Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1393926
| From | Manish Badarkhe <badarkhe.manish@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 1/2] dmaengine: qcom-bam-dma: Add pm_runtime support |
| Date | 2016-05-04 05:40 +0200 |
| Message-ID | <ruVPj-4b0-5@gated-at.bofh.it> (permalink) |
| References | <ruEYa-5FG-5@gated-at.bofh.it> <ruFhw-5Sv-13@gated-at.bofh.it> <ruGQh-7ml-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Pramod
>>> @@ -715,10 +724,13 @@ static int bam_resume(struct dma_chan *chan)
>>> struct bam_device *bdev = bchan->bdev;
>>> unsigned long flag;
>>>
>>> + pm_runtime_get_sync(bdev->dev);
>>> spin_lock_irqsave(&bchan->vc.lock, flag);
>>> writel_relaxed(0, bam_addr(bdev, bchan->id, BAM_P_HALT));
>>> bchan->paused = 0;
>>> spin_unlock_irqrestore(&bchan->vc.lock, flag);
>>> + pm_runtime_mark_last_busy(bdev->dev);
>>> + pm_runtime_put_autosuspend(bdev->dev);
>>>
>>> return 0;
>>> }
>>
>> Why this function simply return 'success' without any error capture?
>>
> I should check return of pm_runtime_get_sync.
Ok, fine.
>>> @@ -1252,16 +1278,76 @@ static int bam_dma_remove(struct platform_device *pdev)
>>>
>>> tasklet_kill(&bdev->task);
>>>
>>> + pm_runtime_get_sync(&pdev->dev);
>>> clk_disable_unprepare(bdev->bamclk);
>>> + pm_runtime_disable(&pdev->dev);
>>> + pm_runtime_put_noidle(&pdev->dev);
>>> + pm_runtime_set_suspended(&pdev->dev);
>>> +
>>> + return 0;
>>> +}
>>
>> Why this function simply return 'success' without any error capture?
> Need to handle it better.
Yes, need to handle __pm_runtime__ errors.
>>
>>> +static int bam_dma_runtime_suspend(struct device *dev)
>>> +{
>>> + struct bam_device *bdev = dev_get_drvdata(dev);
>>> +
>>> + clk_disable(bdev->bamclk);
>>> +
>>> + return 0;
>>> +}
>>
>> Why this function simply return 'success' without any error capture?
> If probe has succeeded means bdev->bamclk is not NULL and error hence
> clk_disable wont return anything.
got it.
>>> +#ifdef CONFIG_PM_SLEEP
>>> +static int bam_dma_suspend(struct device *dev)
>>> +{
>>> + struct bam_device *bdev = dev_get_drvdata(dev);
>>> +
>>> + pm_runtime_force_suspend(dev);
>>> +
>>> + clk_unprepare(bdev->bamclk);
>>>
>>> return 0;
>>> }
>>
>> Why this function simply return 'success' without any error capture?
> Same logic applies here as well, as pm_runtime_force_suspend and
> clk_unprepare may not return error in our case once probe is through.
got it.
Regards
Manish Badarkhe
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2 1/2] dmaengine: qcom-bam-dma: Add pm_runtime support Pramod Gurav <pramod.gurav@linaro.org> - 2016-05-03 11:40 +0200
[PATCH v2 2/2] MAINTAINERS: Update the files to include the Qualcomm DMA folder Pramod Gurav <pramod.gurav@linaro.org> - 2016-05-03 11:40 +0200
Re: [PATCH v2 1/2] dmaengine: qcom-bam-dma: Add pm_runtime support Manish Badarkhe <badarkhe.manish@gmail.com> - 2016-05-03 12:00 +0200
Re: [PATCH v2 1/2] dmaengine: qcom-bam-dma: Add pm_runtime support Pramod Gurav <pramod.gurav@linaro.org> - 2016-05-03 13:40 +0200
Re: [PATCH v2 1/2] dmaengine: qcom-bam-dma: Add pm_runtime support Manish Badarkhe <badarkhe.manish@gmail.com> - 2016-05-04 05:40 +0200
csiph-web