Bug 219027
Summary: | The SCSI can't adjust Max xfer length (blocks) with different storage device | ||
---|---|---|---|
Product: | SCSI Drivers | Reporter: | LXY (983292588) |
Component: | Other | Assignee: | scsi_drivers-other |
Status: | NEW --- | ||
Severity: | high | CC: | imyxh, mkp |
Priority: | P3 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | Subsystem: | ||
Regression: | No | Bisected commit-id: |
Description
LXY
2024-07-11 02:21:51 UTC
Due to some legacy devices hanging when probing for non-existent pages the Linux USB storage driver opts out of consulting the Block Limits VPD. I suggest you create a udev rule to override /sys/block/sdN/queue/max_sectors_kb. Thanks for your reply. I've tried creating udev rules and it works. But whenever I use my USB storage device on a new PC, I find it a little inconvenient to create rules. So I'm trying to find a way to get Linux PC consulting the Block Limits VPD. Do you mean that for all Linux USB storage drivers, Linux hosts will not consult the Block Limits VPD? I actually have the firmware source code for my USB storage device, and I can make some changes I want. For example, change the VPD page it supports. Do you think it will work? Best wishes. (In reply to Martin K. Petersen from comment #1) > Due to some legacy devices hanging when probing for non-existent pages the > Linux USB storage driver opts out of consulting the Block Limits VPD. > > I suggest you create a udev rule to override > /sys/block/sdN/queue/max_sectors_kb. Thanks for your reply. I've tried creating udev rules and it works. But whenever I use my USB storage device on a new PC, I find it a little inconvenient to create rules. So I'm trying to find a way to get Linux PC consulting the Block Limits VPD. Do you mean that for all Linux USB storage drivers, Linux hosts will not consult the Block Limits VPD? I actually have the firmware source code for my USB storage device, and I can make some changes I want. For example, change the VPD page it supports. Do you think it will work? Best wishes. I stumbled across the same issue with an oscilloscope I bought and am just writing to say that I needed to set max_sectors under the scsi subsystem, not max_sectors_kb under the block subsystem. Even with max_sectors_kb set really small, I was seeing read(10) commands for 240 blocks on Wireshark. LXY, you wouldn't happen to be developing firmware for FNIRSI, would you? :) (In reply to imyxh from comment #4) > I stumbled across the same issue with an oscilloscope I bought and am just > writing to say that I needed to set max_sectors under the scsi subsystem, > not max_sectors_kb under the block subsystem. Even with max_sectors_kb set > really small, I was seeing read(10) commands for 240 blocks on Wireshark. > > LXY, you wouldn't happen to be developing firmware for FNIRSI, would you? :) What a pity. I still haven't found a solution. And I haven't developed firmware for FNIRSI. I'm developing TI's firmware. Just for my interests. (In reply to LXY from comment #5) > What a pity. I still haven't found a solution. Have you tried simply handling the invalid write/read commands by returning ILLEGAL REQUEST with INVALID FIELD IN CDB? (I know nothing about SCSI; this is just as per https://stackoverflow.com/a/33372494) (In reply to imyxh from comment #6) > (In reply to LXY from comment #5) > > What a pity. I still haven't found a solution. > > Have you tried simply handling the invalid write/read commands by returning > ILLEGAL REQUEST with INVALID FIELD IN CDB? (I know nothing about SCSI; this > is just as per https://stackoverflow.com/a/33372494) Yes, but it doesn't work for my device. |