From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C0D5C433E0 for ; Thu, 2 Jul 2020 01:29:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07C8620748 for ; Thu, 2 Jul 2020 01:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593653382; bh=pieAcDd6bFTdpg6107qY4pEzKvJ8WHGm9bg/hlipDIk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xELhKZHXB/zWJi/g2DTZCtKIw925x6R/uqI/RqC1j4YAlPSJDJqKUAYt4by9PNl/F KeRUcETBVHhL0XE5CQTw3fcMeKi+xIU713wWmfZPdpQCb8kwbDpqRby4T8zmGp3/q4 91S0r/ahlXGGDaGECWkywLGZ5Lka2QfX0g1+ze3U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728158AbgGBB1O (ORCPT ); Wed, 1 Jul 2020 21:27:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:58110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729224AbgGBB0j (ORCPT ); Wed, 1 Jul 2020 21:26:39 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 749A6206BE; Thu, 2 Jul 2020 01:26:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593653199; bh=pieAcDd6bFTdpg6107qY4pEzKvJ8WHGm9bg/hlipDIk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vb0rvzjkqHReTRN1tzUb9l0nfN27TtW9SdWVMNpmukqApFkH8x9rh73hHcVVa99Np a/VfaeIlT4AjMv2sN7zctxNuHFjQPGPe5kP0q8eWP3CiAt7kkks/XR9xQ9VSqEINZl t+ja/N9gNn4lSMKBVZn/entD8SVrWwJx0eU+Up6s= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Maxime Ripard , Paul Kocialkowski , Sasha Levin , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 4.19 19/27] drm/sun4i: mixer: Call of_dma_configure if there's an IOMMU Date: Wed, 1 Jul 2020 21:26:07 -0400 Message-Id: <20200702012615.2701532-19-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200702012615.2701532-1-sashal@kernel.org> References: <20200702012615.2701532-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxime Ripard [ Upstream commit 842ec61f4006a6477a9deaedd69131e9f46e4cb5 ] The main DRM device is actually a virtual device so it doesn't have the iommus property, which is instead on the DMA masters, in this case the mixers. Add a call to of_dma_configure with the mixers DT node but on the DRM virtual device to configure it in the same way than the mixers. Reviewed-by: Paul Kocialkowski Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/9a4daf438dd3f2fe07afb23688bfb793a0613d7d.1589378833.git-series.maxime@cerno.tech (cherry picked from commit b718102dbdfd0285ad559687a30e27cc9124e592) [Maxime: Applied to -fixes since it missed the merge window and display is broken without it] Signed-off-by: Maxime Ripard Signed-off-by: Sasha Levin --- drivers/gpu/drm/sun4i/sun8i_mixer.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 71a798e5d5591..ddab3fab36a1a 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -435,6 +435,19 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master, mixer->engine.ops = &sun8i_engine_ops; mixer->engine.node = dev->of_node; + if (of_find_property(dev->of_node, "iommus", NULL)) { + /* + * This assume we have the same DMA constraints for + * all our the mixers in our pipeline. This sounds + * bad, but it has always been the case for us, and + * DRM doesn't do per-device allocation either, so we + * would need to fix DRM first... + */ + ret = of_dma_configure(drm->dev, dev->of_node, true); + if (ret) + return ret; + } + /* * While this function can fail, we shouldn't do anything * if this happens. Some early DE2 DT entries don't provide -- 2.25.1