Re: [PATCH v7 8/8] scsi: ufs: Select INITIAL adapt for HS Gear4

From: Can Guo
Date: Fri Feb 07 2020 - 00:10:45 EST


On 2020-02-07 10:56, Can Guo wrote:
On 2020-02-06 21:20, Avri Altman wrote:
Hi Can,


ADAPT is added specifically for HS Gear4 mode only, select INITIAL adapt
before do power mode change to G4 and select no adapt before switch to
non-G4 modes.

UFSHCI 3.0 says:
7.4.1 Adapt
The use of Adapt isn't mandatory but the specification provides some
guidelines on its use.
The HCI should perform an Initial Adapt in the following cases if the
link is running at HS-G4
speed:
- If DME_RESET is initiated.
- If an unused line is activated for HS-G4.
- If UECDME.EC is triggered with bit 3 set to '1'.
- If a change between Rate A and Rate B in HS-G4 is performed.

If it's not mandatory - why are we setting this for all vendors on all
platforms?
Or am I miss-reading the spec?

Thanks,
Avri

Hi Avri,

Yes, it is not mandatory, but I don't know a flash vendor that
refuses to use ADAPT so far, it is even recommended by flash vendors.
So there is no meaning of adding a specific quirk for it, as all flash
vendors need this quirk. Otherwise, we would need to add another vops
to allow platform vendors to control it before send PMC.

Any other suggestions?

FYI, ADAPT sequence is used to train an M-RX equalizer. It gives both
sides better signal integrity against the influence caused by
temperature and voltage variations. ADAPT is also used by Quality of
Service Monitoring for HS-G4.

As for the usage of it, here is just setting the type of it before
PMC to HS-G4, HW will use ADAPT, only if both sides support ADAPT,
when it is required as what the spec is saying.

Thanks,

Can Guo.

Hi Avri,

I will drop this one for now as it may take some time to nail down it.
I will come back with a separate patch series for it later.

Thanks for the review.

Can Guo.