From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0D6E1A724C for ; Tue, 18 Aug 2026 17:15:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787073361; cv=none; b=an+dayYoc5Po/CgJImCAHfCnchxek3k0VsMILJ7k0WFKcOKYGOk6GaQvTbErCeBeb9bMEWn5h41rz+QiZRR1yuq0rFp9dthtgCzdtvnYpq2xLqwGO1jLO6fIY5yrZN1a09OBKw8QaBm5jjhjBr7rWc0/20l3i78VJ7vxnSJs9Os= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787073361; c=relaxed/simple; bh=tdHH1KKwxabqc14PyyehMolsFeTdgMHfgXISMC0rs/Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Oy6enr/BOSAnMEEmO8BK8dtcNM0gcNPth4dESCb2EMBuvbMyX1XdrJsaZHhPgze1a7/pOVYpBNQ3oo9kpL+o9bH5yQLjc9dBcYK5R/gXnZzdCvphO/cM1QAFC9Ag+P3eEdd4Nc+fVZPvoR9qbnqeek4YHA+EyBdbMBL+pe/7nv0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=jqEKX/7P; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="jqEKX/7P" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 767581A00 for ; Tue, 18 Aug 2026 10:15:55 -0700 (PDT) Received: from [192.168.0.1] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 200373F763 for ; Tue, 18 Aug 2026 10:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1787073359; bh=tdHH1KKwxabqc14PyyehMolsFeTdgMHfgXISMC0rs/Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jqEKX/7PWwNNR+tJjQ51RzX/IAXM9svkZqiQTN4zTMZGuaF6Ng+b40H+PiC1Wrb9F NeFxcX7ymUZ4ueKdJhUDXT/Mh6fYNCqycuGUUUppgSCcoxH4A8+FPxmk7uOzEqo+6z g5P+9QdZRB+1DsM3MxGOMXQuo/pwBMBd9CT1yqiI= Date: Tue, 18 Aug 2026 18:15:47 +0100 From: Liviu Dudau To: Boris Brezillon Cc: Steven Price , Chia-I Wu , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 8/9] drm/panthor: Don't defer FW event processing Message-ID: References: <20260811-panthor-signal-from-irq-v6-0-12f2ab53d735@collabora.com> <20260811-panthor-signal-from-irq-v6-8-12f2ab53d735@collabora.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 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Liviu Dudau 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! / --------------- ¯\_(ツ)_/¯