<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/scsi/scsi.c, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/drivers/scsi/scsi.c?h=main</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/drivers/scsi/scsi.c?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2026-04-27T19:44:06Z</updated>
<entry>
<title>scsi: Enable FUA bit in WRITE10 commands</title>
<updated>2026-04-27T19:44:06Z</updated>
<author>
<name>Aswin Murugan</name>
<email>aswin.murugan@oss.qualcomm.com</email>
</author>
<published>2026-04-16T09:10:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4b42c59a34bb9364bd2228fd2fead0c5750e7abf'/>
<id>urn:sha1:4b42c59a34bb9364bd2228fd2fead0c5750e7abf</id>
<content type='text'>
Enable the Force Unit Access (FUA) bit in SCSI WRITE10 commands to
ensure writes bypass the device's volatile cache and go directly to
non-volatile storage. This provides write-through behavior that prevents
data loss during board resets.

Reviewed-by: Varadarajan Narayanan &lt;varadarajan.narayanan@oss.qualcomm.com&gt;
Signed-off-by: Aswin Murugan &lt;aswin.murugan@oss.qualcomm.com&gt;
Signed-off-by: Balaji Selvanathan &lt;balaji.selvanathan@oss.qualcomm.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>Revert "scsi: sync cache on write"</title>
<updated>2026-04-27T19:44:06Z</updated>
<author>
<name>Balaji Selvanathan</name>
<email>balaji.selvanathan@oss.qualcomm.com</email>
</author>
<published>2026-04-16T09:10:46Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=34a44dad743b557542edf5b48f789e6bb6442628'/>
<id>urn:sha1:34a44dad743b557542edf5b48f789e6bb6442628</id>
<content type='text'>
While the SYNC_CACHE approach prevents data loss during board resets,
it causes system hangs during large sparse image flashing operations.
This will be replaced with a FUA (Force Unit Access) approach in future
commit, which achieves the same data integrity goal more efficiently.

This reverts commit ffe4e6ab42d2534302be825e49a2d085acf80f30.

Signed-off-by: Balaji Selvanathan &lt;balaji.selvanathan@oss.qualcomm.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>scsi: Adjust SCSI inquiry command data length</title>
<updated>2026-03-16T16:39:26Z</updated>
<author>
<name>Macpaul Lin</name>
<email>macpaul.lin@mediatek.com</email>
</author>
<published>2026-03-05T10:23:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=041364141b7daef8318a4b8495cac8570002773f'/>
<id>urn:sha1:041364141b7daef8318a4b8495cac8570002773f</id>
<content type='text'>
Per the SCSI SPC-4 specification, the standard inquiry data length
should not be less than 36 bytes. The current implementation uses 512
bytes, which causes detection failures on some UFS devices (e.g.,
Longsys) that do not expect a transfer length exceeding the standard
inquiry size.

Align the default standard inquiry length with the Linux kernel's
implementation (see drivers/scsi/scsi_scan.c), which uses 36 bytes as
the default. Devices requiring vendor-specific inquiry lengths should
be handled through quirk settings in the future.

Signed-off-by: ht.lin &lt;ht.lin@mediatek.com&gt;
Signed-off-by: Macpaul Lin &lt;macpaul.lin@mediatek.com&gt;
Reviewed-by: Marek Vasut &lt;marek.vasut@mailbox.org&gt;
</content>
</entry>
<entry>
<title>drivers: scsi: fix double decrement of block count in 64-bit LBA path</title>
<updated>2025-12-22T22:19:39Z</updated>
<author>
<name>Balaji Selvanathan</name>
<email>balaji.selvanathan@oss.qualcomm.com</email>
</author>
<published>2025-12-22T09:01:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c0add0039825fbd40620284c202f7c4569154605'/>
<id>urn:sha1:c0add0039825fbd40620284c202f7c4569154605</id>
<content type='text'>
The scsi_read function incorrectly decrements the block count twice
when handling large disks that trigger the CONFIG_SYS_64BIT_LBA code
path (reads beyond block 268,435,455). The variable 'blks' was being
decremented both inside the 64-bit LBA block and after the successful
scsi_exec() call, causing incorrect block count tracking and data
abort errors on large capacity disks.

