Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3954672pxb; Tue, 10 Nov 2020 04:35:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyofvI4aFndfbS9BkcxcoNcuUjNL6yHOAGfnDaKyqltwdjsGwcTydHRwWsqHsqHp5xEbLJ1 X-Received: by 2002:a50:d78f:: with SMTP id w15mr20910761edi.227.1605011734400; Tue, 10 Nov 2020 04:35:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605011734; cv=none; d=google.com; s=arc-20160816; b=N3LvtSLki9ZWH3c0hr/dpIWEjOQWOhymBpzUh0eumM3HPaP3JOuPpbomJ1MVOehMv/ qqw/a4bVAQcJnyAHWavNoeHm+iXNu/AMeAf1sWhIwrCHRvAQ2lkYrmAprBFXMZ/+Zrzc jWT3bHB2Qokd03zb5mSc09iXibsw6imYzq6Cq1cPOfbs1ZhbjxuMwu0ji3xpIfJkrCuJ 2KVfAO8Khv6cAk3ZdEBhH4FpdOg7mjaY0S+fPBxJfumXmjYXGBI04V9Fhk0yJcglq7xz 8bgtklcXgcvLwd8RAXUKNB8fzuP9lv7MIdqz0bXrJVvkdjb2+uZ/gUHTG7QaOSGnq5Tk SxXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=MXK9RYmlC92fo5R/MqmdAYvROSqwOhrcpKEmDdHQKBA=; b=Mq6R/6j7mE7sW3DquORzZ2d4C5BTLEnjoVrS/wZ26B6q0IDwEEe8ddI171PM4tDQGO aJnRPbH3gnQhEAgNhn5eQAjagNvlB0mV2EtEKxLERkedETrCbeyJgMg8wUDlMIpD1Dte 3dy13Y+Wq548ZgPSgpC84BAxhznvBvxzLEKCjom9i65Ks1QCUPd6TtQjxdgBjdWSRl4D Wm2s/0MPwXckqMfMztAGKBIwR8+1x48clIilEfbUcsrb16KwBN5fTtO5WEvnF2MXCuB5 aV6LDqu+wdFRvrGMMbpxnh1pkX/bFApqPLRGdzOhI00UdBeLLdz0foRjiZFRXa+TiLmf 587Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b7si9061770ejj.658.2020.11.10.04.35.08; Tue, 10 Nov 2020 04:35:34 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730061AbgKJMdr (ORCPT + 99 others); Tue, 10 Nov 2020 07:33:47 -0500 Received: from mga05.intel.com ([192.55.52.43]:4473 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728478AbgKJMdr (ORCPT ); Tue, 10 Nov 2020 07:33:47 -0500 IronPort-SDR: VP12WtQkAlrkz7JtQWyta2z4lkpSjLAxu+OQDXfjTkSwYgJTl0Detw9pQFdzsUN1xVjWg3jrpm U98jhhECPqDQ== X-IronPort-AV: E=McAfee;i="6000,8403,9800"; a="254673074" X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="254673074" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 04:33:46 -0800 IronPort-SDR: 5VgMFXK1eKUN71n09RR62krilaaQACcguLziG1evT+VskxSeRsAYc3SAku+i2UzsAh2rFw3Q79 ZggGdiz3rosg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="541307141" Received: from mylly.fi.intel.com (HELO [10.237.72.73]) ([10.237.72.73]) by orsmga005.jf.intel.com with ESMTP; 10 Nov 2020 04:33:44 -0800 Subject: Re: [PATCH v1] i2c: nvidia-gpu: drop empty stub for runtime pm To: Vaibhav Gupta , Ajay Gupta Cc: Bjorn Helgaas , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas References: <20201107082151.58239-1-vaibhavgupta40@gmail.com> <20201107090442.GA107675@gmail.com> From: Jarkko Nikula Message-ID: <6989eb51-a36c-6e43-86f3-9b02ab490d95@linux.intel.com> Date: Tue, 10 Nov 2020 14:33:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201107090442.GA107675@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/20 11:04 AM, Vaibhav Gupta wrote: > On Sat, Nov 07, 2020 at 01:51:51PM +0530, Vaibhav Gupta wrote: >> After the commit c5eb1190074c ("PCI / PM: Allow runtime PM without callback >> functions") we no more need empty stubs for runtime-pm to work. >> >> The driver has no device specific task(s) for .suspend() . The stub was >> placed just for runtime-pm, which can be dropped now. >> >> Reported-by: Bjorn Helgaas >> Signed-off-by: Vaibhav Gupta >> --- >> drivers/i2c/busses/i2c-nvidia-gpu.c | 10 +--------- >> 1 file changed, 1 insertion(+), 9 deletions(-) >> >> diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c-nvidia-gpu.c >> index f9a69b109e5c..6b20601ffb13 100644 >> --- a/drivers/i2c/busses/i2c-nvidia-gpu.c >> +++ b/drivers/i2c/busses/i2c-nvidia-gpu.c >> @@ -353,15 +353,7 @@ static void gpu_i2c_remove(struct pci_dev *pdev) >> pci_free_irq_vectors(pdev); >> } >> >> -/* >> - * We need gpu_i2c_suspend() even if it is stub, for runtime pm to work >> - * correctly. Without it, lspci shows runtime pm status as "D0" for the card. >> - * Documentation/power/pci.rst also insists for driver to provide this. >> - */ >> -static __maybe_unused int gpu_i2c_suspend(struct device *dev) >> -{ >> - return 0; >> -} >> +#define gpu_i2c_suspend NULL >> Perhaps we can put NULL directly into UNIVERSAL_DEV_PM_OPS() for the suspend callback? >> static __maybe_unused int gpu_i2c_resume(struct device *dev) >> { >> -- >> 2.28.0 >> > The patch is only compile-tested. > It should work also system suspend point of view. This patch affects also it since callbacks are set with the UNIVERSAL_DEV_PM_OPS(). Means the same callback is used for runtime PM and system suspend. I quickly debugged this with an another driver and PCI stack does put the device into D3 state in system suspend from pci_prepare_to_sleep() if the suspend callback is not set and device was on prior it. Reviewed-by: Jarkko Nikula