RE: [PATCH 0/3] scsi: ufs-bsg: Add read descriptor

2018-12-03 Thread Avri Altman
+Bean Thanks, Avri > -Original Message- > From: linux-scsi-ow...@vger.kernel.org > On Behalf Of Avri Altman > Sent: Friday, November 30, 2018 9:32 AM > To: James E.J. Bottomley ; Martin K. Petersen > ; linux-scsi@vger.kernel.org > Cc: Christoph Hellwig ; Avi

RE: [PATCH 0/3] scsi: ufs-bsg: Add read descriptor

2018-11-29 Thread Avri Altman
A gentle ping. Cheers, Avri > -Original Message- > From: linux-scsi-ow...@vger.kernel.org > On Behalf Of Avri Altman > Sent: Monday, November 26, 2018 11:03 AM > To: James E.J. Bottomley ; Martin K. Petersen > ; linux-scsi@vger.kernel.org > Cc: Christoph Hell

[PATCH 2/3] scsi: ufs: Allow reading descriptor via raw upiu

2018-11-26 Thread 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: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff

[PATCH 3/3] scsi: ufs-bsg: Allow reading descriptors

2018-11-26 Thread Avri Altman
Add this functionality, now that job->reply is big enough. While at it, fix a typo in ufs_bsg_verify_query_params. Signed-off-by: Avri Altman --- Documentation/scsi/ufs.txt | 8 drivers/scsi/ufs/ufs_bsg.c | 25 +++-- 2 files changed, 23 insertions(+), 10 deleti

[PATCH 1/3] bsg: Make job reply size different than SCSI_SENSE_BUFFERSIZE

2018-11-26 Thread Avri Altman
be able to carry some useful information, e.g. ufs descriptors, should be needed. Signed-off-by: Avri Altman --- block/bsg-lib.c | 4 ++-- include/linux/bsg-lib.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/block/bsg-lib.c b/block/bsg-lib.c index f3501cd..5cb2e38

[PATCH 0/3] scsi: ufs-bsg: Add read descriptor

2018-11-26 Thread Avri Altman
behind - allowing reading descriptors as well. Avri Altman (3): bsg: Make job reply size different than SCSI_SENSE_BUFFERSIZE scsi: ufs: Allow reading descriptor via raw upiu scsi: ufs-bsg: Allow reading descriptors Documentation/scsi/ufs.txt | 8 block/bsg-lib.c| 4

[PATCH] scsi: ufs: Remove redundant sense size definition

2018-11-22 Thread Avri Altman
By spec, the ufs sense data is 18 bytes long. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufs.h| 4 ++-- drivers/scsi/ufs/ufshcd.c | 17 +++-- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h index 8e4e526

RE: [PATCH 6/8] bsg-lib: handle bidi requests without block layer help

2018-11-19 Thread Avri Altman
ld, allowing for the eventual > removal of the latter. > > Signed-off-by: Christoph Hellwig Tested-by: Avri Altman Regardless of the ongoing discussion with Benjamin - Tested the scsi pass-through (ufs-bsg) path - nothing is broken.

RE: [PATCH 5/8] bsg: refactor bsg_ioctl

2018-11-19 Thread Avri Altman
; > --- > > block/bsg.c | 158 > > 1 file changed, 72 insertions(+), 86 deletions(-) > > > > Looks fine to me. Did ran the same small test-tool I ran against Jens' > patches, nothing broke. > > Reviewed-by: Benjamin Block > Tested-by: Benjamin Block Tested-by

[PATCH v9 3/8] uapi: ufs: Make utp_upiu_req visible to user space

2018-10-07 Thread Avri Altman
in preparation to send UPIU requests via bsg. Signed-off-by: Avri Altman Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig --- drivers/scsi/ufs/ufs.h | 61 + drivers/scsi/ufs/ufshcd.c| 6 ++-- include/uapi/scsi/scsi_bsg_ufs.h | 74

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

2018-10-07 Thread Avri Altman
for that. We also still not supporting uic commands: For first phase, we plan to use the existing api, and send only uic commands that are already supported. Anyway, all that will come in the next patch. Signed-off-by: Avri Altman Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche

[PATCH v9 0/8] scsi: Add ufs bsg endpoint

