Re: [PATCH v2 09/11] block: Expose queue nr_zones in sysfs

2018-10-11 Thread Ewan D. Milne
So in v2 you moved the #ifdef CONFIG_BLK_DEV_ZONED so that nr_zones is always present? It was previously changed to keep the request_queue size smaller. Would make more sense to make the nr_zones sysfs code here conditional on CONFIG_BLK_DEV_ZONED? -Ewan On Thu, 2018-10-11 at 16:09 +0900, Dami

Re: [PATCH -next] scsi: qedf: remove set but not used variable 'fcport'

2018-10-19 Thread Ewan D. Milne
On Fri, 2018-10-19 at 12:12 +, YueHaibing wrote: > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/scsi/qedf/qedf_main.c: In function 'qedf_eh_abort': > drivers/scsi/qedf/qedf_main.c:619:21: warning: > variable 'fcport' set but not used [-Wunused-but-set-variable] > struct qedf_r

Re: [PATCH 1/1] qla2xxx: Initialize port speed to avoid setting lower speed

2018-11-06 Thread Ewan D. Milne
t->ct_desc.ct_sns = dma_alloc_coherent(&vha->hw->pdev->dev, > sizeof(struct ct_sns_pkt), &fcport->ct_desc.ct_sns_dma, Thanks Laurence for the bisect that found this... Reviewed-by: Ewan D. Milne

Re: [PATCH] qla2xxx: Add SysFS hook for FC-NVMe autoconnect

2018-11-14 Thread Ewan D. Milne
On Tue, 2018-11-13 at 09:49 -0800, Bart Van Assche wrote: > On Tue, 2018-11-13 at 17:38 +, Madhani, Himanshu wrote: > > On Nov 13, 2018, at 6:23 AM, Bart Van Assche wrote: > > > On Tue, 2018-11-13 at 01:02 +, Madhani, Himanshu wrote: > > > > I see other drivers also use similar information

Re: [PATCH] qla2xxx: Add SysFS hook for FC-NVMe autoconnect

2018-11-15 Thread Ewan D. Milne
On Thu, 2018-11-15 at 13:52 +0100, Hannes Reinecke wrote: > On 11/14/18 6:13 PM, Ewan D. Milne wrote: > > On Tue, 2018-11-13 at 09:49 -0800, Bart Van Assche wrote: > > > On Tue, 2018-11-13 at 17:38 +, Madhani, Himanshu wrote: > > > > On Nov 13, 2018, at 6

Re: DIF/DIX issue related to config CONFIG_SCSI_MQ_DEFAULT

2018-11-27 Thread Ewan D. Milne
On Tue, 2018-11-27 at 17:55 +0800, chenxiang (M) wrote: > [ 629.210506] Unable to handle kernel paging request at virtual address > 8027e048 > [ 629.210506] Unable to handle kernel paging request at virtual address > 8027e048 > ... > [ 629.380218] pc : deadline_remove_request+0

Re: [PATCH repost] lpfc: Enable Management features for IF_TYPE=6

2018-12-12 Thread Ewan D. Milne
_rev == LPFC_SLI_REV4 && > (!(vport->load_flag & FC_UNLOADING)) && > (bf_get(lpfc_sli_intf_if_type, > - &phba->sli4_hba.sli_intf) == > + &phba->sli4_hba.sli_intf) >= > LPFC_SLI_INTF_IF_TYPE_2) && > (kref_read(&ndlp->kref) > 0)) { > mbox->ctx_ndlp = lpfc_nlp_get(ndlp); Reviewed-by: Ewan D. Milne

[PATCH] scsi: lpfc: do not set queue->page_count to 0 if pc_sli4_params.wqpcnt is invalid

2018-12-13 Thread Ewan D. Milne
uot;) Cc: sta...@vger.kernel.org # 4.11+ Signed-off-by: Ewan D. Milne --- drivers/scsi/lpfc/lpfc_sli.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index b9e5cd7..462ed4a 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c

[PATCH] [SCSI] sd: fix crash when UA received on DIF enabled device

2012-11-02 Thread Ewan D. Milne
From: "Ewan D. Milne" sd_prep_fn will allocate a larger CDB for the command via mempool_alloc for devices using DIF type 2 protection. This CDB was being freed in sd_done, which results in a kernel crash if the command is retried due to a UNIT ATTENTION. This change moves the code t

[PATCH 0/4] scsi_debug: Unit Attention fixes/enhancements

2014-12-04 Thread Ewan D. Milne
From: "Ewan D. Milne" This patch series fixes a couple of problems in the code to generate UAs when "virtual_gb" is changed, and adds the generation of a UA when "max_luns" is changed. It also adds the generation of a UA when a WRITE BUFFER command is issued.

[PATCH 3/4] scsi_debug: Add REPORTED LUNS DATA HAS CHANGED Unit Attention

2014-12-04 Thread Ewan D. Milne
From: "Ewan D. Milne" Generate a REPORTED LUNS DATA HAS CHANGED Unit Attention if sysfs "max_luns" is used to change the number of scsi_debug LUNs. This is only done if scsi_debug_scsi_level is SPC-3 or above. Additionally, implement SPC-4 behavior which only generates this U

[PATCH 2/4] scsi_debug: Added taking of sdebug_host_list_lock when changing capacity

2014-12-04 Thread Ewan D. Milne
From: "Ewan D. Milne" All other traversals of the sdebug_host_list take the lock. Signed-off-by: Ewan D. Milne --- drivers/scsi/scsi_debug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 397cc10..1a11466 100644 ---

[PATCH 4/4] scsi_debug: Implement WRITE BUFFER command

2014-12-04 Thread Ewan D. Milne
From: "Ewan D. Milne" Accept the WRITE BUFFER command and do nothing other than set the appropriate "microcode has been changed" UA on the LU. >From an earlier patch by Doug Gilbert. Signed-off-by: Ewan D. Milne --- drivers

[PATCH 1/4] scsi_debug: Fixed missing "break;" in SDEBUG_UA_CAPACITY_CHANGED case

2014-12-04 Thread Ewan D. Milne
From: "Ewan D. Milne" This eliminates a superfluous log message when the capacity is changed: "check_readiness: unexpected unit attention code=3" Signed-off-by: Ewan D. Milne --- drivers/scsi/scsi_debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers

[PATCH] scsi_debug: clear_luns_changed_on_target return type should be "void"

2015-01-02 Thread Ewan D. Milne
From: "Ewan D. Milne" Reported by Fengguang Wu (kbuild test robot). Signed-off-by: Ewan D. Milne --- drivers/scsi/scsi_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 5ac04d6..edc60fa 100644 ---

[PATCH] scsi: Avoid crashing if device uses DIX but adapter does not support it

2015-01-14 Thread Ewan D. Milne
From: "Ewan D. Milne" This can happen if a multipathed device uses DIX and another path is added via an adapter that does not support it. Multipath should not allow this path to be added, but we should not depend upon that to avoid crashing. Signed-off-by: Ewan D. Milne --- dr

Re: [PATCH] scsi: disable VPD page check on error

2016-06-13 Thread Ewan D. Milne
On Mon, 2016-06-13 at 14:48 +0200, Hannes Reinecke wrote: > If we encounter an error during VPD page scanning we should be > setting the 'skip_vpd_pages' bit to avoid further accesses. > > Signed-off-by: Hannes Reinecke > --- > drivers/scsi/scsi.c | 3 +++ > 1 file changed, 3 insertions(+) > >

Re: [PATCH] 53c700: fix BUG on untagged commands

2016-06-14 Thread Ewan D. Milne
> > -- > To unsubscribe from this list: send the line "unsubscribe linux-scsi" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Ewan D. Milne -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/3] scsi: Move 'scsi_attach_vpd()' prototype to scsi_priv.h

2016-06-20 Thread Ewan D. Milne
gt; > extern int scsi_device_get(struct scsi_device *); > extern void scsi_device_put(struct scsi_device *); Reviewed-by: Ewan D. Milne -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/3] scsi: disable VPD page check on error

2016-06-20 Thread Ewan D. Milne
) > - scsi_attach_vpd(sdev); > + scsi_attach_vpd(sdev, true); > > sdev->max_queue_depth = sdev->queue_depth; > > @@ -1536,7 +1536,7 @@ void scsi_rescan_device(struct device *dev) > > device_lock(dev); > > - scsi_a

Re: [PATCH 3/3] scsi: consolidate checking for VPD pages

2016-06-20 Thread Ewan D. Milne
> > - if (scsi_get_vpd_page(sdev, 0x90, buffer, vpd_len)) > + if (!scsi_device_supports_vpd(sdev) || > + scsi_get_vpd_page(sdev, 0x90, buffer, vpd_len)) > goto out; > > /* Reviewed-by: Ewan D. Milne -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/3] scsi: disable VPD page check on error

2016-06-20 Thread Ewan D. Milne
On Mon, 2016-06-20 at 06:44 -0700, James Bottomley wrote: > On Mon, 2016-06-20 at 09:25 -0400, Ewan D. Milne wrote: > > On Mon, 2016-06-20 at 08:57 +0200, Hannes Reinecke wrote: > > > If we encounter an error during initial VPD page scan we should be > > > setting the &#

Re: [PATCH] scsi: remove current_cmnd field from struct scsi_device

2016-07-11 Thread Ewan D. Milne
nd *current_cmnd; /* currently active command */ > unsigned short queue_depth; /* How deep of a queue we want */ > unsigned short max_queue_depth; /* max queue depth */ > unsigned short last_queue_full_depth; /* These two are used by */ Reviewed-by: Ewan D. Milne -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [patch] ibmvfc: prevent a potential deadlock

