From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Sean Anderson <sean.anderson@linux.dev>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
David Airlie <airlied@gmail.com>,
Michal Simek <michal.simek@amd.com>,
Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH v6 4/8] drm: zynqmp_dp: Convert to a hard IRQ
Date: Wed, 2 Oct 2024 16:52:55 +0300 [thread overview]
Message-ID: <1846295a-aea7-41fe-a7a6-756a260ef3a3@ideasonboard.com> (raw)
In-Reply-To: <20240809193600.3360015-5-sean.anderson@linux.dev>
Hi,
On 09/08/2024 22:35, Sean Anderson wrote:
> Now that all of the sleeping work is done outside of the IRQ, we can
> convert it to a hard IRQ. Shared IRQs may be triggered even after
> calling disable_irq, so use free_irq instead which removes our callback
> altogether.
>
> Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
> ---
>
> Changes in v6:
> - Fix hang upon driver removal
>
> Changes in v3:
> - New
>
> drivers/gpu/drm/xlnx/zynqmp_dp.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c
> index cec5711c7026..532e103713b3 100644
> --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c
> +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c
> @@ -1831,9 +1831,8 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub)
> * Now that the hardware is initialized and won't generate spurious
> * interrupts, request the IRQ.
> */
> - ret = devm_request_threaded_irq(dp->dev, dp->irq, NULL,
> - zynqmp_dp_irq_handler, IRQF_ONESHOT,
> - dev_name(dp->dev), dp);
> + ret = devm_request_irq(dp->dev, dp->irq, zynqmp_dp_irq_handler,
> + IRQF_SHARED, dev_name(dp->dev), dp);
> if (ret < 0)
> goto err_phy_exit;
>
> @@ -1858,7 +1857,7 @@ void zynqmp_dp_remove(struct zynqmp_dpsub *dpsub)
> struct zynqmp_dp *dp = dpsub->dp;
>
> zynqmp_dp_write(dp, ZYNQMP_DP_INT_DS, ZYNQMP_DP_INT_ALL);
> - disable_irq(dp->irq);
> + devm_free_irq(dp->dev, dp->irq, dp);
>
> cancel_work_sync(&dp->hpd_irq_work);
> cancel_work_sync(&dp->hpd_work);
Not much point using devm for request irq, I think, as it's manually freed.
Another thing, which I think is not an issue at the moment nor related
to this series as such, is that we use IRQF_SHARED and
zynqmp_dp_irq_handler() will read a DP register right away. This means
that if the DP is runtime suspended and we get an interrupt, the driver
accesses a register on a suspended IP, which often leads to crash/hang.
Here I think we enable all necessary clocks at probe time, so the DP is
always enabled and the above is not an issue.
In any case, even with the current devm:
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi
next prev parent reply other threads:[~2024-10-02 13:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 19:35 [PATCH v6 0/8] drm: zynqmp_dp: IRQ cleanups and debugfs support Sean Anderson
2024-08-09 19:35 ` [PATCH v6 1/8] drm: zynqmp_kms: Unplug DRM device before removal Sean Anderson
2024-08-09 19:35 ` [PATCH v6 2/8] drm: zynqmp_dp: Add locking Sean Anderson
2024-08-09 19:35 ` [PATCH v6 3/8] drm: zynqmp_dp: Don't retrain the link in our IRQ Sean Anderson
2024-08-09 19:35 ` [PATCH v6 4/8] drm: zynqmp_dp: Convert to a hard IRQ Sean Anderson
2024-10-02 13:52 ` Tomi Valkeinen [this message]
2024-08-09 19:35 ` [PATCH v6 5/8] drm: zynqmp_dp: Use AUX IRQs instead of polling Sean Anderson
2024-08-09 19:35 ` [PATCH v6 6/8] drm: zynqmp_dp: Split off several helper functions Sean Anderson
2024-08-09 19:35 ` [PATCH v6 7/8] drm: zynqmp_dp: Take dp->lock in zynqmp_dp_hpd_work_func Sean Anderson
2024-08-09 19:36 ` [PATCH v6 8/8] drm: zynqmp_dp: Add debugfs interface for compliance testing Sean Anderson
2024-10-01 18:31 ` [PATCH v6 0/8] drm: zynqmp_dp: IRQ cleanups and debugfs support Sean Anderson
2024-10-02 14:50 ` Tomi Valkeinen
2024-10-03 14:53 ` Sean Anderson
2024-10-25 14:58 ` Sean Anderson
2024-10-28 15:04 ` Tomi Valkeinen
2024-10-30 12:30 ` 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=1846295a-aea7-41fe-a7a6-756a260ef3a3@ideasonboard.com \
--to=tomi.valkeinen@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--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=sean.anderson@linux.dev \
--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
all inboxes | Powered by JetHome®