From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752113AbbHNXsW (ORCPT ); Fri, 14 Aug 2015 19:48:22 -0400 Received: from mail-la0-f67.google.com ([209.85.215.67]:36042 "EHLO mail-la0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750735AbbHNXsU (ORCPT ); Fri, 14 Aug 2015 19:48:20 -0400 MIME-Version: 1.0 In-Reply-To: References: <1437469005-3162-1-git-send-email-yao.yuan@freescale.com> Date: Fri, 14 Aug 2015 18:48:18 -0500 X-Google-Sender-Auth: QTQpALUleUhvW4PxxqtwZTFkcwY Message-ID: Subject: Re: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support From: Li Yang To: Yao Yuan Cc: Vinod Koul , "stefan@agner.ch" , Arnd Bergmann , Dan Williams , "dmaengine@vger.kernel.org" , lkml , "linux-arm-kernel@lists.infradead.org" , "linux-pm@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 14, 2015 at 1:24 AM, Yao Yuan wrote: > Hi Leo, > > Thanks for your review. > About those two methods for DMA suspend that you have mentioned. We have a lot of the discussions in other DMA driver like DMA for Freescale PowerPC. > > Finally, we think the device which used the DMA transmission service should cancel the transmission service in its suspend. > So DMA in suspend should be idle. If that's the case you should clearly state this in the commit message and in code, although I don't know if it is safe to make such assumption. There could be user of the DMA that doesn't track the completion of transfers. > > Once the DMA in late_suspend is not be idle, we think some driver haven't canceled the DMA transmission. So maybe something is error when other driver in suspend. > > In the case, we should return failed to stop PM. DMA should not make a choice for other drivers(which used DMA) to force stop DMA transmission. The suspend entrance should be terminated by wakeup events and only critical issues. I don't think we should just terminate the suspend entrance just because having on-going I/O without even try to stop it. > > Thanks. > > Best Regards, > Yuan Yao > >> -----Original Message----- >> From: pku.leo@gmail.com [mailto:pku.leo@gmail.com] On Behalf Of Li Yang >> Sent: Friday, August 14, 2015 4:58 AM >> To: Yuan Yao-B46683 >> Cc: Vinod Koul; stefan@agner.ch; Arnd Bergmann; Dan Williams; >> dmaengine@vger.kernel.org; lkml; linux-arm-kernel@lists.infradead.org; linux- >> pm@vger.kernel.org >> Subject: Re: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume >> support >> >> On Tue, Jul 21, 2015 at 3:56 AM, Yuan Yao wrote: >> > This add power management suspend/resume support for the fsl-edma >> > driver. >> > >> > eDMA acted as a basic function used by others. What it needs to do is >> > the two steps below to support power management. >> > >> > In fsl_edma_suspend_late: >> > Check whether the DMA chan is idle and if it is not idle, stop PM >> > operation. >> >> You should try to quiesce the device on suspend instead of depending on itself >> to be happen in idle and failing if it is not. >> >> Regards, >> Leo -- - Leo From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Yang Subject: Re: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support Date: Fri, 14 Aug 2015 18:48:18 -0500 Message-ID: References: <1437469005-3162-1-git-send-email-yao.yuan@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Yao Yuan Cc: Vinod Koul , "stefan@agner.ch" , Arnd Bergmann , Dan Williams , "dmaengine@vger.kernel.org" , lkml , "linux-arm-kernel@lists.infradead.org" , "linux-pm@vger.kernel.org" List-Id: linux-pm@vger.kernel.org On Fri, Aug 14, 2015 at 1:24 AM, Yao Yuan wrote: > Hi Leo, > > Thanks for your review. > About those two methods for DMA suspend that you have mentioned. We have a lot of the discussions in other DMA driver like DMA for Freescale PowerPC. > > Finally, we think the device which used the DMA transmission service should cancel the transmission service in its suspend. > So DMA in suspend should be idle. If that's the case you should clearly state this in the commit message and in code, although I don't know if it is safe to make such assumption. There could be user of the DMA that doesn't track the completion of transfers. > > Once the DMA in late_suspend is not be idle, we think some driver haven't canceled the DMA transmission. So maybe something is error when other driver in suspend. > > In the case, we should return failed to stop PM. DMA should not make a choice for other drivers(which used DMA) to force stop DMA transmission. The suspend entrance should be terminated by wakeup events and only critical issues. I don't think we should just terminate the suspend entrance just because having on-going I/O without even try to stop it. > > Thanks. > > Best Regards, > Yuan Yao > >> -----Original Message----- >> From: pku.leo@gmail.com [mailto:pku.leo@gmail.com] On Behalf Of Li Yang >> Sent: Friday, August 14, 2015 4:58 AM >> To: Yuan Yao-B46683 >> Cc: Vinod Koul; stefan@agner.ch; Arnd Bergmann; Dan Williams; >> dmaengine@vger.kernel.org; lkml; linux-arm-kernel@lists.infradead.org; linux- >> pm@vger.kernel.org >> Subject: Re: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume >> support >> >> On Tue, Jul 21, 2015 at 3:56 AM, Yuan Yao wrote: >> > This add power management suspend/resume support for the fsl-edma >> > driver. >> > >> > eDMA acted as a basic function used by others. What it needs to do is >> > the two steps below to support power management. >> > >> > In fsl_edma_suspend_late: >> > Check whether the DMA chan is idle and if it is not idle, stop PM >> > operation. >> >> You should try to quiesce the device on suspend instead of depending on itself >> to be happen in idle and failing if it is not. >> >> Regards, >> Leo -- - Leo From mboxrd@z Thu Jan 1 00:00:00 1970 From: leoli@freescale.com (Li Yang) Date: Fri, 14 Aug 2015 18:48:18 -0500 Subject: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support In-Reply-To: References: <1437469005-3162-1-git-send-email-yao.yuan@freescale.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Aug 14, 2015 at 1:24 AM, Yao Yuan wrote: > Hi Leo, > > Thanks for your review. > About those two methods for DMA suspend that you have mentioned. We have a lot of the discussions in other DMA driver like DMA for Freescale PowerPC. > > Finally, we think the device which used the DMA transmission service should cancel the transmission service in its suspend. > So DMA in suspend should be idle. If that's the case you should clearly state this in the commit message and in code, although I don't know if it is safe to make such assumption. There could be user of the DMA that doesn't track the completion of transfers. > > Once the DMA in late_suspend is not be idle, we think some driver haven't canceled the DMA transmission. So maybe something is error when other driver in suspend. > > In the case, we should return failed to stop PM. DMA should not make a choice for other drivers(which used DMA) to force stop DMA transmission. The suspend entrance should be terminated by wakeup events and only critical issues. I don't think we should just terminate the suspend entrance just because having on-going I/O without even try to stop it. > > Thanks. > > Best Regards, > Yuan Yao > >> -----Original Message----- >> From: pku.leo at gmail.com [mailto:pku.leo at gmail.com] On Behalf Of Li Yang >> Sent: Friday, August 14, 2015 4:58 AM >> To: Yuan Yao-B46683 >> Cc: Vinod Koul; stefan at agner.ch; Arnd Bergmann; Dan Williams; >> dmaengine at vger.kernel.org; lkml; linux-arm-kernel at lists.infradead.org; linux- >> pm at vger.kernel.org >> Subject: Re: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume >> support >> >> On Tue, Jul 21, 2015 at 3:56 AM, Yuan Yao wrote: >> > This add power management suspend/resume support for the fsl-edma >> > driver. >> > >> > eDMA acted as a basic function used by others. What it needs to do is >> > the two steps below to support power management. >> > >> > In fsl_edma_suspend_late: >> > Check whether the DMA chan is idle and if it is not idle, stop PM >> > operation. >> >> You should try to quiesce the device on suspend instead of depending on itself >> to be happen in idle and failing if it is not. >> >> Regards, >> Leo -- - Leo