Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2549583rwj; Mon, 19 Dec 2022 06:07:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf5sgEeoZ8ptt6tG/V2Vi6gmy3waArWjHAB7Bvve4j9K6CCG13mLzel4G0xI5W2QLmsK/+Ft X-Received: by 2002:a17:906:480b:b0:7c0:aabd:fef0 with SMTP id w11-20020a170906480b00b007c0aabdfef0mr35986203ejq.17.1671458850271; Mon, 19 Dec 2022 06:07:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671458850; cv=none; d=google.com; s=arc-20160816; b=dSxBnEnXaF/h3ofkPKRSxkC7Egqr9FRWnp0G64y2KyMvH9TDDKA94TGkNBBRDUYqqC w5TRvmATkcEUGy35VdQ8Y/aQZN4ySR4FvPdDknFVk47DWhsTEBLkkVONr+47QiC5k2AL jvzqu14MvoEb3ZU4lDpT2QnpZLu5BsJaHCeT8wHHTxJFyh5RWL7wV7qe9TYrL16zVykQ TTjR8pDCRnYEvV6a2QmVANbyFecpbcxsGEAmp8LINmlwF0e9/byu9BE5mvGpUn2pm7Hm 2R9Hk2eu1ewLShM0uf+CYdO53YT3px7rYoPxbh1biK+kEfWmp6CHAg7tRMKd6x1Mv0kn lIoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xFAyqgewJCOmxHzf7VbIgeN2WUqDY4BZ0feP6I9NsQQ=; b=SeJykQhdtyEHSqF8LDV13i2yvTNXzQkqBoSnGxyOGPPUzC0KkNiWe0WQ7RE/ZycXSH 1LOmW7X3yneFqkWMm5/8Pgw4I1yS+hi8cvWmLD5/BcKGWeZmGrfKOzDgA8dXJ3MuVuGr lujSs+AGYrwQ09L1rONqhGNqCKcgmicPM0TyBj6fZZ3xKP8EYWt8ds03capMGMkRVXqS gI4yTGZB8StfdHE5UgtprLlwsY0gFnJ8IqqMK3x+PecTrPuyFCqKspbBYI6Xvf9l9eKc Im5XbISI7LhhPpPt20b+2g7LG6NgtArkDOBHJNLrh8biyo4A3eMio0jebrhFIe9zPCmJ dwaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f+Sba0MM; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xe1-20020a170907318100b007c10b6790bfsi9521644ejb.68.2022.12.19.06.07.06; Mon, 19 Dec 2022 06:07:30 -0800 (PST) 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=@intel.com header.s=Intel header.b=f+Sba0MM; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231545AbiLSNLH (ORCPT + 70 others); Mon, 19 Dec 2022 08:11:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231712AbiLSNLD (ORCPT ); Mon, 19 Dec 2022 08:11:03 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 483428FE7; Mon, 19 Dec 2022 05:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671455462; x=1702991462; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=cfu7nn7qs6yDdiRgwGy1GBfso8mGEh+ivNzLv4Ej808=; b=f+Sba0MMNn2rCv5/8OWnvycXOb0PMHYXrQP5LC5aAhHKoXrKRHeHB4nr 3OVHaPg90bgTNpnBP+8XFlKr8dsL8frlMHcK7ROVlcWJih4w+EGg4VmTF T60QQ4gksMMgFQhtL8yHhTVf2dUSKQwami9qZ5ASZXG4L2WqWgN1XWADA wupJLtns8Ba89aGwDRgkoK7zbBNUOCj6hcP1krq8jW10sTH5qgg2bFEjG waaqX8W+BkvaVEdeNsiTkWzkPTCKJuWlqJvAZzF1ffE78bjGfDAPD72a5 A2YR5G9rRb7YqzYhpupeyEmnNSjm9qaQNNyh0Mf4UjMBbZ7lEzU+C6dDn A==; X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="316980323" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="316980323" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 05:11:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="719105753" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="719105753" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga004.fm.intel.com with ESMTP; 19 Dec 2022 05:10:59 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p7Fuz-00CIa0-2w; Mon, 19 Dec 2022 15:10:57 +0200 Date: Mon, 19 Dec 2022 15:10:57 +0200 From: Andy Shevchenko To: Richard Fitzgerald Cc: jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com, jsd@semihalf.com, wsa@kernel.org, hdegoede@redhat.com, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: Re: [PATCH v4] i2c: designware: Fix unbalanced suspended flag Message-ID: References: <20221219130145.883309-1-rf@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221219130145.883309-1-rf@opensource.cirrus.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE 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 On Mon, Dec 19, 2022 at 01:01:45PM +0000, Richard Fitzgerald wrote: > Ensure that i2c_mark_adapter_suspended() is always balanced by a call to > i2c_mark_adapter_resumed(). > > dw_i2c_plat_resume() must always be called, so that > i2c_mark_adapter_resumed() is called. This is not compatible with > DPM_FLAG_MAY_SKIP_RESUME, so remove the flag. > > Since the controller is always resumed on system resume the > dw_i2c_plat_complete() callback is redundant and has been removed. > > The unbalanced suspended flag was introduced by commit c57813b8b288 > ("i2c: designware: Lock the adapter while setting the suspended flag") > > Before that commit, the system and runtime PM used the same functions. The > DPM_FLAG_MAY_SKIP_RESUME was used to skip the system resume if the driver > had been in runtime-suspend. If system resume was skipped, the suspended > flag would be cleared by the next runtime resume. The check of the > suspended flag was _after_ the call to pm_runtime_get_sync() in > i2c_dw_xfer(). So either a system resume or a runtime resume would clear > the flag before it was checked. > > Having introduced the unbalanced suspended flag with that commit, a further > commit 80704a84a9f8 > ("i2c: designware: Use the i2c_mark_adapter_suspended/resumed() helpers") This is still unwrapped propertly, but no need to resend, it so minor, really. Just a hint for the future submissions. > changed from using a local suspended flag to using the > i2c_mark_adapter_suspended/resumed() functions. These use a flag that is > checked by I2C core code before issuing the transfer to the bus driver, so > there was no opportunity for the bus driver to runtime resume itself before > the flag check. ... > --- > Changes from v3: > - Fixed wrapping in commit description. No code changes Thank you, but see the above :-) -- With Best Regards, Andy Shevchenko