Skip to contentSkip to conversation

drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode.

PATCH In review Darren Stevens 4 participants 4 messages Jul 2, 2022 – Jul 5, 2022

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

PATCH v3 1/1 drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode.

In patch a1a2b7125e10 (Drop static setup of IRQ resource from DT core) we stopped platform_get_resource() from returning the IRQ, as all drivers were supposed to have switched to platform_get_irq() Unfortunately the Freescale EHCI driver in host mode got missed. Fix it.

Fixes a1a2b7125e10 (Drop static setup of IRQ resource from DT core)

---
v3 - Corrected resource allocation in fsl-mph-dr-of.c

v2 - Fixed coding style, removed a couple of unneeded initializations,
cc'd Layerscape maintainers.

Tested on AmigaOne X5000/20 and X5000/40 Contains code by Rob Herring (in fsl-mph-dr-of.c)

drivers/usb/host/ehci-fsl.c +3 -8
index 385be30..896c0d1 100644
@@ -76,14 +76,9 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!res) {
-		dev_err(&pdev->dev,
-			"Found HC with no IRQ. Check %s setup!\n",
-			dev_name(&pdev->dev));
-		return -ENODEV;
-	}
-	irq = res->start;
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
 
 	hcd = __usb_create_hcd(&fsl_ehci_hc_driver, pdev->dev.parent,
 			       &pdev->dev, dev_name(&pdev->dev), NULL);
drivers/usb/host/fsl-mph-dr-of.c +3 -0
index 44a7e58..e5df175 100644
@@ -112,6 +112,9 @@ static struct platform_device *fsl_usb2_device_register(
 			goto error;
 	}
 
+	pdev->dev.of_node = ofdev->dev.of_node;
+	pdev->dev.of_node_reused = true;
+
 	retval = platform_device_add(pdev);
 	if (retval)
 		goto error;
Tested-by on v3 1/1
#1 lore raw
Quoted 46 lines · Darren Stevens

In patch a1a2b7125e10 (Drop static setup of IRQ resource from DT core) we stopped platform_get_resource() from returning the IRQ, as all drivers were supposed to have switched to platform_get_irq() Unfortunately the Freescale EHCI driver in host mode got missed. Fix it.

Fixes a1a2b7125e10 (Drop static setup of IRQ resource from DT core)

---
v3 - Corrected resource allocation in fsl-mph-dr-of.c

v2 - Fixed coding style, removed a couple of unneeded initializations,
cc'd Layerscape maintainers.

Tested on AmigaOne X5000/20 and X5000/40 Contains code by Rob Herring (in fsl-mph-dr-of.c)

drivers/usb/host/ehci-fsl.c +3 -8
index 385be30..896c0d1 100644
@@ -76,14 +76,9 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev)
  		return -ENODEV;
  	}
 
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!res) {
-		dev_err(&pdev->dev,
-			"Found HC with no IRQ. Check %s setup!\n",
-			dev_name(&pdev->dev));
-		return -ENODEV;
-	}
-	irq = res->start;
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
 
  	hcd = __usb_create_hcd(&fsl_ehci_hc_driver, pdev->dev.parent,
  			       &pdev->dev, dev_name(&pdev->dev), NULL);
drivers/usb/host/fsl-mph-dr-of.c +0 -0
index 44a7e58..e5df175 100644

drivers/usb/host/fsl-mph-dr-of.c static struct platform_device *fsl_usb2_device_register( · line 120

Quoted 9 lines
drivers/usb/host/fsl-mph-dr-of.c +3 -0
@@ -112,6 +112,9 @@ static struct platform_device *fsl_usb2_device_register(
  			goto error;
  	}
 
+	pdev->dev.of_node = ofdev->dev.of_node;
+	pdev->dev.of_node_reused = true;
+
  	retval = platform_device_add(pdev);
  	if (retval)
  		goto error;

Hello,

I patched the RC5 of kernel 5.19 with this patch and I can confirm, that my keyboard and mouse work without any problems.

Please accept this patch.

Thanks,
Christian

Acked-by on v3 1/1
#2 lore raw
In reply to Darren Stevens
Quoted 11 lines · Darren Stevens

In patch a1a2b7125e10 (Drop static setup of IRQ resource from DT core) we stopped platform_get_resource() from returning the IRQ, as all drivers were supposed to have switched to platform_get_irq() Unfortunately the Freescale EHCI driver in host mode got missed. Fix it.

Fixes a1a2b7125e10 (Drop static setup of IRQ resource from DT core)
Quoted 8 lines

---
v3 - Corrected resource allocation in fsl-mph-dr-of.c

v2 - Fixed coding style, removed a couple of unneeded initializations,
cc'd Layerscape maintainers.

Tested on AmigaOne X5000/20 and X5000/40 Contains code by Rob Herring (in fsl-mph-dr-of.c)

Thanks for fixing.

maintainer Acked-by
#3 lore raw
Quoted 18 lines · Rob Herring
Quoted 17 lines · Darren Stevens

In patch a1a2b7125e10 (Drop static setup of IRQ resource from DT core) we stopped platform_get_resource() from returning the IRQ, as all drivers were supposed to have switched to platform_get_irq() Unfortunately the Freescale EHCI driver in host mode got missed. Fix it.

Fixes a1a2b7125e10 (Drop static setup of IRQ resource from DT core)

---
v3 - Corrected resource allocation in fsl-mph-dr-of.c

v2 - Fixed coding style, removed a couple of unneeded initializations,
cc'd Layerscape maintainers.

Quoted 6 lines
Quoted 2 lines

Tested on AmigaOne X5000/20 and X5000/40 Contains code by Rob Herring (in fsl-mph-dr-of.c)

Thanks for fixing.

Okay for me too.