diff mbox

[V2,1/2] spmi: remove wakeup command before slave probe

Message ID 1422665201-25569-2-git-send-email-gavidov@codeaurora.org (mailing list archive)
State New, archived
Headers show

Commit Message

Gilad Avidov Jan. 31, 2015, 12:46 a.m. UTC
According to spmi spec a slave powers up into startup state and then
transitions into active state. Thus, the wakeup command is not required
before calling the slave's probe. The wakeup command is only needed for
slaves that are in sleep state after receiving the sleep command.

This is a bug since spmi master controllers, such as spmi-pmic-arb,
which have no support for wakeup command return an error on that
command and thus fail before reaching a slave driver probe.

Cc: galak@codeaurora.org
Acked-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
---
 drivers/spmi/spmi.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Stanimir Varbanov Feb. 3, 2015, 9:36 a.m. UTC | #1
On 01/31/2015 02:46 AM, Gilad Avidov wrote:
> According to spmi spec a slave powers up into startup state and then
> transitions into active state. Thus, the wakeup command is not required
> before calling the slave's probe. The wakeup command is only needed for
> slaves that are in sleep state after receiving the sleep command.
> 
> This is a bug since spmi master controllers, such as spmi-pmic-arb,
> which have no support for wakeup command return an error on that
> command and thus fail before reaching a slave driver probe.
> 
> Cc: galak@codeaurora.org
> Acked-by: Sagar Dharia <sdharia@codeaurora.org>
> Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
> ---
>  drivers/spmi/spmi.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c
> index 1d92f51..9ff7454 100644
> --- a/drivers/spmi/spmi.c
> +++ b/drivers/spmi/spmi.c
> @@ -1,4 +1,4 @@
> -/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
> +/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.

run chackpatch please.

<snip>
Gilad Avidov Feb. 4, 2015, 1:17 a.m. UTC | #2
Hi Stan,

On Tue, 03 Feb 2015 11:36:56 +0200
Stanimir Varbanov <svarbanov@mm-sol.com> wrote:

> On 01/31/2015 02:46 AM, Gilad Avidov wrote:
> > According to spmi spec a slave powers up into startup state and then
> > transitions into active state. Thus, the wakeup command is not
> > required before calling the slave's probe. The wakeup command is
> > only needed for slaves that are in sleep state after receiving the
> > sleep command.
> > 
> > This is a bug since spmi master controllers, such as spmi-pmic-arb,
> > which have no support for wakeup command return an error on that
> > command and thus fail before reaching a slave driver probe.
> > 
> > Cc: galak@codeaurora.org
> > Acked-by: Sagar Dharia <sdharia@codeaurora.org>
> > Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
> > ---
> >  drivers/spmi/spmi.c | 8 +-------
> >  1 file changed, 1 insertion(+), 7 deletions(-)
> > 
> > diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c
> > index 1d92f51..9ff7454 100644
> > --- a/drivers/spmi/spmi.c
> > +++ b/drivers/spmi/spmi.c
> > @@ -1,4 +1,4 @@
> > -/* Copyright (c) 2012-2013, The Linux Foundation. All rights
> > reserved. +/* Copyright (c) 2012-2015, The Linux Foundation. All
> > rights reserved.
> 
> run chackpatch please.

I have run checkpatch again on both my patch and the email sent by
me and both pass on my machine:

~/upstream/linux$ scripts/checkpatch.pl "[PATCH V2
1_2] spmi: remove wakeup command before slave probe" total: 0 errors, 0
warnings, 23 lines checked

[PATCH V2 1_2] spmi: remove wakeup command before slave probe has no
obvious style problems and is ready for submission.


I have also updated the source tree today, so it checkpatch's latest
version. Additionally my colleague have tested on her machine and it
passes for here too.

Thanks,
Gilad

> 
> <snip>
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c
index 1d92f51..9ff7454 100644
--- a/drivers/spmi/spmi.c
+++ b/drivers/spmi/spmi.c
@@ -1,4 +1,4 @@ 
-/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -316,11 +316,6 @@  static int spmi_drv_probe(struct device *dev)
 	struct spmi_device *sdev = to_spmi_device(dev);
 	int err;
 
-	/* Ensure the slave is in ACTIVE state */
-	err = spmi_command_wakeup(sdev);
-	if (err)
-		goto fail_wakeup;
-
 	pm_runtime_get_noresume(dev);
 	pm_runtime_set_active(dev);
 	pm_runtime_enable(dev);
@@ -335,7 +330,6 @@  fail_probe:
 	pm_runtime_disable(dev);
 	pm_runtime_set_suspended(dev);
 	pm_runtime_put_noidle(dev);
-fail_wakeup:
 	return err;
 }