]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
9 years agomegaraid_sas: Update OCR capability on controller properties change
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:10:14 +0000 (13:40 +0530)]
megaraid_sas: Update OCR capability on controller properties change

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c4bd265415d5b06d7e3615c53036f589f300076e)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Do not use PAGE_SIZE for max_sectors
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:10:04 +0000 (13:40 +0530)]
megaraid_sas: Do not use PAGE_SIZE for max_sectors

Orabug: 22620626

Do not use PAGE_SIZE marco to calculate max_sectors per I/O
request. Driver code assumes PAGE_SIZE will be always 4096 which can
lead to wrongly calculated value if PAGE_SIZE is not 4096. This issue
was reported in Ubuntu Bugzilla Bug #1475166.

Cc: <stable@vger.kernel.org>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 357ae967ad66e357f78b5cfb5ab6ca07fb4a7758)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Support for Cutlass (12 Gbps) controller
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:09:54 +0000 (13:39 +0530)]
megaraid_sas: Support for Cutlass (12 Gbps) controller

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 7364d34b878d78c4df90d0e6a5e06f8ad0c283e4)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Support for Intruder (12 Gbps) controller
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:09:44 +0000 (13:39 +0530)]
megaraid_sas: Support for Intruder (12 Gbps) controller

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 90c204bc59a313bf03a0641caee3e2b5945629b5)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Remove PCI id checks
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:09:34 +0000 (13:39 +0530)]
megaraid_sas: Remove PCI id checks

Orabug: 22620626

Remove PCI id based checks and use instance->ctrl_context to decide
whether controller is MFI-based or a Fusion adapter. Additionally,
Fusion adapters are divided into two categories: Thunderbolt and
Invader.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 5a8cb85b569b2349493aadb81a747e077766907d)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Expose TAPE drives unconditionally
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:09:24 +0000 (13:39 +0530)]
megaraid_sas: Expose TAPE drives unconditionally

Orabug: 22620626

Expose non-disk (TAPE drive, CD-ROM) unconditionally.

Cc: <stable@vger.kernel.org>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0d5b47a724bab0ebaaa933d6ff5e584957aaa188)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Version update
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:54:21 +0000 (17:24 +0530)]
megaraid_sas: Version update

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 609fb07b2bdebe5d2c6a9da7e9d8e05155086418)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Code refactor for use of requestorId
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:54:11 +0000 (17:24 +0530)]
megaraid_sas: Code refactor for use of requestorId

Orabug: 22620626

Some of these code changes were proposed by David Binderman.

Removed redudant check of requestorId. Redundant condition:
instance.requestorId. Check for plasma firmware 1.11 are now
restructured to support only specific device id.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 92bb6505785b632a1b0f735b21c4b34326ec048f)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Fix validHandles check in I/O path
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:54:01 +0000 (17:24 +0530)]
megaraid_sas: Fix validHandles check in I/O path

Orabug: 22620626

Syncro firmware supports round robin I/O switching on dual path. Driver
uses validHandles to check for dual path. However, it is supposed to
check for values > 1 (not > 2).

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 75b96061eb95c9b9f8a1da6995f1c314526f3572)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Print critical firmware event messages
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:53:51 +0000 (17:23 +0530)]
megaraid_sas: Print critical firmware event messages

Orabug: 22620626

Print firmware events in human-readable form. This will help users track
any critical firmware events without special application support.

Sample syslogd output:

megaraid_sas 0000:02:00.0: 8619 (491648347s/0x0020/WARN) - Controller temperature threshold exceeded. This may indicate inadequate system cooling. Switching to low performance mode.

The format of logged events is:

"<pci_dev_id>: <sequence_number> (<timestamp>/<locale>/<class>) - <description>"

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 714f517745729e060ef716d16026e26e5fce591f)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Chip reset if driver fails to get IOC ready
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:53:41 +0000 (17:23 +0530)]
megaraid_sas: Chip reset if driver fails to get IOC ready

Orabug: 22620626

Fix the issue reported at:

http://marc.info/?l=linux-scsi&m=143694494104544&w=2

Try to do chip reset at driver load time. If firmware fails to reach
ready state, try chip reset using adp_reset() callback. For Fusion
adapters the call back was previously void. Provide a suitable reset
function.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 79b82c2c560025afbb88ba7ad5cddb9c2203cf2e)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Support for max_io_size 1MB
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:53:31 +0000 (17:23 +0530)]
megaraid_sas: Support for max_io_size 1MB

Orabug: 22620626

Driver will expose max sge = 256 (earlier it was 64) if firmware
supports extended IO size (1M).

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit bd5f9484262a13397a0725f4a43f7baaa3341125)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Code cleanup-use local variable drv_ops inside megasas_ioc_init_fusion
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:53:21 +0000 (17:23 +0530)]
megaraid_sas: Code cleanup-use local variable drv_ops inside megasas_ioc_init_fusion

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 4dbbe3cec443f0c6867e7ef549704966fbd6f48b)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: JBOD sequence number support
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:53:11 +0000 (17:23 +0530)]
megaraid_sas: JBOD sequence number support

Orabug: 22620626

Implemented JBOD map which will provide quick access for JBOD path and
also provide sequence number.  This will help hardware to fail command
to the FW in case of any sequence mismatch.

Fast Path I/O for JBOD will refer JBOD map (which has sequence number
per JBOD device) instead of RAID map.  Previously, the driver used RAID
map to get device handle for fast path I/O and this not have sequence
number information. Now, driver will use JBOD map instead.  As part of
error handling, if JBOD map is failed/not supported by firmware, driver
will continue using legacy behavior.

Now there will be three IO paths for JBOD (syspd):

 - JBOD map with sequence number (Fast Path)
 - RAID map without sequence number (Fast Path)
 - FW path via h/w exception queue deliberately setup devhandle
   0xFFFF (FW path).

