From patchwork Tue Dec 17 11:27:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 181862 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp5563837och; Tue, 17 Dec 2019 03:27:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwHaiLOli2Y4L3ZKJV3jGm43H0IgwI/ycdyjNg+X22AM0wIGhQkAuVIMo1iK9u4kD6uuFEI X-Received: by 2002:a05:6830:2087:: with SMTP id y7mr35239778otq.96.1576582048440; Tue, 17 Dec 2019 03:27:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576582048; cv=none; d=google.com; s=arc-20160816; b=qMgDXHlwsL+V9o+xAA1CbS0AXZDewoSMzHAm+JuU72Vwuh7Iuw2ZirOeaXzgUyQTCI nZrOixslJrd4n/TqYTAcMc9vv10U5KRzfhEyz+jTC0XsXpRcQQwUM3efPFlCcCHd+NVE UiS4jj25XBkRXUOB1eOrubkX+ImcSi95LTocAHkuXvVX/tTKNegyPpeGSHKW7wi11ZT0 X4wwFlF5hcuwhPWJeTZoMPigdsHKvTXEu75xQLy4IlwvBvnmwRxNzEUsumHEw343J/02 gDzwVjAVp11Grj8h+BmCH9vZqY6iQs1gSWE5IlOBe4a1GBKdSOnnzyDcVDllYbFwH9ve u0hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=uShTc3UwCCyUhD4DHsOkkHHZPds5f89U9rEuCMCBFBg=; b=tuLmKyp8JQUFHu0uNRnWuNsTB6I5ADzCHvft1UJMMFBLiRW7F+XsArsyDWuTjJzmKa EMQSu+r5iMVpWeeJLZgNVSjI/Ws/+RmV6V0OzY0QzspANlLui40s0LkaKjEaY4w7P/65 aPS90lBCgaJopTI/21942hA/4UxrvIV06qN5FvMs7EOBpv6dOMRNW0Ej9IrShqvPCwlI 881tb0GFILUQjZvyviIBQc/Y42rVDq908LfvIKuQDkAZNWb41CcrzDE/lm4ASf76k+Ga v9cQlwDbJeod49Mkf1EQYfv+5CsjIXOcdIgjiycGEa4Kq7R1uc0QcFLuQMFPf5dCBtEH oMrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mE8VBR9w; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x68si12564489oia.227.2019.12.17.03.27.28; Tue, 17 Dec 2019 03:27:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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=@ti.com header.s=ti-com-17Q1 header.b=mE8VBR9w; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727313AbfLQL10 (ORCPT + 5 others); Tue, 17 Dec 2019 06:27:26 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:51490 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726943AbfLQL10 (ORCPT ); Tue, 17 Dec 2019 06:27:26 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBHBROPO034512; Tue, 17 Dec 2019 05:27:24 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576582044; bh=uShTc3UwCCyUhD4DHsOkkHHZPds5f89U9rEuCMCBFBg=; h=From:To:CC:Subject:Date; b=mE8VBR9wDcKlPDZNBY/vEwuBDbKxIRYfnNcZFFjZpV5/hSalgfhi1FOfaQBj5/SWF v4BE+4bRACLl2mcNKI0X1Vr+X3azoI8gKVOT1mt7If5Z9Bi1UwHMRg8ZnuyEzxiTIm 0gi628dCnrfyz6gYAsY8TP/U37l68JJrEnv0Mr14= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBHBROB9122733; Tue, 17 Dec 2019 05:27:24 -0600 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Tue, 17 Dec 2019 05:27:23 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE102.ent.ti.com (157.170.170.32) 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; Tue, 17 Dec 2019 05:27:23 -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 xBHBRL37082677; Tue, 17 Dec 2019 05:27:22 -0600 From: Peter Ujfalusi To: CC: , , Subject: [PATCH] mmc: mmci: Use dma_request_chan() instead dma_request_slave_channel() Date: Tue, 17 Dec 2019 13:27:37 +0200 Message-ID: <20191217112737.31024-1-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.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/mmc/host/mmci.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index caaa4687de93..bf9573274481 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -706,10 +706,20 @@ int mmci_dmae_setup(struct mmci_host *host) host->dma_priv = dmae; - dmae->rx_channel = dma_request_slave_channel(mmc_dev(host->mmc), - "rx"); - dmae->tx_channel = dma_request_slave_channel(mmc_dev(host->mmc), - "tx"); + dmae->rx_channel = dma_request_chan(mmc_dev(host->mmc), "rx"); + if (IS_ERR(dmae->rx_channel)) { + int ret = PTR_ERR(dmae->rx_channel); + dmae->rx_channel = NULL; + return ret; + } + + dmae->tx_channel = dma_request_chan(mmc_dev(host->mmc), "tx"); + if (IS_ERR(dmae->tx_channel)) { + if (PTR_ERR(dmae->tx_channel) == -EPROBE_DEFER) + dev_warn(mmc_dev(host->mmc), + "Deferred probe for TX channel ignored\n"); + dmae->tx_channel = NULL; + } /* * If only an RX channel is specified, the driver will