Re: [PATCH 1/2] wd719x: Remove last declaration using DEFINE_PCI_DEVICE_TABLE

2016-08-31 Thread Bart Van Assche
On 08/31/16 09:19, Joe Perches wrote:
> Convert it to the preferred const struct pci_device_id instead.

Reviewed-by: Bart Van Assche 
--
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


Issues with LSI-3008 adapters, mpt3sas driver

2016-08-31 Thread Douglas Miller

Hi all,

I am seeing an issue while using an LSI-3008-based adapter (mpt3sas 
driver) on a PowerPC system (although I am not yet convinced it is 
architecture dependent). When I create a RAID1 volume, the physical disk 
devices get "hidden" as expected however the various kernel objects are 
out of sync. The corresponding bits in the "sd_index_ida" bitmap gets 
cleared, and the symlink in /sys/dev/block for this major:minor pair 
gets removed, but none of the other major:minor entries in sysfs get 
removed. The next time a new device is added (for example, during 
another RAID volume create or delete), the recently-freed major:minor 
number is picked up from the "sd_index_ida" bitmap but the attempt to 
create sysfs entries fails EEXIST due to an entry by the same name 
already (still) existing. This failure goes unhandled and later the 
kernel panics in sd_probe_async while dereferencing an (apparently) 
invalid backing_dev_info structure (presumably left invalid due to the 
EEXIST error).


A reboot clears this (bitmaps and sysfs) up and the second RAID volume 
(if a create was done) shows up normally. However, even if the panic 
were avoided by better error handling in sd_probe_async there would 
still be the problem of being able to create more than one RAID volume 
without rebooting.


I am wondering if this issue has been seen elsewhere, and also just what 
might be going wrong. For mpt3sas, it appears that the firmware largely 
drives the hiding/exposing of devices but I don't see an issue with the 
ordering of those events. I am wondering if the driver is failing to 
setup the device attributes correctly in order to get the proper sysfs 
handling.


I am seeing this on Ubuntu 16.04, but also see it on the upstream 
kernel. Oddly, it does not happen on RHEL 7.2 (an older kernel).


A possibly-related issue we see is that when a RAID volume is deleted, 
none of the RAID device nodes (/dev as well as /sys/) get removed - 
although they are unusable. Deleting before creating does not produce 
the panic, so I believe the "sd_index_ida" bitmap is not getting updated 
by the delete.



Any help would be appreciated.

Thanks,

Doug

--
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 07/15] smartpqi: correct controller offline issue

2016-08-31 Thread Don Brace
From: Kevin Barnett 

Fixes: 6c223761e 'smartpqi: initial commit of Microsemi smartpqi driver'

Fixed a bug where the driver would not free all of the
controller resources if the controller ever went offline.

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Johannes Thumshirn 
Reviewed-by: Tomas Henzl 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi_init.c |   15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index 43bfeac..d759703 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -5609,19 +5609,14 @@ static void pqi_free_ctrl_resources(struct 
pqi_ctrl_info *ctrl_info)
 
 static void pqi_remove_ctrl(struct pqi_ctrl_info *ctrl_info)
 {
-   int rc;
+   cancel_delayed_work_sync(_info->rescan_work);
+   cancel_delayed_work_sync(_info->update_time_work);
+   pqi_remove_all_scsi_devices(ctrl_info);
+   pqi_unregister_scsi(ctrl_info);
 
-   if (ctrl_info->controller_online) {
-   cancel_delayed_work_sync(_info->rescan_work);
-   cancel_delayed_work_sync(_info->update_time_work);
-   pqi_remove_all_scsi_devices(ctrl_info);
-   pqi_unregister_scsi(ctrl_info);
-   ctrl_info->controller_online = false;
-   }
if (ctrl_info->pqi_mode_enabled) {
sis_disable_msix(ctrl_info);
-   rc = pqi_reset(ctrl_info);
-   if (rc == 0)
+   if (pqi_reset(ctrl_info) == 0)
sis_reenable_sis_mode(ctrl_info);
}
pqi_free_ctrl_resources(ctrl_info);

--
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 06/15] smartpqi: add kdump support

2016-08-31 Thread Don Brace
From: Kevin Barnett 

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Johannes Thumshirn 
Reviewed-by: Tomas Henzl 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi.h  |   13 +---
 drivers/scsi/smartpqi/smartpqi_init.c |   35 +
 drivers/scsi/smartpqi/smartpqi_sis.c  |   10 +
 drivers/scsi/smartpqi/smartpqi_sis.h  |2 ++
 4 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h
index 053be6b..5f965ad 100644
--- a/drivers/scsi/smartpqi/smartpqi.h
+++ b/drivers/scsi/smartpqi/smartpqi.h
@@ -79,11 +79,13 @@ struct pqi_ctrl_registers {
__le32  sis_ctrl_to_host_doorbell;  /* 9Ch */
u8  reserved3[0xa0 - (0x9c + sizeof(__le32))];
__le32  sis_ctrl_to_host_doorbell_clear;/* A0h */
-   u8  reserved4[0xbc - (0xa0 + sizeof(__le32))];
+   u8  reserved4[0xb0 - (0xa0 + sizeof(__le32))];
+   __le32  sis_driver_scratch; /* B0h */
+   u8  reserved5[0xbc - (0xb0 + sizeof(__le32))];
__le32  sis_firmware_status;/* BCh */
-   u8  reserved5[0x1000 - (0xbc + sizeof(__le32))];
+   u8  reserved6[0x1000 - (0xbc + sizeof(__le32))];
__le32  sis_mailbox[8]; /* 1000h */
-   u8  reserved6[0x4000 - (0x1000 + (sizeof(__le32) * 8))];
+   u8  reserved7[0x4000 - (0x1000 + (sizeof(__le32) * 8))];
/*
 * The PQI spec states that the PQI registers should be at
 * offset 0 from the PCIe BAR 0.  However, we can't map
@@ -963,6 +965,11 @@ struct pqi_ctrl_info {
struct semaphore lun_reset_sem;
 };
 
+enum pqi_ctrl_mode {
+   UNKNOWN,
+   PQI_MODE
+};
+
 /*
  * assume worst case: SATA queue depth of 31 minus 4 internal firmware commands
  */
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index dbc8b40..43bfeac 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -153,6 +153,18 @@ static inline bool pqi_is_hba_lunid(u8 *scsi3addr)
return pqi_scsi3addr_equal(scsi3addr, RAID_CTLR_LUNID);
 }
 
+static inline enum pqi_ctrl_mode pqi_get_ctrl_mode(
+   struct pqi_ctrl_info *ctrl_info)
+{
+   return sis_read_driver_scratch(ctrl_info);
+}
+
+static inline void pqi_save_ctrl_mode(struct pqi_ctrl_info *ctrl_info,
+   enum pqi_ctrl_mode mode)
+{
+   sis_write_driver_scratch(ctrl_info, mode);
+}
+
 #define PQI_RESCAN_WORK_INTERVAL   (10 * HZ)
 
 static inline void pqi_schedule_rescan_worker(struct pqi_ctrl_info *ctrl_info)
@@ -5266,10 +5278,30 @@ out:
return rc;
 }
 
+static int pqi_kdump_init(struct pqi_ctrl_info *ctrl_info)
+{
+   if (!sis_is_firmware_running(ctrl_info))
+   return -ENXIO;
+
+   if (pqi_get_ctrl_mode(ctrl_info) == PQI_MODE) {
+   sis_disable_msix(ctrl_info);
+   if (pqi_reset(ctrl_info) == 0)
+   sis_reenable_sis_mode(ctrl_info);
+   }
+
+   return 0;
+}
+
 static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info)
 {
int rc;
 
+   if (reset_devices) {
+   rc = pqi_kdump_init(ctrl_info);
+   if (rc)
+   return rc;
+   }
+
/*
 * When the controller comes out of reset, it is always running
 * in legacy SIS mode.  This is so that it can be compatible
@@ -5343,6 +5375,7 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info)
 
/* From here on, we are running in PQI mode. */
ctrl_info->pqi_mode_enabled = true;
+   pqi_save_ctrl_mode(ctrl_info, PQI_MODE);
 
rc = pqi_alloc_admin_queues(ctrl_info);
if (rc) {
@@ -5879,6 +5912,8 @@ static void __attribute__((unused)) 
verify_structures(void)
BUILD_BUG_ON(offsetof(struct pqi_ctrl_registers,
sis_ctrl_to_host_doorbell_clear) != 0xa0);
BUILD_BUG_ON(offsetof(struct pqi_ctrl_registers,
+   sis_driver_scratch) != 0xb0);
+   BUILD_BUG_ON(offsetof(struct pqi_ctrl_registers,
sis_firmware_status) != 0xbc);
BUILD_BUG_ON(offsetof(struct pqi_ctrl_registers,
sis_mailbox) != 0x1000);
diff --git a/drivers/scsi/smartpqi/smartpqi_sis.c 
b/drivers/scsi/smartpqi/smartpqi_sis.c
index 5d416a8..71408f9 100644
--- a/drivers/scsi/smartpqi/smartpqi_sis.c
+++ b/drivers/scsi/smartpqi/smartpqi_sis.c
@@ -376,6 +376,16 @@ int sis_reenable_sis_mode(struct pqi_ctrl_info *ctrl_info)
return rc;
 }
 
+void sis_write_driver_scratch(struct pqi_ctrl_info *ctrl_info, u32 value)
+{
+   writel(value, _info->registers->sis_driver_scratch);
+}
+
+u32 

[PATCH V2 04/15] smartpqi: enhance drive offline informational message

2016-08-31 Thread Don Brace
From: Kevin Barnett 

Made a couple of error messages more verbose.

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Johannes Thumshirn 
Reviewed-by: Tomas Henzl 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi_init.c |5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index 9922e31..198a7c2 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2298,11 +2298,16 @@ static inline void pqi_aio_path_disabled(struct 
pqi_io_request *io_request)
 static inline void pqi_take_device_offline(struct scsi_device *sdev)
 {
struct pqi_ctrl_info *ctrl_info;
+   struct pqi_scsi_dev *device;
 
if (scsi_device_online(sdev)) {
scsi_device_set_state(sdev, SDEV_OFFLINE);
ctrl_info = shost_to_hba(sdev->host);
schedule_delayed_work(_info->rescan_work, 0);
+   device = sdev->hostdata;
+   dev_err(_info->pci_dev->dev, "offlined scsi %d:%d:%d:%d\n",
+   ctrl_info->scsi_host->host_no, device->bus,
+   device->target, device->lun);
}
 }
 

--
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 08/15] smartpqi: correct event acknowledgment timeout issue

2016-08-31 Thread Don Brace
From: Kevin Barnett 

the driver no longer waits for the firmware to consume
the event ack IU.

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Johannes Thumshirn 
Reviewed-by: Tomas Henzl 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi.h  |   14 +++---
 drivers/scsi/smartpqi/smartpqi_init.c |   20 
 2 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h
index 5f965ad..07b6444 100644
--- a/drivers/scsi/smartpqi/smartpqi.h
+++ b/drivers/scsi/smartpqi/smartpqi.h
@@ -634,13 +634,6 @@ struct pqi_encryption_info {
 
 #define RAID_MAP_MAX_ENTRIES   1024
 
-#define PQI_RESERVED_IO_SLOTS_LUN_RESET1
-#define PQI_RESERVED_IO_SLOTS_EVENT_ACK1
-#define PQI_RESERVED_IO_SLOTS_SYNCHRONOUS_REQUESTS 3
-#define PQI_RESERVED_IO_SLOTS  \
-   (PQI_RESERVED_IO_SLOTS_LUN_RESET + PQI_RESERVED_IO_SLOTS_EVENT_ACK + \
-   PQI_RESERVED_IO_SLOTS_SYNCHRONOUS_REQUESTS)
-
 #define PQI_PHYSICAL_DEVICE_BUS0
 #define PQI_RAID_VOLUME_BUS1
 #define PQI_HBA_BUS2
@@ -884,6 +877,13 @@ struct pqi_event {
__le32  additional_event_id;
 };
 
+#define PQI_RESERVED_IO_SLOTS_LUN_RESET1
+#define PQI_RESERVED_IO_SLOTS_EVENT_ACK
PQI_NUM_SUPPORTED_EVENTS
+#define PQI_RESERVED_IO_SLOTS_SYNCHRONOUS_REQUESTS 3
+#define PQI_RESERVED_IO_SLOTS  \
+   (PQI_RESERVED_IO_SLOTS_LUN_RESET + PQI_RESERVED_IO_SLOTS_EVENT_ACK + \
+   PQI_RESERVED_IO_SLOTS_SYNCHRONOUS_REQUESTS)
+
 struct pqi_ctrl_info {
unsigned intctrl_id;
struct pci_dev  *pci_dev;
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index d759703..ea822b1 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2642,26 +2642,6 @@ static void pqi_start_event_ack(struct pqi_ctrl_info 
*ctrl_info,
writel(iq_pi, queue_group->iq_pi[RAID_PATH]);
 
spin_unlock_irqrestore(_group->submit_lock[RAID_PATH], flags);
-
-   /*
-* We have to special-case this type of request because the firmware
-* does not generate an interrupt when this type of request completes.
-* Therefore, we have to poll until we see that the firmware has
-* consumed the request before we move on.
-*/
-
-   timeout = (PQI_EVENT_ACK_TIMEOUT * HZ) + jiffies;
-
-   while (1) {
-   if (*queue_group->iq_ci[RAID_PATH] == iq_pi)
-   break;
-   if (time_after(jiffies, timeout)) {
-   dev_err(_info->pci_dev->dev,
-   "completing event acknowledge timed out\n");
-   break;
-   }
-   usleep_range(1000, 2000);
-   }
 }
 
 static void pqi_acknowledge_event(struct pqi_ctrl_info *ctrl_info,

--
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 11/15] smartpqi: scsi queuecommand cleanup

2016-08-31 Thread Don Brace
From: Kevin Barnett 

minor cleanup of scsi queue command function

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Johannes Thumshirn 
Reviewed-by: Tomas Henzl 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi_init.c |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index db248c1..f0672ed 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -4514,7 +4514,7 @@ static int pqi_aio_submit_io(struct pqi_ctrl_info 
*ctrl_info,
 }
 
 static int pqi_scsi_queue_command(struct Scsi_Host *shost,
-   struct scsi_cmnd *scmd)
+   struct scsi_cmnd *scmd)
 {
int rc;
struct pqi_ctrl_info *ctrl_info;
@@ -4532,6 +4532,12 @@ static int pqi_scsi_queue_command(struct Scsi_Host 
*shost,
return 0;
}
 
+   /*
+* This is necessary because the SML doesn't zero out this field during
+* error recovery.
+*/
+   scmd->result = 0;
+
hwq = blk_mq_unique_tag_to_hwq(blk_mq_unique_tag(scmd->request));
if (hwq >= ctrl_info->num_queue_groups)
hwq = 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


[PATCH V2 14/15] smartpqi: add smartpqi.txt

2016-08-31 Thread Don Brace
added Documentation/scsi/smartpqi.txt

Reviewed-by: Kevin Barnett 
Reviewed-by: Scott Benesh 
Reviewed-by: Johannes Thumshirn 
Signed-off-by: Don Brace 
---
 Documentation/scsi/smartpqi.txt |   80 +++
 MAINTAINERS |1 
 2 files changed, 81 insertions(+)
 create mode 100644 Documentation/scsi/smartpqi.txt

diff --git a/Documentation/scsi/smartpqi.txt b/Documentation/scsi/smartpqi.txt
new file mode 100644
index 000..ab377d9
--- /dev/null
+++ b/Documentation/scsi/smartpqi.txt
@@ -0,0 +1,80 @@
+
+SMARTPQI - Microsemi Smart PQI Driver
+-
+
+This file describes the smartpqi SCSI driver for Microsemi
+(http://www.microsemi.com) PQI controllers. The smartpqi driver
+is the next generation SCSI driver for Microsemi Corp. The smartpqi
+driver is the first SCSI driver to implement the PQI queuing model.
+
+The smartpqi driver will replace the aacraid driver for Adaptec Series 9
+controllers. Customers running an older kernel (Pre-4.9) using an Adaptec
+Series 9 controller will have to configure the smartpqi driver or their
+volumes will not be added to the OS.
+
+For Microsemi smartpqi controller support, enable the smartpqi driver
+when configuring the kernel.
+
+For more information on the PQI Queuing Interface, please see:
+http://www.t10.org/drafts.htm
+http://www.t10.org/members/w_pqi2.htm
+
+Supported devices:
+--
+
+
+smartpqi specific entries in /sys
+-
+
+  smartpqi host attributes:
+  -
+  /sys/class/scsi_host/host*/rescan
+  /sys/class/scsi_host/host*/version
+
+  The host rescan attribute is a write only attribute. Writing to this
+  attribute will trigger the driver to scan for new, changed, or removed
+  devices and notify the SCSI mid-layer of any changes detected.
+
+  The version attribute is read-only and will return the driver version
+  and the controller firmware version.
+  For example:
+  driver: 0.9.13-370
+  firmware: 0.01-522
+
+  smartpqi sas device attributes
+  --
+  HBA devices are added to the SAS transport layer. These attributes are
+  automatically added by the SAS transport layer.
+
+  /sys/class/sas_device/end_device-X:X/sas_address
+  /sys/class/sas_device/end_device-X:X/enclosure_identifier
+  /sys/class/sas_device/end_device-X:X/scsi_target_id
+
+smartpqi specific ioctls:
+-
+
+  For compatibility with applications written for the cciss protocol.
+
+  CCISS_DEREGDISK
+  CCISS_REGNEWDISK
+  CCISS_REGNEWD
+
+  The above three ioctls all do exactly the same thing, which is to cause the 
driver
+  to rescan for new devices.  This does exactly the same thing as writing to 
the
+  smartpqi specific host "rescan" attribute.
+
+  CCISS_GETPCIINFO
+
+   Returns PCI domain, bus, device and function and "board ID" (PCI 
subsystem ID).
+
+  CCISS_GETDRIVVER
+
+   Returns driver version in three bytes encoded as:
+   (DRIVER_MAJOR << 28) | (DRIVER_MINOR << 24) | (DRIVER_RELEASE << 16) | 
DRIVER_REVISION;
+
+  CCISS_PASSTHRU
+
+   Allows "BMIC" and "CISS" commands to be passed through to the Smart 
Storage Array.
+   These are used extensively by the SSA Array Configuration Utility, SNMP 
storage
+   agents, etc.
+
diff --git a/MAINTAINERS b/MAINTAINERS
index a05b045..ce68350 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5456,6 +5456,7 @@ F:drivers/scsi/smartpqi/Kconfig
 F: drivers/scsi/smartpqi/Makefile
 F: include/linux/cciss*.h
 F: include/uapi/linux/cciss*.h
+F: Documentation/scsi/smartpqi.txt
 
 HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa)
 M: Don Brace 

--
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 12/15] smartpqi: remove timeout for cache flush operations

2016-08-31 Thread Don Brace
From: Kevin Barnett 

Some cache flush operations can take longer than the
timeout value. Best to not impose a time limit to
handle all cases.

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Johannes Thumshirn 
Reviewed-by: Tomas Henzl 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi_init.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index f0672ed..c6dcb33 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -407,7 +407,6 @@ static int pqi_identify_physical_device(struct 
pqi_ctrl_info *ctrl_info,
 }
 
 #define SA_CACHE_FLUSH_BUFFER_LENGTH   4
-#define PQI_FLUSH_CACHE_TIMEOUT(30 * 1000)
 
 static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info)
 {
@@ -434,7 +433,7 @@ static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info)
goto out;
 
rc = pqi_submit_raid_request_synchronous(ctrl_info, ,
-   0, NULL, PQI_FLUSH_CACHE_TIMEOUT);
+   0, NULL, NO_TIMEOUT);
 
pqi_pci_unmap(ctrl_info->pci_dev, request.sg_descriptors, 1,
pci_direction);

--
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 15/15] smartqi: bump driver version

2016-08-31 Thread Don Brace
From: Kevin Barnett 

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Tomas Henzl 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi_init.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index c6dcb33..52cfa26 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -38,11 +38,11 @@
 #define BUILD_TIMESTAMP
 #endif
 
-#define DRIVER_VERSION "0.9.9-100"
+#define DRIVER_VERSION "0.9.13-370"
 #define DRIVER_MAJOR   0
 #define DRIVER_MINOR   9
-#define DRIVER_RELEASE 9
-#define DRIVER_REVISION100
+#define DRIVER_RELEASE 13
+#define DRIVER_REVISION370
 
 #define DRIVER_NAME"Microsemi PQI Driver (v" DRIVER_VERSION ")"
 #define DRIVER_NAME_SHORT  "smartpqi"

--
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 13/15] smartpqi: update Kconfig

2016-08-31 Thread Don Brace
From: Kevin Barnett 

The aacraid driver will not managage Microsemi
smartpqi controllers, but will still manage
older aacraid devices.

Updated help section.

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Kevin Barnett 
Reviewed-by: Johannes Thumshirn 
Reviewed-by: Tomas Henzl 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/Kconfig |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/smartpqi/Kconfig b/drivers/scsi/smartpqi/Kconfig
index 5d77a80..97e159c 100644
--- a/drivers/scsi/smartpqi/Kconfig
+++ b/drivers/scsi/smartpqi/Kconfig
@@ -37,7 +37,6 @@
 
 config SCSI_SMARTPQI
tristate "Microsemi PQI Driver"
-   default n
depends on PCI && SCSI && !S390
select SCSI_SAS_ATTRS
select RAID_ATTRS
@@ -47,4 +46,9 @@ config SCSI_SMARTPQI

 
To compile this driver as a module, choose M here: the
-   module will be called smartpqi
+   module will be called smartpqi.
+
+Note: the aacraid driver will not manage a smartpqi
+  controller. You need to enable smartpqi for smartpqi
+  controllers. For more information, please see
+  Documentation/scsi/smartpqi.txt

--
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 10/15] smartpqi: minor tweaks to update time support

2016-08-31 Thread Don Brace
From: Kevin Barnett 

minor tweaks to update time support

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Johannes Thumshirn 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi_init.c |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index bfd2d75..db248c1 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -588,10 +588,6 @@ static void pqi_update_time_worker(struct work_struct 
*work)
ctrl_info = container_of(to_delayed_work(work), struct pqi_ctrl_info,
update_time_work);
 
-   if (!ctrl_info) {
-   printk("%s: NULL controller pointer.\n", __func__);
-   return;
-   }
rc = pqi_write_current_time_to_host_wellness(ctrl_info);
if (rc)
dev_warn(_info->pci_dev->dev,
@@ -602,9 +598,9 @@ static void pqi_update_time_worker(struct work_struct *work)
 }
 
 static inline void pqi_schedule_update_time_worker(
-   struct pqi_ctrl_info *ctrl_info)
+   struct pqi_ctrl_info *ctrl_info)
 {
-   schedule_delayed_work(_info->update_time_work, 120);
+   schedule_delayed_work(_info->update_time_work, 0);
 }
 
 static int pqi_report_luns(struct pqi_ctrl_info *ctrl_info, u8 cmd,

--
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 09/15] smartpqi: minor function reformating

2016-08-31 Thread Don Brace
From: Kevin Barnett 

reformatted pqi_num_elements_free() to match the rest of the driver

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Tomas Henzl 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi_init.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index ea822b1..bfd2d75 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2576,8 +2576,7 @@ static unsigned int pqi_process_io_intr(struct 
pqi_ctrl_info *ctrl_info,
 }
 
 static inline unsigned int pqi_num_elements_free(unsigned int pi,
-   unsigned int ci,
-   unsigned int elements_in_queue)
+   unsigned int ci, unsigned int elements_in_queue)
 {
unsigned int num_elements_used;
 

--
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 02/15] smartpqi: change tmf macro names

2016-08-31 Thread Don Brace
From: Kevin Barnett 

small change to make code look cleaner

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Johannes Thumshirn 
Reviewed-by: Tomas Henzl 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi.h  |6 ++
 drivers/scsi/smartpqi/smartpqi_init.c |4 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h
index ea49005..dbcdb03 100644
--- a/drivers/scsi/smartpqi/smartpqi.h
+++ b/drivers/scsi/smartpqi/smartpqi.h
@@ -545,10 +545,8 @@ typedef u32 pqi_index_t;
 #define SOP_TASK_ATTRIBUTE_ORDERED 2
 #define SOP_TASK_ATTRIBUTE_ACA 4
 
-#define SOP_TASK_MANAGEMENT_FUNCTION_COMPLETE  0x0
-#define SOP_TASK_MANAGEMENT_FUNCTION_REJECTED  0x4
-#define SOP_TASK_MANAGEMENT_FUNCTION_FAILED0x5
-#define SOP_TASK_MANAGEMENT_FUNCTION_SUCCEEDED 0x8
+#define SOP_TMF_COMPLETE   0x0
+#define SOP_TMF_FUNCTION_SUCCEEDED 0x8
 
 /* additional CDB bytes usage field codes */
 #define SOP_ADDITIONAL_CDB_BYTES_0 0   /* 16-byte CDB */
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index 418f636..6eab38e 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2469,8 +2469,8 @@ static int pqi_interpret_task_management_response(
int rc;
 
switch (response->response_code) {
-   case SOP_TASK_MANAGEMENT_FUNCTION_COMPLETE:
-   case SOP_TASK_MANAGEMENT_FUNCTION_SUCCEEDED:
+   case SOP_TMF_COMPLETE:
+   case SOP_TMF_FUNCTION_SUCCEEDED:
rc = 0;
break;
default:

--
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 01/15] smartpqi: change aio sg processing

2016-08-31 Thread Don Brace
From: Kevin Barnett 

Take advantage of controller improvements.

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Johannes Thumshirn 
Reviewed-by: Tomas Henzl 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi_init.c |   68 +++--
 1 file changed, 39 insertions(+), 29 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index 906f1aa..418f636 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -4263,48 +4263,58 @@ static int pqi_build_aio_sg_list(struct pqi_ctrl_info 
*ctrl_info,
int i;
u16 iu_length;
int sg_count;
-   unsigned int num_sg_in_iu = 0;
+   bool chained;
+   unsigned int num_sg_in_iu;
+   unsigned int max_sg_per_iu;
struct scatterlist *sg;
struct pqi_sg_descriptor *sg_descriptor;
 
sg_count = scsi_dma_map(scmd);
if (sg_count < 0)
return sg_count;
+
+   iu_length = offsetof(struct pqi_aio_path_request, sg_descriptors) -
+   PQI_REQUEST_HEADER_LENGTH;
+   num_sg_in_iu = 0;
+
if (sg_count == 0)
goto out;
 
-   if (sg_count <= ctrl_info->max_sg_per_iu) {
-   sg_descriptor = >sg_descriptors[0];
-   scsi_for_each_sg(scmd, sg, sg_count, i) {
-   pqi_set_sg_descriptor(sg_descriptor, sg);
-   sg_descriptor++;
-   }
-   put_unaligned_le32(CISS_SG_LAST,
-   >sg_descriptors[sg_count - 1].flags);
-   num_sg_in_iu = sg_count;
-   } else {
-   sg_descriptor = >sg_descriptors[0];
-   put_unaligned_le64((u64)io_request->sg_chain_buffer_dma_handle,
-   _descriptor->address);
-   put_unaligned_le32(sg_count * sizeof(*sg_descriptor),
-   _descriptor->length);
-   put_unaligned_le32(CISS_SG_CHAIN, _descriptor->flags);
-
-   sg_descriptor = io_request->sg_chain_buffer;
-   scsi_for_each_sg(scmd, sg, sg_count, i) {
-   pqi_set_sg_descriptor(sg_descriptor, sg);
-   sg_descriptor++;
+   sg = scsi_sglist(scmd);
+   sg_descriptor = request->sg_descriptors;
+   max_sg_per_iu = ctrl_info->max_sg_per_iu - 1;
+   chained = false;
+   i = 0;
+
+   while (1) {
+   pqi_set_sg_descriptor(sg_descriptor, sg);
+   if (!chained)
+   num_sg_in_iu++;
+   i++;
+   if (i == sg_count)
+   break;
+   sg_descriptor++;
+   if (i == max_sg_per_iu) {
+   put_unaligned_le64(
+   (u64)io_request->sg_chain_buffer_dma_handle,
+   _descriptor->address);
+   put_unaligned_le32((sg_count - num_sg_in_iu)
+   * sizeof(*sg_descriptor),
+   _descriptor->length);
+   put_unaligned_le32(CISS_SG_CHAIN,
+   _descriptor->flags);
+   chained = true;
+   num_sg_in_iu++;
+   sg_descriptor = io_request->sg_chain_buffer;
}
-   put_unaligned_le32(CISS_SG_LAST,
-   _request->sg_chain_buffer[sg_count - 1].flags);
-   num_sg_in_iu = 1;
-   request->partial = 1;
+   sg = sg_next(sg);
}
 
-out:
-   iu_length = offsetof(struct pqi_aio_path_request, sg_descriptors) -
-   PQI_REQUEST_HEADER_LENGTH;
+   put_unaligned_le32(CISS_SG_LAST, _descriptor->flags);
+   request->partial = chained;
iu_length += num_sg_in_iu * sizeof(*sg_descriptor);
+
+out:
put_unaligned_le16(iu_length, >header.iu_length);
request->num_sg_descriptors = num_sg_in_iu;
 

--
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 03/15] smartpqi: simplify spanning

2016-08-31 Thread Don Brace
From: Kevin Barnett 

Removed the workaround for the transition to spanning.

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Johannes Thumshirn 
Reviewed-by: Tomas Henzl 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi_init.c |   38 +
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index 6eab38e..9922e31 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -3663,6 +3663,18 @@ static int pqi_validate_device_capability(struct 
pqi_ctrl_info *ctrl_info)
return -EINVAL;
}
 
+   if (!ctrl_info->inbound_spanning_supported) {
+   dev_err(_info->pci_dev->dev,
+   "the controller does not support inbound spanning\n");
+   return -EINVAL;
+   }
+
+   if (ctrl_info->outbound_spanning_supported) {
+   dev_err(_info->pci_dev->dev,
+   "the controller supports outbound spanning but this 
driver does not\n");
+   return -EINVAL;
+   }
+
return 0;
 }
 
@@ -4138,24 +4150,14 @@ static void pqi_calculate_queue_resources(struct 
pqi_ctrl_info *ctrl_info)
 
ctrl_info->num_queue_groups = num_queue_groups;
 
-   if (ctrl_info->max_inbound_iu_length_per_firmware == 256 &&
-   ctrl_info->outbound_spanning_supported) {
-   /*
-* TEMPHACK
-* This is older f/w that doesn't actually support spanning.
-*/
-   ctrl_info->max_inbound_iu_length =
-   PQI_OPERATIONAL_IQ_ELEMENT_LENGTH;
-   } else {
-   /*
-* Make sure that the max. inbound IU length is an even multiple
-* of our inbound element length.
-*/
-   ctrl_info->max_inbound_iu_length =
-   (ctrl_info->max_inbound_iu_length_per_firmware /
-   PQI_OPERATIONAL_IQ_ELEMENT_LENGTH) *
-   PQI_OPERATIONAL_IQ_ELEMENT_LENGTH;
-   }
+   /*
+* Make sure that the max. inbound IU length is an even multiple
+* of our inbound element length.
+*/
+   ctrl_info->max_inbound_iu_length =
+   (ctrl_info->max_inbound_iu_length_per_firmware /
+   PQI_OPERATIONAL_IQ_ELEMENT_LENGTH) *
+   PQI_OPERATIONAL_IQ_ELEMENT_LENGTH;
 
num_elements_per_iq =
(ctrl_info->max_inbound_iu_length /

--
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 05/15] smartpqi: enhance reset logic

2016-08-31 Thread Don Brace
From: Kevin Barnett 

Eliminated timeout from LUN reset logic.

Reviewed-by: Scott Teel 
Reviewed-by: Scott Benesh 
Reviewed-by: Johannes Thumshirn 
Reviewed-by: Tomas Henzl 
Signed-off-by: Kevin Barnett 
Signed-off-by: Don Brace 
---
 drivers/scsi/smartpqi/smartpqi.h  |2 -
 drivers/scsi/smartpqi/smartpqi_init.c |  101 +++--
 2 files changed, 35 insertions(+), 68 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h
index dbcdb03..053be6b 100644
--- a/drivers/scsi/smartpqi/smartpqi.h
+++ b/drivers/scsi/smartpqi/smartpqi.h
@@ -370,7 +370,6 @@ struct pqi_task_management_request {
 };
 
 #define SOP_TASK_MANAGEMENT_LUN_RESET  0x8
-#define PQI_ABORT_TIMEOUT_MSECS(20 * 1000)
 
 struct pqi_task_management_response {
struct pqi_iu_header header;
@@ -762,7 +761,6 @@ struct pqi_scsi_dev {
 
struct pqi_sas_port *sas_port;
struct scsi_device *sdev;
-   boolreset_in_progress;
 
struct list_head scsi_device_list_entry;
struct list_head new_device_list_entry;
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index 198a7c2..dbc8b40 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -4537,13 +4537,6 @@ static int pqi_scsi_queue_command(struct Scsi_Host 
*shost,
bool raid_bypassed;
 
device = scmd->device->hostdata;
-
-   if (device->reset_in_progress) {
-   set_host_byte(scmd, DID_RESET);
-   pqi_scsi_done(scmd);
-   return 0;
-   }
-
ctrl_info = shost_to_hba(shost);
 
if (pqi_ctrl_offline(ctrl_info)) {
@@ -4585,61 +4578,47 @@ static int pqi_scsi_queue_command(struct Scsi_Host 
*shost,
return rc;
 }
 
-static inline void pqi_complete_queued_requests_queue_group(
-   struct pqi_queue_group *queue_group,
-   struct pqi_scsi_dev *device_in_reset)
+static void pqi_lun_reset_complete(struct pqi_io_request *io_request,
+   void *context)
 {
-   unsigned int path;
-   unsigned long flags;
-   struct pqi_io_request *io_request;
-   struct pqi_io_request *next;
-   struct scsi_cmnd *scmd;
-   struct pqi_scsi_dev *device;
+   struct completion *waiting = context;
 
-   for (path = 0; path < 2; path++) {
-   spin_lock_irqsave(_group->submit_lock[path], flags);
+   complete(waiting);
+}
 
-   list_for_each_entry_safe(io_request, next,
-   _group->request_list[path],
-   request_list_entry) {
-   scmd = io_request->scmd;
-   if (!scmd)
-   continue;
-   device = scmd->device->hostdata;
-   if (device == device_in_reset) {
-   set_host_byte(scmd, DID_RESET);
-   pqi_scsi_done(scmd);
-   list_del(_request->
-   request_list_entry);
-   }
+#define PQI_LUN_RESET_TIMEOUT_SECS 10
+
+static int pqi_wait_for_lun_reset_completion(struct pqi_ctrl_info *ctrl_info,
+   struct pqi_scsi_dev *device, struct completion *wait)
+{
+   int rc;
+   unsigned int wait_secs = 0;
+
+   while (1) {
+   if (wait_for_completion_io_timeout(wait,
+   PQI_LUN_RESET_TIMEOUT_SECS * HZ)) {
+   rc = 0;
+   break;
}
 
-   spin_unlock_irqrestore(_group->submit_lock[path], flags);
-   }
-}
+   pqi_check_ctrl_health(ctrl_info);
+   if (pqi_ctrl_offline(ctrl_info)) {
+   rc = -ETIMEDOUT;
+   break;
+   }
 
-static void pqi_complete_queued_requests(struct pqi_ctrl_info *ctrl_info,
-   struct pqi_scsi_dev *device_in_reset)
-{
-   unsigned int i;
-   struct pqi_queue_group *queue_group;
+   wait_secs += PQI_LUN_RESET_TIMEOUT_SECS;
 
-   for (i = 0; i < ctrl_info->num_queue_groups; i++) {
-   queue_group = _info->queue_groups[i];
-   pqi_complete_queued_requests_queue_group(queue_group,
-   device_in_reset);
+   dev_err(_info->pci_dev->dev,
+   "resetting scsi %d:%d:%d:%d - waiting %u seconds\n",
+   ctrl_info->scsi_host->host_no, device->bus,
+   device->target, device->lun, wait_secs);
}
-}
 
-static void pqi_reset_lun_complete(struct pqi_io_request *io_request,
-   void *context)
-{
-   struct completion *waiting = context;
-
-   complete(waiting);
+   return rc;
 }
 
-static 

[PATCH V2 00/15] smartpqi update

2016-08-31 Thread Don Brace
These changes are based on Linus's tree

The changes are:
 - simplify aio processing
 - simplify tmf macro names
 - remove workaround for spanning
 - add message for offlined drives
 - enhance reset logic
 - add support for kdump
 - correct issue with offlined controller
 - change timeout for events
 - reformat function to match svn version
 - correct update time scheduling
 - minor queuecommand cleanup
 - remove timeout on cache flush operation
 - update smartpqi/Kconfig
   - Martin K. Peterson's review
 - add Documentation/scsi/smartpqi.txt
   - Martin K. Peterson's review
 - bump driver version

Changes since V1:
 - squashed smartpqi-add-smartpqi.txt and
   smartpqi-update-maintainers
   as per Johannes Thumshirn  review.
 - enhanced patch description for
   smartpqi-correct-controller-offline-issue
   as per Johannes Thumshirn  review.
 - redacted patch smartpqi-change-function-to-inline
   as per Johannes Thumshirn  review.
   - The compiler in-lines small functions automatically.

---

Don Brace (1):
  smartpqi: add smartpqi.txt

Kevin Barnett (14):
  smartpqi: change aio sg processing
  smartpqi: change tmf macro names
  smartpqi: simplify spanning
  smartpqi: enhance drive offline informational message
  smartpqi: enhance reset logic
  smartpqi: add kdump support
  smartpqi: correct controller offline issue
  smartpqi: correct event acknowledgment timeout issue
  smartpqi: minor function reformating
  smartpqi: minor tweaks to update time support
  smartpqi: scsi queuecommand cleanup
  smartpqi: remove timeout for cache flush operations
  smartpqi: update Kconfig
  smartqi: bump driver version


 Documentation/scsi/smartpqi.txt   |   80 
 MAINTAINERS   |1 
 drivers/scsi/smartpqi/Kconfig |8 +
 drivers/scsi/smartpqi/smartpqi.h  |   35 ++--
 drivers/scsi/smartpqi/smartpqi_init.c |  314 -
 drivers/scsi/smartpqi/smartpqi_sis.c  |   10 +
 drivers/scsi/smartpqi/smartpqi_sis.h  |2 
 7 files changed, 273 insertions(+), 177 deletions(-)
 create mode 100644 Documentation/scsi/smartpqi.txt

--
Signature
--
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 v1 2/3] Ibmvscsis: Code cleanup of print statements

2016-08-31 Thread Bryant G. Ly
Signed-off-by: Bryant G. Ly 
Signed-off-by: Michael Cyr 
---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 26 ++
 1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 
b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
index a515cdd..d4c67b9 100644
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -1606,8 +1606,6 @@ static void ibmvscsis_send_messages(struct scsi_info 
*vscsi)
 
if (!(vscsi->flags & RESPONSE_Q_DOWN)) {
list_for_each_entry_safe(cmd, nxt, >waiting_rsp, list) {
-   pr_debug("send_messages cmd %p\n", cmd);
-
iue = cmd->iue;
 
crq->valid = VALID_CMD_RESP_EL;
@@ -2556,10 +2554,6 @@ static void ibmvscsis_parse_cmd(struct scsi_info *vscsi,
 
srp->lun.scsi_lun[0] &= 0x3f;
 
-   pr_debug("calling submit_cmd, se_cmd %p, lun 0x%llx, cdb 0x%x, 
attr:%d\n",
->se_cmd, scsilun_to_int(>lun), (int)srp->cdb[0],
-attr);
-
rc = target_submit_cmd(>se_cmd, nexus->se_sess, srp->cdb,
   cmd->sense_buf, scsilun_to_int(>lun),
   data_len, attr, dir, 0);
@@ -3144,8 +3138,6 @@ static int ibmvscsis_rdma(struct ibmvscsis_cmd *cmd, 
struct scatterlist *sg,
long tx_len;
long rc = 0;
 
-   pr_debug("rdma: dir %d, bytes 0x%x\n", dir, bytes);
-
if (bytes == 0)
return 0;
 
@@ -3197,9 +3189,6 @@ static int ibmvscsis_rdma(struct ibmvscsis_cmd *cmd, 
struct scatterlist *sg,
/* write to client */
struct srp_cmd *srp = (struct srp_cmd *)iue->sbuf->buf;
 
-   if (!READ_CMD(srp->cdb))
-   print_hex_dump_bytes(" data:", DUMP_PREFIX_NONE,
-sg_virt(sgp), buf_len);
/* The h_copy_rdma will cause phyp, running in another
 * partition, to read memory, so we need to make sure
 * the data has been written out, hence these syncs.
@@ -3324,12 +3313,9 @@ cmd_work:
rc = ibmvscsis_trans_event(vscsi, crq);
} else if (vscsi->flags & TRANS_EVENT) {
/*
-* if a tranport event has occurred leave
+* if a transport event has occurred leave
 * everything but transport events on the queue
-*/
-   pr_debug("handle_crq, ignoring\n");
-
-   /*
+*
 * need to decrement the queue index so we can
 * look at the elment again
 */
@@ -3695,8 +3681,6 @@ static void ibmvscsis_release_cmd(struct se_cmd *se_cmd)
 se_cmd);
struct scsi_info *vscsi = cmd->adapter;
 
-   pr_debug("release_cmd %p, flags %d\n", se_cmd, cmd->flags);
-
spin_lock_bh(>intr_lock);
/* Remove from active_q */
list_del(>list);
@@ -3717,9 +3701,6 @@ static int ibmvscsis_write_pending(struct se_cmd *se_cmd)
struct iu_entry *iue = cmd->iue;
int rc;
 
-   pr_debug("write_pending, se_cmd %p, length 0x%x\n",
-se_cmd, se_cmd->data_length);
-
rc = srp_transfer_data(cmd, _iu(iue)->srp.cmd, ibmvscsis_rdma,
   1, 1);
if (rc) {
@@ -3758,9 +3739,6 @@ static int ibmvscsis_queue_data_in(struct se_cmd *se_cmd)
uint len = 0;
int rc;
 
-   pr_debug("queue_data_in, se_cmd %p, length 0x%x\n",
-se_cmd, se_cmd->data_length);
-
rc = srp_transfer_data(cmd, _iu(iue)->srp.cmd, ibmvscsis_rdma, 1,
   1);
if (rc) {
-- 
2.5.4 (Apple Git-61)

--
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 v1 3/3] Ibmvscsis: Fixed a bug reported by Dan Carpenter

2016-08-31 Thread Bryant G. Ly
SUPPORTED_FORMATS is 1 << 1 so it's never zero.

Signed-off-by: Bryant G. Ly 
Signed-off-by: Michael Cyr 
---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 
b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
index d4c67b9..35455af 100644
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -1978,7 +1978,7 @@ static long ibmvscsis_srp_login(struct scsi_info *vscsi,
reason = SRP_LOGIN_REJ_MULTI_CHANNEL_UNSUPPORTED;
else if (fmt->buffers & (~SUPPORTED_FORMATS))
reason = SRP_LOGIN_REJ_UNSUPPORTED_DESCRIPTOR_FMT;
-   else if ((fmt->buffers | SUPPORTED_FORMATS) == 0)
+   else if ((fmt->buffers & SUPPORTED_FORMATS) == 0)
reason = SRP_LOGIN_REJ_UNSUPPORTED_DESCRIPTOR_FMT;
 
if (vscsi->state == SRP_PROCESSING)
-- 
2.5.4 (Apple Git-61)

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


Direct Cash Loans Offer!!!

2016-08-31 Thread Direct cash Loans pty




Good News,

Direct cash Loans is currently giving out loan at 3.5% interest rate. 

Kindly forward the following details your ID Number, Full Names, Occupation, 
Monthly Income, Type of loan , telephone number and email address via email to 
this email:  directcashloans_d...@webmail.co.za 

View attached document for more information about our special loan offer or 
call : +27(0)622 539 768  for more information.

Commission earners can also apply. 


Regards, 

Lydia Smith (Mrs) 

Loan Application Unit/Risk Supervisor.


Direct Cash Loan Low Rate Offer.docx
Description: MS-Word 2007 document


[PATCH v1 1/3] Ibmvscsis: Properly deregister target sessions

2016-08-31 Thread Bryant G. Ly
The driver currently doesn't properly deregisters target sessions
completely, so this will address that.

Signed-off-by: Bryant G. Ly 
Signed-off-by: Michael Cyr 
---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 
b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
index b29fef9..a515cdd 100644
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -1934,6 +1934,8 @@ static int ibmvscsis_drop_nexus(struct ibmvscsis_tport 
*tport)
/*
 * Release the SCSI I_T Nexus to the emulated ibmvscsis Target Port
 */
+   target_wait_for_sess_cmds(se_sess);
+   transport_deregister_session_configfs(se_sess);
transport_deregister_session(se_sess);
tport->ibmv_nexus = NULL;
kfree(nexus);
-- 
2.5.4 (Apple Git-61)

--
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 v1 0/3] Ibmvscsis fixes and code cleanup

2016-08-31 Thread Bryant G. Ly
Here are some small fixes and cleanups for Ibmvscsis Target Driver.
The only one of significance is the first one where there is a
possibility of a kernel crash due to inproper deregister of target
session since we didn't sync up work and didn't deregister_configfs.

Bryant G. Ly (3):
  Ibmvscsis: Properly deregister target sessions
  Ibmvscsis: Code cleanup of print statements
  Ibmvscsis: Fixed a bug reported by Dan Carpenter

 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 30 +-
 1 file changed, 5 insertions(+), 25 deletions(-)

-- 
2.5.4 (Apple Git-61)

--
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] wd719x: Remove last declaration using DEFINE_PCI_DEVICE_TABLE

2016-08-31 Thread Joe Perches
Convert it to the preferred const struct pci_device_id instead.

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

diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c
index e3da1a2..2a9da2e 100644
--- a/drivers/scsi/wd719x.c
+++ b/drivers/scsi/wd719x.c
@@ -962,7 +962,7 @@ static void wd719x_pci_remove(struct pci_dev *pdev)
scsi_host_put(sh);
 }
 
-static DEFINE_PCI_DEVICE_TABLE(wd719x_pci_table) = {
+static const struct pci_device_id wd719x_pci_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_WD, 0x3296) },
{}
 };
-- 
2.10.0.rc2.1.gb2aa91d

--
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] Remove last use and references to DEFINE_PCI_DEVICE_TABLE

2016-08-31 Thread Joe Perches
Joe Perches (2):
  wd719x: Remove last declaration using DEFINE_PCI_DEVICE_TABLE
  treewide: Remove references to the now unnecessary DEFINE_PCI_DEVICE_TABLE

 Documentation/PCI/pci.txt | 1 -
 drivers/scsi/wd719x.c | 2 +-
 include/linux/pci.h   | 9 -
 scripts/checkpatch.pl | 9 -
 scripts/tags.sh   | 1 -
 5 files changed, 1 insertion(+), 21 deletions(-)

-- 
2.10.0.rc2.1.gb2aa91d

--
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/17] smartqi: bump driver version

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:45, Don Brace wrote:
> From: Kevin Barnett 
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Signed-off-by: Kevin Barnett 
> Signed-off-by: Don Brace 

Reviewed-by: Tomas Henzl 

--
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 14/17] smartpqi: update Kconfig

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:45, Don Brace wrote:
> From: Kevin Barnett 
>
> The aacraid driver will not managage Microsemi
> smartpqi controllers, but will still manage
> older aacraid devices.
>
> Updated help section.
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Reviewed-by: Kevin Barnett 
> Signed-off-by: Don Brace 
> ---

Reviewed-by: Tomas Henzl 

--
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 13/17] smartpqi: remove timeout for cache flush operations

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:45, Don Brace wrote:
> From: Kevin Barnett 
>
> Some cache flush operations can take longer than the
> timeout value. Best to not impose a time limit to
> handle all cases.
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Signed-off-by: Kevin Barnett 
> Signed-off-by: Don Brace 
> ---

Reviewed-by: Tomas Henzl 

--
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 12/17] smartpqi: scsi queuecommand cleanup

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:45, Don Brace wrote:
> From: Kevin Barnett 
>
> minor cleanup of scsi queue command function
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Signed-off-by: Kevin Barnett 
> Signed-off-by: Don Brace 
> ---

Reviewed-by: Tomas Henzl 

--
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 10/17] smartpqi: minor function reformating

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:45, Don Brace wrote:
> From: Kevin Barnett 
>
> reformatted pqi_num_elements_free() to match the rest of the driver
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Signed-off-by: Kevin Barnett 
> Signed-off-by: Don Brace 
> ---

Reviewed-by: Tomas Henzl 

--
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 09/17] smartpqi: correct event acknowledgment timeout issue

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:45, Don Brace wrote:
> From: Kevin Barnett 
>
> the driver no longer waits for the firmware to consume
> the event ack IU.
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Signed-off-by: Kevin Barnett 
> Signed-off-by: Don Brace 

Reviewed-by: Tomas Henzl 

--
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 08/17] smartpqi: correct controller offline issue

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett 
>
> Fixed a bug where the driver would not free all of the
> controller resources if the controller ever went offline.
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Signed-off-by: Kevin Barnett 
> Signed-off-by: Don Brace 

Reviewed-by: Tomas Henzl 

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] fusion: mptbase: Remove deprecated create_singlethread_workqueue

2016-08-31 Thread Tejun Heo
On Wed, Aug 31, 2016 at 12:33:25AM +0530, Bhaktipriya Shridhar wrote:
> The workqueues "ioc->reset_work_q" and "ioc->fw_event_q" queue a single
> work item >fault_reset_work and _event->work, respectively and
> hence don't require ordering. Hence, they have been converted to use
> alloc_workqueue().
> 
> The WQ_MEM_RECLAIM flag has been set to ensure forward progress under
> memory pressure since the workqueue belongs to a storage driver which is
> being used on a memory reclaim path.
> 
> Since there are fixed number of work items, explicit concurrency
> limit is unnecessary here.
> 
> Signed-off-by: Bhaktipriya Shridhar 

Acked-by: Tejun Heo 

Thanks.

-- 
tejun
--
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] fusion/mptfc: Remove deprecated create_singlethread_workqueue

2016-08-31 Thread Tejun Heo
On Wed, Aug 31, 2016 at 12:33:05AM +0530, Bhaktipriya Shridhar wrote:
> The workqueue "fc_rescan_work_q" queues multiple work items viz
> >fc_rescan_work, >fc_lsc_work, >fc_setup_reset_work,
> which require strict execution ordering.
> Hence, an ordered dedicated workqueue has been used.
> 
> WQ_MEM_RECLAIM has been set since the workqueue is belongs to a storage
> driver which is being used on a memory reclaim path and hence, requires
> forward progress under memory pressure.
> 
> Signed-off-by: Bhaktipriya Shridhar 

Acked-by: Tejun Heo 

Thanks.

-- 
tejun
--
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 3/3] scsi/ncr5380: Improve interrupt latency during PIO tranfers

2016-08-31 Thread Laurence Oberman


- Original Message -
> From: "Finn Thain" 
> To: "James E.J. Bottomley" , "Martin K. Petersen" 
> , "Geert
> Uytterhoeven" , linux-scsi@vger.kernel.org, 
> linux-m...@vger.kernel.org,
> linux-ker...@vger.kernel.org, "Michael Schmitz" 
> Sent: Wednesday, August 31, 2016 12:44:56 AM
> Subject: [PATCH v2 3/3] scsi/ncr5380: Improve interrupt latency during PIO 
> tranfers
> 
> Large PIO transfers are broken up into chunks to try to avoid disabling
> local IRQs for long periods. But IRQs are still disabled for too long
> and this causes SCC FIFO overruns during serial port transfers.
> 
> This patch reduces the PIO chunk size to reduce interrupt latency to
> something on the order of milliseconds, at the expense of additional CPU
> overhead from extra iterations of the NCR5380_main() loop.
> 
> That CPU overhead is a problem for slow machines (e.g. mac_scsi on 25 MHz
> 68030) but these machines generally use PDMA not PIO. This patch doesn't
> make the overhead any worse on my Mac LC III (because it only gets about
> 510 accesses per ms).
> 
> This patch decreases disk performance by a fraction of one percent for
> dmx3191d on my 333 MHz PowerPC 750. Other affected hardware (such as
> g_NCR5380 on x86) was not tested but 5380 ISA cards generally use PDMA
> and not PIO.
> 
> Signed-off-by: Finn Thain 
> 
> ---
> Changed since v1:
> - PIO transfer chunk size is now hard-coded for simplicity.
> 
> ---
>  drivers/scsi/NCR5380.c |8 
>  drivers/scsi/NCR5380.h |2 ++
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> Index: linux/drivers/scsi/NCR5380.c
> ===
> --- linux.orig/drivers/scsi/NCR5380.c 2016-08-31 14:44:51.0 +1000
> +++ linux/drivers/scsi/NCR5380.c  2016-08-31 14:44:52.0 +1000
> @@ -1849,11 +1849,11 @@ static void NCR5380_information_transfer
>   /* XXX - need to source or sink 
> data here, as appropriate */
>   }
>   } else {
> - /* Break up transfer into 3 ms chunks,
> -  * presuming 6 accesses per handshake.
> + /* Transfer a small chunk so that the
> +  * irq mode lock is not held too long.
>*/
> - transfersize = min((unsigned 
> long)cmd->SCp.this_residual,
> -
> hostdata->accesses_per_ms / 2);
> + transfersize = 
> min(cmd->SCp.this_residual,
> +
> NCR5380_PIO_CHUNK_SIZE);
>   len = transfersize;
>   NCR5380_transfer_pio(instance, , 
> ,
>(unsigned char 
> **)>SCp.ptr);
> Index: linux/drivers/scsi/NCR5380.h
> ===
> --- linux.orig/drivers/scsi/NCR5380.h 2016-08-31 14:44:51.0 +1000
> +++ linux/drivers/scsi/NCR5380.h  2016-08-31 14:44:52.0 +1000
> @@ -250,6 +250,8 @@ struct NCR5380_cmd {
>  
>  #define NCR5380_CMD_SIZE (sizeof(struct NCR5380_cmd))
>  
> +#define NCR5380_PIO_CHUNK_SIZE   256
> +
>  static inline struct scsi_cmnd *NCR5380_to_scmd(struct NCR5380_cmd
>  *ncmd_ptr)
>  {
>   return ((struct scsi_cmnd *)ncmd_ptr) - 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 makes sense, look good to me.

Reviwed-by: Laurence Oberman 
--
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 07/17] smartpqi: add kdump support

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett 
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Signed-off-by: Kevin Barnett 
> Signed-off-by: Don Brace 

Reviewed-by: Tomas Henzl 

--
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 03/17] smartpqi: simplify spanning

2016-08-31 Thread Tomas Henzl
On 31.8.2016 15:10, Johannes Thumshirn wrote:
> On Wed, Aug 31, 2016 at 02:59:16PM +0200, Tomas Henzl wrote:
>> On 26.8.2016 18:44, Don Brace wrote:
>>> From: Kevin Barnett 
>>>
>>> Removed the workaround for the transition to spanning.
>>>
>>> Reviewed-by: Scott Teel 
>>> Reviewed-by: Scott Benesh 
>>> Signed-off-by: Kevin Barnett 
>>> Signed-off-by: Don Brace 
>>> ---
>>>  drivers/scsi/smartpqi/smartpqi_init.c |   38 
>>> +
>>>  1 file changed, 20 insertions(+), 18 deletions(-)
>>>
>>> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
>>> b/drivers/scsi/smartpqi/smartpqi_init.c
>>> index 6eab38e..9922e31 100644
>>> --- a/drivers/scsi/smartpqi/smartpqi_init.c
>>> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
>>> @@ -3663,6 +3663,18 @@ static int pqi_validate_device_capability(struct 
>>> pqi_ctrl_info *ctrl_info)
>>> return -EINVAL;
>>> }
>>>  
>>> +   if (!ctrl_info->inbound_spanning_supported) {
>>> +   dev_err(_info->pci_dev->dev,
>>> +   "the controller does not support inbound spanning\n");
>>> +   return -EINVAL;
>>> +   }
>>> +
>>> +   if (ctrl_info->outbound_spanning_supported) {
>>> +   dev_err(_info->pci_dev->dev,
>>> +   "the controller supports outbound spanning but this 
>>> driver does not\n");
>>> +   return -EINVAL;
>>> +   }
>>> +
>>> return 0;
>>>  }
>> This looks like you are dropping support for a probably older firmware 
>> devices,
>> is that necessary - can't you continue a keep the support with something 
>> similar to that
>> 'TEMPHACk' below ?
> The question is, if any of these older firmware devices ever left the
> Microsemi buildings. If not I _think_ it's save to drop it, as no real
> users are harmed.

Well yes, likely it was used only during development - in that case also
if all devices support inbound_spanning it is not needed to test at all and
that bit could have been used for anything else (it's too late now for this 
though.)
Also if Microsemi doesn't want support future devices with this driver
a better option is to not use PCI_ANY_ID in pci_device_id instead of testing
the outbound_spanning_supported.

All that is minor, so -

Reviewed-by: Tomas Henzl 


>
> Byte,
>   Johannes


--
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 05/17] smartpqi: enhance reset logic

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett 
>
> Eliminated timeout from LUN reset logic.
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Signed-off-by: Kevin Barnett 
> Signed-off-by: Don Brace 
> ---

Reviewed-by: Tomas Henzl 

--
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 03/17] smartpqi: simplify spanning

2016-08-31 Thread Johannes Thumshirn
On Wed, Aug 31, 2016 at 02:59:16PM +0200, Tomas Henzl wrote:
> On 26.8.2016 18:44, Don Brace wrote:
> > From: Kevin Barnett 
> >
> > Removed the workaround for the transition to spanning.
> >
> > Reviewed-by: Scott Teel 
> > Reviewed-by: Scott Benesh 
> > Signed-off-by: Kevin Barnett 
> > Signed-off-by: Don Brace 
> > ---
> >  drivers/scsi/smartpqi/smartpqi_init.c |   38 
> > +
> >  1 file changed, 20 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
> > b/drivers/scsi/smartpqi/smartpqi_init.c
> > index 6eab38e..9922e31 100644
> > --- a/drivers/scsi/smartpqi/smartpqi_init.c
> > +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> > @@ -3663,6 +3663,18 @@ static int pqi_validate_device_capability(struct 
> > pqi_ctrl_info *ctrl_info)
> > return -EINVAL;
> > }
> >  
> > +   if (!ctrl_info->inbound_spanning_supported) {
> > +   dev_err(_info->pci_dev->dev,
> > +   "the controller does not support inbound spanning\n");
> > +   return -EINVAL;
> > +   }
> > +
> > +   if (ctrl_info->outbound_spanning_supported) {
> > +   dev_err(_info->pci_dev->dev,
> > +   "the controller supports outbound spanning but this 
> > driver does not\n");
> > +   return -EINVAL;
> > +   }
> > +
> > return 0;
> >  }
> 
> This looks like you are dropping support for a probably older firmware 
> devices,
> is that necessary - can't you continue a keep the support with something 
> similar to that
> 'TEMPHACk' below ?

The question is, if any of these older firmware devices ever left the
Microsemi buildings. If not I _think_ it's save to drop it, as no real
users are harmed.

Byte,
  Johannes
-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
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 04/17] smartpqi: enhance drive offline informational message

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett 
>
> Made a couple of error messages more verbose.
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Signed-off-by: Kevin Barnett 
> Signed-off-by: Don Brace 

Reviewed-by: Tomas Henzl 

> ---
>  drivers/scsi/smartpqi/smartpqi_init.c |5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
> b/drivers/scsi/smartpqi/smartpqi_init.c
> index 9922e31..198a7c2 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -2298,11 +2298,16 @@ static inline void pqi_aio_path_disabled(struct 
> pqi_io_request *io_request)
>  static inline void pqi_take_device_offline(struct scsi_device *sdev)
>  {
>   struct pqi_ctrl_info *ctrl_info;
> + struct pqi_scsi_dev *device;
>  
>   if (scsi_device_online(sdev)) {
>   scsi_device_set_state(sdev, SDEV_OFFLINE);
>   ctrl_info = shost_to_hba(sdev->host);
>   schedule_delayed_work(_info->rescan_work, 0);
> + device = sdev->hostdata;
> + dev_err(_info->pci_dev->dev, "offlined scsi %d:%d:%d:%d\n",
> + ctrl_info->scsi_host->host_no, device->bus,
> + device->target, device->lun);
>   }
>  }
>  
>
> --
> 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


--
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 03/17] smartpqi: simplify spanning

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett 
>
> Removed the workaround for the transition to spanning.
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Signed-off-by: Kevin Barnett 
> Signed-off-by: Don Brace 
> ---
>  drivers/scsi/smartpqi/smartpqi_init.c |   38 
> +
>  1 file changed, 20 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
> b/drivers/scsi/smartpqi/smartpqi_init.c
> index 6eab38e..9922e31 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -3663,6 +3663,18 @@ static int pqi_validate_device_capability(struct 
> pqi_ctrl_info *ctrl_info)
>   return -EINVAL;
>   }
>  
> + if (!ctrl_info->inbound_spanning_supported) {
> + dev_err(_info->pci_dev->dev,
> + "the controller does not support inbound spanning\n");
> + return -EINVAL;
> + }
> +
> + if (ctrl_info->outbound_spanning_supported) {
> + dev_err(_info->pci_dev->dev,
> + "the controller supports outbound spanning but this 
> driver does not\n");
> + return -EINVAL;
> + }
> +
>   return 0;
>  }

This looks like you are dropping support for a probably older firmware devices,
is that necessary - can't you continue a keep the support with something 
similar to that
'TEMPHACk' below ?

Tomas

>  
> @@ -4138,24 +4150,14 @@ static void pqi_calculate_queue_resources(struct 
> pqi_ctrl_info *ctrl_info)
>  
>   ctrl_info->num_queue_groups = num_queue_groups;
>  
> - if (ctrl_info->max_inbound_iu_length_per_firmware == 256 &&
> - ctrl_info->outbound_spanning_supported) {
> - /*
> -  * TEMPHACK
> -  * This is older f/w that doesn't actually support spanning.
> -  */
> - ctrl_info->max_inbound_iu_length =
> - PQI_OPERATIONAL_IQ_ELEMENT_LENGTH;
> - } else {
> - /*
> -  * Make sure that the max. inbound IU length is an even multiple
> -  * of our inbound element length.
> -  */
> - ctrl_info->max_inbound_iu_length =
> - (ctrl_info->max_inbound_iu_length_per_firmware /
> - PQI_OPERATIONAL_IQ_ELEMENT_LENGTH) *
> - PQI_OPERATIONAL_IQ_ELEMENT_LENGTH;
> - }
> + /*
> +  * Make sure that the max. inbound IU length is an even multiple
> +  * of our inbound element length.
> +  */
> + ctrl_info->max_inbound_iu_length =
> + (ctrl_info->max_inbound_iu_length_per_firmware /
> + PQI_OPERATIONAL_IQ_ELEMENT_LENGTH) *
> + PQI_OPERATIONAL_IQ_ELEMENT_LENGTH;
>  
>   num_elements_per_iq =
>   (ctrl_info->max_inbound_iu_length /
>
> --
> 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


--
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 02/17] smartpqi: change tmf macro names

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett 
>
> small change to make code look cleaner
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Signed-off-by: Kevin Barnett 
> Signed-off-by: Don Brace 

Reviewed-by: Tomas Henzl 

--
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 01/17] smartpqi: change aio sg processing

2016-08-31 Thread Tomas Henzl
On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett 
>
> Take advantage of controller improvements.
>
> Reviewed-by: Scott Teel 
> Reviewed-by: Scott Benesh 
> Signed-off-by: Kevin Barnett 
> Signed-off-by: Don Brace 

Reviewed-by: Tomas Henzl 

Tomas


--
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] bfa: do not dereference port before it is null checked

2016-08-31 Thread Johannes Thumshirn
On Tue, Aug 30, 2016 at 05:36:16PM +0100, Colin King wrote:
> From: Colin Ian King 
> 
> port is deferenced before it is null sanity checked, hence
> we potentially have a null pointer dereference bug. Instead,
> initialise trl_enabled from port->fcs->bfa after we are sure
> port is not null.
> 
> Signed-off-by: Colin Ian King 
> ---

Reviewed-by: Johannes Thumshirn 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
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 v5 3/8] char: rpmb: add device attributes

2016-08-31 Thread Greg Kroah-Hartman
On Mon, Jul 18, 2016 at 11:27:48PM +0300, Tomas Winkler wrote:
> Add attribute type that displays underlay storage type technology
> EMMC, UFS, and attribute id, that displays underlay storage device id.
> For EMMC this would be content of CID and for UFS serial number from
> the device descriptor.
> 
> 
> Signed-off-by: Tomas Winkler 
> ---
> V2: resend
> V3: set kernel version to 4.7
> V4: update target date to Maj
> V5: adjust date and kernel version
>  Documentation/ABI/testing/sysfs-class-rpmb | 24 
>  drivers/char/rpmb/core.c   | 63 
> ++
>  2 files changed, 87 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-class-rpmb 
> b/Documentation/ABI/testing/sysfs-class-rpmb
> index 3ffcd2d1f683..7ca97d86bd97 100644
> --- a/Documentation/ABI/testing/sysfs-class-rpmb
> +++ b/Documentation/ABI/testing/sysfs-class-rpmb
> @@ -18,3 +18,27 @@ Contact:   Tomas Winkler 
>  Description:
>   The /sys/class/rpmb/rpmbN directory is created for
>   each RPMB registered device
> +
> +What:/sys/class/rpmb/rpmbN/id
> +Date:Aug 2016
> +KernelVersion:   4.8
> +Contact: Tomas Winkler 
> +Description:
> + The /sys/class/rpmb/rpmbN/id file contains device id
> + in a binary form

Oops, missed that you added these in a later patch, sorry about comment
on patch 2.

binary attribute?  Why?

> +
> +What:/sys/class/rpmb/rpmbN/type
> +Date:Aug 2016
> +KernelVersion:   4.8
> +Contact: Tomas Winkler 
> +Description:
> + The /sys/class/rpmb/rpmbN/type file contains device
> + underlay storage type technology: EMMC, UFS
> +

What is this used for?

> +What:/sys/class/rpmb/rpmbN/reliable_wr_cnt
> +Date:Aug 2016
> +KernelVersion:   4.8
> +Contact: Tomas Winkler 
> +Description:
> + The /sys/class/rpmb/rpmbN/reliable_wr_cnt file contains
> + number of blocks that can be written in a single request

Why is this needed?  Shouldn't the normal block device export this type
of information?


> diff --git a/drivers/char/rpmb/core.c b/drivers/char/rpmb/core.c
> index ff10cbb7b644..63271c7ed072 100644
> --- a/drivers/char/rpmb/core.c
> +++ b/drivers/char/rpmb/core.c
> @@ -308,6 +308,67 @@ struct rpmb_dev *rpmb_dev_find_by_device(struct device 
> *parent)
>  }
>  EXPORT_SYMBOL_GPL(rpmb_dev_find_by_device);
>  
> +static ssize_t type_show(struct device *dev,
> +  struct device_attribute *attr, char *buf)
> +{
> + struct rpmb_dev *rdev = to_rpmb_dev(dev);
> + ssize_t ret;
> +
> + switch (rdev->ops->type) {
> + case RPMB_TYPE_EMMC:
> + ret = scnprintf(buf, PAGE_SIZE, "EMMC\n");

It's a sysfs file, no need for scnprintf() crap, just use sprintf()
please.

> + break;

And the code can be made smaller by just doing:
return sprintf(buf, "EMMC\n");

:)

> + case RPMB_TYPE_UFS:
> + ret = scnprintf(buf, PAGE_SIZE, "UFS\n");
> + break;
> + default:
> + ret = scnprintf(buf, PAGE_SIZE, "UNKNOWN\n");
> + break;
> + }
> +
> + return ret;
> +}
> +static DEVICE_ATTR_RO(type);
> +
> +static ssize_t id_show(struct device *dev,
> +struct device_attribute *attr, char *buf)
> +{
> + struct rpmb_dev *rdev = to_rpmb_dev(dev);
> + size_t sz = min_t(size_t, rdev->ops->dev_id_len, PAGE_SIZE);
> +
> + if (!rdev->ops->dev_id)
> + return 0;
> +
> + memcpy(buf, rdev->ops->dev_id, sz);
>

Hm, no.  That's not how a binary attribute works.  If you want a binary
attribute, use that type, don't put binary data in a "normal" sysfs
file.

> + return sz;
> +}
> +static DEVICE_ATTR_RO(id);
> +
> +static ssize_t reliable_wr_cnt_show(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct rpmb_dev *rdev = to_rpmb_dev(dev);
> +
> + return scnprintf(buf, PAGE_SIZE, "%u\n", rdev->ops->reliable_wr_cnt);
> +}
> +static DEVICE_ATTR_RO(reliable_wr_cnt);
> +
> +static struct attribute *rpmb_attrs[] = {
> + _attr_type.attr,
> + _attr_id.attr,
> + _attr_reliable_wr_cnt.attr,
> + NULL,
> +};
> +
> +static struct attribute_group rpmb_attr_group = {
> + .attrs = rpmb_attrs,
> +};
> +
> +static const struct attribute_group *rpmb_attr_groups[] = {
> + _attr_group,
> + NULL
> +};
> +
>  /**
>   * rpmb_dev_unregister - unregister RPMB partition from the RPMB subsystem
>   *
> @@ -377,6 +438,8 @@ struct rpmb_dev *rpmb_dev_register(struct device *dev,
>   dev_set_name(>dev, "rpmb%d", id);
>   rdev->dev.class = _class;
>   rdev->dev.parent = dev;
> + rdev->dev.groups = rpmb_attr_groups;

Nice job with the 

Re: [PATCH v5 5/8] char: rpmb: add RPMB simulation device

2016-08-31 Thread Greg Kroah-Hartman
On Mon, Jul 18, 2016 at 11:27:50PM +0300, Tomas Winkler wrote:
> This is a simple platform device used for testing
> the RPMB subsystem.
> 
> The module currently supports two configuration options:
> 1. max_wr_blks: for specifying max blocks that can be written
> in a single command
> 2. daunits:  used to set storage capacity in 128K units.
> 
> 
> Signed-off-by: Tomas Winkler 
> ---
> V2: remove .owner setting, it is set automatically
> V3: 1. Add shutdown handler (similar to ufshcd)
> 2. Commit message fix
> V4: Use select RPMB in Kconfg to ensure valid configuration.
> V5: Revamp the code using the sequence command.
> 
>  drivers/char/rpmb/Kconfig|  10 +
>  drivers/char/rpmb/Makefile   |   1 +
>  drivers/char/rpmb/rpmb_sim.c | 668 
> +++
>  3 files changed, 679 insertions(+)
>  create mode 100644 drivers/char/rpmb/rpmb_sim.c
> 
> diff --git a/drivers/char/rpmb/Kconfig b/drivers/char/rpmb/Kconfig
> index 6794be9fcc5e..c21b3934249f 100644
> --- a/drivers/char/rpmb/Kconfig
> +++ b/drivers/char/rpmb/Kconfig
> @@ -13,3 +13,13 @@ config RPMB_INTF_DEV
>   help
> Say yes here if you want to access RPMB from user space
> via character device interface /dev/rpmb%d
> +
> +
> +config RPMB_SIM
> + tristate "RPMB partition device simulator"
> + default n
> + select RPMB
> + select CRYPTO_SHA256
> + select CRYPTO_HMAC
> + help
> +   RPMB partition simulator used for testing the RPMB subsystem
> diff --git a/drivers/char/rpmb/Makefile b/drivers/char/rpmb/Makefile
> index b5dc087b1299..81f924fd9a87 100644
> --- a/drivers/char/rpmb/Makefile
> +++ b/drivers/char/rpmb/Makefile
> @@ -1,5 +1,6 @@
>  obj-$(CONFIG_RPMB) += rpmb.o
>  rpmb-objs += core.o
>  rpmb-$(CONFIG_RPMB_INTF_DEV) += cdev.o
> +obj-$(CONFIG_RPMB_SIM) += rpmb_sim.o
>  
>  ccflags-y += -D__CHECK_ENDIAN__
> diff --git a/drivers/char/rpmb/rpmb_sim.c b/drivers/char/rpmb/rpmb_sim.c
> new file mode 100644
> index ..e33f6809ae2c
> --- /dev/null
> +++ b/drivers/char/rpmb/rpmb_sim.c
> @@ -0,0 +1,668 @@
> +/**
> + * This file is provided under a dual BSD/GPLv2 license.  When using or
> + * redistributing this file, you may do so under either license.
> + *
> + * GPL LICENSE SUMMARY
> + *
> + * Copyright(c) 2016 Intel Corporation. All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of version 2 of the GNU General Public License as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * General Public License for more details.
> + *
> + * The full GNU General Public License is included in this distribution
> + * in the file called LICENSE.GPL.
> + *
> + * Contact Information:
> + *   Intel Corporation.
> + *   linux-...@linux.intel.com
> + *   http://www.intel.com
> + *
> + * BSD LICENSE
> + *
> + * Copyright(c) 2016 Intel Corporation. All rights reserved.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + *  * Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + *  * Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in
> + *the documentation and/or other materials provided with the
> + *distribution.
> + *  * Neither the name Intel Corporation nor the names of its
> + *contributors may be used to endorse or promote products derived
> + *from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + *
> + 
> */
> +#include 
> +#include 
> +#include 
> 

