]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
8 years agomegaraid_sas: driver version upgrade
Sumit Saxena [Fri, 15 Apr 2016 07:23:33 +0000 (00:23 -0700)]
megaraid_sas: driver version upgrade

Orabug: 25568930

Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 54c4042852a85713a7bdd8436cc63762049fbb39)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agomegaraid_sas: task management code optimizations
Sumit Saxena [Fri, 15 Apr 2016 07:23:32 +0000 (00:23 -0700)]
megaraid_sas: task management code optimizations

Orabug: 25568930

This patch will do code optmization for task management functions.
Below are key changes:

1. Remove reset_device hook as it was not being used and driver was
setting this to NULL.

2. Create wrapper functions for task abort and target reset and inside
   these functions adapter specific calls be made. e.g. fusion adapters
   support task abort and target reset so task abort and target reset
   should be issued to fusion adapters only and for MFI adapters, print
   a message saying feature not supported.

Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit bd23d4abe5edf09dfba086d44b7972cf73c14b0b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/scsi/megaraid/megaraid_sas_base.c

8 years agomegaraid_sas: call ISR function to clean up pending replies in OCR path
Sumit Saxena [Fri, 15 Apr 2016 07:23:31 +0000 (00:23 -0700)]
megaraid_sas: call ISR function to clean up pending replies in OCR path

Orabug: 25568930

In OCR path, before calling chip reset calls function
megasas_wait_for_outstanding_fusion to check reason for OCR. In case of
firmware FAULT initiated OCR and DCMD timeout initiated timeout, driver
will clear any outstanding reply (yet to be processed by driver) in
reply queues before going for chip reset. This code is added to handle a
scenario when IO timeout initiated adapter reset and management
application initiated adapter reset (by sending command to FAULT
firmware) happens simultaneously since adapter reset function is
safe-guarded by reset_mutex so only thread will be doing controller
reset. Consider IO timeout thread gets mutex and proceeds with adapter
reset process after disabling interrupts and by the time management
application has fired command to firmware to do adapter reset and the
same command is completed by firmware but since interrupts are disabled,
driver will not get completion and the same command will be in
outstanding/pending commands list of driver and refires same command
from IO timeout thread after chip reset which will again FAULT firmware
and eventually causes kill adapter.

Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 64d0b8e4a6f7e9a3c366c2df93ec1f003d180ca3)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agomegaraid_sas: reduce memory footprints in kdump mode
Sumit Saxena [Fri, 15 Apr 2016 07:23:30 +0000 (00:23 -0700)]
megaraid_sas: reduce memory footprints in kdump mode

Orabug: 25568930

This patch will reduce memory footprints of megaraid_sas driver when
booted in kdump mode.  Driver will not allocate memory for optional and
perfromance oriented features.  Below are key changes done in
megaraid_sas driver to do this:

1. Limit Controller's queue depth to 100 in kdump mode.

2. Do not allocate memory for system info buffer and PD info buffer.

3. Disable performance oriented features e.g. Disable RDPQ mode, disable
   dual queue depth, restrict to single MSI-x vector.

Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c3e385a1b985a9202ba7fbd0bdbdcb909905d00c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agomegaraid_sas: add missing curly braces in ioctl handler
Arnd Bergmann [Mon, 14 Mar 2016 14:29:45 +0000 (15:29 +0100)]
megaraid_sas: add missing curly braces in ioctl handler

Orabug: 25568930

gcc-6 found a dubious indentation in the megasas_mgmt_fw_ioctl
function:

drivers/scsi/megaraid/megaraid_sas_base.c: In function 'megasas_mgmt_fw_ioctl':
drivers/scsi/megaraid/megaraid_sas_base.c:6658:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
    kbuff_arr[i] = NULL;
    ^~~~~~~~~
drivers/scsi/megaraid/megaraid_sas_base.c:6653:3: note: ...this 'if' clause, but it is not
   if (kbuff_arr[i])
   ^~

The code is actually correct, as there is no downside in clearing a NULL
pointer again.

This clarifies the code and avoids the warning by adding extra curly
braces.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 90dc9d98f01b ("megaraid_sas : MFI MPT linked list corruption fix")
Reviewed-by: Hannes Reinecke <hare@suse.com>
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 3deb9438d34a09f6796639b652a01d110aca9f75)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agompt3sas: Don't spam logs if logging level is 0
Johannes Thumshirn [Wed, 3 Aug 2016 13:00:18 +0000 (15:00 +0200)]
mpt3sas: Don't spam logs if logging level is 0

In _scsih_io_done() we test if the ioc->logging_level does _not_ have
the MPT_DEBUG_REPLY bit set and if it hasn't we print the debug
messages. This unfortunately is the wrong way around.

Note, the actual bug is older than af0094115 but this commit removed the
CONFIG_SCSI_MPT3SAS_LOGGING Kconfig option which hid the bug.

Fixes: af0094115 'mpt2sas, mpt3sas: Remove SCSI_MPTXSAS_LOGGING entry from Kconfig'
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0d667f72b2a20bbac72bec0ab11467fc70bb0f1f)

Orabug: 25512724

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
8 years agodrivers/misc/hpilo: Changes to support new security states in iLO5 FW
Rusk, Mark [Mon, 19 Sep 2016 19:50:01 +0000 (19:50 +0000)]
drivers/misc/hpilo: Changes to support new security states in iLO5 FW

Orabug: 25505535

Changes to support new security states of the iLO5 firmware.

- use BAR5 for CCB's for iLO5
- simplification of error handling

Signed-off-by: Mark Rusk <mark.rusk@hpe.com>
Signed-off-by: David Altobelli <david.altobelli@hpe.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c9fef1cc3dd3677633e6fd6ea5bd7ef3b741fab3)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Reviewed-by: Brian Maly <brian.maly@oracle.com>
8 years agomisc: hpilo: Change e-mail address from hp.com to hpe.com
Masanari Iida [Fri, 18 Sep 2015 03:32:13 +0000 (12:32 +0900)]
misc: hpilo: Change e-mail address from hp.com to hpe.com

Orabug: 25505535

This patch changes maintainer's email address from
hp.com to hpe.com in hpilo.c.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: David Altobelli <david.altobelli@hpe.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6b1eb1450269cadfe992465db9941fc42f3bc688)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Reviewed-by: Brian Maly <brian.maly@oracle.com>
8 years agomisc: hpilo: Add min and max value of module parameter in description
Masanari Iida [Fri, 18 Sep 2015 03:32:12 +0000 (12:32 +0900)]
misc: hpilo: Add min and max value of module parameter in description

Orabug: 25505535

