Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1087884ybt; Wed, 1 Jul 2020 18:35:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlLWZnL2RTp3WIeZAZyYnp2A9o7CDLpfeHnnO5Ore3gbrx2xtp/hs0U9vyqQacvwbSH3/4 X-Received: by 2002:a17:906:7250:: with SMTP id n16mr17232351ejk.290.1593653701754; Wed, 01 Jul 2020 18:35:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593653701; cv=none; d=google.com; s=arc-20160816; b=BZhGcsvIkBmiOA9DRyCnAlR4xQgobaWKQAufm0hRkqxc9+MixUjfVwsYsJjcmOc1pr EevT12+rcvxqIP+wV823I9PMWTApEtZ0CzVt4Cjki1BGEy4XJcF/hqlzLCOHHKQEc3Xi d4x8LrgIK9jQijnPV64nq7NEkkxeRvK/oztWpDH0HHNfYKZCW9lrJ0mrRh8zV4pZl+e5 /EhZz91gjS/ZSc2VGd10x+TAR9d5W0M1A5Yu4G71FzrxLnNRwRs4LidMK0PbiMjPaMOD wWrscOK9Ecw5bdC+mh0wpXUGAinfFiENdw0oTnXFu/mbyof/gJsRzAtYlPPARZBU9+kX rO2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XzBIN8Q8u0PmTTgKvgXY5tgy5s/IgRsACUf3sQePz0A=; b=I9j6MiH6aBrznf7NgBhymhwcI8ASL+yxmbj9w53yu4UmRVDsVuJnE01c++1rqW/EmD 7oE0pzMH2cgJgdiIxgKuey+UWqyd5dv8NA4Sx9HtFOUSP2/97ewJ/zO7304gNja6gPqW rxNu/xnVYoDGZ0VqDG13cKLUZYcLH+h85IWYG3oAmEN1Zvw2+Cp6CXyHCLwocSgVFzxx G8eABz64wXSlGHRzAleFXaHifTxNJ7UIt29PEoHkcfQoi5ON/R57XnybEog67LgUMrmX XkVM6IPjW4J3rgnQylyKxjlDDfF0XCOR7Rxqwqeogt7s/ApPGgmRahspOjz++C7Lsc0t GFcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=heD5aE2f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e20si4800736edy.5.2020.07.01.18.34.38; Wed, 01 Jul 2020 18:35:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=heD5aE2f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728812AbgGBBZc (ORCPT + 99 others); Wed, 1 Jul 2020 21:25:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:54400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728450AbgGBBXn (ORCPT ); Wed, 1 Jul 2020 21:23:43 -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 A4DB52082F; Thu, 2 Jul 2020 01:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593653022; bh=3ku+PiRpae9Jp7+rrfv+SYcIAqrcFJfFgtBJfoDHm7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=heD5aE2fAswYC8ttjnyGyuMkU8MLAZJvyQMWGL1rThusub83f2COfL60q9IC3O96F TM31FeFmgqDBhMgWx7BWOQ9pGdmxNO035u6TGpJScJGUVLFGY1E2vf7L3w/AnBu/wO vhHvlPai6Ydcfn5ievT45oSMb02YbmvIkfKYldKs= 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 5.7 38/53] drm/sun4i: mixer: Call of_dma_configure if there's an IOMMU Date: Wed, 1 Jul 2020 21:21:47 -0400 Message-Id: <20200702012202.2700645-38-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200702012202.2700645-1-sashal@kernel.org> References: <20200702012202.2700645-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 4a64f7ae437a8..19b3b41847046 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -452,6 +452,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