[PATCH] [8/2many] MAINTAINERS - 53C700 AND 53C700-66 SCSI DRIVER

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 1275844..ad55112 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -133,6 +133,7 @@ P:  James E.J. Bottomley
 M: [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 S: Maintained
+F: drivers/scsi/53c700*
 
 6PACK NETWORK DRIVER FOR AX.25
 P: Andreas Koensgen
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [20/2many] MAINTAINERS - DPT_I2O SCSI RAID DRIVER

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 71e09b7..7d58f6b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -232,6 +232,8 @@ M:  [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 W: http://www.adaptec.com/
 S: Maintained
+F: drivers/scsi/dpt*
+F: drivers/scsi/dpt/
 
 AACRAID SCSI RAID DRIVER
 P: Adaptec OEM Raid Solutions
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [21/2many] MAINTAINERS - AACRAID SCSI RAID DRIVER

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 7d58f6b..1162fb7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -241,6 +241,7 @@ M:  [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 W: http://www.adaptec.com/
 S: Supported
+F: drivers/scsi/aacraid/
 
 ACPI
 P: Len Brown
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [35/2many] MAINTAINERS - AHA152X SCSI DRIVER

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index c35092f..b6827c1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -343,9 +343,11 @@ F: drivers/char/agp/
 
 AHA152X SCSI DRIVER
 P: Juergen E. Fischer
-M: Juergen Fischer <[EMAIL PROTECTED]>
+M: [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 S: Maintained
+F: drivers/scsi/aha152x*
+F: drivers/scsi/pcmcia/aha152x*
 
 ALCATEL SPEEDTOUCH USB DRIVER
 P: Duncan Sands
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [19/2many] MAINTAINERS - IPS SCSI RAID DRIVER

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 141b08a..71e09b7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -224,6 +224,7 @@ M:  [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 W: http://www.adaptec.com/
 S: Maintained
+F: drivers/scsi/ips*
 
 DPT_I2O SCSI RAID DRIVER
 P: Adaptec OEM Raid Solutions
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [115/2many] MAINTAINERS - BSG (block layer generic sg v4 driver)

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 0ee8069..4ad8cd5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1118,6 +1118,8 @@ P:FUJITA Tomonori
 M: [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 S: Supported
+F: block/bsg.c
+F: include/linux/bsg.h
 
 BTTV VIDEO4LINUX DRIVER
 P: Mauro Carvalho Chehab
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [167/2many] MAINTAINERS - EATA ISA/EISA/PCI SCSI DRIVER

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index a8b11ba..144c052 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1626,6 +1626,7 @@ P:Dario Ballabio
 M: [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 S: Maintained
+F: drivers/scsi/eata*
 
 EATA-PIO SCSI DRIVER
 P: Michael Neuffer
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [182/2many] MAINTAINERS - EMULEX LPFC FC SCSI DRIVER

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index d5bceb3..6da519c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1759,6 +1759,7 @@ M:[EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 W: http://sourceforge.net/projects/lpfc
 S: Supported
+F: drivers/scsi/lpfc/
 
 EPSON 1355 FRAMEBUFFER DRIVER
 P: Christopher Hoover
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [205/2many] MAINTAINERS - GDT SCSI DISK ARRAY CONTROLLER DRIVER

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 770b0d8..6597718 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1961,6 +1961,7 @@ M:[EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 W: http://www.icp-vortex.com/
 S: Supported
+F: drivers/scsi/gdt*
 
 GENERIC GPIO I2C DRIVER
 P: Haavard Skinnemoen
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [204/2many] MAINTAINERS - FUTURE DOMAIN TMC-16x0 SCSI DRIVER (16-bit)

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 3bea26f..770b0d8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1952,6 +1952,8 @@ P:Rik Faith
 M: [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 S: Odd fixes (e.g., new signatures)
+F: drivers/scsi/fdomain.*
+F: drivers/scsi/pcmcia/fdomain_stub.c
 
 GDT SCSI DISK ARRAY CONTROLLER DRIVER
 P: Achim Leubner
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [284/2many] MAINTAINERS - LASI 53c700 driver for PARISC

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 5c4d564..f8a3640 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2731,6 +2731,8 @@ P:James E.J. Bottomley
 M: [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 S: Maintained
+F: Documentation/scsi/53c700.txt
+F: drivers/scsi/53c700*
 
 LED SUBSYSTEM
 P: Richard Purdie
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [303/2many] MAINTAINERS - LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 0046cbd..c90c64d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2909,6 +2909,7 @@ P:Matthew Wilcox
 M: [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 S: Maintained
+F: drivers/scsi/sym53c8xx_2/
 
 M32R ARCHITECTURE
 P: Hirokazu Takata
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [302/2many] MAINTAINERS - LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 8ae4d49..0046cbd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2902,6 +2902,7 @@ L:[EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 W: http://www.lsilogic.com/support
 S: Supported
+F: drivers/message/fusion/
 
 LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers
 P: Matthew Wilcox
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [332/2many] MAINTAINERS - NCR DUAL 700 SCSI DRIVER (MICROCHANNEL)

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index e372aeb..493de7a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3177,6 +3177,7 @@ P:James E.J. Bottomley
 M: [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 S: Maintained
+F: drivers/scsi/NCR_D700.*
 
 NETEM NETWORK EMULATOR
 P: Stephen Hemminger
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [358/2many] MAINTAINERS - ONSTREAM SCSI TAPE DRIVER

2007-08-12 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 17970b0..89a586a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3441,6 +3441,8 @@ M:[EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 S: Maintained
+F: drivers/scsi/osst*
+F: drivers/scsi/st.c
 
 OPROFILE
 P: Philippe Elie
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [418/2many] MAINTAINERS - SCSI CDROM DRIVER

2007-08-13 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index c08c8af..d7a1c74 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3981,6 +3981,7 @@ M:[EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 W: http://www.kernel.dk
 S: Maintained
+F: drivers/scsi/sr.*
 
 SCSI SG DRIVER
 P: Doug Gilbert
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [419/2many] MAINTAINERS - SCSI SG DRIVER

2007-08-13 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index d7a1c74..c156f9f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3989,6 +3989,8 @@ M:[EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 W: http://www.torque.net/sg
 S: Maintained
+F: drivers/scsi/sg.c
+F: include/scsi/sg.h
 
 SCSI SUBSYSTEM
 P: James E.J. Bottomley
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [420/2many] MAINTAINERS - SCSI SUBSYSTEM

2007-08-13 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index c156f9f..c4d29d9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3998,6 +3998,8 @@ M:[EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 T: git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
 S: Maintained
+F: drivers/scsi/
+F: include/scsi/
 
 SCSI TAPE DRIVER
 P: Kai Mäkisara
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [421/2many] MAINTAINERS - SCSI TAPE DRIVER

2007-08-13 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index c4d29d9..2e15975 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4006,6 +4006,7 @@ P:Kai Mäkisara
 M: [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 S: Maintained
+F: drivers/scsi/st*
 
 SCTP PROTOCOL
 P: Vlad Yasevich
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [486/2many] MAINTAINERS - U14-34F SCSI DRIVER

2007-08-13 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 374ee9b..e28c8d4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4609,6 +4609,7 @@ P:Dario Ballabio
 M: [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 S: Maintained
+F: drivers/scsi/u14-34f.c
 
 UDF FILESYSTEM
 P: Ben Fennema
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [541/2many] MAINTAINERS - WD7000 SCSI DRIVER

2007-08-13 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index d8ee850..4172b36 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5112,12 +5112,15 @@ M:  [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 W: http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/
 S: Maintained
+F: Documentation/networking/wavelan.txt
+F: drivers/net/wireless/wavelan*
 
 WD7000 SCSI DRIVER
 P: Miroslav Zagorac
 M: [EMAIL PROTECTED]
 L: linux-scsi@vger.kernel.org
 S: Maintained
+F: drivers/scsi/wd7000.c
 
 WISTRON LAPTOP BUTTON DRIVER
 P: Miloslav Trmac
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [166/2many] MAINTAINERS - EATA-DMA SCSI DRIVER

2007-08-13 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 8c79559..a8b11ba 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1616,8 +1616,10 @@ F:   include/linux/dvb/
 
 EATA-DMA SCSI DRIVER
 P: Michael Neuffer
-L: [EMAIL PROTECTED], linux-scsi@vger.kernel.org
+L: [EMAIL PROTECTED]
+L: linux-scsi@vger.kernel.org
 S: Maintained
+F: drivers/scsi/eata*
 
 EATA ISA/EISA/PCI SCSI DRIVER
 P: Dario Ballabio
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [168/2many] MAINTAINERS - EATA-PIO SCSI DRIVER

2007-08-13 Thread joe
Add file pattern to MAINTAINER entry

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/MAINTAINERS b/MAINTAINERS
index 144c052..45ce2d4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1631,8 +1631,10 @@ F:   drivers/scsi/eata*
 EATA-PIO SCSI DRIVER
 P: Michael Neuffer
 M: [EMAIL PROTECTED]
-L: [EMAIL PROTECTED], linux-scsi@vger.kernel.org
+L: [EMAIL PROTECTED]
+L: linux-scsi@vger.kernel.org
 S: Maintained
+F: drivers/scsi/eata*
 
 EBTABLES
 P: Bart De Schuymer
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 00/12] treewide: Use DECLARE_BITMAP

2015-05-19 Thread Joe Perches
Use the standard method to declare a bitmap array.

Joe Perches (12):
  ARM: mach-imx: iomux-imx31: Use DECLARE_BITMAP
  dmaengine: rcar-dmac: Use DECLARE_BITMAP
  drm/amdkfd: Use DECLARE_BITMAP
  drm/radeon: Use DECLARE_BITMAP
  IB/ehca: Use DECLARE_BITMAP
  bcache: Use DECLARE_BITMAP
  spider_net: Use DECLARE_BITMAP
  s390/sclp: Use DECLARE_BITMAP
  [SCSI] qla4xxx: Use DECLARE_BITMAP
  scsi: Use DECLARE_BITMAP
  logfs: Use DECLARE_BITMAP
  sunrpc: Use DECLARE_BITMAP

 arch/arm/mach-imx/iomux-imx31.c   | 2 +-
 drivers/dma/sh/rcar-dmac.c| 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 5 ++---
 drivers/gpu/drm/radeon/radeon.h   | 2 +-
 drivers/infiniband/hw/ehca/ipz_pt_fn.h| 2 +-
 drivers/md/bcache/journal.c   | 2 +-
 drivers/net/ethernet/toshiba/spider_net.c | 3 +--
 drivers/s390/char/sclp_cmd.c  | 2 +-
 drivers/scsi/qla4xxx/ql4_def.h| 2 +-
 drivers/scsi/sr.c | 2 +-
 fs/logfs/logfs.h  | 2 +-
 net/sunrpc/auth_gss/svcauth_gss.c | 2 +-
 12 files changed, 13 insertions(+), 15 deletions(-)

-- 
2.1.2

--
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: [BUG] hpsa: Controller lockup detected: 0x00150028

2015-05-22 Thread Handzik, Joe
No, the problem here (iirc) actually dealt with buffers in the firmware.

Don or Mark, agree?

Joe

-Original Message-
From: Peter Zijlstra [mailto:pet...@infradead.org] 
Sent: Friday, May 22, 2015 11:40 AM
To: Tomas Henzl
Cc: Oelke, Mark; don.br...@pmcs.com; ISS StorageDev; storage...@pmcs.com; 
linux-scsi@vger.kernel.org
Subject: Re: [BUG] hpsa: Controller lockup detected: 0x00150028

On Fri, May 22, 2015 at 05:10:44PM +0200, Tomas Henzl wrote:
> >> I've updated to 6.62 and it appears to be working now; or rather, it has

I've since gotten 6.64 from HP to test; which does not seem public yet.

6.64 actually fixes the issue for me.

> An older issue for mptsas seems to handle a similar case
> 2a1b7e575b [SCSI] mptsas: fix hangs caused by ATA pass-through
> that might be for hpsa -

> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -1067,6 +1067,8 @@ static int hpsa_slave_alloc(struct scsi_device *sdev)
> if (sd != NULL)
> sdev->hostdata = sd;
> spin_unlock_irqrestore(&h->devlock, flags);
> +
> +   blk_queue_dma_alignment (sdev->request_queue, 512 - 1);
> return 0;
>  }

That does indeed seem _very_ similar; I'll have to defer to Mark Oelke
and or Don Brace to say if the above is a useful alternative. Since they
seem to now know what was the root cause.
--
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 v2 1/3] megaraid : use dev_printk when possible

2015-06-01 Thread Joe Perches
On Mon, 2015-06-01 at 10:40 -0500, Bjorn Helgaas wrote:
> Use dev_printk() when possible to make messages more useful.
[]
> diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
[]
> @@ -268,7 +268,7 @@ mega_query_adapter(adapter_t *adapter)
>   raw_mbox[2] = NC_SUBOP_PRODUCT_INFO;/* i.e. 0x0E */
>  
>   if ((retval = issue_scb_block(adapter, raw_mbox)))
> - printk(KERN_WARNING
> + dev_warn(&adapter->dev->dev,
>   "megaraid: Product_info cmd failed with error: %d\n",
>   retval);

Wouldn't these be a bit redundant with a "megaraid: " prefix now?
Perhaps it'd be nicer to realign arguments too.


--
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 v2 1/3] megaraid : use dev_printk when possible

2015-06-01 Thread Joe Perches
On Mon, 2015-06-01 at 11:40 -0500, Bjorn Helgaas wrote:
> On Mon, Jun 1, 2015 at 11:10 AM, Joe Perches  wrote:
> > On Mon, 2015-06-01 at 10:40 -0500, Bjorn Helgaas wrote:
> >> Use dev_printk() when possible to make messages more useful.
> > []
> >> diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
> > []
> >> @@ -268,7 +268,7 @@ mega_query_adapter(adapter_t *adapter)
> >>   raw_mbox[2] = NC_SUBOP_PRODUCT_INFO;/* i.e. 0x0E */
> >>
> >>   if ((retval = issue_scb_block(adapter, raw_mbox)))
> >> - printk(KERN_WARNING
> >> + dev_warn(&adapter->dev->dev,
> >>   "megaraid: Product_info cmd failed with error: %d\n",
> >>   retval);
> >
> > Wouldn't these be a bit redundant with a "megaraid: " prefix now?
> > Perhaps it'd be nicer to realign arguments too.
> 
> Yes, you're right.  I took out most of the "megaraid: " prefixes, but
> I missed a few.
> 
> I tried not to realign things too much because it's hard to know where
> to stop, and I don't want to spend a week on this.

;)  I try to realign all modified statements.

> I'll post a v3 in a day or two in case there are other comments.

Thanks.


--
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: bisected regression: qla2xxx endianness on sparc64

2015-06-03 Thread Joe Carnuccio
Meelis,

Yes, please revert that patch (it should never have deleted the calls to 
__constant_cpu_to_le16 (those fields are all LE in the HW/nvram)).

-Joe

-Original Message-
From: mr...@math.ut.ee [mailto:mr...@math.ut.ee] On Behalf Of Meelis Roos
Sent: Wednesday, June 03, 2015 1:21 AM
To: Christoph Hellwig
Cc: Chad Dupuis; Joe Carnuccio; Saurav Kashyap; Christoph Hellwig; Dept-Eng 
QLA2xxx Upstream; James E.J. Bottomley; linux-scsi; linux-kernel
Subject: Re: bisected regression: qla2xxx endianness on sparc64

On Mon, 10 Nov 2014, Christoph Hellwig wrote:

> On Mon, Nov 03, 2014 at 03:09:47PM -0500, Chad Dupuis wrote:
> > We should revert that change. What were some of the other failures 
> > you were seeing?
> 
> Can you please send me the revert ASAP?

Since QLogic is still silent on this one, I will send it to you:

Revert change that breaks QLA2XXX on big-endian systems,
__constant_cpu_to_le16() is still needed.

Signed-off-by: Meelis Roos 

diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h 
index 42bb357..88d3143 100644
--- a/drivers/scsi/qla2xxx/qla_fw.h
+++ b/drivers/scsi/qla2xxx/qla_fw.h
@@ -91,7 +91,7 @@ struct nvram_24xx {
/* Firmware Initialization Control Block. */
uint16_t version;
uint16_t reserved_1;
-   __le16 frame_payload_size;
+   uint16_t frame_payload_size;
uint16_t execution_throttle;
uint16_t exchange_count;
uint16_t hard_address;
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c 
index 285cb20..ed973a1 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2658,18 +2658,18 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)
nv->firmware_options[1] = BIT_7 | BIT_5;
nv->add_firmware_options[0] = BIT_5;
nv->add_firmware_options[1] = BIT_5 | BIT_4;
-   nv->frame_payload_size = 2048;
+   nv->frame_payload_size = __constant_cpu_to_le16(2048);
nv->special_options[1] = BIT_7;
} else if (IS_QLA2200(ha)) {
nv->firmware_options[0] = BIT_2 | BIT_1;
nv->firmware_options[1] = BIT_7 | BIT_5;
nv->add_firmware_options[0] = BIT_5;
nv->add_firmware_options[1] = BIT_5 | BIT_4;
-   nv->frame_payload_size = 1024;
+   nv->frame_payload_size = __constant_cpu_to_le16(1024);
} else if (IS_QLA2100(ha)) {
nv->firmware_options[0] = BIT_3 | BIT_1;
nv->firmware_options[1] = BIT_5;
-   nv->frame_payload_size = 1024;
+   nv->frame_payload_size = __constant_cpu_to_le16(1024);
}
 
nv->max_iocb_allocation = __constant_cpu_to_le16(256); @@ 
-2705,7 +2705,7 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)
 * are valid.
 */
if (ia64_platform_is("sn2")) {
-   nv->frame_payload_size = 2048;
+   nv->frame_payload_size = __constant_cpu_to_le16(2048);
if (IS_QLA23XX(ha))
nv->special_options[1] = BIT_7;
}
@@ -5022,7 +5022,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
memset(nv, 0, ha->nvram_size);
nv->nvram_version = __constant_cpu_to_le16(ICB_VERSION);
nv->version = __constant_cpu_to_le16(ICB_VERSION);
-   nv->frame_payload_size = 2048;
+   nv->frame_payload_size = __constant_cpu_to_le16(2048);
nv->execution_throttle = __constant_cpu_to_le16(0x);
nv->exchange_count = __constant_cpu_to_le16(0);
nv->hard_address = __constant_cpu_to_le16(124); @@ -5969,7 
+5969,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
memset(nv, 0, ha->nvram_size);
nv->nvram_version = __constant_cpu_to_le16(ICB_VERSION);
nv->version = __constant_cpu_to_le16(ICB_VERSION);
-   nv->frame_payload_size = 2048;
+   nv->frame_payload_size = __constant_cpu_to_le16(2048);
nv->execution_throttle = __constant_cpu_to_le16(0x);
nv->exchange_count = __constant_cpu_to_le16(0);
nv->port_name[0] = 0x21;

--
Meelis Roos (mr...@linux.ee)
<>

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(
>   ioc->firmware_event_name);
> +#endif

Hi Sreekanth,

I think the upstream version of this code can safely assume
alloc_ordered_workqueue is defined, no?

Regards,

-- Joe
--
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] 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
>> then detects the device later in the boot process.
>>
>> This patch aborts initialization and prints a warning if no memory I/O
>> resources are found.
>>
>> Signed-off-by: Timothy Pearson 
>> Tested-by: Timothy Pearson 
>> ---
>> drivers/scsi/mpt2sas/mpt2sas_base.c | 9 +
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c
>> b/drivers/scsi/mpt2sas/mpt2sas_base.c
>> index 11248de..15c9504 100644
>> --- a/drivers/scsi/mpt2sas/mpt2sas_base.c
>> +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
>> @@ -6,6 +6,8 @@
>> * Copyright (C) 2007-2014 LSI Corporation
>> * Copyright (C) 20013-2014 Avago Technologies
>> * (mailto: mpt-fusionlinux@avagotech.com)
>> + * Copyright (C) 2015 Raptor Engineering
>> + * (mailto: supp...@araptorengineeringinc.com)
>> *
>> * This program is free software; you can redistribute it and/or
>> * modify it under the terms of the GNU General Public License
>> @@ -1582,6 +1584,13 @@ mpt2sas_base_map_resources(struct MPT2SAS_ADAPTER
>> *ioc)
>> }
>> }
>>
>> + if (ioc->chip == NULL) {
>> + printk(MPT2SAS_ERR_FMT "unable to map "
>> + "adapter memory (resource not found)!\n", ioc->name);
>> + r = -EINVAL;
>> + goto out_fail;
>> + }
>> +
>> _base_mask_interrupts(ioc);
>>
>> r = _base_get_ioc_facts(ioc, CAN_SLEEP);
> 
> Just following up on this patch as I have not yet received any response.
> 
> Thanks!

Hi Tim -- just curious, why was the similar check on ioc->chip just a
few lines above the one added by the patch insufficient?

That loop block sets memap_sz when it finds an IORESOURCE_MEM so that it
only sets ioc->chip once.  I wonder if the fix might be simpler if the
existing ioc->chip check relocated entirely to where you put it (maybe
also pulling the entire error text onto one line for easier grepping).

Regards,

-- Joe
--
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 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 upstream kernel.
> so removing the else section where driver use 
> create_singlethread_workqueue() API if alloc_ordered_workqueue() API is
> not defined, This else section is not required since in the latest upstream
> kernel this alloc_ordered_workqueue() API is always defined.
> 
> Signed-off-by: Sreekanth Reddy 
> ---
>  drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
> b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> index b848458..7e5926c 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> @@ -8085,8 +8085,8 @@ _scsih_probe(struct pci_dev *pdev, const struct 
> pci_device_id *id)
>   /* event thread */
>   snprintf(ioc->firmware_event_name, sizeof(ioc->firmware_event_name),
>   "fw_event%d", ioc->id);
> - ioc->firmware_event_thread = create_singlethread_workqueue(
> - ioc->firmware_event_name);
> + ioc->firmware_event_thread = alloc_ordered_workqueue(
> + ioc->firmware_event_name, WQ_MEM_RECLAIM);
>   if (!ioc->firmware_event_thread) {
>   pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
>   ioc->name, __FILE__, __LINE__, __func__);
> 

Hi Sreekanth,

Is this change still needed after e09c2c2954684 workqueue: apply
__WQ_ORDERED to create_singlethread_workqueue() ?  (3.17+)

In upstream, this change looks cosmetic (unless Tejun has a preference
for one over the other), but maybe converting to alloc_ordered_workqueue
keeps your in house version in closer sync?

Thanks,

-- Joe
--
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 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-queue sequentially instead of
>>> create_singlethread_workqueue() API.
>>>
>>> Changes in v1:
>>> No need to check for backport compatibility in the upstream kernel.
>>> so removing the else section where driver use
>>> create_singlethread_workqueue() API if alloc_ordered_workqueue() API is
>>> not defined, This else section is not required since in the latest upstream
>>> kernel this alloc_ordered_workqueue() API is always defined.
>>>
>>> Signed-off-by: Sreekanth Reddy 
>>> ---
>>>  drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
>>> b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
>>> index b848458..7e5926c 100644
>>> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
>>> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
>>> @@ -8085,8 +8085,8 @@ _scsih_probe(struct pci_dev *pdev, const struct 
>>> pci_device_id *id)
>>>   /* event thread */
>>>   snprintf(ioc->firmware_event_name, sizeof(ioc->firmware_event_name),
>>>   "fw_event%d", ioc->id);
>>> - ioc->firmware_event_thread = create_singlethread_workqueue(
>>> - ioc->firmware_event_name);
>>> + ioc->firmware_event_thread = alloc_ordered_workqueue(
>>> + ioc->firmware_event_name, WQ_MEM_RECLAIM);
>>>   if (!ioc->firmware_event_thread) {
>>>   pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
>>>   ioc->name, __FILE__, __LINE__, __func__);
>>>
>>
>> Hi Sreekanth,
>>
>> Is this change still needed after e09c2c2954684 workqueue: apply
>> __WQ_ORDERED to create_singlethread_workqueue() ?  (3.17+)
> 
> I won't say that it is compulsory required, but I feel it is better if
> these changes are included. since initially we thought that thread
> created by using create_singlethread_workqueue() will process the
> works sequentially but in-between  it has broken and then it is fixed
> by Tejun.  So I thought it is better to directly use the
> alloc_ordered_workqueue() as create_singlethead_workqueue() API also
> invoked the same API.

Ok, I was just wondering if maybe create_singlethread_workqueue was
fixed after this patch was initially written.  Since it's effectively
the same...

Reviewed-by: Joe Lawrence 

Regards,

-- Joe
--
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: OOPS: unplugging western digital passport drive

2015-06-22 Thread Joe Lawrence
Hi Alan -- last I heard from Stan on this bug was April 14 -- he was on
"long holidays" at that time :)

-- Joe

On 06/17/2015 03:09 PM, Alan Stern wrote:
> Joe or Stanisナ^ツaw:
> 
> I never heard anything back about this.  Does the patch fix the crash?
> 
> Alan Stern
> 
> 
> 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,
>>>>> 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
>>>
>>> Like it says in that thread, the problem is somehow related to the ses
>>> driver.  If you remove or blacklist that driver, there won't be any
>>> more crashes.
>>
>> Looks like I spoke too soon.  I think the patch below will fix the 
>> problem.  Let me know what happens.
>>
>> Alan Stern
>>
>>
>>
>>
>> Index: usb-4.0/drivers/scsi/scsi_pm.c
>> ===
>> --- usb-4.0.orig/drivers/scsi/scsi_pm.c
>> +++ usb-4.0/drivers/scsi/scsi_pm.c
>> @@ -217,14 +217,18 @@ static int sdev_runtime_suspend(struct d
>>  {
>>  const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
>>  struct scsi_device *sdev = to_scsi_device(dev);
>> -int err;
>> +struct device *blk_rpm_dev = sdev->request_queue->dev;
>> +int err = 0;
>>  
>> -err = blk_pre_runtime_suspend(sdev->request_queue);
>> -if (err)
>> -return err;
>> +if (blk_rpm_dev) {
>> +err = blk_pre_runtime_suspend(sdev->request_queue);
>> +if (err)
>> +return err;
>> +}
>>  if (pm && pm->runtime_suspend)
>>  err = pm->runtime_suspend(dev);
>> -blk_post_runtime_suspend(sdev->request_queue, err);
>> +if (blk_rpm_dev)
>> +blk_post_runtime_suspend(sdev->request_queue, err);
>>  
>>  return err;
>>  }
>> @@ -246,12 +250,15 @@ static int sdev_runtime_resume(struct de
>>  {
>>  struct scsi_device *sdev = to_scsi_device(dev);
>>  const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
>> +struct device *blk_rpm_dev = sdev->request_queue->dev;
>>  int err = 0;
>>  
>> -blk_pre_runtime_resume(sdev->request_queue);
>> +if (blk_rpm_dev)
>> +blk_pre_runtime_resume(sdev->request_queue);
>>  if (pm && pm->runtime_resume)
>>  err = pm->runtime_resume(dev);
>> -blk_post_runtime_resume(sdev->request_queue, err);
>> +if (blk_rpm_dev)
>> +blk_post_runtime_resume(sdev->request_queue, err);
>>  
>>  return err;
>>  }
>>
>>
>>
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in


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:
>>>>> 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
>>>>> then detects the device later in the boot process.
>>>>>
>>>>> This patch aborts initialization and prints a warning if no memory I/O
>>>>> resources are found.
>>>>>
>>>>> Signed-off-by: Timothy Pearson
>>>>> Tested-by: Timothy Pearson
>>>>> ---
>>>>> drivers/scsi/mpt2sas/mpt2sas_base.c | 9 +
>>>>> 1 file changed, 9 insertions(+)
>>>>>
>>>>> diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c
>>>>> b/drivers/scsi/mpt2sas/mpt2sas_base.c
>>>>> index 11248de..15c9504 100644
>>>>> --- a/drivers/scsi/mpt2sas/mpt2sas_base.c
>>>>> +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
>>>>> @@ -6,6 +6,8 @@
>>>>> * Copyright (C) 2007-2014 LSI Corporation
>>>>> * Copyright (C) 20013-2014 Avago Technologies
>>>>> * (mailto: mpt-fusionlinux@avagotech.com)
>>>>> + * Copyright (C) 2015 Raptor Engineering
>>>>> + * (mailto: supp...@araptorengineeringinc.com)
>>>>> *
>>>>> * This program is free software; you can redistribute it and/or
>>>>> * modify it under the terms of the GNU General Public License
>>>>> @@ -1582,6 +1584,13 @@ mpt2sas_base_map_resources(struct
>>>>> MPT2SAS_ADAPTER
>>>>> *ioc)
>>>>> }
>>>>> }
>>>>>
>>>>> + if (ioc->chip == NULL) {
>>>>> + printk(MPT2SAS_ERR_FMT "unable to map "
>>>>> + "adapter memory (resource not found)!\n", ioc->name);
>>>>> + r = -EINVAL;
>>>>> + goto out_fail;
>>>>> + }
>>>>> +
>>>>> _base_mask_interrupts(ioc);
>>>>>
>>>>> r = _base_get_ioc_facts(ioc, CAN_SLEEP);
>>>>
>>>> Just following up on this patch as I have not yet received any
>>>> response.
>>>>
>>>> Thanks!
>>>
>>> Hi Tim -- just curious, why was the similar check on ioc->chip just a
>>> few lines above the one added by the patch insufficient?
>>>
>>> That loop block sets memap_sz when it finds an IORESOURCE_MEM so that it
>>> only sets ioc->chip once. I wonder if the fix might be simpler if the
>>> existing ioc->chip check relocated entirely to where you put it (maybe
>>> also pulling the entire error text onto one line for easier grepping).
>>>
>>> Regards,
>>>
>>> -- Joe
>>
>> If there are no IORESOURCE_MEM resources allocated by the BIOS (i.e. if
>> the BIOS does not run resource allocation on the mpt2sas device) then
>> the check you are referring to is not executed, and the driver attempts
>> to perform operations on a null ioc->chip pointer.
>>
>> I can relocate the check if desired.
>>
> 
> On looking more closely at the code I think having the two separate
> checks is useful for debugging.  The first error message is triggered if
> the resource exists but Linux cannot map it for some reason, and the
> second error message is triggered if the resource does not exist at all
> (buggy BIOS).

Fair enough.  The two error messages are unique, so grepping will lead
to the correct check.

Only other nits would be the addition of a copyright (up to Avago I
guess) and an mpt3sas version (these drivers are 99% the same code).

Acked-by: Joe Lawrence 

-- Joe
--
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] [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 happens when there is an EEH, this read will trigger EEH
> detection and set PCI channel offline. EEH will be able to recover the
> card from this state by doing a reset, so it's a better option than
> simply disabling the card.
> 
> Since eeh_check_failure will mark the channel as offline before
> returning the read value, in case there really was an EEH, we can simply
> check for pci_channel_offline, preventing the board_disable code from
> running if it's true.
> 
> Without this patch, EEH code will try to access those same resources
> that board_disable will try to free. This race can cause EEH recovery to
> fail.
> 
> [  504.370577] EEH: Notify device driver to resume
> [  504.370580] qla2xxx [0001:07:00.0]-9002:2: The device failed to
> resume I/O from slot/link_reset.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo 
> Cc: 
> Cc: 
> ---
>  drivers/scsi/qla2xxx/qla_isr.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_isr.c
> b/drivers/scsi/qla2xxx/qla_isr.c
> index a04a1b1..8132926 100644
> --- a/drivers/scsi/qla2xxx/qla_isr.c
> +++ b/drivers/scsi/qla2xxx/qla_isr.c
> @@ -116,7 +116,7 @@ bool
>  qla2x00_check_reg32_for_disconnect(scsi_qla_host_t *vha, uint32_t reg)
>  {
>  /* Check for PCI disconnection */
> -if (reg == 0x) {
> +if (reg == 0x && !pci_channel_offline(vha->hw->pdev)) {
>  if (!test_and_set_bit(PFLG_DISCONNECTED, &vha->pci_flags) &&
>  !test_bit(PFLG_DRIVER_REMOVING, &vha->pci_flags) &&
>  !test_bit(PFLG_DRIVER_PROBING, &vha->pci_flags)) {

Hi Mauricio,

Re: signed-off-by chain -- I believe if you are (re)sending another
person's patch, you will need a:  "From: Thadeu Lima de Souza Cascardo
"  tag at the top of the message body to
retain original authorship and then your own:  "Signed-off-by: Mauricio
Faria de Oliveira " tag below Thadeu's
since the patch has passed through you.

Re: the patch -- I did some work last year to harden board_disable
against various races, but without having EEH hardware available, I was
uncertain about EEH behavior.  For example:

pci_read
   EEH -> marks channel offline
pci_read returns ~0

When do the EEH error handler callbacks run?

Thanks,

-- Joe
--
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/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 the sas_device_list without
> holding the lock, or we risk corrupting random memory if items are
> added or deleted as we iterate. This patch refactors _scsih_probe_sas()
> to use the sas_device_list in a safe way.
> 
> Cc: Christoph Hellwig 
> Cc: Bart Van Assche 
> Signed-off-by: Calvin Owens 
> ---
>  drivers/scsi/mpt2sas/mpt2sas_base.h  |  22 +-
>  drivers/scsi/mpt2sas/mpt2sas_scsih.c | 434 
> ---
>  drivers/scsi/mpt2sas/mpt2sas_transport.c |  12 +-
>  3 files changed, 315 insertions(+), 153 deletions(-)

[ ... snip ... ]

> @@ -2078,7 +2150,7 @@ _scsih_slave_configure(struct scsi_device *sdev)
>   }
>  
>   spin_lock_irqsave(&ioc->sas_device_lock, flags);
> - sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc,
> + sas_device = __mpt2sas_get_sdev_by_addr(ioc,
>  sas_device_priv_data->sas_target->sas_address);
>   if (!sas_device) {
>   spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
> @@ -2116,13 +2188,14 @@ _scsih_slave_configure(struct scsi_device *sdev)
>   if (!ssp_target)
>   _scsih_display_sata_capabilities(ioc, handle, sdev);
>  
> -
>   _scsih_change_queue_depth(sdev, qdepth);
>  
>   if (ssp_target) {
>   sas_read_port_mode_page(sdev);
>   _scsih_enable_tlr(ioc, sdev);
>   }
> +
> + sas_device_put(sas_device);
>   return 0;
>  }

Hi Calvin,

Any reason why this sas_device_put is placed outside the sas_device
lock?  Most other instances in this patch were called just before unlocking.

BTW I attempted testing, but needed to port to mpt3 and ended up with a
driver that didn't boot :(   Hopefully I can retry later this week, or
find an older mpt2 box lying around.

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


[PATCH] scsi: pmcraid: trivial typo in printk

2015-07-29 Thread Joe Perches
Trivial typo fixes:

o \b should be \n
o coalesce format to avoid excess spaces

Signed-off-by: Joe Perches 
---
And another here:

 drivers/scsi/pmcraid.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index ed31d8c..b421de2 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -1558,8 +1558,7 @@ static void pmcraid_handle_config_change(struct 
pmcraid_instance *pinstance)
cfg_entry = &ccn_hcam->cfg_entry;
fw_version = be16_to_cpu(pinstance->inq_data->fw_version);
 
-   pmcraid_info("CCN(%x): %x timestamp: %llx type: %x lost: %x flags: %x \
-res: %x:%x:%x:%x\n",
+   pmcraid_info("CCN(%x): %x timestamp: %llx type: %x lost: %x flags: %x 
res: %x:%x:%x:%x\n",
 pinstance->ccn.hcam->ilid,
 pinstance->ccn.hcam->op_code,
((pinstance->ccn.hcam->timestamp1) |
@@ -1583,7 +1582,7 @@ static void pmcraid_handle_config_change(struct 
pmcraid_instance *pinstance)
if (pinstance->ccn.hcam->notification_lost) {
cfgcmd = pmcraid_get_free_cmd(pinstance);
if (cfgcmd) {
-   pmcraid_info("lost CCN, reading config table\b");
+   pmcraid_info("lost CCN, reading config table\n");
pinstance->reinit_cfg_table = 1;
pmcraid_querycfg(cfgcmd);
} else {


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


[TRIVIAL PATCH] block: Correct misuses of 0x%

2015-08-02 Thread Joe Perches
Correct misuse of 0x%d in logging messages.

Signed-off-by: Joe Perches 
---
 drivers/block/DAC960.c | 4 ++--
 drivers/block/cciss.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 811e11c..d9b32f2 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -2954,7 +2954,7 @@ DAC960_DetectController(struct pci_dev *PCI_Device,
case DAC960_PD_Controller:
  if (!request_region(Controller->IO_Address, 0x80,
  Controller->FullModelName)) {
-   DAC960_Error("IO port 0x%d busy for Controller at\n",
+   DAC960_Error("IO port 0x%x busy for Controller at\n",
 Controller, Controller->IO_Address);
goto Failure;
  }
@@ -2990,7 +2990,7 @@ DAC960_DetectController(struct pci_dev *PCI_Device,
case DAC960_P_Controller:
  if (!request_region(Controller->IO_Address, 0x80,
  Controller->FullModelName)){
-   DAC960_Error("IO port 0x%d busy for Controller at\n",
+   DAC960_Error("IO port 0x%x busy for Controller at\n",
 Controller, Controller->IO_Address);
goto Failure;
  }
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 0422c47..2758982 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -3854,7 +3854,7 @@ static void print_cfg_table(ctlr_info_t *h)
   readl(&(tb->HostWrite.CoalIntDelay)));
dev_dbg(&h->pdev->dev, "   Coalesce Interrupt Count = 0x%x\n",
   readl(&(tb->HostWrite.CoalIntCount)));
-   dev_dbg(&h->pdev->dev, "   Max outstanding commands = 0x%d\n",
+   dev_dbg(&h->pdev->dev, "   Max outstanding commands = 0x%x\n",
   readl(&(tb->CmdsOutMax)));
dev_dbg(&h->pdev->dev, "   Bus Types = 0x%x\n",
readl(&(tb->BusTypes)));
--
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: [TRIVIAL PATCH] block: Correct misuses of 0x%

2015-08-03 Thread Joe Perches
On Mon, 2015-08-03 at 15:25 +0800, yalin wang wrote:
> > On Aug 3, 2015, at 04:25, Joe Perches  wrote:
> > 
> > Correct misuse of 0x%d in logging messages.
> > 
[]
> why not use like this : dev_dbg(&h->pdev->dev, "   Max outstanding 
> commands = %#x\n”  ? 
> %#x will add 0x prefix automatically .

It's generally a consistency thing.
A 0 value would be emitted as 0 and not 0x0.

--
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: [TRIVIAL PATCH] block: Correct misuses of 0x%

2015-08-03 Thread Joe Perches
On Tue, 2015-08-04 at 10:19 +0800, yalin wang wrote:
> Ping ? 
> > On Aug 3, 2015, at 16:56, yalin wang  wrote:
> > 
> > 
> >> On Aug 3, 2015, at 16:03, Joe Perches  wrote:
> >> 
> >> On Mon, 2015-08-03 at 15:25 +0800, yalin wang wrote:
> >>>> On Aug 3, 2015, at 04:25, Joe Perches  wrote:
> >>>> 
> >>>> Correct misuse of 0x%d in logging messages.
> >>>> 
> >> []
> >>> why not use like this : dev_dbg(&h->pdev->dev, "   Max outstanding 
> >>> commands = %#x\n”  ? 
> >>> %#x will add 0x prefix automatically .
> >> 
> >> It's generally a consistency thing.
> >> A 0 value would be emitted as 0 and not 0x0.
> >> 
> > i try on my ubuntu , 
> > 
> > static int __init throtl_init(void) 
> >   
> >  {  
> >   
> > printk("module init test: %#x %p\n", 0, (void *)0x123); 
> >  
> >  return 0;  
> >  
> > 
> >  }  
> >  
> > 
> >  module_init(throtl_init); 
> > 
> > #uname -a
> > Linux ubuntu 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 
> > UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
> > 
> > #dmesg
> > [259356.375586] module init test: 0x0 0123
> > 
> > it seems don’t need 0x%x for 0, just need %#x for all numbers.
> > there are lots of use like this, i can change them if needed:
> > 
> > # egrep -r  -i '0x%\d*x'  .  | wc -l 
> > 11776

I suggest not, it's not a standard usage and the 0
may be unexpected.

--
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] sd: assign appropriate log level

2016-10-17 Thread Joe Perches
On Mon, 2016-10-17 at 09:51 -0700, David Singleton wrote:
> From: Shikhar Dogra 
> 
> Reduce chatter on console for usb hotplug.
> KERN_ERR is too high severity for these messages, moving them
> to KERN_WARNING

Perhaps KERN_NOTICE is more appropriate.
That's the level for most of these sd_first_printk already.

> USB devices never have a Caching Mode page, it doesn't make
> sense to make it an error when you have tons of USB devices where
> the print is useless, and not an error.
> 
> For second message, the condition is not an error. The existing
> workaround of assuming a write through cache doesn't limit
> functionality in any way.
> 
> Cc: xe-ker...@external.cisco.com
> Signed-off-by: Shikhar Dogra 
> Signed-off-by: David Singleton 
> ---
>  drivers/scsi/sd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 51e5629..ab7bfe3 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -2540,7 +2540,7 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned 
> char *buffer)
>   }
>   }
>  
> - sd_first_printk(KERN_ERR, sdkp, "No Caching mode page found\n");
> + sd_first_printk(KERN_WARNING, sdkp, "No Caching mode page 
> found\n");
>   goto defaults;
>  
>   Page_found:
> @@ -2594,7 +2594,7 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned 
> char *buffer)
>   "Assuming drive cache: write back\n");
>   sdkp->WCE = 1;
>   } else {s
> - sd_first_printk(KERN_ERR, sdkp,
> + sd_first_printk(KERN_WARNING, sdkp,
>   "Assuming drive cache: write through\n");
>   sdkp->WCE = 0;
>   }
> 
--
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] scsi/qla2xxx: label endian-ness for many fields

2016-12-09 Thread Joe Perches
On Fri, 2016-12-09 at 22:45 +0200, Michael S. Tsirkin wrote:
> This adds endian-ness labels for lots of qla structs.
> Doing this cuts down number of sparse warnings from ~1700 to ~1400.
> Will help find and resolve some of real issues down the road.
> 
> Signed-off-by: Michael S. Tsirkin 
> 
> ---
> 
> Compile-tested only.
> 
> diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
> index 73b12e4..a4d3071 100644
> --- a/drivers/scsi/qla2xxx/qla_def.h
> +++ b/drivers/scsi/qla2xxx/qla_def.h
> @@ -1159,28 +1159,28 @@ typedef struct {
>*/
>   uint8_t  firmware_options[2];
>  
> - uint16_t frame_payload_size;
> - uint16_t max_iocb_allocation;
> - uint16_t execution_throttle;
> + __le16 frame_payload_size;
> + __le16 max_iocb_allocation;
> + __le16 execution_throttle;

Shouldn't all these _not_ have the leading __?
Perhaps the uint8_t uses should be converted to u8 as well.

[etc...]

--
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 v1 12/12] scsi: ufs: Improve fatal error logs

2016-12-12 Thread Joe Perches
On Mon, 2016-12-12 at 16:56 -0800, Subhash Jadavani wrote:
> Errors such as UIC error, illegal OCS values, and others may require
> more information for debugging. Such information could be hibern8 events,
> events sequences, recoverable errors, error history, and more.
[]
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
[]
> @@ -346,6 +346,37 @@ static inline void ufshcd_cond_add_cmd_trace(struct 
> ufs_hba *hba,
[]
> +static void ufshcd_print_uic_err_hist(struct ufs_hba *hba,
> + struct ufs_uic_err_reg_hist *err_hist, char *err_name)
> +{
> + int i;
> +
> + for (i = 0; i < UIC_ERR_REG_HIST_LENGTH; i++) {
> + int p = (i + err_hist->pos - 1) % UIC_ERR_REG_HIST_LENGTH;
> +
> + if (err_hist->reg[p] == 0)
> + continue;
> + dev_err(hba->dev, "%s[%d] = 0x%x at %lld us", err_name, i,
> + err_hist->reg[p], ktime_to_us(err_hist->tstamp[p]));

Please consistently use a terminating \n

> + }
> +}
> +
>  static void ufshcd_print_host_regs(struct ufs_hba *hba)
>  {
>   /*
> @@ -362,6 +393,21 @@ static void ufshcd_print_host_regs(struct ufs_hba *hba)
>   dev_err(hba->dev,
>   "hba->outstanding_reqs = 0x%x, hba->outstanding_tasks = 0x%x",
>   (u32)hba->outstanding_reqs, (u32)hba->outstanding_tasks);
> + dev_err(hba->dev,
> + "last_hibern8_exit_tstamp at %lld us, hibern8_exit_cnt = %d",

etc...

--
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 v2 1/4] mpt3sas: Added print to notify cable running at a degraded speed.

2017-01-20 Thread Joe Perches
On Fri, 2017-01-20 at 20:12 +0530, Chaitra P B wrote:
> Driver processes the event MPI26_EVENT_ACTIVE_CABLE_DEGRADED
> when a cable is present and is running at a degraded speed
> (below the SAS3 12 Gb/s rate). Prints added
> to inform the user that the cable is not running at
> optimal speed.
[]
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
> b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
[]
> @@ -8028,15 +8028,23 @@ mpt3sas_scsih_event_callback(struct MPT3SAS_ADAPTER 
> *ioc, u8 msix_index,
>   case MPI2_EVENT_ACTIVE_CABLE_EXCEPTION:
>   ActiveCableEventData =
>   (Mpi26EventDataActiveCableExcept_t *) mpi_reply->EventData;
> - if (ActiveCableEventData->ReasonCode ==
> - MPI26_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER) {
> - pr_info(MPT3SAS_FMT "Currently an active cable with 
> ReceptacleID %d",
> + switch (ActiveCableEventData->ReasonCode) {
> + case MPI26_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER:
> + pr_info(MPT3SAS_FMT "Currently an active cable with 
> ReceptacleID %d\n",
>   ioc->name, ActiveCableEventData->ReceptacleID);
> - pr_info("cannot be powered and devices connected to 
> this active cable");
> - pr_info("will not be seen. This active cable");
> - pr_info("requires %d mW of power",
> + pr_info(" cannot be powered and devices connected 
> to\n");
> + pr_info(" this active cable will not be seen. This\n");
> + pr_info(" cable requires %d mW of power\n",

Can you please use more intelligible logging
where sentences are not broken across multiple
lines of output?  Something like:

pr_notice(MPT3SAS_FMT "Receptacle ID %d: This active 
cable requires %d mW of power\n",
  ioc->name, ActiveCableEventData->ReceptacleID,
  
ActiveCableEventData->ActiveCablePowerRequirement);
pr_notice(MPT3SAS_FMT "Receptacle ID %d: Devices 
connected to this active cable will not be seen\n",
  ioc->name, 
ActiveCableEventData->ReceptacleID);

I believe MPT3SAS_FMT is unnecessary obfuscation and
it should just be replaced by "%s: " everywhere.

--
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 v2 1/4] mpt3sas: Added print to notify cable running at a degraded speed.

2017-01-20 Thread Joe Perches
On Fri, 2017-01-20 at 09:55 -0800, Joe Perches wrote:
> I believe MPT3SAS_FMT is unnecessary obfuscation and
> it should just be replaced by "%s: " everywhere.

Here's a trivial command that could be used one day:

$ git grep --name-only MPT3SAS_FMT -- "*.c" | \
  xargs perl -p -i -e 'local $/; while (<>) { s/\bMPT3SAS_FMT\s*"/"%s: /g; 
print; }'
--
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] net-next: treewide use is_vlan_dev() helper function.

2017-02-03 Thread Joe Perches
On Fri, 2017-02-03 at 22:26 -0600, Parav Pandit wrote:
> This patch makes use of is_vlan_dev() function instead of flag
> comparison which is exactly done by is_vlan_dev() helper function.

Thanks.

btw:  after applying this patch, there is one left

$ git grep -E -n "&\s*IFF_802_1Q_VLAN\b" -- "*.c"
drivers/net/ethernet/chelsio/cxgb4/l2t.c:435:   if (neigh->dev->priv_flags & 
IFF_802_1Q_VLAN)



Re: [RFC 19/19] checkpatch: warn for use of old PCI pool API

2017-02-08 Thread Joe Perches
On Wed, 2017-02-08 at 19:55 +0100, Peter Senna Tschudin wrote:
> On Wed, Feb 08, 2017 at 05:34:57PM +0100, Romain Perier wrote:
> > pci_pool_*() functions should be replaced by the corresponding functions
> > in the DMA pool API. This adds support to check for use of these pci
> > functions and display a warning when it is the case.
> 
> Don't know if relevant, but did not catch the struct. Other than that
> works fine.
> 
> > 
> > Signed-off-by: Romain Perier 
> > ---
> >  scripts/checkpatch.pl | 5 +
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 8e96af5..026920e 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -6058,6 +6058,11 @@ sub process {
> > WARN("USE_DEVICE_INITCALL",
> >  "please use device_initcall() or more appropriate 
> > function instead of __initcall() (see include/linux/init.h)\n" . $herecurr);
> > }
> > +# check for old PCI api pci_pool_*(), use dma_pool_*() instead
> > +   if ($line =~ /\bpci_pool_.+\(/) {
> > +   WARN("USE_PCI_POOL",
> > +"please use the dma pool api or more appropriate 
> > function instead of the old pci pool api\n" . $herecurr);
> > +   }
> >  
> >  # check for various structs that are normally const (ops, kgdb, 
> > device_tree)
> > if ($line !~ /\bconst\b/ &&
> > -- 
> > 2.9.3
> > 

Did this patch get to lkml?

Perhaps this would be more complete:

 scripts/checkpatch.pl | 9 +
 1 file changed, 9 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 8e96af53611c..600f81cc1ec1 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6059,6 +6059,15 @@ sub process {
     "please use device_initcall() or more appropriate 
function instead of __initcall() (see include/linux/init.h)\n" . $herecurr);
    }
 
+# check for old PCI api pci_pool_*(), use dma_pool_*() instead
+   if ($line =~ 
/\bpci_pool(?:_(?:create|destroy|alloc|zalloc|free)|)\b/) {
+   if (WARN("USE_DMA_POOL",
+    "please use the dma pool api or more 
appropriate function instead of the old pci pool api\n" . $herecurr) &&
+   $fix) {
+   while ($fixed[$fixlinenr] =~ 
s/\bpci_pool(_(?:create|destroy|alloc|zalloc|free)|)\b/dma_pool$1/) {}
+   }
+   }
+
 # check for various structs that are normally const (ops, kgdb, device_tree)
    if ($line !~ /\bconst\b/ &&
    $line =~ /\bstruct\s+($const_structs)\b/) {



[PATCH 29/35] drivers/scsi: Convert remaining use of pr_warning to pr_warn

2017-02-16 Thread Joe Perches
To enable eventual removal of pr_warning

This makes pr_warn use consistent for drivers/scsi

Prior to this patch, there was 1 use of pr_warning and
96 uses of pr_warn in drivers/scsi

Signed-off-by: Joe Perches 
---
 drivers/scsi/a3000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index e6375b4de79e..2be0f577abbf 100644
--- a/drivers/scsi/a3000.c
+++ b/drivers/scsi/a3000.c
@@ -38,7 +38,7 @@ static irqreturn_t a3000_intr(int irq, void *data)
spin_unlock_irqrestore(instance->host_lock, flags);
return IRQ_HANDLED;
}
-   pr_warning("Non-serviced A3000 SCSI-interrupt? ISTR = %02x\n", status);
+   pr_warn("Non-serviced A3000 SCSI-interrupt? ISTR = %02x\n", status);
return IRQ_NONE;
 }
 
-- 
2.10.0.rc2.1.g053435c



[PATCH 00/35] treewide trivial patches converting pr_warning to pr_warn

2017-02-16 Thread Joe Perches
There are ~4300 uses of pr_warn and ~250 uses of the older
pr_warning in the kernel source tree.

Make the use of pr_warn consistent across all kernel files.

This excludes all files in tools/ as there is a separate
define pr_warning for that directory tree and pr_warn is
not used in tools/.

Done with 'sed s/\bpr_warning\b/pr_warn/' and some emacsing.

Miscellanea:

o Coalesce formats and realign arguments

Some files not compiled - no cross-compilers

Joe Perches (35):
  alpha: Convert remaining uses of pr_warning to pr_warn
  ARM: ep93xx: Convert remaining uses of pr_warning to pr_warn
  arm64: Convert remaining uses of pr_warning to pr_warn
  arch/blackfin: Convert remaining uses of pr_warning to pr_warn
  ia64: Convert remaining use of pr_warning to pr_warn
  powerpc: Convert remaining uses of pr_warning to pr_warn
  sh: Convert remaining uses of pr_warning to pr_warn
  sparc: Convert remaining use of pr_warning to pr_warn
  x86: Convert remaining uses of pr_warning to pr_warn
  drivers/acpi: Convert remaining uses of pr_warning to pr_warn
  block/drbd: Convert remaining uses of pr_warning to pr_warn
  gdrom: Convert remaining uses of pr_warning to pr_warn
  drivers/char: Convert remaining use of pr_warning to pr_warn
  clocksource: Convert remaining use of pr_warning to pr_warn
  drivers/crypto: Convert remaining uses of pr_warning to pr_warn
  fmc: Convert remaining use of pr_warning to pr_warn
  drivers/gpu: Convert remaining uses of pr_warning to pr_warn
  drivers/ide: Convert remaining uses of pr_warning to pr_warn
  drivers/input: Convert remaining uses of pr_warning to pr_warn
  drivers/isdn: Convert remaining uses of pr_warning to pr_warn
  drivers/macintosh: Convert remaining uses of pr_warning to pr_warn
  drivers/media: Convert remaining use of pr_warning to pr_warn
  drivers/mfd: Convert remaining uses of pr_warning to pr_warn
  drivers/mtd: Convert remaining uses of pr_warning to pr_warn
  drivers/of: Convert remaining uses of pr_warning to pr_warn
  drivers/oprofile: Convert remaining uses of pr_warning to pr_warn
  drivers/platform: Convert remaining uses of pr_warning to pr_warn
  drivers/rapidio: Convert remaining use of pr_warning to pr_warn
  drivers/scsi: Convert remaining use of pr_warning to pr_warn
  drivers/sh: Convert remaining use of pr_warning to pr_warn
  drivers/tty: Convert remaining uses of pr_warning to pr_warn
  drivers/video: Convert remaining uses of pr_warning to pr_warn
  kernel/trace: Convert remaining uses of pr_warning to pr_warn
  lib: Convert remaining uses of pr_warning to pr_warn
  sound/soc: Convert remaining uses of pr_warning to pr_warn

 arch/alpha/kernel/perf_event.c |  4 +-
 arch/arm/mach-ep93xx/core.c|  4 +-
 arch/arm64/include/asm/syscall.h   |  8 ++--
 arch/arm64/kernel/hw_breakpoint.c  |  8 ++--
 arch/arm64/kernel/smp.c|  4 +-
 arch/blackfin/kernel/nmi.c |  2 +-
 arch/blackfin/kernel/ptrace.c  |  2 +-
 arch/blackfin/mach-bf533/boards/stamp.c|  2 +-
 arch/blackfin/mach-bf537/boards/cm_bf537e.c|  2 +-
 arch/blackfin/mach-bf537/boards/cm_bf537u.c|  2 +-
 arch/blackfin/mach-bf537/boards/stamp.c|  2 +-
 arch/blackfin/mach-bf537/boards/tcm_bf537.c|  2 +-
 arch/blackfin/mach-bf561/boards/cm_bf561.c |  2 +-
 arch/blackfin/mach-bf561/boards/ezkit.c|  2 +-
 arch/blackfin/mm/isram-driver.c|  4 +-
 arch/ia64/kernel/setup.c   |  6 +--
 arch/powerpc/kernel/pci-common.c   |  4 +-
 arch/powerpc/mm/init_64.c  |  5 +--
 arch/powerpc/mm/mem.c  |  3 +-
 arch/powerpc/platforms/512x/mpc512x_shared.c   |  4 +-
 arch/powerpc/platforms/85xx/socrates_fpga_pic.c|  7 ++--
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |  2 +-
 arch/powerpc/platforms/pasemi/dma_lib.c|  4 +-
 arch/powerpc/platforms/powernv/opal.c  |  8 ++--
 arch/powerpc/platforms/powernv/pci-ioda.c  | 10 ++---
 arch/powerpc/platforms/ps3/device-init.c   | 14 +++
 arch/powerpc/platforms/ps3/mm.c|  4 +-
 arch/powerpc/platforms/ps3/os-area.c   |  2 +-
 arch/powerpc/platforms/pseries/iommu.c |  8 ++--
 arch/powerpc/platforms/pseries/setup.c |  4 +-
 arch/powerpc/sysdev/fsl_pci.c  |  9 ++---
 arch/powerpc/sysdev/mpic.c | 10 ++---
 arch/powerpc/sysdev/xics/icp-native.c  | 10 ++---
 arch/powerpc/sysdev/xics/ics-opal.c|  4 +-
 arch/powerpc/sysdev/xics/ics-rtas.c|  4 +-
 arch/powerpc/sysdev/xics/xics-common.c |  8 ++--
 arch/sh/boards/mach-sdk7786/nmi.c  |  2 +-
 arch/sh/drivers/pci/fixups-sdk7786.c   |  2 +-
 arch/sh/kernel/io

Re: [PATCH 00/35] treewide trivial patches converting pr_warning to pr_warn

2017-02-23 Thread Joe Perches
On Thu, 2017-02-23 at 09:28 -0600, Rob Herring wrote:
> On Fri, Feb 17, 2017 at 1:11 AM, Joe Perches  wrote:
> > There are ~4300 uses of pr_warn and ~250 uses of the older
> > pr_warning in the kernel source tree.
> > 
> > Make the use of pr_warn consistent across all kernel files.
> > 
> > This excludes all files in tools/ as there is a separate
> > define pr_warning for that directory tree and pr_warn is
> > not used in tools/.
> > 
> > Done with 'sed s/\bpr_warning\b/pr_warn/' and some emacsing.
[]
> Where's the removal of pr_warning so we don't have more sneak in?

After all of these actually get applied,
and maybe a cycle or two later, one would
get sent.



Re: [PATCH 00/35] treewide trivial patches converting pr_warning to pr_warn

2017-02-23 Thread Joe Perches
On Thu, 2017-02-23 at 17:41 +, Emil Velikov wrote:
> On 23 February 2017 at 17:18, Joe Perches  wrote:
> > On Thu, 2017-02-23 at 09:28 -0600, Rob Herring wrote:
> > > On Fri, Feb 17, 2017 at 1:11 AM, Joe Perches  wrote:
> > > > There are ~4300 uses of pr_warn and ~250 uses of the older
> > > > pr_warning in the kernel source tree.
> > > > 
> > > > Make the use of pr_warn consistent across all kernel files.
> > > > 
> > > > This excludes all files in tools/ as there is a separate
> > > > define pr_warning for that directory tree and pr_warn is
> > > > not used in tools/.
> > > > 
> > > > Done with 'sed s/\bpr_warning\b/pr_warn/' and some emacsing.
> > 
> > []
> > > Where's the removal of pr_warning so we don't have more sneak in?
> > 
> > After all of these actually get applied,
> > and maybe a cycle or two later, one would
> > get sent.
> > 
> 
> By which point you'll get a few reincarnation of it. So you'll have to
> do the same exercise again :-(

Maybe to one or two files.  Not a big deal.

> I guess the question is - are you expecting to get the series merged
> all together/via one tree ?

No.  The only person that could do that effectively is Linus.

> If not, your plan is perfectly reasonable.



Re: [PATCH v3 20/20] checkpatch: warn for use of old PCI pool API

2017-02-27 Thread Joe Perches
On Mon, 2017-02-27 at 12:22 +0100, Peter Senna Tschudin wrote:
> On Sun, Feb 26, 2017 at 08:24:25PM +0100, Romain Perier wrote:
> > pci_pool_*() functions should be replaced by the corresponding functions
> > in the DMA pool API. This adds support to check for use of these pci
> > functions and display a warning when it is the case.
> > 
> 
> I guess Joe Perches did sent some comments for this one, did you address
> them?


> Reviewed-by: Peter Senna Tschudin 
> > Signed-off-by: Romain Perier 
> > ---
> >  scripts/checkpatch.pl | 9 -
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index baa3c7b..f2c775c 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -6064,7 +6064,14 @@ sub process {
> > WARN("USE_DEVICE_INITCALL",
> >  "please use device_initcall() or more appropriate 
> > function instead of __initcall() (see include/linux/init.h)\n" . $herecurr);
> > }
> > -
> > +# check for old PCI api pci_pool_*(), use dma_pool_*() instead
> > +   if ($line =~ 
> > /\bpci_pool(?:_(?:create|destroy|alloc|zalloc|free)|)\b/) {
> > +   if (WARN("USE_DMA_POOL",
> > +"please use the dma pool api or more 
> > appropriate function instead of the old pci pool api\n" . $herecurr) &&
> > +   $fix) {
> > +   while ($fixed[$fixlinenr] =~ 
> > s/\bpci_pool(_(?:create|destroy|alloc|zalloc|free)|)\b/dma_pool$1/) {}
> > +   }
> > +   }
> >  # check for various structs that are normally const (ops, kgdb, 
> > device_tree)
> > if ($line !~ /\bconst\b/ &&
> > $line =~ /\bstruct\s+($const_structs)\b/) {
> > 

This is nearly identical to the suggestion that I
sent but this is slightly misformatted as it does
not have a leading nor a trailing blank line to
separate the test blocks.

Also, I think none of the patches have reached lkml.

Romain, are you using git-send-email to send these
patches?  Perhaps the patches you send also contain
html which are rejected by the mailing list.



Re: [PATCH v3 20/20] checkpatch: warn for use of old PCI pool API

2017-02-27 Thread Joe Perches
On Mon, 2017-02-27 at 13:26 +0100, Romain Perier wrote:
> Hello,
> 
> 
> Le 27/02/2017 à 12:22, Peter Senna Tschudin a écrit :
> > On Sun, Feb 26, 2017 at 08:24:25PM +0100, Romain Perier wrote:
> > > pci_pool_*() functions should be replaced by the corresponding functions
> > > in the DMA pool API. This adds support to check for use of these pci
> > > functions and display a warning when it is the case.
> > > 
> > 
> > I guess Joe Perches did sent some comments for this one, did you address
> > them?
> 
> See the changelog of 00/20 (for v2). I have already integrated his
> comments :)

Not quite.  You need to add blank lines before and after
the new test you added.

I also wonder if you've in fact converted all of the
pci_pool struct and function uses why a new checkpatch
test is needed at all.

Also, it seems none of these patches have reached lkml.
Are you sending the patch series with MIME/html parts?  

> > Reviewed-by: Peter Senna Tschudin 
> > > Signed-off-by: Romain Perier 
> > > ---
> > >  scripts/checkpatch.pl | 9 -
> > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > index baa3c7b..f2c775c 100755
> > > --- a/scripts/checkpatch.pl
> > > +++ b/scripts/checkpatch.pl
> > > @@ -6064,7 +6064,14 @@ sub process {
> > >   WARN("USE_DEVICE_INITCALL",
> > >"please use device_initcall() or more appropriate 
> > > function instead of __initcall() (see include/linux/init.h)\n" . 
> > > $herecurr);
> > >   }
> > > -
> > > +# check for old PCI api pci_pool_*(), use dma_pool_*() instead
> > > + if ($line =~ 
> > > /\bpci_pool(?:_(?:create|destroy|alloc|zalloc|free)|)\b/) {
> > > + if (WARN("USE_DMA_POOL",
> > > +  "please use the dma pool api or more 
> > > appropriate function instead of the old pci pool api\n" . $herecurr) &&
> > > + $fix) {
> > > + while ($fixed[$fixlinenr] =~ 
> > > s/\bpci_pool(_(?:create|destroy|alloc|zalloc|free)|)\b/dma_pool$1/) {}
> > > + }
> > > + }
> > >  # check for various structs that are normally const (ops, kgdb, 
> > > device_tree)
> > >   if ($line !~ /\bconst\b/ &&
> > >   $line =~ /\bstruct\s+($const_structs)\b/) {
> > > -- 
> > > 2.9.3


Re: [PATCH v3 20/20] checkpatch: warn for use of old PCI pool API

2017-02-27 Thread Joe Perches
On Mon, 2017-02-27 at 13:52 +0100, Romain Perier wrote:

> > I also wonder if you've in fact converted all of the
> > pci_pool struct and function uses why a new checkpatch
> > test is needed at all.
> 
> That's just to avoid futures mistakes/uses.

When all instances and macro definitions are removed
the check is pointless as any newly submitted patch
will not compile.



Re: [PATCH v4 00/19] Replace PCI pool by DMA pool API

2017-03-01 Thread Joe Perches
On Wed, 2017-03-01 at 16:55 +0100, Romain Perier wrote:
> support to warn about this old API in checkpath.pl

checkpatch

This part isn't true anymore, but it seems sensible enough, thanks.



[PATCH] qla2xxx: Fix ql_dump_buffer

2017-03-02 Thread Joe Perches
Recent printk changes for KERN_CONT cause this logging to be
defectively emitted on multiple lines.  Fix it.

Also reduces object size a trivial amount.

$ size drivers/scsi/qla2xxx/qla_dbg.o*
   textdata bss dec hex filename
  39125   0   0   3912598d5 drivers/scsi/qla2xxx/qla_dbg.o.new
  39164   0   0   3916498fc drivers/scsi/qla2xxx/qla_dbg.o.old

Signed-off-by: Joe Perches 
---
 drivers/scsi/qla2xxx/qla_dbg.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 21d9fb7fc887..51b4179469d1 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -2707,13 +2707,9 @@ ql_dump_buffer(uint32_t level, scsi_qla_host_t *vha, 
int32_t id,
"%-+5d  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F\n", size);
ql_dbg(level, vha, id,
"- ---\n");
-   for (cnt = 0; cnt < size; cnt++, buf++) {
-   if (cnt % 16 == 0)
-   ql_dbg(level, vha, id, "%04x:", cnt & ~0xFU);
-   printk(" %02x", *buf);
-   if (cnt % 16 == 15)
-   printk("\n");
+   for (cnt = 0; cnt < size; cnt += 16) {
+   ql_dbg(level, vha, id, "%04x: ", cnt);
+   print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1,
+  buf + cnt, min(16U, size - cnt), false);
}
-   if (cnt % 16 != 0)
-   printk("\n");
 }
-- 
2.10.0.rc2.1.g053435c



[PATCH] scsi: qedf: Fix defective logging format and argument mismatches

2017-03-04 Thread Joe Perches
Add __printf compiler verification of format and arguments.
Fix fallout.

Signed-off-by: Joe Perches 
---
 drivers/scsi/qedf/qedf_dbg.h | 13 -
 drivers/scsi/qedf/qedf_fip.c |  2 +-
 drivers/scsi/qedf/qedf_io.c  |  4 ++--
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_dbg.h b/drivers/scsi/qedf/qedf_dbg.h
index 23bd70628a2f..7d173f48a81e 100644
--- a/drivers/scsi/qedf/qedf_dbg.h
+++ b/drivers/scsi/qedf/qedf_dbg.h
@@ -81,14 +81,17 @@ struct qedf_dbg_ctx {
 #define QEDF_INFO(pdev, level, fmt, ...)   \
qedf_dbg_info(pdev, __func__, __LINE__, level, fmt, \
  ## __VA_ARGS__)
-
-extern void qedf_dbg_err(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
+__printf(4, 5)
+void qedf_dbg_err(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
  const char *fmt, ...);
-extern void qedf_dbg_warn(struct qedf_dbg_ctx *qedf, const char *func, u32 
line,
+__printf(4, 5)
+void qedf_dbg_warn(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
   const char *, ...);
-extern void qedf_dbg_notice(struct qedf_dbg_ctx *qedf, const char *func,
+__printf(4, 5)
+void qedf_dbg_notice(struct qedf_dbg_ctx *qedf, const char *func,
u32 line, const char *, ...);
-extern void qedf_dbg_info(struct qedf_dbg_ctx *qedf, const char *func, u32 
line,
+__printf(5, 6)
+void qedf_dbg_info(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
  u32 info, const char *fmt, ...);
 
 /* GRC Dump related defines */
diff --git a/drivers/scsi/qedf/qedf_fip.c b/drivers/scsi/qedf/qedf_fip.c
index 868d423380d1..ed58b9104f58 100644
--- a/drivers/scsi/qedf/qedf_fip.c
+++ b/drivers/scsi/qedf/qedf_fip.c
@@ -203,7 +203,7 @@ void qedf_fip_recv(struct qedf_ctx *qedf, struct sk_buff 
*skb)
case FIP_DT_MAC:
mp = (struct fip_mac_desc *)desc;
QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2,
-   "fd_mac=%pM.\n", __func__, mp->fd_mac);
+   "fd_mac=%pM\n", mp->fd_mac);
ether_addr_copy(cvl_mac, mp->fd_mac);
break;
case FIP_DT_NAME:
diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c
index ee0dcf9d3aba..46debe5034af 100644
--- a/drivers/scsi/qedf/qedf_io.c
+++ b/drivers/scsi/qedf/qedf_io.c
@@ -1342,7 +1342,7 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct 
fcoe_cqe *cqe,
} else {
refcount = kref_read(&io_req->refcount);
QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO,
-   "%d:0:%d:%d xid=0x%0x op=0x%02x "
+   "%d:0:%d:%lld xid=0x%0x op=0x%02x "
"lba=%02x%02x%02x%02x cdb_status=%d "
"fcp_resid=0x%x refcount=%d.\n",
qedf->lport->host->host_no, sc_cmd->device->id,
@@ -1426,7 +1426,7 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct 
qedf_ioreq *io_req,
 
sc_cmd->result = result << 16;
refcount = kref_read(&io_req->refcount);
-   QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "%d:0:%d:%d: Completing "
+   QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "%d:0:%d:%lld: Completing "
"sc_cmd=%p result=0x%08x op=0x%02x lba=0x%02x%02x%02x%02x, "
"allowed=%d retries=%d refcount=%d.\n",
qedf->lport->host->host_no, sc_cmd->device->id,
-- 
2.10.0.rc2.1.g053435c



Re: [PATCH] scsi: qedf: Fix defective logging format and argument mismatches

2017-03-06 Thread Joe Perches
On Tue, 2017-03-07 at 02:03 +0800, kbuild test robot wrote:
> Hi Joe,

Hi again Fengguang's robot.

> [auto build test WARNING on scsi/for-next]
> [also build test WARNING on v4.11-rc1 next-20170306]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Joe-Perches/scsi-qedf-Fix-defective-logging-format-and-argument-mismatches/20170307-005400
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
> config: parisc-allmodconfig (attached as .config)
> compiler: hppa-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705

Not new messages.



[PATCH] scsi: qedf: Use vsprintf extension %pad

2017-03-06 Thread Joe Perches
Using %llx for a dma_addr_t can lead to format/argument mismatches.
Use %pad and the address of the dma_addr_t instead.

Signed-off-by: Joe Perches 
---
 drivers/scsi/qedf/qedf_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index d9d7a86b5f8b..8e2a160490e6 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -2456,8 +2456,8 @@ static int qedf_alloc_bdq(struct qedf_ctx *qedf)
}
 
QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
-   "BDQ PBL addr=0x%p dma=0x%llx.\n", qedf->bdq_pbl,
-   qedf->bdq_pbl_dma);
+ "BDQ PBL addr=0x%p dma=%pad\n",
+ qedf->bdq_pbl, &qedf->bdq_pbl_dma);
 
/*
 * Populate BDQ PBL with physical and virtual address of individual
-- 
2.10.0.rc2.1.g053435c



Re: [PATCH] scsi: qedf: Fix defective logging format and argument mismatches

2017-03-06 Thread Joe Perches
On Mon, 2017-03-06 at 10:17 -0800, Joe Perches wrote:
> On Tue, 2017-03-07 at 02:03 +0800, kbuild test robot wrote:
> > Hi Joe,
> 
> Hi again Fengguang's robot.

Rehi.  OK, it is a new message.  Patch sent.



Re: [PATCH 0/25] Replace DEFINE_PCI_DEVICE_TABLE macro use

2014-07-18 Thread Joe Perches
On Fri, 2014-07-18 at 09:43 -0700, Greg KH wrote:
> On Fri, Jul 18, 2014 at 12:22:13PM -0400, John W. Linville wrote:
> > On Fri, Jul 18, 2014 at 05:26:47PM +0200, Benoit Taine wrote:
> > > We should prefer `const struct pci_device_id` over
> > > `DEFINE_PCI_DEVICE_TABLE` to meet kernel coding style guidelines.
> > > This issue was reported by checkpatch.
> >  scripts/checkpatch.pl | 4 ++--
> > Honestly, I prefer the macro -- it stands-out more.  Maybe the style
> > guidelines and/or checkpatch should change instead?
> 
> The macro is horrid, no other bus has this type of thing just to save a
> few characters in typing, so why should PCI be "special" in this regard
> anymore?

I think it doesn't matter much.

The PCI_DEVICE and PCI_VDEVICE macro uses are somewhat similar
and are frequently used with PCI_DEVICE_TABLE, so there's some
commonality there.

The checkpatch message could be made --strict/CHK instead of
WARN so most people would never see it.

Of course it could be removed altogether too.  I don't care.
---
(suggested patch is for -next)

 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index dc72a9b..754fbf2 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3018,8 +3018,8 @@ sub process {
 
 # check for uses of DEFINE_PCI_DEVICE_TABLE
if ($line =~ /\bDEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=/) 
{
-   if (WARN("DEFINE_PCI_DEVICE_TABLE",
-"Prefer struct pci_device_id over deprecated 
DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) &&
+   if (CHK("DEFINE_PCI_DEVICE_TABLE",
+   "Prefer struct pci_device_id over deprecated 
DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~ 
s/\b(?:static\s+|)DEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=\s*/static const 
struct pci_device_id $1\[\] = /;
}


--
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 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
> > board_disable work by qla2x00_check_reg{32,16}_for_disconnect:
> >
> > * Leave the driver-specific data attached to the underlying PCI device
> > intact in qla2x00_disable_board_on_pci_error, so that qla2x00_remove_one
> > has enough breadcrumbs to determine that any board_disable work has been
> > completed.
> >
> > * In qla2xxx_remove_one, set a bit to prevent any subsequent
> > board_disable work from scheduling, then cancel and wait until pending
> > work has completed.
> >
> > * Reuse 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 
> > ---
> > drivers/scsi/qla2xxx/qla_def.h |1 +
> > drivers/scsi/qla2xxx/qla_isr.c |3 ++-
> > drivers/scsi/qla2xxx/qla_os.c  |   31 +++
> > 3 files changed, 22 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
> > index 1267b11..7c441c9 100644
> > --- a/drivers/scsi/qla2xxx/qla_def.h
> > +++ b/drivers/scsi/qla2xxx/qla_def.h
> > @@ -3404,6 +3404,7 @@ typedef struct scsi_qla_host {
> >
> > unsigned long   pci_flags;
> > #define PFLG_DISCONNECTED   0   /* PCI device removed */
> > +#define PFLG_DRIVER_REMOVING   1   /* PCI driver .remove */
> >
> > uint32_tdevice_flags;
> > #define SWITCH_FOUNDBIT_0
> > diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
> > index 2741ad8..ee5eef4 100644
> > --- a/drivers/scsi/qla2xxx/qla_isr.c
> > +++ b/drivers/scsi/qla2xxx/qla_isr.c
> > @@ -117,7 +117,8 @@ qla2x00_check_reg32_for_disconnect(scsi_qla_host_t 
> > *vha, uint32_t reg)
> > {
> > /* Check for PCI disconnection */
> > if (reg == 0x) {
> > -   if (!test_and_set_bit(PFLG_DISCONNECTED, &vha->pci_flags)) {
> > +   if (!test_and_set_bit(PFLG_DISCONNECTED, &vha->pci_flags) &&
> > +   !test_bit(PFLG_DRIVER_REMOVING, &vha->pci_flags)) {
> 
> In our remove function we set a bit that we are unloading:
> 
> set_bit (UNLOADING, &base_vha->dpc_flags);
> 
> could this be used instead?

Hi Chad,

Thanks for the comments.

I think with a little bit of code shuffling this could be accomplished.
My goal with the patchset was to try and present the problem/fix as
plain as possible.  It was easiest to collect all the atomic bits I
needed inside a single variable.  Should I be tacking on such flags to
'dpc_flags' ?

> 
> > /*
> >  * Schedule this (only once) on the default system
> >  * workqueue so that all the adapter workqueues and the
> > diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> > index 39c9953..51cba37 100644
> > --- a/drivers/scsi/qla2xxx/qla_os.c
> > +++ b/drivers/scsi/qla2xxx/qla_os.c
> > @@ -3123,15 +3123,25 @@ qla2x00_remove_one(struct pci_dev *pdev)
> > scsi_qla_host_t *base_vha;
> > struct qla_hw_data  *ha;
> >
> > +   base_vha = pci_get_drvdata(pdev);
> > +   ha = base_vha->hw;
> > +
> > +   /* Indicate device removal to prevent future board_disable and wait
> > +* until any pending board_disable has completed. */
> > +   set_bit(PFLG_DRIVER_REMOVING, &base_vha->pci_flags);
> > +   cancel_work_sync(&ha->board_disable);
> > +
> > /*
> > -* If the PCI device is disabled that means that probe failed and any
> > -* resources should be have cleaned up on probe exit.
> > +* If the PCI device is disabled then there was a PCI-disconnect and
> > +* qla2x00_disable_board_on_pci_error has taken care of most of the
> > +* resources.
> >  */
> > -   if (!atomic_read(&pdev->enable_cnt))
> > +   if (!atomic_read(&pdev->enable_cnt)) {
> 
> Should we also add a check here that this is a disconnection before 
> freeing these structs?  The original intent of the check for 
> pdev->enable_cnt is to make sure we don't try to dereference an already 
> freed struct if probe failed.

I'm not exactly

RE: Bad tag value in scsi-mq.4

2014-08-05 Thread Handzik, Joe
Yeah, we thought about that one. We call scsi_activate_tcq if our scsi_device 
has tagged_supported set within hpsa_change_queue_type (our .change_queue_type 
entry into the scsi_host_template). Also made sure I was booting with the 
"scsi_mod.use_blk_mq=Y" option, which makes no difference either way.

-Original Message-
From: h...@infradead.org [mailto:h...@infradead.org] 
Sent: Tuesday, August 05, 2014 2:28 PM
To: Handzik, Joe
Cc: h...@infradead.org; linux-scsi@vger.kernel.org; 
scame...@beardog.cce.hp.com; Scales, Webb; Teel, Scott Stacy
Subject: Re: Bad tag value in scsi-mq.4

On Tue, Aug 05, 2014 at 06:04:07PM +, Handzik, Joe wrote:
> Hey Christoph,
> 
> Using the scsi-mq.4 branch from git://git.infradead.org/users/hch/scsi.git, 
> I'm getting a -1 returned from from scsi_cmnd->request->tag...very unsure why 
> that would be. It happens without any drives attached to the controller, not 
> sure if that's relevant in any way.

You're using the non-mq code path, in which tagging needs to be enabled,
does your driver call scsi_activate_tcq?

--
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: [RESEND][PATCH 07/10][SCSI]mpt2sas: Added Reply Descriptor Post Queue (RDPQ) Array support

2014-08-12 Thread Joe Perches
On Tue, 2014-08-12 at 14:54 +0530, Sreekanth Reddy wrote:
> So, the proposal is to allocate memory independently for each
> Reply Queue and pass down all of the addresses to the firmware.
> Then the firmware will just take each address and program the value
> into the correct register.

trivial note:

> diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c 
> b/drivers/scsi/mpt2sas/mpt2sas_base.c
[]
> @@ -1179,17 +1184,22 @@ static int
>  _base_config_dma_addressing(struct MPT2SAS_ADAPTER *ioc, struct pci_dev 
> *pdev)
>  {
>   struct sysinfo s;
> - char *desc = NULL;
> + u64 consistent_dma_mask;
> +
> + if (dma_mask)
> + consistent_dma_mask = DMA_BIT_MASK(64);
> + else
> + consistent_dma_mask = DMA_BIT_MASK(32);
>  
>   if (sizeof(dma_addr_t) > 4) {
>   const uint64_t required_mask =
>   dma_get_required_mask(&pdev->dev);
>   if ((required_mask > DMA_BIT_MASK(32)) && 
> !pci_set_dma_mask(pdev,
>   DMA_BIT_MASK(64)) && !pci_set_consistent_dma_mask(pdev,
> - DMA_BIT_MASK(64))) {
> + consistent_dma_mask)) {

This would be easier to read if the embedded functions
within the if were on separate lines like:

if ((required_mask > DMA_BIT_MASK(32)) &&
!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
!pci_set_consistent_dma_mask(pdev, consistent_dma_mask)) {


--
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: Bad tag value in scsi-mq.4

2014-08-19 Thread Handzik, Joe
I may take a look again, but was able to get this working on my Rhel7 box (with 
the kernel boot parameter present). So I either consistently used an earlier 
version of GRUB incorrectly (possible, maybe when I double checked my boot 
parameters in the earlier version I somehow reset to defaults?) or found some 
strange bug. I'm not too concerned, since other members of the team haven't had 
problems and have been using the SCSI mq code more than I have. Sorry for the 
false alarm!

Joe

-Original Message-
From: h...@infradead.org [mailto:h...@infradead.org] 
Sent: Tuesday, August 19, 2014 1:05 PM
To: Handzik, Joe
Cc: h...@infradead.org; linux-scsi@vger.kernel.org; 
scame...@beardog.cce.hp.com; Scales, Webb; Teel, Scott Stacy
Subject: Re: Bad tag value in scsi-mq.4

On Tue, Aug 05, 2014 at 07:47:12PM +, Handzik, Joe wrote:
> Yeah, we thought about that one. We call scsi_activate_tcq if our scsi_device 
> has tagged_supported set within hpsa_change_queue_type (our 
> .change_queue_type entry into the scsi_host_template). Also made sure I was 
> booting with the "scsi_mod.use_blk_mq=Y" option, which makes no difference 
> either way.

Can you add some tracing to catch this?  On the non-mq path requests
start out with ->tag set to -1 and blk_queue_start_tag, which is called
from scsi_request_fn sets it up.  Adding printks in that area should
help you to find the culprit.

--
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 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.  Although the following changes
> may be most interesting on a Stratus platform, they should be applicable
> to general hotplug scenarios on other hardware.
> 
> The first two patches are independent from the others and can be
> reviewed as such.  One fixes up a use-after-free and the other
> consolidates some code.

Patch 1 corrects a bug introduced by commit fe1b806, which has made its
way into three linux-stable releases:

% git tag --contains fe1b806 | grep '^v3.[0-9]*$'
v3.14
v3.15
v3.16

> The final four patches are more invasive and modify the scsi_qla_host
> structure to avoid device removal race conditions.  These changes were
> written to demonstrate the problem at hand and minimally fix them in
> order to continue testing.  (For example, adding completely a new
> pci_flags member to scsi_qla_host is probably overkill.) 
> 
> We would welcome any feedback or questions about our testing.

Chad ack'd the series on 28 Jul 2014.  Any chance this can make into
hch's queue for 3.18?

Regards,

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


[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
  qla2xxx: Schedule board_disable only once
  qla2xxx: Prevent removal and board_disable race
  qla2xxx: Prevent probe and board_disable race

 drivers/scsi/qla2xxx/qla_def.h |5 
 drivers/scsi/qla2xxx/qla_gbl.h |3 +-
 drivers/scsi/qla2xxx/qla_isr.c |   44 +++--
 drivers/scsi/qla2xxx/qla_mr.c  |2 +-
 drivers/scsi/qla2xxx/qla_nx.c  |6 ++--
 drivers/scsi/qla2xxx/qla_os.c  |   60 ++--
 6 files changed, 61 insertions(+), 59 deletions(-)

-- 
1.7.10.4

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


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

2014-08-26 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).

Fixes: fe1b806f4f71 ("qla2xxx: Refactor shutdown code so some functionality can 
be reused") 
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..8252c0e 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -3119,10 +3119,8 @@ qla2x00_unmap_iobases(struct qla_hw_data *ha)
 }
 
 static void
-qla2x00_clear_drv_active(scsi_qla_host_t *vha)
+qla2x00_clear_drv_active(struct qla_hw_data *ha)
 {
-   struct qla_hw_data *ha = vha->hw;
-
if (IS_QLA8044(ha)) {
qla8044_idc_lock(ha);
qla8044_clear_drv_active(ha);
@@ -3193,7 +3191,7 @@ qla2x00_remove_one(struct pci_dev *pdev)
 
scsi_host_put(base_vha->host);
 
-   qla2x00_clear_drv_active(base_vha);
+   qla2x00_clear_drv_active(ha);
 
qla2x00_unmap_iobases(ha);
 
-- 
1.7.10.4

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


[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/qla2xxx/qla_os.c |   13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 8252c0e..53449d7 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -238,6 +238,7 @@ static int qla2xxx_eh_host_reset(struct scsi_cmnd *);
 
 static int qla2x00_change_queue_depth(struct scsi_device *, int, int);
 static int qla2x00_change_queue_type(struct scsi_device *, int);
+static void qla2x00_clear_drv_active(struct qla_hw_data *);
 static void qla2x00_free_device(scsi_qla_host_t *);
 
 struct scsi_host_template qla2xxx_driver_template = {
@@ -2954,16 +2955,8 @@ probe_failed:
scsi_host_put(base_vha->host);
 
 probe_hw_failed:
-   if (IS_QLA82XX(ha)) {
-   qla82xx_idc_lock(ha);
-   qla82xx_clear_drv_active(ha);
-   qla82xx_idc_unlock(ha);
-   }
-   if (IS_QLA8044(ha)) {
-   qla8044_idc_lock(ha);
-   qla8044_clear_drv_active(ha);
-   qla8044_idc_unlock(ha);
-   }
+   qla2x00_clear_drv_active(ha);
+
 iospace_config_failed:
if (IS_P3P_TYPE(ha)) {
if (!ha->nx_pcibase)
-- 
1.7.10.4

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


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

2014-08-26 Thread Joe Lawrence
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 by qla2x00_check_reg{32,16}_for_disconnect:

* Leave the driver-specific data attached to the underlying PCI device
intact in qla2x00_disable_board_on_pci_error, so that qla2x00_remove_one
has enough breadcrumbs to determine that any board_disable work has been
completed.

* In qla2xxx_remove_one, set a bit to prevent any subsequent
board_disable work from scheduling, then cancel and wait until pending
work has completed.

* Reuse 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 
Acked-by: Chad Dupuis 
---
 drivers/scsi/qla2xxx/qla_def.h |1 +
 drivers/scsi/qla2xxx/qla_isr.c |3 ++-
 drivers/scsi/qla2xxx/qla_os.c  |   31 +++
 3 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 4267ec6..1398818 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -3404,6 +3404,7 @@ typedef struct scsi_qla_host {
 
unsigned long   pci_flags;
 #define PFLG_DISCONNECTED  0   /* PCI device removed */
+#define PFLG_DRIVER_REMOVING   1   /* PCI driver .remove */
 
uint32_tdevice_flags;
 #define SWITCH_FOUND   BIT_0
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index fd75b91..341c64d 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -117,7 +117,8 @@ qla2x00_check_reg32_for_disconnect(scsi_qla_host_t *vha, 
uint32_t reg)
 {
/* Check for PCI disconnection */
if (reg == 0x) {
-   if (!test_and_set_bit(PFLG_DISCONNECTED, &vha->pci_flags)) {
+   if (!test_and_set_bit(PFLG_DISCONNECTED, &vha->pci_flags) &&
+   !test_bit(PFLG_DRIVER_REMOVING, &vha->pci_flags)) {
/*
 * Schedule this (only once) on the default system
 * workqueue so that all the adapter workqueues and the
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 3bfa89d..84d4df6 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -3131,15 +3131,25 @@ qla2x00_remove_one(struct pci_dev *pdev)
scsi_qla_host_t *base_vha;
struct qla_hw_data  *ha;
 
+   base_vha = pci_get_drvdata(pdev);
+   ha = base_vha->hw;
+
+   /* Indicate device removal to prevent future board_disable and wait
+* until any pending board_disable has completed. */
+   set_bit(PFLG_DRIVER_REMOVING, &base_vha->pci_flags);
+   cancel_work_sync(&ha->board_disable);
+
/*
-* If the PCI device is disabled that means that probe failed and any
-* resources should be have cleaned up on probe exit.
+* If the PCI device is disabled then there was a PCI-disconnect and
+* qla2x00_disable_board_on_pci_error has taken care of most of the
+* resources.
 */
-   if (!atomic_read(&pdev->enable_cnt))
+   if (!atomic_read(&pdev->enable_cnt)) {
+   scsi_host_put(base_vha->host);
+   kfree(ha);
+   pci_set_drvdata(pdev, NULL);
return;
-
-   base_vha = pci_get_drvdata(pdev);
-   ha = base_vha->hw;
+   }
 
qla2x00_wait_for_hba_ready(base_vha);
 
@@ -4799,18 +4809,15 @@ qla2x00_disable_board_on_pci_error(struct work_struct 
*work)
qla82xx_md_free(base_vha);
qla2x00_free_queues(ha);
 
-   scsi_host_put(base_vha->host);
-
qla2x00_unmap_iobases(ha);
 
pci_release_selected_regions(ha->pdev, ha->bars);
-   kfree(ha);
-   ha = NULL;
-
pci_disable_pcie_error_reporting(pdev);
pci_disable_device(pdev);
-   pci_set_drvdata(pdev, NULL);
 
+   /*
+* Let qla2x00_remove_one cleanup qla_hw_data on device removal.
+*/
 }
 
 /**
-- 
1.7.10.4

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


[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 |3 +++
 drivers/scsi/qla2xxx/qla_isr.c |   14 --
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index b643991..4267ec6 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -3402,6 +3402,9 @@ typedef struct scsi_qla_host {
 #define FX00_CRITEMP_RECOVERY  25
 #define FX00_HOST_INFO_RESEND  26
 
+   unsigned long   pci_flags;
+#define PFLG_DISCONNECTED  0   /* PCI device removed */
+
uint32_tdevice_flags;
 #define SWITCH_FOUND   BIT_0
 #define DFLG_NO_CABLE  BIT_1
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 016ebed..fd75b91 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -117,12 +117,14 @@ qla2x00_check_reg32_for_disconnect(scsi_qla_host_t *vha, 
uint32_t reg)
 {
/* Check for PCI disconnection */
if (reg == 0x) {
-   /*
-* Schedule this on the default system workqueue so that all the
-* adapter workqueues and the DPC thread can be shutdown
-* cleanly.
-*/
-   schedule_work(&vha->hw->board_disable);
+   if (!test_and_set_bit(PFLG_DISCONNECTED, &vha->pci_flags)) {
+   /*
+* Schedule this (only once) on the default system
+* workqueue so that all the adapter workqueues and the
+* DPC thread can be shutdown cleanly.
+*/
+   schedule_work(&vha->hw->board_disable);
+   }
return true;
} else
return false;
-- 
1.7.10.4

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


[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 +---
 drivers/scsi/qla2xxx/qla_mr.c  |2 +-
 drivers/scsi/qla2xxx/qla_nx.c  |6 +++---
 drivers/scsi/qla2xxx/qla_os.c  |8 +---
 5 files changed, 20 insertions(+), 27 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index d646540..43ef0db 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -475,7 +475,8 @@ extern uint8_t *qla25xx_read_nvram_data(scsi_qla_host_t *, 
uint8_t *, uint32_t,
 extern int qla25xx_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
uint32_t);
 extern int qla2x00_is_a_vp_did(scsi_qla_host_t *, uint32_t);
-bool qla2x00_check_reg_for_disconnect(scsi_qla_host_t *, uint32_t);
+bool qla2x00_check_reg32_for_disconnect(scsi_qla_host_t *, uint32_t);
+bool qla2x00_check_reg16_for_disconnect(scsi_qla_host_t *, uint16_t);
 
 extern int qla2x00_beacon_on(struct scsi_qla_host *);
 extern int qla2x00_beacon_off(struct scsi_qla_host *);
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index bea0e74..016ebed 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -56,16 +56,8 @@ qla2100_intr_handler(int irq, void *dev_id)
vha = pci_get_drvdata(ha->pdev);
for (iter = 50; iter--; ) {
hccr = RD_REG_WORD(®->hccr);
-   /* Check for PCI disconnection */
-   if (hccr == 0x) {
-   /*
-* Schedule this on the default system workqueue so that
-* all the adapter workqueues and the DPC thread can be
-* shutdown cleanly.
-*/
-   schedule_work(&ha->board_disable);
+   if (qla2x00_check_reg16_for_disconnect(vha, hccr))
break;
-   }
if (hccr & HCCR_RISC_PAUSE) {
if (pci_channel_offline(ha->pdev))
break;
@@ -121,7 +113,7 @@ qla2100_intr_handler(int irq, void *dev_id)
 }
 
 bool
-qla2x00_check_reg_for_disconnect(scsi_qla_host_t *vha, uint32_t reg)
+qla2x00_check_reg32_for_disconnect(scsi_qla_host_t *vha, uint32_t reg)
 {
/* Check for PCI disconnection */
if (reg == 0x) {
@@ -136,6 +128,12 @@ qla2x00_check_reg_for_disconnect(scsi_qla_host_t *vha, 
uint32_t reg)
return false;
 }
 
+bool
+qla2x00_check_reg16_for_disconnect(scsi_qla_host_t *vha, uint16_t reg)
+{
+   return qla2x00_check_reg32_for_disconnect(vha, 0x | reg);
+}
+
 /**
  * qla2300_intr_handler() - Process interrupts for the ISP23xx and ISP63xx.
  * @irq:
@@ -174,7 +172,7 @@ qla2300_intr_handler(int irq, void *dev_id)
vha = pci_get_drvdata(ha->pdev);
for (iter = 50; iter--; ) {
stat = RD_REG_DWORD(®->u.isp2300.host_status);
-   if (qla2x00_check_reg_for_disconnect(vha, stat))
+   if (qla2x00_check_reg32_for_disconnect(vha, stat))
break;
if (stat & HSR_RISC_PAUSED) {
if (unlikely(pci_channel_offline(ha->pdev)))
@@ -2631,7 +2629,7 @@ qla24xx_intr_handler(int irq, void *dev_id)
vha = pci_get_drvdata(ha->pdev);
for (iter = 50; iter--; ) {
stat = RD_REG_DWORD(®->host_status);
-   if (qla2x00_check_reg_for_disconnect(vha, stat))
+   if (qla2x00_check_reg32_for_disconnect(vha, stat))
break;
if (stat & HSRX_RISC_PAUSED) {
if (unlikely(pci_channel_offline(ha->pdev)))
@@ -2721,7 +2719,7 @@ qla24xx_msix_rsp_q(int irq, void *dev_id)
 * we process the response queue.
 */
stat = RD_REG_DWORD(®->host_status);
-   if (qla2x00_check_reg_for_disconnect(vha, stat))
+   if (qla2x00_check_reg32_for_disconnect(vha, stat))
goto out;
qla24xx_process_response_queue(vha, rsp);
if (!ha->flags.disable_msix_handshake) {
@@ -2761,7 +2759,7 @@ qla25xx_msix_rsp_q(int irq, void *dev_id)
hccr = RD_REG_DWORD_RELAXED(®->hccr);
spin_unlock_irqrestore(&ha->hardware_lock, flags);
}
-   if (qla2x00_check_reg_for_disconnect(vha, hccr))
+   if (qla2x00_check_reg32_for_disconnect(vha, hccr))
goto out;
queue_work_on((int) (rsp->id - 1), ha->wq, &rsp->q_work);
 
@@ -2796,7 +2794,7 @@ qla24xx_msix_default(int irq, void *dev_id)
vha = pci_get_drvdata(ha->pdev);
  

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

2014-08-26 Thread Joe Lawrence
The PCI register read checking introduced in commit fe1b806f4f71
("qla2xxx: Disable adapter when we encounter a PCI disconnect") is
active during driver probe. Hold off scheduling any board removal until
the driver probe has completed. This ensures that the the board_disable
work structure 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 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 1398818..de5a9c4 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -3405,6 +3405,7 @@ typedef struct scsi_qla_host {
unsigned long   pci_flags;
 #define PFLG_DISCONNECTED  0   /* PCI device removed */
 #define PFLG_DRIVER_REMOVING   1   /* PCI driver .remove */
+#define PFLG_DRIVER_PROBING2   /* PCI driver .probe */
 
uint32_tdevice_flags;
 #define SWITCH_FOUND   BIT_0
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 341c64d..a0992bf 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -118,7 +118,8 @@ qla2x00_check_reg32_for_disconnect(scsi_qla_host_t *vha, 
uint32_t reg)
/* Check for PCI disconnection */
if (reg == 0x) {
if (!test_and_set_bit(PFLG_DISCONNECTED, &vha->pci_flags) &&
-   !test_bit(PFLG_DRIVER_REMOVING, &vha->pci_flags)) {
+   !test_bit(PFLG_DRIVER_REMOVING, &vha->pci_flags) &&
+   !test_bit(PFLG_DRIVER_PROBING, &vha->pci_flags)) {
/*
 * Schedule this (only once) on the default system
 * workqueue so that all the adapter workqueues and the
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 84d4df6..f937859 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2632,6 +2632,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct 
pci_device_id *id)
}
 
pci_set_drvdata(pdev, base_vha);
+   set_bit(PFLG_DRIVER_PROBING, &base_vha->pci_flags);
 
host = base_vha->host;
base_vha->req = req;
@@ -2928,6 +2929,7 @@ skip_dpc:
 
qlt_add_target(ha, base_vha);
 
+   clear_bit(PFLG_DRIVER_PROBING, &base_vha->pci_flags);
return 0;
 
 probe_init_failed:
-- 
1.7.10.4

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


[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/drivers/scsi/mpt2sas/mpt2sas_base.c
index cf51b48..bb8dcb0 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -84,10 +84,6 @@ static int mpt2sas_fwfault_debug;
 MODULE_PARM_DESC(mpt2sas_fwfault_debug, " enable detection of firmware fault "
"and halt firmware - (default=0)");
 
-static int disable_discovery = -1;
-module_param(disable_discovery, int, 0);
-MODULE_PARM_DESC(disable_discovery, " disable discovery ");
-
 /**
  * _scsih_set_fwfault_debug - global setting of ioc->fwfault_debug.
  *
-- 
1.7.10.4

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


[PATCH] scsi: sas_ata: change ata__printk routines to return void

2014-09-22 Thread Joe Perches
The return value is not used by callers of this function
so change the function to return void.

Signed-off-by: Joe Perches 
---
This change is associated to a desire to eventually
change printk to return void.

 drivers/scsi/libsas/sas_ata.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 766098a..2a15a54 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -375,26 +375,23 @@ static int local_ata_check_ready(struct ata_link *link)
}
 }
 
-static int sas_ata_printk(const char *level, const struct domain_device *ddev,
- const char *fmt, ...)
+static void sas_ata_printk(const char *level, const struct domain_device *ddev,
+  const char *fmt, ...)
 {
struct ata_port *ap = ddev->sata_dev.ap;
struct device *dev = &ddev->rphy->dev;
struct va_format vaf;
va_list args;
-   int r;
 
va_start(args, fmt);
 
vaf.fmt = fmt;
vaf.va = &args;
 
-   r = printk("%ssas: ata%u: %s: %pV",
-  level, ap->print_id, dev_name(dev), &vaf);
+   printk("%ssas: ata%u: %s: %pV",
+  level, ap->print_id, dev_name(dev), &vaf);
 
va_end(args);
-
-   return r;
 }
 
 static int sas_ata_hard_reset(struct ata_link *link, unsigned int *class,


--
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 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 bug was
introduced by fe1b806f4f71 ("qla2xxx: Refactor shutdown code so some
functionality can be reused") in previous releases.

Regards,

-- Joe

[1] http://thread.gmane.org/gmane.linux.scsi/93859
[2] 
http://git.infradead.org/users/hch/scsi-queue.git/commitdiff/db7157d4cfce6edf052452fb1d327d4d11b67f4c

On Wed, 24 Sep 2014 03:08:23 -0400
Saurav Kashyap  wrote:

> From: Arun Easi 
> 
> Signed-off-by: Arun Easi 
> Signed-off-by: Saurav Kashyap 
> ---
>  drivers/scsi/qla2xxx/qla_os.c |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 8846883..6539513 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -3190,10 +3190,10 @@ qla2x00_remove_one(struct pci_dev *pdev)
>  
>   qla2x00_free_device(base_vha);
>  
> - scsi_host_put(base_vha->host);
> -
>   qla2x00_clear_drv_active(base_vha);
>  
> + scsi_host_put(base_vha->host);
> +
>   qla2x00_unmap_iobases(ha);
>  
>   pci_release_selected_regions(ha->pdev, ha->bars);

--
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 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_os.c |3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 08c8e9c..70445bc 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -3037,6 +3037,9 @@ qla2x00_shutdown(struct pci_dev *pdev)
>   qla2x00_free_irqs(vha);
>  
>   qla2x00_free_fw_dump(ha);
> +
> + pci_disable_pcie_error_reporting(pdev);
> + pci_disable_device(pdev);
>  }
>  
>  /* Deletes all the virtual ports for a given ha */

Hi Saurav,

Just curious if there were any bug report instances to go along with
this patch?  (Or a short explanation of the race.)

Thanks,

-- Joe
--
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 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 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_os.c |3 +++
> >>  1 files changed, 3 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> >> index 08c8e9c..70445bc 100644
> >> --- a/drivers/scsi/qla2xxx/qla_os.c
> >> +++ b/drivers/scsi/qla2xxx/qla_os.c
> >> @@ -3037,6 +3037,9 @@ qla2x00_shutdown(struct pci_dev *pdev)
> >>qla2x00_free_irqs(vha);
> >>
> >>qla2x00_free_fw_dump(ha);
> >> +
> >> +  pci_disable_pcie_error_reporting(pdev);
> >> +  pci_disable_device(pdev);
> >>  }
> >>
> >>  /* Deletes all the virtual ports for a given ha */
> >
> > Hi Saurav,
> >
> > Just curious if there were any bug report instances to go along with
> > this patch?  (Or a short explanation of the race.)
> 
> Joe,
> 
> The race here was during reboot after taking a crash dump.  We hit an AER 
> condition so the driver's AER handler is called after we've already 
> shutdown the adapter which causes us to try to free some already freed 
> structs.  To prevent this we disable the PCI function from the shutdown 
> handler.

Hi Chad,

Could the driver's AER handler get invoked after qla2x00_free_fw_dump,
but before pci_disable_pcie_error_reporting (ie, is there anything to
hold off .shutdown from running at the same time as the AER callbacks)?

Thanks,

-- Joe
--
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] cxgbit: fix dma_addr_t printk format

2016-03-04 Thread Joe Perches
On Sat, 2016-03-05 at 01:04 +0100, Arnd Bergmann wrote:
> The newly added driver prints a dma_addr_t using the %llx format string,
> but that is wrong on most 32-bit architectures:
> 
> drivers/target/iscsi/cxgbit/cxgbit_ddp.c: In function 'cxgbit_dump_sgl':
> drivers/target/iscsi/cxgbit/cxgbit_ddp.c:180:10: error: format '%llx' expects 
> argument of type 'long long unsigned int', but argument 8 has type 
> 'dma_addr_t {aka unsigned int}' [-Werror=format=]
>    pr_info("\t%d/%u, 0x%p: len %u, off %u, pg 0x%p, dma 0x%llx, %u\n",
> 
> Unfortunately, we can't use the %pad format string here because
> we are not printing an lvalue, so we have to add a cast to u64, which
> matches the format string on all architectures.
> Signed-off-by: Arnd Bergmann 
> Fixes: c49aa56e556d ("cxgbit: add cxgbit_ddp.c")
> ---
>  drivers/target/iscsi/cxgbit/cxgbit_ddp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c 
> b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
> index 07e2bc86d0df..d667bc88e21d 100644
> --- a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
> +++ b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
> @@ -179,7 +179,7 @@ cxgbit_dump_sgl(const char *cap, struct scatterlist *sgl, 
> int nents)
>   for_each_sg(sgl, sg, nents, i)
>   pr_info("\t%d/%u, 0x%p: len %u, off %u, pg 0x%p, dma 0x%llx, 
> %u\n",
>   i, nents, sg, sg->length, sg->offset, sg_page(sg),
> - sg_dma_address(sg), sg_dma_len(sg));
> + (u64)sg_dma_address(sg), sg_dma_len(sg));
>  }
>  
>  static int cxgbit_ddp_sgl_check(struct scatterlist *sgl, int nents)

You could create a temporary:

    for_each_sg(sgl, sg, nents, i) {
dma_addr_t addr = sg_dma_address(sg);

pr_info("\t%d/%u, 0x%p: len %u, off %u, pg 0x%p, dma %pad, 
%u\n",
i, nents, sg, sg->length, sg->offset, sg_page(sg),
&addr, sg_dma_len(sg));
}

> 
--
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] cxgbit: fix dma_addr_t printk format

2016-03-04 Thread Joe Perches
On Sat, 2016-03-05 at 01:34 +0100, Arnd Bergmann wrote:
> On Friday 04 March 2016 16:25:07 Joe Perches wrote:
> > > diff --git a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c 
> > > b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
[]
> > > @@ -179,7 +179,7 @@ cxgbit_dump_sgl(const char *cap, struct scatterlist 
> > > *sgl, int nents)
> > >   for_each_sg(sgl, sg, nents, i)
> > >   pr_info("\t%d/%u, 0x%p: len %u, off %u, pg 0x%p, dma 
> > > 0x%llx, %u\n",
> > >   i, nents, sg, sg->length, sg->offset, sg_page(sg),
> > > - sg_dma_address(sg), sg_dma_len(sg));
> > > + (u64)sg_dma_address(sg), sg_dma_len(sg));
[]
> > You could create a temporary:


for_each_sg(sgl, sg, nents, i) {
dma_addr_t addr = sg_dma_address(sg);


pr_info("\t%d/%u, 0x%p: len %u, off %u, pg 0x%p, dma %pad, 
%u\n",
i, nents, sg, sg->length, sg->offset, sg_page(sg),
&addr, sg_dma_len(sg));
}

Sure, but the cast seemed nicer in this case, the result is the same.

Not quite as 0x%llx isn't always the same width and doesn't
have leading 0's like %pad


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


[PATCH] mpt3sas - remove unused fw_event_work delayed_work

2016-04-01 Thread Joe Lawrence
The driver's fw events are queued up using the the fw_event_work's
struct work, not its delayed_work member.  The latter appears to be
unused and may provoke CONFIG_DEBUG_OBJECTS_TIMERS "assert_init not
available" false warnings in _scsih_fw_event_cleanup_queue.  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
updated.

 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index e0e4920d0fa6..67643602efbc 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -189,7 +189,6 @@ struct fw_event_work {
struct list_headlist;
struct work_struct  work;
u8  cancel_pending_work;
-   struct delayed_work delayed_work;
 
struct MPT3SAS_ADAPTER *ioc;
u16 device_handle;
@@ -2804,12 +2803,12 @@ _scsih_fw_event_cleanup_queue(struct MPT3SAS_ADAPTER 
*ioc)
/*
 * Wait on the fw_event to complete. If this returns 1, then
 * the event was never executed, and we need a put for the
-* reference the delayed_work had on the fw_event.
+* reference the work had on the fw_event.
 *
 * If it did execute, we wait for it to finish, and the put will
 * happen from _firmware_event_work()
 */
-   if (cancel_delayed_work_sync(&fw_event->delayed_work))
+   if (cancel_work_sync(&fw_event->work))
fw_event_work_put(fw_event);
 
fw_event_work_put(fw_event);
-- 
1.8.3.1

--
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] 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 complete. If this returns 1, then
>>   * the event was never executed, and we need a put for the
>> - * reference the delayed_work had on the fw_event.
>> + * reference the work had on the fw_event.
>>   *
>>   * If it did execute, we wait for it to finish, and the put will
>>   * happen from _firmware_event_work()
>>   */
>> -if (cancel_delayed_work_sync(&fw_event->delayed_work))
>> +if (cancel_work_sync(&fw_event->work))
>>  fw_event_work_put(fw_event);
>>  
>>  fw_event_work_put(fw_event);
> 
> Hmm... Fixes: 146b16c8 (mpt3sas: Refcount fw_events and fix unsafe list usage)

This could technically go back to f92363d12359 (mpt3sas: add new driver
supporting 12GB SAS) ...  but will probably only apply cleanly to
_scsih_fw_event_cleanup_queue after 146b16c8 (mpt3sas: Refcount
fw_events and fix unsafe list usage), so you're right.

> Since mpt3sas uses ->work instead of _delayed_work this would seem to be
> correct, however the deprecated mpt2sas driver had a commit that changed
> the firmware event work mechanism to use ->delayed_work instead of ->work:
> 
> commit f1c35e6aea579d5bdb6dc02dfa99c67c7c3b3f67
> Author: Kashyap, Desai 
> Date:   Tue Mar 9 16:31:43 2010 +0530

Okay, so this is pre-mpt3sas split.

> [SCSI] mpt2sas: RESCAN Barrier work is added in case of HBA reset.
> 
> Add the cancel_pending_work flag from the fw_event_work structure, and 
> then to
> set the flag during host reset, check the flag later from work threads
> context and if cancel_pending_work_flag is set ingore those events.

More unused mpt2 vestiges in the mpt3 version?

% cd drivers/scsi/mpt3sas/
% grep 'cancel_pending_work' *.{c,h}
mpt3sas_scsih.c: * @cancel_pending_work: flag set during reset handling
mpt3sas_scsih.c:u8  cancel_pending_work;

> Now Rescan after host reset is changed.
> Added special task MPT2SAS_RESCAN_AFTER_HOST_RESET. This task will be 
> queued
> at the time of HBA reset. this task is treated as barrier. All work after
> MPT2SAS_RESCAN_AFTER_HOST_RESET will be treated as new work and will be
> server by callback handle. If host_recovery is going on while running 
> RESCAN
> task, it will wait for shos_recovery_done completion which will be called
> from HBA reset DONE context.

FWIW, I don't see anything like this in today's mpt3sas driver.

Regards,

-- Joe
--
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] mpt3sas - remove unused fw_event_work delayed_work

2016-04-11 Thread Joe Lawrence
Hi Chaitra, while discussing this patch with Ewan, I realized that 
cancel_pending_work is unused as well.  I can send a v2 with that and 
the associated kerneldoc update.


Do we know why f1c35e6aea579 "mpt2sas: RESCAN Barrier work is added in 
case of HBA reset" was unneeded for the mpt3 version?  If that is 
interesting, that info could be added to v2 commit message as well.


Thanks,

-- Joe


On 04/11/2016 07:13 AM, Chaitra Basappa wrote:

Hi,
  Please consider this patch as Ack-by: Chaitra P B


Thanks,
  Chaitra

-Original Message-
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_work

We will look into this early next week and provide a detailed response.  On
the first look this is ACK from Broadcom, will reconfirm.

-Original Message-
From: Ewan D. Milne [mailto:emi...@redhat.com]
Sent: Friday, April 01, 2016 2:04 PM
To: Joe Lawrence
Cc: linux-scsi@vger.kernel.org; Sathya Prakash; Chaitra P B; Suganath Prabu
Subramani; Calvin Owens
Subject: Re: [PATCH] mpt3sas - remove unused fw_event_work delayed_work

On Fri, 2016-04-01 at 15:13 -0400, Joe Lawrence wrote:

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 complete. If this returns 1, then
 * the event was never executed, and we need a put for the
-* reference the delayed_work had on the fw_event.
+* reference the work had on the fw_event.
 *
 * If it did execute, we wait for it to finish, and the put will
 * happen from _firmware_event_work()
 */
-   if (cancel_delayed_work_sync(&fw_event->delayed_work))
+   if (cancel_work_sync(&fw_event->work))
fw_event_work_put(fw_event);

fw_event_work_put(fw_event);


Hmm... Fixes: 146b16c8 (mpt3sas: Refcount fw_events and fix unsafe
list usage)


This could technically go back to f92363d12359 (mpt3sas: add new
driver supporting 12GB SAS) ...  but will probably only apply cleanly
to _scsih_fw_event_cleanup_queue after 146b16c8 (mpt3sas: Refcount
fw_events and fix unsafe list usage), so you're right.


Since mpt3sas uses ->work instead of _delayed_work this would seem
to be correct, however the deprecated mpt2sas driver had a commit
that changed the firmware event work mechanism to use ->delayed_work
instead of ->work:

commit f1c35e6aea579d5bdb6dc02dfa99c67c7c3b3f67
Author: Kashyap, Desai 
Date:   Tue Mar 9 16:31:43 2010 +0530


Okay, so this is pre-mpt3sas split.


 [SCSI] mpt2sas: RESCAN Barrier work is added in case of HBA reset.

 Add the cancel_pending_work flag from the fw_event_work
structure, and then to
 set the flag during host reset, check the flag later from work
threads
 context and if cancel_pending_work_flag is set ingore those events.


More unused mpt2 vestiges in the mpt3 version?

% cd drivers/scsi/mpt3sas/
% grep 'cancel_pending_work' *.{c,h}
mpt3sas_scsih.c: * @cancel_pending_work: flag set during reset handling
mpt3sas_scsih.c:u8  cancel_pending_work;


 Now Rescan after host reset is changed.
 Added special task MPT2SAS_RESCAN_AFTER_HOST_RESET. This task
will be queued
 at the time of HBA reset. this task is treated as barrier. All
work after
 MPT2SAS_RESCAN_AFTER_HOST_RESET will be treated as new work and
will be
 server by callback handle. If host_recovery is going on while
running RESCAN
 task, it will wait for shos_recovery_done completion which will
be called
 from HBA reset DONE context.


FWIW, I don't see anything like this in today's mpt3sas driver.


Well, that's the question.  Is there some functionality missing?  Were the
changes abandoned/replaced?  mpt2sas used delayed_work for something else,
so maybe that's why the firmware event changes initially used it (albeit
with a 0 delay) but it's hard to know...

cancel_delayed_work() will call del_timer() on delayed_work->timer, but it
looks like kzalloc is used to allocate the fw_event_work objects so perhaps
nothing bad will happen.  I was wondering, though, because I have seen dumps
of hung systems with requests that should have timed out but are not on any
timer list.

-Ewan



Regards,

-- Joe

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


[PATCH v2] mpt3sas - remove unused fw_event_work elements

2016-04-18 Thread Joe Lawrence
Firmware events are queued up using the fw_event_work's struct work, not
its delayed_work member.  The initial driver for SAS2 controllers had
handled firmware reset using the rescan barrier and was later redesigned
through "mpt2sas: [Resend] Host Reset code cleanup".  The delayed_work
variables are now unused and may provoke CONFIG_DEBUG_OBJECTS_TIMERS
"assert_init not available" false warnings in
_scsih_fw_event_cleanup_queue.

Cleanup fw_event_work's unused entries, update it's kerneldoc, and update
_scsih_fw_event_cleanup_queue accordingly.

Fixes: 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
index e0e4920d0fa6..f2139e5604a3 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -174,13 +174,13 @@ struct sense_info {
  * struct fw_event_work - firmware event struct
  * @list: link list framework
  * @work: work object (ioc->fault_reset_work_q)
- * @cancel_pending_work: flag set during reset handling
  * @ioc: per adapter object
  * @device_handle: device handle
  * @VF_ID: virtual function id
  * @VP_ID: virtual port id
  * @ignore: flag meaning this event has been marked to ignore
- * @event: firmware event MPI2_EVENT_XXX defined in mpt2_ioc.h
+ * @event: firmware event MPI2_EVENT_XXX defined in mpi2_ioc.h
+ * @refcount: kref for this event
  * @event_data: reply event data payload follows
  *
  * This object stored on ioc->fw_event_list.
@@ -188,8 +188,6 @@ struct sense_info {
 struct fw_event_work {
struct list_headlist;
struct work_struct  work;
-   u8  cancel_pending_work;
-   struct delayed_work delayed_work;
 
struct MPT3SAS_ADAPTER *ioc;
u16 device_handle;
@@ -2804,12 +2802,12 @@ _scsih_fw_event_cleanup_queue(struct MPT3SAS_ADAPTER 
*ioc)
/*
 * Wait on the fw_event to complete. If this returns 1, then
 * the event was never executed, and we need a put for the
-* reference the delayed_work had on the fw_event.
+* reference the work had on the fw_event.
 *
 * If it did execute, we wait for it to finish, and the put will
 * happen from _firmware_event_work()
 */
-   if (cancel_delayed_work_sync(&fw_event->delayed_work))
+   if (cancel_work_sync(&fw_event->work))
fw_event_work_put(fw_event);
 
fw_event_work_put(fw_event);
-- 
1.8.3.1

--
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] megaraid_sas: trivial fix, add missing space in dev_err message

2016-04-25 Thread Joe Perches
On Mon, 2016-04-25 at 22:58 +0100, Colin King wrote:
> From: Colin Ian King 
> 
> Add a missing space in dev_err message, missed because the string
> spans a few lines.

This is a dev_notice() not dev_err().

> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
> b/drivers/scsi/megaraid/megaraid_sas_base.c
[]
> @@ -3345,7 +3345,7 @@ megasas_internal_reset_defer_cmds(struct 
> megasas_instance *instance)
>   if (!list_empty(&cmd->list)) {
>   dev_notice(&instance->pdev->dev, "ERROR while"
>   " moving this cmd:%p, %d %p, it was"
> - "discovered on some list?\n",
> + " discovered on some list?\n",
>   cmd, cmd->sync_cmd, cmd->scmd);
>  
>   list_del_init(&cmd->list);

Better would be to coalesce the format, but perhaps
this dev_notice should be dev_err?

dev_notice(&instance->pdev->dev,
   "ERROR while moving this cmd:%p, %d 
%p, it was discovered on some list?\n",
   cmd, cmd->sync_cmd, cmd->scmd);

And the message seems oddly phrased.
--
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] Fix a bdi reregistration race, v3

2016-05-05 Thread Joe Lawrence
ded: ipmi_devintf]
CPU: 5 PID: 30702 Comm: kworker/u97:7 Tainted: PW  OE   4.6.0-rc6+ #37
Hardware name: Stratus ftServer 6800/G7LYY, BIOS BIOS Version 8.1:64 02/03/2016
Workqueue: events_unbound async_run_entry_fn
 0286 e136f6f8 88038ae03aa0 8134359f
 88038ae03af0  88038ae03ae0 8108af31
 00f08129760c 880853a4f4f8 88003b529e68 ffef
Call Trace:
 [] dump_stack+0x63/0x84
 [] __warn+0xd1/0xf0
 [] warn_slowpath_fmt+0x5f/0x80
 [] kobject_add_internal+0x262/0x320
 [] ? device_private_init+0x23/0x70
 [] kobject_add+0x75/0xd0
 [] ? mutex_lock+0x12/0x2f
 [] device_add+0x125/0x610
 [] device_create_groups_vargs+0xd8/0x100
 [] device_create_vargs+0x1c/0x20
 [] bdi_register+0x8c/0x180
 [] bdi_register_dev+0x27/0x30
 [] add_disk+0x17f/0x4a0
 [] ? update_autosuspend+0x55/0x60
 [] ? __pm_runtime_use_autosuspend+0x54/0x70
 [] sd_probe_async+0x115/0x1d0 [sd_mod]
 [] async_run_entry_fn+0x4a/0x140
 [] process_one_work+0x16e/0x420
 [] worker_thread+0x125/0x4b0
 [] ? __schedule+0x2ad/0x8a0
 [] ? rescuer_thread+0x380/0x380
 [] kthread+0xd8/0xf0
 [] ret_from_fork+0x22/0x40
 [] ? kthread_park+0x60/0x60
---[ end trace 353add4e78cb2a76 ]---
BUG: unable to handle kernel NULL pointer dereference at 0040
IP: [] sysfs_do_create_link_sd.isra.2+0x34/0xb0
PGD 0
Oops:  [#1] SMP
Modules linked in: btrfs xor raid6_pq msdos ext4 jbd2 mbcache matroxfb(OE) 
ccmod(POE) ftmod(OE) videosw(OE) ipmi_devintf fuse xt_CHECKSUM ipt_MASQUERADE 
nf_nat_masquerade_ipv4 tun ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT 
nf_reject_ipv4 xt_conntrack bonding ebtable_nat ebtable_broute bridge stp llc 
ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 
nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter 
ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat 
nf_conntrack iptable_mangle iptable_security iptable_raw iptable_filter vfat 
fat x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul 
crc32_pclmul ghash_clmulni_intel aesni_intel glue_helper lrw gf128mul 
ablk_helper cryptd dm_service_time pcspkr ses enclosure sg wmi nfsd auth_rpcgss 
nfs_acl lockd grace sunrpc dm_multipath ip_tables xfs libcrc32c raid1 sr_mod 
cdrom crc32c_intel qla2xxx(OE) scsi_transport_fc ixgbe(OE) mdio igb(OE) ptp 
pps_core mpt3sas(OE) 
raid_class i2c_algo_bit sra_sense(OE) i2c_core sd_mod(OE) scsi_transport_sas 
dca scsi_hbas(OE) fjes ipmi_msghandler usb_storage dm_mirror dm_region_hash 
dm_log dm_mod [last unloaded: ipmi_devintf]
CPU: 5 PID: 30702 Comm: kworker/u97:7 Tainted: PW  OE   4.6.0-rc6+ #37
Hardware name: Stratus ftServer 6800/G7LYY, BIOS BIOS Version 8.1:64 02/03/2016
Workqueue: events_unbound async_run_entry_fn
task: 88038adfda40 ti: 88038ae0 task.ti: 88038ae0
RIP: 0010:[]  [] 
sysfs_do_create_link_sd.isra.2+0x34/0xb0
RSP: 0018:88038ae03d08  EFLAGS: 00010246
RAX:  RBX: 0040 RCX: 0001
RDX: 0001 RSI: 0040 RDI: 8221adf0
RBP: 88038ae03d30 R08: 88084d4b91f0 R09: 
R10: 8801f1832608 R11: 8801f1832f88 R12: 81a2034e
R13: 8808580bae58 R14: 0001 R15: 8804ac9c7038
FS:  () GS:88085f94() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 0040 CR3: 001054486000 CR4: 001406e0
Stack:
 8804ac9c6fc8 8804ac9c7048 8808352a0a58 8804ac9c6fd4
 8804ac9c7038 88038ae03d40 812979c5 88038ae03da8
 81327f15 8804ac9c6fc8 04108ae03d68 8804ac9c6fc8
Call Trace:
 [] sysfs_create_link+0x25/0x40
 [] add_disk+0x215/0x4a0
 [] sd_probe_async+0x115/0x1d0 [sd_mod]
 [] async_run_entry_fn+0x4a/0x140
 [] process_one_work+0x16e/0x420
 [] worker_thread+0x125/0x4b0
 [] ? __schedule+0x2ad/0x8a0
 [] ? rescuer_thread+0x380/0x380
 [] kthread+0xd8/0xf0
 [] ret_from_fork+0x22/0x40
 [] ? kthread_park+0x60/0x60
Code: 48 89 e5 41 57 41 56 41 55 41 54 49 89 d4 53 74 73 48 85 ff 49 89 fd 74 
6b 48 89 f3 48 c7 c7 f0 ad 21 82 41 89 ce e8 ac 3d 41 00 <48> 8b 1b 48 85 db 74 
08 48 89 df e8 ac c1 ff ff 48 c7 c7 f0 ad
RIP  [] sysfs_do_create_link_sd.isra.2+0x34/0xb0
 RSP 
CR2: 0040
sd 1:0:0:2: [sds] Read Capacity(16) failed: Result: hostbyte=DID_NO_CONNECT 
driverbyte=DRIVER_OK
sd 1:0:0:2: [sds] Sense not available.
sd 1:0:0:2: [sds] Read Capacity(10) failed: Result: hostbyte=DID_NO_CONNECT 
driverbyte=DRIVER_OK
sd 1:0:0:2: [sds] Sense not available.
sd 1:0:0:2: [sds] Write Protect is off
sd 1:0:0:2: [sds] Mode Sense: 00 00 00 60
sd 1:0:0:2: [sds] Asking for cache data failed
sd 1:0:0:2: [sds] Assuming drive cache: write through

Regards,

-- Joe
--
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] 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 warning gets
>>> triggered:
>>>
>>> [ ... ]
>>
>> (replying to my own e-mail)
>>
>> If anyone could review this patch that would be very welcome.
> 
> Hi Bart,
> 
> I *think* I may be hitting this same problem running some tests here at 
> Stratus
> ... snip...


Hi Bart,

Good news = With your v3 patch, I didn't see the "sysfs: cannot create
duplicate filename '/devices/virtual/bdi/65:0'" warning during my
weekend testing (573 surprise disk HBA removals).

Bad news = I still crashed in add_disk > sysfs_create_link >
sysfs_do_create_link_sd on a NULL target_kobj->sd ... unfortunately I
don't have kdump working, so all I have is a serial console output to
work with for now.

Regards,

-- Joe
--
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] ibmvscsis: Initial commit of IBM VSCSI Tgt Driver

2016-05-24 Thread Joe Perches
On Tue, 2016-05-24 at 08:52 -0500, Bryant G. Ly wrote:
> From: bgly 
> 
> This initial commit contains WIP of the IBM VSCSI Target Fabric
> Module. It currently supports read/writes, and I have tested
> the ability to create a file backstore with the driver and install
> RHEL VIA NIM and then boot up the partition via filio backstore
> through the driver.

Only trivial notes:

Maybe try checkpatch with the --strict option and see
if any of the additional messages are important to you.

> diff --git a/MAINTAINERS b/MAINTAINERS
[]
> @@ -5381,6 +5381,16 @@ S: Supported
>  F:   drivers/scsi/ibmvscsi/ibmvscsi*
>  F:   drivers/scsi/ibmvscsi/viosrp.h
>  
> +IBM Power Virtual SCSI Device Target Driver
> +M:   Bryant G. Ly 
> +L:   linux-scsi@vger.kernel.org
> +L:   target-de...@vger.kernel.org
> +S:   Supported
> +F:   drivers/scsi/ibmvscsi/ibmvscsis.c
> +F:  drivers/scsi/ibmvscsi/ibmvscsis.h
> +F:   drivers/scsi/libsrp.h
> +F:  drivers/scsi/libsrp.c

Please use a tab character consistently after the :

> diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
[]
> @@ -847,6 +847,20 @@ config SCSI_IBMVSCSI
>     To compile this driver as a module, choose M here: the
>     module will be called ibmvscsi.
>  
> +config SCSI_IBMVSCSIS
> +     tristate "IBM Virtual SCSI Server support"
> +     depends on PPC_PSERIES && SCSI_SRP && TARGET_CORE
> +     help
> +       This is the IBM POWER Virtual SCSI Target Server
> +
> +  The userspace component needed to initialize the driver and
> +       documentation can be found:

here too.

> +
> +  https://github.com/powervm/ibmvscsis
> +
> +  To compile this driver as a module, choose M here: the
> +       module will be called ibmvstgt.
> +

[]

> diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
[]
> @@ -127,7 +127,9 @@ obj-$(CONFIG_SCSI_LASI700)+= 53c700.o lasi700.o
>  obj-$(CONFIG_SCSI_SNI_53C710)+= 53c700.o sni_53c710.o
>  obj-$(CONFIG_SCSI_NSP32) += nsp32.o
>  obj-$(CONFIG_SCSI_IPR)   += ipr.o
> +obj-$(CONFIG_SCSI_SRP)  += libsrp.o
>  obj-$(CONFIG_SCSI_IBMVSCSI)  += ibmvscsi/
> +obj-$(CONFIG_SCSI_IBMVSCSIS)+= ibmvscsi/

and here

> diff --git a/drivers/scsi/ibmvscsi/ibmvscsis.c 
> b/drivers/scsi/ibmvscsi/ibmvscsis.c
[]

> +static int ibmvscsis_probe(struct vio_dev *vdev,
> +    const struct vio_device_id *id);
[...]

It might be nice to rearrange the code to avoid these forward
function declarations.

> +static ssize_t ibmvscsis_tpg_enable_store(struct config_item *item,
> + const char *page, size_t count)
> +{
[]
> > +   ret = kstrtoul(page, 0, &tmp);
> + if (ret < 0) {
> + pr_err("Unable to extract ibmvscsis_tpg_store_enable\n");
> + return -EINVAL;
> + }

It might be nicer to add:

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

before any #include to output all the logging messages with
a standardized prefix.  Then all the other logging with an
embedded prefix can have the embedded prefix removed too.

> +
> + if ((tmp != 0) && (tmp != 1)) {
> + pr_err("Illegal value for ibmvscsis_tpg_store_enable: %lu\n",
> + tmp);
> + return -EINVAL;
> + }
> +
> + if (tmp == 1)
> + tport->enabled = true;
> + else
> + tport->enabled = false;

tport->enabled = tmp;

--
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 3/3] ibmvscsis: clean up functions

2016-05-25 Thread Joe Perches
On Wed, 2016-05-25 at 09:17 -0500, Bryant G. Ly wrote:
> From: bryantly 

Please use your whole name here and for your sign-off like:

From: Bryant G. Ly 
Signed-off-by: Bryant G. Ly 

> This patch removes forward declarations and re-organizes the
> functions within the driver. This patch also fixes MAINTAINERS
> for ibmvscsis.

trivial note:

> diff --git a/drivers/scsi/ibmvscsi/ibmvscsis.c 
> b/drivers/scsi/ibmvscsi/ibmvscsis.c
[]
>  static inline long h_copy_rdma(s64 length, u64 sliobn, u64 slioba,
>      u64 dliobn, u64 dlioba)
>  {
> 

Functions like this would be less indented and less
line wrapped for 80 columns if they were written:

if (!se_cmd->residual_count)
return;

[unindented one level...]

etc...

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


[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: Joe Lawrence 
---
 drivers/scsi/mpt3sas/mpt3sas_transport.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c 
b/drivers/scsi/mpt3sas/mpt3sas_transport.c
index 6a84b82d71bb..ff93286bc32f 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_transport.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c
@@ -705,6 +705,11 @@ mpt3sas_transport_port_add(struct MPT3SAS_ADAPTER *ioc, 
u16 handle,
goto out_fail;
}
 
+   if (!sas_node->parent_dev) {
+   pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
+   ioc->name, __FILE__, __LINE__, __func__);
+   goto out_fail;
+   }
port = sas_port_alloc_num(sas_node->parent_dev);
if ((sas_port_add(port))) {
pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
-- 
1.8.3.1

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


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

2016-05-25 Thread Joe Lawrence
In _scsih_sas_host_add, the number of HBA phys are determined and then
later used to allocate an array of struct  _sas_phy's.  If the routine
sets ioc->sas_hba.num_phys, but then fails to allocate the
ioc->sas_hba.phy array (by kcalloc error or other intermediate
error/exit path), ioc->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[].

Signed-off-by: Joe Lawrence 
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index f2139e5604a3..6e36d20c9e0b 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -4893,13 +4893,22 @@ _scsih_sas_host_add(struct MPT3SAS_ADAPTER *ioc)
u16 ioc_status;
u16 sz;
u8 device_missing_delay;
+   u8 num_phys;
 
-   mpt3sas_config_get_number_hba_phys(ioc, &ioc->sas_hba.num_phys);
-   if (!ioc->sas_hba.num_phys) {
+   mpt3sas_config_get_number_hba_phys(ioc, &num_phys);
+   if (!num_phys) {
pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
ioc->name, __FILE__, __LINE__, __func__);
return;
}
+   ioc->sas_hba.phy = kcalloc(num_phys,
+   sizeof(struct _sas_phy), GFP_KERNEL);
+   if (!ioc->sas_hba.phy) {
+   pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
+   ioc->name, __FILE__, __LINE__, __func__);
+   goto out;
+   }
+   ioc->sas_hba.num_phys = num_phys;
 
/* sas_iounit page 0 */
sz = offsetof(Mpi2SasIOUnitPage0_t, PhyData) + (ioc->sas_hba.num_phys *
@@ -4959,13 +4968,6 @@ _scsih_sas_host_add(struct MPT3SAS_ADAPTER *ioc)
MPI2_SASIOUNIT1_REPORT_MISSING_TIMEOUT_MASK;
 
ioc->sas_hba.parent_dev = &ioc->shost->shost_gendev;
-   ioc->sas_hba.phy = kcalloc(ioc->sas_hba.num_phys,
-   sizeof(struct _sas_phy), GFP_KERNEL);
-   if (!ioc->sas_hba.phy) {
-   pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
-   ioc->name, __FILE__, __LINE__, __func__);
-   goto out;
-   }
for (i = 0; i < ioc->sas_hba.num_phys ; i++) {
if ((mpt3sas_config_get_phy_pg0(ioc, &mpi_reply, &phy_pg0,
i))) {
-- 
1.8.3.1

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


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

2016-05-25 Thread Joe Lawrence
There are many error paths in _scsih_sas_host_add that lead to an early
exit and a few that leave IOC resources uninitialized, setting the stage
for a later crash.

This can be emulated using a systemtap script like:

  % stap -g -e \
  'probe module("mpt3sas").function("mpt3sas_config_get_sas_iounit_pg0").return 
{ $return = -1 }'

to force early exit, while remove/re-adding an MPT3 adapter:

  % lspci -D | grep MPT
  :54:00.0 Mass storage controller: LSI Logic / Symbios Logic SAS3008 
PCI-Express Fusion-MPT SAS-3 (rev 02)

  % SYSFS=$(find /sys/devices -name :54:00.0)
  % SYSFS_PARENT=$(dirname $SYSFS)

  % echo 1 > $SYSFS/remove
  % sleep 1m
  % echo 1 > $SYSFS_PARENT/rescan

These two patches fix:
  1) referencing unallocated ioc->sas_hba.phy[] space
  2) passing a NULL ioc->sas_hba.parent_dev to the scsi_transport_sas
 layer.

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_scsih.c | 20 +++-
 drivers/scsi/mpt3sas/mpt3sas_transport.c |  5 +
 2 files changed, 16 insertions(+), 9 deletions(-)

-- 
1.8.3.1

--
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] Use the correct size to set block max sectors

2016-05-26 Thread Joe Perches
dOn Thu, 2016-05-26 at 17:08 -0700, Long Li wrote:
> The block sector size should be in unit of 512 bytes, not in bytes.

Thanks.  The patch subject should use something like:

[PATCH] sd: Use the correct size to set block max sectors

to show what subsystem is being modified.

> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
[]
> @@ -2862,9 +2862,11 @@ static int sd_revalidate_disk(struct gendisk *disk)
>   if (sdkp->opt_xfer_blocks &&
>   sdkp->opt_xfer_blocks <= dev_max &&
>   sdkp->opt_xfer_blocks <= SD_DEF_XFER_BLOCKS &&
> - sdkp->opt_xfer_blocks * sdp->sector_size >= PAGE_SIZE)
> - rw_max = q->limits.io_opt =
> + sdkp->opt_xfer_blocks * sdp->sector_size >= PAGE_SIZE) {
> + q->limits.io_opt =
>   sdkp->opt_xfer_blocks * sdp->sector_size;
> + rw_max = (q->limits.io_opt >> 9);
> + }
>   else
>   rw_max = BLK_DEF_MAX_SECTORS;

And style trivia:  it'd be more kernel style consistent as:

if (...
    sdkp->opt_xfer_blocks * sdp->sector_size >= PAGE_SIZE) {
q->limits.io_opt = sdkp->opt_xfer_blocks * sdp->sector_size;
rw_max = q->limits.io_opt >> 9;
} else {
rw_max = BLK_DEF_MAX_SECTORS;
}

ie: no parentheses necessary around the shifted value and
    braces around both arms.

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


[PATCH 0/3] BusLogic: Message logging neatening

2013-05-16 Thread Joe Perches
If you're going through the trouble to fix this CamelCase stuff
and make it work on 64 bit, how about a little more cleanup?

Joe Perches (3):
  BusLogic: Add __printf verification, fix fallout
  BusLogic: Coalesce formats with multiple string fragments
  BusLogic: Use more conventional argument order for logging

 drivers/scsi/BusLogic.c | 304 
 drivers/scsi/BusLogic.h |  23 ++--
 2 files changed, 161 insertions(+), 166 deletions(-)

-- 
1.8.1.2.459.gbcd45b4.dirty

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


[PATCH 1/3] BusLogic: Add __printf verification, fix fallout

2013-05-16 Thread Joe Perches
Make format and arguments match.

Signed-off-by: Joe Perches 
---
 drivers/scsi/BusLogic.c | 50 -
 drivers/scsi/BusLogic.h |  1 +
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index feab3a5..28c2051 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -720,23 +720,23 @@ static int __init blogic_init_mm_probeinfo(struct 
blogic_adapter *adapter)
pci_addr = base_addr1 = pci_resource_start(pci_device, 1);
 
if (pci_resource_flags(pci_device, 0) & IORESOURCE_MEM) {
-   blogic_err("BusLogic: Base Address0 0x%X not I/O for " 
"MultiMaster Host Adapter\n", NULL, base_addr0);
-   blogic_err("at PCI Bus %d Device %d I/O Address 
0x%X\n", NULL, bus, device, io_addr);
+   blogic_err("BusLogic: Base Address0 0x%lX not I/O for " 
"MultiMaster Host Adapter\n", NULL, base_addr0);
+   blogic_err("at PCI Bus %d Device %d I/O Address 
0x%lX\n", NULL, bus, device, io_addr);
continue;
}
if (pci_resource_flags(pci_device, 1) & IORESOURCE_IO) {
-   blogic_err("BusLogic: Base Address1 0x%X not Memory for 
" "MultiMaster Host Adapter\n", NULL, base_addr1);
-   blogic_err("at PCI Bus %d Device %d PCI Address 
0x%X\n", NULL, bus, device, pci_addr);
+   blogic_err("BusLogic: Base Address1 0x%lX not Memory 
for " "MultiMaster Host Adapter\n", NULL, base_addr1);
+   blogic_err("at PCI Bus %d Device %d PCI Address 
0x%lX\n", NULL, bus, device, pci_addr);
continue;
}
if (irq_ch == 0) {
blogic_err("BusLogic: IRQ Channel %d invalid for " 
"MultiMaster Host Adapter\n", NULL, irq_ch);
-   blogic_err("at PCI Bus %d Device %d I/O Address 
0x%X\n", NULL, bus, device, io_addr);
+   blogic_err("at PCI Bus %d Device %d I/O Address 
0x%lX\n", NULL, bus, device, io_addr);
continue;
}
if (blogic_global_options.trace_probe) {
blogic_notice("BusLogic: PCI MultiMaster Host Adapter " 
"detected at\n", NULL);
-   blogic_notice("BusLogic: PCI Bus %d Device %d I/O 
Address " "0x%X PCI Address 0x%X\n", NULL, bus, device, io_addr, pci_addr);
+   blogic_notice("BusLogic: PCI Bus %d Device %d I/O 
Address 0x%lX PCI Address 0x%lX\n", NULL, bus, device, io_addr, pci_addr);
}
/*
   Issue the Inquire PCI Host Adapter Information command to 
determine
@@ -960,23 +960,23 @@ static int __init blogic_init_fp_probeinfo(struct 
blogic_adapter *adapter)
pci_addr = base_addr1 = pci_resource_start(pci_device, 1);
 #ifdef CONFIG_SCSI_FLASHPOINT
if (pci_resource_flags(pci_device, 0) & IORESOURCE_MEM) {
-   blogic_err("BusLogic: Base Address0 0x%X not I/O for " 
"FlashPoint Host Adapter\n", NULL, base_addr0);
-   blogic_err("at PCI Bus %d Device %d I/O Address 
0x%X\n", NULL, bus, device, io_addr);
+   blogic_err("BusLogic: Base Address0 0x%lX not I/O for " 
"FlashPoint Host Adapter\n", NULL, base_addr0);
+   blogic_err("at PCI Bus %d Device %d I/O Address 
0x%lX\n", NULL, bus, device, io_addr);
continue;
}
if (pci_resource_flags(pci_device, 1) & IORESOURCE_IO) {
-   blogic_err("BusLogic: Base Address1 0x%X not Memory for 
" "FlashPoint Host Adapter\n", NULL, base_addr1);
-   blogic_err("at PCI Bus %d Device %d PCI Address 
0x%X\n", NULL, bus, device, pci_addr);
+   blogic_err("BusLogic: Base Address1 0x%lX not Memory 
for " "FlashPoint Host Adapter\n", NULL, base_addr1);
+   blogic_err("at PCI Bus %d Device %d PCI Address 
0x%lX\n", NULL, bus, device, pci_addr);
continue;
}
if (irq_ch == 0) {
blogic_err("BusLogic: IRQ Channel %d invalid for " 
"FlashPoint Host Adapter\n", NULL, irq_ch);
-   blogic_err("at PCI Bus %d Device %d I/O Address 
0x%X\n", NULL, bus, device, io_addr);
+   blogic_err("at PCI Bus %d Device %d I/O Address 
0x%lX\n", 

[PATCH 2/3] BusLogic: Coalesce formats with multiple string fragments

2013-05-16 Thread Joe Perches
Strings fragments coalesced by the compiler are
difficult to grep.  Coalesce them instead.

Signed-off-by: Joe Perches 
---
 drivers/scsi/BusLogic.c | 66 -
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index 28c2051..bd588cf 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -141,7 +141,7 @@ static char *blogic_cmd_failure_reason;
 static void blogic_announce_drvr(struct blogic_adapter *adapter)
 {
blogic_announce("* BusLogic SCSI Driver Version " 
blogic_drvr_version " of " blogic_drvr_date " *\n", adapter);
-   blogic_announce("Copyright 1995-1998 by Leonard N. Zubkoff " 
"\n", adapter);
+   blogic_announce("Copyright 1995-1998 by Leonard N. Zubkoff 
\n", adapter);
 }
 
 
@@ -444,7 +444,7 @@ static int blogic_cmd(struct blogic_adapter *adapter, enum 
blogic_opcode opcode,
goto done;
}
if (blogic_global_options.trace_config)
-   blogic_notice("blogic_cmd(%02X) Status = %02X: " 
"(Modify I/O Address)\n", adapter, opcode, statusreg.all);
+   blogic_notice("blogic_cmd(%02X) Status = %02X: (Modify 
I/O Address)\n", adapter, opcode, statusreg.all);
result = 0;
goto done;
}
@@ -720,22 +720,22 @@ static int __init blogic_init_mm_probeinfo(struct 
blogic_adapter *adapter)
pci_addr = base_addr1 = pci_resource_start(pci_device, 1);
 
if (pci_resource_flags(pci_device, 0) & IORESOURCE_MEM) {
-   blogic_err("BusLogic: Base Address0 0x%lX not I/O for " 
"MultiMaster Host Adapter\n", NULL, base_addr0);
+   blogic_err("BusLogic: Base Address0 0x%lX not I/O for 
MultiMaster Host Adapter\n", NULL, base_addr0);
blogic_err("at PCI Bus %d Device %d I/O Address 
0x%lX\n", NULL, bus, device, io_addr);
continue;
}
if (pci_resource_flags(pci_device, 1) & IORESOURCE_IO) {
-   blogic_err("BusLogic: Base Address1 0x%lX not Memory 
for " "MultiMaster Host Adapter\n", NULL, base_addr1);
+   blogic_err("BusLogic: Base Address1 0x%lX not Memory 
for MultiMaster Host Adapter\n", NULL, base_addr1);
blogic_err("at PCI Bus %d Device %d PCI Address 
0x%lX\n", NULL, bus, device, pci_addr);
continue;
}
if (irq_ch == 0) {
-   blogic_err("BusLogic: IRQ Channel %d invalid for " 
"MultiMaster Host Adapter\n", NULL, irq_ch);
+   blogic_err("BusLogic: IRQ Channel %d invalid for 
MultiMaster Host Adapter\n", NULL, irq_ch);
blogic_err("at PCI Bus %d Device %d I/O Address 
0x%lX\n", NULL, bus, device, io_addr);
continue;
}
if (blogic_global_options.trace_probe) {
-   blogic_notice("BusLogic: PCI MultiMaster Host Adapter " 
"detected at\n", NULL);
+   blogic_notice("BusLogic: PCI MultiMaster Host Adapter 
detected at\n", NULL);
blogic_notice("BusLogic: PCI Bus %d Device %d I/O 
Address 0x%lX PCI Address 0x%lX\n", NULL, bus, device, io_addr, pci_addr);
}
/*
@@ -822,7 +822,7 @@ static int __init blogic_init_mm_probeinfo(struct 
blogic_adapter *adapter)
nonpr_mmcount++;
mmcount++;
} else
-   blogic_warn("BusLogic: Too many Host Adapters " 
"detected\n", NULL);
+   blogic_warn("BusLogic: Too many Host Adapters 
detected\n", NULL);
}
/*
   If the AutoSCSI "Use Bus And Device # For PCI Scanning Seq."
@@ -960,22 +960,22 @@ static int __init blogic_init_fp_probeinfo(struct 
blogic_adapter *adapter)
pci_addr = base_addr1 = pci_resource_start(pci_device, 1);
 #ifdef CONFIG_SCSI_FLASHPOINT
if (pci_resource_flags(pci_device, 0) & IORESOURCE_MEM) {
-   blogic_err("BusLogic: Base Address0 0x%lX not I/O for " 
"FlashPoint Host Adapter\n", NULL, base_addr0);
+   blogic_err("BusLogic: Base Address0 0x%lX not I/O for 
FlashPoint Host Adapter\n", NULL, base_addr0);
blogic_err("at PCI Bus %d Device %d I/O Address 
0x%lX\n", NULL, bus, device, io_addr);
continue;
}
if (pci_resource_flags(pc

[PATCH 3/3] BusLogic: Use more conventional argument order for logging

2013-05-16 Thread Joe Perches
Subsystem specific logging messages generally use
subsystem_(struct subsystem *, fmt, ...)
not
subsystem_(fmt, struct subsystem *, ...)

Convert to use the more generally used kernel style.

Signed-off-by: Joe Perches 
---
 drivers/scsi/BusLogic.c | 304 
 drivers/scsi/BusLogic.h |  24 ++--
 2 files changed, 161 insertions(+), 167 deletions(-)

diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index bd588cf..d5a5d97 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -140,8 +140,8 @@ static char *blogic_cmd_failure_reason;
 
 static void blogic_announce_drvr(struct blogic_adapter *adapter)
 {
-   blogic_announce("* BusLogic SCSI Driver Version " 
blogic_drvr_version " of " blogic_drvr_date " *\n", adapter);
-   blogic_announce("Copyright 1995-1998 by Leonard N. Zubkoff 
\n", adapter);
+   blogic_announce(adapter, "* BusLogic SCSI Driver Version " 
blogic_drvr_version " of " blogic_drvr_date " *\n");
+   blogic_announce(adapter, "Copyright 1995-1998 by Leonard N. Zubkoff 
\n");
 }
 
 
@@ -204,8 +204,7 @@ static bool __init blogic_create_initccbs(struct 
blogic_adapter *adapter)
blk_pointer = pci_alloc_consistent(adapter->pci_device,
blk_size, &blkp);
if (blk_pointer == NULL) {
-   blogic_err("UNABLE TO ALLOCATE CCB GROUP - DETACHING\n",
-   adapter);
+   blogic_err(adapter, "UNABLE TO ALLOCATE CCB GROUP - 
DETACHING\n");
return false;
}
blogic_init_ccbs(adapter, blk_pointer, blk_size, blkp);
@@ -264,10 +263,10 @@ static void blogic_create_addlccbs(struct blogic_adapter 
*adapter,
}
if (adapter->alloc_ccbs > prev_alloc) {
if (print_success)
-   blogic_notice("Allocated %d additional CCBs (total now 
%d)\n", adapter, adapter->alloc_ccbs - prev_alloc, adapter->alloc_ccbs);
+   blogic_notice(adapter, "Allocated %d additional CCBs 
(total now %d)\n", adapter->alloc_ccbs - prev_alloc, adapter->alloc_ccbs);
return;
}
-   blogic_notice("Failed to allocate additional CCBs\n", adapter);
+   blogic_notice(adapter, "Failed to allocate additional CCBs\n");
if (adapter->drvr_qdepth > adapter->alloc_ccbs - adapter->tgt_count) {
adapter->drvr_qdepth = adapter->alloc_ccbs - adapter->tgt_count;
adapter->scsi_host->can_queue = adapter->drvr_qdepth;
@@ -444,7 +443,7 @@ static int blogic_cmd(struct blogic_adapter *adapter, enum 
blogic_opcode opcode,
goto done;
}
if (blogic_global_options.trace_config)
-   blogic_notice("blogic_cmd(%02X) Status = %02X: (Modify 
I/O Address)\n", adapter, opcode, statusreg.all);
+   blogic_notice(adapter, "blogic_cmd(%02X) Status = %02X: 
(Modify I/O Address)\n", opcode, statusreg.all);
result = 0;
goto done;
}
@@ -502,15 +501,15 @@ static int blogic_cmd(struct blogic_adapter *adapter, 
enum blogic_opcode opcode,
 */
if (blogic_global_options.trace_config) {
int i;
-   blogic_notice("blogic_cmd(%02X) Status = %02X: %2d ==> %2d:",
-   adapter, opcode, statusreg.all, replylen,
-   reply_b);
+   blogic_notice(adapter, "blogic_cmd(%02X) Status = %02X: %2d ==> 
%2d:",
+ opcode, statusreg.all, replylen,
+ reply_b);
if (replylen > reply_b)
replylen = reply_b;
for (i = 0; i < replylen; i++)
-   blogic_notice(" %02X", adapter,
-   ((unsigned char *) reply)[i]);
-   blogic_notice("\n", adapter);
+   blogic_notice(adapter, " %02X",
+ ((unsigned char *) reply)[i]);
+   blogic_notice(adapter, "\n");
}
/*
   Process Command Invalid conditions.
@@ -720,23 +719,23 @@ static int __init blogic_init_mm_probeinfo(struct 
blogic_adapter *adapter)
pci_addr = base_addr1 = pci_resource_start(pci_device, 1);
 
if (pci_resource_flags(pci_device, 0) & IORESOURCE_MEM) {
-   blogic_err("BusLogic: Base Address0 0x%lX not I/O for 
MultiMaster Host Adapter\n", NULL, base_addr0);
-  

Re: [PATCH 0/3] BusLogic: Message logging neatening

2013-05-17 Thread Joe Perches
On Fri, 2013-05-17 at 14:18 -0600, Khalid Aziz wrote:
> On Thu, 2013-05-16 at 21:58 -0700, Joe Perches wrote:
> > If you're going through the trouble to fix this CamelCase stuff
> > and make it work on 64 bit, how about a little more cleanup?
> 
> Sounds good to me.

btw, for the BusLogic code:

There seem to be places where addresses are cast to u32.

I don't know the code at all, but that could likely
cause problems with 64 bit addresses.

$ git grep "(u32)" drivers/scsi/BusLogic.c
drivers/scsi/BusLogic.c:ccb->dma_handle = (u32) blkp + offset;
drivers/scsi/BusLogic.c:fpinfo->base_addr = (u32) 
adapter->io_addr;
drivers/scsi/BusLogic.c:extmbox_req.base_mbox_addr = (u32) 
adapter->mbox_space_handle;

--
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: mpt2sas,mpt3sas watchdog device removal

2013-05-17 Thread Joe Lawrence
On Fri, 17 May 2013 09:29:06 -0600
Bjorn Helgaas  wrote:

> [+cc linux-pci]
> 
> On Wed, May 15, 2013 at 11:29 AM, Joe Lawrence
>  wrote:
> > From 84ac7a35ebd61e84d4254eae78bb967de17254c2 Mon Sep 17 00:00:00
> > 2001 From: Joe Lawrence 
> > Date: Wed, 15 May 2013 12:52:31 -0400
> > Subject: [PATCH] mpt2sas,mpt3sas: make watchdog instantiated device
> > removal safe
> >
> > Calling pci_stop_and_remove_bus_device from a SCSI LLD may introduce
> > device removal races with PCI callback functions.
> >
> > Simplify the mpt2sas watchdog mechanism by separating PCI device
> > removal from SCSI midlayer detachment. When the watchdog wishes to
> > remove a SCSI device from the topology, detach from the SCSI
> > midlayer, leaving the PCI device alone. Adjust various pci_driver
> > callbacks to account for a potentially SCSI detached PCI device.
> 
> I don't know the details of the SCSI detachment, but this approach
> looks much cleaner to me.

Thanks for commenting, Bjorn.  I think this approach more closely
represents what this watchdog is trying to accomplish.  

Off list, Sreekanth from LSI tested and noticed a few issues with this
patch:

 - mpt2sas_base_stop_watchdog is called twice: The call from
   mpt2sas_base_detach is safe, but now unnecessary (as a call was
   added earlier up in the PCI driver callbacks to ensure that the
   watchdog was out of the way.) This second invocation can be removed.

 - If the watchdog detects a bad IOC, the watchdog remains running:
   The watchdog workqueue isn't cleaned up until
   mpt2sas_base_stop_watchdog is called, so in the case that the
   watchdog removes the device from SCSI topo, the workqueue will
   remain unused until PCI .remove/.shutdown cleans it up. Perhaps a
   single watchdog that iterates over all adapters would be simpler?

Finally, if SCSI topo detachment is all that is interesting here, would
it make more sense to move the watchdog into the MPT "scsi" code?  I
haven't looked at the code yet, but this might make an MPT fusion patch
easier (due to dependencies between its "scsi" and "base" modules).

Regards,

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


[PATCH v4] block: handle pointer error from blk_get_request

2013-05-23 Thread Joe Lawrence
Hi Jens,

A small fix to this patch to properly cleanup sg_scsi_ioctl buffer when
blk_get_request fails (a return value check was introduced in patch
version 1). Since this is change emanates out of the block layer, I'm
assuming it should go through your tree, though I'm not sure which
branch it needs to be based on. It appears to apply cleanly to for-3.10
and for-3.11. Let me know what you prefer.

Changes from v3:
 - Fix memory leak introduced in previous patch versions of
   sg_scsi_ioctl error path

Regards,

-- Joe

>From 07293e4ce42dfc9a2688fac1ce62a32853348fc3 Mon Sep 17 00:00:00 2001
From: Joe Lawrence 
Date: Thu, 23 May 2013 15:05:08 -0400
Subject: [PATCH v4] block: handle pointer error from blk_get_request

The blk_get_request function may fail in low-memory conditions or during
device removal (even if __GFP_WAIT is set). To distinguish between these
errors, modify the blk_get_request call stack to return the appropriate
error pointer. Verify that all callers check the return status and
consider IS_ERR instead of a simple NULL pointer check.

Signed-off-by: Joe Lawrence 
Cc: Jens Axboe 
Cc: "James E.J. Bottomley" 
Cc: Bart Van Assche 
Cc: linux-scsi@vger.kernel.org
---
 block/blk-core.c| 34 ++---
 block/bsg.c |  8 +++
 block/scsi_ioctl.c  | 13 ---
 drivers/block/paride/pd.c   |  2 ++
 drivers/block/pktcdvd.c |  3 ++-
 drivers/block/sx8.c |  2 +-
 drivers/cdrom/cdrom.c   |  4 ++--
 drivers/ide/ide-park.c  |  2 +-
 drivers/scsi/device_handler/scsi_dh_alua.c  |  2 +-
 drivers/scsi/device_handler/scsi_dh_emc.c   |  2 +-
 drivers/scsi/device_handler/scsi_dh_hp_sw.c |  4 ++--
 drivers/scsi/device_handler/scsi_dh_rdac.c  |  2 +-
 drivers/scsi/osd/osd_initiator.c|  4 ++--
 drivers/scsi/osst.c |  2 +-
 drivers/scsi/scsi_error.c   |  2 ++
 drivers/scsi/scsi_lib.c |  2 +-
 drivers/scsi/scsi_tgt_lib.c |  2 +-
 drivers/scsi/sg.c   |  4 ++--
 drivers/scsi/st.c   |  2 +-
 drivers/target/target_core_pscsi.c  |  4 ++--
 20 files changed, 56 insertions(+), 44 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index f224d17..9e254e4 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -886,9 +886,9 @@ static struct io_context *rq_ioc(struct bio *bio)
  * Get a free request from @q.  This function may fail under memory
  * pressure or if @q is dead.
  *
- * Must be callled with @q->queue_lock held and,
- * Returns %NULL on failure, with @q->queue_lock held.
- * Returns !%NULL on success, with @q->queue_lock *not held*.
+ * Must be called with @q->queue_lock held and,
+ * Returns ERR_PTR on failure, with @q->queue_lock held.
+ * Returns request pointer on success, with @q->queue_lock *not held*.
  */
 static struct request *__get_request(struct request_list *rl, int rw_flags,
 struct bio *bio, gfp_t gfp_mask)
@@ -902,7 +902,7 @@ static struct request *__get_request(struct request_list 
*rl, int rw_flags,
int may_queue;
 
if (unlikely(blk_queue_dying(q)))
-   return NULL;
+   return ERR_PTR(-ENODEV);
 
may_queue = elv_may_queue(q, rw_flags);
if (may_queue == ELV_MQUEUE_NO)
@@ -927,7 +927,7 @@ static struct request *__get_request(struct request_list 
*rl, int rw_flags,
 * process is not a "batcher", and not
 * exempted by the IO scheduler
 */
-   return NULL;
+   return ERR_PTR(-ENOMEM);
}
}
}
@@ -945,7 +945,7 @@ static struct request *__get_request(struct request_list 
*rl, int rw_flags,
 * allocated with any setting of ->nr_requests
 */
if (rl->count[is_sync] >= (3 * q->nr_requests / 2))
-   return NULL;
+   return ERR_PTR(-ENOMEM);
 
q->nr_rqs[is_sync]++;
rl->count[is_sync]++;
@@ -1050,7 +1050,7 @@ fail_alloc:
 rq_starved:
if (unlikely(rl->count[is_sync] == 0))
rl->starved[is_sync] = 1;
-   return NULL;
+   return ERR_PTR(-ENOMEM);
 }
 
 /**
@@ -1063,9 +1063,9 @@ rq_starved:
  * Get a free request from @q.  If %__GFP_WAIT is set in @gfp_mask, this
  * function keeps retrying under memory pressure and fails iff @q is dead.
  *
- * Must be callled with @q->queue_lock held and,
- * Returns %NULL on failure, with @q->queue_lock held.
- * Returns !%NULL on success, with @q->queue_lock *not held*.
+ * Must be called wi

  1   2   3   4   5   >