Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753161AbbBMJHj (ORCPT ); Fri, 13 Feb 2015 04:07:39 -0500 Received: from mga02.intel.com ([134.134.136.20]:43805 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753113AbbBMJHd (ORCPT ); Fri, 13 Feb 2015 04:07:33 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,569,1418112000"; d="scan'208";a="454117863" Message-ID: <54DDBF16.2080807@intel.com> Date: Fri, 13 Feb 2015 11:08:38 +0200 From: Mathias Nyman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Sneeker Yeh , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Felipe Balbi , Greg Kroah-Hartman , Grant Likely , Huang Rui , Kishon Vijay Abraham I , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org CC: Andy Green , Jassi Brar , Sneeker Yeh Subject: Re: [PATCH v3 1/5] xhci: add a quirk for device disconnection errata for Synopsis Designware USB3 core References: <1422173608-24355-1-git-send-email-Sneeker.Yeh@tw.fujitsu.com> <1422173608-24355-2-git-send-email-Sneeker.Yeh@tw.fujitsu.com> In-Reply-To: <1422173608-24355-2-git-send-email-Sneeker.Yeh@tw.fujitsu.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1307 Lines: 42 On 25.01.2015 10:13, Sneeker Yeh wrote: Oh, and one more thing: > > +static void xhci_try_to_clear_csc(struct usb_hcd *hcd, int dev_port_num) > +{ > + int max_ports; > + struct xhci_hcd *xhci = hcd_to_xhci(hcd); > + __le32 __iomem **port_array; > + u32 status; > + > + /* print debug info */ > + if (hcd->speed == HCD_USB3) { > + max_ports = xhci->num_usb3_ports; > + port_array = xhci->usb3_ports; > + } else { > + max_ports = xhci->num_usb2_ports; > + port_array = xhci->usb2_ports; > + } > + > + if (dev_port_num > max_ports) { > + xhci_err(xhci, "%s() port number invalid", __func__); > + return; > + } > + status = readl(port_array[dev_port_num - 1]); > + > + /* write 1 to clear */ > + if (!(status & PORT_CONNECT) && (status & PORT_CSC)) > + writel(status & PORT_CSC, port_array[0]); We don't want to write back all the bits we read from the PORTSC register. Use the xhci_put_state_to_neutral(status) helper function to mask out some RW1C bits. This in addition to writing to the correct PORTSC register as I previously mentioned. -Mathias -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/