2018-10-07 Thread Avri Altman
ufshcd_issue_tm_cmd code - needed a couple of patches for that, and call req_upiu and rsp_upio with their appropriate struct pointers. Use a more appropriate name when checking if enough memory was allocated for write descriptor, and remove redundant goto. Add reference to the spec to explain uic comm

[PATCH v9 2/8] scsi: ufs: add a low-level __ufshcd_issue_tm_cmd helper

2018-10-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 Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 141

[PATCH v9 4/8] scsi: ufs: Add a bsg endpoint that supports UPIUs

2018-10-07 Thread Avri Altman
structure: using upiu transactions that contains the outmost detailed info, so we don't really need complex constructs to support it. Signed-off-by: Avri Altman Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche --- Documentation/scsi/ufs.txt | 20 + drivers/scsi/ufs

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

2018-10-07 Thread Avri Altman
Make ufshcd_send_uic_cmd() public for that. Signed-off-by: Avri Altman Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche --- drivers/scsi/ufs/ufs_bsg.c | 11 +++ drivers/scsi/ufs/ufshcd.c| 3 +-- drivers/scsi/ufs/ufshcd.h| 2 ++ include/uapi/scsi

[PATCH v9 1/8] scsi: ufs: cleanup struct utp_task_req_desc

2018-10-07 Thread Avri Altman
-by: Christoph Hellwig Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufs.h| 30 - drivers/scsi/ufs/ufshcd.c | 68 ++- drivers/scsi/ufs/ufshci.h | 25 + 3 files changed, 34 insertions(+), 89 deletions(-) diff --git

[PATCH v9 5/8] scsi: ufs: Use data structure size in pointer arithmetic

2018-10-07 Thread Avri Altman
Use the structure size in pointer arithmetic's instead of an opaque 32 bytes for the over allocation of descriptors. Signed-off-by: Avri Altman Reviewed-by: Christoph Hellwig --- drivers/scsi/ufs/ufs.h| 2 +- drivers/scsi/ufs/ufshcd.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions

[PATCH v9 6/8] scsi: ufs: Add API to execute raw upiu commands

2018-10-07 Thread Avri Altman
and task work queues. That is, all utrd-typed UPIUs are "disguised" as device management commands. Similarly, the utmrd-typed UPUIs uses the task management infrastructure. It is up to the caller to fill the upiu request properly, as it will be copied without any further input validations. Signed

RE: [PATCH v8 0/8] scsi: Add ufs bsg endpoint

2018-10-07 Thread Avri Altman
gt; >Will reply with the full list on Sunday. > > > >Thanks, > >Avri > >____ > >From: Bean Huo (beanhuo) > >Sent: Friday, October 5, 2018 12:28 AM > >To: Avri Altman; Christoph Hellwig; Johannes Thumshirn; Hannes Rein

RE: [PATCH v8 1/8] scsi: ufs: cleanup struct utp_task_req_desc

2018-10-06 Thread Avri Altman
> On Thu, Oct 04, 2018 at 08:20:30AM +0300, Avri Altman wrote: > > 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 directl

RE: [PATCH v8 3/8] uapi: ufs: Make utp_upiu_req visible to user space

2018-10-06 Thread Avri Altman
> > > > diff --git a/include/uapi/scsi/scsi_bsg_ufs.h > > b/include/uapi/scsi/scsi_bsg_ufs.h > > new file mode 100644 > > index 000..4108ce3 > > --- /dev/null > > +++ b/include/uapi/scsi/scsi_bsg_ufs.h > > @@ -0,0 +1,74 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +/* > > + * TBD - UFS

RE: [PATCH v8 4/8] scsi: ufs: Add ufs-bsg module

2018-10-06 Thread Avri Altman
> > Add a bsg endpoint that supports UPIUs. > > This should probably go into the subject line. Done. > > > > > 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. > > Please use up to 73

Re: [PATCH v8 0/8] scsi: Add ufs bsg endpoint

2018-10-05 Thread Avri Altman
12:28 AM To: Avri Altman; Christoph Hellwig; Johannes Thumshirn; Hannes Reinecke; Bart Van Assche; James E.J. Bottomley; Martin K. Petersen; linux-scsi@vger.kernel.org Cc: Stanislav Nijnikov; Avi Shchislowski; Alex Lemberg; Subhash Jadavani; Vinayak Holikatti Subject: RE: [PATCH v8 0/8] scsi: Add

[PATCH v8 5/8] scsi: ufs: Use data structure size in pointer arithmetic

2018-10-03 Thread Avri Altman
Use the structure size in pointer arithmetic's instead of an opaque 32 bytes for the over allocation of descriptors. Signed-off-by: Avri Altman Reviewed-by: Christoph Hellwig --- drivers/scsi/ufs/ufs.h| 2 +- drivers/scsi/ufs/ufshcd.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions

[PATCH v8 2/8] scsi: ufs: add a low-level __ufshcd_issue_tm_cmd helper

2018-10-03 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 Tested-by: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 141

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

2018-10-03 Thread Avri Altman
Make ufshcd_send_uic_cmd() public for that. Signed-off-by: Avri Altman Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche --- drivers/scsi/ufs/ufs_bsg.c | 11 +++ drivers/scsi/ufs/ufshcd.c| 3 +-- drivers/scsi/ufs/ufshcd.h| 2 ++ include/uapi/scsi

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

2018-10-03 Thread Avri Altman
for that. We also still not supporting uic commands: For first phase, we plan to use the existing api, and send only uic commands that are already supported. Anyway, all that will come in the next patch. Signed-off-by: Avri Altman Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche

[PATCH v8 6/8] scsi: ufs: Add API to execute raw upiu commands

2018-10-03 Thread Avri Altman
and task work queues. That is, all utrd-typed UPIUs are "disguised" as device management commands. Similarly, the utmrd-typed UPUIs uses the task management infrastructure. It is up to the caller to fill the upiu request properly, as it will be copied without any further input validations. Signed

[PATCH v8 3/8] uapi: ufs: Make utp_upiu_req visible to user space

2018-10-03 Thread Avri Altman
in preparation to send UPIU requests via bsg. Signed-off-by: Avri Altman Reviewed-by: Bart Van Assche --- drivers/scsi/ufs/ufs.h | 61 + drivers/scsi/ufs/ufshcd.c| 6 ++-- include/uapi/scsi/scsi_bsg_ufs.h | 74

[PATCH v8 4/8] scsi: ufs: Add ufs-bsg module

2018-10-03 Thread Avri Altman
structure - ufs_bsg_node has a pretty lean structure: using upiu transactions that contains the outmost detailed info, so we don't really need complex constructs to support it. Signed-off-by: Avri Altman Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche --- Documentation/scsi/ufs.txt

[PATCH v8 1/8] scsi: ufs: cleanup struct utp_task_req_desc

2018-10-03 Thread Avri Altman
-by: Christoph Hellwig Tested-by: Avri Altman --- drivers/scsi/ufs/ufs.h| 30 - drivers/scsi/ufs/ufshcd.c | 68 ++- drivers/scsi/ufs/ufshci.h | 25 + 3 files changed, 34 insertions(+), 89 deletions(-) diff --git a/drivers

[PATCH v8 0/8] scsi: Add ufs bsg endpoint

2018-10-03 Thread Avri Altman
name when checking if enough memory was allocated for write descriptor, and remove redundant goto. Add reference to the spec to explain uic command size. Fix a lot of typos. Avri Altman (6): uapi: ufs: Make utp_upiu_req visible to user space scsi: ufs: Add ufs-bsg module scsi: ufs: Use da

RE: [PATCH v7 3/8] uapi: ufs: Make utp_upiu_req visible to user space

2018-10-01 Thread Avri Altman
> > + > > +/* > > + * This file intended to be included by both kernel and user space > > + */ > > + > > +#define MAX_CDB_SIZE 16 > > Please rename this constant such that it has either "UFS" or "UTP" in its > name. This name is too generic for a protocol-specific header file. Done.

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

2018-09-29 Thread Avri Altman
Make ufshcd_send_uic_cmd() public for that. Signed-off-by: Avri Altman Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche --- drivers/scsi/ufs/ufs_bsg.c | 11 +++ drivers/scsi/ufs/ufshcd.c| 3 +-- drivers/scsi/ufs/ufshcd.h| 2 ++ include/uapi/scsi

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

