From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 781AA1CD3F for ; Wed, 18 Sep 2024 13:10:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726665011; cv=none; b=lESZeYKeOa9Axcvhl9qgYSIO0Yf9t1bU+74f3nZFjChDaOyeTI02RPzDD4TfDXAiQmtx/cH6dBhNAfj6syLAzyoyNufIeYFD4VwLQb+QLdvBUZvhyMGs4I4am5AobPPaQLf+JRtgfBt52rG+eAR8ymuatsyFPzAzBTvZvuNTThM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726665011; c=relaxed/simple; bh=qSS9j04dMz97s1/G7sXN4oo94BzskpOxNZlCp1HcBGs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QOeSI40kfBOzf12udOs8EUF7gp2WVbH0OknWOtnawh9v6nkb7fnERKd4y0xDb/kC4jlp4rHOZ7QHaCIgkiFEm9Ac+XQ+4IvJAbDA1vX2AmveKGHvyHCecQ3MQLTa9dBShN7uxraZGrnSAlN/MdOTWxHerj8MOao4GPhswXj15OQ= 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=bXMUM1eh; arc=none smtp.client-ip=209.85.208.43 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="bXMUM1eh" Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-5c241feb80dso1594624a12.0 for ; Wed, 18 Sep 2024 06:10:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726665008; x=1727269808; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VVRgT66/mOuXoJrqQ8wh1eZWHMJn1TVCedz1ceMT+pM=; b=bXMUM1ehfNXoefr+2aBc3G/dLfGptZpgUDvbcIEq1jnu4aLwvo8HeYO/DcAJje3MHV 3cATBVkLuErbn3GPp4oR47+s373xqpNee+GkfeoGq2F9glXutMQwLWwspFXhSlHaAaGT wIow2jvihLG4EexhxvQfKTsBACPh7OLa4M5NiaT1WKgHWmD0SsrA/Dko0FIFnuRfVqIQ 7kh1A62kShBJBqAqOlKno1UEQJCTlSQDAPBiCNTGChsKQJ6tZdNW2c8Ip25Dp05Yibvy RuPGOnWItTXjn32KistG+ktBb8sZrnI6WnRnN/Uj7BnyUIys7PVjhajKoP27slpp1rdp VPNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726665008; x=1727269808; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VVRgT66/mOuXoJrqQ8wh1eZWHMJn1TVCedz1ceMT+pM=; b=eXx76mfSEybn3rRurYihakuP0KkX8xSnj29Acspg3zonKdYrkArN5cPZGPQ+xOjs/w EhA00Uqf85EMT8yjCKjeir0LquEIkBQD+DhdAGBVtxPLftzTQlnQYCREQKri9H1FDlle 14ut6f+oO8k13EdqpqS1oAVW7Iaqqlcztd2krxjOJXsojuL3luOjMApP00c9RND5jbqW 8WtlLaXaI6mIJXRSJcDF/FBiXcPUGG2a/0tqpzeQRjDG5ZoH5YO3uXE5uUDBNXhDb4P/ aKNOFVY992JIobus1+mroiIKY3dXjuq7YR2CnmBRh8l5WAOLKPxYx3lX8MEA9Tvzty2Y 3Zmg== X-Forwarded-Encrypted: i=1; AJvYcCXFWeoU9lkSyjLXHTZetNBw9lMOQPYJo/fV6SFKflXJ/tvDxhqFp5VkWfnP0NKxRS2vaxVZe3jMnBh03SFT@vger.kernel.org X-Gm-Message-State: AOJu0Yz5roCot+bf7kHOB7G/jH2E9bwXwfR7sJY1uxtzkJkNui6XUGGf 4JhQV6EmXeqcWu6EUhn6Rt3Qhs5AC3JXRpq/5IvaOY+KgzFRzsmQ3PRz0NZNJTkUx5j3JTbl6XK K X-Google-Smtp-Source: AGHT+IGHtxlIXrPw47xVhdH8uLboKPn/Kp7bXo6oA0xYfYIupxuqexOncbN9AZZ0BmhjMlNITwnFjw== X-Received: by 2002:a17:907:1b05:b0:a7a:afe8:1013 with SMTP id a640c23a62f3a-a902a3d188dmr2413879466b.1.1726665007741; Wed, 18 Sep 2024 06:10:07 -0700 (PDT) Received: from linaro.org ([62.231.96.65]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9060f39a8fsm588762066b.0.2024.09.18.06.10.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 06:10:07 -0700 (PDT) Date: Wed, 18 Sep 2024 16:10:05 +0300 From: Abel Vesa To: Johan Hovold Cc: Vinod Koul , Kishon Vijay Abraham I , Dmitry Baryshkov , Manivannan Sadhasivam , Srinivas Kandagatla , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] phy: qcom: edp: Add runtime PM support Message-ID: References: <20240907-phy-qcom-edp-enable-runtime-pm-v1-1-8b9ee4210e1e@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 24-09-18 12:05:59, Johan Hovold wrote: > On Sat, Sep 07, 2024 at 06:25:21PM +0300, Abel Vesa wrote: > > Enable runtime PM support by adding proper ops which will handle the > > Avoid words like 'proper' here (what are non-proper runtime PM ops?). Sure. > > > clocks and regulators. These resources will now be handled on power_on and > > power_off instead of init and exit PHY ops. > > No, this is simply a false claim and indicates that you haven't reviewed > how PHY runtime PM works. Core will increment the usage count on init() > and decrement it on exit(). Yeah, I guess the better argument here would be that the PHY needs regulators and clocks enabled. Anyway, ignore this version as it was already NACKed by Dmitry. > > > Also enable these resources on > > probe in order to balance out the disabling that is happening right after. > > Prevent runtime PM from being ON by default as well. > > And here you just regressed all current systems that do not have udev > rules to enable runtime PM, and which will now be stuck with these > resources always-on (e.g. during DPMS off and system suspend). > > In fact, you are even regressing systems that would enable runtime PM, > as the runtime suspend callback would not currently be called when you > enter system suspend so the regulators and clocks will be left on. > > This clearly hasn't been tested and analysed properly. > > > +static int __maybe_unused qcom_edp_runtime_suspend(struct device *dev) > > +{ > > + struct qcom_edp *edp = dev_get_drvdata(dev); > > + > > + dev_err(dev, "Suspending DP phy\n"); > > You forgot to drop your development printks (same below). > > Johan 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 29587CCD1A0 for ; Wed, 18 Sep 2024 13:10:12 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=y7cRwyIDAdeFsgo/X1GfnVCT1+zgzqTcpMdh1DAeyfM=; b=Jqwg6XqdPZ++H4 c+DiVgKfNgcRn5UkqPSNJQrYF2/CDELYC49rHenza3sTuajOJemfGlevJnMD/JmR+sTqk9kDim5g3 7E/k66cQCnkYQZi9H4+iSpDqBm7p/5ex1hiQfphfNxnr1GFeHLHgofdZhaAxGm5fVbRER0Y3ftFpg ecNvgHP97arMFSgud67WOTE/2QBqEL+50yJSgW6L+QS9K3YP6qyoN4rgF8U+UvtKT9LA48bvXMz0w IE5SN9WyiLdiWNwdwPZMMjTk7kJrNxWd8SCU7UwE4FVDwJFkJ0+lRjbZdkXl7KtbS7lnWJiS4fr34 QGMjxqeuKAY3GlGXVYWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1squRf-00000008J2C-3WWy; Wed, 18 Sep 2024 13:10:11 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1squRe-00000008J1f-003a for linux-phy@lists.infradead.org; Wed, 18 Sep 2024 13:10:11 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a8d6ac24a3bso153471166b.1 for ; Wed, 18 Sep 2024 06:10:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726665008; x=1727269808; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VVRgT66/mOuXoJrqQ8wh1eZWHMJn1TVCedz1ceMT+pM=; b=faO5qL7hcJM/E93wrgiDJS3CLnaI5T8WKlCVKKhUtdO1RTWZu2YquR20cU+hDxFptz hIKKGZIEeNTsLFg4gfcOPhVNkUPxhzB3RIlUQWdus6WVe6hUsSucqUOtDWrVrHDFooP+ agQgyFqPs9SPewgAlYroGE2iZWwMDqy5mpFeoRghBak3iyYC74pLzSVy/2S44f5eMn8I 52no3lfxxS+VVkPqYbffVDj8UVTofxyriOi949PjPnCSaDqjBKwB1uKjQ4+sJeLbX9Pw MWQ1FJxrDEK+9rd3nRdn/nw30TAdyKNjAzbyJBWd2PBleOparAniQikn1q0rfhWXd1h2 X/0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726665008; x=1727269808; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VVRgT66/mOuXoJrqQ8wh1eZWHMJn1TVCedz1ceMT+pM=; b=lLsQdc2AKtwUKxFWXbgprkTdiyz23boo8JHOpiZbgYvFCySIIQWojcqgNNt/9S6Sub HHlyK47foWHwu6aoibnSJsPABkP7rV+IgaiwhR9XJPwCnJ+Q2Mb4dFox8Z0atHp8Ch5z ukkQLLo9gXWLYG57eibrmY0rbtZkywF96lBsMpEipIzx2jUeCpThzpb3GOUDh/JM2TKL zBURS0ik/5nEOPQNSmrH3ZFUKTorQmzcmaVjlkf3/JfGehW/6Skli/2+XaCsivirM8xH eSqWmPvtqocy0yU85I7yXOQBesO+A32lkbStJdfg2WXnXwfHXR5+y+tlju1MG+YVoj+/ S6CQ== X-Forwarded-Encrypted: i=1; AJvYcCWYfprnh5/Ni6AWJxiiIBIZVpvr5YJCsjGsCZ2i1XJtba97ED7o2SYXtYTvHRTdF7YJ+LI/st5J6Y4=@lists.infradead.org X-Gm-Message-State: AOJu0YxqYA2J+qa4saAD7ZUu7/e3ds8BKKnEzfiHF9vgtQTHNiEccmdh erZQEYnJGTj5HUyn3EdY0KomAP8VknxiPRYqIX9CLOOkramxuWaHpXUAjQlyDdM= X-Google-Smtp-Source: AGHT+IGHtxlIXrPw47xVhdH8uLboKPn/Kp7bXo6oA0xYfYIupxuqexOncbN9AZZ0BmhjMlNITwnFjw== X-Received: by 2002:a17:907:1b05:b0:a7a:afe8:1013 with SMTP id a640c23a62f3a-a902a3d188dmr2413879466b.1.1726665007741; Wed, 18 Sep 2024 06:10:07 -0700 (PDT) Received: from linaro.org ([62.231.96.65]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9060f39a8fsm588762066b.0.2024.09.18.06.10.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 06:10:07 -0700 (PDT) Date: Wed, 18 Sep 2024 16:10:05 +0300 From: Abel Vesa To: Johan Hovold Cc: Vinod Koul , Kishon Vijay Abraham I , Dmitry Baryshkov , Manivannan Sadhasivam , Srinivas Kandagatla , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] phy: qcom: edp: Add runtime PM support Message-ID: References: <20240907-phy-qcom-edp-enable-runtime-pm-v1-1-8b9ee4210e1e@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240918_061010_077895_3814FB34 X-CRM114-Status: GOOD ( 19.34 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On 24-09-18 12:05:59, Johan Hovold wrote: > On Sat, Sep 07, 2024 at 06:25:21PM +0300, Abel Vesa wrote: > > Enable runtime PM support by adding proper ops which will handle the > > Avoid words like 'proper' here (what are non-proper runtime PM ops?). Sure. > > > clocks and regulators. These resources will now be handled on power_on and > > power_off instead of init and exit PHY ops. > > No, this is simply a false claim and indicates that you haven't reviewed > how PHY runtime PM works. Core will increment the usage count on init() > and decrement it on exit(). Yeah, I guess the better argument here would be that the PHY needs regulators and clocks enabled. Anyway, ignore this version as it was already NACKed by Dmitry. > > > Also enable these resources on > > probe in order to balance out the disabling that is happening right after. > > Prevent runtime PM from being ON by default as well. > > And here you just regressed all current systems that do not have udev > rules to enable runtime PM, and which will now be stuck with these > resources always-on (e.g. during DPMS off and system suspend). > > In fact, you are even regressing systems that would enable runtime PM, > as the runtime suspend callback would not currently be called when you > enter system suspend so the regulators and clocks will be left on. > > This clearly hasn't been tested and analysed properly. > > > +static int __maybe_unused qcom_edp_runtime_suspend(struct device *dev) > > +{ > > + struct qcom_edp *edp = dev_get_drvdata(dev); > > + > > + dev_err(dev, "Suspending DP phy\n"); > > You forgot to drop your development printks (same below). > > Johan -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy