From: Johan Hovold <johan@kernel.org> To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Cc: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@somainline.org>, Vinod Koul <vkoul@kernel.org>, Kishon Vijay Abraham I <kishon@ti.com>, Philipp Zabel <p.zabel@pengutronix.de>, linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org Subject: Re: [PATCH] phy: qcom-qmp-pcie: fix resource mapping for SDM845 QHP PHY Date: Tue, 27 Sep 2022 08:53:01 +0200 [thread overview] Message-ID: <YzKdzTfZXYz2mF4p@hovoldconsulting.com> (raw) In-Reply-To: <20220926172514.880776-1-dmitry.baryshkov@linaro.org> On Mon, Sep 26, 2022 at 08:25:14PM +0300, Dmitry Baryshkov wrote: > On SDM845 one of PCIe PHYs (the QHP one) has the same region for TX and > RX registers. Since the commit 4be26f695ffa ("phy: qcom-qmp-pcie: fix > memleak on probe deferral") added checking that resources are not > allocated beforehand, this PHY can not be probed anymore. Fix this by > skipping the map of ->rx resource on the QHP PHY and assign it manually. Bah. Yet another QMP hack (the QHP support, not just this fix). The binding should be fixed as this device does indeed not have separate TX and RX register blocks. Note that the rx table for this device is empty too so that repeated "TX" region is just a place holder. > Fixes: 4be26f695ffa ("phy: qcom-qmp-pcie: fix memleak on probe deferral") > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > --- > drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c > index 7aff3f9940a5..5be5348fbb26 100644 > --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c > @@ -2210,7 +2210,10 @@ static int qmp_pcie_create(struct device *dev, struct device_node *np, int id, > if (IS_ERR(qphy->tx)) > return PTR_ERR(qphy->tx); > > - qphy->rx = devm_of_iomap(dev, np, 1, NULL); > + if (of_device_is_compatible(dev->of_node, "qcom,sdm845-qhp-pcie-phy")) > + qphy->rx = qphy->tx; > + else > + qphy->rx = devm_of_iomap(dev, np, 1, NULL); > if (IS_ERR(qphy->rx)) > return PTR_ERR(qphy->rx); But I guess this will do for now: Reviewed-by: Johan Hovold <johan+linaro@kernel.org> Johan
WARNING: multiple messages have this Message-ID (diff)
From: Johan Hovold <johan@kernel.org> To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Cc: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@somainline.org>, Vinod Koul <vkoul@kernel.org>, Kishon Vijay Abraham I <kishon@ti.com>, Philipp Zabel <p.zabel@pengutronix.de>, linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org Subject: Re: [PATCH] phy: qcom-qmp-pcie: fix resource mapping for SDM845 QHP PHY Date: Tue, 27 Sep 2022 08:53:01 +0200 [thread overview] Message-ID: <YzKdzTfZXYz2mF4p@hovoldconsulting.com> (raw) In-Reply-To: <20220926172514.880776-1-dmitry.baryshkov@linaro.org> On Mon, Sep 26, 2022 at 08:25:14PM +0300, Dmitry Baryshkov wrote: > On SDM845 one of PCIe PHYs (the QHP one) has the same region for TX and > RX registers. Since the commit 4be26f695ffa ("phy: qcom-qmp-pcie: fix > memleak on probe deferral") added checking that resources are not > allocated beforehand, this PHY can not be probed anymore. Fix this by > skipping the map of ->rx resource on the QHP PHY and assign it manually. Bah. Yet another QMP hack (the QHP support, not just this fix). The binding should be fixed as this device does indeed not have separate TX and RX register blocks. Note that the rx table for this device is empty too so that repeated "TX" region is just a place holder. > Fixes: 4be26f695ffa ("phy: qcom-qmp-pcie: fix memleak on probe deferral") > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > --- > drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c > index 7aff3f9940a5..5be5348fbb26 100644 > --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c > @@ -2210,7 +2210,10 @@ static int qmp_pcie_create(struct device *dev, struct device_node *np, int id, > if (IS_ERR(qphy->tx)) > return PTR_ERR(qphy->tx); > > - qphy->rx = devm_of_iomap(dev, np, 1, NULL); > + if (of_device_is_compatible(dev->of_node, "qcom,sdm845-qhp-pcie-phy")) > + qphy->rx = qphy->tx; > + else > + qphy->rx = devm_of_iomap(dev, np, 1, NULL); > if (IS_ERR(qphy->rx)) > return PTR_ERR(qphy->rx); But I guess this will do for now: Reviewed-by: Johan Hovold <johan+linaro@kernel.org> Johan -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2022-09-27 6:53 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-26 17:25 [PATCH] phy: qcom-qmp-pcie: fix resource mapping for SDM845 QHP PHY Dmitry Baryshkov 2022-09-26 17:25 ` Dmitry Baryshkov 2022-09-27 6:53 ` Johan Hovold [this message] 2022-09-27 6:53 ` Johan Hovold 2022-09-29 6:25 ` Vinod Koul 2022-09-29 6:25 ` Vinod Koul
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=YzKdzTfZXYz2mF4p@hovoldconsulting.com \ --to=johan@kernel.org \ --cc=agross@kernel.org \ --cc=andersson@kernel.org \ --cc=dmitry.baryshkov@linaro.org \ --cc=kishon@ti.com \ --cc=konrad.dybcio@somainline.org \ --cc=linux-arm-msm@vger.kernel.org \ --cc=linux-phy@lists.infradead.org \ --cc=p.zabel@pengutronix.de \ --cc=vkoul@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.