Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp294990lqp; Mon, 10 Jun 2024 04:39:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXpT2rIDNyEtseZO3qos/R8VRjlG0WfjleaivpNHQ+mIXvscD6tqeCmeDXjp4suUlHHXdPPYjE1tD2gp6cIzpk+5vsowbv4OAaZa9ujAw== X-Google-Smtp-Source: AGHT+IHVHzzN03n0JZBxz5IRklt2/yNKOhz2orywpQoStn7AfsDxS5xyBZmS6MeHXxGq0kg/egJL X-Received: by 2002:a17:906:5589:b0:a6e:fecb:6baa with SMTP id a640c23a62f3a-a6efecb6da6mr381042866b.34.1718019594271; Mon, 10 Jun 2024 04:39:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718019594; cv=pass; d=google.com; s=arc-20160816; b=iht+Brt+LTVHNy2zzClnNcgpffJsx0xlTEKJziDmkZzTxLhaa5hiKV/FHTl3WLXSQm ufvuME1LPnBaQkpOlcGca+wpM8xeZcYbobCLPSjXrkPTGcre8Ei7XOZ2/2KmbyBVZQlQ bzDZVgMe10FORG2ErvkQqRJkGjFqStUxxpbUr+dhpXlO86TaXPk5PRabp3uQPCpvQqK3 yBGbGaD+OGrNvPxs983xM8o2WdGSaS7i+ldZB+vigneqDa4JFx5O4YUCb7gVaARtX4yu EHKp/aB9gZjbFqz0Joewgi3ngbrl15BTx2Xus3VK4tRuf6cPNbUBQYKt07cLIRMeeV57 V8CQ== 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:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=TV4KTUZnCE6pjbCnux0zhwSr84BxKZ1ykWq8bSkM1YM=; fh=cW6h/k464pGBgZ2dtI2RmeWjs9UiNKyysxpqVafj99o=; b=075TMIlvJaZepWCLqbvs31EtcZY73m3ht7s+Psm+lUvT6VFymqY3U/2HE4ME3CyfJl 6d27ybvR9QJxesaXuqOLjZbMSlxhKXroKi3uCNu8WIMpe0rHr1XXz/1pgusjTu8LjI1W 6+Tgeg+yHw/9OjZGvCuLOl36KctVE8+xPbrFJIpWP/nE7aIcnp3PDhOb7r3zbNR0dyRG FOP6N4ZiaIih3IeGtLJoJ0sE6fgVsJP9U9KgbYWhBzjgKTkon8qzrzqUTuCmmfNp5Fs6 Y8YcRGEnGXjE/l08/nXBLuORrnPQCwJ9LQPKQ7gqg2Ad9MeylpptUrD3+NMwJNoxJfcp a56Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=IYPrkSrx; 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-208089-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208089-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ef5401350si294647566b.329.2024.06.10.04.39.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 04:39:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208089-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=IYPrkSrx; 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-208089-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208089-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 CEC5F1F21CEC for ; Mon, 10 Jun 2024 11:39:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3395D8004F; Mon, 10 Jun 2024 11:38:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="IYPrkSrx" Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (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 86C377C6EB for ; Mon, 10 Jun 2024 11:38:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718019538; cv=none; b=sTds+zCY4l4tgBEmMXgTXq+9Sum+pFKSNtO6GTOj4C/W0rnufI4YqCNBi+KgixUsHjUPHCdtlxCHV5WE7zLcXc+RJYmrAh7G6jlXxSDWdlZKNr/Pwo+LRhgOXzVBcEDcyAiOwOa9FCg0mC+WtEg7crRUX+idhapav1KLm/LnV1s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718019538; c=relaxed/simple; bh=ICqFw5ZZMvRyWPAU8BnmipUzEkrscSUQMD/V8Z0VPtw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:Content-Type: References; b=pwJKHHash/S0kj8GL6GElPGiQWi5tQvjrJYKS5biBRU5S7P/ikgcNrbfoanh/fbi/tfoIgZoOq4Lft51wmUuRYL0ku2r4ChoLvyj9+VqXqJNfl/H1uSgczL6NOo4wUlcfAMM9uX90QZXyNfz6AeVuveEmQLr9eYJJ3jmulM/4+E= 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.33 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 mailout3.samsung.com (KnoxPortal) with ESMTP id 20240610113850epoutp0364f65fc2978c7d7b26658b101d6813fe~XoakjeGz81812018120epoutp03D for ; Mon, 10 Jun 2024 11:38:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240610113850epoutp0364f65fc2978c7d7b26658b101d6813fe~XoakjeGz81812018120epoutp03D 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/BKPH76kkgh4ODTUBL4vtCsG4RgQ5GiaPPT4PNZRZY wCjx4OQiRpBRwgI+Eq09t8HGsgioShw5+JAJpJlXwE3i93pBiG1yEjfPdTKD2JwC7hIv5/9l gYgfY5d4taEEwnaRODKxnQ3CFpZ4dXwL1KVSEp/f7YWKF0vcev6MGeQGCYEWRokVr1qYIRLG ErOetTOC7GUW0JRYv0sfxJQQUJY4cgtsFbMAn0TH4b/sEGFeiY42IYhGZYnplyewQtiSEgdf n4Ma6CFxsf8LNOBmMUosnHWMeQKj3CyEBQsYGVcxiqUWFOempyYbFRjCIyw5P3cTIziVaTnv YLwy/5/eIUYmDsZDjBIczEoivEIZyWlCvCmJlVWpRfnxRaU5qcWHGE2BQTeRWUo0OR+YTPNK 4g1NLA1MzMwMzY1MDcyVxHnvtc5NERJITyxJzU5NLUgtgulj4uCUamCaL1Xh6nHlabHQwgdr jtby3r+VtP2cYNhElR/h833vXsixPrXUWbtox29TwchP6/4ulteLOz9lQugZrmeHHzRYJE0K Ed2231ZY+aCjQ/3J+u6PZ9IEsw3X/N3+9dgOb4dp+TO3LTPYVX95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G2XNLP+jz0BP2LWw/r+s2S7zUNerZeRmvGuo4zlzZN t4/eYpZ7wn+u6WNDJZbijERDLeai4kQAPsykD6UCAAA= X-CMS-MailID: 20240610113849epcas2p225c0dde8fbb833e37be9c2b63850d520 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: 20240610113849epcas2p225c0dde8fbb833e37be9c2b63850d520 References: <1718019553-111939-1-git-send-email-dh10.jung@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@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; -- 2.7.4