Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5046254pxj; Wed, 26 May 2021 01:14:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3lpSwsmIzEvGJ/STRWjMeQAxz/kCPKrl2X53bVeXAPjrgERD1o4i2w3aDcKRlve0omTk8 X-Received: by 2002:a05:6638:38a8:: with SMTP id b40mr1921612jav.37.1622016855590; Wed, 26 May 2021 01:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622016855; cv=none; d=google.com; s=arc-20160816; b=PyUwJNEU973bzz5lGTXPQrgAMhNPipScVndYezzupa2fUP168wsG1MS+6YiyagNZq2 AlTXK2en2jiwfUS3s60DKSRdP3MBOaNrBss13AvhWR4VtS5dKvdJmzOAisD2+eNbWZCM 0GGRc2ty3z/P+bo+QlESJHWm3rESMq2rpotzvX+47ljaqodN67SQgpROQXvYYsFqxgMJ uKAtxGNY9+MkgOoCXW69L8tWAdkXdaPiWZKcHcUj1G2ta5Jh1h8xbfaU6AZwZKx2p+oI 4qdSHloe5aW86UQTS4OLsJeoHVJ60N//wwFbdOKft74GPQKhTPiU4rcrxR+7vZbFBw9l NgsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=yVcIsLaop0xFTxRezXJ3MSLuEhLYr+XKBNJbxOwir5s=; b=tX4gaeg8hBYEJMWk1xmsKkIXd+tG2BC2C7bOdEMR75vZo+zZAKd2+lOmRcSPLL/rl3 Y4UCavbvL6kd/4hfW/OW8Y+0C7lsqANOlOapSC/G9zInHh+7cVqtV/Ctk7vSLClzxFOP zMSx0dXPjHFKzYmSJ2DahIKvWJ9ojo8oK0+PgeX8er4b7Bhq70AUx1Rsex7hT0RSWQuh aU1Tcqbuj2SCUDW+ZAa2assZb+501CnB1C8F9NKpwbIhua26fqPkntLXPZuyZDO52YFz MKjnpLdEJAFkUB9fvW9mbtkF8iSUPt2zZ+zBFMkRNdMifkxCUPvLXkU9F8MwfN3VniVW sO5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WYbaBVSv; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d20si21704613jak.40.2021.05.26.01.13.59; Wed, 26 May 2021 01:14:15 -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=@gmail.com header.s=20161025 header.b=WYbaBVSv; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232166AbhEZIKF (ORCPT + 99 others); Wed, 26 May 2021 04:10:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230384AbhEZIKC (ORCPT ); Wed, 26 May 2021 04:10:02 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A709C061574; Wed, 26 May 2021 01:08:29 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id p7so51859wru.10; Wed, 26 May 2021 01:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=yVcIsLaop0xFTxRezXJ3MSLuEhLYr+XKBNJbxOwir5s=; b=WYbaBVSv16q5MTWMzaif39kIsCho53bHWXwf9Z/KMlYAAxCZtALxyQhWH7Gg2eWYd7 6nIhK9oO6tCBAo0juIZBBzEjU9QtK64YV6Azt2YNR9VGCRWQx1lrkX9agrTnGVlRgrm9 2L0hOPcam6w7yvn7vfkiNshrSVNvUNPYw5tRd5UvKNQ/eTdNhO+UIPFdy+wzBGHK1zKf pMBmBj8Fmq6Z1i1B19jl3skq2f//GGGJ/dFr5YkSnFvA9pyH6H2NjU+/QFvFSDZCmawD wMYJ3tL5Sz1ifLpT2cbzTnLzdnoLMICiKJIRQx7o6Yx9zM4Ppfa9XTfAy/B9Wrg5bNqN Uy7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=yVcIsLaop0xFTxRezXJ3MSLuEhLYr+XKBNJbxOwir5s=; b=nxwLYRmO+fqiP2A8DZkLXZUdasGEQr9frxieSS9BDTP0v5V+BjwnD+7d9dTyXzqEcm d/ELzvUQIVePsM2lCeA5e0b0a7iP+VIsuwt65ghupY5CKCvjV/LqWqJcJGem2sjFyNu4 omItGAGwL9wx4J/W0Gz1I2GhtMFKuNl+NQhV2No5vQTYv5PsbEjM634O/NljT2noF6NR 94hH+uhp3xzfOLIbVhzXQ5DGQC+5nq7jGTMu1gfX5NC7UX5nrazpqr9dQ8LvsuefgULT 99TxQwaNoTAarwfC5wCK07U8eeGrZd2DX0b1rIVz9emAcLDohREKa5QyvCH7vW8iPI8h w1YA== X-Gm-Message-State: AOAM531BhTgFXHSkKGbuB89JYpzmjZJZHpE1ogseCM8F8pQ+hbK0IziO ZfTTOXSuNcV3v0+jfBdtpUc4sPG7yvG/hFgqjKg= X-Received: by 2002:a5d:43cb:: with SMTP id v11mr1351884wrr.198.1622016508091; Wed, 26 May 2021 01:08:28 -0700 (PDT) MIME-Version: 1.0 References: <20210425123607.26537-1-kevin3.tang@gmail.com> <20210425123607.26537-5-kevin3.tang@gmail.com> <20210430092249.n75to2das5m6p4zb@gilmour> In-Reply-To: From: Chunyan Zhang Date: Wed, 26 May 2021 16:07:51 +0800 Message-ID: Subject: Re: [PATCH v5 4/6] drm/sprd: add Unisoc's drm display controller driver To: Robin Murphy Cc: Joerg Roedel , Kevin Tang , Maxime Ripard , Maarten Lankhorst , Sean Paul , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Orson Zhai , "Linux-Kernel@Vger. Kernel. Org" , ML dri-devel , DTML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org resend for switching to plain text mode. On Wed, 26 May 2021 at 15:59, Chunyan Zhang wrote: > > Hi Robin, > > On Tue, 18 May 2021 at 00:35, Robin Murphy wrote: >> >> On 2021-05-17 10:27, Joerg Roedel wrote: >> > On Fri, Apr 30, 2021 at 08:20:10PM +0800, Kevin Tang wrote: >> >> Cc Robin & Joerg >> > >> > This is just some GPU internal MMU being used here, it seems. It doesn= 't >> > use the IOMMU core code, so no Ack needed from the IOMMU side. >> >> Except the actual MMU being used is drivers/iommu/sprd_iommu.c - this is > > Yes, it is using drivers/iommu/sprd_iommu.c. > >> >> >> just the display driver poking directly at the interrupt registers of >> its associated IOMMU instance. > > > Actually the display driver is poking its own interrupt registers in whic= h some interrupts are caused by using IOMMU, others are purely its own ones= : > +/* Interrupt control & status bits */ > +#define BIT_DPU_INT_DONE BIT(0) > +#define BIT_DPU_INT_TE BIT(1) > +#define BIT_DPU_INT_ERR BIT(2) > +#define BIT_DPU_INT_UPDATE_DONE BIT(4) > +#define BIT_DPU_INT_VSYNC BIT(5) > +#define BIT_DPU_INT_MMU_VAOR_RD BIT(16) > +#define BIT_DPU_INT_MMU_VAOR_WR BIT(17) > +#define BIT_DPU_INT_MMU_INV_RD BIT(18) > +#define BIT_DPU_INT_MMU_INV_WR BIT(19) > > From what I see in the product code, along with the information my collea= gues told me, these _INT_MMU_ interrupts only need to be dealt with by clie= nt devices(i.e. display). IOMMU doesn't even have the INT_STS register for = some early products which we're trying to support in the mainstream kernel. > >> >> I still think this is wrong, and that it >> should be treated as a shared interrupt, with the IOMMU driver handling >> its own registers and reporting to the client through the standard >> report_iommu_fault() API, especially since there are apparently more >> blocks using these IOMMU instances than just the display. > > For the next generation IOMMU, we will handle interrupts in IOMMU drivers= like you say here. > But like I explained above, we have to leave interrupt handling in the cl= ient device driver since the IOMMU we 're using in this display device does= n't have an INT_STS register in the IOMMU register range. > > Thanks for the review, > Chunyan > >> >> Robin.