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 @@ -236,6 +236,26 @@ static int jz4740_mmc_acquire_dma_channels(struct jz4740_mmc_host *host)
236236 return PTR_ERR (host -> dma_rx );
237237 }
238238
239+ /*
240+ * Limit the maximum segment size in any SG entry according to
241+ * the parameters of the DMA engine device.
242+ */
243+ if (host -> dma_tx ) {
244+ struct device * dev = host -> dma_tx -> device -> dev ;
245+ unsigned int max_seg_size = dma_get_max_seg_size (dev );
246+
247+ if (max_seg_size < host -> mmc -> max_seg_size )
248+ host -> mmc -> max_seg_size = max_seg_size ;
249+ }
250+
251+ if (host -> dma_rx ) {
252+ struct device * dev = host -> dma_rx -> device -> dev ;
253+ unsigned int max_seg_size = dma_get_max_seg_size (dev );
254+
255+ if (max_seg_size < host -> mmc -> max_seg_size )
256+ host -> mmc -> max_seg_size = max_seg_size ;
257+ }
258+
239259 return 0 ;
240260}
241261
You can’t perform that action at this time.
0 commit comments