[PATCH] [RFC] scsi: Convert from tasklet to BH workqueue
Allen Pais
apais at linux.microsoft.com
Sat May 4 01:32:54 AEST 2024
> On May 2, 2024, at 7:03 PM, Michael Ellerman <mpe at ellerman.id.au> wrote:
>
> Allen Pais <apais at linux.microsoft.com> writes:
>> The only generic interface to execute asynchronously in the BH context is
>> tasklet; however, it's marked deprecated and has some design flaws. To
>> replace tasklets, BH workqueue support was recently added. A BH workqueue
>> behaves similarly to regular workqueues except that the queued work items
>> are executed in the BH context.
>>
>> This patch converts drivers/scsi/* from tasklet to BH workqueue.
>>
>> Based on the work done by Tejun Heo <tj at kernel.org>
>> Branch: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-6.10
>>
>> Signed-off-by: Allen Pais <allen.lkml at gmail.com>
>> ---
>> drivers/scsi/aic7xxx/aic7xxx_osm.c | 2 +-
>> drivers/scsi/aic94xx/aic94xx_hwi.c | 14 ++--
>> drivers/scsi/aic94xx/aic94xx_hwi.h | 5 +-
>> drivers/scsi/aic94xx/aic94xx_scb.c | 36 +++++-----
>> drivers/scsi/aic94xx/aic94xx_task.c | 14 ++--
>> drivers/scsi/aic94xx/aic94xx_tmf.c | 34 ++++-----
>> drivers/scsi/esas2r/esas2r.h | 12 ++--
>> drivers/scsi/esas2r/esas2r_init.c | 14 ++--
>> drivers/scsi/esas2r/esas2r_int.c | 18 ++---
>> drivers/scsi/esas2r/esas2r_io.c | 2 +-
>> drivers/scsi/esas2r/esas2r_main.c | 16 ++---
>> drivers/scsi/ibmvscsi/ibmvfc.c | 16 ++---
>> drivers/scsi/ibmvscsi/ibmvfc.h | 3 +-
>> drivers/scsi/ibmvscsi/ibmvscsi.c | 16 ++---
>> drivers/scsi/ibmvscsi/ibmvscsi.h | 3 +-
>> drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 15 ++--
>> drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | 3 +-
>
> Something there is giving me a build failure (ppc64le_guest_defconfig):
>
> + make -s 'CC=ccache powerpc64le-linux-gnu-gcc' -j 4
> /linux/drivers/scsi/ibmvscsi/ibmvscsi.c: In function 'ibmvscsi_init_crq_queue':
> Error: /linux/drivers/scsi/ibmvscsi/ibmvscsi.c:370:331: error: 'ibmvscsi_work' undeclared (first use in this function)
> /linux/drivers/scsi/ibmvscsi/ibmvscsi.c:370:331: note: each undeclared identifier is reported only once for each function it appears in
> /linux/scripts/Makefile.build:244: recipe for target 'drivers/scsi/ibmvscsi/ibmvscsi.o' failed
> /linux/scripts/Makefile.build:485: recipe for target 'drivers/scsi/ibmvscsi' failed
> /linux/scripts/Makefile.build:485: recipe for target 'drivers/scsi' failed
> /linux/scripts/Makefile.build:485: recipe for target 'drivers' failed
> /linux/drivers/scsi/ibmvscsi/ibmvscsi.c: In function 'ibmvscsi_probe':
> Error: /linux/drivers/scsi/ibmvscsi/ibmvscsi.c:2255:78: error: passing argument 1 of 'kthread_create_on_node' from incompatible pointer type [-Werror=incompatible-pointer-types]
> In file included from /linux/drivers/scsi/ibmvscsi/ibmvscsi.c:56:0:
> /linux/include/linux/kthread.h:11:21: note: expected 'int (*)(void *)' but argument is of type 'int (*)(struct work_struct *)'
> struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
> ^
> /linux/drivers/scsi/ibmvscsi/ibmvscsi.c: At top level:
> Warning: /linux/drivers/scsi/ibmvscsi/ibmvscsi.c:212:13: warning: 'ibmvscsi_task' defined but not used [-Wunused-function]
> static void ibmvscsi_task(void *data)
> ^
> Warning: cc1: warning: unrecognized command line option '-Wno-shift-negative-value'
> Warning: cc1: warning: unrecognized command line option '-Wno-stringop-overflow'
> cc1: some warnings being treated as errors
> make[6]: *** [drivers/scsi/ibmvscsi/ibmvscsi.o] Error 1
> make[5]: *** [drivers/scsi/ibmvscsi] Error 2
> make[4]: *** [drivers/scsi] Error 2
> make[3]: *** [drivers] Error 2
> make[3]: *** Waiting for unfinished jobs....
>
> Full log here: https://github.com/linuxppc/linux-snowpatch/actions/runs/8930174372/job/24529645923
Thank you for testing it out. Unfortunately, I did not cross-compile it.
Will fix this in v2.
- Allen
>
> Cross compile instructions if you're keen: https://github.com/linuxppc/wiki/wiki/Building-powerpc-kernels
>
> cheers
More information about the Linuxppc-dev
mailing list