Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: 4b512d3707ca8315062b380defa469168b2510c4
      
https://github.com/tianocore/edk2/commit/4b512d3707ca8315062b380defa469168b2510c4
  Author: Matt DeVillier <[email protected]>
  Date:   2026-09-30 (Wed, 30 Sep 2026)

  Changed paths:
    M MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c

  Log Message:
  -----------
  MdeModulePkg/ScsiDiskDxe: Don't fail media detection on FUA query error

Commit ee58614bbb ("MdeModulePkg/ScsiDiskDxe: Check Write Caching and
FUA support") added a best-effort FUA-support query to
ScsiDiskDetectMedia(). It issues a MODE SENSE(10) for the Caching mode
page via ScsiDiskFuaMode() and assigns the result to the function's
shared Status variable.

When the device rejects that command, Status is left as
EFI_DEVICE_ERROR and falls through to the function's return, even
though the media was already detected successfully (capacity read,
media present). Callers treat this as fatal:
ScsiDiskDriverBindingStart() skips installing Block I/O, and
ScsiDiskReadBlocks()/WriteBlocks() return EFI_DEVICE_ERROR. For
non-fixed devices DetectMedia() re-runs on every access, so the disk
is never usable.

This is observed on UFS (google/yaviks): the LUN answers the MODE
SENSE with a Target Failure ("UfsExecScsiCmds() fails with Target
Failure"), so a drive that was detected with edk2-stable202602 is no
longer detected with edk2-stable202605.

The FUA query is only used to refine ScsiDiskDevice->FuaMode, which
already defaults to TRUE (the prior always-set-FUA behavior). Its
failure must not affect media detection, so stop assigning its result
to Status and hoist the device-type check out of the retry loop.

Fixes: ee58614bbb ("MdeModulePkg/ScsiDiskDxe: Check Write Caching and
FUA support")

TEST=build/boot google/yaviks Chromebook with UFS, drive is detected
and bootable.

Signed-off-by: Matt DeVillier <[email protected]>



To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to