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 @@ -247,6 +247,26 @@ static int jz4740_mmc_acquire_dma_channels(struct jz4740_mmc_host *host)
247247 return PTR_ERR (host -> dma_rx );
248248 }
249249
250+ /*
251+ * Limit the maximum segment size in any SG entry according to
252+ * the parameters of the DMA engine device.
253+ */
254+ if (host -> dma_tx ) {
255+ struct device * dev = host -> dma_tx -> device -> dev ;
256+ unsigned int max_seg_size = dma_get_max_seg_size (dev );
257+
258+ if (max_seg_size < host -> mmc -> max_seg_size )
259+ host -> mmc -> max_seg_size = max_seg_size ;
260+ }
261+
262+ if (host -> dma_rx ) {
263+ struct device * dev = host -> dma_rx -> device -> dev ;
264+ unsigned int max_seg_size = dma_get_max_seg_size (dev );
265+
266+ if (max_seg_size < host -> mmc -> max_seg_size )
267+ host -> mmc -> max_seg_size = max_seg_size ;
268+ }
269+
250270 return 0 ;
251271}
252272
You can’t perform that action at this time.
0 commit comments