This patch add minimum and maximum value of module parameter
max_ccb in hpilo.c.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 7a56f329c719d296f6b721d0ff10a6048fa94555)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Reviewed-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: aacraid: Fix INTx/MSI-x issue with older controllers
Dave Carroll [Thu, 9 Feb 2017 18:04:47 +0000 (11:04 -0700)]
scsi: aacraid: Fix INTx/MSI-x issue with older controllers

commit 78cbccd3bd68 ("aacraid: Fix for KDUMP driver hang")

caused a problem on older controllers which do not support MSI-x (namely
ASR3405,ASR3805). This patch conditionalizes the previous patch to
controllers which support MSI-x

Cc: <stable@vger.kernel.org> # v4.7+
Fixes: 78cbccd3bd68 ("aacraid: Fix for KDUMP driver hang")
Reported-by: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com>
Signed-off-by: Dave Carroll <david.carroll@microsemi.com>
Reviewed-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 8af8e1c22f9994bb1849c01d66c24fe23f9bc9a0)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: aacraid: remove wildcard for series 9 controllers
Kevin Barnett [Thu, 8 Dec 2016 16:29:29 +0000 (10:29 -0600)]
scsi: aacraid: remove wildcard for series 9 controllers

Controllers with this PCI ID never shipped outside of
PMCS/Microsemi. Remove the ID from the aacraid driver. smartpqi is the
correct driver for these controllers.

[mkp: patch description]

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ae2aae2421983f6f68eb7c4692624bc43ea50712)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoscsi: aacraid: mark aac_src_select_comm() static
Baoyou Xie [Sun, 4 Sep 2016 06:47:10 +0000 (14:47 +0800)]
scsi: aacraid: mark aac_src_select_comm() static

We get 1 warning when building kernel with W=1:
drivers/scsi/aacraid/src.c:616:5: warning: no previous prototype for 'aac_src_select_comm' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is declared
and don't need a declaration, but can be made static.  so this patch
marks this function with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Dave Carroll <david.carroll@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a44199eee7fdd2791b39da88938e6de6f5058632)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: use kmemdup
Muhammad Falak R Wani [Thu, 19 May 2016 14:08:33 +0000 (19:38 +0530)]
aacraid: use kmemdup

Use kmemdup when some other buffer is immediately copied into allocated
region. It replaces call to allocation followed by memcpy, by a single
call to kmemdup.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Reviewed-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 22e9f5a61666ed1145a09fbe49ac1a6f2ae7be8e)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: do not activate events on non-SRC adapters
Hannes Reinecke [Wed, 18 May 2016 08:16:51 +0000 (10:16 +0200)]
aacraid: do not activate events on non-SRC adapters

Only SRC-based adapters support the AifReqEvent function, so there is no
point in trying to activate it on older, non-SRC based adapters.  Doing
so lead to crashes on older adapters.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.com>
Reviewed-by: Raghava Aditya Renukunta <RaghavaAaditya.Renukunta@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 787ab6e97024926f38773287d9f98a9b330bce23)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
 Conflicts:
drivers/scsi/aacraid/linit.c

8 years agoaacraid: Fix for KDUMP driver hang
Raghava Aditya Renukunta [Tue, 26 Apr 2016 06:32:37 +0000 (23:32 -0700)]
aacraid: Fix for KDUMP driver hang

When KDUMP is triggered the driver first talks to the firmware in INTX
mode, but the adapter firmware is still in MSIX mode. Therefore the first
driver command hangs since the driver is waiting for an INTX response and
firmware gives a MSIX response. If when the OS is installed on a RAID
drive created by the adapter KDUMP will hang since the driver does not
receive a response in sync mode.

Fixed by: Change the firmware to INTX mode if it is in MSIX mode before
sending the first sync command.

Cc: stable@vger.kernel.org
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 78cbccd3bd683c295a44af8050797dc4a41376ff)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Remove code to needlessly complete fib
Raghava Aditya Renukunta [Tue, 26 Apr 2016 06:32:26 +0000 (23:32 -0700)]
aacraid: Remove code to needlessly complete fib

Currently driver completes double completed or spurious interrupted fibs.
This  is not necessary and causes the SCSI mid layer to issue aborts and
resets, since completing a fib  prematurely might trigger a race condition
resulting in the driver not calling the scsi_done callback.

Fixed by removing the call to fib complete.

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit eef76f16295d34d7fab6994b82dda60ce002f91d)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Log firmware AIF messages
Raghava Aditya Renukunta [Tue, 26 Apr 2016 06:32:09 +0000 (23:32 -0700)]
aacraid: Log firmware AIF messages

Firmware AIF messages about cache loss and data recovery are being missed
by the driver since currently they are not captured but rather let go.
This patch to capture those messages and log them for the user.

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 9cb62fa24e0d22dbe991c315d6c454a341ea3f76)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Fix for aac_command_thread hang
Raghava Aditya Renukunta [Tue, 26 Apr 2016 06:31:57 +0000 (23:31 -0700)]
aacraid: Fix for aac_command_thread hang

Typically under error conditions, it is possible for aac_command_thread()
to miss the wakeup from kthread_stop() and go back to sleep, causing it
to hang aac_shutdown.

In the observed scenario, the adapter is not functioning correctly and so
aac_fib_send() never completes (or time-outs depending on how it was
called). Shortly after aac_command_thread() starts it performs
aac_fib_send(SendHostTime) which hangs. When aac_probe_one
/aac_get_adapter_info send time outs, kthread_stop is called which breaks
the command thread out of it's hang.

The code will still go back to sleep in schedule_timeout() without
checking kthread_should_stop() so it causes aac_probe_one to hang until
the schedule_timeout() which is 30 minutes.

Fixed by: Adding another kthread_should_stop() before schedule_timeout()
Cc: stable@vger.kernel.org
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit fc4bf75ea300a5e62a2419f89dd0e22189dd7ab7)
Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Disable MSI mode for series 6, 7, 8 cards
Raghava Aditya Renukunta [Tue, 26 Apr 2016 06:31:43 +0000 (23:31 -0700)]
aacraid: Disable MSI mode for series 6, 7, 8 cards

As the firmware for series 6, 7, 8 cards does not support msi, remove it
in the driver

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit e4d5c4e238999ba0b68618a91eec33e7079cdbd4)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Relinquish CPU during timeout wait
Raghava Aditya Renukunta [Tue, 26 Apr 2016 06:31:26 +0000 (23:31 -0700)]
aacraid: Relinquish CPU during timeout wait

