qlt_free_session_done() tries to post async PRLO / LOGO, and waits for the
completion of these async commands. If UNLOADING is set, this is doomed to
timeout, because the async logout command will never complete.
The only way to avoid waiting pointlessly is to fail posting these commands
in the first place if the driver is in UNLOADING state. In general,
posting any command should be avoided when the driver is UNLOADING.
With this patch, "rmmod qla2xxx" completes without noticeable delay.
Link: https://lore.kernel.org/r/20200421204621.19228-3-mwilck@suse.com
Fixes: 45235022da99 ("scsi: qla2xxx: Fix driver unload by shutting down chip")
Acked-by: Arun Easi <aeasi@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 5a263892d7d0b4fe351363f8d1a14c6a75955475 upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9019 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The purpose of the UNLOADING flag is to avoid port login procedures to
continue when a controller is in the process of shutting down. It makes
sense to set this flag before starting session teardown.
Furthermore, use atomic test_and_set_bit() to avoid the shutdown being run
multiple times in parallel. In qla2x00_disable_board_on_pci_error(), the
test for UNLOADING is postponed until after the check for an already
disabled PCI board.
Link: https://lore.kernel.org/r/20200421204621.19228-2-mwilck@suse.com
Fixes: 45235022da99 ("scsi: qla2xxx: Fix driver unload by shutting down chip")
Reviewed-by: Arun Easi <aeasi@marvell.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 856e152a3c08bf7987cbd41900741d83d9cddc8e upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9018 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Fix the following compiler warnings:
drivers/scsi/qla2xxx/qla_dbg.c:2542:7: warning: The scope of the variable 'pbuf' can be reduced. [variableScope]
drivers/scsi/qla2xxx/qla_init.c:3615:6: warning: Variable 'rc' is assigned a value that is never used. [unreadVariable]
drivers/scsi/qla2xxx/qla_isr.c:81:11-29: WARNING: dma_alloc_coherent use in rsp_els already zeroes out memory, so memset is not needed
drivers/scsi/qla2xxx/qla_mbx.c:4889:15-33: WARNING: dma_alloc_coherent use in els_cmd_map already zeroes out memory, so memset is not needed
[mkp: added newline after variable declaration]
Link: https://lore.kernel.org/r/20200403084018.30766-2-njavali@marvell.com
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit bb46737ec09e9a072424bf46def2977c5b6b925d upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9017 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Simplify the scst_local driver by always using thread context for passing
commands to SCST.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9005 d57e44dd-8a1f-0410-8b47-8ef2f437770f
$(KBUILD_EXTRA_SYMBOLS) is not only used at compile time but also at link
time. Move the $(KBUILD_EXTRA_SYMBOLS) definitions such that it is
available both at compile time and at link time.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9000 d57e44dd-8a1f-0410-8b47-8ef2f437770f
While $(src) is always defined, $(KBUILD_EXTMOD) is only defined when
building code as an external module.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8999 d57e44dd-8a1f-0410-8b47-8ef2f437770f
User space code must not use PAGE_SIZE but must use sysconf(_SC_PAGESIZE)
instead to obtain the page size.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8997 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Annotate members of FC protocol and firmware dump data structures as big
endian. Annotate members of RISC control structures as little endian.
Annotate mailbox registers as little endian. Annotate the mb[] arrays as
CPU-endian because communication of the mb[] values with the hardware
happens through the readw() and writew() functions. readw() converts from
__le16 to u16 and writew() converts from u16 to __le16. Annotate 'handles'
as CPU-endian because for the firmware these are opaque values.
[ commit 21038b0900d1b8728ec77d9286d7b0b57ca7b585 upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8973 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Casting a pointer to void * and relying on an implicit cast from void *
to uint16_t or uint32_t suppresses sparse warnings about endianness. Hence
cast explicitly to uint16_t and uint32_t. Additionally, remove superfluous
void * casts.
[ commit ab053c09ee2066a2fe62a755f1e64dbc8eddc17c upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8971 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This was suggested by Daniel Wagner.
[ commit 04474d3a1c968119e7214c312b273dee01258cad upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8970 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Make the MMIO accessors strongly typed such that the compiler checks
whether the accessor function is used that matches the register width. Fix
those MMIO accesses where another number of bits was read or written than
the size of the register.
[ commit 37139da1b097e06841d40a6055db64c78755aea9 upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8968 d57e44dd-8a1f-0410-8b47-8ef2f437770f