- 20 12月, 2019 4 次提交
-
-
由 Can Guo 提交于
To be on the safe side, do not touch lrb after clearing its slot in the lrb_in_use bitmap to avoid messing up the next task which would possibly occupy this lrb. [mkp: applied by hand] Link: https://lore.kernel.org/r/1574751214-8321-4-git-send-email-cang@qti.qualcomm.com Reviewed by: Avri Altman <avri.altman@wdc.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>
-
由 Asutosh Das 提交于
bkops level should be rechecked upon receiving an exception. Currently the level is being cached and never updated. Update bkops each time the level is checked. Also do not use the cached bkops level value if it is disabled and then enabled. Fixes: afdfff59 (scsi: ufs: handle non spec compliant bkops behaviour by device) Link: https://lore.kernel.org/r/1574751214-8321-2-git-send-email-cang@qti.qualcomm.comReviewed-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Tested-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bart Van Assche 提交于
Manage TMF tags with blk_{get,put}_request() instead of ufshcd_get_tm_free_slot() / ufshcd_put_tm_slot(). Store a per-request completion pointer in request.end_io_data instead of using a waitqueue to report TMF completion. Cc: Can Guo <cang@codeaurora.org> Cc: Stanley Chu <stanley.chu@mediatek.com> Cc: Avri Altman <avri.altman@wdc.com> Cc: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20191209181309.196233-3-bvanassche@acm.orgTested-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NBart Van Assche <bvanassche@acm.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bart Van Assche 提交于
Instead of tracking which tags are in use in the ufs_hba.lrb_in_use bitmask, rely on the block layer tag allocation mechanism. This patch removes the following busy-waiting loop if ufshcd_issue_devman_upiu_cmd() and the block layer accidentally allocate the same tag for a SCSI request: * ufshcd_queuecommand() returns SCSI_MLQUEUE_HOST_BUSY. * The SCSI core requeues the SCSI command. Cc: Can Guo <cang@codeaurora.org> Cc: Stanley Chu <stanley.chu@mediatek.com> Cc: Avri Altman <avri.altman@wdc.com> Cc: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20191209181309.196233-2-bvanassche@acm.orgTested-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NBart Van Assche <bvanassche@acm.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 20 11月, 2019 3 次提交
-
-
由 Subhash Jadavani 提交于
During clock gating (ufshcd_gate_work()), we first put the link hibern8 by calling ufshcd_uic_hibern8_enter() and if ufshcd_uic_hibern8_enter() returns success (0) then we gate all the clocks. Now let’s zoom in to what ufshcd_uic_hibern8_enter() does internally: It calls __ufshcd_uic_hibern8_enter() and if failure is encountered, link recovery shall put the link back to the highest HS gear and returns success (0) to ufshcd_uic_hibern8_enter() which is the issue as link is still in active state due to recovery! Now ufshcd_uic_hibern8_enter() returns success to ufshcd_gate_work() and hence it goes ahead with gating the UFS clock while link is still in active state hence I believe controller would raise UIC error interrupts. But when we service the interrupt, clocks might have already been disabled! This change fixes for this by returning failure from __ufshcd_uic_hibern8_enter() if recovery succeeds as link is still not in hibern8, upon receiving the error ufshcd_hibern8_enter() would initiate retry to put the link state back into hibern8. Link: https://lore.kernel.org/r/1573798172-20534-8-git-send-email-cang@codeaurora.orgReviewed-by: NAvri Altman <avri.altman@wdc.com> Reviewed-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NSubhash Jadavani <subhashj@codeaurora.org> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Asutosh Das 提交于
This change attempts to abort gating of clocks if a request to turn-on clocks is pending. This would in turn avoid turning OFF and back ON the clocks. Link: https://lore.kernel.org/r/1573798172-20534-7-git-send-email-cang@codeaurora.orgReviewed-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NAsutosh Das <asutoshd@codeaurora.org> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Venkat Gopalakrishnan 提交于
Return IRQ_HANDLED only if the irq is really handled, this will help in catching spurious interrupts that go unhandled. Link: https://lore.kernel.org/r/1573798172-20534-6-git-send-email-cang@codeaurora.orgReviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NVenkat Gopalakrishnan <venkatg@codeaurora.org> Signed-off-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 19 11月, 2019 3 次提交
-
-
由 Can Guo 提交于
ufshcd_print_host_regs() can be called by interrupt handler, but it may sleep due to ufshcd_dump_regs() allocates the dump buffer memory with flag GFP_KERNEL. Fix it by changing GFP_KERNEL to GFP_ATMOIC. Link: https://lore.kernel.org/r/1573798172-20534-5-git-send-email-cang@codeaurora.orgReviewed-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 提交于
Fix up possible unclocked register access to auto hibern8 register in resume path and through sysfs entry. Meanwhile, enable auto hibern8 only after device is fully initialized in probe path. Link: https://lore.kernel.org/r/1573798172-20534-4-git-send-email-cang@codeaurora.orgReviewed-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>
-
由 Can Guo 提交于
In order to recover from hibern8 exit failure, perform a reset in link recovery path before issuing link start-up. Link: https://lore.kernel.org/r/1573798172-20534-2-git-send-email-cang@codeaurora.orgReviewed-by: NBean Huo <beanhuo@micron.com> 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>
-
- 13 11月, 2019 2 次提交
-
-
由 Bean Huo 提交于
In function __ufshcd_query_descriptor(), in the event of an error happening, we directly goto out_unlock and forget to invaliate hba->dev_cmd.query.descriptor pointer. This results in this pointer still valid in ufshcd_copy_query_response() for other query requests which go through ufshcd_exec_raw_upiu_cmd(). This will cause __memcpy() crash and system hangs. Log as shown below: Unable to handle kernel paging request at virtual address ffff000012233c40 Mem abort info: ESR = 0x96000047 Exception class = DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000047 CM = 0, WnR = 1 swapper pgtable: 4k pages, 48-bit VAs, pgdp = 0000000028cc735c [ffff000012233c40] pgd=00000000bffff003, pud=00000000bfffe003, pmd=00000000ba8b8003, pte=0000000000000000 Internal error: Oops: 96000047 [#2] PREEMPT SMP ... Call trace: __memcpy+0x74/0x180 ufshcd_issue_devman_upiu_cmd+0x250/0x3c0 ufshcd_exec_raw_upiu_cmd+0xfc/0x1a8 ufs_bsg_request+0x178/0x3b0 bsg_queue_rq+0xc0/0x118 blk_mq_dispatch_rq_list+0xb0/0x538 blk_mq_sched_dispatch_requests+0x18c/0x1d8 __blk_mq_run_hw_queue+0xb4/0x118 blk_mq_run_work_fn+0x28/0x38 process_one_work+0x1ec/0x470 worker_thread+0x48/0x458 kthread+0x130/0x138 ret_from_fork+0x10/0x1c Code: 540000ab a8c12027 a88120c7 a8c12027 (a88120c7) ---[ end trace 793e1eb5dff69f2d ]--- note: kworker/0:2H[2054] exited with preempt_count 1 This patch is to move "descriptor = NULL" down to below the label "out_unlock". Fixes: d44a5f98(ufs: query descriptor API) Link: https://lore.kernel.org/r/20191112223436.27449-3-huobean@gmail.comReviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Reviewed-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>
-
由 Bean Huo 提交于
Print out returned response size and buffer size, while the front one is bigger than the back one. Link: https://lore.kernel.org/r/20191112223436.27449-2-huobean@gmail.comReviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Reviewed-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>
-
- 01 11月, 2019 3 次提交
-
-
由 Bart Van Assche 提交于
Declare all variables that hold dev_cmd_type values as an enum instead of as an int. Cc: Yaniv Gardi <ygardi@codeaurora.org> Cc: Subhash Jadavani <subhashj@codeaurora.org> Cc: Stanley Chu <stanley.chu@mediatek.com> Cc: Avri Altman <avri.altman@wdc.com> Cc: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20191029230710.211926-3-bvanassche@acm.orgSigned-off-by: NBart Van Assche <bvanassche@acm.org> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bart Van Assche 提交于
Fix the following three kernel-doc warnings: drivers/scsi/ufs/ufs_bsg.c:165: warning: Function parameter or member 'hba' not described in 'ufs_bsg_remove' drivers/scsi/ufs/ufshcd.c:5789: warning: Function parameter or member 'cmd_type' not described in 'ufshcd_issue_devman_upiu_cmd' drivers/scsi/ufs/ufshcd.c:5789: warning: Excess function parameter 'msgcode' description in 'ufshcd_issue_devman_upiu_cmd' Cc: Yaniv Gardi <ygardi@codeaurora.org> Cc: Subhash Jadavani <subhashj@codeaurora.org> Cc: Stanley Chu <stanley.chu@mediatek.com> Cc: Avri Altman <avri.altman@wdc.com> Cc: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20191029230710.211926-2-bvanassche@acm.orgSigned-off-by: NBart Van Assche <bvanassche@acm.org> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bean Huo 提交于
There is no need to call ufshcd_def_desc_sizes() in ufshcd_init(), since descriptor lengths will be checked and initialized later in ufshcd_init_desc_sizes(). Fixes: a4b0e8a4(scsi: ufs: Factor out ufshcd_read_desc_param) Link: https://lore.kernel.org/r/BN7PR08MB5684A3ACE214C3D4792CE729DB610@BN7PR08MB5684.namprd08.prod.outlook.comSigned-off-by: NBean Huo <beanhuo@micron.com> Acked-by: Avri Altman <avri.altman.wdc.com> Reviewed-by: NCan Guo <cang@codeaurora.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 01 10月, 2019 1 次提交
-
-
由 Stanley Chu 提交于
Rework from previous work by: Sujit Reddy Thumma <sthumma@codeaurora.org> Override auto suspend tunables for UFS device LUNs during initialization so as to efficiently manage background operations and the power consumption. Link: https://lore.kernel.org/r/1568649411-5127-3-git-send-email-stanley.chu@mediatek.comReviewed-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>
-
- 24 9月, 2019 1 次提交
-
-
由 Stanley Chu 提交于
In some cases, hba may go through shutdown flow without successful initialization and then make system hang. For example, if ufshcd_change_power_mode() gets error and leads to ufshcd_hba_exit() to release resources of the host, future shutdown flow may hang the system since the host register will be accessed in unpowered state. To solve this issue, simply add checking to skip shutdown for above kind of situation. Link: https://lore.kernel.org/r/1568780438-28753-1-git-send-email-stanley.chu@mediatek.comSigned-off-by: NStanley Chu <stanley.chu@mediatek.com> Acked-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 08 9月, 2019 2 次提交
-
-
由 YueHaibing 提交于
Use kmemdup rather than duplicating its implementation Link: https://lore.kernel.org/r/20190831124424.18642-1-yuehaibing@huawei.comSigned-off-by: NYueHaibing <yuehaibing@huawei.com> Acked-by: NTomas Winkler <tomas.winkler@intel.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Bjorn Andersson 提交于
Some UFS memory devices needs their reset line toggled in order to get them into a good state for initialization. Provide a new vops to allow the platform driver to implement this operation. Link: https://lore.kernel.org/r/20190828191756.24312-2-bjorn.andersson@linaro.orgSigned-off-by: NBjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Reviewed-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NStanley Chu <stanley.chu@mediatek.com> Acked-by: NAvri Altman <Avri.Altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 30 8月, 2019 1 次提交
-
-
由 Stanley Chu 提交于
Currently bits in hba->outstanding_tasks are cleared only after their corresponding task management commands are successfully done by __ufshcd_issue_tm_cmd(). If timeout happens in a task management command, its corresponding bit in hba->outstanding_tasks will not be cleared until next task management command with the same tag used successfully finishes. This is wrong and can lead to some issues, like power issue. For example, ufshcd_release() and ufshcd_gate_work() will do nothing if hba->outstanding_tasks is not zero even if both UFS host and devices are actually idle. Solution is referred from error handling of device commands: bits in hba->outstanding_tasks shall be cleared regardless of their execution results. Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Signed-off-by: NChun-Hung Wu <chun-hung.wu@mediatek.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 15 8月, 2019 1 次提交
-
-
由 Adrian Hunter 提交于
Fix the following BUG: [ 187.065689] BUG: kernel NULL pointer dereference, address: 000000000000001c [ 187.065790] RIP: 0010:ufshcd_vreg_set_hpm+0x3c/0x110 [ufshcd_core] [ 187.065938] Call Trace: [ 187.065959] ufshcd_resume+0x72/0x290 [ufshcd_core] [ 187.065980] ufshcd_system_resume+0x54/0x140 [ufshcd_core] [ 187.065993] ? pci_pm_restore+0xb0/0xb0 [ 187.066005] ufshcd_pci_resume+0x15/0x20 [ufshcd_pci] [ 187.066017] pci_pm_thaw+0x4c/0x90 [ 187.066030] dpm_run_callback+0x5b/0x150 [ 187.066043] device_resume+0x11b/0x220 Voltage regulators are optional, so functions must check they exist before dereferencing. Note this issue is hidden if CONFIG_REGULATORS is not set, because the offending code is optimised away. Notes for stable: The issue first appears in commit 57d104c1 ("ufs: add UFS power management support") but is inadvertently fixed in commit 60f01870 ("scsi: ufs: disable vccq if it's not needed by UFS device") which in turn was reverted by commit 73067981 ("Revert "scsi: ufs: disable vccq if it's not needed by UFS device""). So fix applies v3.18 to v4.5 and v5.1+ Fixes: 57d104c1 ("ufs: add UFS power management support") Fixes: 73067981 ("Revert "scsi: ufs: disable vccq if it's not needed by UFS device"") Cc: stable@vger.kernel.org Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 08 8月, 2019 1 次提交
-
-
由 Tomas Winkler 提交于
Define new a type: uc_string_id for easier string handling and less casting. Reduce number or string copies in price of a dynamic allocation. Signed-off-by: NTomas Winkler <tomas.winkler@intel.com> Tested-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 23 7月, 2019 5 次提交
-
-
由 Bean Huo 提交于
This patch is to change msleep() to usleep_range() based on Documentation/timers/timers-howto.txt. It suggests using usleep_range() for small msec(1ms - 20ms) since msleep() will often sleep longer than desired value. After changing, booting time will be 5ms-10ms faster than before. I tested this change on two different platforms, one has 5ms faster, another one is about 10ms. I think this is different on different platform. Actually, from UFS host side, 1ms-5ms delay is already sufficient for its initialization of the local UIC layer. Fixes: 7a3e97b0 ([SCSI] ufshcd: UFS Host controller driver) Signed-off-by: NBean Huo <beanhuo@micron.com> Acked-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
Currently only "interrupt-based" errors have their own history, however there are some "non-interrupt-based" errors or events which need history to improve debugging or help know the health status of UFS devices. Example of fatal errors: - Link startup error - Suspend error - Resume error Example of abnormal events: - Task or request abort - Device reset (now equals to Logical Unit Reset) - Host reset This patch tries to track above errors and events by existed UFS error history mechanism. Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
Currently UFS error history will be reset and lost during host reset flow by ufschd_probe_hba(). Avoid resetting it so error history can be kept as complete as possible to improve debugging. In addition, fix a minor display error in ufshcd_print_err_hist(). [mkp: commit desc clarification] Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
Provide more information about fatal and auto-hibern8 errors to improve debugging by extending existing UFS error history framework. [mkp: typos] Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
Remove "uic" term in below error history functions and structures for more general usages, struct ufs_uic_err_reg_hist; void ufshcd_update_uic_reg_hist(struct ufs_uic_err_reg_hist *reg_hist, u32 reg); void ufshcd_print_uic_err_hist(struct ufs_hba *hba, struct ufs_uic)err_reg_hist *err_hist, char *err_name); Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 17 7月, 2019 1 次提交
-
-
由 Christoph Hellwig 提交于
We need to also mirror the value to the device to ensure IOMMU merging doesn't undo it, and the SCSI host level parameter will ensure that. Signed-off-by: NChristoph Hellwig <hch@lst.de> Reviewed-by: NBart Van Assche <bvanassche@acm.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 19 6月, 2019 3 次提交
-
-
由 Stanley Chu 提交于
Currently auto-hibernate is activated if host supports auto-hibern8 capability. However error-handling is not implemented, which makes the feature somewhat risky. If either "Hibernate Enter" or "Hibernate Exit" fail during auto-hibernate flow, the corresponding interrupt "UIC_HIBERNATE_ENTER" or "UIC_HIBERNATE_EXIT" shall be raised according to UFS specification. This patch adds auto-hibernate error-handling: - Monitor "Hibernate Enter" and "Hibernate Exit" interrupts after auto-hibernate feature is activated. - If a failure happens, trigger error-handling just like "manual-hibernate" failure and apply the same recovery flow: schedule UFS error handler in ufshcd_check_errors(), and then do host reset and restore in UFS error handler. Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Reviewed-by: NAvri Altman <Avri.Altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
Some vendor-specific initialization flow may set its own auto-hibernate timer. In this case, do not overwrite timer value as "default value" in ufshcd_init(). Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Reviewed-by: NAvri Altman <Avri.Altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
The checking of Auto-Hibernation support is used in many places in the driver, thus re-factor it as ufshcd_is_auto_hibern8_supported() to make code more clean. Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NBean Huo <beanhuo@micron.com> Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Reviewed-by: NAvri Altman <Avri.Altman@wdc.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 05 6月, 2019 1 次提交
-
-
由 Avri Altman 提交于
struct ufs_dev_cmd is the main container that supports device management commands. In the case of a read descriptor request, we assume that the proper space was allocated in dev_cmd to hold the returning descriptor. This is no longer true, as there are flows that doesn't use dev_cmd for device management requests, and was wrong in the first place. Fixes: d44a5f98 (ufs: query descriptor API) Signed-off-by: NAvri Altman <avri.altman@wdc.com> Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com> Acked-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 16 4月, 2019 1 次提交
-
-
由 Stanley Chu 提交于
If UFS device responds an unknown request response code, we can not know what it was via logs because the code is replaced by "DID_ERROR << 16" before log printing. Fix this to provide precise request response code information for easier issue breakdown. Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NTomas Winkler <tomas.winkler@intel.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 04 4月, 2019 3 次提交
-
-
由 Zeng Guangyue 提交于
The pointer value is initialized as &hba->vreg_info, and it's never changed. It's not necessary to check the pointer is null or not. Signed-off-by: NZeng Guangyue <zengguangyue@hisilicon.com> Acked-by: NTomas Winkler <tomas.winkler@intel.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
Currently if a regulator has "<name>-fixed-regulator" property in device tree, it will skip current limit initialization. This lead to a zero "max_uA" value in struct ufs_vreg. However, "regulator_set_load" operation shall be required on regulators which have valid current limits, otherwise a zero "max_uA" set by "regulator_set_load" may cause unexpected behavior when this regulator is enabled or set as high power mode. Similarly, in device's icc_level configuration flow, the target icc_level shall be updated if regulator also has valid current limit, otherwise a wrong icc_level will be calculated by zero "max_uA" and thus causes unexpected results after it is written to device. Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Acked-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Stanley Chu 提交于
For regulators used by UFS, vcc, vccq and vccq2 will have voltage range initialized by ufshcd_populate_vreg(), however other regulators may have undefined voltage range if dt-bindings have no such definition. In above undefined case, both "min_uV" and "max_uV" fields in ufs_vreg struct will be zero values and these values will be configured on regulators in different power modes. Currently this may have no harm if both "min_uV" and "max_uV" always keep "zero values" because regulator_set_voltage() will always bypass such invalid values and return "good" results. However improper values shall be fixed to avoid potential bugs. Simply bypass voltage configuration if voltage range is not defined. Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Acked-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 27 2月, 2019 3 次提交
-
-
由 Avri Altman 提交于
Allow to read descriptors via raw upiu. This in fact was forbidden just as a precaution, as ufs-bsg actually enforces which functionality is supported. Signed-off-by: NAvri Altman <avri.altman@wdc.com> Reviewed-by: NEvan Green <evgreen@chromium.org> Reviewed-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Marc Gonzalez 提交于
The UFSHC driver defines a few quirks that are not used anywhere: UFS_DEVICE_QUIRK_BROKEN_LCC UFS_DEVICE_NO_VCCQ UFS_DEVICE_QUIRK_NO_LINK_OFF UFS_DEVICE_NO_FASTAUTO Let's remove them. Acked-by: NAvri Altman <avri.altman@wdc.com> Acked-by: NAlim Akhtar <alim.akhtar@samsung.com> Reviewed-by: NEvan Green <evgreen@chromium.org> Signed-off-by: NMarc Gonzalez <marc.w.gonzalez@free.fr> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
由 Marc Gonzalez 提交于
This reverts commit 60f01870. There was one conflict in drivers/scsi/ufs/ufshcd.c <<<<<<< HEAD /* Init check for device descriptor sizes */ ufshcd_init_desc_sizes(hba); ret = ufs_get_device_desc(hba, &card); if (ret) { dev_err(hba->dev, "%s: Failed getting device info. err = %d\n", __func__, ret); goto out; } ufs_fixup_device_setup(hba, &card); ufshcd_tune_unipro_params(hba); ret = ufshcd_set_vccq_rail_unused(hba, (hba->dev_quirks & UFS_DEVICE_NO_VCCQ) ? true : false); if (ret) goto out; ======= ufs_advertise_fixup_device(hba); >>>>>>> parent of 60f01870... scsi: ufs: disable vccq if it's not needed by UFS device Resolution: keep HEAD, and delete the ufshcd_set_vccq_rail_unused() call and corresponding error-handling code. Clean up loose ends in a follow-up patch. 60f01870 introduced a small power optimization: ignore the vccq load specified in the UFSHC DT node when said host controller is connected to specific Flash chips (currently, Samsung and Hynix). Unfortunately, this optimization breaks UFS on systems where vccq powers not only the Flash chip, but the host controller as well, such as APQ8098 MEDIABOX or MTP8998: [ 3.929877] ufshcd-qcom 1da4000.ufshc: ufshcd_query_attr: opcode 0x04 for idn 13 failed, index 0, err = -11 [ 5.433815] ufshcd-qcom 1da4000.ufshc: ufshcd_query_attr: opcode 0x04 for idn 13 failed, index 0, err = -11 [ 6.937771] ufshcd-qcom 1da4000.ufshc: ufshcd_query_attr: opcode 0x04 for idn 13 failed, index 0, err = -11 [ 6.937866] ufshcd-qcom 1da4000.ufshc: ufshcd_query_attr_retry: query attribute, idn 13, failed with error -11 after 3 retires [ 6.946412] ufshcd-qcom 1da4000.ufshc: ufshcd_disable_auto_bkops: failed to enable exception event -11 [ 6.957972] ufshcd-qcom 1da4000.ufshc: dme-peer-get: attr-id 0x1587 failed 3 retries [ 6.967181] ufshcd-qcom 1da4000.ufshc: dme-peer-get: attr-id 0x1586 failed 3 retries [ 6.975025] ufshcd-qcom 1da4000.ufshc: ufshcd_get_max_pwr_mode: invalid max pwm tx gear read = 0 [ 6.982755] ufshcd-qcom 1da4000.ufshc: ufshcd_probe_hba: Failed getting max supported power mode [ 8.505770] ufshcd-qcom 1da4000.ufshc: ufshcd_query_flag: Sending flag query for idn 3 failed, err = -11 [ 10.009807] ufshcd-qcom 1da4000.ufshc: ufshcd_query_flag: Sending flag query for idn 3 failed, err = -11 [ 11.513766] ufshcd-qcom 1da4000.ufshc: ufshcd_query_flag: Sending flag query for idn 3 failed, err = -11 [ 11.513861] ufshcd-qcom 1da4000.ufshc: ufshcd_query_flag_retry: query attribute, opcode 5, idn 3, failed with error -11 after 3 retires [ 13.049807] ufshcd-qcom 1da4000.ufshc: __ufshcd_query_descriptor: opcode 0x01 for idn 8 failed, index 0, err = -11 [ 14.553768] ufshcd-qcom 1da4000.ufshc: __ufshcd_query_descriptor: opcode 0x01 for idn 8 failed, index 0, err = -11 [ 16.057767] ufshcd-qcom 1da4000.ufshc: __ufshcd_query_descriptor: opcode 0x01 for idn 8 failed, index 0, err = -11 [ 16.057872] ufshcd-qcom 1da4000.ufshc: ufshcd_read_desc_param: Failed reading descriptor. desc_id 8, desc_index 0, param_offset 0, ret -11 [ 16.067109] ufshcd-qcom 1da4000.ufshc: ufshcd_init_icc_levels: Failed reading power descriptor.len = 98 ret = -11 [ 37.073787] ufshcd-qcom 1da4000.ufshc: link startup failed 1 In my opinion, the rationale for the original patch is questionable. If neither the UFSHC, nor the Flash chip, require any load from vccq, then that power rail should simply not be specified at all in the DT. Working around that fact in the driver is detrimental, as evidenced by the failure to initialize the host controller on MSM8998. Acked-by: NAvri Altman <avri.altman@wdc.com> Acked-by: NAlim Akhtar <alim.akhtar@samsung.com> Signed-off-by: NMarc Gonzalez <marc.w.gonzalez@free.fr> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-
- 05 2月, 2019 1 次提交
-
-
由 Stanley Chu 提交于
uic errors are currently printed out of time order. Make things more readable by printing logs in time order, and printing "No record" if history is empty. Signed-off-by: NStanley Chu <stanley.chu@mediatek.com> Reviewed-by: NAvri Altman <avri.altman@wdc.com> Reviewed-by: NBean Huo <beanhuo@micron.com> Tested-by: NBean Huo <beanhuo@micron.com> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
-