[PATCH] scsi-sysfs: correct errno for host_reset

2017-08-10 Thread weiping zhang
ot;; -EOPNOTSUPP if string match but not implement ->host_reset. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- drivers/scsi/scsi_sysfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index dff8faf..3e664f4 100644

Re: [PATCH] scsi-sysfs: correct errno for host_reset

2017-08-14 Thread weiping zhang
On Fri, Aug 11, 2017 at 01:52:17AM +0800, weiping zhang wrote: > if scsi_host_template->host_reset is NULL, when user > "echo adapter > /sys/class/scsi_host/hostx/host_reset", > -EINVAL will return even string compare successfully. It make user confuse.

[PATCH v2] scsi: megaraid_sas: fix allocate instance->pd_info twice

2017-08-07 Thread weiping zhang
fix allocate instance->pd_info twice which was introduced by 96188a89cc6d. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- drivers/scsi/megaraid/megaraid_sas_base.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/scsi

[PATCH] scsi: megaraid_sas: fix error handle in megasas_probe_one

2017-08-07 Thread weiping zhang
megasas_mgmt_info.max_index has increased by 1 before megasas_io_attach, if megasas_io_attach return error, then goto fail_io_attach, megasas_mgmt_info.instance has a wrong index here. So first reduce max_index and then set that instance to NULL. Signed-off-by: weiping zhang <zhangw

[PATCH] scsi: sd: remove duplicated setting of gd->minors

2017-08-18 Thread weiping zhang
gd->minors has been set when call alloc_disk() in sd_probe. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- drivers/scsi/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index bea36ad..c18ca7a 100644 --- a/drivers/scsi/s

[PATCH] scsi: sd: add check for changing allow_restart

2017-09-27 Thread weiping zhang
/sys/class/scsi_disk/0:2:0:0/allow_restart can be changed to 0 unexpectly by writing invalid string, like following: echo asdf > /sys/class/scsi_disk/0:2:0:0/allow_restart Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- drivers/scsi/sd.c | 7 ++- 1 file changed, 6 i

Re: [PATCH] scsi: sd: remove duplicated setting of gd->minors

2017-08-24 Thread weiping zhang
On Fri, Aug 18, 2017 at 02:49:30PM +0800, weiping zhang wrote: > gd->minors has been set when call alloc_disk() in sd_probe. > > Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> > --- > drivers/scsi/sd.c | 1 - > 1 file changed, 1 deletion(-) > >

Re: [PATCH] scsi: sd: add check for changing allow_restart

2017-10-07 Thread weiping zhang
On Thu, Sep 28, 2017 at 12:53:18AM +0800, weiping zhang wrote: > /sys/class/scsi_disk/0:2:0:0/allow_restart can be changed to 0 unexpectly by > writing invalid string, like following: > > echo asdf > /sys/class/scsi_disk/0:2:0:0/allow_restart > > Signed-off-by: wei

Re: [PATCH] scsi: sd: add check for changing allow_restart

2017-10-12 Thread weiping zhang
On Wed, Oct 11, 2017 at 01:22:18PM -0400, Martin K. Petersen wrote: > > weiping, > > > /sys/class/scsi_disk/0:2:0:0/allow_restart can be changed to 0 unexpectly by > > writing invalid string, like following: > > > > echo asdf > /sys/class/scsi_disk/0:2:0:0/allow_restart > > Please switch to

[PATCH v2 0/2] change allow_restart, manage_start_stop to bool in sysfs

2017-10-12 Thread weiping zhang
Changes since V1: switch kstrtoint to kstrtobool. add fix for manage_start_stop. weiping zhang (2): scsi: sd: change allow_restart to bool in sysfs interface scsi: sd: change manage_start_stop to bool in sysfs interface drivers/scsi/sd.c | 12 ++-- 1 file changed, 10 insertions

[PATCH v2 1/2] scsi: sd: change allow_restart to bool in sysfs interface

2017-10-12 Thread weiping zhang
/sys/class/scsi_disk/0:2:0:0/allow_restart can be changed to 0 unexpectly by writing invalid string, like following: echo asdf > /sys/class/scsi_disk/0:2:0:0/allow_restart Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- drivers/scsi/sd.c | 6 +- 1 file changed, 5 i

[PATCH v2 2/2] scsi: sd: change manage_start_stop to bool in sysfs interface

2017-10-12 Thread weiping zhang
/sys/class/scsi_disk/0:2:0:0/manage_start_stop can be changed to 0 unexpectly by writing invalid string. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- drivers/scsi/sd.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/sd.c b/driver

[PATCH v2] scsi: sd: add new match array for cache_type

2018-01-18 Thread weiping zhang
off 1 0 on on 1 1 on off When execute "cat cache_type", it will show more detail info like following: write back 10 write:on, read:on Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- drivers/scsi/sd.c | 20 +--- 1 file change

Re: [RFC PATCH] scsi: sd: add wce_rcd sysfs interface

2018-01-17 Thread weiping zhang
2018-01-18 10:51 GMT+08:00 Martin K. Petersen : > > Hi Weiping, > >> add user friendly interface wce_rcd to enable/disable >> write cache. The code base on cache_type, but need short input. > > While I agree that the cache_type interface is somewhat arcane, I don't >

Re: [PATCH v3] scsi: sd: add new match array for cache_type

2018-02-01 Thread Weiping Zhang
2018-01-31 11:22 GMT+08:00 Martin K. Petersen : > > Weiping, > >> add user friendly command strings sd_wr_cache to enable/disable >> write cache. user can enable both write and read cache by one of >> the following commands: > > I remain unconvinced that introducing

[RFC PATCH] scsi: sd: add wce_rcd sysfs interface

2018-01-17 Thread weiping zhang
off Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- drivers/scsi/sd.c | 84 +++ 1 file changed, 84 insertions(+) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index a028ab3..9ab210c 100644 --- a/drivers/scsi

Re: [PATCH v2] scsi: sd: add new match array for cache_type

2018-01-18 Thread weiping zhang
2018-01-19 10:41 GMT+08:00 Martin K. Petersen : > > Hi Weiping, > >> Add user friendly command strings sd_wce_rcd to enable/disable >> write cache. User can enable both write and read cache by one of >> the following commands: > > I am not entirely sure what the

Re: [PATCH v2] scsi: sd: add new match array for cache_type

2018-01-23 Thread weiping zhang
2018-01-23 8:23 GMT+08:00 Martin K. Petersen : > > Hi Weiping, > >> currently, there are four combinations as following: "write through", >> "none", "write back", "write back, no read (daft)" >> >> cache_type can control both write and read cache, but for "write >>

[PATCH v3] scsi: sd: add new match array for cache_type

2018-01-23 Thread weiping zhang
/ w0r0 | 0 1 | off off write back / w1r1 | 1 0 | on on write back, no read (daft) / w1r0 | 1 1 | on off Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- drivers/scsi/sd.c | 21 +++-- 1 file changed, 19 insertion

[PATCH] scsi:Documentation: add sd-parameters.txt

2018-02-26 Thread Weiping Zhang
this document include SCSI disk and SCSI device parameters, add cache_type firstly, other parameters will be added later. Signed-off-by: Weiping Zhang <zhangweip...@didichuxing.com> --- Documentation/scsi/sd-parameters.txt | 23 +++ 1 file changed, 23 insertions(+)