Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1852359lqo; Sun, 19 May 2024 01:31:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUaQuSsid9ieXXYxseUujwcrBpKpMIXc8mL9uaG/fchOe4+Mf1CsOf7GI5a6eLW2RfVvj5cPqfhtWNM5ahXEyoEctKjr2RcWwhlz0b0QA== X-Google-Smtp-Source: AGHT+IH58bO8B2m6u/kcGxSH7o8p09cFruRMqcVo200y7lg6Si16VjiD7Tda0TEyAXwwXm3YacA8 X-Received: by 2002:a05:6214:43c3:b0:6a9:452b:196a with SMTP id 6a1803df08f44-6a9452b1b40mr23997116d6.41.1716107479416; Sun, 19 May 2024 01:31:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716107479; cv=pass; d=google.com; s=arc-20160816; b=mvDCjIj1aQj6f122eNcGUDpjVLA9rv2G3BcdKyEeMiWQMH87EGXLc5GaxANcYfAdG2 goCEdEIllGymf/0gCE7fKuqpA52ebfCU015SMynIDZLQgkTNjgkMto2UycmI5BG2fYtw xQbQQ9jfqvzCtW0Sp66mzUvowIZ6FKnVEqP+btsqyFtOHmhbcPJ6gyf3QOerk8PCfcGd S6X0xeGht2tgy/+YgxTihMwxIySSCgW7hYn69TpRJ1N3JCUCJi/CJILjlAaLBLe14jzn W0x7EIg10ESUT9sOQzw/JZOtjov4mwxHkwkGKQ6EmlbgpaIQJYz0r/n6RlKXkudUuPE5 eDWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=O3x30n4rUJq1+J/cwi02KSucHGfHRmh38wGSJ7vLBLs=; fh=HxqV7Q1rucBwLslK4phdhf8LkcJnYzEYQ8Z6pQCbziw=; b=HuRziDwDHPqjGog6ubm+ai3INTaZkW9xGcF4ZXfORNaTLy7n+/dGtwDZ9WnCZUvVUm HG2L8CT9AUOCJR1AjNeEvf2V6oNjlNYYdZq05+FIpPbZ/H4b/FhLG6JBcw5+i1s7Qhp1 mBpwH8vxxYgAMWmEXd4lwTW6kmFwyitbvk+EsjRQhIZ4IT7sTUxGY5pypBZsvQbR3O6q F+/diE5OsQqzhgSMRBsLMfg+xlsnl0XgfRXQAMXRk89Xif/g1JzR2a5512u1xabQTfG4 WPqVQ5FmUnjVBspzYmHO6vGXBktbbsiYAo95Z3Pdl9NzGMGWnRtFISPOXAb7NJAYe8Vd 3jsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="KI/GbEZN"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-183061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a836b26078si5755776d6.533.2024.05.19.01.31.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:31:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="KI/GbEZN"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-183061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 283141C209E9 for ; Sun, 19 May 2024 08:31:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF51218C38; Sun, 19 May 2024 08:31:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KI/GbEZN" Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B2EF168DC for ; Sun, 19 May 2024 08:31:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716107473; cv=none; b=X3GDEZxecwwUnxD9yRQ6i4RhwDkofbdDB+Q1yiyQ4doZGaGovNihUlzQRGTj9p4CAkGAxzWNlDl111+hSwyGgegLpsAfNlhlgZs+vTCYC4HBkMnxu+/ViZjwnssJlL8MQCm+DeUZKQohJVDKmR5tbjSzBM83EQQwLLtEX18kE8k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716107473; c=relaxed/simple; bh=F0LBOMZDJVE+xbmnqDNWkHm61GJlkhpnSs7Nz8Y6szM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MI+BZmR4vMqqLxHjFZD6oB5gmSIVLYIE4dbLZMUnOOkBL6OopiZtl5fUFIuYAJB7XHBuVm6GlcArjvGWqs1NMicueGLUoE/EKx1xQsWw9ghpUOkugSZkiNvpLnnmpSoGGGJIu+KikScUs1S7jPKaIW0+AEUcrPRCG8CM+o+nYF0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=KI/GbEZN; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-523b017a5c6so5032592e87.1 for ; Sun, 19 May 2024 01:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716107470; x=1716712270; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=O3x30n4rUJq1+J/cwi02KSucHGfHRmh38wGSJ7vLBLs=; b=KI/GbEZNVrWmHAg32qInwZeg6owzZBa02pGKm9eYRhtJhowuJo2YrVtPpIE8ijNdAZ M0p0WOnATQ8vwmYUaUpfRR9QkzIYHnHte1ULSMGSuRZnnszOFlOznwsXpVW1ptrcr9b9 D7Y9tsi2Np3Hnqd73HXG8BTj9ugh/9mFvlR9w3aC4ddFho70MkzVupnX6TWtVryl7JGS 8wmf6cqhaSF+a2ZJ2MoTvonjWq77XOjQcFUiDywUtTqhg02bzFNKUBcSsGjOLpGW/MbZ nW7SJHitmnJvp3qxP8cO+ORE8GF/j/sFCk4p5aXqasqfBnRssrGUzB94vHl0zD2rRcDh p+4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716107470; x=1716712270; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=O3x30n4rUJq1+J/cwi02KSucHGfHRmh38wGSJ7vLBLs=; b=VBDHZrLSQl0Oe2HoUiClidmlGnpEM0KuNwxSbXSYtprwCjTgABXFAc2HETYlocqPhL 9z6zU4ZOYUkgo0Y4dlAF2asIrXwEGY8FWv3i4Dvv+oB3JbQZ2TT6OZALQQzp5YQPK+KO /Sv4oNgopTT9WPmr/0dUrOIz3ZZVVOOlfzYXOF650QVwJbJFmUBdbj7PXUtchF6BvZkG 7CMeaODH64q5rtqoS+KIOhNK5iYy6yYrxl1FqmmuWYeh7i9QX+d6PkxGNRCmVt7KcIkx 5kyH3tLc2wjAKXJrIY0bbZdHO0vkDIvAZy1DASKejTmLMyvKkDd0EwHMmJUoNc1611Pu vIFw== X-Forwarded-Encrypted: i=1; AJvYcCVVOXh12ZKeBEOloEb8bz0G13Knxqc1+Sl165pllib80ThA4L/FJlID+yQSqIjf8bN/h622FlZlWoO9LfoMiTIeDjVOk81JU0oZEI21 X-Gm-Message-State: AOJu0YxDPvyIY4q1nAPpk2PS8HCwDNdBtTDm1KokjqVYIYMffe2VLpQY 03GXYnjcGHBDmLjphZcj0VJvv8CFKbWhqjZ4sJlE57pSI99ODYXs1UYMU5OWjsE= X-Received: by 2002:a05:6512:3e17:b0:51d:605e:f0ce with SMTP id 2adb3069b0e04-52210278698mr30114392e87.50.1716107470416; Sun, 19 May 2024 01:31:10 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzdbxzyyyyyyyyyyyykxt-3.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::227]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-521f35ba5d5sm3779923e87.77.2024.05.19.01.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:31:10 -0700 (PDT) Date: Sun, 19 May 2024 11:31:08 +0300 From: Dmitry Baryshkov To: Abhinav Kumar Cc: freedreno@lists.freedesktop.org, Rob Clark , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, seanpaul@chromium.org, swboyd@chromium.org, dianders@chromium.org, quic_jesszhan@quicinc.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/4] drm/msm: register a fault handler for display mmu faults Message-ID: References: <20240517233801.4071868-1-quic_abhinavk@quicinc.com> <20240517233801.4071868-2-quic_abhinavk@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240517233801.4071868-2-quic_abhinavk@quicinc.com> On Fri, May 17, 2024 at 04:37:56PM -0700, Abhinav Kumar wrote: > In preparation to register a iommu fault handler for display > related modules, register a fault handler for the backing > mmu object of msm_kms. > > Currently, the fault handler only captures the display snapshot > but we can expand this later if more information needs to be > added to debug display mmu faults. > > Signed-off-by: Abhinav Kumar > --- > drivers/gpu/drm/msm/msm_kms.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/drivers/gpu/drm/msm/msm_kms.c b/drivers/gpu/drm/msm/msm_kms.c > index af6a6fcb1173..62c8e6163e81 100644 > --- a/drivers/gpu/drm/msm/msm_kms.c > +++ b/drivers/gpu/drm/msm/msm_kms.c > @@ -200,6 +200,28 @@ struct msm_gem_address_space *msm_kms_init_aspace(struct drm_device *dev) > return aspace; > } > > +static int msm_kms_fault_handler(void *arg, unsigned long iova, int flags, void *data) > +{ > + struct msm_kms *kms = arg; > + struct msm_disp_state *state; > + int ret; > + > + ret = mutex_lock_interruptible(&kms->dump_mutex); > + if (ret) > + return ret; > + > + state = msm_disp_snapshot_state_sync(kms); > + > + mutex_unlock(&kms->dump_mutex); > + > + if (IS_ERR(state)) { > + DRM_DEV_ERROR(kms->dev->dev, "failed to capture snapshot\n"); > + return PTR_ERR(state); > + } > + > + return 0; > +} > + > void msm_drm_kms_uninit(struct device *dev) > { > struct platform_device *pdev = to_platform_device(dev); > @@ -261,6 +283,9 @@ int msm_drm_kms_init(struct device *dev, const struct drm_driver *drv) > goto err_msm_uninit; > } > > + if (kms->aspace) > + msm_mmu_set_fault_handler(kms->aspace->mmu, kms, msm_kms_fault_handler); > + Can we move this to msm_kms_init_aspace() instead of checking for kms->aspace? > drm_helper_move_panel_connectors_to_head(ddev); > > drm_for_each_crtc(crtc, ddev) { > -- > 2.44.0 > -- With best wishes Dmitry