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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D238C71155 for ; Fri, 20 Jun 2025 12:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7gmpHRiB06w/33SYnXC0XlcZIz0j82aepex3MJBZIfI=; b=q/mt0eV+mOTOZP WaxZFEicORgq5rkZJzkI4yJNvfE6s7aizlTjLKU89VL5TUnLvY8P2l2VpGLgECdB2QMLfmaUPnajP zPHWQEV3aEPJvRbUvx0hmO6XgeZIa5QP6zF3ortn4s+jC4dyjhmjaKWdoxGri7z82qBLSRNIbAXjn LMbDSheb/dQLLmvavHELvOVPQhSEzLami6cEZ7lO19VOfAdgXMeRDhD9IBnK+5Y33+wIYFgCH0JGN xTb1EX/CiwcNUfNRzUNae1SZC5dyYf1kSMZuyjw3THRvk1oIJiHEwSiwIFrsAzj7mLJ7aNi11iYKz /yovZieSWnoPsgMSCLiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uSbJZ-0000000Fc7t-1nIv; Fri, 20 Jun 2025 12:57:53 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uSaUE-0000000FX2B-2HtL; Fri, 20 Jun 2025 12:04:51 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4E59D106F; Fri, 20 Jun 2025 05:04:30 -0700 (PDT) Received: from [192.168.1.102] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AD2173F58B; Fri, 20 Jun 2025 05:04:47 -0700 (PDT) Message-ID: <4c2c9a15-50bc-4a89-b5fe-d9014657fca7@arm.com> Date: Fri, 20 Jun 2025 13:04:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v5 3/4] phy: rockchip-pcie: Enable all four lanes To: Geraldo Nascimento , linux-rockchip@lists.infradead.org Cc: Shawn Lin , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , Rick wertenbroek , linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: From: Robin Murphy Content-Language: en-GB In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250620_050450_632035_BAD5A28A X-CRM114-Status: GOOD ( 14.17 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On 2025-06-13 6:03 pm, Geraldo Nascimento wrote: > Current code enables only Lane 0 because pwr_cnt will be incremented > on first call to the function. Use for-loop to enable all 4 lanes > through GRF. If this was really necessary, then surely it would also need the equivalent changes in rockchip_pcie_phy_power_off() too? However, I'm not sure it *is* necessary - the NVMe on my RK3399 board happily claims to be using an x4 link, so I stuck a print of inst->index in this function, and sure enough I do see it being called for each instance already: [ 1.737479] phy phy-ff770000.syscon:pcie-phy.1: power_on 0 [ 1.738810] phy phy-ff770000.syscon:pcie-phy.2: power_on 1 [ 1.745193] phy phy-ff770000.syscon:pcie-phy.3: power_on 2 [ 1.745196] phy phy-ff770000.syscon:pcie-phy.4: power_on 3 Thanks, Robin. > Signed-off-by: Geraldo Nascimento > --- > drivers/phy/rockchip/phy-rockchip-pcie.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/drivers/phy/rockchip/phy-rockchip-pcie.c b/drivers/phy/rockchip/phy-rockchip-pcie.c > index bd44af36c67a..48bcc7d2b33b 100644 > --- a/drivers/phy/rockchip/phy-rockchip-pcie.c > +++ b/drivers/phy/rockchip/phy-rockchip-pcie.c > @@ -176,11 +176,13 @@ static int rockchip_pcie_phy_power_on(struct phy *phy) > PHY_CFG_ADDR_MASK, > PHY_CFG_ADDR_SHIFT)); > > - regmap_write(rk_phy->reg_base, > - rk_phy->phy_data->pcie_laneoff, > - HIWORD_UPDATE(!PHY_LANE_IDLE_OFF, > - PHY_LANE_IDLE_MASK, > - PHY_LANE_IDLE_A_SHIFT + inst->index)); > + for (int i=0; i < PHY_MAX_LANE_NUM; i++) { > + regmap_write(rk_phy->reg_base, > + rk_phy->phy_data->pcie_laneoff, > + HIWORD_UPDATE(!PHY_LANE_IDLE_OFF, > + PHY_LANE_IDLE_MASK, > + PHY_LANE_IDLE_A_SHIFT + i)); > + } > > /* > * No documented timeout value for phy operation below, _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip