Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1729752rwb; Wed, 26 Jul 2023 18:07:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlHw24DCAC9QaBylYUkeXgTeqieJq9ggwLvnu5nEYHmIA37D3c0dmv1KB743lsyaBX0W+UiZ X-Received: by 2002:a2e:7001:0:b0:2b6:e3d5:76a7 with SMTP id l1-20020a2e7001000000b002b6e3d576a7mr467637ljc.24.1690420031460; Wed, 26 Jul 2023 18:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690420031; cv=none; d=google.com; s=arc-20160816; b=YHn+9+A4G8GAs/pnb99JtLnprcD/lAEAy54/wxHk+ajKPkXQs2dc7u9EPqC8IW7bwE Gcx7umvfFEclHVg+l2GhBs7dhBV0YgUEqEtovUGUC+FMbIoj2tDnegwQ5V61nu0XITHB DB6E+PsyiqNRvNrFOF38Bid8NNWMTVaCCnmLTQYzCa+JIY86OBN8ZRMyNc1hqpSeJlPG eGTFb191s4ZfF5iBomfRNnX/tY75Ex5ZQTUb707SKlxZMvCTcQ1YaIvFS2XOirkDf9cy HycaRZHMxBCZPynu2Ho4SEI5bxNSSOIksrEDqbNMOjaJOJILimC+/iap8OdHxC32eOaJ Q1Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0oIStr/OmbJD+W5kWT1prBGbTi+hA2BSJ9OfETR0rZE=; fh=uF1NGLo0fBhApSV/ZxSpfJz8xF0/0ZwzB8oDCW1idqA=; b=pforXoWZyjeZ+QvtGSUZDzEkmkMqTXabUa8VCkFO0tOjPMHD6s0ZBI5nfmTOsR2F83 2Yxo11TjFpvLQqDQyEQBMWM2liMpkadrnzPDEPneePojiJnJK0HcYJwwmAS7Vcb6pYNp +2eNgsrBMXRU44mnH8wZaZRuFUmx0umJn+Cbgi4ssyGBdbJujhQEgPf6uMf7blPee+oC ZCsdClXSfo21Eum+6hKP3VRRixX2CcrIcDfO35xqG/GouwnGjREvK1WZwqcvGxH9B9QN f0yOTb9QO6Ms1clBywRKOrt2Uk7SJbtlpehTq3vSpEFXAoS2LN8J4j6IassKffNJsDLB a4+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="KX/GU4x5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020a170906524d00b0098761ff7860si133158ejm.635.2023.07.26.18.06.46; Wed, 26 Jul 2023 18:07:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="KX/GU4x5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230399AbjG0Af7 (ORCPT + 99 others); Wed, 26 Jul 2023 20:35:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbjG0Af4 (ORCPT ); Wed, 26 Jul 2023 20:35:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A4AC268B; Wed, 26 Jul 2023 17:35:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1FCF561CE2; Thu, 27 Jul 2023 00:35:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 288A3C433C8; Thu, 27 Jul 2023 00:35:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690418154; bh=asGQMrcLTGnqdLEv4v7h7MunHSk6hn+xQskVyzD00EI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KX/GU4x5ISX6eCdyK9NiseW4INm7QCa1E6gqTkMaJlrasrY6D9UzfMbLKEtoYGky6 qbUSZ5OCCkRUDACuVWL0uwyDJ47s52VDav03kw3bxkKI6jS+L1wp5jjOqZfJx4uAVr mXX9G2lNhpRBgyUzIavpmq0W5HdbXWaNcU1ivKwuLFAEVMRiT3A4cya5Fohz8w+pUA UAL2dEjEru2u2acsZ2OFMUArUokuXxZu6UJbpBSh5DiUs2FgXTiA1xh8hKH3IFeWIp VJl0f7FwVTGRzVdra/U7qjviX/fgWHzolZ1Jg8x7f2U7nlM7UwZ/9QmNVZ0cUF96Us elrTHN+6Rk5kQ== Date: Thu, 27 Jul 2023 02:35:51 +0200 From: Andi Shyti To: Samuel Holland Cc: Peter Korsgaard , Andrew Lunn , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: ocores: Move system PM hooks to the NOIRQ phase Message-ID: <20230727003551.dtjx3shwpjs3le6x@intel.intel> References: <20230717203857.2626773-1-samuel.holland@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230717203857.2626773-1-samuel.holland@sifive.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Samuel, On Mon, Jul 17, 2023 at 01:38:57PM -0700, Samuel Holland wrote: > When an I2C device contains a wake IRQ subordinate to a regmap-irq chip, > the regmap-irq code must be able to perform I2C transactions during > suspend_device_irqs() and resume_device_irqs(). Therefore, the bus must > be suspended/resumed during the NOIRQ phase. > > Signed-off-by: Samuel Holland it's OK for me. Peter, any comment on this? Andi > --- > > drivers/i2c/busses/i2c-ocores.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c > index 4ac77e57bbbf..b1f621d42910 100644 > --- a/drivers/i2c/busses/i2c-ocores.c > +++ b/drivers/i2c/busses/i2c-ocores.c > @@ -743,7 +743,6 @@ static void ocores_i2c_remove(struct platform_device *pdev) > i2c_del_adapter(&i2c->adap); > } > > -#ifdef CONFIG_PM_SLEEP > static int ocores_i2c_suspend(struct device *dev) > { > struct ocores_i2c *i2c = dev_get_drvdata(dev); > @@ -772,11 +771,9 @@ static int ocores_i2c_resume(struct device *dev) > return ocores_init(dev, i2c); > } > > -static SIMPLE_DEV_PM_OPS(ocores_i2c_pm, ocores_i2c_suspend, ocores_i2c_resume); > -#define OCORES_I2C_PM (&ocores_i2c_pm) > -#else > -#define OCORES_I2C_PM NULL > -#endif > +static const struct dev_pm_ops ocores_i2c_pm_ops = { > + NOIRQ_SYSTEM_SLEEP_PM_OPS(ocores_i2c_suspend, ocores_i2c_resume) > +}; > > static struct platform_driver ocores_i2c_driver = { > .probe = ocores_i2c_probe, > @@ -784,7 +781,7 @@ static struct platform_driver ocores_i2c_driver = { > .driver = { > .name = "ocores-i2c", > .of_match_table = ocores_i2c_match, > - .pm = OCORES_I2C_PM, > + .pm = &ocores_i2c_pm_ops, > }, > }; > > -- > 2.40.1 >