Re: [PATCH v2 00/17] lpfc updates for 11.4.0.0
Hi James, >> We're approaching rc5 and there are several hundred-liners in this >> submission. The EQ delay logic patch in particular looks like a feature >> rather than a bug fix. >> >> How many of these are critical to get into 4.12 vs. 4.13? >> > All others I'd like to get in 4.12 This really looks way too big to be able to fly under the emperor penguin's radar for rc6. We should be down to 10-liner patches at this point in the stabilization window. I have queued the whole series for 4.13. If there are smaller, trivial patches without dependencies you would like to see in 4.12 I can shuffle them over. 10, 11, and 12 appear to fix panics and are thus candidates for rc6. Whereas "Add nvme initiator devloss support", while obviously a deficiency, falls pretty clearly in the new feature bucket. -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 0/3] scsi: qedf: Fix a return value + some cleanups
Christophe, > This patch serie first fixes a case where an error code was missing. > The 2 other patches are just cleanups in the same area. Applied to 4.13/scsi-queue with fixed typo. -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 0/2] esas2r: Replace semaphores with mutexes
Binoy, > These are a set of patches which removes semaphores from esas2r. > These are part of a bigger effort to eliminate unwanted semaphores > from the linux kernel. Applied to 4.13/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH] qla2xxx: Fix compile warning
Himanshu, > Fixes following 0-day kernel build warnings Applied to 4.13/scsi-queue. Thank you! -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH][scsi-next] scsi: qla2xxx: remove redundant null check on tgt
Colin, > An earlier commit ed7fb808477b846bb2 ("scsi: qla2xxx: Remove redundant > wait when target is stopped.") removed a null check on ha->tgt.tgt_ops > and replaced it with a new check that null checked tgt, thus making > the subsequent null check on tgt totally redundant. Remove it. Applied to 4.13/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH V4 0/2] scsi: ufshcd-pci: Add Intel CNL support
Adrian, > Here is V4 of patches to add support for Intel UFS host controllers. Applied to 4.13/scsi-queue. Thank you! -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH] scsi: lpfc: make a couple of functions static
Colin, > functions lpfc_nvmet_cleanup_io_context and > lpfc_nvmet_setup_io_context can be made static as they do not need to > be in global scope. > > Cleans up sparse warnings: > "warning: symbol 'lpfc_nvmet_cleanup_io_context' was not declared. >Should it be static?" > "warning: symbol 'lpfc_nvmet_setup_io_context' was not declared. >Should it be static?" Applied to 4.13/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH v3 00/12] SCSI patches for kernel v4.13
Bart, > This patch series consists of the bug fixes and improvements I came up > with during the past two months. This patch series has been developed > on top of your 4.13/scsi-queue branch. Please consider these patches > for kernel v4.13. Applied to 4.13/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering
[PATCH] storvsc: use default I/O timeout handler for FC devices
From: Long LiFC disks are usually setup in a multipath system, and they don't want to unconditionaly reset I/O on timeout. I/O timeout is detected by multipath as a good time to failover and recover. Signed-off-by: Long Li --- drivers/scsi/storvsc_drv.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 8d955db..d60b5ea 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -486,6 +486,7 @@ struct hv_host_device { unsigned int port; unsigned char path; unsigned char target; + bool is_fc; }; struct storvsc_scan_work { @@ -1495,6 +1496,11 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd) */ static enum blk_eh_timer_return storvsc_eh_timed_out(struct scsi_cmnd *scmnd) { + struct hv_host_device *host_dev = shost_priv(scmnd->device->host); + + if (host_dev->is_fc) + return BLK_EH_NOT_HANDLED; + return BLK_EH_RESET_TIMER; } @@ -1738,6 +1744,7 @@ static int storvsc_probe(struct hv_device *device, host_dev->port = host->host_no; host_dev->dev = device; + host_dev->is_fc = is_fc; stor_device = kzalloc(sizeof(struct storvsc_device), GFP_KERNEL); -- 2.7.4
Re: [ANNOUNCE]: Broadcom (Emulex) FC Target driver - efct
On 5/16/2017 12:59 PM, Roland Dreier wrote: On Sun, Mar 5, 2017 at 8:35 AM, Sebastian Herbsztwrote: Just like Hannes I do favour integration. I guess it could be comparable to qla2xxx + tcm_qla2xxx, lpfc + lpfc_scst and lpfc + tcm_lpfc. That approach might even help Bart with his target driver unification if he didn't give up on that topic. Resurrecting this old topic - sorry for not seeing this go by initially. For context, I have a lot of experience debugging the qla2xxx target code - we did a lot of work to get error/exception paths correct. Basic FC target support is pretty straightforward but handling SAN log in / log out events and other strange things that initiators do took a lot of effort. Anyway, my feeling is that the integration of tcm_qla2xxx and qla2xxx was overall a net negative. Having the target driver grafted onto the side of an already-complex driver that has a bunch of code not relevant to the target (SCSI error handling, logging into and timing out remote target ports, etc) made the code harder to debug and harder to get right. Of course I'm in favor of making common code really common. So certainly we should have a common library of SLI-4 code that both the initiator and target driver share. And if there is more commonality, that's great. But any code similar to "if (initiator) ... else ..." is really suspect to me - grepping for "qla_ini_mode_enabled" shows great examples like ... Handling "dual mode" (both initiator and target on the same port at the same time) is a design challenge, but I don't think the current qla2xxx driver is an example of a maintainable way to do that. (I'm agnostic about what to do about SLI-3 - perhaps the cleanest thing to do is split the driver between SLI-4 and SLI-3, and handle the initiator and target drivers for those two cases as appropriate) I'd love to discuss this further and come up with a design that meets the concerns about integration but also learns the lessons from tcm_qla2xxx. - R. Thanks for the feedback. I believe you echo many of our concerns as we look at "merging them into one". I agree with your statements on the number of if-else roles and know that we made this even more complicated by the driver doing fc-nvme initiator and fc-nvme target as well. Your small list of "mode_enabled" hits pales in comparison to a hit list in the current driver if looking for SCSI initiator support (LPFC_ENABLE_FCP), NVME initiator support (LPFC_ENABLE_NVME), or NVME target support (phba->nvmet_support). And that's before adding SCSI target support. We're also concerned about the discovery engines as not only are there lots of different paths for the different roles as well as support for fcoe, but there are a lot of carefully managed accommodations for various oem and switch environments. It's very difficult to replicate and retest all these different configurations and scenarios. Here's what I'd like to propose for a direction: 1) Create an initiator driver and a target driver. For now, initiator would support both SCSI and NVME initiator. Target would support SCSI and NVME target. 2) SLI3 support would be contained only within the initiator driver and limited to SCSI (as it is today in lpfc). 3) SLI4 support would be library-ized,so that the code can be shared between the two drivers. Library-izing SLI-4 means SLI-3 will also be library-ized. 4) Discovery support would be librarized so it can be shared. As part of this effort we will minimally move generic functions from the library to drivers/scsi/libfc (example: setting RPA payloads, etc). At this time, the drivers will not attempt to use libfc for discovery. There is too much sensitive code tied to interlocks with adapter api design that are visible in the discovery state machine. Use of libfc can be a future, but for the short term, the goal is a single library for the broadcom initiator/target drivers. 5) lpfc will be refactored, addressing concerns that have been desired for a while. To start this effort, I'd like a bcmlpfc directory to be made within the drivers staging tree. The directory would be populated with the efct driver and a copy of the existing lpfc driver. Work can then commence on refactoring lpfc and creating the libraries and integrating the libraries into both drivers. As lpfc is updated in the main tree, patches would be posted to the staging version of lpfc to keep them on par. Questions: a) How best to deal with overlapping pci id's ? E.g. if we do (1) and we have an initiator and target driver, there is a lot of adapters that are fully functional for target operation, but were sold as primarily an initiator adapter. How could we manage target mode enablement without code mod or hard pci id partitioning ? I know individual pci unbind/bind could work, but its been frowned upon as a long term option. Same thing goes for module parameters to select which ports do what role. b)
Re: [PATCH 1/3] scsi:ufs:add AHIT for hi3660 ufs
On 2017-06-09 18:20, butao wrote: add Auto-Hibernate Idle Timer value for hi3660 ufs Signed-off-by: Bu TaoSigned-off-by: Geng Jianfeng Signed-off-by: Zang Leigang Signed-off-by: Yu Jianfeng --- drivers/scsi/ufs/ufshci.h | 3 +++ 1 file changed, 3 insertions(+) mode change 100644 => 100755 drivers/scsi/ufs/ufshci.h diff --git a/drivers/scsi/ufs/ufshci.h b/drivers/scsi/ufs/ufshci.h old mode 100644 new mode 100755 index f60145d4a66e..5ab9dfe4280e --- a/drivers/scsi/ufs/ufshci.h +++ b/drivers/scsi/ufs/ufshci.h @@ -151,6 +151,9 @@ enum { CONTROLLER_FATAL_ERROR |\ SYSTEM_BUS_FATAL_ERROR) +/* AHIT - Auto-Hibernate Idle Timer */ +#define UFS_AHIT_AH8ITV_MASK 0x3FF This should be added only when we would need it in the driver. + /* HCS - Host Controller Status 30h */ #define DEVICE_PRESENT UFS_BIT(0) #define UTP_TRANSFER_REQ_LIST_READYUFS_BIT(1) -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH 0/3] scsi: qedf: Fix a return value + some cleanups
On Sun, 11 Jun 2017, 2:16am, Christophe JAILLET wrote: > This patch serie first fixes a case where an error code was missing. > The 2 other patches are just cleanups in the same area. > > Christophe JAILLET (3): > scsi: qedf: Fix a return value in case of error in > 'qedf_alloc_global_queues' > scsi: qedf: Use 'dma_zalloc_coherent' to reduce code verbosity. > scsi: qedf: Merge a few quoted strings split across lines > > drivers/scsi/qedf/qedf_main.c | 38 +- > 1 file changed, 13 insertions(+), 25 deletions(-) > > All are sensible small improvements. Ack the series. series-acked-by: Chad Dupuis
Re: [PATCH v5 03/23] scsi: hisi_sas: optimise the usage of hisi_hba.lock
On 12/06/2017 10:45, Arnd Bergmann wrote: On Mon, Jun 12, 2017 at 10:26 AM, John Garrywrote: On 10/06/2017 21:44, kbuild test robot wrote: I don't think that reusing flags variable is in error, as there would be no nested spinlock at this point within the function. If it is not recommended or not permitted to reuse flags variable for separate spinlocks, then that can be changed - I don't know. No, look again: coccinelle is right as the locks are nested in https://github.com/0day-ci/linux/blob/bf95e9cccde4af4ed2012a6ec44d48b545d5ffed/drivers/scsi/hisi_sas/hisi_sas_main.c#L1208 dq->lock is already held and you acquire task->task_state_lock in line 1208, which overwrites the flags. Arnd Hi Arnd, Ah, now I see. The error message mislead me, as I straight away checked hisi_sas_task_prep() which does the same locking and also reuses flags for spinlock_irqsave(), but it's safe here. But, as you pointed out, the problem is in hisi_sas_internal_abort_task_exec(). A thought: it would be useful if coccinelle printed explicitly the function name which has the warning/error. Thanks, John .
Re: [PATCH v5 03/23] scsi: hisi_sas: optimise the usage of hisi_hba.lock
On Mon, Jun 12, 2017 at 10:26 AM, John Garrywrote: > On 10/06/2017 21:44, kbuild test robot wrote: > > > I don't think that reusing flags variable is in error, as there would be no > nested spinlock at this point within the function. > > If it is not recommended or not permitted to reuse flags variable for > separate spinlocks, then that can be changed - I don't know. No, look again: coccinelle is right as the locks are nested in https://github.com/0day-ci/linux/blob/bf95e9cccde4af4ed2012a6ec44d48b545d5ffed/drivers/scsi/hisi_sas/hisi_sas_main.c#L1208 dq->lock is already held and you acquire task->task_state_lock in line 1208, which overwrites the flags. Arnd
Re: [PATCH v5 03/23] scsi: hisi_sas: optimise the usage of hisi_hba.lock
On 10/06/2017 21:44, kbuild test robot wrote: Hi Xiang, [auto build test WARNING on mkp-scsi/for-next] [also build test WARNING on v4.12-rc4 next-20170609] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/John-Garry/hisi_sas-hip08-support/20170611-014437 base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next coccinelle warnings: (new ones prefixed by >>) drivers/scsi/hisi_sas/hisi_sas_main.c:1208:1-18: ERROR: nested lock+irqsave that reuses flags from line 1178. vim +1208 drivers/scsi/hisi_sas/hisi_sas_main.c bf95e9ccc Xiang Chen 2017-06-09 1172 if (rc) { bf95e9ccc Xiang Chen 2017-06-09 1173 spin_unlock_irqrestore(_hba->lock, flags); 441c27401 John Garry 2016-08-24 1174 goto err_out; bf95e9ccc Xiang Chen 2017-06-09 1175 } bf95e9ccc Xiang Chen 2017-06-09 1176 spin_unlock_irqrestore(_hba->lock, flags); bf95e9ccc Xiang Chen 2017-06-09 1177 bf95e9ccc Xiang Chen 2017-06-09 @1178 spin_lock_irqsave(>lock, flags); bf95e9ccc Xiang Chen 2017-06-09 1179 rc = hisi_hba->hw->get_free_slot(hisi_hba, dq); 441c27401 John Garry 2016-08-24 1180 if (rc) 441c27401 John Garry 2016-08-24 1181 goto err_out_tag; 441c27401 John Garry 2016-08-24 1182 bf95e9ccc Xiang Chen 2017-06-09 1183 dlvry_queue = dq->id; bf95e9ccc Xiang Chen 2017-06-09 1184 dlvry_queue_slot = dq->wr_point; bf95e9ccc Xiang Chen 2017-06-09 1185 441c27401 John Garry 2016-08-24 1186 slot = _hba->slot_info[slot_idx]; 441c27401 John Garry 2016-08-24 1187 memset(slot, 0, sizeof(struct hisi_sas_slot)); 441c27401 John Garry 2016-08-24 1188 441c27401 John Garry 2016-08-24 1189 slot->idx = slot_idx; 441c27401 John Garry 2016-08-24 1190 slot->n_elem = n_elem; 441c27401 John Garry 2016-08-24 1191 slot->dlvry_queue = dlvry_queue; 441c27401 John Garry 2016-08-24 1192 slot->dlvry_queue_slot = dlvry_queue_slot; 441c27401 John Garry 2016-08-24 1193 cmd_hdr_base = hisi_hba->cmd_hdr[dlvry_queue]; 441c27401 John Garry 2016-08-24 1194 slot->cmd_hdr = _hdr_base[dlvry_queue_slot]; 441c27401 John Garry 2016-08-24 1195 slot->task = task; 441c27401 John Garry 2016-08-24 1196 slot->port = port; 441c27401 John Garry 2016-08-24 1197 task->lldd_task = slot; 441c27401 John Garry 2016-08-24 1198 441c27401 John Garry 2016-08-24 1199 memset(slot->cmd_hdr, 0, sizeof(struct hisi_sas_cmd_hdr)); 441c27401 John Garry 2016-08-24 1200 441c27401 John Garry 2016-08-24 1201 rc = hisi_sas_task_prep_abort(hisi_hba, slot, device_id, 441c27401 John Garry 2016-08-24 1202 abort_flag, task_tag); 441c27401 John Garry 2016-08-24 1203 if (rc) 441c27401 John Garry 2016-08-24 1204 goto err_out_tag; 441c27401 John Garry 2016-08-24 1205 405314df5 John Garry 2017-03-23 1206 405314df5 John Garry 2017-03-23 1207 list_add_tail(>entry, _dev->list); 54c9dd2d2 John Garry 2017-03-23 @1208 spin_lock_irqsave(>task_state_lock, flags); I don't think that reusing flags variable is in error, as there would be no nested spinlock at this point within the function. If it is not recommended or not permitted to reuse flags variable for separate spinlocks, then that can be changed - I don't know. John 441c27401 John Garry 2016-08-24 1209 task->task_state_flags |= SAS_TASK_AT_INITIATOR; 54c9dd2d2 John Garry 2017-03-23 1210 spin_unlock_irqrestore(>task_state_lock, flags); 441c27401 John Garry 2016-08-24 1211 :: The code at line 1208 was first introduced by commit :: 54c9dd2d26d0951891516a956893428feb9aea17 scsi: hisi_sas: fix some sas_task.task_state_lock locking :: TO: John Garry:: CC: Martin K. Petersen --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .
Re: [PATCH v4 0/5] tcmu: Add Type of reconfig into netlink
On 06/11/2017 04:02 PM, Mike Christie wrote: > On 06/09/2017 01:11 AM, Nicholas A. Bellinger wrote: >> Hi Bryant & Co, >> >> On Tue, 2017-06-06 at 09:28 -0500, Bryant G. Ly wrote: >>> From: "Bryant G. Ly">>> >>> This patch consists of adding a netlink to allow for reconfiguration >>> of a device in tcmu. >>> >>> It also changes and adds some attributes that are reconfigurable: >>> write_cache, device size, and device path. >>> >>> V2 - Fixes kfree in tcmu: Make dev_config configurable >>> V3 - Fixes spelling error >>> V4 - change strcpy to strlcpy for tcmu_dev_path_store and move >>> tcmu_reconfig_type into target_core_user.h >>> >>> >>> Bryant G. Ly (5): >>> tcmu: Support emulate_write_cache >>> tcmu: Add netlink for device reconfiguration >>> tcmu: Make dev_size configurable via userspace >>> tcmu: Make dev_config configurable >>> tcmu: Add Type of reconfig into netlink >>> >>> drivers/target/target_core_user.c | 152 >>> -- >>> include/uapi/linux/target_core_user.h | 9 ++ >>> 2 files changed, 155 insertions(+), 6 deletions(-) >>> >> >> AFAICT, it looks like all of the review comments have been addressed in >> -v4. >> >> Applied to target-pending/for-next, with MNC's (pseudo) Reviewed-by's >> added for #3-#5. >> >> Please let me know if anything else needs to be changed. >> > > The patches look ok. Thanks. Could you just merge the attached patch > into "[PATCH v4 5/5] tcmu: Add Type of reconfig into netlink" or into > the patchset after it? It just makes some of the names a little less > generic and only returns the reconfig attr for reconfig commands. > Actually Nick, do not merge the last patch. I have a lot more fixes/changes. Bryant, could you test and adapt your userspace patches for the attached patch build over Nicks for-next branch. Basically, the patch just has use pass the value being reconfigured with the netlink event. Along the way, it fixes a couple bugs. Nick, when we have tested the patch, then I can submit as a formal patchset, or you can fold into the existing patches or whatever you prefer. >From dad38c89d92a83b19b285431268818a74fe48fab Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 12 Jun 2017 01:34:28 -0500 Subject: [PATCH 1/1] tcmu: reconfigure netlink attr changes v2 1. TCMU_ATTR_TYPE is too generic. Drop it and use per reconfig type attrs. 2. Only return the reconfig type when it is a TCMU_CMD_RECONFIG_DEVICE command. 3. CONFIG_* type is not needed. We can pass the value along with an ATTR to userspace, so it does not need to read sysfs/configfs. 4. Fix leak in tcmu_dev_path_store and rename to dev_config to reflect it is more than just a path that can be changed. 6. Don't update kernel struct value if netlink sending fails. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 73 +-- include/uapi/linux/target_core_user.h | 12 ++ 2 files changed, 48 insertions(+), 37 deletions(-) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index afc1fd6..1712c42 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -1177,7 +1177,8 @@ static int tcmu_release(struct uio_info *info, struct inode *inode) } static int tcmu_netlink_event(enum tcmu_genl_cmd cmd, const char *name, - int minor, int type) + int minor, int reconfig_attr, + const void *reconfig_data) { struct sk_buff *skb; void *msg_header; @@ -1199,9 +1200,27 @@ static int tcmu_netlink_event(enum tcmu_genl_cmd cmd, const char *name, if (ret < 0) goto free_skb; - ret = nla_put_u32(skb, TCMU_ATTR_TYPE, type); - if (ret < 0) - goto free_skb; + if (cmd == TCMU_CMD_RECONFIG_DEVICE) { + switch (reconfig_attr) { + case TCMU_ATTR_DEV_CFG: + ret = nla_put_string(skb, reconfig_attr, reconfig_data); + break; + case TCMU_ATTR_DEV_SIZE: + ret = nla_put_u64_64bit(skb, reconfig_attr, + *((u64 *)reconfig_data), + TCMU_ATTR_PAD); + break; + case TCMU_ATTR_WRITECACHE: + ret = nla_put_u8(skb, reconfig_attr, + *((u8 *)reconfig_data)); + break; + default: + BUG(); + } + + if (ret < 0) + goto free_skb; + } genlmsg_end(skb, msg_header); @@ -1306,7 +1325,7 @@ static int tcmu_configure_device(struct se_device *dev) kref_get(>kref); ret = tcmu_netlink_event(TCMU_CMD_ADDED_DEVICE, udev->uio_info.name, - udev->uio_info.uio_dev->minor, NO_RECONFIG); + udev->uio_info.uio_dev->minor, 0, NULL); if (ret) goto err_netlink; @@ -1388,7 +1407,7 @@ static void tcmu_free_device(struct se_device *dev) if (tcmu_dev_configured(udev)) { tcmu_netlink_event(TCMU_CMD_REMOVED_DEVICE, udev->uio_info.name, - udev->uio_info.uio_dev->minor, NO_RECONFIG); + udev->uio_info.uio_dev->minor, 0, NULL); uio_unregister_device(>uio_info); } @@ -1553,7 +1572,7 @@ static ssize_t