2016-07-15 Thread Ewan D. Milne
> spin_unlock_irqrestore(vhost->host->host_lock, flags); > } > > kref_put(&tgt->kref, ibmvfc_release_tgt); > -- Reviewed-by: Ewan D. Milne -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/5] sd: configure ZBC devices

2016-07-22 Thread Ewan D. Milne
On Tue, 2016-07-19 at 15:25 +0200, Hannes Reinecke wrote: > For ZBC devices I/O must not cross zone boundaries, so setup > the 'chunk_sectors' block queue setting to the zone size. > This is only valid for REPORT ZONES SAME type 2 or 3; > for other types the zone sizes might be different > for indi

Re: [PATCH 1/5] sd: configure ZBC devices

2016-07-25 Thread Ewan D. Milne
On Mon, 2016-07-25 at 08:00 +0200, Hannes Reinecke wrote: > On 07/24/2016 12:04 AM, Bart Van Assche wrote: > > On 07/23/16 13:31, Hannes Reinecke wrote: > >> On 07/22/2016 11:56 PM, Ewan D. Milne wrote: > >>> > >>> So, blk_queue_chunk_sectors() has: >

Re: [PATCH V4 1/2] smartpqi: initial commit of Microsemi smartpqi driver

2016-08-10 Thread Ewan D. Milne
rivers/scsi/smartpqi/smartpqi_init.c > create mode 100644 drivers/scsi/smartpqi/smartpqi_sas_transport.c > create mode 100644 drivers/scsi/smartpqi/smartpqi_sis.c > create mode 100644 drivers/scsi/smartpqi/smartpqi_sis.h > Reviewed-by: Ewan D. Milne -- To unsubscribe from this list: send

Re: [PATCH V4 2/2] aacraid: remove wildcard for series 9 controllers

2016-08-10 Thread Ewan D. Milne
rcv_init, "aacraid", "ADAPTEC ", "RAID", 2, > AAC_QUIRK_SRC }, /* Adaptec PMC Series 8 */ > - { aac_srcv_init, "aacraid", "ADAPTEC ", "RAID", 2, > AAC_QUIRK_SRC } /* Adaptec PMC Series 9 */ >

Re: [PATCH] scsi:Prevent deletion of SCSI block device in use

2016-09-13 Thread Ewan D. Milne
On Tue, 2016-09-13 at 22:08 +0530, Gurunath, Vasundhara wrote: > From: "Gurunath, Vasundhara" > > SCSI block device can be removed, using write to sysfs > delete file as below: > echo 1 > /sys/block/sdX/device/delete > If the device is in use by applications, or part of > system configuration suc

Re: [PATCH] scsi: do not print 'reservation conflict' for TEST UNIT READY

2016-09-13 Thread Ewan D. Milne
On Tue, 2016-09-13 at 08:06 -0700, James Bottomley wrote: > On Tue, 2016-09-13 at 16:24 +0200, Hannes Reinecke wrote: > > On 09/13/2016 04:04 PM, James Bottomley wrote: > > > You could argue that the entire message needs removing, since it's > > > reporting stuff that mostly only shows when systems

Re: [RESEND] [PATCH 1/1] ses: Retry UNIT ATTENTION for receive diagnostics

2016-09-19 Thread Ewan D. Milne
On Mon, 2016-09-19 at 09:20 -0700, James Bottomley wrote: > On Mon, 2016-09-19 at 11:57 -0400, Martin K. Petersen wrote: > > > > > > > "Brian" == Brian King writes: > > > > Brian> If the ses driver receives a UNIT ATTENTION when issuing a > > Brian> receive diagnostics while probing a SES device,

Re: [PATCH] scsi: lpfc: fix potential buffer overflow.

2017-04-18 Thread Ewan D. Milne
+ len += snprintf(buf + len, PAGE_SIZE - len, "\nNVME Statistics\n"); > len += snprintf(buf+len, PAGE_SIZE-len, > "LS: Xmt %016llx Cmpl %016llx\n", > phba->fc4NvmeLsRequests, Reviewed-by: Ewan D. Milne

Re: [PATCH v2] lpfc: Fix panic on BFS configuration.

2017-04-27 Thread Ewan D. Milne
;phba->hbalock); > @@ -4445,7 +4450,7 @@ lpfc_sli_brdrestart(struct lpfc_hba *phba) > * iteration, the function will restart the HBA again. The function returns > * zero if HBA successfully restarted else returns negative error code. > **/ > -static int > +int > lpfc_sli_chipset_init(struct lpfc_hba *phba) > { > uint32_t status, i = 0; If it was me, I probably would have added the checking for null pport in the _s4 functions as well, even though the current code only appears to trip over a null pport in the _s3 case. It would save a potential crash in case a SLI4 reset is added in the future and the checks are not added. You might want to consider doing this at some point. It's fine for now. Reviewed-by: Ewan D. Milne

Re: [PATCH v2] lpfc: Fix panic on BFS configuration.

2017-04-27 Thread Ewan D. Milne
Actually, it seems like there is a problem with this patch, see below: It did not compile for me. On Thu, 2017-04-27 at 09:18 -0400, Ewan D. Milne wrote: > On Wed, 2017-04-26 at 12:19 -0700, jsmart2...@gmail.com wrote: > > From: James Smart > > > > To select the appropriat

Re: [PATCH v3] lpfc: Fix panic on BFS configuration.

2017-04-28 Thread Ewan D. Milne
up word1 */ > else > word0 = 0; /* This is really setting up word1 */ > @@ -4359,7 +4363,8 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba) > readl(to_slim); /* flush */ > > lpfc_sli_brdreset(phba); > - phba->pport->stopped = 0; > + if (phba->pport) > + phba->pport->stopped = 0; > phba->link_state = LPFC_INIT_START; > phba->hba_flag = 0; > spin_unlock_irq(&phba->hbalock); > @@ -4446,7 +4451,7 @@ lpfc_sli_brdrestart(struct lpfc_hba *phba) > * iteration, the function will restart the HBA again. The function returns > * zero if HBA successfully restarted else returns negative error code. > **/ > -static int > +int > lpfc_sli_chipset_init(struct lpfc_hba *phba) > { > uint32_t status, i = 0; Reviewed-by: Ewan D. Milne

Re: [PATCH v3] sd: Ignore sync cache failures when not supported

2017-05-09 Thread Ewan D. Milne
On Tue, 2017-05-09 at 17:43 +0200, Thierry Escande wrote: > From: Derek Basehore > > Some external hard drives don't support the sync command even though the > hard drive has write cache enabled. In this case, upon suspend request, > sync cache failures are ignored if the error code in the sense

Re: [PATCH v4] sd: Ignore sync cache failures when not supported

2017-05-11 Thread Ewan D. Milne
turn ret; > + > + /* > + * sshdr.sense_key == ILLEGAL_REQUEST means this drive > + * doesn't support sync. There's not much to do and > + * suspend shouldn't fail. > + */ > + ret = 0; > } > } > > @@ -3359,7 +3376,6 @@ static int sd_suspend_common(struct device *dev, bool > ignore_stop_errors) > ret = 0; > } > > -done: > return ret; > } > Reviewed-by: Ewan D. Milne

Re: [PATCH] scsi: libfc: fix incorrect variable assingment

2017-05-12 Thread Ewan D. Milne
NAB; > - rjt_data.reason = ELS_EXPL_INSUF_RES; > + rjt_data.explan = ELS_EXPL_INSUF_RES; > fc_seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data); > goto drop; > } s/assingment/assignment/ Reviewed-by: Ewan D. Milne

Re: [RFC] scsi: generate uevent for SCSI sense code

2017-05-15 Thread Ewan D. Milne
On Mon, 2017-05-15 at 08:04 +0200, Hannes Reinecke wrote: > In general I like the idea; however, the 'filter' thingie is somewhat > odd. I could somewhat buy into the idea of filtering for sense keys, but > then I would have expected to use the 'sense_event_filter' as a bitmap > of allowed sense ke

[PATCH] sd: fix sysfs writes to "provisioning_mode" and "zeroing_mode"

2017-05-15 Thread Ewan D. Milne
From: "Ewan D. Milne" Change to use strlen() of the desired string for the length parameter to strncmp(). Otherwise one cannot simply use a command like 'echo "writesame_16" > .../provisioning_mode'. This patch makes sysfs writes consistent with other usa

Re: [PATCH] sd: fix sysfs writes to "provisioning_mode" and "zeroing_mode"

2017-05-15 Thread Ewan D. Milne
On Mon, 2017-05-15 at 20:14 +, Bart Van Assche wrote: > On Mon, 2017-05-15 at 15:13 -0400, Ewan D. Milne wrote: > > From: "Ewan D. Milne" > > > > Change to use strlen() of the desired string for the length > > parameter to strncmp(). Otherwise one canno

Re: [PATCH] sd: fix sysfs writes to "provisioning_mode" and "zeroing_mode"

2017-05-16 Thread Ewan D. Milne
On Mon, 2017-05-15 at 17:18 -0400, Martin K. Petersen wrote: > Bart, > > >> So, are you suggesting we change all the other sysfs store routines? > > > > I will leave it to Martin and James to comment on this. > > As I mentioned a few weeks ago, I have a patch that converts all these > to sysfs_ma

Re: [PATCH] ses: fix error message in ses_intf_add()

2017-05-17 Thread Ewan D. Milne
"Failed to get diagnostic page %d with error %d\n", > + page, result); > err = -ENODEV; > err_free: > kfree(buf); This looks OK but I think we should consider suppressing these messages. There are a lot of devices that return page 0 instead of the correct page, we should either say something like "enclosure services not supported", or else work with what we get instead of logging a message on every device probe that make it sound like the device is failing. I've received several complaints about this. Reviewed-by: Ewan D. Milne

Re: Need help with handling failed ATA pass-through command and sense data

2017-05-18 Thread Ewan D. Milne
On Thu, 2017-05-18 at 10:35 -0400, Alan Stern wrote: > This is in reference to > > https://bugzilla.redhat.com/show_bug.cgi?id=1351305 > > The problem is that some program (probably udisks2) periodically sends > the following ATA pass-through command to a USB-ATA bridge attached to > a West

Re: Need help with handling failed ATA pass-through command and sense data

2017-05-18 Thread Ewan D. Milne
On Thu, 2017-05-18 at 11:34 -0400, Ewan D. Milne wrote: > On Thu, 2017-05-18 at 10:35 -0400, Alan Stern wrote: > > This is in reference to > > > > https://bugzilla.redhat.com/show_bug.cgi?id=1351305 > > > > The problem is that some program (probably ud

Re: Need help with handling failed ATA pass-through command and sense data

2017-05-18 Thread Ewan D. Milne
On Thu, 2017-05-18 at 13:37 -0400, Alan Stern wrote: > > I had completely forgotten about this code. :-( > > Looks like you put your finger on the source of the problem. So if the > device sends back essentially empty sense data (SK = No Sense, ASC = > ASCQ = 0), but the USB transport indicat

Re: [PATCH 06/10] lpfc: Check if SCSI scanning is complete, before allowing I/O commands

2018-05-09 Thread Ewan D. Milne
On Fri, 2018-05-04 at 20:37 -0700, James Smart wrote: > A race condition is being seen. I/O is being issued to scsi targets > simultaneous to a short connectivity loss. The rport block/unblock is > occurring, but the unblock is allowing pending I/O commands to intermix > with the commands being use

Re: [PATCH] qla2xxx: Fix setting lower transfer speed if GPSC fails

2018-06-04 Thread Ewan D. Milne
On Mon, 2018-06-04 at 08:28 +, Bart Van Assche wrote: > On Sun, 2018-06-03 at 22:09 -0700, Himanshu Madhani wrote: > > This patch prevents driver from setting lower default speed > > of 1 GB/sec, if the switch does not support Get Port Speed > > Capabilities (GPSC) command. Setting this default

Re: [PATCH] qla2xxx: Fix setting lower transfer speed if GPSC fails

2018-06-04 Thread Ewan D. Milne
gt; ha->link_data_rate) > + fcport->fp_speed > ha->link_data_rate || > + !ha->flags.gpsc_supported) > return; > > rval = qla2x00_set_idma_speed(vha, fcport->loop_id, fcport->fp_speed, Martin, This patch fixes the issue Eda found in our test environment. Reported-by: Eda Zhou Reviewed-by: Ewan D. Milne Tested-by: Ewan D. Milne

Re: [PATCH] qla2xxx: Mask off Scope bits in retry delay.

2018-06-06 Thread Ewan D. Milne
+ ql_dbg(ql_dbg_io, sp->vha, 0x3033, > + "%s: scope=%#x retry_delay=%#x\n", __func__, > + sts24->retry_delay >> 14, retry_delay); > + } > } else { > if (scsi_status & SS_SENSE_LEN_VALID) > sense_len = le16_to_cpu(sts->req_sense_length); Reviewed-by: Ewan D. Milne

Re: [PATCH] scsi: aacraid: Fix PD performance regression over incorrect qd being set

2018-06-25 Thread Ewan D. Milne
> dev->hba_map[bus][target].scan_counter = dev->scan_counter; > > aac_set_safw_target_qd(dev, bus, target); > - > -update_devtype: > - dev->hba_map[bus][target].devtype = devtype; > } > } > > The "Fixes:" tag above does not look correct to me, I've put in what I see in Martin's tree. Fixes a very noticeable performance regression. Reviewed-by: Ewan D. Milne