2018-09-29 Thread Avri Altman
for that. We also still not supporting uic commands: For first phase, we plan to use the existing api, and send only uic commands that are already supported. Anyway, all that will come in the next patch. Signed-off-by: Avri Altman Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche

[PATCH v7 5/8] scsi: ufs: Use data structure size in pointer arithmetic

2018-09-29 Thread Avri Altman
Use the structure size in pointer arithmetic's instead of an opaque 32 bytes for the over allocation of descriptors. Signed-off-by: Avri Altman Reviewed-by: Christoph Hellwig --- drivers/scsi/ufs/ufs.h| 2 +- drivers/scsi/ufs/ufshcd.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions

[PATCH v7 6/8] scsi: ufs: Add API to execute raw upiu commands

2018-09-29 Thread Avri Altman
and task work queues. That is, all utrd-typed UPIUs are "disguised" as device management commands. Similarly, the utmrd-typed UPUIs uses the task management infrastructure. It is up to the caller to fill the upiu request properly, as it will be copied without any further input validations. Signed

[PATCH v7 2/8] scsi: ufs: add a low-level __ufshcd_issue_tm_cmd helper

2018-09-29 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 Tested-by: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 141

[PATCH v7 3/8] uapi: ufs: Make utp_upiu_req visible to user space

2018-09-29 Thread Avri Altman
in preparation to send UPIU requests via bsg. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufs.h | 61 + include/uapi/scsi/scsi_bsg_ufs.h | 74 2 files changed, 75 insertions(+), 60 deletions(-) create mode

[PATCH v7 4/8] scsi: ufs: Add ufs-bsg module

2018-09-29 Thread Avri Altman
structure - ufs_bsg_node has a pretty lean structure: using upiu transactions that contains the outmost detailed info, so we don't really need complex constructs to support it. Signed-off-by: Avri Altman Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche --- Documentation/scsi/ufs.txt

[PATCH v7 1/8] scsi: ufs: cleanup struct utp_task_req_desc

2018-09-29 Thread Avri Altman
-by: Christoph Hellwig Tested-by: Avri Altman --- drivers/scsi/ufs/ufs.h| 30 - drivers/scsi/ufs/ufshcd.c | 68 ++- drivers/scsi/ufs/ufshci.h | 25 + 3 files changed, 34 insertions(+), 89 deletions(-) diff --git a/drivers

[PATCH v7 0/8] scsi: Add ufs bsg endpoint

2018-09-29 Thread Avri Altman
was allocated for write descriptor, and remove redundant goto. Add reference to the spec to explain uic command size. Fix a lot of typos. Avri Altman (6): uapi: ufs: Make utp_upiu_req visible to user space scsi: ufs: Add ufs-bsg module scsi: ufs: Use data structure size in pointer arithmetic

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

