From patchwork Thu May 5 19:42:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 619041 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r153257pFz9s5g for ; Fri, 6 May 2016 05:44:46 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=lFqS9o6F; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ayPB3-0007dF-9S; Thu, 05 May 2016 19:43:13 +0000 Received: from mail-pf0-x22c.google.com ([2607:f8b0:400e:c00::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ayPB1-0007aB-VV for linux-mtd@lists.infradead.org; Thu, 05 May 2016 19:43:12 +0000 Received: by mail-pf0-x22c.google.com with SMTP id c189so42301114pfb.3 for ; Thu, 05 May 2016 12:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=P5euRgvJ3ljWalml9AIwZdNhy0drSmtGzPgSnHRdrGw=; b=lFqS9o6FeZ2R/U/LeZJAhKlXo7I0/TJiuovkiivGyjJXakojINlkysjyocfad8YC61 YicLNtgvRsu+hxiLf84jJfBoM0StlSqwN0tanj/7mMStu5jA1Ms9GDfpwQsgWA7TX3n7 driL9QEm5hXqy5gWV+w3/PqJvPLQrEupcw5t5zYf8SSvRtm3cQ/uvV/IYIhFLPZ2T0tl TqLNEqls4kY++bd3jl8difM8ojZin+vvWC9Gb2VbJi1mGD7mobiwgSytLiUwr2vXZh8I sUq0V3GccHWQbGtnkM4cLlLe6kkQi9fg1vCLbz1I9ILuoWQd6U090b5iXnOK3RDAKcw6 h8cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=P5euRgvJ3ljWalml9AIwZdNhy0drSmtGzPgSnHRdrGw=; b=FutjOIPI2HR0NcUEH8Gy3I//7hOuyKVYEg7UruQ3K9BC6ajFzHLDcKY6ndJL0+O6YS EvpIo0Qr7nRw1uT0ZCwCg3RD+XUlfteEznhe/VFZn1v2szRj84zmd20VF3s6RwVM/7OS r7kRENij94HWAlQz3s5jXP9upciVFR8jJTBLciTKEEetlSvmFf8AY/GzGjYyR+QZF4Sr PIPToCB9+TG1tgZsh7tzmv1aj17dhLKs5kfLCC/3ogo5RVljyLcE1iLcU9NK3r7d6+Ek cAQMYqAMe63NTCQMDYNBVGcaS2p3j3tp9jzNnBsCchlStR757Fiz6Lm68maLfPPks6gC JMYA== X-Gm-Message-State: AOPr4FUqjvij8E1xxoLHHfMTwm7VKyRCyKxNY67Z6SxkXZXqWbJM/Fz+vivWYPjkArQnGA== X-Received: by 10.98.41.65 with SMTP id p62mr22952650pfp.29.1462477371217; Thu, 05 May 2016 12:42:51 -0700 (PDT) Received: from ban.mtv.corp.google.com ([172.22.64.120]) by smtp.gmail.com with ESMTPSA id r73sm15534560pfi.4.2016.05.05.12.42.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 May 2016 12:42:50 -0700 (PDT) From: Brian Norris To: Boris Brezillon Subject: [PATCH] mtd: nand: sh_flctl: handle dma_submit() errors Date: Thu, 5 May 2016 12:42:44 -0700 Message-Id: <1462477364-19529-1-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160505_124312_050413_F5D77385 X-CRM114-Status: GOOD ( 10.81 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c00:0:0:0:22c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (computersforpeace[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Weinberger , Brian Norris , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Some build tools noticed that 'cookie' is being set but not used. Might as well catch the errors here and handle them the same way we handle other DMA prep steps. Signed-off-by: Brian Norris --- Compile tested only drivers/mtd/nand/sh_flctl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c index 6fa3bcd59769..442ce619b3b6 100644 --- a/drivers/mtd/nand/sh_flctl.c +++ b/drivers/mtd/nand/sh_flctl.c @@ -397,7 +397,7 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf, struct dma_chan *chan; enum dma_transfer_direction tr_dir; dma_addr_t dma_addr; - dma_cookie_t cookie = -EINVAL; + dma_cookie_t cookie; uint32_t reg; int ret; @@ -423,6 +423,12 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf, desc->callback = flctl_dma_complete; desc->callback_param = flctl; cookie = dmaengine_submit(desc); + if (dma_submit_error(cookie)) { + ret = dma_submit_error(cookie); + dev_warn(&flctl->pdev->dev, + "DMA submit failed, falling back to PIO\n"); + goto out; + } dma_async_issue_pending(chan); } else {