qla2xxx: Add qla2x00_async_done routine for async routines.
Subsystems (2)
Nilesh Javali
maintainerPATCH 1/1 qla2xxx: Add qla2x00_async_done routine for async routines.
From: Saurav Kashyap <[email protected]>
This done routine will delete the timer and check for it's return value and accordingly decrease the reference count.
--- drivers/scsi/qla2xxx/qla_iocb.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_iocb.c +16 -1
@@ -2560,6 +2560,20 @@ qla24xx_tm_iocb(srb_t *sp, struct tsk_mgmt_entry *tsk) } } +static void +qla2x00_async_done (struct srb *sp,int res) +{ +if (del_timer (&sp->u.iocb_cmd.timer)) { +/* +* Successfully cancelled the timeout handler +* ref: TMR +*/ +if (kref_put (&sp->cmd_kref, qla2x00_sp_release)) +return ; + } + sp->async_done (sp, res); +} +void qla2x00_sp_release (struct kref *kref) {
@@ -2573,7 +2587,8 @@ qla2x00_init_async_sp(srb_t *sp, unsigned long tmo, void (*done)(struct srb *sp, int res)) {timer_setup (&sp->u.iocb_cmd.timer, qla2x00_sp_timeout,0 ); - sp->done = done; + sp->done = qla2x00_async_done; + sp->async_done = done; sp->free = qla2x00_sp_free; sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; sp->u.iocb_cmd.timer.expires = jiffies + tmo *HZ ;
Signature · 1 line
2.23.1
Quoted 12 lines · Nilesh Javali
From: Saurav Kashyap <[email protected]>
This done routine will delete the timer and check for it's return value and accordingly decrease the reference count.
Fixes 31e6cdbe0eae ("scsi: qla2xxx: Implement ref count for SRB")Signed-off-by Saurav Kashyap <[email protected]>Signed-off-by Nilesh Javali <[email protected]>
FYI… You should add
Quoted 42 lines
---
drivers/scsi/qla2xxx/qla_iocb.c| 17 ++++++++++++++++-1 file changed, 16 insertions(+), 1 deletion(-)drivers/scsi/qla2xxx/qla_iocb.c +14
-0@@ -2560,6 +2560,20 @@ qla24xx_tm_iocb(srb_t *sp, struct tsk_mgmt_entry *tsk) } } +static void +qla2x00_async_done (struct srb *sp,int res) +{ +if (del_timer (&sp->u.iocb_cmd.timer)) { +/* +* Successfully cancelled the timeout handler +* ref: TMR +*/ +if (kref_put (&sp->cmd_kref, qla2x00_sp_release)) +return ; + } + sp->async_done (sp, res); +} +void
qla2x00_sp_release(struct kref *kref)
{drivers/scsi/qla2xxx/qla_iocb.c +2
-1@@ -2573,7 +2587,8 @@ qla2x00_init_async_sp(srb_t *sp, unsigned long tmo, void (*done)(struct srb *sp, int res)) {timer_setup (&sp->u.iocb_cmd.timer, qla2x00_sp_timeout,0 ); - sp->done = done; + sp->done = qla2x00_async_done; + sp->async_done = done; sp->free = qla2x00_sp_free; sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; sp->u.iocb_cmd.timer.expires = jiffies + tmo *HZ ;Signature · 1 line
2.23.1
Looks Good.
--
Himanshu Madhani Oracle Linux Engineering
Thanks, that appears to have resolved the crash on boot I was seeing.
Quoted 51 lines · Nilesh Javali
From: Saurav Kashyap <[email protected]>
This done routine will delete the timer and check for it's return value and accordingly decrease the reference count.
Fixes 31e6cdbe0eae ("scsi: qla2xxx: Implement ref count for SRB")Signed-off-by Saurav Kashyap <[email protected]>Signed-off-by Nilesh Javali <[email protected]>--- drivers/scsi/qla2xxx/qla_iocb.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)drivers/scsi/qla2xxx/qla_iocb.c +16
-2@@ -2560,6 +2560,20 @@ qla24xx_tm_iocb(srb_t *sp, struct tsk_mgmt_entry *tsk) } } +static void +qla2x00_async_done (struct srb *sp,int res) +{ +if (del_timer (&sp->u.iocb_cmd.timer)) { +/* +* Successfully cancelled the timeout handler +* ref: TMR +*/ +if (kref_put (&sp->cmd_kref, qla2x00_sp_release)) +return ; + } + sp->async_done (sp, res); +} +void qla2x00_sp_release (struct kref *kref) {@@ -2573,7 +2587,8 @@ qla2x00_init_async_sp(srb_t *sp, unsigned long tmo, void (*done)(struct srb *sp, int res)) {timer_setup (&sp->u.iocb_cmd.timer, qla2x00_sp_timeout,0 ); - sp->done = done; + sp->done = qla2x00_async_done; + sp->async_done = done; sp->free = qla2x00_sp_free; sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; sp->u.iocb_cmd.timer.expires = jiffies + tmo *HZ ; --2.23.1
Hi Ewan,
Thanks a lot for an update.
Hi Martin,
Can this be merged to original patch?
Thanks,
~Saurav
Quoted 68 lines
-----Original Message-----
From: Ewan Milne <[email protected]>
Sent: Thursday, February 10, 2022 1:39 AM
To: Nilesh Javali <[email protected]>
Cc: Martin K. Petersen <[email protected]>; linux- [email protected]; GR-QLogic-Storage-Upstream <GR-QLogic-Storage- [email protected]>
Subject: Re: [PATCH] qla2xxx: Addqla2x00_async_doneroutine for async routines.Thanks, that appears to have resolved the crash on boot I was seeing.
Tested-by Ewan D. Milne <[email protected]>drivers/scsi/qla2xxx/qla_iocb.c qla24xx_tm_iocb(srb_t *sp, struct
Quoted 18 lines · Nilesh Javali
From: Saurav Kashyap <[email protected]>
This done routine will delete the timer and check for it's return value and accordingly decrease the reference count.
Fixes 31e6cdbe0eae ("scsi: qla2xxx: Implement ref count for SRB")Signed-off-by Saurav Kashyap <[email protected]>Signed-off-by Nilesh Javali <[email protected]>--- drivers/scsi/qla2xxx/qla_iocb.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)drivers/scsi/qla2xxx/qla_iocb.c +0
-0@@ -2560,6 +2560,20 @@ qla24xx_tm_iocb(srb_t *sp, struct
tsk_mgmt_entry*tsk)drivers/scsi/qla2xxx/qla_iocb.c qla2x00_init_async_sp(srb_t *sp, unsigned long
Quoted 21 lines
drivers/scsi/qla2xxx/qla_iocb.c +14
-0} } +static void +qla2x00_async_done (struct srb *sp,int res) +{ +if (del_timer (&sp->u.iocb_cmd.timer)) { +/* +* Successfully cancelled the timeout handler +* ref: TMR +*/ +if (kref_put (&sp->cmd_kref, qla2x00_sp_release)) +return ; + } + sp->async_done (sp, res); +} +void qla2x00_sp_release (struct kref *kref) {@@ -2573,7 +2587,8 @@ qla2x00_init_async_sp(srb_t *sp, unsigned longtmo,
Quoted 12 lines
drivers/scsi/qla2xxx/qla_iocb.c +2
-2void (*done)(struct srb *sp, int res)) {timer_setup (&sp->u.iocb_cmd.timer, qla2x00_sp_timeout,0 ); - sp->done = done; + sp->done = qla2x00_async_done; + sp->async_done = done; sp->free = qla2x00_sp_free; sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; sp->u.iocb_cmd.timer.expires = jiffies + tmo *HZ ; --2.23.1
Martin K. Petersen
AppliedNilesh,
Quoted 2 lines
This done routine will delete the timer and check for it's return value and accordingly decrease the reference count.
Applied to 5.18/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 6 lines · Nilesh Javali
From: Saurav Kashyap <[email protected]>
This done routine will delete the timer and check for it's return value and accordingly decrease the reference count.
Applied to 5.18/scsi-queue, thanks!
[1/1] qla2xxx: Add qla2x00_async_done routine for async routines.
https://git.kernel.org/mkp/scsi/c/49b729f58e7a
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering