From owner-freebsd-current@freebsd.org Fri Jul 31 18:03:38 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E26359B08C6 for ; Fri, 31 Jul 2015 18:03:37 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8BB41A5C for ; Fri, 31 Jul 2015 18:03:37 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by pdjr16 with SMTP id r16so47453268pdj.3 for ; Fri, 31 Jul 2015 11:03:31 -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:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=kOFoXFhJ6FtDYY0jJRMEpgCdvY4nXV9uQg8GSn36Bik=; b=b1FA9/0/JSg10bkmp2LwqnqgOKwMuwgOrZJALuN6W3U5YadL4wUbDHh6A24USBk0Rn EGtQJijShJ+W9rKOLVwqVrsXmHz/753+8Rgy3NELyS9Kw3GP7o81eM/9QhrJMxDZZG4S +3wAWJNSLaZS8RIsNvAVit1/gEkc9WjicgUdRn8RRmwTjN/KZnT+XOuR4oxfIHTbmpC8 DWh/4Nsfr5qMLdxGYZl/fEx/aocABRyfzKkXCK934CiI+Ps8PBm0BpV4aKchvwNq+30v QKMjxIJlPnuZ88KKvhd0xF0XUM15+cZyA+C79E67PmV3HlBDQEplYAELtQsDtQoTEJEd l8xg== X-Gm-Message-State: ALoCoQlF3zKM0ML8R0OkV97RT526gLoGKK9C6unku7yA67on1HghLhFvX+WaTLn8g/voSQ/exSpI X-Received: by 10.70.38.10 with SMTP id c10mr9576352pdk.72.1438365811364; Fri, 31 Jul 2015 11:03:31 -0700 (PDT) Received: from [10.64.26.198] ([69.53.236.236]) by smtp.gmail.com with ESMTPSA id j5sm8925079pdi.7.2015.07.31.11.03.29 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Jul 2015 11:03:30 -0700 (PDT) Sender: Warner Losh Subject: Re: pmspcv panic on boot on this box Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: multipart/signed; boundary="Apple-Mail=_740C48EC-53FF-423A-A6C7-4C41E80412A1"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5 From: Warner Losh In-Reply-To: <14ee53e57a8.2846.a6b027662ce9a8103f88b1e74d3c5524@lerctr.org> Date: Fri, 31 Jul 2015 12:03:27 -0600 Cc: Glen Barber , Benno Rice , freebsd-current@freebsd.org Message-Id: References: <20150730201351.GH90754@FreeBSD.org> <20150730201517.GI90754@FreeBSD.org> <20150730221728.GK90754@FreeBSD.org> <452d406c68674df3834c75bd3736e6dc@thebighonker.lerctr.org> <20150731041815.GO90754@FreeBSD.org> <20150731042114.GP90754@FreeBSD.org> <20150731065016.GT90754@FreeBSD.org> <20150731102721.GA824@oldtbh.lerctr.org> <20150731133214.GV90754@FreeBSD.org> <14ee48f81d8.2846.a6b027662ce9a8103f88b1e74d3c5524@lerctr.org> <9B59F252-D41D-4714-A983-356E525359FD@bsdimp.com> <14ee53e57a8.2846.a6b027662ce9a8103f88b1e74d3c5524@lerctr.org> To: Larry Rosenman X-Mailer: Apple Mail (2.2102) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 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, 31 Jul 2015 18:03:38 -0000 --Apple-Mail=_740C48EC-53FF-423A-A6C7-4C41E80412A1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 It replaces it. Or you could just add the #if 0 bits to remove the atomic_cmpset_32 from = the picture entirely. All this state saving should be done in attach anyway, so it is = mis-located here=E2=80=A6 But the current patch will tell me if my theory of the crime is correct and offer a path = forward... Warner > On Jul 31, 2015, at 11:52 AM, Larry Rosenman wrote: >=20 > Is this with or without Benno's patch? >=20 >=20 > On July 31, 2015 12:24:11 PM Warner Losh wrote: >=20 >> Try the following patch. There=E2=80=99s a fundamental = misunderstanding of newbus that=E2=80=99s screwing things up=E2=80=A6 >>=20 >> Also available at http://people.freebsd.org/~imp/patch-queue/pms >>=20 >> The problem is that the first time through for ahd0 we=E2=80=99re = setting cardMap[0] to 5. The second time through it is already 5, so we = say =E2=80=98oh, this has been probed before=E2=80=99 and return 2. This = causes antiapi_probe() to return 0, because the card has already been = probed before. This is wrong on so many levels, but I=E2=80=99ll = suppress channelling my inner bde and stop here. >>=20 >> Warner >>=20 >> diff -r 1805eb187340 sys/dev/pms/freebsd/driver/common/lxutil.c >> --- a/sys/dev/pms/freebsd/driver/common/lxutil.c >> +++ b/sys/dev/pms/freebsd/driver/common/lxutil.c >> @@ -757,18 +757,25 @@ STATIC int agtiapi_ProbeCard( device_t d >> { >> int idx; >> static U32 cardMap[4] =3D { 0, 0, 0, 0 }; >> + u_int16_t agtiapi_vendor; // PCI vendor ID >> u_int16_t agtiapi_dev; // PCI device ID >> AGTIAPI_PRINTK("agtiapi_ProbeCard: start\n"); >>=20 >> +#if 0 >> if ( ! atomic_cmpset_32( &cardMap[thisCard], 0, 5 ) ) { // card = already ran >> AGTIAPI_PRINTK( "We'll only ID this card once -- %d\n", thisCard = ); >> return 2; // error return value; card already ran this function >> } >> else { >> +#else >> + { >> +#endif >> + agtiapi_vendor =3D pci_get_vendor( dev ); // get PCI vendor ID >> agtiapi_dev =3D pci_get_device( dev ); // get PCI device ID >> for( idx =3D 0; idx < COUNT(ag_card_type); idx++ ) >> { >> - if( ag_card_type[idx].deviceId =3D=3D agtiapi_dev ) >> + if( ag_card_type[idx].deviceId =3D=3D agtiapi_dev && >> + ag_card_type[idx].vendorId =3D=3D agtiapi_vendor) >> { // device ID match >> memset( (void *)&agCardInfoList[ thisCard ], 0, >> sizeof(ag_card_info_t) ); >>=20 >>=20 >>=20 >> > On Jul 31, 2015, at 8:41 AM, Larry Rosenman wrote: >> > >> > Please do pull it from GENERIC until this is fixed in HEAD and = RELENG/10. >> > >> > >> > On July 31, 2015 8:32:17 AM Glen Barber wrote: >> > >> >> On Fri, Jul 31, 2015 at 05:27:22AM -0500, Larry Rosenman wrote: >> >> > Ok, I made a GENERIC-NOPMS, without the device pmspcv, and = adjusted my custom >> >> > to include GENERIC-NOPMS. And we boot (I'm typing this from a = ssh session >> >> > to the box). >> >> > >> >> >> >> Larry, thank you very much for testing this. >> >> >> >> Benno, for 10.2-RELEASE, I think we're going to pull pmspcv from = GENERIC >> >> and issue an EN for the driver update when this is fixed. >> >> >> >> I think this should be pulled from GENERIC in head and stable/10 = in the >> >> meantime, as well. >> >> >> >> Glen >> >> >> > >> > >> > _______________________________________________ >> > freebsd-current@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-current >> > To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org" >>=20 >=20 >=20 --Apple-Mail=_740C48EC-53FF-423A-A6C7-4C41E80412A1 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 iQIcBAEBCgAGBQJVu7hvAAoJEGwc0Sh9sBEAfNQQAMS1Qvn2UbNY4MuQVrDF3rqB e70oF3DoZMRqTOfIbL6D0f9NJ4cR4Y5QaMgLFoUsMoYKPDOBGuABMf7lXGpk5NwD akuTXz7FNY/zY0x8MFXtEgwI1VmMZljQbnGW22DjkdMYL0mKPKUS8zlvlx9RU2GH YWRZBjuXV+C90bc+vC14P3inG5ZkvxiT3PRAPQaqXCtCdQWDGcxoaHDcBGAakkBL n11h/qYdWElLko6GxY5UbadtHo69qc4X4haNT0euN0sF4Cgv9t3AQPdlSdvzHEiO 0dtONv3B/yI/G84knMs7W+pi7Kuqfe2xEG+CxoYS6qGp+s9cuOeOpMcqL2Zs6sYD FetF+1svVlN4s021NgiN+RaIe0/VHfrk46FiRUTpvx4ILQjbkcrBSWtVE6BrHFg/ lfLkA5sNvTJfsraiIz4wC/ciBCIKN1amf7JJgfcWiqYbmDRjBrEfXdgEL8ejoQpa J6CWl7NAg8tXakiZ25ZxmzI1lyrSgPwwmXQG1VXyiuq7XrPBR5y9FyvymbjeC8pK JT8y3YnoVtqHq44VLIrSs313vDM5TFWWaRCUKKChiGsrSz4A+SK07BhFZsrsV+L+ FRV0/KV8gW8zCvEEInXTBNyHUWzgsFmLOwWfeoLMXunKpOWEB1Ytx12rGl9ouj9H vVLiZeWGOc7hvIU2m63f =BIA2 -----END PGP SIGNATURE----- --Apple-Mail=_740C48EC-53FF-423A-A6C7-4C41E80412A1--