Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1300948 > unrolled thread

[PATCH] base/platform: Fix platform drivers with no probe callback (ex alarmtimer)

Started byMartin Fuzzey <mfuzzey@parkeon.com>
First post2016-01-04 19:40 +0100
Last post2016-01-05 12:20 +0100
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] base/platform: Fix platform drivers with no probe callback  (ex alarmtimer) Martin Fuzzey <mfuzzey@parkeon.com> - 2016-01-04 19:40 +0100
    Re: [PATCH] base/platform: Fix platform drivers with no probe  callback (ex alarmtimer) Uwe Kleine-König   <u.kleine-koenig@pengutronix.de> - 2016-01-05 09:50 +0100
      Re: [PATCH] base/platform: Fix platform drivers with no probe callback  (ex alarmtimer) Tero Roponen <tero.roponen@gmail.com> - 2016-01-05 11:10 +0100
        Re: [PATCH] base/platform: Fix platform drivers with no probe  callback (ex alarmtimer) Uwe Kleine-König   <u.kleine-koenig@pengutronix.de> - 2016-01-05 14:10 +0100
      Re: [PATCH] base/platform: Fix platform drivers with no probe  callback (ex alarmtimer) Martin Fuzzey <mfuzzey@parkeon.com> - 2016-01-05 12:20 +0100

#1300948 — [PATCH] base/platform: Fix platform drivers with no probe callback (ex alarmtimer)

FromMartin Fuzzey <mfuzzey@parkeon.com>
Date2016-01-04 19:40 +0100
Subject[PATCH] base/platform: Fix platform drivers with no probe callback (ex alarmtimer)
Message-ID<qNicX-79x-25@gated-at.bofh.it>
Normally, when a platform driver defines a .probe callback, the
result of dev_pm_domain_attach() is ignored unless it is EPROBE_DEFER.

However, when a .probe callback is not defined the result of
dev_pm_domain_attach() is propagated to the caller.

But dev_pm_domain_attach() can return -ENODEV for devices with no
power domain.

This was causing the alarmtimer .suspend() callback to be ignored
and hence alarms not to wake from suspend (since the RTC was
not being programmed on suspend).

Fixes: b8b2c7d [base/platform: assert that dev_pm_domain callbacks are called unconditionally]
Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
---
 drivers/base/platform.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 1dd6d3b..61e5b7e 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -513,8 +513,8 @@ 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 != -EPROBE_DEFER) {
+		ret = drv->probe ? drv->probe(dev) : 0;
 		if (ret)
 			dev_pm_domain_detach(_dev, true);
 	}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1301328 — Re: [PATCH] base/platform: Fix platform drivers with no probe callback (ex alarmtimer)

FromUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date2016-01-05 09:50 +0100
SubjectRe: [PATCH] base/platform: Fix platform drivers with no probe callback (ex alarmtimer)
Message-ID<qNvtw-80m-1@gated-at.bofh.it>
In reply to#1300948
Hello,

I think this is the same problem that another Martin found and fixed in

http://mid.gmane.org/1449132704-9952-1-git-send-email-martin.wilck@ts.fujitsu.com

I didn't check, but thought Greg already picked that up?!

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1301396

FromTero Roponen <tero.roponen@gmail.com>
Date2016-01-05 11:10 +0100
Message-ID<qNwIX-Cq-25@gated-at.bofh.it>
In reply to#1301328

[Multipart message — attachments visible in raw view] — view raw

On Tue, 5 Jan 2016, Uwe Kleine-König wrote:

> Hello,
> 
> I think this is the same problem that another Martin found and fixed in
> 
> http://mid.gmane.org/1449132704-9952-1-git-send-email-martin.wilck@ts.fujitsu.com
> 
> I didn't check, but thought Greg already picked that up?!

I can confirm that applying the patch in that link to 4.4-rc8 fixes the
following problem I've seen since 4.4-rc5:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000e20
IP: [<ffffffffa017835e>] asus_sysfs_is_visible+0xe/0x1d0 [asus_laptop]

So:

Tested-by: Tero Roponen <tero.roponen@gmail.com>

[toc] | [prev] | [next] | [standalone]


#1301517 — Re: [PATCH] base/platform: Fix platform drivers with no probe callback (ex alarmtimer)

FromUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date2016-01-05 14:10 +0100
SubjectRe: [PATCH] base/platform: Fix platform drivers with no probe callback (ex alarmtimer)
Message-ID<qNzx9-3cW-27@gated-at.bofh.it>
In reply to#1301396
On Tue, Jan 05, 2016 at 12:02:23PM +0200, Tero Roponen wrote:
> 
> On Tue, 5 Jan 2016, Uwe Kleine-König wrote:
> 
> > Hello,
> > 
> > I think this is the same problem that another Martin found and fixed in
> > 
> > http://mid.gmane.org/1449132704-9952-1-git-send-email-martin.wilck@ts.fujitsu.com
> > 
> > I didn't check, but thought Greg already picked that up?!
> 
> I can confirm that applying the patch in that link to 4.4-rc8 fixes the
> following problem I've seen since 4.4-rc5:
> 
> BUG: unable to handle kernel NULL pointer dereference at 0000000000000e20
> IP: [<ffffffffa017835e>] asus_sysfs_is_visible+0xe/0x1d0 [asus_laptop]

This is a separate bug however that is worth fixing, too. I guess this
is similar to the tpm problem my broken patch made obvious.

Best regards
Uwe


-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1301453 — Re: [PATCH] base/platform: Fix platform drivers with no probe callback (ex alarmtimer)

FromMartin Fuzzey <mfuzzey@parkeon.com>
Date2016-01-05 12:20 +0100
SubjectRe: [PATCH] base/platform: Fix platform drivers with no probe callback (ex alarmtimer)
Message-ID<qNxOG-1jL-27@gated-at.bofh.it>
In reply to#1301328
Hi Uwe,

On 05/01/16 09:43, Uwe Kleine-König wrote:
> Hello,
>
> I think this is the same problem that another Martin found and fixed in
>
> http://mid.gmane.org/1449132704-9952-1-git-send-email-martin.wilck@ts.fujitsu.com

Yes it's the same problem and the fix is equivalent to my patch
> I didn't check, but thought Greg already picked that up?!

It's not in 4.4-rc8

Regards,

Martin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web