2018-09-27 Thread Avri Altman
> > > -ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd) > > +int ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command > *uic_cmd) > > { > > int ret; > > unsigned long flags; > > @@ -2081,6 +2080,7 @@ static inline u8 ufshcd_get_upmcrs(struct ufs_hba > *hba) >

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

2018-09-27 Thread Avri Altman
> > > + case UPIU_TRANSACTION_QUERY_REQ: > > + qr = _request->upiu_req.qr; > > + if (qr->opcode == UPIU_QUERY_OPCODE_READ_DESC) > > + goto not_supported; > > + > > + if (ufs_bsg_get_query_desc_size(hba, qr, _len)) > > + goto

RE: [PATCH v6 3/7] scsi: ufs: Add ufs-bsg module

2018-09-27 Thread Avri Altman
Bart/Christoph, > + */ > +int ufs_bsg_probe(struct ufs_hba *hba) > +{ > + struct device *bsg_dev = >bsg_dev; > + struct Scsi_Host *shost = hba->host; > + struct device *parent = >shost_gendev; > + struct request_queue *q; > + int ret; > + > + device_initialize(bsg_dev); >

RE: [PATCH v6 3/7] scsi: ufs: Add ufs-bsg module

2018-09-26 Thread Avri Altman
> > Avri, > > > this looks generally good to me, but I'd suggest two small tweaks: > > > > - please split out a new prep patch that creates > >include/uapi/scsi/scsi_bsg_ufs.h with the structures move there > > - pleae keep the copyrights from drivers/scsi/ufs/ufs.h in this > >new file

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

2018-09-26 Thread Avri Altman
> > + > > +/** > > + * ufshcd_exec_raw_upiu_cmd - API function for sending raw upiu > commands > > + * @hba: per-adapter instance > > + * @req_upiu: upiu request > > + * @rsp_upiu: upiu reply - only 8 DW as we do not support scsi > commands > > + * @msgcode: message code, one of

RE: [PATCH v6 3/7] scsi: ufs: Add ufs-bsg module

2018-09-26 Thread Avri Altman
> Hi Avri, > > this looks generally good to me, but I'd suggest two small tweaks: > > - please split out a new prep patch that creates >include/uapi/scsi/scsi_bsg_ufs.h with the structures move there > - pleae keep the copyrights from drivers/scsi/ufs/ufs.h in this >new file Done.

Re: [PATCH V14 0/2] Add UFS provisioning support in driver

2018-09-24 Thread Avri Altman
>Configuration descriptor buffer consists of Device and Unit >descriptor configurable parameters which are parsed from vendor >specific provisioning file and then passed via configfs node at >runtime to provision ufs device. Can you describe your test setup? Will try to re-test it if not too

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

2018-09-21 Thread Avri Altman
Make ufshcd_send_uic_cmd() public for that. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufs_bsg.c | 11 ++- drivers/scsi/ufs/ufshcd.c| 4 ++-- drivers/scsi/ufs/ufshcd.h| 2 ++ include/uapi/scsi/scsi_bsg_ufs.h | 2 ++ 4 files changed, 16 insertions(+), 3

[PATCH v6 4/7] scsi: ufs: Use data structure size in pointer arithmetic

2018-09-21 Thread Avri Altman
Use the structure size in pointer arithmetic's instead of an opaque 32 bytes for the over allocation of descriptors. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufs.h| 2 +- drivers/scsi/ufs/ufshcd.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi

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

2018-09-21 Thread Avri Altman
and task work queues. That is, all utrd-typed UPIUs are "disguised" as device management commands. Similarly, the utmrd-typed UPUIs uses the task management infrastructure. It is up to the caller to fill the upiu request properly, as it will be copied without any further input validations. Signed-off

[PATCH v6 3/7] scsi: ufs: Add ufs-bsg module

2018-09-21 Thread Avri Altman
structure - ufs_bsg_node has a pretty lean structure: using upiu transactions that contains the outmost detailed info, so we don't really need complex constructs to support it. Signed-off-by: Avri Altman --- Documentation/scsi/ufs.txt | 20 drivers/scsi/ufs/Kconfig | 19

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

2018-09-21 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 | 141

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

2018-09-21 Thread Avri Altman
for that. We also still not supporting uic commands: For first phase, we plan to use the existing api, and send only uic commands that are already supported. Anyway, all that will come in the next patch. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufs_bsg.c | 112

[PATCH v6 0/7] scsi: Add ufs bsg endpoint

2018-09-21 Thread Avri Altman
o with their appropriate struct pointers. Use a more appropriate name when checking if enough memory was allocated for write descriptor, and remove redundant goto. Add reference to the spec to explain uic command size. Fix a lot of typos. Avri Altman (5): scsi: ufs: Add ufs-bsg module scsi: ufs:

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

2018-09-21 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:

RE: [PATCH v5 5/6] scsi: ufs-bsg: Add support for raw upiu in ufs_bsg_request()

2018-09-20 Thread Avri Altman
> > +static inline struct ufs_hba *dev_to_ufs_hba(struct device *d) > > +{ > > + struct Scsi_Host *shost = dev_to_shost(d->parent); > > + > > + return shost_priv(shost); > > This just has one caller that culd directly do: > > struct ufs_hba *hba =

RE: [PATCH v5 4/6] scsi: ufs: Add API to execute raw upiu commands

2018-09-20 Thread Avri Altman
> > + lrbp->command_type = hba->ufs_version == UFSHCI_VERSION_10 || > > +hba->ufs_version == UFSHCI_VERSION_11 ? > > +UTP_CMD_TYPE_DEV_MANAGE : > > +UTP_CMD_TYPE_UFS_STORAGE; > > I think a good old if/self or even a switch

RE: [PATCH v5 3/6] scsi: ufs: Add ufs-bsg module

2018-09-20 Thread Avri Altman
> -Original Message- > From: linux-scsi-ow...@vger.kernel.org > On Behalf Of Bart Van Assche > Sent: Wednesday, September 19, 2018 12:41 AM > To: Avri Altman ; Christoph Hellwig ; > Johannes Thumshirn ; Hannes Reinecke > ; James E.J. Bottomley ; Martin K. &g

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

2018-09-17 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 v5 4/6] scsi: ufs: Add API to execute raw upiu commands

2018-09-17 Thread Avri Altman
and task work queues. That is, all utrd-typed UPIUs are "disguised" as device management commands. Similarly, the utmrd-typed UPUIs uses the task management infrastructure. It is up to the caller to fill the upiu request properly, as it will be copied without any further input validations. Signed-off

[PATCH v5 2/6] scsi: ufs: add a low-level __ufshcd_issue_tm_cmd helper

2018-09-17 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 | 141

[PATCH v5 1/6] scsi: ufs: cleanup struct utp_task_req_desc

2018-09-17 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:

[PATCH v5 0/6] scsi: Add ufs bsg endpoint

2018-09-17 Thread Avri Altman
n checking if enough memory was allocated for write descriptor, and remove redundant goto. Add reference to the spec to explain uic command size. Fix a lot of typos. Avri Altman (4): scsi: ufs: Add ufs-bsg module scsi: ufs: Add API to execute raw upiu commands scsi: ufs-bsg: Add support for raw

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

2018-09-17 Thread Avri Altman
> > > @@ -5,6 +5,9 @@ obj-$(CONFIG_SCSI_UFS_DWC_TC_PLATFORM) += tc- > dwc-g210-pltfrm.o ufshcd-dwc.o tc-d > > obj-$(CONFIG_SCSI_UFS_QCOM) += ufs-qcom.o > > obj-$(CONFIG_SCSI_UFSHCD) += ufshcd-core.o > > ufshcd-core-objs := ufshcd.o ufs-sysfs.o > > +ifeq ($(CONFIG_SCSI_UFS_BSG),y) > >

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

2018-09-16 Thread Avri Altman
> > On 09/15/18 23:41, Avri Altman wrote: > >> Since this patch series does not touch any include/uapi header and since no > >> uapi UFS header files already exist, how is user space software expected to > >> know which message format it should use for

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

2018-09-16 Thread Avri Altman
Hi Bart, > Since this patch series does not touch any include/uapi header and since no > uapi UFS header files already exist, how is user space software expected to > know which message format it should use for communicating over the UFS BSG > endpoint? I don't think that "read the source" is an

[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
for that. We also still not supporting uic commands: For first phase, we plan to use the existing api, and send only uic commands that are already supported. Anyway, all that will come in the next patch. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufs_bsg.c | 127

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

2018-09-07 Thread Avri Altman
structure - ufs_bsg_node has a pretty lean structure: using upiu transactions that contains the outmost detailed info, so we don't really need complex constructs to support it. Signed-off-by: Avri Altman --- drivers/scsi/ufs/Kconfig | 19 ++ drivers/scsi/ufs/Makefile | 3 + drivers/scsi/ufs

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

2018-09-07 Thread Avri Altman
and task work queues. That is, all utrd-typed UPIUs are "disguised" as device management commands. Similarly, the utmrd-typed UPUIs uses the task management infrastructure. It is up to the caller to fill the upiu request properly, as it will be copied without any further input validations. Signed-off

[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

[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:

[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
- needed a couple of patches for that, and call req_upiu and rsp_upio with their appropriate struct pointers. Use a more appropriate name when checking if enough memory was allocated for write descriptor, and remove redundant goto. Add reference to the spec to explain uic command size. Fix a lot of typos.

RE: [PATCH v3 3/7] scsi: ufs: Add fill task management request

2018-09-06 Thread Avri Altman
Ok thanks. Will test and those as the first 2 patches in the series. Thanks a lot, Avri > -Original Message- > From: Christoph Hellwig > Sent: Wednesday, September 05, 2018 8:15 PM > To: Avri Altman > Cc: Christoph Hellwig ; Johannes Thumshirn > ; Hannes Reinecke

RE: [PATCH v3 3/7] scsi: ufs: Add fill task management request

2018-09-05 Thread Avri Altman
> On Wed, Sep 05, 2018 at 07:30:03AM +0000, Avri Altman wrote: > > Looking into the UFSHCI spec (JESD223C March 2016) paragraph 6.2, > > It doesn't specify any inner structure of the task management > > request or response, just a bunch of 8 DW each. > > I gues

RE: [PATCH v3 4/7] scsi: ufs: Allow ufshcd_issue_tm_cmd accept raw task upius

2018-09-05 Thread Avri Altman
> > --- > > drivers/scsi/ufs/ufshcd.c | 35 ++- > > 1 file changed, 26 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > > index d18832a..15be103 100644 > > --- a/drivers/scsi/ufs/ufshcd.c > > +++

RE: [PATCH v3 3/7] scsi: ufs: Add fill task management request

2018-09-05 Thread Avri Altman
> -Original Message- > From: linux-scsi-ow...@vger.kernel.org > On Behalf Of Christoph Hellwig > Sent: Tuesday, September 04, 2018 10:12 PM > To: Avri Altman > Cc: Christoph Hellwig ; Johannes Thumshirn > ; Hannes Reinecke ; Bart Van Assche > ; James E.J

RE: [PATCH v3 1/7] scsi: ufs: Add ufs-bsg module

2018-09-05 Thread Avri Altman
> > + */ > > +#ifndef SCSI_BSG_UFS_H > > +#define SCSI_BSG_UFS_H > > + > > +/* > > + * This file intended to be included by both kernel and user space > > + */ > > + > > + > > +/** > > + * struct ufs_bsg_upiu - upiu transaction structure > > + * > > + * @header: upiu header > > + * @tsf:

RE: [PATCH v3 1/7] scsi: ufs: Add ufs-bsg module

2018-09-05 Thread Avri Altman
> -Original Message- > From: Christoph Hellwig > Sent: Tuesday, September 04, 2018 10:20 PM > To: Avri Altman > Cc: Christoph Hellwig ; Johannes Thumshirn > ; Hannes Reinecke ; Bart Van Assche > ; James E.J. Bottomley > ; Martin K. Petersen > ; linux-scsi

RE: [PATCH v3 2/7] scsi: ufs: Instantiate a ufs bsg if its available

2018-09-05 Thread Avri Altman
> -Original Message- > From: Christoph Hellwig > Sent: Tuesday, September 04, 2018 10:16 PM > To: Avri Altman > Cc: Christoph Hellwig ; Johannes Thumshirn > ; Hannes Reinecke ; Bart Van Assche > ; James E.J. Bottomley > ; Martin K. Petersen > ; linux-scsi

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

2018-09-03 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 | 56

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

2018-09-03 Thread Avri Altman
for that. We also still not supporting uic commands: For first phase, we plan to use the existing api, and send only uic commands that are already supported. Anyway, all that will come in the next patch. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufs_bsg.c | 118

[PATCH v3 3/7] scsi: ufs: Add fill task management request

2018-09-03 Thread Avri Altman
Do that in preparation to re-use ufshcd_issue_tm_cmd code. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 50 +++ 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index

[PATCH v3 4/7] scsi: ufs: Allow ufshcd_issue_tm_cmd accept raw task upius

2018-09-03 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 | 35 ++- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers

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

2018-09-03 Thread Avri Altman
and task work queues. That is, all utrd-typed UPIUs are "disguised" as device management commands. Similarly, the utmrd-typed UPUIs uses the task management infrastructure. It is up to the caller to fill the upiu request properly, as it will be copied without any further input validations. Signed-off

[PATCH v3 1/7] scsi: ufs: Add ufs-bsg module

2018-09-03 Thread Avri Altman
structure - ufs_bsg_node has a pretty lean structure: using upiu transactions that contains the outmost detailed info, so we don't really need complex constructs to support it. Signed-off-by: Avri Altman --- drivers/scsi/ufs/Kconfig | 19 + drivers/scsi/ufs/Makefile| 1

[PATCH v3 2/7] scsi: ufs: Instantiate a ufs bsg if its available

2018-09-03 Thread Avri Altman
Call the probe/remove APIs. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 9d5d2ca..ed37914 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c

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

2018-09-03 Thread Avri Altman
priate name when checking if enough memory was allocated for write descriptor, and remove redundant goto. Add reference to the spec to explain uic command size. Fix a lot of typos. Avri Altman (7): scsi: ufs: Add ufs-bsg module scsi: ufs: Instantiate a ufs bsg if its available scsi: uf

RE: [PATCH v2 1/8] scsi: Add ufs transport class

2018-08-20 Thread Avri Altman
Hi Bart, > -Original Message- > From: Bart Van Assche > Sent: Tuesday, August 21, 2018 4:54 AM > To: jthumsh...@suse.de; h...@lst.de; Avri Altman ; > martin.peter...@oracle.com; linux-scsi@vger.kernel.org; h...@suse.com; > j...@linux.vnet.ibm.com; Stanislav Nijn

RE: [PATCH v2 1/8] scsi: Add ufs transport class

2018-08-09 Thread Avri Altman
> -Original Message- > From: Bart Van Assche > Sent: Wednesday, August 08, 2018 7:58 PM > To: h...@lst.de; Avri Altman ; linux-scsi@vger.kernel.org; > jthumsh...@suse.de; h...@suse.com; martin.peter...@oracle.com; > j...@linux.vnet.ibm.com > Cc: Vinayak Holikat

RE: [PATCH v2 7/8] scsi: ufs-bsg: Add support for raw upiu in ufs_bsg_request()

2018-08-09 Thread Avri Altman
Thanks, Avri > -Original Message- > From: Bart Van Assche > Sent: Wednesday, August 08, 2018 7:40 PM > To: h...@lst.de; Avri Altman ; linux-scsi@vger.kernel.org; > jthumsh...@suse.de; h...@suse.com; martin.peter...@oracle.com; > j...@linux.vnet.ibm.com > Cc: Vi

RE: [PATCH v2 6/8] scsi: ufs: Add API to execute raw upiu commands

2018-08-09 Thread Avri Altman
Thanks, Avri > -Original Message- > From: Bart Van Assche > Sent: Wednesday, August 08, 2018 7:39 PM > To: h...@lst.de; Avri Altman ; linux-scsi@vger.kernel.org; > jthumsh...@suse.de; h...@suse.com; martin.peter...@oracle.com; > j...@linux.vnet.ibm.com > Cc: Vi

RE: [PATCH v2 2/8] scsi: ufs: Add ufs-bsg module

2018-08-09 Thread Avri Altman
Thanks, Avri > -Original Message- > From: Bart Van Assche > Sent: Wednesday, August 08, 2018 7:27 PM > To: h...@lst.de; Avri Altman ; linux-scsi@vger.kernel.org; > jthumsh...@suse.de; h...@suse.com; martin.peter...@oracle.com; > j...@linux.vnet.ibm.com > Cc: Vi

RE: [PATCH v2 1/8] scsi: Add ufs transport class

2018-08-09 Thread Avri Altman
> -Original Message- > From: Bart Van Assche > Sent: Wednesday, August 08, 2018 7:21 PM > To: h...@lst.de; Avri Altman ; linux-scsi@vger.kernel.org; > jthumsh...@suse.de; h...@suse.com; martin.peter...@oracle.com; > j...@linux.vnet.ibm.com > Cc: Vinayak Holikat

RE: [PATCH v2 0/8] scsi: scsi transport for ufs devices

2018-08-07 Thread Avri Altman
> On Sun, Aug 05, 2018 at 02:39:48PM +0300, Avri Altman wrote: > > Here is a proposal to use the scsi transport subsystem to manage > > ufs devices. > > This should superceed previous patches to provide provisioning > support through sysfs or configfs, right? Yes. Thanks, Avri

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

2018-08-05 Thread Avri Altman
for that. We also still not supporting uic commands: For first phase, we plan to use the existing api, and send only uic commands that are already supported. Anyway, all that will come in the next patch. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufs_bsg.c | 118

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

2018-08-05 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 | 56

  1   2   >