Date: Fri, 23 May 2014 10:41:45 -0600 From: Warner Losh <imp@bsdimp.com> To: John Baldwin <jhb@freebsd.org> Cc: Hans Petter Selasky <hps@selasky.org>, freebsd-current <freebsd-current@freebsd.org>, Warner Losh <imp@freebsd.org> Subject: Re: panic: resource_list_add: resource entry is busy Message-ID: <31818D06-0553-48B7-921A-B6770F8B8D35@bsdimp.com> In-Reply-To: <201405231007.58608.jhb@freebsd.org> References: <53763B0F.4040003@selasky.org> <5379200E.8080602@selasky.org> <537A65C2.6060203@selasky.org> <201405231007.58608.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On May 23, 2014, at 8:07 AM, John Baldwin <jhb@freebsd.org> wrote: > On Monday, May 19, 2014 4:12:50 pm Hans Petter Selasky wrote: >> On 05/18/14 23:03, Hans Petter Selasky wrote: >>> Hi, >>> >>> First call: >>> >>> resource_list_add: >> >> Hi, >> >> It appears that the /dev/pccard.X is opened and reading some CIS data >> from the device before any driver has been attached. The attached patch >> solves the panic I've seen. Not sure if the patch is correct. > > Oops, your patch was dropped in my reply, but it just disables > pccard_scan_cis() while a device is probing. Hmmm, that seems like it would break PC Card probing entirely… Otherwise, how would we get here? The stack traces earlier in the thread suggest that would be the case…. What’s the other thing reading /dev/pccard.X though? > Warner, the issue here is that pccard_scan_cis() can do a bus_alloc_resource() > for SYS_RES_MEMORY rid 0 of a pccard device concurrently with > pccard_function_init(). Hans patch might be along the right track, though > we might want to make /dev/pccard.X block until pccard_function_init() > finishes rather than causing pccard_scan_cis() to fail. What do you think? Yes. I’d say it a bit differently. Only one pccard_scan_cis should be in flight at a time. http://people.freebsd.org/~imp/patch-queue/cismtx should do the trick. Warner [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTf3pJAAoJEGwc0Sh9sBEApEUQAOghDqoAiEfG1D3dXSIAbFf2 dLgs+RBefIyC84rrjJgzWHky+/cH2zNzndg4EHPeOXpuqm24EpSDBE9lseUll75O cH+XzLtotoDBewryzR9c44f+y1jzhoR+ZHdiJus2osGUiJfya7TcwjV2LmPH5INk dt9I71gkq/9+2i0eVbuEDv4d5A2gQ8MjNbCwpd5xnZeM3+hAu9HSXaQ9BxqS73nV omX5ku+LOvimRNdAY3V1cbOPZ5WJUSRVPy87YWdlBx9FiKgMrvNsUsE2OCxLmL6O arTTPm4t6DZt3KcWclzaPeiYoqNSkXUjR77xuwEnCp0XazFPrWi1pqPE0f6xgHRw U1OiwC2ytkXHNQsoFFb74ORufatAeQyHuhj4/0c5HiDtRI0EtOs7obt9m+J59tY/ rMK5zLKMr8McvVA+gnkExPN8vgi+DBTUy7336KOc5RQr7SXyGyz9HItPupMXziMO 1KDEB3Z9BFA7iuSVmkQFmIkvmjeOwSU2HyIGuYsT9J2wd4Vb9EjOJDiGLF9/nnU3 FeqKP96/3kRdoIWIAR1Yk4FrVRxlEikbqRNR4K1nMhJgLLsAFxzmrJCb2KGMTUGT ONhwG8yCvNGVXIWkGY3owg27/McRfPmJp+7m8XKLQfinEBRwLm2g2Y90iSpeGpx2 onvxhXQH0Of6Wveed5IQ =Mmh0 -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31818D06-0553-48B7-921A-B6770F8B8D35>
