From patchwork Mon Mar 21 08:59:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jung Daehwan X-Patchwork-Id: 12787002 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FEA4C43217 for ; Mon, 21 Mar 2022 09:02:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345633AbiCUJDp (ORCPT ); Mon, 21 Mar 2022 05:03:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345603AbiCUJDm (ORCPT ); Mon, 21 Mar 2022 05:03:42 -0400 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5F9090263 for ; Mon, 21 Mar 2022 02:02:12 -0700 (PDT) Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20220321090208epoutp0399f432cddbab6f42a572d7677cd70d91~eWd8jviMY0694306943epoutp03a for ; Mon, 21 Mar 2022 09:02:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20220321090208epoutp0399f432cddbab6f42a572d7677cd70d91~eWd8jviMY0694306943epoutp03a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1647853328; bh=jkqJCU4+aVDJS7yOCCdF4ZZs3P9ETXU7EF57rPAUAM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=erkwhH2lf4GzwhlMB0Gtrcwg0wgVbju1o01DzIkPXsn0lGf0nsjbKKdfeAKBcUGqg rt5SP3b/8qRgSfIv3mYTd5eHRkEjGKNgeevCvva3DckMQH2xPRO1FQRv6kj1mdUGLc OSGvO89SsGdm95hBabVLwvaK3m0ZtLfQ4WcIvLyY= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20220321090208epcas2p2d2768e0c3a1c1447ad04eb4161ac8f60~eWd8GCMv83058430584epcas2p2c; Mon, 21 Mar 2022 09:02:08 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.99]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4KMTC15rCrz4x9QM; Mon, 21 Mar 2022 09:02:05 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 93.C7.33036.D0F38326; Mon, 21 Mar 2022 18:02:05 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20220321090205epcas2p4f3698a0aa49d251c0a8f008e85d968ba~eWd5i-KTd0252402524epcas2p4b; Mon, 21 Mar 2022 09:02:05 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220321090205epsmtrp1324d4e15cd89a97cdac910ade2dd33a2~eWd5hy0uF2591125911epsmtrp1b; Mon, 21 Mar 2022 09:02:05 +0000 (GMT) X-AuditID: b6c32a48-4fbff7000000810c-95-62383f0dff75 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 56.3E.29871.D0F38326; Mon, 21 Mar 2022 18:02:05 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [12.36.155.120]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220321090205epsmtip2b9eb2f9c109f6f1fe94ed3429fac1de3~eWd5SjMw81528315283epsmtip27; Mon, 21 Mar 2022 09:02:05 +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), Howard Yen , Jack Pham , Puma Hsu , "J . Avila" , Daehwan Jung , sc.suh@samsung.com Subject: [PATCH v3 3/4] usb: host: add some to xhci overrides for USB offload Date: Mon, 21 Mar 2022 17:59:53 +0900 Message-Id: <1647853194-62147-4-git-send-email-dh10.jung@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1647853194-62147-1-git-send-email-dh10.jung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLKsWRmVeSWpSXmKPExsWy7bCmuS6vvUWSwexWLYs7C6YxWTw5sojd onnxejaL63/eM1q0P7/AZnF51xw2i0XLWpktmjdNYbWYuVbZouvuDUYHLo/Lfb1MHgs2lXos 3vOSyWP/3DXsHn1bVjF6fN4kF8AWlW2TkZqYklqkkJqXnJ+SmZduq+QdHO8cb2pmYKhraGlh rqSQl5ibaqvk4hOg65aZA3SYkkJZYk4pUCggsbhYSd/Opii/tCRVISO/uMRWKbUgJafAvECv ODG3uDQvXS8vtcTK0MDAyBSoMCE743vTY/aCu4IVzV83Mjcw/ufrYuTkkBAwkVh47RhzFyMX h5DADkaJ3VsOMUE4nxgljk8/yALhfGOUaJ74mr2LkQOsZedaNoj4XkaJs4eWQrX/YJTY0Hae GaSITUBL4vtCRpAVIgJxEks7L4FNZRZYzSTx/uNFNpCEsIC/xMlzV8CKWARUJbb/2cAMYvMK uEq0zf/OCHGfnMTNc51gcU4BN4m1NxvBLpIQeMQusXvKejaIIheJtvv7WSBsYYlXx7ewQ9hS Ei/726DsYoldn1qZIJobGCUaH5xghkgYS8x61s4IcjWzgKbE+l36EF8qSxy5BTaSWYBPouPw X6jneSU62oQgGpUlpl+ewAphS0ocfH2OGaLEQ2L7A2i4zWSUODD5LPsERrlZCPMXMDKuYhRL LSjOTU8tNiowgUdYcn7uJkZwutPy2ME4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rf7+WOe8j/zT9JjnG uAvfJ8w3k30pf3/79k8NIdsbUv8vmPM99PCCnd/9Ul1WTJ+24nDkGqnCHw82fy6yzz3beHbb vIgsy0cZ7+/+2N3pcFGj9UbNrire3TILPj9e9mDqE9clfl9vV/7ZKOE7M2yJc/bZkIvbY3Ji 3Kp4DXM4tgquq60SOfUoWDBhW+ciRp1LYTWavBdWsbAdD312WLx8oZ2dLpfe7MySf1tMH2Vs 1XojaW73jvtf92uW6B/n+S+K+eixvfgR0VFS55ZwOv2py+krB570z0xlNLip+nnJzq0NWUVe eaIL9nuXzxet/VOakrYuRdO69IGAjydzAws3y+Vl9v+/KLEUZyQaajEXFScCAMHWax27AgAA X-CMS-MailID: 20220321090205epcas2p4f3698a0aa49d251c0a8f008e85d968ba X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220321090205epcas2p4f3698a0aa49d251c0a8f008e85d968ba References: <1647853194-62147-1-git-send-email-dh10.jung@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Co-processor needs some information about connected usb device. It's proper to pass information after usb device gets address when getting "Set Address" command. It supports vendors to implement it using xhci overrides. There're several power scenarios depending on vendors. It gives vendors flexibilty to meet their power requirement. They can override suspend and resume of root hub. Signed-off-by: Daehwan Jung --- drivers/usb/host/xhci.c | 6 ++++++ drivers/usb/host/xhci.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 4e4fcf97ba42..d3c3d57c89f9 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -5544,6 +5544,12 @@ void xhci_init_driver(struct hc_driver *drv, drv->check_bandwidth = over->check_bandwidth; if (over->reset_bandwidth) drv->reset_bandwidth = over->reset_bandwidth; + if (over->address_device) + drv->address_device = over->address_device; + if (over->bus_suspend) + drv->bus_suspend = over->bus_suspend; + if (over->bus_resume) + drv->bus_resume = over->bus_resume; } } EXPORT_SYMBOL_GPL(xhci_init_driver); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index f690a5dc9eb3..de37d72847f2 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1947,6 +1947,9 @@ struct xhci_driver_overrides { struct usb_host_endpoint *ep); int (*check_bandwidth)(struct usb_hcd *, struct usb_device *); void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); + int (*address_device)(struct usb_hcd *hcd, struct usb_device *udev); + int (*bus_suspend)(struct usb_hcd *hcd); + int (*bus_resume)(struct usb_hcd *hcd); }; #define XHCI_CFC_DELAY 10 @@ -2103,6 +2106,7 @@ int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep); int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); +int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev); int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id); int xhci_ext_cap_init(struct xhci_hcd *xhci);