Relevant data structures:

 - Driver send new DCMD MR_DCMD_SYSTEM_PD_MAP_GET_INFO for this purpose.
 - struct MR_PD_CFG_SEQ- This structure represent map of single physical
   device.
 - struct MR_PD_CFG_SEQ_NUM_SYNC- This structure represent whole JBOD
   map in general(size, count of sysPDs configured, struct MR_PD_CFG_SEQ
   of syspD with 0 index).
 - JBOD sequence map size is: sizeof(struct MR_PD_CFG_SEQ_NUM_SYNC)
   + (sizeof(struct MR_PD_CFG_SEQ) * (MAX_PHYSICAL_DEVICES - 1)) which
   is allocated while setting up JBOD map at driver load time.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 3761cb4cf65ec78846b4b8cba9c0578bb10f92d5)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Increase timeout to 60 secs for abort frames during shutdown
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:53:01 +0000 (17:23 +0530)]
megaraid_sas: Increase timeout to 60 secs for abort frames during shutdown

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit e0bd0874f2de21613e572669b2de1e4b0c3a97de)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Synchronize driver headers with firmware APIs
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:52:51 +0000 (17:22 +0530)]
megaraid_sas: Synchronize driver headers with firmware APIs

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0be3f4c9e6b8f12c8c0d7b156b995b30134c7448)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: fix whitespace errors
Bjorn Helgaas [Tue, 7 Jul 2015 20:52:45 +0000 (15:52 -0500)]
megaraid_sas: fix whitespace errors

Orabug: 22620626

Fix whitespace and indentation errors.  No code change.

[jejb: checkpatch fixes]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit da0dc9fb4e6b0ad5a947c27a3c48985f6a2377eb)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: use dev_printk when possible
Bjorn Helgaas [Tue, 7 Jul 2015 20:52:34 +0000 (15:52 -0500)]
megaraid_sas: use dev_printk when possible

Orabug: 22620626

Use dev_printk() when possible to make messages more useful.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 1be1825453f6d75ea9c9ea0c8549ca481d94a7ab)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: fix TRUE and FALSE re-define build error
Suthikulpanit, Suravee [Wed, 10 Jun 2015 16:08:57 +0000 (11:08 -0500)]
megaraid_sas: fix TRUE and FALSE re-define build error

Orabug: 22620626

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Cc: Kashyap Desai <kashyap.desai@avagotech.com>
Cc: Sumit Saxena <sumit.saxena@avagotech.com>
Cc: Uday Lingala <uday.lingala@avagotech.com>
Acked-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit ad466c6c1edd3deac6deda3885f12d0b05efac11)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid: fix irq setup process regression
Tomas Henzl [Tue, 2 Jun 2015 10:39:46 +0000 (16:09 +0530)]
megaraid: fix irq setup process regression

Orabug: 22620626

This fixes a regression caused by commit
d3557fc8be11d25f316884581f487684f8e7dad3 megaraid_sas : Add separate function
for setting up IRQs This makes boot end with 'root does not exist' message on
certain adapters.

The bug is that the driver does not setup ints for cards without msi-x
support.  This patch fixes it, in addition to that it moves tasklet
initialisation before enable_intr, otherwise a kernel panic may occur, when an
interrupt arrives before the tasklet is ready.

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 258c3af2b9309412d82e74b2ea87e8c140fe2072)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agoqla2xxx: Update driver version to 8.07.00.33.40.0-k.
Sawan Chandak [Wed, 2 Mar 2016 06:15:20 +0000 (11:45 +0530)]
qla2xxx: Update driver version to 8.07.00.33.40.0-k.

Orabug: 22863553

Signed-off-by: Sawan Chandak <sawan.chandak@qlogic.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Set relogin flag when we fail to queue login requests.
Chad Dupuis [Wed, 27 Jan 2016 17:03:37 +0000 (12:03 -0500)]
qla2xxx: Set relogin flag when we fail to queue login requests.

Orabug: 22863553

If we fail to queue an srb for an async login we should set the
relogin flag so it will be retried as the reason for the queuing
failure was most likely transient.  Failure to do this can lead to
failed paths as login is never retried if the relogin flag is not
set.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Enable T10-DIF for ISP27XX
Himanshu Madhani [Wed, 27 Jan 2016 17:03:36 +0000 (12:03 -0500)]
qla2xxx: Enable T10-DIF for ISP27XX

Orabug: 22863553

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Provide mbx info in BBCR data after mbx failure
Harish Zunjarrao [Wed, 27 Jan 2016 17:03:35 +0000 (12:03 -0500)]
qla2xxx: Provide mbx info in BBCR data after mbx failure

Orabug: 22863553

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Avoid side effects when using endianizer macros.
Joe Carnuccio [Wed, 27 Jan 2016 17:03:34 +0000 (12:03 -0500)]
qla2xxx: Avoid side effects when using endianizer macros.

Orabug: 22863553

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Add support for Private link statistics counters.
Harish Zunjarrao [Fri, 26 Feb 2016 11:15:06 +0000 (16:45 +0530)]
qla2xxx: Add support for Private link statistics counters.

Orabug: 22863553

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Add support for buffer to buffer credit value for ISP27XX.
Sawan Chandak [Fri, 26 Feb 2016 11:00:57 +0000 (16:30 +0530)]
qla2xxx: Add support for buffer to buffer credit value for ISP27XX.

Orabug: 22863553

Signed-off-by: Sawan Chandak <sawan.chandak@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Add support for online flash update for ISP27XX.
Sawan Chandak [Fri, 26 Feb 2016 10:50:32 +0000 (16:20 +0530)]
qla2xxx: Add support for online flash update for ISP27XX.

Orabug: 22863553

Signed-off-by: Sawan Chandak <sawan.chandak@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Allow fw to hold status before sending ABTS response.
Himanshu Madhani [Fri, 26 Feb 2016 10:44:44 +0000 (16:14 +0530)]
qla2xxx: Allow fw to hold status before sending ABTS response.

Orabug: 22863553

Set bit 12 of additional firmware options 3 to let firmware
hold status IOCB until ABTS response is received from Target.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Seed init-cb login timeout from nvram exclusively.
Joe Carnuccio [Wed, 27 Jan 2016 17:03:29 +0000 (12:03 -0500)]
qla2xxx: Seed init-cb login timeout from nvram exclusively.

Orabug: 22863553

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Remove unneeded link offline message.
Chad Dupuis [Fri, 26 Feb 2016 10:33:49 +0000 (16:03 +0530)]
qla2xxx: Remove unneeded link offline message.

Orabug: 22863553

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agofirmware: dmi_scan: Fix UUID endianness for SMBIOS >= 2.6
Andrea Arcangeli [Fri, 8 Jan 2016 08:00:54 +0000 (09:00 +0100)]
firmware: dmi_scan: Fix UUID endianness for SMBIOS >= 2.6

The dmi_ver wasn't updated correctly before the dmi_decode method run
to save the uuid.

That resulted in "dmidecode -s system-uuid" and
/sys/class/dmi/id/product_uuid disagreeing. The latter was buggy and
this fixes it.

Reported-by: Federico Simoncelli <fsimonce@redhat.com>
Fixes: 9f9c9cbb6057 ("drivers/firmware/dmi_scan.c: fetch dmi version from SMBIOS if it exists")
Fixes: 79bae42d51a5 ("dmi_scan: refactor dmi_scan_machine(), {smbios,dmi}_present()")
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Orabug: 22694972
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agoxhci: Workaround to get Intel xHCI reset working more reliably
Rajmohan Mani [Wed, 18 Nov 2015 08:48:20 +0000 (10:48 +0200)]
xhci: Workaround to get Intel xHCI reset working more reliably

Orabug: 22805913

Existing Intel xHCI controllers require a delay of 1 mS,
after setting the CMD_RESET bit in command register, before
accessing any HC registers. This allows the HC to complete
the reset operation and be ready for HC register access.
Without this delay, the subsequent HC register access,
may result in a system hang, very rarely.

Verified CherryView / Braswell platforms go through over
5000 warm reboot cycles (which was not possible without
this patch), without any xHCI reset hang.

Signed-off-by: Rajmohan Mani <rajmohan.mani@intel.com>
Tested-by: Joe Lawrence <joe.lawrence@stratus.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a5964396190d0c40dd549c23848c282fffa5d1f2)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agohpsa: fix rmmod issues
Don Brace [Fri, 6 Nov 2015 14:04:55 +0000 (06:04 -0800)]
hpsa: fix rmmod issues

The driver is calling hpsa_shutdown before calling scsi_remove_host.
hpsa_shutdown is disabling interrupts.

scsi_remove_host can trigger I/O operations, such as
SYNCHRONIZE CACHE when multipath is enabled which hang the system.

Call scsi_remove_host before calling hpsa_shutdown.

Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: fix issues with multilun devices
shane.seymour [Fri, 6 Nov 2015 14:04:55 +0000 (06:04 -0800)]
hpsa: fix issues with multilun devices

A regression was introduced into the hpsa driver a while back so
non-zero LUNs of multi-LUN devices may no longer be presented via
a SAS based Smart Array. I have not done a bisection to discover
the change that caused it.

The CISS firmware specification (available on sourceforge)
defines an 8 byte lunid that describes devices that the Smart
Array can see/present to the system. The current code in the hpsa
driver attempts to find matches for non-zero LUNs with LUN 0 for
a bus/target by zeroing out byte 4 of the lunid and find a match.

This method is sufficient for SCSI based Smart Arrays because
byte 5 is always 0. For SAS based Smart arrays byte 5 of the
lunid contains the path number for a multipath device and
either one or two bits (the documentation does not define how
many bits are used but it appears it may be one only) that
indicate if the given path number in byte 5 must always be
used to access that device. Byte 5 may not always be zero.

The following are lunids (spaces added for clarity) for a
MSL2024 single drive library connected via a H241 Smart Array:

00 00 00 00 01 00 00 01 (changer)
00 00 00 00 00 80 00 01 (tape)

In the 4th byte (counting from 0) you can see that the tape
is LUN 0 and the changer is LUN 1. The 0x80 set in the 5th byte
for the tape drive means the driver should force access to
path 0 (the library in this case was connected to one path only
anyway).

After the changes we can see the following in the dmesg output:

scsi 0:3:0:0: RAID              HP       H241             1.18 \
PQ: 0 ANSI: 5
scsi 0:2:0:0: Sequential-Access HP       Ultrium 6-SCSI   354W \
PQ: 0 ANSI: 6
scsi 0:2:0:1: Medium Changer    HP       MSL G3 Series    8.70 \
PQ: 0 ANSI: 5

Showing that the changer is correctly identified as LUN 1 of
bus 2 target 0. Before the change the changer device is not seen.

