Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2628359imu; Tue, 6 Nov 2018 18:57:14 -0800 (PST) X-Google-Smtp-Source: AJdET5cq/EWOAj15NGej4OknxVDWrSqXFkqcjhuoRrb5FxG1k++zs4ZqEqfYCUWWPBlcxzsvd2ZH X-Received: by 2002:a63:a35c:: with SMTP id v28mr112386pgn.205.1541559434577; Tue, 06 Nov 2018 18:57:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541559434; cv=none; d=google.com; s=arc-20160816; b=VKiR8f0Ktjckc43jCc8vxs0EwyRWvgIWdB/OSLW7/GQaQRGWuEn6jAznVE7Hd/DStD p5JorYXRScVygEGfIm/hNuvHCONXg07FZFjz3iBEE1RLIwcAwULUyRDZJ39qBSIhzRKD DzBPvZbCvrW4rbtlyv1jKMOw4UGMdvNBExEbCjgTTmwZE0w2wJ77SboLuPo3x72LuSnK 4gSnTS89rtNb/N3XSwoxJAPTI0UvKNXOvkQo6XFP6xK2tk6GH63lxmhaYr0JfGoDpm/j bjE+p/SRlvmtwtJvFHOukahXfhhDRMPL2ZsakhK/3BVOVqlJ7mUvL32NEO6hvkZRMOpe DfiA== 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:dkim-signature; bh=V2wcfhy5y0AiMf7u809T/U+/OgtsEImPqt6IotOeUW8=; b=xyy42m6xxJcRV5s7m0GOreKzl9cUQK8jmdenDGV/MIZg9obdhHr4XTzO2irv3WM2vN BJjWb+/yT5TZKIvYbmnmL7fq2V4QEZsBaErCL99DnuuiL9u3uzpDpIoUb5CxGUU6Pwat q9zrSwZOCyxomB11EcU85xjuXu4BVvYHCc6p+xA/cmB0BsSwcZURR6PvfvV7dZmNCPKL rgG2o3lNF4YzyY9dlp3hAQPHgEv8DjXhljVIj64pUUtuT5W+qm3a7mfTwG62Wfv8NnWg Kod0e/wE3ZJTDT9ic8h8xha+bW+fo09+77SNfiVC+lJU3pGfWoVIZZTvjJbNLVdf3kQX VTVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DOt2+2N4; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i3-v6si19356211pli.318.2018.11.06.18.56.57; Tue, 06 Nov 2018 18:57:14 -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=@linaro.org header.s=google header.b=DOt2+2N4; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389251AbeKGMYw (ORCPT + 99 others); Wed, 7 Nov 2018 07:24:52 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:44345 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388451AbeKGMYw (ORCPT ); Wed, 7 Nov 2018 07:24:52 -0500 Received: by mail-ed1-f66.google.com with SMTP id n19-v6so12210727edq.11 for ; Tue, 06 Nov 2018 18:56:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V2wcfhy5y0AiMf7u809T/U+/OgtsEImPqt6IotOeUW8=; b=DOt2+2N4aUMpcYKov6owcCWtNoxhexX+9sA/BMu35HGsVJ3zhjn555f2n2Z4IUWxW0 t61GhmaIA528S01Uk1uk5lgt4dh4KG2Fcm0zRxN1dhnDjjOUimuLjiBxp1QQ/3MPbXL/ CvjMnxJhBMtF/ncAJvu++GMwvwtFmv3hB9p8c= 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=V2wcfhy5y0AiMf7u809T/U+/OgtsEImPqt6IotOeUW8=; b=ka3MP1KKLriX5LxRQ3nxDxmzzekt9sDSOvDcvxG9YP3Zhhc4JP2atZVgG+QufW2urL 2tjIQAUsBCZlxTfRFdPKrltopF8czYc93nGCbZdRn6lTMmbI66phb6bCrf40r6LHPysz 0H16V8EysRPb5GXSWbXWqmmyZgvAsmamuOTREjelXfLR7F1GP2Oh8vSNz90Bk5BmUnyu f4tx1MOtopaMVRjbSgYOqKbbAfCjDG9OcGev5T3duaj7kNODIsKnOwRWY24zyoIrKdCx 89QB55OVHM3Ear+/kCvPpoMcewH4shkucXD8jqlu+iXUUR5Iy9I0L9yUFXJEf8YzNfm0 eZdQ== X-Gm-Message-State: AGRZ1gJsQT8GdBsHPHrzVnRB4pRBfDW6gYev9oLJLgWzWlBmG9coX4mR EGXfdYXbTkrSokDtqx/SZRpgA5TQgD7guo/xuyIbZw== X-Received: by 2002:a17:906:f6cc:: with SMTP id jo12-v6mr350157ejb.66.1541559387543; Tue, 06 Nov 2018 18:56:27 -0800 (PST) MIME-Version: 1.0 References: <1541387810-24867-1-git-send-email-zhang.chunyan@linaro.org> <1541387810-24867-2-git-send-email-zhang.chunyan@linaro.org> In-Reply-To: From: Chunyan Zhang Date: Wed, 7 Nov 2018 10:56:16 +0800 Message-ID: Subject: Re: [PATCH RFC 1/3] mmc: sdhci: add support for using external DMA devices To: Arnd Bergmann Cc: Ulf Hansson , Adrian Hunter , linux-mmc@vger.kernel.org, Linux Kernel Mailing List , Mark Brown , Kishon Vijay Abraham I , Sekhar Nori , Lyra Zhang 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 On Tue, 6 Nov 2018 at 19:16, Arnd Bergmann wrote: > > On 11/5/18, Chunyan Zhang wrote: > > Some standard SD host controller can support both external dma > > controllers as well as ADMA in which the controller acts as > > DMA master. > > > > Currently the generic SDHCI code supports ADMA/SDMA integrated into > > the host controller but does not have any support for external DMA > > controllers implemented using dmaengine meaning that custom code is > > needed for any systems that use a generic DMA controller with SDHCI. > > > > Signed-off-by: Chunyan Zhang > > Looks good to me overall, but I think I found one small bug: > > > > + dma->rx_chan = dma_request_chan(mmc->parent, "rx"); > > + if (IS_ERR(dma->rx_chan)) { > > + ret = PTR_ERR(dma->rx_chan); > > + if (ret == -EPROBE_DEFER && dma->tx_chan) > > + dma_release_channel(dma->tx_chan); > > + > > + dma->rx_chan = NULL; > > + pr_warn("Failed to request RX DMA channel.\n"); > > + } > > The error handling looks wrong here: if you get EPROBE_DEFER, > you want to skip the warning message. If you get any other error code, Right, will address. > you want the warning message and also the dma_release_channel() > which should be unconditional here. Will address. Thanks for the review, Chunyan > > Arnd