From patchwork Sat Dec 5 16:57:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Bondarenko X-Patchwork-Id: 7775781 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0A136BEEE1 for ; Sat, 5 Dec 2015 16:58:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47142204F6 for ; Sat, 5 Dec 2015 16:58:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7422C204D9 for ; Sat, 5 Dec 2015 16:58:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754003AbbLEQ6j (ORCPT ); Sat, 5 Dec 2015 11:58:39 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:36770 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754481AbbLEQ5V (ORCPT ); Sat, 5 Dec 2015 11:57:21 -0500 Received: by lfs39 with SMTP id 39so12797567lfs.3; Sat, 05 Dec 2015 08:57:20 -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=kERtCOxoYsM+RI2U54z69gBBwPLK8I6mzHPtxqw8LKQ=; b=Plk6A84xZEXvsWJY+Le7Bf1uXoY2wlj91+ZOWBWMj2Q0THJb4w0yku9p4uyE/euxth g1gNh8onF9wR4hKPDB4dAJKsnAJN2D4nF+0UtVjoURd3C5qcNvvZ/dzCO1mVFJ+qxAHD xOwZLdQuKabBVosGhjy7oOsXCW0oLJiMl79nb8pWtbaMKcwY3k5jeGMJvExQTgsflhPh SkM3sCQorAYxzYGfioJ8+kQrJTvxzF4WwgoeyyvRcM0+e35NU9wRfWRCjFaPHBUCQH/G fedhinjzxuoFelynHsZCFh/LyeUEt5pRTuqLPhgijbxpC21tIuFpyJHpUT9G/GOZmFJB qGHQ== X-Received: by 10.25.135.133 with SMTP id j127mr8830043lfd.73.1449334639951; Sat, 05 Dec 2015 08:57:19 -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 tv8sm164546lbb.27.2015.12.05.08.57.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 05 Dec 2015 08:57:19 -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 v5 07/11] spi: imx: defer spi initialization, if DMA engine is Date: Sat, 5 Dec 2015 17:57:05 +0100 Message-Id: <1449334629-4715-8-git-send-email-anton.bondarenko.sama@gmail.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1449334629-4715-1-git-send-email-anton.bondarenko.sama@gmail.com> References: <1449334629-4715-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 277dd75..fa24637 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1221,6 +1221,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);