Re: Spurious DISK_EVENT_MEDIA_CHANGE on USB DVD hotplug?

2017-08-17 Thread Joe Lawrence
On 08/14/2017 02:30 PM, Tejun Heo wrote: > Hello, Joe. > > On Thu, Aug 10, 2017 at 10:45:54AM -0400, Joe Lawrence wrote: >> In the case of my USB DVD -> laptop example, there is no media in my >> device, however I still see the DISK_EVENT_MEDIA_CHANGE event. This is &

Spurious DISK_EVENT_MEDIA_CHANGE on USB DVD hotplug?

2017-08-10 Thread Joe Lawrence
Hi Tejun, Kay, I'm investigating a customer report which manifests itself all the way up in gnome-session when a BMC hotplug-adds a simulated DVD device. The user logs into their server's BMC and enables "media redirection", an emulated DVD device + .iso is dynamically added to the bus... in the

[PATCH 2/2] mpt3sas - avoid mpt3sas_transport_port_add NULL parent_dev

2016-05-25 Thread Joe Lawrence
If _scsih_sas_host_add's call to mpt3sas_config_get_sas_iounit_pg0 fails, ioc->sas_hba.parent_dev may be left uninitialized. A later device probe could invoke mpt3sas_transport_port_add which will call sas_port_alloc_num [scsi_transport_sas] with a NULL parent_dev pointer. Signed-off-by:

[PATCH 1/2] mpt3sas - set num_phys after allocating phy[] space

2016-05-25 Thread Joe Lawrence
t;sas_hba is left in a dangerous state: all readers of ioc->sas_hba.phy[] do so by indexing it from 0..ioc->sas_hba.num_phys without checking that the space was ever allocated. Modify _scsih_sas_host_add to set ioc->sas_hba.num_phys only after successfully allocating ioc->sas_hba.phy[]

[PATCH 0/2] _scsih_sas_host_add early exits can crash system

2016-05-25 Thread Joe Lawrence
e changes don't improve or retry adapter initialization, but only try to prevent the system from crashing Joe Lawrence (2): mpt3sas - set num_phys after allocating phy[] space mpt3sas - avoid mpt3sas_transport_port_add NULL parent_dev drivers/scsi/mpt3sas/mpt3sas_scsih.c | 20 ++

Re: [PATCH] Fix a bdi reregistration race, v3

2016-05-09 Thread Joe Lawrence
On 05/05/2016 04:40 PM, Joe Lawrence wrote: > On 05/05/2016 03:58 PM, Bart Van Assche wrote: >> On 03/28/2016 02:29 PM, Bart Van Assche wrote: >>> Avoid that the sd driver registers a BDI device with a name that >>> is still in use. This patch avoids that the following

Re: [PATCH] Fix a bdi reregistration race, v3

2016-05-05 Thread Joe Lawrence
On 05/05/2016 03:58 PM, Bart Van Assche wrote: > On 03/28/2016 02:29 PM, Bart Van Assche wrote: >> Avoid that the sd driver registers a BDI device with a name that >> is still in use. This patch avoids that the following warning gets >> triggered: >> >> [ ... ] > > (replying to my own e-mail) >

[PATCH v2] mpt3sas - remove unused fw_event_work elements

2016-04-18 Thread Joe Lawrence
f (mpt3sas: Refcount fw_events and fix unsafe list usage) Signed-off-by: Joe Lawrence <joe.lawre...@stratus.com> --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt

Re: [PATCH] mpt3sas - remove unused fw_event_work delayed_work

2016-04-11 Thread Joe Lawrence
--- From: Sathya Prakash [mailto:sathya.prak...@broadcom.com] Sent: Saturday, April 02, 2016 1:45 AM To: emi...@redhat.com; Joe Lawrence Cc: linux-scsi@vger.kernel.org; Chaitra Basappa; Suganath Prabu Subramani; Calvin Owens Subject: RE: [PATCH] mpt3sas - remove unused fw_event_work delayed_wo

Re: [PATCH] mpt3sas - remove unused fw_event_work delayed_work