Re: [PATCH v5 5/8] char: rpmb: add RPMB simulation device

2016-08-31 Thread Greg Kroah-Hartman
On Mon, Jul 18, 2016 at 11:27:50PM +0300, Tomas Winkler wrote:
> This is a simple platform device used for testing
> the RPMB subsystem.
> 
> The module currently supports two configuration options:
> 1. max_wr_blks: for specifying max blocks that can be written
> in a single command
> 2. daunits:  used to set storage capacity in 128K units.
> 
> 
> Signed-off-by: Tomas Winkler 
> ---
> V2: remove .owner setting, it is set automatically
> V3: 1. Add shutdown handler (similar to ufshcd)
> 2. Commit message fix
> V4: Use select RPMB in Kconfg to ensure valid configuration.
> V5: Revamp the code using the sequence command.
> 
>  drivers/char/rpmb/Kconfig|  10 +
>  drivers/char/rpmb/Makefile   |   1 +
>  drivers/char/rpmb/rpmb_sim.c | 668 
> +++
>  3 files changed, 679 insertions(+)
>  create mode 100644 drivers/char/rpmb/rpmb_sim.c
> 
> diff --git a/drivers/char/rpmb/Kconfig b/drivers/char/rpmb/Kconfig
> index 6794be9fcc5e..c21b3934249f 100644
> --- a/drivers/char/rpmb/Kconfig
> +++ b/drivers/char/rpmb/Kconfig
> @@ -13,3 +13,13 @@ config RPMB_INTF_DEV
>   help
> Say yes here if you want to access RPMB from user space
> via character device interface /dev/rpmb%d
> +
> +
> +config RPMB_SIM
> + tristate "RPMB partition device simulator"
> + default n
> + select RPMB
> + select CRYPTO_SHA256
> + select CRYPTO_HMAC
> + help
> +   RPMB partition simulator used for testing the RPMB subsystem

Hm, that's very vague, why would I want this?  Not want this?  Please
provide more information here.

thanks,

greg k-h
--
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 v5 2/8] char: rpmb: add sysfs-class ABI documentation

2016-08-31 Thread Greg Kroah-Hartman
On Mon, Jul 18, 2016 at 11:27:47PM +0300, Tomas Winkler wrote:
> Signed-off-by: Tomas Winkler 
> ---
> V2: resend
> V3: add more verbose description
> V4: resend
> V5: adjust date and kernel version
> 
>  Documentation/ABI/testing/sysfs-class-rpmb | 20 
>  MAINTAINERS|  1 +
>  2 files changed, 21 insertions(+)
>  create mode 100644 Documentation/ABI/testing/sysfs-class-rpmb
> 
> diff --git a/Documentation/ABI/testing/sysfs-class-rpmb 
> b/Documentation/ABI/testing/sysfs-class-rpmb
> new file mode 100644
> index ..3ffcd2d1f683
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-class-rpmb
> @@ -0,0 +1,20 @@
> +What:/sys/class/rpmb/
> +Date:Aug 2016
> +KernelVersion:  4.8
> +Contact: Tomas Winkler 
> +Description:
> + The rpmb/ class sub-directory belongs to RPMB device class.
> +
> + Few storage technologies such is EMMC, UFS, and NVMe support
> + Replay Protected Memory Block (RPMB) hardware partition with
> + common protocol and frame layout.
> + Such a partition provides authenticated and replay protected 
> access,
> + hence suitable as a secure storage.
> +
> +What:/sys/class/rpmb/rpmbN/
> +Date:Aug 2016
> +KernelVersion:   4.8
> +Contact: Tomas Winkler 
> +Description:
> + The /sys/class/rpmb/rpmbN directory is created for
> + each RPMB registered device

So you have no sysfs files?  If not, why have a sysfs class at all?

thanks,

greg k-h
--
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 v5 4/8] char: rpmb: provide a user space interface

2016-08-31 Thread Greg Kroah-Hartman
On Sun, Aug 07, 2016 at 09:44:03AM +, Winkler, Tomas wrote:
> > 
> > On Mon 2016-07-18 23:27:49, Tomas Winkler wrote:
> > > The user space API is achieved via two synchronous IOCTL.
> > 
> > IOCTLs?
> 
> Will fix
>  
> > > Simplified one, RPMB_IOC_REQ_CMD, were read result cycles is
> > performed
> > > by the framework on behalf the user and second, RPMB_IOC_SEQ_CMD
> > where
> > > the whole RPMB sequence including RESULT_READ is supplied by the caller.
> > > The latter is intended for  easier adjusting  of the  applications
> > > that use MMC_IOC_MULTI_CMD ioctl.
> > 
> > Why "  "?
> Not sure I there is enough clue in your question. 
> > 
> > >
> > > Signed-off-by: Tomas Winkler 
> > 
> > > +
> > > +static long rpmb_ioctl(struct file *fp, unsigned int cmd, unsigned
> > > +long arg) {
> > > + return __rpmb_ioctl(fp, cmd, (void __user *)arg); }
> > > +
> > > +#ifdef CONFIG_COMPAT
> > > +static long rpmb_compat_ioctl(struct file *fp, unsigned int cmd,
> > > +   unsigned long arg)
> > > +{
> > > + return  __rpmb_ioctl(fp, cmd, compat_ptr(arg));
> > > +}
> > > +#endif /* CONFIG_COMPAT */
> > 
> > Description of the ioctl is missing, 
> Will add. 
> 
> and it should certainly be designed in a way
> > that it does not need compat support.
> 
> The compat_ioctl handler just casts the compat_ptr, I believe this
> should be done unless the ioctl is globaly registered in
> fs/compat_ioctl.c, but I might be wrong.

You shouldn't need a compat ioctl for anything new that is added, unless
your api is really messed up.  Please test to be sure, and not use a
compat ioctl at all, it isn't that hard to do.

thanks,

greg k-h
--
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 11/17] smartpqi: minor tweaks to update time support

2016-08-31 Thread Johannes Thumshirn
On Tue, Aug 30, 2016 at 03:26:15PM +, Don Brace wrote:
> > -Original Message-
> > From: Johannes Thumshirn [mailto:jthumsh...@suse.de]
> > Sent: Tuesday, August 30, 2016 2:18 AM
> > To: Don Brace
> > Cc: j...@linux.vnet.ibm.com; Viswas G; Mahesh Rajashekhara;
> > h...@infradead.org; Scott Teel; Kevin Barnett; Justin Lindley; Scott Benesh;
> > elli...@hpe.com; linux-scsi@vger.kernel.org
> > Subject: Re: [PATCH 11/17] smartpqi: minor tweaks to update time support
> > 
> > EXTERNAL EMAIL
> > 
> > 
> > On Mon, Aug 29, 2016 at 08:29:20PM +, Don Brace wrote:
> > > > -Original Message-
> > > > From: Johannes Thumshirn [mailto:jthumsh...@suse.de]
> > 
> > [...]
> > 
> > >
> > > The reason is that we want it run immediately (or close to immediately).
> > >
> > > The code could be restructured to avoid calling this function with a 0, 
> > > but it
> > would result in more code and no benefit.
> > 
> > OK, now I'm not sure if we talked past each other. I didn't mean
> > "don't call schedule_delayed_work() with a delay of 0" but "why aren't
> > you using schedule_work() instead". But maybe it's just too early in
> > the morning and I didn't have enough coffee yet.
> 
> Because the two functions take different work structures as arguments:
> 
> static inline bool schedule_delayed_work(struct delayed_work *dwork,
>unsigned long delay)
> 
> static inline bool schedule_work(struct work_struct *work)

If that's the only concern, schedule_work(>work);

Anyway, that's probably just cosmetics.

With or without schedule_work()
Reviewed-by: Johannes Thumshirn 

But I bet someone comes up with a coccinelle spatch to change this
pattern some day.

Byte,
Johannes

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
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 00/30] FCoE VN2VN fixes

2016-08-31 Thread Johannes Thumshirn
On Tue, Aug 30, 2016 at 10:46:17PM -0400, Martin K . Petersen wrote:
> > "Johannes" == Johannes Thumshirn  writes:
> 
> Hannes,
> 
> Johannes> I _think_ I already reviewed them (at least I do have a
> Johannes> deja-vu when I read 'Revisit kref handling')
> 
> In v1 of the series patches 7, 11, 15 and 22 needed changes, everything
> else had been reviewed. 15 appears to have been dropped ("libfc: frame
> alloc failure messages"). Whereas 7, 11 and 15 have emerged as patches
> 25, 26 and 29 in the new series.
> 
> Anyway. You can't expect me, nor reviewers to keep track of all this
> shuffling. Especially not in a series with 30 patches. Please maintain a
> changelog when you repost and apply tags for patches you haven't
> tweaked.
> 
> I am happy to apply a partial series as long as nothing breaks. I have
> done a few where I have committed up to the first patch that had
> comments.

Hannes is currently on vacation. I think it's the save if we wait for
him to return so he can make a proper v2 (or v3) of this series.

Thanks,
Johannes
-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
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