Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1718541imu; Tue, 6 Nov 2018 03:16:40 -0800 (PST) X-Google-Smtp-Source: AJdET5d0Gm4BRWcNR0Nl229kl07XVr96S8t7zFwHimI9E7g2ZuGZgRPcGcIz2YS0TKSQwlj3J4Bx X-Received: by 2002:a63:d846:: with SMTP id k6mr22233315pgj.251.1541503000437; Tue, 06 Nov 2018 03:16:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541503000; cv=none; d=google.com; s=arc-20160816; b=m+mLHrcL4TJKqurGFmbNTYvr+y4rhubFnH/N9eHs3XhNUrZNqQmjcpDtcHBef3fau0 /osUG97uVN+5M7XPXiyDYv33LE4u8u2ejvb0i3iTZ7R8AaJe1Sxg5qTMnmuKlke6fDkB 3NpJaec4WOUaApkpiI2VRFrSGFF6H0ksG2wW8mfJ12h2VaRpVuA/k/M7PVFX8qMiJsZS 4qiC8MYk0RFJmtdIk8ldKxxZE5AoFmzeAdoQbKXSsLOHBOPj2YDThX0mUQ0pharRqnAH /dTG93AaxGgc7UILdeBqhQ0JIs5HOYJWBL0DalyBxymbrQmtNyjwZQxAewBMyboGO5B+ Qm3Q== 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 :references:in-reply-to:mime-version:dkim-signature; bh=83IN5G0ix7r+IaBQDu0omdTI0gPN8wWLp3vequMbwng=; b=c08zjIghgwOaBPl2xlcvIpQlAZYNTMpDJ6EBIwORwyjuNzR3TKJLcnXhrUOWa+77LX POADwfUEea9Qnh8RQxncvsDjSkz6trMgNHACson03KPgyGSWMrnK5ePNlx3lHmDnSVlP Tl8ZBIP1l6pd+7XimIN0u/jPZtv8bks8JvQFcWsC60dTH7HHaRzSJcKigWC+IFtDTFM2 bb+NnTy4272Ad0B277CHLANJplsD2sqPtTaN8DCiLKlLq5gNUvGeWvAsamFstGswDcSU ZpNfiD2D6E1YwrGrv6TcAyjnBlItAPko53oEmu2TxPxJRNYaNotauWpc2ZP4q+pRmfIm z9Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=OsuhSkHu; 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 i20si15205468pgm.586.2018.11.06.03.16.23; Tue, 06 Nov 2018 03:16:40 -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=fail header.i=@gmail.com header.s=20161025 header.b=OsuhSkHu; 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 S1730087AbeKFUko (ORCPT + 99 others); Tue, 6 Nov 2018 15:40:44 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:46004 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726976AbeKFUko (ORCPT ); Tue, 6 Nov 2018 15:40:44 -0500 Received: by mail-qt1-f193.google.com with SMTP id l9-v6so2088424qtj.12; Tue, 06 Nov 2018 03:16:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=83IN5G0ix7r+IaBQDu0omdTI0gPN8wWLp3vequMbwng=; b=OsuhSkHuvC3vdQOTqnJFu6lIQjUKnjOAXzfgrj+vwtUlsdwphhZ9yKMAjl8Bp/3Qyy 6loHY6jtxpAwDqzlShwU97bKSPmH24Shl3jXurfDNwD4Meq9zxUswOGutkI+3neZOCM7 U/cb+gYg0axzKwnD5dFDU7pXo4roZtQ9ezpu36wZVZe42FzSOmQlN8We+jk3RjXzLS3Z Pa7l6ElXgP6Q4DZ29OUmJzmh9I29zyMMMZda0Pp0V/eVNTJssmkjjH7+kmgDcQSVZKZU hr44a1g9a++rh3MPa217Z+lQHsfG1bVvdkQPgCQfxxDEdssAsIvQjpDg+8cWEuhqmbYC t3Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=83IN5G0ix7r+IaBQDu0omdTI0gPN8wWLp3vequMbwng=; b=aD0qkvYq4g+RmAVHh/9yFaM27fP0u4IzHQszASi5ltA4gmky1OnsRjDQOA9YkkGIWX I8Xzw2c7iYxmRd1KFHeJL6qALPnswHwURP1f4LZlRwq6y8jQf44h2H5SSp8vhyREaWop hgtGi2W/A8PD0x6jp1d9lHfCeyYz0Giz9IVDF1QaaBeyUXry0Q+32YCt7dJUr5oCnZ3O ijJi8ip7vj/UwkfgRidbQ21H/isWmJJ3fffs8sZqDeIf4BjKtsJkdwwhFTFL+AH8nA77 O3mN6xFahSoGm8CophSxhom3s0Ln01R/jIRe1kQXWwWIMuxINZJbS+TLfC2HP46zgjLs Fkjw== X-Gm-Message-State: AGRZ1gJjklEPrqw6WbuAEFoq44jJGLOKktP7KKNnFcJeqcCLHczWForu zU5AD3zBdz8G56WwN3e/hr6rbG0/c9fuJ6vgjRo= X-Received: by 2002:ac8:410a:: with SMTP id q10-v6mr23883842qtl.96.1541502961142; Tue, 06 Nov 2018 03:16:01 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a0c:9881:0:0:0:0:0 with HTTP; Tue, 6 Nov 2018 03:16:00 -0800 (PST) In-Reply-To: <1541387810-24867-2-git-send-email-zhang.chunyan@linaro.org> References: <1541387810-24867-1-git-send-email-zhang.chunyan@linaro.org> <1541387810-24867-2-git-send-email-zhang.chunyan@linaro.org> From: Arnd Bergmann Date: Tue, 6 Nov 2018 12:16:00 +0100 X-Google-Sender-Auth: LOJufIe7PeLQOTYFgDX6v6sjRb4 Message-ID: Subject: Re: [PATCH RFC 1/3] mmc: sdhci: add support for using external DMA devices To: Chunyan Zhang Cc: Ulf Hansson , Adrian Hunter , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown , Kishon Vijay Abraham I , Sekhar Nori , Chunyan 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 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, you want the warning message and also the dma_release_channel() which should be unconditional here. Arnd