@@ -180,7 +180,8 @@ static void hisi_dma_reset_qp_point(struct hisi_dma_dev *hdma_dev, u32 index)
180
180
hisi_dma_chan_write (hdma_dev -> base , HISI_DMA_CQ_HEAD_PTR , index , 0 );
181
181
}
182
182
183
- static void hisi_dma_reset_hw_chan (struct hisi_dma_chan * chan )
183
+ static void hisi_dma_reset_or_disable_hw_chan (struct hisi_dma_chan * chan ,
184
+ bool disable )
184
185
{
185
186
struct hisi_dma_dev * hdma_dev = chan -> hdma_dev ;
186
187
u32 index = chan -> qp_num , tmp ;
@@ -201,8 +202,11 @@ static void hisi_dma_reset_hw_chan(struct hisi_dma_chan *chan)
201
202
hisi_dma_do_reset (hdma_dev , index );
202
203
hisi_dma_reset_qp_point (hdma_dev , index );
203
204
hisi_dma_pause_dma (hdma_dev , index , false);
204
- hisi_dma_enable_dma (hdma_dev , index , true);
205
- hisi_dma_unmask_irq (hdma_dev , index );
205
+
206
+ if (!disable ) {
207
+ hisi_dma_enable_dma (hdma_dev , index , true);
208
+ hisi_dma_unmask_irq (hdma_dev , index );
209
+ }
206
210
207
211
ret = readl_relaxed_poll_timeout (hdma_dev -> base +
208
212
HISI_DMA_Q_FSM_STS + index * HISI_DMA_OFFSET , tmp ,
@@ -218,7 +222,7 @@ static void hisi_dma_free_chan_resources(struct dma_chan *c)
218
222
struct hisi_dma_chan * chan = to_hisi_dma_chan (c );
219
223
struct hisi_dma_dev * hdma_dev = chan -> hdma_dev ;
220
224
221
- hisi_dma_reset_hw_chan (chan );
225
+ hisi_dma_reset_or_disable_hw_chan (chan , false );
222
226
vchan_free_chan_resources (& chan -> vc );
223
227
224
228
memset (chan -> sq , 0 , sizeof (struct hisi_dma_sqe ) * hdma_dev -> chan_depth );
@@ -394,7 +398,7 @@ static void hisi_dma_enable_qp(struct hisi_dma_dev *hdma_dev, u32 qp_index)
394
398
395
399
static void hisi_dma_disable_qp (struct hisi_dma_dev * hdma_dev , u32 qp_index )
396
400
{
397
- hisi_dma_reset_hw_chan (& hdma_dev -> chan [qp_index ]);
401
+ hisi_dma_reset_or_disable_hw_chan (& hdma_dev -> chan [qp_index ], true );
398
402
}
399
403
400
404
static void hisi_dma_enable_qps (struct hisi_dma_dev * hdma_dev )
0 commit comments