+ Kalle Valo On 9 May 2018 at 15:55, Christoph Hellwig <hch@xxxxxx> wrote: > In the next few merge windows I plan to gradually remove the block > layer bounce buffering, and mmc is one of the worst offenders in > terms of still using it. > > This series is a blind (and untested) conversion of a few drivers to be > safe vs highmem. There are about a few others (davinci_mmc, mvsdio, > omap, s3cmci, sh_mmcif) that don't seem quite as trivial as they have > somewhat convoluted state machines for a current pio buffers, but > any help on those would be welcome as well. I am willing to help, although I am lacking most of the above HW. Anyway, regarding the state machines and a few other things that may be good to keep in mind doing this kind of conversion. Some mmc drivers/controllers supports SDIO, which means they also need to cope with buffers not as nicely allocated as by the block layer. Buffer length can vary, but more importantly it sometimes may not even be aligned to "power of 2". In cases like these, we can get quite complex scenarios, for example when buffers are split across several pages and the size is not aligned to power of 2. Moreover, the are constraints how controllers data FIFOs must written to and read from. For example, the access may needs to be aligned to a word (reading two bytes or writing two bytes doesn't work - so padding may be needed). Then imagine the case where the buffer is split across 2 pages and perhaps having the size of 4 bytes. I think that is the main reason to these odd state machines exists in the mmc drivers. I have been thinking of how to make it possible for mmc host drivers to specify "best buffer constraints" for upper SDIO layers, similar as we do for the mmc block device layer, however so far I haven't figured it out. One final thing, in regards to DMA vs PIO mode. It's quite common that a mmc driver implements a fallback method to PIO mode, in case DMA fails (the DMA channel could not be fetched or a DMA transfer failed). Not sure if this impact things for this series though. Kind regards Uffe -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html