public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Phil Elwell <phil@raspberrypi.com>
Cc: Minas Harutyunyan <hminas@synopsys.com>,
	Sasha Levin <sashal@kernel.org>,
	Artur Petrosyan <Arthur.Petrosyan@synopsys.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] usb: dwc2: Fix build in periphal-only mode
Date: Fri, 28 May 2021 11:23:20 +0200	[thread overview]
Message-ID: <YLC2iPPEOCJuElIR@kroah.com> (raw)
In-Reply-To: <20210528091349.2602410-1-phil@raspberrypi.com>

On Fri, May 28, 2021 at 10:13:50AM +0100, Phil Elwell wrote:
> The bus_suspended member of struct dwc2_hsotg is only present in builds
> that support host-mode.
> 
> Fixes: 24d209dba5a3 ("usb: dwc2: Fix hibernation between host and device modes.")
> Signed-off-by: Phil Elwell <phil@raspberrypi.com>
> ---
>  drivers/usb/dwc2/core_intr.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> v2: Correct commit hash used in the Fixes line.
> 
> diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c
> index a5ab03808da6..03d0c034cf57 100644
> --- a/drivers/usb/dwc2/core_intr.c
> +++ b/drivers/usb/dwc2/core_intr.c
> @@ -725,7 +725,11 @@ static inline void dwc_handle_gpwrdn_disc_det(struct dwc2_hsotg *hsotg,
>  	dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN);
>  
>  	hsotg->hibernated = 0;
> +
> +#if IS_ENABLED(CONFIG_USB_DWC2_HOST) ||	\
> +	IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
>  	hsotg->bus_suspended = 0;
> +#endif
>  
>  	if (gpwrdn & GPWRDN_IDSTS) {
>  		hsotg->op_state = OTG_STATE_B_PERIPHERAL;
> -- 
> 2.25.1
> 

I do not understand, the field in the structure is present for all, why
is this crazy #if needed here?

I see that the commit you reference here did add the new line to set
bus_suspended, which seemed to be the point here.  Why will the #if
values matter here?

thanks,

greg k-h

  reply	other threads:[~2021-05-28  9:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28  9:13 [PATCH v2] usb: dwc2: Fix build in periphal-only mode Phil Elwell
2021-05-28  9:23 ` Greg Kroah-Hartman [this message]
2021-05-28  9:37   ` Phil Elwell
2021-05-28  9:51     ` Greg Kroah-Hartman
2021-05-28 10:04       ` Phil Elwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YLC2iPPEOCJuElIR@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Arthur.Petrosyan@synopsys.com \
    --cc=hminas@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=phil@raspberrypi.com \
    --cc=sashal@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox