Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4221572pxu; Mon, 21 Dec 2020 07:10:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYa0o6uRFlmTo6+cDa3jf9D/q3buKI5jHjbK/U/UD9v+Hfd7gK+XgVQ5+ZBSx9/dDMgLza X-Received: by 2002:a17:907:210b:: with SMTP id qn11mr15914163ejb.41.1608563459151; Mon, 21 Dec 2020 07:10:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608563459; cv=none; d=google.com; s=arc-20160816; b=RJ1iHCFmgY4HUa7Fkt16cURKsw20k9zjGIRN+9WXISmKE/UN/OOUDNIkxzIcOux1Rw JX0Lbu3dvkj/pvQiCFvJI5sLEr1tvUMfoBSNHSSAn/K6uocf3OiiNFXlf2T48+QQGsTa tk+Fm2J7ak3id6HMe366Gk86g2DlTgUeu9gdj9JD++fC1+XAo28/Cr828XCOIf30DVxZ tarPjRlYO4s8Kip4nENbbgXs/XlgDt9SIrlDmAaOkMS2v7fdD9aebEoqA4vcSvpIATE6 VgHgJE8esJbhbpwi7Uvq4QCYsMt1s6FGqbETVd7lCQi6iVmx/UKo5OuhF7X+ZlBsjbOw 8TjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=60ajE19u6y2o7ThxKhfxn3NYiXAeXUMFadzA3K/Z4xE=; b=VKA9Bv+ZWyu+Lgi2C9E9wTE9kW9VQXQmOjzyrfbHpLPn3GINUwj6AiWml/75+WUOzq TkmaodZS9r9JfdAcTXIciJiugBydu/DzVOeJzgqLU4KzsHK6j5iw+cddRTKMLn1N2rX8 doXmboEkh6svCe8lraiSOdMzs9ITu5lYw4XSZBV5t60KpQ3sOPhe53ne0Jl0E/znkmkm xWm2TGY9Y2HXcuXE3wq4jkETlVSIQYJ3BtZMhEPPYHf1I9kgUcqkEySAKkfJoZ3MLU7N wITxR7/FVYK3fGeHjvGdNATh9WF94qH+F6BeGms6GC4TOjRIBhVJiNWzTJSf+rTQnc5c CjqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f24si10278722edq.247.2020.12.21.07.10.34; Mon, 21 Dec 2020 07:10:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725913AbgLUPJ6 (ORCPT + 99 others); Mon, 21 Dec 2020 10:09:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:33456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725777AbgLUPJ6 (ORCPT ); Mon, 21 Dec 2020 10:09:58 -0500 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Mathias Nyman , Greg Kroah-Hartman , Peter Chen Cc: Jun Li , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: host: xhci-plat: fix support for XHCI_SKIP_PHY_INIT quirk Date: Mon, 21 Dec 2020 16:09:03 +0100 Message-Id: <20201221150903.26630-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently init_quirk callbacks for xhci platform drivers are called xhci_plat_setup() function which is called after chip reset completes. It happens in the middle of the usb_add_hcd() function. But XHCI_SKIP_PHY_INIT quirk is checked in the xhci_plat_probe() function prior calling usb_add_hcd() function. Therefore this XHCI_SKIP_PHY_INIT currently does nothing as prior xhci_plat_setup() it is not set. Quirk XHCI_SKIP_PHY_INIT is only setting hcd->skip_phy_initialization value which really needs to be set prior calling usb_add_hcd() as this function at its beginning skips PHY init if this member is set. This patch fixes implementation of the XHCI_SKIP_PHY_INIT quirk by calling init_quirk callbacks (via xhci_priv_init_quirk()) prior checking if XHCI_SKIP_PHY_INIT is set. Fixes: f768e718911e0 ("usb: host: xhci-plat: add priv quirk for skip PHY initialization") Signed-off-by: Pali Rohár --- drivers/usb/host/xhci-plat.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 4d34f6005381..58704c5b002b 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -89,13 +89,6 @@ static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci) /* called during probe() after chip reset completes */ static int xhci_plat_setup(struct usb_hcd *hcd) { - int ret; - - - ret = xhci_priv_init_quirk(hcd); - if (ret) - return ret; - return xhci_gen_setup(hcd, xhci_plat_quirks); } @@ -330,6 +323,13 @@ static int xhci_plat_probe(struct platform_device *pdev) hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node); xhci->shared_hcd->tpl_support = hcd->tpl_support; + + if (priv) { + ret = xhci_priv_init_quirk(hcd); + if (ret) + goto disable_usb_phy; + } + if (priv && (priv->quirks & XHCI_SKIP_PHY_INIT)) hcd->skip_phy_initialization = 1; -- 2.20.1