From patchwork Sat Jan 4 15:43:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WangYuli X-Patchwork-Id: 855158 Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) (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 68DE11C1F23 for ; Sat, 4 Jan 2025 15:44:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=18.169.211.239 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736005476; cv=none; b=o5arU/YBfIAl1HEe1CqCjXJzbn87gMrRlidX/gXlNBClcouNxBkwvAVktkjDDRT0cx8gxMpl8vr3428VAWq+9Qb/MJErel1j8w3xxcFllkw/0PFKiHx4fhJZQb8cKWRfC9dDvPygRe3vR6KveqYyxrNB+ElEoL4h2leuHbACHnc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736005476; c=relaxed/simple; bh=kFeqrAqXccBgLLqwQbFf4kM9CWXzXJ2FCtfoIE8oAeI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=e+XqZPuvdHhWEzjw/YpREXAbqwH1CvpLHG+fXD5gn+FLR1S8Uv3lnc+rR9xaQjBsX3kZQFvsJ15gaLkYqYG/nn0zto/YaKLSkH7Gb8DqnSslDd/5rvWAn+9mSEb0/ZbkAEOAkoRR2gP6SsIoZIsDAWMWWZZi23GbcG/Ageu7uPw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com; spf=pass smtp.mailfrom=uniontech.com; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b=dLyvLMoO; arc=none smtp.client-ip=18.169.211.239 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniontech.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b="dLyvLMoO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1736005456; bh=s/Zi94DxekvcQ0+OqbLAnT4W07KfhdhwNJ+YjfK9Pbs=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=dLyvLMoOEFrK15seWSn5JXQ6rg6OuT1bxapt0wylVNfQUXlZsVrts7zU53RGHUq6m QVlTpjuiJAydkyY0tKCB1CQRKps9JDWjh7FuwctRWC4+U9T/F58G609UH6u/ZZ48+k 3X8IudtG7nH53Qtc2fqDwaMQhFrOW/x64D8HtbDs= X-QQ-mid: bizesmtpip4t1736005446ts6qc7b X-QQ-Originating-IP: PAL671qYWvWGxJZO4YSzNxJE8sPV9AU9fj56G+mev4Q= Received: from avenger-OMEN-by-HP-Gaming-Lapto ( [localhost]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 04 Jan 2025 23:44:04 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 442894868819710046 From: WangYuli To: mathias.nyman@intel.com, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, niklas.neronin@linux.intel.com, quic_wcheng@quicinc.com, andriy.shevchenko@linux.intel.com, michal.pecio@gmail.com, guanwentao@uniontech.com, zhanjun@uniontech.com, bigeasy@linutronix.de, balbi@ti.com, sarah.a.sharp@linux.intel.com, WangYuli , Xu Rao Subject: [PATCH] usb: host: xhci-plat: Assign shared_hcd->rsrc_start Date: Sat, 4 Jan 2025 23:43:53 +0800 Message-ID: <8AC53C0500C2C839+20250104154353.93075-1-wangyuli@uniontech.com> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-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S60DbZgxU5KAgR/Cwra8VrcHWy +TIHteORm5k21sSGUR0mGCIjngrOozeMb8/l93m+zaL8mTJrwVwagyRBbHGE/8ASOOeICIr LWkpAvn7gam5LxAq8oYWobNHf0WcYUEAE1JeyLIA== X-QQ-XMRINFO: Mp0Kj//9VHAxr69bL5MkOOs= X-QQ-RECHKSPAM: 0 When inserting a USB device, examining hcd->rsrc_start can be helpful in identifying which hcd is mounted, as the physical address represented here is typically unique. The following code snippet demonstrates this: struct usb_hcd *hcd = bus_to_hcd(udev->bus); unsigned long long usb_hcd_addr = (unsigned long long)hcd->rsrc_start; However, this approach has limitations now. For USB hosts with an MMIO interface, the effectiveness of this method is restricted to USB 2.0. Becase commit 3429e91a661e ("usb: host: xhci: add platform driver support") assigned res->start to hcd->rsrc_start. But shared_hcd->rsrc_start remains unassigned, which is also necessary in certain scenarios. Co-developed-by: Xu Rao Signed-off-by: Xu Rao Signed-off-by: WangYuli --- 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 e6c9006bd568..56a65ddb7e4c 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -328,6 +328,9 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s if (usb3_hcd && HCC_MAX_PSA(xhci->hcc_params) >= 4) usb3_hcd->can_do_streams = 1; + xhci->shared_hcd->rsrc_start = hcd->rsrc_start; + xhci->shared_hcd->rsrc_len = hcd->rsrc_len; + if (xhci->shared_hcd) { ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); if (ret)