Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp172906ybv; Wed, 5 Feb 2020 03:33:25 -0800 (PST) X-Google-Smtp-Source: APXvYqzqts8oLQGKIR6w4o30LqTrDS95qY///o89dvOcN1qV/9zEVIr/6IsoVxePonLCLmyJ4Ik3 X-Received: by 2002:a05:6830:110a:: with SMTP id w10mr25931889otq.300.1580902404850; Wed, 05 Feb 2020 03:33:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580902404; cv=none; d=google.com; s=arc-20160816; b=vJwsz+bM67g6zTbi6+UlOxE49wGQHK+Kci6D9FbG/3iTD62VbIvH/26huMJzqVzOiG xJINak1Si/e/JvJyMBa3m3h5YRpPUo6eWeyCm6BBWJ2q9OPBnYXVPy9pz2Xl/0N2pzQQ skIdsuSGikdVmho3JkdWtiu+g+jYDBCfaGuk92DTaD/MFjQMjaJ8HfvkPpGyQGd5SCah PtKB/UNTPndD5CZ5LAGGdU4XTszd0ttfowBu3p7CViSZONnpKn6Nx79Nfi2MngVAN4MW PTLKBT7B4LTL3PgpDux0Cm9xF+9uwa/4G4fPqDFnFzOI7uOX4F3QundpZtylwbD6ye3S jlOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SmqamOrkTgnXU8fRY8CI/Q6vbi205ApP7UFfCyD0pnY=; b=hV2u4Puz5IVt9MWaAy9QnNO6uNKieiPGG2NtT4HM386C76GAe2cJ89+bXxSvnX4FIc dhP+Tb4ob9K4QjqeJlF2ULd8qw3dLYXxLTO5lgRfAcfML99DO3H67S1R0ZqxtqyRCq7G q+/rDb8zL2iMf6tlQQSgm9bOVvwwHoJamM7pqJxtG6zhY8wqbwqt1wEIWq7ioeLWqdvi hV/ry3NGM4d7zJpmWxmRhZPuFVlLdxjZs8vQXTZrMX6JR3M2n6UjVZulnb6zUzROgjsR lEsgH55TYHbomcUfy6YgDfe1nXPxB5+6blPJvFNVM09wJHQYtT++6tJ2SMAfiBA2nWKH xVhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ynQt/JGS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si13456727otq.238.2020.02.05.03.33.10; Wed, 05 Feb 2020 03:33:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ynQt/JGS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728282AbgBELcB (ORCPT + 99 others); Wed, 5 Feb 2020 06:32:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:39494 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727170AbgBELcB (ORCPT ); Wed, 5 Feb 2020 06:32:01 -0500 Received: from localhost (unknown [122.178.239.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 79CC22072B; Wed, 5 Feb 2020 11:31:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580902320; bh=PFVOCoulyejpN6mvZgVTk5pxnaukban7QLyDFO77WfU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ynQt/JGSz9QiJeFwzdoIo5Lu3mZYK4JHHr73L7Q3xz3HP++C72Tasj3hjstGaK0ZH E6I6/kFHVqHJN7upIyo5b3zB1vDEHcq3sFsVdXKIKN0tkDf8kBhZOd1o3VpQ37mOP0 luK0OQha7EXiuCibsLDJz5qdwSQbswM/lcova95M= Date: Wed, 5 Feb 2020 17:01:55 +0530 From: Vinod Koul To: Peter Ujfalusi Cc: Andy Shevchenko , dmaengine , Linux Kernel Mailing List , Dan Williams Subject: Re: [PATCH 0/3] dmaengine: Stear users towards dma_request_slave_chan() Message-ID: <20200205113155.GE2618@vkoul-mobl> References: <20200203101806.2441-1-peter.ujfalusi@ti.com> <20200204062118.GS2841@vkoul-mobl> <20200205044352.GC2618@vkoul-mobl> <13dcf3d9-06ca-d793-525d-12f6d7cd27c1@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <13dcf3d9-06ca-d793-525d-12f6d7cd27c1@ti.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On 05-02-20, 10:10, Peter Ujfalusi wrote: > Vinod, > > On 05/02/2020 6.43, Vinod Koul wrote: > > On 04-02-20, 13:21, Andy Shevchenko wrote: > >> On Tue, Feb 4, 2020 at 8:21 AM Vinod Koul wrote: > >>> > >>> On 03-02-20, 12:37, Andy Shevchenko wrote: > >>>> On Mon, Feb 3, 2020 at 12:32 PM Peter Ujfalusi wrote: > >>>> > >>>>> dma_request_slave_channel_reason() no longer have user in mainline, it > >>>>> can be removed. > >>>>> > >>>>> Advise users of dma_request_slave_channel() and > >>>>> dma_request_slave_channel_compat() to move to dma_request_slave_chan() > >>>> > >>>> How? There are legacy ARM boards you have to care / remove before. > >>>> DMAengine subsystem makes a p*s off decisions without taking care of > >>>> (I'm talking now about dma release callback, for example) end users. > >>> > >>> Can you elaborate issue you are seeing with dma_release callback? > >> > >> > >> [ 7.980381] intel-lpss 0000:00:1e.3: WARN: Device release is not > >> defined so it is not safe to unbind this driver while in use > > > > Yes that is expected but is not valid in your case. > > In which case it is valid? It is valid for cases where device can be hotplugged. We didnt handle that very well earlier. TBH we never had a reason as most of the embedded cases that is not really doable. > > Anyway this will be turned off before the release. > > Looking at the commit which added it and I still don't get the point. > If any of the channel is in use then we should not allow the DMA driver > to go away at all. Not really, if the device is already gone, we cant do much about it. We have to handle that gracefully rather than oopsing The important part is that the device is gone. Think about a device on PCI card which is yanked off or a USB device unplugged. Device is already gone, you can't communicate with it anymore. So all we can do is handle the condition and exit, hence the new method to let driver know. > Imho there should be a function to check if we can proceed with the > .remove of the driver and fail it if any of the channels are in use. > > Hrm, base/dd.c __device_release_driver() does not check the .remove's > return value, so it can not fail. > > What is expected if the .remove returns with OK but we still have > channels in use? > > After the remove all sorts of things got yanked which might makes the > still in use channels cause issues down the road. > > I'm curious why it is a good thing to remotely try to support unbind > when the driver is in use. > It is like one wants to support ext4 removal even when your rootfs is ext4. > > I think krefing the DMA driver for channel request/release is just fine, > if user wants to break the system we should not assist... > > >> It's not limited to that driver, but actually all I'm maintaining. > >> > >> Users are not happy! > >> > >> -- > >> With Best Regards, > >> Andy Shevchenko > > > > - P?ter > > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki -- ~Vinod