Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2848952lqo; Mon, 20 May 2024 21:12:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUkR5xiIGv5p31Nxp/krxg290mcB4tYIxX5hVXYeUrlfzLcxeMJm0snWQQO38bc97s8l45XrTmbcRBucTCAhlxAwLCXr1+LjLVC3zO42A== X-Google-Smtp-Source: AGHT+IGV6C1hH14Wq+M9uZs5eZ7XTuAX1rNhqvH7gAq7arsh0dvOcLLopvu2Invcb2zhZiInUs8C X-Received: by 2002:a05:6512:234f:b0:51f:2f5a:54ae with SMTP id 2adb3069b0e04-5220fc7c5e0mr35249438e87.7.1716264771275; Mon, 20 May 2024 21:12:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716264771; cv=pass; d=google.com; s=arc-20160816; b=I0hxaGO0Odb8uO6HaZnTYc4zZ0+x3byRiGkzIva1RYHbsDWSCRr4MeNOluMzBsRrOT OY9XVNyPhCWlql5KLU5Hb7mgSoJaKaoZkPwz/bo+LRwLo2njeKlCHqhcJlPHxuNZeQvJ k8GPqlv7BbG480MBTKQAbDBRvTH03AfTYUxZSEBjt541h+4eM8BRplwbqAqB/inzyXV+ 0NnEPalMXBjRHo7ga+HE1KWYlh+GM0WoxQph7eUvT8vS5lLkGpHmAsTljhIqpHMIxNRJ Wn/gpIJev98/TxEAW4xNnM7y8/FQ+6jehaj1IBfaN4k3b0XMYW2Czmywk2T0FmEoNe6g k/7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:dkim-signature; bh=HDK8WDfUBYYirSWO06T0TVOheARrNR/0B8M0BZ3uAqU=; fh=dHSco5PKxjGiqRAVPAm4lpqLUm58YwQ0PqOMYb+XGzU=; b=yWjFTLUdFzIHA48OrGWdUd0dqH5DYE29wNT+tWTREbxXPF4pl8AqhMKgQXHxTxPfFN Yk/4ZvFgsYzs/InFsQWOLfrvNveBUIPpXKaC6rzXA5pareXkcVMeFYwaWYP6kSYnNM67 t/fk+va0gahF+0AKEbg4NACKMgquA4zdR9LMoLSkkX+G/kt/DJQuCxQmtSdDfC6TfITX Pp7NoO8wX+9FwKEjFhbAVmZgwknBCeNK7xXn0jriPP/JOj/xIsETtTMjOon2zuO5ugUi ahYDGroc/0ERme7REN9FPaGlsvW2EObeIOJdrYgvrqdvEk82+7NU77ICMTnLlogXe87X 28Vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TCJteCuG; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-184481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184481-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a1797caadsi1313048666b.245.2024.05.20.21.12.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 21:12:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TCJteCuG; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-184481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184481-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 04B7B1F21803 for ; Tue, 21 May 2024 04:12:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FE8A25569; Tue, 21 May 2024 04:12:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="TCJteCuG" Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 49B4314F62 for ; Tue, 21 May 2024 04:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716264763; cv=none; b=I6X+gtjH3nBKLm8yyriC6eH243Tm9hEfn5H7o4+Jjy5LvaXAu0OfwQ5o90nIOLb5ZuZLv2qsKtAceLgceVmAgSTwJxoMDipc8KOK9Rv89akTbWZdmL72AoptRCggf2cayw6LnUzH9qkYvs81Y6M2oPUTazhiGbBQpvm5N4yrdK0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716264763; c=relaxed/simple; bh=O92KeYUkA1edHwlwkgSl2dByMiiKmyF/6D5jrMUsaIQ=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=IRwaVKyJYEovB05PdDKQL76A0cjOMMacsV4fC6QoubXAknBtFR+fJdXJaBMRZTzTgY9sWBdEoQDqcBblkD9TiYu8rNmzdK9DbKopOwQP3OKNZBfE8vREcGkRpPLxcTlnc2QRCgWQVRKFRoxP+G2+9rfBVE6mTsRIInn2YUDJRw8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=TCJteCuG; arc=none smtp.client-ip=209.85.222.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-792b934de39so269649585a.3 for ; Mon, 20 May 2024 21:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716264760; x=1716869560; darn=vger.kernel.org; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:from:to:cc:subject:date:message-id :reply-to; bh=HDK8WDfUBYYirSWO06T0TVOheARrNR/0B8M0BZ3uAqU=; b=TCJteCuGSX2EXaKRCsBoBMOb5dK/dicBSL/0kUkHsR5XHVrmHiW4JVmw6yw6n/CBUV fCjAnIeV/ERNQw6Vt5mn1GKy55xVI5VxFbyPfmMJK/SMRciX+IPrbIeyMZlZOMlrRsAu 1ASGpxwwtPo5n8+cPwJ+EGutcFouHcM+wSIL8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716264760; x=1716869560; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HDK8WDfUBYYirSWO06T0TVOheARrNR/0B8M0BZ3uAqU=; b=UX0mnpLUwfIA2Gdxs3y6l76rhA8qChj9zqJPsLiFSlKNUKW7RPUNX2xOmohF4zmnB/ fSEU7nmDhmo4iBpVsk9Db1ze/qlHT1OO+ttjBaoHqWA33meWmN0B5+E0D/HodID93koy bdt+Ojf0b+cJhpJ88FrrAVnu5l6cOD9+91pIshv8OWLQvDRwZGJCw4/a7Lk7QKVGP5n5 udKVXjV2/hocalqH9MiVf1V+XGPBwtu2VQUedAJpZ8XaNYUzG+09b+yhV1LcNP0ejNP4 shc3otBvLuHBjhMlAnLA0sLVHQ2pmHzA+F7RPWCs8qsAC2SBqhBE/rvdwNaEzSn7eS0R gppA== X-Forwarded-Encrypted: i=1; AJvYcCVDAjn5ZXaOFi0ODdDo6pEOfAeOavx8dTS98hZIsIecFRNID3i07l/4b1EPeVq0uV63qhBk70PCekF+p55NRdSL69O/HX0lK/bNRjE/ X-Gm-Message-State: AOJu0Yw62YZgvHmD/pBoLF7JD61azW9K3+8DT1j0kUIyTPL+htoNjUUJ +w7RaxbImQXbwzV083YxSlNDOK7+Bp1fdLgz0Xj6kJPvqJEVqhgvl34FMrd41hcE+5SOTqhQW+a Zq1i16vMetnkG18USySWNipVKEXJLoi2thYkY X-Received: by 2002:a05:620a:280e:b0:793:b91:2dbe with SMTP id af79cd13be357-7930b912e08mr1615135785a.40.1716264760099; Mon, 20 May 2024 21:12:40 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 21 May 2024 00:12:39 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20240517233801.4071868-2-quic_abhinavk@quicinc.com> References: <20240517233801.4071868-1-quic_abhinavk@quicinc.com> <20240517233801.4071868-2-quic_abhinavk@quicinc.com> From: Stephen Boyd User-Agent: alot/0.10 Date: Tue, 21 May 2024 00:12:39 -0400 Message-ID: Subject: Re: [RFC PATCH 1/4] drm/msm: register a fault handler for display mmu faults To: Abhinav Kumar , Daniel Vetter , David Airlie , Dmitry Baryshkov , Marijn Suijten , Rob Clark , Sean Paul , freedreno@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org, seanpaul@chromium.org, dianders@chromium.org, quic_jesszhan@quicinc.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Quoting Abhinav Kumar (2024-05-17 16:37:56) > 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); From past experience I've seen the smmu fault handler called in hardirq context, so it can't sleep. Is there some way to grab the register contents without sleeping? Otherwise this will have to fork off somewhere else that can take locks, runtime PM resume, etc. > + if (ret) > + return ret; > + > + state = msm_disp_snapshot_state_sync(kms); > + > + mutex_unlock(&kms->dump_mutex); > +