Thread (24 messages) flat view 24 messages, 4 authors, 2022-06-16

Re: [FSL P50x0] Keyboard and mouse don't work anymore after the devicetree updates for 5.19

From: Christian Zigotzky <hidden>
Date: 2022-06-16 17:05:49

On 13 June 2022 at 05:57 pm, Rob Herring wrote:
On Thu, Jun 9, 2022 at 12:03 PM Christian Zigotzky
[off-list ref] wrote:
quoted
On 06 June 2022 at 07:06 pm, Rob Herring wrote:
quoted
On Mon, Jun 6, 2022 at 11:14 AM Christian Zigotzky
[off-list ref] wrote:
quoted
On 06 June 2022 at 04:58 pm, Rob Herring wrote:
quoted
On Fri, May 27, 2022 at 9:23 AM Rob Herring [off-list ref] wrote:
quoted
On Fri, May 27, 2022 at 3:33 AM Christian Zigotzky
[off-list ref] wrote:
quoted
On 27 May 2022 at 10:14 am, Prabhakar Mahadev Lad wrote:
quoted
Hi,
quoted
-----Original Message-----
From: Christian Zigotzky <redacted>

On 27 May 2022 at 09:56 am, Prabhakar Mahadev Lad wrote:
quoted
Hi,
quoted
-----Original Message-----
From: Christophe Leroy <redacted>
[...]
quoted
quoted
quoted
quoted
quoted
Looks like the driver which you are using has not been converted to use
platform_get_irq(), could you please check that.
quoted
Cheers,
Prabhakar
Do you mean the mouse and keyboard driver?
No it could be your gpio/pinctrl driver assuming the keyboard/mouse are using GPIO's. If you are using interrupts then it might be some hierarchal irqc driver in drivers/irqchip/.

Cheers,
Prabhakar
Good to know. I only use unmodified drivers from the official Linux
kernel so it's not an issue of the Cyrus+ board.
The issue is in drivers/usb/host/fsl-mph-dr-of.c which copies the
resources to a child platform device. Can you try the following
change:
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index 44a7e58a26e3..47d9b7be60da 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -80,8 +80,6 @@ static struct platform_device *fsl_usb2_device_register(
                                           const char *name, int id)
    {
           struct platform_device *pdev;
-       const struct resource *res = ofdev->resource;
-       unsigned int num = ofdev->num_resources;
           int retval;

           pdev = platform_device_alloc(name, id);
@@ -106,11 +104,7 @@ static struct platform_device *fsl_usb2_device_register(
           if (retval)
                   goto error;

-       if (num) {
-               retval = platform_device_add_resources(pdev, res, num);
-               if (retval)
-                       goto error;
-       }
+       pdev->dev.of_node = ofdev->dev.of_node;
From the log, I think you also need to add this line:
pdev->dev.of_node_reused = true;
quoted
           retval = platform_device_add(pdev);
           if (retval)
Hello Rob,

Thanks a lot for your answer.

Is the following patch correct?
Yes
quoted
--- a/drivers/usb/host/fsl-mph-dr-of.c    2022-05-28 09:10:26.797688422
+0200
+++ b/drivers/usb/host/fsl-mph-dr-of.c    2022-05-28 09:15:01.668594809
+0200
@@ -80,8 +80,6 @@ static struct platform_device *fsl_usb2_
                        const char *name, int id)
    {
        struct platform_device *pdev;
-    const struct resource *res = ofdev->resource;
-    unsigned int num = ofdev->num_resources;
        int retval;

        pdev = platform_device_alloc(name, id);
@@ -106,11 +104,7 @@ static struct platform_device *fsl_usb2_
        if (retval)
            goto error;

-    if (num) {
-        retval = platform_device_add_resources(pdev, res, num);
-        if (retval)
-            goto error;
-    }
+    pdev->dev.of_node = ofdev->dev.of_node;
+    pdev->dev.of_node_reused = true;

        retval = platform_device_add(pdev);
        if (retval)

---
Thanks,
Christian
Hello Rob,

I tested this patch today and unfortunately the issue still exists.
The log is the same?

Rob
Yes, it's the same.

Link: http://www.xenosoft.de/dmesg_FSL_P5040_Void_PPC-2.txt

-- Christian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help