From patchwork Thu Feb 27 12:37:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 183940 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4463345ile; Thu, 27 Feb 2020 04:40:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzCOwh8Z+EuBy1G8BGQ5ARyOOfkB18jOdG3G1CKhQ0v4H8OFslot8cyV70CvSnrSH8FKzJ/ X-Received: by 2002:a17:90a:be03:: with SMTP id a3mr4441608pjs.99.1582807217718; Thu, 27 Feb 2020 04:40:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582807217; cv=none; d=google.com; s=arc-20160816; b=zm02r6R4/H+RrgqlzrDS8dGqiCa6F/PnEk7uF1QlajwzkXssjigPe61GD4QWepMSeq R6Rl+SWi9XJHkoDb4qNlOSURZfry2L8irDTyJWVUZ9QOQAunMm6M9osSW5E8/8H6hD3E wuoFpxvOMZl8RSfNUj7U7vCaTlt380a6OLmrIMRR1U+BkFATPjDHmSQZTSVqSFQJZ4C+ eSdzGZr/D/Vgyh5HIJOqZ1OVBq4WufTYDSf9SCV+fq7mTJ0q9UEFf5/qAqdktfl2CfKl odyh+N6hmG/cNDEbKUQAp+RbzQCrMhMH+4YQehwBsmqBXaKBpA7Hm1OJRObH0W0w2btY 1Xsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:dkim-signature; bh=ThaCPh63tinCAoATzLEax2j/Uc1K/iSisaawbv/Nm3w=; b=PnPbicY67eR8PU3d8H4Fh6NYuTmSEWvo87jP1VMFC9p69vaWM9DUQilBbt161EdkEr UA88aeje4OQRApjKwmXZs0pkiAR4SSPkB8nEbrgdvv5mFlLBZc2+vOiC9Tx3qGeOstoz 2otGuzKsVsCaaPIDXH+gc2Mtm8h3ikj40c0EU1HWocU78CYVnabY3S7YGbDckBktvJS2 Zr3dlvV43b0Dg7igR+cx7CKkJC2W3409NR9lV81AIqHMijcFZAyTH742JQzzna+GvN1S n3lKCmTcPmh2bNsGSq1ps6/CuONUfqyOFBrLDT7+8apiiMUHsasbbmZJ3jGjUTGbL4pD N4+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=J+st7cVO; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=FskWtjnN; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id 9si3600348pje.13.2020.02.27.04.40.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 04:40:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=J+st7cVO; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=FskWtjnN; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ThaCPh63tinCAoATzLEax2j/Uc1K/iSisaawbv/Nm3w=; b=J+st7cVOC873tD ugSH1Rp8B9NwwTpQSWKTfPKgUZEJfndS6c9Si8dZHebgw8TwSywQNsnlz+iV+SwaYYxFs4sV2bEwx oK1k4Cywd8bzx2FatLP+xv5L2zTJD5wvNiNE4Ju8V6LR/G4BIMApzD0VvI/vVDfI25+eu8luCVeSb xWHAnpFhfnDsFOOMvV38qy/Lf3s2xlRN/DHXKxYE5ezb5c2ZSUV59vWL9Fb32dmfR+AjYn2AVt421 Io88cRHVgY2TbyTpw4JbCIVspHfbeLcKgEHSU2C5mSn92MAyTL98mW+OARfQ/jn/iyZTIhFnooigE twJqE2hJTliQ4G15i7Tw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7ISa-0004RG-0k; Thu, 27 Feb 2020 12:40:12 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7IQf-0001oh-AD; Thu, 27 Feb 2020 12:38:14 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 01RCc5t7117401; Thu, 27 Feb 2020 06:38:05 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1582807085; bh=rajg4uTg/TEsV6CsUleF0jbc10ghlyv7bjJVEvPVLiU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=FskWtjnNY3OwRDzpQjNUVBsqmFuGzzDUUaB6Knvmlo3V0fmrNa5PSNlX6+uQd4cHG 4fSA44R8tHLbSovbpRwMeoWwDoY6uBMUwGT1TmvE3AygtePsainRv6ZOTv7O/PtMrS q4TLs6F981JAxJOz2AWqn0fBGOd2EJHz3XpJXsDM= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 01RCc5kG117291 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 27 Feb 2020 06:38:05 -0600 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 27 Feb 2020 06:38:04 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE105.ent.ti.com (10.64.6.26) 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; Thu, 27 Feb 2020 06:38:05 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 01RCbnvR100207; Thu, 27 Feb 2020 06:38:02 -0600 From: Peter Ujfalusi To: , , , , , , , Subject: [PATCH 4/7] mtd: rawnand: sunxi: Use dma_request_chan() instead dma_request_slave_channel() Date: Thu, 27 Feb 2020 14:37:46 +0200 Message-ID: <20200227123749.24064-5-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227123749.24064-1-peter.ujfalusi@ti.com> References: <20200227123749.24064-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200227_043813_438881_518B43CD X-CRM114-Status: GOOD ( 13.53 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [198.47.19.141 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: vkoul@kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org 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 --- drivers/mtd/nand/raw/sunxi_nand.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ Acked-by: Maxime Ripard diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c index 37a4ac0dd85b..3a24c4512af7 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -2123,8 +2123,16 @@ static int sunxi_nfc_probe(struct platform_device *pdev) if (ret) goto out_ahb_reset_reassert; - nfc->dmac = dma_request_slave_channel(dev, "rxtx"); - if (nfc->dmac) { + nfc->dmac = dma_request_chan(dev, "rxtx"); + if (IS_ERR(nfc->dmac)) { + ret = PTR_ERR(nfc->dmac); + if (ret == -EPROBE_DEFER) + goto out_ahb_reset_reassert; + + /* Ignore errors to fall back to PIO mode */ + dev_warn(dev, "failed to request rxtx DMA channel: %d\n", ret); + nfc->dmac = NULL; + } else { struct dma_slave_config dmac_cfg = { }; dmac_cfg.src_addr = r->start + nfc->caps->reg_io_data; @@ -2138,9 +2146,6 @@ static int sunxi_nfc_probe(struct platform_device *pdev) if (nfc->caps->extra_mbus_conf) writel(readl(nfc->regs + NFC_REG_CTL) | NFC_DMA_TYPE_NORMAL, nfc->regs + NFC_REG_CTL); - - } else { - dev_warn(dev, "failed to request rxtx DMA channel\n"); } platform_set_drvdata(pdev, nfc);