From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752199AbcHHPYw (ORCPT ); Mon, 8 Aug 2016 11:24:52 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:35890 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752054AbcHHPYv (ORCPT ); Mon, 8 Aug 2016 11:24:51 -0400 Date: Mon, 8 Aug 2016 08:24:49 -0700 From: Viresh Kumar To: Vinod Koul Cc: Greg Kroah-Hartman , Dan Williams , linaro-kernel@lists.linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dmaengine: device must have at least one channel Message-ID: <20160808152448.GA4798@ubuntu> References: <4a6e2283fb7736c33fb733c310314d7bc135cd6d.1469654853.git.viresh.kumar@linaro.org> <20160803193421.GC31688@kroah.com> <20160805163050.GH3946@ubuntu> <20160808081754.GW9681@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160808081754.GW9681@localhost> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08-08-16, 13:47, Vinod Koul wrote: > On Fri, Aug 05, 2016 at 09:30:50AM -0700, Viresh Kumar wrote: > > On 03-08-16, 21:34, Greg Kroah-Hartman wrote: > > > > To follow up on this, as you found out, this patch breaks working > > > hardware, so please don't apply it anywhere. It needs more debugging to > > > figure out exactly what is going on with some very strange hardware that > > > seems to be relying on some strange code... > > > > Thanks for your email Greg, and I know what the issue is. > > > > So, the dmaengine core actually allows registering a device without any channels > > and the dma driver can add channels later (directly to the dma-device channel > > list), for example, from the of-xlate callback once someone requests for a > > channel. > > I do not think that is good idea > > > Though its not the right way of doing things, but it still works. The only thing > > which breaks in that case is sysfs interface to dmaengine as the channels aren't > > registered as devices and so they aren't visible in userspace, as that code is > > *only* executed while the dma-device is registered. > > > > I think its dmaengine core's decision to keep supporting such drivers or not and > > so I would like Vinod to comment on that.. > > My view would be to ensure that controllers have channels before they > register. If they dont, then please register later. > > > But if we do want to support such drivers, then the core must be updated to fix > > the memleak I reported here, as idr_ref is allocated and not used at all (also > > dma-id allocated for it). > > > > Or provide another API to properly and fully add channels at a later point of > > time. > > And looking at drivers, I am not seeing anyone who needs such a support, so > am not inclined to support such a feature atm. Right and so I believe that applying this patch is the right thing to do.. -- viresh