stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Linux 4.5-rc2
       [not found] <CA+55aFwpEs_=7DRRkVuROCboPD4evk2ZV4S40C2B5tO9koEyhw@mail.gmail.com>
@ 2016-02-01 19:08 ` Heinz Diehl
  2016-02-01 20:41   ` Greg KH
  2016-02-01 20:46   ` Linus Torvalds
  0 siblings, 2 replies; 5+ messages in thread
From: Heinz Diehl @ 2016-02-01 19:08 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, stable

Hi,

On 01.02.2016, Linus Torvalds wrote: 

> Go forth and test,
> 
>                  Linus

Still, some Asus laptops are hanging at boot-time, both with latest
-stable and 4.5-rc1/rc2:

[    4.056862] asus_laptop:    model detected
[    4.058731] BUG: unable to handle kernel NULL pointer dereference at 0000000000000e20
[    4.060018] IP: [<ffffffffc03d3423>] asus_sysfs_is_visible+0x13/0x1d0 [asus_laptop]
[    4.061346] PGD 0
[    4.062629] Oops: 0000 [#1] PREEMPT SMP
[    4.063960] Modules linked in: wmi asus_laptop(+) input_polldev sparse_keymap rfkill nfsd auth_rpcgss oid_registry nfs_acl lockd grace sunrpc sch_fq_codel tcp_westwood xfs libcrc32c
+hid_logitech_dj crc32c_intel serio_raw atl1c i915 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm i2c_core video
[    4.067026] CPU: 1 PID: 536 Comm: systemd-udevd Not tainted 4.4.0 #1
[    4.068515] Hardware name: ASUSTeK Computer Inc.         U45JC/U45JC, BIOS U45JC.208 02/24/2011
[    4.070023] task: ffff88003645b680 ti: ffff8800a4a0c000 task.ti: ffff8800a4a0c000
[    4.071568] RIP: 0010:[<ffffffffc03d3423>]  [<ffffffffc03d3423>] asus_sysfs_is_visible+0x13/0x1d0 [asus_laptop]
[    4.073188] RSP: 0000:ffff8800a4a0faf8  EFLAGS: 00010282
[    4.074820] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
[    4.076462] RDX: 0000000000000000 RSI: ffffffffc03d63c0 RDI: ffff88003675b420
[    4.078109] RBP: ffff8800a4a0fb08 R08: ffff8801428940c8 R09: 0000000000000124
[    4.079777] R10: ffff88014348d100 R11: 0000000000000014 R12: ffffffffc03d4940
[    4.081470] R13: 0000000000000000 R14: ffff8801418af000 R15: ffffffffc03d6220
[    4.083156] FS:  00007f58ba6dd8c0(0000) GS:ffff880147c40000(0000) knlGS:0000000000000000
[    4.084885] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    4.086611] CR2: 0000000000000e20 CR3: 00000000a49f3000 CR4: 00000000000006e0
[    4.088351] Stack:
[    4.090066]  0000000000000000 ffffffffc03d4940 ffff8800a4a0fb50 ffffffff8122d12b
[    4.091838]  0000000000000000 ffff88003675b420 ffff880141327000 0000000000000000
[    4.093606]  0000000000000000 ffff880036b42498 0000000000000001 ffff8800a4a0fb60
[    4.095386] Call Trace:
[    4.097151]  [<ffffffff8122d12b>] internal_create_group+0xbb/0x310
[    4.098943]  [<ffffffff8122d393>] sysfs_create_group+0x13/0x20
[    4.100748]  [<ffffffffc03d292b>] asus_acpi_add+0x3bb/0xea0 [asus_laptop]
[    4.102583]  [<ffffffff81399d32>] acpi_device_probe+0x4f/0xf5
[    4.104415]  [<ffffffff81431107>] driver_probe_device+0x167/0x490
[    4.106254]  [<ffffffff814314b4>] __driver_attach+0x84/0x90
[    4.108087]  [<ffffffff81431430>] ? driver_probe_device+0x490/0x490
[    4.109931]  [<ffffffff8142ee34>] bus_for_each_dev+0x64/0xa0
[    4.111724]  [<ffffffff814309ae>] driver_attach+0x1e/0x20
[    4.113509]  [<ffffffff8143053b>] bus_add_driver+0x1eb/0x280
[    4.115273]  [<ffffffffc03da000>] ? 0xffffffffc03da000
[    4.117032]  [<ffffffff81431d10>] driver_register+0x60/0xe0
[    4.118818]  [<ffffffff81399c01>] acpi_bus_register_driver+0x38/0x40
[    4.120619]  [<ffffffffc03da02a>] asus_laptop_init+0x2a/0x1000 [asus_laptop]
[    4.122433]  [<ffffffff810003db>] do_one_initcall+0xab/0x1c0
[    4.124276]  [<ffffffff8114b43e>] do_init_module+0x5f/0x1e5
[    4.126114]  [<ffffffff810d8dff>] load_module+0x1f3f/0x2530
[    4.127943]  [<ffffffff810d5500>] ? __symbol_put+0x50/0x50
[    4.129786]  [<ffffffff810d581b>] ? copy_module_from_fd.isra.50+0xdb/0x130
[    4.131653]  [<ffffffff810d95ea>] SyS_finit_module+0x9a/0xc0
[    4.133521]  [<ffffffff816bacd7>] entry_SYSCALL_64_fastpath+0x12/0x6a
[    4.135378] Code: c7 80 48 3d c0 e8 11 7e d7 c0 4c 89 f7 e8 66 3c e5 ff e9 27 ff ff ff 90 66 66 66 66 90 55 48 89 e5 41 54 53 48 8b 8790 00 00 00 <4c> 8b a0 20 0e 00 00 0f b6 80 95 0d 00 00 84 c0 74 1a 48 81 fe
[    4.139719] RIP  [<ffffffffc03d3423>] asus_sysfs_is_visible+0x13/0x1d0 [asus_laptop]
[    4.141788]  RSP <ffff8800a4a0faf8>
[    4.143809] CR2: 0000000000000e20
[    4.145867] ---[ end trace 7d8d7d572a3e9126 ]---

The bug is also reported here:
https://bugzilla.kernel.org/show_bug.cgi?id=110751

This patch fixes the problem (both for me and others):

From: Martin Wilck <Martin.Wilck@ts.fujitsu.com>

Since b8b2c7d845d5, platform_drv_probe() is called for all platform
devices. If drv->probe is NULL, and dev_pm_domain_attach() fails,
platform_drv_probe() will return the error code from dev_pm_domain_attach().

This causes real_probe() to enter the "probe_failed" path and set
dev->driver to NULL. Before b8b2c7d845d5, real_probe() would assume
success if both dev->bus->probe and drv->probe were missing. As a result,
a device and driver could be "bound" together just by matching their names;
this doesn't work any more after b8b2c7d845d5.

This change broke the assumptions of certain drivers; for example, the TPM
code has long assumed that platform driver and device with matching name
could be bound in this way. That assumption may cause such drivers to
fail with Oops during initialization after applying this change. Failure
in suspend/resume tests under qemu has also been reported.

This patch restores the previous (4.3.0 and earlier) behavior of
platform_drv_probe() in the case when the associated platform driver has
no "probe" function.

Fixes: b8b2c7d845d5 ("base/platform: assert that dev_pm_domain callbacks are called unconditionally")
Signed-off-by: Martin Wilck <Martin.Wilck@ts.fujitsu.com>
---
 v2: fixed style issues, rephrased commit message.
 v3: rephrased commit message and subject again.

 drivers/base/platform.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 1dd6d3b..176b59f 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -513,10 +513,15 @@ static int platform_drv_probe(struct device *_dev)
 		return ret;
 
 	ret = dev_pm_domain_attach(_dev, true);
-	if (ret != -EPROBE_DEFER && drv->probe) {
-		ret = drv->probe(dev);
-		if (ret)
-			dev_pm_domain_detach(_dev, true);
+	if (ret != -EPROBE_DEFER) {
+		if (drv->probe) {
+			ret = drv->probe(dev);
+			if (ret)
+				dev_pm_domain_detach(_dev, true);
+		} else {
+			/* don't fail if just dev_pm_domain_attach failed */
+			ret = 0;
+		}
 	}
 
 	if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) {
-- 
1.8.3.1

Thanks,
 Heinz
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Linux 4.5-rc2
  2016-02-01 19:08 ` Linux 4.5-rc2 Heinz Diehl
