Date: Sun, 18 Jun 2017 19:33:56 +0800 From: Jia-Ju Bai <baijiaju1990@163.com> To: "N.J. Mann" <njm@njm.me.uk> Cc: freebsd-drivers@freebsd.org Subject: Re: [Bug 220095][PATCH] dpt_scsi: Fix a possible sleep-under-mutex bug in dpt_init Message-ID: <2481c6e4-d748-8b6b-3ebe-cdcf256f78ef@163.com> In-Reply-To: <7D8CD40C6A8CDF922B1E15A8@triton.njm.me.uk> References: <20170618094601.40636-1-baijiaju1990@163.com> <7D8CD40C6A8CDF922B1E15A8@triton.njm.me.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
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@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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2481c6e4-d748-8b6b-3ebe-cdcf256f78ef>