]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
8 years agoscsi: mpt3sas: Fix for improper info displayed in var log, while blocking or unblocki...
Suganath Prabu Subramani [Wed, 26 Oct 2016 08:04:32 +0000 (13:34 +0530)]
scsi: mpt3sas: Fix for improper info displayed in var log, while blocking or unblocking the device.

Orabug: 25535122

Return value and Device_handle Arguments passed in correct order
 to match with its format string.

Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com>
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b2fe6be798754a222ee5f22b90d175739c75c8c1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoscsi: mpt3sas: Fix for block device of raid exists even after deleting raid disk
Sreekanth Reddy [Fri, 28 Oct 2016 04:39:12 +0000 (10:09 +0530)]
scsi: mpt3sas: Fix for block device of raid exists even after deleting raid disk

Orabug: 25535122

While merging mpt3sas & mpt2sas code, we added the is_warpdrive check
condition on the wrong line

---------------------------------------------------------------------------
 scsih_target_alloc(struct scsi_target *starget)
                        sas_target_priv_data->handle = raid_device->handle;
                        sas_target_priv_data->sas_address = raid_device->wwid;
                        sas_target_priv_data->flags |= MPT_TARGET_FLAGS_VOLUME;
-                       raid_device->starget = starget;
+                       sas_target_priv_data->raid_device = raid_device;
+                       if (ioc->is_warpdrive)
+                               raid_device->starget = starget;
                }
                spin_unlock_irqrestore(&ioc->raid_device_lock, flags);
                return 0;
------------------------------------------------------------------------------

That check should be for the line sas_target_priv_data->raid_device =
raid_device;

Due to above hunk, we are not initializing raid_device's starget for
raid volumes, and so during raid disk deletion driver is not calling
scsi_remove_target() API as driver observes starget field of
raid_device's structure as NULL.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@broadcom.com>
Cc: <stable@vger.kernel.org> # v4.4+
Fixes: 7786ab6aff9 ("mpt3sas: Ported WarpDrive product SSS6200 support")
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6d3a56ed098566bc83d6c2afa74b4199c12ea074)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agompt3sas: Fix resume on WarpDrive flash cards
Greg Edwards [Sat, 30 Jul 2016 16:06:26 +0000 (10:06 -0600)]
mpt3sas: Fix resume on WarpDrive flash cards

Orabug: 25535122

mpt3sas crashes on resume after suspend with WarpDrive flash cards.  The
reply_post_host_index array is not set back up after the resume, and we
deference a stale pointer in _base_interrupt().

[   47.309711] BUG: unable to handle kernel paging request at ffffc90001f8006c
[   47.318289] IP: [<ffffffffc00863ef>] _base_interrupt+0x49f/0xa30 [mpt3sas]
[   47.326749] PGD 41ccaa067 PUD 41ccab067 PMD 3466c067 PTE 0
[   47.333848] Oops: 0002 [#1] SMP
...
[   47.452708] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.7.0 #6
[   47.460506] Hardware name: Dell Inc. OptiPlex 990/06D7TR, BIOS A18 09/24/2013
[   47.469629] task: ffffffff81c0d500 ti: ffffffff81c00000 task.ti: ffffffff81c00000
[   47.479112] RIP: 0010:[<ffffffffc00863ef>]  [<ffffffffc00863ef>] _base_interrupt+0x49f/0xa30 [mpt3sas]
[   47.490466] RSP: 0018:ffff88041d203e30  EFLAGS: 00010002
[   47.497801] RAX: 0000000000000001 RBX: ffff880033f4c000 RCX: 0000000000000001
[   47.506973] RDX: ffffc90001f8006c RSI: 0000000000000082 RDI: 0000000000000082
[   47.516141] RBP: ffff88041d203eb0 R08: ffff8804118e2820 R09: 0000000000000001
[   47.525300] R10: 0000000000000001 R11: 00000000100c0000 R12: 0000000000000000
[   47.534457] R13: ffff880412c487e0 R14: ffff88041a8987d8 R15: 0000000000000001
[   47.543632] FS:  0000000000000000(0000) GS:ffff88041d200000(0000) knlGS:0000000000000000
[   47.553796] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   47.561632] CR2: ffffc90001f8006c CR3: 0000000001c06000 CR4: 00000000000406f0
[   47.570883] Stack:
[   47.575015]  000000001d211228 ffff88041d2100c0 ffff8800c47d8130 0000000000000100
[   47.584625]  ffff8804100c0000 100c000000000000 ffff88041a8992a0 ffff88041a8987f8
[   47.594230]  ffff88041d203e00 ffffffff81111e55 000000000000038c ffff880414ad4280
[   47.603862] Call Trace:
[   47.608474]  <IRQ>
[   47.610413]  [<ffffffff81111e55>] ? call_timer_fn+0x35/0x120
[   47.620539]  [<ffffffff81100a1f>] handle_irq_event_percpu+0x7f/0x1c0
[   47.629061]  [<ffffffff81100b8c>] handle_irq_event+0x2c/0x50
[   47.636859]  [<ffffffff81103fff>] handle_edge_irq+0x6f/0x130
[   47.644654]  [<ffffffff8102fbf3>] handle_irq+0x73/0x120
[   47.652011]  [<ffffffff810c6ada>] ? atomic_notifier_call_chain+0x1a/0x20
[   47.660854]  [<ffffffff817e374b>] do_IRQ+0x4b/0xd0
[   47.667777]  [<ffffffff817e160c>] common_interrupt+0x8c/0x8c
[   47.675635]  <EOI>

Move the reply_post_host_index array setup into
mpt3sas_base_map_resources(), which is also in the resume path.

Cc: stable@vger.kernel.org
Signed-off-by: Greg Edwards <gedwards@fireweed.org>
Acked-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ce7c6c9e1d997a2670aead3a7b87f4df32c11118)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agompt3sas: Fix warnings exposed by W=1
Calvin Owens [Fri, 29 Jul 2016 04:38:22 +0000 (21:38 -0700)]
mpt3sas: Fix warnings exposed by W=1

Orabug: 25535122

Trivial non-functional changes for a couple annoying things:

  1) Functions local to files are not declared static, which is
  frustrating when reading the code because it's non-obvious at first
  glance what's actually called from other files.

  2) Set-but-unused variables abound, presumably to mask -Wunused-result
  errors in the past. None of these are flagged today though (with one
  exception noted below), so remove them.

Fixing (2) exposed the fact that we improperly ignore the return value
of scsi_device_reprobe() in _scsih_reprobe_lun(). Fixing the calling
code to deal with the potential error is non-trivial, so for now just
WARN().

Signed-off-by: Calvin Owens <calvinowens@fb.com>
Acked-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 8bbb1cf63f5e345685d42749606d0474cfde6def)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agompt3sas: Eliminate dead sleep_flag code
Calvin Owens [Fri, 29 Jul 2016 04:38:21 +0000 (21:38 -0700)]
mpt3sas: Eliminate dead sleep_flag code

Orabug: 25535122

With the exception of a single call to wait_for_doorbell_int(), all this
conditional sleeping code is dead. So delete it.

Signed-off-by: Calvin Owens <calvinowens@fb.com>
Acked-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 98c56ad32c33f0fd6742502bafe7003e4b8c80ed)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agompt3sas: Eliminate conditional locking in mpt3sas_scsih_issue_tm()
Calvin Owens [Fri, 29 Jul 2016 04:38:20 +0000 (21:38 -0700)]
mpt3sas: Eliminate conditional locking in mpt3sas_scsih_issue_tm()

Orabug: 25535122

