Haowen Bai
d627660c22
scsi: elx: efct: Remove NULL check after calling container_of()
...
container_of() will never return NULL.
Link: https://lore.kernel.org/r/1652750737-22673-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Haowen Bai <baihaowen@meizu.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-05-19 20:16:27 -04:00
Harshit Mogalapalli
e79aaa9cc0
scsi: elx: efct: Remove redundant memset() statement
...
As memset() of bmbx is immediately followed by a memcpy() where bmbx is the
destination, the memset() is redundant.
Link: https://lore.kernel.org/r/20220505143703.45441-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-05-19 20:16:26 -04:00
Wan Jiabing
507bd398a0
scsi: elx: efct: Remove unnecessary memset() in efct_io()
...
io->sgl is allocated by kzalloc(). The memory is set to zero.
It is unnecessary to call memset again.
Link: https://lore.kernel.org/r/20220318145230.1031-1-wanjiabing@vivo.com
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-04-25 23:28:25 -04:00
Linus Torvalds
6f2689a766
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
...
Pull SCSI updates from James Bottomley:
"This series consists of the usual driver updates (qla2xxx, pm8001,
libsas, smartpqi, scsi_debug, lpfc, iscsi, mpi3mr) plus minor updates
and bug fixes.
The high blast radius core update is the removal of write same, which
affects block and several non-SCSI devices. The other big change,
which is more local, is the removal of the SCSI pointer"
* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (281 commits)
scsi: scsi_ioctl: Drop needless assignment in sg_io()
scsi: bsg: Drop needless assignment in scsi_bsg_sg_io_fn()
scsi: lpfc: Copyright updates for 14.2.0.0 patches
scsi: lpfc: Update lpfc version to 14.2.0.0
scsi: lpfc: SLI path split: Refactor BSG paths
scsi: lpfc: SLI path split: Refactor Abort paths
scsi: lpfc: SLI path split: Refactor SCSI paths
scsi: lpfc: SLI path split: Refactor CT paths
scsi: lpfc: SLI path split: Refactor misc ELS paths
scsi: lpfc: SLI path split: Refactor VMID paths
scsi: lpfc: SLI path split: Refactor FDISC paths
scsi: lpfc: SLI path split: Refactor LS_RJT paths
scsi: lpfc: SLI path split: Refactor LS_ACC paths
scsi: lpfc: SLI path split: Refactor the RSCN/SCR/RDF/EDC/FARPR paths
scsi: lpfc: SLI path split: Refactor PLOGI/PRLI/ADISC/LOGO paths
scsi: lpfc: SLI path split: Refactor base ELS paths and the FLOGI path
scsi: lpfc: SLI path split: Introduce lpfc_prep_wqe
scsi: lpfc: SLI path split: Refactor fast and slow paths to native SLI4
scsi: lpfc: SLI path split: Refactor lpfc_iocbq
scsi: lpfc: Use kcalloc()
...
2022-03-24 19:37:53 -07:00
Julia Lawall
8037185d1a
scsi: elx: libefc_sli: Fix typos in comments
...
Various spelling mistakes in comments. Detected with the help of
Coccinelle.
Link: https://lore.kernel.org/r/20220314115354.144023-18-Julia.Lawall@inria.fr
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-03-15 00:32:15 -04:00
Gustavo A. R. Silva
5224f79096
treewide: Replace zero-length arrays with flexible-array members
...
There is a regular need in the kernel to provide a way to declare
having a dynamically sized set of trailing elements in a structure.
Kernel code should always use “flexible array members”[1] for these
cases. The older style of one-element or zero-length arrays should
no longer be used[2].
This code was transformed with the help of Coccinelle:
(next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)
@@
identifier S, member, array;
type T1, T2;
@@
struct S {
...
T1 member;
T2 array[
- 0
];
};
UAPI and wireless changes were intentionally excluded from this patch
and will be sent out separately.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
Link: https://github.com/KSPP/linux/issues/78
Reviewed-by: Kees Cook <keescook@chromium.org >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
2022-02-17 07:00:39 -06:00
Yang Yingliang
61263b3a11
scsi: elx: efct: Don't use GFP_KERNEL under spin lock
...
GFP_KERNEL/GFP_DMA can't be used under a spin lock. According the comment,
els_ios_lock is used to protect els ios list so we can move down the spin
lock to avoid using this flag under the lock.
Link: https://lore.kernel.org/r/20220111012441.3232527-1-yangyingliang@huawei.com
Fixes: 8f406ef728 ("scsi: elx: libefc: Extended link Service I/O handling")
Reported-by: Hulk Robot <hulkci@huawei.com >
Reviewed-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-01-24 23:30:23 -05:00
Christophe JAILLET
1aa7d9799e
scsi: efct: Remove useless DMA-32 fallback configuration
...
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also
fail for the same reason.
Simplify code and remove some dead code accordingly.
While at it, return the error code returned by dma_set_mask_and_coherent()
instead of -1.
[1]: https://lkml.org/lkml/2021/6/7/398
Link: https://lore.kernel.org/r/958bcb2a6e86344c14f38369e8e7079615a2b0e3.1641754613.git.christophe.jaillet@wanadoo.fr
Reviewed-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2022-01-10 10:37:02 -05:00
Christoph Hellwig
efac162a4e
scsi: efct: Don't pass GFP_DMA to dma_alloc_coherent()
...
dma_alloc_coherent() ignores the zone specifiers so this is pointless and
confusing.
Link: https://lore.kernel.org/r/20211214163605.416288-1-hch@lst.de
Reviewed-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-12-16 22:52:29 -05:00
Christophe JAILLET
2c2934c80e
scsi: elx: Use 'bitmap_zalloc()' when applicable
...
'sli4->ext[i].use_map' is a bitmap. Use 'bitmap_zalloc()' to simplify code,
improve the semantic and avoid some open-coded arithmetic in allocator
arguments.
Also change the corresponding 'kfree()' into 'bitmap_free()' to keep
consistency.
Link: https://lore.kernel.org/r/2a0a83949fb896a0a236dcca94dfdc8486d489f5.1635104793.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-10-26 23:28:33 -04:00
Martin K. Petersen
ec65e6beb0
Merge branch '5.15/scsi-fixes' into 5.16/scsi-staging
...
Merge the 5.15/scsi-fixes branch into the staging tree to resolve UFS
conflict reported by sfr.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-10-12 11:58:12 -04:00
Dan Carpenter
a013c71c63
scsi: elx: efct: Delete stray unlock statement
...
It's not holding the lock at this stage and the IRQ "flags" are not correct
so it would restore something bogus. Delete the unlock statement.
Link: https://lore.kernel.org/r/20211004103851.GE25015@kili
Fixes: 3e6414003b ("scsi: elx: efct: SCSI I/O handling routines")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-10-04 23:33:31 -04:00
Christophe JAILLET
ca4ff9e751
scsi: elx: efct: Switch from 'pci_' to 'dma_' API
...
The wrappers in include/linux/pci-dma-compat.h should go away.
The patch has been generated with the coccinelle script below.
It has been hand modified to use 'dma_set_mask_and_coherent()' instead of
'pci_set_dma_mask()/pci_set_consistent_dma_mask()' when applicable.
This is less verbose.
It has been compile tested.
@@
@@
- PCI_DMA_BIDIRECTIONAL
+ DMA_BIDIRECTIONAL
@@
@@
- PCI_DMA_TODEVICE
+ DMA_TO_DEVICE
@@
@@
- PCI_DMA_FROMDEVICE
+ DMA_FROM_DEVICE
@@
@@
- PCI_DMA_NONE
+ DMA_NONE
@@
expression e1, e2, e3;
@@
- pci_alloc_consistent(e1, e2, e3)
+ dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
@@
expression e1, e2, e3;
@@
- pci_zalloc_consistent(e1, e2, e3)
+ dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
@@
expression e1, e2, e3, e4;
@@
- pci_free_consistent(e1, e2, e3, e4)
+ dma_free_coherent(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_map_single(e1, e2, e3, e4)
+ dma_map_single(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_unmap_single(e1, e2, e3, e4)
+ dma_unmap_single(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4, e5;
@@
- pci_map_page(e1, e2, e3, e4, e5)
+ dma_map_page(&e1->dev, e2, e3, e4, e5)
@@
expression e1, e2, e3, e4;
@@
- pci_unmap_page(e1, e2, e3, e4)
+ dma_unmap_page(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_map_sg(e1, e2, e3, e4)
+ dma_map_sg(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_unmap_sg(e1, e2, e3, e4)
+ dma_unmap_sg(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+ dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_dma_sync_single_for_device(e1, e2, e3, e4)
+ dma_sync_single_for_device(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+ dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
@@
expression e1, e2, e3, e4;
@@
- pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+ dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
@@
expression e1, e2;
@@
- pci_dma_mapping_error(e1, e2)
+ dma_mapping_error(&e1->dev, e2)
@@
expression e1, e2;
@@
- pci_set_dma_mask(e1, e2)
+ dma_set_mask(&e1->dev, e2)
@@
expression e1, e2;
@@
- pci_set_consistent_dma_mask(e1, e2)
+ dma_set_coherent_mask(&e1->dev, e2)
Link: https://lore.kernel.org/r/3899b1ed4abac581c30845d82f33ec6df8b38976.1629633207.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-09-28 23:39:23 -04:00
Dmitry Bogdanov
e76b7c5e25
scsi: efct: Decrease area under spinlock
...
Under the session level spinlock node->active_ios_lock in
efct_scsi_io_alloc() we are taking another spinlock for the port. This
leads to contention between sessions and even between I/Os in the same
session.
Reduce the locked region to active_ios list for which active_ios_lock is
intended. Spinlock CPU usage decreases from 18% down to 13%. IOPS are
increased from 220 kIOPS to 264 kIOPS for one LUN.
Link: https://lore.kernel.org/r/20210914105539.6942-4-d.bogdanov@yadro.com
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com >
Reviewed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-09-22 00:04:56 -04:00
Dmitry Bogdanov
ee3dce9f38
scsi: efct: Fix nport free
...
nport_free for an empty nport hangs the state machine waiting for mbox
completion if nport is not yet attached thinking that it is attaching right
now. Add a check for nport attaching state and complete nport free.
Link: https://lore.kernel.org/r/20210914105539.6942-3-d.bogdanov@yadro.com
Reviewed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-09-22 00:04:55 -04:00
Dmitry Bogdanov
8d4efd0040
scsi: efct: Add state in nport sm trace printout
...
Similar to other state machine traces and to make debug easier, add the
state name to nport sm trace printout.
Link: https://lore.kernel.org/r/20210914105539.6942-2-d.bogdanov@yadro.com
Reviewed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-09-22 00:04:55 -04:00
Len Baker
0a5e20fc8c
scsi: elx: libefc: Prefer kcalloc() over open coded arithmetic
...
As noted in the "Deprecated Interfaces, Language Features, Attributes, and
Conventions" documentation [1], size calculations (especially
multiplication) should not be performed in memory allocator (or similar)
function arguments due to the risk of them overflowing. This could lead to
values wrapping around and a smaller allocation being made than the caller
was expecting. Using those allocations could lead to linear overflows of
heap memory and other misbehaviors.
Use the purpose specific kcalloc() function instead of the argument count *
size in the kzalloc() function.
[1] https://www.kernel.org/doc/html/v5.14/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
Link: https://lore.kernel.org/r/20210905062448.6587-1-len.baker@gmx.com
Reviewed-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Len Baker <len.baker@gmx.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-09-14 23:33:22 -04:00
James Smart
450907424d
scsi: elx: efct: Do not hold lock while calling fc_vport_terminate()
...
Smatch checker reported the following error:
drivers/base/power/sysfs.c:833 dpm_sysfs_remove()
warn: sleeping in atomic context
With a calling sequence of:
efct_lio_npiv_drop_nport() <- disables preempt
-> fc_vport_terminate()
-> device_del()
-> dpm_sysfs_remove()
Issue is efct_lio_npiv_drop_nport() is making the fc_vport_terminate() call
while holding a lock w/ ipl raised.
It is unnecessary to hold the lock over this call, shift where the lock is
taken.
Link: https://lore.kernel.org/r/20210907165225.10821-1-jsmart2021@gmail.com
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-09-13 22:15:46 -04:00
James Smart
96fafe7c65
scsi: elx: efct: Fix void-pointer-to-enum-cast warning for efc_nport_topology
...
The kernel test robot flagged an warning for ".../efc_device.c:932:6:
warning: cast to smaller integer type 'enum efc_nport_topology' from 'void
*'"
For the topology events, the "arg" field is generically defined as a void *
and is used to pass different arguments. Most of the arguments are pointers
to data structures. But for the EFC_EVT_NPORT_TOPOLOGY_NOTIFY event, the
argument is an enum value, and the code is typecasting the void * to an
enum generating the warning.
Fix by converting the EFC_EVT_NPORT_TOPOLOGY_NOTIFY event to pass a pointer
to the enum, thus it's a straight-forward pointer dereference in the event
handler.
Link: https://lore.kernel.org/r/20210830231050.5951-1-jsmart2021@gmail.com
Fixes: 202bfdffae ("scsi: elx: libefc: FC node ELS and state handling")
Reported-by: kernel test robot <lkp@intel.com >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-09-13 22:15:40 -04:00
Linus Torvalds
b250e6d141
Merge tag 'kbuild-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
...
Pull Kbuild updates from Masahiro Yamada:
- Add -s option (strict mode) to merge_config.sh to make it fail when
any symbol is redefined.
- Show a warning if a different compiler is used for building external
modules.
- Infer --target from ARCH for CC=clang to let you cross-compile the
kernel without CROSS_COMPILE.
- Make the integrated assembler default (LLVM_IAS=1) for CC=clang.
- Add <linux/stdarg.h> to the kernel source instead of borrowing
<stdarg.h> from the compiler.
- Add Nick Desaulniers as a Kbuild reviewer.
- Drop stale cc-option tests.
- Fix the combination of CONFIG_TRIM_UNUSED_KSYMS and CONFIG_LTO_CLANG
to handle symbols in inline assembly.
- Show a warning if 'FORCE' is missing for if_changed rules.
- Various cleanups
* tag 'kbuild-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (39 commits)
kbuild: redo fake deps at include/ksym/*.h
kbuild: clean up objtool_args slightly
modpost: get the *.mod file path more simply
checkkconfigsymbols.py: Fix the '--ignore' option
kbuild: merge vmlinux_link() between ARCH=um and other architectures
kbuild: do not remove 'linux' link in scripts/link-vmlinux.sh
kbuild: merge vmlinux_link() between the ordinary link and Clang LTO
kbuild: remove stale *.symversions
kbuild: remove unused quiet_cmd_update_lto_symversions
gen_compile_commands: extract compiler command from a series of commands
x86: remove cc-option-yn test for -mtune=
arc: replace cc-option-yn uses with cc-option
s390: replace cc-option-yn uses with cc-option
ia64: move core-y in arch/ia64/Makefile to arch/ia64/Kbuild
sparc: move the install rule to arch/sparc/Makefile
security: remove unneeded subdir-$(CONFIG_...)
kbuild: sh: remove unused install script
kbuild: Fix 'no symbols' warning when CONFIG_TRIM_UNUSD_KSYMS=y
kbuild: Switch to 'f' variants of integrated assembler flag
kbuild: Shuffle blank line to improve comment meaning
...
2021-09-03 15:33:47 -07:00
Alexey Dobriyan
39f75da7bc
isystem: trim/fixup stdarg.h and other headers
...
Delete/fixup few includes in anticipation of global -isystem compile
option removal.
Note: crypto/aegis128-neon-inner.c keeps <stddef.h> due to redefinition
of uintptr_t error (one definition comes from <stddef.h>, another from
<linux/types.h>).
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com >
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org >
2021-08-19 09:02:55 +09:00
Colin Ian King
e71dd41ea0
scsi: elx: efct: Remove redundant initialization of variable 'ret'
...
The variable 'ret' is being initialized with a value that is never read, it
is being updated later on. The assignment is redundant and can be removed.
Link: https://lore.kernel.org/r/20210804132451.113086-1-colin.king@canonical.com
Signed-off-by: Colin Ian King <colin.king@canonical.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
Addresses-Coverity: ("Unused value")
2021-08-09 23:41:19 -04:00
James Smart
f7c95d7460
scsi: elx: efct: Fix vport list linkage in LIO backend
...
vport is linked onto the driver's vport list at allocation, but failure
path fails to remove it from the list.
Change location of linkage until after complete vport completion.
Link: https://lore.kernel.org/r/20210619155729.20049-1-jsmart2021@gmail.com
Fixes: 692e5d73a8 ("scsi: elx: efct: LIO backend interface routines")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <james.smart@broadcom.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-22 21:11:37 -04:00
James Smart
f6060eb134
scsi: elx: libefc_sli: Fix ANDing with zero bit value
...
Flags value is being set to a constant and ANDed with 0 which always
results in 0.
Remove the assignment line.
Link: https://lore.kernel.org/r/20210619155641.19942-1-jsmart2021@gmail.com
Fixes: 1628f5b497 ("scsi: elx: libefc_sli: Populate and post different WQEs")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <james.smart@broadcom.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-22 21:07:30 -04:00
Dan Carpenter
7cca85dff2
scsi: elx: libefc: Fix IRQ restore in efc_domain_dispatch_frame()
...
Calling a nested spin_lock_irqsave() will overwrite the original "flags" so
that they can not be enabled again at the end.
Link: https://lore.kernel.org/r/YMyjH16k4M1yEmmU@mwanda
Fixes: 3146240f19 ("scsi: elx: libefc: FC Domain state machine interfaces")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-18 23:01:04 -04:00
Colin Ian King
99cf922692
scsi: elx: libefc: Fix less than zero comparison of a unsigned int
...
The comparison of the u32 variable rc to less than zero always false
because it is unsigned. Fix this by making it an int.
Link: https://lore.kernel.org/r/20210616170401.15831-1-colin.king@canonical.com
Fixes: 202bfdffae ("scsi: elx: libefc: FC node ELS and state handling")
Signed-off-by: Colin Ian King <colin.king@canonical.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
Addresses-Coverity: ("Unsigned compared against 0")
2021-06-18 23:01:04 -04:00
James Smart
ae3272ec5e
scsi: elx: efct: Fix pointer error checking in debugfs init
...
debugfs_create_xxx routines, which return pointers, are being checked for
error by looking for NULL values. The routines may return pointer-munged
-Exxx codes, so they should be using IS_ERR() to adapt.
There are two cases:
- The first case is on initial directory creation, which actually doesn't
need to be checked. So remove the check.
- Creation of the sessions subdirectory. Modify this creation to create
under the initial directory created, and fix failure check.
Link: https://lore.kernel.org/r/20210618233004.83769-1-jsmart2021@gmail.com
Fixes: 4df84e8466 ("scsi: elx: efct: Driver initialization routines")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-18 23:01:04 -04:00
James Smart
ca7f33c6b4
scsi: elx: efct: Fix is_originator return code type
...
efct_hw_iotype_is_originator() is returning a negative (-EIO) status which
doesn't make sense for a u8 function type.
Reviewing the code, the function only needs to return true/false, thus a
bool status is most appropriate.
Change the function return type and patch up the one callee as the bool
inverses the if check.
Link: https://lore.kernel.org/r/20210618231524.83179-1-jsmart2021@gmail.com
Fixes: 4df84e8466 ("scsi: elx: efct: Driver initialization routines")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-18 23:01:04 -04:00
James Smart
d66a65b7f5
scsi: elx: efct: Fix link error for _bad_cmpxchg
...
cmpxchg is being used on a bool type, which is requiring architecture
support that isn't compatible with a bool.
Convert variable abort_in_progress from bool to int.
Link: https://lore.kernel.org/r/20210618174050.80302-1-jsmart2021@gmail.com
Fixes: ebc076b3ed ("scsi: elx: efct: Tie into kernel Kconfig and build process")
Reported-by: kernel test robot <lkp@intel.com >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-18 23:01:04 -04:00
Nathan Chancellor
0d7be7a8a0
scsi: elx: efct: Eliminate unnecessary boolean check in efct_hw_command_cancel()
...
clang warns:
drivers/scsi/elx/efct/efct_hw.c:1523:17: warning: address of array
'ctx->buf' will always evaluate to 'true' [-Wpointer-bool-conversion]
(!ctx->buf ? U32_MAX : *((u32 *)ctx->buf)));
~~~~~~^~~
buf is an array in the middle of a struct so deferencing it is not a
problem as long as ctx is not NULL. Eliminate the check, which fixes the
warning.
Link: https://github.com/ClangBuiltLinux/linux/issues/1398
Link: https://lore.kernel.org/r/20210617063123.21239-1-nathan@kernel.org
Fixes: 580c0255e4 ("scsi: elx: efct: RQ buffer, memory pool allocation and deallocation APIs")
Reviewed-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Nathan Chancellor <nathan@kernel.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-18 23:01:04 -04:00
Nathan Chancellor
a255036178
scsi: elx: efct: Do not use id uninitialized in efct_lio_setup_session()
...
clang warns:
drivers/scsi/elx/efct/efct_lio.c:1216:24: warning: variable 'id' is
uninitialized when used here [-Wuninitialized]
se_sess, node, id);
^~
Shuffle the debug print after id's initialization so that the actual value
is printed.
Link: https://github.com/ClangBuiltLinux/linux/issues/1397
Link: https://lore.kernel.org/r/20210617061721.2405511-1-nathan@kernel.org
Fixes: 692e5d73a8 ("scsi: elx: efct: LIO backend interface routines")
Reviewed-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Nathan Chancellor <nathan@kernel.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-18 23:01:04 -04:00
Wei Yongjun
41962aba2d
scsi: elx: efct: Fix error handling in efct_hw_init()
...
Fix to return negative error code -ENOMEM from the error handling case
instead of 0. Also fix typo in error message.
Link: https://lore.kernel.org/r/20210617024837.1023069-1-weiyongjun1@huawei.com
Fixes: 4df84e8466 ("scsi: elx: efct: Driver initialization routines")
Reported-by: Hulk Robot <hulkci@huawei.com >
Reviewed-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-18 23:01:03 -04:00
Colin Ian King
61bf3fdb5d
scsi: elx: efct: Remove redundant initialization of variable lun
...
The variable "lun" is being initialized with a value that is never read, it
is being updated later on. The assignment is redundant and can be removed.
Link: https://lore.kernel.org/r/20210616171621.16176-1-colin.king@canonical.com
Reviewed-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Colin Ian King <colin.king@canonical.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
Addresses-Coverity: ("Unused value")
2021-06-18 23:01:03 -04:00
Colin Ian King
5911429343
scsi: elx: efct: Fix spelling mistake "Unexected" -> "Unexpected"
...
There is a spelling mistake in a efc_log_info message. Fix it.
Link: https://lore.kernel.org/r/20210616142637.12706-1-colin.king@canonical.com
Signed-off-by: Colin Ian King <colin.king@canonical.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-18 23:01:03 -04:00
James Smart
6f84c11ecc
scsi: elx: efct: Add Makefile and Kconfig for efct driver
...
Add efct driver Kconfig and Makefiles.
Link: https://lore.kernel.org/r/20210601235512.20104-31-jsmart2021@gmail.com
Reviewed-by: Hannes Reinecke <hare@suse.de >
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:33 -04:00
James Smart
32ddbad5b6
scsi: elx: efct: Transport class host interface support
...
Integration with the scsi_fc_transport host interfaces.
Link: https://lore.kernel.org/r/20210601235512.20104-30-jsmart2021@gmail.com
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Reviewed-by: Hannes Reinecke <hare@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:32 -04:00
James Smart
ab332fcbcd
scsi: elx: efct: Transport and hardware teardown routines
...
Implement routines to detach transport and hardware objects.
Link: https://lore.kernel.org/r/20210601235512.20104-29-jsmart2021@gmail.com
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Reviewed-by: Hannes Reinecke <hare@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:32 -04:00
James Smart
6ae7147bfe
scsi: elx: efct: Link and host statistics
...
Add routines to retrieve link stats and host stats, add firmware update
helper routines.
Link: https://lore.kernel.org/r/20210601235512.20104-28-jsmart2021@gmail.com
Reviewed-by: Hannes Reinecke <hare@suse.de >
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:32 -04:00
James Smart
dd53d333aa
scsi: elx: efct: Hardware I/O submission routines
...
Routines that write I/O to work queue, send SRRs and raw frames.
Link: https://lore.kernel.org/r/20210601235512.20104-27-jsmart2021@gmail.com
Reviewed-by: Hannes Reinecke <hare@suse.de >
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:32 -04:00
James Smart
692e5d73a8
scsi: elx: efct: LIO backend interface routines
...
Add LIO backend template registration and template functions.
Link: https://lore.kernel.org/r/20210601235512.20104-26-jsmart2021@gmail.com
Reviewed-by: Hannes Reinecke <hare@suse.de >
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:32 -04:00
James Smart
3e6414003b
scsi: elx: efct: SCSI I/O handling routines
...
Routines for SCSI transport IO alloc, build and send I/O.
Link: https://lore.kernel.org/r/20210601235512.20104-25-jsmart2021@gmail.com
Reviewed-by: Hannes Reinecke <hare@suse.de >
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:32 -04:00
James Smart
f45ae6aac0
scsi: elx: efct: Unsolicited FC frame processing routines
...
Add routines to handle unsolicited FC frames.
Link: https://lore.kernel.org/r/20210601235512.20104-24-jsmart2021@gmail.com
Reviewed-by: Hannes Reinecke <hare@suse.de >
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:32 -04:00
James Smart
e2cf422ba8
scsi: elx: efct: Hardware queues processing
...
Add driver definitions for:
- Routines for EQ, CQ, WQ and RQ processing.
- Routines for I/O object pool allocation and deallocation.
Link: https://lore.kernel.org/r/20210601235512.20104-23-jsmart2021@gmail.com
Reviewed-by: Hannes Reinecke <hare@suse.de >
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:31 -04:00
James Smart
63de51327a
scsi: elx: efct: Hardware I/O and SGL initialization
...
Add driver definitions for:
- Routines to create I/O interfaces (wqs, etc), SGL initialization, and
configure hardware features.
Link: https://lore.kernel.org/r/20210601235512.20104-22-jsmart2021@gmail.com
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:31 -04:00
James Smart
580c0255e4
scsi: elx: efct: RQ buffer, memory pool allocation and deallocation APIs
...
Add driver definitions for:
- RQ data buffer allocation and deallocate.
- Memory pool allocation and deallocation APIs.
- Mailbox command submission and completion routines.
Link: https://lore.kernel.org/r/20210601235512.20104-21-jsmart2021@gmail.com
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Reviewed-by: Hannes Reinecke <hare@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:31 -04:00
James Smart
e10fc23359
scsi: elx: efct: Hardware queue creation and deletion
...
Add routines for queue creation, deletion, and configuration.
Link: https://lore.kernel.org/r/20210601235512.20104-20-jsmart2021@gmail.com
Reviewed-by: Hannes Reinecke <hare@suse.de >
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:31 -04:00
James Smart
4df84e8466
scsi: elx: efct: Driver initialization routines
...
Add driver definitions for:
- Emulex FC Target driver init, attach and hardware setup routines.
Link: https://lore.kernel.org/r/20210601235512.20104-19-jsmart2021@gmail.com
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Reviewed-by: Hannes Reinecke <hare@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:31 -04:00
James Smart
75a10a7a91
scsi: elx: efct: Data structures and defines for hw operations
...
Start the population of the efct target mode driver. The driver is
contained in the drivers/scsi/elx/efct subdirectory.
Create the efct directory and start population of the driver by adding
SLI-4 configuration parameters, data structures for configuring SLI-4
queues, converting from OS to SLI-4 IO requests, and handling async events.
Link: https://lore.kernel.org/r/20210601235512.20104-18-jsmart2021@gmail.com
Reviewed-by: Hannes Reinecke <hare@suse.de >
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:31 -04:00
James Smart
cdaf39bad5
scsi: elx: libefc: Register discovery objects with hardware
...
Add library interface definitions for:
- Registrations for VFI, VPI and RPI.
Link: https://lore.kernel.org/r/20210601235512.20104-17-jsmart2021@gmail.com
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Reviewed-by: Hannes Reinecke <hare@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:30 -04:00
James Smart
8f406ef728
scsi: elx: libefc: Extended link Service I/O handling
...
Add library interface definitions for:
- Functions to build and send ELS/CT/BLS commands and responses.
Link: https://lore.kernel.org/r/20210601235512.20104-16-jsmart2021@gmail.com
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Reviewed-by: Hannes Reinecke <hare@suse.de >
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com >
Signed-off-by: James Smart <jsmart2021@gmail.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2021-06-15 23:39:30 -04:00