OSDN Git Service

scsi: ufs: fix bug when changing power mode via debugfs
authorYaniv Gardi <ygardi@codeaurora.org>
Fri, 12 Sep 2014 07:28:43 +0000 (10:28 +0300)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 17:57:26 +0000 (10:57 -0700)
commit3997870e3b9e4261c5f35a483a3d81bb71a264ee
tree26f07c6c21c70cbe7f61d5e27f953e8f6131f3da
parenta343f60a4658c82cd8ca0404d10e853fde40e458
scsi: ufs: fix bug when changing power mode via debugfs

So far when required to change UFS power mode via debugfs the final power
parameters to which the UFS device is configured were determined based on
comparison between the new required power (gear, lane, mode) and qcom
pre-defined power preferences, and the minimum between them was the
configured power which is incorrect.
This change fixes this issue so what is done is a comparison between
the new required power and the device maximum supported power
parameters. If the new required power parameters exceed the device
maximum supported power, then the UFS power mode is not changed.

This change also contains a few cosmetic changes that simplify
code that is related to the above power change.

Change-Id: If08d3ce50af2dc17a6f68583dd1e7973aeb3c33a
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
[subhashj@codeaurora.org: resolved merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
drivers/scsi/ufs/debugfs.c
drivers/scsi/ufs/ufs-qcom.c
drivers/scsi/ufs/ufshcd.c
include/linux/scsi/ufs/ufshcd.h