aac_fib_send has a special function case for initial commands during
driver initialization using wait < 0(pseudo sync mode). In this case,
the command does not sleep but rather spins checking for timeout.This
loop is calls cpu_relax() in an attempt to allow other processes/threads
to use the CPU, but this function does not relinquish the CPU and so the
command will hog the processor. This was observed in a KDUMP
"crashkernel" and that prevented the "command thread" (which is
responsible for completing the command from being timed out) from
starting because it could not get the CPU.

Fixed by replacing "cpu_relax()" call with "schedule()"
Cc: stable@vger.kernel.org
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Orabug: 25505509
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 07beca2be24cc710461c0b131832524c9ee08910)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Start adapter after updating number of MSIX vectors
Raghava Aditya Renukunta [Tue, 26 Apr 2016 06:31:12 +0000 (23:31 -0700)]
aacraid: Start adapter after updating number of MSIX vectors

The adapter has to be started after updating the number of MSIX Vectors

Fixes: ecc479e00db8 (aacraid: Set correct MSIX count for EEH recovery)
Cc: stable@vger.kernel.org
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 116d77fea02e2a5aded7d29ba4c692774cb339f1)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Fix incorrectly named MACRO
Raghava Aditya Renukunta [Tue, 26 Apr 2016 06:31:03 +0000 (23:31 -0700)]
aacraid: Fix incorrectly named MACRO

Suggested-by: Seymour, Shane M <shane.seymour@hpe.com>
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a6cd4549af54ee1ba70a77661499828ea5a2bb3c)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Removed unnecessary checks for NULL
Raghava Aditya Renukunta [Tue, 26 Apr 2016 06:30:55 +0000 (23:30 -0700)]
aacraid: Removed unnecessary checks for NULL

Current driver checks for NULL return from aac_fib_alloc_tag, but it not
possible for it to return NULL.

Fixed by: Remove all the checks for NULL returns from aac_fib_alloc_tag

Suggested-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit da31df8c7285910ee8c8629d901b34a480ab0005)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: add missing curly braces
Arnd Bergmann [Mon, 14 Mar 2016 14:29:43 +0000 (15:29 +0100)]
aacraid: add missing curly braces

gcc-6 warns about obviously wrong indentation for newly added code in
aac_slave_configure():

drivers/scsi/aacraid/linit.c: In function 'aac_slave_configure':
drivers/scsi/aacraid/linit.c:458:3: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
   sdev->tagged_supported = 1;
   ^~~~
drivers/scsi/aacraid/linit.c:455:4: note: ...this 'else' clause, but it is not

gcc is correct, and evidently this was meant to be within the curly
braces that should have been there to start with. This patch adds them,
which avoids the warning and makes it clear what was intended here.

Nothing changes in behavior because in the 'if' block, the
sdev->tagged_supported flag is known to be set already.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 6bf3b630d0a7 ("aacraid: SCSI blk tag support")
Reviewed-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 548f0e65a38f36976260a63ff4acfa9f3b17307d)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: SCSI blk tag support
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:05:59 +0000 (15:05 -0800)]
aacraid: SCSI blk tag support

The method to allocate and free FIB's in the present code utilizes
spinlocks. Multiple IO's have to wait on the spinlock to acquire or free
fibs creating a performance bottleneck.

An alternative solution would be to use block layer tags to keep track
of the fibs allocated and freed. To this end aac_fib_alloc_tag was
created to utilize the blk layer tags to plug into the Fib pool.These
functions are used exclusively in the IO path. 8 fibs are reserved for
the use of AIF management software and utilize the previous spinlock
based implementations.

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@pmcs.com>
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6bf3b630d0a733b74f7167a1cfac457358e67074)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Fix character device re-initialization
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:07 +0000 (15:06 -0800)]
aacraid: Fix character device re-initialization

During EEH PCI hotplug activity kernel unloads and loads the driver,
causing character device to be unregistered(aac_remove_one).When the
driver is loaded back using aac_probe_one the character device needs
to be registered again for the AIF management tools to work.

Fixed by adding code to register character device in aac_probe_one if
it is unregistered in aac_remove_one.

Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b9fb54b425e14658959bbc753452aaaf4d11d6fa)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Fix AIF triggered IOP_RESET
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:06 +0000 (15:06 -0800)]
aacraid: Fix AIF triggered IOP_RESET

while driver removal is in progress or PCI shutdown is invoked, driver
kills AIF aacraid thread, but IOCTL requests from the management tools
re-start AIF thread leading to IOP_RESET.

Fixed by setting adapter_shutdown flag when PCI shutdown is invoked.

Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit fbd185986ebafaeac900a1af1829fed2bf03242e)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Created new mutex for ioctl path
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:05 +0000 (15:06 -0800)]
aacraid: Created new mutex for ioctl path

aac_mutex was used to create protect the ioctl path for only the compat
path, it would be make more sense to place mutex in aac_do_ioctl, which
is the main ioctl function call that handles all ioctl commands.

Created new mutex ioctl_mutex in struct aac_dev to protect switch case
in aac_do_ioctl and removed aac_mutex from aac_cfg_ioctl and
aac_compat_do_ioctl

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@pmcs.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 222a9fb376df0f4aec32493a3fb5d18fa56979f2)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Fundamental reset support for Series 7
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:04 +0000 (15:06 -0800)]
aacraid: Fundamental reset support for Series 7

Series 7 does not support PCI hot reset used by EEH.

Enabled fundamental reset only for Series 7

Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6b93b7dd85dc0788eedc6ad30ff0b01ad9d4c657)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Set correct msix count for EEH recovery
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:03 +0000 (15:06 -0800)]
aacraid: Set correct msix count for EEH recovery

During EEH recovery number of online CPU's might change thereby changing
the number of MSIx vectors. Since each fib is allocated to a vector,
changes in the number of vectors causes fib to be sent thru invalid
vectors.In addition the correct number of MSIx vectors is not updated in
the INIT struct sent to the controller, when it is reinitialized.

Fixed by reassigning vectors to fibs based on the updated number of MSIx
vectors and updating the INIT structure before sending to controller.

Fixes: MSI-X vector calculation for suspend/resume
Cc: stable@vger.kernel.org
Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
Reviewed-by: Johannes Thumshirn <jthushirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ecc479e00db8eb110b200afe1effcb3df20ca7ae)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Added EEH support
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:01 +0000 (15:06 -0800)]
aacraid: Added EEH support

