Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2059467ybl; Thu, 19 Dec 2019 07:25:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxn+SOiXWFNXh2f51NZ+n9mbPVwD9SVyz/GIGejB9XfZJFkAWM/Dn1RpcEnRM7fRxE74YQx X-Received: by 2002:a05:6830:1608:: with SMTP id g8mr8954652otr.169.1576769153721; Thu, 19 Dec 2019 07:25:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576769153; cv=none; d=google.com; s=arc-20160816; b=JscFPRWcz5Pnffm/Kh1IuVDbnHMLNNegxeX+Y5Mhk0+04GMihYnGteNXZxKgj8AjeB bIs5VLes8QlOK9L92emcOYecRC+Qlpmk3KBuTySLSuc7x9TlArC3/jJLUAGOa59D2m1A TAim2pEOQpNW43/DPz3oEVD6J/6PLsTWywIGdO99zowKDqLcD4xDGIq98P2wItbVOYcH +FQ7aR4JJCeP0D8K1FQ0XcA1vQDVdCFtDwyzwBh6pfVJPFT07qnLRJQN4/rg493L9aPB UbmKuQ59csoHcIL7VdStGwtgVnLwURbw+n/n78FgNux/7yl92i1Iiy2aPbav6lb++WC6 XqZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=3yKXPaH8GS879pqXVR/snYWjruJaHyZcREhClQNij3g=; b=CaCXf7GpeaCcEog6Ww6nWe/5IMIMoYZBbyY+TYr1TKNRoZWu/mV9lXsaPXuH11KY6V 8u9ndK6iReD0NHJ7cHbvGlr/eUebN79iEpCtaNiPYKH4E2vNlerXaOeZ/X3o82r5X9mM IgCJ4OCm51iTSDP2Eskc+owlgqqZFeQAoOc90iA86mXzv+DITZd06kp57dGZwP8E4fzu Ro5BV+iRLbXtNfEn8T8Rfy5XIAE5Q9i6DkTjdmq6wpmKxRS+QeAzmPfY1jYZpzZBokCZ /q1uzW596nYTvuhqNy36+pno6wNqWGkH2iqO0BZLJbmQLXBa0u+/RfBw93ahRCLKu7SW PhxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gVtkEjgU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q126si3200554oia.8.2019.12.19.07.25.42; Thu, 19 Dec 2019 07:25:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gVtkEjgU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726884AbfLSPY7 (ORCPT + 99 others); Thu, 19 Dec 2019 10:24:59 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:35546 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726776AbfLSPY6 (ORCPT ); Thu, 19 Dec 2019 10:24:58 -0500 Received: by mail-lj1-f194.google.com with SMTP id j6so6681206lja.2; Thu, 19 Dec 2019 07:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3yKXPaH8GS879pqXVR/snYWjruJaHyZcREhClQNij3g=; b=gVtkEjgUrkMRB8e7nkrrEaIOsKTs1U/wa+nxCOWiWK2ohBbnpEtzzySkl3TPG5SlH9 oap5cxYuqSHChf6p+0P9sLdjWnlaAQl7UBIdJt7ZQHqqB6Qp2Q8TYhWSIHF+J0hNVmH7 8IRAQmk9jMu5x16puZ0DQFlhkQBzvQS2NQi2k4ZgC3JNJjq0Pneo4KuhsI0pXpvUWBk+ x+/SDePocPlvbP0VYnjCkMoEsA7cJUpLnZxUlA8cYftHpzHAG48S8X6uW6frpB7NkdRv qM3aV8C05fP1WqAJI8hhfI4IK7JMeuppmyTrhkhparmr8KAf5XWxwdFW6F971a8DXqOj ccWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3yKXPaH8GS879pqXVR/snYWjruJaHyZcREhClQNij3g=; b=fDhvEButImWQAHKvoGdekvqFA5TEq/h480RuQqe+rZSiE1UWqFrrVnwIbMUaGo4G63 VW5VA7hZ0/7krxOzxZfz+kHSpuTVu6/s5b5Rl9Bi+HmNyuugijSi96bbcTdwGH2eO1i6 QowhZrSJW/AeydexQkzeFXGfl5bUpwV3VCYRmPqCrCEBCANmUxfomMFoo68thmV5ZTLw M6vB3L/pKj7eSo9VqdWNVPTucF6Gu5R5J6KuVT67JTDuE7nr8beghAcmCzQVx7LTWEH7 tCkJJAN6I0nsSljxv1hOelNqgw0SYQ/w74HWdPi2Ui6/ipRDlGuRt3OPqQlBrLGia3bY VpBA== X-Gm-Message-State: APjAAAVdM1GW9or+dXhbOo0nnesDJONICt4hJZhbNR3S0Rxt9bcHXx7+ NXY17SYBM93DPm+a4IE4UD4C9naj X-Received: by 2002:a2e:90da:: with SMTP id o26mr6426240ljg.25.1576769095399; Thu, 19 Dec 2019 07:24:55 -0800 (PST) Received: from [192.168.2.145] (79-139-233-37.dynamic.spd-mgts.ru. [79.139.233.37]) by smtp.googlemail.com with ESMTPSA id y1sm691185ljm.12.2019.12.19.07.24.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Dec 2019 07:24:54 -0800 (PST) Subject: Re: [PATCH v1 2/4] usb: phy: tegra: Hook up init/shutdown callbacks To: Peter Chen Cc: Rob Herring , Greg Kroah-Hartman , Thierry Reding , Jonathan Hunter , Felipe Balbi , "devicetree@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-tegra@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20191218175313.16235-1-digetx@gmail.com> <20191218175313.16235-3-digetx@gmail.com> <20191219065619.GA19921@b29397-desktop> From: Dmitry Osipenko Message-ID: Date: Thu, 19 Dec 2019 18:24:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <20191219065619.GA19921@b29397-desktop> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 19.12.2019 09:56, Peter Chen пишет: > On 19-12-18 20:53:11, Dmitry Osipenko wrote: >> Generic PHY provides init/shutdown callbacks which allow USB-host drivers >> to abstract PHY's hardware management in a common way. This change allows >> to remove Tegra-specific PHY handling from the ChipIdea driver. >> >> Note that ChipIdea's driver shall be changed at the same time because it >> turns PHY ON without the PHY's initialization and this doesn't work now, >> resulting in a NULL dereference of phy->freq because it's set during of >> the PHY's initialization. >> >> Signed-off-by: Dmitry Osipenko >> --- >> drivers/usb/chipidea/ci_hdrc_tegra.c | 9 -- >> drivers/usb/phy/phy-tegra-usb.c | 165 +++++++++++++++++---------- >> 2 files changed, 102 insertions(+), 72 deletions(-) >> >> diff --git a/drivers/usb/chipidea/ci_hdrc_tegra.c b/drivers/usb/chipidea/ci_hdrc_tegra.c >> index 0c9911d44ee5..7455df0ede49 100644 >> --- a/drivers/usb/chipidea/ci_hdrc_tegra.c >> +++ b/drivers/usb/chipidea/ci_hdrc_tegra.c >> @@ -83,13 +83,6 @@ static int tegra_udc_probe(struct platform_device *pdev) >> return err; >> } >> >> - /* >> - * Tegra's USB PHY driver doesn't implement optional phy_init() >> - * hook, so we have to power on UDC controller before ChipIdea >> - * driver initialization kicks in. >> - */ >> - usb_phy_set_suspend(udc->phy, 0); >> - >> /* setup and register ChipIdea HDRC device */ >> udc->data.name = "tegra-udc"; >> udc->data.flags = soc->flags; >> @@ -109,7 +102,6 @@ static int tegra_udc_probe(struct platform_device *pdev) >> return 0; >> >> fail_power_off: >> - usb_phy_set_suspend(udc->phy, 1); >> clk_disable_unprepare(udc->clk); >> return err; >> } >> @@ -119,7 +111,6 @@ static int tegra_udc_remove(struct platform_device *pdev) >> struct tegra_udc *udc = platform_get_drvdata(pdev); >> >> ci_hdrc_remove_device(udc->dev); >> - usb_phy_set_suspend(udc->phy, 1); >> clk_disable_unprepare(udc->clk); >> >> return 0; >> diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c >> index ea7ef1dc0b42..15bd253d53c9 100644 >> --- a/drivers/usb/phy/phy-tegra-usb.c >> +++ b/drivers/usb/phy/phy-tegra-usb.c >> @@ -238,23 +238,6 @@ static int utmip_pad_open(struct tegra_usb_phy *phy) >> { >> int ret; >> >> - phy->pad_clk = devm_clk_get(phy->u_phy.dev, "utmi-pads"); >> - if (IS_ERR(phy->pad_clk)) { >> - ret = PTR_ERR(phy->pad_clk); >> - dev_err(phy->u_phy.dev, >> - "Failed to get UTMIP pad clock: %d\n", ret); >> - return ret; >> - } >> - >> - phy->pad_rst = devm_reset_control_get_optional_shared( >> - phy->u_phy.dev, "utmi-pads"); >> - if (IS_ERR(phy->pad_rst)) { >> - ret = PTR_ERR(phy->pad_rst); >> - dev_err(phy->u_phy.dev, >> - "Failed to get UTMI-pads reset: %d\n", ret); >> - return ret; >> - } >> - >> ret = clk_prepare_enable(phy->pad_clk); >> if (ret) { >> dev_err(phy->u_phy.dev, >> @@ -315,6 +298,18 @@ static int utmip_pad_close(struct tegra_usb_phy *phy) >> return ret; >> } > > Acked-by: Peter Chen > > Felipe, would you please queue this series after reviewing for USB PHY > changes? If not, Dmitry may need to split the patch. I'll take a closer look whether it is possible to factor out ChipIdea's driver change into a separate patch in a sensible way. Thanks!