From nobody Tue Feb 10 07:01:37 2026 Received: from smtpbgsg1.qq.com (smtpbgsg1.qq.com [54.254.200.92]) (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 46B9E1E9B0F for ; Tue, 7 Jan 2025 13:40:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.254.200.92 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736257223; cv=none; b=hLDEPP6bc3CkGKgmzoPWoVnN8qU8JYy+8+lAxnItY4cKahUsb/xDmDwpUwZ09tHsJnnwDP0/mneVNQ73D6HFkZ1eJfE8lUkgOO+q+QB4Bmhfne9KQjUzEI3mQ1388gt6ktNkXkT+qxNd89GsIfKl8kofWgP/XSgxAvTKJs5lTBE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736257223; c=relaxed/simple; bh=anR295dsYLaPZMGJqRadGXRXwUp8EaI7n9P8OHjUspA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qPBEE6Myg9asIgFx3Opv3UqcPDaPM4NKpqoxdCOurWkY/uGJnAIlsgHRyhwjAAgIdWliIge1i6tyt/clYuxqtu4DIG4pQXWDZCFNUJwv6lbyQQOklyjHHRU0eQ0lMAtN0I6FXjkHMWQ80YXM+nnu2b0u9d98olw0mD0KJruMm0E= 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=Gd19n6OP; arc=none smtp.client-ip=54.254.200.92 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="Gd19n6OP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1736257153; bh=Jwz9VBmRlX+Is2NqzUvb2PX5ziUNiqVFpfw8i6EXWf0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Gd19n6OPrABEqEiPt8lqKev5k7rNiNZyj9XBXe11D6widHbu7zmOBroFyWxBdZ+ZY mbjgJts7DrGnJk7ONMEtdxK491R+78gvxHp+7HigE4u1c6V04rUCPjp5atf+1yey+k jZcMlS1h0z9M+PNqvAxhF0N+hvHhktuwC+vrSLdE= X-QQ-mid: bizesmtpip4t1736257142tuu34xk X-QQ-Originating-IP: v4T783SAuQhS+1f6RBJR3A4D2pB/VYrLfcMPIalcI6c= Received: from localhost.localdomain ( [localhost]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 07 Jan 2025 21:38:58 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 7022212570655544969 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, hkallweit1@gmail.com, wangyuli@uniontech.com, raoxu@uniontech.com Subject: [PATCH v3] usb: host: xhci-plat: Assign shared_hcd->rsrc_start Date: Tue, 7 Jan 2025 21:38:54 +0800 Message-ID: <186B9F56972457B4+20250107133854.172309-1-wangyuli@uniontech.com> X-Mailer: git-send-email 2.47.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpip:uniontech.com:qyb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jf6iuc13VejV+CmJNV3fFbRSI Ta1kJ4x07t0hNKAFY7NLwgwsPfJqY= X-QQ-XMRINFO: NyFYKkN4Ny6FSmKK/uo/jdU= X-QQ-RECHKSPAM: 0 Content-Type: text/plain; charset="utf-8" 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 =3D bus_to_hcd(udev->bus); unsigned long long usb_hcd_addr =3D (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. Because 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. Fixes: 3429e91a661e ("usb: host: xhci: add platform driver support") Co-developed-by: Xu Rao Signed-off-by: Xu Rao Signed-off-by: WangYuli -- Changlog: *v1 -> v2: Move code changes for commit e0fe986972f5 ("usb: host: xhci-plat: prepare operation w/o shared hcd"). v2 -> v3: Add the "Fixes" tag and fix a typo in commit message. --- drivers/usb/host/xhci-plat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index e6c9006bd568..457e839b9b53 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -329,6 +329,8 @@ int xhci_plat_probe(struct platform_device *pdev, struc= t device *sysdev, const s usb3_hcd->can_do_streams =3D 1; =20 if (xhci->shared_hcd) { + xhci->shared_hcd->rsrc_start =3D hcd->rsrc_start; + xhci->shared_hcd->rsrc_len =3D hcd->rsrc_len; ret =3D usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); if (ret) goto put_usb3_hcd; --=20 2.47.1