From patchwork Thu Feb 21 15:00:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 1046198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nvidia.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nvidia.com header.i=@nvidia.com header.b="coZjX2H+"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 444yMd2v4Nz9s7h for ; Fri, 22 Feb 2019 02:00:45 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726155AbfBUPAo (ORCPT ); Thu, 21 Feb 2019 10:00:44 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:14477 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbfBUPAo (ORCPT ); Thu, 21 Feb 2019 10:00:44 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 21 Feb 2019 07:00:49 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 21 Feb 2019 07:00:43 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 21 Feb 2019 07:00:43 -0800 Received: from HQMAIL102.nvidia.com (172.18.146.10) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 21 Feb 2019 15:00:43 +0000 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL102.nvidia.com (172.18.146.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 21 Feb 2019 15:00:43 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Thu, 21 Feb 2019 15:00:42 +0000 Received: from moonraker.nvidia.com (Not Verified[10.21.132.148]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7, 5, 8, 10121) id ; Thu, 21 Feb 2019 07:00:42 -0800 From: Jon Hunter To: Wolfram Sang , Laxman Dewangan , Thierry Reding CC: Sowjanya Komatineni , , , Jonathan Hunter Subject: [PATCH] i2c: tegra: Only display error messages if DMA setup fails Date: Thu, 21 Feb 2019 15:00:38 +0000 Message-ID: <1550761238-23974-1-git-send-email-jonathanh@nvidia.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1550761249; bh=xB5cSxwD7FDLqWKms2z/hoVUHpd9pxNv/JAa/tuX+AQ=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Type; b=coZjX2H+E7U3U7egg59O2aPEem6hYYcNW00LFprTWaBRhyloZQFaj3Qe1JsGWioSh YX/xvEVQXX1sbnpapU04E/Ql2O9TG2e6pfetC1fH2Qw19HZxmR63PWj2dix4R3JO++ 1L0UFzj1Y6do4vpa6ZErPUdiWZLr7AiL0VSJXeYDmzygPTKg0DTdAvGq+ae1wmBNoc FdT9HZav2AKqJT/ROe14Lx6lv2L9JSZrFu+iVlL+SZnZETJ+7+biccxD2koPSMlraV cUg4doFFn/JSkKSNWl9LEMK3k2Bv6Os4bWzpVHGfDIkXJh9/HQS8jV64rtqVZ8LQR+ uIn4BeACHTKTA== Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Jonathan Hunter Commit 86c92b9965ff ("i2c: tegra: Add DMA support") added DMA support to the Tegra I2C driver for Tegra devices that support the APB DMA controller. One side-effect of this change is that even for Tegra devices that do not have an APB DMA controller and hence, cannot support DMA tranfers for I2C transactions, the following error messages are still displayed ... ERR KERN tegra-i2c 31c0000.i2c: cannot use DMA: -19 ERR KERN tegra-i2c 31c0000.i2c: falling back to PIO There is no point displaying the above messages for devices that do not have an APB DMA controller and so fix this by returning from the tegra_i2c_init_dma() function if 'has_apb_dma' is not true. Furthermore, if CONFIG_TEGRA20_APB_DMA is not set, then rather than printing an error message, print an debug message as for whatever reason this could be intentional. Fixes: 86c92b9965ff ("i2c: tegra: Add DMA support") Signed-off-by: Jonathan Hunter Reviewed-by: Dmitry Osipenko Acked-by: Thierry Reding --- drivers/i2c/busses/i2c-tegra.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 31ff67015255..ebaa78d17d6e 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -414,10 +414,12 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev) dma_addr_t dma_phys; int err; - if (!IS_ENABLED(CONFIG_TEGRA20_APB_DMA) || - !i2c_dev->hw->has_apb_dma) { - err = -ENODEV; - goto err_out; + if (!i2c_dev->hw->has_apb_dma) + return 0; + + if (!IS_ENABLED(CONFIG_TEGRA20_APB_DMA)) { + dev_dbg(i2c_dev->dev, "Support for APB DMA not enabled!\n"); + return 0; } chan = dma_request_slave_channel_reason(i2c_dev->dev, "rx");