public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: linux-scsi@vger.kernel.org
Subject: [Bug 219027] New: The SCSI can't adjust Max xfer length (blocks) with different storage device
Date: Thu, 11 Jul 2024 02:21:51 +0000	[thread overview]
Message-ID: <bug-219027-11613@https.bugzilla.kernel.org/> (raw)

https://bugzilla.kernel.org/show_bug.cgi?id=219027

            Bug ID: 219027
           Summary: The SCSI can't adjust Max xfer length (blocks) with
                    different storage device
           Product: SCSI Drivers
           Version: 2.5
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: high
          Priority: P3
         Component: Other
          Assignee: scsi_drivers-other@kernel-bugs.osdl.org
          Reporter: 983292588@qq.com
        Regression: No

My storage device CPU has a 64kB (limited by hardware) buffer used to cache
reads/writes which means it can only cache up to 128 blocks(512Byte) of memory.

But the Linux source code says that for USB2.0, the default max_sectors=240
blocks. So the SCSI Write-10 and Read-10 command has a total-blocks field that
can be up to 240 blocks (120KB) for USB2.0. 

When originally testing the product on Windows 11 it never writes more than 128
blocks at a time. However, when tested on Linux it sometimes writes more than
128 blocks(240 blocks as setting above), which causes the usb storage device to
crash. 


Is there a way to tell the Linux host OS not to request more than 128 blocks?

My storage device's firmware has implemented block limit VPD page (page =
0xB0), and it works well on Windows 10/11. I even set the block limit to be 64
blocks, it's OK too. Because before the data transfer, the windows host issue
an SCSI inquiry order with the VPD PAGE CODE = 0xB0, so the device could
transmit the block limits information to the host. And then the windows host
could adjust the amount of data transferred.

However, on Linux or MacOS, the host does not appear to be running the block
limits command. So maybe the host doesn't know what is the block limits. Then
the write/read blocks number beyond the buffer size.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

             reply	other threads:[~2024-07-11  2:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11  2:21 bugzilla-daemon [this message]
2024-07-23  1:10 ` [Bug 219027] The SCSI can't adjust Max xfer length (blocks) with different storage device bugzilla-daemon
2024-07-23  1:56 ` bugzilla-daemon
2024-07-23  1:57 ` bugzilla-daemon
2024-08-04  4:38 ` bugzilla-daemon
2024-08-05 12:46 ` bugzilla-daemon
2024-08-05 19:28 ` bugzilla-daemon
2024-08-06  2:16 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-219027-11613@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox