On May 23, 2014, at 8:07 AM, John Baldwin <j...@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.


Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to