If UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS quirk is enabled then we are always
adding 1ms delay before issuing DME commands but after experiments show
that 700us delay is more than enough. As we have atleast 20 different DME
commands issued during link initialization phase (as part of UFS device
detection), this change should help reduce the total UFS device detection
time by atleast 6ms.
Change-Id: I495cec3916dbaa974d204d790f0dbc3d6753ba6f
[subhashj@codeaurora.org: resolved trivial 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>
When UFS link is in off, put the UFS phy in reset state to reduce the
leakage from PHY.
Change-Id: I27473cbb5be19b331e0a0258c5a20546317d064c
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Currently when we try to put the link in off/disabled state during suspend,
it seems link is not being kept in low power mode. This patch fixes the
issue by putting the link in hibern8 first (so device also puts the link in
low power mode) and then stop the host controller.
Change-Id: I157c0c0c246fb83692b57a3d8f5a7868c0703cf0
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Currently it seems possible that UFS shutdown handler may race with some
other UFS transfer requests and it may disable the clocks while normal UFS
requests are in progress. Until we fix this race properly, this change
stubs out the UFS shutdown handler. Stubbing out UFS shutdown handler
shouldn't have any functional side effects as UFS device's cache should
anyway be synced by the SCSI shutdown handler. UFS shutdown handler's
main purpose was to send power down notification to UFS device but it
should work even without this explicit notification.
Change-Id: I557891c71defbde722bba1a884f608f4ba3c7da3
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Add PM QOS cpu-dma latency request to the driver.
Latency parameter value is taken from the device tree node
using an optional parameter 'qcom,cpu-dma-latency-us'.
Unless specified, a default of 200us is used.
Change-Id: I3e10da9e65fc7324897c866b0c2a40cc5e6ca070
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[subhashj@codeaurora.org: resolved trivial 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>
On Qualcomm platforms, there will be many consumers of the source clock
which also supply ref_clk to UFS Device. So even if generic UFS
driver (ufshcd) vote to turn off the source ref_clk, it's very likely that
device ref_clk is still running. Hence some of the qualcomm chipsets have
separate control bit to gate & ungate the UFS ref_clk to device. This
control bit is part of the TLMM register adddress space so it can't be
simulated at clock control bit which means UFS qcom driver has to manually
control this bit to gate or ungate the device ref_clk. This change adds
support for the same.
Change-Id: I3ee1187292eaadfdb552d33c2bb6f58922c9e501
[subhashj@codeaurora.org: resolved merge conflicts, dropped changes to
msm8994.dtsi]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts,
drop changes to include/linux/phy/phy-qcom-ufs.h]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
If UFS link is inactive then UFS PHY reference clock can be switched off
to save power. As of now, this clock is turned off only during the suspend
(runtime and system). This change extend support to turn off the PHY
reference clock during clock gating (after pre-defined idle timeout) as
well.
Change-Id: Id1f83a003e228abedf222157691998470c3f7932
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
This patch adds the profiling support for some of the time critical
operations like hibern8 enter/exit, clock gating & clock scaling.
Change-Id: I4dde1078dcd2af47f051639b03c44c423ee344fa
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
UFS driver's error handler is not printing the saved error state
information, this change fixes it.
Change-Id: I02b06a8c49a32e8ce19a5523d7ccda8cd0b9a8ac
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Immediately after successful UFS link startup, UFS link power mode would
be in PWM-G1, 1-lane, SLOW-AUTO mode. But currently we are doing few
of the DME local/peer attributes access before setting the "hba->pwr_info"
to default power mode. If we are doing link startup as part of error
recovery then old power mode might be set to FAST mode and doing DME peer
access (after link startup but before updating "hba->pwr_info" to default
power mode) unintentionally tries to switch from FAST to FAST_AUTO mode (if
UFSHCD_QUIRK_DME_PEER_ACCESS_AUTO_MODE quirk is enabled).
Above issue is fixed by setting the default power mode immediately after
successful link startup.
Change-Id: Ica332298114c9d24ecf67c7e452cebc07656415c
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[subhashj@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
UFS device requires to perform bkops (back ground operations) periodically
but host can control (via auto-bkops parameter of device) when device can
perform bkops based on its performance requirements. In general, host
would like to enable the device's auto-bkops only when it's not doing any
regular data transfer but sometimes device may not behave properly if host
keeps the auto-bkops disabled. This change adds the capability to let the
device auto-bkops always enabled except suspend.
Change-Id: I92c4531f88cb75a563568270584926eb73b53c98
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Add a write memory barrier to make sure descriptors prepared are actually
written to memory before ringing the doorbell. We have also added the
write memory barrier after ringing the doorbell register so that
controller sees the new request immediately.
Change-Id: Ifb3fb294eda81a5bccddb05227eade1b7453921a
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[gbroner@codeaurora.org: fix merge conflict]
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Clock gating timeout is generally choosen such a way that it doesn't
impact storage benchmark performance numbers. Although current timeout
value of 150ms seems high hence this change reduces it to 50ms to save
power clock gating timeout. Reducing it to 50ms doesn't affect the
storage performance benchmark numbers.
Change-Id: Ia131fc420995f44d8446f3800c19de40fedea504
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Provide an option to enable/disable hibern8 on idle functionality during
runtime. Write 1 or 0 to "hibern8_on_idle_enable" sysfs node to
enable/disable hibern8 on idle functionality.
Change-Id: Id4b6253c3c53ed71575c05596abbd4dd99821eff
[subhashj@codeaurora.org: resolved trivial 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>
In order to save power we should put the UFS link into hibern8 as soon as
UFS link is idle and power measurement of active usecases (like audio/video
playback/recording) show that putting UFS link in hibern8 @ 10ms of idle
(if not earlier) would save significant power.
Our current available solution is to do hibern8 with clock gating @idle
timeout of 150ms. As clock gating has huge latencies (7ms each in enter and
exit), we cannot bring down the idle timeout to <=10ms without degrading
UFS throughput. Hence this change has added support to enter into hibern8
with another idle timer.
Change-Id: I5a31f18fc21015d4a68236da9fd94f3f016e1d44
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[subhashj@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Set the bus vector name used for slow-auto mode to be "MIN".
For each power mode a specific bus vector name should be selected
from UFS DTS node. Slow-auto mode was missing this specification.
Change-Id: I48de8e70823b75ed3bb4eefe7828f841f2e775eb
Signed-off-by: Noa Rubens <noag@codeaurora.org>
The device can set the exception event bit in one of the response UPIU,
for example to notify the need for urgent BKOPs operation.
In such a case the host driver calls ufshcd_exception_event_handler to
handle this notification.
When trying to check the exception event status (for finding the cause for
the exception event), the device may be busy with additional SCSI commands
handling and may not respond within the 100ms timeout.
To prevent that, we need to block SCSI commands during handling of
exception events and allow retransmissions of the query requests,
in case of timeout.
CRs-Fixed: 725525
Change-Id: I67a55ad5f891a018f1dfff319233f875789805a1
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
When UFS controller reports an error a dump is printed to
aid debugging. In certain cases the print outs is too excesive
and not all the information is really needed. In addition, printing
is done from interrupt context so long prints might cause the target
to crash.
This change reduces the amount of data printed out and moves part of
the printing to the worker thread context.
Change-Id: If3e13000b8165479f2dac4d0c8e513eaa9a3e3c2
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Optimal values of local UniPro parameters like PA_Hibern8Time &
PA_TActivate can help reduce the hibern8 exit latency. If both host and
device supports UniPro ver1.6 or later, these parameters will be
automatically tuned during link startup itself. But if either host or
device doesn't support UniPro ver 1.6 or later, we have to manually tune
them. But to keep manual tuning logic simple, we will only do manual
tuning if local unipro version doesn't support ver1.6 or later.
Change-Id: I533afe9b62a35602e4e766d76912db7ac9a480b6
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Some UFS host controllers may only allow accessing the peer DME attribute
in AUTO mode (FAST AUTO or SLOW AUTO) hence we had added a quirk for
switching to AUTO power mode before accessing the peer DME attribute.
But this quirk handling was only done in UFS driver's debugfs handling
hence this patch moves it to main driver ufshcd.c so that this quirk
handling is applied to all the peer DME accesses.
As we are doing this, this patch fixes 2 more related problem:
1. Current quirk was only handling the switch from FAST to FAST AUTO hence
this change adds the handling for SLOW to SLOW AUTO mode change as well.
2. ufsdbg_dme_read() helper function was always reading the local DME
attribute hence this change fix the same.
Change-Id: I475375fb57cd27cdafe1573c14d09dc7f9a2791b
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Product name string (referred as "model" string in driver) starts from
offset 02h in Product Name String Descriptor but currently we copy the
product name from 00h offset of the descriptor which is incorrect.
This change fixes the above problem by copying the product name from
the right offset of the Product Name String Descriptor.
Change-Id: I0ab2ecc19c7383d9782ba57af6441175d2ecda46
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
While reading variable size descriptors (like string descriptor), some UFS
devices may report the "LENGTH" (field in "Transaction Specific fields" of
Query Response UPIU) same as what was requested in Query Request UPIU
instead of reporting the actual size of the variable size descriptor.
Although it's safe to ignore the "LENGTH" field for variable size
descriptors as we can always derive the length of the descriptor from
the descriptor header fields. Hence this change impose the length match
check only for fixed size descriptors (for which we always request the
correct size as part of Query Request UPIU).
Change-Id: I6be74b3e139b876275c265524cb6ee8489f3737c
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
The UTP controller has a number of internal clock gating cells (CGCs).
Internal hardware sub-modules within the UTP controller control the CGCs.
Hardware CGCs disable the clock to inactivate UTP sub-modules not involved
in a specific operation, UTP controller CGCs are by default disabled and
this change enables them (after every UFS link startup) to save some power
leakage.
Change-Id: I47bba62436c5913eb6755e59c36a11fea2e9468f
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
MSM8994v2 will have UFS controller revision 1.3.0 (major.minor.step)
hence update the quirks check for this revision as well.
Here is the list of UFS revisions (for quick reference):
8084 : 1.1.1
8994v1 : 1.2.0
8994v2 : 1.3.0
Future revisions: x.y.z where x >= 2
Change-Id: Iabc4b9117cda9d685e5a4fbaa9cc1f1bd40a5a60
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
This patch adds the debugfs capability to read the DME attribute of
peer UniPro/M-PHY. This should help for debugging.
Change-Id: I26d3675bdda8b9fdf0f9aa6b81a1ffafbd828fd0
[subhashj@codeaurora.org: resolved trivial 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>
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>
UFS device and link can be put in multiple different low power modes hence
UFS driver supports multiple different low power modes. By default UFS
driver selects the default (optimal) low power mode (which gives moderate
power savings and have relatively less enter and exit latencies) but
we might have to tune this default power mode for different chipset
platforms to meet the low power requirements/goals. Hence this patch
adds option to change default UFS low power mode (level).
Change-Id: I45aaae9f46beb3b5d38bcc6dcbd728e79677276c
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
By default UFS link operates in FAST mode which would keep the link active
until host puts the link in hibern8. Power consumption during link active
state is huge hence it's recommended to put the link in hibern8 as soon
as possible. Clock gating mechanism kicks in after pre-defined idle timeout
(150ms at this time) shorter than the runtime suspend timeout hence it
would be idle to put the UFS link in hibern8 along with clock gating.
Note that this aggressive power management approach doesn't affect the
normal storage benchmark performance numbers as clock gating idle timeout
has been choosen to not affect storage performance benchmarks.
Change-Id: I5b88a7ea2d918750a3cc9150511e25caa1e57284
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
This patch adds the debugfs capability to read the DME attribute of
local UniPro/M-PHY. This should help for debugging.
Change-Id: I2dea471f6bcf591a69206e127d3c9e3febbbc68f
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
We are unnecessarily checking for the request/task doorbell status
during hibern8 enter/exit path but it's very important to have the
minimal latencies for hibern8 enter/exit in order to achieve agressive
power management strategies for UFS. So these unecessary checks are moved
out of this hot path.
Change-Id: Ibaeddca7bd516d71eb03b02a1fc1a86f05038f08
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
This change contains:
1. Relocating the phy ufs files to reside under the phy driver since
this is the location of any file that implements the APIs presented in
the generic phy framework
2. Renaming ufs-msm-phy*.* files to be phy-qcom-ufs*.* files.
Since UFS is not used strictly in a specific set of targets but rather
its code is applicable to MSM, APQ, IPQ etc, any mentioning of "msm" in
the file name should be changed to "qcom".
Also, prefix of "phy-" is the naming convention of platform driver files
that reside in the phy driver.
3. As a result of the relocation of files into the phy driver,
a new path is created (include/linux/scsi/ufs) and there we expose ufs
header files that are being used also from the drivers/scsi/ufs
and from drivers/phy as well.
Change-Id: Ie5cb47718911ff711d9401a389f56fa508fcddf3
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
[gbroner@codeaurora.org: fix merge conflicts]
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[venkatg@codeaurora.org: resolved merge conflicts by keeping
upstream version]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
In this change the "compatible" attribute in dts files of ufsphy node
and the "phy-names" attribute in ufs node are changed to a more generic
name.
This is done for apq8084 and for msm8994 targets.
Change-Id: I46176459e9bc877456489e4728b86eecb2c16261
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
[subhashj@codeaurora.org: resolved merge conflicts & dropped changes to
apq8084.dtsi & msm8994.dtsi]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Since UFS is not used strictly in a specific set of targets but rather
its code is applicable to MSM, APQ, IPQ etc, "SCSI_UFS_MSM" should be
changed to "SCSI_UFS_QCOM".
Change-Id: I8851907f86055bb5012cb4a00f81511529ba4e03
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
[gbroner@codeaurora.org: fix merge conflicts]
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[subhashj@codeaurora.org: resolved merge conflicts, dropped changes to
apq8084_defconfig & msm8994_defconfig files]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Since UFS is not used strictly in a specific set of targets but rather
its code is applicable to MSM, APQ, IPQ etc, everywhere where
there is a use of "msm" should be replaced with "qcom".
Change-Id: Ib96259bab6de506a40876c1c121a12bb75b655c1
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>
The scm library has added support for a new secure world
interface that is more aligned to the ARMv8 SMC calling
convention. Use the new API while maintaining backward
compatibility.
Change-Id: I19b523edb7a849f50916dbbd426c92cc4c459799
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
In this change we simply remove dependencies in header files as they are
not required.
Change-Id: I73298a603f205fc102e9a39711263a10ace489e9
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
In this change a global variable which is never referenced is being
removed.
Change-Id: I2eda5157cf5e77e61d776d450cb036ca51027a08
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Following UFS core power collapse, all the TZ programmed xPU protection
settings would be lost and default protection settings won't allow access
to even UFS host controller register address space from non-secure world.
Hence we have to explicitly call into TZ to open up atleast UFS host
controller & UFS PHY register address space access to non-secure world.
Change-Id: Ic05c88e418484a10ad0d651fe2295916117c085e
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[gbroner@codeaurora.org: fix merge conflicts]
Signed-off-by: Gilad Broner <gbroner@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>
strlcpy() must get null-terminated buffer as a second argument because
inside strlcpy(), strlen() is invoked on that argument, and unterminated
buffer will result incorrect value.
In this case, str_desc_buf is a buffer that might return from
ufshcd_read_string_desc() when it is no longer null-terminated.
Therefor we must null-terminate it before sending it to strlcpy().
This change also fixes the type of the vendor variable that is read
from the device descriptor. According to UFS device specification this
field is 2 bytes wide. Its name is also changed to be compatible
with UFS device specification.
Change-Id: I3b1ba0311846881a1f3f1c984cc6f9d7109821b3
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
If UFSHCD_CAP_HIBERN8_WITH_CLK_GATING capability is enabled then UFS
driver should put the link in hibern8 along with gating of UFS related
clocks but we are hitting the deadlock in this case. UFS gating work
calls the ufshcd_uic_hibern8_enter() which would call the helper function
ufshcd_uic_pwr_ctrl(). ufshcd_uic_pwr_ctrl() calls ufshcd_hold() to make
sure that clocks are ungated which means clock ungate work would end up
waiting for the gate work to finish which causes the deadlock (as gate
work is waiting for ufshcd_uic_pwer_ctrl() to finish).
Fix this issue by letting the callers of ufshcd_uic_pwr_ctrl() to decide
if they really need to vote for the UFS clocks or not.
Change-Id: I5b9d1a1c75bbc5a7097e6cc71cd9ec6885cd271a
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[subhashj@codeaurora.org: resolved merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
When control reaches to Linux UFS driver during UFS boot mode, UFS host
controller interrupt status/enable registers may have left over settings.
In order to avoid any spurious interrupts due to these left overs, it's
important to clear these interrupt status/enable registers before enabling
UFS interrupt handling.
CRs-Fixed: 709250
Change-Id: Ibb554ca6e1bd2f69663a741f15948f80c52ce75c
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Tracing message for suspend/resume events is wrongly printing the device
state as link state and link state as device state. This change fixes the
same and while we are here, fix the device and link state string to be more
readable.
Change-Id: Ifc878b84345bf4f7be56102d4972cbac039b78ed
[subhashj@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
In this change unnecessary callbacks of the generic PHY framework
are removed and instead we call the required operations directly in
the driver.
The callbacks that were removed are:
phy_suspend(), phy_resume() and advertise_quirks()
In addition, one specific callback of the generic PHY is added:
restore_configuration() as complementary callback of save_configuration().
Change-Id: Iaf2be3ebff7a9978adae50c3f2617714106c40ac
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
This change fixes a possible info leak from kernel into userspace, since
two buffers were allocated with kmalloc() and never set their memory
region to 0.
Now, they are being allocated with kzalloc that fixes this issue
Change-Id: I23012ae8d3611c561511775362c3014b9a8be522
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
In this change there are a few fixes of possible NULL pointer access
and possible access to index that exceeds array boundaries.
Change-Id: I4a2dbc417d53931e012925978cd52e3397356ec2
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
[subhashj@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
In this change, ufs driver is using the generic PHY framework,
by calling the API "devm_phy_get" that returns handle to a generic
PHY driver.
In this change "__maybe_unused" flag of a few callbacks is removed
since those callbacks are now hooked to generic PHY driver APIs that
were added.
This change also includes the required DT changes as in this case,
the driver changes derived from the DT changes and therefor must
be placed within the same change.
Change-Id: I10e15e25d050bedca55a058b79240360564aebcd
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
[gbroner@codeaurora.org: fix merge conflict]
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
This change disables the use of the generic PHY framework API and
callbacks.
This change is only temporary and eventually UFS will use the
updated generic PHY framework API.
The reason for temporary disabling the use of the generic PHY framework,
is due to generic PHY changes in the upstream that are required to be
merged and would result into many conflicts.
In this change, calling to devm_phy_get_by_index() is removed.
Following, the API itself will be removed from the generic PHY framework,
and changes from the upstream will be cherry-picked.
Also, hooking resume, suspend and advertise_quirks is temporary removed
to avoid compilation errors.
After merging all generic PHY framework changes from the upstream,
the UFS driver will call the updated API in order to get its correct
generic PHY and will hook the local implementation of resume, suspend
and advertise_quirks into the correct hooks.
Change-Id: I2bf1007ecf079bc82f472a17538a17dc452ea447
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Boot device can be either UFS or eMMC which means if eMMC is the boot
device, probing UFS device is not desirable as it's not going to be
used after probing. Kernel command line parameter "android.bootdevice"
tells the kernel about the boot device so look at this boot device
parameter to know whether to probe UFS device or not.
Change-Id: I053b9611088263cd8de64085754c00d082aec3ed
[subhashj@codeaurora.org: resolved merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>