Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2758002rwb; Fri, 9 Dec 2022 06:06:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf56clS3Gbfhs3rT2MzE5XWiZfck0oQ/qbOpwVfNd5hr1LmFqp6FBSaye33BLf3zVF2gSSBV X-Received: by 2002:a17:90a:12c9:b0:219:ed2e:1a7c with SMTP id b9-20020a17090a12c900b00219ed2e1a7cmr5696583pjg.14.1670594787896; Fri, 09 Dec 2022 06:06:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670594787; cv=none; d=google.com; s=arc-20160816; b=M7YpRAFHwwcX/1ZSm13NQOrKZ6vC9ze9xnmW2Qv8r7RJFBRzrAHCnoT+4AF2XqZ+jG k4AqeSdxAeavxarj0ydtrjX+sqwx4LrplKe2gA55Ld42K5phr8Fa7gWd4l717YXlUCa5 1pp7awB4CBfswO1DJfhb+hWsvOq5SuxLMMsY3i0C6VQDCN/quuwUjrimaoTI2VvDWiKT Yh4Wnr0gjhYBGVCaIB1FGSGWQyTgIOBxaT1/z0RPeX3MHvioSIB9kPdw3RlCR5yfogkY dP5F19hAK02An4fJBlAbntpz1tyy3Mr1WMvBS8g6R39FETyhjA2JIZYz4OyhJRNntHt0 g3Mw== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=JDDhfRPCulDaOnhemyJ6yfUpKVtJKrsDBP+FxmOJD8M=; b=e4XYXGAB+0DWY7A/f/EoIsa9RPRE1EXg8VoQ8DAWFjKxA6O9J+Ozc0nFG6dubyZLL1 bg/Lw8lY2whpW3AFk9oifAF1vDYaW96bBhWJmm7gWdIpPZZAudkQbFZGC9dsmLQMvFCo 7RTTpH9U0xtc/CVACQ2CjOF/T9WlS77F1VgEKLdBXglHCWt+yBnjvhHnOqL3BTJ62lDh LBns4nTCibYasF+UWXIJ2T9ZAbFYrJYn3VIb6eJXjQE8e2YN0DdKu9iJ/FxIVcoickHB oh/jmzc+41HQGUhaEw5SPAXKHv5uUUyh+jYByrQZDBM8ZR+fjxG2p20btHCNtSipWEz5 I1Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=jYvSUpxt; 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 my9-20020a17090b4c8900b0021d20da7a5fsi2444675pjb.120.2022.12.09.06.06.15; Fri, 09 Dec 2022 06:06:27 -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=jYvSUpxt; 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 S229637AbiLINgU (ORCPT + 75 others); Fri, 9 Dec 2022 08:36:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbiLINgS (ORCPT ); Fri, 9 Dec 2022 08:36:18 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95BAB1C925; Fri, 9 Dec 2022 05:36:16 -0800 (PST) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B9Covgb017285; Fri, 9 Dec 2022 07:36:10 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=PODMain02222019; bh=JDDhfRPCulDaOnhemyJ6yfUpKVtJKrsDBP+FxmOJD8M=; b=jYvSUpxt+Qt6u40vZvSnjwwkCTP1OVxxRdJPhQ5WYpICnHyDuwJHY3/XWpixtYpFUwP4 vyBdKPUayodcYCDNA6WMtVOZTkL4tV9PWzsU6o1Ln7KHBmDHPsrAng0bl4wGoRMcLtFe VQxSPdsqbgZGH9Fv11Wow6U6SE7DYIJb0yhyXCLcfDhAoKMMO9sCVlwTn+zPlB9Qavs5 roOKPhNVNgCaVGH6BMBOerMzPPH9Cef06GwZe00aCMb85DUz/wVxDyZStho6ZRkE0Sz3 9Adj1YsEDGUIjqFHulX3d8IS3p2LSb1rfFR6cnPcnHCaabGxYaje/ZsSEzPdBi5tddgz pQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3matyutjgf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 07:36:09 -0600 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) 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 07:36:08 -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 07:36:08 -0600 Received: from [198.61.65.44] (EDIN4L06LR3.ad.cirrus.com [198.61.65.44]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id D3A8DB0E; Fri, 9 Dec 2022 13:36:07 +0000 (UTC) Message-ID: Date: Fri, 9 Dec 2022 13:36:07 +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 To: Hans de Goede , , , , , CC: , , References: <20221209114034.18025-1-rf@opensource.cirrus.com> From: Richard Fitzgerald In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: ecPXIxk8avJiXEUx7JF1gn6x33M6WQZD X-Proofpoint-GUID: ecPXIxk8avJiXEUx7JF1gn6x33M6WQZD 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 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) So it can skip the resume even if it didn't skip the suspend. The SMART_SUSPEND flag is not set on i2c2 and the driver core can skip resume even if it didn't skip suspend.