All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: ocores: use request_any_context_irq() to register IRQ handler
@ 2019-08-22 13:21 ` Federico Vaga
  0 siblings, 0 replies; 6+ messages in thread
From: Federico Vaga @ 2019-08-22 13:21 UTC (permalink / raw)
  To: Andrew Lunn, Peter Korsgaard; +Cc: linux-i2c, linux-kernel, Federico Vaga

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 <federico.vaga@cern.ch>
---
 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] i2c: ocores: use request_any_context_irq() to register IRQ handler
@ 2019-08-22 13:21 ` Federico Vaga
  0 siblings, 0 replies; 6+ messages in thread
From: Federico Vaga @ 2019-08-22 13:21 UTC (permalink / raw)
  To: Andrew Lunn, Peter Korsgaard; +Cc: linux-i2c, linux-kernel, Federico Vaga

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 <federico.vaga@cern.ch>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] i2c: ocores: use request_any_context_irq() to register IRQ handler
  2019-08-22 13:21 ` Federico Vaga
  (?)
@ 2019-08-22 13:48 ` Andrew Lunn
  -1 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2019-08-22 13:48 UTC (permalink / raw)
  To: Federico Vaga; +Cc: Peter Korsgaard, linux-i2c, linux-kernel

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 <federico.vaga@cern.ch>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] i2c: ocores: use request_any_context_irq() to register IRQ handler
  2019-08-22 13:21 ` Federico Vaga
@ 2019-08-22 14:13   ` Peter Korsgaard
  -1 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2019-08-22 14:13 UTC (permalink / raw)
  To: Federico Vaga; +Cc: Andrew Lunn, linux-i2c, linux-kernel

>>>>> "Federico" == Federico Vaga <federico.vaga@cern.ch> 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 <federico.vaga@cern.ch>

Reviewed-by: Peter Korsgaard <peter@korsgaard.com>

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] i2c: ocores: use request_any_context_irq() to register IRQ handler
@ 2019-08-22 14:13   ` Peter Korsgaard
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2019-08-22 14:13 UTC (permalink / raw)
  To: Federico Vaga; +Cc: Andrew Lunn, linux-i2c, linux-kernel

>>>>> "Federico" == Federico Vaga <federico.vaga@cern.ch> 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 <federico.vaga@cern.ch>

Reviewed-by: Peter Korsgaard <peter@korsgaard.com>

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] i2c: ocores: use request_any_context_irq() to register IRQ handler
  2019-08-22 13:21 ` Federico Vaga
                   ` (2 preceding siblings ...)
  (?)
@ 2019-08-29 20:12 ` Wolfram Sang
  -1 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2019-08-29 20:12 UTC (permalink / raw)
  To: Federico Vaga; +Cc: Andrew Lunn, Peter Korsgaard, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 601 bytes --]

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 <federico.vaga@cern.ch>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-29 20:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-22 13:21 [PATCH] i2c: ocores: use request_any_context_irq() to register IRQ handler Federico Vaga
2019-08-22 13:21 ` Federico Vaga
2019-08-22 13:48 ` Andrew Lunn
2019-08-22 14:13 ` Peter Korsgaard
2019-08-22 14:13   ` Peter Korsgaard
2019-08-29 20:12 ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.