My usb storage device has a 64kB (limited by hardware) buffer used to cache reads/writes which means it can only cache up to 128 blocks(512B) of memory. The SCSI Write-10 command has a total-blocks field that can be up to 256 blocks (128kB). When originally testing the product on Windows 11 it never writes more than 128 blocks at a time but when tested on Linux it sometimes writes more than 128 blocks, which causes the microcontroller to crash.
Is there a way to tell the host OS not to request more than 128 blocks?
I have implemented block limit VPD page, and it works well on Windows 10/11. I even set the block limit to be 64 blocks, it's OK! However, on Linux or MacOS, the host does not appear to be running the block limits command. So what can I do?
max_sectors
sysfs file in Linux? planykao.blogspot.com/2010/10/linux-usb-maxsectors.html@nickname
approach to notify the respective user.