File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,26 @@ static int jz4740_mmc_acquire_dma_channels(struct jz4740_mmc_host *host)
224224 return PTR_ERR (host -> dma_rx );
225225 }
226226
227+ /*
228+ * Limit the maximum segment size in any SG entry according to
229+ * the parameters of the DMA engine device.
230+ */
231+ if (host -> dma_tx ) {
232+ struct device * dev = host -> dma_tx -> device -> dev ;
233+ unsigned int max_seg_size = dma_get_max_seg_size (dev );
234+
235+ if (max_seg_size < host -> mmc -> max_seg_size )
236+ host -> mmc -> max_seg_size = max_seg_size ;
237+ }
238+
239+ if (host -> dma_rx ) {
240+ struct device * dev = host -> dma_rx -> device -> dev ;
241+ unsigned int max_seg_size = dma_get_max_seg_size (dev );
242+
243+ if (max_seg_size < host -> mmc -> max_seg_size )
244+ host -> mmc -> max_seg_size = max_seg_size ;
245+ }
246+
227247 return 0 ;
228248}
229249
You can’t perform that action at this time.
0 commit comments