From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D771C433E6 for ; Fri, 28 Aug 2020 16:26:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6972320C56 for ; Fri, 28 Aug 2020 16:26:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598632004; bh=4Vnh1C/RoVVBKrT7SjMj6aee4KReTZw02BiPUaRhAQ0=; h=Date:From:To:Cc:Subject:In-Reply-To:List-ID:From; b=SCObfw5sntiniC3jwiISpwio8N+1sgH8KgEtzTD9g+UqsfNZ+vhdv83/zhweLLrrN 6LTiA0zbn8Nar3f45AxS+wv02Ni0W2+T+uMKwQVga6lJ0RK3ejSiKFJ2bYaJ3g0Ubz M2eUdu+ydqzGOzFJ61qaiKSy4OPoBrrolTIqrMO0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbgH1Q0n (ORCPT ); Fri, 28 Aug 2020 12:26:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:33464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726033AbgH1Q0m (ORCPT ); Fri, 28 Aug 2020 12:26:42 -0400 Received: from localhost (104.sub-72-107-126.myvzw.com [72.107.126.104]) (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 765D22080C; Fri, 28 Aug 2020 16:26:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598632001; bh=4Vnh1C/RoVVBKrT7SjMj6aee4KReTZw02BiPUaRhAQ0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=QVOV/M0eLCw2BVGQp4zvew/mE1Q4RL7hiEsH79cNpyPCxwSZe05WMETsy+9Db+hDj sKvWOaB1vh6jVlK2lN5CmqNofr7zadr76rZ5qfeZphI3NzUxMq7O8ZX0a8uuo4+Hex 1gmGg+jCAvGxgygQHK+NpsxfUpiX7u90xwPUIC7M= Date: Fri, 28 Aug 2020 11:26: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, Vaibhav Gupta Subject: Re: [PATCH 1/2] i2c: i801: Fix runtime PM Message-ID: <20200828162640.GA2160001@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180627212340.GA161569@bhelgaas-glaptop.roam.corp.google.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org [+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.