Re: [PATCH] sg: fix minor memory leak in error path

2018-07-12 Thread Ewan D. Milne
kfree(sfp); > return ERR_PTR(-ENODEV); > } > list_add_tail(&sfp->sfd_siblings, &sdp->sfds); > Reviewed-by: Ewan D. Milne

Re: [PATCH] lpfc: Correct MDS diag and nvmet configuration

2018-08-20 Thread Ewan D. Milne
define LS_MDS_LOOPBACK 0x10/* MDS Diagnostics Link Up (Loopback) */ > > uint32_t hba_flag; /* hba generic flags */ > #define HBA_ERATT_HANDLED0x1 /* This flag is set when eratt handled */ Fixes driver crash when lpfc_enable_nvmet used. Tested-by: Ewan D. Milne

Re: [PATCH 0/8] qla2xxx: Bug fixes for the driver

2018-09-27 Thread Ewan D. Milne
++--- > drivers/scsi/qla2xxx/qla_mbx.c| 2 +- > drivers/scsi/qla2xxx/qla_nvme.c | 5 +-- > drivers/scsi/qla2xxx/qla_os.c | 4 +- > drivers/scsi/qla2xxx/qla_target.c | 3 +- > 6 files changed, 62 insertions(+), 57 deletions(-) > All patches in series Reviewed-by: Ewan D. Milne

Re: [PATCH 1/3] scsi: Allow state transitions from OFFLINE to BLOCKED

2018-10-08 Thread Ewan D. Milne
This change would permit a device that was OFFLINE (for any reason) to go back to RUNNING via: OFFLINE -> BLOCKED -> RUNNING Obviously that was your intention, but e.g. if a device was put OFFLINE due to exceeding max_medium_access_timeouts a fabric event and recovery would put it back online. S

Re: [PATCH] lpfc: fixup crash in lpfc_els_unsol_buffer()

2018-10-09 Thread Ewan D. Milne
On Tue, 2018-10-09 at 08:30 +0200, Hannes Reinecke wrote: > lpfc_nlp_get() in lpfc_els_unsol_buffer() is not running under a > lock, so there is a chance that it might actually fail. But as we > never check the return value we'll get a crash in lpfc_nlp_put() > later on trying to free an invalid bu

Re: [PATCH] scsi: SSDs can timeout during FS init because of too many unmaps

2017-09-19 Thread Ewan D. Milne
On Tue, 2017-09-19 at 09:02 -0400, Bill Kuzeja wrote: > I encountered this issue putting XFS on several brands of SSDs on my > system. During initialization, I would see a bunch of timeouts on > WRITE_SAME_16 commands, which would get aborted, reissued, and complete. > The logs look like this: > >

[PATCH] sd: Limit WRITE SAME / WRITE SAME(16) w/UNMAP length for certain devices

2017-09-19 Thread Ewan D. Milne
From: "Ewan D. Milne" Some devices do not support a WRITE SAME / WRITE SAME(16) with the UNMAP bit set up to the length specified in the MAXIMUM WRITE SAME LENGTH field in the block limits VPD page (or, the field is zero, indicating there is no limit). Limit the length by the MAXIMUM

Re: [PATCH] sd: Limit WRITE SAME / WRITE SAME(16) w/UNMAP length for certain devices

