From patchwork Sun Sep 24 09:04:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Perttunen X-Patchwork-Id: 817880 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="qsCqQsUU"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3y0Lwl4vgFz9tX7 for ; Sun, 24 Sep 2017 19:08:23 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751890AbdIXJIU (ORCPT ); Sun, 24 Sep 2017 05:08:20 -0400 Received: from mail.kapsi.fi ([91.232.154.25]:36380 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751630AbdIXJIT (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=Message-Id:Date:Subject:Cc:To:From; bh=eKvORQMAbVZ94jB5SdEoG/uk9yph1sIgHSKxSWoOIAk=; b=qsCqQsUUhTf9Dt6+mYyBh9NHbq5JxdxyfuTyHx+fNVpm7QA5pEWmJ9WrFhmLb0XECtzOB28KcrDI+RcFeDyxx79fQ4g9VAhJybYpOskbU5grtdUyqWH7gntRsQ2SfXCejnghxa5bZR/1i9oUJNJ6jqbnWEKDtzJpaCfCcBWCSwVJ1IpOMGHkHNAgfchC+/dEnA0zTx3Q8SQVyw0Dni9gh7sPoTP0Y5oZChCkMUX+mdREmuNRJnO0yb8iBxAKlREiIGvQ8lhfVYY0T4WMMKT8ghn/lGgDkLJbRl/tiZgLT+n15548eBIYv7sfF+EMdaDNnEGcNmTJA9dSJRIsvHzAuQ==; 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-R2; 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 1/2] gpu: host1x: Call of_dma_configure after setting bus Date: Sun, 24 Sep 2017 12:04:53 +0300 Message-Id: <20170924090454.28116-1-mperttunen@nvidia.com> X-Mailer: git-send-email 2.14.1 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 of_dma_configure now checks the device's bus before configuring it, so we need to set the device's bus before calling. Signed-off-by: Mikko Perttunen --- drivers/gpu/host1x/bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c index f9cde03030fd..66ea5acee820 100644 --- a/drivers/gpu/host1x/bus.c +++ b/drivers/gpu/host1x/bus.c @@ -403,12 +403,13 @@ static int host1x_device_add(struct host1x *host1x, device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask; device->dev.dma_mask = &device->dev.coherent_dma_mask; dev_set_name(&device->dev, "%s", driver->driver.name); - of_dma_configure(&device->dev, host1x->dev->of_node); device->dev.release = host1x_device_release; device->dev.of_node = host1x->dev->of_node; device->dev.bus = &host1x_bus_type; device->dev.parent = host1x->dev; + of_dma_configure(&device->dev, host1x->dev->of_node); + err = host1x_device_parse_dt(device, driver); if (err < 0) { kfree(device); 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;