From patchwork Sun Sep 24 09:04:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Perttunen X-Patchwork-Id: 817881 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; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=kapsi.fi header.i=@kapsi.fi header.b="JDmBisrc"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3y0Lwq1Sc5z9tXL for ; Sun, 24 Sep 2017 19:08:27 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751868AbdIXJIW (ORCPT ); Sun, 24 Sep 2017 05:08:22 -0400 Received: from mail.kapsi.fi ([91.232.154.25]:52043 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797AbdIXJIT (ORCPT ); Sun, 24 Sep 2017 05:08:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=2BLY4ljMJsNO1CSTKTRhHR+EqMWr0NfVSgwJqph77F4=; b=JDmBisrcElrls/ByrFfwqAXgDMkJlz5GwsdGY8D1ERR3we479+9/RNk1xPgfFBkYUK94vc7qF2akxLeDGDV3LwAtOVQFXzmIKkKh6sG5+PEinp+/ZYqySm2Taitln+wyH5pGJjR2xI8YrV2+B9SHdk1As6R9tiNR8ZGN81PNzNoIcIuC/HYmCKSIYwEbfYeRzFAZtBdgQjiAhdUvx/npOq6IzijKIp+WE9o+A4zSQyfJv+zW/haFunQ2pSKW+s3Ui6SIIcEfNlxp191LZbMkfET+zbAzKKisTy4Sy7C0AQsVaiVQybZ5vK1akOPnv+AoH9u9h0NCzroS9hmztDDs6w==; Received: from dsl-hkibng22-54f983-249.dhcp.inet.fi ([84.249.131.249] helo=localhost.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1dw2tV-0005sr-Tv; Sun, 24 Sep 2017 12:08:09 +0300 From: Mikko Perttunen To: thierry.reding@gmail.com, jonathanh@nvidia.com, hch@lst.de, robin.murphy@arm.com, robh@kernel.org Cc: devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mikko Perttunen Subject: [PATCH 2/2] of: configure DMA for host1x devices Date: Sun, 24 Sep 2017 12:04:54 +0300 Message-Id: <20170924090454.28116-2-mperttunen@nvidia.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170924090454.28116-1-mperttunen@nvidia.com> References: <20170924090454.28116-1-mperttunen@nvidia.com> X-SA-Exim-Connect-IP: 84.249.131.249 X-SA-Exim-Mail-From: mperttunen@nvidia.com X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Devices in the host1x bus rely on the old behavior of of_dma_configure to set up DMA ops. Add a check for them into of_dma_configure. We must do the check using a string comparison instead of using pointers since the host1x bus can be compiled into a module. Fixes: 723288836628 ("of: restrict DMA configuration") Signed-off-by: Mikko Perttunen Signed-off-by: Robin Murphy Acked-by: Thierry Reding Acked-by: Rob Herring --- drivers/of/device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/of/device.c b/drivers/of/device.c index 64b710265d39..12368418cd33 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -104,6 +104,9 @@ int of_dma_configure(struct device *dev, struct device_node *np) if (!dev_is_pci(dev) && #ifdef CONFIG_ARM_AMBA dev->bus != &amba_bustype && +#endif +#if IS_ENABLED(CONFIG_TEGRA_HOST1X) + !(dev->bus && !strcmp("host1x", dev->bus->name)) && #endif dev->bus != &platform_bus_type) return ret == -ENODEV ? 0 : ret;