Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2964196ybc; Thu, 21 Nov 2019 00:57:56 -0800 (PST) X-Google-Smtp-Source: APXvYqz9mQ0fOqbQ62pcPQDDP/pP1775AnskLIDJupNaapixIPlSnXjF/PS/C6d55oZpzJbn8g3h X-Received: by 2002:a17:906:7750:: with SMTP id o16mr12445312ejn.224.1574326676229; Thu, 21 Nov 2019 00:57:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574326676; cv=none; d=google.com; s=arc-20160816; b=iqBy0dO7slulelmeNYnusWa8KRT7dtJqGN0lZy2CyPOT3ZcyJxXy1tuIBGKMXo0FYz rChzpa0hlOe/L5S1jmE1AThRB1HcPevkwNnBSwSB2/acLUoVxyazlRWOW4VQ4TKB0yAO I3iAnWrME2x1xHFYMmZiEgwWjD9tx3HU5rfeTOa3X2J8HH9sddgH+ECsVPOSnBZmgEXV KZjkMKsrPovwwNJp4FkCR7Ze8nmpuZnlTedb7wGMH9PbIsL/1LjKRd+MnVL7YhcGqS3Q xtJMupffMUPEBcZP7fPPQqCB73jAh/lp++8WC3wTtqnAnsVNNIsWufBZkUoRVCORR110 YV+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=0Bz/aVHhrSp8CJz37MAck0aUQWH98Jp3Ah7Te9LIS/w=; b=QFfVsHvgI/lQKUM2X7nwA1ngtnTuhiOduhzlKLsYWAJcuO0JwesKrzVYj2JGi3UDWv zMW4JxRnYOY9Zb5QQ6UORUAaAKmCQ5O+29ccaxWneagw2yzbHhzKP+UjuvYR0QKVN1// UblRpMhAmnoK/SuD5m9LIdBaRq4WpgUtR5R9uRbfizHm9WiQFovPEdWTbyb8indhLlXR K4ke45qgiFey8XgZIfhsnBlg40l38tijECRBA91qgltBQOTnRxHf6MUi36UxWZMmos9y KAvTAtf/vzycvyTNQSGlq3RsIpGzTkDhK6wJ2fCaGCihSEqfGtAguoxFDafWwW97Bwg0 smmw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u17si1574774edd.276.2019.11.21.00.57.32; Thu, 21 Nov 2019 00:57:56 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726614AbfKUIyU (ORCPT + 99 others); Thu, 21 Nov 2019 03:54:20 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:34631 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726132AbfKUIyT (ORCPT ); Thu, 21 Nov 2019 03:54:19 -0500 Received: by mail-oi1-f196.google.com with SMTP id l202so2528290oig.1; Thu, 21 Nov 2019 00:54:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0Bz/aVHhrSp8CJz37MAck0aUQWH98Jp3Ah7Te9LIS/w=; b=D8fU+rZ0XM97dU4r/q4YuuSYzGXJiKpuqvAvzFlEjFn8fd5h01zHF/9IRi/elnHPaW I/viH1ZrOYJhQkO8VqqUhHMtowvmSfcQnk1Tw4OOO30YIufDWGb3Bf+W5OyjFhC9PIv5 9dYb+yrM+6QwfhVu99Ygd47pZAPSp3l7DNWCZznRO+QvCqE3EjaZW9OTgRko/2FcC0mi z1brto+siocmZV6Ov8uTBlNUInWOgqXs1yxg3JORsvwJvaFHGqVLusa153R8kvtl+74A R557RMU4mOFggGKwZOErIrDdZjk13+Dlsy1MUG4E9W7/rLp019a+4HgxTnAbishjIHjH Po9Q== X-Gm-Message-State: APjAAAWL2sYtmTM0MmeeSW8U68dFnAgdDnMYKayvpW7pTJvK0JT6gDNB +h09rGxo4pk20Z5xaF7SeCoB6taHDT2WeHS0tHU= X-Received: by 2002:aca:3a86:: with SMTP id h128mr6376241oia.131.1574326457337; Thu, 21 Nov 2019 00:54:17 -0800 (PST) MIME-Version: 1.0 References: <20191121080954.14915-1-peter.ujfalusi@ti.com> In-Reply-To: From: Geert Uytterhoeven Date: Thu, 21 Nov 2019 09:54:06 +0100 Message-ID: Subject: Re: [PATCH] spi: pic32: Retire dma_request_slave_channel_compat() To: Peter Ujfalusi Cc: Mark Brown , Vinod , linux-spi , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On Thu, Nov 21, 2019 at 9:40 AM Peter Ujfalusi wrote: > On 21/11/2019 10.30, Geert Uytterhoeven wrote: > > On Thu, Nov 21, 2019 at 9:11 AM Peter Ujfalusi wrote: > >> There is no reason to use the dma_request_slave_channel_compat() as no > >> filter function and parameter is provided. > >> > >> Switch the driver to use dma_request_chan() instead. > >> > >> Signed-off-by: Peter Ujfalusi > > > >> --- a/drivers/spi/spi-pic32.c > >> +++ b/drivers/spi/spi-pic32.c > >> @@ -609,22 +609,18 @@ static void pic32_spi_cleanup(struct spi_device *spi) > >> static void pic32_spi_dma_prep(struct pic32_spi *pic32s, struct device *dev) > >> { > >> struct spi_master *master = pic32s->master; > >> - dma_cap_mask_t mask; > >> > >> - dma_cap_zero(mask); > >> - dma_cap_set(DMA_SLAVE, mask); > >> - > >> - master->dma_rx = dma_request_slave_channel_compat(mask, NULL, NULL, > >> - dev, "spi-rx"); > >> - if (!master->dma_rx) { > >> + master->dma_rx = dma_request_chan(dev, "spi-rx"); > > > > Why not dma_request_slave_channel()? > > The longer term plan is to retire dma_request_slave_channel() as well. > With dma_request_chan() deferred probing against DMA drivers is possible > and it also supports legacy boot with dma_slave_map. > > At the end we should be left with only dma_request_chan() for slave > channels in the kernel. Thank you, deferred probing is a valid argument. You may want to add that to the patch description. Reviewed-by: Geert Uytterhoeven > > That way you... > > > >> + if (IS_ERR(master->dma_rx)) { > > > > ... don't have to change the NULL check here, and... > > > >> dev_warn(dev, "RX channel not found.\n"); > >> + master->dma_rx = NULL; > > > > ... don't have to override by NULL here. > > It is a small sacrifice, true, but if anyone cares the driver can > support deferred probing with dma_request_chan(). Deferred probing in case of missing DMA controllers is always a bit tricky, as there are multiple options: 1. Defer probing of the slave driver, 2a. Continue probing of the slave driver, fall back to PIO (which is what this driver does) 2b. and Retry DMA setup later. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds