Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp106349ybh; Tue, 14 Jul 2020 19:32:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYOHCtK8KS3PtGPhOToRDGEuDnc+7NxwQ7GPMn8XBqVdkwFDejCTPFoevjN4jufywc+hfA X-Received: by 2002:a50:e883:: with SMTP id f3mr7594715edn.220.1594780324495; Tue, 14 Jul 2020 19:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594780324; cv=none; d=google.com; s=arc-20160816; b=J1IhOLBgoC6G5eS4L6gS9BQpz02lECfj6kAPcUNLXd1pj2EMsX9XUlvKurNM9hPuYo YX13h6jfK8Wv/RxNORrd/8PeI1WyFHybCz5qSMQSUjG5OMzHqnANHFm9Q5s6WpQSbvZU wFYPUjbz1TKM1mU9IaY2xvK7vcNMj0hAsWg6YlgHV4P1z+Xxk9E48BC0XASvlNWEMHnS hKMKPQeFoAMTIISwVQN3PTKvVAvvXKBK6rcw4vnH8Cxp5JUxOeK6+aH+g+i3S3SGUL53 ELyDbhcmbObH1WE5UCdNq9j7DBHVctTEUNZjytyHAJIMAhpmjhaKewWTgzJJOpFCAYTA HkWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MjrLJnsax506wEAwX9IEqajhmE3FVs7rpkjIizoVOr4=; b=OFgwiVgtqDdwK+ztVc8t40HzgvP5Fr6I0EhiGPviavuyQLSijHovs+H+byKxvR2ZZy 9tIZ4WZZshHe9neUPD+yeGL8AlV5M2q83oRoMZJ77fIZ4INGcifTkJB0Xytsa90I9A3Z /yKjkMnQOi3humIUC9U6U//SJgV1ZSLv/ufGoLBpuOygLnvvVknX0mWW5kbpnk3hbYzI 70XvMy8DBLBWpQRiKhMjidcqyA/sGrJlOy+gU170uEakluxgZNFxoZMHndTzSVYCxo60 r3tAdeaiAobIYDP6NZ9MydIoMO9rPyAWoeqhS/RoRfDFPYa2SC0BASmjSg77LUBwkgl9 UsmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RmuNG9E7; 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 dc22si450677ejb.317.2020.07.14.19.31.41; Tue, 14 Jul 2020 19:32:04 -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=RmuNG9E7; 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 S1728097AbgGOCW1 (ORCPT + 99 others); Tue, 14 Jul 2020 22:22:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:55692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726458AbgGOCW0 (ORCPT ); Tue, 14 Jul 2020 22:22:26 -0400 Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 8FEC220729; Wed, 15 Jul 2020 02:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594779745; bh=c4adXwgTz9+ULV0x1H07n31CpFW3Edu+uF+WF0+7G9c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RmuNG9E7sSX4nRDZbRLxTevXtFu/bIOq03QJKfFuVBIO7XnxDNP94KFf+qM8bT4WK j/fuHFx6wkd8kst4Y6b4xD4w8mg8DOsxn1JIRT+OC2wJX+qJUlzQLvyxneFzq/elTs DZPNJSSV110zvBjvyjBN71PShvY2BsXkcLrjLyTs= Received: by mail-lj1-f178.google.com with SMTP id e4so831551ljn.4; Tue, 14 Jul 2020 19:22:25 -0700 (PDT) X-Gm-Message-State: AOAM533edfqQm05gs4QWglCwoldo0kiaUuaza/Si/iPU/aN+/spoPLd3 Umf7lDAPnk0mJUtgsFGR7yKDY1b65VI5/IEJZ+I= X-Received: by 2002:a2e:3a14:: with SMTP id h20mr3363025lja.331.1594779743917; Tue, 14 Jul 2020 19:22:23 -0700 (PDT) MIME-Version: 1.0 References: <20200714184105.507384017@linuxfoundation.org> <20200714184106.782410654@linuxfoundation.org> In-Reply-To: <20200714184106.782410654@linuxfoundation.org> From: Chen-Yu Tsai Date: Wed, 15 Jul 2020 10:22:13 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 5.4 026/109] drm/sun4i: mixer: Call of_dma_configure if theres an IOMMU To: Greg Kroah-Hartman Cc: linux-kernel , stable , Paul Kocialkowski , Maxime Ripard , Sasha Levin Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, On Wed, Jul 15, 2020 at 3:11 AM Greg Kroah-Hartman wrote: > > 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. The iommu driver and DT changes were added in v5.8-rc1. IMO There is no point in backporting this patch to any stable kernel. ChenYu > 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 18b4881f44814..e24f225d80f1f 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 > > >