Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6941811imm; Wed, 27 Jun 2018 16:36:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfKpiljUOpYTWmTw2u/7w8dCnO/OnYoEo1C3yZJT+IBM45zAv0aVNPZuawipvq0DUtbO6bT X-Received: by 2002:a62:d98f:: with SMTP id b15-v6mr4131678pfl.1.1530142616264; Wed, 27 Jun 2018 16:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530142616; cv=none; d=google.com; s=arc-20160816; b=JJoij1oVfCq9Y2+3VaY/aa8fhyXF+I0npUNxymlP3KHTb+N6mHZ6HzZCKjAkgtdbkb jOowjnT7ETcjknFF74AhbX+BW4V6IqJm+/UAF0yUVghRpnXVPpDFUuxxLW6LINuX3LOG fzPSZP5jvfrqcl9rqt5zX0RelVDLuJTwTJ9qQqOscgvz34QxQVbvQsnwHvctp4F79IB2 TXdO/zzURiI/M/6yI/nHLQBKSAhgKrrjhzXGs/3McsgpPf9OG+LInUsIBrc2tT60wU3q RD92+tpIyhFyQgEsArqFUaJL2cUf3gZgCd3pMZziozzsId8AaEkFG58d6WtfXzHgaVYs 2eEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=VaUZncG7POw//wxxGF4aGwJL880HLdDXLH3bsWNYAuE=; b=BSwC87oL4a4z2FRXsckW3EtPSCbdKvl9oAsAODyMrP6nyGrhhkLUYUUGpP398Ohpi8 knYA2RURuQjyu6JvrLvc6jVZ/Yp/9C9mDMBdOUgIE964eGif3fbd6kaHblFWkgZpcpZT HVz5uwodrQGYSiRG/N8/Y8fcw0UDWOC4CDMV33FN3GLzJZ5+S0sjGZCZXAR+8UeI92An 8ojtf8P8NucZXWMsqthWuO+yY0s0FfxZxFBbxvFx27ZAdWcucDI2n7ppDw99Cwd4qAIV Hqe0J88CWwE7Lg1PTcsi916pYn5qNnaINc//nLXD6XuUQys5onMSGUJW8wb0A6f1hO0F BlBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lECakIob; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15-v6si4562199pgr.286.2018.06.27.16.36.41; Wed, 27 Jun 2018 16:36:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lECakIob; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966005AbeF0VXp (ORCPT + 99 others); Wed, 27 Jun 2018 17:23:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:37814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965946AbeF0VXn (ORCPT ); Wed, 27 Jun 2018 17:23:43 -0400 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 32C302244A; Wed, 27 Jun 2018 21:23:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1530134622; bh=kg0Y27VLEzNGxqr3Mej6igWB1kjN82s6dipEssk/1QQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lECakIobiZ+A+uZcCHppteJr66iJx87skjarM6mt7oaQms9EszuARbslAsI3o8dH/ Qi8ClTZnLtdcbzD9zwneTsTrqJm45mtdWhzt71TTLVvip9GhmNnBTBqhathotS5zaa gfoKrUQc+Vc6ISs7BgJb6JUdP/7BLXOvXoiOTkvg= Date: Wed, 27 Jun 2018 16:23:40 -0500 From: Bjorn Helgaas To: Jean Delvare Cc: 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: <20180627212340.GA161569@bhelgaas-glaptop.roam.corp.google.com> References: <20180626143913.7361-1-jarkko.nikula@linux.intel.com> <20180627221550.0fa5f2df@endymion> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180627221550.0fa5f2df@endymion> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+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.