2019-08-22 15:03:08

by Federico Vaga

[permalink] [raw]
Subject: [PATCH] i2c: ocores: use request_any_context_irq() to register IRQ handler

The i2c-ocores device is an HDL component that get instantiated in FPGA.
The software stack used to drive an FPGA can be very different, and the
i2c-ocore ip-core must work in different context. With respect to this
patch the IRQ controller behind this device, and its driver, can have
different implementations (nested threads). For this reason, it is safer
to use `request_any_context_irq()` to avoid errors at probe time.

Signed-off-by: Federico Vaga <[email protected]>
---
drivers/i2c/busses/i2c-ocores.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index 4117f1abc7c6..ca8b3ecfa93d 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -703,8 +703,9 @@ static int ocores_i2c_probe(struct platform_device *pdev)
}

if (ocores_algorithm.master_xfer != ocores_xfer_polling) {
- ret = devm_request_irq(&pdev->dev, irq, ocores_isr, 0,
- pdev->name, i2c);
+ ret = devm_request_any_context_irq(&pdev->dev, irq,
+ ocores_isr, 0,
+ pdev->name, i2c);
if (ret) {
dev_err(&pdev->dev, "Cannot claim IRQ\n");
goto err_clk;
--
2.15.0


2019-08-22 15:23:15

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH] i2c: ocores: use request_any_context_irq() to register IRQ handler

On Thu, Aug 22, 2019 at 03:21:32PM +0200, Federico Vaga wrote:
> The i2c-ocores device is an HDL component that get instantiated in FPGA.
> The software stack used to drive an FPGA can be very different, and the
> i2c-ocore ip-core must work in different context. With respect to this
> patch the IRQ controller behind this device, and its driver, can have
> different implementations (nested threads). For this reason, it is safer
> to use `request_any_context_irq()` to avoid errors at probe time.
>
> Signed-off-by: Federico Vaga <[email protected]>

Reviewed-by: Andrew Lunn <[email protected]>

Andrew

2019-08-22 17:11:52

by Peter Korsgaard

[permalink] [raw]
Subject: Re: [PATCH] i2c: ocores: use request_any_context_irq() to register IRQ handler

>>>>> "Federico" == Federico Vaga <[email protected]> writes:

> The i2c-ocores device is an HDL component that get instantiated in FPGA.
> The software stack used to drive an FPGA can be very different, and the
> i2c-ocore ip-core must work in different context. With respect to this
> patch the IRQ controller behind this device, and its driver, can have
> different implementations (nested threads). For this reason, it is safer
> to use `request_any_context_irq()` to avoid errors at probe time.

> Signed-off-by: Federico Vaga <[email protected]>

Reviewed-by: Peter Korsgaard <[email protected]>

--
Bye, Peter Korsgaard

2019-08-29 20:13:53

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH] i2c: ocores: use request_any_context_irq() to register IRQ handler

On Thu, Aug 22, 2019 at 03:21:32PM +0200, Federico Vaga wrote:
> The i2c-ocores device is an HDL component that get instantiated in FPGA.
> The software stack used to drive an FPGA can be very different, and the
> i2c-ocore ip-core must work in different context. With respect to this
> patch the IRQ controller behind this device, and its driver, can have
> different implementations (nested threads). For this reason, it is safer
> to use `request_any_context_irq()` to avoid errors at probe time.
>
> Signed-off-by: Federico Vaga <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (601.00 B)
signature.asc (849.00 B)
Download all attachments