From patchwork Fri May 8 12:32:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226274 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3664C47247 for ; Fri, 8 May 2020 12:41:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2B6D24981 for ; Fri, 8 May 2020 12:41:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588941695; bh=TWVZp//Y38gc0wX2cTOnRapUQ18gETsH64Rw0nidY3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bAiiIbISE20u87pqalnRabvpiM2Ce5745i+43+Og674WfpOx3gKc/ihGzsYb3LLeW zzCwP/38qbj1pouVLYTqDMt7Kn1WsD94huEi75ls1TYC8xttaDjx38iPh20tVE/ZP6 o0xvFXs7Lrj6MIS7GfMv91imdSdt3UwWkL7kvwPQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728835AbgEHMle (ORCPT ); Fri, 8 May 2020 08:41:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:36672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728833AbgEHMld (ORCPT ); Fri, 8 May 2020 08:41:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 568D12495F; Fri, 8 May 2020 12:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588941692; bh=TWVZp//Y38gc0wX2cTOnRapUQ18gETsH64Rw0nidY3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pqu2TBbRKtdQLyRLJXak81fou9Ek+OsXg8F2d84AZ/7KbpMR1WoDcPufIehe0RWCC B5m4zQ0bJ3eX0RZWiu0FGWmR+TJvqqNOXvsSzApHTgGQoOr5oaAT/Z1d2gJeYBCvhw Qc9mwU5RLzcYLArVtRt9oKoMsd1Nep7xD4RXWwNY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Jarzmik , Ezequiel Garcia , Brian Norris Subject: [PATCH 4.4 133/312] mtd: nand: pxa3xx_nand: fix dmaengine initialization Date: Fri, 8 May 2020 14:32:04 +0200 Message-Id: <20200508123133.859362525@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123124.574959822@linuxfoundation.org> References: <20200508123124.574959822@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Robert Jarzmik commit 9097103f06332d099c5ab06d1e7f22f4bcaca6e2 upstream. When the driver is initialized in a pure device-tree platform, the driver's probe fails allocating the dma channel : [ 525.624435] pxa3xx-nand 43100000.nand: no resource defined for data DMA [ 525.632088] pxa3xx-nand 43100000.nand: alloc nand resource failed The reason is that the DMA IO resource is not acquired through platform resources but by OF bindings. Fix this by ensuring that DMA IO resources are only queried in the non device-tree case. Fixes: 8f5ba31aa565 ("mtd: nand: pxa3xx-nand: switch to dmaengine") Signed-off-by: Robert Jarzmik Acked-by: Ezequiel Garcia Signed-off-by: Brian Norris Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/pxa3xx_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1750,7 +1750,7 @@ static int alloc_nand_resource(struct pl if (ret < 0) return ret; - if (use_dma) { + if (!np && use_dma) { r = platform_get_resource(pdev, IORESOURCE_DMA, 0); if (r == NULL) { dev_err(&pdev->dev,