From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-ew0-f43.google.com ([209.85.215.43]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1R3WPi-0004bH-J4 for barebox@lists.infradead.org; Tue, 13 Sep 2011 17:04:51 +0000 Received: by ewy20 with SMTP id 20so564166ewy.16 for ; Tue, 13 Sep 2011 10:04:47 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1315823160-11664-1-git-send-email-antonynpavlov@gmail.com> <20110913073419.GX31404@pengutronix.de> Date: Tue, 13 Sep 2011 21:04:47 +0400 Message-ID: From: Antony Pavlov List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH] ehci-hcd.c: handle EHCI_HAS_TT in ehci_reset() during startup To: Sascha Hauer Cc: barebox@lists.infradead.org On 13 September 2011 16:14, Antony Pavlov wrote: > On 13 September 2011 11:34, Sascha Hauer wrote: >> On Mon, Sep 12, 2011 at 02:26:00PM +0400, Antony Pavlov wrote: >>> Signed-off-by: Antony Pavlov >>> --- >>> =A0drivers/usb/host/ehci-hcd.c | =A0 =A09 ++------- >>> =A01 files changed, 2 insertions(+), 7 deletions(-) >>> >>> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c >>> index 60fc181..883dc07 100644 >>> --- a/drivers/usb/host/ehci-hcd.c >>> +++ b/drivers/usb/host/ehci-hcd.c >>> @@ -921,15 +921,10 @@ static int ehci_probe(struct device_d *dev) >>> =A0 =A0 =A0 host->submit_control_msg =3D submit_control_msg; >>> =A0 =A0 =A0 host->submit_bulk_msg =3D submit_bulk_msg; >>> >>> - =A0 =A0 if (ehci->flags & EHCI_HAS_TT) { >>> - =A0 =A0 =A0 =A0 =A0 =A0 /* Set to host mode */ >>> - =A0 =A0 =A0 =A0 =A0 =A0 reg =3D ehci_readl(ehci->hcor + USBMODE); >>> - =A0 =A0 =A0 =A0 =A0 =A0 reg |=3D USBMODE_CM_HC; >>> - =A0 =A0 =A0 =A0 =A0 =A0 writel(reg, ehci->hcor + USBMODE); >>> - =A0 =A0 } >>> - >>> =A0 =A0 =A0 usb_register_host(host); >>> >>> + =A0 =A0 ehci_reset(ehci); >>> + >> >> ehci_reset is called from ehci_init. Isn't that enough or do we have to >> call it explicitely here? > > I suppose it's preferable reset the controller after changing "host > controller mode" bit (USBMODE_CM_HC). Let's check the file > drivers/usb/host/ehci-hcd.c from linux kernel sources, in ehci_reset() > we have: > > =A0 =A0if (ehci_is_TDI(ehci)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tdi_reset (ehci); > May be this "patch" (linux-style) will be better? host->submit_control_msg =3D submit_control_msg; host->submit_bulk_msg =3D submit_bulk_msg; if (ehci->flags & EHCI_HAS_TT) { - /* Set to host mode */ - reg =3D ehci_readl(ehci->hcor + USBMODE); - reg |=3D USBMODE_CM_HC; - writel(reg, ehci->hcor + USBMODE); + ehci_reset(ehci); } usb_register_host(host); -- = Best regards, =A0 Antony Pavlov _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox