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

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

2016-05-25 Thread Joe Lawrence
>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.

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

2016-05-25 Thread Joe Lawrence
Note: these 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_scsi

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
es: 146b16c8071f (mpt3sas: Refcount fw_events and fix unsafe list usage) Signed-off-by: Joe Lawrence --- 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/mpt3sas/mpt3sas_scsih.c inde

Re: [PATCH] mpt3sas - remove unused fw_event_work delayed_work

2016-04-11 Thread Joe Lawrence
athya.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_work We will look into this early next week a

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 comple

[PATCH] mpt3sas - remove unused fw_event_work delayed_work

2016-04-01 Thread Joe Lawrence
Remove it and update _scsih_fw_event_cleanup_queue accordingly. Signed-off-by: Joe Lawrence --- 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 mpt3sas but never upd

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

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 th

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

2015-06-23 Thread Joe Lawrence
On 06/21/2015 02:46 PM, Timothy Pearson wrote: > On 06/16/2015 01:49 PM, Timothy Pearson wrote: >> On 06/16/2015 12:42 PM, Joe Lawrence wrote: >>> On 06/16/2015 12:28 PM, Timothy Pearson wrote: >>>> On 06/12/2015 05:05 PM, Timothy Pearson wrote: >>>>>

Re: OOPS: unplugging western digital passport drive

2015-06-22 Thread Joe Lawrence
t; > > On Wed, 18 Mar 2015, Alan Stern 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, >>>>

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 > 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

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] 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 L

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/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: >

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

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

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 stac

Re: usb-storage URB use-after-free

