All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Leo <LeoLi@freescale.com>
To: Yao Yuan <yao.yuan@freescale.com>, Vinod Koul <vinod.koul@intel.com>
Cc: Nigel Cunningham <nigel@nigelcunningham.com.au>,
	"stefan@agner.ch" <stefan@agner.ch>,
	Arnd Bergmann <arnd@arndb.de>,
	Dan Williams <dan.j.williams@intel.com>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Subject: RE: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support
Date: Wed, 9 Sep 2015 03:02:26 +0000	[thread overview]
Message-ID: <DM2PR0301MB07349323D2F5F6C5EEB39DF8BA520@DM2PR0301MB0734.namprd03.prod.outlook.com> (raw)
In-Reply-To: <BLUPR03MB134EC0560527216B7D729EE83540@BLUPR03MB134.namprd03.prod.outlook.com>


> On Thu, Aug 20, 2015 at 12:08:00PM +0800, Vinod Koul wrote:
> > On Mon, Aug 17, 2015 at 02:10:46PM -0500, Li Yang wrote:
> > > >> Think of it from the end user perspective. Would you like your
> > > >> laptop (or
> > > >> whatever) to refuse to suspend because of this condition? The
> > > >> user may well expect that closing the lid on their laptop will
> > > >> reliably lead to it suspending to ram. Returning a failure here
> > > >> could result in a loss of data if the condition is not detected
> > > >> and the machine
> > subsequently runs out of power.
> > > >>
> > > >
> > > > Yes, the user may well expect that closing the lid on their laptop
> > > > will reliably
> > lead to it suspending to ram.
> > > > So the client(the user of the DMA) must  to PAUSE or terminate the
> > > > DMA
> > transmission.
> > > >
> > > > We need to rely on client doing the right thing here.
> > > > The DMA should not make a decision instead of client.
> > > > If the DMA is not idle in DMA suspend, it should be the client's issue.
> > > > We don't know what the client really want to do, so just return
> > > > the non-
> > success value.
> > >
> > > The problem here is that neither the client nor the DMA controller
> > > driver should easily decide to stop the suspend entrance and rollback.
> > > I don't think the non-idle situation is serious enough to cause a
> > > rollback.  You should do whatever can be done with the DMA
> > > controller(such as stop the controller and leave whatever to be done
> > > to the wake up) and continue with the suspend.
> >
> > Ideally yes client should suspend first and dmaengine driver then
> > being idle when suspend is invoked. But we know we are in idle world!
> > So, driver should ensure it suspends the active channels and then goes
> > to suspend and restores that on resume
> >
> 
> Hi Vinod,
> Hi Leo,
> 
> Is there any other discussions?
> 
> I think we can have the following solutions for DMA driver:
> 1, Force terminate the active channels in its suspend and then return.
> 2, DMA have to wait until the active channels idle.
> 3, Don't care about the active channels and direct return.
> 4, Return BUS BUSY error and stop PM progress.
> 
> 
> I prefer the last one, because I think client should make sure the channel is idle.
> 
> But also the first one should be works.

I agree that client should be responsible for cleaning up the pending requests.  My concern is that we shouldn't be triggering rewind by returning error if any client failed to do so.  I would suggest to complain about it with a message and continue to do whatever we can do at the DMA driver level and continue with the suspend.  So I would prefer the solution one.

Regards,
Leo


WARNING: multiple messages have this Message-ID (diff)
From: Li Leo <LeoLi@freescale.com>
To: Yao Yuan <yao.yuan@freescale.com>, Vinod Koul <vinod.koul@intel.com>
Cc: Nigel Cunningham <nigel@nigelcunningham.com.au>,
	Arnd Bergmann <arnd@arndb.de>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	"stefan@agner.ch" <stefan@agner.ch>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support
