From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) (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 E388818C92C for ; Mon, 7 Oct 2024 22:09:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728338945; cv=none; b=t1CyMfBCybwaa2CdRkml60df4ZoxZIQg5NZtOB6RTsXJDoyNxZtN39+2eY7wFagLgX9ZgjMY4TIJj0kza+yysCBOroY0TErQUNO4Nrzh/Y8PWFYH/rGOz64p/C7Hdz4bW1BH+dVJZgvnNVJO0fmMTuBZZqt9LzNVotvuqfoRu9Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728338945; c=relaxed/simple; bh=CqX9Y0dEmHgiIN61I3/zW08Bfod5n7pFQiGUVIMbBVk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=PLtU3+Bf0jMbID2bXtWGT6M+5bo5QPQXN+F1UnDxua1eGg0G9n6+VMN4x8ImMvNLwLgy4KkszCbxaNSbTHnJWBAf3YvWtSFsgVOzbvuw78u5PDrevdSFCkCdqwdD5v8MwA6l1TtcqkgHoFyaY6JanVHGhTDGA6eaiv3bc8GJHIM= 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=f42ekjaj; arc=none smtp.client-ip=209.85.219.170 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="f42ekjaj" Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-e28eaf56ffcso350105276.1 for ; Mon, 07 Oct 2024 15:09:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728338941; x=1728943741; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CqX9Y0dEmHgiIN61I3/zW08Bfod5n7pFQiGUVIMbBVk=; b=f42ekjajbfDK67ZKARCmr941NjbWO+zYjmvxMyp4Fy4kuKtSrf2iKVgUnqsi4Pq/C8 ipLnwDdGgIhMpbV6MbaWihNRjelX2+woJYoIbLTf7wbD0Bhx61DhylVJNKfm5EKD+bxx t76f21S9sdP2+Srx/IKijDY7UfyJgxLwnqWIBzkYi0Sb+DT3hOoxoIAQVRQPbOB/qV3q Adu2DK2XKllz6BnqNBICrcVCCtOrLKrRgH/K3/H9o6de1RgHgyfio5vJeL9oVtyZ5KBH JuVFWDW0N8Y7ot5/Mgf88aiwlINp0hKoeKv2zWBPzzQeNqT2AoyY/oKF9WuxmYryhJzP QjeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728338941; x=1728943741; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CqX9Y0dEmHgiIN61I3/zW08Bfod5n7pFQiGUVIMbBVk=; b=TvP7BpjEMBRq9zPw7PqvWwpiBzTFQLFTD1y091ueCi2OjR89XRxkwiyKjrF4HMXdFJ FApsK/SpWTw/Uvzw76l7BgOJ9+MGTllrqH2xWf9eQVya6bmRvR5hlRWiEqVBMr4meb1w nAlHYjAe29De2CRdO3E6w6eV2W/j9MEOb/qTWZGmCPBOTWTv8UPZwGxYuhi/+Uom86eP BOQhp8gIE9HLHnzejYcK+cHMrMi7mE77Ny+rSLeuGapRpCpT6suVqE+rh9UcnzLwMHAg XSBgyiNUNbagOsVjhznQxJeW3oYFa6AdIOe5uBWmr2upKoboexlL4rilLTbq/2WH/Mzj EkLw== X-Forwarded-Encrypted: i=1; AJvYcCUJCdx4jVdGmyCJr8/p656fQqwYdWWgjiza1klWElZ8ShWUbCyU52p6knyG9IHdDhYslXFoggOxtIQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yw0FexnlGlYpc+KJeU2hXHrEcJrOjhxW7flwxBD89p9wHjcHbQ5 SFqgCCO3Hq4lC2r8ceB8bo9oZ/XREBMG40nxWQGzioxRDDIz6sI4dh0CbEo3Qm6H0ZU+W03Y6Jc 1c3461y6xlBF/G9lfuB2TcrSDVLB7mgIde2ZbUQ== X-Google-Smtp-Source: AGHT+IE2nJVabbXdwibt1H0pVBms5dYTsG8RkBKKAzfdsgMhYsZ8VyWIk7HanuWHiQPQxXFBk2ezA08qlljJFN0QQR4= X-Received: by 2002:a05:6902:848:b0:e28:edbd:765f with SMTP id 3f1490d57ef6-e28edbd7f75mr206026276.2.1728338940867; Mon, 07 Oct 2024 15:09:00 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20241004094101.113349-1-sakari.ailus@linux.intel.com> <20241007184924.GH14766@pendragon.ideasonboard.com> In-Reply-To: <20241007184924.GH14766@pendragon.ideasonboard.com> From: Ulf Hansson Date: Tue, 8 Oct 2024 00:08:24 +0200 Message-ID: Subject: Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend() To: Laurent Pinchart Cc: Sakari Ailus , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-clk@vger.kernel.org, linux-crypto@vger.kernel.org, dmaengine@vger.kernel.org, linux-gpio@vger.kernel.org, amd-gfx@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-i3c@lists.infradead.org, linux-iio@vger.kernel.org, linux-input@vger.kernel.org, patches@opensource.cirrus.com, iommu@lists.linux.dev, imx@lists.linux.dev, linux-mediatek@lists.infradead.org, linux-media@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-pci@vger.kernel.org, linux-phy@lists.infradead.org, linux-pwm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-sound@vger.kernel.org, linux-spi@vger.kernel.org, linux-staging@lists.linux.dev, linux-usb@vger.kernel.org, linux-serial@vger.kernel.org, greybus-dev@lists.linaro.org, asahi@lists.linux.dev, rafael@kernel.org, Andy Shevchenko Content-Type: text/plain; charset="UTF-8" On Mon, 7 Oct 2024 at 20:49, Laurent Pinchart wrote: > > Hi Ulf, > > On Fri, Oct 04, 2024 at 04:38:36PM +0200, Ulf Hansson wrote: > > On Fri, 4 Oct 2024 at 11:41, Sakari Ailus wrote: > > > > > > Hello everyone, > > > > > > This set will switch the users of pm_runtime_put_autosuspend() to > > > __pm_runtime_put_autosuspend() while the former will soon be re-purposed > > > to include a call to pm_runtime_mark_last_busy(). The two are almost > > > always used together, apart from bugs which are likely common. Going > > > forward, most new users should be using pm_runtime_put_autosuspend(). > > > > > > Once this conversion is done and pm_runtime_put_autosuspend() re-purposed, > > > I'll post another set to merge the calls to __pm_runtime_put_autosuspend() > > > and pm_runtime_mark_last_busy(). > > > > That sounds like it could cause a lot of churns. > > > > Why not add a new helper function that does the > > pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy() > > things? Then we can start moving users over to this new interface, > > rather than having this intermediate step? > > I think the API would be nicer if we used the shortest and simplest > function names for the most common use cases. Following > pm_runtime_put_autosuspend() with pm_runtime_mark_last_busy() is that > most common use case. That's why I like Sakari's approach of repurposing > pm_runtime_put_autosuspend(), and introducing > __pm_runtime_put_autosuspend() for the odd cases where > pm_runtime_mark_last_busy() shouldn't be called. Okay, so the reason for this approach is because we couldn't find a short and descriptive name that could be used in favor of pm_runtime_put_autosuspend(). Let me throw some ideas at it and maybe you like it - or not. :-) I don't know what options you guys discussed, but to me the entire "autosuspend"-suffix isn't really that necessary in my opinion. There are more ways than calling pm_runtime_put_autosuspend() that triggers us to use the RPM_AUTO flag for rpm_suspend(). For example, just calling pm_runtime_put() has the similar effect. Moreover, it's similar for pm_runtime_mark_last_busy(), it's called during rpm_resume() too, for example. So why bother about having "mark_last_busy" in the new name too. That said, my suggestion is simply "pm_runtime_put_suspend". If you don't like it, I will certainly not object to your current approach, even if I think it leads to unnecessary churns. [...] Kind regards Uffe