From owner-freebsd-current@FreeBSD.ORG Fri May 23 16:41:51 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09591629 for ; Fri, 23 May 2014 16:41:51 +0000 (UTC) Received: from mail-ig0-f169.google.com (mail-ig0-f169.google.com [209.85.213.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C08B82F99 for ; Fri, 23 May 2014 16:41:50 +0000 (UTC) Received: by mail-ig0-f169.google.com with SMTP id hl10so1116719igb.4 for ; Fri, 23 May 2014 09:41:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=qNYnS8q6q0uieR2rEsOYAGfzckwF0T5EXM95SLJO3Ps=; b=LXDSPNCUM20xO4G6ju070/fVNdMPgCmnLyWbWRiQUBzXeOZ++IpWad3tYLYX4ZABFS 1kfpi7XCVZTpEO9IK+TQd0v9BOgjOm+dAUWV53kwHOLN8DMCS6PlzliNxQLHUajxeXML dqtEL6WqUb1WlfexXmecKlKpDJo6P4J4FOHpc0v5ZSrKKlMGLU/DArFxs2qnWIZgfR0C 2ByBunx4RICjh9WJbJorUaWy1+nu+j+f3wkAzfJN8wBM/1II0/bpIA5OsnGxlHcW6LMp oQRLjqnuZ+8mxhElkz2XkzNjXaZB73MovZF6FiVeB/6ieofCsd0M0nS+xT1h7CyJ/HY/ n6wA== X-Gm-Message-State: ALoCoQnLAidkAn+zsrtyyKu2Zd7Mq8rguMfPMuXyDMCpfZs4V5lb+H2bddbHAY1O1vikpsT+3Dbp X-Received: by 10.43.84.67 with SMTP id aj3mr6014348icc.38.1400863304735; Fri, 23 May 2014 09:41:44 -0700 (PDT) Received: from bsdimp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id is8sm5238099igb.7.2014.05.23.09.41.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 09:41:44 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_EF3ECCBD-DE4D-4CB9-AB22-828ABA013621"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: panic: resource_list_add: resource entry is busy From: Warner Losh In-Reply-To: <201405231007.58608.jhb@freebsd.org> Date: Fri, 23 May 2014 10:41:45 -0600 Message-Id: <31818D06-0553-48B7-921A-B6770F8B8D35@bsdimp.com> References: <53763B0F.4040003@selasky.org> <5379200E.8080602@selasky.org> <537A65C2.6060203@selasky.org> <201405231007.58608.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1878.2) Cc: Hans Petter Selasky , freebsd-current , Warner Losh X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 16:41:51 -0000 --Apple-Mail=_EF3ECCBD-DE4D-4CB9-AB22-828ABA013621 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 23, 2014, at 8:07 AM, John Baldwin 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, >>>=20 >>> First call: >>>=20 >>> resource_list_add: >>=20 >> Hi, >>=20 >> It appears that the /dev/pccard.X is opened and reading some CIS data=20= >> from the device before any driver has been attached. The attached = patch=20 >> solves the panic I've seen. Not sure if the patch is correct. >=20 > Oops, your patch was dropped in my reply, but it just disables=20 > pccard_scan_cis() while a device is probing. Hmmm, that seems like it would break PC Card probing entirely=85 = Otherwise, how would we get here? The stack traces earlier in the thread = suggest that would be the case=85. What=92s the other thing reading /dev/pccard.X though? > Warner, the issue here is that pccard_scan_cis() can do a = bus_alloc_resource()=20 > for SYS_RES_MEMORY rid 0 of a pccard device concurrently with=20 > 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()=20= > finishes rather than causing pccard_scan_cis() to fail. What do you = think? Yes. I=92d 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 --Apple-Mail=_EF3ECCBD-DE4D-4CB9-AB22-828ABA013621 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----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----- --Apple-Mail=_EF3ECCBD-DE4D-4CB9-AB22-828ABA013621--