* [PATCH] intel_mid_dma: remove legacy pm interface
@ 2011-12-15 22:32 Alan Cox
2011-12-23 16:19 ` Vinod Koul
0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2011-12-15 22:32 UTC (permalink / raw)
To: vinod.koul, linux-kernel
From: Kristen Carlson Accardi <kristen@linux.intel.com>
Drivers should not support both legacy pm and new framework.
Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/dma/intel_mid_dma.c | 12 +++++++-----
drivers/dma/intel_mid_dma_regs.h | 2 +-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
index 01929ed..d67cecf 100644
--- a/drivers/dma/intel_mid_dma.c
+++ b/drivers/dma/intel_mid_dma.c
@@ -868,7 +868,7 @@ static int intel_mid_dma_alloc_chan_resources(struct dma_chan *chan)
pm_runtime_get_sync(&mid->pdev->dev);
if (mid->state == SUSPENDED) {
- if (dma_resume(mid->pdev)) {
+ if (dma_resume(&mid->pdev->dev)) {
pr_err("ERR_MDMA: resume failed");
return -EFAULT;
}
@@ -1337,8 +1337,9 @@ static void __devexit intel_mid_dma_remove(struct pci_dev *pdev)
*
* This function is called by OS when a power event occurs
*/
-int dma_suspend(struct pci_dev *pci, pm_message_t state)
+int dma_suspend(struct device *dev)
{
+ struct pci_dev *pci = to_pci_dev(dev);
int i;
struct middma_device *device = pci_get_drvdata(pci);
pr_debug("MDMA: dma_suspend called\n");
@@ -1362,8 +1363,9 @@ int dma_suspend(struct pci_dev *pci, pm_message_t state)
*
* This function is called by OS when a power event occurs
*/
-int dma_resume(struct pci_dev *pci)
+int dma_resume(struct device *dev)
{
+ struct pci_dev *pci = to_pci_dev(dev);
int ret;
struct middma_device *device = pci_get_drvdata(pci);
@@ -1429,6 +1431,8 @@ static const struct dev_pm_ops intel_mid_dma_pm = {
.runtime_suspend = dma_runtime_suspend,
.runtime_resume = dma_runtime_resume,
.runtime_idle = dma_runtime_idle,
+ .suspend = dma_suspend,
+ .resume = dma_resume,
};
static struct pci_driver intel_mid_dma_pci_driver = {
@@ -1437,8 +1441,6 @@ static struct pci_driver intel_mid_dma_pci_driver = {
.probe = intel_mid_dma_probe,
.remove = __devexit_p(intel_mid_dma_remove),
#ifdef CONFIG_PM
- .suspend = dma_suspend,
- .resume = dma_resume,
.driver = {
.pm = &intel_mid_dma_pm,
},
diff --git a/drivers/dma/intel_mid_dma_regs.h b/drivers/dma/intel_mid_dma_regs.h
index c6de919..c83d35b 100644
--- a/drivers/dma/intel_mid_dma_regs.h
+++ b/drivers/dma/intel_mid_dma_regs.h
@@ -296,6 +296,6 @@ static inline struct intel_mid_dma_slave *to_intel_mid_dma_slave
}
-int dma_resume(struct pci_dev *pci);
+int dma_resume(struct device *dev);
#endif /*__INTEL_MID_DMAC_REGS_H__*/
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] intel_mid_dma: remove legacy pm interface
2011-12-15 22:32 [PATCH] intel_mid_dma: remove legacy pm interface Alan Cox
@ 2011-12-23 16:19 ` Vinod Koul
2011-12-27 7:55 ` Adrian Hunter
0 siblings, 1 reply; 4+ messages in thread
From: Vinod Koul @ 2011-12-23 16:19 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-kernel
On Thu, 2011-12-15 at 22:32 +0000, Alan Cox wrote:
> From: Kristen Carlson Accardi <kristen@linux.intel.com>
>
> Drivers should not support both legacy pm and new framework.
Not really.
I am using this driver in our system where we go to D0i3 aka
runtime_suspend when DMA is idle.
Also we goto D3/S3 aka when traditional suspend is invoked.
So we need both.
>
> Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
>
> drivers/dma/intel_mid_dma.c | 12 +++++++-----
> drivers/dma/intel_mid_dma_regs.h | 2 +-
> 2 files changed, 8 insertions(+), 6 deletions(-)
>
>
> diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
> index 01929ed..d67cecf 100644
> --- a/drivers/dma/intel_mid_dma.c
> +++ b/drivers/dma/intel_mid_dma.c
> @@ -868,7 +868,7 @@ static int intel_mid_dma_alloc_chan_resources(struct dma_chan *chan)
> pm_runtime_get_sync(&mid->pdev->dev);
>
> if (mid->state == SUSPENDED) {
> - if (dma_resume(mid->pdev)) {
> + if (dma_resume(&mid->pdev->dev)) {
> pr_err("ERR_MDMA: resume failed");
> return -EFAULT;
> }
> @@ -1337,8 +1337,9 @@ static void __devexit intel_mid_dma_remove(struct pci_dev *pdev)
> *
> * This function is called by OS when a power event occurs
> */
> -int dma_suspend(struct pci_dev *pci, pm_message_t state)
> +int dma_suspend(struct device *dev)
> {
> + struct pci_dev *pci = to_pci_dev(dev);
> int i;
> struct middma_device *device = pci_get_drvdata(pci);
> pr_debug("MDMA: dma_suspend called\n");
> @@ -1362,8 +1363,9 @@ int dma_suspend(struct pci_dev *pci, pm_message_t state)
> *
> * This function is called by OS when a power event occurs
> */
> -int dma_resume(struct pci_dev *pci)
> +int dma_resume(struct device *dev)
> {
> + struct pci_dev *pci = to_pci_dev(dev);
> int ret;
> struct middma_device *device = pci_get_drvdata(pci);
>
> @@ -1429,6 +1431,8 @@ static const struct dev_pm_ops intel_mid_dma_pm = {
> .runtime_suspend = dma_runtime_suspend,
> .runtime_resume = dma_runtime_resume,
> .runtime_idle = dma_runtime_idle,
> + .suspend = dma_suspend,
> + .resume = dma_resume,
> };
>
> static struct pci_driver intel_mid_dma_pci_driver = {
> @@ -1437,8 +1441,6 @@ static struct pci_driver intel_mid_dma_pci_driver = {
> .probe = intel_mid_dma_probe,
> .remove = __devexit_p(intel_mid_dma_remove),
> #ifdef CONFIG_PM
> - .suspend = dma_suspend,
> - .resume = dma_resume,
> .driver = {
> .pm = &intel_mid_dma_pm,
> },
> diff --git a/drivers/dma/intel_mid_dma_regs.h b/drivers/dma/intel_mid_dma_regs.h
> index c6de919..c83d35b 100644
> --- a/drivers/dma/intel_mid_dma_regs.h
> +++ b/drivers/dma/intel_mid_dma_regs.h
> @@ -296,6 +296,6 @@ static inline struct intel_mid_dma_slave *to_intel_mid_dma_slave
> }
>
>
> -int dma_resume(struct pci_dev *pci);
> +int dma_resume(struct device *dev);
>
> #endif /*__INTEL_MID_DMAC_REGS_H__*/
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
~Vinod
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] intel_mid_dma: remove legacy pm interface
2011-12-23 16:19 ` Vinod Koul
@ 2011-12-27 7:55 ` Adrian Hunter
2012-01-02 11:05 ` Vinod Koul
0 siblings, 1 reply; 4+ messages in thread
From: Adrian Hunter @ 2011-12-27 7:55 UTC (permalink / raw)
To: Vinod Koul; +Cc: Alan Cox, linux-kernel
On 23/12/11 18:19, Vinod Koul wrote:
> On Thu, 2011-12-15 at 22:32 +0000, Alan Cox wrote:
>> From: Kristen Carlson Accardi <kristen@linux.intel.com>
>>
>> Drivers should not support both legacy pm and new framework.
> Not really.
>
> I am using this driver in our system where we go to D0i3 aka
> runtime_suspend when DMA is idle.
> Also we goto D3/S3 aka when traditional suspend is invoked.
>
> So we need both.
There is no functional change caused by this patch.
It simply moves suspend/resume calls into dev_pm_ops
where they really belong now. It is necessary to prevent
kernel warnings.
>>
>> Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
>> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>> Signed-off-by: Alan Cox <alan@linux.intel.com>
>> ---
>>
>> drivers/dma/intel_mid_dma.c | 12 +++++++-----
>> drivers/dma/intel_mid_dma_regs.h | 2 +-
>> 2 files changed, 8 insertions(+), 6 deletions(-)
>>
>>
>> diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
>> index 01929ed..d67cecf 100644
>> --- a/drivers/dma/intel_mid_dma.c
>> +++ b/drivers/dma/intel_mid_dma.c
>> @@ -868,7 +868,7 @@ static int intel_mid_dma_alloc_chan_resources(struct dma_chan *chan)
>> pm_runtime_get_sync(&mid->pdev->dev);
>>
>> if (mid->state == SUSPENDED) {
>> - if (dma_resume(mid->pdev)) {
>> + if (dma_resume(&mid->pdev->dev)) {
>> pr_err("ERR_MDMA: resume failed");
>> return -EFAULT;
>> }
>> @@ -1337,8 +1337,9 @@ static void __devexit intel_mid_dma_remove(struct pci_dev *pdev)
>> *
>> * This function is called by OS when a power event occurs
>> */
>> -int dma_suspend(struct pci_dev *pci, pm_message_t state)
>> +int dma_suspend(struct device *dev)
>> {
>> + struct pci_dev *pci = to_pci_dev(dev);
>> int i;
>> struct middma_device *device = pci_get_drvdata(pci);
>> pr_debug("MDMA: dma_suspend called\n");
>> @@ -1362,8 +1363,9 @@ int dma_suspend(struct pci_dev *pci, pm_message_t state)
>> *
>> * This function is called by OS when a power event occurs
>> */
>> -int dma_resume(struct pci_dev *pci)
>> +int dma_resume(struct device *dev)
>> {
>> + struct pci_dev *pci = to_pci_dev(dev);
>> int ret;
>> struct middma_device *device = pci_get_drvdata(pci);
>>
>> @@ -1429,6 +1431,8 @@ static const struct dev_pm_ops intel_mid_dma_pm = {
>> .runtime_suspend = dma_runtime_suspend,
>> .runtime_resume = dma_runtime_resume,
>> .runtime_idle = dma_runtime_idle,
>> + .suspend = dma_suspend,
>> + .resume = dma_resume,
>> };
>>
>> static struct pci_driver intel_mid_dma_pci_driver = {
>> @@ -1437,8 +1441,6 @@ static struct pci_driver intel_mid_dma_pci_driver = {
>> .probe = intel_mid_dma_probe,
>> .remove = __devexit_p(intel_mid_dma_remove),
>> #ifdef CONFIG_PM
>> - .suspend = dma_suspend,
>> - .resume = dma_resume,
>> .driver = {
>> .pm = &intel_mid_dma_pm,
>> },
>> diff --git a/drivers/dma/intel_mid_dma_regs.h b/drivers/dma/intel_mid_dma_regs.h
>> index c6de919..c83d35b 100644
>> --- a/drivers/dma/intel_mid_dma_regs.h
>> +++ b/drivers/dma/intel_mid_dma_regs.h
>> @@ -296,6 +296,6 @@ static inline struct intel_mid_dma_slave *to_intel_mid_dma_slave
>> }
>>
>>
>> -int dma_resume(struct pci_dev *pci);
>> +int dma_resume(struct device *dev);
>>
>> #endif /*__INTEL_MID_DMAC_REGS_H__*/
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] intel_mid_dma: remove legacy pm interface
2011-12-27 7:55 ` Adrian Hunter
@ 2012-01-02 11:05 ` Vinod Koul
0 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2012-01-02 11:05 UTC (permalink / raw)
To: Adrian Hunter; +Cc: Alan Cox, linux-kernel
On Tue, 2011-12-27 at 09:55 +0200, Adrian Hunter wrote:
> On 23/12/11 18:19, Vinod Koul wrote:
> > On Thu, 2011-12-15 at 22:32 +0000, Alan Cox wrote:
> >> From: Kristen Carlson Accardi <kristen@linux.intel.com>
> >>
> >> Drivers should not support both legacy pm and new framework.
> > Not really.
> >
> > I am using this driver in our system where we go to D0i3 aka
> > runtime_suspend when DMA is idle.
> > Also we goto D3/S3 aka when traditional suspend is invoked.
> >
> > So we need both.
>
> There is no functional change caused by this patch.
>
> It simply moves suspend/resume calls into dev_pm_ops
> where they really belong now. It is necessary to prevent
> kernel warnings.
Somehow I didn't read the patch correctly in first place.
Applied now, Thanks
--
~Vinod
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-01-02 11:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-15 22:32 [PATCH] intel_mid_dma: remove legacy pm interface Alan Cox
2011-12-23 16:19 ` Vinod Koul
2011-12-27 7:55 ` Adrian Hunter
2012-01-02 11:05 ` Vinod Koul
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.