| ec3cc37b | 07-May-2025 |
Warner Losh <imp@FreeBSD.org> |
umass: Bring in small fix from NetBSD's umass
When completing a request for UFI, don't fail the request on non-zero asc/ascq values if we've done a request sense.
This idea is from umass.c 1.100 by
umass: Bring in small fix from NetBSD's umass
When completing a request for UFI, don't fail the request on non-zero asc/ascq values if we've done a request sense.
This idea is from umass.c 1.100 by mycroft. He used it to help elminate the INQUIRY_SHORT quirk that we still have. However, it will make little difference because we treat both return values the same for CBI. And it appears we have (maybe bogusly) some devices that specify this quirk that aren't CBI.
Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D49475
show more ...
|
| ff77f1ca | 07-May-2025 |
Warner Losh <imp@FreeBSD.org> |
umass: Fix a direct call to sc_transform
Call umass_std_transform instead of following the sc_transform member to get the standard transforms now that has moved to umass_std_transform. Pass NULL as
umass: Fix a direct call to sc_transform
Call umass_std_transform instead of following the sc_transform member to get the standard transforms now that has moved to umass_std_transform. Pass NULL as the CCB so that we don't stomp on the status that was just set (and allow that in std_transform).
Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D49474
show more ...
|
| 43030e34 | 07-May-2025 |
Warner Losh <imp@FreeBSD.org> |
umass: Be more consistent about how we fail bad commands
Elsewhere, if we fail a command, we use SCSI code ILLEGAL REQUEST/24/00, but here we were using the CAM code for illegal request.
Sponsored
umass: Be more consistent about how we fail bad commands
Elsewhere, if we fail a command, we use SCSI code ILLEGAL REQUEST/24/00, but here we were using the CAM code for illegal request.
Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D49473
show more ...
|
| 86de66a6 | 07-May-2025 |
Warner Losh <imp@FreeBSD.org> |
umass: Move INQUIRY and TEST UNIT READY quirks to umass_std_transform
Only doing a short inquiry and converting TUR to START STOP UNIT are the same everywhere, so move those quirks to umass_std_tran
umass: Move INQUIRY and TEST UNIT READY quirks to umass_std_transform
Only doing a short inquiry and converting TUR to START STOP UNIT are the same everywhere, so move those quirks to umass_std_transform.
Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D49472
show more ...
|
| b8e77c8b | 07-May-2025 |
Warner Losh <imp@FreeBSD.org> |
umass: Move common code into umass_std_transform
Move the length checks, and byte copying into umass_std_transform. The copies are typically small and this simplifies the code a lot. Move zeroing th
umass: Move common code into umass_std_transform
Move the length checks, and byte copying into umass_std_transform. The copies are typically small and this simplifies the code a lot. Move zeroing the buffer now to only when we change TEST UNIT READY to START STOP.
Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D49471
show more ...
|
| 49633d5d | 07-May-2025 |
Warner Losh <imp@FreeBSD.org> |
umass: Simplify umass_std_transform to eliminate fake success
Now that nothing returns (2) to fake the success of the command, eliminate that magic number by eliminating the case.
Sponsored by: Ne
umass: Simplify umass_std_transform to eliminate fake success
Now that nothing returns (2) to fake the success of the command, eliminate that magic number by eliminating the case.
Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D49469
show more ...
|
| a945c21a | 07-May-2025 |
Warner Losh <imp@FreeBSD.org> |
umass: Fail SYNCHRONIZE_CACHE for UFI
Just go ahead and fail SYNCHRONIZE_CACHE commands for UFI. This standard doesn't have a cache to flush, and the upper layers (aka da) will notice sync cache fai
umass: Fail SYNCHRONIZE_CACHE for UFI
Just go ahead and fail SYNCHRONIZE_CACHE commands for UFI. This standard doesn't have a cache to flush, and the upper layers (aka da) will notice sync cache failed and won't send it again.
Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D49468
show more ...
|
| db860eb3 | 07-May-2025 |
Warner Losh <imp@FreeBSD.org> |
umass: Document the ideal that it's better to fail bad commands
Generally, lying to the periph drivers about commands working is a bad idea. They cannot get a global insight into the actual capaciti
umass: Document the ideal that it's better to fail bad commands
Generally, lying to the periph drivers about commands working is a bad idea. They cannot get a global insight into the actual capacities of the device when commands just work. There's good reason to intercept bad commands at times, and to prevent the device from being exposed to commands that, for example, hand the device. However, upper layer periph drivers is the better place to cope with devices that don't support the commands since it can make other inferences about the device when it has wider knowledge.
But this represents a change in philosphy, so document that as well. This shift happened for some commands a while ago. Many of the quirks existed only to avoid whining errors on boot that were benign and were a big burden. So da and cd slowly stopped the whining. Except in cases where the command hangs the drive, we should limit new quirks and avoid overly broad quirks (things work, but are less performant or reliable, again mostly to avoid harmless errors that are no longer printed).
Other sims will likely need some help with this.
Differential Revision: https://reviews.freebsd.org/D49467 Sponsored by: Netflix
show more ...
|
| 966c6be6 | 07-May-2025 |
Warner Losh <imp@FreeBSD.org> |
umass: fail synchronize_cache
When we know the umass device doesn't support synchronize cache (either probed or hard quirk), fail the command w/o sending it to the device. The da driver is the only
umass: fail synchronize_cache
When we know the umass device doesn't support synchronize cache (either probed or hard quirk), fail the command w/o sending it to the device. The da driver is the only driver that sends this command, and since this filter was written has grown the ability to catch the failure and never send the command again.
In an ideal world, we'd let the da driver work this out. However, there's a lot of devices that hang when this command is sent in a way that's impossible to detect other than a black list. There's also a number that require a hard USB endpoint reset to recover, which the autoquirk code takes care of. So umass has to act as a filter.
By failing this command, we're able to avoid upper level BIO_FLUSH commands by tagging the underlying disk as not supporting that.
Differential Revision: https://reviews.freebsd.org/D49466 Sponsored by: Netflix
show more ...
|