This flag that conditionally acquires the mutex is confusing and prone
to bugginess: refactor it into two separate function calls, and make the
unlocked one complain if it's called outside the mutex.

Signed-off-by: Calvin Owens <calvinowens@fb.com>
Acked-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 96902835e7e2c7bf59db28ffd550852610169a2d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agompt3sas: Ensure the connector_name string is NUL-terminated
Calvin Owens [Thu, 28 Jul 2016 04:45:51 +0000 (21:45 -0700)]
mpt3sas: Ensure the connector_name string is NUL-terminated

Orabug: 25535122

We blindly trust the hardware to give us NUL-terminated strings, which
is a bad idea because it doesn't always do that. For example:

  [  481.184784] mpt3sas_cm0:  enclosure level(0x0000), connector name(     \x3)

In this case, connector_name is four spaces. We got lucky here because
the 2nd byte beyond our character array happens to be a NUL. Fix this by
explicitly writing '\0' to the end of the string to ensure we don't run
off the edge of the world in printk().

Signed-off-by: Calvin Owens <calvinowens@fb.com>
Acked-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 310c8e40d5cd2512b6d46177563460726cc6166a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agompt3sas: Fix panic when aer correct error occurred
Kefeng Wang [Tue, 12 Jul 2016 09:43:25 +0000 (17:43 +0800)]
mpt3sas: Fix panic when aer correct error occurred

Orabug: 25535122

The _scsih_pci_mmio_enabled called if scsih_pci_error_detected returns
PCI_ERS_RESULT_CAN_RECOVER, at this point, read/write to the device
still works, no need to reset slot.

Or the mpt3sas_base_map_resources in scsih_pci_slot_reset will fail,
and iounamp ioc->chip, then we will meet issue when read ioc->chip
in mpt3sas_base_get_iocstate from _base_fault_reset_work.

Cc: Sathya Prakash <sathya.prakash@broadcom.com>
Cc: Chaitra P B <chaitra.basappa@broadcom.com>
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Acked-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 83c3d3400c87d6d943bf97fce4b30f4fe6870253)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agompt3sas: avoid mpt3sas_transport_port_add NULL parent_dev
Joe Lawrence [Wed, 25 May 2016 19:14:29 +0000 (15:14 -0400)]
mpt3sas: avoid mpt3sas_transport_port_add NULL parent_dev

Orabug: 25535122

If _scsih_sas_host_add's call to mpt3sas_config_get_sas_iounit_pg0
fails, ioc->sas_hba.parent_dev may be left uninitialized.  A later
device probe could invoke mpt3sas_transport_port_add which will call
sas_port_alloc_num [scsi_transport_sas] with a NULL parent_dev pointer.

Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
Acked-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit ad2bf16543622594432439cd16e90e22cc965964)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agompt3sas: set num_phys after allocating phy[] space
Joe Lawrence [Wed, 25 May 2016 19:14:28 +0000 (15:14 -0400)]
mpt3sas: set num_phys after allocating phy[] space

Orabug: 25535122

In _scsih_sas_host_add, the number of HBA phys are determined and then
later used to allocate an array of struct _sas_phy's.  If the routine
sets ioc->sas_hba.num_phys, but then fails to allocate the
ioc->sas_hba.phy array (by kcalloc error or other intermediate
error/exit path), ioc->sas_hba is left in a dangerous state: all readers
of ioc->sas_hba.phy[] do so by indexing it from 0..ioc->sas_hba.num_phys
without checking that the space was ever allocated.

Modify _scsih_sas_host_add to set ioc->sas_hba.num_phys only after
successfully allocating ioc->sas_hba.phy[].

Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
Acked-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 87aa95d4bb77613acaed9724efe07dde9e9bacd7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agompt3sas: add missing curly braces
Dan Carpenter [Thu, 12 May 2016 20:37:38 +0000 (23:37 +0300)]
mpt3sas: add missing curly braces

Orabug: 25639713

There are some missing curly braces on this if statement, so we end up
printing when we shouldn't.

Fixes: a470a51cd648 ('mpt3sas: Handle active cable exception event')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 7ebd67e0dece0ec53e5541fc600eda4e050fab72)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agobnx2i: fix spelling mistake "complection" -> "completion"
Colin Ian King [Sat, 4 Jun 2016 19:14:30 +0000 (20:14 +0100)]
bnx2i: fix spelling mistake "complection" -> "completion"

Trivial fix to spelling mistake in printk message.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25606037
(cherry picked from commit 09d2a4e7fca62369b6ad018fb03ac8df96c93823)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agobnx2i: silence uninitialized variable warnings
Dan Carpenter [Thu, 14 Apr 2016 09:40:06 +0000 (12:40 +0300)]
bnx2i: silence uninitialized variable warnings

Presumably it isn't possible to have empty lists here, but my static
checker doesn't know that and complains that "ep" can be used
uninitialized.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25606037
(cherry picked from commit 9c8a76d5f00dbfd1da6ea242a9263a47133e4053)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoqlcnic: Update version to 5.3.65
Manish Chopra [Wed, 3 Aug 2016 08:02:04 +0000 (04:02 -0400)]
qlcnic: Update version to 5.3.65

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605962
(cherry picked from commit b8b2372de9cc00d5ed667c7b8db29b6cfbf037f5)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoqlcnic: fix napi budget alteration
Manish Chopra [Wed, 3 Aug 2016 08:02:03 +0000 (04:02 -0400)]
qlcnic: fix napi budget alteration

Driver modifies the supplied NAPI budget in qlcnic_83xx_msix_tx_poll()
function. Instead, it should use the budget as it is.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605962
(cherry picked from commit fc4ca987f7cc0cb7ea8cb8bb673447939a84bb07)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoqlcnic: fix data structure corruption in async mbx command handling
Manish Chopra [Wed, 3 Aug 2016 08:02:02 +0000 (04:02 -0400)]
qlcnic: fix data structure corruption in async mbx command handling

This patch fixes a data structure corruption bug in the SRIOV VF mailbox
handler code. While handling mailbox commands from the atomic context,
driver is accessing and updating qlcnic_async_work_list_struct entry fields
in the async work list. These fields could be concurrently accessed by the
work function resulting in data corruption.

This patch restructures async mbx command handling by using a separate
async command list instead of using a list of work_struct structures.
A single work_struct is used to schedule and handle the async commands
with proper locking mechanism.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605962
(cherry picked from commit 2b10d3ecf2dac737653828889ff85f614318f01a)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agonet: qlcnic: avoid superfluous assignement
xypron.glpk@gmx.de [Sun, 31 Jul 2016 10:07:37 +0000 (12:07 +0200)]
net: qlcnic: avoid superfluous assignement

Assigning NULL to parmeter dcb has no effect outside of the
inlined function.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605962
(cherry picked from commit 43dcff349f091b6a2f5f491c35d89b173df41acf)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoqlcnic: add wmb() call in transmit data path.
Sony Chacko [Wed, 29 Jun 2016 21:51:34 +0000 (17:51 -0400)]
qlcnic: add wmb() call in transmit data path.

Call wmb() to ensure writes are complete before
hardware fetches updated Tx descriptors.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605962
(cherry picked from commit 9216a97a12b069c62f0e927a9f54be4883648a0f)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoqlcnic: use the correct ring in qlcnic_83xx_process_rcv_ring_diag()
Dan Carpenter [Mon, 27 Jun 2016 20:50:29 +0000 (23:50 +0300)]
qlcnic: use the correct ring in qlcnic_83xx_process_rcv_ring_diag()

There is a static checker warning here "warn: mask and shift to zero"
and the code sets "ring" to zero every time.  From looking at how
QLCNIC_FETCH_RING_ID() is used in qlcnic_83xx_process_rcv_ring() the
qlcnic_83xx_hndl() should be removed.

