Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1044261pxk; Mon, 31 Aug 2020 08:20:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyd6BjyKfl+S12WrjwY5FmrDZBnXHx4njpMWOLIdrGMA7rCGRtVC7WQPDbOpAEvRifTDl7 X-Received: by 2002:a17:906:a88a:: with SMTP id ha10mr1681786ejb.532.1598887208725; Mon, 31 Aug 2020 08:20:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598887208; cv=none; d=google.com; s=arc-20160816; b=Ei48WyRZAwcllzdhQGVN0x5ZYN96dA2HkKIlNVmv7qxMsU4mteeoMQoMCWklJPMS0D bI1F9EQItA5frdBU51J4ht9pHi56M8abHnLwVXwysH9lkj5yUnMUZQ7Ok10V9ZxKGN6P D2t3e2CU/5AfMvWEO4K2lmXZA86A/d9qV2SIcCdmuUp46IKJTPwZ8UdArtukZkn9VQ2v f59nE52EMgq0rBy8j7Jl9kPW3e6GHgolzx+STjtNmPEtuw5h+y0REFUl1wTpKNC7o46E JTFcSdd1ubjYrNL9q3/rR8qqHDKeMtTe28cg14C9mlVHlKbpxpmH5n2KiEGTDq+GbMxZ IPZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=o2tp+O/fvjT5GP7vYXsEtBxLItwJjgYMH2teIh37dm8=; b=FiI7aSaLVHWh7v3fp0WAUI+44rABwPxHTB53cs0hwDIeS3M5Zx0gWEHPkPxxtFPdgF 5awLEfPfFQk6w2ShSfKY/Pd6qSq0L22D77EWVcuy0xM/V51g22dpP2prsxhuWZ3iUfFA U+7IRDJ7bGKW3mlgK1lZIieHNHh7zmfhTOoqM8bN9qRjrsNG5/U94dSzrUX7difkoiiB 1bZMtbt7k9UeKatXgWnrWKZFTWzZY0o6v922ZNDi6QXvCFRfP24kFajUSv1JRegpEcoI 7D9AfzUzWlgRRclKeBUPqArjyQVczvTo0Vdtvo3rOWBqENezNL0fExjPJxb5AJ/iGHaY CNAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fNUV6toF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si1239027edi.28.2020.08.31.08.19.45; Mon, 31 Aug 2020 08:20:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fNUV6toF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728502AbgHaPRx (ORCPT + 99 others); Mon, 31 Aug 2020 11:17:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728415AbgHaPRT (ORCPT ); Mon, 31 Aug 2020 11:17:19 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CCE8C061573; Mon, 31 Aug 2020 08:17:19 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id 31so740117pgy.13; Mon, 31 Aug 2020 08:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=o2tp+O/fvjT5GP7vYXsEtBxLItwJjgYMH2teIh37dm8=; b=fNUV6toFn7/F1MjitalN8tMYAdmNugJVStqW3KuHLW8doFsghzwRNbMHMLvicQE6wU yFofiIJnd8S69MJ0qisVO7fMjkiOZHclHUuY5vkd6z3h0KcquKCm0Kf+4WcGl8Y3p3bU jigUTQJC76Tl514EcN8HKe7gRpcJgnqwSkHIwdUSm8MYTz+Bh1819ZA76HUPW6K1UHMd VEHwZxciLUwUDoRkNWmCX6i252xAdWYuJ08KkPYM5sRBPFOBhisj1cfjYn2wn8U1u2nP lIpj0joCbU5Eqq+OBG6/flvFI0V4Uz9LDsq20f015T2lWJMjUYbooY6ZnBO9BZeOv3U2 UwSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=o2tp+O/fvjT5GP7vYXsEtBxLItwJjgYMH2teIh37dm8=; b=J5MwiZqccg5snq7sMKbDL0DbPTelTq2mspcji7PSnwZ1N1n/eyYbNZzxHxevlbXXM3 uHBXOhFmItoXyR7Rfj9VmPUIdDGSTDJLAtaWH58yjTwTcGW8SGZJ8CeF+JTVkwH0GN5e fOkvnvKEoIcBNkibpTLrgjRtUvcGd/2WpMcvadaooxMWcN5y7rED3NoHAq2ZbVzZPp1b 5XYMzHac717UTMRR5+MiYLqDdZ8640n4z6COrR2u200MHRjqCw8UPhK5YMljCDEJVq26 hkHuQKILwaVz/JBH0VscXX5ieeF/BsEDYy+BHDKzswMIzgxBSbDX19Eo0FgF5x1hHkLO RAKg== X-Gm-Message-State: AOAM532SDQwRkR//m3QWfjq38az11UEALh00JtpPkr6DlfPSLwWHbwYg CW00/OYfL3w2wUN9zQsyvys= X-Received: by 2002:aa7:8430:: with SMTP id q16mr141766pfn.69.1598887038744; Mon, 31 Aug 2020 08:17:18 -0700 (PDT) Received: from gmail.com ([223.190.108.199]) by smtp.gmail.com with ESMTPSA id y7sm7528471pgk.73.2020.08.31.08.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 08:17:18 -0700 (PDT) Date: Mon, 31 Aug 2020 20:45:30 +0530 From: Vaibhav Gupta To: Bjorn Helgaas Cc: Jean Delvare , Jarkko Nikula , linux-i2c@vger.kernel.org, Wolfram Sang , Mika Westerberg , stable@vger.kernel.org, Bjorn Helgaas , linux-pci@vger.kernel.org, "Rafael J. Wysocki" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] i2c: i801: Fix runtime PM Message-ID: <20200831151159.GA11707@gmail.com> References: <20180627212340.GA161569@bhelgaas-glaptop.roam.corp.google.com> <20200828162640.GA2160001@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200828162640.GA2160001@bjorn-Precision-5520> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 28, 2020 at 11:26:40AM -0500, Bjorn Helgaas wrote: > [+cc Vaibhav] > > On Wed, Jun 27, 2018 at 04:23:40PM -0500, Bjorn Helgaas wrote: > > [+cc Rafael, linux-pm, linux-kernel] > > > > On Wed, Jun 27, 2018 at 10:15:50PM +0200, Jean Delvare wrote: > > > Hi Jarkko, > > > > > > On Tue, 26 Jun 2018 17:39:12 +0300, Jarkko Nikula wrote: > > > > Commit 9c8088c7988 ("i2c: i801: Don't restore config registers on > > > > runtime PM") nullified the runtime PM suspend/resume callback pointers > > > > while keeping the runtime PM enabled. This causes that device stays in > > > > D0 power state and sysfs /sys/bus/pci/devices/.../power/runtime_status > > > > shows "error" when runtime PM framework attempts to autosuspend the > > > > device. > > > > > > > > This is due PCI bus runtime PM which checks for driver runtime PM > > > > callbacks and returns with -ENOSYS if they are not set. Fix this by > > > > having a shared dummy runtime PM callback that returns with success. > > > > > > > > Fixes: a9c8088c7988 ("i2c: i801: Don't restore config registers on runtime PM") > > > > > > I don't want to sound like I'm trying to decline all responsibility for > > > a regression I caused, but frankly, if just using SIMPLE_DEV_PM_OPS() > > > breaks runtime PM, then it's the PM model which is broken, not the > > > i2c-i801 driver. > > > > > > I will boldly claim that the PCI bus runtime code is simply wrong in > > > returning -ENOSYS in the absence of runtime PM callbacks, and it should > > > be changed to return 0 instead. Or whoever receives that -ENOSYS should > > > not treat it as an error - whatever makes more sense. > > > > > > Having to add dummy functions in every PCI driver that doesn't need to > > > do anything special for runtime PM sounds plain stupid. It should be > > > pretty obvious that a whole lot of drivers are going to use > > > SIMPLE_DEV_PM_OPS() because it exists and seems to do what they want, > > > and all of them will be bugged because the PCI core is doing something > > > silly and unexpected. > > > > > > So please let's fix it at the PCI subsystem core level. Adding Bjorn > > > and the linux-pci list to Cc. > > > > Thanks Jean. What you describe does sound broken. I think the PM > > guys (cc'd) will have a better idea of how to deal with this. > > Did we ever get anywhere with this? It seems like the thread petered > out. This does seems worrying. I remember, few days earlier you pointed out a driver i2c-nvidia-gpuc.c. In the code, gpu_i2c_suspend() is an empty-body function. And comment mentioned that empty stub is necessary for runtime_pm to work. And this driver also uses UNIVERSAL_DEV_PM_OPS.