[Bug 220095][PATCH] dpt_scsi: Fix a possible sleep-under-mutex bug in dpt_init
Jia-Ju Bai
baijiaju1990 at 163.com
Sun Jun 18 11:33:57 UTC 2017
Hi,
Thanks for reply. I think you are right after I read the manual page.
I am sorry for my wrong report.
Thanks,
Jia-Ju Bai
On 2017/6/18 18:04, N.J. Mann wrote:
> Hi,
>
>
> On Sunday, June 18, 2017 17:46:01 +0800 Jia-Ju Bai <baijiaju1990 at 163.com> wrote:
>> The driver may sleep under a mutex, and the function call path is:
>> dpt_init [acquire the mutex]
>> dptallocsgmap
>> bus_dmamap_load(BUS_DMA_WAITOK) --> may sleep
>>
>> The possible fix of this bug is to set the last parameter in
>> bus_dmamap_load to "BUS_DMA_NOWAIT".
> Have you read the manual page for bus_dmamap_load() ?
>
> bus_dmamap_load(dmat, map, buf, buflen, *callback, callback_arg, flags)
> Creates a mapping in device visible address space of buflen bytes
> of buf, associated with the DMA map map. This call will always
> return immediately and will not block for any reason.
>
> I am not saying that your change should not be made, just that your analysis
> may be wrong.
>
>
> Cheers,
> Nick.
More information about the freebsd-drivers
mailing list