Re: [PATCH 01/33] TCMU PR: first commit to implement TCMU PR

2018-06-15 Thread Christoph Hellwig
On Sat, Jun 16, 2018 at 02:23:10AM +0800, Zhu Lingshan wrote: > These commits and the following intend to implement Persistent > Reservation operations for TCMU devices. Err, hell no. If you are that tightly integrated with the target code that you can implement persistent reservation you need

[PATCH v2 0/8] mpt3sas: Fix static source code checker complaints

2018-06-15 Thread Bart Van Assche
Hello Martin, This patch series addresses the complaints reported by multiple static source code analysis tools about the mpt3sas source code. Please consider these patches for kernel v4.19. Thanks, Bart. Changes compared to v1: - Addressed Randy Dunlap's feedback about kernel-doc headers.

[PATCH v2 5/8] mpt3sas: Fix _transport_smp_handler() error path

2018-06-15 Thread Bart Van Assche
This patch avoids that smatch complains about a double unlock on ioc->transport_cmds.mutex. Fixes: 651a01364994 ("scsi: scsi_transport_sas: switch to bsg-lib for SMP passthrough") Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu

[PATCH v2 8/8] mpt3sas: Improve kernel-doc headers

2018-06-15 Thread Bart Van Assche
Avoids that warnings about the kernel headers appear when building with W=1. Remove useless "@Returns - Nothing" clauses. Change "@Return - " into "Return: ". Signed-off-by: Bart Van Assche Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani Cc: Randy Dunlap ---

[PATCH v2 3/8] mpt3sas: Annotate switch/case fall-through

2018-06-15 Thread Bart Van Assche
This patch avoids that gcc complains about switch/case fall-through when building with W=1. Signed-off-by: Bart Van Assche Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani --- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 1 + drivers/scsi/mpt3sas/mpt3sas_scsih.c | 3 +++ 2 files

[PATCH v2 1/8] mpt3sas: Fix indentation

2018-06-15 Thread Bart Van Assche
Modify the indentation such that smatch no longer complains about inconsistent indenting. Signed-off-by: Bart Van Assche Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani --- drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 40

[PATCH v2 2/8] mpt3sas: Remove set-but-not-used variables

2018-06-15 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani --- drivers/scsi/mpt3sas/mpt3sas_base.c | 10 -- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 5 - 2 files changed, 15 deletions(-) diff --git

[PATCH v2 6/8] mpt3sas: Fix a race condition in mpt3sas_base_hard_reset_handler()

2018-06-15 Thread Bart Van Assche
Since ioc->shost_recovery is set after ioc->reset_in_progress_mutex is obtained, if concurrent resets are issued there is a short time during which ioc->reset_in_progress_mutex is locked and ioc->shost_recovery == 0. Avoid that this can cause trouble by unconditionally locking ioc->shost_recovery.

[PATCH v2 7/8] mpt3sas: Split _base_reset_handler(), mpt3sas_scsih_reset_handler() and mpt3sas_ctl_reset_handler()

2018-06-15 Thread Bart Van Assche
Split each of these functions in three functions - one function per reset phase. This patch does not change any functionality but makes the code easier to read. Note: it is much easier to review the git diff -w output after having applied this patch than by reviewing the patch itself.

[PATCH v2 4/8] mpt3sas: Introduce struct mpt3sas_nvme_cmd

2018-06-15 Thread Bart Van Assche
Make _base_build_nvme_prp() easier to read by introducing a structure to access NVMe command fields. Signed-off-by: Bart Van Assche Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani --- drivers/scsi/mpt3sas/mpt3sas_base.c | 13 - drivers/scsi/mpt3sas/mpt3sas_base.h

Re: [PATCH 01/33] TCMU PR: first commit to implement TCMU PR

2018-06-15 Thread Zhu Lingshan
Hi, I am replying my own thread, if you want to test these commits, maybe you need my tcmu-runner patch, I have attached, it works fine with PR register, reserve, clear, release and preempt. Or you can use my repo directly: https://github.com/ls-zhu/tcmu-runner/tree/rbd_v2_pr It only works

[PATCH 20/33] TCMU PR: add a func to register an existing reg

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_execute_pr_register_existing() which will handle Persistent Reservation registration for a currently registered IT_Nexus. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 34 +++ 1 file changed, 34 insertions(+)

[PATCH 21/33] TCMU PR: add a func to update PR info on TCMU dev

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_pr_info_replace() which can help update Persistent Reservation information stored on a TCMU device. It will generate a new string based on the provided struct tcmu_pr_info struct, then write it to the device.For example, If we are using RBD, it will update PR info

[PATCH 28/33] TCMU PR: implementation of PR Reserve for TCMU

2018-06-15 Thread Zhu Lingshan
This patch added functions to handle Persistent Reservation Reserve against TCMU devices. Function tcm_rbd_pr_info_rsv_set() will help set PR information in struct tcmu_pr_info, function tcmu_execute_pr_reserve() will help handle PR reserve requests against TCMU devices. Signed-off-by: Zhu

[PATCH 23/33] TCMU PR: func to handle PR read keys but no regs

2018-06-15 Thread Zhu Lingshan
When try to execute Persistent Reservation Read Keys, but tcmu_pr_info_get() returns -ENODATA, this means there are no registrations, so we should generate a fake empty struct tcmu_pr_info, so that the code can keep running, but we don't want to store it in the TCMU device, this is different from

[PATCH 30/33] TCMU PR: implementation of PR release for TCMU

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_execute_pr_release() to handle SCSI3 Persistent Reservation Release for TCMU devices. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 119 ++ 1 file changed, 119 insertions(+) diff --git

[PATCH 22/33] TCMU PR: add a function to handle TCMU PR register

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_execute_pr_register() which can help to handle Persistent Reservation register operation for TCMU devices. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 138 ++ 1 file changed, 138 insertions(+) diff --git

[PATCH 33/33] TCMU PR: enable PRO Clear for TCMU devices

2018-06-15 Thread Zhu Lingshan
This patch would enable the passthrough Persist Reservation clear operation routine for TCMU devices. If dev->passthrough_pr is 1, both dev->transport->pr_ops and dev->transport->pr_ops->pr_clear are not NULL, core_scsi3_emulate_pro_clear() will call dev->transport->pr_ops->pr_clear to

[PATCH 32/33] TCMU PR: implementation of PR clear for TCMU

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_execute_pr_clear() which can help perform Persistent Reservation clear operation, this means clear reservations and registrations. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 108 ++ 1 file changed, 108

[PATCH 31/33] TCMU PR: enable PRO Release for TCMU devices

2018-06-15 Thread Zhu Lingshan
This patch would enable the passthrough Persist Reservation Release operation routine for TCMU devices. If dev->passthrough_pr is 1, both dev->transport->pr_ops and dev->transport->pr_ops->pr_release are not NULL, core_scsi3_emulate_pro_release() will call dev->transport->pr_ops->pr_release to

[PATCH 26/33] TCMU PR: add PR ops function pointers

2018-06-15 Thread Zhu Lingshan
This patch added a struct target_pr_ops contains TCMU Persistent Reservation operation functions. Added a "struct target_pr_ops" type pointer in target_backend_ops, so that we can call TCMU PR functions from struct target_backend_ops. Signed-off-by: Zhu Lingshan ---

[PATCH 25/33] TCMU PR: netlink support for passthrough PR info

2018-06-15 Thread Zhu Lingshan
This patch added netlink support for passthrough Persistent Reservation information. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/drivers/target/target_core_user.c

[PATCH 29/33] TCMU PR: enable PRO Reserve for TCMU devices

2018-06-15 Thread Zhu Lingshan
This patch would enable the passthrough Persist Reservation Reserve operation routine for TCMU devices. If dev->passthrough_pr is 1, both dev->transport->pr_ops and dev->transport->pr_ops->pr_register are not NULL, core_scsi3_emulate_pro_reserve() will call dev->transport->pr_ops->pr_reserve to

[PATCH 24/33] TCMU PR: handle PR read keys for TCMU devs

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_execute_pr_read_keys() which can help handle Persistent Reservation Read Keys. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 74 +++ 1 file changed, 74 insertions(+) diff --git

[PATCH 27/33] TCMU PR: enable PR register and ReadKeys for TCMU

2018-06-15 Thread Zhu Lingshan
This patch added a function is_passthrough_pr_supportive_dev() to tell whether the device can support passthrough Persistent Reservation, if supported, tcmu_configure_device() will set 1 to dev->passthrough_pr to indicate it. If dev->passthrough_pr is 1, both dev->transport->pr_ops and

[PATCH 01/33] TCMU PR: first commit to implement TCMU PR

2018-06-15 Thread Zhu Lingshan
These commits and the following intend to implement Persistent Reservation operations for TCMU devices. This series of commits would implement such PR operations: PR_Out_Register, PR_Out_Reserve, PR_Out_Clear, PR_Out_Preempt, PR_Out_Release and PR_In_ReadKeys. Next wave of patches will contain

[PATCH 14/33] TCMU PR: add a function can get PR info from a dev

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_pr_info_get() which can help get Persistent Reservation information from a TCMU device. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 51 +++ 1 file changed, 51 insertions(+) diff --git

[PATCH 05/33] TCMU PR: add a function to get IT_Nexus

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_gen_it_nexus() which can help generate a string contain IT_Nexus information from a session. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 44 +++ 1 file changed, 44 insertions(+) diff --git

