Re: [PATCH v3 08/24] dmaengine: dw-edma: Prepare LL progress event handling

Koichiro Den <[email protected]> Tue, 28 Jul 2026 15:02:35 +0900
Newsgroups org.kernel.vger.dmaengine,org.kernel.vger.linux-kernel
Message-ID <hlq7pbpnv5ilymqawadggdhqeinq6yfpgdpycjnt7llpddhcyw@ehwmetriczu2>
On Mon, Jul 27, 2026 at 04:09:01PM -0400, Frank Li wrote:
> On Tue, Jul 28, 2026 at 02:03:07AM +0900, Koichiro Den wrote:
> > LL event pairing needs to know whether event registers are shared per
> > channel or per direction. It also needs a provider operation to clear
> > stale LL interrupt status before a channel restart. Add both.
> >
> > Centralize runtime request updates in dw_edma_set_request(). A later
> > patch uses it to cancel a pending LL recheck when STOP or PAUSE changes
> > the channel policy. Rename the existing workqueue event bits to
> > distinguish them from provider IRQ events.
> >
> > No functional change.
> >
> > Signed-off-by: Koichiro Den <[email protected]>
> > ---
> ...
> >
> > +enum dw_edma_event_scope {
> > +	DW_EDMA_EVENT_PER_CHAN,
> > +	DW_EDMA_EVENT_PER_DIR,
> > +};
> > +
> 
> not why core need know this information?

It doesn't need to. It is just an artifact of my v3 implementation.

With your suggestion to make chan->event_lock a pointer, I believe the core no
longer needs to know whether its scope is per channel or per direction, ie. both
the enum and the core_ops member can be dropped.

Thanks for the review,
Koichiro

> 
> Frank
> >  struct dw_edma_chan;
> >  struct dw_edma_chunk;
> >
> > @@ -155,6 +160,7 @@ struct dw_edma_core_ops {
> >  	int (*ch_quiesce)(struct dw_edma_chan *chan);
> >  	u16 (*ch_count)(struct dw_edma *dw, enum dw_edma_dir dir);
> >  	enum dma_status (*ch_status)(struct dw_edma_chan *chan);
> > +	enum dw_edma_event_scope event_scope;
> >  	irqreturn_t (*handle_int)(struct dw_edma_irq *dw_irq, enum dw_edma_dir dir,
> >  				  dw_edma_handler_t done, dw_edma_handler_t abort);
> >  	void (*non_ll_start)(struct dw_edma_chan *chan, struct dw_edma_burst *child);
> > @@ -163,6 +169,7 @@ struct dw_edma_core_ops {
> >  	void (*ll_link)(struct dw_edma_chan *chan, u32 idx, bool cb, u64 addr);
> >  	void (*ll_clear)(struct dw_edma_chan *chan, u32 idx);
> >  	int (*ll_cur_idx)(struct dw_edma_chan *chan);
> > +	void (*ll_irq_clear)(struct dw_edma_chan *chan);
> >  	void (*ch_doorbell)(struct dw_edma_chan *chan);
> >  	void (*ch_enable)(struct dw_edma_chan *chan);
> >  	void (*ch_config)(struct dw_edma_chan *chan);
> > @@ -284,6 +291,11 @@ static inline void dw_edma_core_ll_clear(struct dw_edma_chan *chan, u32 idx)
> >  	chan->dw->core->ll_clear(chan, idx);
> >  }
> >
> > +static inline void dw_edma_core_ll_irq_clear(struct dw_edma_chan *chan)
> > +{
> > +	chan->dw->core->ll_irq_clear(chan);
> > +}
> > +
> >  static inline void dw_edma_core_ch_doorbell(struct dw_edma_chan *chan)
> >  {
> >  	chan->dw->core->ch_doorbell(chan);
> > diff --git a/drivers/dma/dw-edma/dw-edma-v0-core.c b/drivers/dma/dw-edma/dw-edma-v0-core.c
> > index c31fff095b4f..d497d36f5b28 100644
> > --- a/drivers/dma/dw-edma/dw-edma-v0-core.c
> > +++ b/drivers/dma/dw-edma/dw-edma-v0-core.c
> > @@ -680,11 +680,13 @@ static const struct dw_edma_core_ops dw_edma_v0_core = {
> >  	.ch_quiesce = dw_edma_v0_core_ch_quiesce,
> >  	.ch_count = dw_edma_v0_core_ch_count,
> >  	.ch_status = dw_edma_v0_core_ch_status,
> > +	.event_scope = DW_EDMA_EVENT_PER_DIR,
> >  	.handle_int = dw_edma_v0_core_handle_int,
> >  	.ll_data = dw_edma_v0_core_ll_data,
> >  	.ll_link = dw_edma_v0_core_ll_link,
> >  	.ll_clear = dw_edma_v0_core_ll_clear,
> >  	.ll_cur_idx = dw_edma_v0_core_ll_cur_idx,
> > +	.ll_irq_clear = dw_edma_v0_core_clear_done_int,
> >  	.ch_doorbell = dw_edma_v0_core_ch_doorbell,
> >  	.ch_enable = dw_edma_v0_core_ch_enable,
> >  	.ch_config = dw_edma_v0_core_ch_config,
> > diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c b/drivers/dma/dw-edma/dw-hdma-v0-core.c
> > index b2d35f0b7b6d..b181603bf2c7 100644
> > --- a/drivers/dma/dw-edma/dw-hdma-v0-core.c
> > +++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c
> > @@ -435,12 +435,14 @@ static const struct dw_edma_core_ops dw_hdma_v0_core = {
> >  	.ch_quiesce = dw_hdma_v0_core_ch_quiesce,
> >  	.ch_count = dw_hdma_v0_core_ch_count,
> >  	.ch_status = dw_hdma_v0_core_ch_status,
> > +	.event_scope = DW_EDMA_EVENT_PER_CHAN,
> >  	.handle_int = dw_hdma_v0_core_handle_int,
> >  	.non_ll_start = dw_hdma_v0_core_non_ll_start,
> >  	.ll_data = dw_hdma_v0_core_ll_data,
> >  	.ll_link = dw_hdma_v0_core_ll_link,
> >  	.ll_clear = dw_hdma_v0_core_ll_clear,
> >  	.ll_cur_idx = dw_hdma_v0_core_ll_cur_idx,
> > +	.ll_irq_clear = dw_hdma_v0_core_clear_done_int,
> >  	.ch_doorbell = dw_hdma_v0_core_ch_doorbell,
> >  	.ch_enable = dw_hdma_v0_core_ch_enable,
> >  	.ch_config = dw_hdma_v0_core_ch_config,
> > --
> > 2.51.0
> >