2017-09-27 Thread Ewan D. Milne
On Mon, 2017-09-25 at 21:46 -0400, Martin K. Petersen wrote: > Ewan, > > > Some devices do not support a WRITE SAME / WRITE SAME(16) with the > > UNMAP bit set up to the length specified in the MAXIMUM WRITE SAME > > LENGTH field in the block limits VPD page (or, the field is zero, > > indicating

Re: [PATCH] scsi: sd: Implement blacklist option for WRITE SAME w/ UNMAP

2017-09-28 Thread Ewan D. Milne
commands with the UNMAP bit set to be limited to the > value reported in MAXIMUM UNMAP LBA COUNT in the Block Limits VPD. > > Implement a blacklist option that can be used to accommodate devices > with this behavior. > > Reported-by: Bill Kuzeja > Reported-by: Ewan D. Milne >

Re: [PATCH] scsi: fix the issue that iscsi_if_rx doesn't parse nlmsg properly

2017-09-29 Thread Ewan D. Milne
On Mon, 2017-09-25 at 15:28 -0400, Martin K. Petersen wrote: > Xin, > > > ChunYu found a kernel crash by syzkaller: > > [...] > > > It's caused by skb_shared_info at the end of sk_buff was overwritten by > > ISCSI_KEVENT_IF_ERROR when parsing nlmsg info from skb in iscsi_if_rx. > > > > During th

Re: [PATCH 1/1] qla2xxx: Fix sparse warnings for N2N

2017-10-13 Thread Ewan D. Milne
On Thu, 2017-10-12 at 23:08 -0700, Madhani, Madhani wrote: > From: Himanshu Madhani > > Fixes following warning reported by 0-day kernel test build > > drivers/scsi/qla2xxx/qla_iocb.c: In function 'qla2x00_els_dcmd2_iocb_timeout': > drivers/scsi/qla2xxx/qla_iocb.c:2611:50: warning: format '%x' e

Re: [PATCH v2 4/5] qla2xxx: Changes to support N2N logins

2017-10-13 Thread Ewan D. Milne
ql_dbg(ql_dbg_async, vha, 0x5075, > +"Format 1: Remote WWPN %8phC.\n", > +rptid_entry->u.f1.port_name); > + > + ql_dbg(ql_dbg_async, vha, 0x5075, > +"Format 1: WWPN %8phC.\n", > + vha->port_name); > + > + /* N2N. direct connect */ > + if (IS_QLA27XX(ha) && > + ((rptid_entry->u.f1.flags>>1) & 0x7) == 2) { > + /* if our portname is higher then initiate N2N login */ > + if (wwn_to_u64(vha->port_name) > > + wwn_to_u64(rptid_entry->u.f1.port_name)) { > + // ??? qlt_update_host_map(vha, id); > + vha->n2n_id = 0x1; > + ql_dbg(ql_dbg_async, vha, 0x5075, > + "Format 1: Setting n2n_update_needed for id > %d\n", > + vha->n2n_id); > + } else { > + ql_dbg(ql_dbg_async, vha, 0x5075, > + "Format 1: Remote login - Waiting for WWPN > %8phC.\n", > + rptid_entry->u.f1.port_name); > + } > + > + memcpy(vha->n2n_port_name, rptid_entry->u.f1.port_name, > + WWN_SIZE); > + set_bit(N2N_LOGIN_NEEDED, &vha->dpc_flags); > + set_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags); > + set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags); > + return; > + } > > /* buffer to buffer credit flag */ > vha->flags.bbcr_enable = (rptid_entry->u.f1.bbcr & 0xf) != 0; > @@ -4599,6 +4633,48 @@ qla25xx_set_driver_version(scsi_qla_host_t *vha, char > *version) > return rval; > } > > +int > +qla24xx_get_port_login_templ(scsi_qla_host_t *vha, dma_addr_t buf_dma, > +void *buf, uint16_t bufsiz) > +{ > + int rval, i; > + mbx_cmd_t mc; > + mbx_cmd_t *mcp = &mc; > + uint32_t*bp; > + > + if (!IS_FWI2_CAPABLE(vha->hw)) > + return QLA_FUNCTION_FAILED; > + > + ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1159, > + "Entered %s.\n", __func__); > + > + mcp->mb[0] = MBC_GET_RNID_PARAMS; > + mcp->mb[1] = RNID_TYPE_PORT_LOGIN << 8; > + mcp->mb[2] = MSW(buf_dma); > + mcp->mb[3] = LSW(buf_dma); > + mcp->mb[6] = MSW(MSD(buf_dma)); > + mcp->mb[7] = LSW(MSD(buf_dma)); > + mcp->mb[8] = bufsiz/4; > + mcp->out_mb = MBX_8|MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; > + mcp->in_mb = MBX_1|MBX_0; > + mcp->tov = MBX_TOV_SECONDS; > + mcp->flags = 0; > + rval = qla2x00_mailbox_command(vha, mcp); > + > + if (rval != QLA_SUCCESS) { > + ql_dbg(ql_dbg_mbx, vha, 0x115a, > + "Failed=%x mb[0]=%x,%x.\n", rval, mcp->mb[0], mcp->mb[1]); > + } else { > + ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x115b, > + "Done %s.\n", __func__); > + bp = (uint32_t *) buf; > + for (i = 0; i < (bufsiz-4)/4; i++, bp++) > + *bp = cpu_to_be32(*bp); > + } > + > + return rval; > +} > + > static int > qla2x00_read_asic_temperature(scsi_qla_host_t *vha, uint16_t *temp) > { Thanks. Tested-by: Ewan D. Milne

Re: [PATCH 1/2] qla2xxx: Use ql2xnvmeenable to enable Q-Pair for FC-NVMe

2017-10-16 Thread Ewan D. Milne
> set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags); > qla2xxx_wake_dpc(vha); > } > @@ -6326,7 +6335,7 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, > pci_channel_state_t state) > case pci_channel_io_perm_failure: > ha->flags.pci_channel_io_perm_failure = 1; > qla2x00_abort_all_cmds(vha, DID_NO_CONNECT << 16); > - if (ql2xmqsupport) { > + if (ql2xmqsupport || ql2xnvmeenable) { > set_bit(QPAIR_ONLINE_CHECK_NEEDED, &vha->dpc_flags); > qla2xxx_wake_dpc(vha); > } Reviewed-by: Ewan D. Milne

Re: [PATCH] lpfc: Fix hard lock up NMI in els timeout handling.

2017-11-08 Thread Ewan D. Milne
lock_irqrestore(&pring->ring_lock, iflag); > + else > + spin_unlock_irqrestore(&phba->hbalock, iflag); > > if (cmdiocbp) { > if (cmdiocbp->iocb_cmpl) { The other callers of lpfc_sli_iocbq_lookup() use the 2 different locks, depending upon the SLI-3/SLI-4 case. Reviewed-by: Ewan D. Milne

Re: [PATCH] scsi: fix race condition when removing target

2017-11-29 Thread Ewan D. Milne
On Wed, 2017-11-29 at 17:39 +, gre...@linuxfoundation.org wrote: > On Wed, Nov 29, 2017 at 05:20:50PM +0100, h...@lst.de wrote: > > On Wed, Nov 29, 2017 at 04:18:30PM +, Bart Van Assche wrote: > > > As the above patch description shows it can happen that the SCSI core > > > calls > > > get

Re: [PATCH] scsi: fix race condition when removing target

2017-11-29 Thread Ewan D. Milne
get > *starget) >*/ > if (sdev->channel != starget->channel || > sdev->id != starget->id || > - !get_device(&sdev->sdev_gendev)) > + scsi_device_get_not_deleted(sdev)) > continue; > spin_unlock_irqrestore(shost->host_lock, flags); > scsi_remove_device(sdev); See subsequent discussion, however, we have a reproducible case here and the patch does appear to fix the issue (500+ iterations). Reviewed-by: Ewan D. Milne

Re: [PATCH] scsi: fix race condition when removing target

2017-11-29 Thread Ewan D. Milne
On Wed, 2017-11-29 at 19:11 +, Bart Van Assche wrote: > On Wed, 2017-11-29 at 13:49 -0500, Ewan D. Milne wrote: > > because a get inside a destructor would *always* be wrong, no? > > Hello Ewan, > > That's not what we are discussing. What can happen with the SCSI

Re: [PATCH] scsi: fix race condition when removing target

2017-12-01 Thread Ewan D. Milne
We have another test case that demonstrates this issue involving duplicate invocations of scsi_device_dev_release() on the same device. This other test case involves repeated log in / log out of an iSCSI target. (The first test case I mentioned in an earlier mail was an oscillating FC port with a

Re: crash in iscsi/scsi initiator with linux-4.15.0-rc1

2017-12-01 Thread Ewan D. Milne
On Fri, 2017-12-01 at 11:00 -0600, Steve Wise wrote: > Hey, > > I'm seeing this null pointer dereference with linux-4.15.0-rc1. To reproduce > it, I connect two ram disks via iscsi/TCP, and start an fio: > > iscsiadm -m discovery --op update --type sendtargets -p 172.16.1.10:3260 > iscsiadm -m

Re: [PATCH] scsi: check for device state in __scsi_remove_target()

2017-12-14 Thread Ewan D. Milne
er to have the fix in the meantime. > > Cheers, > > Hannes We have 2 reproducible test cases, this patch fixes one of them, which was a continually oscillating FC target port w/short dev_loss_tmo. I'm still waiting for a report on the iSCSI test. The code looks good. We need to get some kind of fix for this sooner rather than later. Reviewed-by: Ewan D. Milne

Re: [PATCH] scsi: check for device state in __scsi_remove_target()

2017-12-18 Thread Ewan D. Milne
On Thu, 2017-12-14 at 17:10 -0500, Ewan D. Milne wrote: > On Thu, 2017-12-14 at 10:02 +0100, Hannes Reinecke wrote: > > On 12/14/2017 09:05 AM, Jason Yan wrote: > > > > > > On 2017/12/14 6:23, Bart Van Assche wrote: > > >> On Wed, 2017-12-13 at 14:21 +010

RE: crash in iscsi/scsi initiator with linux-4.15.0-rc1

2017-12-19 Thread Ewan D. Milne
t fix your issue. It should. commit 81b6c999897919d5a16fedc018fe375dbab091c5 Author: Hannes Reinecke Date: Wed Dec 13 14:21:37 2017 +0100 scsi: core: check for device state in __scsi_remove_target() As it turned out device_get() doesn't use kref_get_unless_zero(), so

<    1   2   3