From patchwork Tue Dec 8 06:43:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Bondarenko X-Patchwork-Id: 7794831 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2B0279F39B for ; Tue, 8 Dec 2015 06:46:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 82207204EA for ; Tue, 8 Dec 2015 06:46:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88B43204E3 for ; Tue, 8 Dec 2015 06:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933099AbbLHGpt (ORCPT ); Tue, 8 Dec 2015 01:45:49 -0500 Received: from mail-lb0-f172.google.com ([209.85.217.172]:34306 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933103AbbLHGn6 (ORCPT ); Tue, 8 Dec 2015 01:43:58 -0500 Received: by lbbcs9 with SMTP id cs9so5579174lbb.1; Mon, 07 Dec 2015 22:43:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h/Wh/7AE23Xag9RBHyKRyYry2mAo0gHHTHXBC6LvD1o=; b=SPcSCFkfqzqEHvm/ak6goUPrMBYG0QIFNGYNtP+O+MBiyZdMP+nBFRKoMi93jqBkFT ZXo8rvb6BRYQv+sJUyrVvCzak1F4EdkyjZJ9vXhT9WZTuNMrmuDd9UikLiyDjpY/axpZ xmTGJUPoVsPX7mmMDo6+ZsL3J5q6qvbUeF5eRocDMt0Z5BUQXyCS7KREHcZi43AD/cv4 Kga8go8fSXbRScwhGDJdcEgclP04jh3zpBhWWIPMrfHJvh9h4+SaRY6ESrz5gNoY//jd VXEW5dGDe2GUaJXkgVOfTENydeKESzqrRN3rZPR6lnpeFIseNPbHO+AT9Injt6AxXXx9 Dtqg== X-Received: by 10.112.132.73 with SMTP id os9mr739730lbb.128.1449557036757; Mon, 07 Dec 2015 22:43:56 -0800 (PST) Received: from localhost.localdomain (c-89-233-200-205.cust.bredband2.com. [89.233.200.205]) by smtp.gmail.com with ESMTPSA id d2sm286875lbc.11.2015.12.07.22.43.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Dec 2015 22:43:56 -0800 (PST) From: Anton Bondarenko To: broonie@kernel.org, b38343@freescale.com, s.hauer@pengutronix.de Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, vladimir_zapolskiy@mentor.com, jiada_wang@mentor.com Subject: [PATCH v6 4/8] spi: imx: defer spi initialization, if DMA engine is Date: Tue, 8 Dec 2015 07:43:46 +0100 Message-Id: <1449557030-27525-5-git-send-email-anton.bondarenko.sama@gmail.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1449557030-27525-1-git-send-email-anton.bondarenko.sama@gmail.com> References: <1449557030-27525-1-git-send-email-anton.bondarenko.sama@gmail.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If SPI device supports DMA mode, but DMA controller is not yet available due to e.g. a delay in the corresponding kernel module initialization, retry to initialize SPI driver later on instead of falling back into PIO only mode. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index c123060..d98c33c 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1222,6 +1222,9 @@ static int spi_imx_probe(struct platform_device *pdev) */ if (is_imx51_ecspi(spi_imx)) { ret = spi_imx_sdma_init(&pdev->dev, spi_imx, master, res); + if (ret == -EPROBE_DEFER) + goto out_clk_put; + if (ret < 0) dev_err(&pdev->dev, "dma setup error %d, use pio\n", ret);