From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Anatoliy Klymenko <anatoliy.klymenko@amd.com>
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
Date: Mon, 5 Feb 2024 09:35:22 +0200 [thread overview]
Message-ID: <20240205073522.GG6804@pendragon.ideasonboard.com> (raw)
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 <anatoliy.klymenko@amd.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-02-05 7:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-24 2:53 [PATCH v3 0/5] Fixing live video input in ZynqMP DPSUB Anatoliy Klymenko
2024-01-24 2:53 ` [PATCH v3 1/5] drm: xlnx: zynqmp_dpsub: Make drm bridge discoverable Anatoliy Klymenko
2024-01-24 2:53 ` [PATCH v3 2/5] drm: xlnx: zynqmp_dpsub: Fix timing for live mode Anatoliy Klymenko
2024-02-05 8:08 ` Laurent Pinchart
2024-02-05 22:22 ` Klymenko, Anatoliy
2024-01-24 2:54 ` [PATCH v3 3/5] drm: xlnx: zynqmp_dpsub: Clear status register ASAP Anatoliy Klymenko
2024-02-01 7:39 ` Tomi Valkeinen
2024-02-05 7:33 ` Laurent Pinchart
2024-01-24 2:54 ` [PATCH v3 4/5] drm: xlnx: zynqmp_dpsub: Filter interrupts against mask Anatoliy Klymenko
2024-02-01 7:41 ` Tomi Valkeinen
2024-02-05 7:35 ` Laurent Pinchart [this message]
2024-01-24 2:54 ` [PATCH v3 5/5] drm: xlnx: zynqmp_dpsub: Set live video in format Anatoliy Klymenko
2024-02-05 7:29 ` [PATCH v3 0/5] Fixing live video input in ZynqMP DPSUB Laurent Pinchart
2024-02-05 8:26 ` Laurent Pinchart
2024-02-07 13:24 ` Tomi Valkeinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240205073522.GG6804@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=anatoliy.klymenko@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=michal.simek@amd.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).