The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Liviu Dudau <liviu.dudau@arm.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Steven Price <steven.price@arm.com>,
	Chia-I Wu <olvaffe@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 8/9] drm/panthor: Don't defer FW event processing
Date: Tue, 18 Aug 2026 18:15:47 +0100	[thread overview]
Message-ID: <aoSTQz0X0nTo3CN3@e142607> (raw)
In-Reply-To: <20260811-panthor-signal-from-irq-v6-8-12f2ab53d735@collabora.com>

On Tue, Aug 11, 2026 at 01:23:42PM +0200, Boris Brezillon wrote:
> Avoid a workqueue roundtrip and process things immediately from
> panthor_sched_report_fw_events().
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> ---
>  drivers/gpu/drm/panthor/panthor_sched.c | 48 +++++++--------------------------
>  1 file changed, 9 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index 1ef9da55030c..8016b0a55173 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -177,23 +177,6 @@ struct panthor_scheduler {
>  	 */
>  	struct work_struct sync_upd_work;
>  
> -	/**
> -	 * @fw_events_work: Work used to process FW events outside the interrupt path.
> -	 *
> -	 * Even if the interrupt is threaded, we need any event processing
> -	 * that require taking the panthor_scheduler::lock to be processed
> -	 * outside the interrupt path so we don't block the tick logic when
> -	 * it calls panthor_fw_{csg,wait}_wait_acks(). Since most of the
> -	 * event processing requires taking this lock, we just delegate all
> -	 * FW event processing to the scheduler workqueue.
> -	 */
> -	struct work_struct fw_events_work;
> -
> -	/**
> -	 * @fw_events: Bitmask encoding pending FW events.
> -	 */
> -	atomic_t fw_events;
> -
>  	/**
>  	 * @resched_target: When the next tick should occur.
>  	 *
> @@ -1971,14 +1954,17 @@ static void sched_process_global_irq_locked(struct panthor_device *ptdev)
>  		sched_process_idle_event_locked(ptdev);
>  }
>  
> -static void process_fw_events_work(struct work_struct *work)
> +/**
> + * panthor_sched_report_fw_events() - Report FW events to the scheduler.
> + * @ptdev: Device.
> + * @events: Bitmask of pending FW events to report.
> + */
> +void panthor_sched_report_fw_events(struct panthor_device *ptdev, u32 events)
>  {
> -	struct panthor_scheduler *sched = container_of(work, struct panthor_scheduler,
> -						      fw_events_work);
> -	u32 events = atomic_xchg(&sched->fw_events, 0);
> -	struct panthor_device *ptdev = sched->ptdev;
> +	if (!ptdev->scheduler)
> +		return;
>  
> -	guard(spinlock)(&sched->events_lock);
> +	guard(spinlock)(&ptdev->scheduler->events_lock);
>  
>  	if (events & JOB_INT_GLOBAL_IF) {
>  		sched_process_global_irq_locked(ptdev);
> @@ -1993,20 +1979,6 @@ static void process_fw_events_work(struct work_struct *work)
>  	}
>  }
>  
> -/**
> - * panthor_sched_report_fw_events() - Report FW events to the scheduler.
> - * @ptdev: Device.
> - * @events: Bitmask of pending FW events to report.
> - */
> -void panthor_sched_report_fw_events(struct panthor_device *ptdev, u32 events)
> -{
> -	if (!ptdev->scheduler)
> -		return;
> -
> -	atomic_or(events, &ptdev->scheduler->fw_events);
> -	sched_queue_work(ptdev->scheduler, fw_events);
> -}
> -
>  static const char *fence_get_driver_name(struct dma_fence *fence)
>  {
>  	return "panthor";
> @@ -4082,7 +4054,6 @@ void panthor_sched_unplug(struct panthor_device *ptdev)
>  	struct panthor_scheduler *sched = ptdev->scheduler;
>  
>  	disable_delayed_work_sync(&sched->tick_work);
> -	disable_work_sync(&sched->fw_events_work);
>  	disable_work_sync(&sched->sync_upd_work);
>  
>  	mutex_lock(&sched->lock);
> @@ -4167,7 +4138,6 @@ int panthor_sched_init(struct panthor_device *ptdev)
>  	sched->tick_period = msecs_to_jiffies(10);
>  	INIT_DELAYED_WORK(&sched->tick_work, tick_work);
>  	INIT_WORK(&sched->sync_upd_work, sync_upd_work);
> -	INIT_WORK(&sched->fw_events_work, process_fw_events_work);
>  
>  	spin_lock_init(&sched->events_lock);
>  
> 
> -- 
> 2.55.0
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

  parent reply	other threads:[~2026-08-18 17:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 11:23 [PATCH v6 0/9] drm/panthor: Reduce dma_fence signalling latency Boris Brezillon
2026-08-11 11:23 ` [PATCH v6 1/9] drm/panthor: Make panthor_irq::state a non-atomic field Boris Brezillon
2026-08-11 11:23 ` [PATCH v6 2/9] drm/panthor: Move the register accessors before the IRQ helpers Boris Brezillon
2026-08-11 11:23 ` [PATCH v6 3/9] drm/panthor: Replace the panthor_irq macro machinery by inline helpers Boris Brezillon
2026-08-18 17:08   ` Liviu Dudau
2026-08-11 11:23 ` [PATCH v6 4/9] drm/panthor: Don't update might_have_idle_groups in process_idle_event_locked() Boris Brezillon
2026-08-17 15:09   ` Steven Price
2026-08-18 17:08   ` Liviu Dudau
2026-08-11 11:23 ` [PATCH v6 5/9] drm/panthor: Get rid of panthor_group::fatal_lock Boris Brezillon
2026-08-17 15:12   ` Steven Price
2026-08-18 17:09   ` Liviu Dudau
2026-08-11 11:23 ` [PATCH v6 6/9] drm/panthor: Protect events processing with a separate spinlock Boris Brezillon
2026-08-17 15:21   ` Steven Price
2026-08-18 17:13   ` Liviu Dudau
2026-08-11 11:23 ` [PATCH v6 7/9] drm/panthor: Don't defer job completion checks Boris Brezillon
2026-08-17 15:29   ` Steven Price
2026-08-11 11:23 ` [PATCH v6 8/9] drm/panthor: Don't defer FW event processing Boris Brezillon
2026-08-17 15:35   ` Steven Price
2026-08-18 17:15   ` Liviu Dudau [this message]
2026-08-11 11:23 ` [PATCH v6 9/9] drm/panthor: Automate CSG IRQ processing at group unbind time Boris Brezillon
2026-08-18 17:20   ` Liviu Dudau

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=aoSTQz0X0nTo3CN3@e142607 \
    --to=liviu.dudau@arm.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=olvaffe@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.com \
    --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