Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753592AbcDTNDI (ORCPT ); Wed, 20 Apr 2016 09:03:08 -0400 Received: from mga04.intel.com ([192.55.52.120]:36450 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752255AbcDTNDG (ORCPT ); Wed, 20 Apr 2016 09:03:06 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,509,1455004800"; d="scan'208";a="88626606" Subject: Re: [PATCH 3/4] i2c: designware-pcidrv: enable RuntimePM before registering to the core To: Jisheng Zhang , andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, wsa@the-dreams.de References: <1460638414-5987-1-git-send-email-jszhang@marvell.com> <1460638414-5987-4-git-send-email-jszhang@marvell.com> Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org From: Jarkko Nikula Message-ID: <57177E05.80107@linux.intel.com> Date: Wed, 20 Apr 2016 16:03:01 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <1460638414-5987-4-git-send-email-jszhang@marvell.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1571 Lines: 41 On 04/14/2016 03:53 PM, Jisheng Zhang wrote: > As pointed out by commit 36d48fb5766a ("i2c: designware-platdrv: enable > RuntimePM before registering to the core"), "The core may register > clients attached to this master which may use funtionality from the > master", so enable RuntimePM before registering to the core. > > Signed-off-by: Jisheng Zhang > --- > drivers/i2c/busses/i2c-designware-pcidrv.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c > index 7368be0..41a01a7 100644 > --- a/drivers/i2c/busses/i2c-designware-pcidrv.c > +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c > @@ -248,14 +248,17 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, > ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev)); > adap->nr = controller->bus_num; > > + pm_runtime_set_autosuspend_delay(&pdev->dev, 1000); > + pm_runtime_use_autosuspend(&pdev->dev); > + pm_runtime_allow(&pdev->dev); > + > r = i2c_dw_probe(dev); > - if (r) > + if (r) { > + pm_runtime_forbid(&pdev->dev); > return r; > + } > > - pm_runtime_set_autosuspend_delay(&pdev->dev, 1000); > - pm_runtime_use_autosuspend(&pdev->dev); > pm_runtime_put_autosuspend(&pdev->dev); > - pm_runtime_allow(&pdev->dev); > Last time I checked this I didn't see urgent reason for the move because runtime PM is enabled for PCI devices by default via pci_device_add() -> pci_init_capabilities() -> pci_pm_init() -> pm_runtime_enable(). -- Jarkko