From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Subject: Re: [PATCH v3 03/12] usb: ehci-hcd: notify phy when connect change Date: Tue, 5 Jun 2012 19:23:08 +0200 Message-ID: <201206051923.09063.marex@denx.de> References: Mime-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Alan Stern Cc: Alexander Shishkin , B29397-KZfg59tc24xl57MIdRCFDg@public.gmane.org, B20596-KZfg59tc24xl57MIdRCFDg@public.gmane.org, shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org, dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org, linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, balbi-l0cyMroinI0@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org List-Id: devicetree@vger.kernel.org Dear Alan Stern, > On Tue, 5 Jun 2012, Marek Vasut wrote: > > > > > + /* FIXME: > > > > > + * - it does not work for multi-phy ehci > > > > > + * - the best place is after debounce, but I can't get > > > > > + * phy there > > > > > + */ > > > > > + if ((pstatus & PORT_CSC) && ehci->transceiver) { > > > > > > Do the tests in the opposite order and add "unlikely": > > > if (unlikely(ehci->transceiver && > > > > > > (pstatus & PORT_CSC)) { > > > > > > That way it will fail more quickly on systems where it doesn't apply or > > > for unaffected ports. > > > > Does this unlikely() have any effect on ARM/MIPS/PPC, where this chipidea > > IP is used ? Or is there some x86 device sporting this IP too? > > I don't know what unlikely() does on architectures other than x86. It should be optimized out to nothing on anything else but x86. On x86 it is a hint for the branch predictor. Or that's what I believe it is. > And > I haven't heard of any x86 systems that would need to use this code. > > On the other hand, port-status changes don't occur very frequently. A > little time penalty one way or the other won't make much difference. I'm not opposed, just curious :) > Alan Stern Best regards, Marek Vasut -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html