Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1210131 > unrolled thread

Re: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support

Started byVinod Koul <vinod.koul@intel.com>
First post2015-08-20 06:10 +0200
Last post2015-09-09 05:20 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support Vinod Koul <vinod.koul@intel.com> - 2015-08-20 06:10 +0200
    RE: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support Yao Yuan <yao.yuan@freescale.com> - 2015-09-07 09:50 +0200
      RE: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support Li Leo <LeoLi@freescale.com> - 2015-09-09 05:20 +0200

#1210131 — Re: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support

FromVinod Koul <vinod.koul@intel.com>
Date2015-08-20 06:10 +0200
SubjectRe: [PATCH v2] dmaengine: fsl-edma: add PM suspend/resume support
Message-ID<pZpkS-1Os-5@gated-at.bofh.it>
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

-- 
~Vinod

--
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/

[toc] | [next] | [standalone]


#1219971

FromYao Yuan <yao.yuan@freescale.com>
Date2015-09-07 09:50 +0200
Message-ID<q5ZlE-7A1-9@gated-at.bofh.it>
In reply to#1210131
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.

Can we have a conclusion and suggestion for which one is better?

Thanks.


--
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/

[toc] | [prev] | [next] | [standalone]


#1221208

FromLi Leo <LeoLi@freescale.com>
Date2015-09-09 05:20 +0200
Message-ID<q6E5r-7qJ-7@gated-at.bofh.it>
In reply to#1219971
> 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

--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web