Re: [PATCH] PCI: rcar: Use runtime PM to control controller clock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/08/2017 10:36 AM, Geert Uytterhoeven wrote:
> Hi Marek,
> 
> On Wed, Nov 8, 2017 at 10:19 AM, Marek Vasut <marek.vasut@xxxxxxxxx> wrote:
>> From: Dien Pham <dien.pham.ry@xxxxxxxxxxxxxxx>
>>
>> The controller clock can be switched off during suspend/resume,
>> let runtime PM take care of that.
>>
>> Signed-off-by: Dien Pham <dien.pham.ry@xxxxxxxxxxxxxxx>
>> Signed-off-by: Hien Dang <hien.dang.eb@xxxxxxxxxxx>
>> Signed-off-by: Marek Vasut <marek.vasut+renesas@xxxxxxxxx>
> 
> Thanks for your patch!
> 
>> --- a/drivers/pci/host/pcie-rcar.c
>> +++ b/drivers/pci/host/pcie-rcar.c
> 
>> @@ -1126,6 +1115,13 @@ static int rcar_pcie_probe(struct platform_device *pdev)
>>
>>         rcar_pcie_parse_request_of_pci_ranges(pcie);
>>
>> +       pm_runtime_enable(pcie->dev);
>> +       err = pm_runtime_get_sync(pcie->dev);
>> +       if (err < 0) {
>> +               dev_err(pcie->dev, "pm_runtime_get_sync failed\n");
>> +               goto err_pm_disable;
>> +       }
>> +
>>         err = rcar_pcie_get_resources(pcie);
>>         if (err < 0) {
>>                 dev_err(dev, "failed to request resources: %d\n", err);
>> @@ -1136,13 +1132,6 @@ static int rcar_pcie_probe(struct platform_device *pdev)
>>         if (err)
>>                 goto err_free_bridge;
>>
>> -       pm_runtime_enable(dev);
>> -       err = pm_runtime_get_sync(dev);
>> -       if (err < 0) {
>> -               dev_err(dev, "pm_runtime_get_sync failed\n");
>> -               goto err_pm_disable;
>> -       }
>> -
>>         /* Failure to get a link might just be that no cards are inserted */
>>         hw_init_fn = of_device_get_match_data(dev);
>>         err = hw_init_fn(pcie);
> 
> As you changed initialization order, cleanup order for error handling below
> should be updated, too.
> 
> Apart from that, this patch looks good to me.
Ah, thanks for catching this.

-- 
Best regards,
Marek Vasut



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux