Hannes Reinecke [Mon, 9 Nov 2015 12:24:28 +0000 (13:24 +0100)]
scsi: rescan VPD attributes
The VPD page information might change, so we need to be able to update
it. This patch implements a VPD page rescan whenever the 'rescan' sysfs
attribute is triggered.
Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Shane Seymour <shane.seymour@hpe.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Arnd Bergmann [Fri, 20 Nov 2015 16:38:28 +0000 (17:38 +0100)]
scsi: use sector_div instead of do_div
do_div is the wrong way to divide a sector_t, as it is less efficient
when sector_t is 32-bit wide. With the upcoming do_div optimizations,
the kernel starts warning about this:
drivers/scsi/scsi_debug.c: In function 'dif_store':
include/asm-generic/div64.h:207:28: warning: comparison of distinct pointer types lacks a cast
This changes the code to use sector_div instead, which always produces
optimal code.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinicke <hare@suse.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Thu, 19 Nov 2015 12:23:59 +0000 (20:23 +0800)]
hisi_sas: Remove dependency on of_irq_count
Originally the driver would use of_irq_count to calculate how much
memory is required for storing the interrupt names, since the number of
interrupt sources for the controller is variable. Since of_irq_count
cannot be used by the driver, use fixed names.
Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:59 +0000 (00:50 +0800)]
MAINTAINERS: Add maintainer for HiSi SAS driver
Add maintainer for HiSilicon SAS driver.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:58 +0000 (00:50 +0800)]
hisi_sas: Add fatal irq handler
Add handlers for fatal interrupts.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:57 +0000 (00:50 +0800)]
hisi_sas: Add control phy handler
Add method for lldd_control_phy. Currently link rate control and spinup
hold is unsupported.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:56 +0000 (00:50 +0800)]
hisi_sas: Add tmf methods
Add function methods for tmf's.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:55 +0000 (00:50 +0800)]
hisi_sas: Add scan finished and start
Add functions for scsi host template scan_finished and scan_start
methods.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:54 +0000 (00:50 +0800)]
hisi_sas: Add smp protocol support
Add support for smp function, which allows devices attached by expander
to be controlled.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:53 +0000 (00:50 +0800)]
hisi_sas: Add bcast interrupt handler
This is for expander broadcast event.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:52 +0000 (00:50 +0800)]
hisi_sas: Add abnormal irq handler
Add abnormal irq handler. This handler is concerned with phy down event.
Also add port formed and port deformed handlers.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:51 +0000 (00:50 +0800)]
hisi_sas: Add dev_found and dev_gone
Add functions to deal with lldd_dev_found and lldd_dev_gone.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:50 +0000 (00:50 +0800)]
hisi_sas: Add cq interrupt handler
Add cq interrupt handler and also slot error handler function.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:49 +0000 (00:50 +0800)]
hisi_sas: Add ssp command function
Add path to send ssp command to HW.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:48 +0000 (00:50 +0800)]
hisi_sas: Add path from phyup irq to SAS framework
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:47 +0000 (00:50 +0800)]
hisi_sas: Add v1 hardware interrupt init
Add code to interrupts, so now we can get a phy up interrupt when a disk
is connected.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:46 +0000 (00:50 +0800)]
hisi_sas: Add v1 hardware initialisation code
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:45 +0000 (00:50 +0800)]
hisi_sas: Add v1 hardware register definitions
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:44 +0000 (00:50 +0800)]
hisi_sas: Add v1 hw module init
Add module init code for v1 hw.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:43 +0000 (00:50 +0800)]
hisi_sas: Add timer and spinlock init
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:42 +0000 (00:50 +0800)]
hisi_sas: Add phy and port init
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:41 +0000 (00:50 +0800)]
hisi_sas: Add hisi sas device type
Include initialisation.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:40 +0000 (00:50 +0800)]
hisi_sas: Add hisi_hba workqueue
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:39 +0000 (00:50 +0800)]
hisi_sas: Set dev DMA mask
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:38 +0000 (00:50 +0800)]
hisi_sas: Add phy SAS ADDR initialization
The SAS address for the HBA comes from the device tree.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:37 +0000 (00:50 +0800)]
hisi_sas: Add cq structure initialization
Each completion queue has a structure. This is mainly for passing to irq
handler so we know which queue the irq occured on.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:36 +0000 (00:50 +0800)]
hisi_sas: Add slot init code
Add functionality to init slot indexing.
Slot indexing is for the host to track which slots (or tags) are free
and which are used.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:35 +0000 (00:50 +0800)]
hisi_sas: Add hisi_sas_remove
This patch also includes relevant memory/pool freeing and sas/scsi host
removal.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:34 +0000 (00:50 +0800)]
hisi_sas: Allocate memories and create pools
Allocate DMA and non-DMA memories for the controller. Also create DMA
pools.
These include:
- Delivery queues
- Completion queues
- Command status buffer
- Command table
- ITCT (For device context)
- Host slot info
- IO status
- Breakpoint
- host slot indexing
- SG data
- FIS
- interrupts names
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:33 +0000 (00:50 +0800)]
hisi_sas: Add HW DMA structures
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:32 +0000 (00:50 +0800)]
hisi_sas: Scan device tree
Scan the device tree for all properties. Also do this:
- do ioremap for SAS registers
- allocate memory for interrupt names
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:31 +0000 (00:50 +0800)]
hisi_sas: Add scsi host registration
Add functionality to register device as a scsi host.
The SAS domain transport ops are empty at this point.
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:29 +0000 (00:50 +0800)]
devicetree: bindings: scsi: HiSi SAS
Add devicetree bindings for HiSilicon SAS driver.
Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Tue, 17 Nov 2015 16:50:28 +0000 (00:50 +0800)]
scsi: Centralise ssp frame information units
The xfer_rdy, command, and task frame's iu structures are not available
in <scsi/sas.h>, but only aic94xx driver folder. Add them to
include/scsi/sas.h
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:28 +0000 (19:24 +0100)]
atp870u: Introduce atp870_init()
Move 870-specific init code to a separate function atp870_init()
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:27 +0000 (19:24 +0100)]
atp870u: Introduce atp885_init()
Move 885-specific init code to a separate function atp885_init()
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:26 +0000 (19:24 +0100)]
atp870u: Introduce atp880_init()
Move 880-specific init code to a separate function atp880_init()
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:25 +0000 (19:24 +0100)]
atp870u: Initialize tables earlier
Call _init_tables before chip-specific initialization. This avoids code
duplication and fixes a bug(?) in 880 init where the values read from flash
into atpdev->sp are then overwritten by calling init_tables.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:24 +0000 (19:24 +0100)]
atp870u: Remove scam_on from struct atp_unit
scam_on is used only during probe, no need to keep it later.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:23 +0000 (19:24 +0100)]
atp870u: Request IRQ later, remove weird locking
Allocate IRQ later during probe to avoid code duplication and also
remove the need for weird locking in _probe.
(It was probably there to prevent race with the IRQ handler?)
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:22 +0000 (19:24 +0100)]
atp870u: Use pci_request_regions
Use pci_request_regions and do it before accessing the I/O ports.
Also add missing pci_disable_device() call to atp870u_remove().
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:21 +0000 (19:24 +0100)]
atp870u: Introduce is880(), is885() and remove dev_id
Introduce chip type inline functions to simplify code, allowing to delete
dev_id from struct atp_unit.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:20 +0000 (19:24 +0100)]
atp870u: Simplify _probe()
Move shpnt common code to the top, remove base_io, use pci_resource_len.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:19 +0000 (19:24 +0100)]
atp870u: Remove chip_ver from struct atp_unit
chip_ver is used for wide chip detection only. Remove it and use a local
variable instead (for 870; 880 and 885 are always wide).
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:18 +0000 (19:24 +0100)]
atp870u: Improve unsupported chip detection
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:17 +0000 (19:24 +0100)]
atp870u: Improve _probe()
Move scsi_host_alloc() to the top of _probe() to remove code duplication,
*p and unneeded atpdev (de)allocation and copying. While at it, fix the
error paths to return real error codes and also add missing
pci_disble_device() call.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:16 +0000 (19:24 +0100)]
atp870u: Remove unused irq from struct atp_unit
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:15 +0000 (19:24 +0100)]
atp870u: Remove useless and broken card counting
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:14 +0000 (19:24 +0100)]
atp870u: Use n_io_port in request_region and release_region
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:13 +0000 (19:24 +0100)]
atp870u: Use module_pci_driver
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:12 +0000 (19:24 +0100)]
atp870u: Remove empty tscam_885()
tscam_885() is empty (except a delay) so remove it.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:11 +0000 (19:24 +0100)]
atp870u: Reduce log spam on module load/unload
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:10 +0000 (19:24 +0100)]
atp870u: Introduce atp_set_host_id
The code for setting host adapter ID is the same for all chips.
Move it to a common function.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:09 +0000 (19:24 +0100)]
atp870u: Fix incorrect writeb_io access to register 0x3a
The ioport region is 0x20 bytes long so accessing 0x3a register using
writeb_io is incorrect. Use writeb_base instead.
There's no change in behavior as 870 chips have ioport = baseport.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:08 +0000 (19:24 +0100)]
atp870u: Replace port 0x80 delay by udelay
tscam() is using port 0x80 access for delays but that's x86-only.
Use udelay(2) instead.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:07 +0000 (19:24 +0100)]
atp870u: Convert remaining in[bwl] and out[bwl] to wrappers
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:06 +0000 (19:24 +0100)]
atp870u: Rename is885() to atp_is()
Now that all the is* functions except is885() are gone, rename is885() to
atp_is() to avoid confusion. Don't know what "is" means, though...
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:05 +0000 (19:24 +0100)]
atp870u: Remove is870()
Now that is885() supports everything from is870() and the rest of the code
is almost identical, remove is870() and use is885() instead.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:04 +0000 (19:24 +0100)]
atp870u: Move 870-specific code out of is870()
Move few remaining 870-specific code lines out of is870()
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:03 +0000 (19:24 +0100)]
atp870u: Add remaining 870 support to is885()
Add remaining 870 support to is885():
- different synw, no synuw
- synu[4] = 0x0c
- atp_writeb_io(dev, c, 0x04, 0x00); instead of
atp_writeb_io(dev, c, 0x14, 0x00); (isn't that a bug?)
- atp_writeb_io(dev, c, 0x14, 0xff); instead of
atp_writeb_io(dev, c, 0x14, 0x06);
- different mbuf[3] and mbuf[4] checks
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:02 +0000 (19:24 +0100)]
atp870u: Add wide_chip parameter to is870() and is885()
Don't check chip_ver in is870() but add wide_chip parameter for that.
Then add the non-wide support to is885().
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:01 +0000 (19:24 +0100)]
atp870u: Remove is880()
Now that is880() and is885() are almost identical (except for some cpu_relax()
calls and debug printks), remove is880() and use is885() instead.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:24:00 +0000 (19:24 +0100)]
atp870u: Move chip-specific lines out of is880() and is885()
Move few chip-specifis lines out of is880() and is885() so they become
almost identical.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:59 +0000 (19:23 +0100)]
atp870u: Add channel parameter to is870() and is880()
Add channel parameter to is870() and is880() functions to simplify comparing
them with is885().
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:58 +0000 (19:23 +0100)]
atp870u: Unify code format in is870(), is880() and is885()
Unify code formatting in is870(), is880() and is885() functions to simplify
comparing them.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:57 +0000 (19:23 +0100)]
atp870u: Convert is885() to use wrappers
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:56 +0000 (19:23 +0100)]
atp870u: Convert is880() to use wrappers
Subtract 0x40 to use _io access wrappers. Now it's obvious that is870()
and is880() are very similar.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:55 +0000 (19:23 +0100)]
atp870u: Convert is870() to use wrappers
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:54 +0000 (19:23 +0100)]
atp870u: Introduce HW access wrappers
Introduce *_read? and *_write? wrappers to improve code readability.
Also make sure that baseport is always initialized, not only for ATP880.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:53 +0000 (19:23 +0100)]
atp870u: Remove ugly gotos #5
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:52 +0000 (19:23 +0100)]
atp870u: Remove ugly gotos #4
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:51 +0000 (19:23 +0100)]
atp870u: Remove ugly gotos #3
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:50 +0000 (19:23 +0100)]
atp870u: Remove ugly gotos #2
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:49 +0000 (19:23 +0100)]
atp870u: Remove ugly gotos
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:48 +0000 (19:23 +0100)]
atp870u: Untangle tmpcip #2
Untangle the tmpcip crap so it becomes obvious what ports are accessed.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:47 +0000 (19:23 +0100)]
atp870u: Untangle tmpcip
Untangle the tmpcip crap so it becomes obvious what ports are accessed.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:46 +0000 (19:23 +0100)]
atp870u: Untangle tmport #8
Untangle the tmport crap so it becomes obvious what ports are accessed.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:45 +0000 (19:23 +0100)]
atp870u: Untangle tmport #7
Untangle the tmport crap so it becomes obvious what ports are accessed.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:44 +0000 (19:23 +0100)]
atp870u: Untangle tmport #6
Untangle the tmport crap so it becomes obvious what ports are accessed.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:43 +0000 (19:23 +0100)]
atp870u: Untangle tmport #5
Untangle the tmport crap so it becomes obvious what ports are accessed.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:42 +0000 (19:23 +0100)]
atp870u: Untangle tmport #4
Untangle the tmport crap so it becomes obvious what ports are accessed.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:41 +0000 (19:23 +0100)]
atp870u: Untangle tmport #3
Untangle the tmport crap so it becomes obvious what ports are accessed.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:40 +0000 (19:23 +0100)]
atp870u: Untangle tmport #2
Untangle the tmport crap so it becomes obvious what ports are accessed.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:39 +0000 (19:23 +0100)]
atp870u: Untangle tmport
Untangle the tmport crap so it becomes obvious what ports are accessed.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:38 +0000 (19:23 +0100)]
atp870u: Remove tmport1
Remove tmport1 temporary variable to simplify the code.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ondrej Zary [Tue, 17 Nov 2015 18:23:37 +0000 (19:23 +0100)]
atp870u: Remove workport
Remove workport temporary variable to simplify the code.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Hannes Reinicke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
The initio driver has for many years had two copies of the
same module device table. One of them is also used for registering
the other driver, the other one is entirely useless after the
large scale cleanup that Alan Cox did back in 2007.
The compiler warns about this whenever the driver is built-in:
drivers/scsi/initio.c:131:29: warning: 'i91u_pci_devices' defined but not used [-Wunused-variable]
This removes the extraneous table and the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 72d39fea901 ("[SCSI] initio: Convert into a real Linux driver and update to modern style") Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Its last user was removed 10 years ago, in commit 8b05b773b6030de5 ("[SCSI] convert st to use scsi_execute_async").
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Acked-by: Kai Mäkisara <kai.makisara@kolumbus.fi> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1) Fix list tests in netfilter ingress support, from Florian Westphal.
2) Fix reversal of input and output interfaces in ingress hook
invocation, from Pablo Neira Ayuso.
3) We have a use after free in r8169, caught by Dave Jones, fixed by
Francois Romieu.
4) Splice use-after-free fix in AF_UNIX frmo Hannes Frederic Sowa.
5) Three ipv6 route handling bug fixes from Martin KaFai Lau:
a) Don't create clone routes not managed by the fib6 tree
b) Don't forget to check expiration of DST_NOCACHE routes.
c) Handle rt->dst.from == NULL properly.
6) Several AF_PACKET fixes wrt transport header setting and SKB
protocol setting, from Daniel Borkmann.
7) Fix thunder driver crash on shutdown, from Pavel Fedin.
8) Several Mellanox driver fixes (max MTU calculations, use of correct
DMA unmap in TX path, etc.) from Saeed Mahameed, Tariq Toukan, Doron
Tsur, Achiad Shochat, Eran Ben Elisha, and Noa Osherovich.
9) Several mv88e6060 DSA driver fixes (wrong bit definitions for
certain registers, etc.) from Neil Armstrong.
10) Make sure to disable preemption while updating per-cpu stats of ip
tunnels, from Jason A. Donenfeld.
11) Various ARM64 bpf JIT fixes, from Yang Shi.
12) Flush icache properly in ARM JITs, from Daniel Borkmann.
13) Fix masking of RX and TX interrupts in ravb driver, from Masaru
Nagai.
14) Fix netdev feature propagation for devices not implementing
->ndo_set_features(). From Nikolay Aleksandrov.
15) Big endian fix in vmxnet3 driver, from Shrikrishna Khare.
16) RAW socket code increments incorrect SNMP counters, fix from Ben
Cartwright-Cox.
17) IPv6 multicast SNMP counters are bumped twice, fix from Neil Horman.
18) Fix handling of VLAN headers on stacked devices when REORDER is
disabled. From Vlad Yasevich.
19) Fix SKB leaks and use-after-free in ipvlan and macvlan drivers, from
Sabrina Dubroca.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (83 commits)
MAINTAINERS: Update Mellanox's Eth NIC driver entries
net/core: revert "net: fix __netdev_update_features return.." and add comment
af_unix: take receive queue lock while appending new skb
rtnetlink: fix frame size warning in rtnl_fill_ifinfo
net: use skb_clone to avoid alloc_pages failure.
packet: Use PAGE_ALIGNED macro
packet: Don't check frames_per_block against negative values
net: phy: Use interrupts when available in NOLINK state
phy: marvell: Add support for 88E1540 PHY
arm64: bpf: make BPF prologue and epilogue align with ARM64 AAPCS
macvlan: fix leak in macvlan_handle_frame
ipvlan: fix use after free of skb
ipvlan: fix leak in ipvlan_rcv_frame
vlan: Do not put vlan headers back on bridge and macvlan ports
vlan: Fix untag operations of stacked vlans with REORDER_HEADER off
via-velocity: unconditionally drop frames with bad l2 length
ipg: Remove ipg driver
dl2k: Add support for IP1000A-based cards
snmp: Remove duplicate OUTMCAST stat increment
net: thunder: Check for driver data in nicvf_remove()
...
net/core: revert "net: fix __netdev_update_features return.." and add comment
This reverts commit 00ee59271777 ("net: fix __netdev_update_features return
on ndo_set_features failure")
and adds a comment explaining why it's okay to return a value other than
0 upon error. Some drivers might actually change flags and return an
error so it's better to fire a spurious notification rather than miss
these.
CC: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
af_unix: take receive queue lock while appending new skb
While possibly in future we don't necessarily need to use
sk_buff_head.lock this is a rather larger change, as it affects the
af_unix fd garbage collector, diag and socket cleanups. This is too much
for a stable patch.
For the time being grab sk_buff_head.lock without disabling bh and irqs,
so don't use locked skb_queue_tail.
Fixes: 869e7c62486e ("net: af_unix: implement stream sendpage support") Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Reported-by: Eric Dumazet <edumazet@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
rtnetlink: fix frame size warning in rtnl_fill_ifinfo
Fix the following warning:
CC net/core/rtnetlink.o
net/core/rtnetlink.c: In function ‘rtnl_fill_ifinfo’:
net/core/rtnetlink.c:1308:1: warning: the frame size of 2864 bytes is larger than 2048 bytes [-Wframe-larger-than=]
}
^
by splitting up the huge rtnl_fill_ifinfo into some smaller ones, so we
don't have the huge frame allocations at the same time.
Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Martin Zhang [Tue, 17 Nov 2015 12:49:30 +0000 (20:49 +0800)]
net: use skb_clone to avoid alloc_pages failure.
1. new skb only need dst and ip address(v4 or v6).
2. skb_copy may need high order pages, which is very rare on long running server.
Signed-off-by: Junwei Zhang <linggao.zjw@alibaba-inc.com> Signed-off-by: Martin Zhang <martinbj2008@gmail.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Andrew Lunn [Mon, 16 Nov 2015 22:36:46 +0000 (23:36 +0100)]
net: phy: Use interrupts when available in NOLINK state
The NOLINK state will poll the phy once a second to see if the link
has come up. If the phy has an interrupt line, this polling can be
skipped, since the phy should interrupt when the link returns.
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>