@ 2016-02-01 20:41   ` Greg KH
  2016-02-01 20:48     ` Linus Torvalds
  2016-02-01 20:46   ` Linus Torvalds
  1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2016-02-01 20:41 UTC (permalink / raw)
  To: Heinz Diehl; +Cc: Linus Torvalds, linux-kernel, stable

On Mon, Feb 01, 2016 at 08:08:01PM +0100, Heinz Diehl wrote:
> Hi,
> 
> On 01.02.2016, Linus Torvalds wrote: 
> 
> > Go forth and test,
> > 
> >                  Linus
> 
> Still, some Asus laptops are hanging at boot-time, both with latest
> -stable and 4.5-rc1/rc2:
> 
> [    4.056862] asus_laptop:    model detected
> [    4.058731] BUG: unable to handle kernel NULL pointer dereference at 0000000000000e20
> [    4.060018] IP: [<ffffffffc03d3423>] asus_sysfs_is_visible+0x13/0x1d0 [asus_laptop]
> [    4.061346] PGD 0
> [    4.062629] Oops: 0000 [#1] PREEMPT SMP
> [    4.063960] Modules linked in: wmi asus_laptop(+) input_polldev sparse_keymap rfkill nfsd auth_rpcgss oid_registry nfs_acl lockd grace sunrpc sch_fq_codel tcp_westwood xfs libcrc32c
> +hid_logitech_dj crc32c_intel serio_raw atl1c i915 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm i2c_core video
> [    4.067026] CPU: 1 PID: 536 Comm: systemd-udevd Not tainted 4.4.0 #1
> [    4.068515] Hardware name: ASUSTeK Computer Inc.         U45JC/U45JC, BIOS U45JC.208 02/24/2011
> [    4.070023] task: ffff88003645b680 ti: ffff8800a4a0c000 task.ti: ffff8800a4a0c000
> [    4.071568] RIP: 0010:[<ffffffffc03d3423>]  [<ffffffffc03d3423>] asus_sysfs_is_visible+0x13/0x1d0 [asus_laptop]
> [    4.073188] RSP: 0000:ffff8800a4a0faf8  EFLAGS: 00010282
> [    4.074820] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
> [    4.076462] RDX: 0000000000000000 RSI: ffffffffc03d63c0 RDI: ffff88003675b420
> [    4.078109] RBP: ffff8800a4a0fb08 R08: ffff8801428940c8 R09: 0000000000000124
> [    4.079777] R10: ffff88014348d100 R11: 0000000000000014 R12: ffffffffc03d4940
> [    4.081470] R13: 0000000000000000 R14: ffff8801418af000 R15: ffffffffc03d6220
> [    4.083156] FS:  00007f58ba6dd8c0(0000) GS:ffff880147c40000(0000) knlGS:0000000000000000
> [    4.084885] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    4.086611] CR2: 0000000000000e20 CR3: 00000000a49f3000 CR4: 00000000000006e0
> [    4.088351] Stack:
> [    4.090066]  0000000000000000 ffffffffc03d4940 ffff8800a4a0fb50 ffffffff8122d12b
> [    4.091838]  0000000000000000 ffff88003675b420 ffff880141327000 0000000000000000
> [    4.093606]  0000000000000000 ffff880036b42498 0000000000000001 ffff8800a4a0fb60
> [    4.095386] Call Trace:
> [    4.097151]  [<ffffffff8122d12b>] internal_create_group+0xbb/0x310
> [    4.098943]  [<ffffffff8122d393>] sysfs_create_group+0x13/0x20
> [    4.100748]  [<ffffffffc03d292b>] asus_acpi_add+0x3bb/0xea0 [asus_laptop]
> [    4.102583]  [<ffffffff81399d32>] acpi_device_probe+0x4f/0xf5
> [    4.104415]  [<ffffffff81431107>] driver_probe_device+0x167/0x490
> [    4.106254]  [<ffffffff814314b4>] __driver_attach+0x84/0x90
> [    4.108087]  [<ffffffff81431430>] ? driver_probe_device+0x490/0x490
> [    4.109931]  [<ffffffff8142ee34>] bus_for_each_dev+0x64/0xa0
> [    4.111724]  [<ffffffff814309ae>] driver_attach+0x1e/0x20
> [    4.113509]  [<ffffffff8143053b>] bus_add_driver+0x1eb/0x280
> [    4.115273]  [<ffffffffc03da000>] ? 0xffffffffc03da000
> [    4.117032]  [<ffffffff81431d10>] driver_register+0x60/0xe0
> [    4.118818]  [<ffffffff81399c01>] acpi_bus_register_driver+0x38/0x40
> [    4.120619]  [<ffffffffc03da02a>] asus_laptop_init+0x2a/0x1000 [asus_laptop]
> [    4.122433]  [<ffffffff810003db>] do_one_initcall+0xab/0x1c0
> [    4.124276]  [<ffffffff8114b43e>] do_init_module+0x5f/0x1e5
> [    4.126114]  [<ffffffff810d8dff>] load_module+0x1f3f/0x2530
> [    4.127943]  [<ffffffff810d5500>] ? __symbol_put+0x50/0x50
> [    4.129786]  [<ffffffff810d581b>] ? copy_module_from_fd.isra.50+0xdb/0x130
> [    4.131653]  [<ffffffff810d95ea>] SyS_finit_module+0x9a/0xc0
> [    4.133521]  [<ffffffff816bacd7>] entry_SYSCALL_64_fastpath+0x12/0x6a
> [    4.135378] Code: c7 80 48 3d c0 e8 11 7e d7 c0 4c 89 f7 e8 66 3c e5 ff e9 27 ff ff ff 90 66 66 66 66 90 55 48 89 e5 41 54 53 48 8b 8790 00 00 00 <4c> 8b a0 20 0e 00 00 0f b6 80 95 0d 00 00 84 c0 74 1a 48 81 fe
> [    4.139719] RIP  [<ffffffffc03d3423>] asus_sysfs_is_visible+0x13/0x1d0 [asus_laptop]
> [    4.141788]  RSP <ffff8800a4a0faf8>
> [    4.143809] CR2: 0000000000000e20
> [    4.145867] ---[ end trace 7d8d7d572a3e9126 ]---
> 
> The bug is also reported here:
> https://bugzilla.kernel.org/show_bug.cgi?id=110751
> 
> This patch fixes the problem (both for me and others):
> 
> From: Martin Wilck <Martin.Wilck@ts.fujitsu.com>

The patch you show below is included in 4.5-rc2, it's commit
25cad69f21f5532d99e2ee73c8ab6512bcab614c.  So how could you apply it to
4.5-rc2 and have this fix the issue for you?

confused,

greg k-h

> Since b8b2c7d845d5, platform_drv_probe() is called for all platform
> devices. If drv->probe is NULL, and dev_pm_domain_attach() fails,
> platform_drv_probe() will return the error code from dev_pm_domain_attach().
> 
> This causes real_probe() to enter the "probe_failed" path and set
> dev->driver to NULL. Before b8b2c7d845d5, real_probe() would assume
> success if both dev->bus->probe and drv->probe were missing. As a result,
> a device and driver could be "bound" together just by matching their names;
> this doesn't work any more after b8b2c7d845d5.
> 
> This change broke the assumptions of certain drivers; for example, the TPM
> code has long assumed that platform driver and device with matching name
> could be bound in this way. That assumption may cause such drivers to
> fail with Oops during initialization after applying this change. Failure
> in suspend/resume tests under qemu has also been reported.
> 
> This patch restores the previous (4.3.0 and earlier) behavior of
> platform_drv_probe() in the case when the associated platform driver has
> no "probe" function.
> 
> Fixes: b8b2c7d845d5 ("base/platform: assert that dev_pm_domain callbacks are called unconditionally")
> Signed-off-by: Martin Wilck <Martin.Wilck@ts.fujitsu.com>
> ---
>  v2: fixed style issues, rephrased commit message.
>  v3: rephrased commit message and subject again.
> 
>  drivers/base/platform.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 1dd6d3b..176b59f 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -513,10 +513,15 @@ static int platform_drv_probe(struct device *_dev)
>  		return ret;
>  
>  	ret = dev_pm_domain_attach(_dev, true);
> -	if (ret != -EPROBE_DEFER && drv->probe) {
> -		ret = drv->probe(dev);
> -		if (ret)
> -			dev_pm_domain_detach(_dev, true);
> +	if (ret != -EPROBE_DEFER) {
> +		if (drv->probe) {
> +			ret = drv->probe(dev);
> +			if (ret)
> +				dev_pm_domain_detach(_dev, true);
> +		} else {
> +			/* don't fail if just dev_pm_domain_attach failed */
> +			ret = 0;
> +		}
>  	}
>  
>  	if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) {
> -- 
> 1.8.3.1
> 
> Thanks,
>  Heinz
>  
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linux 4.5-rc2
  2016-02-01 19:08 ` Linux 4.5-rc2 Heinz Diehl
  2016-02-01 20:41   ` Greg KH
@ 2016-02-01 20:46   ` Linus Torvalds
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2016-02-01 20:46 UTC (permalink / raw)
  To: Heinz Diehl, Greg Kroah-Hartman; +Cc: Linux Kernel Mailing List, stable

