Christoph Hellwig
6917a9cc28
scsi: smartpqi: fully convert to the generic DMA API
...
The driver is currently using an odd mix of legacy PCI DMA API and
generic DMA API calls, switch it over to the generic API entirely.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Tested-by: Don Brace <don.brace@microchip.com >
Acked-by: Don Brace <don.brace@microchip.com >
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2018-10-17 21:58:53 -04:00
Don Brace
4ae5e9d159
scsi: smartpqi: bump driver version to 1.1.4-130
...
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2018-06-19 22:02:25 -04:00
Kevin Barnett
dac12fbc7b
scsi: smartpqi: fix critical ARM issue reading PQI index registers
...
Use the readl() kernel function to read all index registers. For ARM
systems, this function includes a read memory barrier that eliminates ci/pi
corruption.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Reviewed-by: Scott Teel <scott.teel@microsemi.com >
Tested-by: Shunyong Yang <shunyong.yang@hxt-semitech.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2018-06-19 22:02:25 -04:00
Kevin Barnett
9f8d05fa98
scsi: smartpqi: add inspur advantech ids
...
Add support for these new device IDs:
Advantech MIC-8312BridgeB
INSPUR PM8204-2GB
INSPUR PM8204-4GB
INSPUR PM8222-SHBA
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2018-06-19 22:02:25 -04:00
Kevin Barnett
26b390aba2
scsi: smartpqi: improve error checking for sync requests
...
Detect rare error cases for synchronous requests down the RAID path.
Also retry INQUIRY of VPD page 0 sent to an HBA drive if the command failed
due to an abort.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Reviewed-by: Scott Teel <scott.teel@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2018-06-19 22:02:25 -04:00
Kevin Barnett
957c5ab108
scsi: smartpqi: improve handling for sync requests
...
Decrement the active thread count after the synchronous request was
submitted to the controller but before the driver blocks to wait for the
request to complete.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Reviewed-by: Scott Teel <scott.teel@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2018-06-19 22:02:25 -04:00
Kees Cook
6396bb2215
treewide: kzalloc() -> kcalloc()
...
The kzalloc() function has a 2-factor argument form, kcalloc(). This
patch replaces cases of:
kzalloc(a * b, gfp)
with:
kcalloc(a * b, gfp)
as well as handling cases of:
kzalloc(a * b * c, gfp)
with:
kzalloc(array3_size(a, b, c), gfp)
as it's slightly less ugly than:
kzalloc_array(array_size(a, b), c, gfp)
This does, however, attempt to ignore constant size factors like:
kzalloc(4 * 1024, gfp)
though any constants defined via macros get caught up in the conversion.
Any factors with a sizeof() of "unsigned char", "char", and "u8" were
dropped, since they're redundant.
The Coccinelle script used for this was:
// Fix redundant parens around sizeof().
@@
type TYPE;
expression THING, E;
@@
(
kzalloc(
- (sizeof(TYPE)) * E
+ sizeof(TYPE) * E
, ...)
|
kzalloc(
- (sizeof(THING)) * E
+ sizeof(THING) * E
, ...)
)
// Drop single-byte sizes and redundant parens.
@@
expression COUNT;
typedef u8;
typedef __u8;
@@
(
kzalloc(
- sizeof(u8) * (COUNT)
+ COUNT
, ...)
|
kzalloc(
- sizeof(__u8) * (COUNT)
+ COUNT
, ...)
|
kzalloc(
- sizeof(char) * (COUNT)
+ COUNT
, ...)
|
kzalloc(
- sizeof(unsigned char) * (COUNT)
+ COUNT
, ...)
|
kzalloc(
- sizeof(u8) * COUNT
+ COUNT
, ...)
|
kzalloc(
- sizeof(__u8) * COUNT
+ COUNT
, ...)
|
kzalloc(
- sizeof(char) * COUNT
+ COUNT
, ...)
|
kzalloc(
- sizeof(unsigned char) * COUNT
+ COUNT
, ...)
)
// 2-factor product with sizeof(type/expression) and identifier or constant.
@@
type TYPE;
expression THING;
identifier COUNT_ID;
constant COUNT_CONST;
@@
(
- kzalloc
+ kcalloc
(
- sizeof(TYPE) * (COUNT_ID)
+ COUNT_ID, sizeof(TYPE)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(TYPE) * COUNT_ID
+ COUNT_ID, sizeof(TYPE)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(TYPE) * (COUNT_CONST)
+ COUNT_CONST, sizeof(TYPE)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(TYPE) * COUNT_CONST
+ COUNT_CONST, sizeof(TYPE)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(THING) * (COUNT_ID)
+ COUNT_ID, sizeof(THING)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(THING) * COUNT_ID
+ COUNT_ID, sizeof(THING)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(THING) * (COUNT_CONST)
+ COUNT_CONST, sizeof(THING)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(THING) * COUNT_CONST
+ COUNT_CONST, sizeof(THING)
, ...)
)
// 2-factor product, only identifiers.
@@
identifier SIZE, COUNT;
@@
- kzalloc
+ kcalloc
(
- SIZE * COUNT
+ COUNT, SIZE
, ...)
// 3-factor product with 1 sizeof(type) or sizeof(expression), with
// redundant parens removed.
@@
expression THING;
identifier STRIDE, COUNT;
type TYPE;
@@
(
kzalloc(
- sizeof(TYPE) * (COUNT) * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kzalloc(
- sizeof(TYPE) * (COUNT) * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kzalloc(
- sizeof(TYPE) * COUNT * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kzalloc(
- sizeof(TYPE) * COUNT * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kzalloc(
- sizeof(THING) * (COUNT) * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kzalloc(
- sizeof(THING) * (COUNT) * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kzalloc(
- sizeof(THING) * COUNT * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kzalloc(
- sizeof(THING) * COUNT * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
)
// 3-factor product with 2 sizeof(variable), with redundant parens removed.
@@
expression THING1, THING2;
identifier COUNT;
type TYPE1, TYPE2;
@@
(
kzalloc(
- sizeof(TYPE1) * sizeof(TYPE2) * COUNT
+ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
, ...)
|
kzalloc(
- sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
, ...)
|
kzalloc(
- sizeof(THING1) * sizeof(THING2) * COUNT
+ array3_size(COUNT, sizeof(THING1), sizeof(THING2))
, ...)
|
kzalloc(
- sizeof(THING1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(THING1), sizeof(THING2))
, ...)
|
kzalloc(
- sizeof(TYPE1) * sizeof(THING2) * COUNT
+ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
, ...)
|
kzalloc(
- sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
, ...)
)
// 3-factor product, only identifiers, with redundant parens removed.
@@
identifier STRIDE, SIZE, COUNT;
@@
(
kzalloc(
- (COUNT) * STRIDE * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- COUNT * (STRIDE) * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- COUNT * STRIDE * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- (COUNT) * (STRIDE) * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- COUNT * (STRIDE) * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- (COUNT) * STRIDE * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- (COUNT) * (STRIDE) * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- COUNT * STRIDE * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
)
// Any remaining multi-factor products, first at least 3-factor products,
// when they're not all constants...
@@
expression E1, E2, E3;
constant C1, C2, C3;
@@
(
kzalloc(C1 * C2 * C3, ...)
|
kzalloc(
- (E1) * E2 * E3
+ array3_size(E1, E2, E3)
, ...)
|
kzalloc(
- (E1) * (E2) * E3
+ array3_size(E1, E2, E3)
, ...)
|
kzalloc(
- (E1) * (E2) * (E3)
+ array3_size(E1, E2, E3)
, ...)
|
kzalloc(
- E1 * E2 * E3
+ array3_size(E1, E2, E3)
, ...)
)
// And then all remaining 2 factors products when they're not all constants,
// keeping sizeof() as the second factor argument.
@@
expression THING, E1, E2;
type TYPE;
constant C1, C2, C3;
@@
(
kzalloc(sizeof(THING) * C2, ...)
|
kzalloc(sizeof(TYPE) * C2, ...)
|
kzalloc(C1 * C2 * C3, ...)
|
kzalloc(C1 * C2, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(TYPE) * (E2)
+ E2, sizeof(TYPE)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(TYPE) * E2
+ E2, sizeof(TYPE)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(THING) * (E2)
+ E2, sizeof(THING)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(THING) * E2
+ E2, sizeof(THING)
, ...)
|
- kzalloc
+ kcalloc
(
- (E1) * E2
+ E1, E2
, ...)
|
- kzalloc
+ kcalloc
(
- (E1) * (E2)
+ E1, E2
, ...)
|
- kzalloc
+ kcalloc
(
- E1 * E2
+ E1, E2
, ...)
)
Signed-off-by: Kees Cook <keescook@chromium.org >
2018-06-12 16:19:22 -07:00
Kees Cook
6da2ec5605
treewide: kmalloc() -> kmalloc_array()
...
The kmalloc() function has a 2-factor argument form, kmalloc_array(). This
patch replaces cases of:
kmalloc(a * b, gfp)
with:
kmalloc_array(a * b, gfp)
as well as handling cases of:
kmalloc(a * b * c, gfp)
with:
kmalloc(array3_size(a, b, c), gfp)
as it's slightly less ugly than:
kmalloc_array(array_size(a, b), c, gfp)
This does, however, attempt to ignore constant size factors like:
kmalloc(4 * 1024, gfp)
though any constants defined via macros get caught up in the conversion.
Any factors with a sizeof() of "unsigned char", "char", and "u8" were
dropped, since they're redundant.
The tools/ directory was manually excluded, since it has its own
implementation of kmalloc().
The Coccinelle script used for this was:
// Fix redundant parens around sizeof().
@@
type TYPE;
expression THING, E;
@@
(
kmalloc(
- (sizeof(TYPE)) * E
+ sizeof(TYPE) * E
, ...)
|
kmalloc(
- (sizeof(THING)) * E
+ sizeof(THING) * E
, ...)
)
// Drop single-byte sizes and redundant parens.
@@
expression COUNT;
typedef u8;
typedef __u8;
@@
(
kmalloc(
- sizeof(u8) * (COUNT)
+ COUNT
, ...)
|
kmalloc(
- sizeof(__u8) * (COUNT)
+ COUNT
, ...)
|
kmalloc(
- sizeof(char) * (COUNT)
+ COUNT
, ...)
|
kmalloc(
- sizeof(unsigned char) * (COUNT)
+ COUNT
, ...)
|
kmalloc(
- sizeof(u8) * COUNT
+ COUNT
, ...)
|
kmalloc(
- sizeof(__u8) * COUNT
+ COUNT
, ...)
|
kmalloc(
- sizeof(char) * COUNT
+ COUNT
, ...)
|
kmalloc(
- sizeof(unsigned char) * COUNT
+ COUNT
, ...)
)
// 2-factor product with sizeof(type/expression) and identifier or constant.
@@
type TYPE;
expression THING;
identifier COUNT_ID;
constant COUNT_CONST;
@@
(
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * (COUNT_ID)
+ COUNT_ID, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * COUNT_ID
+ COUNT_ID, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * (COUNT_CONST)
+ COUNT_CONST, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * COUNT_CONST
+ COUNT_CONST, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * (COUNT_ID)
+ COUNT_ID, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * COUNT_ID
+ COUNT_ID, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * (COUNT_CONST)
+ COUNT_CONST, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * COUNT_CONST
+ COUNT_CONST, sizeof(THING)
, ...)
)
// 2-factor product, only identifiers.
@@
identifier SIZE, COUNT;
@@
- kmalloc
+ kmalloc_array
(
- SIZE * COUNT
+ COUNT, SIZE
, ...)
// 3-factor product with 1 sizeof(type) or sizeof(expression), with
// redundant parens removed.
@@
expression THING;
identifier STRIDE, COUNT;
type TYPE;
@@
(
kmalloc(
- sizeof(TYPE) * (COUNT) * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kmalloc(
- sizeof(TYPE) * (COUNT) * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kmalloc(
- sizeof(TYPE) * COUNT * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kmalloc(
- sizeof(TYPE) * COUNT * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kmalloc(
- sizeof(THING) * (COUNT) * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kmalloc(
- sizeof(THING) * (COUNT) * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kmalloc(
- sizeof(THING) * COUNT * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kmalloc(
- sizeof(THING) * COUNT * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
)
// 3-factor product with 2 sizeof(variable), with redundant parens removed.
@@
expression THING1, THING2;
identifier COUNT;
type TYPE1, TYPE2;
@@
(
kmalloc(
- sizeof(TYPE1) * sizeof(TYPE2) * COUNT
+ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
, ...)
|
kmalloc(
- sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
, ...)
|
kmalloc(
- sizeof(THING1) * sizeof(THING2) * COUNT
+ array3_size(COUNT, sizeof(THING1), sizeof(THING2))
, ...)
|
kmalloc(
- sizeof(THING1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(THING1), sizeof(THING2))
, ...)
|
kmalloc(
- sizeof(TYPE1) * sizeof(THING2) * COUNT
+ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
, ...)
|
kmalloc(
- sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
, ...)
)
// 3-factor product, only identifiers, with redundant parens removed.
@@
identifier STRIDE, SIZE, COUNT;
@@
(
kmalloc(
- (COUNT) * STRIDE * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- COUNT * (STRIDE) * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- COUNT * STRIDE * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- (COUNT) * (STRIDE) * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- COUNT * (STRIDE) * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- (COUNT) * STRIDE * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- (COUNT) * (STRIDE) * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- COUNT * STRIDE * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
)
// Any remaining multi-factor products, first at least 3-factor products,
// when they're not all constants...
@@
expression E1, E2, E3;
constant C1, C2, C3;
@@
(
kmalloc(C1 * C2 * C3, ...)
|
kmalloc(
- (E1) * E2 * E3
+ array3_size(E1, E2, E3)
, ...)
|
kmalloc(
- (E1) * (E2) * E3
+ array3_size(E1, E2, E3)
, ...)
|
kmalloc(
- (E1) * (E2) * (E3)
+ array3_size(E1, E2, E3)
, ...)
|
kmalloc(
- E1 * E2 * E3
+ array3_size(E1, E2, E3)
, ...)
)
// And then all remaining 2 factors products when they're not all constants,
// keeping sizeof() as the second factor argument.
@@
expression THING, E1, E2;
type TYPE;
constant C1, C2, C3;
@@
(
kmalloc(sizeof(THING) * C2, ...)
|
kmalloc(sizeof(TYPE) * C2, ...)
|
kmalloc(C1 * C2 * C3, ...)
|
kmalloc(C1 * C2, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * (E2)
+ E2, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * E2
+ E2, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * (E2)
+ E2, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * E2
+ E2, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- (E1) * E2
+ E1, E2
, ...)
|
- kmalloc
+ kmalloc_array
(
- (E1) * (E2)
+ E1, E2
, ...)
|
- kmalloc
+ kmalloc_array
(
- E1 * E2
+ E1, E2
, ...)
)
Signed-off-by: Kees Cook <keescook@chromium.org >
2018-06-12 16:19:22 -07:00
Linus Torvalds
052c220da3
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
...
Pull SCSI updates from James Bottomley:
"This is mostly updates of the usual drivers: arcmsr, qla2xx, lpfc,
ufs, mpt3sas, hisi_sas.
In addition we have removed several really old drivers: sym53c416,
NCR53c406a, fdomain, fdomain_cs and removed the old scsi_module.c
initialization from all remaining drivers.
Plus an assortment of bug fixes, initialization errors and other minor
fixes"
* tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (168 commits)
scsi: ufs: Add support for Auto-Hibernate Idle Timer
scsi: ufs: sysfs: reworking of the rpm_lvl and spm_lvl entries
scsi: qla2xxx: fx00 copypaste typo
scsi: qla2xxx: fix error message on <qla2400
scsi: smartpqi: update driver version
scsi: smartpqi: workaround fw bug for oq deletion
scsi: arcmsr: Change driver version to v1.40.00.05-20180309
scsi: arcmsr: Sleep to avoid CPU stuck too long for waiting adapter ready
scsi: arcmsr: Handle adapter removed due to thunderbolt cable disconnection.
scsi: arcmsr: Rename ACB_F_BUS_HANG_ON to ACB_F_ADAPTER_REMOVED for adapter hot-plug
scsi: qla2xxx: Update driver version to 10.00.00.06-k
scsi: qla2xxx: Fix Async GPN_FT for FCP and FC-NVMe scan
scsi: qla2xxx: Cleanup code to improve FC-NVMe error handling
scsi: qla2xxx: Fix FC-NVMe IO abort during driver reset
scsi: qla2xxx: Fix retry for PRLI RJT with reason of BUSY
scsi: qla2xxx: Remove nvme_done_list
scsi: qla2xxx: Return busy if rport going away
scsi: qla2xxx: Fix n2n_ae flag to prevent dev_loss on PDB change
scsi: qla2xxx: Add FC-NVMe abort processing
scsi: qla2xxx: Add changes for devloss timeout in driver
...
2018-04-05 15:05:53 -07:00
Keith Busch
f23f5bece6
blk-mq: Allow PCI vector offset for mapping queues
...
The PCI interrupt vectors intended to be associated with a queue may
not start at 0; a driver may allocate pre_vectors for special use. This
patch adds an offset parameter so blk-mq may find the intended affinity
mask and updates all drivers using this API accordingly.
Cc: Don Brace <don.brace@microsemi.com >
Cc: <qla2xxx-upstream@qlogic.com >
Cc: <linux-scsi@vger.kernel.org >
Signed-off-by: Keith Busch <keith.busch@intel.com >
Reviewed-by: Ming Lei <ming.lei@redhat.com >
Signed-off-by: Jens Axboe <axboe@kernel.dk >
2018-03-27 21:25:36 -06:00
Don Brace
61c187e46e
scsi: smartpqi: update driver version
...
Reviewed-by: Scott Teel <scott.teel@microsemi.com >
Reviewed-by: Gerry Morong <gerry.morong@microsemi.com >
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2018-03-21 18:51:37 -04:00
Kevin Barnett
339faa8150
scsi: smartpqi: workaround fw bug for oq deletion
...
Skip deleting PQI operational queues when there is an error creating a
new queue group. It's not really necessary to delete the queues anyway
because they get deleted during the PQI reset that is part of the error
recovery path.
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2018-03-21 18:51:37 -04:00
Kevin Barnett
b0f9408b14
scsi: smartpqi: add in new supported controllers
...
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2018-03-06 20:15:17 -05:00
Steffen Weber
dc2db1dc5f
scsi: smartpqi: allow static build ("built-in")
...
If CONFIG_SCSI_SMARTPQI=y then don't build this driver as a module.
Signed-off-by: Steffen Weber <steffen.weber@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2018-01-10 23:25:07 -05:00
Linus Torvalds
670ffccb2f
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
...
Pull SCSI updates from James Bottomley:
"This is mostly updates of the usual suspects: lpfc, qla2xxx, hisi_sas,
megaraid_sas, pm80xx, mpt3sas, be2iscsi, hpsa. and a host of minor
updates.
There's no major behaviour change or additions to the core in all of
this, so the potential for regressions should be small (biggest
potential being in the scsi error handler changes)"
* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (203 commits)
scsi: lpfc: Fix hard lock up NMI in els timeout handling.
scsi: mpt3sas: remove a stray KERN_INFO
scsi: mpt3sas: cleanup _scsih_pcie_enumeration_event()
scsi: aacraid: use timespec64 instead of timeval
scsi: scsi_transport_fc: add 64GBIT and 128GBIT port speed definitions
scsi: qla2xxx: Suppress a kernel complaint in qla_init_base_qpair()
scsi: mpt3sas: fix dma_addr_t casts
scsi: be2iscsi: Use kasprintf
scsi: storvsc: Avoid excessive host scan on controller change
scsi: lpfc: fix kzalloc-simple.cocci warnings
scsi: mpt3sas: Update mpt3sas driver version.
scsi: mpt3sas: Fix sparse warnings
scsi: mpt3sas: Fix nvme drives checking for tlr.
scsi: mpt3sas: NVMe drive support for BTDHMAPPING ioctl command and log info
scsi: mpt3sas: Add-Task-management-debug-info-for-NVMe-drives.
scsi: mpt3sas: scan and add nvme device after controller reset
scsi: mpt3sas: Set NVMe device queue depth as 128
scsi: mpt3sas: Handle NVMe PCIe device related events generated from firmware.
scsi: mpt3sas: API's to remove nvme drive from sml
scsi: mpt3sas: API 's to support NVMe drive addition to SML
...
2017-11-14 16:23:44 -08:00
Kees Cook
74a0f57392
scsi: smartpqi: Convert timers to use timer_setup()
...
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.
Cc: "Martin K. Petersen" <martin.petersen@oracle.com >
Cc: Don Brace <don.brace@microsemi.com >
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com >
Cc: esc.storagedev@microsemi.com
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com >
Acked-by: Don Brace <don.brace@microsemi.com >
2017-10-27 02:22:00 -07:00
Don Brace
85ce6b42d0
scsi: smartpqi: update driver version to 1.1.2-126
...
Reviewed-by: Gerry Morong <gerry.morong@microsemi.com >
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Reviewed-by: Scott Teel <scott.teel@microsemi.com >
Reviewed-by: Tomas Henzl <thenzl@redhat.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-10-02 22:46:26 -04:00
Kevin Barnett
38a7338ab5
scsi: smartpqi: cleanup raid map warning message
...
Fix a small cosmetic bug in a very rarely encountered error message that
can occur when a LD has a corrupted raid map.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Reviewed-by: Tomas Henzl <thenzl@redhat.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-10-02 22:26:26 -04:00
Kevin Barnett
bd809e8dfc
scsi: smartpqi: update controller ids
...
Update the driver's PCI IDs.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Reviewed-by: Scott Teel <scott.teel@microsemi.com >
Reviewed-by: Tomas Henzl <thenzl@redhat.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-10-02 22:26:17 -04:00
Christoph Hellwig
eaa79a6cd7
scsi: smartpqi: remove the smp_handler stub
...
The SAS transport class will do the right thing and not register the BSG
node if now smp_handler method is present.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-08-29 21:51:44 -04:00
Kevin Barnett
b98117caa0
scsi: smartpqi: change driver version to 1.1.2-125
...
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-08-10 19:58:26 -04:00
Kevin Barnett
557900640b
scsi: smartpqi: add in new controller ids
...
Update the driver’s PCI IDs to match the latest Microsemi controllers
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-08-10 19:58:26 -04:00
Kevin Barnett
b6d478119e
scsi: smartpqi: update kexec and power down support
...
Add PQI reset to driver shutdown callback to work around controller bug.
During an 1.) OS shutdown or 2.) kexec outside of a kdump, the Linux
kernel will clear BME on our controller.
If BME is cleared during a controller/host PCIe transfer, the controller
will lock up.
So we perform a PQI reset in the driver's shutdown callback function to
eliminate the possibility of a controller/host PCIe transfer being
active when the kernel clears BME immediately after calling the driver's
shutdown callback.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-08-10 19:58:26 -04:00
Kevin Barnett
4f078e2408
scsi: smartpqi: cleanup doorbell register usage.
...
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-08-10 19:58:26 -04:00
Kevin Barnett
41555d540f
scsi: smartpqi: update pqi passthru ioctl
...
- make pass-thru requests bi-directional
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-08-10 19:58:26 -04:00
Kevin Barnett
58322fe006
scsi: smartpqi: enhance BMIC cache flush
...
- distinguish between shutdown and non-shutdown.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-08-10 19:58:25 -04:00
Kevin Barnett
336b681931
scsi: smartpqi: add pqi reset quiesce support
...
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-08-10 19:58:25 -04:00
Yadan Fan
eeee410754
scsi: smartpqi: limit transfer length to 1MB
...
The smartpqi firmware will bypass the cache for any request larger than
1MB, so we should cap the request size to avoid any performance
degradation in kernels later than v4.3
This degradation is caused from d2be537c3b
,
which changed max_sectors_kb to 1280k, but the hardware is able to
work fine with it, so the true fix should be from smartpqi driver.
Signed-off-by: Yadan Fan <ydfan@suse.com >
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de >
Acked-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-07-17 22:56:33 -04:00
Arnd Bergmann
5c146686e3
scsi: smartpqi: mark PM functions as __maybe_unused
...
The newly added suspend/resume support causes harmless warnings when
CONFIG_PM is disabled:
smartpqi/smartpqi_init.c:5147:12: error: 'pqi_ctrl_wait_for_pending_io' defined but not used [-Werror=unused-function]
smartpqi/smartpqi_init.c:2019:13: error: 'pqi_wait_until_lun_reset_finished' defined but not used [-Werror=unused-function]
smartpqi/smartpqi_init.c:2013:13: error: 'pqi_wait_until_scan_finished' defined but not used [-Werror=unused-function]
We can avoid the warnings by removing the #ifdef around the handlers and
instead marking them as __maybe_unused, which will let gcc drop the
unused code silently.
Fixes: f44d210312a6 ("scsi: smartpqi: add suspend and resume support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:05 -04:00
Kevin Barnett
2d154f5ff3
scsi: smartpqi: bump driver version
...
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Reviewed-by: Gerry Morong <gerry.morong@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:04 -04:00
Corentin Labbe
ebaec8e3ee
scsi: smartpqi: remove writeq/readq function definitions
...
Instead of rewriting write/readq, use existing functions
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:04 -04:00
Kevin Barnett
5a259e32ba
scsi: smartpqi: add module parameters
...
Add module parameters to disable heartbeat support and to disable
shutting down the controller when a controller is taken offline.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:04 -04:00
Kevin Barnett
8a994a04fc
scsi: smartpqi: cleanup list initialization
...
Better initialization of linked list heads.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:04 -04:00
Kevin Barnett
a9f9339241
scsi: smartpqi: add raid level show
...
Display the RAID level via sysfs
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:04 -04:00
Kevin Barnett
588a63fea1
scsi: smartpqi: make ioaccel references consistent
...
- make all references to RAID bypass consistent throughout driver.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:04 -04:00
Kevin Barnett
6de783f666
scsi: smartpqi: enhance device add and remove messages
...
Improved formatting of information displayed when devices
are added/removed from the system.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:04 -04:00
Kevin Barnett
13bede676b
scsi: smartpqi: update timeout on admin commands
...
Increase the timeout on admin commands from 3 seconds to 60
seconds and added a check for controller crash in the loop
where the driver polls for admin command completion.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:04 -04:00
Kevin Barnett
f5b6320625
scsi: smartpqi: map more raid errors to SCSI errors
...
enhance mapping of RAID path errors to Linux SCSI host
error codes.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:04 -04:00
Kevin Barnett
37b36847a9
scsi: smartpqi: cleanup controller branding
...
- Improve controller branding support.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:03 -04:00
Kevin Barnett
5f310425c8
scsi: smartpqi: update rescan worker
...
improve support for taking controller offline.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:03 -04:00
Kevin Barnett
03b288cf3d
scsi: smartpqi: update device offline
...
- Improve handling of offline devices.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:03 -04:00
Kevin Barnett
376fb880a4
scsi: smartpqi: correct aio error path
...
set the internal flag that causes I/O to be sent down the
RAID path when the AIO path is disabled
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:03 -04:00
Kevin Barnett
3c50976f33
scsi: smartpqi: add lockup action
...
add support for actions to take when controller goes offline.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:03 -04:00
Kevin Barnett
94086f5be3
scsi: smartpqi: remove qdepth calculations for logical volumes
...
make the queue depth for LVs the same as the maximum
I/Os supported by the controller
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:03 -04:00
Kevin Barnett
d727a776d7
scsi: smartpqi: enhance kdump
...
constrain resource usage during kdump to avoid kdump failures
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:03 -04:00
Kevin Barnett
4e8415e386
scsi: smartpqi: change return value for LUN reset operations
...
change return value for controller offline to be consistent
with the rest of the driver.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:03 -04:00
Kevin Barnett
bd10cf0be6
scsi: smartpqi: add ptraid support
...
add support for PTRAID devices
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:03 -04:00
Kevin Barnett
b805dbfe2b
scsi: smartpqi: update copyright
...
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:03 -04:00
Kevin Barnett
d87d5474e2
scsi: smartpqi: cleanup messages
...
- improve some error messages.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:03 -04:00
Kevin Barnett
7eddabff8a
scsi: smartpqi: add new PCI device IDs
...
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com >
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com >
Signed-off-by: Don Brace <don.brace@microsemi.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2017-06-12 20:48:03 -04:00