Message ID | 20221019113552.22353-13-johan+linaro@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp285407wrs; Wed, 19 Oct 2022 05:07:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5mBqcgoJXDKRxdBa/6IzCXSa9urfM1eolYKd65mD5MvQe6GGSBxPgsl/zffuwkc2OvweNe X-Received: by 2002:a17:90b:4d8b:b0:20a:e256:fdd8 with SMTP id oj11-20020a17090b4d8b00b0020ae256fdd8mr44652621pjb.4.1666181264791; Wed, 19 Oct 2022 05:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666181264; cv=none; d=google.com; s=arc-20160816; b=PdNPw21UmgVjBrCgaYW6dt7xtmJusN+OS05XI25gLQfhY6+oeHEbNrCt6BxVV9ueCl o8hQsc+zSBSpTZlxmqa1D3dv36lNPYHI+xbBtTSvEqn0O54Hwi0ZPGnVhOU0XP5bsvPc U74AkqzdVUAYFtmvbLPlFOrZH2keGDTCvDUcav0aUQGlp4+PTdYZdeVxy5c1j4Q21gWD l+6ThGL0F2cE5u5YukhOWRO6yx09Klur3gzRceFC4WUfxdmxxHJHcgw/rUwL0naFBO3L T9frhJlUKGwdTaMzVIs0LnNVlJrHE9zRmit0zlZ2gNqsetpONcwmzr5Pw2t3vLBsSlyI XtCQ== 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:date:subject:cc:to:from :dkim-signature; bh=LX8dZctt+qduXfyEuo8piDFDhh8GYyJrZFyEpKbBYYE=; b=bw/umUx/Q3dIs75Rrnn1ZV3FUMM+lQa61DKMS6B9qvHQVkL0tI6mDFElSJ+Kw7IYBb ZSfgm7lDM4oS+8E4JfL6iyoXUM4EepLkbAyZdgSAHcolTMOQzJSaRiooAarHT8vqeqNB saDdpE2IBa7aGo8z0RJe5juoWcJxY6XOAIyiECEh1lpqmAQDiJWYyBGzBXE57heT5FgW blzZMPBAy024Xf5IT6MrDoZ91rUnqQOuSMQus8lxFk1wxQcRM4LDwgp/9hAIAwlKLTW2 YhIjNTbM9NkSwmPqMpkuSqLtTM3Q/mvZgxCsN5tS3X2EIVzIC9LBhOWabtS75l0DP8AK s2DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OnfROS9p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j73-20020a638b4c000000b0044af51e7d4bsi16826625pge.75.2022.10.19.05.07.30; Wed, 19 Oct 2022 05:07:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OnfROS9p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232360AbiJSMCy (ORCPT <rfc822;samuel.l.nystrom@gmail.com> + 99 others); Wed, 19 Oct 2022 08:02:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231430AbiJSMCE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Oct 2022 08:02:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3080E18499D; Wed, 19 Oct 2022 04:38:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DB1E160B8E; Wed, 19 Oct 2022 11:36:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF12BC4347C; Wed, 19 Oct 2022 11:36:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666179379; bh=zIA+ml8wbUJ1pYtOiAw0rtWwlGesij42jZ74b5odlbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OnfROS9pgtB+v2R+pRpamwuc5ZfGYmp8hTczSrF6h09gpiAZ/PA1Z0Xbqp0QBh46S EGCz/oppZ1IkL0Xwa6D6udZxbKcCKWaDetAWHO3swrwh/yqZZe0v1Wk1yKHuZ1TUOB eqj0e2n60OIZXQnPaQSgbklGG4T1ZCIjZPWgA/DBT8a2O+9ngHv08rAQNhhR5rp+ZY hgPKMoZJ/tU+VU5Db0V2rs+aWwm6lt4hp7FAToofhsG1qEOhyPOPWBqbNIk4veu8zo 0ESO1sgYXpUofJridNFGr0ujQNQ8iOlEEPpgZriNDaikppkA4kKK4xt5xoQYh9mGmN 67dypo7QXf4cQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from <johan+linaro@kernel.org>) id 1ol7Mm-0005pl-9a; Wed, 19 Oct 2022 13:36:08 +0200 From: Johan Hovold <johan+linaro@kernel.org> To: Vinod Koul <vkoul@kernel.org> Cc: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@somainline.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold <johan+linaro@kernel.org> Subject: [PATCH v2 12/15] phy: qcom-qmp-pcie: fix initialisation reset Date: Wed, 19 Oct 2022 13:35:49 +0200 Message-Id: <20221019113552.22353-13-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221019113552.22353-1-johan+linaro@kernel.org> References: <20221019113552.22353-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747117685587317465?= X-GMAIL-MSGID: =?utf-8?q?1747117685587317465?= |
Series |
phy: qcom-qmp-pcie: add support for sc8280xp
|
|
Commit Message
Johan Hovold
Oct. 19, 2022, 11:35 a.m. UTC
Add the missing delay after asserting reset. This is specifically needed
for the reset to have any effect on SC8280XP.
The vendor driver uses a 1 ms delay, but that seems a bit excessive.
Instead use a 200 us delay which appears to be more than enough and also
matches the UFS reset delay added by commit 870b1279c7a0 ("scsi:
ufs-qcom: Add reset control support for host controller").
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On 19/10/2022 14:35, Johan Hovold wrote: > Add the missing delay after asserting reset. This is specifically needed > for the reset to have any effect on SC8280XP. > > The vendor driver uses a 1 ms delay, but that seems a bit excessive. > Instead use a 200 us delay which appears to be more than enough and also > matches the UFS reset delay added by commit 870b1279c7a0 ("scsi: > ufs-qcom: Add reset control support for host controller"). > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > --- > drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 ++ > 1 file changed, 2 insertions(+) Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
On 19/10/2022 14:35, Johan Hovold wrote: > Add the missing delay after asserting reset. This is specifically needed > for the reset to have any effect on SC8280XP. > > The vendor driver uses a 1 ms delay, but that seems a bit excessive. > Instead use a 200 us delay which appears to be more than enough and also > matches the UFS reset delay added by commit 870b1279c7a0 ("scsi: > ufs-qcom: Add reset control support for host controller"). > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > --- > drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c > index 2f4bdef73395..9c8e009033f1 100644 > --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c > @@ -1866,6 +1866,8 @@ static int qmp_pcie_init(struct phy *phy) > goto err_disable_regulators; > } > > + usleep_range(200, 300); > + If there is a v3, I'd kindly ask to add a comment about vendor using 1ms here. > ret = reset_control_bulk_deassert(cfg->num_resets, qmp->resets); > if (ret) { > dev_err(qmp->dev, "reset deassert failed\n");
On Wed, Oct 19, 2022 at 04:52:29PM +0300, Dmitry Baryshkov wrote: > On 19/10/2022 14:35, Johan Hovold wrote: > > Add the missing delay after asserting reset. This is specifically needed > > for the reset to have any effect on SC8280XP. > > > > The vendor driver uses a 1 ms delay, but that seems a bit excessive. > > Instead use a 200 us delay which appears to be more than enough and also > > matches the UFS reset delay added by commit 870b1279c7a0 ("scsi: > > ufs-qcom: Add reset control support for host controller"). > > > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > > --- > > drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c > > index 2f4bdef73395..9c8e009033f1 100644 > > --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c > > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c > > @@ -1866,6 +1866,8 @@ static int qmp_pcie_init(struct phy *phy) > > goto err_disable_regulators; > > } > > > > + usleep_range(200, 300); > > + > > If there is a v3, I'd kindly ask to add a comment about vendor using 1ms > here. No, I'm going to leave this is as is. The vendor driver is just a reference implementation with a wide range of differences which there's little point in documenting in mainline. This information will continue to be available in the git logs if anyone wonders were these numbers came from. If it turns out that some other platform needs a longer delay, we can consider increasing the delay unconditionally after verifying experimentally. And anyone with access to actual documentation is of course free to suggest a different delay from the start. > > ret = reset_control_bulk_deassert(cfg->num_resets, qmp->resets); > > if (ret) { > > dev_err(qmp->dev, "reset deassert failed\n"); Johan
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index 2f4bdef73395..9c8e009033f1 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -1866,6 +1866,8 @@ static int qmp_pcie_init(struct phy *phy) goto err_disable_regulators; } + usleep_range(200, 300); + ret = reset_control_bulk_deassert(cfg->num_resets, qmp->resets); if (ret) { dev_err(qmp->dev, "reset deassert failed\n");