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: Re: [FSL P50x0] Keyboard and mouse don't work anymore after the devicetree updates for 5.19
Date: Sat, 28 May 2022 12:01:18 +0200	[thread overview]
Message-ID: <ea464a1d-407d-7a30-16f8-3efd32eca039@xenosoft.de> (raw)
In-Reply-To: <f2945a3f-04c6-9685-3193-62d02e6453b8@xenosoft.de>

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

On 28 May 2022 at 10:05 am, Christian Zigotzky wrote:
> On 27 May 2022 at 04:23 am, Rob Herring wrote:
>> 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;
>>
>>          retval = platform_device_add(pdev);
>>          if (retval)
> Hi Rob,
>
> Thanks a lot for your patch! :-)
>
> First attempt with the latest git kernel:
>
> patching file a/drivers/usb/host/fsl-mph-dr-of.c
> Hunk #1 FAILED at 80.
> Hunk #2 FAILED at 106.
> 2 out of 2 hunks FAILED -- saving rejects to file 
> a/drivers/usb/host/fsl-mph-dr-of.c.rej
>
> I created a new patch with your modifications. (see attachment)
>
> Unfortunately I can't test it. The git kernel doesn't compile currently.
>
> powerpc-linux-gnu-ld: net/rds/tcp_stats.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/wireless/wext-spy.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/wireless/wext-priv.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/bcast.o:(.bss+0x0): multiple definition 
> of `____cacheline_aligned'; init/version.o:(.bss+0x0): first defined here
> powerpc-linux-gnu-ld: net/tipc/bearer.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/core.o:(.bss+0x0): multiple definition 
> of `____cacheline_aligned'; init/version.o:(.bss+0x0): first defined here
> powerpc-linux-gnu-ld: net/tipc/link.o:(.bss+0x0): multiple definition 
> of `____cacheline_aligned'; init/version.o:(.bss+0x0): first defined here
> powerpc-linux-gnu-ld: net/tipc/discover.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/msg.o:(.bss+0x0): multiple definition 
> of `____cacheline_aligned'; init/version.o:(.bss+0x0): first defined here
> powerpc-linux-gnu-ld: net/tipc/name_distr.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/subscr.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/name_table.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/net.o:(.bss+0x0): multiple definition 
> of `____cacheline_aligned'; init/version.o:(.bss+0x0): first defined here
> powerpc-linux-gnu-ld: net/tipc/netlink.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/netlink_compat.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/node.o:(.bss+0x0): multiple definition 
> of `____cacheline_aligned'; init/version.o:(.bss+0x0): first defined here
> powerpc-linux-gnu-ld: net/tipc/eth_media.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/topsrv.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/group.o:(.bss+0x0): multiple definition 
> of `____cacheline_aligned'; init/version.o:(.bss+0x0): first defined here
> powerpc-linux-gnu-ld: net/tipc/trace.o:(.bss+0x0): multiple definition 
> of `____cacheline_aligned'; init/version.o:(.bss+0x0): first defined here
> powerpc-linux-gnu-ld: net/tipc/udp_media.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/sysctl.o:(.bss+0x40): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/crypto.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/tipc/diag.o:(.bss+0x0): multiple definition 
> of `____cacheline_aligned'; init/version.o:(.bss+0x0): first defined here
> powerpc-linux-gnu-ld: net/9p/trans_common.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/9p/trans_virtio.o:(.bss+0x40): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/6lowpan/ndisc.o:(.bss+0x0): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> powerpc-linux-gnu-ld: net/sysctl_net.o:(.bss+0x80): multiple 
> definition of `____cacheline_aligned'; init/version.o:(.bss+0x0): 
> first defined here
> make: *** [Makefile:1160: vmlinux] Error 1
>
> @All
> Could you please check the multiple definition of 
> `____cacheline_aligned'?
>
> Thanks,
> Christian
>
Fix at
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220527112035.2842155-1-mpe@ellerman.id.au/

Christophe

------

Thank you for your hint. It compiles with the paca.patch.

@Rob
Unfortunately with your modifications I get a boot loop.

I compiled it also with the reverting patch (see attachment) and then it 
boots and works.

Thanks,
Christian

[-- Attachment #2: of.patch --]
[-- Type: text/plain, Size: 1272 bytes --]

--- a/drivers/of/platform.c	2022-05-26 18:46:15.551656025 +0200
+++ b/drivers/of/platform.c	2022-05-22 21:52:31.000000000 +0200
@@ -114,31 +114,35 @@ struct platform_device *of_device_alloc(
 				  struct device *parent)
 {
 	struct platform_device *dev;
-	int rc, i, num_reg = 0;
+	int rc, i, num_reg = 0, num_irq;
 	struct resource *res, temp_res;
 
 	dev = platform_device_alloc("", PLATFORM_DEVID_NONE);
 	if (!dev)
 		return NULL;
 
-	/* count the io resources */
+	/* count the io and irq resources */
 	while (of_address_to_resource(np, num_reg, &temp_res) == 0)
 		num_reg++;
+	num_irq = of_irq_count(np);
 
 	/* Populate the resource table */
-	if (num_reg) {
-		res = kcalloc(num_reg, sizeof(*res), GFP_KERNEL);
+	if (num_irq || num_reg) {
+		res = kcalloc(num_irq + num_reg, sizeof(*res), GFP_KERNEL);
 		if (!res) {
 			platform_device_put(dev);
 			return NULL;
 		}
 
-		dev->num_resources = num_reg;
+		dev->num_resources = num_reg + num_irq;
 		dev->resource = res;
 		for (i = 0; i < num_reg; i++, res++) {
 			rc = of_address_to_resource(np, i, res);
 			WARN_ON(rc);
 		}
+		if (of_irq_to_resource_table(np, res, num_irq) != num_irq)
+			pr_debug("not all legacy IRQ resources mapped for %pOFn\n",
+				 np);
 	}
 
 	dev->dev.of_node = of_node_get(np);

  parent reply	other threads:[~2022-05-28 10:02 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 [this message]
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
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=ea464a1d-407d-7a30-16f8-3efd32eca039@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).