From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DD642EA738 for ; Wed, 18 Jun 2025 13:54:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750254874; cv=none; b=WlHZ7INFMqbUhNuWKjE7uSigCa2fHtmubJ42vmQBcSCZr+ZmH2A/ByQYFQ0cn7tte4eNi8w9d3NF4EiD6E/wbqpb5jxsXujX4MA8aO4IWVyi2lWBSFmc1CO4+rjc/4OJOqCVNy5W9FejdnwUKJYlLMFVXr08tE8GILqbn66impI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750254874; c=relaxed/simple; bh=0UFoENu50ZTkfQPdsEVQhcY5hAw7OHivCnTN+o3lPpg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=doeOaeViJm///nlUWZ6ZNxG9PdM9ZWUMDuslpo1O31SyB6G2wiSz7DHFDjvR2E+j+x68DfJeWAHmfsEyFnKMa+2ojEKOPdNWkRB0w2Cri1uOST/RE1/CgnU5TGQ6r1E0a5VnOWhoE2tRX61WzZktdx9t9RFqA24QDSZQOlMM6E8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=V6KBpNr8; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="V6KBpNr8" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4533fbbd21bso3392775e9.2 for ; Wed, 18 Jun 2025 06:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750254870; x=1750859670; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=AWjIwRrGgNhijgz5jxbu7f3s/HYrSgK/4vHwebpDl+0=; b=V6KBpNr8SWxhKdwCywlp5DEfmArCBj84t6trhlCE/nyTXdHrAZk5m8ZsaXI6DsnX+P 4DSoXv59zWrmF/hsMy9Pb8sq06LmtIojJHfyPWi59Tx5jsEpZjR35eMUjUl0WYSgrJW6 MrYYiV3ot7ueA17gLVLTl08dCDakz1VTbhDpYmQ0EztHji4XP54a8PtUOJkFlX8OvjKC jLGqo3dphsw9k7/NDKRtIrz2eC0mtLYFSaRDUV00dNxz+INIMWQtlJVsrHj5VzBtInu7 341S7dCmEHchlhH5NcaVZll81G9qQb6TU3fPtN5wtblbbx8DtgRh0a0CYWn2iU1+em4I p0Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750254870; x=1750859670; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AWjIwRrGgNhijgz5jxbu7f3s/HYrSgK/4vHwebpDl+0=; b=NchD87Y7v0hKAeBP6mkIlUBgpFQXP/riRXRKg2jVkO9kutKG3xrR4URIytFlriLIC/ XnUL5gqydGQvAuetPdD13BOguwyAUvaDqwFrDf2vixpP1ZJ6TAzlOgmksfjqViOEg5tK WoU2a/LD/AL4/xbtZ5+/qvdhjBmDGkz0xB3RFIuyujp/mtlFQyWDwOQnsonZAU7R2bxc ynaNRONjYsZ/y+DCFRNJvx50s6JcOfv5dulSCV7WjckXUecZ5koEQGXSCXRP7AQjCECf ITeN+OYlYpUOYteJ7DRfmCHKzL6jQi6bh/Z1dK5B0TVIILUNw+2Gk4CQJU1+JjlO1dJa idww== X-Forwarded-Encrypted: i=1; AJvYcCUob0IMXIDlQx3zUMtnifm/uvIEnP4MV2Xvsyqg4qhONXytKgeVzIc2HfvaD+WQ0HoCTHeu5tXiUXYKV0g=@vger.kernel.org X-Gm-Message-State: AOJu0YzVIt5mzESZJERtJ2a1iv6ibL1oVVz952QEogFCRHtNF4iPgqP9 RD2tb/02x1sIxXmcK1moXWQmbheONLFnL4b0WcY3qsDu+zKyFjDurN2mP/TfGAiceqQ= X-Gm-Gg: ASbGncvi+R1hJXVLNLoB91VsaadSLOnB61phOxHU2uIHC7EygX9ZNkWIOb1DmglhIrD PssiJLgbQQpvY2c+XfQ4MRODr/sktwNq23JVdH8axG/4BCXFdiHANlQoyoadfDo67gRhQ8behKd XHu4MDcCiVCwCnpRfVGySlf7+ZmXo1o9oT42E1go3meNhjVKA4hDwEu9o5vv4IQTjA/V/jdXq0H g5/KRYnDg8T/pt2UZ+oMBccrpmIaPKGeRpIILxvff2uR2VZdyfl4IbxZBTubEvAdGRQBgnFZ/Tb OspTi467+HW3T5IkvdkvtlTASlkyM6x6HykYLJ8viAVHyYNWorsj6//gA55IMFPhARhIFGIIrfi 2hFoVmKQ= X-Google-Smtp-Source: AGHT+IFIDwtsgZPAfFivmPBda4I5bWtgd3I8v5X2E5jG1PRTDFnTfpxzy7dAaPeCl1P4AggaKF1pUA== X-Received: by 2002:a05:6000:1a8e:b0:3a3:5c97:70c with SMTP id ffacd0b85a97d-3a572e8c559mr5703696f8f.14.1750254869706; Wed, 18 Jun 2025 06:54:29 -0700 (PDT) Received: from [192.168.1.29] ([178.197.223.125]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a58a03f059sm4450137f8f.44.2025.06.18.06.54.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Jun 2025 06:54:29 -0700 (PDT) Message-ID: <07af3f49-6992-4897-acec-b2d46158fa00@linaro.org> Date: Wed, 18 Jun 2025 15:54:26 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 08/17] drm/msm/dsi/phy: Fix reading zero as PLL rates when unprepared To: Dmitry Baryshkov Cc: Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krishna Manikandan , Jonathan Marek , Kuogee Hsieh , Neil Armstrong , Dmitry Baryshkov , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Clark , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Abel Vesa , Srinivas Kandagatla References: <20250610-b4-sm8750-display-v6-0-ee633e3ddbff@linaro.org> <20250610-b4-sm8750-display-v6-8-ee633e3ddbff@linaro.org> <738a889d-9bd5-40c3-a8f5-f76fcde512f4@oss.qualcomm.com> <8a986ebb-5c25-46d9-8a2f-7c0ad7702c15@linaro.org> <24xkss4bw6ww43x2gbjchcm4gtmqhdecncmxopnnhf7y2tblc2@iibgqhuix5rm> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXf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Qbk0N9O0FimwUCaBdQXwUJFpZbKgAKCRAbk0N9O0Fim07TD/92Vcmzn/jaEBcq yT48ODfDIQVvg2nIDW+qbHtJ8DOT0d/qVbBTU7oBuo0xuHo+MTBp0pSTWbThLsSN1AuyP8wF KChC0JPcwOZZRS0dl3lFgg+c+rdZUHjsa247r+7fvm2zGG1/u+33lBJgnAIH5lSCjhP4VXiG q5ngCxGRuBq+0jNCKyAOC/vq2cS/dgdXwmf2aL8G7QVREX7mSl0x+CjWyrpFc1D/9NV/zIWB G1NR1fFb+oeOVhRGubYfiS62htUQjGLK7qbTmrd715kH9Noww1U5HH7WQzePt/SvC0RhQXNj XKBB+lwwM+XulFigmMF1KybRm7MNoLBrGDa3yGpAkHMkJ7NM4iSMdSxYAr60RtThnhKc2kLI zd8GqyBh0nGPIL+1ZVMBDXw1Eu0/Du0rWt1zAKXQYVAfBLCTmkOnPU0fjR7qVT41xdJ6KqQM NGQeV+0o9X91X6VBeK6Na3zt5y4eWkve65DRlk1aoeBmhAteioLZlXkqu0pZv+PKIVf+zFKu h0At/TN/618e/QVlZPbMeNSp3S3ieMP9Q6y4gw5CfgiDRJ2K9g99m6Rvlx1qwom6QbU06ltb vJE2K9oKd9nPp1NrBfBdEhX8oOwdCLJXEq83vdtOEqE42RxfYta4P3by0BHpcwzYbmi/Et7T 2+47PN9NZAOyb771QoVr8A== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 18/06/2025 15:39, Dmitry Baryshkov wrote: > On 18/06/2025 16:34, Krzysztof Kozlowski wrote: >> On 18/06/2025 15:07, Dmitry Baryshkov wrote: >>> On Wed, Jun 18, 2025 at 10:28:10AM +0200, Krzysztof Kozlowski wrote: >>>> On 13/06/2025 16:04, Dmitry Baryshkov wrote: >>>>> On 13/06/2025 17:02, Krzysztof Kozlowski wrote: >>>>>> On 13/06/2025 15:55, Dmitry Baryshkov wrote: >>>>>>>> >>>>>>>> @@ -361,24 +373,47 @@ static int dsi_pll_7nm_lock_status(struct dsi_pll_7nm *pll) >>>>>>>> >>>>>>>> static void dsi_pll_disable_pll_bias(struct dsi_pll_7nm *pll) >>>>>>>> { >>>>>>>> + unsigned long flags; >>>>>>>> u32 data; >>>>>>>> >>>>>>>> + spin_lock_irqsave(&pll->pll_enable_lock, flags); >>>>>>>> + --pll->pll_enable_cnt; >>>>>>>> + if (pll->pll_enable_cnt < 0) { >>>>>>>> + spin_unlock_irqrestore(&pll->pll_enable_lock, flags); >>>>>>>> + DRM_DEV_ERROR_RATELIMITED(&pll->phy->pdev->dev, >>>>>>>> + "bug: imbalance in disabling PLL bias\n"); >>>>>>>> + return; >>>>>>>> + } else if (pll->pll_enable_cnt > 0) { >>>>>>>> + spin_unlock_irqrestore(&pll->pll_enable_lock, flags); >>>>>>>> + return; >>>>>>>> + } /* else: == 0 */ >>>>>>>> + >>>>>>>> data = readl(pll->phy->base + REG_DSI_7nm_PHY_CMN_CTRL_0); >>>>>>>> data &= ~DSI_7nm_PHY_CMN_CTRL_0_PLL_SHUTDOWNB; >>>>>>>> writel(0, pll->phy->pll_base + REG_DSI_7nm_PHY_PLL_SYSTEM_MUXES); >>>>>>>> writel(data, pll->phy->base + REG_DSI_7nm_PHY_CMN_CTRL_0); >>>>>>>> + spin_unlock_irqrestore(&pll->pll_enable_lock, flags); >>>>>>>> ndelay(250); >>>>>>> >>>>>>> What is this ndelay protecting? Is is to let the hardware to wind down >>>>>>> correctly? I'm worried about dsi_pll_disable_pll_bias() beng followed up >>>>>>> by dsi_pll_enable_pll_bias() in another thread, which would mean that >>>>>>> corresponding writes to the REG_DSI_7nm_PHY_CMN_CTRL_0 can come up >>>>>>> without any delay between them. >>>>>>> >>>>>> >>>>>> Great question, but why do you ask me? The code was there already and >>>>>> MSM DRM drivers are not something I know and could provide context about. >>>>> >>>>> Because it's you who are changing the code as you've faced the issue >>>>> with recalc_rate. >>>>> >>>> Heh, the answer is then: I don't know. I think authors of the code could >>>> know. >>> >>> The 10nm HPG documents a 250ns interval between enabling PLL bias and >>> and enabling the PLL via the CMN_PLL_CNTRL register. There is no extra >>> delay between disabling the PLL, disabling FIFO and remobing PLL bias. >>> Please adjust the code for 7nm and 10nm PHYs accordingly. >>> >>> >> >> I can drop this 250 ns here, if that's what you ask me. But fixing >> anything in 10nm is not relevant to this patchset. You were already >> asking me for different fixes for some different things and I find it >> not acceptable anymore. Stop blocking this patchset with every little >> existing issue. > > I think that it is a common practice to ask to fix the issue in relevant No, it is not. It is common practice to fix things everywhere, but you rejecting the patches on that basis (coming again with some requests for unrelated issues) is not common and not correct. > pieces. For example, we frequently ask to fix all the DT files if there > was an issue / workaround reported against a selected set of those. And you reject the submitted fix of one DT file based because contributor did not fix the rest? Really? Since when do you employ such practice? > > In this case you can send a fix for 10nm separately, but please post a > fix for that platform too. > >> >> Or merge this code without this patch if a fix for reading PLL as zero >> anyhow is questionable for you. > > I think I've asked it at some point, to split the generic code parts and > the DSI enablement into two different patch series, so that they could > be picked up separately. > > No, the fix is not questionable. The patch causes questions though. I have no interests in fixing DRM code. This is not my subsystem, this is not part I am responsible for. If it raises questions, why not devoting your time to fix it? Best regards, Krzysztof