On Fri, Jul 24, 2015 at 10:28:45AM +0200, Lars-Peter Clausen wrote: > On 07/23/2015 08:39 PM, Vinod Koul wrote: > [...] > >+static inline int dmaengine_desc_set_reuse(struct dma_async_tx_descriptor *tx) > >+{ > >+ struct dma_slave_caps caps; > >+ > >+ dma_get_slave_caps(tx->chan, &caps); > >+ > >+ if (caps.descriptor_reuse) { > >+ tx->flags |= DMA_CTRL_REUSE; > >+ return 0; > >+ } else { > >+ return -EPERM; > >+ } > >+} > >+ > >+static inline void dmaengine_desc_clear_reuse(struct dma_async_tx_descriptor *tx) > >+{ > >+ tx->flags &= ~DMA_CTRL_REUSE; > >+} > > I don' think we need set set and clear functions. We need them for > the ACK flag because the ACK flag can be set later on. But the REUSE > flag should be specified when the descriptor is created so the > driver can make the necessary preparations it might need to support > re-usable descriptors. Maybe we should call the flag > DMA_PREP_REUSABLE (like the other DMA_PREP_*) flag to reflect this. The flow I have depicted is that descriptor prepare should not be linked to it's reuse. The submit operation specifies if a descriptor can be reused or not, so driver knows what to do after txn completion While reusing if client wants to stop reusing it can clear reuse flag and submit so that descriptor is freed up Also this is tied to caps so you are allowed to do so only if caps supports it. From these points we do need set/clear/test_reuse APIs -- ~Vinod -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html