Re: [PATCH] scsi: ufs: Enable bInitPowerMode of sleep

From: Evan Green
Date: Tue Sep 04 2018 - 13:01:51 EST


On Fri, Aug 10, 2018 at 4:50 PM Evan Green <evgreen@xxxxxxxxxxxx> wrote:
>
> UFS devices can be provisioned to have an initial power mode of either
> active or sleep. If the initial power mode is sleep, then the host
> controller driver must send a START STOP UNIT to the device in order
> to wake it up. Unfortunately, the device will refuse to complete other
> common low level operations, such as reading descriptors and attributes.
> The Linux driver currently fails to enumerate devices that start in
> sleep mode, because it fails to read the device descriptor from the
> unconscious device.
>
> The way the UFS controller driver is structured, this presents a bit of
> a Catch-22. In order to perform low-level enumeration of the device, the
> driver needs to send a SCSI command. But SCSI needs low-level enumeration
> of the device to be complete before full enumeration can occur.
>
> This change adds a method for sending low-level SCSI commands, modeled
> after (and reusing much of) the mechanism for sending device management
> commands. With this primitive, ufshcd_probe_hba can execute REQUEST SENSE
> to clear the Unit Attention, and then a START STOP UNIT in order to bring
> the device out of sleep mode. Only after this is done can the rest of
> enumeration, such as reading the device descriptor and geometry descriptor,
> be done.
>
> Signed-off-by: Evan Green <evgreen@xxxxxxxxxxxx>

A very gentle bump, did anyone get a chance to take a look at this?
Currently Linux can't enumerate UFS devices that start in Sleep mode.