Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6546159pxu; Thu, 24 Dec 2020 05:27:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjEgOVk+Xmiv9vuufgnqPjTE2MkFirXrLjISkErQdXUXNVu6jMmby8NDBmONYRXGykjV89 X-Received: by 2002:a17:906:2ccb:: with SMTP id r11mr6288990ejr.39.1608816430251; Thu, 24 Dec 2020 05:27:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608816430; cv=none; d=google.com; s=arc-20160816; b=dLZp8tQ1GUFmLb7Y1dlaT/UQNVuMrityoZ6bJIcUZJH5OKhbxpoqmHtO0PnWj7kg+W tr+om0bommRc8uRBoEyV+dDNTXI4jEJg5Gs91FD5dw8Ug1uJFbVIKMMXKfsQSUdSSZhO GO2t2Iiv1azZKa136S3ndImqWtiT+9ytEbVpnbSmfaBhZlNe44QSaTAp+jpO3HzQIsA9 YnTSbdj7vBdaQe6w50E2llNXAgjOm4lOwPLKz7xbbN0Fib1QA9iDwTTk+UuZ3NJBri4T 2eXWCtTGf60ryqMzocg+LvKTLVN4GVWwwRFh+OdZ15ffQuu3CcjRYUy+ushm7Zd1xO6S TRLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4TAG1660uHZUqAhnqI0E1+PBkJMzgSJg0GteAIGnf9w=; b=l4SNZ+I+No7aTIgzhGGupMj9sMoTWYVnqYUwlhzaS5gpPjcWkJP3s/P3ol/izDXVvI zX6tYHtVG1vCnj97F5kGT1Z3yaTDuuX+qU9MTW2tw6k6AWuvzeSWkHgg8YzdM9D8OXUk upBZ6LKzo3U1FCTTlyXUCxxCggljMAkz/OJBqnt1R5NlGtrJe2pX8qKH3C/JpL5dQuY/ eH4AOCD2HfqW1jJMtsPmyGkdgAI1yLBCLH221qTm2eYNJZi5ETBMRyWODT60dd9/z3LW b+0D0K4TeveVZkHCg015K+6XIl+3fElX1bgJVFQL2rguJz5Xajm6eVDRbNNZdcbxqyry YIhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cjkHcljf; 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 hs12si14654963ejc.74.2020.12.24.05.26.26; Thu, 24 Dec 2020 05:27:10 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cjkHcljf; 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 S1728122AbgLXNYo (ORCPT + 99 others); Thu, 24 Dec 2020 08:24:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:47714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbgLXNYo (ORCPT ); Thu, 24 Dec 2020 08:24:44 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A7CC82222B; Thu, 24 Dec 2020 13:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608816243; bh=7MYzM6Rsb/0XmQQeH1H74pjQzsefTE8icYXdZ4+lk3w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cjkHcljfayChBM7bhmH6OmN6sdcEFF8hCcVo9So6S1Zc1y79Kua6CpSYZTzvBLUh9 s6Urys1bsCn+MIuDukfYPcy8gZ38/Qx9j0grVeMoS3iUnt0pyoLza8l/xa9I0rdzLN 6eNOAUaWr3+HEqjXy7ZQYmO1mh7lUWHIAB5K8R8RslYbivlseyJ5VO6JgjW5tJ1hOt w1h6KR85bdfQRUAVxwMpD7N5C3HJK8xx0+ufuhm/egl5iFRc3CjzlYegpC3OoED0x6 IvWWzjl9gUvbPBPcQaQlKj+HeaGoUXwz+gkjlEitSbul7VZRoSc/t3qhsmLd4ZeTic VxfyhA4K35+2Q== Received: by pali.im (Postfix) id 83C01829; Thu, 24 Dec 2020 14:24:01 +0100 (CET) Date: Thu, 24 Dec 2020 14:24:01 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Peter Chen Cc: Mathias Nyman , Greg Kroah-Hartman , Gregory CLEMENT , Miquel Raynal , Tomasz Maciej Nowak , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 Message-ID: <20201224132401.7inh5ae7aaqvooxe@pali> References: <20201223162403.10897-1-pali@kernel.org> <20201224055425.GA27629@b29397-desktop> <20201224125347.z2ka7itpxuvboghq@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 24 December 2020 13:15:21 Peter Chen wrote: > > > > > + /* 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; > > > > > > Doesn't need to judge IS_ERR(phy). > > > > Ok, I can remove it. I used same condition which is already in SATA and PCIe > > phy code. > > > > > > + 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; > > > > + > > > > + phy_power_off(phy); > > > > +phy_exit: > > > > + phy_exit(phy); > > > > +phy_put: > > > > + of_phy_put(phy); > > > > +phy_out: > > > > + > > > > > > You do power on and off again only want to know if PHY has already > > > powered at ATF, right? > > > > I need to know if power on/off procedure is supported by ATF. And if not > > (indicated by -EOPNOTSUPP) then I need to ensure that usb hdc code would not > > try to call phy_power_on() as it would cause failure as described in the commit > > message. You can look at those other two commits for PCIe and SATA. Same > > thing is needed for USB. > > If not supported by ATF, then where to power on and off PHY since no other place calls PHY APIs? Is it always on? Yes, in this case (when -EOPNOTSUPP is returned) SMC API is not supported by ATF, and PHY is always on.