Added support for PCI EEH (extended error handling).

Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 5c63f7f710bdde6454d304a84146a5338962a509)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: aac_release_resources() can be static
Fengguang Wu [Tue, 10 Nov 2015 05:59:06 +0000 (13:59 +0800)]
aacraid: aac_release_resources() can be static

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit fe0798c5e150be8f06959250076d3864477e74c2)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Update driver version
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:41 +0000 (06:38 -0400)]
aacraid: Update driver version

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit ead1cbf92745b2b52846da56c9b3dd83ea4e718b)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Use pci_enable_msix_range()
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:40 +0000 (06:38 -0400)]
aacraid: Use pci_enable_msix_range()

As pci_enable_msix() deprecated, replaced with pci_enable_msix_range()

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 84859c926b0828b07b2c3dd66a440ef4120a8668)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: IOCTL fix
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:39 +0000 (06:38 -0400)]
aacraid: IOCTL fix

Driver blocks ioctls once it received shutdown/suspend request during
suspend/hybernation. This patch unblocks ioctls on resume path.

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit e728f8e39ffd8f7054e0718b4fb308c32235a5c2)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Reset irq affinity hints
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:38 +0000 (06:38 -0400)]
aacraid: Reset irq affinity hints

Reset irq affinity hints before releasing IRQ.
Removed duplicate code of IRQ acquire/release.

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 8b1462e0ebb677ee07da6c18f7047539ea6e449e)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Tune response path if IsFastPath bit set
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:37 +0000 (06:38 -0400)]
aacraid: Tune response path if IsFastPath bit set

If 'IsFastPath' bit is set, then response path assumes no error and skips
error check.

Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 55b8760847a6e593ab67448ca79f83c4b1a9f012)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Enable 64bit write to controller register
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:36 +0000 (06:38 -0400)]
aacraid: Enable 64bit write to controller register

If writeq() not supported, then do atomic two 32bit write

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit c6992781d9e8086d592f95870092a59042d111a2)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Change interrupt mode to MSI for Series 6
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:35 +0000 (06:38 -0400)]
aacraid: Change interrupt mode to MSI for Series 6

This change always sets MSI interrupt mode for series-6 controller.

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 9022d375bd22869ba3e5ad3635f00427cfb934fc)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Add Power Management support
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:34 +0000 (06:38 -0400)]
aacraid: Add Power Management support

* .suspend() and .resume() routines implemented in the driver
* aac_release_resources() initiates firmware shutdown
* aac_acquire_resources re-initializes the host interface

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit de665f28f788ad72ff6a0ce6ac2721d77248b7cf)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: Fix for LD name and UID not exposed to OS
Mahesh Rajashekhara [Fri, 28 Aug 2015 10:38:33 +0000 (06:38 -0400)]
aacraid: Fix for LD name and UID not exposed to OS

Driver sends the right size of the response buffer.

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Murthy Bhat <Murthy.Bhat@pmcs.com>
Reviewed-by: Karthikeya Sunkesula <Karthikeya.Sunkesula@pmcs.com>
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit fb5d40d4fca272286695c67da0a2d0a9d0954615)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoaacraid: aac_src_intr_message() can be static
kbuild test robot [Fri, 10 Apr 2015 08:53:38 +0000 (16:53 +0800)]
aacraid: aac_src_intr_message() can be static

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 305974fe011d9c2061b8da668c7da63ef0a4346d)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
8 years agoLPFC driver update for UEK4 11.2.0.5
rkennedy [Thu, 9 Feb 2017 18:29:12 +0000 (10:29 -0800)]
LPFC driver update for UEK4 11.2.0.5

Orabug: 25486030

Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Update copyrights
rkennedy [Thu, 9 Feb 2017 18:25:29 +0000 (10:25 -0800)]
lpfc: Update copyrights

Orabug: 25486030

Update copyrights to 2017 for all files touched in this patch set

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct WQ creation for pagesize
rkennedy [Thu, 9 Feb 2017 18:15:07 +0000 (10:15 -0800)]
lpfc: Correct WQ creation for pagesize

Orabug: 25486030

Correct WQ creation for pagesize

The driver was calculating the adapter command pagesize indicator from
the system pagesize. However, the buffers the driver allocates are only
one size (SLI4_PAGE_SIZE), so no calculation was necessary.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Fix few small typos in lpfc_scsi.c
Milan P. Gandhi [Thu, 13 Oct 2016 22:06:02 +0000 (15:06 -0700)]
scsi: lpfc: Fix few small typos in lpfc_scsi.c

Orabug: 25486030

This patch does a cleanup and fixes few small typos in lpfc_scsi.c

Signed-off-by: Milan P. Gandhi <mgandhi@redhat.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 4b160ae8a34983f11635981168760412ed3c2cfa)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Fix sg_reset on SCSI device causing kernel crash
James Smart [Thu, 13 Oct 2016 22:06:04 +0000 (15:06 -0700)]
scsi: lpfc: Fix sg_reset on SCSI device causing kernel crash

Orabug: 25486030

Fix sg_reset on SCSI device causing kernel crash

Driver could reference stale node pointers in task mgmt call.
Changed to use resetting cmd and look up node pointer in task mgmt
function.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit eed695d70e7eff55595f222b55b96f105d4a27ca)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Correct issue leading to oops during link reset
James Smart [Mon, 19 Dec 2016 23:07:23 +0000 (15:07 -0800)]
scsi: lpfc: Correct issue leading to oops during link reset

Orabug: 25486030

Correct issue leading to oops during link reset. Missing vport pointer.

[mkp: fixed typo]

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit e6c6acc0e0223ddaf867628d420ee196349c6fae)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Correct error in setting OS Driver Version with FW
James Smart [Mon, 19 Dec 2016 23:07:21 +0000 (15:07 -0800)]
scsi: lpfc: Correct error in setting OS Driver Version with FW

Orabug: 25486030

Correct error in setting OS Driver Version with FW.  Prior length was
too short.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@Suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b2fd103b05feabbc86db726ae121da94639892d7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Clear the VendorVersion in the PLOGI/PLOGI ACC payload
James Smart [Mon, 19 Dec 2016 23:07:20 +0000 (15:07 -0800)]
scsi: lpfc: Clear the VendorVersion in the PLOGI/PLOGI ACC payload

Orabug: 25486030

Clear the VendorVersion in the PLOGI/PLOGI ACC payload

Vendor version info may have been set on fabric login. Before sending
PLOGI payloads, ensure that it's cleared.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit e0165f20447c8ca1d367725ee94d8ec9f38ca275)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Correct host name in symbolic_name field
James Smart [Mon, 19 Dec 2016 23:07:24 +0000 (15:07 -0800)]
scsi: lpfc: Correct host name in symbolic_name field

Orabug: 25486030

