From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75EADC54EE9 for ; Tue, 27 Sep 2022 06:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229538AbiI0GxA (ORCPT ); Tue, 27 Sep 2022 02:53:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiI0Gw7 (ORCPT ); Tue, 27 Sep 2022 02:52:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CC919C220 for ; Mon, 26 Sep 2022 23:52:59 -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 ams.source.kernel.org (Postfix) with ESMTPS id B33F5B819CC for ; Tue, 27 Sep 2022 06:52:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BCEBC433C1; Tue, 27 Sep 2022 06:52:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664261576; bh=mU9f9LoidskksX7PDIWPHuh8+QezhzFTM0/tR8Icdkk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qxBglPoVVeXt1IoW1KKQdwz0b0EcST7l27JJVnYPVGz4mhbyb2e4Zzeb8H69IlDxc rKS4ekkNMmrCwKCCs0caRmeWyP+Ym46KPtpjZhVyVPKbXPK1+FzxChJw1nkLeiQDfz gka7guPUPKRXGKalPYjlqmqXidA/LWimXSa7pu7bOCb1phWjOsEpoPMyarQirGAuMk RIXBDZ9ShVTVDmII1GL8hJk7B0Z6RwtsbhPNc6bz0lj4xT1Vg6Y1PclkM2WkBTWPlN YO40uefqy5NjE2yiJescyK+oZLmZG6AQA2gZgZ95zOQxoXVZae9r3ogBA3fkCyv5jD LECr4eO+pdGxQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1od4Sj-0006aV-Gu; Tue, 27 Sep 2022 08:53:02 +0200 Date: Tue, 27 Sep 2022 08:53:01 +0200 From: Johan Hovold To: Dmitry Baryshkov Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , 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 Message-ID: References: <20220926172514.880776-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220926172514.880776-1-dmitry.baryshkov@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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 > --- > 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