From patchwork Mon Jun 10 11:39:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jung Daehwan X-Patchwork-Id: 13691924 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6D2D7CF3A for ; Mon, 10 Jun 2024 11:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718019537; cv=none; b=p/26Kwl84SNT7nH/ETgpIKpkcdJK2b2zLC2dqlH1gIpI/jigeFWjj4w+TKp5uoGqxJmmLzW8xhuLPV3nzsSLIv7mZdBVpLoZr9zaY55m1NJEAsvXdNy4XgJjJ5JacwHcigOXXSHuIWPx0cgiAoupVaRZJvwGdC8puTiZGzy3Ajs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718019537; c=relaxed/simple; bh=4g0jh8mVTXXIWWd6K8v/g22BWViRX2KKtDtoBlE5OWo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:Content-Type: References; b=oSZp6Z/g2l91E/K30VNxxnzyaVjbILuGctovZpXbdPcKgaQGrC+nYV3YFiHebn7366Uceh5waCZcHnHUrVY01GGTLhS8BwfaLELckAUJr2t1nInRHTd+VGrZWQ9wdeOYo+4F87rxjwKfiPhs66pqAQY3O6NArcu5FuVLe8wRCZ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=t55c8XQt; arc=none smtp.client-ip=203.254.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="t55c8XQt" Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20240610113850epoutp0432de14717d5112d8daf3a4a7cb9a155b~XoakL6_Zl1836418364epoutp04B for ; Mon, 10 Jun 2024 11:38:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20240610113850epoutp0432de14717d5112d8daf3a4a7cb9a155b~XoakL6_Zl1836418364epoutp04B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1718019530; bh=CYNsfsElRoaTG9v3KypueJ6qSMPhqLeAdpy+lkpm4r0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t55c8XQtKtc9f09itfza3EDkv6W7X6wMTdP9vT6ovF24m75lblYCRfWl/JZLMgKhY 6ZiQLPcp2KAWHhoZUWYQMitMIRNrOmYeJg2XkkzinbSbVZThOue7ge3NwAXI+B0rDh q7DL3qj1LxRFrzAZk3chOgIJNHKUZhgu9MOzofxQ= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20240610113849epcas2p388dc65dc0f10e659b47a897794f7946b~Xoaj3mQwl2563025630epcas2p3g; Mon, 10 Jun 2024 11:38:49 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.89]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4VyVF52xsYz4x9Pv; Mon, 10 Jun 2024 11:38:49 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id C2.F3.09485.9C5E6666; Mon, 10 Jun 2024 20:38:49 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20240610113848epcas2p3742cffc295e0ebb35713a761c06e1c47~Xoai0nwFN2563025630epcas2p3f; Mon, 10 Jun 2024 11:38:48 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240610113848epsmtrp18a605a9b73dccedda64478d9dbc69a99~Xoai0CNZ92145221452epsmtrp1c; Mon, 10 Jun 2024 11:38:48 +0000 (GMT) X-AuditID: b6c32a46-19bfa7000000250d-56-6666e5c96fff Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id BF.57.18846.8C5E6666; Mon, 10 Jun 2024 20:38:48 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [10.229.95.128]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240610113848epsmtip2812169bd042b5df7bfa52ac1001c6990~Xoain6lk21349813498epsmtip2d; Mon, 10 Jun 2024 11:38:48 +0000 (GMT) From: Daehwan Jung To: Greg Kroah-Hartman , Thinh Nguyen , Mathias Nyman Cc: linux-usb@vger.kernel.org (open list:USB SUBSYSTEM), linux-kernel@vger.kernel.org (open list), h10.kim@samsung.com, Daehwan Jung Subject: [PATCH v3 1/3] usb: dwc3: Support quirk for writing high-low order Date: Mon, 10 Jun 2024 20:39:11 +0900 Message-Id: <1718019553-111939-2-git-send-email-dh10.jung@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1718019553-111939-1-git-send-email-dh10.jung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJKsWRmVeSWpSXmKPExsWy7bCmue7Jp2lpBhcbhC3uLJjGZNG8eD2b xd/bF1ktLu+aw2axaFkrs0XzpimsFqsWHGB3YPdYvOclk8f+uWvYPfq2rGL02LL/M6PH501y AaxR2TYZqYkpqUUKqXnJ+SmZeem2St7B8c7xpmYGhrqGlhbmSg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ALMWRmVeSWpSXmKPExsWy7bCSvO6Jp2lpBpe+a1ncWTCNyaJ58Xo2 i7+3L7JaXN41h81i0bJWZovmTVNYLVYtOMDuwO6xeM9LJo/9c9ewe/RtWcXosWX/Z0aPz5vk AlijuGxSUnMyy1KL9O0SuDIafikU3OCp6Dwwi7GB8TBXFyMnh4SAicSO+YfZQWwhge2MEl+X 10PEJSWWzr3BDmELS9xvOcLaxcgFVPONUeLpg58sXYwcHGwCWhLfFzKCxEUEuhglHmy6wwLi MAssYpR403uHEaRIWMBbYvFlK5BBLAKqEguPTmYFCfMKuEnsXyUGMV9O4ua5TmYQm1PAXeLl /L8sEPe4SZw9vYplAiPfAkaGVYyiqQXFuem5yQWGesWJucWleel6yfm5mxjBgaYVtINx2fq/ eocYmTgYDzFKcDArifAKZSSnCfGmJFZWpRblxxeV5qQWH2KU5mBREudVzulMERJITyxJzU5N LUgtgskycXBKNTDlTLxVuPzYiYZVQjZGwTNvMG2fwWI/Jflayr0Jxi1lCfd8hAJlJhquu/iq tKVm4c21a0yXOb01SRFxzBM9klI44fv/p6LMq7V5812O3pLcMnH5w1f2dYdvLaj7x5vzpeEU v1zK+nVMN59791k6HWv/3vzn/wznD6Iv9ktKMy7Kb/1yR7TPmO3TgVlPvlUz+SQsX9IdfMn8 dPyEbQsC95b4sfBftZnSWrXllWr6Mv6yK+xTszuKDGVv/bitNTX6U5fOrDlmP+8+m2JWtDid 5cb1X/O2SL44cmFG0LmDrlJTpX4dvK3q+b6Jv8U6rXeT7kO2xLNWhYd0DVZLrpsgWX+ob/GO iFOf58rkm6xRK/5YpsRSnJFoqMVcVJwIANFQsLqjAgAA X-CMS-MailID: 20240610113848epcas2p3742cffc295e0ebb35713a761c06e1c47 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240610113848epcas2p3742cffc295e0ebb35713a761c06e1c47 References: <1718019553-111939-1-git-send-email-dh10.jung@samsung.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: There's the limitation of Synopsys dwc3 controller with ERST programming in supporting separate ERSTBA_HI and ERSTBA_LO programming. It's supported when the ERSTBA is programmed ERSTBA_HI before ERSTBA_LO. But, writing operations in xHCI is done low-high order following xHCI spec. xHCI specification 5.1 "Register Conventions" states that 64 bit registers should be written in low-high order. Synopsys dwc3 needs workaround for high-low order. That's why adding new quirk is needed to support this. Signed-off-by: Daehwan Jung --- v1 -> v2: - this patch is added newly in the patchset - add a property in dwc3 structure v2 -> v3: - add change note - add description in commit message - remove the property in dwc3 structure to pass it unconditionally --- drivers/usb/dwc3/host.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index a171b27..e0533ce 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -126,7 +126,7 @@ static int dwc3_host_get_irq(struct dwc3 *dwc) int dwc3_host_init(struct dwc3 *dwc) { - struct property_entry props[5]; + struct property_entry props[6]; struct platform_device *xhci; int ret, irq; int prop_idx = 0; @@ -162,6 +162,8 @@ int dwc3_host_init(struct dwc3 *dwc) props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-sg-trb-cache-size-quirk"); + props[prop_idx++] = PROPERTY_ENTRY_BOOL("write-64-hi-lo-quirk"); + if (dwc->usb3_lpm_capable) props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-lpm-capable"); From patchwork Mon Jun 10 11:39:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jung Daehwan X-Patchwork-Id: 13691926 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 365E780055 for ; Mon, 10 Jun 2024 11:38:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718019541; cv=none; b=CmDQN/oiPai65DUDjKxK/JL796CDiTP3jjQzH0Uz6XKGPL1rBtIYgJUBSwEmx2+gvZ9CYiL5n+aI3XsMRcjR4HuHDqg/W67BSshp4Yhi/Fd41BJRXEJ0ryWbvIulWagMk1pUCspEZ6R/+Ck7LSY0GW+wkZBsocMJKzp6Y3M3jp4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718019541; c=relaxed/simple; bh=ICqFw5ZZMvRyWPAU8BnmipUzEkrscSUQMD/V8Z0VPtw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:Content-Type: References; b=Pu50VPMqXlrQ2hNwiiEppAehnUZPV9/bDqCOWnNZ0PBa0mtkYsHvgWch5EzJuxLa1sK5D+be3zfPVhbEGiNdNgGFQiOZtZFzHMJ3s7xW7TUgIAu5TWqA2gU7ooJW4BlPx6sVPk9PSWewaRyy+d78G+UIbXRm28XT2a6Vv2arKaw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=IYPrkSrx; arc=none smtp.client-ip=203.254.224.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="IYPrkSrx" Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20240610113850epoutp020320fbb1494bf03610a9300a208ea773~Xoakjws6l3236132361epoutp02b for ; Mon, 10 Jun 2024 11:38:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20240610113850epoutp020320fbb1494bf03610a9300a208ea773~Xoakjws6l3236132361epoutp02b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1718019530; bh=TV4KTUZnCE6pjbCnux0zhwSr84BxKZ1ykWq8bSkM1YM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IYPrkSrxzaUXnstAf9uz1tnO4fEz2hjiwmi2eqGiOuzLG2LFsoZVw70S5wnDmqoTa GXJATXOnSSN9JD3z7eTch/Gpah9kFV5cabXOiH5+5O90h5lu1vMRIe8DB7v3vZcO0B sxJ6GrfD65xpl+MK0XmR/rgP8x7fENNUkqM/cI6Q= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20240610113850epcas2p4c8b75587503830ebfc0c82433a4860ca~XoakLIBum1513815138epcas2p44; Mon, 10 Jun 2024 11:38:50 +0000 (GMT) Received: from epsmgec2p1.samsung.com (unknown [182.195.36.91]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4VyVF56gm0z4x9Pt; Mon, 10 Jun 2024 11:38:49 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmgec2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 1F.55.56241.9C5E6666; Mon, 10 Jun 2024 20:38:49 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20240610113849epcas2p225c0dde8fbb833e37be9c2b63850d520~XoajYipcq0449004490epcas2p2p; Mon, 10 Jun 2024 11:38:49 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240610113849epsmtrp22ef630505b243d015bef204cf00f8ff3~XoajX4s9F2502825028epsmtrp28; Mon, 10 Jun 2024 11:38:49 +0000 (GMT) X-AuditID: b6c32a43-c03fd7000000dbb1-bf-6666e5c943c1 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 30.67.18846.9C5E6666; Mon, 10 Jun 2024 20:38:49 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [10.229.95.128]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240610113849epsmtip2a0da05666ea452d474f28f6ad3d81aad~XoajNecFO1786817868epsmtip2o; Mon, 10 Jun 2024 11:38:49 +0000 (GMT) From: Daehwan Jung To: Greg Kroah-Hartman , Thinh Nguyen , Mathias Nyman Cc: linux-usb@vger.kernel.org (open list:USB SUBSYSTEM), linux-kernel@vger.kernel.org (open list), h10.kim@samsung.com, Daehwan Jung Subject: [PATCH v3 2/3] xhci: Add a quirk for writing ERST in high-low order Date: Mon, 10 Jun 2024 20:39:12 +0900 Message-Id: <1718019553-111939-3-git-send-email-dh10.jung@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1718019553-111939-1-git-send-email-dh10.jung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNKsWRmVeSWpSXmKPExsWy7bCmme7Jp2lpBt8nGFvcWTCNyaJ58Xo2 i7+3L7JaXN41h81i0bJWZovmTVNYLVYtOMDuwO6xeM9LJo/9c9ewe/RtWcXosWX/Z0aPz5vk Alijsm0yUhNTUosUUvOS81My89JtlbyD453jTc0MDHUNLS3MlRTyEnNTbZVcfAJ03TJzgM5Q UihLzCkFCgUkFhcr6dvZFOWXlqQqZOQXl9gqpRak5BSYF+gVJ+YWl+al6+WlllgZGhgYmQIV JmRntD4LLNgnUNH2+xBzA+MP3i5GTg4JAROJg9ObWLoYuTiEBHYwSnTM/MQG4XxilJi5bS0j nNPdPYEdpuX1oZPsEImdjBJbd86C6v/BKPH76kkgh4ODTUBL4vtCsG4RgQ5GiaPP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ok9OxYCJTg42AS0JL4vZASJiwh0MUo82HSHBcRh FljEKPGm9w4jSLewgI9Ea89tsEksAqoSRw4+ZAJp5hVwk/i9XhBigZzEzXOdzCA2p4C7xMv5 f8GOEAIqOXt6FcsERr4FjAyrGEVTC4pz03OTCwz1ihNzi0vz0vWS83M3MYKDTStoB+Oy9X/1 DjEycTAeYpTgYFYS4RXKSE4T4k1JrKxKLcqPLyrNSS0+xCjNwaIkzquc05kiJJCeWJKanZpa kFoEk2Xi4JRqYNooPDWOc+riI50Laqwy/aw0/YtPyfLxf72yiFOt6ZlrXdfyfEtewYCnc9uU 7y7XkTtYGbw3UN8hIube5MbFE7dmvN292uV279N9O3M4dB+48d49dYlr74NvDjU2OU2vLd0i 2Q+bHZilEN6cIPlT0jTB/8+fiS/mO87K/3sq4Jxt4bKS6zfU7kp9uf2N6ygr27nLOWm7WVwO /Embam675fXhXbuP+hz38Q3cPvukoOkjjoX/lO78OzONcd/K3Zx8e44eSji4Mzf7hdHND5/W Oq34tflHxYR3Gtdt274tvXW94vbGGaG2XNLP+jz0BP2LWw/r+s2S7zUNerZeRmvGuo4zlzZN t4/eYpZ7wn+u6WNDJZbijERDLeai4kQAPsykD6UCAAA= X-CMS-MailID: 20240610113849epcas2p225c0dde8fbb833e37be9c2b63850d520 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240610113849epcas2p225c0dde8fbb833e37be9c2b63850d520 References: <1718019553-111939-1-git-send-email-dh10.jung@samsung.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: This quirk is for the controller that has a limitation in supporting separate ERSTBA_HI and ERSTBA_LO programming. It's supported when the ERSTBA is programmed ERSTBA_HI before ERSTBA_LO. That's because the internal initialization of event ring fetches the "Event Ring Segment Table Entry" based on the indication of ERSTBA_LO written. Signed-off-by: Daehwan Jung --- RFC -> v1: - add a quirk in xhci - use the quirk for programming ERST high-low order v1 -> v2: - none v2 -> v3: - none --- drivers/usb/host/xhci-mem.c | 5 ++++- drivers/usb/host/xhci.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 3100219..ef768e6 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -2325,7 +2325,10 @@ xhci_add_interrupter(struct xhci_hcd *xhci, struct xhci_interrupter *ir, erst_base = xhci_read_64(xhci, &ir->ir_set->erst_base); erst_base &= ERST_BASE_RSVDP; erst_base |= ir->erst.erst_dma_addr & ~ERST_BASE_RSVDP; - xhci_write_64(xhci, erst_base, &ir->ir_set->erst_base); + if (xhci->quirks & XHCI_WRITE_64_HI_LO) + hi_lo_writeq(erst_base, &ir->ir_set->erst_base); + else + xhci_write_64(xhci, erst_base, &ir->ir_set->erst_base); /* Set the event ring dequeue address of this interrupter */ xhci_set_hc_event_deq(xhci, ir); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 3041515..8664dd1 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -17,6 +17,7 @@ #include #include #include +#include /* Code sharing between pci-quirks and xhci hcd */ #include "xhci-ext-caps.h" @@ -1627,6 +1628,7 @@ struct xhci_hcd { #define XHCI_RESET_TO_DEFAULT BIT_ULL(44) #define XHCI_ZHAOXIN_TRB_FETCH BIT_ULL(45) #define XHCI_ZHAOXIN_HOST BIT_ULL(46) +#define XHCI_WRITE_64_HI_LO BIT_ULL(47) unsigned int num_active_eps; unsigned int limit_active_eps; From patchwork Mon Jun 10 11:39:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jung Daehwan X-Patchwork-Id: 13691925 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0052B7D088 for ; Mon, 10 Jun 2024 11:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718019538; cv=none; b=GOYVysQImfUDHVOCINeiMvKQ7kpPbpNTmMshP2r71IB4ivmRa6PYIS1X55uq+tHp3bqw6cBR581jnTNg1RH2TtBjStgn00ne9SpFBt4GYzsRdEpTOGimB8EpLHXZI8ktC1nhcTSWL+jgX6y8hDyEPj34+I8VmmFRsVBDGoeJ+EI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718019538; c=relaxed/simple; bh=w4aoBE2RHPHu2ZSiA+i0yxvAaX2L0ErPKpUGuL84L88=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:Content-Type: References; b=Y/pRhjmHJ6zRfNk4BsCOGQj72uCAZg80XwTEy1UA8RhqfFOKUbqk3/JJyu6SpdkruFZ07uuGmJcAe9/9lnwmJBNueo5X8Hvl+nEaFklf1HENAr4CXThf4pZybQlVfv9sF4S8cd8zNb7rWx07i5wQu7wYcJ2yqPSIGrQFlUinrkE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=jy7fJjkQ; arc=none smtp.client-ip=203.254.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="jy7fJjkQ" Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20240610113852epoutp0441c90ede8f10c82566e60479bd2c5a1f~Xoal0rwlj2028920289epoutp04G for ; Mon, 10 Jun 2024 11:38:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20240610113852epoutp0441c90ede8f10c82566e60479bd2c5a1f~Xoal0rwlj2028920289epoutp04G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1718019532; bh=JxfLXLQD8x6rYjmBvtf0D1L1IPRfMZxdKMeIJSsIEUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jy7fJjkQ2G3HbCVR4a0gTk/+we1dtDbCi0OPYeFQAVwlg7QdrNLIGQVWBinNKOQuw MHaUnh2pgAQ1iPNw7w9tWX7fA4grGz2I/Rs7oLu2/XZgmKcvZst12HhNu4TATC/p+K Zv4esQu8uJt8QNuOJwu1FGGjsYZwVn9I11QpXnnE= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20240610113850epcas2p30a935a008aea087500307f1836f90d32~XoaknCzlL2317623176epcas2p35; Mon, 10 Jun 2024 11:38:50 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.88]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4VyVF61SWvz4x9Pv; Mon, 10 Jun 2024 11:38:50 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id EB.6F.09806.AC5E6666; Mon, 10 Jun 2024 20:38:50 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20240610113849epcas2p4a61cf754aeb74e62fbcc305f3e5dac59~XoajzS1Bv1984319843epcas2p4B; Mon, 10 Jun 2024 11:38:49 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240610113849epsmtrp15769d572ecd01bfd5af42ac753b30462~Xoajyp4o82171421714epsmtrp1P; Mon, 10 Jun 2024 11:38:49 +0000 (GMT) X-AuditID: b6c32a47-c6bff7000000264e-db-6666e5cab052 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 80.52.08622.9C5E6666; Mon, 10 Jun 2024 20:38:49 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [10.229.95.128]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240610113849epsmtip277a0976d343b66485873ab18d29d59be~XoajnR-TK1851618516epsmtip2H; Mon, 10 Jun 2024 11:38:49 +0000 (GMT) From: Daehwan Jung To: Greg Kroah-Hartman , Thinh Nguyen , Mathias Nyman Cc: linux-usb@vger.kernel.org (open list:USB SUBSYSTEM), linux-kernel@vger.kernel.org (open list), h10.kim@samsung.com, Daehwan Jung Subject: [PATCH v3 3/3] usb: host: xhci-plat: Add support for XHCI_WRITE_64_HI_LO Date: Mon, 10 Jun 2024 20:39:13 +0900 Message-Id: <1718019553-111939-4-git-send-email-dh10.jung@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1718019553-111939-1-git-send-email-dh10.jung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNKsWRmVeSWpSXmKPExsWy7bCmqe6pp2lpBi2X2SzuLJjGZNG8eD2b xd/bF1ktLu+aw2axaFkrs0XzpimsFqsWHGB3YPdYvOclk8f+uWvYPfq2rGL02LL/M6PH501y AaxR2TYZqYkpqUUKqXnJ+SmZeem2St7B8c7xpmYGhrqGlhbmSgp5ibmptkouPgG6bpk5QGco KZQl5pQChQISi4uV9O1sivJLS1IVMvKLS2yVUgtScgrMC/SKE3OLS/PS9fJSS6wMDQyMTIEK E7Iz9s8KLpjEWfFna2YD40X2LkZODgkBE4n2iy1sXYxcHEICOxgldrXeYIVwP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WdrZgPjRfYuRk4OCQETibf7/jJ2MXJxCAnsZpRY tbGPGSIhKbF07g2oImGJ+y1HWCGKvjFKbFu9iKmLkYODTUBL4vtCsGYRgS5GiQeb7rCAOMwC ixgl3vTeYQTpFhYIlPh4ez8jSAOLgKrExF0mIGFeATeJPQvamSAWyEncPNcJtphTwF3i5fy/ LCC2EFDN2dOrWCYw8i1gZFjFKJlaUJybnltsWGCUl1quV5yYW1yal66XnJ+7iREcclpaOxj3 rPqgd4iRiYPxEKMEB7OSCK9QRnKaEG9KYmVValF+fFFpTmrxIUZpDhYlcd5vr3tThATSE0tS s1NTC1KLYLJMHJxSDUziR5UijW599XU8Z1h4aKGC1Rd9q7Alx13sFG8vzHKaLS+mdskrYta2 73qua4Ln/W2fvqc07MIK/beOdQnfGQ8FFDfGbQiSaJ73r7W1T/NLw4eiSxWCYQcf1Unvq0tV /vc+8rJijDhDQI/byfmqR4ukzno77Xu3Ijv70rzUbNmCa4/W/3d5r1fwrdHHy1343ZyaOyU2 6evUq3a9nNGSxT9n/cWrnqqP36lan3u0r2u5e6Ptp8R1wTpFv/07F0f5bc+J0GnQy3O8l3La y+vcq/P6viYdWoxhXqWsdTfCVS/XFtyZXRHDdPJiW878/3O1Jma/DO1Q4f07SdrXx2jmvcpP v3d7tltYmdxKmJ25VYmlOCPRUIu5qDgRADl8s6qoAgAA X-CMS-MailID: 20240610113849epcas2p4a61cf754aeb74e62fbcc305f3e5dac59 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240610113849epcas2p4a61cf754aeb74e62fbcc305f3e5dac59 References: <1718019553-111939-1-git-send-email-dh10.jung@samsung.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: xHCI specification 5.1 "Register Conventions" states that 64 bit registers should be written in low-high order. All writing operations in xhci is done low-high order following the spec. Add a new quirk to support workaround for high-low order. Signed-off-by: Daehwan Jung --- v1 -> v2: - this patch is added newly in the patchset - add setting the hi-lo quirk in xhci platform v2 -> v3: - add description in commit message. --- drivers/usb/host/xhci-plat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 3d071b8..31bdfa5 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -256,6 +256,9 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s if (device_property_read_bool(tmpdev, "xhci-sg-trb-cache-size-quirk")) xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK; + if (device_property_read_bool(tmpdev, "write-64-hi-lo-quirk")) + xhci->quirks |= XHCI_WRITE_64_HI_LO; + device_property_read_u32(tmpdev, "imod-interval-ns", &xhci->imod_interval); }