Re: [PATCH 03/23] xhci: Ring allocation and initialization.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 28, 2009 at 01:54:07AM -0700, David Brownell wrote:
> On Tuesday 28 April 2009, Oliver Neukum wrote:
> > Am Dienstag 28 April 2009 04:52:34 schrieb Sarah Sharp:
> > > +/**
> > > + * struct doorbell_array
> > > + *
> > > + * Section 5.6
> > > + */
> > > +struct xhci_doorbell_array {
> > > +       u32     doorbell[256];
> > > +} __attribute__ ((packed));
> > 
> > If you declare this packed, does gcc still give you atomic writes on
> > all platforms or will it write bytewise?

No idea. :)

> For that matter ... why "packed"?  To ensure that it can
> be un-aligned?  I thought it was pretty much guaranteed
> that an array of same-size values will have no padding.  :)

Again, I don't know much about this area.  This structure resides in the
register space of the host controller, so I didn't want any padding.  I
had noticed that EHCI makes sure to add the packed attribute to all its
register structures, so I added it here too.  The struct
xhci_doorbell_array pointer in xhci_hcd is declared as __iomem.

It would be helpful for someone to explain when to use packed and what
its implications are.

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux