Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2444982lqb; Mon, 27 May 2024 22:57:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUcO+Yhl1r7+dH7iNtpmvGGmnCKhBtp+aZJz+mayimImSjp+6r97KN7DoslpcsNHLLxpSgrnB9t0GSbHngQq4wRnmGtwWaJVcXmBajM8g== X-Google-Smtp-Source: AGHT+IHXWYZX7X/L5LusKkNIqyOw05jf32dJrUfW3a+uXtIhXntJzE0dWQMTKv/y3fVYx4AhVDmj X-Received: by 2002:a17:906:1713:b0:a5d:7dcc:cc32 with SMTP id a640c23a62f3a-a623e6d5b66mr1208907366b.8.1716875841776; Mon, 27 May 2024 22:57:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716875841; cv=pass; d=google.com; s=arc-20160816; b=YZkTqfJFYD5uvevSwpk0RPfa2EDXOJbeFVh+CK7FK+EM3yYODdOvy6TRZcLoICe0su NcJgFYXopbDi/XiBYzp0R8eA4a0C6vzfs6ElpRTIzffDgR4E2IxFubKcpsd1z4EBpqSF 443HID3cteSFsD/v+1n6gFV5rLwpxwroFA0UnS5P0aaiH5nkqb59W7OHzR/46riXiyTG SE5N3Q7AHnqZXOscbJQY9jh9ZqcfwhwaPh9spsP/Lbv6X2rVxgZfcfv4HNl32Z64I9Jp h95wC+etkLcatp9gVRs6ZxrznCsBB6TtT/VtkTa59NzRGGL+/gxyEEszB7XKquAqJV+9 o4qw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :dlp-filter:cms-type:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=IZqSyOEN6oaujsmsFgWCF7ZAIEjCMHQeDCmq2lF9xXQ=; fh=0cMn3CHj9Mg/zHEG545Jj+cmXHX8W1YfNLtrnUCt0Yw=; b=dVMeTJY0gKEMEYbsPwLdlKIJgJuOauBoaLZ4GL0+gb4WZgMBSwOH4L4Msa+dPAijzk ESGssc0/hD8b/eT89gZ9Ul5Won03E8NU5IqQYNyCEXnUnv5DOW4ODn24MzKxtRNEAB9+ ZvJN5jkH+f/owsnOyNzsbSqVsx8skCKpgXhhPBQOkwpGjWPS8DmkTdBOZL9/WX3iSkWC 0PSfv3yBXSfdu2BJWfNiVJ4YY2SirJeliG7tHPNFzxNdMO7VXem2ZufSCA8ivWSFApod l0EluynkxW7U/2cSZPn1BNRqDUE0ZGAbU52yRETah2v/By4O1u8N0cgep6mvjZ2b31Wi 3lSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=XsIx4ryW; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-191788-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191788-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cd932casi459264366b.811.2024.05.27.22.57.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 22:57:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191788-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=XsIx4ryW; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-191788-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191788-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 53F691F22C8B for ; Tue, 28 May 2024 05:57:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C7804F881; Tue, 28 May 2024 05:57:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="XsIx4ryW" Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) (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 2345C4E1B3 for ; Tue, 28 May 2024 05:57:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716875832; cv=none; b=s5SldY9o848QDMaOE66hwdqkDXCU+YDUXE3p1nqBeSWPtYkpiMKreHWVFrr9E/3w52oXIKJxfK+7EY1qP4xpPeD7HxgCeoY/lzOfdKyJgzndpz32R0gcd/DdpcdjUTuwOLTEcY4KM1PAkMD65r59sALDX984U0/CPVAaOTJW0QM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716875832; c=relaxed/simple; bh=UoR5gPGym9uf54ZGp6/U0JiMpXAEVmwnB+CE+byyg1g=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:References; b=dPn1fA8u67Wf+CpqFcuv28Qpx2iOcQ5BktuxQt5u0nOzA+da1gmY23pZUtHNF/neqLwAgMfp7uzALh/fPTlYMLF1WAxCan4dQeonml0TQ78nBJpMGo1slvrmggdNeRJHkw1YklZOJkvf0KXcXJZZb9wLh6cPXFp+TPQiqJUKONM= 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=XsIx4ryW; arc=none smtp.client-ip=203.254.224.24 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 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20240528055700epoutp01adb560470c334c2b09636362ca6d0e0f~TkXZxlMiq2536025360epoutp01v for ; Tue, 28 May 2024 05:57:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20240528055700epoutp01adb560470c334c2b09636362ca6d0e0f~TkXZxlMiq2536025360epoutp01v DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1716875820; bh=IZqSyOEN6oaujsmsFgWCF7ZAIEjCMHQeDCmq2lF9xXQ=; h=From:To:Cc:Subject:Date:References:From; b=XsIx4ryWw5G8DlRpgOfFzja1HdT/dxTSr26Ln7us2iJ42A9lmcBcrqFaGoxyk2sgZ WTrlN+ZEgY3CRp+RGxQzVXJ+2UH/2aovba5QSPAHRy/MaTZPyuqt3+rhmm7PlgDPS7 UMlt+SoAuuOJJYO9gNLwKvkk5xO+Zl+jDi0kLGLM= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20240528055700epcas2p48a69c3c3cc2f4fb04907f2eef8988907~TkXZerKBy1671416714epcas2p4a; Tue, 28 May 2024 05:57:00 +0000 (GMT) Received: from epsmgec2p1-new.samsung.com (unknown [182.195.36.70]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4VpMGg61J2z4x9Q3; Tue, 28 May 2024 05:56:59 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmgec2p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id C3.16.18956.B2275566; Tue, 28 May 2024 14:56:59 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20240528055659epcas2p4f86642d6647855747cea35b04f8a46cc~TkXYdoRYi0312903129epcas2p4L; Tue, 28 May 2024 05:56:59 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240528055659epsmtrp22c4559e1e0fc88d63cf66fc7fc5b5e14~TkXYc_wZq2805328053epsmtrp2X; Tue, 28 May 2024 05:56:59 +0000 (GMT) X-AuditID: b6c32a4d-247ff70000004a0c-3a-6655722b41a3 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 1F.A4.08622.B2275566; Tue, 28 May 2024 14:56:59 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [10.229.95.128]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240528055659epsmtip228d801d5b246e5c824b0b5929700980f~TkXYTETEO1503015030epsmtip2q; Tue, 28 May 2024 05:56:59 +0000 (GMT) From: Daehwan Jung To: Mathias Nyman , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org (open list:USB XHCI DRIVER), linux-kernel@vger.kernel.org (open list), Thinh Nguyen , Daehwan Jung Subject: [PATCH] usb: host: Add a quirk for writing ERST in high-low order Date: Tue, 28 May 2024 14:57:16 +0900 Message-Id: <1716875836-186791-1-git-send-email-dh10.jung@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDKsWRmVeSWpSXmKPExsWy7bC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yslvipGmkSr/zeY1P2Hr28 tIQH7C9Se7kaV8XXX56Q0M+ebm/cHphlZ1I2eb2eu9M/JZbijERDLeai4kQAzMVSiN8DAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFJMWRmVeSWpSXmKPExsWy7bCSvK52UWiawbEPohZ3FkxjsmhevJ7N 4vKuOWwWi5a1Mls0b5rCarFqwQF2BzaPxXteMnnsn7uG3aNvyypGjy37PzN6fN4kF8AaxWWT kpqTWZZapG+XwJXRNvUgW8EKgYqnW7qYGxg/8HYxcnJICJhIbG67z97FyMUhJLCbUWLhxdus EAlJiaVzb7BD2MIS91uOsEIUfWOUuLV2PVsXIwcHm4CWxPeFjCA1IgJxEisu72EBqWEW2Mko cfvDDjaQhLCAl8SOc7eZQWwWAVWJC33LwYbyCrhJrPp7jhligZzEzXOdzBMYeRYwMqxilEwt KM5Nzy02LDDKSy3XK07MLS7NS9dLzs/dxAgOHi2tHYx7Vn3QO8TIxMF4iFGCg1lJhFdkXmCa EG9KYmVValF+fFFpTmrxIUZpDhYlcd5vr3tThATSE0tSs1NTC1KLYLJMHJxSDUyzedj0RNN/ 3rZ03XFgY92+Gm8H7lvRJ3fs8C94c0/3wUnrDy+nvzg6K+HCJub7oidWlSzuSlj5PPrd9kZv h7Mun6xNJvYfY3vGtqtTOO33nCVMO83Pptzzvn9k7p/D0dGV19ftMljw+N6L9rwfjz/HbPl6 rJn1qd1erinnhU9K7ZhflWnfLzn396kYu0Y+jYRtipFSMz/HpfrftNbZEVT2x+n45W32u0yC 3u+Jqfh441CXustJvv/3frwTiM7dP/3PzJ0XVireV7++7L/eWbNNtY+V1fnsZ0w/c62ayZBF 5OCysvc/Oze+OHrY9kRb3GE+2VPpkdYPA63j1RcanqmY1u3RbuB27jJ78YUt/eubNyuxFGck GmoxFxUnAgC/FfL8jQIAAA== X-CMS-MailID: 20240528055659epcas2p4f86642d6647855747cea35b04f8a46cc X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240528055659epcas2p4f86642d6647855747cea35b04f8a46cc References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: [Synopsys]- The host controller was design to support ERST setting during the RUN state. But since there is a limitation in controller in supporting separate ERSTBA_HI and ERSTBA_LO programming, It is supported when the ERSTBA is programmed in 64bit, or in 32 bit mode ERSTBA_HI before ERSTBA_LO [Synopsys]- 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 --- 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; -- 2.7.4