Signed-off-by: Balaji Selvanathan &lt;balaji.selvanathan@oss.qualcomm.com&gt;
Tested-by: Tony Dinh &lt;mibodhi@gmail.com&gt;
</content>
</entry>
<entry>
<title>scsi: Fix the name string memory leak during scsi scan</title>
<updated>2025-11-11T17:54:48Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2025-11-05T11:07:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c6e8befd4b8da4a99c779a0fddd92690e2f611fa'/>
<id>urn:sha1:c6e8befd4b8da4a99c779a0fddd92690e2f611fa</id>
<content type='text'>
There is a memory leak during the scsi scan process due to the
strdup'ed name string is never freed. Actually it is unnecessary
to pass a strdup'ed name string to blk_create_devicef() as we can
use the name string on the stack directly.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Reviewed-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
</content>
</entry>
<entry>
<title>drivers: scsi: fix inaccurate block count reporting in scsi operations</title>
<updated>2025-08-07T17:14:23Z</updated>
<author>
<name>Balaji Selvanathan</name>
<email>balaji.selvanathan@oss.qualcomm.com</email>
</author>
<published>2025-07-28T16:21:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b32dda34506b4f486bc803d0c7251f987edd2455'/>
<id>urn:sha1:b32dda34506b4f486bc803d0c7251f987edd2455</id>
<content type='text'>
The 'blks' variable in scsi_read/write/erase functions is updated
regardless of pass/fail of the scsi operation . If the scsi operation
fails, 'blkcnt' is updated using an incorrect value of 'blks'. This
wrong 'blkcnt' is returned to the caller and it assumes all blocks were
processed correctly.

Fix this by updating the 'blks' variable only if the scsi operation
succeeds.

Signed-off-by: Balaji Selvanathan &lt;balaji.selvanathan@oss.qualcomm.com&gt;
Signed-off-by: Varadarajan Narayanan &lt;quic_varada@quicinc.com&gt;
Reviewed-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
</content>
</entry>
<entry>
<title>scsi: Make static functions consistent using lbaint_t</title>
<updated>2025-07-14T21:16:43Z</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-07-07T14:12:20Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=41713b99671f6775c18d70d31ccd8b27e438abe1'/>
<id>urn:sha1:41713b99671f6775c18d70d31ccd8b27e438abe1</id>
<content type='text'>
The static helper functions are inconsistent in their use of their third
parameter which is used to pass a block count. Keep consistency by
always using lbaint_t here. This will fix an issue where two left shifts
were overflowing the variable type in use.

This issue found by Smatch

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
<entry>
<title>drivers: scsi: Add 'erase' support</title>
<updated>2025-04-11T02:55:53Z</updated>
<author>
<name>Varadarajan Narayanan</name>
<email>quic_varada@quicinc.com</email>
</author>
<published>2025-04-01T10:09:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7dd49a9264a6de349343a873e465e1a5fcd459e3'/>
<id>urn:sha1:7dd49a9264a6de349343a873e465e1a5fcd459e3</id>
<content type='text'>
UFS devices uses the block and scsi frameworks. Enable UFS erase
support by adding erase support to SCSI.

Signed-off-by: Varadarajan Narayanan &lt;quic_varada@quicinc.com&gt;
</content>
</entry>
<entry>
<title>scsi: sync cache on write</title>
<updated>2025-04-10T20:21:41Z</updated>
<author>
<name>Caleb Connolly</name>
<email>caleb.connolly@linaro.org</email>
</author>
<published>2025-03-26T12:24:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ffe4e6ab42d2534302be825e49a2d085acf80f30'/>
<id>urn:sha1:ffe4e6ab42d2534302be825e49a2d085acf80f30</id>
<content type='text'>
We don't have a mechanism to safely shutdown block devices prior to a
baord reset or driver removal. Prevent data loss by synchronizing the
SCSI cache after every write.

In particular this solves the issue of capsule updates looping on some
devices because the board resets immediately after deleting the capsule
file and this write wouldn't be flushed in time.

This may impact NAND wear, but should be negligible given the usecases
for disk write in U-Boot.

Signed-off-by: Caleb Connolly &lt;caleb.connolly@linaro.org&gt;
Reviewed-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
</content>
</entry>
<entry>
<title>scsi: fix typo in setup_read_ext()</title>
<updated>2025-04-10T20:21:41Z</updated>
<author>
<name>Caleb Connolly</name>
<email>caleb.connolly@linaro.org</email>
</author>
<published>2025-03-26T12:24:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0cd3c1e7d0201cf9e4dbcac1e0179604f4461062'/>
<id>urn:sha1:0cd3c1e7d0201cf9e4dbcac1e0179604f4461062</id>
<content type='text'>
This clears the 6th byte of cmd twice rather than setting the 9th byte
to 0. Fix it.

The only other command that sets the 9th byte is the 64-bit read, so
this likely never caused issues in practise.

Signed-off-by: Caleb Connolly &lt;caleb.connolly@linaro.org&gt;
Reviewed-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
</content>
</entry>
</feed>
