linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christian Zigotzky <chzigotzky@xenosoft.de>
To: Rob Herring <robh@kernel.org>
Cc: Darren Stevens <darren@stevens-zone.net>,
	mad skateman <madskateman@gmail.com>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	"R.T.Dickinson" <rtd2@xtra.co.nz>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Christian Zigotzky <info@xenosoft.de>
Subject: [FSL P50x0] Keyboard and mouse don't work anymore after the devicetree updates for 5.19
Date: Thu, 9 Jun 2022 20:03:04 +0200	[thread overview]
Message-ID: <229b38b6-1a79-259a-e571-2551d80f334d@xenosoft.de> (raw)
In-Reply-To: <CAL_JsqJXXGBcuO+921DNf1yYCbUX4Mv19kQds1rkFM8q8kwxSg@mail.gmail.com>

On 06 June 2022 at 07:06 pm, Rob Herring wrote:
> On Mon, Jun 6, 2022 at 11:14 AM Christian Zigotzky
> <chzigotzky@xenosoft.de> wrote:
>> On 06 June 2022 at 04:58 pm, Rob Herring wrote:
>>> On Fri, May 27, 2022 at 9:23 AM Rob Herring <robh@kernel.org> wrote:
>>>> On Fri, May 27, 2022 at 3:33 AM Christian Zigotzky
>>>> <chzigotzky@xenosoft.de> wrote:
>>>>> On 27 May 2022 at 10:14 am, Prabhakar Mahadev Lad wrote:
>>>>>> Hi,
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: Christian Zigotzky <chzigotzky@xenosoft.de>
>>>>>>>
>>>>>>> On 27 May 2022 at 09:56 am, Prabhakar Mahadev Lad wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>>> -----Original Message-----
>>>>>>>>> From: Christophe Leroy <christophe.leroy@csgroup.eu>
>>> [...]
>>>
>>>>>>>> Looks like the driver which you are using has not been converted to use
>>>>>>> platform_get_irq(), could you please check that.
>>>>>>>> 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;
>>>
>>>>           retval = platform_device_add(pdev);
>>>>           if (retval)
>> Hello Rob,
>>
>> Thanks a lot for your answer.
>>
>> Is the following patch correct?
> Yes
>
>> --- 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.

Do you have another idea?

Thanks,
Christian

Updated patch:

--- a/drivers/usb/host/fsl-mph-dr-of.c  2022-06-06 02:18:54.000000000 +0200
+++ b/drivers/usb/host/fsl-mph-dr-of.c  2022-06-09 19:31:50.135472793 +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);
@@ -105,12 +103,8 @@ static struct platform_device *fsl_usb2_
         retval = platform_device_add_data(pdev, pdata, sizeof(*pdata));
         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)

  reply	other threads:[~2022-06-09 18:04 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26 17:42 [FSL P50x0] Keyboard and mouse don't work anymore after the devicetree updates for 5.19 Christian Zigotzky
2022-05-27  7:23 ` Christophe Leroy
2022-05-27  7:48   ` Christian Zigotzky
2022-05-27  7:54     ` Fwd: " Christian Zigotzky
2022-05-27  7:56   ` Prabhakar Mahadev Lad
2022-05-27  8:06     ` Christian Zigotzky
2022-05-27  8:14       ` Prabhakar Mahadev Lad
2022-05-27  8:32         ` Christian Zigotzky
2022-05-27 14:23           ` Rob Herring
2022-05-28  8:05             ` Christian Zigotzky
2022-05-28  8:44               ` Christophe Leroy
2022-05-28 10:01               ` Christian Zigotzky
2022-05-30  5:26             ` Christian Zigotzky
2022-05-31 13:45               ` Rob Herring
2022-05-31 16:29                 ` Christian Zigotzky
2022-06-01 12:35                   ` Rob Herring
2022-06-04 13:12                     ` Christian Zigotzky
2022-06-01  2:10                 ` Christian Zigotzky
2022-06-06 14:58             ` Rob Herring
2022-06-06 16:13               ` Christian Zigotzky
2022-06-06 17:06                 ` Rob Herring
2022-06-09 18:03                   ` Christian Zigotzky [this message]
2022-06-13 15:57                     ` Rob Herring
2022-06-16 17:04                       ` Christian Zigotzky
  -- strict thread matches above, loose matches on Subject: below --
2022-05-26 17:49 Christian Zigotzky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=229b38b6-1a79-259a-e571-2551d80f334d@xenosoft.de \
    --to=chzigotzky@xenosoft.de \
    --cc=darren@stevens-zone.net \
    --cc=info@xenosoft.de \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=madskateman@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=robh@kernel.org \
    --cc=rtd2@xtra.co.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).