Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2246313rdb; Sun, 4 Feb 2024 23:35:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXmQ1u+aFoNVxe2UMIEXYftqN43Tcjay10MMWB9bzqvJhfEvzimvj9QTvTJFqpRP65EozQ X-Received: by 2002:a05:6808:1b0a:b0:3bf:dfeb:7cd8 with SMTP id bx10-20020a0568081b0a00b003bfdfeb7cd8mr582198oib.7.1707118533202; Sun, 04 Feb 2024 23:35:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707118533; cv=pass; d=google.com; s=arc-20160816; b=hGvfSIzFZJ5S8vH1YaBBbQ7TA9SvkSCGlWdz7nkR3wrSo2P6sET94489gQk4QPgqgT VHoLoJDxm5K/Uw7Vkm1N/E/Wz7xEZ9kGjDqfih2ub3bTGLxF8Gp4shLC8IhxYlvw4AI3 IGTrzTyFR+gJ3Jk0vGZV4rBDYrnkqD60nlsa5hmBGWmA7Nd6OeXm4H2zvqrgDC5sMLl2 8HsmJ5tmQJjrM9qTtteyHKgQAONd0DzGmoUmhO9vgqlPkBmBJ+AbhpiJ9QQ1Wi2btReU RRcbflteg0eNK27qDXto6REfdjnefDAo9NcZHi1WHaU4ed5z7WttY9rd82TStmnbaNmU 3Uxg== 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=XxDiVqT9BA30RLxAWOmIVKHMWI44p+7Sb8uErV4HoSw=; fh=3sW40h9KdrKAlRGEAfgepV42Iv2gRTr5MpkA5F/m+5g=; b=PAUvUywmTzsm9OTsfCzDziV88Gx3rRj85MiQKJez/2wSaQfmpO0Tx3mnQcmplckQe/ 37vdHd8KZ1OOHGpOdqTHjtonaWDtyoDBNdxJ9DqtZacbRmuYZYWPPJSMPcE835xzQmXZ 15vhLAgrW3nYfD6f+wIlfktT417BAS7At+yfVS6NKS5A4gY0TEfevDS3Dss3OvgRdhTc eLYzgSTlSfD/drPXLzcwKaPrdE93WuuvZTID3EI9ZaRJ8THlMxVTFzXwMUZJfA3Tss4h wKt+ID2v3SOI67DbbFL7P9eAgagq2UAp0ClCGvyeXYnvm70R88SpEwT7Uy1unIVLLbMX LuyQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="WSJRT/3S"; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-52147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52147-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVb1YocTNnFEyObXp326c4LNoS2//ABisZv8k+LtPHc8pUO0+BY+nbGS6YVhnERvQr50Fs4lDd72vN6pAvy0C79tqKsYdr553Neu1a2tQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g5-20020ac87d05000000b0042bf17dc87esi7984212qtb.152.2024.02.04.23.35.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 23:35:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52147-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 (test mode) header.i=@ideasonboard.com header.s=mail header.b="WSJRT/3S"; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-52147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52147-linux.lists.archive=gmail.com@vger.kernel.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 2F9C11C226C0 for ; Mon, 5 Feb 2024 07:35:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE05F125AD; Mon, 5 Feb 2024 07:35:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="WSJRT/3S" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94116125A5 for ; Mon, 5 Feb 2024 07:35:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707118524; cv=none; b=Or1P0Gvoda/FJFCP4QEeQWmuyf1XxHU9PN89IkvpcbyGq7UEc2YYEhGjDjwR4BDbjqauRrPvqLgggF6/V19sUiIBn6oYcz8TN6nF6yz0qZEWsI3WAjxEfURQXI2LQFBYlXsNs4GMRljPoM8+5zqxYXUbsYXuMCVjKPEdbXpfh7U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707118524; c=relaxed/simple; bh=TPAhRfZNvGXB/DBnRhVN6DN8EMYWbqn2NG2XnBRmiZQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aIgGzIODF3LSra8bJnFelW4pJgqH/P2wPU6yxSjBAeVERjBZu9w6qpFi/qt5I0D5cYI11fIVOLtON1cuFzZfe9qkyoOyK8zYBSZS/P1HU7uH0va/EBWEBTqqqynirIoQgXzXHxydu8pNqLQBA6k/39le2nMQVq7QDbk1cunOk1U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=WSJRT/3S; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (99.141-128-109.adsl-dyn.isp.belgacom.be [109.128.141.99]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 94C24667; Mon, 5 Feb 2024 08:33:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1707118438; bh=TPAhRfZNvGXB/DBnRhVN6DN8EMYWbqn2NG2XnBRmiZQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WSJRT/3StG+O7Jz2pKyDnebcgjnslPoTgBbloAtiqlGXMR7S3xmlsydsn/T3NlrEM NpZQIZ5jWwnrUHlFK7NOgVxX4G1GYCzL/++6NkwZeCArXaJovYBVVLKFCVRYmaiqz8 8YviHml3Asllhr1nRtqC7qS2iVvI2PIAgNmBQxc8= Date: Mon, 5 Feb 2024 09:35:22 +0200 From: Laurent Pinchart To: Anatoliy Klymenko Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, michal.simek@amd.com, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/5] drm: xlnx: zynqmp_dpsub: Filter interrupts against mask Message-ID: <20240205073522.GG6804@pendragon.ideasonboard.com> References: <20240124025402.373620-1-anatoliy.klymenko@amd.com> <20240124025402.373620-5-anatoliy.klymenko@amd.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=utf-8 Content-Disposition: inline In-Reply-To: <20240124025402.373620-5-anatoliy.klymenko@amd.com> Hi Anatoliy, Thank you for the patch. On Tue, Jan 23, 2024 at 06:54:01PM -0800, Anatoliy Klymenko wrote: > Filter out status register against the interrupts' mask. > > Some events are being reported via DP status register, even if > corresponding interrupts have been disabled. One instance of such event > leads to generation of VBLANK when the driver is in DRM bridge mode, > which in turn results in NULL pointer dereferencing. We should avoid > processing such events in an interrupt handler context. > > This problem is less noticeable when the driver operates in DMA mode, as > in this case we have DRM CRTC object instantiated and DRM framework > simply discards unwanted VBLANKs in drm_handle_vblank(). > > Signed-off-by: Anatoliy Klymenko Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/xlnx/zynqmp_dp.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c > index 5a3335e1fffa..9f48e5bbcdec 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c > +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c > @@ -1627,7 +1627,14 @@ static irqreturn_t zynqmp_dp_irq_handler(int irq, void *data) > /* clear status register as soon as we read it */ > zynqmp_dp_write(dp, ZYNQMP_DP_INT_STATUS, status); > mask = zynqmp_dp_read(dp, ZYNQMP_DP_INT_MASK); > - if (!(status & ~mask)) > + > + /* > + * Status register may report some events, which corresponding interrupts > + * have been disabled. Filter out those events against interrupts' mask. > + */ > + status &= ~mask; > + > + if (!status) > return IRQ_NONE; > > /* dbg for diagnostic, but not much that the driver can do */ -- Regards, Laurent Pinchart