Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6062782rwp; Mon, 17 Jul 2023 14:16:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlEhpicp+Deoget0PMsjrljAX2tmCmv/sAd/EHQ2hyMQ0ab6H5Sb8BINXySMAmnX0FY9o/di X-Received: by 2002:a05:6a21:3383:b0:134:7199:95ca with SMTP id yy3-20020a056a21338300b00134719995camr6755880pzb.6.1689628614063; Mon, 17 Jul 2023 14:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689628614; cv=none; d=google.com; s=arc-20160816; b=UhpNUFp6qfL45a3t2IjfUl5AJl0TKaxi+awt8D7fqvI3L7+N7HAorX6yZooQHwDd/N b3mTQS3sJGcZoPr3yr5Q9OQUL4Cy8rCrgkluNs2v8CbFEfA8CvroeJ6j31xcU48tCchX ukv5WM3/kHaDi6otuFN8v2D7Z8ul+Kh7gABZlesmF3SF50pQ7zKuKXlifXihtgvTSHtz fS0/8FLxKxdAJ9e9m5KC9HeuLwRAfUoPO08I/J+WKQWAyTTYs/uoR+wQMI8ZohRPFLqi dahYYPAazut97rgOIhf2o2bge9nKAnIEzBPXC59/MDlkZFrX2K7nYppRwSK5IlVsLVh7 k1qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7tT6FOFtH3ohDgShMpbLWtPrL0RbY5dikqjcrYpu9jQ=; fh=i05pYwNm2eDNBq6g2wF1riqDyniI8q+vhsXgIZCE7tc=; b=rG2VJ+lfsvxHAO6tm5AMiPoLNJbV9s4jzv6l8MI17pipFtmbEw1gUDMzSERwq3oPmB WAa5jrLGS3MufyFjsMNERMCPZJ6qcAbttr+JpfGSFWCKoADiy3k0eq1shluAmIWkljjd a6FgS4DitvUei3wCYKPo5ZDWrht5t8/YxkgTutJmClGPM7bs4576l8JUluUVAN7bZb+z tlZLlTPdpwmq/aTmQJuY2sufFKVuGFNfPa7nOoaKy86x1jlfCKcS/OQVstfF6WuUcNfl kQewlCBnLibNNlWT/G6gcyCvDyKPSBYkl5TMEFOvyHm/T39cIEfzO1Uu9jiq3ZGMSKuc oZUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=ZvGwKqxG; 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=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l63-20020a639142000000b0053424040bb7si389233pge.298.2023.07.17.14.16.41; Mon, 17 Jul 2023 14:16:54 -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=@sifive.com header.s=google header.b=ZvGwKqxG; 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=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229585AbjGQUjC (ORCPT + 99 others); Mon, 17 Jul 2023 16:39:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230319AbjGQUjB (ORCPT ); Mon, 17 Jul 2023 16:39:01 -0400 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F783103 for ; Mon, 17 Jul 2023 13:39:00 -0700 (PDT) Received: by mail-io1-xd36.google.com with SMTP id ca18e2360f4ac-7836272f36eso226912739f.1 for ; Mon, 17 Jul 2023 13:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1689626339; x=1692218339; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7tT6FOFtH3ohDgShMpbLWtPrL0RbY5dikqjcrYpu9jQ=; b=ZvGwKqxG6qgetzFMhWNfLscpg66l0U3YhjbK/Ssw/IcZUjPhffiOgaYsXEhF629moB fW2K6+Ow084JYJjlSQj0Ro0m7VIIzYfdQrfNw8RSErsKuZp/6IaO+b1d+5XbvOIUdDv7 RtXyxdHgpk4KNMFOCvQxrBAlrJyQSfEa89Z9bf8EbErqmmylx3B0iUMcKembc8C1LHHI 1C5cmTZNRnINvGRpn4X1X9rKbV0HcgZRiIUsH1ySZ9ndIhrpI277pWbPTs+yTLN8y/PU bUBPBJYWE/XNVbb3u/puEI8oj3BDPKm+j7euUAkiA6wUBefxer7hwSMkpDZBEIdl9OOd mokw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689626339; x=1692218339; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7tT6FOFtH3ohDgShMpbLWtPrL0RbY5dikqjcrYpu9jQ=; b=GJyNcJTxxAD1gwv3X9NWvDvdOVm6N5NPBxXjZxeNNykge4WxjvJDpKX8UMi8gpQitl isoYTQEiy7kVlHE0DQoKbjADKOS1AV+kPwcOhIP8i7iT05FRMlHnp+guxbYc4z1PWwiG ZmncPv1/SO6vE+ovlYh0VObgJt2lyLo0KQlhdObEMD3Di4wbJS8BvRsS6ZWnpGwBNSBx Iuu894ANRsPBIYi4t352zn3KcYx6UpTw4y19LXyCTOxM+jT+ramovhKwMHICvm3Gmmzb SYPzng4gU1O6+U7p6xu98oC320/kSl8K742xYHq0ewVoNA+cC2P3n28Aj6T9czPSVPpE mkMA== X-Gm-Message-State: ABy/qLbRfIiAxlRbFhP0w22yuUo+EEiUkMBxUsxgzj5Knt4h7F6ULcJB s1WUFtoypAde+JgZeg/NeUP87w6U7yZs/qbWXRfRSA== X-Received: by 2002:a05:6e02:1bae:b0:348:1a1d:79a5 with SMTP id n14-20020a056e021bae00b003481a1d79a5mr857769ili.15.1689626339606; Mon, 17 Jul 2023 13:38:59 -0700 (PDT) Received: from sw06.internal.sifive.com ([64.62.193.194]) by smtp.gmail.com with ESMTPSA id 6-20020a17090a1a4600b0025eaeaae318sm254143pjl.7.2023.07.17.13.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 13:38:59 -0700 (PDT) From: Samuel Holland To: Peter Korsgaard , Andrew Lunn Cc: Samuel Holland , Andi Shyti , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] i2c: ocores: Move system PM hooks to the NOIRQ phase Date: Mon, 17 Jul 2023 13:38:57 -0700 Message-Id: <20230717203857.2626773-1-samuel.holland@sifive.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 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 --- 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