From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.infotech.no ([82.134.31.41]:39924 "EHLO smtp.infotech.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751981AbbKOAKZ (ORCPT ); Sat, 14 Nov 2015 19:10:25 -0500 Reply-To: dgilbert@interlog.com To: linux-arm-kernel , USB list , Boris BREZILLON , "Ferre, Nicolas" , Felipe Balbi Cc: Alan Stern , stable@vger.kernel.org From: Douglas Gilbert Subject: [PATCH] Atmel USB High speed device port, speed fix Message-ID: <5647CBAE.4070908@interlog.com> Date: Sat, 14 Nov 2015 19:02:54 -0500 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050107060204040002010103" Sender: stable-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------050107060204040002010103 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Following changes that appeared in lk 4.0.0, the gadget udc driver for some ARM based Atmel SoCs (e.g. at91sam9x5 and sama5d3 families) incorrectly deduced full-speed USB link speed even when the hardware had negotiated a high-speed link. The fix is to make sure that the UDPHS Interrupt Enable Register value does not mask the SPEED bit in the Interrupt Status Register. For a mass storage gadget this problem lead to failures when the host had a USB 3 port with the xhci_hcd driver. If the host was a USB 2 port using the ehci_hcd driver then the mass storage gadget worked (but probably at a lower speed than it should have). Signed-of-by: Douglas Gilbert Cc: #4.0+ --------------050107060204040002010103 Content-Type: text/x-patch; name="atmel_udhs_int_mask.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="atmel_udhs_int_mask.patch" diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index f0f2b06..f92f5af 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -1633,7 +1633,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid) spin_lock(&udc->lock); int_enb = usba_int_enb_get(udc); - status = usba_readl(udc, INT_STA) & int_enb; + status = usba_readl(udc, INT_STA) & (int_enb | USBA_HIGH_SPEED); DBG(DBG_INT, "irq, status=%#08x\n", status); if (status & USBA_DET_SUSPEND) { --------------050107060204040002010103--