linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xhci: fix 'broken_suspend' placement in struct xchi_hcd
@ 2018-12-17 13:37 Nicolas Saenz Julienne
  2018-12-17 13:49 ` Felipe Balbi
  2018-12-17 13:59 ` Mathias Nyman
  0 siblings, 2 replies; 4+ messages in thread
From: Nicolas Saenz Julienne @ 2018-12-17 13:37 UTC (permalink / raw)
  To: Mathias Nyman
  Cc: oneukum, sandeep.singh, Nicolas Saenz Julienne,
	Greg Kroah-Hartman, linux-usb, linux-kernel

As commented in the struct's definition there shouldn't be anything
underneath it's 'priv[0]' member as it would break some macros.

The patch converts the broken_suspend into a bit-field and relocates it
next to to the rest of bit-fields.

Fixes: a7d57abcc8a5 ("xhci: workaround CSS timeout on AMD SNPS 3.0 xHC")
Reported-by: Oliver Neukum  <oneukum@suse.com>
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
 drivers/usb/host/xhci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index c3515bad5dbb..011dd45f8718 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1863,6 +1863,8 @@ struct xhci_hcd {
 	unsigned		sw_lpm_support:1;
 	/* support xHCI 1.0 spec USB2 hardware LPM */
 	unsigned		hw_lpm_support:1;
+	/* Broken Suspend flag for SNPS Suspend resume issue */
+	unsigned		broken_suspend:1;
 	/* cached usb2 extened protocol capabilites */
 	u32                     *ext_caps;
 	unsigned int            num_ext_caps;
@@ -1880,8 +1882,6 @@ struct xhci_hcd {
 	void			*dbc;
 	/* platform-specific data -- must come last */
 	unsigned long		priv[0] __aligned(sizeof(s64));
-	/* Broken Suspend flag for SNPS Suspend resume issue */
-	u8			broken_suspend;
 };
 
 /* Platform specific overrides to generic XHCI hc_driver ops */
-- 
2.19.2


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

* Re: [PATCH] xhci: fix 'broken_suspend' placement in struct xchi_hcd
  2018-12-17 13:37 [PATCH] xhci: fix 'broken_suspend' placement in struct xchi_hcd Nicolas Saenz Julienne
@ 2018-12-17 13:49 ` Felipe Balbi
  2018-12-17 13:59 ` Mathias Nyman
  1 sibling, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2018-12-17 13:49 UTC (permalink / raw)
  To: Nicolas Saenz Julienne, Mathias Nyman
  Cc: oneukum, sandeep.singh, Nicolas Saenz Julienne,
	Greg Kroah-Hartman, linux-usb, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

Nicolas Saenz Julienne <nsaenzjulienne@suse.de> writes:

> As commented in the struct's definition there shouldn't be anything
> underneath it's 'priv[0]' member as it would break some macros.
             its?

I guess Mathias can fix when applying.

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: [PATCH] xhci: fix 'broken_suspend' placement in struct xchi_hcd
  2018-12-17 13:37 [PATCH] xhci: fix 'broken_suspend' placement in struct xchi_hcd Nicolas Saenz Julienne
  2018-12-17 13:49 ` Felipe Balbi
@ 2018-12-17 13:59 ` Mathias Nyman
  2018-12-17 14:11   ` Greg Kroah-Hartman
  1 sibling, 1 reply; 4+ messages in thread
From: Mathias Nyman @ 2018-12-17 13:59 UTC (permalink / raw)
  To: Nicolas Saenz Julienne, Mathias Nyman, Greg Kroah-Hartman
  Cc: oneukum, sandeep.singh, linux-usb, linux-kernel

On 17.12.2018 15:37, Nicolas Saenz Julienne wrote:
> As commented in the struct's definition there shouldn't be anything
> underneath it's 'priv[0]' member as it would break some macros.
> 
> The patch converts the broken_suspend into a bit-field and relocates it
> next to to the rest of bit-fields.
> 
> Fixes: a7d57abcc8a5 ("xhci: workaround CSS timeout on AMD SNPS 3.0 xHC")
> Reported-by: Oliver Neukum  <oneukum@suse.com>
> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> ---
>   drivers/usb/host/xhci.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
> index c3515bad5dbb..011dd45f8718 100644
> --- a/drivers/usb/host/xhci.h
> +++ b/drivers/usb/host/xhci.h
> @@ -1863,6 +1863,8 @@ struct xhci_hcd {
>   	unsigned		sw_lpm_support:1;
>   	/* support xHCI 1.0 spec USB2 hardware LPM */
>   	unsigned		hw_lpm_support:1;
> +	/* Broken Suspend flag for SNPS Suspend resume issue */
> +	unsigned		broken_suspend:1;
>   	/* cached usb2 extened protocol capabilites */
>   	u32                     *ext_caps;
>   	unsigned int            num_ext_caps;
> @@ -1880,8 +1882,6 @@ struct xhci_hcd {
>   	void			*dbc;
>   	/* platform-specific data -- must come last */
>   	unsigned long		priv[0] __aligned(sizeof(s64));
> -	/* Broken Suspend flag for SNPS Suspend resume issue */
> -	u8			broken_suspend;
>   };
>   
>   /* Platform specific overrides to generic XHCI hc_driver ops */
> 

Thanks, not sure how I missed that.

Greg, in case you want to pick this simple fix to 4.20 still:
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>

Or prefer me to resend it?

-Mathias

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

* Re: [PATCH] xhci: fix 'broken_suspend' placement in struct xchi_hcd
  2018-12-17 13:59 ` Mathias Nyman
@ 2018-12-17 14:11   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2018-12-17 14:11 UTC (permalink / raw)
  To: Mathias Nyman
  Cc: Nicolas Saenz Julienne, Mathias Nyman, oneukum, sandeep.singh,
	linux-usb, linux-kernel

On Mon, Dec 17, 2018 at 03:59:28PM +0200, Mathias Nyman wrote:
> On 17.12.2018 15:37, Nicolas Saenz Julienne wrote:
> > As commented in the struct's definition there shouldn't be anything
> > underneath it's 'priv[0]' member as it would break some macros.
> > 
> > The patch converts the broken_suspend into a bit-field and relocates it
> > next to to the rest of bit-fields.
> > 
> > Fixes: a7d57abcc8a5 ("xhci: workaround CSS timeout on AMD SNPS 3.0 xHC")
> > Reported-by: Oliver Neukum  <oneukum@suse.com>
> > Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> > ---
> >   drivers/usb/host/xhci.h | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
> > index c3515bad5dbb..011dd45f8718 100644
> > --- a/drivers/usb/host/xhci.h
> > +++ b/drivers/usb/host/xhci.h
> > @@ -1863,6 +1863,8 @@ struct xhci_hcd {
> >   	unsigned		sw_lpm_support:1;
> >   	/* support xHCI 1.0 spec USB2 hardware LPM */
> >   	unsigned		hw_lpm_support:1;
> > +	/* Broken Suspend flag for SNPS Suspend resume issue */
> > +	unsigned		broken_suspend:1;
> >   	/* cached usb2 extened protocol capabilites */
> >   	u32                     *ext_caps;
> >   	unsigned int            num_ext_caps;
> > @@ -1880,8 +1882,6 @@ struct xhci_hcd {
> >   	void			*dbc;
> >   	/* platform-specific data -- must come last */
> >   	unsigned long		priv[0] __aligned(sizeof(s64));
> > -	/* Broken Suspend flag for SNPS Suspend resume issue */
> > -	u8			broken_suspend;
> >   };
> >   /* Platform specific overrides to generic XHCI hc_driver ops */
> > 
> 
> Thanks, not sure how I missed that.
> 
> Greg, in case you want to pick this simple fix to 4.20 still:
> Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>

I can queue it up, thanks!

greg k-h

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

end of thread, other threads:[~2018-12-17 14:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-17 13:37 [PATCH] xhci: fix 'broken_suspend' placement in struct xchi_hcd Nicolas Saenz Julienne
2018-12-17 13:49 ` Felipe Balbi
2018-12-17 13:59 ` Mathias Nyman
2018-12-17 14:11   ` Greg Kroah-Hartman

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