Re: [PATCH v2 1/4] qla2xxx_nvmet: Add files for FC-NVMe Target support

2017-11-09 Thread Himanshu Madhani
Hi James, On Thu, 9 Nov 2017, 7:36am, James Smart wrote: > On 11/8/2017 7:17 PM, Himanshu Madhani wrote: > > +static struct nvmet_fc_target_template qla_nvmet_fc_transport = { > > + .targetport_delete = qla_nvmet_targetport_delete, > > + .xmt_ls_rsp = qla_nvmet_ls_rsp, > > +

Re: qla2xxx UBSAN warning in 4.14-rc1

2017-11-09 Thread Himanshu Madhani
Hi Meelis, On Thu, 9 Nov 2017, 12:59am, Meelis Roos wrote: > Hello again. > > > > On Sep 18, 2017, at 3:49 AM, Meelis Roos wrote: > > > > > > Hello, I decided to widen the coverage of my kernel testbed and put some > > > FC cards into servers. This one is a PCI-X QLA2340 in HP Proliant DL 380

Re: [PATCH v2 0/4] qla2xxx: Add FC-NVMe Target support

2017-11-09 Thread Himanshu Madhani
On Thu, 9 Nov 2017, 1:33am, Christoph Hellwig wrote: > Before even looking at the patches: they seem to add a lot of new > sparse warnings, mostly about endianess issues. Given that FC-NVMe > is a mix of BE and LE structures getting this right is important. > Please fix them up first. > > >

[PATCH v2 07/17] lpfc: Driver fails to detect direct attach storage array

2017-11-09 Thread James Smart
The driver does not respond to PLOGI from the direct attach target. The driver uses incorrect S_ID in CONFIG_LINK, after FLOGI completion Correct by issuing CONFIG_LINK with the correct S_ID after receiving the PLOGI from the target Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewe

[PATCH v2 09/17] lpfc: Adjust default value of lpfc_nvmet_mrq

2017-11-09 Thread James Smart
The current default for async hw receive queues is 1, which presents issues under heavy load as number of queues influence the available async receive buffer limits. Raise the default to the either the current hw limit (16) or the number of hw qs configured (io channel value). Revise the attribut

[PATCH v2 17/17] lpfc: update driver version to 11.4.0.5

2017-11-09 Thread James Smart
Update the driver version to 11.4.0.5 Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index e0181371af09..cc2f5cec9

[PATCH v2 16/17] lpfc: small sg cnt cleanup

2017-11-09 Thread James Smart
The logic for sg_seg_cnt is a bit convoluted. This patch tries to clean up a couple of areas, especially around the +2 and +1 logic. This patch: - cleans up the lpfc_sg_seg_cnt attribute to specify a real minimum rather than making the minimum be whatever the default is. - Remove the hardcoding

[PATCH v2 14/17] lpfc: Fix crash during driver unload with running nvme traffic

2017-11-09 Thread James Smart
When the driver is unloading, the nvme transport could be in the process of submitting new requests, will send abort requests to terminate associations, or may make LS-related requests. The driver's abort and request entry points currently is ignorant of the unloading state and is starting the requ

[PATCH v2 12/17] lpfc: correct port registrations with nvme_fc

2017-11-09 Thread James Smart
The driver currently registers any remote port that has NVME support. It should only be registering target ports. Register only target ports. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hbadisc.c | 20 drivers/scsi/lpfc/lpfc_nvme.c

[PATCH v2 11/17] lpfc: Linux LPFC driver does not process all RSCNs

2017-11-09 Thread James Smart
During RSCN storms, the driver does not rediscover some targets. The driver marks some RSCN as to be handled after the ones it's working on. The driver missed processing some deferred RSCN. Move where the driver checks for deferred RSCNs and initiate deferred RSCN handling if the flag was set. Als

[PATCH v2 06/17] lpfc: Raise maximum NVME sg list size for 256 elements

2017-11-09 Thread James Smart
Raise the maximum NVME sg list size allowed to 256 elements. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h

[PATCH v2 15/17] lpfc: Fix driver handling of nvme resources during unload

2017-11-09 Thread James Smart
During driver unload, the driver may crash due to NULL pointers. The NULL pointers were due to the driver not protecting itself sufficiently during some of the teardown paths. Additionally, the driver was not waiting for and cleanup up nvme io resources. As such, the driver wasn't making the callba

[PATCH v2 08/17] lpfc: Fix display for debugfs queInfo

2017-11-09 Thread James Smart
Display for lpfc/fnX/iDiag/queInfo isn't formatted perfectly. Corrected the format strings for the queue info debug messages. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_debugfs.c | 14 +++--- 1 file changed, 7 insertio

[PATCH v2 04/17] lpfc: Fix crash after bad bar setup on driver attachment

2017-11-09 Thread James Smart
In test cases where an instance of the driver is detached and reattached, the driver will crash on reattachment. There is a compound if statement that will skip over the bar setup if the pci_resource_start call is not successful. The driver erroneously returns success to its bar setup in this scena

[PATCH v2 13/17] lpfc: Correct driver deregistrations with host nvme transport

2017-11-09 Thread James Smart
The driver's interaction with the host nvme transport has been incorrect for a while. The driver did not wait for the unregister callbacks (waited only 5 jiffies). Thus the driver may remove objects that may be referenced by subsequent abort commands from the transport, and the actual unregister ca

[PATCH v2 10/17] lpfc: Fix ndlp ref count for pt2pt mode issue RSCN

2017-11-09 Thread James Smart
pt2pt ndlp ref count prematurely goes to 0. There was reference removed that should only be removed if connected to a switch, not if in point-to-point mode. Add a mode check before the reference remove. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_els.c | 4

[PATCH v2 02/17] lpfc: Expand WQE capability of every NVME hardware queue

2017-11-09 Thread James Smart
Hardware queues are a fast staging area to push commands into the adapter. The adapter should drain them extremely quickly. However, under heavy io load, the host cpu is pushing commands faster than the drain rate of the adapter causing the driver to resource busy commands. Enlarge the hardware qu

[PATCH v2 03/17] lpfc: Handle XRI_ABORTED_CQE in soft IRQ

2017-11-09 Thread James Smart
XRI_ABORTED_CQE completions were not being handled in the fast path. They were being queued and deferred to the lpfc worker thread for processing. This is an artifact of the driver design prior to moving queue processing out of the isr and into a workq element. Now that queue processing is already

[PATCH v2 05/17] lpfc: Fix NVME LS abort_xri

2017-11-09 Thread James Smart
performing an LS abort results in the following message being seen: 0603 Invalid CQ subtype 6: 0300 2202 0016 d005 and the associated exchange is not properly freed. The code did not recognize the exchange type that was aborted, thus it was not properly handled. Correct by addin

[PATCH v2 01/17] lpfc: FLOGI failures are reported when connected to a private loop.

2017-11-09 Thread James Smart
When the HBA is connected to a private loop, the driver reports FLOGI loop-open failure as functional error. This is an expected condition. Mark loop-open failure as a warning instead of error. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- v2: Reworked printf. v1 printed 2 messa

[PATCH v2 00/17] lpfc updates for 11.4.0.5

2017-11-09 Thread James Smart
This patch set provides a number of bug fixes and additions to the driver. The patches were cut against the Martin's 4.15/scsi-queue tree. There are no outside dependencies and are expected to be pulled via Martins tree. v2: Rework patch 1 per review Add signed-by's on other patches James Sma

Re: [PATCH v3] scsi: require CAP_SYS_ADMIN to write to procfs interface

2017-11-09 Thread Eric W. Biederman
Aleksa Sarai writes: > On 11/05/2017 01:56 PM, Aleksa Sarai wrote: >> Previously, the only capability effectively required to operate on the >> /proc/scsi interface was CAP_DAC_OVERRIDE (or for some other files, >> having an fsuid of GLOBAL_ROOT_UID was enough). This means that >> semi-privileged

Re: [PATCH v12 0/7] block, scsi: Improve suspend and resume

2017-11-09 Thread Jens Axboe
On 11/09/2017 11:49 AM, Bart Van Assche wrote: > Hello Jens, > > It is known that during the resume following a hibernate, especially when > using an md RAID1 array created on top of SCSI devices, sometimes the system > hangs instead of resuming up properly. This patch series fixes that > problem.

[PATCH v12 5/7] block: Add the QUEUE_FLAG_PREEMPT_ONLY request queue flag

2017-11-09 Thread Bart Van Assche
This flag will be used in the next patch to let the block layer core know whether or not a SCSI request queue has been quiesced. A quiesced SCSI queue namely only processes RQF_PREEMPT requests. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Tested-by: Martin Steigerwald Tested-by:

[PATCH v12 6/7] block, scsi: Make SCSI quiesce and resume work reliably

2017-11-09 Thread Bart Van Assche
The contexts from which a SCSI device can be quiesced or resumed are: * Writing into /sys/class/scsi_device/*/device/state. * SCSI parallel (SPI) domain validation. * The SCSI device power management methods. See also scsi_bus_pm_ops. It is essential during suspend and resume that neither the file

[PATCH v12 0/7] block, scsi: Improve suspend and resume

2017-11-09 Thread Bart Van Assche
Hello Jens, It is known that during the resume following a hibernate, especially when using an md RAID1 array created on top of SCSI devices, sometimes the system hangs instead of resuming up properly. This patch series fixes that problem. These patches have been tested on top of the block layer f

[PATCH v12 2/7] block: Introduce blk_get_request_flags()

2017-11-09 Thread Bart Van Assche
A side effect of this patch is that the GFP mask that is passed to several allocation functions in the legacy block layer is changed from GFP_KERNEL into __GFP_DIRECT_RECLAIM. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Tested-by: Martin Steigerwald Tested-by: Oleksandr Natalenk

[PATCH v12 4/7] ide, scsi: Tell the block layer at request allocation time about preempt requests

2017-11-09 Thread Bart Van Assche
Convert blk_get_request(q, op, __GFP_RECLAIM) into blk_get_request_flags(q, op, BLK_MQ_PREEMPT). This patch does not change any functionality. Signed-off-by: Bart Van Assche Tested-by: Martin Steigerwald Acked-by: David S. Miller [ for IDE ] Acked-by: Martin K. Petersen Reviewed-by: Hannes Rei

[PATCH v12 7/7] block, nvme: Introduce blk_mq_req_flags_t

2017-11-09 Thread Bart Van Assche
Several block layer and NVMe core functions accept a combination of BLK_MQ_REQ_* flags through the 'flags' argument but there is no verification at compile time whether the right type of block layer flags is passed. Make it possible for sparse to verify this. This patch does not change any function

[PATCH v12 1/7] block: Make q_usage_counter also track legacy requests

2017-11-09 Thread Bart Van Assche
From: Ming Lei This patch makes it possible to pause request allocation for the legacy block layer by calling blk_mq_freeze_queue() and blk_mq_unfreeze_queue(). Signed-off-by: Ming Lei [ bvanassche: Combined two patches into one, edited a comment and made sure REQ_NOWAIT is handled properly i

[PATCH v12 3/7] block: Introduce BLK_MQ_REQ_PREEMPT

2017-11-09 Thread Bart Van Assche
Set RQF_PREEMPT if BLK_MQ_REQ_PREEMPT is passed to blk_get_request_flags(). Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Tested-by: Martin Steigerwald Tested-by: Oleksandr Natalenko Cc: Christoph Hellwig Cc: Ming Lei Cc: Johannes Thumshirn --- block/blk-core.c | 4 +++-

Re: [PATCH v11 0/7] block, scsi, md: Improve suspend and resume

2017-11-09 Thread Oleksandr Natalenko
Then, Reported-by: Oleksandr Natalenko Tested-by: Oleksandr Natalenko On čtvrtek 9. listopadu 2017 17:55:58 CET Jens Axboe wrote: > On 11/09/2017 09:54 AM, Bart Van Assche wrote: > > On Thu, 2017-11-09 at 07:16 +0100, Oleksandr Natalenko wrote: > >> is this something known to you, or it is just

Re: [PATCH v11 0/7] block, scsi, md: Improve suspend and resume

2017-11-09 Thread Jens Axboe
On 11/09/2017 09:54 AM, Bart Van Assche wrote: > On Thu, 2017-11-09 at 07:16 +0100, Oleksandr Natalenko wrote: >> is this something known to you, or it is just my fault applying this series >> to >> v4.13? Except having this warning, suspend/resume works for me: >> >> [ 27.383846] sd 0:0:0:0: [

Re: [PATCH v11 0/7] block, scsi, md: Improve suspend and resume

2017-11-09 Thread Bart Van Assche
On Thu, 2017-11-09 at 07:16 +0100, Oleksandr Natalenko wrote: > is this something known to you, or it is just my fault applying this series > to > v4.13? Except having this warning, suspend/resume works for me: > > [ 27.383846] sd 0:0:0:0: [sda] Starting disk > [ 27.383976] sd 1:0:0:0: [sdb]

Re: [PATCH v2 1/4] qla2xxx_nvmet: Add files for FC-NVMe Target support

2017-11-09 Thread James Smart
On 11/8/2017 7:17 PM, Himanshu Madhani wrote: +static struct nvmet_fc_target_template qla_nvmet_fc_transport = { + .targetport_delete = qla_nvmet_targetport_delete, + .xmt_ls_rsp = qla_nvmet_ls_rsp, + .fcp_op = qla_nvmet_fcp_op, + .fcp_abor

Re: [PATCH] scsi/eh: fix hang adding ehandler wakeups after decrementing host_busy

2017-11-09 Thread Pavel Tikhomirov
> Are there any issues with this patch (https://patchwork.kernel.org/patch/9938919/) that Pavel Tikhomirov submitted back in September? I am willing to help if there's anything I can do to help get it accepted. Hi, Stuart, I asked James Bottomley about the patch status offlist and it seems t

Re: [PATCH v2 0/4] qla2xxx: Add FC-NVMe Target support

2017-11-09 Thread Christoph Hellwig
Before even looking at the patches: they seem to add a lot of new sparse warnings, mostly about endianess issues. Given that FC-NVMe is a mix of BE and LE structures getting this right is important. Please fix them up first.

Re: qla2xxx UBSAN warning in 4.14-rc1

2017-11-09 Thread Meelis Roos
Hello again. > > On Sep 18, 2017, at 3:49 AM, Meelis Roos wrote: > > > > Hello, I decided to widen the coverage of my kernel testbed and put some > > FC cards into servers. This one is a PCI-X QLA2340 in HP Proliant DL 380 > > G4 (first 64-bit generation of Proliants). I got a UBSAN warning fr

[PATCH] scsi: ufs: Fix Runtime PM

2017-11-09 Thread Michal Potomski
From: Michał Potomski Recent testing of Runtime PM for UFS has shown it's not working as intended. To acheive fully working Runtime PM, first we have to put back scsi_device autopm reference counter. Existing implementation was prone to races and not working for tranfsers to sleeping devices. Th

[PATCH 13/13] scsi: arcmsr: update driver version to v1.40.00.02-20171011

2017-11-09 Thread Ching Huang
From: Ching Huang update driver version to v1.40.00.02-20171011 Signed-off-by: Ching Huang --- diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h --- a/drivers/scsi/arcmsr/arcmsr.h 2017-11-07 17:29:10.0 +0800 +++ b/drivers/scsi/arcmsr/arcmsr.h 2017-11-07

[PATCH 12/13] scsi: arcmsr: adjust some tab or white-space to make text alignment

2017-11-09 Thread Ching Huang
From: Ching Huang adjust some tab or white-space to make text alignment Signed-off-by: Ching Huang --- diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h --- a/drivers/scsi/arcmsr/arcmsr.h 2017-11-07 16:18:22.0 +0800 +++ b/drivers/scsi/arcmsr/arcmsr.h 20

[PATCH 11/13] scsi: arcmsr: spin off duplicate code of timer init for message isr BH in arcmsr_probe and arcmsr_resume as a function

2017-11-09 Thread Ching Huang
From: Ching Huang spin off duplicate code of timer init for message isr BH in arcmsr_probe and arcmsr_resume as a function arcmsr_init_get_devmap_timer Signed-off-by: Ching Huang --- diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c --- a/drivers/scsi/arcmsr/arc

[PATCH 10/13] scsi: arcmsr: fix clear doorbell queue on ACB_ADAPTER_TYPE_B controller

2017-11-09 Thread Ching Huang
From: Ching Huang fix clear doorbell queue on ACB_ADAPTER_TYPE_B controller Signed-off-by: Ching Huang --- diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c --- a/drivers/scsi/arcmsr/arcmsr_hba.c 2017-11-08 18:54:18.0 +0800 +++ b/drivers/scsi/arcmsr/arcm

[PATCH 9/13] scsi: arcmsr: add a function arcmsr_set_iop_datetime and driver option set_date_time to set date and time to firmware

2017-11-09 Thread Ching Huang
From: Ching Huang add a function arcmsr_set_iop_datetime and driver option set_date_time to set date and time to firmware Signed-off-by: Ching Huang --- diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h --- a/drivers/scsi/arcmsr/arcmsr.h 2017-08-04 18:39:18.000

[PATCH 8/13] scsi: arcmsr: add ACB_F_MSG_GET_CONFIG to acb->acb_flags for for message interrupt checking before schedule work for get device map

2017-11-09 Thread Ching Huang
From: Ching Huang add ACB_F_MSG_GET_CONFIG to acb->acb_flags for for message interrupt checking before schedule work for get device map Signed-off-by: Ching Huang --- diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h --- a/drivers/scsi/arcmsr/arcmsr.h 2017-08-04 18

[PATCH 7/13] scsi: arcmsr: add driver option cmd_per_lun to set host->cmd_per_lun value by user

2017-11-09 Thread Ching Huang
From: Ching Huang add driver option cmd_per_lun to set host->cmd_per_lun value by user Signed-off-by: Ching Huang --- diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h --- a/drivers/scsi/arcmsr/arcmsr.h 2017-08-04 17:40:54.0 +0800 +++ b/drivers/scsi/arcmsr/a

[PATCH 6/13] scsi: arcmsr: replace constant ARCMSR_MAX_OUTSTANDING_CMD by variable acb->maxOutstanding that was determined by user

2017-11-09 Thread Ching Huang
From: Ching Huang replace constant ARCMSR_MAX_OUTSTANDING_CMD by variable acb->maxOutstanding that was determined by user Signed-off-by: Ching Huang --- diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c --- a/drivers/scsi/arcmsr/arcmsr_hba.c 2017-11-08 18:51:20

[PATCH 5/13] scsi: arcmsr: add driver option host_can_queue to set host->can_queue value by user. It's value expands up to 1024

2017-11-09 Thread Ching Huang
From: Ching Huang add driver option host_can_queue to set host->can_queue value by user. It's value expands up to 1024 Signed-off-by: Ching Huang --- diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h --- a/drivers/scsi/arcmsr/arcmsr.h 2017-08-04 17:07:52.0