On 2/13/25 4:00 AM, Ming Lei wrote:
PAGE_SIZE is applied in validating block device queue limits, this way is
^^^^^^^ used?
very fragile and is wrong: - queue limits are read from hardware, which is often one readonly hardware
^^^^^^^^ read-only?
@@ -1163,6 +1163,8 @@ static inline bool bdev_is_partition(struct block_device *bdev) enum blk_default_limits { BLK_MAX_SEGMENTS = 128, BLK_SAFE_MAX_SECTORS = 255, + /* use minimized PAGE_SIZE as min segment size hint */ + BLK_MIN_SEGMENT_SIZE = 4096, BLK_MAX_SEGMENT_SIZE = 65536, BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL, };
The above comment could be made more clear, e.g. "Use 4 KiB as the smallest supported DMA segment size limit instead of PAGE_SIZE. This is important if the page size is larger than 4 KiB since the maximum DMA segment size for some storage controllers (e.g. eMMC) is 4 KiB." Anyway: Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>