Date: Wed, 9 Sep 2015 03:02:26 +0000	[thread overview]
Message-ID: <DM2PR0301MB07349323D2F5F6C5EEB39DF8BA520@DM2PR0301MB0734.namprd03.prod.outlook.com> (raw)
In-Reply-To: <BLUPR03MB134EC0560527216B7D729EE83540@BLUPR03MB134.namprd03.prod.outlook.com>


> On Thu, Aug 20, 2015 at 12:08:00PM +0800, Vinod Koul wrote:
> > On Mon, Aug 17, 2015 at 02:10:46PM -0500, Li Yang wrote:
> > > >> Think of it from the end user perspective. Would you like your
> > > >> laptop (or
> > > >> whatever) to refuse to suspend because of this condition? The
> > > >> user may well expect that closing the lid on their laptop will
> > > >> reliably lead to it suspending to ram. Returning a failure here
> > > >> could result in a loss of data if the condition is not detected
> > > >> and the machine
> > subsequently runs out of power.
> > > >>
> > > >
> > > > Yes, the user may well expect that closing the lid on their laptop
> > > > will reliably
> > lead to it suspending to ram.
> > > > So the client(the user of the DMA) must  to PAUSE or terminate the
> > > > DMA
> > transmission.
> > > >
> > > > We need to rely on client doing the right thing here.
> > > > The DMA should not make a decision instead of client.
> > > > If the DMA is not idle in DMA suspend, it should be the client's issue.
> > > > We don't know what the client really want to do, so just return
> > > > the non-
> > success value.
> > >
> > > The problem here is that neither the client nor the DMA controller
> > > driver should easily decide to stop the suspend entrance and rollback.
> > > I don't think the non-idle situation is serious enough to cause a
> > > rollback.  You should do whatever can be done with the DMA
> > > controller(such as stop the controller and leave whatever to be done
> > > to the wake up) and continue with the suspend.
> >
> > Ideally yes client should suspend first and dmaengine driver then
> > being idle when suspend is invoked. But we know we are in idle world!
> > So, driver should ensure it suspends the active channels and then goes
> > to suspend and restores that on resume
> >
> 
> Hi Vinod,
> Hi Leo,
> 
> Is there any other discussions?
> 
> I think we can have the following solutions for DMA driver:
> 1, Force terminate the active channels in its suspend and then return.
> 2, DMA have to wait until the active channels idle.
> 3, Don't care about the active channels and direct return.
> 4, Return BUS BUSY error and stop PM progress.
> 
> 
> I prefer the last one, because I think client should make sure the channel is idle.
> 
> But also the first one should be works.

I agree that client should be responsible for cleaning up the pending requests.  My concern is that we shouldn't be triggering rewind by returning error if any client failed to do so.  I would suggest to complain about it with a message and continue to do whatever we can do at the DMA driver level and continue with the suspend.  So I would prefer the solution one.

Regards,
Leo

