From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Subject: dma: cppi41: delete channel from pending list when stop channel From: Bin Liu Message-Id: <20181126134738.GD27653@uda0271908> Date: Mon, 26 Nov 2018 07:47:38 -0600 To: Vinod Koul Cc: Peter Ujfalusi , dmaengine@vger.kernel.org, linux-usb@vger.kernel.org, stable@vger.kernel.org List-ID: SGksCgpPbiBTYXQsIE5vdiAyNCwgMjAxOCBhdCAwNzo1ODowM1BNICswNTMwLCBWaW5vZCBLb3Vs IHdyb3RlOgo+IE9uIDEyLTExLTE4LCAwOTo0MywgQmluIExpdSB3cm90ZToKPiA+IFRoZSBkcml2 ZXIgZGVmaW5lcyB0aHJlZSBzdGF0ZXMgZm9yIGEgY3BwaSBjaGFubmVsLgo+ID4gLSBpZGxlOiAu Y2hhbl9idXN5ID09IDAgJiYgbm90IGluIC5wZW5kaW5nIGxpc3QKPiA+IC0gcGVuZGluZzogLmNo YW5fYnVzeSA9PSAwICYmIGluIC5wZW5kaW5nIGxpc3QKPiA+IC0gYnVzeTogLmNoYW5fYnVzeSA9 PSAxICYmIG5vdCBpbiAucGVuZGluZyBsaXN0Cj4gPiAKPiA+IFRoZXJlIGFyZSBjYXNlcyBpbiB3 aGljaCB0aGUgY3BwaSBjaGFubmVsIGNvdWxkIGJlIGluIHRoZSBwZW5kaW5nIHN0YXRlCj4gPiB3 aGVuIGNwcGk0MV9kbWFfaXNzdWVfcGVuZGluZygpIGlzIGNhbGxlZCBhZnRlciBjcHBpNDFfcnVu dGltZV9zdXNwZW5kKCkKPiA+IGlzIGNhbGxlZC4KPiA+IAo+ID4gY3BwaTQxX3N0b3BfY2hhbigp IGhhcyBhIGJ1ZyBmb3IgdGhlc2UgY2FzZXMgdG8gc2V0IGNoYW5uZWxzIHRvIGlkbGUgc3RhdGUu Cj4gPiBJdCBvbmx5IGNoZWNrcyB0aGUgLmNoYW5fYnVzeSBmbGFnLCBid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.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726266AbeK0Alv (ORCPT ); Mon, 26 Nov 2018 19:41:51 -0500 Date: Mon, 26 Nov 2018 07:47:38 -0600 From: Bin Liu To: Vinod Koul CC: Peter Ujfalusi , , , Subject: Re: [PATCH] dma: cppi41: delete channel from pending list when stop channel Message-ID: <20181126134738.GD27653@uda0271908> References: <20181112154322.24337-1-b-liu@ti.com> <20181124142803.GI3175@vkoul-mobl.Dlink> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20181124142803.GI3175@vkoul-mobl.Dlink> Sender: stable-owner@vger.kernel.org List-ID: Hi, On Sat, Nov 24, 2018 at 07:58:03PM +0530, Vinod Koul wrote: > On 12-11-18, 09:43, Bin Liu wrote: > > 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. > > I would like some testing, given that intent is to go to stable. > Peter..? FYI, this cppi41 dma driver is *only* used by musb controller driver. In the past I received multiple reports for this issue, but I wasn't able to reproduce it using similar test cases. The only way I could trigger the issue is to do system suspend/resume test on AM335x with a USB hub attached to the usb host port. This issue only happens once in the very *first* time suspend/resume test after reboot. Regards, -Bin.