- 21 8月, 2020 5 次提交
-
-
由 Can Guo 提交于
Commit 5586dd8e ("scsi: ufs: Fix a race condition between error handler and runtime PM ops") moves the ufshcd_scsi_block_requests() inside err_handler() but forgets to remove the ufshcd_scsi_unblock_requests() in the early return path. Correct the mistake. Link: https://lore.kernel.org/r/1597798958-24322-1-git-send-email-cang@codeaurora.org Fixes: 5586dd8e ("scsi: ufs: Fix a race condition between error handler and runtime PM ops") Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Reviewed-by: Hongwu Su<hongwus@codeaurora.org> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Kiwoong Kim 提交于
Currently, the UFS driver busy waits for fDeviceInit to be cleared. Provide an upper bound and sleep between attempts instead of busy waiting. Link: https://lore.kernel.org/r/1597053747-75171-1-git-send-email-kwmad.kim@samsung.comTested-by: NKiwoong Kim <kwmad.kim@samsung.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NKiwoong Kim <kwmad.kim@samsung.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bean Huo 提交于
Link: https://lore.kernel.org/r/20200814095034.20709-3-huobean@gmail.comReviewed-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bean Huo 提交于
ufshcd_comp_devman_upiu() was poorly named leading people to think it was a completion function. Rename it to ufshcd_compose_devman_upiu(). Link: https://lore.kernel.org/r/20200814095034.20709-2-huobean@gmail.comReviewed-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Acked-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Can Guo 提交于
In current UFS task abort hook, namely ufshcd_abort(), if one task is aborted successfully, clk_gating.active_reqs held by this task is not decreased, which makes clk_gating.active_reqs stay above zero forever, thus clock gating would never happen. Instead of releasing resources of one task "manually", use the existing func __ufshcd_transfer_req_compl(). This change also eliminates a possible race of scsi_dma_unmap() from the real completion in IRQ handler path. Link: https://lore.kernel.org/r/1596975355-39813-10-git-send-email-cang@codeaurora.org Fixes: 1ab27c9c ("ufs: Add support for clock gating") CC: Stanley Chu <stanley.chu@mediatek.com> Reviewed-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 18 8月, 2020 6 次提交
-
-
由 Can Guo 提交于
The current IRQ handler blocks SCSI requests before scheduling eh_work, when error handler calls pm_runtime_get_sync, if ufshcd_suspend/resume sends a SCSI cmd, most likely the SSU cmd, since SCSI requests are blocked, pm_runtime_get_sync() will never return because ufshcd_suspend/resume is blocked by the SCSI cmd. - In queuecommand path, hba->ufshcd_state check and ufshcd_send_command should stay under the same spin lock. This is to make sure that no more commands leak into doorbell after hba->ufshcd_state is changed. - Don't block SCSI requests before error handler starts to run, let error handler block SCSI requests when it is ready to start error recovery. - Don't let SCSI layer keep requeuing the SCSI cmds sent from HBA runtime PM ops, let them pass or fail them. Let them pass if eh_work is scheduled due to non-fatal errors. Fail them if eh_work is scheduled due to fatal errors, otherwise the cmds may eventually time out since UFS is in bad state, which gets error handler blocked for too long. If we fail the SCSI cmds sent from HBA runtime PM ops, HBA runtime PM ops fails too, but it does not hurt since error handler can recover HBA runtime PM error. Link: https://lore.kernel.org/r/1596975355-39813-9-git-send-email-cang@codeaurora.orgReviewed-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Can Guo 提交于
Performing dumps in the IRQ handler causes system stability issues. Move dumps to the error handler and only print basic host registers here. Link: https://lore.kernel.org/r/1596975355-39813-8-git-send-email-cang@codeaurora.orgReviewed-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Can Guo 提交于
The current error handler can not recover HBA runtime PM error if ufshcd_suspend/resume has failed due to UFS errors, e.g. hibern8 enter/exit error or SSU cmd error. When this happens, error handler may fail performing a full reset and restore because error handler always assumes that power, IRQs and clocks are ready after pm_runtime_get_sync returns, but actually they are not if ufshcd_resume fails[1]. If ufschd_suspend/resume fails due to UFS errors, runtime PM framework saves the error value to dev.power.runtime_error. After that, HBA dev runtime suspend/resume would not be invoked anymore unless runtime_error is cleared[2]. In case of ufshcd_suspend/resume fails due to UFS errors, for scenario [1], error handler cannot assume anything of pm_runtime_get_sync, meaning error handler should explicitly turn ON powers, IRQs and clocks again. To get the HBA runtime PM work as regard for scenario [2], error handler can clear the runtime_error by calling pm_runtime_set_active() if full reset and restore succeeds. And, more important, if pm_runtime_set_active() returns no error, which means runtime_error has been cleared, we also need to resume those scsi devices under HBA in case any of them has failed to be resumed due to HBA runtime resume failure. This is to unblock blk_queue_enter in case there are bios waiting inside it. Link: https://lore.kernel.org/r/1596975355-39813-7-git-send-email-cang@codeaurora.orgReviewed-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Can Guo 提交于
Error recovery can be invoked from multiple code paths, including hibern8 enter/exit (from ufshcd_link_recovery), ufshcd_eh_host_reset_handler() and eh_work scheduled from IRQ context. Ultimately, these paths are all trying to invoke ufshcd_reset_and_restore() in either a synchronous or asynchronous manner. This causes problems: - If link recovery happens during ungate work, ufshcd_hold() would be called recursively. Although commit 53c12d0e ("scsi: ufs: fix error recovery after the hibern8 exit failure") fixed a deadlock due to recursive calls of ufshcd_hold() by adding a check of eh_in_progress into ufshcd_hold, this check allows eh_work to run in parallel while link recovery is running. - Similar concurrency can also happen when error recovery is invoked from ufshcd_eh_host_reset_handler and ufshcd_link_recovery. - Concurrency can even happen between eh_works. eh_work, currently queued on system_wq, is allowed to have multiple instances running in parallel, but we don't have proper protection for that. If any of above concurrency scenarios happen, error recovery would fail and lead ufs device and host into bad states. To fix the concurrency problem, this change queues eh_work on a single threaded workqueue and removes link recovery calls from the hibern8 enter/exit path. In addition, make use of eh_work in eh_host_reset_handler instead of calling ufshcd_reset_and_restore. This unifies the UFS error recovery mechanism. According to the UFSHCI JEDEC spec, hibern8 enter/exit error occurs when the link is broken. This essentially applies to any power mode change operations (since they all use PACP_PWR cmds in UniPro layer). So, if a power mode change operation (including AH8 enter/exit) fails, mark link state as UIC_LINK_BROKEN_STATE and schedule the eh_work. In this case, error handler needs to do a full reset and restore to recover the link back to active. Before the link state is recovered to active, ufshcd_uic_pwr_ctrl simply returns -ENOLINK to avoid more errors. Link: https://lore.kernel.org/r/1596975355-39813-6-git-send-email-cang@codeaurora.orgReviewed-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Can Guo 提交于
Information about the last interrupt status and timestamp is helpful when debugging system stability issues (IRQ starvation, for instance). Add this information to ufshcd_print_host_state() output. In addition, UFS device information such as model name and firmware version also comes in handy during debugging. This is printed as well. Link: https://lore.kernel.org/r/1596975355-39813-5-git-send-email-cang@codeaurora.orgReviewed-by: NAvri Altman <avri.altman@wdc.com> Reviewed-by: NHongwu Su <hongwus@codeaurora.org> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Reviewed-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Can Guo 提交于
Clock gating can be turned on/off selectively which means the associated state information is only correct if the feature is enabled. This change makes sure that we only look at state of clk-gating if it is enabled. Link: https://lore.kernel.org/r/1596975355-39813-2-git-send-email-cang@codeaurora.orgReviewed-by: NAvri Altman <avri.altman@wdc.com> Reviewed-by: NHongwu Su <hongwus@codeaurora.org> Reviewed-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 31 7月, 2020 1 次提交
-
-
由 Stanley Chu 提交于
Some UFS devices require delay after VCC power rail is turned off. Introduce a device quirk "DELAY_AFTER_LPM" to add 5ms delay after VCC power-off during suspend flow. Link: https://lore.kernel.org/r/20200729051840.31318-2-stanley.chu@mediatek.comReviewed-by: NAndy Teng <andy.teng@mediatek.com> Reviewed-by: NPeter Wang <peter.wang@mediatek.com> Reviewed-by: NCan Guo <cang@codeaurora.org> Acked-by: NAvri Altman <Avri.Altman@wdc.com> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 14 7月, 2020 2 次提交
-
-
由 Stanley Chu 提交于
Add missing setup_xfer_req() call in ufshcd_issue_devman_upiu_cmd() in ufs-bsg path. Relocate existing setup_xfer_req() calls to a common place, i.e., ufshcd_send_command(), to simplify the driver. Link: https://lore.kernel.org/r/20200706060707.32608-3-stanley.chu@mediatek.comAcked-by: NAvri Altman <Avri.Altman@wdc.com> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
Simplify recording command completion time in __ufshcd_transfer_req_compl() by assigning lrbp->compl_time_stamp in a unified location. Link: https://lore.kernel.org/r/20200706060707.32608-2-stanley.chu@mediatek.comAcked-by: NAvri Altman <Avri.Altman@wdc.com> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 08 7月, 2020 3 次提交
-
-
由 Satya Tangirala 提交于
Wire up ufshcd.c with the UFS Crypto API, the block layer inline encryption additions and the keyslot manager. Many existing inline crypto devices require some additional behaviour not specified in the UFSHCI v2.1 specification - as such the vendor specific drivers will need to be updated where necessary to make it possible to use those devices. Some of these changes have already been proposed upstream, such as for the Qualcomm 845 SoC at https://lkml.kernel.org/linux-scsi/20200501045111.665881-1-ebiggers@kernel.org/ and for ufs-mediatek at https://lkml.kernel.org/linux-scsi/20200304022101.14165-1-stanley.chu@mediatek.com/ This patch has been tested on the db845c, sm8150-mtp and sm8250-mtp (which have Qualcomm chipsets) and on some mediatek chipsets using these aforementioned vendor specific driver updates. Link: https://lore.kernel.org/r/20200706200414.2027450-4-satyat@google.comReviewed-by: NEric Biggers <ebiggers@google.com> Reviewed-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NSatya Tangirala <satyat@google.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Satya Tangirala 提交于
Add the crypto registers and structs defined in v2.1 of the JEDEC UFSHCI specification in preparation to add support for inline encryption to UFS. Link: https://lore.kernel.org/r/20200706200414.2027450-2-satyat@google.comReviewed-by: NEric Biggers <ebiggers@google.com> Reviewed-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NSatya Tangirala <satyat@google.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bean Huo 提交于
According to the UFS Spec, the Flags field in the UPIU is one byte in size, not 4. Change it to be u8. Link: https://lore.kernel.org/r/20200706123936.24799-1-huobean@gmail.comTested-by: NAlim Akhtar <alim.akhtar@samsung.com> Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 27 6月, 2020 1 次提交
-
-
由 Stanley Chu 提交于
If a UFS device is not qualified to use WriteBooster, either due to wrong UFS version or device-specific quirks, then the capability in host shall be disabled to prevent any WriteBooster operations in the future. Link: https://lore.kernel.org/r/20200625030430.25048-1-stanley.chu@mediatek.com Fixes: 3d17b9b5 ("scsi: ufs: Add write booster feature support") Tested-by: NSteev Klimaszewski <steev@kali.org> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Reviewed-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 16 6月, 2020 15 次提交
-
-
由 Stanley Chu 提交于
The UFS load calculation is based on "total_time" and "busy_time" in a devfreq window. However, the source of time is different for both parameters: "busy_time" is assigned from "jiffies" thus has different accuracy from "total_time" which is assigned from ktime_get(). In addition, the time of window boundary is not exactly the same as the starting busy time in this window if UFS is actually busy in the beginning of the window. A similar accuracy error may also happen for the end of busy time in current window. To guarantee the precision of load calculation, we need to 1. Align time accuracy of both devfreq_dev_status.total_time and devfreq_dev_status.busy_time. For example, use "ktime_get()" directly. 2. Align the following timelines: - The beginning time of devfreq windows - The beginning of busy time in a new window - The end of busy time in the current window Link: https://lore.kernel.org/r/20200611101043.6379-1-stanley.chu@mediatek.com Fixes: a3cd5ec5 ("scsi: ufs: add load based scaling of UFS gear") Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
Use the ftrace infrastructure to conditionally trace UFS UIC command events. New trace event "ufshcd_uic_command" is created, which samples the following UFS UIC command data: - Device name - Optional identification string - UIC command opcode - UIC command argument1 - UIC command argument2 - UIC command argement3 Usage: echo 1 > /sys/kernel/debug/tracing/events/ufs/enable cat /sys/kernel/debug/tracing/trace_pipe Link: https://lore.kernel.org/r/20200615072235.23042-3-stanley.chu@mediatek.comAcked-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
Clean up the following items: - Sort vendor names in alphabetical order - Squash quirks as compact as possible in device table to enhance performance of the lookup - Sort device quirks in alphabetical order Link: https://lore.kernel.org/r/20200612012625.6615-3-stanley.chu@mediatek.comReviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
It is confirmed that Micron device needs DELAY_BEFORE_LPM quirk to have a delay before VCC is powered off. Sdd Micron vendor ID and this quirk for Micron devices. Link: https://lore.kernel.org/r/20200612012625.6615-2-stanley.chu@mediatek.comReviewed-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bean Huo 提交于
Add SPDX GPL-2.0 to UFS driver files that specified the GPL version 2 license, remove the full boilerplate text. Link: https://lore.kernel.org/r/20200605200520.20831-2-huobean@gmail.comReviewed-by: NTomas Winkler <tomas.winkler@intel.com> Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bean Huo 提交于
For UFS 3.1, the normal unit descriptor is 10 bytes larger than the RPMB unit. However, both descriptors share the same desc_idn, to cover both unit descriptors with one length, we choose the normal unit descriptor length by desc_index. Link: https://lore.kernel.org/r/20200603091959.27618-6-huobean@gmail.comReviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bean Huo 提交于
At UFS initialization stage, to get the length of the descriptor, ufshcd_read_desc_length() was being called 6 times. Instead, we will capture the descriptor size the first time we'll read it. Delete unnecessary redundant code, remove ufshcd_read_desc_length(), ufshcd_init_desc_sizes(), and boost UFS initialization. Link: https://lore.kernel.org/r/20200603091959.27618-5-huobean@gmail.comAcked-by: NAvri Altman <avri.altman@wdc.com> Reviewed-by: NBart van Assche <bvanassche@acm.org> Reviewed-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bean Huo 提交于
If param_offset is not 0, the memcpy length shouldn't be the true descriptor length. Link: https://lore.kernel.org/r/20200603091959.27618-4-huobean@gmail.comAcked-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bean Huo 提交于
Delete ufshcd_read_desc(). Instead, let caller directly call ufshcd_read_desc_param(). Link: https://lore.kernel.org/r/20200603091959.27618-3-huobean@gmail.comReviewed-by: NAvri Altman <avri.altman@wdc.com> Reviewed-by: NBart van Assche <bvanassche@acm.org> Reviewed-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bean Huo 提交于
For the UFS device, the maximum descriptor size is 255, max_t called on ufs_get_device_desc() is useless. Link: https://lore.kernel.org/r/20200603091959.27618-2-huobean@gmail.comReviewed-by: NStanley Chu <stanley.chu@mediatek.com> Acked-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NBart van Assche <bvanassche@acm.org> Signed-off-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Kiwoong Kim 提交于
Some controller like Exynos determines if FATAL ERROR (0x7) in OCS field in UTRD occurs for values other than GOOD (0x0) in STATUS field in response upiu as well as errors that a host controller can't cover. This patch is to prevent from reporting command results in those cases. Link: https://lore.kernel.org/r/20200528011658.71590-6-alim.akhtar@samsung.comReviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NKiwoong Kim <kwmad.kim@samsung.com> Signed-off-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Alim Akhtar 提交于
Some UFS host controllers like Exynos uses granularities of PRDT length and offset as bytes, whereas others use actual segment count. Link: https://lore.kernel.org/r/20200528011658.71590-5-alim.akhtar@samsung.comReviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NKiwoong Kim <kwmad.kim@samsung.com> Signed-off-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Alim Akhtar 提交于
Some host controllers don't support host controller enable via HCE. Link: https://lore.kernel.org/r/20200528011658.71590-4-alim.akhtar@samsung.comReviewed-by: NCan Guo <cang@codeaurora.org> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NSeungwon Jeon <essuuj@gmail.com> Signed-off-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Alim Akhtar 提交于
Some host controllers support interrupt aggregation but don't allow resetting counter and timer in software. Link: https://lore.kernel.org/r/20200528011658.71590-3-alim.akhtar@samsung.comReviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NSeungwon Jeon <essuuj@gmail.com> Signed-off-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Alim Akhtar 提交于
With the correct behavior, setting the bit to '0' indicates clear and '1' indicates no change. If host controller handles this the other way around, UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR can be used. Link: https://lore.kernel.org/r/20200528011658.71590-2-alim.akhtar@samsung.comReviewed-by: NCan Guo <cang@codeaurora.org> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NSeungwon Jeon <essuuj@gmail.com> Signed-off-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 03 6月, 2020 2 次提交
-
-
由 Stanley Chu 提交于
In ufshcd_probe_hba(), all BKOP SW tracking variables can be reset together in ufshcd_force_reset_auto_bkops(), thus urgent_bkop_lvl initialization in the beginning of ufshcd_probe_hba() can be merged into ufshcd_force_reset_auto_bkops(). Link: https://lore.kernel.org/r/20200530141200.4616-1-stanley.chu@mediatek.comReviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Can Guo 提交于
Urgent bkops level is used to compare against actual bkops status read from UFS device. Urgent bkops level is set during initialization and might be updated in exception event handler during runtime. But it should not be updated to the actual bkops status every time when auto bkops is toggled. Otherwise, if urgent bkops level is updated to 0, auto bkops shall always be kept enabled. Link: https://lore.kernel.org/r/1590632686-17866-1-git-send-email-cang@codeaurora.org Fixes: 24366c2a ("scsi: ufs: Recheck bkops level if bkops is disabled") Reviewed-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 27 5月, 2020 4 次提交
-
-
由 Stanley Chu 提交于
Currently UFS host driver promises VCC supply if UFS device needs to do WriteBooster flush during runtime suspend. However the UFS specification mentions: "While the flushing operation is in progress, the device is in Active power mode." Therefore UFS host driver needs to promise more: Keep UFS device as "Active power mode", otherwise UFS device shall not do any flush if device enters Sleep or PowerDown power mode. Similarly, the same promises shall be applied if device needs urgent BKOP during runtime suspend. Fix this by not changing device power mode if WriteBooster flush or urgent BKOP is required in ufshcd_suspend(). Now, if device finishes its job but is not resumed for a very long time, system will have unnecessary power drain because VCC is still supplied. A method to re-check the threshold of keeping VCC supply is required to fix the power drain. However, the threshold re-check needs to re-activate the link first because the decision depends on the latest device status. Also introduce a delayed work to force runtime resume after a certain delay during runtime suspend. This makes threshold re-check happen natually in the entry of the next runtime-suspend. The device can continue its WriteBooster flush or urgent BKOP jobs soon after resumed if device has no upcoming requests and link enters hibern8 state either by Auto-Hibern8 or hibern8 during clk-gating scheme. This solution not only prevents power drain but also makes as much use of time as possible for device's background jobs. Link: https://lore.kernel.org/r/20200522083212.4008-5-stanley.chu@mediatek.comReviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
For WriteBooster feature related attributes, the index used by query shall be LUN ID if LU Dedicated buffer mode is enabled. Link: https://lore.kernel.org/r/20200522083212.4008-4-stanley.chu@mediatek.comReviewed-by: NAvri Altman <avri.altman@wdc.com> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
According to the UFS specification, WriteBooster is officially supported by UFS 2.2. Since UFS 2.2 specification has been finalized in JEDEC and such devices have also showed up in the market, modify the checking rule for ufshcd_wb_probe() to allow these devices to enable WriteBooster. Link: https://lore.kernel.org/r/20200522083212.4008-3-stanley.chu@mediatek.comReviewed-by: NAvri Altman <avri.altman@wdc.com> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
The whole UFS host instance has been zero-initialized by scsi_host_alloc(), thus UFS driver does not need to clear "dev_info" member specifically in ufshcd_device_params_init(). Simply remove the unnecessary code. Link: https://lore.kernel.org/r/20200522083212.4008-2-stanley.chu@mediatek.comReviewed-by: NAvri Altman <avri.altman@wdc.com> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 20 5月, 2020 1 次提交
-
-
由 Bart Van Assche 提交于
The ufshcd_wait_for_register() function either sleeps or spins until the specified register has reached the desired value. Busy-waiting is not only considered a bad practice but also has a bad impact on energy consumption. Always sleep instead of spinning by making sure that all ufshcd_wait_for_register() calls happen from a context where it is allowed to sleep. The only function call that has to be moved is the ufshcd_hba_stop() call in ufshcd_host_reset_and_restore(). Link: https://lore.kernel.org/r/20200507222750.19113-1-bvanassche@acm.org Cc: Can Guo <cang@codeaurora.org> Cc: Avri Altman <avri.altman@wdc.com> Cc: Bean Huo <beanhuo@micron.com> Cc: Alim Akhtar <alim.akhtar@samsung.com> Cc: Asutosh Das <asutoshd@codeaurora.org> Tested-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NBart Van Assche <bvanassche@acm.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-