From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751790AbdAYNMt (ORCPT ); Wed, 25 Jan 2017 08:12:49 -0500 Received: from www381.your-server.de ([78.46.137.84]:50690 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751574AbdAYNMr (ORCPT ); Wed, 25 Jan 2017 08:12:47 -0500 Subject: Re: [PATCH v7 2/4] dmaengine: Forward slave device pointer to of_xlate callback To: Marek Szyprowski , linux-samsung-soc@vger.kernel.org, dmaengine@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org References: <1485340088-25481-1-git-send-email-m.szyprowski@samsung.com> <1485340088-25481-3-git-send-email-m.szyprowski@samsung.com> Cc: Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Vinod Koul , Ulf Hansson , "Rafael J. Wysocki" , Kuninori Morimoto , Mark Brown , Inki Dae From: Lars-Peter Clausen X-Enigmail-Draft-Status: N1110 Message-ID: <26397455-1237-2a66-acf8-215aacc7c9ce@metafoo.de> Date: Wed, 25 Jan 2017 14:12:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.5.1 MIME-Version: 1.0 In-Reply-To: <1485340088-25481-3-git-send-email-m.szyprowski@samsung.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Authenticated-Sender: lars@metafoo.de Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/25/2017 11:28 AM, Marek Szyprowski wrote: > Add pointer to slave device to of_dma_xlate to let DMA engine driver > to know which slave device is using given DMA channel. This will be > later used to implement non-irq-safe runtime PM for DMA engine driver. of_dma_xlate() is used to translate from a OF phandle and a specifier to a DMA channel. On one hand this does not necessarily mean that the channel is actually going to be used by the slave that called the xlate function. Modifying the driver state when a lookup of the channel is done is a layering violation. And this approach is also missing a way to disassociate a slave from a DMA channel, e.g. when it is no longer used. On the other hand there are other mechanisms to translate between some kind of firmware handle to a DMA channel which are completely ignored here. So this approach does not work. This is something that needs to be done at the dmaengine level, not a the firmware resource translation level. And it needs a matching method that is called when the channel is disassociated from a device, when the device no longer uses the DMA channel.