Skip to contentSkip to conversation

i2c: ocores: use request_any_context_irq() to register IRQ handler

PATCH Applied Federico Vaga 4 participants 4 messages Aug 22, 2019 – Aug 29, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/i2c/busses/i2c-ocores.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-ocores.c +3 -2
index 4117f1abc7c6..ca8b3ecfa93d 100644
@@ -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;
Signature · 1 line
2.15.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · 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.

Andrew

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Federico Vaga
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"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.

Signature · 1 line
Bye, Peter Korsgaard
Applied
#3 lore raw
In reply to Federico Vaga
Quoted 8 lines · 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.

Applied to for-next, thanks!