Fixes: 4be41e92f7c6 ('qlcnic: 83xx data path routines')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605962
(cherry picked from commit 5b4d10f5e0369ed79434593b7cd8e85eebbe473f)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agonet: qlcnic: don't set unused function argument
Arnd Bergmann [Thu, 16 Jun 2016 11:38:22 +0000 (13:38 +0200)]
net: qlcnic: don't set unused function argument

We get a warning for qlcnic_83xx_get_mac_address when building with
"make W=1":

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c: In function 'qlcnic_83xx_get_mac_address':
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c:2156:8: error: parameter 'function' set but not used [-Werror=unused-but-set-parameter]

Clearly this is harmless, but there is also no point for setting
the variable, so we can simply remove the assignment.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605962
(cherry picked from commit 287debd6aac5b9f60113d45931a53da0cd4adc94)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agonet: qlge: remove superfluous statement
xypron.glpk@gmx.de [Sun, 31 Jul 2016 10:19:28 +0000 (12:19 +0200)]
net: qlge: remove superfluous statement

Variable length is not used after the deleted line.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit 4fb482f73703d69ce23f9ddfa1c55acdb3cf49a6)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agonet/qlge: Avoids recursive EEH error
Gavin Shan [Mon, 23 May 2016 01:58:28 +0000 (11:58 +1000)]
net/qlge: Avoids recursive EEH error

One timer, whose handler keeps reading on MMIO register for EEH
core to detect error in time, is started when the PCI device driver
is loaded. MMIO register can't be accessed during PE reset in EEH
recovery. Otherwise, the unexpected recursive error is triggered.
The timer isn't closed that time if the interface isn't brought
up. So the unexpected recursive error is seen during EEH recovery
when the interface is down.

This avoids the unexpected recursive EEH error by closing the timer
in qlge_io_error_detected() before EEH PE reset unconditionally. The
timer is started unconditionally after EEH PE reset in qlge_io_resume().
Also, the timer should be closed unconditionally when the device is
removed from the system permanently in qlge_io_error_detected().

Reported-by: Shriya R. Kulkarni <shriyakul@in.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit 3275c0c6c522ab04afa14f80efdac6213c3883d6)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoqlge: Replace create_singlethread_workqueue with alloc_ordered_workqueue
Amitoj Kaur Chawla [Sat, 9 Apr 2016 11:57:45 +0000 (17:27 +0530)]
qlge: Replace create_singlethread_workqueue with alloc_ordered_workqueue

Replace deprecated create_singlethread_workqueue with
alloc_ordered_workqueue.

Work items include getting tx/rx frame sizes, resetting MPI processor,
setting asic recovery bit so ordering seems necessary as only one work
item should be in queue/executing at any given time, hence the use of
alloc_ordered_workqueue.

WQ_MEM_RECLAIM flag has been set since ethernet devices seem to sit in
memory reclaim path, so to guarantee forward progress regardless of
memory pressure.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit ac18dd9e842294377dbaf1e8d169493567a81fa1)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoqlge: Update version to 1.00.00.35
Manish Chopra [Fri, 25 Mar 2016 11:14:09 +0000 (07:14 -0400)]
qlge: Update version to 1.00.00.35

Just updating version as many fixes got
accumulated over 1.00.00.34

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit d31fecd1af991e39cbe27a59f290cdcefb7ba6ae)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoqlge: Fix receive packets drop.
Manish Chopra [Tue, 15 Mar 2016 11:13:45 +0000 (07:13 -0400)]
qlge: Fix receive packets drop.

When running small packets [length < 256 bytes] traffic, packets were
being dropped due to invalid data in those packets which were
delivered by the driver upto the stack. Using pci_dma_sync_single_for_cpu
ensures copying latest and updated data into skb from the receive buffer.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit 2c9a266afefe137bff06bbe0fc48b4d3b3cb348c)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoqlge: fix a timeout loop in ql_change_rx_buffers()
Dan Carpenter [Tue, 15 Dec 2015 10:52:36 +0000 (13:52 +0300)]
qlge: fix a timeout loop in ql_change_rx_buffers()

The problem here is that after the loop we test for "if (!i) " but
because "i--" is a post-op we exit with i set to -1.  I have fixed this
by changing it to a pre-op instead.  I had to change the starting value
from 3 to 4 so that we still iterate 3 times.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit 351434c6ba92e1fe7799a0c33c1412584a0fb3de)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoqlge: Move jiffies_to_usecs immediately before loop
Joe Perches [Wed, 20 May 2015 04:44:52 +0000 (21:44 -0700)]
qlge: Move jiffies_to_usecs immediately before loop

30 usecs (or really, 1 jiffy) can go by pretty fast.

Move the set of the timeout immediately before the loop.

Remove the unnecessary max(1ul, usecs_to_jiffies(30)) as
usecs_to_jiffies with a non-zero constant is guaranteed
to be non-zero.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605959
(cherry picked from commit 3f6e785fe113febd037af6351fc375eb428ff65b)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agonetxen: netxen_rom_fast_read() doesn't return -1
Dan Carpenter [Thu, 5 May 2016 13:20:20 +0000 (16:20 +0300)]
netxen: netxen_rom_fast_read() doesn't return -1

The error handling is broken here.  netxen_rom_fast_read() returns zero
on success and -EIO on error.  It never returns -1.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605954
(cherry picked from commit 8c1f454625743d60763a23c58fa65681d3c98b6f)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agonetxen: reversed condition in netxen_nic_set_link_parameters()
Dan Carpenter [Thu, 5 May 2016 13:19:44 +0000 (16:19 +0300)]
netxen: reversed condition in netxen_nic_set_link_parameters()

My static checker complains that we are using "autoneg" without
initializing it.  The problem is the ->phy_read() condition is reversed
so we only set this on error instead of success.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605954
(cherry picked from commit 1c755ffa4fa3e2d4112cadd30142344789ad2fd2)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agonetxen: fix error handling in netxen_get_flash_block()
Dan Carpenter [Thu, 5 May 2016 13:18:46 +0000 (16:18 +0300)]
netxen: fix error handling in netxen_get_flash_block()

My static checker complained that "v" can be used unintialized if
netxen_rom_fast_read() returns -EIO.  That function never actually
returns -1.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605954
(cherry picked from commit 545fea54916af5e88f02346d85301ba0ecc143f3)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agonetxen: Use kobj_to_dev()
Amitoj Kaur Chawla [Wed, 24 Feb 2016 14:39:38 +0000 (20:09 +0530)]
netxen: Use kobj_to_dev()

Introduce the use of kobj_to_dev() helper function instead of open
coding it with container_of()

The Coccinelle semantic patch used to make this change is as follows:

//<smpl>
@@
expression a;
symbol kobj;
@@
- container_of(a, struct device, kobj)
+ kobj_to_dev(a)
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 25605954
(cherry picked from commit 016c0bbae1d17d4509b74227dca618e01263e61a)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agohpsa: update reset handler
Don Brace [Sat, 25 Feb 2017 00:08:04 +0000 (16:08 -0800)]
hpsa: update reset handler

Use the return from TUR as a check for the
device state.

Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agohpsa: update identify physical device structure
Don Brace [Sat, 25 Feb 2017 00:08:04 +0000 (16:08 -0800)]
hpsa: update identify physical device structure

Align more closely with controller.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agohpsa: add in a new check for volume status
Don Brace [Sat, 25 Feb 2017 00:08:04 +0000 (16:08 -0800)]
hpsa: add in a new check for volume status

- Add in a new case for volume offline. Resolves internal
   testing bug for multilun array management.
 - was not returning correct value for failed TURs.

Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agohpsa: send ioaccel requests with 0 length trasfer down raid path
Don Brace [Sat, 25 Feb 2017 00:08:03 +0000 (16:08 -0800)]
hpsa: send ioaccel requests with 0 length trasfer down raid path

Block I/O requests with 0 length transfers which go down the ioaccel path.
This causes lockup issues down in the basecode. These issues have been
fixed, but there are customers who are experiencing the issues.

Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agohpsa: remove abort handler
Don Brace [Sat, 25 Feb 2017 00:08:03 +0000 (16:08 -0800)]
hpsa: remove abort handler

There are a lot of racy conditions not handled, turn off
the abort handler for now and re-add it when all
cases are covered.

Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agohpsa: prevent concurrent rescans
Don Brace [Sat, 25 Feb 2017 00:08:03 +0000 (16:08 -0800)]
hpsa: prevent concurrent rescans

Prevent driver initiated and externally initiated
rescans from occurring simultaneously.

Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agohpsa: correct scan wakeup
Don Brace [Sat, 25 Feb 2017 00:03:05 +0000 (16:03 -0800)]
hpsa: correct scan wakeup

Prevent multiple instances of hpsa_update_scsi_devices

Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agohpsa: correct queue depth for externals
Don Brace [Sat, 25 Feb 2017 00:03:04 +0000 (16:03 -0800)]
hpsa: correct queue depth for externals

queue depth setting not in correct place, had no effect.

Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agohpsa: bump driver version
Don Brace [Sat, 25 Feb 2017 00:03:04 +0000 (16:03 -0800)]
hpsa: bump driver version

Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: remove coalescing settings for ioaccel2
Don Brace [Mon, 30 Jan 2017 22:05:17 +0000 (16:05 -0600)]
scsi: hpsa: remove coalescing settings for ioaccel2

- Setting coalescing has a significant negative impact on low
  queue-depth performance.
- Does not help high queue-depth performance.

Signed-off-by: Don Brace <don.brace@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 96b6ce4e8b66b009396799843d6191fefcc36c33)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: use designated initializers
Kees Cook [Sat, 17 Dec 2016 01:04:49 +0000 (17:04 -0800)]
scsi: hpsa: use designated initializers

Prepare to mark sensitive kernel structures for randomization by making
sure they're using designated initializers. These were identified during
allyesconfig builds of x86, arm, and arm64, with most initializer fixes
extracted from grsecurity.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 93380123fbb5357d3ea6935efc9226df3c59099d)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: remove memory allocate failure message
Amit Kushwaha [Mon, 12 Dec 2016 11:04:21 +0000 (16:34 +0530)]
scsi: hpsa: remove memory allocate failure message

This patch cleanup warning reported by checkpatch.pl WARNING: Possible
unnecessary 'out of memory' message With no available memory, a warn on
message already gets printed by page alloc apis and modified goto use if
memory unallocated.

Signed-off-by: Amit Kushwaha <kushwaha.a@samsung.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 7e8a9486786d5ede1d2405fab140c6a0d8b2c1fe)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: fallback to use legacy REPORT PHYS command
Hannes Reinecke [Fri, 2 Dec 2016 10:36:13 +0000 (11:36 +0100)]
scsi: hpsa: fallback to use legacy REPORT PHYS command

Older SmartArray controllers (eg SmartArray 64xx) do not support the
extended REPORT PHYS command, so fallback to use the legacy version
here.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 2a80d5458a027f6d514987c09f0b51f45c3a5be4)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: use %phN for short hex dumps
Rasmus Villemoes [Wed, 30 Nov 2016 22:35:47 +0000 (23:35 +0100)]
scsi: hpsa: use %phN for short hex dumps

Passing one instead of 8 or 16 arguments reduces the size of the
generated code somewhat:

add/remove: 2/3 grow/shrink: 1/4 up/down: 1772/-2137 (-365)

There's one more candidate, unique_id_show, but that uses %02X, and I'm
not sure it would be ok to start using lowercase there, so I've left it
alone for now.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 609a70df07af1ff857257fb2e93c3ef281e30710)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: add 'ctlr_num' sysfs attribute
Hannes Reinecke [Fri, 18 Nov 2016 07:32:49 +0000 (08:32 +0100)]
scsi: hpsa: add 'ctlr_num' sysfs attribute

Add a sysfs attribute 'ctlr_num' holding the current HPSA controller
number. This is required to construct compability 'cciss' links.

[mkp: fixed typo]

Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 16961204a0ebcb87b89ed3be14b0a484c754d7e4)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: use correct DID_NO_CONNECT hostbyte
Hannes Reinecke [Fri, 18 Nov 2016 07:32:47 +0000 (08:32 +0100)]
scsi: hpsa: use correct DID_NO_CONNECT hostbyte

NOT_READY is a sense key, not a legit scsi hostbyte value. Use
DID_NO_CONNECT instead.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 1ccde7004ff66cdcbe4c8005f3bb44dda6ab0b99)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: use bus '3' for legacy HBA devices
Hannes Reinecke [Thu, 17 Nov 2016 11:15:56 +0000 (12:15 +0100)]
scsi: hpsa: use bus '3' for legacy HBA devices

Older controllers use SCSI target id '0' for the first internal disk. As
the controllers are now placed on the same bus as the internal disks
this leads to a clash with the SCSI target id of controller.  This patch
checks the SCSI revision, and moves older controller to bus '3' to be
compatible with older releases and avoid this problem.

[mkp: fixed uninitialized variable]

Fixes: 09371d623c9 ("hpsa: Change SAS transport devices to bus 0.")
Cc: <stable@vger.kernel.org> # v4.5+
Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 7630b3a599e2c6d1c042945d32ff2debc855ad29)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: correct logical resets
Don Brace [Tue, 15 Nov 2016 20:45:32 +0000 (14:45 -0600)]
scsi: hpsa: correct logical resets

- driver was not calling done in some cases which causes the volume to
  be offlined.
- avoid doing rescan during a reset.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-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>
Orabug: 25605941
(cherry picked from commit bfd7546cd19abf0f8a08c1339a917fe326fcfc71)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: Remove unneeded void pointer cast
Javier Martinez Canillas [Thu, 13 Oct 2016 16:10:08 +0000 (13:10 -0300)]
scsi: hpsa: Remove unneeded void pointer cast

It's not necessary to cast the result of kmalloc, since void pointers
are promoted to any other type. This also fixes following coccinelle
warning:

casting value returned by memory allocation function to (BIG_IOCTL_Command_struct *) is useless.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit 19be606be1df35479333bd04e2cdaddc9d77e38c)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: correct call to hpsa_do_reset
Don Brace [Tue, 20 Sep 2016 20:42:30 +0000 (15:42 -0500)]
scsi: hpsa: correct call to hpsa_do_reset

calling fill_cmd() using a MACRO definition not handled in switch
statement causes BUG() to be called.

Signed-off-by: Don Brace <don.brace@microsemi.com>
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit b32ece0ff70c30e59f16e9a8ffd05acc27298ba3)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: correct scsi 6byte lba calculation
Mahesh Rajashekhara [Fri, 16 Sep 2016 19:54:23 +0000 (14:54 -0500)]
scsi: hpsa: correct scsi 6byte lba calculation

Missing 5 bits of byte 1 in the LBA issued by SML.

Reported-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com>
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit abbada7175999fbd6500b8144e985b779588962f)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: Check for null devices in ioaccel submission patch
Don Brace [Fri, 9 Sep 2016 21:30:42 +0000 (16:30 -0500)]
scsi: hpsa: Check for null devices in ioaccel submission patch

Reviewed-by: Scott Benesh <scott.benest@microsemi.com>
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-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>
Orabug: 25605941
(cherry picked from commit 45e596cd6ead1c4ada74b03067595d7f4502fa6a)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: Prevent sending bmic commands to externals
Scott Teel [Fri, 9 Sep 2016 21:30:36 +0000 (16:30 -0500)]
scsi: hpsa: Prevent sending bmic commands to externals

Reviewed-by: Scott Benesh <scott.benest@microsemi.com>
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-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>
Orabug: 25605941
(cherry picked from commit 4b6e5597f4c9ae545a1bd18e830d9f6b4465cadd)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: Check for vpd support before sending
Scott Teel [Fri, 9 Sep 2016 21:30:29 +0000 (16:30 -0500)]
scsi: hpsa: Check for vpd support before sending

Before using vendor-specific VPD pages for getting raid_level and
device_id, check for page support.  If page isn't supported, don't try
to use it.  Also, pay attention to return status on hpsa_get_device_id.

[mkp: fix boolean return warnings reported by kbuild test robot]

Reviewed-by: Scott Benesh <scott.benest@microsemi.com>
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-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>
Orabug: 25605941
(cherry picked from commit 8383278d28b9bc598225f163b6644b8b09f2733d)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: Check for null device pointers
Don Brace [Fri, 9 Sep 2016 21:30:23 +0000 (16:30 -0500)]
scsi: hpsa: Check for null device pointers

A device can be deleted causing NULL pointer issues.

Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-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>
Orabug: 25605941
(cherry picked from commit d49c2077c03d70a59e3063c7d33f00172491ae31)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoscsi: hpsa: Determine device external status earlier
Don Brace [Fri, 9 Sep 2016 21:30:17 +0000 (16:30 -0500)]
scsi: hpsa: Determine device external status earlier

Currently we are checking for external status before we are determining
if a device is an external device.

Reviewed-by: Scott Benesh <scott.benest@microsemi.com>
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-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>
Orabug: 25605941
(cherry picked from commit 86cf7130a58bd2cdd09da72cdadae0dcd5f5db19)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agohpsa: change hpsa_passthru_ioctl timeout
Don Brace [Fri, 1 Jul 2016 18:37:38 +0000 (13:37 -0500)]
hpsa: change hpsa_passthru_ioctl timeout

Was not alloting for FW Flash times.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-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>
Orabug: 25605941
(cherry picked from commit 3fb134cb4c170debf2b786d689fe263186feea4b)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agohpsa: correct skipping masked peripherals
Don Brace [Fri, 1 Jul 2016 18:37:31 +0000 (13:37 -0500)]
hpsa: correct skipping masked peripherals

The SA controller spins down RAID drive spares.

A REGNEWD event causes an inquiry to be sent to all physical
drives. This causes the SA controller to spin up the spare.

The controller suspends all I/O to a logical volume until
the spare is spun up. The spin-up can take over 50 seconds.

This can result in one or both of the following:
 - SML sends down aborts and resets to the logical volume
   and can cause the logical volume to be off-lined.
 - a negative impact on the logical volume's I/O performance
   each time a REGNEWD is triggered.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-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>
Orabug: 25605941
(cherry picked from commit 64ce60cab24603ac0fcd59c9fbc3be78f4c4d229)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agohpsa: set the enclosure identifier to zero
Dan Carpenter [Thu, 14 Apr 2016 09:37:44 +0000 (12:37 +0300)]
hpsa: set the enclosure identifier to zero

This has only called from show_sas_rphy_enclosure_identifier().  The
caller expects that we set an identifier, otherwise it uses an
uninitialized variable.

[mkp: fixed typo]

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 25605941
(cherry picked from commit aa105695732daa6604cb017ceb59a05ef34956bd)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
8 years agoenic: Remove local ndo_busy_poll() implementation.
David S. Miller [Fri, 3 Feb 2017 22:28:21 +0000 (17:28 -0500)]
enic: Remove local ndo_busy_poll() implementation.

Orabug: 25535122

We do polling generically these days.

Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7a655c6324a8968ea2f027bf3660c87c42ac3de4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoenic: set skb->hash type properly
Govindarajulu Varadarajan [Wed, 2 Nov 2016 00:58:50 +0000 (17:58 -0700)]
enic: set skb->hash type properly

Orabug: 25535122

Driver sets the skb l4/l3 hash based on NIC_CFG_RSS_HASH_TYPE_*,
which is bit mask. This is wrong. Hw actually provides us enum.
Use CQ_ENET_RQ_DESC_RSS_TYPE_* to set l3 and l4 hash type.

Fixes: bf751ba802fe ("driver/net: enic: record q_number and rss_hash for skb")
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 17197236d62c44da127be461c63ac5cc2cce1e53)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/cisco/enic/enic.h

8 years agoenic: fix rq disable
Govindarajulu Varadarajan [Thu, 27 Oct 2016 23:01:03 +0000 (16:01 -0700)]
enic: fix rq disable

Orabug: 25535122

When MTU is changed from 9000 to 1500 while there is burst of inbound 9000
bytes packets, adaptor sometimes delivers 9000 bytes packets to 1500 bytes
buffers. This causes memory corruption and sometimes crash.

This is because of a race condition in adaptor between "RQ disable"
clearing descriptor mini-cache and mini-cache valid bit being set by
completion of descriptor fetch. This can result in stale RQ desc being
cached and used when packets arrive. In this case, the stale descriptor
have old MTU value.

Solution is to write RQ->disable twice. The first write will stop any
further desc fetches, allowing the second disable to clear the mini-cache
valid bit without danger of a race.

Also, the check for rq->running becoming 0 after writing rq->enable to 0
is not done properly. When incoming packets are flooding the interface,
rq->running will pulse high for each dropped packet. Since the driver was
waiting for 10us between each poll, it is possible to see rq->running = 1
1000 times in a row, even though it is not actually stuck running.
This results in false failure of vnic_rq_disable(). Fix is to try more
than 1000 time without delay between polls to ensure we do not miss when
running goes low.

In old adaptors rq->enable needs to be re-written to 0 when posted_index
is reset in vnic_rq_clean() in order to keep rq->prefetch_index in sync.

Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9fe1c98ac90023842ae7cd921badfa1029e45bd1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet: enic: use correct type specifier
xypron.glpk@gmx.de [Sun, 31 Jul 2016 09:10:08 +0000 (11:10 +0200)]
net: enic: use correct type specifier

Orabug: 25535122

i is defined as unsigned.
So print it with %u.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8d546f58ec441d1377457b2134fb27ba2455d9f8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoenic: set netdev->vlan_features
Govindarajulu Varadarajan [Fri, 15 Apr 2016 19:10:43 +0000 (00:40 +0530)]
enic: set netdev->vlan_features

Orabug: 25535122

Driver sets vlan_feature to netdev->features as hardware supports all of
them on vlan interface.

Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e7600449bef0650ee7818be6de26955e81579d13)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agocisco: enic: Update logging macros and uses
Joe Perches [Tue, 8 Mar 2016 21:54:56 +0000 (13:54 -0800)]
cisco: enic: Update logging macros and uses

Orabug: 25535122

Don't hide varibles used by the logging macros.

Miscellanea:

o Use the more common ##__VA_ARGS__ extension
o Add missing newlines to formats
o Realign arguments

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e327f4e193b6a176f4dc3b19faf6371a8917588d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoenic: assign affinity hint to interrupts
Govindarajulu Varadarajan [Fri, 30 Oct 2015 11:22:51 +0000 (16:52 +0530)]
enic: assign affinity hint to interrupts

Orabug: 25535122

The affinity hint is used by the user space daemon, irqbalancer, to
indicate a preferred CPU mask for irqs. This patch sets the irq affinity
hint to local numa core first, when exausted we try non-local numa cores.

Also set tx xps cpus mask bassed on affinity hint.

v2: remove the global affinity policy.

Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 322cf7e3a4e89236ae386cb5668ae0d787d21136)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet/ena: update driver version to 1.1.2
Netanel Belgazal [Thu, 9 Feb 2017 13:21:39 +0000 (15:21 +0200)]
net/ena: update driver version to 1.1.2

Orabug: 25535122

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3e5d6897176d38b54124da56183810abbd68c8bc)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet/ena: change condition for host attribute configuration
Netanel Belgazal [Thu, 9 Feb 2017 13:21:38 +0000 (15:21 +0200)]
net/ena: change condition for host attribute configuration

Orabug: 25535122

Move the host info config to be the first admin command that is executed.
This change require the driver to remove the 'feature check'
from host info configuration flow.
The check is removed since the supported features bitmask field
is retrieved only after calling ENA_ADMIN_DEVICE_ATTRIBUTES admin command.

If set host info is not supported an error will be returned by the device.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit dd8427a78ffccbacf166a2d5d5eae55b586e1afe)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet/ena: change driver's default timeouts
Netanel Belgazal [Thu, 9 Feb 2017 13:21:37 +0000 (15:21 +0200)]
net/ena: change driver's default timeouts

Orabug: 25535122

The timeouts were too agressive and sometimes cause false alarms.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7102a18ac3f323805e3cd8f3dc64907644608c1e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet/ena: reduce the severity of ena printouts
Netanel Belgazal [Thu, 9 Feb 2017 13:21:36 +0000 (15:21 +0200)]
net/ena: reduce the severity of ena printouts

Orabug: 25535122

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5add6e4a222f2eb437992af6b39c8a9c9a28604a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet/ena: use READ_ONCE to access completion descriptors
Netanel Belgazal [Thu, 9 Feb 2017 13:21:35 +0000 (15:21 +0200)]
net/ena: use READ_ONCE to access completion descriptors

Orabug: 25535122

Completion descriptors are accessed from the driver and from the device.
To avoid reading the old value, use READ_ONCE macro.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a8496eb81342393e4c8280a5ec27e1872a3fb9fd)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet/ena: fix potential access to freed memory during device reset
Netanel Belgazal [Thu, 9 Feb 2017 13:21:33 +0000 (15:21 +0200)]
net/ena: fix potential access to freed memory during device reset

Orabug: 25535122

If the ena driver detects that the device is not behave as expected,
it tries to reset the device.
The reset flow calls ena_down, which will frees all the resources
the driver allocates and then it will reset the device.

This flow can cause memory corruption if the device is still writes
to the driver's memory space.
To overcome this potential race, move the reset before the device
resources are freed.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3f6159dbfc24c5e61fb5deb9b69e0abb934609bb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet/ena: refactor ena_get_stats64 to be atomic context safe
Netanel Belgazal [Thu, 9 Feb 2017 13:21:32 +0000 (15:21 +0200)]
net/ena: refactor ena_get_stats64 to be atomic context safe

Orabug: 25535122

ndo_get_stat64() can be called from atomic context, but the current
implementation sends an admin command to retrieve the statistics from
the device. This admin command can sleep.

This patch re-factors the implementation of ena_get_stats64() to use
the {rx,tx}bytes/count from the driver's inner counters, and to obtain
the rx drop counter from the asynchronous keep alive (heart bit)
event.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d81db24056132fe8b83e2fba337e9ea76675e68d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/amazon/ena/ena_netdev.c

8 years agonet/ena: fix NULL dereference when removing the driver after device reset failed
Netanel Belgazal [Thu, 9 Feb 2017 13:21:31 +0000 (15:21 +0200)]
net/ena: fix NULL dereference when removing the driver after device reset failed

Orabug: 25535122

If for some reason the device stops responding, and the device reset
failes to recover the device, the mmio register read data structure
will not be reinitialized.

On driver removal, the driver will also try to reset the device, but
this time the mmio data structure will be NULL.

To solve this issue, perform the device reset in the remove function
only if the device is runnig.

Crash log
   54.240382] BUG: unable to handle kernel NULL pointer dereference at           (null)
[   54.244186] IP: [<ffffffffc067de5a>] ena_com_reg_bar_read32+0x8a/0x180 [ena_drv]
[   54.244186] PGD 0
[   54.244186] Oops: 0002 [#1] SMP
[   54.244186] Modules linked in: ena_drv(OE-) snd_hda_codec_generic kvm_intel kvm crct10dif_pclmul ppdev crc32_pclmul ghash_clmulni_intel aesni_intel snd_hda_intel aes_x86_64 snd_hda_controller lrw gf128mul cirrus glue_helper ablk_helper ttm snd_hda_codec drm_kms_helper cryptd snd_hwdep drm snd_pcm pvpanic snd_timer syscopyarea sysfillrect snd parport_pc sysimgblt serio_raw soundcore i2c_piix4 mac_hid lp parport psmouse floppy
[   54.244186] CPU: 5 PID: 1841 Comm: rmmod Tainted: G           OE 3.16.0-031600-generic #201408031935
[   54.244186] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
[   54.244186] task: ffff880135852880 ti: ffff8800bb640000 task.ti: ffff8800bb640000
[   54.244186] RIP: 0010:[<ffffffffc067de5a>]  [<ffffffffc067de5a>] ena_com_reg_bar_read32+0x8a/0x180 [ena_drv]
[   54.244186] RSP: 0018:ffff8800bb643d50  EFLAGS: 00010083
[   54.244186] RAX: 000000000000deb0 RBX: 0000000000030d40 RCX: 0000000000000003
[   54.244186] RDX: 0000000000000202 RSI: 0000000000000058 RDI: ffffc90000775104
[   54.244186] RBP: ffff8800bb643d88 R08: 0000000000000000 R09: cf00000000000000
[   54.244186] R10: 0000000fffffffe0 R11: 0000000000000001 R12: 0000000000000000
[   54.244186] R13: ffffc90000765000 R14: ffffc90000775104 R15: 00007fca1fa98090
[   54.244186] FS:  00007fca1f1bd740(0000) GS:ffff88013fd40000(0000) knlGS:0000000000000000
[   54.244186] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   54.244186] CR2: 0000000000000000 CR3: 00000000b9cf6000 CR4: 00000000001406e0
[   54.244186] Stack:
[   54.244186]  0000000000000202 0000005800000286 ffffc90000765000 ffffc90000765000
[   54.244186]  ffff880135f6b000 ffff8800b9360000 00007fca1fa98090 ffff8800bb643db8
[   54.244186]  ffffffffc0680b3d ffff8800b93608c0 ffffc90000765000 ffff880135f6b000
[   54.244186] Call Trace:
[   54.244186]  [<ffffffffc0680b3d>] ena_com_dev_reset+0x1d/0x1b0 [ena_drv]
[   54.244186]  [<ffffffffc0678497>] ena_remove+0xa7/0x130 [ena_drv]
[   54.244186]  [<ffffffff813d4df6>] pci_device_remove+0x46/0xc0
[   54.244186]  [<ffffffff814c3b7f>] __device_release_driver+0x7f/0xf0
[   54.244186]  [<ffffffff814c4738>] driver_detach+0xc8/0xd0
[   54.244186]  [<ffffffff814c3969>] bus_remove_driver+0x59/0xd0
[   54.244186]  [<ffffffff814c4fde>] driver_unregister+0x2e/0x60
[   54.244186]  [<ffffffff810f0a80>] ? show_refcnt+0x40/0x40
[   54.244186]  [<ffffffff813d4ec3>] pci_unregister_driver+0x23/0xa0
[   54.244186]  [<ffffffffc068413f>] ena_cleanup+0x10/0xed1 [ena_drv]
[   54.244186]  [<ffffffff810f3a47>] SyS_delete_module+0x157/0x1e0
[   54.244186]  [<ffffffff81014fb7>] ? do_notify_resume+0xc7/0xd0
[   54.244186]  [<ffffffff81793fad>] system_call_fastpath+0x1a/0x1f
[   54.244186] Code: c3 4d 8d b5 04 01 01 00 4c 89 f7 e8 e1 5a 11 c1 48 89 45 c8 41 0f b7 85 00 01 01 00 8d 48 01 66 2d 52 21 66 41 89 8d 00 01 01 00 <66> 41 89 04 24 0f b7 45 d4 89 45 d0 89 c1 41 0f b7 85 00 01 01
[   54.244186] RIP  [<ffffffffc067de5a>] ena_com_reg_bar_read32+0x8a/0x180 [ena_drv]
[   54.244186]  RSP <ffff8800bb643d50>
[   54.244186] CR2: 0000000000000000
[   54.244186] ---[ end trace 18dd9889b6497810 ]---

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 22b331c9e0a345126708af60f7d00d38b53db70b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet/ena: fix RSS default hash configuration
Netanel Belgazal [Thu, 9 Feb 2017 13:21:30 +0000 (15:21 +0200)]
net/ena: fix RSS default hash configuration

Orabug: 25535122

ENA default hash configures IPv4_frag hash twice instead of
configure non-IP packets.

The bug caused IPv4 fragmented packets to be calculated based on
L2 source and destination address instead of L3 source and destination.
IPv4 packets can reach to the wrong Rx queue.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 422e21e7619bb8751aa1cd32a9b671b1baaf3d18)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet/ena: fix ethtool RSS flow configuration
Netanel Belgazal [Thu, 9 Feb 2017 13:21:29 +0000 (15:21 +0200)]
net/ena: fix ethtool RSS flow configuration

Orabug: 25535122

ena_flow_data_to_flow_hash and ena_flow_hash_to_flow_type
treat the ena_flow_hash_to_flow_type enum as power of two values.

Change the values of ena_admin_flow_hash_fields to be power of two values.

This bug effect the ethtool set/get rxnfc.
ethtool will report wrong values hash fields for get and will
configure wrong hash fields in set.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6e2de20ddc4b606a9b6b170a6bb21ee4dc4ad93a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet/ena: fix queues number calculation
Netanel Belgazal [Thu, 9 Feb 2017 13:21:28 +0000 (15:21 +0200)]
net/ena: fix queues number calculation

Orabug: 25535122

The ENA driver tries to open a queue per vCPU.
To determine how many vCPUs the instance have it uses num_possible_cpus()
while it should have use num_online_cpus() instead.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6a1ce2fb67161f249b372a87d1d9899d8b087c8e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet/ena: remove ntuple filter support from device feature list
Netanel Belgazal [Thu, 9 Feb 2017 13:21:27 +0000 (15:21 +0200)]
net/ena: remove ntuple filter support from device feature list

Orabug: 25535122

Remove NETIF_F_NTUPLE from netdev->features.
The ENA device driver does not support ntuple filtering.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit fdeea0ad87fd05e5fcb5e7b6643eabc34f29405a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agonet: ena: use setup_timer() and mod_timer()
Wei Yongjun [Sat, 22 Oct 2016 14:36:36 +0000 (14:36 +0000)]
net: ena: use setup_timer() and mod_timer()

Orabug: 25535122

Use setup_timer() instead of init_timer(), being the preferred/standard
way to set a timer up.

Also, quoting the mod_timer() function comment:
-> mod_timer() is a more efficient way to update the expire field of an
   active timer (if the timer is inactive it will be activated).

Use setup_timer and mod_timer to setup and arm a timer, to make the code
cleaner and easier to read.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f850b4a77d71a9cac513dadff91891a78c12ba05)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed*: Fix link indication race
Mintz, Yuval [Mon, 20 Feb 2017 20:43:39 +0000 (22:43 +0200)]
qed*: Fix link indication race

Orabug: 25477939

Driver changes the link properties via communication with
the management firmware, and re-reads the resulting link status
when it receives an indication that the link has changed.
However, there are certain scenarios where such indications
might be missing, and so driver also re-reads the current link
results without attention in several places. Specifically, it
does so during load and when resetting the link.

This creates a race where driver might reflect incorrect
link status - e.g., when explicit reading of the link status is
switched by attention with the changed configuration.

Correct this flow by a lock syncronizing the handling of the
link indications [both explicit requests and attention].

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 65ed2ffd640578166e4ec149573bcf1d10f81b81)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/qed/qed_sriov.h

8 years agoqed: Don't allocate SBs using main PTT
Mintz, Yuval [Mon, 20 Feb 2017 20:43:38 +0000 (22:43 +0200)]
qed: Don't allocate SBs using main PTT

Orabug: 25477939

Flows accessing registers require the flow to hold a PTT entry.
To protect 'major' load/unload flows a main_ptt is pre-allocated
to guarantee such flows wouldn't be blocked by PTT being
unavailable.

Status block initialization currently uses the main_ptt which
is incorrect, as this flow might run concurrently to others
[E.g., loading qedr while toggling qede]. That would have dire
effects as it means registers' access to device breaks and further
read/writes might access incorrect addresses.

Instead, when initializing status blocks acquire/release a PTT
as part of the flow.

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 85750d74fba5a7c31309c038c5f9f019edc6ea31)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqede: Prevent index problems in loopback test
Sudarsana Reddy Kalluru [Mon, 20 Feb 2017 20:43:37 +0000 (22:43 +0200)]
qede: Prevent index problems in loopback test

Orabug: 25477939

Driver currently utilizes the same loop variable in two
nested loops.

Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit afe981d664aeeebc8d1bcbd7d2070b5432edaecb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed: Reflect PF link when initializing VF
Mintz, Yuval [Mon, 20 Feb 2017 20:43:36 +0000 (22:43 +0200)]
qed: Reflect PF link when initializing VF

Orabug: 25477939

VF learns of the current link state via its bulletin board,
which might reflect either the physical link state or some
user-configured logical state.
Whenever the physical link changes or whnever such a configuration
is explicitly made by user the PF driver would update the bulletin
that the VF reads. But if neither has happened - i.e., PF still
hasn't got a physical link up and no additional configuration was
done the VF wouldn't have a valid link information available.

Simply reflect the physical link state whenever the VF is
initialized. The user could then affect it however he wants.

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 33b2fbd0a8d3c556b802d8753ac5bb3e8f90e988)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqede: Free netdevice only after stoping slowpath
Mintz, Yuval [Mon, 20 Feb 2017 20:43:35 +0000 (22:43 +0200)]
qede: Free netdevice only after stoping slowpath

Orabug: 25477939

qed needs to be informed of the removal of the qede interface
prior to its actual removal, as qede has some registered callbacks
that might get called async to the removal flow.

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 885185dfc49bde35b45046bb6b7384eca68e404f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/qede/qede_main.c

8 years agoqede: Initialize lock and slowpath workqueue early
Mintz, Yuval [Mon, 20 Feb 2017 20:43:34 +0000 (22:43 +0200)]
qede: Initialize lock and slowpath workqueue early

Orabug: 25477939

