From: Vinod Koul <vkoul@kernel.org>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Bin Liu <b-liu@ti.com>,
dmaengine@vger.kernel.org, linux-usb@vger.kernel.org,
Vinod Koul <vinod.koul@intel.com>,
stable@vger.kernel.org
Subject: dma: cppi41: delete channel from pending list when stop channel
Date: Wed, 5 Dec 2018 14:02:56 +0530 [thread overview]
Message-ID: <20181205083256.GG2847@vkoul-mobl> (raw)
On 28-11-18, 13:15, Peter Ujfalusi wrote:
>
>
> On 12/11/2018 17.40, Bin Liu wrote:
>
> Can you fix up the subject line to:
> dmaengine: ti: cppi4: delete channel from pending list when stop channel
>
> > The driver defines three states for a cppi channel.
> > - idle: .chan_busy == 0 && not in .pending list
> > - pending: .chan_busy == 0 && in .pending list
> > - busy: .chan_busy == 1 && not in .pending list
> >
> > There are cases in which the cppi channel could be in the pending state
> > when cppi41_dma_issue_pending() is called after cppi41_runtime_suspend()
> > is called.
> >
> > cppi41_stop_chan() has a bug for these cases to set channels to idle state.
> > It only checks the .chan_busy flag, but not the .pending list, then later
> > when cppi41_runtime_resume() is called the channels in .pending list will
> > be transitioned to busy state.
> >
> > Removing channels from the .pending list solves the problem.
>
> So, let me see if I understand this correctly:
> - client issued a transfer _after_ the cppi4 driver is suspended
> - cppi41_dma_issue_pending() will place it to pending list and will not
> start the transfer right away as cdd->is_suspended is true.
> - on resume the cppi4 will pick up the pending transfers from the
> pending list
>
> This is so far a sane thing to do.
>
> If I guess right, then after the issue_pending the client driver will
> call terminate_all, presumably from it's suspend callback?
>
> As per the purpose of terminate_all we should terminated all future
> transfers on the channel, so clearing the pending list is the correct
> thing to do.
>
> With the fixed subject:
> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Thanks Peter,
Applied after fixing the title, thanks
WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Bin Liu <b-liu@ti.com>,
dmaengine@vger.kernel.org, linux-usb@vger.kernel.org,
Vinod Koul <vinod.koul@intel.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] dma: cppi41: delete channel from pending list when stop channel
Date: Wed, 5 Dec 2018 14:02:56 +0530 [thread overview]
Message-ID: <20181205083256.GG2847@vkoul-mobl> (raw)
In-Reply-To: <e8cb45f3-35f9-d687-1354-ffbf1cc681ff@ti.com>
On 28-11-18, 13:15, Peter Ujfalusi wrote:
>
>
> On 12/11/2018 17.40, Bin Liu wrote:
>
> Can you fix up the subject line to:
> dmaengine: ti: cppi4: delete channel from pending list when stop channel
>
> > The driver defines three states for a cppi channel.
> > - idle: .chan_busy == 0 && not in .pending list
> > - pending: .chan_busy == 0 && in .pending list
> > - busy: .chan_busy == 1 && not in .pending list
> >
> > There are cases in which the cppi channel could be in the pending state
> > when cppi41_dma_issue_pending() is called after cppi41_runtime_suspend()
> > is called.
> >
> > cppi41_stop_chan() has a bug for these cases to set channels to idle state.
> > It only checks the .chan_busy flag, but not the .pending list, then later
> > when cppi41_runtime_resume() is called the channels in .pending list will
> > be transitioned to busy state.
> >
> > Removing channels from the .pending list solves the problem.
>
> So, let me see if I understand this correctly:
> - client issued a transfer _after_ the cppi4 driver is suspended
> - cppi41_dma_issue_pending() will place it to pending list and will not
> start the transfer right away as cdd->is_suspended is true.
> - on resume the cppi4 will pick up the pending transfers from the
> pending list
>
> This is so far a sane thing to do.
>
> If I guess right, then after the issue_pending the client driver will
> call terminate_all, presumably from it's suspend callback?
>
> As per the purpose of terminate_all we should terminated all future
> transfers on the channel, so clearing the pending list is the correct
> thing to do.
>
> With the fixed subject:
> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Thanks Peter,
Applied after fixing the title, thanks
--
~Vinod
next reply other threads:[~2018-12-05 8:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 8:32 Vinod Koul [this message]
2018-12-05 8:32 ` [PATCH] dma: cppi41: delete channel from pending list when stop channel Vinod Koul
-- strict thread matches above, loose matches on Subject: below --
2018-12-06 14:56 Bin Liu
2018-12-06 14:56 ` [PATCH] " Bin Liu
2018-11-28 11:16 Peter Ujfalusi
2018-11-28 11:16 ` [PATCH] " Peter Ujfalusi
2018-11-28 11:15 Peter Ujfalusi
2018-11-28 11:15 ` [PATCH] " Peter Ujfalusi
2018-11-26 13:47 Bin Liu
2018-11-24 14:28 Vinod Koul
2018-11-12 15:46 Bin Liu
2018-11-12 15:46 ` [PATCH] " Bin Liu
2018-11-12 15:43 Bin Liu
2018-11-12 15:40 Bin Liu
2018-11-12 15:40 ` [PATCH] " Bin Liu
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=20181205083256.GG2847@vkoul-mobl \
--to=vkoul@kernel.org \
--cc=b-liu@ti.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=peter.ujfalusi@ti.com \
--cc=stable@vger.kernel.org \
--cc=vinod.koul@intel.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.