[PATCH 04/33] TCMU PR: add functions can store PR info into devs

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_send_set_pr_info_event() to store Persistent Reservation information into a TCMU device (for example, if we use a RBD device, the information will be stored in it's metadata), added it's wrapper function tcmu_set_dev_pr_info() as well. Signed-off-by: Zhu Lingshan

[PATCH 13/33] TCMU PR: add a PR info decoder function

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_pr_info_decode() which can decode Persistent Reservation info, from the string to a struct tcmu_pr_info. This function will call the pervious added decoder like tcmu_pr_info_reg_decode() to do it's work. Signed-off-by: Zhu Lingshan ---

[PATCH 09/33] TCMU PR: add func to handle PR type, key, IT nexus

2018-06-15 Thread Zhu Lingshan
This patch add two functions: tcmu_pr_info_rsv_decode() and tcmu_pr_info_rsv_encode() to handle Persistent Reservations type, key and IT_Nexus. This patch added a struct tcmu_pr_rsv to store such information as well. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 72

[PATCH 16/33] TCMU PR: init PR info when empty for TCMU dev

2018-06-15 Thread Zhu Lingshan
When try to register an IT_Nexus, if tcmu_pr_info_get() returns -ENODATA, this means the string stored on the TCMU DEVICE records(for example, RBD metadata) which represent Persistent Reservation information is empty,there are no registrations, we should initialize a new struct tcmu_pr_info. This

[PATCH 15/33] TCMU PR: add a PR info encoder function

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_pr_info_encode() which can encode Persistent Reservation info, from a struct tcmu_pr_info to a string, so that we can store this string on a TCMU device. This function will call the pervious added encoder like tcmu_pr_info_reg_encode() to do it's work.

[PATCH 19/33] TCMU PR: add functions to unregister a reg

2018-06-15 Thread Zhu Lingshan
This patch added four functions: tcmu_pr_info_clear_reg() would delete a registration from a struct tcmu_pr_info, tcmu_pr_info_rsv_clear() would clear the reservation, tcmu_is_rsv_holder() would check whether the registration is a reservation holder. Then tcmu_pr_info_unregister_reg() would call

[PATCH 11/33] TCMU PR: add funcs to handle TCMU PR registrations

2018-06-15 Thread Zhu Lingshan
This patch added a struct tcmu_pr_reg which contain Persistent Reservation registrations information, also added two functions tcmu_pr_info_reg_decode() and tcmu_pr_info_reg_encode() to handle it. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 51

[PATCH 18/33] TCMU PR: add a function to register a new IT Nexus

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_execute_pr_register_new() which can help to register an unregistered I_T Nexus. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 34 +++ 1 file changed, 34 insertions(+) diff --git

[PATCH 17/33] TCMU PR: add a function to append a new PR reg

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_pr_info_append_reg() which can help to append a new Persistent Reservation registration to struct tcmu_pr_info. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 20 1 file changed, 20 insertions(+) diff --git

[PATCH 12/33] TCMU PR: add a function to free tcmu_pr_info

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_pr_info_free() which can help free struct tcmu_pr_info. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c

[PATCH 10/33] TCMU PR: add funcs to handle PR registrations num

2018-06-15 Thread Zhu Lingshan
This patch added two functions: tcmu_pr_info_num_regs_decode() and tcmu_pr_info_num_regs_encode() to handle the number of Persistent Reservation registrations. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 34 +++ 1 file changed, 34

[PATCH 08/33] TCMU PR: add functions to handle PR generation

2018-06-15 Thread Zhu Lingshan
This patch added two functions: tcmu_pr_info_gen_encode() and tcmu_pr_info_gen_decode() to encode/decode the generations of Persistent Reservations Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 34 +++ 1 file changed, 34 insertions(+) diff

[PATCH 07/33] TCMU PR: add functions to handle SCSI2 Reservation

2018-06-15 Thread Zhu Lingshan
This patch added two functions: tcmu_pr_info_scsi2_rsv_encode() and tcmu_pr_info_scsi2_rsv_decode() to encode and decode SCSI2 Reservations. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 65 +++ 1 file changed, 65 insertions(+) diff --git

[PATCH 06/33] TCMU PR: add decode/encode func for PR seq and ver

2018-06-15 Thread Zhu Lingshan
This patch added three functions, tcmu_pr_info_vers_seq_encode() to encode PR sequence and version into a string, tcmu_pr_info_vers_decode() and tcmu_pr_info_seq_decode() used to decode them. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 62 +++

[PATCH 03/33] TCMU PR: add functions can get PR info from a dev

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_send_get_pr_info_event() to get Persistent Reservation info from a TCMU device, added it's wrapper function tcmu_get_dev_pr_info() as well. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 31 +++ 1 file changed,

[PATCH 02/33] TCMU PR: add tcmu_dev_pr_info to store PR buffer

2018-06-15 Thread Zhu Lingshan
This patch added a struct tcmu_dev_pr_info, which can help store the string buffer we got from a TCMU device record (for example, for RBD devices, the records should be stored in their metadata). So that we can decode / encode them. Signed-off-by: Zhu Lingshan ---

Re: [PATCH 2/2] qla2xxx: remove irq save in qla2x00_poll()

2018-06-15 Thread Sebastian Andrzej Siewior
On 2018-06-11 16:56:35 [+0200], Johannes Thumshirn wrote: > Looks good, > Reviewed-by: Johannes Thumshirn Martin, what about this one? Sebastian

Re: [PATCH 1/2 v2] libsas: remove irq save in sas_ata_qc_issue()

2018-06-15 Thread Sebastian Andrzej Siewior
On 2018-06-14 21:59:18 [-0400], Martin K. Petersen wrote: > > Sebastian, Martin, > Applied to 4.19/scsi-queue. Thank you! Thank you. Sebastian