[PATCH v4 7/7] scsi: ufs-bsg: Add support for uic commands in ufs_bsg_request()

2018-09-07 Thread Avri Altman
Add support to those uic commands, that are currently supported by ufshcd api: the variants of dme_{peer}_{set_get}. At this point better not to add any new api, as careless uic command may turn the device into a brick. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufs_bsg.c | 54

[PATCH v4 6/7] scsi: ufs-bsg: Add support for raw upiu in ufs_bsg_request()

2018-09-07 Thread Avri Altman
Do that for the currently supported UPIUs: query, nop out, and task management. We do not support UPIU of type scsi command yet, while we are using the job's request and reply pointers to hold the payload. We will look into it in later patches. We might need to elaborate the raw upiu api for that

[PATCH v4 4/7] scsi: ufs: Add ufs-bsg module

2018-09-07 Thread Avri Altman
Add a bsg endpoint that supports UPIUs. For now, just provide an API to allocate and remove ufs-bsg node. We will use this framework to manage ufs devices by sending UPIU transactions. For the time being, implements an empty bsg_request() - will add some more functionality in coming patches. Non

[PATCH v4 5/7] scsi: ufs: Add API to execute raw upiu commands

2018-09-07 Thread Avri Altman
The UFS host software uses a combination of a host register set, and Transfer Request Descriptors in system memory to communicate with host controller hardware. In its mmio space, a separate places are assigned to UTP Transfer Request Descriptor ("utrd") list, and to UTP Task Management Request Des

[PATCH v4 3/7] scsi: ufs: Allow ufshcd_issue_tm_cmd accept raw upiu

2018-09-07 Thread Avri Altman
Do that in order to re-use its code if the task request and response UPIUs are given externally. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 39 --- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/driv

[PATCH v4 1/7] scsi: ufs: cleanup struct utp_task_req_desc

2018-09-07 Thread Avri Altman
From: Christoph Hellwig Remove the pointless task_req_upiu and task_rsp_upiu indirections, which are __le32 arrays always cast to given structures and just add the members directly. Also clean up variables names in use in the callers a bit to make the code more readable. Signed-off-by: Christop

[PATCH v4 2/7] scsi: ufs: add a low-level __ufshcd_issue_tm_cmd helper

2018-09-07 Thread Avri Altman
From: Christoph Hellwig Add a helper that takes a utp_task_req_desc and issues it, which will be useful for UFS bsg support. Rewrite ufshcd_issue_tm_cmd0x to use this new helper. Signed-off-by: Christoph Hellwig --- drivers/scsi/ufs/ufshcd.c | 140 -

[PATCH v4 0/7] scsi: ufs bsg endpoint

2018-09-07 Thread Avri Altman
Here is a proposal to use a bsg endpoint to manage ufs devices. We will do that by adding a bsg device node to the ufs driver, and use it to send UPIU transactions to the ufs device. It will serve as a ufs device management infrastructure, for device configuration, provisioning, testing and valid