Correct host name in symbolic_name field of nameserver registrations

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6c9231f604c2575be24c96d38deb70f145172f92)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: FCoE VPort enable-disable does not bring up the VPort
James Smart [Mon, 19 Dec 2016 23:07:25 +0000 (15:07 -0800)]
scsi: lpfc: FCoE VPort enable-disable does not bring up the VPort

Orabug: 25486030

FCoE VPort enable-disable does not bring up the VPort.
VPI structure needed to be initialized before being re-registered.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 104450eb08ca662e6b1d02da11aca9598e978f3e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Fix Xlane dynamic LUN set for LUN priority.
James Smart [Mon, 19 Dec 2016 23:07:26 +0000 (15:07 -0800)]
scsi: lpfc: Fix Xlane dynamic LUN set for LUN priority.

Orabug: 25486030

Fix Xlane dynamic LUN set for LUN priority. Dynamic changing of the
priority was not getting reflected on the LUN.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b5749fe182a0fa1c39ea1b33c0691d436f269195)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Deprecate lpfc_prot_sg_seg_cnt parameter
James Smart [Mon, 19 Dec 2016 23:07:27 +0000 (15:07 -0800)]
scsi: lpfc: Deprecate lpfc_prot_sg_seg_cnt parameter

Orabug: 25486030

Deprecate lpfc_prot_sg_seg_cnt parameter. Eliminates driver from
unnecessarily limiting DIF s/g list length.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit f2bf460cf5ef989f0a593d05932460326376d5f6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Correct oops on vport port resets
James Smart [Mon, 19 Dec 2016 23:07:29 +0000 (15:07 -0800)]
scsi: lpfc: Correct oops on vport port resets

Orabug: 25486030

Correct oops on vport port resets. Incorrect WQE type, thus the clearing
code actually overstepped the WQE.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 2f07784f05c23b322863274e801c31aa64e46c71)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Add missing memory barrier
James Smart [Mon, 19 Dec 2016 23:07:30 +0000 (15:07 -0800)]
scsi: lpfc: Add missing memory barrier

Orabug: 25486030

On loosely ordered memory systems (PPC for example), the WQE elements
were being updated in memory, but not necessarily flushed before the
separate doorbell was written to hw which would cause hw to dma the
WQE element. Thus, the hardware occasionally received partially
updated WQE data.

Add the memory barrier after updating the WQE memory.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6b3b3bdb83b4ad51252d21bb13596db879e51850)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: fix oops/BUG in lpfc_sli_ringtxcmpl_put()
Mauricio Faria de Oliveira [Wed, 23 Nov 2016 12:33:19 +0000 (10:33 -0200)]
scsi: lpfc: fix oops/BUG in lpfc_sli_ringtxcmpl_put()

Orabug: 25486030

The BUG_ON() recently introduced in lpfc_sli_ringtxcmpl_put() is hit in
the lpfc_els_abort() > lpfc_sli_issue_abort_iotag() >
lpfc_sli_abort_iotag_issue() function path [similar names], due to
'piocb->vport == NULL':

BUG_ON(!piocb || !piocb->vport);

This happens because lpfc_sli_abort_iotag_issue() doesn't set the
'abtsiocbp->vport' pointer -- but this is not the problem.

Previously, lpfc_sli_ringtxcmpl_put() accessed 'piocb->vport' only if
'piocb->iocb.ulpCommand' is neither CMD_ABORT_XRI_CN nor
CMD_CLOSE_XRI_CN, which are the only possible values for
lpfc_sli_abort_iotag_issue():

    lpfc_sli_ringtxcmpl_put():

        if ((unlikely(pring->ringno == LPFC_ELS_RING)) &&
           (piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) &&
           (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN) &&
            (!(piocb->vport->load_flag & FC_UNLOADING)))

    lpfc_sli_abort_iotag_issue():

        if (phba->link_state >= LPFC_LINK_UP)
                iabt->ulpCommand = CMD_ABORT_XRI_CN;
        else
                iabt->ulpCommand = CMD_CLOSE_XRI_CN;

So, this function path would not have hit this possible NULL pointer
dereference before.

In order to fix this regression, move the second part of the BUG_ON()
check prior to the pointer dereference that it does check for.

For reference, this is the stack trace observed. The problem happened
because an unsolicited event was received - a PLOGI was received after
our PLOGI was issued but not yet complete, so the discovery state
machine goes on to sw-abort our PLOGI.

    kernel BUG at drivers/scsi/lpfc/lpfc_sli.c:1326!
    Oops: Exception in kernel mode, sig: 5 [#1]
    <...>
    NIP [...] lpfc_sli_ringtxcmpl_put+0x1c/0xf0 [lpfc]
    LR  [...] __lpfc_sli_issue_iocb_s4+0x188/0x200 [lpfc]
    Call Trace:
    [...] [...] __lpfc_sli_issue_iocb_s4+0xb0/0x200 [lpfc] (unreliable)
    [...] [...] lpfc_sli_issue_abort_iotag+0x2b4/0x350 [lpfc]
    [...] [...] lpfc_els_abort+0x1a8/0x4a0 [lpfc]
    [...] [...] lpfc_rcv_plogi+0x6d4/0x700 [lpfc]
    [...] [...] lpfc_rcv_plogi_plogi_issue+0xd8/0x1d0 [lpfc]
    [...] [...] lpfc_disc_state_machine+0xc0/0x2b0 [lpfc]
    [...] [...] lpfc_els_unsol_buffer+0xcc0/0x26c0 [lpfc]
    [...] [...] lpfc_els_unsol_event+0xa8/0x220 [lpfc]
    [...] [...] lpfc_complete_unsol_iocb+0xb8/0x138 [lpfc]
    [...] [...] lpfc_sli4_handle_received_buffer+0x6a0/0xec0 [lpfc]
    [...] [...] lpfc_sli_handle_slow_ring_event_s4+0x1c4/0x240 [lpfc]
    [...] [...] lpfc_sli_handle_slow_ring_event+0x24/0x40 [lpfc]
    [...] [...] lpfc_do_work+0xd88/0x1970 [lpfc]
    [...] [...] kthread+0x108/0x130
    [...] [...] ret_from_kernel_thread+0x5c/0xbc
    <...>

Cc: stable@vger.kernel.org # v4.8
Fixes: 22466da5b4b7 ("lpfc: Fix possible NULL pointer dereference")
Reported-by: Harsha Thyagaraja <hathyaga@in.ibm.com>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 2319f847a8910cff1d46c9b66aa1dd7cc3e836a9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Fix possible NULL pointer dereference
Johannes Thumshirn [Fri, 29 Jul 2016 13:30:56 +0000 (15:30 +0200)]
lpfc: Fix possible NULL pointer dereference

Orabug: 25486030

Check for the existence of piocb->vport before accessing it.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 22466da5b4b7a82d3e5a9c21c752cae91a21dc91)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Use %zd format string for size_t
Arnd Bergmann [Mon, 17 Oct 2016 12:35:46 +0000 (14:35 +0200)]
scsi: lpfc: Use %zd format string for size_t

Orabug: 25486030

A recent bugfix introduced a harmless warning in the lpfc driver:

drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_write_firmware':
drivers/scsi/lpfc/lpfc_logmsg.h:56:45: error: format '%ld' expects argument of type 'long int', but argument 9 has type 'size_t {aka const unsigned int}' [-Werror=format=]

'size_t' is always the same width as 'long' in the kernel, but the
compiler doesn't know that. The %z modifier is what the standard expects
to be used here, and this shuts up the warning.

Fixes: 679053c651fb ("scsi: lpfc: Fix fw download on SLI-4 FC adapters")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit efe583c6d3cdafbeb0c039cd5d0f88fd26637065)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Fix fw download on SLI-4 FC adapters
James Smart [Thu, 13 Oct 2016 22:06:17 +0000 (15:06 -0700)]
scsi: lpfc: Fix fw download on SLI-4 FC adapters

Orabug: 25486030

Fix fw download on SLI-4 FC adapters

Driver performs a quick validation of magic numbers in the fw
download image. Driver needed to be updated for more recent
magic numbers.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6b6ef5db2590f0f6b99ba25fb018b60653ea66fe)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Synchronize link speed with boot driver
James Smart [Thu, 13 Oct 2016 22:06:16 +0000 (15:06 -0700)]
scsi: lpfc: Synchronize link speed with boot driver

Orabug: 25486030

Synchronize link speed with boot driver

Link speed settings set by the boot driver are reported by the hw.
Driver will attempt to read them, and if set, will respect their
values.
The driver can override the settings with its own if instructed by
user space (via bsg), with the new values being picked up by the
boot driver.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c691816e00d0b4da376f005ffc06eec8a9711dcf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Correct panics with eh_timeout and eh_deadline
James Smart [Thu, 13 Oct 2016 22:06:15 +0000 (15:06 -0700)]
scsi: lpfc: Correct panics with eh_timeout and eh_deadline

Orabug: 25486030

Correct panics with eh_timeout and eh_deadline

We were having double completions on our SLI-3 version of adapters.
Solved by clearing our command pointer before calling scsi_done.

The eh paths potentially ran simulatenously and would see the non-null
value and invoke scsi_done again.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 89533e9be08aeda5cdc4600d46c1540c7b440299)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Fix lost target in pt-to-pt connect
James Smart [Thu, 13 Oct 2016 22:06:14 +0000 (15:06 -0700)]
scsi: lpfc: Fix lost target in pt-to-pt connect

Orabug: 25486030

Fix lost target in pt-to-pt connect

Change reject code to something that allows a retry

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 401304cc0d508de2e366e693fedbe52b18aef0a8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Revise strings with full lpfc parameter name
James Smart [Thu, 13 Oct 2016 22:06:13 +0000 (15:06 -0700)]
scsi: lpfc: Revise strings with full lpfc parameter name

Orabug: 25486030

Revise strings with full lpfc parameter name

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6c86068dd235b61af9bfdcb8d3ec0d98ccbcf5a6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Code cleanup for lpfc_sriov_nr_virtfn parameter
James Smart [Thu, 13 Oct 2016 22:06:12 +0000 (15:06 -0700)]
scsi: lpfc: Code cleanup for lpfc_sriov_nr_virtfn parameter

Orabug: 25486030

Code cleanup for lpfc_sriov_nr_virtfn parameter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0cfbbf2f9672c07637427f24768647a7fe19bd75)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Code cleanup for lpfc_max_scsicmpl_time parameter
James Smart [Thu, 13 Oct 2016 22:06:11 +0000 (15:06 -0700)]
scsi: lpfc: Code cleanup for lpfc_max_scsicmpl_time parameter

Orabug: 25486030

Code cleanup for lpfc_max_scsicmpl_time parameter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ed5b152913971aeac12751f313655358ca2ab6e4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Code cleanup for lpfc_topology parameter
James Smart [Thu, 13 Oct 2016 22:06:10 +0000 (15:06 -0700)]
scsi: lpfc: Code cleanup for lpfc_topology parameter

Orabug: 25486030

Code cleanup for lpfc_topology parameter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0a0354398cf8775c40973bcfa60ec8d5a72ee58d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Code cleanup for lpfc_aer_support parameter
James Smart [Thu, 13 Oct 2016 22:06:09 +0000 (15:06 -0700)]
scsi: lpfc: Code cleanup for lpfc_aer_support parameter

Orabug: 25486030

Code cleanup for lpfc_aer_support parameter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 506139a23eff91c365098fe9cc418e0fdcc5b660)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Code cleanup for lpfc_enable_rrq parameter
James Smart [Thu, 13 Oct 2016 22:06:08 +0000 (15:06 -0700)]
scsi: lpfc: Code cleanup for lpfc_enable_rrq parameter

Orabug: 25486030

Code cleanup for lpfc_enable_rrq parameter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 31202b0e3c8dded6623a13ea0033a7bf03121c0a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Code clean up for lpfc_iocb_cnt parameter
James Smart [Thu, 13 Oct 2016 22:06:07 +0000 (15:06 -0700)]
scsi: lpfc: Code clean up for lpfc_iocb_cnt parameter

Orabug: 25486030

Code clean up for lpfc_iocb_cnt parameter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0d8c8ba3fa5e21eebf36ef7ab7e370622309ac1c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Set driver environment data on adapter
James Smart [Thu, 13 Oct 2016 22:06:05 +0000 (15:06 -0700)]
scsi: lpfc: Set driver environment data on adapter

Orabug: 25486030

Set driver environment data on adapter

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 61bda8f7c3ce46ce5de7c91a3383f7fe963643b9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Correct embedded io wq element size
James Smart [Thu, 13 Oct 2016 22:06:03 +0000 (15:06 -0700)]
scsi: lpfc: Correct embedded io wq element size

Orabug: 25486030

Correct embedded io wq element size. Embedded element sizes are
128 byte elements

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit dc58f44c2140748d96e33a533cd9e80692f58518)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: Mark symbols static where possible
Baoyou Xie [Sun, 25 Sep 2016 05:44:55 +0000 (13:44 +0800)]
scsi: lpfc: Mark symbols static where possible

Orabug: 25486030

We get a few warnings when building kernel with W=1:
drivers/scsi/lpfc/lpfc_sli.c:5693:1: warning: no previous prototype for 'lpfc_set_features' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_sli.c:8972:1: warning: no previous prototype for 'lpfc_sli_calc_ring' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4621:1: warning: no previous prototype for 'lpfc_rdp_res_link_service' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4633:1: warning: no previous prototype for 'lpfc_rdp_res_sfp_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4698:1: warning: no previous prototype for 'lpfc_rdp_res_link_error' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4727:1: warning: no previous prototype for 'lpfc_rdp_res_bbc_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4752:1: warning: no previous prototype for 'lpfc_rdp_res_oed_temp_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4780:1: warning: no previous prototype for 'lpfc_rdp_res_oed_voltage_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4809:1: warning: no previous prototype for 'lpfc_rdp_res_oed_txbias_desc' [-Wmissing-prototypes]
drivers/scsi/lpfc/lpfc_els.c:4838:1: warning: no previous prototype for 'lpfc_rdp_res_oed_txpower_desc' [-Wmissing-prototypes]
....

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.  So this
patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit bd4b3e5c8adf2b9f601b46b917afac555be05688)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: lpfc: avoid harmless comparison warning
Arnd Bergmann [Wed, 15 Jun 2016 20:42:17 +0000 (22:42 +0200)]
scsi: lpfc: avoid harmless comparison warning

Orabug: 25486030

When building with -Wextra, we get a lot of warnings for the lpfc driver
concerning expressions that are always true, starting with:

drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_enable_npiv_init':
drivers/scsi/lpfc/lpfc_attr.c:2786:77: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_enable_rrq_init':
drivers/scsi/lpfc/lpfc_attr.c:2802:76: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_suppress_link_up_init':
drivers/scsi/lpfc/lpfc_attr.c:2812:2050: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_log_verbose_init':
drivers/scsi/lpfc/lpfc_attr.c:3064:1930: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]

The code works as intended, but it would be nice to shut up the warning
so we don't clutter up build logs with this. Using a separate inline
function for it makes it clear to the compiler that the comparison is
necessary in the caller but still lets it do the constant-folding.

[mkp: fix typo]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit de8c36bba33380fcc8564e69c039a4b84166e66d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: call lpfc_sli_validate_fcp_iocb() with the hbalock held
Johannes Thumshirn [Mon, 18 Jul 2016 14:06:03 +0000 (16:06 +0200)]
lpfc: call lpfc_sli_validate_fcp_iocb() with the hbalock held

Orabug: 25486030

Call lpfc_sli_validate_fcp_iocb() with the hbalock held, as the pointer
to iocbq is not guaranteed to still be valid after looking it up.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 31979008fdae72d7441643f3a5b1bdaedf481335)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Copyright updates
James Smart [Wed, 6 Jul 2016 19:36:13 +0000 (12:36 -0700)]
lpfc: Copyright updates

Orabug: 25486030

Copyright updates

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 51f4ca3c93b2eaf80a182e9fcfa4f9e5706cca12)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct issue with ioremap() call on 32bit kernel
James Smart [Wed, 6 Jul 2016 19:36:11 +0000 (12:36 -0700)]
lpfc: Correct issue with ioremap() call on 32bit kernel

Orabug: 25486030

Correct issue with ioremap() call on 32bit kernel

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 115a4124bae6697b375e150deaed3a4ffc6580e1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Re-organize source for easier driver attribute management
James Smart [Wed, 6 Jul 2016 19:36:10 +0000 (12:36 -0700)]
lpfc: Re-organize source for easier driver attribute management

Orabug: 25486030

Re-organize source for easier driver attribute management

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 93dd1911cf4913321d91aa9c525f5f8149f90fee)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Remove global lpfc_sli_mode attribute in leiu of per-hba lpfc_sli_mode
James Smart [Wed, 6 Jul 2016 19:36:09 +0000 (12:36 -0700)]
lpfc: Remove global lpfc_sli_mode attribute in leiu of per-hba lpfc_sli_mode

Orabug: 25486030

Remove global lpfc_sli_mode attribute in leiu of per-hba lpfc_sli_mode

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 12247e8101eacfda790a14944c34bdccb6e90d6b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Remove global lpfc_delay_discovery attribute in leiu of per-hba lpfc_delay_disc...
James Smart [Wed, 6 Jul 2016 19:36:08 +0000 (12:36 -0700)]
lpfc: Remove global lpfc_delay_discovery attribute in leiu of per-hba lpfc_delay_discovery

Orabug: 25486030

Remove global lpfc_delay_discovery attribute in leiu of per-hba
lpfc_delay_discovery

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 8eb8b960fd0593baaddd1c01cbff6b85c5056ccf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Remove global lpfc_enable_npiv attribute in leiu of per-hba lpfc_enable_npiv
James Smart [Wed, 6 Jul 2016 19:36:07 +0000 (12:36 -0700)]
lpfc: Remove global lpfc_enable_npiv attribute in leiu of per-hba lpfc_enable_npiv

Orabug: 25486030

Remove global lpfc_enable_npiv attribute in leiu of per-hba lpfc_enable_npiv

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 458c083e83ed2f8e446cf1a38dd21996cebe6da0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct Port reset resulting in FC port going offline
James Smart [Wed, 6 Jul 2016 19:36:06 +0000 (12:36 -0700)]
lpfc: Correct Port reset resulting in FC port going offline

Orabug: 25486030

Correct Port reset resulting in FC port going offline

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0e916ee71d2f0453dbfe402cd8ca24f9668518ad)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Add support for XLane LUN priority
James Smart [Wed, 6 Jul 2016 19:36:05 +0000 (12:36 -0700)]
lpfc: Add support for XLane LUN priority

Orabug: 25486030

Add support for XLane LUN priority

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c92c841cc72ae7eb665fb9ea2a1c991e214c3807)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct RDP response Revision location
James Smart [Wed, 6 Jul 2016 19:36:04 +0000 (12:36 -0700)]
lpfc: Correct RDP response Revision location

Orabug: 25486030

Correct RDP response Revision location

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 5b1993dedfdc131ff095c0c079ef106aed3fe9ac)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Re-organize source for easier device-id management
James Smart [Wed, 6 Jul 2016 19:36:03 +0000 (12:36 -0700)]
lpfc: Re-organize source for easier device-id management

Orabug: 25486030

