lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <85b28900-5f42-b997-2ded-0b952bc2a03e@huawei.com>
Date:   Fri, 27 Aug 2021 22:38:28 +0800
From:   Kefeng Wang <wangkefeng.wang@...wei.com>
To:     Saravana Kannan <saravanak@...gle.com>
CC:     Rob Herring <robh+dt@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Frank Rowand <frowand.list@...il.com>,
        <devicetree@...r.kernel.org>, Russell King <linux@...linux.org.uk>,
        "Linus Walleij" <linus.walleij@...aro.org>,
        linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        <linux-input@...r.kernel.org>
Subject: Re: [BUG] amba: Remove deferred device addition


On 2021/8/27 8:04, Saravana Kannan wrote:
> On Thu, Aug 26, 2021 at 1:22 AM Kefeng Wang <wangkefeng.wang@...wei.com> wrote:
>>
>>>>> Btw, I've been working on [1] cleaning up the one-off deferred probe
>>>>> solution that we have for amba devices. That causes a bunch of other
>>>>> headaches. Your patch 3/3 takes us further in the wrong direction by
>>>>> adding more reasons for delaying the addition of the device.
>> Hi Saravana, I try the link[1], but with it, there is a crash when boot
>> (qemu-system-arm -M vexpress-a15),
> Hi,
>
> It's hard to make sense of the logs. Looks like two different threads
> might be printing to the log at the same time? Can you please enable
> the config that prints the thread ID (forgot what it's called) and
> collect this again? With what I could tell the crash seems to be
> happening somewhere in platform_match(), but that's not related to
> this patch at all?

Can you reproduce it? it is very likely related(without your patch, the 
boot is fine),

the NULL ptr is about serio, it is registed from amba driver.

ambakmi_driver_init

  -- amba_kmi_probe

    -- __serio_register_port

> -Saravana

+Dmitry and input maillist, is there some known issue about serio ?

I add some debug, the full log is attached.

[    2.958355][   T41] input: AT Raw Set 2 keyboard as 
/devices/platform/bus@...0000/bus@...0000:motherboard-bus/bus@...0000:motherboard-bus:iofpga-bus@...000000/1c060000.kmi/serio0/input/input0
[    2.977441][   T41] serio serio1: pdev c1e05508, pdev->name (null), 
drv c1090fc0, drv->name vexpress-reset
[    2.977928][   T41] 8<--- cut here ---
[    2.978162][   T41] Unhandled fault: page domain fault (0x01b) at 
0x00000000
[    2.978494][   T41] pgd = (ptrval)
[    2.978819][   T41] [00000000] *pgd=00000000
[    2.979881][   T41] Internal error: : 1b [#1] SMP ARM
[    2.980385][   T41] Modules linked in:
[    2.980810][   T41] CPU: 0 PID: 41 Comm: kworker/0:2 Not tainted 
5.14.0-rc7+ #213
[    2.981229][   T41] Hardware name: ARM-Versatile Express
[    2.981780][   T41] Workqueue: events_long serio_handle_event
[    2.982737][   T41] PC is at strcmp+0x18/0x44
[    2.983030][   T41] LR is at platform_match+0xdc/0xf0
[    2.983283][   T41] pc : [<c0560bcc>]    lr : [<c0646358>]    psr: 
600b0013
[    2.983572][   T41] sp : c1675d68  ip : c1675d78  fp : c1675d74
[    2.983832][   T41] r10: 00000000  r9 : 00000000  r8 : 00000001
[    2.984095][   T41] r7 : c1e05518  r6 : c1675df4  r5 : c1e05518  r4 : 
c1090fc0
[    2.984395][   T41] r3 : c0a5e180  r2 : 6bede3db  r1 : c0b82a04  r0 : 
00000000
[    2.984906][   T41] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32 ISA 
ARM  Segment none
[    2.985273][   T41] Control: 10c5387d  Table: 81e0806a  DAC: 00000051
[    2.985598][   T41] Register r0 information: NULL pointer
[    2.986045][   T41] Register r1 information: non-slab/vmalloc memory
[    2.986444][   T41] Register r2 information: non-paged memory
[    2.986724][   T41] Register r3 information: non-slab/vmalloc memory
[    2.987010][   T41] Register r4 information: non-slab/vmalloc memory
[    2.987300][   T41] Register r5 information: slab kmalloc-1k start 
c1e05400 pointer offset 280 size 1024
[    2.988215][   T41] Register r6 information: non-slab/vmalloc memory
[    2.988507][   T41] Register r7 information: slab kmalloc-1k start 
c1e05400 pointer offset 280 size 1024
[    2.988975][   T41] Register r8 information: non-paged memory
[    2.989240][   T41] Register r9 information: NULL pointer
[    2.989486][   T41] Register r10 information: NULL pointer
[    2.989733][   T41] Register r11 information: non-slab/vmalloc memory
[    2.990014][   T41] Register r12 information: non-slab/vmalloc memory
[    2.990333][   T41] Process kworker/0:2 (pid: 41, stack limit = 
0x(ptrval))
[    2.990696][   T41] Stack: (0xc1675d68 to 0xc1676000)
[    2.991194][   T41] 5d60:                   c1675d9c c1675d78 
c0646358 c0560bc0 c1090fc0 c0b82a04
[    2.991788][   T41] 5d80: 200b0013 00000000 c1090fc0 c1675df4 
c1675dbc c1675da0 c06437d4 c0646288
[    2.992363][   T41] 5da0: 00000000 c1675df4 c0643798 c0d04d08 
c1675dec c1675dc0 c0641180 c06437a4
[    2.992932][   T41] 5dc0: c1675dec c16bfa6c c1dedab8 6bede3db 
c0d04d08 c1e05518 c1e0555c c13ab800
[    2.993501][   T41] 5de0: c1675e24 c1675df0 c0642f40 c0641124 
c1675e44 c1e05518 00000001 6bede3db
[    2.994066][   T41] 5e00: 00000000 c1e05518 c108ea84 c1e05518 
c13ab800 c10843a0 c1675e34 c1675e28
[    2.994657][   T41] 5e20: c06439d4 c0642e5c c1675e54 c1675e38 
c0642030 c06439c4 c1e05518 00000000
[    2.995238][   T41] 5e40: c0d04d08 c13ab800 c1675eb4 c1675e58 
c063f9cc c0641fa8 c13a5180 c1de98c0
[    2.995806][   T41] 5e60: eee3bd20 c1201180 c071c0f0 c11ea558 
c0b7f404 c0b7f430 c1675eb4 c1675e88
[    2.996382][   T41] 5e80: c02e6410 6bede3db 00000001 c1de938c 
c1e05400 c108ea54 c1de9380 c11ea558
[    2.996950][   T41] 5ea0: c0b7f404 c0b7f430 c1675ef4 c1675eb8 
c071c1cc c063f5d0 c0923528 c0158300
[    2.997523][   T41] 5ec0: 00000000 c1e05518 c1675ef4 c108ea70 
c1702f80 effc4400 effc7700 00000000
[    2.998098][   T41] 5ee0: 00000000 c10b2580 c1675f34 c1675ef8 
c01475a4 c071c020 c13a5100 ffffe000
[    2.998664][   T41] 5f00: c1675f1c c1675f10 c0149250 c1702f80 
effc4400 c1702f94 effc4418 ffffe000
[    2.999239][   T41] 5f20: 00000008 c0d03d00 c1675f74 c1675f38 
c014795c c0147378 c1617e74 c0b0c298
[    2.999805][   T41] 5f40: c10b1d2a effc4400 c1675f74 c1706b80 
c1706a80 c0147900 c1702f80 00000000
[    3.000380][   T41] 5f60: c1617e74 c1674000 c1675fac c1675f78 
c014feb4 c014790c c1706ba4 c1706ba4
[    3.000947][   T41] 5f80: c1675fac c1706a80 c014fd3c 00000000 
00000000 00000000 00000000 00000000
[    3.001519][   T41] 5fa0: 00000000 c1675fb0 c0100150 c014fd48 
00000000 00000000 00000000 00000000
[    3.002093][   T41] 5fc0: 00000000 00000000 00000000 00000000 
00000000 00000000 00000000 00000000
[    3.002658][   T41] 5fe0: 00000000 00000000 00000000 00000000 
00000013 00000000 00000000 00000000
[    3.003113][   T41] Backtrace:
[    3.003451][   T41] [<c0560bb4>] (strcmp) from [<c0646358>] 
(platform_match+0xdc/0xf0)
[    3.003963][   T41] [<c064627c>] (platform_match) from [<c06437d4>] 
(__device_attach_driver+0x3c/0xf4)
[    3.004408][   T41]  r6:c1675df4 r5:c1090fc0 r4:00000000
[    3.004769][   T41] [<c0643798>] (__device_attach_driver) from 
[<c0641180>] (bus_for_each_drv+0x68/0xc8)
[    3.005218][   T41]  r7:c0d04d08 r6:c0643798 r5:c1675df4 r4:00000000
[    3.005481][   T41] [<c0641118>] (bus_for_each_drv) from [<c0642f40>] 
(__device_attach+0xf0/0x16c)
[    3.005885][   T41]  r7:c13ab800 r6:c1e0555c r5:c1e05518 r4:c0d04d08
[    3.006152][   T41] [<c0642e50>] (__device_attach) from [<c06439d4>] 
(device_initial_probe+0x1c/0x20)
[    3.006560][   T41]  r8:c10843a0 r7:c13ab800 r6:c1e05518 r5:c108ea84 
r4:c1e05518
[    3.006853][   T41] [<c06439b8>] (device_initial_probe) from 
[<c0642030>] (bus_probe_device+0x94/0x9c)
[    3.007259][   T41] [<c0641f9c>] (bus_probe_device) from [<c063f9cc>] 
(device_add+0x408/0x8b8)
[    3.007644][   T41]  r7:c13ab800 r6:c0d04d08 r5:00000000 r4:c1e05518
[    3.007900][   T41] [<c063f5c4>] (device_add) from [<c071c1cc>] 
(serio_handle_event+0x1b8/0x234)
[    3.008320][   T41]  r10:c0b7f430 r9:c0b7f404 r8:c11ea558 r7:c1de9380 
r6:c108ea54 r5:c1e05400
[    3.008667][   T41]  r4:c1de938c
[    3.008824][   T41] [<c071c014>] (serio_handle_event) from 
[<c01475a4>] (process_one_work+0x238/0x594)
[    3.009253][   T41]  r10:c10b2580 r9:00000000 r8:00000000 r7:effc7700 
r6:effc4400 r5:c1702f80
[    3.009583][   T41]  r4:c108ea70
[    3.009737][   T41] [<c014736c>] (process_one_work) from [<c014795c>] 
(worker_thread+0x5c/0x5f4)
[    3.010145][   T41]  r10:c0d03d00 r9:00000008 r8:ffffe000 r7:effc4418 
r6:c1702f94 r5:effc4400
[    3.010478][   T41]  r4:c1702f80
[    3.010638][   T41] [<c0147900>] (worker_thread) from [<c014feb4>] 
(kthread+0x178/0x194)
[    3.011008][   T41]  r10:c1674000 r9:c1617e74 r8:00000000 r7:c1702f80 
r6:c0147900 r5:c1706a80
[    3.011342][   T41]  r4:c1706b80
[    3.011496][   T41] [<c014fd3c>] (kthread) from [<c0100150>] 
(ret_from_fork+0x14/0x24)
[    3.011860][   T41] Exception stack(0xc1675fb0 to 0xc1675ff8)
[    3.012213][   T41] 5fa0: 00000000 00000000 00000000 00000000
[    3.012780][   T41] 5fc0: 00000000 00000000 00000000 00000000 
00000000 00000000 00000000 00000000
[    3.013311][   T41] 5fe0: 00000000 00000000 00000000 00000000 
00000013 00000000
[    3.013684][   T41]  r10:00000000 r9:00000000 r8:00000000 r7:00000000 
r6:00000000 r5:c014fd3c
[    3.014024][   T41]  r4:c1706a80
[    3.014646][   T41] Code: e24cb004 ea000001 e3530000 0a000006 (e4d03001)
[    3.015468][   T41] ---[ end trace ff98706550126357 ]---
[    3.015897][   T41] Kernel panic - not syncing: Fatal exception
[    3.032519][   T41] ---[ end Kernel panic - not syncing: Fatal 
exception ]---

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 836d6d23bba3..883a58c658c2 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -237,6 +237,7 @@ static int amba_match(struct device *dev, struct 
device_driver *drv)

         if (!pcdev->periphid) {
                 int ret = amba_read_periphid(pcdev);
+               dev_info(dev, "%s, amba_read_periphid ret = %d\n", 
__func__, ret);

                 if (ret)
                         return ret;
@@ -522,6 +523,7 @@ int amba_device_add(struct amba_device *dev, struct 
resource *parent)
         /* If primecell ID isn't hard-coded, figure it out */
         if (!dev->periphid) {
                 ret = amba_read_periphid(dev);
+               dev_info(&dev->dev, "%s, amba_read_periphid ret = %d\n", 
__func__, ret);
                 if (ret && ret != -EPROBE_DEFER)
                         goto err_release;
                 /*
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 8640578f45e9..f7c1933c56b5 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -1360,6 +1360,7 @@ static int platform_match(struct device *dev, 
struct device_driver *drv)
         struct platform_device *pdev = to_platform_device(dev);
         struct platform_driver *pdrv = to_platform_driver(drv);

+       dev_info(dev, "pdev %px, pdev->name %s, drv %px, drv->name %s", 
pdev, pdev->name, drv, drv->name);
         /* When driver_override is set, only bind to the matching driver */
         if (pdev->driver_override)
                 return !strcmp(pdev->driver_override, drv->name);


> [1] - https://lore.kernel.org/lkml/CAGETcx8b228nDUho3cX9AAQ-pXOfZTMv8cj2vhdx9yc_pk8q+A@mail.gmail.com/
> .
>
>>> .
>>>
> .
>

View attachment "amba-change.log" of type "text/plain" (231666 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