2015-01-30 Thread Joe Lawrence
On Thu, 29 Jan 2015 11:42:18 -0500 Alan Stern 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, > >

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 &

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: [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 for confirmation. How about this instead: Acked-by: Joe Lawrence You still pro

[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 --- drivers/scsi/mpt2sas/mpt2sas_base.c | 10 -- drivers/scsi/mpt3sas/mpt3sas_base.c | 10

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

2014-12-30 Thread Joe Lawrence
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 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 Signed-off-by: Joe Lawrence --- drivers/scsi/mpt2sas/mpt2sas_base.c |7 --- drivers/scsi/mpt3sas/mpt3sas_base.c |7 --- 2 files changed, 8 insertions(+), 6 deletions(-) diff

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

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 wrote: > > > On Wed, 24 Sep 2014, Joe Lawrence wrote: > > > On Wed, 24 Sep 2014 03:08:34 -0400 > > Saurav Kashyap wrote: > > > >> From: Chad Dupuis > >> > >> Disable the PCI device duri

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 wrote: > From: Chad Dupuis > > 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 > Signed-off-by: Saurav Kashyap > --- > drivers/scsi/qla2xxx/qla_o

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

[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 --- drivers/scsi/mpt2sas/mpt2sas_base.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b

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

2014-08-26 Thread Joe Lawrence
ructure is initialized and more importantly, avoids racing qla2x00_probe_one. Signed-off-by: Joe Lawrence Acked-by: Chad Dupuis --- 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 deletio

[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 Acked-by: Chad Dupuis --- drivers/scsi/qla2xxx/qla_gbl.h |3 ++- drivers/scsi/qla2xxx/qla_isr.c | 28

[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 Acked-by: Chad Dupuis --- drivers/scsi/qla2xxx/qla_def.h

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

2014-08-26 Thread Joe Lawrence
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 Acked-by: Chad Dupuis --- drivers/scsi/ql

[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 Acked-by: Chad Dupuis --- drivers/scsi/q

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

2014-08-26 Thread Joe Lawrence
Cc: sta...@vger.kernel.org # 3.14, 3.15, 3.16 Signed-off-by: Joe Lawrence Acked-by: Chad Dupuis --- 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/qla2xxx/qla_os.c index be9698d..8252

[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

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 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. Althoug

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 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 &

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 wrote: > In IBM Power servers, when hardware error occurs during probe > state, EEH subsystem will call driver's error_detected interface, > which will call pci_disable_device(). But driver's probe

Re: mpt2sas stuck installing

2014-07-14 Thread Joe Lawrence
On Sat, 12 Jul 2014 03:13:07 + "Elliott, Robert (Server Storage)" wrote: > > > > -Original Message- > > From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- > > ow...@vger.kernel.org] On Behalf Of Joe Lawrence > ... > > In your cr

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_S

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 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 is assig

[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 Cc: Dan Carpenter Cc: Sr

[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 Cc: Dan Carpenter Cc: Christoph Hellwig Cc: Sreekanth Reddy --- drivers/scsi

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

2014-06-25 Thread Joe Lawrence
mptscsih_qcmd() error: we previously assumed 'vdevice' could be null (see 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 C

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

2014-06-25 Thread Joe Lawrence
bably non-NULL. 'ioc->prod_name' Signed-off-by: Joe Lawrence Cc: Dan Carpenter Cc: Sreekanth Reddy Reviewed-by: Christoph Hellwig --- drivers/message/fusion/mptbase.c | 11 +-- drivers/message/fusion/mptbase.h |2 +- 2 files changed, 6 insertions(+), 7 deletion

[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 Cc: Christoph Hellwi

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

2014-06-25 Thread Joe Lawrence
kfree() Signed-off-by: Joe Lawrence Cc: Dan Carpenter Cc: Sreekanth Reddy Reviewed-by: Christoph Hellwig --- drivers/message/fusion/mptfc.c |3 +-- drivers/message/fusion/mptspi.c |3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/message/fusion/mptfc.c b/d

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

2014-06-25 Thread Joe Lawrence
drivers/message/fusion/mptspi.c:624:1: warning: symbol 'mptscsih_quiesce_raid' was not declared. Should it be static? Signed-off-by: Joe Lawrence Cc: Dan Carpenter Cc: Sreekanth Reddy Reviewed-by: Christoph Hellwig --- drivers/message/fusion/mptbase.c |2 +- drivers/message/fusi

[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 Cc: Dan Carpenter Cc: Sreekanth Reddy Cc: Christoph Hellwig --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 56 +++--- 1 file changed, 31 insertions(+), 25 deletions(-) di

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

2014-06-25 Thread Joe Lawrence
ned-off-by: Joe Lawrence Cc: Dan Carpenter Reviewed-by: Christoph Hellwig Acked-by: Sreekanth Reddy --- drivers/scsi/mpt2sas/mpt2sas_base.c |9 + drivers/scsi/mpt2sas/mpt2sas_base.h |2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/mpt2sas/mpt2

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

2014-06-25 Thread Joe Lawrence
warn: struct type mismatch 'MPT3SAS_DEVICE vs scsi_device' Signed-off-by: Joe Lawrence Cc: Dan Carpenter Reviewed-by: Christoph Hellwig Acked-by: Sreekanth Reddy --- drivers/scsi/mpt3sas/mpt3sas_scsih.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --

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

2014-06-25 Thread Joe Lawrence
warn: struct type mismatch 'MPT2SAS_DEVICE vs scsi_device' Signed-off-by: Joe Lawrence Cc: Dan Carpenter Reviewed-by: Christoph Hellwig Acked-by: Sreekanth Reddy --- drivers/scsi/mpt2sas/mpt2sas_scsih.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --

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

2014-06-25 Thread Joe Lawrence
f 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: annotat

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

2014-06-25 Thread Joe Lawrence
her 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 appl

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

2014-06-18 Thread Joe Lawrence
ructure is initialized and more importantly, avoids racing qla2x00_probe_one. Signed-off-by: Joe Lawrence --- 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 --git a/dr

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

2014-06-18 Thread Joe Lawrence
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 --- drivers/scsi/qla2xxx/qla_def.h |1 + dr

[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 --- drivers/scsi/qla2xxx/qla_gbl.h |3 ++- drivers/scsi/qla2xxx/qla_isr.c | 28

[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 --- drivers/scsi/qla2xxx/qla_os.c | 13 +++---

[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 rel

[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 --- drivers/scsi/qla2xxx/qla_def.h |3 +++ drivers

[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 --- drivers/scsi/qla2xxx/qla_os.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx

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 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 @@ struct f

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 wrote: > Fixes the following smatch warning: > > drivers/message/fusion/mptctl.c:1369 mptctl_getiocinfo() warn: > possible info leak 'karg' > > Signed-off-by: Joe Lawrence > Cc: Christoph Hellwig > Cc: Da

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

2014-06-04 Thread Joe Lawrence
'h' could be null (see line 1274) drivers/message/fusion/mptscsih.c:1388 mptscsih_qcmd() error: we previously assumed 'vdevice' could be null (see line 1373) Signed-off-by: Joe Lawrence Cc: Christoph Hellwig Cc: Dan Carpenter Cc: Sreekanth Reddy --- JL: Comments on the abo

[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 Cc: Christoph Hellwig Cc: Dan

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

2014-06-04 Thread Joe Lawrence
bably non-NULL. 'ioc->prod_name' Signed-off-by: Joe Lawrence Cc: Christoph Hellwig Cc: Dan Carpenter Cc: Sreekanth Reddy --- drivers/message/fusion/mptbase.c | 11 +-- drivers/message/fusion/mptbase.h |2 +- 2 files changed, 6 insertions(+), 7 deletions(-) di

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

2014-06-04 Thread Joe Lawrence
drivers/message/fusion/mptspi.c:624:1: warning: symbol 'mptscsih_quiesce_raid' was not declared. Should it be static? Signed-off-by: Joe Lawrence Cc: Christoph Hellwig Cc: Dan Carpenter Cc: Sreekanth Reddy --- drivers/message/fusion/mptbase.c |2 +- drivers/message/fusion/mptsas

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

2014-06-04 Thread Joe Lawrence
kfree() Signed-off-by: Joe Lawrence Cc: Christoph Hellwig Cc: Dan Carpenter Cc: Sreekanth Reddy --- drivers/message/fusion/mptfc.c |3 +-- drivers/message/fusion/mptspi.c |3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/message/fusion/mptfc.c b/drivers/m

[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 Cc: Christoph Hellwig Cc: Dan Carpenter Cc: Sreekanth Reddy --- drivers/message/fusion/mptctl.c |2 +- 1 file

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

2014-06-04 Thread Joe Lawrence
ers/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 Cc: Christoph Hellwig Cc: Dan Carpenter Cc: Sreeka

[PATCH 0/7] mptfusion static checker fixups

2014-06-04 Thread Joe Lawrence
/easiest change up to the last three, which are bit more involved and should be reviewed by LSI, especially the last one "mptfusion: tweak null pointer checks". See the commentary in those patches after the signed-off-by line. Cc: Christoph Hellwig Cc: Dan Carpenter Cc: Sreekanth R

Christoph Hellwig 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 > al

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 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 fir

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

2014-06-02 Thread Joe Lawrence
ned-off-by: Joe Lawrence Cc: Dan Carpenter Cc: Sreekanth Reddy --- drivers/scsi/mpt2sas/mpt2sas_base.c |9 + drivers/scsi/mpt2sas/mpt2sas_base.h |2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2

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

2014-06-02 Thread Joe Lawrence
warn: struct type mismatch 'MPT3SAS_DEVICE vs scsi_device' Signed-off-by: Joe Lawrence Cc: Dan Carpenter Cc: Sreekanth Reddy --- drivers/scsi/mpt3sas/mpt3sas_scsih.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih

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

2014-06-02 Thread Joe Lawrence
Signed-off-by: Joe Lawrence Cc: Dan Carpenter Cc: Sreekanth Reddy --- 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/mpt3sas/mpt3sas_scsih.c index e6f0720..25e3a22 100644 --- a/dr

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

2014-06-02 Thread Joe Lawrence
warn: struct type mismatch 'MPT2SAS_DEVICE vs scsi_device' Signed-off-by: Joe Lawrence Cc: Dan Carpenter Cc: Sreekanth Reddy --- drivers/scsi/mpt2sas/mpt2sas_scsih.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih

[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

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 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 > error handler code

[PATCH] scsi_transport_sas: move bsg destructor into sas_rphy_remove

2014-05-22 Thread Joe Lawrence
B, C, A. Note the sas_device 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.

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 wrote: > On Wed, 2 Apr 2014 16:40:41 -0400 > Joe Lawrence wrote: > > > Since bsg creation is a side effect of sas_rphy_add, move its > > complementary removal call into sas_rphy_remove. > > Hello James, > > T

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

2014-04-14 Thread Joe Lawrence
On Mon, 14 Apr 2014 04:30:15 -0700 Christoph Hellwig 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: > > ---

[PATCH RESEND] scsi_transport_sas: move bsg destructor into sas_rphy_remove

2014-04-02 Thread Joe Lawrence
B, C, A. Note the sas_device 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.

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 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 deletion path when re

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

2014-02-21 Thread Joe Lawrence
On Wed, 12 Feb 2014 11:13:22 -0800 Dan Williams wrote: > > Acked-by: Dan Williams > > I think this is the right move, and some follow-up cleanups / fixes > come to mind: Dan -- Thanks for taking a look. A few comments below. > 1/ Why is sas_bsg_remove() multiplexing 2 use cases? Let's just

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

2014-02-12 Thread Joe Lawrence
g the same WARNING call > trace on latest 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 > > >-

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/scsi_transport_sas_sysfs_warning.patch

[PATCH] scsi_transport_sas: move bsg destructor into sas_rphy_remove

2013-12-03 Thread Joe Lawrence
B, C, A. Note the sas_device 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.

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 wrote: > On Wed, 20 Nov 2013 14:08:40 -0500 > Joe Lawrence wrote: > > > Starting in 3.12, when loading and unloading the mpt2sas driver, I see > > the following warning: > > > > [ cut here ]

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 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/0x

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 linked

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 wrote: > On 14.11.2013, at 22.50, Joe Lawrence wrote: > > > On Thu, 14 Nov 2013 20:22:40 +0100 > > Bodo Stroesser wrote: > > > > > On 14.11.2013, at 20.05, Kai M??kisara (Kolumbus) > > > wrote:

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 wrote: > On 14.11.2013, at 20.05, Kai M??kisara (Kolumbus) > wrote: > > > > > On 14.11.2013, at 16.48, Bodo Stroesser wrote: > > > > > Hi, > > > > > > in st_probe(), st.c I stumbled across what I'd call a minor problem. > > > > > > So I'd

  1   2   >