Suggested-by: shane.seymour <shane.seymour@hp.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add in new offline mode
Scott Benesh [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: add in new offline mode

prevent adding volumes that are not available.

Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Justin Lindley <justin.lindley@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add in new controllers
Don Brace [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: add in new controllers

Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: cleanup update scsi devices
Don Brace [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: cleanup update scsi devices

showing that tables have been updated unnecessarily.

Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add sysfs entry path_info to show box and bay information
Joe Handzik [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: add sysfs entry path_info to show box and bay information

host no, bus, target, lun, scsi_device_type
for hba mode add: box and bay information

report if the path is active/inactive

Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add PMC-Sierra to copyright
Don Brace [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: add PMC-Sierra to copyright

need to add PMC to copyright notice and update the Hewlett-Packard
copyright notification.

Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: correct static checker warnings on driver init cleanup
Don Brace [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: correct static checker warnings on driver init cleanup

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: correct decode sense data
Don Brace [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: correct decode sense data

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: Correct double unlock of mutex
Don Brace [Fri, 6 Nov 2015 14:04:53 +0000 (06:04 -0800)]
hpsa: Correct double unlock of mutex

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: change driver version
Don Brace [Fri, 6 Nov 2015 13:47:45 +0000 (05:47 -0800)]
hpsa: change driver version

update driver version

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add in new controller id
Don Brace [Fri, 6 Nov 2015 13:47:45 +0000 (05:47 -0800)]
hpsa: add in new controller id

add in support for latest PMC controller

Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: dont meddle with hw which isn't ours
Don Brace [Fri, 6 Nov 2015 13:47:45 +0000 (05:47 -0800)]
hpsa: dont meddle with hw which isn't ours

the hpsa driver touches the hardware before checking the pci-id table.
This way, especially in kdump, it may confuse the proper driver (cciss)

Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: cleanup reset
Webb Scales [Fri, 6 Nov 2015 13:47:45 +0000 (05:47 -0800)]
hpsa: cleanup reset

Synchronize completion the reset with completion of outstanding commands

Extending the newly-added synchronous abort functionality,
now also synchronize resets with the completion of outstanding commands.
Rename the wait queue to reflect the fact that it's being used for both
types of waits.  Also, don't complete commands which are terminated
due to a reset operation.

fix for controller lockup during reset

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Webb Scales <webbnh@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: propagate the error code in hpsa_kdump_soft_reset
Robert Elliott [Fri, 6 Nov 2015 13:47:45 +0000 (05:47 -0800)]
hpsa: propagate the error code in hpsa_kdump_soft_reset

If hpsa_wait_for_board_state fails, hpsa_kdump_soft_reset
should propagate its return value (e.g., -ENODEV) rather
than just returning -1.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: use scsi host_no as hpsa controller number
Robert Elliott [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: use scsi host_no as hpsa controller number

Rather than numbering the hpsa controllers with an
incrementing 0..n value (e.g., that shows up in
/proc/interrupts), use the scsi midlayer
host_no (e.g. matching /sys/class/scsi_host/hostNN).

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: use block layer tag for command allocation
Webb Scales [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: use block layer tag for command allocation

Rework slave allocation:
  - separate the tagging support setup from the hostdata setup
  - make the hostdata setup act consistently when the lookup fails
  - make the hostdata setup act consistently when the device is not added
  - set up the queue depth consistently across these scenarios
  - if the block layer mq support is not available, explicitly enable and
    activate the SCSI layer tcq support (and do this at allocation-time so
    that the tags will be available for INQUIRY commands)

Tweak slave configuration so that devices which are masked are also
not attached.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Webb Scales <webbnh@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add interrupt number to /proc/interrupts interrupt name
Robert Elliott [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: add interrupt number to /proc/interrupts interrupt name

Add the interrupt number to the interrupt names that
appear in /proc/interrupts, so they are unique

Also, delete the IRQ and DAC prints.  Other parts of the kernel
already print the IRQ assignments, and dual-address-cycle support
has not been interesting since the parallel PCI bus went from
32 to 64 bits wide.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: create workqueue after the driver is ready for use
Robert Elliott [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: create workqueue after the driver is ready for use

Don't create the resubmit workqueue in hpsa_init_one until everything else
is ready to use, so everything can be freed in reverse order of when they
were allocated without risking freeing things while workqueue items are
still active.

Destroy the workqueue in the right order in
hpsa_undo_allocations_after_kdump_soft_reset too.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: fix try_soft_reset error handling
Robert Elliott [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: fix try_soft_reset error handling

If registering the special interrupt handlers in hpsa_init_one
before a soft reset fails, the error exit needs to deallocate
everything that was allocated before.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: cleanup for init_one step 2 in kdump
Robert Elliott [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: cleanup for init_one step 2 in kdump

In hpsa_undo_allocations_after_kdump_soft_reset,
the things allocated in hpsa_init_one step 2 -
h->resubmit_wq and h->lockup_detected  need to
be freed, in the right order.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: skip free_irq calls if irqs are not allocated
Robert Elliott [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: skip free_irq calls if irqs are not allocated

If try_soft_reset fails to re-allocate irqs, the error exit
starts with free_irq calls, which generate kernel WARN
messages since they were already freed a few lines earlier.

Jump to the next exit label to skip the free_irq calls.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: call pci_release_regions after pci_disable_device
Robert Elliott [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: call pci_release_regions after pci_disable_device

Despite the fact that PCI devices are enabled in this order:
    1. pci_enable_device
    2. pci_request_regions

    Documentation/PCI/pci.txt specifies that they be undone
    in this order
    1. pci_disable_device
    2. pci_release_regions

    Tested by injecting error in the call to pci_enable_device
    in hpsa_init_one -> hpsa_pci_init:
    [    9.095001] hpsa 0000:04:00.0: failed to enable PCI device
    [    9.095005] hpsa: probe of 0000:04:00.0 failed with error -22
    (-22 is -EINVAL)
    and then in the call pci_request_regions:
    [    9.178623] hpsa 0000:04:00.0: failed to obtain PCI resources
    [    9.178671] hpsa: probe of 0000:04:00.0 failed with error -16
    (-16 is -EBUSY)

    and then by adding
        reset_devices
    to the kernel command line and inject errors into the two
    calls to pci_enable_device and the call to pci_request_regions
    in hpsa_init_one -> hpsa_init_reset_devices.

    (inject on 6th call, 1st to hpsa2)
    [   62.413750] hpsa 0000:04:00.0: Failed to enable PCI device

    (inject on 7th call, 2nd to hpsa2)
    [   62.807571] hpsa 0000:04:00.0: failed to enable device.

    (inject on 8th call, 3rd to hpsa2)
    [   62.697198] hpsa 0000:04:00.0: failed to obtain PCI resources
    [   62.697234] hpsa: probe of 0000:04:00.0 failed with error -16

    The reset_devices path calls return -ENODEV on failure
    rather than passing the result, which apparently doesn't
    cause the pci driver to print anything.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace < don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: performance tweak for hpsa_scatter_gather()
Webb Scales [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: performance tweak for hpsa_scatter_gather()

Divide the loop in hpsa_scatter_gather() into two, one for the initial SG list
and a second one for the chained list, if any.  This allows the conditional
check which resets the indicies for the chained list to be performed outside
the loop instead of being done on every iteration inside the loop.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Webb Scales <webbnh@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: refactor and rework support for sending TEST_UNIT_READY
Webb Scales [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: refactor and rework support for sending TEST_UNIT_READY

Factor out the code which sends the TEST_UNIT_READY from
wait_for_device_to_become_ready() into its own function.

Move the code which waits for the TEST_UNIT_READY from
wait_for_device_to_become_ready() into its own function.

If a logical drive has failed, resetting it will ensure
outstanding commands are completed, but polling it with
TURs after the reset will not work because the TURs will
never report good status.  So successful TUR should not
be a condition of success for the device reset error
handler.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Webb Scales <webbnh@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: don't return abort request until target is complete
Webb Scales [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: don't return abort request until target is complete

Don't return from the abort request until the target command is complete.
Mark outstanding commands which have a pending abort, and do not send them
to the host if we can avoid it.

If the current command has been aborted, do not call the SCSI command
completion routine from the I/O path: when the abort returns successfully,
the SCSI mid-layer will handle the completion implicitly.

The following race was possible in theory.

1. LLD is requested to abort a scsi command
2. scsi command completes
3. The struct CommandList associated with 2 is made available.
4. new io request to LLD to another LUN re-uses struct CommandList
5. abort handler follows scsi_cmnd->host_scribble and
   finds struct CommandList and tries to aborts it.

Now we have aborted the wrong command.

Fix by resetting the scsi_cmd field of struct CommandList
upon completion and making the abort handler check that
the scsi_cmd pointer in the CommadList struct matches the
scsi_cmnd that it has been asked to abort.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Webb Scales <webbnh@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: use helper routines for finishing commands
Webb Scales [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: use helper routines for finishing commands

cleanup command completions

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Webb Scales <webbnh@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add support sending aborts to physical devices via the ioaccel2 path
Stephen Cameron [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: add support sending aborts to physical devices via the ioaccel2 path

add support for tmf when in ioaccel2 mode

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: do not print ioaccel2 warning messages about unusual completions.
Robert Elliott [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: do not print ioaccel2 warning messages about unusual completions.

The SCSI midlayer already prints more detail about completions,
and has logging level options to filter them if not wanted.
These just slow down the system if a lot of errors occur,
stressing error handling even more.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: clean up some error reporting output in abort handler
Robert Elliott [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: clean up some error reporting output in abort handler

report more useful information on aborts

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: clean up driver init
Robert Elliott [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: clean up driver init

Improve initialization error handling in hpsa_init_one
Clean up style and indent issues
Rename functions for consistency
Improve error messaging on allocations
Fix return status from hpsa_put_ctlr_into_performant_mode
Correct free order in hpsa_init_one using new function
   hpsa_free_performant_mode
Prevent inadvertent use of null pointers by nulling out the parent structures
   and zeroing out associated size variables.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: correct return values from driver functions.
Robert Elliott [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: correct return values from driver functions.

correct return codes for error conditions

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: do not check cmd_alloc return value - it cannnot return NULL
Robert Elliott [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: do not check cmd_alloc return value - it cannnot return NULL

cmd_alloc can no longer return NULL, so don't check for NULL any more
(which is unreachable code).

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add more ioaccel2 error handling, including underrun statuses.
Joe Handzik [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: add more ioaccel2 error handling, including underrun statuses.

improve ioaccel2 error handling, including better handling of
underrun statuses

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add ioaccel sg chaining for the ioaccel2 path
Webb Scales [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: add ioaccel sg chaining for the ioaccel2 path

Increase the request size for ioaccel2 path.

The error, if any, returned by hpsa_allocate_ioaccel2_sg_chain_blocks
to hpsa_alloc_ioaccel2_cmd_and_bft should be returned upstream rather
than assumed to be -ENOMEM.

This differs slightly from hpsa_alloc_ioaccel1_cmd_and_bft,
which does not call another hpsa_allocate function and only
has -ENOMEM to return from some kmalloc calls.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: refactor freeing of resources into more logical functions
Robert Elliott [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: refactor freeing of resources into more logical functions

refactor freeing of resources into more logical functions

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: clean up error handling
Robert Elliott [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: clean up error handling

refactor error cleanup and shutdown
disable interrupts and pci_disable_device on critical failures
add hpsa_free_cfgtables function

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: break hpsa_free_irqs_and_disable_msix into two functions
Robert Elliott [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: break hpsa_free_irqs_and_disable_msix into two functions

replace calls to hpsa_free_irqs_and_disable_msix with
hpsa_free_irqs and hpsa_disable_interrupt_mode

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: Get queue depth from identify physical bmic for physical disks.
Joe Handzik [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: Get queue depth from identify physical bmic for physical disks.

get drive queue depth to help avoid task set full conditions.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: use ioaccel2 path to submit IOs to physical drives in HBA mode.
Joe Handzik [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: use ioaccel2 path to submit IOs to physical drives in HBA mode.

use ioaccel2 path to submit I/O to physical drives in HBA mode

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: print accurate SSD Smart Path Enabled status
Robert Elliott [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: print accurate SSD Smart Path Enabled status

offload_enabled changes are deferred until after the
added/updated prints occur, so the values are incorrect.

defer printing SSD Smart Path Enabled status information until the
information is correct

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: factor out hpsa_ioaccel_submit function
Webb Scales [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: factor out hpsa_ioaccel_submit function

clean up command submission

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Webb Scales <webbnh@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: try resubmitting down raid path on task set full
Stephen Cameron [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: try resubmitting down raid path on task set full

allow the controller firmware to queue up commands when the ioaccel device
queue is full.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: do not ignore return value of hpsa_register_scsi
Stephen Cameron [Fri, 6 Nov 2015 13:47:40 +0000 (05:47 -0800)]
hpsa: do not ignore return value of hpsa_register_scsi

add error handling for failure when registering with SCSI subsystem.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: factor out hpsa_init_cmd function
Stephen Cameron [Fri, 6 Nov 2015 13:47:40 +0000 (05:47 -0800)]
hpsa: factor out hpsa_init_cmd function

Factor out hpsa_cmd_init from cmd_alloc().  We also need
this for resubmitting commands down the default RAID path
when they have returned from the ioaccel paths with errors.

In particular, reinitialize the cmd_type and busaddr fields as these
will not be correct for submitting down the RAID stack path
after ioaccel command completion.

This saves time when submitting commands.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: make function names consistent
Robert Elliott [Fri, 6 Nov 2015 13:47:40 +0000 (05:47 -0800)]
hpsa: make function names consistent

make function names more consistent and meaningful

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: allow lockup detected to be viewed via sysfs
Stephen Cameron [Fri, 6 Nov 2015 13:47:40 +0000 (05:47 -0800)]
hpsa: allow lockup detected to be viewed via sysfs

expose a detected lockup via sysfs

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: hpsa decode sense data for io and tmf
Stephen Cameron [Fri, 6 Nov 2015 13:47:40 +0000 (05:47 -0800)]
hpsa: hpsa decode sense data for io and tmf

In hba mode, we could get sense data in descriptor format so
we need to handle that.

It's possible for CommandStatus to have value 0x0D
"TMF Function Status", which we should handle.  We will get
this from a P1224 when aborting a non-existent tag, for
example.  The "ScsiStatus" field of the errinfo field
will contain the TMF function status value.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: decrement h->commands_outstanding in fail_all_outstanding_cmds
Stephen Cameron [Fri, 6 Nov 2015 13:47:40 +0000 (05:47 -0800)]
hpsa: decrement h->commands_outstanding in fail_all_outstanding_cmds

make tracking of outstanding commands more robust

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: clean up aborts
Stephen Cameron [Fri, 6 Nov 2015 13:47:40 +0000 (05:47 -0800)]
hpsa: clean up aborts

Do not send aborts to logical devices that do not support aborts

Instead of relying on what the Smart Array claims for supporting logical
drives, simply try an abort and see how it responds at device discovery
time.  This way devices that do support aborts (e.g. MSA2000) can work
and we do not waste time trying to send aborts to logical drives that do
not support them (important for high IOPS devices.)

While rescanning devices only test whether devices support aborts
the first time we encounter a device rather than every time.

Some Smart Arrays required aborts to be sent with tags in
the wrong endian byte order.  To avoid having to know about
this, we would send two aborts with tags with each endian order.
On high IOPS devices, this turns out to be not such a hot idea.
So we now have a list of the devices that got the tag backwards,
and we only send it one way.

If all available commands are outstanding and the abort handler
is invoked, the abort handler may not be able to allocate a command
and may busy-wait excessivly.  Reserve a small number of commands
for the abort handler and limit the number of concurrent abort
requests to the number of reserved commands.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: rework controller command submission
Webb Scales [Fri, 6 Nov 2015 13:47:39 +0000 (05:47 -0800)]
hpsa: rework controller command submission

Allow driver initiated commands to have a timeout.  It does not
yet try to do anything with timeouts on such commands.

We are sending a reset in order to get rid of a command we want to abort.
If we make it return on the same reply queue as the command we want to abort,
the completion of the aborted command will not race with the completion of
the reset command.

Rename hpsa_scsi_do_simple_cmd_core() to hpsa_scsi_do_simple_cmd(), since
this function is the interface for issuing commands to the controller and
not the "core" of that implementation.  Add a parameter to it which allows
the caller to specify the reply queue to be used.  Modify existing callers
to specify the default reply queue.

Rename __hpsa_scsi_do_simple_cmd_core() to hpsa_scsi_do_simple_cmd_core(),
since this routine is the "core" implementation of the "do simple command"
function and there is no longer any other function with a similar name.
Modify the existing callers of this routine (other than
hpsa_scsi_do_simple_cmd()) to instead call hpsa_scsi_do_simple_cmd(), since
it will now accept the reply_queue paramenter, and it provides a controller
lock-up check.  (Also, tweak two related message strings to make them
distinct from each other.)

Submitting a command to a locked up controller always results in a timeout,
so check for controller lock-up before submitting.

This is to enable fixing a race between command completions and
abort completions on different reply queues in a subsequent patch.
We want to be able to specify which reply queue an abort completion
should occur on so that it cannot race the completion of the command
it is trying to abort.

The following race was possible in theory:

  1. Abort command is sent to hardware.
  2. Command to be aborted simultaneously completes on another
     reply queue.
  3. Hardware receives abort command, decides command has already
     completed and indicates this to the driver via another different
     reply queue.
  4. driver processes abort completion finds that the hardware does not know
     about the command, concludes that therefore the command cannot complete,
     returns SUCCESS indicating to the mid-layer that the scsi_cmnd may be
     re-used.
  5. Command from step 2 is processed and completed back to scsi mid
     layer (after we already promised that would never happen.)

Fix by forcing aborts to complete on the same reply queue as the command
they are aborting.

Piggybacking device rescanning functionality onto the lockup
detection thread is not a good idea because if the controller
locks up during device rescanning, then the thread could get
stuck, then the lockup isn't detected.  Use separate work
queues for device rescanning and lockup detection.

Detect controller lockup in abort handler.

After a lockup is detected, return DO_NO_CONNECT which results in immediate
termination of commands rather than DID_ERR which results in retries.

Modify detect_controller_lockup() to return the result, to remove the need for a separate check.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Webb Scales <webbnh@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: clean up host, channel, target, lun prints
Webb Scales [Fri, 6 Nov 2015 13:47:39 +0000 (05:47 -0800)]
hpsa: clean up host, channel, target, lun prints

We had a mix of formats used for specifying controller, bus, target,
and lun address of devices.

change to the format used by the scsi midlayer and upper layer (2:3:0:0)
so you can easily follow the information from hpsa to scsi midlayer
to sd upper layer.

Also add this information:
- product ID
- vendor ID
- RAID level
- SSD Smath Path capable and enabled
- exposure level (sg-only)

Example:
hpsa 0000:04:00.0: added scsi 2:0:0:0: Direct-Access     HP LOGICAL VOLUME   RAID-0 SSDSmartPathCap+ En+ Exp=4
scsi 2:0:0:0: Direct-Access     HP       LOGICAL VOLUME   10.0 PQ: 0 ANSI: 5
sd 2:0:0:0: [sdr] 12501713072 512-byte logical blocks: (6.40 TB/5.82 TiB)
sd 2:0:0:0: [sdr] 4096-byte physical blocks
sd 2:0:0:0: [sdr] Attached SCSI disk
sd 2:0:0:0: Attached scsi generic sg20 type 0

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add masked physical devices into h->dev[] array
Stephen Cameron [Fri, 6 Nov 2015 13:47:39 +0000 (05:47 -0800)]
hpsa: add masked physical devices into h->dev[] array

Cache the ioaccel handle so that when we need to abort commands sent
down the ioaccel2 path, we can look up the LUN ID in h->dev[] instead of
having to do I/O to the controller.

Add a field to elements in h->dev[] to keep track of how the device is exposed
to the SCSI mid layer: Not at all, without an upper level driver
(no_uld_attach) or normally exposed.

Since masked physical devices are now present in h->dev[] array
it would be perfectly possible to do

echo scsi add-single-device 2 2 0 0 > /proc/scsi/scsi

and bring them online.  This was previously not allowed for masked
physical devices.

Ensure that the mapping of physical disks to logical drives gets updated in a
consistent way when a RAID migration occurs and is not touched until updates
to it are complete.

now instead of doing CISS_REPORT_PHYSICAL to get the LUNID for
the physical disk in hpsa_get_pdisk_of_ioaccel2(), just get
it out of h->dev[] where we already have it cached.

do not touch phys_disk[] for ioaccel enabled logical drives during rescan

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agoi40e/i40evf: Bump i40e to 1.4.25 and i40evf to 1.4.15
Jesse Brandeburg [Thu, 18 Feb 2016 00:12:24 +0000 (16:12 -0800)]
i40e/i40evf: Bump i40e to 1.4.25 and i40evf to 1.4.15

Orabug: 22342532

Bump.

Change-ID: Ifa19aadaa892ad103f1b96fe2361fa690912c6a3
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b8f1343a13c669aaa3d475ed8513a32154ae5ffd)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: let go of the past
Mitch Williams [Thu, 18 Feb 2016 00:12:23 +0000 (16:12 -0800)]
i40e: let go of the past

Orabug: 22342532

If we reset a VF, its VSI goes away, and it gets a new one. So don't
hang on to the now-stale local VSI pointer. It just leads to suffering
and kernel panics.

Change-ID: Ia8823b4e85893e95e963acee284968022b29177a
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 35f3472a750b3549f7f914ed96f41f0c2ca284f3)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: suspend scheduling during driver unload
Pandi Kumar Maharajan [Thu, 18 Feb 2016 17:19:25 +0000 (09:19 -0800)]
i40e: suspend scheduling during driver unload

Orabug: 22342532

We need to suspend scheduling or any pending service task during driver
unload process, so that new task will not be scheduled. This patch sets
the suspend flag bit during reload which avoids service task execution.

Change-ID: I017c57b5d6656564556e3c5387da671369a572ac
Signed-off-by: Pandi Kumar Maharajan <pandi.maharajan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a4618ec88de95a86f290d01c74c506552f1a5d95)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Use the new rx ctl register helpers. Don't use AQ calls from clear_hw.
Shannon Nelson [Thu, 18 Feb 2016 00:12:21 +0000 (16:12 -0800)]
i40e: Use the new rx ctl register helpers. Don't use AQ calls from clear_hw.

Orabug: 22342532

Use the new AdminQ functions for safely accessing the Rx control
registers that may be affected by heavy small packet traffic.

We can't use AdminQ calls in i40e_clear_hw() because the HW is being
initialized and the AdminQ is not alive.  We recently added an AQ
related replacement for reading PFLAN_QALLOC, and this patch puts
back the original register read.

Change-ID: Ib027168c954a5733299aa3a4ce5f8218c6bb5636
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 272cdaf2472ab7713deebe060bb90319b0382a94)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: implement and use Rx CTL helper functions
Shannon Nelson [Thu, 18 Feb 2016 00:12:20 +0000 (16:12 -0800)]
i40e: implement and use Rx CTL helper functions

Orabug: 22342532

Use the new AdminQ functions for safely accessing the Rx control
registers that may be affected by heavy small packet traffic.

Change-ID: Ibb00983e8dcba71f4b760222a609a5fcaa726f18
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f658137cbb1fddbe40ec7f1a2cebaf9dc9484ea7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add adminq commands for Rx CTL registers
Shannon Nelson [Thu, 18 Feb 2016 00:12:19 +0000 (16:12 -0800)]
i40e: add adminq commands for Rx CTL registers

Orabug: 22342532

Add the new opcodes and struct used for asking the firmware to update Rx
control registers that need extra care when being accessed while under
heavy traffic - e.g. sustained 64byte packets at line rate on all ports.
The firmware will take extra steps to be sure the register accesses
are successful.

The registers involved are:
PFQF_CTL_0
PFQF_HENA
PFQF_FDALLOC
PFQF_HREGION
PFLAN_QALLOC
VPQF_CTL
VFQF_HENA
VFQF_HREGION
VSIQF_CTL
VSILAN_QBASE
VSILAN_QTABLE
VSIQF_TCREGION
PFQF_HKEY
VFQF_HKEY
PRTQF_CTL_0
GLFCOE_RCTL
GLFCOE_RSOF
GLQF_CTL
GLQF_SWAP
GLQF_HASH_MSK
GLQF_HASH_INSET
GLQF_HSYM
GLQF_FC_MSK
GLQF_FC_INSET
GLQF_FD_MSK
PRTQF_FD_INSET
PRTQF_FD_FLXINSET
PRTQF_FD_MSK

Change-ID: I56c8144000da66ad99f68948d8a184b2ec2aeb3e
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3336514381f9ef99c50e5337ae1bf36f8138679d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: add check for null VSI
John Underwood [Thu, 18 Feb 2016 17:19:24 +0000 (09:19 -0800)]
i40e: add check for null VSI

Orabug: 22342532

Return from i40e_vsi_reinit_setup() if vsi param is NULL.
This makes this code consistent with all the other code that
checks for NULL before using one of the VSI pointers accessed
with an indexed variable. (Indexed VSI pointers are
intentionally set to NULL in i40e_vsi_clear() and
i40e_remove().

Change-ID: I3bc8b909c70fd2439334eeae994d151f61480985
Signed-off-by: John Underwood <johnx.underwood@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f534039dd8ab39cb3259e5860d2be3b0e70aacbf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Expose some registers to program parser, FD and RSS logic
Anjali Singhai Jain [Thu, 18 Feb 2016 00:12:17 +0000 (16:12 -0800)]
i40e: Expose some registers to program parser, FD and RSS logic

Orabug: 22342532

This patch adds 7 new register definitions for programming the
parser, flow director and RSS blocks in the HW.

Change-ID: I31e76673125275f3c69a14c646361919d04dc987
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit fe726082728da9f653d4e747baf0816d826fc626)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix for unexpected messaging
Carolyn Wyborny [Thu, 18 Feb 2016 00:12:16 +0000 (16:12 -0800)]
i40e: Fix for unexpected messaging

Orabug: 22342532

This fixes an issue where a previously removed message
has returned.  Changing the message type to dev_dbg
leaves the info, if desired, but takes it out of normal
everyday usage. Also changed call to only provide port
data when its valid and not when its not (delete case).

Change-ID: Ief6f33b915f6364c24fa8e5789c2fc3168b5e2ed
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 730a8f8777e55912f445c2c29234d51cceb1dfc2)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Do not wait for Rx queue disable in DCB reconfig
Neerav Parikh [Thu, 18 Feb 2016 00:12:15 +0000 (16:12 -0800)]
i40e: Do not wait for Rx queue disable in DCB reconfig

Orabug: 22342532

Just like Tx queues don't wait for Rx queues to be disabled before
DCB has been reconfigured.
Check the queues are disabled only after the DCB configuration has
been applied to the VSI(s) managed by the PF driver.

In case of any timeout issue a PF reset to recover.

Change-ID: Ic51e94c25baf9a5480cee983f35d15575a88642c
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3fe06f415b31ad06d2c2923216292057e899eb0d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Increase timeout when checking GLGEN_RSTAT_DEVSTATE bit
Kevin Scott [Thu, 18 Feb 2016 00:12:13 +0000 (16:12 -0800)]
i40e: Increase timeout when checking GLGEN_RSTAT_DEVSTATE bit

Orabug: 22342532

When linking with particular PHY types (ex: copper PHY), the amount of
time it takes for the GLGEN_RSTAT_DEVSTATE to be set increases greatly,
which can lead to a timeout and failure to load the driver.

Change-ID: If02be0dfcd7c57fdde2d5c81cd63651260cd2029
Signed-off-by: Kevin Scott <kevin.c.scott@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4d7cec078de864b7ba5459aa688278c4e6f3ad42)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix led blink capability for 10GBaseT PHY
Carolyn Wyborny [Thu, 18 Feb 2016 00:12:12 +0000 (16:12 -0800)]
i40e: Fix led blink capability for 10GBaseT PHY

Orabug: 22342532

This patch fixes a problem where the ethtool identify adapter
functionality did not work for some copper PHY's.  Without this
patch, the blink led functionality fails on some parts.  This
patch adds PHY write code to blink led's on parts where this
functionality is contained in the PHY rather than the MAC.

Change-ID: Iee7b3453f61d5ffd0b3d03f720ee4f17f919fcc2
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 31b606d0c40a1435c54bff18e4d3d3c33af1c3cf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e.h

9 years agoi40e: Add functions to blink led on 10GBaseT PHY
Carolyn Wyborny [Thu, 18 Feb 2016 00:12:11 +0000 (16:12 -0800)]
i40e: Add functions to blink led on 10GBaseT PHY

Orabug: 22342532

This patch adds functions to blink led on devices using
10GBaseT PHY since MAC registers used in other designs
do not work in this device configuration.

Change-ID: Id4b88c93c649fd2b88073a00b42867a77c761ca3
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit fd077cd3399b164548f538625f07f3e9f1d7ef00)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Move Tx checksum closer to TSO
Alexander Duyck [Wed, 17 Feb 2016 19:02:56 +0000 (11:02 -0800)]
i40e/i40evf: Move Tx checksum closer to TSO

Orabug: 22342532

On all of the other Intel drivers we place checksum close to TSO as they
have a significant amount in common and it can help to reduce the decision
tree for how to handle the frame as the first check in TSO is to see if
checksumming is offloaded, and if it is not we can skip _BOTH_ TSO and Tx
checksum offload based on a single check.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3bc67973e81d5104908a4ba7c2aab98a4f7bd64e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>