* Re: [PATCH] usb: chipidea: core: wrap ci_handle_power_lost() with CONFIG_PM_SLEEP
2022-10-26 12:11 [PATCH] usb: chipidea: core: wrap ci_handle_power_lost() with CONFIG_PM_SLEEP Xu Yang
@ 2022-10-26 7:02 ` Conor Dooley
2022-11-04 10:52 ` Conor Dooley
0 siblings, 1 reply; 3+ messages in thread
From: Conor Dooley @ 2022-10-26 7:02 UTC (permalink / raw)
To: Xu Yang; +Cc: gregkh, peter.chen, jun.li, linux-usb, linux-imx
On Wed, Oct 26, 2022 at 08:11:57PM +0800, Xu Yang wrote:
> If CONFIG_PM_SLEEP is not set, the following error will be shown up
> when build kernel:
> error: 'ci_handle_power_lost' defined but not used.
>
> This will move ci_handle_power_lost() to an area wrapped by
> CONFIG_PM_SLEEP.
>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> Fixes: 74494b33211d ("usb: chipidea: core: add controller resume support when controller is powered off")
Reported-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Conor Dooley <conor.dooley@microchip.com>
Thanks for the quick fix. BTW, your mails show up timestamped in the
future, maybe something's up with the TZ on your machine.
Thanks,
Conor.
> ---
> drivers/usb/chipidea/core.c | 38 ++++++++++++++++++-------------------
> 1 file changed, 19 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 2b170b434d01..484b1cd23431 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -661,25 +661,6 @@ static enum ci_role ci_get_role(struct ci_hdrc *ci)
> return role;
> }
>
> -static void ci_handle_power_lost(struct ci_hdrc *ci)
> -{
> - enum ci_role role;
> -
> - disable_irq_nosync(ci->irq);
> - if (!ci_otg_is_fsm_mode(ci)) {
> - role = ci_get_role(ci);
> -
> - if (ci->role != role) {
> - ci_handle_id_switch(ci);
> - } else if (role == CI_ROLE_GADGET) {
> - if (ci->is_otg && hw_read_otgsc(ci, OTGSC_BSV))
> - usb_gadget_vbus_connect(&ci->gadget);
> - }
> - }
> -
> - enable_irq(ci->irq);
> -}
> -
> static struct usb_role_switch_desc ci_role_switch = {
> .set = ci_usb_role_switch_set,
> .get = ci_usb_role_switch_get,
> @@ -1400,6 +1381,25 @@ static int ci_suspend(struct device *dev)
> return 0;
> }
>
> +static void ci_handle_power_lost(struct ci_hdrc *ci)
> +{
> + enum ci_role role;
> +
> + disable_irq_nosync(ci->irq);
> + if (!ci_otg_is_fsm_mode(ci)) {
> + role = ci_get_role(ci);
> +
> + if (ci->role != role) {
> + ci_handle_id_switch(ci);
> + } else if (role == CI_ROLE_GADGET) {
> + if (ci->is_otg && hw_read_otgsc(ci, OTGSC_BSV))
> + usb_gadget_vbus_connect(&ci->gadget);
> + }
> + }
> +
> + enable_irq(ci->irq);
> +}
> +
> static int ci_resume(struct device *dev)
> {
> struct ci_hdrc *ci = dev_get_drvdata(dev);
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] usb: chipidea: core: wrap ci_handle_power_lost() with CONFIG_PM_SLEEP
@ 2022-10-26 12:11 Xu Yang
2022-10-26 7:02 ` Conor Dooley
0 siblings, 1 reply; 3+ messages in thread
From: Xu Yang @ 2022-10-26 12:11 UTC (permalink / raw)
To: gregkh; +Cc: peter.chen, jun.li, linux-usb, linux-imx
If CONFIG_PM_SLEEP is not set, the following error will be shown up
when build kernel:
error: 'ci_handle_power_lost' defined but not used.
This will move ci_handle_power_lost() to an area wrapped by
CONFIG_PM_SLEEP.
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Fixes: 74494b33211d ("usb: chipidea: core: add controller resume support when controller is powered off")
---
drivers/usb/chipidea/core.c | 38 ++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 2b170b434d01..484b1cd23431 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -661,25 +661,6 @@ static enum ci_role ci_get_role(struct ci_hdrc *ci)
return role;
}
-static void ci_handle_power_lost(struct ci_hdrc *ci)
-{
- enum ci_role role;
-
- disable_irq_nosync(ci->irq);
- if (!ci_otg_is_fsm_mode(ci)) {
- role = ci_get_role(ci);
-
- if (ci->role != role) {
- ci_handle_id_switch(ci);
- } else if (role == CI_ROLE_GADGET) {
- if (ci->is_otg && hw_read_otgsc(ci, OTGSC_BSV))
- usb_gadget_vbus_connect(&ci->gadget);
- }
- }
-
- enable_irq(ci->irq);
-}
-
static struct usb_role_switch_desc ci_role_switch = {
.set = ci_usb_role_switch_set,
.get = ci_usb_role_switch_get,
@@ -1400,6 +1381,25 @@ static int ci_suspend(struct device *dev)
return 0;
}
+static void ci_handle_power_lost(struct ci_hdrc *ci)
+{
+ enum ci_role role;
+
+ disable_irq_nosync(ci->irq);
+ if (!ci_otg_is_fsm_mode(ci)) {
+ role = ci_get_role(ci);
+
+ if (ci->role != role) {
+ ci_handle_id_switch(ci);
+ } else if (role == CI_ROLE_GADGET) {
+ if (ci->is_otg && hw_read_otgsc(ci, OTGSC_BSV))
+ usb_gadget_vbus_connect(&ci->gadget);
+ }
+ }
+
+ enable_irq(ci->irq);
+}
+
static int ci_resume(struct device *dev)
{
struct ci_hdrc *ci = dev_get_drvdata(dev);
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: chipidea: core: wrap ci_handle_power_lost() with CONFIG_PM_SLEEP
2022-10-26 7:02 ` Conor Dooley
@ 2022-11-04 10:52 ` Conor Dooley
0 siblings, 0 replies; 3+ messages in thread
From: Conor Dooley @ 2022-11-04 10:52 UTC (permalink / raw)
To: Conor Dooley, gregkh
Cc: Xu Yang, gregkh, peter.chen, jun.li, linux-usb, linux-imx
On Wed, Oct 26, 2022 at 08:02:49AM +0100, Conor Dooley wrote:
> On Wed, Oct 26, 2022 at 08:11:57PM +0800, Xu Yang wrote:
> > If CONFIG_PM_SLEEP is not set, the following error will be shown up
> > when build kernel:
> > error: 'ci_handle_power_lost' defined but not used.
> >
> > This will move ci_handle_power_lost() to an area wrapped by
> > CONFIG_PM_SLEEP.
> >
> > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> > Fixes: 74494b33211d ("usb: chipidea: core: add controller resume support when controller is powered off")
>
> Reported-by: Conor Dooley <conor.dooley@microchip.com>
> Tested-by: Conor Dooley <conor.dooley@microchip.com>
>
> Thanks for the quick fix. BTW, your mails show up timestamped in the
> future, maybe something's up with the TZ on your machine.
Hey Greg (I'm assuming you apply the chipidea stuff directly),
Apologies for the ping, this is a fix for the allmodconfig build on
RISC-V in -next so it'd be nice to get it applied.
Thanks,
Conor.
> > ---
> > drivers/usb/chipidea/core.c | 38 ++++++++++++++++++-------------------
> > 1 file changed, 19 insertions(+), 19 deletions(-)
> >
> > diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> > index 2b170b434d01..484b1cd23431 100644
> > --- a/drivers/usb/chipidea/core.c
> > +++ b/drivers/usb/chipidea/core.c
> > @@ -661,25 +661,6 @@ static enum ci_role ci_get_role(struct ci_hdrc *ci)
> > return role;
> > }
> >
> > -static void ci_handle_power_lost(struct ci_hdrc *ci)
> > -{
> > - enum ci_role role;
> > -
> > - disable_irq_nosync(ci->irq);
> > - if (!ci_otg_is_fsm_mode(ci)) {
> > - role = ci_get_role(ci);
> > -
> > - if (ci->role != role) {
> > - ci_handle_id_switch(ci);
> > - } else if (role == CI_ROLE_GADGET) {
> > - if (ci->is_otg && hw_read_otgsc(ci, OTGSC_BSV))
> > - usb_gadget_vbus_connect(&ci->gadget);
> > - }
> > - }
> > -
> > - enable_irq(ci->irq);
> > -}
> > -
> > static struct usb_role_switch_desc ci_role_switch = {
> > .set = ci_usb_role_switch_set,
> > .get = ci_usb_role_switch_get,
> > @@ -1400,6 +1381,25 @@ static int ci_suspend(struct device *dev)
> > return 0;
> > }
> >
> > +static void ci_handle_power_lost(struct ci_hdrc *ci)
> > +{
> > + enum ci_role role;
> > +
> > + disable_irq_nosync(ci->irq);
> > + if (!ci_otg_is_fsm_mode(ci)) {
> > + role = ci_get_role(ci);
> > +
> > + if (ci->role != role) {
> > + ci_handle_id_switch(ci);
> > + } else if (role == CI_ROLE_GADGET) {
> > + if (ci->is_otg && hw_read_otgsc(ci, OTGSC_BSV))
> > + usb_gadget_vbus_connect(&ci->gadget);
> > + }
> > + }
> > +
> > + enable_irq(ci->irq);
> > +}
> > +
> > static int ci_resume(struct device *dev)
> > {
> > struct ci_hdrc *ci = dev_get_drvdata(dev);
> > --
> > 2.34.1
> >
> >
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-04 10:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 12:11 [PATCH] usb: chipidea: core: wrap ci_handle_power_lost() with CONFIG_PM_SLEEP Xu Yang
2022-10-26 7:02 ` Conor Dooley
2022-11-04 10:52 ` Conor Dooley
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).