From patchwork Fri May 19 14:20:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 9737379 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E364D6034C for ; Fri, 19 May 2017 14:20:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E814B288F1 for ; Fri, 19 May 2017 14:20:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB21E28911; Fri, 19 May 2017 14:20:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57659288F1 for ; Fri, 19 May 2017 14:20:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751687AbdESOUt (ORCPT ); Fri, 19 May 2017 10:20:49 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:35190 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751472AbdESOUs (ORCPT ); Fri, 19 May 2017 10:20:48 -0400 Received: by mail-wm0-f49.google.com with SMTP id b84so237472996wmh.0 for ; Fri, 19 May 2017 07:20:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=D064zQ1QC4PReOPkEIgNhyGpmjsbrtU2ZX6+ymKq0ac=; b=1EpZ1X+aOX8/qPJ15UJwXhwkIOOGckzAcRP9JWUuVAYsu/cgqrAnde7EjOhzOE4iyV +rA3cacsQw/Ukg+LWFDcyG0pcGB7v6pV6wnBiYTWSkey3fVcwPx2lulGVZw/kFhuj+dO YRMo9sIeBPzCyRwG5a8qpxLw4AR8RqOlhxPcy6GzXWG0G/+RxCh010cNyFAtl0kq0aOE datvzAFkg+IPqn07a7xtWw4jEPSFlvfkEFR53Hk/XvYqQ0AsAodW2/z8/2mUZ8NMaKUc jqZUQHY2cIg33FpSLKfQyWeAP4USRg6FJja+bZnn1QS4xtmaJZ9CMAS+UgUtjMfkbu8H blYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=D064zQ1QC4PReOPkEIgNhyGpmjsbrtU2ZX6+ymKq0ac=; b=Tat+WWsdyuhYQcRCY6iDqJtUxRF1VUKRc4Tg60ATiGo31YgAGjHNIo/9DvPD7Tt4dj cpBoNb7OGHVLt1K5liaPdn5HrnIUsNdklst0k+cZUH5/vdRtfAmSSB03cnUZG0cIr0HM UQ7KmrLveQ2fUky5SdeMKSvSkWhTcmuQEFJVItPYBeLjOvgAK/gdVoEovMgaDLSt2wm1 9YsJy6z7wfHt6vEVfgRvLes2njhz5FSw0d7M07SBZcDbqG155XMIsia+LDY75UKLuBqW 1StTuxosESDgpjs1Rwat7p3xVL/dcEOh0A3Lx36ZSHPtylSDpy1Bnd95cN4mwaw+ySgL +KKA== X-Gm-Message-State: AODbwcB85L4Dsphg1mCQZMh3340avjFEoxDxev84aLJTVJbR8UjBoLZK ZtLBnmrRkYi6Mtcu X-Received: by 10.28.217.1 with SMTP id q1mr14981834wmg.23.1495203647426; Fri, 19 May 2017 07:20:47 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id f70sm14813097wmd.25.2017.05.19.07.20.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 May 2017 07:20:46 -0700 (PDT) From: Alexandre Bailon To: b-liu@ti.com Cc: linux-usb@vger.kernel.org, nsekhar@ti.com, ptitiano@baylibre.com, sergei.shtylyov@cogentembedded.com, linux-omap@vger.kernel.org, johan@kernel.org, Alexandre Bailon Subject: [PATCH v4] usb: musb: musb_cppi41: Defer probe only if DMA is not ready Date: Fri, 19 May 2017 16:20:35 +0200 Message-Id: <20170519142035.8341-1-abailon@baylibre.com> X-Mailer: git-send-email 2.10.2 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If dma_request_slave_channel() failed to return a channel, then the driver will print an error and request to defer probe, regardless of the cause of the failure. Defer if the DMA is not ready yet otherwise print an error. Signed-off-by: Alexandre Bailon Reviewed-by: Johan Hovold --- drivers/usb/musb/musb_cppi41.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index e7c8b1b..ba25528 100644 --- a/drivers/usb/musb/musb_cppi41.c +++ b/drivers/usb/musb/musb_cppi41.c @@ -673,12 +673,15 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller) musb_dma->status = MUSB_DMA_STATUS_FREE; musb_dma->max_len = SZ_4M; - dc = dma_request_slave_channel(dev->parent, str); - if (!dc) { - dev_err(dev, "Failed to request %s.\n", str); - ret = -EPROBE_DEFER; + dc = dma_request_chan(dev->parent, str); + if (IS_ERR(dc)) { + ret = PTR_ERR(dc); + if (ret != -EPROBE_DEFER) + dev_err(dev, "Failed to request %s: %d.\n", + str, ret); goto err; } + cppi41_channel->dc = dc; } return 0;