From patchwork Mon Mar 14 10:34:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 8578051 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E94E19F294 for ; Mon, 14 Mar 2016 10:34:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3456720384 for ; Mon, 14 Mar 2016 10:34:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6845820377 for ; Mon, 14 Mar 2016 10:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755649AbcCNKee (ORCPT ); Mon, 14 Mar 2016 06:34:34 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:10811 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755647AbcCNKed (ORCPT ); Mon, 14 Mar 2016 06:34:33 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie3.idc.renesas.com with ESMTP; 14 Mar 2016 19:34:31 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id C38AC4963D; Mon, 14 Mar 2016 19:34:31 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id B3D581806F; Mon, 14 Mar 2016 19:34:31 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id AC5C61800A; Mon, 14 Mar 2016 19:34:31 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id VAA22598; Mon, 14 Mar 2016 19:34:31 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="206318442" Received: from mail-pu1apc01lp0022.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.22]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 14 Mar 2016 19:34:30 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesasgroup-onmicrosoft-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=B8zq5a62TfBQm+LaxYaB4ssJEsS3C02EcF9dIs23DEU=; b=CUQ1un/qjhWtifqsoi3UTe508VlmIIKNqsfaFJs2IXGAjZ7SdQ7uydMsRX/lDzkpl+IRpdMQGXPFg1jX4hG9tQgNUTT5pyJzwMf8Wh6m5VzacR4lilajuOEXBpU1ockqmgSZtCJTiTeXayHyrmJ3yAHWEmMLouTGqK8EuNrR04Q= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=none action=none header.from=renesas.com; Received: from localhost (211.11.155.144) by SG2PR06MB0919.apcprd06.prod.outlook.com (10.162.204.152) with Microsoft SMTP Server (TLS) id 15.1.434.16; Mon, 14 Mar 2016 10:34:27 +0000 From: Yoshihiro Shimoda To: , CC: , , Yoshihiro Shimoda Subject: [PATCH v3 1/2] usb: host: xhci: add a new quirk XHCI_NO_64BIT_SUPPORT Date: Mon, 14 Mar 2016 19:34:12 +0900 Message-ID: <1457951653-7516-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1457951653-7516-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1457951653-7516-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR0201CA0029.apcprd02.prod.outlook.com (25.164.90.167) To SG2PR06MB0919.apcprd06.prod.outlook.com (25.162.204.152) X-MS-Office365-Filtering-Correlation-Id: eedc6aa0-d3ea-4320-7794-08d34bf43890 X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0919; 2:4Z05B8aBbRJx7tld6CSIhZ5yz1kDXDNxuxLWOQT4W+4cMwKdhFtgDs7OFgARreFvS0Tpa26BEUHHBPBSGOHejXCoghtcWV2LYyh0atVxUxJt43GiyRNVTeynZMOSFKqwp7IiE2NTNDcUkmAeL2txWfAW2lkj3opj26fVF5Iz8AFZp1VixnqMZX/Bd/LPvq5f; 3:UWLbJPbG6Hv+uWRRPweXNS/xMwRecdVeZIsRf1CXo0rFlmglsRgZB6SP89pnJCOq/KqPKgospAoyCFXBNjScoCRMAU/Y6D5tODAsOFKBbkhCfLV/rJB+yS2gKwUBRCqq; 25:BQ2suO3B8pqwW376yQiBwOAnwIo3DDZq6RYx4PfcZeiHjriQxWeYGjZVj57umGf27i2GOw2OS3JHZ1al6s1NQCG4fCDDRCxLSpoIiOotPxBDsrdRMYB6hJDcR3MNna8/KhGGlbsa4MJs1sEZot//7X+1ATE5fQx06j8gVcXF+hGuvTbforM9iRrKpGXEC2qDGwduWRTdneo43rrB0ngqgbk4eyWtUPNNrrnSzkcUjmWz5fa8mKF0GKOqA9Vto/e7lFY6uE9/JYBtjZqG1wTigh39vU+nz+8LorJtr24CAHycFIh383gkkfEH6gx0RpliRNLN3zVxQoJyN8A5AA74iQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0919; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0919; 20:K9s/tumEXuSGSsYQ1Ew0+iBOsP7Lfc1OAWY/31FGfVnrvRCx2h530ECcJ6XrAh+s0q2jaR633KmPFpGWwGSnY++oNFwWRv+UgKEqGQeZ3plqfg2LNa6NP3ukWF6YaWZwi/akp/MQEmL4lpHwnJL+T9BG6KtDV9s/1WtJxHHDS0pTMnyUNUBN6wLjjfSEna1msadYF7+M27IOIeWwRZqSh5k57URoawVWd8XIw5ajb+9YfIuFElFaseGGMiwyP3T0dYqvwjRzpDAjWFrvX9nfTXqLcRcC5/iNpzbnXuRjdKBVDrO/0YU5JHg0KTnQiZdvuy+964oItQMhkIEBlEdPfLV4QsoO1Ul7LChHcenGrvfAUPK2W1Jl/6SPjmvoFGmtIBu6eowv6iXTikKjYiTiT8ffLR11JmduBMJostD6QYXgTUzu2u+YHMYUKFbs8yMR2ProjKQCBeFuvS0IywI21fojecsAUjtbWqOdwOH0qkS/wSjjXbNekf6bcIhFV3N9; 4:k2/to/K6z8dS2QUTuGDukJU5byH2wvxTZrItV9feg9/Wb/ShPmyJ5DJyOgQtnkJUCMT/jrwzNKoFiWmhntYCYarfgvzEKUkWacsV245T4mU85PCv27j5MWO46sFZ9S9wi4jYQmnsPak/k9C/nA+eHyXKdIJSh3EQznBxtXhmFCKO/ZMREC9ED8MUwAUu9xqttoSmqC5MWLgmK6zPPAA8qszQiuJMXeCLRfy7BdzbSK7xZHwhs1YP5HqGkurkm81jagG3avCCF08oRrj5DF3wVAqXY7SmEpqvX7OkJjkzYWzinzCVX0QrXDIveCLS1nE5DftrNy90Grrw9wXNjoUKEg1JlP5cDUBb30g8c+pjZgNSGmgI/diUgeXM4ySDwDlW X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:SG2PR06MB0919; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0919; X-Forefront-PRVS: 0881A7A935 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6069001)(6009001)(42382002)(575784001)(76506005)(42186005)(36756003)(33646002)(1096002)(50466002)(50226001)(77096005)(66066001)(2906002)(5003940100001)(19580395003)(586003)(4326007)(5008740100001)(229853001)(78352003)(5004730100002)(81166005)(48376002)(3846002)(92566002)(50986999)(189998001)(76176999)(5001770100001)(2950100001)(47776003)(4001430100002)(107886002)(6116002)(15760500001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0919; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB0919; 23:RUNgx6ba4DWCD3HgMTmcVoKqIvwzTnivkdYAYKfvR?= =?us-ascii?Q?drqsGNukcPJEf8xHD8cLI+AP+9Rxr4Kn4HEcDU+xq3tqPTRyRONMyKs9JulX?= =?us-ascii?Q?zQIO0Ln5t5A8I8EJ05iNg78fO5Tk+z2P6YcdeckRU3gtywS5CtVW6YKJVNbO?= =?us-ascii?Q?hA1NZvXH7/MQnpZ/Ej9oRtn7bV8keM9Nj8qaQT6v/leIyAqG94+vxh9CaSy2?= =?us-ascii?Q?ikavzsYUZz6dUGowiAsHl4p4wBUNN1DkpYi+g/7rWlNCKUo0zdHHNhg+eZ1z?= =?us-ascii?Q?XbK7q+X8vfOJ705YOvJvUNtcI7QCPMoqmrCGF8tEvzhSL1OSRSUjLS/f4C9W?= =?us-ascii?Q?6Oq1vlsEfpGbHAaYraKJzDVATkewAjsOdCAHJKBgVYwDKQq1zDsW5Re6xuWV?= =?us-ascii?Q?NDNmYU+cGj7aAZ56szwPbTck0w/SOtTGC5U4q+Um+Cp9j4Co2qQp/RBJ4EsM?= =?us-ascii?Q?i6DwUpbyEVkTlqovAkV7vlAwyIuK5rm1Enecujgcs9HrN/8vr11Gki2Xg8Yb?= =?us-ascii?Q?0HXqwYyjDAh4Kmdxd31NrtlbMfGUk4ch7Br1waNpZ2R+DEswZEuibXvrVaLd?= =?us-ascii?Q?QYxq6vxJlqcnpYdlWWcuLkCDDqxA+VLk3PoRw4MJUyYFhLJ71kcIP+CBXSSo?= =?us-ascii?Q?L7oMQR9S9tOyWLAtGxAtqRpx/JC4FjQhcex72rN86Q+OVkn/Do51M1YPaZzM?= =?us-ascii?Q?qoftPexh2kKuIMSSzuL2Up4jkDHaB7DuZNWsH/dspJdfNKiP8jWqTDv2uk7m?= =?us-ascii?Q?v+QExz+g2WwoXOk4PQqE1zEvBdMd8pyR4Fdos0FHm4FpZaDuGTaocHTzWnrj?= =?us-ascii?Q?y+El+SeX9I0Nle2R/l5xeKTNpDKRLB5s1uOqzU6oHsYtl9ewvEHI5qZwtKrv?= =?us-ascii?Q?4VbGrt19lU+pfUdEzVUaLudDIW/XW4fLtAlCQB2Fh+rXOBt2izib1PXK2189?= =?us-ascii?Q?2bpKHs92eqcfKryEg8jbdy8iOH89obsYSTGPcWz2zt88SwMHOnQ7+dMKqcWI?= =?us-ascii?Q?gbbZaSwBQkJvMTASlFyJ08j?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0919; 5:3hmMV1p4+2yZjlc8ZqY783bKEMF9AhuAWQcg/dpZAEip1wN2sBjBy4Y8RHOsp4lD/pPLokIz/TJrEE4cMtU1t/0KY+2WpoPSSEpgtl2cI7z4XyBiVCR9vUCdk0KSw8oLfVPrHCZQecvVMb39t3xqzw==; 24:fLkAmCFHK3oUwToMNY5NgE+Cjx2/5iXhrAbrXfnuqZHSUmAUft8nKTqv32n909lRqsqhMfVyj8RfhC9Stawh7AFL/LM2z+m9Ed/AgtV7aYc=; 20:TKkPMyWv665demz3BAL6qxrAUSs42bAk70seC7SJ5n5hdeV8E4SabT68dZO43WdFHkO1rZe85PQwQPjcU6Bj3E7Hgn3/NdVhJLhlvsQRsR9OZaxqpyDzfHeW1GEyR0SpH9Sx1fiMGC2W7tc2iLwicsIMrybFrm9LByVLvftvLcY= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2016 10:34:27.9498 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0919 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On some xHCI controllers (e.g. R-Car SoCs), the AC64 bit (bit 0) of HCCPARAMS1 is set to 1. However, the xHCs don't support 64-bit address memory pointers actually. So, in this case, this driver should call dma_set_coherent_mask(dev, DMA_BIT_MASK(32)) in xhci_gen_setup(). Otherwise, the xHCI controller will be died after a usb device is connected if it runs on above 4GB physical memory environment. So, this patch adds a new quirk XHCI_NO_64BIT_SUPPORT to resolve such an issue. Signed-off-by: Yoshihiro Shimoda --- drivers/usb/host/xhci.c | 10 ++++++++++ drivers/usb/host/xhci.h | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index d51ee0c..489706f 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4948,6 +4948,16 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) return retval; xhci_dbg(xhci, "Reset complete\n"); + /* + * On some xHCI controllers (e.g. R-Car SoCs), the AC64 bit (bit 0) + * of HCCPARAMS1 is set to 1. However, the xHCs don't support 64-bit + * address memory pointers actually. So, this driver clears the AC64 + * bit of xhci->hcc_params to call dma_set_coherent_mask(dev, + * DMA_BIT_MASK(32)) in this xhci_gen_setup(). + */ + if (xhci->quirks & XHCI_NO_64BIT_SUPPORT) + xhci->hcc_params &= ~BIT(0); + /* Set dma_mask and coherent_dma_mask to 64-bits, * if xHC supports 64-bit addressing */ if (HCC_64BIT_ADDR(xhci->hcc_params) && diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index e293e09..70f215c 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1641,6 +1641,7 @@ struct xhci_hcd { #define XHCI_PME_STUCK_QUIRK (1 << 20) #define XHCI_MTK_HOST (1 << 21) #define XHCI_SSIC_PORT_UNUSED (1 << 22) +#define XHCI_NO_64BIT_SUPPORT (1 << 23) unsigned int num_active_eps; unsigned int limit_active_eps; /* There are two roothubs to keep track of bus suspend info for */