Re: [PATCH] dmaengine: cppi41: Fix oops in cppi41_runtime_resume

2017-01-13 Thread Tony Lindgren
* Grygorii Strashko [170113 09:37]: > On 01/13/2017 10:17 AM, Tony Lindgren wrote: > > But anyways here's your basic idea plugged into my recent patch and > > it seems to work. I maybe have missed something though while reading > > so please check. > > > > The pm_runtime_get/mark_last_busy/put_au

Re: [PATCH] dmaengine: cppi41: Fix oops in cppi41_runtime_resume

2017-01-13 Thread Grygorii Strashko
On 01/13/2017 10:17 AM, Tony Lindgren wrote: > * Tony Lindgren [170112 16:04]: >> * Grygorii Strashko [170112 15:43]: >>> @@ -457,38 +449,36 @@ static void push_desc_queue(struct cppi41_channel *c) >>> cppi_writel(reg, cdd->qmgr_mem + QMGR_QUEUE_D(c->q_num)); >>> } >>> >>> -static vo

Re: [PATCH] dmaengine: cppi41: Fix oops in cppi41_runtime_resume

2017-01-13 Thread Tony Lindgren
* Tony Lindgren [170113 08:27]: > @@ -316,11 +318,12 @@ static irqreturn_t cppi41_irq(int irq, void *data) > __iormb(); > > while (val) { > + unsigned long flags; > u32 desc, len; > int error; >

Re: [PATCH] dmaengine: cppi41: Fix oops in cppi41_runtime_resume

2017-01-13 Thread Tony Lindgren
* Tony Lindgren [170112 16:04]: > * Grygorii Strashko [170112 15:43]: > > @@ -457,38 +449,36 @@ static void push_desc_queue(struct cppi41_channel *c) > > cppi_writel(reg, cdd->qmgr_mem + QMGR_QUEUE_D(c->q_num)); > > } > > > > -static void pending_desc(struct cppi41_channel *c) > > +sta

Re: [PATCH] dmaengine: cppi41: Fix oops in cppi41_runtime_resume

2017-01-13 Thread Tony Lindgren
* Sergei Shtylyov [170113 01:25]: > > @@ -320,7 +323,8 @@ static irqreturn_t cppi41_irq(int irq, void *data) > > int error; > > > > error = pm_runtime_get(cdd->ddev.dev); > > - if (error < 0) > > + if (((error != -EINPROG

Re: [PATCH] dmaengine: cppi41: Fix oops in cppi41_runtime_resume

2017-01-13 Thread Sergei Shtylyov
Hello! On 1/13/2017 12:30 AM, Tony Lindgren wrote: Commit fdea2d09b997 ("dmaengine: cppi41: Add basic PM runtime support") together with recent MUSB changes allowed USB and DMA on BeagleBone to idle when no cable is connected. But looks like few corner case issues still remain. Looks like just

Re: [PATCH] dmaengine: cppi41: Fix oops in cppi41_runtime_resume

2017-01-12 Thread Tony Lindgren
* Grygorii Strashko [170112 15:43]: > @@ -457,38 +449,36 @@ static void push_desc_queue(struct cppi41_channel *c) > cppi_writel(reg, cdd->qmgr_mem + QMGR_QUEUE_D(c->q_num)); > } > > -static void pending_desc(struct cppi41_channel *c) > +static void cppi41_dma_issue_pending(struct dma_ch

Re: [PATCH] dmaengine: cppi41: Fix oops in cppi41_runtime_resume

2017-01-12 Thread Grygorii Strashko
On 01/12/2017 05:04 PM, Tony Lindgren wrote: > * Grygorii Strashko [170112 14:53]: >> >> >> On 01/12/2017 04:19 PM, Tony Lindgren wrote: >>> * Grygorii Strashko [170112 13:54]: On 01/12/2017 03:30 PM, Tony Lindgren wrote: Sry, but even if it looks better it might still race with

Re: [PATCH] dmaengine: cppi41: Fix oops in cppi41_runtime_resume

2017-01-12 Thread Tony Lindgren
* Grygorii Strashko [170112 14:53]: > > > On 01/12/2017 04:19 PM, Tony Lindgren wrote: > > * Grygorii Strashko [170112 13:54]: > >> On 01/12/2017 03:30 PM, Tony Lindgren wrote: > >> > >> Sry, but even if it looks better it might still race with PM runtime :( > >> > >>> - if (likely(pm_runtime_a

Re: [PATCH] dmaengine: cppi41: Fix oops in cppi41_runtime_resume

2017-01-12 Thread Grygorii Strashko
On 01/12/2017 04:19 PM, Tony Lindgren wrote: > * Grygorii Strashko [170112 13:54]: >> On 01/12/2017 03:30 PM, Tony Lindgren wrote: >> >> Sry, but even if it looks better it might still race with PM runtime :( >> >>> - if (likely(pm_runtime_active(cdd->ddev.dev))) >>> + if (likely(atomic_read

Re: [PATCH] dmaengine: cppi41: Fix oops in cppi41_runtime_resume

2017-01-12 Thread Tony Lindgren
* Grygorii Strashko [170112 13:54]: > On 01/12/2017 03:30 PM, Tony Lindgren wrote: > > Sry, but even if it looks better it might still race with PM runtime :( > > > - if (likely(pm_runtime_active(cdd->ddev.dev))) > > + if (likely(atomic_read(&cdd->active))) > > push_desc_queue(c);

Re: [PATCH] dmaengine: cppi41: Fix oops in cppi41_runtime_resume

2017-01-12 Thread Grygorii Strashko
On 01/12/2017 03:30 PM, Tony Lindgren wrote: > Commit fdea2d09b997 ("dmaengine: cppi41: Add basic PM runtime support") > together with recent MUSB changes allowed USB and DMA on BeagleBone to idle > when no cable is connected. But looks like few corner case issues still > remain. > > Looks like