Commit 6ccf44fe authored by Seungwon Jeon's avatar Seungwon Jeon Committed by James Bottomley

[SCSI] ufs: rework link start-up process

Link start-up requires long time with multiphase handshakes
between UFS host and device. This affects driver's probe time.
This patch let link start-up run asynchronously. Link start-up
will be executed at the end of prove separately.
Along with this change, the following is worked.

Defined completion time of uic command to avoid a permanent wait.
Added mutex to guarantee of uic command at a time.
Adapted some sequence of controller initialization after link statup
according to HCI standard.
Signed-off-by: default avatarSeungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: default avatarSujit Reddy Thumma <sthumma@codeaurora.org>
Tested-by: default avatarMaya Erez <merez@codeaurora.org>
Signed-off-by: default avatarSantosh Y <santoshsy@gmail.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 261ea452
This diff is collapsed.
......@@ -51,6 +51,7 @@
#include <linux/bitops.h>
#include <linux/pm_runtime.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <asm/irq.h>
#include <asm/byteorder.h>
......@@ -75,6 +76,7 @@
* @argument3: UIC command argument 3
* @cmd_active: Indicate if UIC command is outstanding
* @result: UIC command result
* @done: UIC command completion
*/
struct uic_command {
u32 command;
......@@ -83,6 +85,7 @@ struct uic_command {
u32 argument3;
int cmd_active;
int result;
struct completion done;
};
/**
......@@ -136,11 +139,11 @@ struct ufshcd_lrb {
* @ufs_version: UFS Version to which controller complies
* @irq: Irq number of the controller
* @active_uic_cmd: handle of active UIC command
* @uic_cmd_mutex: mutex for uic command
* @ufshcd_tm_wait_queue: wait queue for task management
* @tm_condition: condition variable for task management
* @ufshcd_state: UFSHCD states
* @intr_mask: Interrupt Mask Bits
* @uic_workq: Work queue for UIC completion handling
* @feh_workq: Work queue for fatal controller error handling
* @errors: HBA errors
*/
......@@ -171,7 +174,9 @@ struct ufs_hba {
u32 ufs_version;
unsigned int irq;
struct uic_command active_uic_cmd;
struct uic_command *active_uic_cmd;
struct mutex uic_cmd_mutex;
wait_queue_head_t ufshcd_tm_wait_queue;
unsigned long tm_condition;
......@@ -179,7 +184,6 @@ struct ufs_hba {
u32 intr_mask;
/* Work Queues */
struct work_struct uic_workq;
struct work_struct feh_workq;
/* HBA Errors */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment