From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23FEE1FBF51 for ; Tue, 12 Nov 2024 13:55:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731419738; cv=none; b=PHfeUF+rAn41odAyE7q5TxV1TC3+SntQaVTWeeJEhKey5aSvcDsA0qdNLfVkuS4bAOaLUE8j0dEyJ6MAWYM418/7rAQ365W20MUpP2iEQ06orV3bbvPFbTLCkLWNSzV0NareJ9kiwbnuDQbxsQFsSLFK0Pz5jR7px9uP5xCriCw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731419738; c=relaxed/simple; bh=wVhWepG5ipKBph4MdKxl7IN3Iu15gPli/CQF7GkV1ng=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nsg6BKD/h/U1I0ZWBdfFRGkuoTSBg3cmlheDOOLMymFi3FBIU/W7AZm4oDIZLYP7shLFi6qFpPZbRo6VvafcaEujFwEv0j1HpzwHCjwua2ErFr69E7a6rIHcKq2VgRz30V3AenxBWdML1qd90yIcSsh2RwS0EvFF6Dxee7FkZio= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ah81A8my; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ah81A8my" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B18BC4CECD; Tue, 12 Nov 2024 13:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1731419737; bh=wVhWepG5ipKBph4MdKxl7IN3Iu15gPli/CQF7GkV1ng=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ah81A8my9r1ybO6l447XUt9Nxob6kD6xCpF6+nIydADyOimPljoPbmC2GM15jTBbE AzbWHVKJA/AdahcslpFpnLiMUJhSpewRRDaI9dBvfJ33TMEEO0fOw5zV1qZ2PqCXNB y2XurDJdgQQkIqa3FuFk2/5iBut+1lfpr8ndhICM= Date: Tue, 12 Nov 2024 14:55:34 +0100 From: Greg Kroah-Hartman To: Peng Fan Cc: "Peng Fan (OSS)" , "Rafael J. Wysocki" , open list , Dmitry Torokhov , Rob Herring , Ulf Hansson Subject: Re: [PATCH] drivers: core: clear wake irq in device_unbind_cleanup Message-ID: <2024111213-eradicate-puma-3592@gregkh> References: <20241111092131.1693319-1-peng.fan@oss.nxp.com> <2024111207-baggie-eskimo-d2b0@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@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 Tue, Nov 12, 2024 at 01:09:19PM +0000, Peng Fan wrote: > Hi Greg > > > Subject: Re: [PATCH] drivers: core: clear wake irq in > > device_unbind_cleanup > > > > On Mon, Nov 11, 2024 at 05:21:30PM +0800, Peng Fan (OSS) wrote: > > > From: Peng Fan > > > > > > With dev_pm_clear_wake_irq in device_unbind_cleanup, there is no > > need > > > to invoke dev_pm_clear_wake_irq in driver remove hook explicitly. > > > > > > Cc: Dmitry Torokhov > > > Cc: Rob Herring > > > Cc: Ulf Hansson > > > Signed-off-by: Peng Fan > > > --- > > > drivers/base/dd.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/drivers/base/dd.c b/drivers/base/dd.c index > > > f0e4b4aba885..ea3a871bdd11 100644 > > > --- a/drivers/base/dd.c > > > +++ b/drivers/base/dd.c > > > @@ -26,6 +26,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > > > > @@ -556,6 +557,7 @@ static void device_unbind_cleanup(struct > > device *dev) > > > dev->pm_domain->dismiss(dev); > > > pm_runtime_reinit(dev); > > > dev_pm_set_driver_flags(dev, 0); > > > + dev_pm_clear_wake_irq(dev); > > > > I don't understand, you say you don't need to invoke it, yet you are > > calling it here. > > I mean not need to invoke it in driver.remove hook. With this patch, we > could remove > https://elixir.bootlin.com/linux/v6.11.7/source/drivers/input/touchscreen/ti_am335x_tsc.c#L498 > and same to other drivers. But you did not say that, and you would need to make this as part of a series. Also, are you sure that ll drivers want to clear this irq flag? What is wrong with just doing it explicitly in the drivers that need it? > > > > What commit id does this fix? > > I am thinking to take this as a improvement, with core code > has this, the various drivers no need explicitly invoke it > in their own driver remove hook. > > And what bug is this resolving? What > > drivers are broken without this? > > See here: > https://lore.kernel.org/all/ZymxvLMkkktRoCXZ@google.com/ Again, this seems to be a per-driver thing. What do you break if you attempt to do this for all drivers? What about drivers that share irqs? How was this tested? On what platfoms? thanks, greg k-h