irqchip fixes for 5.16, take #1

- Address an issue with the SiFive PLIC being unable to EOI
   a masked interrupt
 
 - Move the disable/enable methods in the CSky mpintc to
   mask/unmask
 
 - Fix a regression in the OF irq code where an interrupt-controller
   property in the same node as an interrupt-map property would get
   ignored
 -----BEGIN PGP SIGNATURE-----
 
 iQJDBAABCgAtFiEEn9UcU+C1Yxj9lZw9I9DQutE9ekMFAmGOossPHG1hekBrZXJu
 ZWwub3JnAAoJECPQ0LrRPXpDxFQP/im/O8gnxRtyXRJEE8n7i653EpHibO8lfIyU
 johuoKDdFlDHZzq8fW+/ARCzpPsMHvIkgawRPzJ9xCyfldeOzSWRI07dqf8KFBYM
 uLjatzWVovnfkRV3VJRTQ/qGrnpo3yPZV0qP1eB63zMVtAvYcypPE13I3VAtpZKc
 sLC/+7ssV/b+xuIZRDNzMWde+JU9khp+n08iLq4qeSwqTSgzeSXP+E2qROLYHLId
 Ou9mznqDvEb6Lj+Z65qqf2kcZ0LiGT2B2E3L9b8OttaSBaGQ8HVua+8t9n08oeRu
 EBAHLiSv7VqMBvpavJvY24djVhpVSCYvzbQvTUFuEyUzcGy/iDxPHuuWLY81Pns1
 ciPVMJro7NXX5GSgbDDA8QjWcD3n1AdiRWOej/EcXNi97uorxdcvmfSPduKFtjbB
 a1b10XP2cJtalQNJwTCTBSRVVN4/41IkUgAGocbDQZH7wGJH69tO8Dc8MSQaSmT9
 CqTFeeCY+bFE2vtzWyCxKj/DvtalDeauJ3a3l5mSMf+nZyrIGgumJ+O39m0nUV69
 V82AEKKBIO25heVjZCkM0tRkoSz5rSefj43lfRX3sKafQnf8Vp6KpA0qyNxNTZXg
 Ydgu39ttX7aV6AoUMLnAn1pGRVVQjYfatpFez1FWeTeJifLi22jE/gYdv6vUwqzN
 v7LVipxQ
 =27Fe
 -----END PGP SIGNATURE-----

Merge tag 'irqchip-fixes-5.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent

Pull irqchip fixes from Marc Zyngier:

  - Address an issue with the SiFive PLIC being unable to EOI
    a masked interrupt

  - Move the disable/enable methods in the CSky mpintc to
    mask/unmask

  - Fix a regression in the OF irq code where an interrupt-controller
    property in the same node as an interrupt-map property would get
    ignored

Link: https://lore.kernel.org/all/20211112173459.4015233-1-maz@kernel.org
This commit is contained in:
Thomas Gleixner 2021-11-14 13:59:05 +01:00
commit 979292af5b
3 changed files with 27 additions and 8 deletions

View File

@ -78,7 +78,7 @@ static void csky_mpintc_handler(struct pt_regs *regs)
readl_relaxed(reg_base + INTCL_RDYIR));
}
static void csky_mpintc_enable(struct irq_data *d)
static void csky_mpintc_unmask(struct irq_data *d)
{
void __iomem *reg_base = this_cpu_read(intcl_reg);
@ -87,7 +87,7 @@ static void csky_mpintc_enable(struct irq_data *d)
writel_relaxed(d->hwirq, reg_base + INTCL_SENR);
}
static void csky_mpintc_disable(struct irq_data *d)
static void csky_mpintc_mask(struct irq_data *d)
{
void __iomem *reg_base = this_cpu_read(intcl_reg);
@ -164,8 +164,8 @@ static int csky_irq_set_affinity(struct irq_data *d,
static struct irq_chip csky_irq_chip = {
.name = "C-SKY SMP Intc",
.irq_eoi = csky_mpintc_eoi,
.irq_enable = csky_mpintc_enable,
.irq_disable = csky_mpintc_disable,
.irq_unmask = csky_mpintc_unmask,
.irq_mask = csky_mpintc_mask,
.irq_set_type = csky_mpintc_set_type,
#ifdef CONFIG_SMP
.irq_set_affinity = csky_irq_set_affinity,

View File

@ -163,7 +163,13 @@ static void plic_irq_eoi(struct irq_data *d)
{
struct plic_handler *handler = this_cpu_ptr(&plic_handlers);
writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM);
if (irqd_irq_masked(d)) {
plic_irq_unmask(d);
writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM);
plic_irq_mask(d);
} else {
writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM);
}
}
static struct irq_chip plic_chip = {

View File

@ -161,9 +161,10 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
* if it is then we are done, unless there is an
* interrupt-map which takes precedence.
*/
bool intc = of_property_read_bool(ipar, "interrupt-controller");
imap = of_get_property(ipar, "interrupt-map", &imaplen);
if (imap == NULL &&
of_property_read_bool(ipar, "interrupt-controller")) {
if (imap == NULL && intc) {
pr_debug(" -> got it !\n");
return 0;
}
@ -244,8 +245,20 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
pr_debug(" -> imaplen=%d\n", imaplen);
}
if (!match)
if (!match) {
if (intc) {
/*
* The PASEMI Nemo is a known offender, so
* let's only warn for anyone else.
*/
WARN(!IS_ENABLED(CONFIG_PPC_PASEMI),
"%pOF interrupt-map failed, using interrupt-controller\n",
ipar);
return 0;
}
goto fail;
}
/*
* Successfully parsed an interrrupt-map translation; copy new