diff mbox

3.7 kernel hangs when doing scp

Message ID 20121220043943.GA992@nchen-desktop (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Chen Dec. 20, 2012, 4:39 a.m. UTC
On Wed, Dec 19, 2012 at 12:56:12PM -0200, Fabio Estevam wrote:
> Hi Greg,
> 
> On Tue, Dec 18, 2012 at 12:43 AM, Greg KH <greg@kroah.com> wrote:
> > On Tue, Dec 18, 2012 at 12:01:35AM -0200, Fabio Estevam wrote:
> >> Hi,
> >>
> >> Booting a 3.7 kernel on a mx6qsabrelite board via NFS and using an
> >> asix USB/Ethernet adapter and then I try to transfer a 10MB file from
> >> the target to the host:
> >
> > Has this ever worked before on any older kernel?
> 
> We did more experiments on this and we noticed that:
> 
> - mx51 running kernel 3.7 does not show this problem (tested a non-dt
> mx51 kernel, which uses drivers/usb/host/ehci-mxc.c instead of the
> chipidea driver.)
> - x86 running 3.2 kernel does not show this problem
> - usb support on mx6 has appeared on 3.6, but running an out-of-tree
> 3.0.35 kernel also shows the same issue.
> - Doing long file transfers via mass storage on mx6 running 3.7 works fine.
> 
> Shawn/Sascha/Peter,
> 
> Any suggestions as to how debug this? By looking at the kernel dumps
> it seems to point to 'gic_handle_irq' area.
Hi Fabio,

Please to see if the Stream mode disable (bit4, usbmode) is set or not?
If it is not, please try below patch


> 
> Thanks,
> 
> Fabio Estevam
>

Comments

Fabio Estevam Dec. 20, 2012, 10:20 a.m. UTC | #1
Hi Peter,

On Thu, Dec 20, 2012 at 2:39 AM, Peter Chen <peter.chen@freescale.com> wrote:

> Please to see if the Stream mode disable (bit4, usbmode) is set or not?
> If it is not, please try below patch
>
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index c97503b..258bc02 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -227,6 +227,7 @@ static void tdi_reset (struct ehci_hcd *ehci)
>
>         tmp = ehci_readl(ehci, &ehci->regs->usbmode);
>         tmp |= USBMODE_CM_HC;
> +       tmp |= (1 << 4); /* disable stream mode */
>         /* The default byte access to MMR space is LE after
>          * controller reset. Set the required endian mode
>          * for transfer buffers to match the host microprocessor

Excellent! Your suggestion made scp work with mx6 on 3.7.

I assume that this "fix" or workaround would need a better place, right?

Should this fix go into the chipidea host driver instead?

Also, I wonder on how "standard" this USBMODE register is. i.e. there
is a deviation from the FSL EHCI USBMODE register.
I found it in include/linux/usb/ehci_def.h:

#define USBMODE_SDIS            (1<<3)          /* Stream disable */

, which is at a different bit position from the i.MX6 Reference Manual:

4 SDIS Stream Disable Mode. (0 - Inactive [default]; 1 - Active)

Also interested to know more details at to why disabling stream mode
make things work.

Thanks a lot!

Fabio Estevam
Fabio Estevam Dec. 20, 2012, 10:40 a.m. UTC | #2
On Thu, Dec 20, 2012 at 8:20 AM, Fabio Estevam <festevam@gmail.com> wrote:

> Excellent! Your suggestion made scp work with mx6 on 3.7.
>
> I assume that this "fix" or workaround would need a better place, right?
>
> Should this fix go into the chipidea host driver instead?

Also, we are already passing the CI13XXX_DISABLE_STREAMING flag:

static struct ci13xxx_platform_data ci13xxx_imx_platdata  = {
	.name			= "ci13xxx_imx",
	.flags			= CI13XXX_REQUIRE_TRANSCEIVER |
				  CI13XXX_PULLUP_ON_VBUS |
				  CI13XXX_DISABLE_STREAMING,
	.capoffset		= DEF_CAPOFFSET,
};

Regards,

Fabio Estevam
diff mbox

Patch

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index c97503b..258bc02 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -227,6 +227,7 @@  static void tdi_reset (struct ehci_hcd *ehci)
 
 	tmp = ehci_readl(ehci, &ehci->regs->usbmode);
 	tmp |= USBMODE_CM_HC;
+	tmp |= (1 << 4); /* disable stream mode */
 	/* The default byte access to MMR space is LE after
 	 * controller reset. Set the required endian mode
 	 * for transfer buffers to match the host microprocessor