On Mon, Feb 1, 2016 at 11:08 AM, Heinz Diehl <htd+ml@fritha.org> wrote:
>
> Still, some Asus laptops are hanging at boot-time, both with latest
> -stable and 4.5-rc1/rc2:
>
> [    4.056862] asus_laptop:    model detected
> [    4.058731] BUG: unable to handle kernel NULL pointer dereference at 0000000000000e20
> [    4.060018] IP: [<ffffffffc03d3423>] asus_sysfs_is_visible+0x13/0x1d0 [asus_laptop]
>
> The bug is also reported here:
> https://bugzilla.kernel.org/show_bug.cgi?id=110751
>
> This patch fixes the problem (both for me and others):
>
> [ https://patchwork.ozlabs.org/patch/552082/ ]

Greg, do you have that pending, or should I just apply it directly?

                Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linux 4.5-rc2
  2016-02-01 20:41   ` Greg KH
@ 2016-02-01 20:48     ` Linus Torvalds
  2016-02-01 21:45       ` Heinz Diehl
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2016-02-01 20:48 UTC (permalink / raw)
  To: Greg KH; +Cc: Heinz Diehl, Linux Kernel Mailing List, stable

On Mon, Feb 1, 2016 at 12:41 PM, Greg KH <greg@kroah.com> wrote:
>
> The patch you show below is included in 4.5-rc2, it's commit
> 25cad69f21f5532d99e2ee73c8ab6512bcab614c.

Right you are, Greg.

Heinz? Did you actually test rc2 or something else?

                Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linux 4.5-rc2
  2016-02-01 20:48     ` Linus Torvalds
@ 2016-02-01 21:45       ` Heinz Diehl
  0 siblings, 0 replies; 5+ messages in thread
From: Heinz Diehl @ 2016-02-01 21:45 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Greg KH, Heinz Diehl, Linux Kernel Mailing List, stable

On 01.02.2016, Linus Torvalds wrote: 

> Heinz? Did you actually test rc2 or something else?

You're right, my bad! In fact, I tested 4.4.1-rc1 and 4.5-rc1.
Sorry for the noise!


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-01 21:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CA+55aFwpEs_=7DRRkVuROCboPD4evk2ZV4S40C2B5tO9koEyhw@mail.gmail.com>
2016-02-01 19:08 ` Linux 4.5-rc2 Heinz Diehl
2016-02-01 20:41   ` Greg KH
2016-02-01 20:48     ` Linus Torvalds
2016-02-01 21:45       ` Heinz Diehl
2016-02-01 20:46   ` Linus Torvalds

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).