[Cbe-oss-dev] [PATCH 1/5 v2] usb: Fix PS3 EHCI suspend
Antonio Ospite
ospite at studenti.unina.it
Mon Dec 5 07:19:13 EST 2011
On Fri, 2 Dec 2011 14:26:12 +0100
Geert Uytterhoeven <geert at linux-m68k.org> wrote:
> Hi Antonio,
>
> On Fri, Dec 2, 2011 at 10:30, Antonio Ospite <ospite at studenti.unina.it> wrote:
> > On Thu, 1 Dec 2011 16:19:18 -0800
> > Geoff Levand <geoff at infradead.org> wrote:
> >
> > [...]
> >> @@ -236,6 +240,30 @@ static int handshake_on_error_set_halt(struct ehci_hcd *ehci, void __iomem *ptr,
> >> int error;
> >>
> >> error = handshake(ehci, ptr, mask, done, usec);
> >> +
> >> + /*
> >> + * The EHCI controller of the Cell Super Companion Chip used in the
> >> + * PS3 will stop the root hub after all root hub ports are suspended.
> >> + * When in this condition handshake will return -ETIMEDOUT. The
> >> + * STS_HLT bit will not be set, so inspection of the frame index is
> >> + * used here to test for the condition. If the condition is found
> >> + * return success to allow the USB suspend to complete.
> >> + */
> >> +
> >> +#if defined(CONFIG_USB_SUSPEND) && defined(CONFIG_PPC_PS3)
> >> + if (firmware_has_feature(FW_FEATURE_PS3_LV1) && error == -ETIMEDOUT) {
> >> +#else
> >> + if (0) {
> >> +#endif
> >
> > Sometime I still have these doubts, forgive me:
> > Geoff is this done this way to keep the #endif as near as possible to
> > the #if? I mean wouldn't it be equivalent (even if one would be left out
> > by the preprocessor and the other by the compiler) to put the whole
> > conditional block inside the #if defined(CONFIG_PPC_PS3)?
>
> The advantage of the way Geoff did it is that the compiler will detect if
> someone breaks compilation for PS3 inside the block. With a big #ifdef
> around the block, only PS3 users (and linux-next) will notice.
>
I see, thanks Geert.
Regards,
Antonio
--
Antonio Ospite
http://ao2.it
PGP public key ID: 0x4553B001
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/cbe-oss-dev/attachments/20111204/13ceb096/attachment.pgp>
More information about the cbe-oss-dev
mailing list