Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9008870pxu; Mon, 28 Dec 2020 04:16:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1mvwrpDFGAM18fI0/zE+eAlOjFJdnU7EM3yaKBms0hGotIbCnp05VyZrLRrX6GShjPPbp X-Received: by 2002:a50:eb97:: with SMTP id y23mr42055613edr.29.1609157774559; Mon, 28 Dec 2020 04:16:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609157774; cv=none; d=google.com; s=arc-20160816; b=gx5CuMkuNKJ9Ps3xi1MqLuXEGCXEzQO+bgbHUrvA+8EBkLsrtDNxYdKgNKjMbWO161 tZYzBdGhNK5dO7pay2hPND+b4rPpJsJ7wP2D8ahNeAnANIqe2q6rRGUuDmSS9mhM2qZp sIkLB1pKXiSLA90Kb2VIcE+rkdSTEYWSL4ySXg6rmm5YIBF//JUWfzhRp0TnMm9iec8h TWUMzl9Gx09qCGRbgaRGKFOYeCuiV9yn99c4coyaKwXNrclJr1I8udAmwXdR8SQGi0zV 7EGSHBQxXb8IavLme4JFFkg8eGPew8TkeRRaiQM5XYnRnTmZuqET4xU8RQDsNfIBrNm+ TvVw== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=ezFxuw9IT9kgj18HNK2/ECcVgx97tHVgQUYAK5ifWgA=; b=NN0/VQjNbQuWN/RsQtKLxqREANqviLY/RZxqV+p8ATfTuLHFj0vi1pUpFujl8fcret 1F5aca8v/tFYgRjrUCIe7uFuUfyqwxQgrtcF0zwd9goR+mCm53GW5b19+W6CiNvDermU Srce5nhmRqdS05HWZ6Nkfq2knhrDC3YHVjnk5vuosdW6ocgLOao3LjEPHXmIeTu1BPYp Hy5YFmZI+HbAnEtCMP3GrLMjjt99sRZgwukq2QghRyIYBLMopCxp9HDVKeN32sJ7b3ZA 7cvLXJSp85xHQ0mX1VLTkCNlEIdhf04P3LJrZdG2Eajq+D7QR7OKZrgKCdHLviwe+ebQ MOng== 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=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si20060963edy.318.2020.12.28.04.15.52; Mon, 28 Dec 2020 04:16:14 -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=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727645AbgL1MMs convert rfc822-to-8bit (ORCPT + 99 others); Mon, 28 Dec 2020 07:12:48 -0500 Received: from lists.nic.cz ([217.31.204.67]:52734 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727234AbgL1MMs (ORCPT ); Mon, 28 Dec 2020 07:12:48 -0500 Received: from localhost (unknown [IPv6:2a0e:b107:ae1:0:3e97:eff:fe61:c680]) by mail.nic.cz (Postfix) with ESMTPSA id CBC77140A3F; Mon, 28 Dec 2020 13:12:06 +0100 (CET) Date: Mon, 28 Dec 2020 13:11:49 +0100 From: Marek Behun To: Pali =?UTF-8?B?Um9ow6Fy?= , Miquel Raynal Cc: Mathias Nyman , Greg Kroah-Hartman , Gregory CLEMENT , Tomasz Maciej Nowak , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Chen Subject: Re: [PATCH] usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 Message-ID: <20201228131149.30907b44@nic.cz> In-Reply-To: <20201223162403.10897-1-pali@kernel.org> References: <20201223162403.10897-1-pali@kernel.org> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-100.0 required=5.9 tests=SHORTCIRCUIT, USER_IN_WELCOMELIST,USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz X-Virus-Scanned: clamav-milter 0.102.2 at mail X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pali and Miquel, On Wed, 23 Dec 2020 17:24:03 +0100 Pali Rohár wrote: > int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd) > { > struct xhci_hcd *xhci = hcd_to_xhci(hcd); > + struct device *dev = hcd->self.controller; > + struct phy *phy; > + int ret; > > /* Without reset on resume, the HC won't work at all */ > xhci->quirks |= XHCI_RESET_ON_RESUME; > > + /* Old bindings miss the PHY handle */ > + phy = of_phy_get(dev->of_node, "usb3-phy"); > + if (IS_ERR(phy) && PTR_ERR(phy) == -EPROBE_DEFER) > + return -EPROBE_DEFER; > + else if (IS_ERR(phy)) > + goto phy_out; > + > + ret = phy_init(phy); > + if (ret) > + goto phy_put; > + > + ret = phy_set_mode(phy, PHY_MODE_USB_HOST_SS); > + if (ret) > + goto phy_exit; > + > + ret = phy_power_on(phy); > + if (ret == -EOPNOTSUPP) { > + /* Skip initializatin of XHCI PHY when it is unsupported by firmware */ > + dev_warn(dev, "PHY unsupported by firmware\n"); > + xhci->quirks |= XHCI_SKIP_PHY_INIT; > + } > + if (ret) > + goto phy_exit; I am not sure if this is the correct way to check whether PHY_INIT should be skipped. Moreover the subsequent phy_power_off: > + > + phy_power_off(phy); won't power off the PHY, because the corresponding handler in ATF is currently empty. I guess the patch needs to be in kernel if users are unwilling to upgrade ATF firmware. The SMC calls for Marvell's comphy are designed to be generic for several Marvell platforms (the constants are the same and so one), but we still have different drivers for them anyway. Maybe it would be better to just not use the ATF implementation at all, and implement the comphy driver for A3720 entirely in kernel... Miquel, what do you think? Marek