In cascade mode interrupt line is shared among both switches.
Update global interrupt flag for shared interrupt, otherwise second
switch probe will fail with busy status.
Signed-off-by: Rakesh Sankaranarayanan <rakesh.sankaranarayanan@microchip.com>
---
drivers/net/dsa/microchip/ksz_common.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
On Thu, Feb 02, 2023 at 06:29:24PM +0530, Rakesh Sankaranarayanan wrote:
> In cascade mode interrupt line is shared among both switches.
I assume this is specific to the board you are using. Other boards
could have two interrupts. It should not cause a problem marking it a
shared, but please update the commit message to indicate that the
interrupts don't need to be shared.
Andrew
@@ -2009,7 +2009,8 @@ static irqreturn_t ksz_irq_thread_fn(int irq, void *dev_id)
return (nhandled > 0 ? IRQ_HANDLED : IRQ_NONE);
}
-static int ksz_irq_common_setup(struct ksz_device *dev, struct ksz_irq *kirq)
+static int ksz_irq_common_setup(struct ksz_device *dev, struct ksz_irq *kirq,
+ unsigned long flag)
{
int ret, n;
@@ -2025,7 +2026,7 @@ static int ksz_irq_common_setup(struct ksz_device *dev, struct ksz_irq *kirq)
irq_create_mapping(kirq->domain, n);
ret = request_threaded_irq(kirq->irq_num, NULL, ksz_irq_thread_fn,
- IRQF_ONESHOT, kirq->name, kirq);
+ flag, kirq->name, kirq);
if (ret)
goto out;
@@ -2048,7 +2049,7 @@ static int ksz_girq_setup(struct ksz_device *dev)
girq->irq_num = dev->irq;
- return ksz_irq_common_setup(dev, girq);
+ return ksz_irq_common_setup(dev, girq, (IRQF_ONESHOT | IRQF_SHARED));
}
static int ksz_pirq_setup(struct ksz_device *dev, u8 p)
@@ -2064,7 +2065,7 @@ static int ksz_pirq_setup(struct ksz_device *dev, u8 p)
if (pirq->irq_num < 0)
return pirq->irq_num;
- return ksz_irq_common_setup(dev, pirq);
+ return ksz_irq_common_setup(dev, pirq, IRQF_ONESHOT);
}
static int ksz_setup(struct dsa_switch *ds)