Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3771336ybl; Mon, 3 Feb 2020 06:16:19 -0800 (PST) X-Google-Smtp-Source: APXvYqxjN9wg7HT5XGOmT5IJpPJtkLinjtDXBcOxQ1hfmyp3g/8CM0KOCyagT4gYDmk8WHMTB2kP X-Received: by 2002:aca:dc8b:: with SMTP id t133mr14987225oig.98.1580739379803; Mon, 03 Feb 2020 06:16:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580739379; cv=none; d=google.com; s=arc-20160816; b=kHtSrf/deVGKnK6HeyAdQW78aZMKCM9CG1mEjqbMGJehYm9KFU/u9GaJC7bz8GfYmY vRb+xosMAiviQFDBpr7uQZqPltQa4OoIoRjcHQ3kq/Xt84QH12VYP9GWHiQpwLT93IUs lGvtHq7Rrci4zMT7QPpCmawyV+/0uXzzr8WqFxUZEbHoWtivTDUaXPxseGoNxIjzEp1x KewvO8lizyjTLBP3cPGpJFm0e2/JBo20Kk/77sOVKmKrh8NPJfRyXIlQclt/5rNHxlFA Ei2MvZe7Sv7br5dV0K6UUFG/Np4/7wTRoobDbmJwraHOsGTajexv77RvuWKvZtZ9EM4K K5FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Azrd1Ga5O4/syHeRQpUf0nWLHJyST0WafXdUhsLe1do=; b=m13ekR3Gq3C1aUpn7LrX8Ny7gwKDRqUApsZ31GgiQhPY4F6CY1QBBRvj0+Ik/PDwD6 RqyONmJsVqZR9hAhuri0Omkefqi0VvPA9Hrcwr5HKPRTp73p/OOL47vqpXkbL8ZQsRB8 7MGaZ/Dfjofv/uEn1F3WHX5ijtnmOdmFbB99Ynus70i1PQrjmrl4wHYNaCQTTXZ6sRen X2VZ5Ln0b7QeDJgSPmaNHsXZ1GRue6V1ePi4rlyUVGedls1kwuXAmnabyOJq426NlV3b FWeQzVpf4VpMtY1hX+ZGIatAqoDspq91ZUt7BeoTxu0qUjzrS6uzOu2IE3IPl6CCs8K+ Wyzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yPqwuhTi; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s11si3617602oic.57.2020.02.03.06.16.07; Mon, 03 Feb 2020 06:16:19 -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=@ti.com header.s=ti-com-17Q1 header.b=yPqwuhTi; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727669AbgBCMJe (ORCPT + 99 others); Mon, 3 Feb 2020 07:09:34 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:37570 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727201AbgBCMJe (ORCPT ); Mon, 3 Feb 2020 07:09:34 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 013C9UFg015233; Mon, 3 Feb 2020 06:09:30 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1580731770; bh=Azrd1Ga5O4/syHeRQpUf0nWLHJyST0WafXdUhsLe1do=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=yPqwuhTiPKFrHxk0+wyqxYYE7fET9ZZf1jFsTSAa26ZRsOVIudcHlvzOmmPw2JjVZ iVzcitpAA5pGl5W4htaSL7Bc4kBJHFRgPDbPIeva327keFBqhI5Bd+9KQrPuRmbsEM 2VwziHX+KTYBkow+8OGjrXpZ+t3KSJZhPGIJGaOM= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 013C9U30121750 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 3 Feb 2020 06:09:30 -0600 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 3 Feb 2020 06:09:30 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 3 Feb 2020 06:09:30 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 013C9SKQ091675; Mon, 3 Feb 2020 06:09:28 -0600 Subject: Re: [PATCH 0/3] dmaengine: Stear users towards dma_request_slave_chan() To: Andy Shevchenko CC: Vinod Koul , dmaengine , Linux Kernel Mailing List , Dan Williams References: <20200203101806.2441-1-peter.ujfalusi@ti.com> From: Peter Ujfalusi Message-ID: <701ab186-c240-3c37-2c0b-8ac195f8073f@ti.com> Date: Mon, 3 Feb 2020 14:09:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On 03/02/2020 13.16, Andy Shevchenko wrote: > On Mon, Feb 3, 2020 at 12:59 PM Peter Ujfalusi wrote: >> On 03/02/2020 12.37, Andy Shevchenko wrote: >>> On Mon, Feb 3, 2020 at 12:32 PM Peter Ujfalusi wrote: > >>>> 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 >> >> The dma_slave_map support is added few years back for the legacy ARM >> boards, because we do care. >> daVinci, OMAP1, pxa, s3cx4xx and even m68k/coldfire moved over. > > Then why simple not to convert (start converting) those few drivers to > new API and simple remove the old one? _if_ the dma_request_slave_channel_compat() is really falling back after dma_request_chan() - this is what it calls first, then it is not a simple convert to a new API. 1. The arch needs to define the dma_slave_map for the SoC. 2. The dma driver needs few lines to add it to DMAengine core (+pdata change). After this the _compat() can be replaced with dma_request_chan() In most cases I do not have access to documentation and boards to test. Looking at the output of 'git grep dma_request_slave_channel_compat': drivers/mmc/host/renesas_sdhi_sys_dmac.c drivers/spi/spi-pxa2xx-dma.c drivers/spi/spi-rspi.c drivers/spi/spi-sh-msiof.c drivers/tty/serial/8250/8250_dma.c From these rspi boots only in DT and I'm not sure about the others. 8250_dma is a tricky one as it is used as generic DMA layer for many arch. >> Imho it is confusing to have 4+ APIs to do the same thing, but in a >> slightly different way. > > It was always an excuse by authors "that too many drivers to convert..." Sure, but before you accuse anyone with neglect, can you check the git log for 'dma_request_slave_channel' in the commit messages? >>> without taking care of >>> (I'm talking now about dma release callback, for example) end users. >> >> I have been converting users in the background, but the _compat() is a >> bit more problematic as I need to maintainers of those legacy platforms >> to craft the map. If they care. > > Why not to remove them and don't punish users of new drivers / platforms? The _compat() can not be removed, but we just don't know who really needs the fallback after dma_request_chan(). With the print the hope is that users will come forward and we can help migrate or address their specific needs. >> Obviously the APIs are not going to be removed if we have a single user >> and if there is clearly a need for something the _compat() was doing and >> it can not be done via the dma_slave_map, then rest assured there will >> be a clean API to achieve just that. >> >>> They will be scary for no reason. >> >> There is a reason: to clean up the API to make it non confusing for the >> users. > > No, it's a reason when you first take care of existing users and > decide to obsolete an API followed by removal few releases later. I'm fine to drop the pr_info() and the __deprecated mark for dma_request_slave_channel. > But > I see no reason to keep such APIs at all, so, instead of this > *wonderful* messages perhaps somebody should do better work? To touch the _compat() variant one needs to have access to the documentation of the SoC on which the code falls back. It is not a matter of sloppy/poor/ignorant/etc work attitude. I have kept clear on touching those few drivers using it [1] as I don't have documentation. >> New drivers should not use the old API i new code and developers tend to >> pick the API they use after a quick 'git grep dma_request_' and see what >> the majority is using. > > Isn't it a point to do better review rather than scary end users? Sure, but we rarely CCd on new client drivers for DMAengine API usage. [1] fwiw, there are drivers using dma_request_channel() and by the look their use is either _compat() or the dma_request_chan_by_mask() style and some even have a twist here and there... - Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki