Message ID | 20230502103810.12061-3-johan+linaro@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp507604vqo; Tue, 2 May 2023 03:44:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70EGJpNkiJozbk/J4pRnUX+0t4zv4ZzK2M+LmFRiSkJnn3tk1RTEDDQ8O5I8p2P6NTV/PY X-Received: by 2002:a05:6a21:3a48:b0:ec:707f:7dc7 with SMTP id zu8-20020a056a213a4800b000ec707f7dc7mr17768446pzb.33.1683024247999; Tue, 02 May 2023 03:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683024247; cv=none; d=google.com; s=arc-20160816; b=j+cXn12tVXaHfnkhEVkKo8RkOvx7Vspp0rYjipCYkWqcQUWs6/Ij5vPM0PuMEg31R7 xNq4hNzN00RxsecQQp2wygyVhVvaUKY9/5/hL2jHkx0CkbEKhxQVI2yWM2DsQfp0okhI iPRYpl1KgSwHDTSl71MoPFoDU3HRDUZQNYW74a3zgrwjD5V/hpEw+QFDHIhLCaPAQ3CQ vYBJi0UbdU+3FpZFgD2YeUpVnuBggwJGIdjjDYSXQOCxzj63DXYX+UkwT2e3qv9c1zTC VzsayCEnB5ZzQVFRmR0lXbxzn2GbqmsfrRMQDt/u3aHQRsQCTJ+q19JnHQY1Qbl15Wby 668w== 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=Avn1Bp/9scptliaY2KooP4rvSPmsriMCeOgENKpS/vc=; b=xDgrDYgMCwjmDNakxoc4bMeHJOcchK6JgE9pJxMrsc78eHgR7fWylzzro15EFVVzrU k+j5/1xTaafrQ+iiLY7O+MqdjC01Z1kcLQCwPKPiDWeGQ0mvblqAjM4exsoaO+8z2xfo 5yqwo6CbKowR8ibZgVpU96iDzeCCVod+AZenCYTtfn5k0njmHnBAfRQuZdkg2i0JiVNU Ml9SFmw/mfUEzb/BMXVLTgYkLJreC3jV5CzRxs9+FS4YnJb/jKQPrK3/K4ONaOHNwRZE r27WGWpAQoARB2tnk5d/toT2QTabU9wSvZfOmamb9Hmn0eLoYYTJcVv+brw7zZqBPYtB alPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rOHMAG4G; 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 g14-20020a62520e000000b00640f213b6fesi17095422pfb.240.2023.05.02.03.43.55; Tue, 02 May 2023 03:44:07 -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=rOHMAG4G; 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 S232402AbjEBKjp (ORCPT <rfc822;rbbytesnap@gmail.com> + 99 others); Tue, 2 May 2023 06:39:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234029AbjEBKjL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 2 May 2023 06:39:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7592F3586; Tue, 2 May 2023 03:38:51 -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 0E14D622DB; Tue, 2 May 2023 10:38:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67857C4339B; Tue, 2 May 2023 10:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683023930; bh=R7UAdwqbV3UuM3O7wDNuryWZu1psAQNZrWV73HlxA/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rOHMAG4G6EUpMa7NyB//qgND9I1hG3Ze5d3EQcth9b56Ct2/bDjwnPt4o5X5gSXV3 cjZGWLzXFPIsCnAMqfuMF3SfVrDsDzythuLBwKLoaraXpcZDrH3MMUvG1I4aDn07Jt IGDjAuJpglgXldLF8mCgQonzlWkNrfja5JP+X+WV3HQRfR+iJ5P94uDTO8sc/HikZG Q96DU5hK1yDLmH8yOOEyfU4qR1PdHYWIleemrB5OC9Yy38+LPWVOtH+b2xSlj1Q8nh KUCjtNkW+EVtxWvtpc52Ds0/Gzbcy22exihqD/dNcvcZ7QNvQ5G4yYkZvaBJ4sU+Il OHOMs0y4ZLfWQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from <johan+linaro@kernel.org>) id 1ptnPJ-00038z-70; Tue, 02 May 2023 12:38:53 +0200 From: Johan Hovold <johan+linaro@kernel.org> To: Vinod Koul <vkoul@kernel.org>, Kishon Vijay Abraham I <kishon@kernel.org> Cc: Bjorn Andersson <andersson@kernel.org>, Andy Gross <agross@kernel.org>, linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold <johan+linaro@kernel.org>, stable@vger.kernel.org Subject: [PATCH 2/2] phy: qcom-qmp-pcie-msm8996: fix init-count imbalance Date: Tue, 2 May 2023 12:38:10 +0200 Message-Id: <20230502103810.12061-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230502103810.12061-1-johan+linaro@kernel.org> References: <20230502103810.12061-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 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,T_SCC_BODY_TEXT_LINE 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?1764778833989411243?= X-GMAIL-MSGID: =?utf-8?q?1764778833989411243?= |
Series |
phy: qcom-qmp: fix init-count imbalance
|
|
Commit Message
Johan Hovold
May 2, 2023, 10:38 a.m. UTC
The init counter is not decremented on initialisation errors, which
prevents retrying initialisation.
Add the missing decrement on initialisation errors so that the counter
reflects the state of the device.
Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
Cc: stable@vger.kernel.org # 4.12
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Comments
On Tue, 2 May 2023 at 13:39, Johan Hovold <johan+linaro@kernel.org> wrote: > > The init counter is not decremented on initialisation errors, which > prevents retrying initialisation. > > Add the missing decrement on initialisation errors so that the counter > reflects the state of the device. > > Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets") > Cc: stable@vger.kernel.org # 4.12 > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > --- > drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c > index 09824be088c9..0c603bc06e09 100644 > --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c > @@ -379,7 +379,7 @@ static int qmp_pcie_msm8996_com_init(struct qmp_phy *qphy) > ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs); > if (ret) { > dev_err(qmp->dev, "failed to enable regulators, err=%d\n", ret); > - goto err_unlock; > + goto err_decrement_count; > } > > ret = reset_control_bulk_assert(cfg->num_resets, qmp->resets); > @@ -409,7 +409,8 @@ static int qmp_pcie_msm8996_com_init(struct qmp_phy *qphy) > reset_control_bulk_assert(cfg->num_resets, qmp->resets); > err_disable_regulators: > regulator_bulk_disable(cfg->num_vregs, qmp->vregs); > -err_unlock: > +err_decrement_count: > + qmp->init_count--; > mutex_unlock(&qmp->phy_mutex); > > return ret; > -- > 2.39.2 >
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c index 09824be088c9..0c603bc06e09 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c @@ -379,7 +379,7 @@ static int qmp_pcie_msm8996_com_init(struct qmp_phy *qphy) ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs); if (ret) { dev_err(qmp->dev, "failed to enable regulators, err=%d\n", ret); - goto err_unlock; + goto err_decrement_count; } ret = reset_control_bulk_assert(cfg->num_resets, qmp->resets); @@ -409,7 +409,8 @@ static int qmp_pcie_msm8996_com_init(struct qmp_phy *qphy) reset_control_bulk_assert(cfg->num_resets, qmp->resets); err_disable_regulators: regulator_bulk_disable(cfg->num_vregs, qmp->vregs); -err_unlock: +err_decrement_count: + qmp->init_count--; mutex_unlock(&qmp->phy_mutex); return ret;