2016-04-01 Thread Joe Lawrence
On 04/01/2016 02:51 PM, Ewan D. Milne wrote: > On Fri, 2016-04-01 at 13:56 -0400, Joe Lawrence wrote: >> @@ -2804,12 +2803,12 @@ _scsih_fw_event_cleanup_queue(struct MPT3SAS_ADAPTER >> *ioc) >> /* >> * Wait on the fw_event to

[PATCH] mpt3sas - remove unused fw_event_work delayed_work

2016-04-01 Thread Joe Lawrence
and update _scsih_fw_event_cleanup_queue accordingly. Signed-off-by: Joe Lawrence <joe.lawre...@stratus.com> --- I think this goes all the way back to the introduction of the mpt3sas driver. The previous generation mpt2sas driver uses delayed_work, so perhaps it was simply copied and pasted into the m

Re: [PATCH 1/2] mpt2sas: Refcount sas_device objects and fix unsafe list usage

2015-07-13 Thread Joe Lawrence
On 07/12/2015 12:24 AM, Calvin Owens wrote: These objects can be referenced concurrently throughout the driver, we need a way to make sure threads can't delete them out from under each other. This patch adds the refcount, and refactors the code to use it. Additionally, we cannot iterate over

Re: [PATCH] [RESEND] qla2xxx: prevent board_disable from running during EEH

2015-06-26 Thread Joe Lawrence
On 06/26/2015 12:33 PM, Mauricio Faria de Oliveira wrote: Commit f3ddac1918fe963bcbf8d407a3a3c0881b47248b ([SCSI] qla2xxx: Disable adapter when we encounter a PCI disconnect.) has introduced a code that disables the board, releasing some resources, when reading 0x. In case this

Re: OOPS: unplugging western digital passport drive

2015-06-22 Thread Joe Lawrence
wrote: On Wed, 18 Mar 2015, Alan Stern wrote: On Tue, 17 Mar 2015, Joe Lawrence wrote: On 03/11/2015 12:25 AM, Stanisław Pitucha wrote: Hi linux-scsi, I've got another case of reproducible crash when unplugging western digital passport drives. This was mentioned before in http

Re: [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API

2015-06-18 Thread Joe Lawrence
On 06/16/2015 01:37 AM, Sreekanth Reddy wrote: Created a thread using alloc_ordered_workqueue() API in order to process the works from firmware Work-queue sequentially instead of create_singlethread_workqueue() API. Changes in v1: No need to check for backport compatibility in the

Re: [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API

2015-06-18 Thread Joe Lawrence
On 06/18/2015 09:06 AM, Sreekanth Reddy wrote: On Thu, Jun 18, 2015 at 5:40 PM, Joe Lawrence joe.lawre...@stratus.com wrote: On 06/16/2015 01:37 AM, Sreekanth Reddy wrote: Created a thread using alloc_ordered_workqueue() API in order to process the works from firmware Work-queue sequentially

Re: [PATCH] mpt2sas: Abort initialization if no memory I/O resources, detected

2015-06-16 Thread Joe Lawrence
On 06/16/2015 12:28 PM, Timothy Pearson wrote: On 06/12/2015 05:05 PM, Timothy Pearson wrote: The mpt2sas driver crashes if the BIOS does not set up at least one memory I/O resource. This failure can happen if the device is too slow to respond during POST and is missed by the BIOS, but Linux

Re: [PATCH 17/20] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API

2015-06-12 Thread Joe Lawrence
On 06/12/2015 05:42 AM, Sreekanth Reddy wrote: ... +#if defined(alloc_ordered_workqueue) + ioc-firmware_event_thread = alloc_ordered_workqueue( + ioc-firmware_event_name, WQ_MEM_RECLAIM); +#else + ioc-firmware_event_thread = create_singlethread_workqueue(

Re: [PATCH 0/2] mpt2sas,mpt3sas - PCI master abort fixups

2015-04-13 Thread Joe Lawrence
On 04/12/2015 08:54 PM, James Bottomley wrote: On Sun, 2015-04-12 at 20:11 -0400, Joe Lawrence wrote: On 12/30/2014 09:07 AM, Joe Lawrence wrote: A colleague noticed that the mpt2 and mpt3sas drivers do not correctly check the PCI master abort pattern in _base_wait_for_doorbell_ack

Re: [PATCH 0/2] mpt2sas,mpt3sas - PCI master abort fixups

2015-04-13 Thread Joe Lawrence
On 04/13/2015 10:38 AM, James Bottomley wrote: On Mon, 2015-04-13 at 10:06 -0400, Joe Lawrence wrote: On 04/12/2015 08:54 PM, James Bottomley wrote: On Sun, 2015-04-12 at 20:11 -0400, Joe Lawrence wrote: On 12/30/2014 09:07 AM, Joe Lawrence wrote: A colleague noticed that the mpt2 and mpt3sas

Re: [PATCH 0/2] mpt2sas,mpt3sas - PCI master abort fixups

2015-04-12 Thread Joe Lawrence
On 12/30/2014 09:07 AM, Joe Lawrence wrote: A colleague noticed that the mpt2 and mpt3sas drivers do not correctly check the PCI master abort pattern in _base_wait_for_doorbell_ack. This pattern should be checked *prior* to any valid bit patterns, which would always return true since a PCI

Re: OOPS: unplugging western digital passport drive

2015-03-17 Thread Joe Lawrence
On 03/11/2015 12:25 AM, Stanisław Pitucha wrote: Hi linux-scsi, I've got another case of reproducible crash when unplugging western digital passport drives. This was mentioned before in http://www.spinics.net/lists/linux-scsi/msg82603.html Is there any way I can get a more correct

Re: usb-storage URB use-after-free

2015-01-30 Thread Joe Lawrence
On Thu, 29 Jan 2015 11:42:18 -0500 Alan Stern st...@rowland.harvard.edu wrote: On Wed, 28 Jan 2015, Joe Lawrence wrote: This one should have gone over to linux-usb. -- Joe On 01/28/2015 05:04 PM, Joe Lawrence wrote: Hello linux-usb, We've hit a USB use-after-free

Re: usb-storage URB use-after-free

2015-01-28 Thread Joe Lawrence
This one should have gone over to linux-usb. -- Joe On 01/28/2015 05:04 PM, Joe Lawrence wrote: Hello linux-usb, We've hit a USB use-after-free on Stratus HW during device removal tests. We're running fio disk I/O to a scsi disk hanging off USB when the USB controller is hotplug removed

usb-storage URB use-after-free

2015-01-28 Thread Joe Lawrence
Hello linux-usb, We've hit a USB use-after-free on Stratus HW during device removal tests. We're running fio disk I/O to a scsi disk hanging off USB when the USB controller is hotplug removed. This crash is very consistent (usually the first device pull during testing). Without I/O, it may take

Re: [SCSI RFC] mpt2sas: wait_for_completion_timeout timeout not reported

2014-12-30 Thread Joe Lawrence
On 12/29/2014 12:25 PM, Nicholas Mc Guire wrote: wait_for_completion_timeout reaching timeout was being ignored, this probably also should fail if timeout condition occurs ? this was only compile tested with x86_64_defconfig + CONFIG_SCSI_LOWLEVEL=y + CONFIG_SCSI_MPT2SAS=m patch is

[PATCH 1/2] mpt2sas,mpt3sas: correct master-abort checking in doorbell ack

2014-12-30 Thread Joe Lawrence
Test against the invalid data pattern ~0 before testing valid data patterns. Reported-by: Derek Shute derek.sh...@stratus.com Signed-off-by: Joe Lawrence joe.lawre...@stratus.com --- drivers/scsi/mpt2sas/mpt2sas_base.c |7 --- drivers/scsi/mpt3sas/mpt3sas_base.c |7 --- 2 files

[PATCH 0/2] mpt2sas,mpt3sas - PCI master abort fixups

2014-12-30 Thread Joe Lawrence
. The second patch adds similar checking to _base_wait_for_doorbell_int and _base_wait_for_doorbell_not_used to avoid potentially long loops around PCI reads. Joe Lawrence (2): mpt2sas,mpt3sas: correct master-abort checking in doorbell ack mpt2sas,mpt3sas: additional master abort checks drivers/scsi

[PATCH 2/2] mpt2sas,mpt3sas: additional master abort checks

2014-12-30 Thread Joe Lawrence
Add checks for PCI master abort reads in _base_wait_for_doorbell_int and _base_wait_for_doorbell_not_used, which contain potentially long loops around readl calls. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com --- drivers/scsi/mpt2sas/mpt2sas_base.c | 10 -- drivers/scsi/mpt3sas

Re: [SCIS] mpt3sas: wait_for_completion_timeout timeout not reported

2014-12-30 Thread Joe Lawrence
On 12/30/2014 11:19 AM, Nicholas Mc Guire wrote: wait_for_completion_timeout reaching timeout was being ignored, this also should fail if timeout condition occurs. Thanks to Joe Lawrence joe.lawre...@stratus.com for confirmation. How about this instead: Acked-by: Joe Lawrence joe.lawre

Re: [PATCH 20/35] qla2xxx: Unload of qla2xxx driver crashes the machine.

2014-09-24 Thread Joe Lawrence
Hi Saurav, Will these changes conflict with those submitted in August [1] to Christoph's drivers-for-3.18 branch? In particular, qla2xxx: Fix shost use-after-free on device removal [2] fixed this same driver unload issue in a slightly different manner. That change was marked for stable as the

Re: [PATCH 31/35] qla2xxx: Disable PCI device in shutdown handler.

2014-09-24 Thread Joe Lawrence
On Wed, 24 Sep 2014 03:08:34 -0400 Saurav Kashyap saurav.kash...@qlogic.com wrote: From: Chad Dupuis chad.dup...@qlogic.com Disable the PCI device during shutdown to prevent any races with other PCI code such as the AER handling code. Signed-off-by: Chad Dupuis chad.dup...@qlogic.com

Re: [PATCH 31/35] qla2xxx: Disable PCI device in shutdown handler.

2014-09-24 Thread Joe Lawrence
On Wed, 24 Sep 2014 11:37:55 -0400 Chad Dupuis chad.dup...@qlogic.com wrote: On Wed, 24 Sep 2014, Joe Lawrence wrote: On Wed, 24 Sep 2014 03:08:34 -0400 Saurav Kashyap saurav.kash...@qlogic.com wrote: From: Chad Dupuis chad.dup...@qlogic.com Disable the PCI device during

[PATCH] mpt2sas: remove duplicate disable_discovery MODULE_PARAM

2014-09-05 Thread Joe Lawrence
The disable_discovery module parameter is declared and only used by mpt2sas_scsih.c. Remove the extra copy in mpt2sas_base.c. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com --- drivers/scsi/mpt2sas/mpt2sas_base.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/scsi

Re: [PATCH 0/6] qla2xxx device removal fixups

2014-08-26 Thread Joe Lawrence
On Wed, 18 Jun 2014 10:02:13 -0400 Joe Lawrence joe.lawre...@stratus.com wrote: Hi Chad, Giri, et al. Stratus has been testing the upstream qla2xxx driver against surprise device removal and has found a few minor issues along the way. With this patchset, results have been good. Although

[PATCH RESEND 0/6] qla2xxx device removal fixups

2014-08-26 Thread Joe Lawrence
Resending patchset against scsi-queue/drivers-for-3.18 with Acked-by and Cc stable annotations. Joe Lawrence (6): qla2xxx: Fix shost use-after-free on device removal qla2xxx: Use qla2x00_clear_drv_active on probe failure qla2xxx: Collect PCI register checks and board_disable scheduling

[PATCH RESEND 1/6] qla2xxx: Fix shost use-after-free on device removal

2014-08-26 Thread Joe Lawrence
...@vger.kernel.org # 3.14, 3.15, 3.16 Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Acked-by: Chad Dupuis chad.dup...@qlogic.com --- drivers/scsi/qla2xxx/qla_os.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi

[PATCH RESEND 2/6] qla2xxx: Use qla2x00_clear_drv_active on probe failure

2014-08-26 Thread Joe Lawrence
Take advantage of commit fe1b806f4f71 (qla2xxx: Refactor shutdown code so some functionality can be reused) to remove an inlined copy of qla2x00_clear_drv_active in the driver's probe hardware error path. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Acked-by: Chad Dupuis chad.dup

[PATCH RESEND 5/6] qla2xxx: Prevent removal and board_disable race

2014-08-26 Thread Joe Lawrence
the PCI device enable count check in qla2x00_remove_one to determine if board_disable has occured. The original purpose of this check was unnecessary since the driver remove function wasn't called when the probe fails. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Acked-by: Chad Dupuis chad.dup

[PATCH RESEND 4/6] qla2xxx: Schedule board_disable only once

2014-08-26 Thread Joe Lawrence
There are various callers of qla2x00_check_reg{32,16}_for_disconnect that may schedule board removal on PCI-disconnect. Test-and-set a dedicated flag before scheduling board_disable so it is invoked only once. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Acked-by: Chad Dupuis chad.dup

[PATCH RESEND 3/6] qla2xxx: Collect PCI register checks and board_disable scheduling

2014-08-26 Thread Joe Lawrence
Add an uint16_t variant of qla2x00_check_reg_for_disconnect and use these routines to check and schedule a PCI-disconnected board from a centralized place. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Acked-by: Chad Dupuis chad.dup...@qlogic.com --- drivers/scsi/qla2xxx/qla_gbl.h |3

[PATCH RESEND 6/6] qla2xxx: Prevent probe and board_disable race

2014-08-26 Thread Joe Lawrence
is initialized and more importantly, avoids racing qla2x00_probe_one. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Acked-by: Chad Dupuis chad.dup...@qlogic.com --- drivers/scsi/qla2xxx/qla_def.h |1 + drivers/scsi/qla2xxx/qla_isr.c |3 ++- drivers/scsi/qla2xxx/qla_os.c |2 ++ 3 files

Re: [PATCH 5/6] qla2xxx: Prevent removal and board_disable race

2014-07-25 Thread Joe Lawrence
On Fri, 25 Jul 2014 11:23:02 -0400 Chad Dupuis chad.dup...@qlogic.com wrote: On Wed, 18 Jun 2014, Joe Lawrence wrote: Introduce mutual exclusion between the qla2xxx_remove_one PCI driver callback and qla2x00_disable_board_on_pci_error, which is scheduled as board_disable work

Re: [PATCH] lpfc: Avoid to disable pci_dev twice

2014-07-17 Thread Joe Lawrence
[ +cc linux-pci and Bjorn, comments inline/below ... ] On Thu, 17 Jul 2014 02:32:31 -0400 Mike Qiu qiud...@linux.vnet.ibm.com wrote: In IBM Power servers, when hardware error occurs during probe state, EEH subsystem will call driver's error_detected interface, which will call

Re: mpt2sas stuck installing

2014-07-14 Thread Joe Lawrence
On Sat, 12 Jul 2014 03:13:07 + Elliott, Robert (Server Storage) elli...@hp.com wrote: -Original Message- From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- ow...@vger.kernel.org] On Behalf Of Joe Lawrence ... In your crash stack trace, the scsi error handler has

Re: [PATCH] drivers: message: fusion: Simplify rounding

2014-07-03 Thread Joe Lawrence
ALIGN is certainly more readable to me. Reviewed-by: Joe Lawrence joe.lawre...@stratus.com -- Joe On Tue, 1 Jul 2014, Rasmus Villemoes wrote: Rounding up to a multiple of 4 should be done using the ALIGN macro. As a bonus, this also makes the generated code smaller. In GetIocFacts(), sz

Re: [PATCH] scsi: mpt2sas: mpt2sas_base.c: Fix for possible null pointer dereference

2014-07-03 Thread Joe Lawrence
On Wed, 28 May 2014, Christoph Hellwig wrote: - ioc_status = le16_to_cpu(mpi_reply-IOCStatus) MPI2_IOCSTATUS_MASK; + if (mpi_reply) { + ioc_status = le16_to_cpu(mpi_reply-IOCStatus) MPI2_IOCSTATUS_MASK; + } if (ioc_status != MPI2_IOCSTATUS_SUCCESS)

Re: [PATCH 0/7] mptfusion static checker fixups

2014-06-25 Thread Joe Lawrence
get another review for this series? On Wed, Jun 04, 2014 at 12:49:42PM -0400, Joe Lawrence wrote: While reviewing the mpt2/mpt3 static checker fixup patchset, Christoph inquired about mptfusion. None of the sparse / smatch warnings from the earlier patchset directly apply to fusion

[PATCH v2 00/11] mptfusion/mpt2/mpt3 static checker fixups

2014-06-25 Thread Joe Lawrence
if the alignment attribute should be: __attribute__ ((aligned (sizeof(unsigned long instead of: char event_data[0] __aligned(4) Regards, Joe Lawrence (11): mpt2sas: correct scsi_{target,device} hostdata allocation mpt2sas: combine fw_event_work and its event_data mpt2sas: annotate ioc

[PATCH v2 01/11] mpt2sas: correct scsi_{target,device} hostdata allocation

2014-06-25 Thread Joe Lawrence
type mismatch 'MPT2SAS_DEVICE vs scsi_device' Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter dan.carpen...@oracle.com Reviewed-by: Christoph Hellwig h...@lst.de Acked-by: Sreekanth Reddy sreekanth.re...@avagotech.com --- drivers/scsi/mpt2sas/mpt2sas_scsih.c |6 -- 1

[PATCH v2 04/11] mpt3sas: correct scsi_{target,device} hostdata allocation

2014-06-25 Thread Joe Lawrence
type mismatch 'MPT3SAS_DEVICE vs scsi_device' Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter dan.carpen...@oracle.com Reviewed-by: Christoph Hellwig h...@lst.de Acked-by: Sreekanth Reddy sreekanth.re...@avagotech.com --- drivers/scsi/mpt3sas/mpt3sas_scsih.c |6 -- 1

[PATCH v2 03/11] mpt2sas: annotate ioc-reply_post_host_index as __iomem

2014-06-25 Thread Joe Lawrence
Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter dan.carpen...@oracle.com Reviewed-by: Christoph Hellwig h...@lst.de Acked-by: Sreekanth Reddy sreekanth.re...@avagotech.com --- drivers/scsi/mpt2sas/mpt2sas_base.c |9 + drivers/scsi/mpt2sas/mpt2sas_base.h |2 +- 2

[PATCH v2 05/11] mpt3sas: combine fw_event_work and its event_data

2014-06-25 Thread Joe Lawrence
mpt3sas_send_trigger_data_event() warn: possible memory leak of 'fw_event' Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy sreekanth.re...@avagotech.com Cc: Christoph Hellwig h...@lst.de --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 56

[PATCH v2 06/11] mptfusion: mark file-private functions as static

2014-06-25 Thread Joe Lawrence
: warning: symbol 'mptscsih_quiesce_raid' was not declared. Should it be static? Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy sreekanth.re...@avagotech.com Reviewed-by: Christoph Hellwig h...@lst.de --- drivers/message/fusion

[PATCH v2 09/11] mptfusion: make adapter prod_name[] a pointer

2014-06-25 Thread Joe Lawrence
non-NULL. 'ioc-prod_name' Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy sreekanth.re...@avagotech.com Reviewed-by: Christoph Hellwig h...@lst.de --- drivers/message/fusion/mptbase.c | 11 +-- drivers/message/fusion

[PATCH v2 08/11] mptfusion: use memdup_user

2014-06-25 Thread Joe Lawrence
Let memdup_user handle the kmalloc, copy_from_user and error checking kfree code. Spotted by the following smatch (false positive) warning: drivers/message/fusion/mptctl.c:1369 mptctl_getiocinfo() warn: possible info leak 'karg' Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc

[PATCH v2 07/11] mptfusion: remove redundant kfree checks

2014-06-25 Thread Joe Lawrence
() Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy sreekanth.re...@avagotech.com Reviewed-by: Christoph Hellwig h...@lst.de --- drivers/message/fusion/mptfc.c |3 +-- drivers/message/fusion/mptspi.c |3 +-- 2 files changed, 2

[PATCH v2 11/11] mptfusion: tweak null pointer checks

2014-06-25 Thread Joe Lawrence
line 1373) [HCH: vdevice can't ever be NULL here, it's allocated in -slave_alloc and thus guaranteed to be around when -queuecommand is called.] Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Christoph Hellwig h...@infradead.org Cc: Dan Carpenter dan.carpen

[PATCH v2 02/11] mpt2sas: combine fw_event_work and its event_data

2014-06-25 Thread Joe Lawrence
Tack the firmware reply event_data payload to the end of its corresponding struct fw_event_work allocation. This matches the convention in the mptfusion driver and simplifies the code. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Christoph

[PATCH v2 10/11] mptfusion: combine fw_event_work and its event_data

2014-06-25 Thread Joe Lawrence
/fusion/mptsas.c:1003 mptsas_queue_device_delete() error: memcpy() 'fw_event-event_data' too small (29 vs 36) drivers/message/fusion/mptsas.c:1017 mptsas_queue_rescan() error: not allocating enough data 168 vs 160 Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter

[PATCH 1/6] qla2xxx: Fix shost use-after-free on device removal

2014-06-18 Thread Joe Lawrence
Once calling scsi_host_put, be careful to not access qla_hw_data through the Scsi_Host private data (ie, scsi_qla_host base_vha). Signed-off-by: Joe Lawrence joe.lawre...@stratus.com --- drivers/scsi/qla2xxx/qla_os.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

[PATCH 4/6] qla2xxx: Schedule board_disable only once

2014-06-18 Thread Joe Lawrence
There are various callers of qla2x00_check_reg{32,16}_for_disconnect that may schedule board removal on PCI-disconnect. Test-and-set a dedicated flag before scheduling board_disable so it is invoked only once. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com --- drivers/scsi/qla2xxx

[PATCH 0/6] qla2xxx device removal fixups

2014-06-18 Thread Joe Lawrence
testing. Regards, -- Joe Joe Lawrence (6): qla2xxx: Fix shost use-after-free on device removal scsi_qla_host *base_vha is allocated as part of the Scsi_Host private hostdata[] by qla2x00_create_host. When the last reference on the host is put by qla2x00_remove_one, it's released

[PATCH 2/6] qla2xxx: Use qla2x00_clear_drv_active on probe failure

2014-06-18 Thread Joe Lawrence
Take advantage of commit fe1b806f qla2xxx: Refactor shutdown code so some functionality can be reused to remove an inlined copy of qla2x00_clear_drv_active in the driver's probe hardware error path. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com --- drivers/scsi/qla2xxx/qla_os.c | 13

[PATCH 5/6] qla2xxx: Prevent removal and board_disable race

2014-06-18 Thread Joe Lawrence
the PCI device enable count check in qla2x00_remove_one to determine if board_disable has occured. The original purpose of this check was unnecessary since the driver remove function wasn't called when the probe fails. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com --- drivers/scsi/qla2xxx

[PATCH 3/6] qla2xxx: Collect PCI register checks and board_disable scheduling

2014-06-18 Thread Joe Lawrence
Add an uint16_t variant of qla2x00_check_reg_for_disconnect and use these routines to check and schedule a PCI-disconnected board from a centralized place. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com --- drivers/scsi/qla2xxx/qla_gbl.h |3 ++- drivers/scsi/qla2xxx/qla_isr.c | 28

[PATCH 6/6] qla2xxx: Prevent probe and board_disable race

2014-06-18 Thread Joe Lawrence
is initialized and more importantly, avoids racing qla2x00_probe_one. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com --- drivers/scsi/qla2xxx/qla_def.h |1 + drivers/scsi/qla2xxx/qla_isr.c |3 ++- drivers/scsi/qla2xxx/qla_os.c |2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff

Re: [PATCH 6/7] mptfusion: combine fw_event_work and its event_data

2014-06-06 Thread Joe Lawrence
On Thu, 5 Jun 2014 02:34:29 -0700 Christoph Hellwig h...@infradead.org wrote: diff --git a/drivers/message/fusion/mptsas.h b/drivers/message/fusion/mptsas.h index 57e86ab..c396483 100644 --- a/drivers/message/fusion/mptsas.h +++ b/drivers/message/fusion/mptsas.h @@ -110,7 +110,7 @@

[PATCH 0/7] mptfusion static checker fixups

2014-06-04 Thread Joe Lawrence
...@oracle.com Cc: Sreekanth Reddy sreekanth.re...@lsi.com Joe Lawrence (7): mptfusion: mark file-private functions as static mptfusion: remove redundant kfree checks mptfusion: initChainBuffers should return errno mptfusion: zero kernel-space source of copy_to_user mptfusion: make adapter

[PATCH 4/7] mptfusion: zero kernel-space source of copy_to_user

2014-06-04 Thread Joe Lawrence
Fixes the following smatch warning: drivers/message/fusion/mptctl.c:1369 mptctl_getiocinfo() warn: possible info leak 'karg' Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Christoph Hellwig h...@infradead.org Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy

[PATCH 3/7] mptfusion: initChainBuffers should return errno

2014-06-04 Thread Joe Lawrence
/message/fusion/mptbase.c:4335 initChainBuffers() warn: returning -1 instead of -ENOMEM is sloppy drivers/message/fusion/mptbase.c:4402 initChainBuffers() warn: returning -1 instead of -ENOMEM is sloppy Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Christoph Hellwig h

[PATCH 1/7] mptfusion: mark file-private functions as static

2014-06-04 Thread Joe Lawrence
: warning: symbol 'mptscsih_quiesce_raid' was not declared. Should it be static? Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Christoph Hellwig h...@infradead.org Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy sreekanth.re...@lsi.com --- drivers/message/fusion/mptbase.c

[PATCH 2/7] mptfusion: remove redundant kfree checks

2014-06-04 Thread Joe Lawrence
() Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Christoph Hellwig h...@infradead.org Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy sreekanth.re...@lsi.com --- drivers/message/fusion/mptfc.c |3 +-- drivers/message/fusion/mptspi.c |3 +-- 2 files changed, 2

[PATCH 5/7] mptfusion: make adapter prod_name[] a pointer

2014-06-04 Thread Joe Lawrence
non-NULL. 'ioc-prod_name' Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Christoph Hellwig h...@infradead.org Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy sreekanth.re...@lsi.com --- drivers/message/fusion/mptbase.c | 11 +-- drivers/message/fusion/mptbase.h

[PATCH 6/7] mptfusion: combine fw_event_work and its event_data

2014-06-04 Thread Joe Lawrence
/fusion/mptsas.c:1003 mptsas_queue_device_delete() error: memcpy() 'fw_event-event_data' too small (29 vs 36) drivers/message/fusion/mptsas.c:1017 mptsas_queue_rescan() error: not allocating enough data 168 vs 160 Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Christoph Hellwig h

[PATCH 7/7] mptfusion: tweak null pointer checks

2014-06-04 Thread Joe Lawrence
) drivers/message/fusion/mptscsih.c:1388 mptscsih_qcmd() error: we previously assumed 'vdevice' could be null (see line 1373) Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Christoph Hellwig h...@infradead.org Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy sreekanth.re

Re: [PATCH 4/7] mptfusion: zero kernel-space source of copy_to_user

2014-06-04 Thread Joe Lawrence
On Wed, 4 Jun 2014 12:49:46 -0400 Joe Lawrence joe.lawre...@stratus.com wrote: Fixes the following smatch warning: drivers/message/fusion/mptctl.c:1369 mptctl_getiocinfo() warn: possible info leak 'karg' Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Christoph Hellwig h

[PATCH 1/4] mpt2sas: correct scsi_{target,device} hostdata allocation

2014-06-02 Thread Joe Lawrence
type mismatch 'MPT2SAS_DEVICE vs scsi_device' Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy sreekanth.re...@lsi.com --- drivers/scsi/mpt2sas/mpt2sas_scsih.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH 0/4] mpt2/mpt3 static checker fixups

2014-06-02 Thread Joe Lawrence
Hello Sreekanth, Dan, These are a few minor smatch and sparse static checker fixes for the LSI mpt2 and mpt3 drivers. The first three fix real potential bugs and the last cleans up a noisy complaint from sparse. Joe Lawrence (4): mpt2sas: correct scsi_{target,device} hostdata allocation

[PATCH 3/4] mpt3sas: fix possible memory leak in mpt3sas_send_trigger_data_event

2014-06-02 Thread Joe Lawrence
-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy sreekanth.re...@lsi.com --- drivers/scsi/mpt3sas/mpt3sas_scsih.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi

[PATCH 2/4] mpt3sas: correct scsi_{target,device} hostdata allocation

2014-06-02 Thread Joe Lawrence
type mismatch 'MPT3SAS_DEVICE vs scsi_device' Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy sreekanth.re...@lsi.com --- drivers/scsi/mpt3sas/mpt3sas_scsih.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH 4/4] mpt2sas: annotate ioc-reply_post_host_index as __iomem

2014-06-02 Thread Joe Lawrence
Signed-off-by: Joe Lawrence joe.lawre...@stratus.com Cc: Dan Carpenter dan.carpen...@oracle.com Cc: Sreekanth Reddy sreekanth.re...@lsi.com --- drivers/scsi/mpt2sas/mpt2sas_base.c |9 + drivers/scsi/mpt2sas/mpt2sas_base.h |2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff

Re: [PATCH 0/4] mpt2/mpt3 static checker fixups

2014-06-02 Thread Joe Lawrence
On Mon, 2 Jun 2014 09:33:07 -0700 Christoph Hellwig h...@infradead.org wrote: On Mon, Jun 02, 2014 at 10:34:28AM -0400, Joe Lawrence wrote: Hello Sreekanth, Dan, These are a few minor smatch and sparse static checker fixes for the LSI mpt2 and mpt3 drivers. The first three fix real

Christoph Hellwig h...@infradead.org wrote:

2014-06-02 Thread Joe Lawrence
On Mon, Jun 02, 2014 at 10:37:26AM -0400, Joe Lawrence wrote: If mpt3sas_send_trigger_data_event exits early without inserting a fw_event, be sure to undo any prior allocations. Looks good, but why don't we just allocate the two in a single allocation? Hi Christoph, The following

Re: Make SCSI error handler code easier to understand

2014-05-28 Thread Joe Lawrence
On Mon, 26 May 2014 17:12:27 +0200 Bart Van Assche bvanass...@acm.org wrote: Every now and then someone asks how it is avoided that the SCSI error handler and the SCSI completion handler are invoked concurrently for the same SCSI command. Hence this patch series that should make the SCSI

[PATCH] scsi_transport_sas: move bsg destructor into sas_rphy_remove

2014-05-22 Thread Joe Lawrence
and sas_end_device transport class devices (B and C above) are created and destroyed both via the list match traversal in attribute_container_device_trigger, so the order in which they are handled is fixed. This is fine as long as they are deleted before their parent device. Signed-off-by: Joe Lawrence joe.lawre

Re: [PATCH RESEND] scsi_transport_sas: move bsg destructor into sas_rphy_remove

2014-05-02 Thread Joe Lawrence
On Wed, 2 Apr 2014 16:48:52 -0400 Joe Lawrence joe.lawre...@stratus.com wrote: On Wed, 2 Apr 2014 16:40:41 -0400 Joe Lawrence joe.lawre...@stratus.com wrote: Since bsg creation is a side effect of sas_rphy_add, move its complementary removal call into sas_rphy_remove. Hello James

Re: 3.15-mw: Oops Workqueue: writeback bdi_writeback_workfn (flush-8:16) RIP: e030:[ffffffff814c6bc1] [ffffffff814c6bc1] kobject_put+0x11/0x70

2014-04-14 Thread Joe Lawrence
On Mon, 14 Apr 2014 04:30:15 -0700 Christoph Hellwig h...@infradead.org wrote: On Sat, Apr 12, 2014 at 01:34:31PM +0200, Sander Eikelenboom wrote: Hi, I just ran into the oops belowafter some uptime. Classic use after free introduced by my recent changes, sorry. This should fix it:

Re: [PATCH RESEND] scsi_transport_sas: move bsg destructor into sas_rphy_remove

2014-04-02 Thread Joe Lawrence
On Wed, 2 Apr 2014 16:40:41 -0400 Joe Lawrence joe.lawre...@stratus.com wrote: Since bsg creation is a side effect of sas_rphy_add, move its complementary removal call into sas_rphy_remove. Hello James, This a resend of a patch posted to quiet an end-device sysfs warning in its device

[PATCH RESEND] scsi_transport_sas: move bsg destructor into sas_rphy_remove

2014-04-02 Thread Joe Lawrence
and sas_end_device transport class devices (B and C above) are created and destroyed both via the list match traversal in attribute_container_device_trigger, so the order in which they are handled is fixed. This is fine as long as they are deleted before their parent device. Signed-off-by: Joe Lawrence joe.lawre

Re: mpt2sas driver barfs when force removing a drive on 3.13.1

2014-02-12 Thread Joe Lawrence
3.14.0-rc2+ kernel whenever we unload the mpt2sas/mpt3sas driver or whenever we unplug the drive attached to the HBA. But after applying yours patch, these WARNING call trace is not observed. Regards, Sreekanth -Original Message- From: Joe Lawrence [mailto:joe.lawre...@stratus.com

Re: mpt2sas driver barfs when force removing a drive on 3.13.1

2014-02-03 Thread Joe Lawrence
a lot like what I see on mpt2sas driver removal [1]. I posted a suggested fix back in Dec [2], which you might try, however it is not reviewed at this point. [1] http://thread.gmane.org/gmane.linux.scsi/86237 [2] https://github.com/joe-lawrence/linux/compare

Re: sysfs group not found for kobject on mpt2sas unload

2013-12-03 Thread Joe Lawrence
On Mon, 25 Nov 2013 11:23:39 -0500 Joe Lawrence joe.lawre...@stratus.com wrote: On Wed, 20 Nov 2013 14:08:40 -0500 Joe Lawrence joe.lawre...@stratus.com wrote: Starting in 3.12, when loading and unloading the mpt2sas driver, I see the following warning: [ cut here

[PATCH] scsi_transport_sas: move bsg destructor into sas_rphy_remove

2013-12-03 Thread Joe Lawrence
and sas_end_device transport class devices (B and C above) are created and destroyed both via the list match traversal in attribute_container_device_trigger, so the order in which they are handled is fixed. This is fine as long as they are deleted before their parent device. Signed-off-by: Joe Lawrence joe.lawre

Re: sysfs group not found for kobject on mpt2sas unload

2013-11-25 Thread Joe Lawrence
On Wed, 20 Nov 2013 14:08:40 -0500 Joe Lawrence joe.lawre...@stratus.com wrote: Starting in 3.12, when loading and unloading the mpt2sas driver, I see the following warning: [ cut here ] WARNING: CPU: 20 PID: 19096 at fs/sysfs/group.c:214 sysfs_remove_group+0xc6

sysfs group not found for kobject on mpt2sas unload

2013-11-20 Thread Joe Lawrence
Starting in 3.12, when loading and unloading the mpt2sas driver, I see the following warning: [ cut here ] WARNING: CPU: 20 PID: 19096 at fs/sysfs/group.c:214 sysfs_remove_group+0xc6/0xd0() sysfs group 81ca2f40 not found for kobject 'end_device-30:0' Modules

Re: PATCH: st.c: Fix blk_get_queue usage

2013-11-15 Thread Joe Lawrence
On Fri, 15 Nov 2013 12:23:06 +0100 Bodo Stroesser bstroes...@ts.fujitsu.com wrote: On 14.11.2013, at 22.50, Joe Lawrence joe.lawre...@stratus.com wrote: On Thu, 14 Nov 2013 20:22:40 +0100 Bodo Stroesser bstroes...@ts.fujitsu.com wrote: On 14.11.2013, at 20.05, Kai M??kisara (Kolumbus

Re: PATCH: st.c: Fix blk_get_queue usage

2013-11-14 Thread Joe Lawrence
On Thu, 14 Nov 2013 20:22:40 +0100 Bodo Stroesser bstroes...@ts.fujitsu.com wrote: On 14.11.2013, at 20.05, Kai M??kisara (Kolumbus) kai.makis...@kolumbus.fi wrote: On 14.11.2013, at 16.48, Bodo Stroesser bstroes...@ts.fujitsu.com wrote: Hi, in st_probe(), st.c I stumbled

[PATCH v6 2/2] block,scsi: convert and handle ERR_PTR from blk_get_request

2013-10-31 Thread Joe Lawrence
instead of a simple NULL pointer check. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com --- block/blk-core.c| 34 ++--- block/bsg.c | 8 +++ block/scsi_ioctl.c | 12

[PATCH v6 1/2] block,scsi: verify return pointer from blk_get_request

2013-10-31 Thread Joe Lawrence
The blk-core dead queue checks introduce an error scenario to blk_get_request that returns NULL if the request queue has been shutdown. This affects the behavior for __GFP_WAIT callers, who should verify the return value before dereferencing. Signed-off-by: Joe Lawrence joe.lawre...@stratus.com

  1   2   >