Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2811740rwb; Fri, 9 Dec 2022 06:39:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf72vMkaMWP6MExPNieEyOhPF+/8+0xJa/dY8y6BgdH/vVgloutmy9hW9WFmSQYko5l9eMqT X-Received: by 2002:a05:6a21:9103:b0:a5:35f1:95d1 with SMTP id tn3-20020a056a21910300b000a535f195d1mr7205259pzb.35.1670596749347; Fri, 09 Dec 2022 06:39:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670596749; cv=none; d=google.com; s=arc-20160816; b=tdpDkDJ0RgMSznrhCgV4P3y5jLZBKR1E/DkFWlNXjoZFe6c+VkGy12Yn9qQul1nmqm RIZA6TOUdCNbalJ63Y2QfxKDzuqpfxiXPPFyGvSiuwhaQWMQT6Wm0KSVN7J/P7juuGn5 eso7OMcgsAlDqcRetn7Cmj4epAamO9NawX9bPyct8mekb+9IAo4/i0Nsmy7tS8Vr50A3 Wt5IL0exh6xwpW9WNDRj83FQcM6X4t+pGE4GK4nTuptTr8B3f+5oLVd8/WHRwso3+G4L JLvERpAjr6gBgdKS7PG+DuHNbuy4pB8t+sHH9+Qjh3hJ9P5/fFr4haK1deQmryOUkeJ4 eGqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=7Vf/NnD5hqlYQ4HFLY1/bMAp98qvmD/6f8WHOuGA/vI=; b=A2uoWdFkLb4vjOPBlr7BTVnd023HT+9NvQh21JP6DDjuvALB6zpuHO6PHISgs7p+/4 +T+Fjq37UHGYNOcDkEViaGJrf9exEXvco10mDyMBDEcDOFUYPuf3rZ1JrEqgLLRfOq5M bDAycMieZHBHiAVWonBOqOBJTK9D6MHLTcJQ3P4P+R6JJ/ERSAJ0Qzq2K4c2D9qNFurb 3mEv8VUyWuUxTctpft30RLPHguvCqtUJ4g+pTNtQis1KX+XbBF6lBUg6JiE4TegEsPcE QvFrvacd/5xvIK6OrKZrIQCa9MeJ9ESBEgE2VCQb47U8+D+bdAxa/TOW7P3xJ+8LmeW0 I8NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=CIEH0F47; 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=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e5-20020a170902784500b0018696ec99e9si1550992pln.492.2022.12.09.06.38.59; Fri, 09 Dec 2022 06:39:09 -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=@cirrus.com header.s=PODMain02222019 header.b=CIEH0F47; 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=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229977AbiLIOX1 (ORCPT + 75 others); Fri, 9 Dec 2022 09:23:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230130AbiLIOXB (ORCPT ); Fri, 9 Dec 2022 09:23:01 -0500 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1243879C3C; Fri, 9 Dec 2022 06:22:23 -0800 (PST) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B9BV0sL002223; Fri, 9 Dec 2022 08:22:17 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=message-id : date : mime-version : subject : from : to : cc : references : in-reply-to : content-type : content-transfer-encoding; s=PODMain02222019; bh=7Vf/NnD5hqlYQ4HFLY1/bMAp98qvmD/6f8WHOuGA/vI=; b=CIEH0F47CrqsMIppF+49tkG6phkANjPb9umP93SH+sZXt3aBqwrWkSz4Oq8r1YXBJlO4 dmczxRgwU4Ig9jvNG9URUoxoaugoLyVHHEc7g24gAHQI+N3w+3MpMnWHB5Xak562y6eF OP8xXY+qbhHfj7VMlsdzbozpLDHpQa1XXpsmBZZ+vbp4mjC4eMuivWwVf4dRw+wjBG9J yFbHqHeaXyQDn3eyBixmYtRm3XcNzDRDXA5em/fHPeoAq7WEy6yGsDZXKXcw5GjDTZ1E th3XMAw0PUhyg8M99MT5yr2xgjKJH29Zb6R9fLc0MO85sUSyIedJxYLVJ1uecTl4Ezjj nQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3m84r6q21c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 08:22:17 -0600 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20; Fri, 9 Dec 2022 08:22:15 -0600 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.20 via Frontend Transport; Fri, 9 Dec 2022 08:22:15 -0600 Received: from [198.61.65.44] (EDIN4L06LR3.ad.cirrus.com [198.61.65.44]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id ED683B0E; Fri, 9 Dec 2022 14:22:14 +0000 (UTC) Message-ID: Date: Fri, 9 Dec 2022 14:22:14 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH] i2c: designware: Fix unbalanced suspended flag Content-Language: en-US From: Richard Fitzgerald To: Hans de Goede , , , , , CC: , , References: <20221209114034.18025-1-rf@opensource.cirrus.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: Q7pN0TG89CDntNMOvXzFoLWqHK0zlIL1 X-Proofpoint-GUID: Q7pN0TG89CDntNMOvXzFoLWqHK0zlIL1 X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS 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 9/12/22 13:36, Richard Fitzgerald wrote: > On 9/12/22 12:15, Hans de Goede wrote: >> Hi Richard, >> >> On 12/9/22 12:40, Richard Fitzgerald wrote: >>> Ensure that i2c_mark_adapter_suspended() is always balanced by a call to >>> i2c_mark_adapter_resumed(). > > > >> >> It is not entirely clear to me where the unbalance you claim to see comes >> from? When runtime-suspended SMART_SUSPEND should keep it suspended at >> which point >> the system suspend callback will never run ? >> >> Are you sure that you are not maybe seeing a suspend/resume ordering >> issue? >> >> Did you add printk messages to the suspend/resume callbacks of >> i2c-designware-platdrv.c which show the system suspend callback >> being called but not the system resume one ? >> > > With messages in strategic places. > > [  169.607358] i2c_designware i2c_designware.2: PM: dev_pm_skip_suspend: > SMART_SUSPEND=0 pm_runtime_status_suspended=1 > [  169.607361] i2c_designware i2c_designware.2: PM: > __device_suspend_late: dev_pm_skip_suspend:false > [  169.607364] i2c_designware i2c_designware.2: dw_i2c_plat_suspend > ... > [  169.702511] i2c_designware i2c_designware.2: PM: dev_pm_skip_resume: > 1 because !power.must_resume > [  169.706241] i2c_designware i2c_designware.2: PM: dev_pm_skip_resume: > 1 because !power.must_resume > [  169.706244] i2c_designware i2c_designware.2: PM: device_resume_early: > dev_pm_skip_resume:true > ... > [  175.254832] i2c i2c-2: Transfer while suspended > > (Just to prove my logging isn't lying, for i2c3 it reports > SMART_SUSPEND=1) > Oh, that's embarrassing. After confidently telling you my logging is perfect, actually there was a bug in it... New log summary: [ 162.253431] i2c_designware i2c_designware.2: PM: dev_pm_skip_suspend: SMART_SUSPEND=1 pm_runtime_status_suspended=0 [ 162.253438] i2c_designware i2c_designware.2: PM: __device_suspend_late: dev_pm_skip_suspend:false [ 162.253445] i2c_designware i2c_designware.2: dw_i2c_plat_suspend [ 162.273115] i2c_designware i2c_designware.2: PM: dev_pm_skip_suspend: SMART_SUSPEND=1 pm_runtime_status_suspended=0 [ 162.362547] i2c_designware i2c_designware.2: PM: dev_pm_skip_resume: 1 because !power.must_resume [ 162.369216] i2c_designware i2c_designware.2: PM: dev_pm_skip_resume: 1 because !power.must_resume [ 162.369220] i2c_designware i2c_designware.2: PM: device_resume_early: dev_pm_skip_resume:true [ 167.901269] i2c i2c-2: Transfer while suspended Same result that it doesn't skip suspend but does skip resume.