Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp341376ybl; Thu, 9 Jan 2020 23:06:57 -0800 (PST) X-Google-Smtp-Source: APXvYqzC5XDSUK31sPAn7/sNAYonapE6VMBp2RVGZP1b+/j71UohHndowOcxLBfINDxB4gV+RUiG X-Received: by 2002:aca:f5c1:: with SMTP id t184mr1165757oih.23.1578640017009; Thu, 09 Jan 2020 23:06:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578640017; cv=none; d=google.com; s=arc-20160816; b=b3DTDmw9WwRxOX3WY/NU9XMk+/P0gZzGadU6VDbAJG1jxF3STym9NdIhIrZCmG0fKn HGBMzD0Nq4ky3AAi8vwE9KH5a37gJMakq0rTdVNrmyZ1UNsOD4ZpBmlDXgqN4cEne8hz OAbAwAtzuWg9JjwY2R0jI2qU41ix19Gj/8ozXq3s1hKJWANBirl031isnRztlmJjeU4j hV13LVjuzGxdUywn48VUKe7ssGwWKRlc5OEKw71akSxSEzouijszsa1UBf5BFzRecbmh CZgX8s6MnRFmk+xUPYphKt8XIv0gdrpAkxSFiaR8iBZclMT7mvJpGfTKMwLawxIHj0sG uqYg== 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=kpORGyTnFiUB2kyV4rh9SVQZSJpHZQmOr0++G25k5Oc=; b=Mo9kiNadoTD21bcknjHZ28q3Iu7FGzarS0/IoSmlingr/X4RCPxATCSokoR9Ltxvas 5WCHJE6z40Mhkmu191eL+PnUY4ts//G6QBEZ0x32a++NzUADr/wCRg6uiG/SdKB/GmtR jLiUiDC0YZb3igzo0wSA/i5ZtgXh3JMRqTiDVgHb39WRd+xKGUeTgWtJ0AQDsiuhbtoy ETSd2SV+Gb/gUhYoMjAv0SvsJ7iIaYDSARXy3tFE3OVHMG04sF7qpXS3RXAHU5zvBElb kRbqnXGkKAXYdcVCKO3cyMX1p3h1/xeSvnqF3w28bWjnERX6yP+HlTYHc3Sd86jKsuRi JX5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=WqqWhJ00; 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 d10si728740oti.226.2020.01.09.23.06.45; Thu, 09 Jan 2020 23:06: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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=WqqWhJ00; 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 S1726788AbgAJHFw (ORCPT + 99 others); Fri, 10 Jan 2020 02:05:52 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:51656 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726276AbgAJHFw (ORCPT ); Fri, 10 Jan 2020 02:05:52 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 00A75cER115272; Fri, 10 Jan 2020 01:05:38 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1578639938; bh=kpORGyTnFiUB2kyV4rh9SVQZSJpHZQmOr0++G25k5Oc=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=WqqWhJ008QHlSIDVi34sOqZuXoEJmGIeNFnfPWDFSCvpu1SlX7OMiEoPbYuK//T6Y oqiaD5ciDKWocqn9lJ8EJJEXDxHNCjhtc2JbLBbb7Y17fZ86Ek8WJceVPSc5pA5Zwp WIg1PC5VkRDWBFdqEJrl0uOG71YPeSNcjwcHhNjo= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 00A75cYD031065; Fri, 10 Jan 2020 01:05:38 -0600 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Fri, 10 Jan 2020 01:05:38 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE101.ent.ti.com (157.170.170.31) 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; Fri, 10 Jan 2020 01:05:38 -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 00A75ZF7099102; Fri, 10 Jan 2020 01:05:36 -0600 Subject: Re: [PATCH] media: xilinx: Use dma_request_chan() instead dma_request_slave_channel() To: Laurent Pinchart CC: , , , , , , References: <20191217104235.23771-1-peter.ujfalusi@ti.com> <20200109164847.GF31792@pendragon.ideasonboard.com> <20200109165348.GG31792@pendragon.ideasonboard.com> From: Peter Ujfalusi Message-ID: <1a58e0e2-b1c2-1b97-22a8-8c0f366882d3@ti.com> Date: Fri, 10 Jan 2020 09:06:08 +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: <20200109165348.GG31792@pendragon.ideasonboard.com> 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 On 09/01/2020 18.53, Laurent Pinchart wrote: > Hello again, > > On Thu, Jan 09, 2020 at 06:48:47PM +0200, Laurent Pinchart wrote: >> On Tue, Dec 17, 2019 at 12:42:35PM +0200, Peter Ujfalusi wrote: >>> dma_request_slave_channel() is a wrapper on top of dma_request_chan() >>> eating up the error code. >>> >>> By using dma_request_chan() directly the driver can support deferred >>> probing against DMA. >>> >>> Signed-off-by: Peter Ujfalusi >> >> Reviewed-by: Laurent Pinchart >> >> Vinod, could you please pick this up ? > > I spoke too fast. > >>> --- >>> drivers/media/platform/xilinx/xilinx-dma.c | 6 +++--- >>> 1 file changed, 3 insertions(+), 3 deletions(-) >>> >>> diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c >>> index b211380a11f2..9ce515ff9c0a 100644 >>> --- a/drivers/media/platform/xilinx/xilinx-dma.c >>> +++ b/drivers/media/platform/xilinx/xilinx-dma.c >>> @@ -725,10 +725,10 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma, >>> >>> /* ... and the DMA channel. */ >>> snprintf(name, sizeof(name), "port%u", port); >>> - dma->dma = dma_request_slave_channel(dma->xdev->dev, name); >>> - if (dma->dma == NULL) { >>> + dma->dma = dma_request_chan(dma->xdev->dev, name); >>> + if (IS_ERR(dma->dma)) { >>> dev_err(dma->xdev->dev, "no VDMA channel found\n"); and print this only in case of !EPROBE_DEFER >>> - ret = -ENODEV; >>> + ret = PTR_ERR(dma->dma); >>> goto error; > > At the error label, we have > > error: > xvip_dma_cleanup(dma); > return ret; > > and xvip_dma_cleanup() contains > > if (dma->dma) > dma_release_channel(dma->dma); > > You need to turn this into > > if (!IS_ERR_OR_NULL(dma->dma)) I generally try to avoid IS_ERR_OR_NULL() > > or add a > > dma->dma = NULL; But in this case I think it looks better that way. > > in the error case in xvip_dma_init(). > >>> } >>> > - Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki