Santosh Shilimkar [Wed, 21 Oct 2015 00:53:40 +0000 (17:53 -0700)]
Merge branch 'uek4-avago' of git://ca-git.us.oracle.com/linux-mkp-public into topic/uek-4.1/drivers
* 'uek4-avago' of git://ca-git.us.oracle.com/linux-mkp-public: (76 commits)
mpt3sas : Bump mpt3sas driver version to 9.100.00.00
mpt3sas: When device is blocked followed by unblock fails, unfreeze the I/Os
mpt3sas: Call dma_mapping_error() API after mapping an address with dma_map_single() API
mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API
mpt3sas: Added support for customer specific branding
mpt3sas: Return host busy error status to SML when DMA mapping of scatter gather list fails for a SCSI command
mpt3sas: Complete the SCSI command with DID_RESET status for log_info value 0x0x32010081
mpt3sas: MPI 2.5 Rev K (2.5.6) specifications
mpt3sas: Bump mpt3sas driver version to v6.100.00.00
mpt3sas: Add branding string support for OEM custom HBA
mpt3sas: Add branding string support for OEM's HBA
mpt3sas: MPI 2.5 Rev J (2.5.5) specification and 2.00.34 header files
mpt3sas: Update MPI2 strings to MPI2.5
mpt3sas: Bump mpt3sas Driver version to v5.100.00.00
mpt3sas: Provides the physical location of sas drives
mpt3sas: MPI 2.5 Rev I (2.5.4) specifications.
mpt3sas: Remove redundancy code while freeing the controller resources.
mpt3sas: Don't block the drive when drive addition under the control of SML
mpt3sas: Get IOC_FACTS information using handshake protocol only after HBA card gets into READY or Operational state.
mpt3sas: Added Combined Reply Queue feature to extend up-to 96 MSIX vector support
...
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:06 +0000 (12:25 +0530)]
mpt3sas : Bump mpt3sas driver version to 9.100.00.00
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit c75683ca13d12a700531864bcd3118e94bc9eaa0) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:05 +0000 (12:25 +0530)]
mpt3sas: When device is blocked followed by unblock fails, unfreeze the I/Os
Issue: When the disks are getting discovered and assigned device
handles by the kernel, a device block followed by an unblock
(due to broadcast primitives) issued by the driver is
interspersed by the kernel changing the state of the device.
Therefore the unblock by the driver results in a no operation
within the kernel API.
To fix this one, the below patch checks the return of the unblock API
and performs a block followed by an unblock to unfreeze the block
layer's I/O queue. Sufficient checks and prints are also added in the
driver to identify this condition caused by the kernel.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit df838f92f3f5240dca54e1629e8547818e8ea646) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:04 +0000 (12:25 +0530)]
mpt3sas: Call dma_mapping_error() API after mapping an address with dma_map_single() API
Added dma_mapping_error() API after mapping an address with dma_map_single()
API. Otherwise when CONFIG_DMA_API_DEBUG is enabled in the kernel, then it
complains about mpt3sas driver not calling dma_mapping_error after mapping an
address with dma_map_single
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 36814028ad720165a6febcf9ddd7de20833fd240) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:03 +0000 (12:25 +0530)]
mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API
Created a thread using alloc_ordered_workqueue() API in order to process
the works from firmware Work-queue sequentially instead of
create_singlethread_workqueue() API.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Joe Lawrence <joe.lawrence@stratus.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit bdff785e4f593218816fa3677e043aae1481aa98) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:02 +0000 (12:25 +0530)]
mpt3sas: Added support for customer specific branding
"VendorID" "DeviceID" "SubsystemVendor ID" "SubsystemDevice ID" Cisco Branding String
0x1000 0x97 0x1137 0x154 Cisco 9300-8i 12Gbps SAS HBA
0x1000 0x97 0x1137 0x155 Cisco 12G Modular SAS Pass through Controller
0x1000 0x97 0x1137 0x156 UCS C3X60 12G SAS Pass through Controller
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit d8eb4a47c70b4bab34b938d2f682044687f53c64) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:01 +0000 (12:25 +0530)]
mpt3sas: Return host busy error status to SML when DMA mapping of scatter gather list fails for a SCSI command
scsi_dma_map API will return a negative value (i.e. -ENOMEM)
if DMA mapping of sg lists fails and zero if the sg list in the
SCSI cmd is NULL. But drivers doesn't handled sg list DMA mapping
failure case properly.
So, Updated the code to return host busy error status to SCSI MID Layer(SML),
when DMA mapping of scatter gather list fails for a SCSI command.
So that SML will retry this SCSI cmd after some time.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 62f5c74c97037c7c00fdefb69dcfe39810c34a05) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:55:00 +0000 (12:25 +0530)]
mpt3sas: Complete the SCSI command with DID_RESET status for log_info value 0x0x32010081
For any SCSI command, if the driver receives
IOC status = SCSI_IOC_TERMINATED and log info = 0x32010081 then
that command will be completed with DID_RESET host status.
The definition of this log info value is
"Virtual IO has failed and has to be retried".
Firmware will provide this log info value with IOC Status
"SCSI_IOC_TERMINATED", whenever a drive (with is a part of a volume)
is pulled and pushed back within some minimal delay.
With this log info value, firmware informs the driver to retry the
failed IO command infinite times, so to provide some time for the
firmware to discover the reinserted drive successfully instated of
just retrying failed command for five times(doesn't giving enough
time for firmware to complete the drive discovery) and failing the
IO permanently even though drive came back successfully.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 3898f08e8ccfc8b7b4c297960ecdde970869e950) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:59 +0000 (12:24 +0530)]
mpt3sas: MPI 2.5 Rev K (2.5.6) specifications
Below are the new changes to MPI 2.5 Rev K(2.5.6) specification and 2.00.35
header files
1) Added a minimum size requirement for target mode command buffers.
2) Added MinMSIxIndex and MaxMSIxIndex fields to CommandBufferPostBase
Request.
3) For BIOS Page 1, added SSUTimeout field, and added Product Name String
Format bits to the BiosOptions field
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit a6f84009b9d7ca97c400ca929f9d58f43b0ece9d) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:58 +0000 (12:24 +0530)]
mpt3sas: Bump mpt3sas driver version to v6.100.00.00
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 2b89669ae4addfa68a58e0fc16afdd24739720d8) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 38e4141ecb0e59c93d85ec5948f98d1f1e331a88) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit fb84dfc44718ef4099a827d147f738e428828d02) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 35c319b47884e49d9d0a84779097916ccb173947) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:54 +0000 (12:24 +0530)]
mpt3sas: Update MPI2 strings to MPI2.5
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 2e26c3853206ba166c3434e5f2ca4c82078ad84e) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:53 +0000 (12:24 +0530)]
mpt3sas: Bump mpt3sas Driver version to v5.100.00.00
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit f9d81cfc23151eb6e9e498663c9784c351646d0e) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:52 +0000 (12:24 +0530)]
mpt3sas: Provides the physical location of sas drives
This Patch will provide more details of the devices such as slot number,
enclosure logical id, enclosure level & connector name in the following
scenarios,
- When end device is added in the topology,
- When the end device is removed from the setup,
- When the SCSI mid layer issues TASK ABORT/ DEVICE RESET/ TARGET RESET during
error handling,
- When any command to the device fails with Sense key Hardware error or Medium
error or Unit Attention,
- When firmware returns device error or device not ready status for the end
device,
- When a Predicted fault is detected on an end device.
This information can be used by the user to identify the location of the
desired drive in the topology.
Driver will get these information by reading the sas device page0.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit e6d45e3e7e6582fa206ef84631639ce70d50e5c5) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:51 +0000 (12:24 +0530)]
mpt3sas: MPI 2.5 Rev I (2.5.4) specifications.
Update MPI 2.5 Release: MPI 2.5 Rev I (2.5.4) specification and 2.00.33 header
files
Below is the change set from the MPI specification for I Rev
1) Added Base Enclosure Level bit to the Flags field of Manufacturing Page 7.
2) Updated description of the MaxTargetPortConnectTime field of SAS IO Unit
Page 1.
3) Added EnclosureLevel and ConnectorName fields to SAS Device Page 0. Also,
added EnclosureLevel and ConnectorName Valid bit to the Flags field.
4) Added EnclosureLevel field to SAS Enclosure Page 0. Also, added
EnclosureLevel Valid bit to the Flags field.
5) Added value for BIOS image to HashImageType.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit a94bea343c2f747c62ef66b52d2430e6aeb75434) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:50 +0000 (12:24 +0530)]
mpt3sas: Remove redundancy code while freeing the controller resources.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 580d4e3153f0d7a9a9235b675b0b7b13e2185a8b) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:49 +0000 (12:24 +0530)]
mpt3sas: Don't block the drive when drive addition under the control of SML
During hot-plugging of a disk(having a flaky link), the disk addition
stops and any further disk addition or removal doesn't happen on that
controller.
This is because, when driver receives DELAY_NOT_RESPONDING event for a disk
while it is undergoing addition at the SCSI Transport layer, the driver
would block the I/O to that disk resulting in a deadlock. i.e the disk
addition work couldn't be completed at the SCSI Transport Layer as it
can't send any I/Os (such as Inquiry, Report LUNs etc) to the disk as
I/Os are blocked to this drive. Also any subsequent device removal
(TARGET_NOT_RESPONDING) or link update(RC_PHY_CHANGED) event couldn't be
processed as they are in the queue to get processed after disk addition
event.
Description of Change:
Don't block the drive when drive addition is under the control of SML.
So that SML won't be blocked of issuing the device dicovery commands
(such as Inquiry, Report LUNs etc).
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit e4bc7f5c21a18cab9acd30940df0ee791fcd7b9e) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:48 +0000 (12:24 +0530)]
mpt3sas: Get IOC_FACTS information using handshake protocol only after HBA card gets into READY or Operational state.
Driver initialization fails if driver tries to send IOC facts request message
when the IOC is in reset or in a fault state.
This patch will make sure that
1.Driver to send IOC facts request message only if HBA is in operational or
ready state.
2.If IOC is in fault state, a diagnostic reset would be issued.
3.If IOC is in reset state then driver will wait for 10 seconds to exit out
of reset state. If the HBA continues to be in reset state, then the HBA
wouldn't be claimed by the driver.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 4dc8c8087f0304ff8d06f862520406b11aac4a66) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sreekanth Reddy [Tue, 30 Jun 2015 06:54:47 +0000 (12:24 +0530)]
mpt3sas: Added Combined Reply Queue feature to extend up-to 96 MSIX vector support
In this patch, increased the number of MSIX vector support for SAS3 C0 HBAs to
up-to 96.
Following are changes that are done in this patch
1. This feature is enabled only for SAS3 C0 and higher revision cards and also
only when reply post free queue count is greater than 8.
2. To support this feature 12 SupplementalReplyPostHostIndex system interfaces
are used. MSI-X index numbered from 0 to 7 use the first
SupplementalReplyPostHostIndex system interface to update its corresponding
ReplyPostHostIndex values, MSI-X index numbered from 8 to 15 will use the
second SupplementalReplyPostHostIndex system interface and so on. These 12
SuppementalReplyPostHostIndex system interfaces address are saved in the array
replyPostRegisterIndex[].
3. As each SupplementalReplyPostHostIndex register supports 8 MSI-X
vectors. So MSIxIndex field in these register must contain a value between 0
and 7.
4. After processing the reply descriptors from a reply post free queues then
update the new reply post host index value in ReplyPostHostIndex field and
(msix_index mod 8) value in MSIxIndex field of SupplementalReplyPostHostIndex
register. The Address of this SupplementalReplyPostHostIndex register is
retrived from (msix_index/8)th entry of replyPostRegisterIndex[] array.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit fb77bb5376a55f4e6c8d9243249e82831a276ee5) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Calvin Owens [Fri, 14 Aug 2015 01:48:10 +0000 (18:48 -0700)]
mpt2sas: Refcount fw_events and fix unsafe list usage
The fw_event_work struct is concurrently referenced at shutdown, so
add a refcount to protect it, and refactor the code to use it.
Additionally, refactor _scsih_fw_event_cleanup_queue() such that it
no longer iterates over the list without holding the lock, since
_firmware_event_work() concurrently deletes items from the list.
Signed-off-by: Calvin Owens <calvinowens@fb.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Nicholas Bellinger <nab@linux-iscsi.org> Tested-by: Chaitra Basappa <chaitra.basappa@avagotech.com> Acked-by: Sreekanth Reddy <sreekanth.reddy@avagotech.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 008549f6e8a1dc4aeea4a8d64184909786b27713) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Calvin Owens [Fri, 14 Aug 2015 01:48:09 +0000 (18:48 -0700)]
mpt2sas: Refcount sas_device objects and fix unsafe list usage
These objects can be referenced concurrently throughout the driver, we
need a way to make sure threads can't delete them out from under each
other. This patch adds the refcount, and refactors the code to use it.
Additionally, we cannot iterate over the sas_device_list without
holding the lock, or we risk corrupting random memory if items are
added or deleted as we iterate. This patch refactors _scsih_probe_sas()
to use the sas_device_list in a safe way.
Signed-off-by: Calvin Owens <calvinowens@fb.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Nicholas Bellinger <nab@linux-iscsi.org> Tested-by: Chaitra Basappa <chaitra.basappa@avagotech.com> Acked-by: Sreekanth Reddy <sreekanth.reddy@avagotech.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit d224fe0d609734888af63656ddaf3a8352f0a7b5) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
mpt2sas, mpt3sas: Abort initialization if no memory I/O resources detected
Driver crashes if the BIOS do not set up at least one
memory I/O resource. This failure can happen if the device is too
slow to respond during POST and is missed by the BIOS, but Linux
then detects the device later in the boot process.
Based on a patch from Timothy Pearson <tpearson@raptorengineeringinc.com>
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 5aeeb78aeb4c8607cbda54a7b0dc7315171e214f) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Santosh Shilimkar [Tue, 20 Oct 2015 01:20:23 +0000 (18:20 -0700)]
Merge branch 'topic/uek-4.1/rpm-build' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/rpm-build' of git://ca-git.us.oracle.com/linux-uek:
uek-rpm: unset CONFIG_NFS_USE_LEGACY_DNS for OL7 debug kernel too
uek-rpm: build: Update the base release to 9 with stable v4.1.10
uek-rpm: configs: sparc: Enable VCC as a module
uek-rpm: configs: sparc64: enable i40e modules
uek-rpm: configs: sparc64: synced config files
Santosh Shilimkar [Tue, 20 Oct 2015 01:19:31 +0000 (18:19 -0700)]
Merge branch 'topic/uek-4.1/stable-cherry-picks' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/stable-cherry-picks' of git://ca-git.us.oracle.com/linux-uek: (30 commits)
Linux 4.1.10
hp-wmi: limit hotkey enable
zram: fix possible use after free in zcomp_create()
netlink: Replace rhash_portid with bound
netlink: Fix autobind race condition that leads to zero port ID
mvneta: use inband status only when explicitly enabled
of_mdio: add new DT property 'managed' to specify the PHY management type
net: phy: fixed_phy: handle link-down case
net: dsa: bcm_sf2: Do not override speed settings
fib_rules: fix fib rule dumps across multiple skbs
net: revert "net_sched: move tp->root allocation into fw_init()"
tcp: add proper TS val into RST packets
openvswitch: Zero flows on allocation.
macvtap: fix TUNSETSNDBUF values > 64k
net/mlx4_en: really allow to change RSS key
bridge: fix igmpv3 / mldv2 report parsing
sctp: fix race on protocol/netns initialization
netlink, mmap: transform mmap skb into full skb on taps
net: dsa: bcm_sf2: Fix 64-bits register writes
ipv6: fix multipath route replace error recovery
...
Santosh Shilimkar [Tue, 20 Oct 2015 01:19:19 +0000 (18:19 -0700)]
Merge branch 'topic/uek-4.1/sparc' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/sparc' of git://ca-git.us.oracle.com/linux-uek:
PCI: Restore pref MMIO allocation logic for host bridge without mmio64
PCI: Only treat non-pref mmio64 as pref if host bridge has mmio64
PCI: Add has_mem64 for struct host_bridge
PCI: Only treat non-pref mmio64 as pref if all bridges have MEM_64
PCI: Check pref compatible bit for mem64 resource of PCIe device
OF/PCI: Add IORESOURCE_MEM_64 for 64-bit resource
PCI: kill wrong quirk about M7101
sparc/PCI: Keep resource idx order with bridge register number
sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing
sparc/PCI: Reserve legacy mmio after PCI mmio
sparc/PCI: Unify pci_register_region()
sparc/PCI: Use correct bus address to resource offset
sparc/PCI: Add mem64 resource parsing for root bus
sparc: Revert commits that broke ixgbe and igb drivers on T7
sparc: vdso: lockdep fixes
SPARC64: LDoms suspend domain service.
Santosh Shilimkar [Tue, 20 Oct 2015 01:18:46 +0000 (18:18 -0700)]
Merge branch 'topic/uek-4.1/drivers' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1
* 'topic/uek-4.1/drivers' of git://ca-git.us.oracle.com/linux-uek: (122 commits)
be2net: bump up the driver version to 10.6.0.4
enic: do hang reset only in case of tx timeout
enic: handle spurious error interrupt
enic: reduce ioread in devcmd2
enic: Fix build failure with SRIOV disabled.
enic: Fix namespace pollution causing build errors.
enic: Fix sparse warning in vnic_devcmd_init().
enic: add devcmd2
enic: add devcmd2 resources
enic: use netdev_<foo> or dev_<foo> instead of pr_<foo>
enic: move struct definition from .c to .h file
enic: allow adaptive coalesce setting for msi/legacy intr
enic: add adaptive coalescing intr for intx and msi poll
enic: fix issues in enic_poll
enic: use atomic_t instead of spin_lock in busy poll
drivers/net: remove all references to obsolete Ethernet-HOWTO
enic: Grammar s/an negative/a negative/
qla2xxx: Update driver version to 8.07.00.26.39.0-k.
be2net: remove vlan promisc capability from VF's profile descriptors
be2net: set pci_func_num while issuing GET_PROFILE_CONFIG cmd
...
Quentin Casasnovas [Mon, 19 Oct 2015 21:22:27 +0000 (14:22 -0700)]
RDS: fix race condition when sending a message on unbound socket.
Sasha's found a NULL pointer dereference in the RDS connection code when
sending a message to an apparently unbound socket. The problem is caused
by the code checking if the socket is bound in rds_sendmsg(), which checks
the rs_bound_addr field without taking a lock on the socket. This opens a
race where rs_bound_addr is temporarily set but where the transport is not
in rds_bind(), leading to a NULL pointer dereference when trying to
dereference 'trans' in __rds_conn_create().
Vegard wrote a reproducer for this issue, so kindly ask him to share if
you're interested.
I cannot reproduce the NULL pointer dereference using Vegard's reproducer
with this patch, whereas I could without.
Complete earlier incomplete fix to CVE-2015-6937:
74e98eb08588 ("RDS: verify the underlying transport exists before creating a connection")
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com> Reviewed-by: Vegard Nossum <vegard.nossum@oracle.com> Reviewed-by: Sasha Levin <sasha.levin@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Cc: Vegard Nossum <vegard.nossum@oracle.com> Cc: Sasha Levin <sasha.levin@oracle.com> Cc: Chien Yen <chien.yen@oracle.com> Cc: David S. Miller <davem@davemloft.net> Cc: stable@vger.kernel.org Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Yinghai Lu [Thu, 8 Oct 2015 21:38:34 +0000 (14:38 -0700)]
PCI: Restore pref MMIO allocation logic for host bridge without mmio64
From 5b2854155 (PCI: Restrict 64-bit prefetchable bridge windows to 64-bit
resources), we change the logic for pref mmio allocation:
When bridge pref support mmio64, we will only put children pref
that support mmio64 into it, and will put children pref mmio32
into bridge's non-pref mmio32.
That could leave bridge pref bar not used when that pref bar is mmio64,
and children res only has mmio32.
Also could have allocation failure when non-pref mmio32 is not big
enough space for those children pref mmio32.
That is not rational when the host bridge does not 64bit mmio above 4g
at all.
The patch restore to old logic:
when host bridge does not have has_mem64, put children pref mmio64 and
pref mmio32 all under bridges pref bars.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Orabug: 21826746
Yinghai Lu [Thu, 8 Oct 2015 21:38:32 +0000 (14:38 -0700)]
PCI: Add has_mem64 for struct host_bridge
Add has_mem64 for struct host_bridge, on root bus that does not support
mmio64 above 4g, will not set that.
We will use that info next two following patches:
1. Don't treat non-pref mmio64 as pref mmio, so will not put
it under bridge's pref range when rescan the devices
2. will keep pref mmio64 and pref mmio32 under bridge pref bar.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Orabug: 21826746
Yinghai Lu [Thu, 8 Oct 2015 21:38:31 +0000 (14:38 -0700)]
PCI: Only treat non-pref mmio64 as pref if all bridges have MEM_64
If any bridge up to root only have 32bit pref mmio, We don't need to
treat device non-pref mmio64 as as pref mmio64.
We need to move pci_bridge_check_ranges calling early.
for parent bridges pref mmio BAR may not allocated by BIOS, res flags
is still 0, we need to have it correct set before we check them for
child device resources.
-v2: check all bus resources instead of just res[15].
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Orabug: 21826746
All the bridges 64-bit resource have pref bit, but the device resource does not
have pref set, then we can not find parent for the device resource,
as we can not put non-pref mem under pref mem.
According to pcie spec errta
https://www.pcisig.com/specifications/pciexpress/base2/PCIe_Base_r2.1_Errata_08Jun10.pdf
page 13, in some case it is ok to mark some as pref.
Mark if the entire path from the host to the adapter is over PCI Express.
Then set pref compatible bit for claim/sizing/assign for 64bit mem resource
on that pcie device.
-v2: set pref for mmio 64 when whole path is PCI Express, according to David Miller.
-v3: don't set pref directly, change to UNDER_PREF, and set PREF before
sizing and assign resource, and cleart PREF afterwards. requested by BenH.
-v4: use on_all_pcie_path device flag instead.
Yinghai Lu [Thu, 8 Oct 2015 21:38:29 +0000 (14:38 -0700)]
OF/PCI: Add IORESOURCE_MEM_64 for 64-bit resource
For device resource PREF bit setting under bridge 64-bit pref resource,
we need to make sure only set PREF for 64bit resource, so set
IORESOUCE_MEM_64 for 64bit resource during OF device resource flags
parsing.
Yinghai Lu [Thu, 8 Oct 2015 21:38:26 +0000 (14:38 -0700)]
PCI: kill wrong quirk about M7101
Meelis reported that qla2000 driver does not get loaded on one sparc system.
schizo f00732d0: PCI host bridge to bus 0001:00
pci_bus 0001:00: root bus resource [io 0x7fe01000000-0x7fe01ffffff] (bus address [0x0000-0xffffff])
pci 0001:00:06.0: quirk: [io 0x7fe01000800-0x7fe0100083f] claimed by ali7101 ACPI
pci 0001:00:06.0: quirk: [io 0x7fe01000600-0x7fe0100061f] claimed by ali7101 SMB
pci 0001:00:07.0: can't claim BAR 0 [io 0x7fe01000000-0x7fe0100ffff]: address conflict with 0001:00:06.0 [io 0x7fe01000600-0x7fe0100061f]
So the quirk for M7101 claim the io range early.
According to spec with M7101 in M1543 page 103/104,
http://www.versalogic.com/Support/Downloads/pdf/ali1543.pdf
0xe0, and 0xe2 do not include address info for acpi/smb.
and we already had pref_compat support that add extra pref bit for device
resource.
It turns out that pci_resource_compatible()/pci_up_path_over_pref_mem64()
just check resource with bridge pref mmio register idx 15, and we have put
resource to use mmio register idx 14 during of_scan_pci_bridge()
as the bridge does not mmio resource.
We already fix pci_up_path_over_pref_mem64() to check all bus resources.
And at the same time, this patch will make resource to consistent sequence
like other arch or directly from pci_read_bridge_bases(),
even non-pref mmio is missing, or out of ordering in firmware reporting.
So hold i = 1 for non pref mmio, and i =2 for pref mmio.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Orabug: 21826746
Yinghai Lu [Thu, 8 Oct 2015 21:38:24 +0000 (14:38 -0700)]
sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing
For device resource PREF bit setting under bridge 64-bit pref resource,
we need to make sure only set PREF for 64bit resource, so set
IORESOUCE_MEM_64 for 64bit resource during of device resource flags
parsing.
Yinghai Lu [Thu, 8 Oct 2015 21:38:20 +0000 (14:38 -0700)]
sparc/PCI: Add mem64 resource parsing for root bus
Found "no compatible bridge window" warning in boot log from T5-8.
pci 0000:00:01.0: can't claim BAR 15 [mem 0x100000000-0x4afffffff pref]: no compatible bridge window
That resource is above 4G, but does not get offset correctly as
root bus only report io and mem32.
pci_sun4v f02dbcfc: PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [io 0x804000000000-0x80400fffffff] (bus address [0x0000-0xfffffff])
pci_bus 0000:00: root bus resource [mem 0x800000000000-0x80007effffff] (bus address [0x00000000-0x7effffff])
pci_bus 0000:00: root bus resource [bus 00-77]
Add mem64 handling in pci_common for sparc, so we can have 64bit resource
registered for root bus at first.
After patch, will have:
pci_sun4v f02dbcfc: PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [io 0x804000000000-0x80400fffffff] (bus address [0x0000-0xfffffff])
pci_bus 0000:00: root bus resource [mem 0x800000000000-0x80007effffff] (bus address [0x00000000-0x7effffff])
pci_bus 0000:00: root bus resource [mem 0x800100000000-0x8007ffffffff] (bus address [0x100000000-0x7ffffffff])
pci_bus 0000:00: root bus resource [bus 00-77]
-v2: mem64_space should use mem_space.start as offset.
-v3: add IORESOURCE_MEM_64 flag
-v4: set name for mem64_space, otherwise /proc/iomem will have <bad> for name
Sujith Sankar [Tue, 13 Oct 2015 10:04:02 +0000 (15:34 +0530)]
enic: do hang reset only in case of tx timeout
The current code invokes hang reset in case of error interrupt. We should
hang reset only in case of tx timeout. This because of the way hang reset
is implemented in firmware. Hang reset takes more firmware resources than
soft reset. Adaptor does not generate error interrupt in case of tx
timeout.
Hang reset only in case of tx timeout, in .ndo_tx_timeout. Do soft reset
otherwise. Introduce deferred work, enic_tx_hang_reset, to do hang reset.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sujith Sankar [Tue, 13 Oct 2015 10:02:31 +0000 (15:32 +0530)]
enic: handle spurious error interrupt
Some of the enic adaptors are know to generate spurious interrupts. When
error interrupt is generated, driver just resets the device. This patch
resets the device only when an error is occurred.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/built-in.o: In function `.vnic_wq_devcmd2_alloc':
(.text+0x49fe40): multiple definition of `.vnic_wq_devcmd2_alloc'
drivers/scsi/built-in.o:(.text+0xb4318): first defined here
drivers/net/built-in.o:(.opd+0x2af00): multiple definition of `vnic_wq_devcmd2_alloc'
drivers/scsi/built-in.o:(.opd+0xad70): first defined here
drivers/net/built-in.o: In function `.vnic_wq_init_start':
(.text+0x49f9c0): multiple definition of `.vnic_wq_init_start'
drivers/scsi/built-in.o:(.text+0xb3b58): first defined here
drivers/net/built-in.o:(.opd+0x2ae88): multiple definition of `vnic_wq_init_start'
drivers/scsi/built-in.o:(.opd+0xace0): first defined here
Rename these to 'enic_*' to avoid the conflict with the functiosn of
the same name in the snic scsi driver.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Sujith Sankar [Tue, 13 Oct 2015 09:55:27 +0000 (15:25 +0530)]
enic: add devcmd2
devcmd is an interface for driver to communicate with fw/adaptor. It
involves writing data to hardware registers and waiting for the result.
This mechanism does not scale well. The queuing of "no wait" devcmds is
done in firmware memory rather than on the host. Firmware memory is a
rather more scarce and valuable resource than host memory. A devcmd storm
from one vf can disrupt the service on other pf/vf. The lack of flow
control allows for possible denial of server from one VM to another.
Devcmd2 uses work queue to post the devcmds, just like tx work queue. This
allows better flow control.
Initialize devcmd2, if fails we fall back to devcmd1.
Also change the driver version.
Signed-off-by: N V V Satyanarayana Reddy <nalreddy@cisco.com> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sujith Sankar [Tue, 13 Oct 2015 09:49:59 +0000 (15:19 +0530)]
enic: add devcmd2 resources
Add devcmd resources to vnic_res_type. Add data types used by devcmd.
Signed-off-by: N V V Satyanarayana Reddy <nalreddy@cisco.com> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sujith Sankar [Tue, 13 Oct 2015 09:47:36 +0000 (15:17 +0530)]
enic: use netdev_<foo> or dev_<foo> instead of pr_<foo>
pr_info does not give any details about the interface involved. This patch
uses netdev_info for printing the message. Use dev_info where netdev is not
ready.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sujith Sankar [Tue, 13 Oct 2015 09:46:19 +0000 (15:16 +0530)]
enic: move struct definition from .c to .h file
Some of the structure definitions are in .c file to make them private to
that file. This patch moves the struct definition to .h file, So that their
definitions are accessible from other files.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sujith Sankar [Tue, 13 Oct 2015 09:44:45 +0000 (15:14 +0530)]
enic: allow adaptive coalesce setting for msi/legacy intr
* Allow setting of adaptive coalescing setting for all types of interrupt.
* In msi & legacy intr, we use single interrupt for rx & tx. In this case
tx_coalesce_usecs is invalid. We should use only rx_coalesce_usecs.
Do not display tx_coal values for msi/intx. And do not allow user to set
this as well.
* Driver supports only tx/rx_coalesce_usec and adaptive coalesce settings.
For other values, driver does not return error. So ethtool succeeds for
unsupported values. Introduce enic_coalesce_valid() function to validate
the coalescing values.
* If user requests for coalesce value greater than what adaptor supports,
driver uses the max value. We should at least log this.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sujith Sankar [Tue, 13 Oct 2015 09:42:52 +0000 (15:12 +0530)]
enic: add adaptive coalescing intr for intx and msi poll
Adaptive interrupt coalescing is available for msix. This patch adds the support
for msi poll. Interface for adaptive interrupt coalescing is already added in
driver. We just did not enable it for legacy intr & msi.
enic_calc_int_moderation() & enic_set_int_moderation() are defined as static
after enic_poll. Since enic_poll needs it, move both of these function
definitions above enic_poll. No change in functionality.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sujith Sankar [Tue, 13 Oct 2015 09:32:18 +0000 (15:02 +0530)]
enic: fix issues in enic_poll
In enic_poll, we clean tx and rx queues, when low latency busy socket polling
is happening, enic_poll will only clean tx queue. After cleaning tx, it should
return total budget for re-poll.
There is a small window between vnic_intr_unmask() and enic_poll_unlock_napi().
In this window if an irq occurs and napi is scheduled on different cpu, it tries
to acquire enic_poll_lock_napi() and fails. Unlock napi_poll before unmasking
the interrupt.
v2:
Do not change tx wonk done behaviour. Consider only rx work done for completing
napi.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sujith Sankar [Tue, 13 Oct 2015 09:27:34 +0000 (14:57 +0530)]
enic: use atomic_t instead of spin_lock in busy poll
We use spinlock to access a single flag. We can avoid spin_locks by using
atomic variable and atomic_cmpxchg(). Use atomic_cmpxchg to set the flag
for idle to poll. And a simple atomic_set to unlock (set idle from poll).
In napi poll, if gro is enabled, we call napi_gro_receive() to deliver the
packets. Before we call napi_complete(), i.e while re-polling, if low
latency busy poll is called, we use netif_receive_skb() to deliver the packets.
At this point if there are some skb's held in GRO, busy poll could deliver the
packets out of order. So we call napi_gro_flush() to flush skbs before we
move the napi poll to idle.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sujith Sankar [Tue, 13 Oct 2015 09:21:06 +0000 (14:51 +0530)]
drivers/net: remove all references to obsolete Ethernet-HOWTO
This howto made sense in the 1990s when users had to manually configure
ISA cards with jumpers or vendor utilities, but with the implementation
of PCI it became increasingly less and less relevant, to the point where
it has been well over a decade since I last updated it. And there is
no value in anyone else taking over updating it either.
However the references to it continue to spread as boiler plate text
from one Kconfig file into the next. We are not doing end users any
favours by pointing them at this old document, so lets kill it with
fire, once and for all, to hopefully stop any further spread.
No code is changed in this commit, just Kconfig help text.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
rkennedy [Tue, 13 Oct 2015 20:15:40 +0000 (13:15 -0700)]
lpfc: Fix default RA_TOV and ED_TOV in the FC/FCoE driver for all topologies
Submitted by james.smart () james.smart.()@emulex.com
Fix default RA_TOV and ED_TOV in the FC/FCoE driver for all topologies
Initial link up defaults were not properly being tracked relative to
initial FLOGI or pt2pt PLOGI. Add code to initialize them.
Signed-off-by: Dick Kennedy dick.kennedy@avagotech.com Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105412203750&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 20:15:36 +0000 (13:15 -0700)]
lpfc: The linux driver does not reinitiate discovery after a failed FLOGI
Submitted by james.smart () james.smart.()@emulex.com
The linux driver does not reinitiate discovery after a failed FLOGI
Forgot to clear FCF Discovery in-progress flag upon FLOGI failures.
Thus we didn't restart FLOGI.
Signed-off-by: Dick Kennedy dick.kennedy@avagotech.com Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105413003760&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 20:15:31 +0000 (13:15 -0700)]
lpfc: Fix for discovery failure in PT2PT when FLOGI's ELS ACC response gets aborted
Submitted by james.smart () james.smart.()@emulex.com
Fix for discovery failure in PT2PT when FLOGI's ELS ACC response gets aborted
Change login state machine to:
- Restart FLOGI if prior is ABTS'd
- Reject incoming FLOGIs if we have one pending
The above ensures that we always finish FLOGI processing, regardless
of who initated FLOGI, before processing PLOGI's.
Signed-off-by: Dick Kennedy dick.kennedy@avagotech.com Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105413003759&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 20:15:26 +0000 (13:15 -0700)]
lpfc: Add support for Lancer G6 and 32G FC links
Submitted by james.smart () james.smart.()@emulex.com
Add support for Lancer G6 and 32G FC links
Signed-off-by: Dick Kennedy dick.kennedy@avagotech.com Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105411903746&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Ales Novak Ales.Novak@emulex.com
From: Ales Novak alnovak@suse.cz
lpfc_send_rscn_event() allocates data for sizeof(struct
lpfc_rscn_event_header) + payload_len, but claims that the data has size
of sizeof(struct lpfc_els_event_header) + payload_len. That leads to
buffer overruns.
Signed-off-by: Ales Novak alnovak@suse.cz Signed-off-by: James Smart james.smart@avagotech.com Reviewed-by: Hannes Reinecke hare@suse.de
http://marc.info/?l=linux-scsi&m=144105411603743&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 20:15:17 +0000 (13:15 -0700)]
lpfc: Fix possible use-after-free and double free in lpfc_mbx_cmpl_rdp_page_a2()
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Johannes Thumshirn Johannes.Thumshirn@emulex.com
From: Johannes Thumshirn jthumshirn@suse.de
If the bf_get() call in lpfc_mbx_cmpl_rdp_page_a2() does succeeds, execution
continues normally and mp gets kfree()d.
If the subsequent call to lpfc_sli_issue_mbox() fails execution jumps to the
error label where lpfc_mbuf_free() is called with mp-virt and mp-phys as
function arguments. This is the use after free. Following the use after free mp
gets kfree()d again which is a double free.
Signed-off-by: Johannes Thumshirn jthumshirn@suse.de Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105412703755&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 20:15:12 +0000 (13:15 -0700)]
lpfc: remove set but not used variables
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Sebastian Herbszt Sebastian.Herbszt@emulex.com
From: Sebastian Herbszt herbszt@gmx.de
Remove set but not used variables.
Signed-off-by: Sebastian Herbszt herbszt@gmx.de Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105412703757&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 20:15:07 +0000 (13:15 -0700)]
lpfc:Make the function lpfc_sli4_mbox_completions_pending static in order to comply wi
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Nicholas Krause Nicholas.Krause@emulex.com
From: Nicholas Krause xerofoify@gmail.com
This makes the function lpfc_sli4_mbox_completion's definition
static now in order to comply with its prototype being also
declared as static too.
Signed-off-by: Nicholas Krause xerofoify@gmail.com Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105411503741&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 20:13:30 +0000 (13:13 -0700)]
Fix kmalloc overflow in LPFC driver at large core count
Submitted by james.smart james.smart.@avagotech.com
From: james.smart@avagotech.com (James Smart)
Note: original patch modified by me to resolve unused variable warning
From: ian mitchell <imitchell@sgi.com>
This patch allows the LPFC to start up without a fatal kernel bug based
on an exceeded KMALLOC_MAX_SIZE and a too large NR_CPU-based maskbits
field. The bug was based on the number of CPU cores in a system.
Using the get_cpu_mask() function declared in kernel/cpu.c allows the
driver to load on the community kernel 4.2 RC1.
Signed-off-by: Ian Mitchell <imitchell@sgi.com> Signed-off-by: Alex Thorlton <athorlton@sgi.com> Suggested-by: Robert Elliot <elliott@hp.com>
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 19:48:28 +0000 (12:48 -0700)]
lpfc: Destroy lpfc_hba_index IDR on module exit
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Johannes Thumshirn Johannes.Thumshirn@emulex.com
From: Johannes Thumshirn jthumshirn@suse.de
Destroy lpfc_hba_index IDR on module exit, reclaiming the allocated memory.
This was detected by the following semantic patch (written by Luis Rodriguez
mcgrof@suse.com)
SmPL
@ defines_module_init @
declarer name module_init, module_exit;
declarer name DEFINE_IDR;
identifier init;
@@
Signed-off-by: Johannes Thumshirn jthumshirn@suse.de Signed-off-by: James Smart james.smart@avagotech.com Reviewed-by: Hannes Reinecke hare@suse.de
http://marc.info/?l=linux-scsi&m=144105411403740&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
rkennedy [Tue, 13 Oct 2015 19:48:24 +0000 (12:48 -0700)]
lpfc: in sli3 use configured sg_seg_cnt for sg_tablesize
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Bodo Stroesser Bodo.Stroesser@emulex.com
From: Bodo Stroesser bstroesser@ts.fujitsu.com
Hi James,
We had some performance problems with RAID systems connected to LPe12k.
AFAICS, the reason is a small bug in lpfc.ko, causing the IO-size to
be smaller than expected.
rkennedy [Tue, 13 Oct 2015 19:48:15 +0000 (12:48 -0700)]
lpfc: fix model description
Submitted by james.smart () james.smart.()@emulex.comSubmitted by Sebastian Herbszt Sebastian.Herbszt@emulex.com
From: Sebastian Herbszt herbszt@gmx.de
Remove trailing space from model description.
Signed-off-by: Sebastian Herbszt herbszt@gmx.de Signed-off-by: James Smart james.smart@avagotech.com
http://marc.info/?l=linux-scsi&m=144105410703733&w=2
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:35 +0000 (10:42 -0400)]
lpfc: Check for active portpeerbeacon.
LCB requests to set Beacon would fail if the beacon was already enabled
internally as the mailbox command used to query the state failes with
an already-set status.
Correct by enhancing the check so we don't fail if if the already set
status comes back.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 481ad967991e1ff00d627d365de398b7a77e4d7f)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:36 +0000 (10:42 -0400)]
lpfc: Fix vport deletion failure.
If a vport was deleted while in the middle of discovery, we weren't
clearing the nport discovery flag. Correct by clearing the flag and
cancelling our discovery timeout timer.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 73dc0dbed3f9f65c6f80fab429dd9771de794714)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:37 +0000 (10:42 -0400)]
lpfc: Devices are not discovered during takeaway/giveback testing
When a remote nport changes it's DID, a new ndlp is used.
However, we left the old ndlp state unchanged and still in
a discovery state. The may stall discovery resulting in some
devices not being discovered. Correct by swapping the state
of the 2 ndlp's when a DID swap is detected.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 953ceeda97ddfed2c6e0bea3706257d57197f269)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:38 +0000 (10:42 -0400)]
lpfc: Add support for using block multi-queue
With blk-mq support in the mid-layer, lpfc can do IO steering based
on the information in the request tag. This patch allows lpfc to use
blk-mq if enabled. If not enabled, we fall back into the emulex-internal
affinity mappings.
This feature can be turned on via CONFIG_SCSI_MQ_DEFAULT or passing
scsi_mod.use_blk_mq=Y as a parameter to the kernel.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 8b0dff14164d3f43eba8365950b506d898e0e1e6)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:39 +0000 (10:42 -0400)]
lpfc: Fix scsi prep dma buf error.
Didn't check for less-than-or-equal zero. Means we may later call
scsi_dma_unmap() even though we don't have valid mappings.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 5116fbf136ea21b8678a85eee5c03508736ada9f)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:40 +0000 (10:42 -0400)]
lpfc: Fix cq_id masking problem.
The driver inadvertainly constrained the id space to 8 bits, when its
a full 16 bits from hw. This resulted in bad id's being written to the
hardware. Resulted in symptoms such as incomplete initialization, no
detection of link events, etc.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 16f3b48d26ac069abc020826f0c429c4ddcfb20c)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:41 +0000 (10:42 -0400)]
lpfc: Fix scsi task management error message.
TMF's were getting error messages on FCP_RSP errors (underrun). Underruns
aren't meaningful in the scenario. Change the error message to filter out
these response check errors, and don't unconditionally mark the cmd as
in error.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit ae374a308cbfeab3cf72ef7c57695d2145defeab)
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
James Smart [Fri, 22 May 2015 14:42:43 +0000 (10:42 -0400)]
lpfc: Fix to drop PLOGIs from fabric node till LOGO processing completes
The domain controller PLOGI's concurrent with prior LOGO's/unreg_rpi's
completing created a race condition where driver rpi ref count can
inadvertantly hit 0 and the rpi attempted to be freed. This error
sometimes resulted in Warning messages indicating kref.h via
lfpc_nlp_get+0x128.
Correct by dropping any new PLOGI until the prior nport state has settled.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Orabug: 22029622
From dick.kennedy@avagotech.com lpfc-10.5.0.1-11.0.0.3-1.tar.gz Acked-by: Chuck Anderson <chuck.anderson@oracle.com>