Hi, On Thu, May 9, 2019 at 3:50 AM Giridhar Malavali <gmalavali@xxxxxxxxxxx> wrote: > > > > On 5/8/19, 1:42 PM, "linux-scsi-owner@xxxxxxxxxxxxxxx on behalf of Shivaram Upadhyayula" <linux-scsi-owner@xxxxxxxxxxxxxxx on behalf of shivaram.u@xxxxxxxxxxxx> wrote: > > Hi, > > There seem to be a few issues when trying to do a logout > qla_target.c:qlt_free_session_done in 4.19.41 > > 1. When the logout timesout qla2x00_sp_timeout is called. This > function assumes sp->qpair is valid, but this isn't the case if mq is > not enabled With the upstream driver a sp->qpair is always valid, so the crash is only specific to the 4.19.x driver > > 2. qla2x00_async_iocb_timeout also assumes that sp->qpair is valid. > Also only if qla24xx_async_abort_cmd() fails is sp->done() called, > sp->done in this case is qlt_logo_completion_handler() which will > never be called if qla24xx_async_abort_cmd() succeeds This is a problem with the upstream driver too. I haven't tried to build this driver so my comments are based on my experience with 4.19.41. In qla2x00_async_iocb_timeout, lets take the case of SRB_LOGOUT_CMD switch (sp->type) { .. case SRB_LOGOUT_CMD: <...> rc = qla24xx_async_abort_cmd(sp, false); if (rc) { .... sp->done(sp, QLA_FUNCTION_TIMEOUT); } sp->done() is called only if qla24xx_async_abort_cmd() fails (rc != 0). The same for case SRB_LOGIN_CMD. Regards, Shivaram > 3. qla24xx_async_abort_cmd() can lead to "scheduling while atomic" if > called from qla2x00_async_iocb_timeout. The wait parameter can be used > to alloc with GFP_ATOMIC > > Please see diff https://www.quadstor.com/patches/srb-logout.diff > generated against 4.9.41 > > >> We have addressed issues related to above in our latest upstream driver. Can you check and let us know whether you still see the above issues. > > -- Giri > > Regards, > Shivaram > > -- > Virtual Tape Library https://www.quadstor.com/virtual-tape-library.html > Storage Virtualization with VAAI > https://www.quadstor.com/storage-virtualization.html > > -- Virtual Tape Library https://www.quadstor.com/virtual-tape-library.html Storage Virtualization with VAAI https://www.quadstor.com/storage-virtualization.html