Need to make sure the slowpath workqueue and the qede lock
are ready for the registration of the netdevice, as once
registered there's no guarantee those wouldn't be used.

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0e0b80a9a7181cbdbb965a6b4750574932106e31)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed: Reserve doorbell BAR space for present CPUs
Ram Amrani [Mon, 20 Feb 2017 20:43:33 +0000 (22:43 +0200)]
qed: Reserve doorbell BAR space for present CPUs

Orabug: 25477939

Reserving doorbell BAR space according to the currently active CPUs
may result in a bug if disabled CPUs are later enabled but no
doorbell space was reserved for them.

Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c2dedf8773e873474535bd4a158609b9eda5403d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed: Don't free a QP more than once
Ram Amrani [Mon, 20 Feb 2017 20:43:32 +0000 (22:43 +0200)]
qed: Don't free a QP more than once

Orabug: 25477939

If QP is in reset state then there are no resources to free so avoid
freeing any.

Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 300c0d7c232da572cb640f3bc803554f74e08f69)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed: Read queue state before releasing buffer
Ram Amrani [Mon, 20 Feb 2017 20:43:31 +0000 (22:43 +0200)]
qed: Read queue state before releasing buffer

Orabug: 25477939

Currently the state is read only after the buffers are relesed.

Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c5212b943d4b52a7d9e0d9f747e7ad59c50d31f1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed: Release CQ resource under lock on failure
Ram Amrani [Mon, 20 Feb 2017 20:43:30 +0000 (22:43 +0200)]
qed: Release CQ resource under lock on failure

Orabug: 25477939

The CQ resource pool is protected by a spin lock. When a CQ creation
fails it now deallocates under that lock as well.

Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 670dde55c6f182b8a159f0484be92b89d82107e1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed: Add support for hardware offloaded FCoE.
Arun Easi [Wed, 15 Feb 2017 14:28:22 +0000 (06:28 -0800)]
qed: Add support for hardware offloaded FCoE.

Orabug: 25477939

This adds the backbone required for the various HW initalizations
which are necessary for the FCoE driver (qedf) for QLogic FastLinQ
4xxxx line of adapters - FW notification, resource initializations, etc.

Signed-off-by: Arun Easi <arun.easi@cavium.com>
Signed-off-by: Yuval Mintz <yuval.mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1e128c81290a419ab9ec8b09fe989f1c6c15a0f4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed: Add infrastructure for PTP support
Sudarsana Reddy Kalluru [Wed, 15 Feb 2017 08:24:10 +0000 (10:24 +0200)]
qed: Add infrastructure for PTP support

Orabug: 25477939

The patch adds the required qed interfaces for configuring/reading
the PTP clock on the adapter.

Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c78c70fa30e23dc6cdb394f6c13880919499fba5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed: avoid possible stack overflow in qed_ll2_acquire_connection
Arnd Bergmann [Wed, 18 Jan 2017 14:52:52 +0000 (15:52 +0100)]
qed: avoid possible stack overflow in qed_ll2_acquire_connection

Orabug: 25477939

struct qed_ll2_info is rather large, so putting it on the stack
can cause an overflow, as this warning tries to tell us:

drivers/net/ethernet/qlogic/qed/qed_ll2.c: In function 'qed_ll2_start':
drivers/net/ethernet/qlogic/qed/qed_ll2.c:2159:1: error: the frame size of 1056 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

qed_ll2_start_ooo() already uses a dynamic allocation for the structure
to work around that problem, and we could do the same in qed_ll2_start()
as well as qed_roce_ll2_start(), but since the structure is only
used to pass a couple of initialization values here, it seems nicer
to replace it with a different structure.

Lacking any idea for better naming, I'm adding 'struct qed_ll2_conn',
which now contains all the initialization data, and this now simply
gets copied into struct qed_ll2_info rather than assigning all members
one by one.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0629a330cf55454962168dd3ee46fad53a39323e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed: Replace memset with eth_zero_addr
Shyam Saini [Tue, 17 Jan 2017 02:05:04 +0000 (07:35 +0530)]
qed: Replace memset with eth_zero_addr

Orabug: 25477939

Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Also, it makes the code clearer

Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0ee28e31553a6f2ed13223e565ae5a4d7a376942)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/qed/qed_sriov.c

8 years agoqed*: Advance driver versions to 8.10.10.20.
Mintz, Yuval [Sun, 1 Jan 2017 11:57:11 +0000 (13:57 +0200)]
qed*: Advance driver versions to 8.10.10.20.

Orabug: 25477939

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ce742922acdc4219509bf5b57e0a073990abfa28)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed: Conserve RDMA resources when !QEDR
Ram Amrani [Sun, 1 Jan 2017 11:57:10 +0000 (13:57 +0200)]
qed: Conserve RDMA resources when !QEDR

Orabug: 25477939

If qedr isn't part of the kernel then don't allocate RDMA resources
for it in qed.

Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1fe582ecade714e90e71c67c32edb7b5b809d651)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed: Support Multicast on Tx-switching
Mintz, Yuval [Sun, 1 Jan 2017 11:57:09 +0000 (13:57 +0200)]
qed: Support Multicast on Tx-switching

Orabug: 25477939

Currently multicast traffic wouldn't be routed internally to
listener; Instead it would only be sent to network via the
physical carrier.

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8806787609dea02c333b187f94c1556798ac8897)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed*: Change maximal number of queues
Mintz, Yuval [Sun, 1 Jan 2017 11:57:03 +0000 (13:57 +0200)]
qed*: Change maximal number of queues

Orabug: 25477939

Today qede requests contexts that would suffice for 64 'whole'
combined queues [192 meant for 64 rx, tx and xdp tx queues],
but registers netdev and limits the number of queues based on
information received by qed. In turn, qed doesn't take context
into account when informing qede how many queues it can support.

This would lead to a configuration problem in case user tries
configuring >64 combined queues to interface [or >96 in case
xdp isn't enabled]. Since we don't have a mangement firware
that actually provides so many interrupt lines to a single
device we're currently safe but that's about to change soon.

The new maximum is hence changed:
  - For RoCE devices, the limit would remain 64.
  - For non-RoCE devices, the limit might be higher [depending
    on the actual configuration of the device].
qed would start enforcing that limit in both scenarios.

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e1d32acbcbd35af5264acc70ff03bf8da9e447a8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/qede/qede_main.c

8 years agoqed*: Update to dual-license
Mintz, Yuval [Sun, 1 Jan 2017 11:57:00 +0000 (13:57 +0200)]
qed*: Update to dual-license

Orabug: 25477939

Since the submission of the qedr driver, there's inconsistency
in the licensing of the various qed/qede files - some are GPLv2
and some are dual-license.
Since qedr requires dual-license and it's dependent on both,
we're updating the licensing of all qed/qede source files.

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e8f1cb507d01205e03f69809af4347ed8ec9db5b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
8 years agoqed: fix old-style function definition
Arnd Bergmann [Fri, 16 Dec 2016 08:47:41 +0000 (09:47 +0100)]
qed: fix old-style function definition

Orabug: 25477939

The newly added file causes a harmless warning, with "make W=1":

drivers/net/ethernet/qlogic/qed/qed_iscsi.c: In function 'qed_get_iscsi_ops':
drivers/net/ethernet/qlogic/qed/qed_iscsi.c:1268:29: warning: old-style function definition [-Wold-style-definition]

This makes it a proper prototype.

Fixes: fc831825f99e ("qed: Add support for hardware offloaded iSCSI.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7729bad4fd95e48bcafcb2222c63a8a5cdc42f61)
Signed-off-by: Brian Maly <brian.maly@oracle.com>