Re-organize source for easier device-id management

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 12f4445733c516648ab0b013314a83467876ac2f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct FCOE discovery to avoid loss of storage devices after system reboot
James Smart [Wed, 6 Jul 2016 19:36:02 +0000 (12:36 -0700)]
lpfc: Correct FCOE discovery to avoid loss of storage devices after system reboot

Orabug: 25486030

Correct FCOE discovery to avoid loss of storage devices after system reboot

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a1cadfeffac70a1ed77b45a8f93b92b9cb501d94)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Fix SLI mode 2 config failure
James Smart [Wed, 6 Jul 2016 19:36:01 +0000 (12:36 -0700)]
lpfc: Fix SLI mode 2 config failure

Orabug: 25486030

Fix SLI mode 2 config failure

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 4597663fabf16645e2af8f02b9d7ba66110588b6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Add MDS Diagnostics Support
James Smart [Wed, 6 Jul 2016 19:36:00 +0000 (12:36 -0700)]
lpfc: Add MDS Diagnostics Support

Orabug: 25486030

Add MDS Diagnostics Support

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 7bdedb34a0ac1a4b30224c6945eaaebc6fae779a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Add recovery from adapter parity errors on some SLI4 adapters
James Smart [Wed, 6 Jul 2016 19:35:56 +0000 (12:35 -0700)]
lpfc: Add recovery from adapter parity errors on some SLI4 adapters

Orabug: 25486030

Add recovery from adapter parity errors on some SLI4 adapters

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 65791f1f90aade6a02877f9bb7c63f67b35f138c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Utilize embedded CDB logic to minimize IO latency
James Smart [Thu, 31 Mar 2016 21:12:30 +0000 (14:12 -0700)]
lpfc: Utilize embedded CDB logic to minimize IO latency

Orabug: 25486030

Pass cmd iu payloads inline to adapter job structure rather than as
separate dma buffers.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b5c539583988b70bddea73f333c640fc93a62e88)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Add sysfs proc_name support
James Smart [Wed, 6 Jul 2016 19:35:59 +0000 (12:35 -0700)]
lpfc: Add sysfs proc_name support

Orabug: 25486030

Add sysfs proc_name support

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 08dcd4cf3be26024ade20ff7c9f436a2cff83792)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Disable FDMI probing if not connected to a fabric
James Smart [Wed, 6 Jul 2016 19:36:12 +0000 (12:36 -0700)]
lpfc: Disable FDMI probing if not connected to a fabric

Orabug: 25486030

Disable FDMI probing if not connected to a fabric

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a03a4219a4e0b3e53078a2f97fee0b5a4cab2a20)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Reject RDP ELS if port has no login
James Smart [Wed, 6 Jul 2016 19:35:58 +0000 (12:35 -0700)]
lpfc: Reject RDP ELS if port has no login

Orabug: 25486030

Reject RDP ELS if port has no login

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 7d9333139ec0dd7fd1ffa69ad4ab4bf701481ac9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct Buffer credit descriptor values in RDP response
James Smart [Wed, 6 Jul 2016 19:35:57 +0000 (12:35 -0700)]
lpfc: Correct Buffer credit descriptor values in RDP response

Orabug: 25486030

Correct Buffer credit descriptor values in RDP response

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 3aaaa3141796d646052457aaff2a1be7c81aab3a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Correct RDP response sizing issue
James Smart [Wed, 6 Jul 2016 19:35:55 +0000 (12:35 -0700)]
lpfc: Correct RDP response sizing issue

Orabug: 25486030

Correct RDP response sizing issue

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6c92d1d0ce4efffc67ba6f4ce0c7f970c15af390)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agolpfc: Fix Transgression Flag of Optical Element descriptor for RDP on Linux
James Smart [Wed, 6 Jul 2016 19:35:54 +0000 (12:35 -0700)]
lpfc: Fix Transgression Flag of Optical Element descriptor for RDP on Linux

Orabug: 25486030

Fix Transgression Flag of Optical Element descriptor for RDP on Linux

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 310429ef11e828e26c5ef222b6793bef1fc8cd6e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agobnx2x: avoid two atomic ops per page on x86
Eric Dumazet [Fri, 20 Jan 2017 16:25:34 +0000 (08:25 -0800)]
bnx2x: avoid two atomic ops per page on x86

Orabug: 25477835

Commit 4cace675d687 ("bnx2x: Alloc 4k fragment for each rx ring buffer
element") added extra put_page() and get_page() calls on arches where
PAGE_SIZE=4K like x86

Reorder things to avoid this overhead.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Cc: Yuval Mintz <Yuval.Mintz@cavium.com>
Cc: Ariel Elior <ariel.elior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b9032741e4f86844d8c4a7c18001ee328dae2f7a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agobnx2x: Prevent tunnel config for 577xx
Mintz, Yuval [Sun, 4 Dec 2016 13:30:18 +0000 (15:30 +0200)]
bnx2x: Prevent tunnel config for 577xx

Orabug: 25477835

Only the 578xx adapters are capable of configuring UDP ports for
the purpose of tunnelling - doing the same on 577xx might lead to
a firmware assertion.
We're already not claiming support for any related feature for such
devices, but we also need to prevent the configuration of the UDP
ports to the device in this case.

Fixes: f34fa14cc033 ("bnx2x: Add vxlan RSS support")
Reported-by: Anikina Anna <anikina@gmail.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 360d9df2acd9f0b89aabaf16fca08954f113bd4e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

8 years agoixgbevf: Handle previously-freed msix_entries
Mark Rustad [Fri, 28 Oct 2016 17:46:39 +0000 (10:46 -0700)]
ixgbevf: Handle previously-freed msix_entries

Orabug: 24568240

The msix_entries memory can be freed by a previous suspend or
remove, so don't crash on close when it isn't there. Also only
clear the interrupts when the interface is up, because there
aren't any when it is not up.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit eeffceee421b17a1d484679d738f278fbaa01384)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoixgbe: ixgbe_atr() compute l4_proto only if non-paged data has network/transport...
Sowmini Varadhan [Mon, 24 Oct 2016 22:36:39 +0000 (15:36 -0700)]
ixgbe: ixgbe_atr() compute l4_proto only if non-paged data has network/transport headers

Orabug: 24568240

For some Tx paths (e.g., tpacket_snd()), ixgbe_atr may be
passed down an sk_buff that has the network and transport
header in the paged data, so it needs to make sure these
headers are available in the headlen bytes to calculate the
l4_proto.

This patch expect that network and transport headers are
already available in the non-paged header dat.  The assumption
is that the caller has set this up if l4_proto based Tx
steering is desired.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Reviewed-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 9f3c7504fa005e2aab5ba9e1f2d8b4f4fcc6c077)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c