WARNING: multiple messages have this Message-ID (diff)
From: LeoLi@freescale.com (Li Leo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support
Date: Wed, 9 Sep 2015 03:02:26 +0000	[thread overview]
Message-ID: <DM2PR0301MB07349323D2F5F6C5EEB39DF8BA520@DM2PR0301MB0734.namprd03.prod.outlook.com> (raw)
In-Reply-To: <BLUPR03MB134EC0560527216B7D729EE83540@BLUPR03MB134.namprd03.prod.outlook.com>


> On Thu, Aug 20, 2015 at 12:08:00PM +0800, Vinod Koul wrote:
> > On Mon, Aug 17, 2015 at 02:10:46PM -0500, Li Yang wrote:
> > > >> Think of it from the end user perspective. Would you like your
> > > >> laptop (or
> > > >> whatever) to refuse to suspend because of this condition? The
> > > >> user may well expect that closing the lid on their laptop will
> > > >> reliably lead to it suspending to ram. Returning a failure here
> > > >> could result in a loss of data if the condition is not detected
> > > >> and the machine
> > subsequently runs out of power.
> > > >>
> > > >
> > > > Yes, the user may well expect that closing the lid on their laptop
> > > > will reliably
> > lead to it suspending to ram.
> > > > So the client(the user of the DMA) must  to PAUSE or terminate the
> > > > DMA
> > transmission.
> > > >
> > > > We need to rely on client doing the right thing here.
> > > > The DMA should not make a decision instead of client.
> > > > If the DMA is not idle in DMA suspend, it should be the client's issue.
> > > > We don't know what the client really want to do, so just return
> > > > the non-
> > success value.
> > >
> > > The problem here is that neither the client nor the DMA controller
> > > driver should easily decide to stop the suspend entrance and rollback.
> > > I don't think the non-idle situation is serious enough to cause a
> > > rollback.  You should do whatever can be done with the DMA
> > > controller(such as stop the controller and leave whatever to be done
> > > to the wake up) and continue with the suspend.
> >
> > Ideally yes client should suspend first and dmaengine driver then
> > being idle when suspend is invoked. But we know we are in idle world!
> > So, driver should ensure it suspends the active channels and then goes
> > to suspend and restores that on resume
> >
> 
> Hi Vinod,
> Hi Leo,
> 
> Is there any other discussions?
> 
> I think we can have the following solutions for DMA driver:
> 1, Force terminate the active channels in its suspend and then return.
> 2, DMA have to wait until the active channels idle.
> 3, Don't care about the active channels and direct return.
> 4, Return BUS BUSY error and stop PM progress.
> 
> 
> I prefer the last one, because I think client should make sure the channel is idle.
> 
> But also the first one should be works.

I agree that client should be responsible for cleaning up the pending requests.  My concern is that we shouldn't be triggering rewind by returning error if any client failed to do so.  I would suggest to complain about it with a message and continue to do whatever we can do at the DMA driver level and continue with the suspend.  So I would prefer the solution one.

Regards,
Leo

  reply	other threads:[~2015-09-09  3:17 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21  8:56 [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support Yuan Yao
2015-07-21  8:56 ` Yuan Yao
2015-08-11 10:33 ` Yao Yuan
2015-08-11 10:33   ` Yao Yuan
2015-08-13 20:58 ` Li Yang
2015-08-13 20:58   ` Li Yang
2015-08-13 20:58   ` Li Yang
2015-08-14  6:24   ` Yao Yuan
2015-08-14  6:24     ` Yao Yuan
2015-08-14  6:24     ` Yao Yuan
2015-08-14 23:48     ` Li Yang
2015-08-14 23:48       ` Li Yang
2015-08-14 23:48       ` Li Yang
2015-08-17  3:59       ` Yao Yuan
2015-08-17  3:59         ` Yao Yuan
2015-08-17  3:59         ` Yao Yuan
2015-08-17  6:48         ` Nigel Cunningham
2015-08-17  6:48           ` Nigel Cunningham
2015-08-17  6:48           ` Nigel Cunningham
2015-08-17  7:22           ` Yao Yuan
2015-08-17  7:22             ` Yao Yuan
2015-08-17  7:22             ` Yao Yuan
2015-08-17 19:10             ` Li Yang
2015-08-17 19:10               ` Li Yang
2015-08-17 19:10               ` Li Yang
2015-08-20  4:08               ` Vinod Koul
2015-08-20  4:08                 ` Vinod Koul
2015-08-20  4:08                 ` Vinod Koul
2015-09-07  7:41                 ` Yao Yuan
2015-09-07  7:41                   ` Yao Yuan
2015-09-07  7:41                   ` Yao Yuan
2015-09-09  3:02                   ` Li Leo [this message]
2015-09-09  3:02                     ` Li Leo
2015-09-09  3:02                     ` Li Leo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM2PR0301MB07349323D2F5F6C5EEB39DF8BA520@DM2PR0301MB0734.namprd03.prod.outlook.com \
    --to=leoli@freescale.com \
    --cc=arnd@arndb.de \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nigel@nigelcunningham.com.au \
    --cc=stefan@agner.ch \
    --cc=vinod.koul@intel.com \
    --cc=yao.yuan@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.