From owner-freebsd-scsi@FreeBSD.ORG Mon Nov 7 02:20:32 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 859041065670 for ; Mon, 7 Nov 2011 02:20:32 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail28.syd.optusnet.com.au (mail28.syd.optusnet.com.au [211.29.133.169]) by mx1.freebsd.org (Postfix) with ESMTP id 19E488FC13 for ; Mon, 7 Nov 2011 02:20:31 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail28.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pA72KTKS015354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 7 Nov 2011 13:20:29 +1100 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.5/8.14.4) with ESMTP id pA72KSYf090289 for ; Mon, 7 Nov 2011 13:20:28 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.5/8.14.4/Submit) id pA72KSQs090288 for freebsd-scsi@freebsd.org; Mon, 7 Nov 2011 13:20:28 +1100 (EST) (envelope-from peter) Date: Mon, 7 Nov 2011 13:20:27 +1100 From: Peter Jeremy To: freebsd-scsi@freebsd.org Message-ID: <20111107022027.GA89682@server.vk2pj.dyndns.org> References: <20111027222603.GA39946@server.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <20111027222603.GA39946@server.vk2pj.dyndns.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: Watchdog timeouts on isp(4) X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 02:20:32 -0000 --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Oct-28 09:26:03 +1100, Peter Jeremy = wrote: >I have a 16-CPU SunFire V890 running FreeBSD-current/sparc64 r226167. >Whilst doing some stress testing (6 parallel -j16 buildworlds with >regular "sysctl vm.vmtotal"), I have started seeing isp watchdog >timeouts. I didn't see this with similar testing on about r223035. Having done some more careful checks, I did find a couple of timeouts with an older kernel but it was quite rare whereas it's now fairly easy for me to trigger. >The messages look like: > >(da4:isp0:0:4:0): first watchdog (handle 0xb4d820d9) timed out- deferring = for grace period >(da4:isp0:0:4:0): first watchdog (handle 0xb4d920ba) timed out- deferring = for grace period >(da11:isp1:0:5:0): first watchdog (handle 0x5f0620c9) timed out- deferring= for grace period >(da11:isp1:0:5:0): first watchdog (handle 0x5f07203a) timed out- deferring= for grace period >(da11:isp1:0:5:0): first watchdog (handle 0x5f08208c) timed out- deferring= for grace period >... marius@, mjacob@ and I are investigating this off-list. If anyone else is seeing something similar, I'd appreciate them contacting me. --=20 Peter Jeremy --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk63QGsACgkQ/opHv/APuIchUwCaAwDJZ+uY4GQB86oI/KOk63FM wtEAnitrusmtg/s3OaqcaHPqiaBoNZJJ =imta -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e-- From owner-freebsd-scsi@FreeBSD.ORG Mon Nov 7 08:48:43 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69303106566C; Mon, 7 Nov 2011 08:48:43 +0000 (UTC) (envelope-from Karli.Sjoberg@slu.se) Received: from Edge1-3.slu.se (edge1-3.slu.se [193.10.100.98]) by mx1.freebsd.org (Postfix) with ESMTP id B8D288FC17; Mon, 7 Nov 2011 08:48:42 +0000 (UTC) Received: from Exchange1.ad.slu.se (193.10.100.94) by Edge1-3.slu.se (193.10.100.98) with Microsoft SMTP Server (TLS) id 8.3.213.0; Mon, 7 Nov 2011 09:48:39 +0100 Received: from exmbx3.ad.slu.se ([193.10.100.93]) by Exchange1.ad.slu.se ([193.10.100.94]) with mapi; Mon, 7 Nov 2011 09:48:39 +0100 From: =?iso-8859-1?Q?Karli_Sj=F6berg?= To: Jeremy Chadwick Date: Mon, 7 Nov 2011 09:48:37 +0100 Thread-Topic: AOC-USAS2-L8i zfs panics and SCSI errors in messages Thread-Index: AcydKgshssCJtxGcRfKbhNyvhT7O9w== Message-ID: <75BDE9FA-6130-4BB4-8518-275D68BB3E49@slu.se> References: <82B38DBF-DD3A-46CD-93F6-02CDB6506E05@slu.se> <20111025193302.GA30409@nargothrond.kdm.org> <20111026101602.GA9768@icarus.home.lan> In-Reply-To: <20111026101602.GA9768@icarus.home.lan> Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: sv-SE, en-US MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "freebsd-scsi@freebsd.org" , "Kenneth D. Merry" , "fs@freebsd.org" Subject: Re: AOC-USAS2-L8i zfs panics and SCSI errors in messages X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 08:48:43 -0000 As a test, I have copied in about 1.5TB and scrubbed several times without = any panic. It stayed solid until periodic weekly:( Same panic as with daily= . /Karli Sj=F6berg 26 okt 2011 kl. 12.16 skrev Jeremy Chadwick: On Wed, Oct 26, 2011 at 11:36:44AM +0200, Karli Sj?berg wrote: Hi all, I tracked down what causes the panics! I got a tip from aragon and phoenix at the forum about /etc/periodic/security/100.chksetuid And to put: daily_status_security_chksetuid_enable=3D"NO" into /etc/periodic.conf This is not truly the cause of the panic, it simply exacerbates it. Many of the periodic scripts will do things like iterate over all files on the filesystem looking for specific attributes, etc.. This tends to stress filesystems heavily. This isn't the only one. :-) I can now run periodic daily without any panics. I?m still wondering about the cause of this, the explanation from the forum was that that phase is too demanding for multi TB systems. But I have several multi TB servers with FreeBSD and ZFS, and none of them has ever behaved this way. Besides, the panic is instantaneous, not degenerative. I imagine that a run like that would start out OK and then just get worse and worse, getting gradually slower and slower until it just wouldn?t cope any more and hang. This feels more like hitting a wall. As if it found something that is couldn?t deal with and has no choice but to panic immediately. It may be possible that you have some underlying filesystem corruption that triggers this situation. Have you actually tried doing a "zpool scrub" of your pools and seeing if any errors happen or if the panic occurs there? I'm inclined to think what you're experiencing is probably a bug or "quirk" in the storage controller driver you're using. There are other drivers that have had fixes applied to them "to make them work decently with ZFS", meaning the kind of stressful I/O ZFS puts on them results in the controller driver behaving oddly or freaking out, case in point. It could also be a controller firmware bug/quirk/design issue. Seriously. I believe the AOC-USAS2-L8i controller has been discussed on freebsd-stable, re: mps(4) driver problems or equivalent, but I'm not going to CC that list given that there would be 3 cross-posted lists involved and that is liable to upset some folks. You should search the mailing lists for discussion of Supermicro controllers that work reliably with FreeBSD. It would be worthwhile to discuss this condition on -stable, mainly with something like "Anyone else using the AOC-USAS2-L8i reliably with ZFS?" You get the idea. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | Med V=E4nliga H=E4lsningar ---------------------------------------------------------------------------= ---- Karli Sj=F6berg Swedish University of Agricultural Sciences Box 7079 (Visiting Address Kron=E5sv=E4gen 8) S-750 07 Uppsala, Sweden Phone: +46-(0)18-67 15 66 karli.sjoberg@slu.se From owner-freebsd-scsi@FreeBSD.ORG Mon Nov 7 09:22:53 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 482F91065670; Mon, 7 Nov 2011 09:22:53 +0000 (UTC) (envelope-from rincebrain@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id CBB6E8FC24; Mon, 7 Nov 2011 09:22:52 +0000 (UTC) Received: by qadb12 with SMTP id b12so2346282qad.13 for ; Mon, 07 Nov 2011 01:22:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=7tlGToQ+TyuJS4hlFip2dDFGqpO3lkVwaCsHg3eIWPY=; b=fJfw5AGM1634meM2INBzq+9WoGzfirbQh3IvnTkSqVMLf4GDTNNkXLumQmOGCORmub u5GXDlHFAOV38JpWPpBA7sPCbqx2pnFd8Fac0V29xJFqinv46TILw8S7zZa5usipB+hS 5b6UrxPoMtYAPT5aV4mDEsw/oEvOGAQ5EKhbE= MIME-Version: 1.0 Received: by 10.229.65.27 with SMTP id g27mr2359222qci.288.1320656174318; Mon, 07 Nov 2011 00:56:14 -0800 (PST) Sender: rincebrain@gmail.com Received: by 10.229.138.14 with HTTP; Mon, 7 Nov 2011 00:56:14 -0800 (PST) In-Reply-To: <75BDE9FA-6130-4BB4-8518-275D68BB3E49@slu.se> References: <82B38DBF-DD3A-46CD-93F6-02CDB6506E05@slu.se> <20111025193302.GA30409@nargothrond.kdm.org> <20111026101602.GA9768@icarus.home.lan> <75BDE9FA-6130-4BB4-8518-275D68BB3E49@slu.se> Date: Mon, 7 Nov 2011 03:56:14 -0500 X-Google-Sender-Auth: zmMH5-mOzoXy4iUoPfLnn9EKedo Message-ID: From: Rich To: =?ISO-8859-1?Q?Karli_Sj=F6berg?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-scsi@freebsd.org" , "Kenneth D. Merry" , "fs@freebsd.org" , Jeremy Chadwick Subject: Re: AOC-USAS2-L8i zfs panics and SCSI errors in messages X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 09:22:53 -0000 Observation - the LSI SAS expanders, in my experience, sometimes misbehave when there are drives which respond slower than some timeout to commands (as far as I've seen it's only SATA drives it does this for, but I don't have many SAS drives for comparison), leading to all further commands to that drive for a bit not working, and then what happens depending on the OS varies dramatically. If you could try without an expander (e.g. with 1->4 SAS->SATA fanout cables), you may be surprised (and/or annoyed) to find your life gets better. - Rich On Mon, Nov 7, 2011 at 3:48 AM, Karli Sj=F6berg wrot= e: > As a test, I have copied in about 1.5TB and scrubbed several times withou= t any panic. It stayed solid until periodic weekly:( Same panic as with dai= ly. > > /Karli Sj=F6berg > > 26 okt 2011 kl. 12.16 skrev Jeremy Chadwick: > > On Wed, Oct 26, 2011 at 11:36:44AM +0200, Karli Sj?berg wrote: > Hi all, > > I tracked down what causes the panics! > > I got a tip from aragon and phoenix at the forum about > /etc/periodic/security/100.chksetuid > > And to put: > daily_status_security_chksetuid_enable=3D"NO" > into /etc/periodic.conf > > This is not truly the cause of the panic, it simply exacerbates it. > > Many of the periodic scripts will do things like iterate over all files > on the filesystem looking for specific attributes, etc.. =A0This tends to > stress filesystems heavily. =A0This isn't the only one. =A0:-) > > I can now run periodic daily without any panics. I?m still wondering > about the cause of this, the explanation from the forum was that that > phase is too demanding for multi TB systems. But I have several multi > TB servers with FreeBSD and ZFS, and none of them has ever behaved > this way. Besides, the panic is instantaneous, not degenerative. I > imagine that a run like that would start out OK and then just get > worse and worse, getting gradually slower and slower until it just > wouldn?t cope any more and hang. This feels more like hitting a wall. > As if it found something that is couldn?t deal with and has no choice > but to panic immediately. > > It may be possible that you have some underlying filesystem corruption > that triggers this situation. =A0Have you actually tried doing a "zpool > scrub" of your pools and seeing if any errors happen or if the panic > occurs there? > > I'm inclined to think what you're experiencing is probably a bug or > "quirk" in the storage controller driver you're using. =A0There are other > drivers that have had fixes applied to them "to make them work decently > with ZFS", meaning the kind of stressful I/O ZFS puts on them results in > the controller driver behaving oddly or freaking out, case in point. =A0I= t > could also be a controller firmware bug/quirk/design issue. =A0Seriously. > > I believe the AOC-USAS2-L8i controller has been discussed on > freebsd-stable, re: mps(4) driver problems or equivalent, but I'm not > going to CC that list given that there would be 3 cross-posted lists > involved and that is liable to upset some folks. =A0You should search the > mailing lists for discussion of Supermicro controllers that work > reliably with FreeBSD. > > It would be worthwhile to discuss this condition on -stable, mainly with > something like "Anyone else using the AOC-USAS2-L8i reliably with ZFS?" > You get the idea. > > -- > | Jeremy Chadwick =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0jdc at parodius.com | > | Parodius Networking =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 http://= www.parodius.com/ | > | UNIX Systems Administrator =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Mountain= View, CA, US | > | Making life hard for others since 1977. =A0 =A0 =A0 =A0 =A0 =A0 =A0 PGP= 4BD6C0CB | > > > > > Med V=E4nliga H=E4lsningar > -------------------------------------------------------------------------= ------ > Karli Sj=F6berg > Swedish University of Agricultural Sciences > Box 7079 (Visiting Address Kron=E5sv=E4gen 8) > S-750 07 Uppsala, Sweden > Phone: =A0+46-(0)18-67 15 66 > karli.sjoberg@slu.se > > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" > From owner-freebsd-scsi@FreeBSD.ORG Mon Nov 7 11:07:19 2011 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91CDA106564A for ; Mon, 7 Nov 2011 11:07:19 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7707F8FC14 for ; Mon, 7 Nov 2011 11:07:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7B7JB3078794 for ; Mon, 7 Nov 2011 11:07:19 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id pA7B7I4X078792 for freebsd-scsi@FreeBSD.org; Mon, 7 Nov 2011 11:07:18 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 7 Nov 2011 11:07:18 GMT Message-Id: <201111071107.pA7B7I4X078792@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-scsi@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-scsi@FreeBSD.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 11:07:19 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/161809 scsi [cam] [patch] set kern.cam.boot_delay via build option o kern/159412 scsi [ciss] 7.3 RELEASE: ciss0 ADAPTER HEARTBEAT FAILED err o kern/157770 scsi [iscsi] [panic] iscsi_initiator panic o kern/154432 scsi [xpt] run_interrupt_driven_hooks: still waiting after o kern/153514 scsi [cam] [panic] CAM related panic o kern/153361 scsi [ciss] Smart Array 5300 boot/detect drive problem o kern/152250 scsi [ciss] [patch] Kernel panic when hw.ciss.expose_hidden o kern/151564 scsi [ciss] ciss(4) should increase CISS_MAX_LOGICAL to 10 o docs/151336 scsi Missing documentation of scsi_ and ata_ functions in c s kern/149927 scsi [cam] hard drive not stopped before removing power dur o kern/148083 scsi [aac] Strange device reporting o kern/147704 scsi [mpt] sys/dev/mpt: new chip revision, partially unsupp o kern/146287 scsi [ciss] ciss(4) cannot see more than one SmartArray con o kern/145768 scsi [mpt] can't perform I/O on SAS based SAN disk in freeb o kern/144648 scsi [aac] Strange values of speed and bus width in dmesg o kern/144301 scsi [ciss] [hang] HP proliant server locks when using ciss o kern/142351 scsi [mpt] LSILogic driver performance problems o kern/141934 scsi [cam] [patch] add support for SEAGATE DAT Scopion 130 o kern/134488 scsi [mpt] MPT SCSI driver probes max. 8 LUNs per device o kern/132250 scsi [ciss] ciss driver does not support more then 15 drive o kern/132206 scsi [mpt] system panics on boot when mirroring and 2nd dri o kern/130621 scsi [mpt] tranfer rate is inscrutable slow when use lsi213 o kern/129602 scsi [ahd] ahd(4) gets confused and wedges SCSI bus o kern/128452 scsi [sa] [panic] Accessing SCSI tape drive randomly crashe o kern/128245 scsi [scsi] "inquiry data fails comparison at DV1 step" [re o kern/127927 scsi [isp] isp(4) target driver crashes kernel when set up o kern/127717 scsi [ata] [patch] [request] - support write cache toggling o kern/124667 scsi [amd] [panic] FreeBSD-7 kernel page faults at amd-scsi o kern/123674 scsi [ahc] ahc driver dumping o kern/123520 scsi [ahd] unable to boot from net while using ahd o sparc/121676 scsi [iscsi] iscontrol do not connect iscsi-target on sparc o kern/120487 scsi [sg] scsi_sg incompatible with scanners o kern/120247 scsi [mpt] FreeBSD 6.3 and LSI Logic 1030 = only 3.300MB/s o kern/114597 scsi [sym] System hangs at SCSI bus reset with dual HBAs o kern/110847 scsi [ahd] Tyan U320 onboard problem with more than 3 disks o kern/99954 scsi [ahc] reading from DVD failes on 6.x [regression] o kern/92798 scsi [ahc] SCSI problem with timeouts o kern/90282 scsi [sym] SCSI bus resets cause loss of ch device o kern/76178 scsi [ahd] Problem with ahd and large SCSI Raid system o kern/74627 scsi [ahc] [hang] Adaptec 2940U2W Can't boot 5.3 s kern/61165 scsi [panic] kernel page fault after calling cam_send_ccb o kern/60641 scsi [sym] Sporadic SCSI bus resets with 53C810 under load o kern/60598 scsi wire down of scsi devices conflicts with config s kern/57398 scsi [mly] Current fails to install on mly(4) based RAID di o bin/57088 scsi [cam] [patch] for a possible fd leak in libcam.c o kern/52638 scsi [panic] SCSI U320 on SMP server won't run faster than o kern/44587 scsi dev/dpt/dpt.h is missing defines required for DPT_HAND o kern/39388 scsi ncr/sym drivers fail with 53c810 and more than 256MB m o kern/35234 scsi World access to /dev/pass? (for scanner) requires acce 49 problems total. From owner-freebsd-scsi@FreeBSD.ORG Mon Nov 7 13:50:10 2011 Return-Path: Delivered-To: freebsd-scsi@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72C101065670 for ; Mon, 7 Nov 2011 13:50:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 619118FC14 for ; Mon, 7 Nov 2011 13:50:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7DoA5H033656 for ; Mon, 7 Nov 2011 13:50:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id pA7DoALb033655; Mon, 7 Nov 2011 13:50:10 GMT (envelope-from gnats) Date: Mon, 7 Nov 2011 13:50:10 GMT Message-Id: <201111071350.pA7DoALb033655@freefall.freebsd.org> To: freebsd-scsi@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: kern/124667: commit references a PR X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 13:50:10 -0000 The following reply was made to PR kern/124667; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/124667: commit references a PR Date: Mon, 7 Nov 2011 13:41:06 +0000 (UTC) Author: marius Date: Mon Nov 7 13:40:54 2011 New Revision: 227305 URL: http://svn.freebsd.org/changeset/base/227305 Log: MFC: r227006, r227281, r227282 Add a PCI front-end to esp(4) allowing it to support AMD Am53C974 and replace amd(4) with the former in the amd64, i386 and pc98 GENERIC kernel configuration files. Besides duplicating functionality, amd(4), which previously also supported the AMD Am53C974, unlike esp(4) is no longer maintained and has accumulated enough bit rot over time to always cause a panic during boot as long as at least one target is attached to it (see PR 124667). PR: 124667 Approved by: re (kib) Obtained from: NetBSD (based on) Added: stable/9/sys/dev/esp/am53c974reg.h - copied unchanged from r227006, head/sys/dev/esp/am53c974reg.h stable/9/sys/dev/esp/esp_pci.c - copied unchanged from r227006, head/sys/dev/esp/esp_pci.c Modified: stable/9/UPDATING stable/9/share/man/man4/esp.4 stable/9/sys/amd64/conf/GENERIC stable/9/sys/conf/NOTES stable/9/sys/conf/files stable/9/sys/i386/conf/GENERIC stable/9/sys/modules/Makefile stable/9/sys/modules/esp/Makefile stable/9/sys/pc98/conf/GENERIC stable/9/sys/sparc64/conf/GENERIC Directory Properties: stable/9/ (props changed) stable/9/Makefile.inc1 (props changed) stable/9/bin/ps/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/contrib/bind9/ (props changed) stable/9/contrib/binutils/ (props changed) stable/9/contrib/bzip2/ (props changed) stable/9/contrib/compiler-rt/ (props changed) stable/9/contrib/dialog/ (props changed) stable/9/contrib/ee/ (props changed) stable/9/contrib/expat/ (props changed) stable/9/contrib/file/ (props changed) stable/9/contrib/gcc/ (props changed) stable/9/contrib/gdb/ (props changed) stable/9/contrib/gdtoa/ (props changed) stable/9/contrib/gnu-sort/ (props changed) stable/9/contrib/groff/ (props changed) stable/9/contrib/less/ (props changed) stable/9/contrib/libpcap/ (props changed) stable/9/contrib/libstdc++/ (props changed) stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) stable/9/contrib/ncurses/ (props changed) stable/9/contrib/netcat/ (props changed) stable/9/contrib/ntp/ (props changed) stable/9/contrib/one-true-awk/ (props changed) stable/9/contrib/openbsm/ (props changed) stable/9/contrib/openpam/ (props changed) stable/9/contrib/openresolv/ (props changed) stable/9/contrib/pf/ (props changed) stable/9/contrib/sendmail/ (props changed) stable/9/contrib/tcpdump/ (props changed) stable/9/contrib/tcsh/ (props changed) stable/9/contrib/tnftp/ (props changed) stable/9/contrib/top/ (props changed) stable/9/contrib/top/install-sh (props changed) stable/9/contrib/tzcode/ (props changed) stable/9/contrib/tzcode/stdtime/ (props changed) stable/9/contrib/tzcode/zic/ (props changed) stable/9/contrib/tzdata/ (props changed) stable/9/contrib/wpa/ (props changed) stable/9/contrib/xz/ (props changed) stable/9/crypto/openssh/ (props changed) stable/9/crypto/openssl/ (props changed) stable/9/etc/ (props changed) stable/9/games/fortune/ (props changed) stable/9/gnu/lib/ (props changed) stable/9/gnu/usr.bin/binutils/ (props changed) stable/9/gnu/usr.bin/cc/cc_tools/ (props changed) stable/9/gnu/usr.bin/gdb/ (props changed) stable/9/include/ (props changed) stable/9/kerberos5/ (props changed) stable/9/lib/clang/ (props changed) stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) stable/9/lib/libfetch/ (props changed) stable/9/lib/libusb/ (props changed) stable/9/lib/libutil/ (props changed) stable/9/lib/libz/ (props changed) stable/9/libexec/rshd/ (props changed) stable/9/libexec/rtld-elf/ (props changed) stable/9/release/ (props changed) stable/9/sbin/ (props changed) stable/9/sbin/atacontrol/ (props changed) stable/9/sbin/camcontrol/ (props changed) stable/9/sbin/ipfw/ (props changed) stable/9/share/doc/ (props changed) stable/9/share/examples/ (props changed) stable/9/share/man/man4/ (props changed) stable/9/share/man/man5/ (props changed) stable/9/share/man/man7/ (props changed) stable/9/share/man/man9/ (props changed) stable/9/share/misc/ (props changed) stable/9/share/mk/bsd.arch.inc.mk (props changed) stable/9/share/zoneinfo/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/tools/ (props changed) stable/9/usr.bin/calendar/ (props changed) stable/9/usr.bin/clang/ (props changed) stable/9/usr.bin/csup/ (props changed) stable/9/usr.bin/fetch/ (props changed) stable/9/usr.bin/grep/ (props changed) stable/9/usr.bin/procstat/ (props changed) stable/9/usr.bin/script/ (props changed) stable/9/usr.bin/sed/ (props changed) stable/9/usr.sbin/boot0cfg/ (props changed) stable/9/usr.sbin/bsdinstall/ (props changed) stable/9/usr.sbin/burncd/ (props changed) stable/9/usr.sbin/freebsd-update/ (props changed) stable/9/usr.sbin/makefs/ (props changed) stable/9/usr.sbin/mergemaster/ (props changed) stable/9/usr.sbin/mfiutil/ (props changed) stable/9/usr.sbin/ndiscvt/ (props changed) stable/9/usr.sbin/pc-sysinstall/ (props changed) stable/9/usr.sbin/portsnap/ (props changed) stable/9/usr.sbin/rtadvctl/ (props changed) stable/9/usr.sbin/rtadvd/ (props changed) stable/9/usr.sbin/rtsold/ (props changed) stable/9/usr.sbin/tzsetup/ (props changed) stable/9/usr.sbin/usbdump/ (props changed) stable/9/usr.sbin/zic/ (props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Mon Nov 7 13:18:09 2011 (r227304) +++ stable/9/UPDATING Mon Nov 7 13:40:54 2011 (r227305) @@ -9,6 +9,10 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20111101: + The broken amd(4) driver has been replaced with esp(4) in the amd64, + i386 and pc98 GENERIC kernel configuration files. + 20110913: This commit modifies vfs_register() so that it uses a hash calculation to set vfc_typenum, which is enabled by default. Modified: stable/9/share/man/man4/esp.4 ============================================================================== --- stable/9/share/man/man4/esp.4 Mon Nov 7 13:18:09 2011 (r227304) +++ stable/9/share/man/man4/esp.4 Mon Nov 7 13:40:54 2011 (r227305) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2004 Tom Rhodes +.\" Copyright (c) 2011 Marius Strobl .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,158 +25,91 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2005 +.Dd November 1, 2011 .Dt ESP 4 .Os .Sh NAME .Nm esp -.Nd Qlogic FEPS and FAS366 SCSI driver +.Nd Emulex ESP, NCR 53C9x and QLogic FAS families based SCSI controllers .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your +To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device scbus" .Cd "device esp" .Ed -.Sh HARDWARE +.Pp +Alternatively, to load the driver as a module at boot time, place the +following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_esp_load="YES" +.Ed +.Sh DESCRIPTION The .Nm driver provides support for the -.Tn Qlogic -FAS216 and FAS408 +.Tn AMD +Am53C974, the +.Tn Emulex +ESP100, ESP100A, ESP200 and ESP406, the +.Tn NCR +53C90, 53C94 and 53C96 as well as the +.Tn QLogic +FAS100A, FAS216, FAS366 and FAS408 .Tn SCSI controller chips found in a wide variety of systems and peripheral boards. -This includes the -.Tn Qlogic -.Tn SCSI -cards found in most -.Tn Sun -.Tn Ultra 1e -and -.Tn Ultra 2 -machines. -.Pp -For -.Tn Qlogic -.Tn PCI -.Tn SCSI -host adapters, the -.Xr isp 4 -driver should be used in place of the -.Nm -driver. -.Sh IMPLEMENTATION NOTES -During the boot sequence, the +.Sh HARDWARE +Controllers supported by the .Nm -driver -searches the linked list for LUN info by LUN ID. -At this point the driver will attach on that instance, -and then attempt to attach every sub-device. -.Pp -There are at least 4 variations of the -configuration 3 register. -A second config register must be loaded to inquire the chip revision, -otherwise the -.Fn ncr53c9x_reset -function will not set the defaults correctly. -.Pp -The drive attach routine attempts to set the appropriate -bit to put the chip into Fast -.Tn SCSI -mode so that it does not -have to be figured out each time. -This will then be stored in the -.Tn NCR -registers for later use. +driver include: .Pp -The -.Nm -driver makes use of the -.Tn LSI -64854 -.Tn DMA -engine which contains three independent -channels designed to interface with -an NCR539X -.Tn SCSI -controller; -an AM7990 Ethernet controller; -and certain types of parallel port hardware. -As such this driver may eventually replace the -.Xr amd 4 -driver for network hardware. -.Sh DIAGNOSTICS -The following driver specific error messages -may be reported: -.Bl -diag -.It "esp: cannot map %d segments" -The device was unable to map segments while mapping the -.Tn SCSI -devices in -.Tn DMA -mode. -.It "unknown variant %d, devices not attached" -An unknown version of the card was found and devices will -not be attached. -.It "Unhandled function code %d" -The device returned a function code which the driver is -unable to handle, most likely during negotiation. -.It "esp:%d:%d: selection failed %d left in FIFO" -The target left the command phase prematurely. -If a command did not reach the device then it will -be reported as shown above. -.It "invalid state: %d" -The device has reached an invalid state. -.El -.Sh SEE ALSO -.Xr amd 4 , -.Xr isp 4 , -.Xr scbus 4 , -.Xr camcontrol 8 -.Pp -.Bl -item -compact +.Bl -bullet -compact +.It +MELCO IFC-DP (PC-98) +.It +Sun ESP family +.It +Sun FAS family .It -.Pa http://www.qlc.com/ +Tekram DC390 .It -.Pa http://www.sun.com/ +Tekram DC390T .El +.Sh SEE ALSO +.Xr cd 4 , +.Xr ch 4 , +.Xr da 4 , +.Xr intro 4 , +.Xr pci 4 , +.Xr sa 4 , +.Xr sbus 4 , +.Xr scsi 4 , +.Xr camcontrol 8 .Sh HISTORY The .Nm -driver was written for -.Nx -by -.An Eric S. Hvozda . +driver first appeared in +.Nx 1.3 . +The first +.Fx +version to include it was +.Fx 5.3 . +.Sh AUTHORS +.An -nosplit The .Nm -driver was then ported to -.Fx 5.3 +driver was ported to +.Fx by -.An Scott Long Aq scottl@FreeBSD.org . -.Sh AUTHORS -This manual page was written by -.An Tom Rhodes Aq trhodes@FreeBSD.org -instead of porting the original from -.Nx . +.An Scott Long +.Aq scottl@FreeBSD.org +and later on considerably improved by +.An Marius Strobl +.Aq marius@FreeBSD.org . .Sh BUGS The .Nm -driver includes the sbus front-end but lacks the -.Tn PCI -front-end. -Thus it can only support the -.Tn FEPS/FAS366 -.Tn SCSI -found in -.Tn Sun -.Tn Ultra 1e -and -.Tn Ultra 2 -machines at this time. -.Pp -This driver should eventually replace the -.Xr amd 4 -driver, but that requires porting the -.Tn PCI -front-end mentioned above. +driver should read the EEPROM settings of +.Tn Tekram +controllers. Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Mon Nov 7 13:18:09 2011 (r227304) +++ stable/9/sys/amd64/conf/GENERIC Mon Nov 7 13:40:54 2011 (r227305) @@ -95,7 +95,7 @@ options AHC_REG_PRETTY_PRINT # Print re device ahd # AHA39320/29320 and onboard AIC79xx devices options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. -device amd # AMD 53C974 (Tekram DC-390(T)) +device esp # AMD Am53C974 (Tekram DC-390(T)) device hptiop # Highpoint RocketRaid 3xxx series device isp # Qlogic family #device ispfw # Firmware for QLogic HBAs- normally a module Modified: stable/9/sys/conf/NOTES ============================================================================== --- stable/9/sys/conf/NOTES Mon Nov 7 13:18:09 2011 (r227304) +++ stable/9/sys/conf/NOTES Mon Nov 7 13:40:54 2011 (r227305) @@ -1459,7 +1459,9 @@ options TEKEN_UTF8 # UTF-8 output hand # such as the Tekram DC-390(T). # bt: Most Buslogic controllers: including BT-445, BT-54x, BT-64x, BT-74x, # BT-75x, BT-946, BT-948, BT-956, BT-958, SDC3211B, SDC3211F, SDC3222F -# esp: NCR53c9x. Only for SBUS hardware right now. +# esp: Emulex ESP, NCR 53C9x and QLogic FAS families based controllers +# including the AMD Am53C974 (found on devices such as the Tekram +# DC-390(T)) and the Sun ESP and FAS families of controllers # isp: Qlogic ISP 1020, 1040 and 1040B PCI SCSI host adapters, # ISP 1240 Dual Ultra SCSI, ISP 1080 and 1280 (Dual) Ultra2, # ISP 12160 Ultra3 SCSI, Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Mon Nov 7 13:18:09 2011 (r227304) +++ stable/9/sys/conf/files Mon Nov 7 13:40:54 2011 (r227305) @@ -1064,6 +1064,7 @@ dev/ep/if_ep_eisa.c optional ep eisa dev/ep/if_ep_isa.c optional ep isa dev/ep/if_ep_mca.c optional ep mca dev/ep/if_ep_pccard.c optional ep pccard +dev/esp/esp_pci.c optional esp pci dev/esp/ncr53c9x.c optional esp dev/ex/if_ex.c optional ex dev/ex/if_ex_isa.c optional ex isa Copied: stable/9/sys/dev/esp/am53c974reg.h (from r227006, head/sys/dev/esp/am53c974reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/esp/am53c974reg.h Mon Nov 7 13:40:54 2011 (r227305, copy of r227006, head/sys/dev/esp/am53c974reg.h) @@ -0,0 +1,72 @@ +/* $NetBSD: pcscpreg.h,v 1.2 2008/04/28 20:23:55 martin Exp $ */ + +/*- + * Copyright (c) 1998 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Izumi Tsutsui. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef _AM53C974_H_ +#define _AM53C974_H_ + +/* + * Am53c974 DMA engine registers + */ + +#define DMA_CMD 0x40 /* Command */ +#define DMACMD_RSVD 0xFFFFFF28 /* reserved */ +#define DMACMD_DIR 0x00000080 /* Transfer Direction (read:1) */ +#define DMACMD_INTE 0x00000040 /* DMA Interrupt Enable */ +#define DMACMD_MDL 0x00000010 /* Map to Memory Description List */ +#define DMACMD_DIAG 0x00000004 /* Diagnostic */ +#define DMACMD_CMD 0x00000003 /* Command Code Bit */ +#define DMACMD_IDLE 0x00000000 /* Idle */ +#define DMACMD_BLAST 0x00000001 /* Blast */ +#define DMACMD_ABORT 0x00000002 /* Abort */ +#define DMACMD_START 0x00000003 /* Start */ + +#define DMA_STC 0x44 /* Start Transfer Count */ +#define DMA_SPA 0x48 /* Start Physical Address */ +#define DMA_WBC 0x4C /* Working Byte Counter */ +#define DMA_WAC 0x50 /* Working Address Counter */ + +#define DMA_STAT 0x54 /* Status Register */ +#define DMASTAT_RSVD 0xFFFFFF80 /* reserved */ +#define DMASTAT_PABT 0x00000040 /* PCI master/target Abort */ +#define DMASTAT_BCMP 0x00000020 /* BLAST Complete */ +#define DMASTAT_SINT 0x00000010 /* SCSI Interrupt */ +#define DMASTAT_DONE 0x00000008 /* DMA Transfer Terminated */ +#define DMASTAT_ABT 0x00000004 /* DMA Transfer Aborted */ +#define DMASTAT_ERR 0x00000002 /* DMA Transfer Error */ +#define DMASTAT_PWDN 0x00000001 /* Power Down Indicator */ + +#define DMA_SMDLA 0x58 /* Starting Memory Descpritor List Address */ +#define DMA_WMAC 0x5C /* Working MDL Counter */ +#define DMA_SBAC 0x70 /* SCSI Bus and Control */ + +#endif /* _AM53C974_H_ */ Copied: stable/9/sys/dev/esp/esp_pci.c (from r227006, head/sys/dev/esp/esp_pci.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/esp/esp_pci.c Mon Nov 7 13:40:54 2011 (r227305, copy of r227006, head/sys/dev/esp/esp_pci.c) @@ -0,0 +1,654 @@ +/*- + * Copyright (c) 2011 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $NetBSD: pcscp.c,v 1.45 2010/11/13 13:52:08 uebayasi Exp $ */ + +/*- + * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, + * NASA Ames Research Center; Izumi Tsutsui. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * esp_pci.c: device dependent code for AMD Am53c974 (PCscsi-PCI) + * written by Izumi Tsutsui + * + * Technical manual available at + * http://www.amd.com/files/connectivitysolutions/networking/archivednetworking/19113.pdf + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#define PCI_DEVICE_ID_AMD53C974 0x20201022 + +struct esp_pci_softc { + struct ncr53c9x_softc sc_ncr53c9x; /* glue to MI code */ + struct device *sc_dev; + + struct resource *sc_res[2]; +#define ESP_PCI_RES_INTR 0 +#define ESP_PCI_RES_IO 1 + + bus_dma_tag_t sc_pdmat; + + bus_dma_tag_t sc_xferdmat; /* DMA tag for transfers */ + bus_dmamap_t sc_xferdmam; /* DMA map for transfers */ + + void *sc_ih; /* interrupt handler */ + + size_t sc_dmasize; /* DMA size */ + void **sc_dmaaddr; /* DMA address */ + size_t *sc_dmalen; /* DMA length */ + int sc_active; /* DMA state */ + int sc_datain; /* DMA Data Direction */ +}; + +static struct resource_spec esp_pci_res_spec[] = { + { SYS_RES_IRQ, 0, RF_SHAREABLE | RF_ACTIVE }, /* ESP_PCI_RES_INTR */ + { SYS_RES_IOPORT, PCIR_BAR(0), RF_ACTIVE }, /* ESP_PCI_RES_IO */ + { -1, 0 } +}; + +#define READ_DMAREG(sc, reg) \ + bus_read_4((sc)->sc_res[ESP_PCI_RES_IO], (reg)) +#define WRITE_DMAREG(sc, reg, var) \ + bus_write_4((sc)->sc_res[ESP_PCI_RES_IO], (reg), (var)) + +#define READ_ESPREG(sc, reg) \ + bus_read_1((sc)->sc_res[ESP_PCI_RES_IO], (reg) << 2) +#define WRITE_ESPREG(sc, reg, val) \ + bus_write_1((sc)->sc_res[ESP_PCI_RES_IO], (reg) << 2, (val)) + +static int esp_pci_probe(device_t); +static int esp_pci_attach(device_t); +static int esp_pci_detach(device_t); +static int esp_pci_suspend(device_t); +static int esp_pci_resume(device_t); + +static device_method_t esp_pci_methods[] = { + DEVMETHOD(device_probe, esp_pci_probe), + DEVMETHOD(device_attach, esp_pci_attach), + DEVMETHOD(device_detach, esp_pci_detach), + DEVMETHOD(device_suspend, esp_pci_suspend), + DEVMETHOD(device_resume, esp_pci_resume), + + KOBJMETHOD_END +}; + +static driver_t esp_pci_driver = { + "esp", + esp_pci_methods, + sizeof(struct esp_pci_softc) +}; + +DRIVER_MODULE(esp, pci, esp_pci_driver, esp_devclass, 0, 0); +MODULE_DEPEND(esp, pci, 1, 1, 1); + +/* + * Functions and the switch for the MI code + */ +static void esp_pci_dma_go(struct ncr53c9x_softc *); +static int esp_pci_dma_intr(struct ncr53c9x_softc *); +static int esp_pci_dma_isactive(struct ncr53c9x_softc *); + +static int esp_pci_dma_isintr(struct ncr53c9x_softc *); +static void esp_pci_dma_reset(struct ncr53c9x_softc *); +static int esp_pci_dma_setup(struct ncr53c9x_softc *, void **, size_t *, + int, size_t *); +static void esp_pci_dma_stop(struct ncr53c9x_softc *); +static void esp_pci_write_reg(struct ncr53c9x_softc *, int, uint8_t); +static uint8_t esp_pci_read_reg(struct ncr53c9x_softc *, int); +static void esp_pci_xfermap(void *arg, bus_dma_segment_t *segs, int nseg, + int error); + +static struct ncr53c9x_glue esp_pci_glue = { + esp_pci_read_reg, + esp_pci_write_reg, + esp_pci_dma_isintr, + esp_pci_dma_reset, + esp_pci_dma_intr, + esp_pci_dma_setup, + esp_pci_dma_go, + esp_pci_dma_stop, + esp_pci_dma_isactive, +}; + +static int +esp_pci_probe(device_t dev) +{ + + if (pci_get_devid(dev) == PCI_DEVICE_ID_AMD53C974) { + device_set_desc(dev, "AMD Am53C974 Fast-SCSI"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +/* + * Attach this instance, and then all the sub-devices + */ +static int +esp_pci_attach(device_t dev) +{ + struct esp_pci_softc *esc; + struct ncr53c9x_softc *sc; + int error; + + esc = device_get_softc(dev); + sc = &esc->sc_ncr53c9x; + + NCR_LOCK_INIT(sc); + + esc->sc_dev = dev; + sc->sc_glue = &esp_pci_glue; + + pci_enable_busmaster(dev); + + error = bus_alloc_resources(dev, esp_pci_res_spec, esc->sc_res); + if (error != 0) { + device_printf(dev, "failed to allocate resources\n"); + bus_release_resources(dev, esp_pci_res_spec, esc->sc_res); + return (error); + } + + error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE_32BIT, BUS_SPACE_UNRESTRICTED, + BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &esc->sc_pdmat); + if (error != 0) { + device_printf(dev, "cannot create parent DMA tag\n"); + goto fail_res; + } + + /* + * XXX More of this should be in ncr53c9x_attach(), but + * XXX should we really poke around the chip that much in + * XXX the MI code? Think about this more... + */ + + /* + * Set up static configuration info. + * + * XXX we should read the configuration from the EEPROM. + */ + sc->sc_id = 7; + sc->sc_cfg1 = sc->sc_id | NCRCFG1_PARENB; + sc->sc_cfg2 = NCRCFG2_SCSI2 | NCRCFG2_FE; + sc->sc_cfg3 = NCRAMDCFG3_IDM | NCRAMDCFG3_FCLK; + sc->sc_cfg4 = NCRAMDCFG4_GE12NS | NCRAMDCFG4_RADE; + sc->sc_rev = NCR_VARIANT_AM53C974; + sc->sc_features = NCR_F_FASTSCSI | NCR_F_DMASELECT; + sc->sc_cfg3_fscsi = NCRAMDCFG3_FSCSI; + sc->sc_freq = 40; /* MHz */ + + /* + * This is the value used to start sync negotiations + * Note that the NCR register "SYNCTP" is programmed + * in "clocks per byte", and has a minimum value of 4. + * The SCSI period used in negotiation is one-fourth + * of the time (in nanoseconds) needed to transfer one byte. + * Since the chip's clock is given in MHz, we have the following + * formula: 4 * period = (1000 / freq) * 4 + */ + sc->sc_minsync = 1000 / sc->sc_freq; + + sc->sc_maxxfer = DFLTPHYS; /* see below */ + sc->sc_maxoffset = 15; + sc->sc_extended_geom = 1; + +#define MDL_SEG_SIZE 0x1000 /* 4kbyte per segment */ + + /* + * Create the DMA tag and map for the data transfers. + * + * Note: given that bus_dma(9) only adheres to the requested alignment + * for the first segment (and that also only for bus_dmamem_alloc()ed + * DMA maps) we can't use the Memory Descriptor List. However, also + * when not using the MDL, the maximum transfer size apparently is + * limited to 4k so we have to split transfers up, which plain sucks. + */ + error = bus_dma_tag_create(esc->sc_pdmat, PAGE_SIZE, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + MDL_SEG_SIZE, 1, MDL_SEG_SIZE, BUS_DMA_ALLOCNOW, + busdma_lock_mutex, &sc->sc_lock, &esc->sc_xferdmat); + if (error != 0) { + device_printf(dev, "cannot create transfer DMA tag\n"); + goto fail_pdmat; + } + error = bus_dmamap_create(esc->sc_xferdmat, 0, &esc->sc_xferdmam); + if (error != 0) { + device_printf(dev, "cannnot create transfer DMA map\n"); + goto fail_xferdmat; + } + + error = bus_setup_intr(dev, esc->sc_res[ESP_PCI_RES_INTR], + INTR_MPSAFE | INTR_TYPE_CAM, NULL, ncr53c9x_intr, sc, + &esc->sc_ih); + if (error != 0) { + device_printf(dev, "cannot set up interrupt\n"); + goto fail_xferdmam; + } + + /* Do the common parts of attachment. */ + sc->sc_dev = esc->sc_dev; + error = ncr53c9x_attach(sc); + if (error != 0) { + device_printf(esc->sc_dev, "ncr53c9x_attach failed\n"); + goto fail_intr; + } + + return (0); + + fail_intr: + bus_teardown_intr(esc->sc_dev, esc->sc_res[ESP_PCI_RES_INTR], + esc->sc_ih); + fail_xferdmam: + bus_dmamap_destroy(esc->sc_xferdmat, esc->sc_xferdmam); + fail_xferdmat: + bus_dma_tag_destroy(esc->sc_xferdmat); + fail_pdmat: + bus_dma_tag_destroy(esc->sc_pdmat); + fail_res: + bus_release_resources(dev, esp_pci_res_spec, esc->sc_res); + NCR_LOCK_DESTROY(sc); + + return (error); +} + +static int +esp_pci_detach(device_t dev) +{ + struct ncr53c9x_softc *sc; + struct esp_pci_softc *esc; + int error; + + esc = device_get_softc(dev); + sc = &esc->sc_ncr53c9x; + + bus_teardown_intr(esc->sc_dev, esc->sc_res[ESP_PCI_RES_INTR], + esc->sc_ih); + error = ncr53c9x_detach(sc); + if (error != 0) + return (error); + bus_dmamap_destroy(esc->sc_xferdmat, esc->sc_xferdmam); + bus_dma_tag_destroy(esc->sc_xferdmat); + bus_dma_tag_destroy(esc->sc_pdmat); + bus_release_resources(dev, esp_pci_res_spec, esc->sc_res); + NCR_LOCK_DESTROY(sc); + + return (0); +} + +static int +esp_pci_suspend(device_t dev) +{ + + return (ENXIO); +} + +static int +esp_pci_resume(device_t dev) +{ + + return (ENXIO); +} + +static void +esp_pci_xfermap(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)arg; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: bad transfer segment count %d", __func__, + nsegs)); + KASSERT(segs[0].ds_len <= MDL_SEG_SIZE, + ("%s: bad transfer segment length %ld", __func__, + (long)segs[0].ds_len)); + + /* Program the DMA Starting Physical Address. */ + WRITE_DMAREG(esc, DMA_SPA, segs[0].ds_addr); +} + +/* + * Glue functions + */ + +static uint8_t +esp_pci_read_reg(struct ncr53c9x_softc *sc, int reg) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + return (READ_ESPREG(esc, reg)); +} + +static void +esp_pci_write_reg(struct ncr53c9x_softc *sc, int reg, uint8_t v) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + WRITE_ESPREG(esc, reg, v); +} + +static int +esp_pci_dma_isintr(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + return (READ_ESPREG(esc, NCR_STAT) & NCRSTAT_INT) != 0; +} + +static void +esp_pci_dma_reset(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE); + + esc->sc_active = 0; +} + +static int +esp_pci_dma_intr(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + bus_dma_tag_t xferdmat; + bus_dmamap_t xferdmam; + size_t dmasize; + int datain, i, resid, trans; + uint32_t dmastat; + char *p = NULL; + + xferdmat = esc->sc_xferdmat; + xferdmam = esc->sc_xferdmam; + datain = esc->sc_datain; + + dmastat = READ_DMAREG(esc, DMA_STAT); + + if ((dmastat & DMASTAT_ERR) != 0) { + /* XXX not tested... */ + WRITE_DMAREG(esc, DMA_CMD, DMACMD_ABORT | (datain != 0 ? + DMACMD_DIR : 0)); + + device_printf(esc->sc_dev, "DMA error detected; Aborting.\n"); + bus_dmamap_sync(xferdmat, xferdmam, datain != 0 ? + BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(xferdmat, xferdmam); + return (-1); + } + + if ((dmastat & DMASTAT_ABT) != 0) { + /* XXX what should be done? */ + device_printf(esc->sc_dev, "DMA aborted.\n"); + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | (datain != 0 ? + DMACMD_DIR : 0)); + esc->sc_active = 0; + return (0); + } + + KASSERT(esc->sc_active != 0, ("%s: DMA wasn't active", __func__)); + + /* DMA has stopped. */ + + esc->sc_active = 0; + + dmasize = esc->sc_dmasize; + if (dmasize == 0) { + /* A "Transfer Pad" operation completed. */ + NCR_DMA(("%s: discarded %d bytes (tcl=%d, tcm=%d)\n", + __func__, READ_ESPREG(esc, NCR_TCL) | + (READ_ESPREG(esc, NCR_TCM) << 8), + READ_ESPREG(esc, NCR_TCL), READ_ESPREG(esc, NCR_TCM))); + return (0); + } + + resid = 0; + /* + * If a transfer onto the SCSI bus gets interrupted by the device + * (e.g. for a SAVEPOINTER message), the data in the FIFO counts + * as residual since the ESP counter registers get decremented as + * bytes are clocked into the FIFO. + */ + if (datain == 0 && + (resid = (READ_ESPREG(esc, NCR_FFLAG) & NCRFIFO_FF)) != 0) + NCR_DMA(("%s: empty esp FIFO of %d ", __func__, resid)); + + if ((sc->sc_espstat & NCRSTAT_TC) == 0) { + /* + * "Terminal count" is off, so read the residue + * out of the ESP counter registers. + */ + if (datain != 0) { + resid = READ_ESPREG(esc, NCR_FFLAG) & NCRFIFO_FF; + while (resid > 1) + resid = + READ_ESPREG(esc, NCR_FFLAG) & NCRFIFO_FF; + WRITE_DMAREG(esc, DMA_CMD, DMACMD_BLAST | DMACMD_DIR); + + for (i = 0; i < 0x8000; i++) /* XXX 0x8000 ? */ + if ((READ_DMAREG(esc, DMA_STAT) & + DMASTAT_BCMP) != 0) + break; + + /* See the below comments... */ + if (resid != 0) + p = *esc->sc_dmaaddr; + } + + resid += READ_ESPREG(esc, NCR_TCL) | + (READ_ESPREG(esc, NCR_TCM) << 8) | + (READ_ESPREG(esc, NCR_TCH) << 16); + } else + while ((dmastat & DMASTAT_DONE) == 0) + dmastat = READ_DMAREG(esc, DMA_STAT); + + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | (datain != 0 ? + DMACMD_DIR : 0)); + + /* Sync the transfer buffer. */ + bus_dmamap_sync(xferdmat, xferdmam, datain != 0 ? + BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(xferdmat, xferdmam); + + trans = dmasize - resid; + + /* + * From the technical manual notes: + * + * "In some odd byte conditions, one residual byte will be left + * in the SCSI FIFO, and the FIFO flags will never count to 0. + * When this happens, the residual byte should be retrieved + * via PIO following completion of the BLAST operation." + */ + if (p != NULL) { + p += trans; + *p = READ_ESPREG(esc, NCR_FIFO); + trans++; + } + + if (trans < 0) { /* transferred < 0 ? */ +#if 0 + /* + * This situation can happen in perfectly normal operation + * if the ESP is reselected while using DMA to select + * another target. As such, don't print the warning. + */ + device_printf(dev, "xfer (%d) > req (%d)\n", trans, dmasize); +#endif + trans = dmasize; + } + + NCR_DMA(("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n", __func__, + READ_ESPREG(esc, NCR_TCL), READ_ESPREG(esc, NCR_TCM), + READ_ESPREG(esc, NCR_TCH), trans, resid)); + + *esc->sc_dmalen -= trans; + *esc->sc_dmaaddr = (char *)*esc->sc_dmaaddr + trans; + + return (0); +} + +static int +esp_pci_dma_setup(struct ncr53c9x_softc *sc, void **addr, size_t *len, + int datain, size_t *dmasize) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + int error; + + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | (datain != 0 ? DMACMD_DIR : + 0)); + + *dmasize = esc->sc_dmasize = ulmin(*dmasize, MDL_SEG_SIZE); + esc->sc_dmaaddr = addr; + esc->sc_dmalen = len; + esc->sc_datain = datain; + + /* + * There's no need to set up DMA for a "Transfer Pad" operation. + */ + if (*dmasize == 0) + return (0); + + /* Set the transfer length. */ + WRITE_DMAREG(esc, DMA_STC, *dmasize); + + /* + * Load the transfer buffer and program the DMA address. + * Note that the NCR53C9x core can't handle EINPROGRESS so we set + * BUS_DMA_NOWAIT. + */ + error = bus_dmamap_load(esc->sc_xferdmat, esc->sc_xferdmam, + *esc->sc_dmaaddr, *dmasize, esp_pci_xfermap, sc, BUS_DMA_NOWAIT); + + return (error); +} + +static void +esp_pci_dma_go(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + int datain; + + datain = esc->sc_datain; + + /* No DMA transfer for a "Transfer Pad" operation */ + if (esc->sc_dmasize == 0) + return; + + /* Sync the transfer buffer. */ + bus_dmamap_sync(esc->sc_xferdmat, esc->sc_xferdmam, datain != 0 ? + BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE); + + /* Set the DMA engine to the IDLE state. */ + /* XXX DMA Transfer Interrupt Enable bit is broken? */ + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | /* DMACMD_INTE | */ + (datain != 0 ? DMACMD_DIR : 0)); + + /* Issue a DMA start command. */ + WRITE_DMAREG(esc, DMA_CMD, DMACMD_START | /* DMACMD_INTE | */ + (datain != 0 ? DMACMD_DIR : 0)); + + esc->sc_active = 1; +} + +static void +esp_pci_dma_stop(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + /* DMA stop */ + /* XXX what should we do here ? */ + WRITE_DMAREG(esc, DMA_CMD, + DMACMD_ABORT | (esc->sc_datain != 0 ? DMACMD_DIR : 0)); + bus_dmamap_unload(esc->sc_xferdmat, esc->sc_xferdmam); + + esc->sc_active = 0; +} + +static int +esp_pci_dma_isactive(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-freebsd-scsi@FreeBSD.ORG Mon Nov 7 13:50:12 2011 Return-Path: Delivered-To: freebsd-scsi@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62205106564A for ; Mon, 7 Nov 2011 13:50:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 17FB78FC15 for ; Mon, 7 Nov 2011 13:50:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7DoCbI033664 for ; Mon, 7 Nov 2011 13:50:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id pA7DoCpY033663; Mon, 7 Nov 2011 13:50:12 GMT (envelope-from gnats) Date: Mon, 7 Nov 2011 13:50:12 GMT Message-Id: <201111071350.pA7DoCpY033663@freefall.freebsd.org> To: freebsd-scsi@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: kern/124667: commit references a PR X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 13:50:12 -0000 The following reply was made to PR kern/124667; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/124667: commit references a PR Date: Mon, 7 Nov 2011 13:45:30 +0000 (UTC) Author: marius Date: Mon Nov 7 13:45:18 2011 New Revision: 227306 URL: http://svn.freebsd.org/changeset/base/227306 Log: MFC: r227006, r227281, r227282 Add a PCI front-end to esp(4) allowing it to support AMD Am53C974 and replace amd(4) with the former in the amd64, i386 and pc98 GENERIC kernel configuration files. Besides duplicating functionality, amd(4), which previously also supported the AMD Am53C974, unlike esp(4) is no longer maintained and has accumulated enough bit rot over time to always cause a panic during boot as long as at least one target is attached to it (see PR 124667). PR: 124667 Obtained from: NetBSD (based on) Added: stable/8/sys/dev/esp/am53c974reg.h - copied unchanged from r227006, head/sys/dev/esp/am53c974reg.h stable/8/sys/dev/esp/esp_pci.c - copied unchanged from r227006, head/sys/dev/esp/esp_pci.c Modified: stable/8/UPDATING (contents, props changed) stable/8/share/man/man4/esp.4 stable/8/sys/amd64/conf/GENERIC stable/8/sys/conf/NOTES stable/8/sys/conf/files stable/8/sys/i386/conf/GENERIC stable/8/sys/modules/Makefile stable/8/sys/modules/esp/Makefile stable/8/sys/pc98/conf/GENERIC stable/8/sys/sparc64/conf/GENERIC Directory Properties: stable/8/ (props changed) stable/8/COPYRIGHT (props changed) stable/8/LOCKS (props changed) stable/8/MAINTAINERS (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/README (props changed) stable/8/bin/ (props changed) stable/8/bin/chio/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/date/ (props changed) stable/8/bin/df/ (props changed) stable/8/bin/echo/ (props changed) stable/8/bin/ed/ (props changed) stable/8/bin/expr/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/kenv/ (props changed) stable/8/bin/kill/ (props changed) stable/8/bin/ln/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/pwait/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/bin/sleep/ (props changed) stable/8/bin/stty/ (props changed) stable/8/bin/test/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/dtracetoolkit/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/sbin/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/libstdc++/ (props changed) stable/8/contrib/lukemftp/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/one-true-awk/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/contrib/xz/AUTHORS (props changed) stable/8/contrib/xz/COPYING (props changed) stable/8/contrib/xz/ChangeLog (props changed) stable/8/contrib/xz/FREEBSD-Xlist (props changed) stable/8/contrib/xz/FREEBSD-upgrade (props changed) stable/8/contrib/xz/README (props changed) stable/8/contrib/xz/THANKS (props changed) stable/8/contrib/xz/TODO (props changed) stable/8/contrib/xz/po/ (props changed) stable/8/contrib/xz/src/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/grdc/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/lib/csu/ (props changed) stable/8/gnu/lib/libgcc/ (props changed) stable/8/gnu/lib/libstdc++/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/Makefile (props changed) stable/8/gnu/usr.bin/binutils/ld/ (props changed) stable/8/gnu/usr.bin/cc/cc_tools/ (props changed) stable/8/gnu/usr.bin/cc/include/ (props changed) stable/8/gnu/usr.bin/dialog/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/arch/sparc64/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/comsat/ (props changed) stable/8/libexec/ftpd/ (props changed) stable/8/libexec/rshd/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/tftpd/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) stable/8/rescue/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/conscontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fdisk/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/multipath/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/gvinum/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mdmfs/ (props changed) stable/8/sbin/mknod/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/mount_unionfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/quotacheck/ (props changed) stable/8/sbin/rcorder/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/route/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/shutdown/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/ (props changed) stable/8/secure/lib/libcrypto/ (props changed) stable/8/secure/lib/libssl/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/secure/usr.bin/openssl/ (props changed) stable/8/share/dict/ (props changed) stable/8/share/doc/papers/devfs/ (props changed) stable/8/share/doc/papers/jail/ (props changed) stable/8/share/doc/smm/01.setup/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/examples/cvsup/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/misc/bsd-family-tree (props changed) stable/8/share/mk/ (props changed) stable/8/share/skel/ (props changed) stable/8/share/syscons/ (props changed) stable/8/share/termcap/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acct/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/date/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/bin/test/ (props changed) stable/8/tools/regression/doat/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/netinet/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/sockets/unix_gc/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/test/malloc/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/aac/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/cfi/ (props changed) stable/8/tools/tools/ether_reflect/ (props changed) stable/8/tools/tools/iwi/ (props changed) stable/8/tools/tools/mctest/ (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/netblast/ (props changed) stable/8/tools/tools/netrate/netsend/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/bluetooth/ (props changed) stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) stable/8/usr.sbin/bluetooth/bthidd/ (props changed) stable/8/usr.sbin/bluetooth/l2control/ (props changed) stable/8/usr.sbin/bluetooth/l2ping/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/chown/ (props changed) stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/config/SMM.doc/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/crunch/examples/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/cxgbtool/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/ifmcstat/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/kbdmap/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/mailwrapper/ (props changed) stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/ (props changed) stable/8/usr.sbin/mountd/ (props changed) stable/8/usr.sbin/moused/ (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/named/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/nfsd/ (props changed) stable/8/usr.sbin/nfsdumpstate/ (props changed) stable/8/usr.sbin/nfsuserd/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/portsnap/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/pw/ (props changed) stable/8/usr.sbin/rpc.lockd/ (props changed) stable/8/usr.sbin/rpc.statd/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rpcbind/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/sade/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/services_mkdb/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/tcpdrop/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/tzsetup/ (props changed) stable/8/usr.sbin/uathload/ (props changed) stable/8/usr.sbin/ugidfw/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/usbdump/ (props changed) stable/8/usr.sbin/vidcontrol/ (props changed) stable/8/usr.sbin/watchdogd/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Mon Nov 7 13:40:54 2011 (r227305) +++ stable/8/UPDATING Mon Nov 7 13:45:18 2011 (r227306) @@ -15,6 +15,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20111101: + The broken amd(4) driver has been replaced with esp(4) in the amd64, + i386 and pc98 GENERIC kernel configuration files. + 20110606: A new version of ZFS (version 28) has been merged. This version does not depend on a python library and the Modified: stable/8/share/man/man4/esp.4 ============================================================================== --- stable/8/share/man/man4/esp.4 Mon Nov 7 13:40:54 2011 (r227305) +++ stable/8/share/man/man4/esp.4 Mon Nov 7 13:45:18 2011 (r227306) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2004 Tom Rhodes +.\" Copyright (c) 2011 Marius Strobl .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,158 +25,91 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2005 +.Dd November 1, 2011 .Dt ESP 4 .Os .Sh NAME .Nm esp -.Nd Qlogic FEPS and FAS366 SCSI driver +.Nd Emulex ESP, NCR 53C9x and QLogic FAS families based SCSI controllers .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your +To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device scbus" .Cd "device esp" .Ed -.Sh HARDWARE +.Pp +Alternatively, to load the driver as a module at boot time, place the +following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_esp_load="YES" +.Ed +.Sh DESCRIPTION The .Nm driver provides support for the -.Tn Qlogic -FAS216 and FAS408 +.Tn AMD +Am53C974, the +.Tn Emulex +ESP100, ESP100A, ESP200 and ESP406, the +.Tn NCR +53C90, 53C94 and 53C96 as well as the +.Tn QLogic +FAS100A, FAS216, FAS366 and FAS408 .Tn SCSI controller chips found in a wide variety of systems and peripheral boards. -This includes the -.Tn Qlogic -.Tn SCSI -cards found in most -.Tn Sun -.Tn Ultra 1e -and -.Tn Ultra 2 -machines. -.Pp -For -.Tn Qlogic -.Tn PCI -.Tn SCSI -host adapters, the -.Xr isp 4 -driver should be used in place of the -.Nm -driver. -.Sh IMPLEMENTATION NOTES -During the boot sequence, the +.Sh HARDWARE +Controllers supported by the .Nm -driver -searches the linked list for LUN info by LUN ID. -At this point the driver will attach on that instance, -and then attempt to attach every sub-device. -.Pp -There are at least 4 variations of the -configuration 3 register. -A second config register must be loaded to inquire the chip revision, -otherwise the -.Fn ncr53c9x_reset -function will not set the defaults correctly. -.Pp -The drive attach routine attempts to set the appropriate -bit to put the chip into Fast -.Tn SCSI -mode so that it does not -have to be figured out each time. -This will then be stored in the -.Tn NCR -registers for later use. +driver include: .Pp -The -.Nm -driver makes use of the -.Tn LSI -64854 -.Tn DMA -engine which contains three independent -channels designed to interface with -an NCR539X -.Tn SCSI -controller; -an AM7990 Ethernet controller; -and certain types of parallel port hardware. -As such this driver may eventually replace the -.Xr amd 4 -driver for network hardware. -.Sh DIAGNOSTICS -The following driver specific error messages -may be reported: -.Bl -diag -.It "esp: cannot map %d segments" -The device was unable to map segments while mapping the -.Tn SCSI -devices in -.Tn DMA -mode. -.It "unknown variant %d, devices not attached" -An unknown version of the card was found and devices will -not be attached. -.It "Unhandled function code %d" -The device returned a function code which the driver is -unable to handle, most likely during negotiation. -.It "esp:%d:%d: selection failed %d left in FIFO" -The target left the command phase prematurely. -If a command did not reach the device then it will -be reported as shown above. -.It "invalid state: %d" -The device has reached an invalid state. -.El -.Sh SEE ALSO -.Xr amd 4 , -.Xr isp 4 , -.Xr scbus 4 , -.Xr camcontrol 8 -.Pp -.Bl -item -compact +.Bl -bullet -compact +.It +MELCO IFC-DP (PC-98) +.It +Sun ESP family +.It +Sun FAS family .It -.Pa http://www.qlc.com/ +Tekram DC390 .It -.Pa http://www.sun.com/ +Tekram DC390T .El +.Sh SEE ALSO +.Xr cd 4 , +.Xr ch 4 , +.Xr da 4 , +.Xr intro 4 , +.Xr pci 4 , +.Xr sa 4 , +.Xr sbus 4 , +.Xr scsi 4 , +.Xr camcontrol 8 .Sh HISTORY The .Nm -driver was written for -.Nx -by -.An Eric S. Hvozda . +driver first appeared in +.Nx 1.3 . +The first +.Fx +version to include it was +.Fx 5.3 . +.Sh AUTHORS +.An -nosplit The .Nm -driver was then ported to -.Fx 5.3 +driver was ported to +.Fx by -.An Scott Long Aq scottl@FreeBSD.org . -.Sh AUTHORS -This manual page was written by -.An Tom Rhodes Aq trhodes@FreeBSD.org -instead of porting the original from -.Nx . +.An Scott Long +.Aq scottl@FreeBSD.org +and later on considerably improved by +.An Marius Strobl +.Aq marius@FreeBSD.org . .Sh BUGS The .Nm -driver includes the sbus front-end but lacks the -.Tn PCI -front-end. -Thus it can only support the -.Tn FEPS/FAS366 -.Tn SCSI -found in -.Tn Sun -.Tn Ultra 1e -and -.Tn Ultra 2 -machines at this time. -.Pp -This driver should eventually replace the -.Xr amd 4 -driver, but that requires porting the -.Tn PCI -front-end mentioned above. +driver should read the EEPROM settings of +.Tn Tekram +controllers. Modified: stable/8/sys/amd64/conf/GENERIC ============================================================================== --- stable/8/sys/amd64/conf/GENERIC Mon Nov 7 13:40:54 2011 (r227305) +++ stable/8/sys/amd64/conf/GENERIC Mon Nov 7 13:45:18 2011 (r227306) @@ -108,7 +108,7 @@ options AHC_REG_PRETTY_PRINT # Print re device ahd # AHA39320/29320 and onboard AIC79xx devices options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. -device amd # AMD 53C974 (Tekram DC-390(T)) +device esp # AMD Am53C974 (Tekram DC-390(T)) device hptiop # Highpoint RocketRaid 3xxx series device isp # Qlogic family #device ispfw # Firmware for QLogic HBAs- normally a module Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Mon Nov 7 13:40:54 2011 (r227305) +++ stable/8/sys/conf/NOTES Mon Nov 7 13:45:18 2011 (r227306) @@ -1434,7 +1434,9 @@ options TEKEN_XTERM # xterm-style term # such as the Tekram DC-390(T). # bt: Most Buslogic controllers: including BT-445, BT-54x, BT-64x, BT-74x, # BT-75x, BT-946, BT-948, BT-956, BT-958, SDC3211B, SDC3211F, SDC3222F -# esp: NCR53c9x. Only for SBUS hardware right now. +# esp: Emulex ESP, NCR 53C9x and QLogic FAS families based controllers +# including the AMD Am53C974 (found on devices such as the Tekram +# DC-390(T)) and the Sun ESP and FAS families of controllers # isp: Qlogic ISP 1020, 1040 and 1040B PCI SCSI host adapters, # ISP 1240 Dual Ultra SCSI, ISP 1080 and 1280 (Dual) Ultra2, # ISP 12160 Ultra3 SCSI, Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Mon Nov 7 13:40:54 2011 (r227305) +++ stable/8/sys/conf/files Mon Nov 7 13:45:18 2011 (r227306) @@ -959,6 +959,7 @@ dev/ep/if_ep_eisa.c optional ep eisa dev/ep/if_ep_isa.c optional ep isa dev/ep/if_ep_mca.c optional ep mca dev/ep/if_ep_pccard.c optional ep pccard +dev/esp/esp_pci.c optional esp pci dev/esp/ncr53c9x.c optional esp dev/ex/if_ex.c optional ex dev/ex/if_ex_isa.c optional ex isa Copied: stable/8/sys/dev/esp/am53c974reg.h (from r227006, head/sys/dev/esp/am53c974reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/esp/am53c974reg.h Mon Nov 7 13:45:18 2011 (r227306, copy of r227006, head/sys/dev/esp/am53c974reg.h) @@ -0,0 +1,72 @@ +/* $NetBSD: pcscpreg.h,v 1.2 2008/04/28 20:23:55 martin Exp $ */ + +/*- + * Copyright (c) 1998 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Izumi Tsutsui. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef _AM53C974_H_ +#define _AM53C974_H_ + +/* + * Am53c974 DMA engine registers + */ + +#define DMA_CMD 0x40 /* Command */ +#define DMACMD_RSVD 0xFFFFFF28 /* reserved */ +#define DMACMD_DIR 0x00000080 /* Transfer Direction (read:1) */ +#define DMACMD_INTE 0x00000040 /* DMA Interrupt Enable */ +#define DMACMD_MDL 0x00000010 /* Map to Memory Description List */ +#define DMACMD_DIAG 0x00000004 /* Diagnostic */ +#define DMACMD_CMD 0x00000003 /* Command Code Bit */ +#define DMACMD_IDLE 0x00000000 /* Idle */ +#define DMACMD_BLAST 0x00000001 /* Blast */ +#define DMACMD_ABORT 0x00000002 /* Abort */ +#define DMACMD_START 0x00000003 /* Start */ + +#define DMA_STC 0x44 /* Start Transfer Count */ +#define DMA_SPA 0x48 /* Start Physical Address */ +#define DMA_WBC 0x4C /* Working Byte Counter */ +#define DMA_WAC 0x50 /* Working Address Counter */ + +#define DMA_STAT 0x54 /* Status Register */ +#define DMASTAT_RSVD 0xFFFFFF80 /* reserved */ +#define DMASTAT_PABT 0x00000040 /* PCI master/target Abort */ +#define DMASTAT_BCMP 0x00000020 /* BLAST Complete */ +#define DMASTAT_SINT 0x00000010 /* SCSI Interrupt */ +#define DMASTAT_DONE 0x00000008 /* DMA Transfer Terminated */ +#define DMASTAT_ABT 0x00000004 /* DMA Transfer Aborted */ +#define DMASTAT_ERR 0x00000002 /* DMA Transfer Error */ +#define DMASTAT_PWDN 0x00000001 /* Power Down Indicator */ + +#define DMA_SMDLA 0x58 /* Starting Memory Descpritor List Address */ +#define DMA_WMAC 0x5C /* Working MDL Counter */ +#define DMA_SBAC 0x70 /* SCSI Bus and Control */ + +#endif /* _AM53C974_H_ */ Copied: stable/8/sys/dev/esp/esp_pci.c (from r227006, head/sys/dev/esp/esp_pci.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/esp/esp_pci.c Mon Nov 7 13:45:18 2011 (r227306, copy of r227006, head/sys/dev/esp/esp_pci.c) @@ -0,0 +1,654 @@ +/*- + * Copyright (c) 2011 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $NetBSD: pcscp.c,v 1.45 2010/11/13 13:52:08 uebayasi Exp $ */ + +/*- + * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, + * NASA Ames Research Center; Izumi Tsutsui. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * esp_pci.c: device dependent code for AMD Am53c974 (PCscsi-PCI) + * written by Izumi Tsutsui + * + * Technical manual available at + * http://www.amd.com/files/connectivitysolutions/networking/archivednetworking/19113.pdf + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#define PCI_DEVICE_ID_AMD53C974 0x20201022 + +struct esp_pci_softc { + struct ncr53c9x_softc sc_ncr53c9x; /* glue to MI code */ + struct device *sc_dev; + + struct resource *sc_res[2]; +#define ESP_PCI_RES_INTR 0 +#define ESP_PCI_RES_IO 1 + + bus_dma_tag_t sc_pdmat; + + bus_dma_tag_t sc_xferdmat; /* DMA tag for transfers */ + bus_dmamap_t sc_xferdmam; /* DMA map for transfers */ + + void *sc_ih; /* interrupt handler */ + + size_t sc_dmasize; /* DMA size */ + void **sc_dmaaddr; /* DMA address */ + size_t *sc_dmalen; /* DMA length */ + int sc_active; /* DMA state */ + int sc_datain; /* DMA Data Direction */ +}; + +static struct resource_spec esp_pci_res_spec[] = { + { SYS_RES_IRQ, 0, RF_SHAREABLE | RF_ACTIVE }, /* ESP_PCI_RES_INTR */ + { SYS_RES_IOPORT, PCIR_BAR(0), RF_ACTIVE }, /* ESP_PCI_RES_IO */ + { -1, 0 } +}; + +#define READ_DMAREG(sc, reg) \ + bus_read_4((sc)->sc_res[ESP_PCI_RES_IO], (reg)) +#define WRITE_DMAREG(sc, reg, var) \ + bus_write_4((sc)->sc_res[ESP_PCI_RES_IO], (reg), (var)) + +#define READ_ESPREG(sc, reg) \ + bus_read_1((sc)->sc_res[ESP_PCI_RES_IO], (reg) << 2) +#define WRITE_ESPREG(sc, reg, val) \ + bus_write_1((sc)->sc_res[ESP_PCI_RES_IO], (reg) << 2, (val)) + +static int esp_pci_probe(device_t); +static int esp_pci_attach(device_t); +static int esp_pci_detach(device_t); +static int esp_pci_suspend(device_t); +static int esp_pci_resume(device_t); + +static device_method_t esp_pci_methods[] = { + DEVMETHOD(device_probe, esp_pci_probe), + DEVMETHOD(device_attach, esp_pci_attach), + DEVMETHOD(device_detach, esp_pci_detach), + DEVMETHOD(device_suspend, esp_pci_suspend), + DEVMETHOD(device_resume, esp_pci_resume), + + KOBJMETHOD_END +}; + +static driver_t esp_pci_driver = { + "esp", + esp_pci_methods, + sizeof(struct esp_pci_softc) +}; + +DRIVER_MODULE(esp, pci, esp_pci_driver, esp_devclass, 0, 0); +MODULE_DEPEND(esp, pci, 1, 1, 1); + +/* + * Functions and the switch for the MI code + */ +static void esp_pci_dma_go(struct ncr53c9x_softc *); +static int esp_pci_dma_intr(struct ncr53c9x_softc *); +static int esp_pci_dma_isactive(struct ncr53c9x_softc *); + +static int esp_pci_dma_isintr(struct ncr53c9x_softc *); +static void esp_pci_dma_reset(struct ncr53c9x_softc *); +static int esp_pci_dma_setup(struct ncr53c9x_softc *, void **, size_t *, + int, size_t *); +static void esp_pci_dma_stop(struct ncr53c9x_softc *); +static void esp_pci_write_reg(struct ncr53c9x_softc *, int, uint8_t); +static uint8_t esp_pci_read_reg(struct ncr53c9x_softc *, int); +static void esp_pci_xfermap(void *arg, bus_dma_segment_t *segs, int nseg, + int error); + +static struct ncr53c9x_glue esp_pci_glue = { + esp_pci_read_reg, + esp_pci_write_reg, + esp_pci_dma_isintr, + esp_pci_dma_reset, + esp_pci_dma_intr, + esp_pci_dma_setup, + esp_pci_dma_go, + esp_pci_dma_stop, + esp_pci_dma_isactive, +}; + +static int +esp_pci_probe(device_t dev) +{ + + if (pci_get_devid(dev) == PCI_DEVICE_ID_AMD53C974) { + device_set_desc(dev, "AMD Am53C974 Fast-SCSI"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +/* + * Attach this instance, and then all the sub-devices + */ +static int +esp_pci_attach(device_t dev) +{ + struct esp_pci_softc *esc; + struct ncr53c9x_softc *sc; + int error; + + esc = device_get_softc(dev); + sc = &esc->sc_ncr53c9x; + + NCR_LOCK_INIT(sc); + + esc->sc_dev = dev; + sc->sc_glue = &esp_pci_glue; + + pci_enable_busmaster(dev); + + error = bus_alloc_resources(dev, esp_pci_res_spec, esc->sc_res); + if (error != 0) { + device_printf(dev, "failed to allocate resources\n"); + bus_release_resources(dev, esp_pci_res_spec, esc->sc_res); + return (error); + } + + error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE_32BIT, BUS_SPACE_UNRESTRICTED, + BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &esc->sc_pdmat); + if (error != 0) { + device_printf(dev, "cannot create parent DMA tag\n"); + goto fail_res; + } + + /* + * XXX More of this should be in ncr53c9x_attach(), but + * XXX should we really poke around the chip that much in + * XXX the MI code? Think about this more... + */ + + /* + * Set up static configuration info. + * + * XXX we should read the configuration from the EEPROM. + */ + sc->sc_id = 7; + sc->sc_cfg1 = sc->sc_id | NCRCFG1_PARENB; + sc->sc_cfg2 = NCRCFG2_SCSI2 | NCRCFG2_FE; + sc->sc_cfg3 = NCRAMDCFG3_IDM | NCRAMDCFG3_FCLK; + sc->sc_cfg4 = NCRAMDCFG4_GE12NS | NCRAMDCFG4_RADE; + sc->sc_rev = NCR_VARIANT_AM53C974; + sc->sc_features = NCR_F_FASTSCSI | NCR_F_DMASELECT; + sc->sc_cfg3_fscsi = NCRAMDCFG3_FSCSI; + sc->sc_freq = 40; /* MHz */ + + /* + * This is the value used to start sync negotiations + * Note that the NCR register "SYNCTP" is programmed + * in "clocks per byte", and has a minimum value of 4. + * The SCSI period used in negotiation is one-fourth + * of the time (in nanoseconds) needed to transfer one byte. + * Since the chip's clock is given in MHz, we have the following + * formula: 4 * period = (1000 / freq) * 4 + */ + sc->sc_minsync = 1000 / sc->sc_freq; + + sc->sc_maxxfer = DFLTPHYS; /* see below */ + sc->sc_maxoffset = 15; + sc->sc_extended_geom = 1; + +#define MDL_SEG_SIZE 0x1000 /* 4kbyte per segment */ + + /* + * Create the DMA tag and map for the data transfers. + * + * Note: given that bus_dma(9) only adheres to the requested alignment + * for the first segment (and that also only for bus_dmamem_alloc()ed + * DMA maps) we can't use the Memory Descriptor List. However, also + * when not using the MDL, the maximum transfer size apparently is + * limited to 4k so we have to split transfers up, which plain sucks. + */ + error = bus_dma_tag_create(esc->sc_pdmat, PAGE_SIZE, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + MDL_SEG_SIZE, 1, MDL_SEG_SIZE, BUS_DMA_ALLOCNOW, + busdma_lock_mutex, &sc->sc_lock, &esc->sc_xferdmat); + if (error != 0) { + device_printf(dev, "cannot create transfer DMA tag\n"); + goto fail_pdmat; + } + error = bus_dmamap_create(esc->sc_xferdmat, 0, &esc->sc_xferdmam); + if (error != 0) { + device_printf(dev, "cannnot create transfer DMA map\n"); + goto fail_xferdmat; + } + + error = bus_setup_intr(dev, esc->sc_res[ESP_PCI_RES_INTR], + INTR_MPSAFE | INTR_TYPE_CAM, NULL, ncr53c9x_intr, sc, + &esc->sc_ih); + if (error != 0) { + device_printf(dev, "cannot set up interrupt\n"); + goto fail_xferdmam; + } + + /* Do the common parts of attachment. */ + sc->sc_dev = esc->sc_dev; + error = ncr53c9x_attach(sc); + if (error != 0) { + device_printf(esc->sc_dev, "ncr53c9x_attach failed\n"); + goto fail_intr; + } + + return (0); + + fail_intr: + bus_teardown_intr(esc->sc_dev, esc->sc_res[ESP_PCI_RES_INTR], + esc->sc_ih); + fail_xferdmam: + bus_dmamap_destroy(esc->sc_xferdmat, esc->sc_xferdmam); + fail_xferdmat: + bus_dma_tag_destroy(esc->sc_xferdmat); + fail_pdmat: + bus_dma_tag_destroy(esc->sc_pdmat); + fail_res: + bus_release_resources(dev, esp_pci_res_spec, esc->sc_res); + NCR_LOCK_DESTROY(sc); + + return (error); +} + +static int +esp_pci_detach(device_t dev) +{ + struct ncr53c9x_softc *sc; + struct esp_pci_softc *esc; + int error; + + esc = device_get_softc(dev); + sc = &esc->sc_ncr53c9x; + + bus_teardown_intr(esc->sc_dev, esc->sc_res[ESP_PCI_RES_INTR], + esc->sc_ih); + error = ncr53c9x_detach(sc); + if (error != 0) + return (error); + bus_dmamap_destroy(esc->sc_xferdmat, esc->sc_xferdmam); + bus_dma_tag_destroy(esc->sc_xferdmat); + bus_dma_tag_destroy(esc->sc_pdmat); + bus_release_resources(dev, esp_pci_res_spec, esc->sc_res); + NCR_LOCK_DESTROY(sc); + + return (0); +} + +static int +esp_pci_suspend(device_t dev) +{ + + return (ENXIO); +} + +static int +esp_pci_resume(device_t dev) +{ + + return (ENXIO); +} + +static void +esp_pci_xfermap(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)arg; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: bad transfer segment count %d", __func__, + nsegs)); + KASSERT(segs[0].ds_len <= MDL_SEG_SIZE, + ("%s: bad transfer segment length %ld", __func__, + (long)segs[0].ds_len)); + + /* Program the DMA Starting Physical Address. */ + WRITE_DMAREG(esc, DMA_SPA, segs[0].ds_addr); +} + +/* + * Glue functions + */ + +static uint8_t +esp_pci_read_reg(struct ncr53c9x_softc *sc, int reg) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + return (READ_ESPREG(esc, reg)); +} + +static void +esp_pci_write_reg(struct ncr53c9x_softc *sc, int reg, uint8_t v) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + WRITE_ESPREG(esc, reg, v); +} + +static int +esp_pci_dma_isintr(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + return (READ_ESPREG(esc, NCR_STAT) & NCRSTAT_INT) != 0; +} + +static void +esp_pci_dma_reset(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE); + + esc->sc_active = 0; +} + +static int +esp_pci_dma_intr(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + bus_dma_tag_t xferdmat; + bus_dmamap_t xferdmam; + size_t dmasize; + int datain, i, resid, trans; + uint32_t dmastat; + char *p = NULL; + + xferdmat = esc->sc_xferdmat; + xferdmam = esc->sc_xferdmam; + datain = esc->sc_datain; + + dmastat = READ_DMAREG(esc, DMA_STAT); + + if ((dmastat & DMASTAT_ERR) != 0) { + /* XXX not tested... */ + WRITE_DMAREG(esc, DMA_CMD, DMACMD_ABORT | (datain != 0 ? + DMACMD_DIR : 0)); + + device_printf(esc->sc_dev, "DMA error detected; Aborting.\n"); + bus_dmamap_sync(xferdmat, xferdmam, datain != 0 ? + BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(xferdmat, xferdmam); + return (-1); + } + + if ((dmastat & DMASTAT_ABT) != 0) { + /* XXX what should be done? */ + device_printf(esc->sc_dev, "DMA aborted.\n"); + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | (datain != 0 ? + DMACMD_DIR : 0)); + esc->sc_active = 0; + return (0); + } + + KASSERT(esc->sc_active != 0, ("%s: DMA wasn't active", __func__)); + + /* DMA has stopped. */ + + esc->sc_active = 0; + + dmasize = esc->sc_dmasize; + if (dmasize == 0) { + /* A "Transfer Pad" operation completed. */ + NCR_DMA(("%s: discarded %d bytes (tcl=%d, tcm=%d)\n", + __func__, READ_ESPREG(esc, NCR_TCL) | + (READ_ESPREG(esc, NCR_TCM) << 8), + READ_ESPREG(esc, NCR_TCL), READ_ESPREG(esc, NCR_TCM))); + return (0); + } + + resid = 0; + /* + * If a transfer onto the SCSI bus gets interrupted by the device + * (e.g. for a SAVEPOINTER message), the data in the FIFO counts + * as residual since the ESP counter registers get decremented as + * bytes are clocked into the FIFO. + */ + if (datain == 0 && + (resid = (READ_ESPREG(esc, NCR_FFLAG) & NCRFIFO_FF)) != 0) + NCR_DMA(("%s: empty esp FIFO of %d ", __func__, resid)); + + if ((sc->sc_espstat & NCRSTAT_TC) == 0) { + /* + * "Terminal count" is off, so read the residue + * out of the ESP counter registers. + */ + if (datain != 0) { + resid = READ_ESPREG(esc, NCR_FFLAG) & NCRFIFO_FF; + while (resid > 1) + resid = + READ_ESPREG(esc, NCR_FFLAG) & NCRFIFO_FF; + WRITE_DMAREG(esc, DMA_CMD, DMACMD_BLAST | DMACMD_DIR); + + for (i = 0; i < 0x8000; i++) /* XXX 0x8000 ? */ + if ((READ_DMAREG(esc, DMA_STAT) & + DMASTAT_BCMP) != 0) + break; + + /* See the below comments... */ + if (resid != 0) + p = *esc->sc_dmaaddr; + } + + resid += READ_ESPREG(esc, NCR_TCL) | + (READ_ESPREG(esc, NCR_TCM) << 8) | + (READ_ESPREG(esc, NCR_TCH) << 16); + } else + while ((dmastat & DMASTAT_DONE) == 0) + dmastat = READ_DMAREG(esc, DMA_STAT); + + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | (datain != 0 ? + DMACMD_DIR : 0)); + + /* Sync the transfer buffer. */ + bus_dmamap_sync(xferdmat, xferdmam, datain != 0 ? + BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(xferdmat, xferdmam); + + trans = dmasize - resid; + + /* + * From the technical manual notes: + * + * "In some odd byte conditions, one residual byte will be left + * in the SCSI FIFO, and the FIFO flags will never count to 0. + * When this happens, the residual byte should be retrieved + * via PIO following completion of the BLAST operation." + */ + if (p != NULL) { + p += trans; + *p = READ_ESPREG(esc, NCR_FIFO); + trans++; + } + + if (trans < 0) { /* transferred < 0 ? */ +#if 0 + /* + * This situation can happen in perfectly normal operation + * if the ESP is reselected while using DMA to select + * another target. As such, don't print the warning. + */ + device_printf(dev, "xfer (%d) > req (%d)\n", trans, dmasize); +#endif + trans = dmasize; + } + + NCR_DMA(("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n", __func__, + READ_ESPREG(esc, NCR_TCL), READ_ESPREG(esc, NCR_TCM), + READ_ESPREG(esc, NCR_TCH), trans, resid)); + + *esc->sc_dmalen -= trans; + *esc->sc_dmaaddr = (char *)*esc->sc_dmaaddr + trans; + + return (0); +} + +static int +esp_pci_dma_setup(struct ncr53c9x_softc *sc, void **addr, size_t *len, + int datain, size_t *dmasize) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + int error; + + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | (datain != 0 ? DMACMD_DIR : + 0)); + + *dmasize = esc->sc_dmasize = ulmin(*dmasize, MDL_SEG_SIZE); + esc->sc_dmaaddr = addr; + esc->sc_dmalen = len; + esc->sc_datain = datain; + + /* + * There's no need to set up DMA for a "Transfer Pad" operation. + */ + if (*dmasize == 0) + return (0); + + /* Set the transfer length. */ + WRITE_DMAREG(esc, DMA_STC, *dmasize); + + /* + * Load the transfer buffer and program the DMA address. + * Note that the NCR53C9x core can't handle EINPROGRESS so we set + * BUS_DMA_NOWAIT. + */ + error = bus_dmamap_load(esc->sc_xferdmat, esc->sc_xferdmam, + *esc->sc_dmaaddr, *dmasize, esp_pci_xfermap, sc, BUS_DMA_NOWAIT); + + return (error); +} + +static void +esp_pci_dma_go(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + int datain; + + datain = esc->sc_datain; + + /* No DMA transfer for a "Transfer Pad" operation */ + if (esc->sc_dmasize == 0) + return; + + /* Sync the transfer buffer. */ + bus_dmamap_sync(esc->sc_xferdmat, esc->sc_xferdmam, datain != 0 ? + BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE); + + /* Set the DMA engine to the IDLE state. */ + /* XXX DMA Transfer Interrupt Enable bit is broken? */ + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | /* DMACMD_INTE | */ + (datain != 0 ? DMACMD_DIR : 0)); + + /* Issue a DMA start command. */ + WRITE_DMAREG(esc, DMA_CMD, DMACMD_START | /* DMACMD_INTE | */ + (datain != 0 ? DMACMD_DIR : 0)); + + esc->sc_active = 1; +} + +static void +esp_pci_dma_stop(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + /* DMA stop */ + /* XXX what should we do here ? */ + WRITE_DMAREG(esc, DMA_CMD, + DMACMD_ABORT | (esc->sc_datain != 0 ? DMACMD_DIR : 0)); + bus_dmamap_unload(esc->sc_xferdmat, esc->sc_xferdmam); + + esc->sc_active = 0; +} + +static int +esp_pci_dma_isactive(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-freebsd-scsi@FreeBSD.ORG Mon Nov 7 13:50:13 2011 Return-Path: Delivered-To: freebsd-scsi@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E238B1065672 for ; Mon, 7 Nov 2011 13:50:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D17058FC13 for ; Mon, 7 Nov 2011 13:50:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7DoD9N033671 for ; Mon, 7 Nov 2011 13:50:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id pA7DoDu5033670; Mon, 7 Nov 2011 13:50:13 GMT (envelope-from gnats) Date: Mon, 7 Nov 2011 13:50:13 GMT Message-Id: <201111071350.pA7DoDu5033670@freefall.freebsd.org> To: freebsd-scsi@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: kern/124667: commit references a PR X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 13:50:14 -0000 The following reply was made to PR kern/124667; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/124667: commit references a PR Date: Mon, 7 Nov 2011 13:46:33 +0000 (UTC) Author: marius Date: Mon Nov 7 13:46:16 2011 New Revision: 227307 URL: http://svn.freebsd.org/changeset/base/227307 Log: MFC: r227006, r227281, r227282 Add a PCI front-end to esp(4) allowing it to support AMD Am53C974 and replace amd(4) with the former in the amd64, i386 and pc98 GENERIC kernel configuration files. Besides duplicating functionality, amd(4), which previously also supported the AMD Am53C974, unlike esp(4) is no longer maintained and has accumulated enough bit rot over time to always cause a panic during boot as long as at least one target is attached to it (see PR 124667). PR: 124667 Obtained from: NetBSD (based on) Added: stable/7/sys/dev/esp/am53c974reg.h - copied unchanged from r227006, head/sys/dev/esp/am53c974reg.h stable/7/sys/dev/esp/esp_pci.c - copied unchanged from r227006, head/sys/dev/esp/esp_pci.c Modified: stable/7/UPDATING (contents, props changed) stable/7/share/man/man4/esp.4 stable/7/sys/amd64/conf/GENERIC stable/7/sys/conf/NOTES stable/7/sys/conf/files stable/7/sys/i386/conf/GENERIC stable/7/sys/modules/Makefile stable/7/sys/modules/esp/Makefile stable/7/sys/pc98/conf/GENERIC stable/7/sys/sparc64/conf/GENERIC Directory Properties: stable/7/ (props changed) stable/7/COPYRIGHT (props changed) stable/7/Makefile (props changed) stable/7/Makefile.inc1 (props changed) stable/7/ObsoleteFiles.inc (props changed) stable/7/bin/ (props changed) stable/7/bin/chflags/ (props changed) stable/7/bin/chio/ (props changed) stable/7/bin/chmod/ (props changed) stable/7/bin/cp/ (props changed) stable/7/bin/csh/ (props changed) stable/7/bin/dd/ (props changed) stable/7/bin/df/ (props changed) stable/7/bin/echo/ (props changed) stable/7/bin/ed/ (props changed) stable/7/bin/expr/ (props changed) stable/7/bin/kill/ (props changed) stable/7/bin/ln/ (props changed) stable/7/bin/ls/ (props changed) stable/7/bin/pax/ (props changed) stable/7/bin/ps/ (props changed) stable/7/bin/rm/ (props changed) stable/7/bin/sh/ (props changed) stable/7/bin/test/ (props changed) stable/7/cddl/compat/opensolaris/ (props changed) stable/7/cddl/contrib/opensolaris/ (props changed) stable/7/cddl/lib/libzpool/ (props changed) stable/7/contrib/bind9/ (props changed) stable/7/contrib/binutils/ (props changed) stable/7/contrib/bsnmp/ (props changed) stable/7/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) stable/7/contrib/cpio/ (props changed) stable/7/contrib/csup/ (props changed) stable/7/contrib/expat/ (props changed) stable/7/contrib/gcc/ (props changed) stable/7/contrib/gdb/ (props changed) stable/7/contrib/gdtoa/ (props changed) stable/7/contrib/groff/ (props changed) stable/7/contrib/ipfilter/ (props changed) stable/7/contrib/less/ (props changed) stable/7/contrib/libpcap/ (props changed) stable/7/contrib/libstdc++/ (props changed) stable/7/contrib/lukemftp/ (props changed) stable/7/contrib/ncurses/ (props changed) stable/7/contrib/netcat/ (props changed) stable/7/contrib/ntp/ (props changed) stable/7/contrib/nvi/ (props changed) stable/7/contrib/pf/ (props changed) stable/7/contrib/sendmail/ (props changed) stable/7/contrib/smbfs/ (props changed) stable/7/contrib/tcp_wrappers/ (props changed) stable/7/contrib/tcsh/ (props changed) stable/7/contrib/telnet/ (props changed) stable/7/contrib/top/ (props changed) stable/7/contrib/traceroute/ (props changed) stable/7/contrib/wpa_supplicant/ (props changed) stable/7/contrib/wpa_supplicant/wpa_supplicant.conf (props changed) stable/7/crypto/openssh/ (props changed) stable/7/crypto/openssl/ (props changed) stable/7/etc/ (props changed) stable/7/games/factor/ (props changed) stable/7/games/fortune/ (props changed) stable/7/games/grdc/ (props changed) stable/7/gnu/ (props changed) stable/7/gnu/lib/libstdc++/ (props changed) stable/7/gnu/usr.bin/ (props changed) stable/7/gnu/usr.bin/cc/ (props changed) stable/7/gnu/usr.bin/cc/include/ (props changed) stable/7/gnu/usr.bin/cpio/ (props changed) stable/7/gnu/usr.bin/cvs/ (props changed) stable/7/gnu/usr.bin/gdb/ (props changed) stable/7/gnu/usr.bin/gdb/arch/sparc64/ (props changed) stable/7/gnu/usr.bin/gdb/kgdb/ (props changed) stable/7/gnu/usr.bin/grep/ (props changed) stable/7/gnu/usr.bin/groff/ (props changed) stable/7/gnu/usr.bin/groff/tmac/mdoc.local (props changed) stable/7/gnu/usr.bin/man/ (props changed) stable/7/gnu/usr.bin/sort/ (props changed) stable/7/include/ (props changed) stable/7/kerberos5/ (props changed) stable/7/lib/ (props changed) stable/7/lib/bind/ (props changed) stable/7/lib/csu/ (props changed) stable/7/lib/libarchive/ (props changed) stable/7/lib/libbluetooth/ (props changed) stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) stable/7/lib/libc_r/ (props changed) stable/7/lib/libcam/ (props changed) stable/7/lib/libdevstat/ (props changed) stable/7/lib/libdisk/ (props changed) stable/7/lib/libdwarf/ (props changed) stable/7/lib/libelf/ (props changed) stable/7/lib/libexpat/ (props changed) stable/7/lib/libfetch/ (props changed) stable/7/lib/libftpio/ (props changed) stable/7/lib/libgeom/ (props changed) stable/7/lib/libgssapi/ (props changed) stable/7/lib/libkse/ (props changed) stable/7/lib/libkvm/ (props changed) stable/7/lib/libmagic/ (props changed) stable/7/lib/libmemstat/ (props changed) stable/7/lib/libpmc/ (props changed) stable/7/lib/libradius/ (props changed) stable/7/lib/libsm/ (props changed) stable/7/lib/libstand/ (props changed) stable/7/lib/libthr/ (props changed) stable/7/lib/libthread_db/ (props changed) stable/7/lib/libufs/ (props changed) stable/7/lib/libutil/ (props changed) stable/7/lib/msun/ (props changed) stable/7/libexec/ (props changed) stable/7/libexec/comsat/ (props changed) stable/7/libexec/ftpd/ (props changed) stable/7/libexec/rpc.rquotad/ (props changed) stable/7/libexec/rpc.rstatd/ (props changed) stable/7/libexec/rshd/ (props changed) stable/7/libexec/rtld-elf/ (props changed) stable/7/libexec/talkd/ (props changed) stable/7/libexec/tftpd/ (props changed) stable/7/release/ (props changed) stable/7/release/doc/ (props changed) stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/7/release/picobsd/tinyware/login/ (props changed) stable/7/rescue/ (props changed) stable/7/sbin/ (props changed) stable/7/sbin/atacontrol/ (props changed) stable/7/sbin/bsdlabel/ (props changed) stable/7/sbin/clri/ (props changed) stable/7/sbin/ddb/ (props changed) stable/7/sbin/devd/ (props changed) stable/7/sbin/devfs/ (props changed) stable/7/sbin/dhclient/ (props changed) stable/7/sbin/dumpfs/ (props changed) stable/7/sbin/fdisk/ (props changed) stable/7/sbin/fdisk_pc98/ (props changed) stable/7/sbin/fsck/ (props changed) stable/7/sbin/fsck_ffs/ (props changed) stable/7/sbin/fsck_msdosfs/ (props changed) stable/7/sbin/geom/ (props changed) stable/7/sbin/geom/class/journal/ (props changed) stable/7/sbin/geom/class/label/ (props changed) stable/7/sbin/geom/class/part/ (props changed) stable/7/sbin/geom/class/stripe/ (props changed) stable/7/sbin/geom/misc/ (props changed) stable/7/sbin/growfs/ (props changed) stable/7/sbin/ifconfig/ (props changed) stable/7/sbin/init/ (props changed) stable/7/sbin/ipf/ (props changed) stable/7/sbin/ipfw/ (props changed) stable/7/sbin/md5/ (props changed) stable/7/sbin/mdconfig/ (props changed) stable/7/sbin/mknod/ (props changed) stable/7/sbin/mksnap_ffs/ (props changed) stable/7/sbin/mount/ (props changed) stable/7/sbin/mount_msdosfs/ (props changed) stable/7/sbin/natd/ (props changed) stable/7/sbin/newfs/ (props changed) stable/7/sbin/newfs_msdos/ (props changed) stable/7/sbin/ping6/ (props changed) stable/7/sbin/rcorder/ (props changed) stable/7/sbin/reboot/ (props changed) stable/7/sbin/restore/ (props changed) stable/7/sbin/route/ (props changed) stable/7/sbin/savecore/ (props changed) stable/7/sbin/sconfig/ (props changed) stable/7/sbin/shutdown/ (props changed) stable/7/sbin/sysctl/ (props changed) stable/7/sbin/tunefs/ (props changed) stable/7/secure/lib/libcrypto/ (props changed) stable/7/secure/lib/libssh/ (props changed) stable/7/secure/lib/libssl/ (props changed) stable/7/secure/libexec/sftp-server/ (props changed) stable/7/secure/usr.bin/bdes/ (props changed) stable/7/secure/usr.bin/openssl/ (props changed) stable/7/secure/usr.bin/ssh/ (props changed) stable/7/secure/usr.sbin/sshd/ (props changed) stable/7/share/ (props changed) stable/7/share/colldef/ (props changed) stable/7/share/dict/ (props changed) stable/7/share/doc/bind9/ (props changed) stable/7/share/doc/papers/devfs/ (props changed) stable/7/share/doc/papers/jail/ (props changed) stable/7/share/doc/smm/01.setup/ (props changed) stable/7/share/examples/ (props changed) stable/7/share/man/ (props changed) stable/7/share/man/man1/ (props changed) stable/7/share/man/man3/ (props changed) stable/7/share/man/man4/ (props changed) stable/7/share/man/man5/ (props changed) stable/7/share/man/man7/ (props changed) stable/7/share/man/man8/ (props changed) stable/7/share/man/man9/ (props changed) stable/7/share/misc/ (props changed) stable/7/share/misc/iso639 (props changed) stable/7/share/misc/pci_vendors (props changed) stable/7/share/mk/ (props changed) stable/7/share/mklocale/ (props changed) stable/7/share/monetdef/ (props changed) stable/7/share/msgdef/ (props changed) stable/7/share/numericdef/ (props changed) stable/7/share/sendmail/ (props changed) stable/7/share/syscons/ (props changed) stable/7/share/syscons/keymaps/ (props changed) stable/7/share/termcap/ (props changed) stable/7/share/timedef/ (props changed) stable/7/share/zoneinfo/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/tools/ (props changed) stable/7/tools/build/ (props changed) stable/7/tools/build/options/ (props changed) stable/7/tools/debugscripts/ (props changed) stable/7/tools/regression/acct/ (props changed) stable/7/tools/regression/atm/ (props changed) stable/7/tools/regression/bin/ (props changed) stable/7/tools/regression/bin/date/ (props changed) stable/7/tools/regression/bin/sh/ (props changed) stable/7/tools/regression/file/ (props changed) stable/7/tools/regression/file/flock/ (props changed) stable/7/tools/regression/lib/libc/ (props changed) stable/7/tools/regression/usr.bin/ (props changed) stable/7/tools/regression/usr.bin/jot/ (props changed) stable/7/tools/regression/usr.bin/tr/ (props changed) stable/7/tools/sched/ (props changed) stable/7/tools/test/ (props changed) stable/7/tools/test/malloc/ (props changed) stable/7/tools/tools/ (props changed) stable/7/tools/tools/aac/ (props changed) stable/7/tools/tools/crypto/ (props changed) stable/7/tools/tools/editing/ (props changed) stable/7/tools/tools/iwi/ (props changed) stable/7/tools/tools/nanobsd/ (props changed) stable/7/tools/tools/nanobsd/FlashDevice.sub (props changed) stable/7/tools/tools/nanobsd/nanobsd.sh (props changed) stable/7/tools/tools/netrate/ (props changed) stable/7/tools/tools/netrate/netblast/ (props changed) stable/7/tools/tools/netrate/netsend/ (props changed) stable/7/tools/tools/tinybsd/ (props changed) stable/7/tools/tools/umastat/ (props changed) stable/7/tools/tools/usb/ (props changed) stable/7/usr.bin/ (props changed) stable/7/usr.bin/basename/ (props changed) stable/7/usr.bin/bluetooth/rfcomm_sppd/ (props changed) stable/7/usr.bin/calendar/ (props changed) stable/7/usr.bin/catman/ (props changed) stable/7/usr.bin/checknr/ (props changed) stable/7/usr.bin/cksum/ (props changed) stable/7/usr.bin/comm/ (props changed) stable/7/usr.bin/cpuset/ (props changed) stable/7/usr.bin/csup/ (props changed) stable/7/usr.bin/cut/ (props changed) stable/7/usr.bin/dirname/ (props changed) stable/7/usr.bin/du/ (props changed) stable/7/usr.bin/fetch/ (props changed) stable/7/usr.bin/file/ (props changed) stable/7/usr.bin/find/ (props changed) stable/7/usr.bin/finger/ (props changed) stable/7/usr.bin/fold/ (props changed) stable/7/usr.bin/fstat/ (props changed) stable/7/usr.bin/gcore/ (props changed) stable/7/usr.bin/getopt/ (props changed) stable/7/usr.bin/gprof/ (props changed) stable/7/usr.bin/gzip/ (props changed) stable/7/usr.bin/hexdump/ (props changed) stable/7/usr.bin/id/ (props changed) stable/7/usr.bin/indent/ (props changed) stable/7/usr.bin/ipcrm/ (props changed) stable/7/usr.bin/ipcs/ (props changed) stable/7/usr.bin/jot/ (props changed) stable/7/usr.bin/kdump/ (props changed) stable/7/usr.bin/ktrace/ (props changed) stable/7/usr.bin/ldd/ (props changed) stable/7/usr.bin/less/ (props changed) stable/7/usr.bin/lex/ (props changed) stable/7/usr.bin/locate/ (props changed) stable/7/usr.bin/lockf/ (props changed) stable/7/usr.bin/logger/ (props changed) stable/7/usr.bin/m4/ (props changed) stable/7/usr.bin/mail/ (props changed) stable/7/usr.bin/make/ (props changed) stable/7/usr.bin/ncal/ (props changed) stable/7/usr.bin/netstat/ (props changed) stable/7/usr.bin/newgrp/ (props changed) stable/7/usr.bin/nsupdate/ (props changed) stable/7/usr.bin/pkill/ (props changed) stable/7/usr.bin/procstat/ (props changed) stable/7/usr.bin/quota/ (props changed) stable/7/usr.bin/rpcgen/ (props changed) stable/7/usr.bin/rpcinfo/ (props changed) stable/7/usr.bin/rs/ (props changed) stable/7/usr.bin/ruptime/ (props changed) stable/7/usr.bin/script/ (props changed) stable/7/usr.bin/sed/ (props changed) stable/7/usr.bin/shar/ (props changed) stable/7/usr.bin/sockstat/ (props changed) stable/7/usr.bin/split/ (props changed) stable/7/usr.bin/stat/ (props changed) stable/7/usr.bin/su/ (props changed) stable/7/usr.bin/systat/ (props changed) stable/7/usr.bin/tail/ (props changed) stable/7/usr.bin/tar/ (props changed) stable/7/usr.bin/tftp/ (props changed) stable/7/usr.bin/tip/ (props changed) stable/7/usr.bin/top/ (props changed) stable/7/usr.bin/truncate/ (props changed) stable/7/usr.bin/truss/ (props changed) stable/7/usr.bin/uname/ (props changed) stable/7/usr.bin/unifdef/ (props changed) stable/7/usr.bin/units/ (props changed) stable/7/usr.bin/uudecode/ (props changed) stable/7/usr.bin/vmstat/ (props changed) stable/7/usr.bin/w/ (props changed) stable/7/usr.bin/wall/ (props changed) stable/7/usr.bin/wc/ (props changed) stable/7/usr.bin/whereis/ (props changed) stable/7/usr.bin/whois/ (props changed) stable/7/usr.bin/window/ (props changed) stable/7/usr.bin/xargs/ (props changed) stable/7/usr.bin/xinstall/ (props changed) stable/7/usr.bin/xlint/ (props changed) stable/7/usr.bin/ypcat/ (props changed) stable/7/usr.bin/ypmatch/ (props changed) stable/7/usr.bin/ypwhich/ (props changed) stable/7/usr.sbin/ (props changed) stable/7/usr.sbin/Makefile (props changed) stable/7/usr.sbin/acpi/ (props changed) stable/7/usr.sbin/adduser/ (props changed) stable/7/usr.sbin/arp/ (props changed) stable/7/usr.sbin/bluetooth/ (props changed) stable/7/usr.sbin/bluetooth/btpand/ (props changed) stable/7/usr.sbin/bluetooth/hcsecd/ (props changed) stable/7/usr.sbin/bluetooth/hcseriald/ (props changed) stable/7/usr.sbin/bluetooth/rfcomm_pppd/ (props changed) stable/7/usr.sbin/bluetooth/sdpd/ (props changed) stable/7/usr.sbin/boot0cfg/ (props changed) stable/7/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) stable/7/usr.sbin/bsnmpd/modules/snmp_pf/ (props changed) stable/7/usr.sbin/burncd/ (props changed) stable/7/usr.sbin/cdcontrol/ (props changed) stable/7/usr.sbin/chown/ (props changed) stable/7/usr.sbin/chroot/ (props changed) stable/7/usr.sbin/config/ (props changed) stable/7/usr.sbin/config/SMM.doc/ (props changed) stable/7/usr.sbin/cpucontrol/ (props changed) stable/7/usr.sbin/crashinfo/ (props changed) stable/7/usr.sbin/cron/ (props changed) stable/7/usr.sbin/cron/cron/ (props changed) stable/7/usr.sbin/crunch/ (props changed) stable/7/usr.sbin/cxgbtool/ (props changed) stable/7/usr.sbin/diskinfo/ (props changed) stable/7/usr.sbin/eeprom/ (props changed) stable/7/usr.sbin/extattr/ (props changed) stable/7/usr.sbin/faithd/ (props changed) stable/7/usr.sbin/fdcontrol/ (props changed) stable/7/usr.sbin/fdformat/ (props changed) stable/7/usr.sbin/fdread/ (props changed) stable/7/usr.sbin/fdwrite/ (props changed) stable/7/usr.sbin/fifolog/ (props changed) stable/7/usr.sbin/freebsd-update/ (props changed) stable/7/usr.sbin/fwcontrol/ (props changed) stable/7/usr.sbin/gstat/ (props changed) stable/7/usr.sbin/iostat/ (props changed) stable/7/usr.sbin/jail/ (props changed) stable/7/usr.sbin/jexec/ (props changed) stable/7/usr.sbin/jls/ (props changed) stable/7/usr.sbin/kbdmap/ (props changed) stable/7/usr.sbin/lpr/ (props changed) stable/7/usr.sbin/mailwrapper/ (props changed) stable/7/usr.sbin/makefs/ (props changed) stable/7/usr.sbin/mergemaster/ (props changed) stable/7/usr.sbin/mfiutil/ (props changed) stable/7/usr.sbin/mountd/ (props changed) stable/7/usr.sbin/moused/ (props changed) stable/7/usr.sbin/mptutil/ (props changed) stable/7/usr.sbin/mtree/ (props changed) stable/7/usr.sbin/named/ (props changed) stable/7/usr.sbin/ndiscvt/ (props changed) stable/7/usr.sbin/ndp/ (props changed) stable/7/usr.sbin/newsyslog/ (props changed) stable/7/usr.sbin/nfsd/ (props changed) stable/7/usr.sbin/nscd/ (props changed) stable/7/usr.sbin/ntp/ (props changed) stable/7/usr.sbin/pciconf/ (props changed) stable/7/usr.sbin/pkg_install/ (props changed) stable/7/usr.sbin/pmccontrol/ (props changed) stable/7/usr.sbin/pmcstat/ (props changed) stable/7/usr.sbin/portsnap/ (props changed) stable/7/usr.sbin/powerd/ (props changed) stable/7/usr.sbin/ppp/ (props changed) stable/7/usr.sbin/pstat/ (props changed) stable/7/usr.sbin/pw/ (props changed) stable/7/usr.sbin/pwd_mkdb/ (props changed) stable/7/usr.sbin/rpc.lockd/ (props changed) stable/7/usr.sbin/rpc.statd/ (props changed) stable/7/usr.sbin/rpc.yppasswdd/ (props changed) stable/7/usr.sbin/rpcbind/ (props changed) stable/7/usr.sbin/rtadvd/ (props changed) stable/7/usr.sbin/rtsold/ (props changed) stable/7/usr.sbin/sade/ (props changed) stable/7/usr.sbin/service/ (props changed) stable/7/usr.sbin/setfib/ (props changed) stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/syslogd/ (props changed) stable/7/usr.sbin/traceroute/ (props changed) stable/7/usr.sbin/traceroute6/ (props changed) stable/7/usr.sbin/tzsetup/ (props changed) stable/7/usr.sbin/ugidfw/ (props changed) stable/7/usr.sbin/wpa/wpa_supplicant/ (props changed) stable/7/usr.sbin/ypserv/ (props changed) stable/7/usr.sbin/zic/ (props changed) Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Mon Nov 7 13:45:18 2011 (r227306) +++ stable/7/UPDATING Mon Nov 7 13:46:16 2011 (r227307) @@ -8,6 +8,10 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20111101: + The broken amd(4) driver has been replaced with esp(4) in the amd64, + i386 and pc98 GENERIC kernel configuration files. + 20110221: FreeBSD 7.4-RELEASE Modified: stable/7/share/man/man4/esp.4 ============================================================================== --- stable/7/share/man/man4/esp.4 Mon Nov 7 13:45:18 2011 (r227306) +++ stable/7/share/man/man4/esp.4 Mon Nov 7 13:46:16 2011 (r227307) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2004 Tom Rhodes +.\" Copyright (c) 2011 Marius Strobl .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,158 +25,91 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2005 +.Dd November 1, 2011 .Dt ESP 4 .Os .Sh NAME .Nm esp -.Nd Qlogic FEPS and FAS366 SCSI driver +.Nd Emulex ESP, NCR 53C9x and QLogic FAS families based SCSI controllers .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your +To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device scbus" .Cd "device esp" .Ed -.Sh HARDWARE +.Pp +Alternatively, to load the driver as a module at boot time, place the +following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_esp_load="YES" +.Ed +.Sh DESCRIPTION The .Nm driver provides support for the -.Tn Qlogic -FAS216 and FAS408 +.Tn AMD +Am53C974, the +.Tn Emulex +ESP100, ESP100A, ESP200 and ESP406, the +.Tn NCR +53C90, 53C94 and 53C96 as well as the +.Tn QLogic +FAS100A, FAS216, FAS366 and FAS408 .Tn SCSI controller chips found in a wide variety of systems and peripheral boards. -This includes the -.Tn Qlogic -.Tn SCSI -cards found in most -.Tn Sun -.Tn Ultra 1e -and -.Tn Ultra 2 -machines. -.Pp -For -.Tn Qlogic -.Tn PCI -.Tn SCSI -host adapters, the -.Xr isp 4 -driver should be used in place of the -.Nm -driver. -.Sh IMPLEMENTATION NOTES -During the boot sequence, the +.Sh HARDWARE +Controllers supported by the .Nm -driver -searches the linked list for LUN info by LUN ID. -At this point the driver will attach on that instance, -and then attempt to attach every sub-device. -.Pp -There are at least 4 variations of the -configuration 3 register. -A second config register must be loaded to inquire the chip revision, -otherwise the -.Fn ncr53c9x_reset -function will not set the defaults correctly. -.Pp -The drive attach routine attempts to set the appropriate -bit to put the chip into Fast -.Tn SCSI -mode so that it does not -have to be figured out each time. -This will then be stored in the -.Tn NCR -registers for later use. +driver include: .Pp -The -.Nm -driver makes use of the -.Tn LSI -64854 -.Tn DMA -engine which contains three independent -channels designed to interface with -an NCR539X -.Tn SCSI -controller; -an AM7990 Ethernet controller; -and certain types of parallel port hardware. -As such this driver may eventually replace the -.Xr amd 4 -driver for network hardware. -.Sh DIAGNOSTICS -The following driver specific error messages -may be reported: -.Bl -diag -.It "esp: cannot map %d segments" -The device was unable to map segments while mapping the -.Tn SCSI -devices in -.Tn DMA -mode. -.It "unknown variant %d, devices not attached" -An unknown version of the card was found and devices will -not be attached. -.It "Unhandled function code %d" -The device returned a function code which the driver is -unable to handle, most likely during negotiation. -.It "esp:%d:%d: selection failed %d left in FIFO" -The target left the command phase prematurely. -If a command did not reach the device then it will -be reported as shown above. -.It "invalid state: %d" -The device has reached an invalid state. -.El -.Sh SEE ALSO -.Xr amd 4 , -.Xr isp 4 , -.Xr scbus 4 , -.Xr camcontrol 8 -.Pp -.Bl -item -compact +.Bl -bullet -compact +.It +MELCO IFC-DP (PC-98) +.It +Sun ESP family +.It +Sun FAS family .It -.Pa http://www.qlc.com/ +Tekram DC390 .It -.Pa http://www.sun.com/ +Tekram DC390T .El +.Sh SEE ALSO +.Xr cd 4 , +.Xr ch 4 , +.Xr da 4 , +.Xr intro 4 , +.Xr pci 4 , +.Xr sa 4 , +.Xr sbus 4 , +.Xr scsi 4 , +.Xr camcontrol 8 .Sh HISTORY The .Nm -driver was written for -.Nx -by -.An Eric S. Hvozda . +driver first appeared in +.Nx 1.3 . +The first +.Fx +version to include it was +.Fx 5.3 . +.Sh AUTHORS +.An -nosplit The .Nm -driver was then ported to -.Fx 5.3 +driver was ported to +.Fx by -.An Scott Long Aq scottl@FreeBSD.org . -.Sh AUTHORS -This manual page was written by -.An Tom Rhodes Aq trhodes@FreeBSD.org -instead of porting the original from -.Nx . +.An Scott Long +.Aq scottl@FreeBSD.org +and later on considerably improved by +.An Marius Strobl +.Aq marius@FreeBSD.org . .Sh BUGS The .Nm -driver includes the sbus front-end but lacks the -.Tn PCI -front-end. -Thus it can only support the -.Tn FEPS/FAS366 -.Tn SCSI -found in -.Tn Sun -.Tn Ultra 1e -and -.Tn Ultra 2 -machines at this time. -.Pp -This driver should eventually replace the -.Xr amd 4 -driver, but that requires porting the -.Tn PCI -front-end mentioned above. +driver should read the EEPROM settings of +.Tn Tekram +controllers. Modified: stable/7/sys/amd64/conf/GENERIC ============================================================================== --- stable/7/sys/amd64/conf/GENERIC Mon Nov 7 13:45:18 2011 (r227306) +++ stable/7/sys/amd64/conf/GENERIC Mon Nov 7 13:46:16 2011 (r227307) @@ -97,7 +97,7 @@ options AHC_REG_PRETTY_PRINT # Print re device ahd # AHA39320/29320 and onboard AIC79xx devices options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. -device amd # AMD 53C974 (Tekram DC-390(T)) +device esp # AMD Am53C974 (Tekram DC-390(T)) device hptiop # Highpoint RocketRaid 3xxx series device isp # Qlogic family #device ispfw # Firmware for QLogic HBAs- normally a module Modified: stable/7/sys/conf/NOTES ============================================================================== --- stable/7/sys/conf/NOTES Mon Nov 7 13:45:18 2011 (r227306) +++ stable/7/sys/conf/NOTES Mon Nov 7 13:46:16 2011 (r227307) @@ -1388,7 +1388,9 @@ options SC_NO_SUSPEND_VTYSWITCH # such as the Tekram DC-390(T). # bt: Most Buslogic controllers: including BT-445, BT-54x, BT-64x, BT-74x, # BT-75x, BT-946, BT-948, BT-956, BT-958, SDC3211B, SDC3211F, SDC3222F -# esp: NCR53c9x. Only for SBUS hardware right now. +# esp: Emulex ESP, NCR 53C9x and QLogic FAS families based controllers +# including the AMD Am53C974 (found on devices such as the Tekram +# DC-390(T)) and the Sun ESP and FAS families of controllers # isp: Qlogic ISP 1020, 1040 and 1040B PCI SCSI host adapters, # ISP 1240 Dual Ultra SCSI, ISP 1080 and 1280 (Dual) Ultra2, # ISP 12160 Ultra3 SCSI, Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Mon Nov 7 13:45:18 2011 (r227306) +++ stable/7/sys/conf/files Mon Nov 7 13:46:16 2011 (r227307) @@ -826,6 +826,7 @@ dev/ep/if_ep_eisa.c optional ep eisa dev/ep/if_ep_isa.c optional ep isa dev/ep/if_ep_mca.c optional ep mca dev/ep/if_ep_pccard.c optional ep pccard +dev/esp/esp_pci.c optional esp pci dev/esp/ncr53c9x.c optional esp dev/ex/if_ex.c optional ex dev/ex/if_ex_isa.c optional ex isa Copied: stable/7/sys/dev/esp/am53c974reg.h (from r227006, head/sys/dev/esp/am53c974reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/dev/esp/am53c974reg.h Mon Nov 7 13:46:16 2011 (r227307, copy of r227006, head/sys/dev/esp/am53c974reg.h) @@ -0,0 +1,72 @@ +/* $NetBSD: pcscpreg.h,v 1.2 2008/04/28 20:23:55 martin Exp $ */ + +/*- + * Copyright (c) 1998 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Izumi Tsutsui. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef _AM53C974_H_ +#define _AM53C974_H_ + +/* + * Am53c974 DMA engine registers + */ + +#define DMA_CMD 0x40 /* Command */ +#define DMACMD_RSVD 0xFFFFFF28 /* reserved */ +#define DMACMD_DIR 0x00000080 /* Transfer Direction (read:1) */ +#define DMACMD_INTE 0x00000040 /* DMA Interrupt Enable */ +#define DMACMD_MDL 0x00000010 /* Map to Memory Description List */ +#define DMACMD_DIAG 0x00000004 /* Diagnostic */ +#define DMACMD_CMD 0x00000003 /* Command Code Bit */ +#define DMACMD_IDLE 0x00000000 /* Idle */ +#define DMACMD_BLAST 0x00000001 /* Blast */ +#define DMACMD_ABORT 0x00000002 /* Abort */ +#define DMACMD_START 0x00000003 /* Start */ + +#define DMA_STC 0x44 /* Start Transfer Count */ +#define DMA_SPA 0x48 /* Start Physical Address */ +#define DMA_WBC 0x4C /* Working Byte Counter */ +#define DMA_WAC 0x50 /* Working Address Counter */ + +#define DMA_STAT 0x54 /* Status Register */ +#define DMASTAT_RSVD 0xFFFFFF80 /* reserved */ +#define DMASTAT_PABT 0x00000040 /* PCI master/target Abort */ +#define DMASTAT_BCMP 0x00000020 /* BLAST Complete */ +#define DMASTAT_SINT 0x00000010 /* SCSI Interrupt */ +#define DMASTAT_DONE 0x00000008 /* DMA Transfer Terminated */ +#define DMASTAT_ABT 0x00000004 /* DMA Transfer Aborted */ +#define DMASTAT_ERR 0x00000002 /* DMA Transfer Error */ +#define DMASTAT_PWDN 0x00000001 /* Power Down Indicator */ + +#define DMA_SMDLA 0x58 /* Starting Memory Descpritor List Address */ +#define DMA_WMAC 0x5C /* Working MDL Counter */ +#define DMA_SBAC 0x70 /* SCSI Bus and Control */ + +#endif /* _AM53C974_H_ */ Copied: stable/7/sys/dev/esp/esp_pci.c (from r227006, head/sys/dev/esp/esp_pci.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/dev/esp/esp_pci.c Mon Nov 7 13:46:16 2011 (r227307, copy of r227006, head/sys/dev/esp/esp_pci.c) @@ -0,0 +1,654 @@ +/*- + * Copyright (c) 2011 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $NetBSD: pcscp.c,v 1.45 2010/11/13 13:52:08 uebayasi Exp $ */ + +/*- + * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, + * NASA Ames Research Center; Izumi Tsutsui. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * esp_pci.c: device dependent code for AMD Am53c974 (PCscsi-PCI) + * written by Izumi Tsutsui + * + * Technical manual available at + * http://www.amd.com/files/connectivitysolutions/networking/archivednetworking/19113.pdf + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#define PCI_DEVICE_ID_AMD53C974 0x20201022 + +struct esp_pci_softc { + struct ncr53c9x_softc sc_ncr53c9x; /* glue to MI code */ + struct device *sc_dev; + + struct resource *sc_res[2]; +#define ESP_PCI_RES_INTR 0 +#define ESP_PCI_RES_IO 1 + + bus_dma_tag_t sc_pdmat; + + bus_dma_tag_t sc_xferdmat; /* DMA tag for transfers */ + bus_dmamap_t sc_xferdmam; /* DMA map for transfers */ + + void *sc_ih; /* interrupt handler */ + + size_t sc_dmasize; /* DMA size */ + void **sc_dmaaddr; /* DMA address */ + size_t *sc_dmalen; /* DMA length */ + int sc_active; /* DMA state */ + int sc_datain; /* DMA Data Direction */ +}; + +static struct resource_spec esp_pci_res_spec[] = { + { SYS_RES_IRQ, 0, RF_SHAREABLE | RF_ACTIVE }, /* ESP_PCI_RES_INTR */ + { SYS_RES_IOPORT, PCIR_BAR(0), RF_ACTIVE }, /* ESP_PCI_RES_IO */ + { -1, 0 } +}; + +#define READ_DMAREG(sc, reg) \ + bus_read_4((sc)->sc_res[ESP_PCI_RES_IO], (reg)) +#define WRITE_DMAREG(sc, reg, var) \ + bus_write_4((sc)->sc_res[ESP_PCI_RES_IO], (reg), (var)) + +#define READ_ESPREG(sc, reg) \ + bus_read_1((sc)->sc_res[ESP_PCI_RES_IO], (reg) << 2) +#define WRITE_ESPREG(sc, reg, val) \ + bus_write_1((sc)->sc_res[ESP_PCI_RES_IO], (reg) << 2, (val)) + +static int esp_pci_probe(device_t); +static int esp_pci_attach(device_t); +static int esp_pci_detach(device_t); +static int esp_pci_suspend(device_t); +static int esp_pci_resume(device_t); + +static device_method_t esp_pci_methods[] = { + DEVMETHOD(device_probe, esp_pci_probe), + DEVMETHOD(device_attach, esp_pci_attach), + DEVMETHOD(device_detach, esp_pci_detach), + DEVMETHOD(device_suspend, esp_pci_suspend), + DEVMETHOD(device_resume, esp_pci_resume), + + KOBJMETHOD_END +}; + +static driver_t esp_pci_driver = { + "esp", + esp_pci_methods, + sizeof(struct esp_pci_softc) +}; + +DRIVER_MODULE(esp, pci, esp_pci_driver, esp_devclass, 0, 0); +MODULE_DEPEND(esp, pci, 1, 1, 1); + +/* + * Functions and the switch for the MI code + */ +static void esp_pci_dma_go(struct ncr53c9x_softc *); +static int esp_pci_dma_intr(struct ncr53c9x_softc *); +static int esp_pci_dma_isactive(struct ncr53c9x_softc *); + +static int esp_pci_dma_isintr(struct ncr53c9x_softc *); +static void esp_pci_dma_reset(struct ncr53c9x_softc *); +static int esp_pci_dma_setup(struct ncr53c9x_softc *, void **, size_t *, + int, size_t *); +static void esp_pci_dma_stop(struct ncr53c9x_softc *); +static void esp_pci_write_reg(struct ncr53c9x_softc *, int, uint8_t); +static uint8_t esp_pci_read_reg(struct ncr53c9x_softc *, int); +static void esp_pci_xfermap(void *arg, bus_dma_segment_t *segs, int nseg, + int error); + +static struct ncr53c9x_glue esp_pci_glue = { + esp_pci_read_reg, + esp_pci_write_reg, + esp_pci_dma_isintr, + esp_pci_dma_reset, + esp_pci_dma_intr, + esp_pci_dma_setup, + esp_pci_dma_go, + esp_pci_dma_stop, + esp_pci_dma_isactive, +}; + +static int +esp_pci_probe(device_t dev) +{ + + if (pci_get_devid(dev) == PCI_DEVICE_ID_AMD53C974) { + device_set_desc(dev, "AMD Am53C974 Fast-SCSI"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +/* + * Attach this instance, and then all the sub-devices + */ +static int +esp_pci_attach(device_t dev) +{ + struct esp_pci_softc *esc; + struct ncr53c9x_softc *sc; + int error; + + esc = device_get_softc(dev); + sc = &esc->sc_ncr53c9x; + + NCR_LOCK_INIT(sc); + + esc->sc_dev = dev; + sc->sc_glue = &esp_pci_glue; + + pci_enable_busmaster(dev); + + error = bus_alloc_resources(dev, esp_pci_res_spec, esc->sc_res); + if (error != 0) { + device_printf(dev, "failed to allocate resources\n"); + bus_release_resources(dev, esp_pci_res_spec, esc->sc_res); + return (error); + } + + error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE_32BIT, BUS_SPACE_UNRESTRICTED, + BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &esc->sc_pdmat); + if (error != 0) { + device_printf(dev, "cannot create parent DMA tag\n"); + goto fail_res; + } + + /* + * XXX More of this should be in ncr53c9x_attach(), but + * XXX should we really poke around the chip that much in + * XXX the MI code? Think about this more... + */ + + /* + * Set up static configuration info. + * + * XXX we should read the configuration from the EEPROM. + */ + sc->sc_id = 7; + sc->sc_cfg1 = sc->sc_id | NCRCFG1_PARENB; + sc->sc_cfg2 = NCRCFG2_SCSI2 | NCRCFG2_FE; + sc->sc_cfg3 = NCRAMDCFG3_IDM | NCRAMDCFG3_FCLK; + sc->sc_cfg4 = NCRAMDCFG4_GE12NS | NCRAMDCFG4_RADE; + sc->sc_rev = NCR_VARIANT_AM53C974; + sc->sc_features = NCR_F_FASTSCSI | NCR_F_DMASELECT; + sc->sc_cfg3_fscsi = NCRAMDCFG3_FSCSI; + sc->sc_freq = 40; /* MHz */ + + /* + * This is the value used to start sync negotiations + * Note that the NCR register "SYNCTP" is programmed + * in "clocks per byte", and has a minimum value of 4. + * The SCSI period used in negotiation is one-fourth + * of the time (in nanoseconds) needed to transfer one byte. + * Since the chip's clock is given in MHz, we have the following + * formula: 4 * period = (1000 / freq) * 4 + */ + sc->sc_minsync = 1000 / sc->sc_freq; + + sc->sc_maxxfer = DFLTPHYS; /* see below */ + sc->sc_maxoffset = 15; + sc->sc_extended_geom = 1; + +#define MDL_SEG_SIZE 0x1000 /* 4kbyte per segment */ + + /* + * Create the DMA tag and map for the data transfers. + * + * Note: given that bus_dma(9) only adheres to the requested alignment + * for the first segment (and that also only for bus_dmamem_alloc()ed + * DMA maps) we can't use the Memory Descriptor List. However, also + * when not using the MDL, the maximum transfer size apparently is + * limited to 4k so we have to split transfers up, which plain sucks. + */ + error = bus_dma_tag_create(esc->sc_pdmat, PAGE_SIZE, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + MDL_SEG_SIZE, 1, MDL_SEG_SIZE, BUS_DMA_ALLOCNOW, + busdma_lock_mutex, &sc->sc_lock, &esc->sc_xferdmat); + if (error != 0) { + device_printf(dev, "cannot create transfer DMA tag\n"); + goto fail_pdmat; + } + error = bus_dmamap_create(esc->sc_xferdmat, 0, &esc->sc_xferdmam); + if (error != 0) { + device_printf(dev, "cannnot create transfer DMA map\n"); + goto fail_xferdmat; + } + + error = bus_setup_intr(dev, esc->sc_res[ESP_PCI_RES_INTR], + INTR_MPSAFE | INTR_TYPE_CAM, NULL, ncr53c9x_intr, sc, + &esc->sc_ih); + if (error != 0) { + device_printf(dev, "cannot set up interrupt\n"); + goto fail_xferdmam; + } + + /* Do the common parts of attachment. */ + sc->sc_dev = esc->sc_dev; + error = ncr53c9x_attach(sc); + if (error != 0) { + device_printf(esc->sc_dev, "ncr53c9x_attach failed\n"); + goto fail_intr; + } + + return (0); + + fail_intr: + bus_teardown_intr(esc->sc_dev, esc->sc_res[ESP_PCI_RES_INTR], + esc->sc_ih); + fail_xferdmam: + bus_dmamap_destroy(esc->sc_xferdmat, esc->sc_xferdmam); + fail_xferdmat: + bus_dma_tag_destroy(esc->sc_xferdmat); + fail_pdmat: + bus_dma_tag_destroy(esc->sc_pdmat); + fail_res: + bus_release_resources(dev, esp_pci_res_spec, esc->sc_res); + NCR_LOCK_DESTROY(sc); + + return (error); +} + +static int +esp_pci_detach(device_t dev) +{ + struct ncr53c9x_softc *sc; + struct esp_pci_softc *esc; + int error; + + esc = device_get_softc(dev); + sc = &esc->sc_ncr53c9x; + + bus_teardown_intr(esc->sc_dev, esc->sc_res[ESP_PCI_RES_INTR], + esc->sc_ih); + error = ncr53c9x_detach(sc); + if (error != 0) + return (error); + bus_dmamap_destroy(esc->sc_xferdmat, esc->sc_xferdmam); + bus_dma_tag_destroy(esc->sc_xferdmat); + bus_dma_tag_destroy(esc->sc_pdmat); + bus_release_resources(dev, esp_pci_res_spec, esc->sc_res); + NCR_LOCK_DESTROY(sc); + + return (0); +} + +static int +esp_pci_suspend(device_t dev) +{ + + return (ENXIO); +} + +static int +esp_pci_resume(device_t dev) +{ + + return (ENXIO); +} + +static void +esp_pci_xfermap(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)arg; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: bad transfer segment count %d", __func__, + nsegs)); + KASSERT(segs[0].ds_len <= MDL_SEG_SIZE, + ("%s: bad transfer segment length %ld", __func__, + (long)segs[0].ds_len)); + + /* Program the DMA Starting Physical Address. */ + WRITE_DMAREG(esc, DMA_SPA, segs[0].ds_addr); +} + +/* + * Glue functions + */ + +static uint8_t +esp_pci_read_reg(struct ncr53c9x_softc *sc, int reg) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + return (READ_ESPREG(esc, reg)); +} + +static void +esp_pci_write_reg(struct ncr53c9x_softc *sc, int reg, uint8_t v) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + WRITE_ESPREG(esc, reg, v); +} + +static int +esp_pci_dma_isintr(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + return (READ_ESPREG(esc, NCR_STAT) & NCRSTAT_INT) != 0; +} + +static void +esp_pci_dma_reset(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE); + + esc->sc_active = 0; +} + +static int +esp_pci_dma_intr(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + bus_dma_tag_t xferdmat; + bus_dmamap_t xferdmam; + size_t dmasize; + int datain, i, resid, trans; + uint32_t dmastat; + char *p = NULL; + + xferdmat = esc->sc_xferdmat; + xferdmam = esc->sc_xferdmam; + datain = esc->sc_datain; + + dmastat = READ_DMAREG(esc, DMA_STAT); + + if ((dmastat & DMASTAT_ERR) != 0) { + /* XXX not tested... */ + WRITE_DMAREG(esc, DMA_CMD, DMACMD_ABORT | (datain != 0 ? + DMACMD_DIR : 0)); + + device_printf(esc->sc_dev, "DMA error detected; Aborting.\n"); + bus_dmamap_sync(xferdmat, xferdmam, datain != 0 ? + BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(xferdmat, xferdmam); + return (-1); + } + + if ((dmastat & DMASTAT_ABT) != 0) { + /* XXX what should be done? */ + device_printf(esc->sc_dev, "DMA aborted.\n"); + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | (datain != 0 ? + DMACMD_DIR : 0)); + esc->sc_active = 0; + return (0); + } + + KASSERT(esc->sc_active != 0, ("%s: DMA wasn't active", __func__)); + + /* DMA has stopped. */ + + esc->sc_active = 0; + + dmasize = esc->sc_dmasize; + if (dmasize == 0) { + /* A "Transfer Pad" operation completed. */ + NCR_DMA(("%s: discarded %d bytes (tcl=%d, tcm=%d)\n", + __func__, READ_ESPREG(esc, NCR_TCL) | + (READ_ESPREG(esc, NCR_TCM) << 8), + READ_ESPREG(esc, NCR_TCL), READ_ESPREG(esc, NCR_TCM))); + return (0); + } + + resid = 0; + /* + * If a transfer onto the SCSI bus gets interrupted by the device + * (e.g. for a SAVEPOINTER message), the data in the FIFO counts + * as residual since the ESP counter registers get decremented as + * bytes are clocked into the FIFO. + */ + if (datain == 0 && + (resid = (READ_ESPREG(esc, NCR_FFLAG) & NCRFIFO_FF)) != 0) + NCR_DMA(("%s: empty esp FIFO of %d ", __func__, resid)); + + if ((sc->sc_espstat & NCRSTAT_TC) == 0) { + /* + * "Terminal count" is off, so read the residue + * out of the ESP counter registers. + */ + if (datain != 0) { + resid = READ_ESPREG(esc, NCR_FFLAG) & NCRFIFO_FF; + while (resid > 1) + resid = + READ_ESPREG(esc, NCR_FFLAG) & NCRFIFO_FF; + WRITE_DMAREG(esc, DMA_CMD, DMACMD_BLAST | DMACMD_DIR); + + for (i = 0; i < 0x8000; i++) /* XXX 0x8000 ? */ + if ((READ_DMAREG(esc, DMA_STAT) & + DMASTAT_BCMP) != 0) + break; + + /* See the below comments... */ + if (resid != 0) + p = *esc->sc_dmaaddr; + } + + resid += READ_ESPREG(esc, NCR_TCL) | + (READ_ESPREG(esc, NCR_TCM) << 8) | + (READ_ESPREG(esc, NCR_TCH) << 16); + } else + while ((dmastat & DMASTAT_DONE) == 0) + dmastat = READ_DMAREG(esc, DMA_STAT); + + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | (datain != 0 ? + DMACMD_DIR : 0)); + + /* Sync the transfer buffer. */ + bus_dmamap_sync(xferdmat, xferdmam, datain != 0 ? + BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(xferdmat, xferdmam); + + trans = dmasize - resid; + + /* + * From the technical manual notes: + * + * "In some odd byte conditions, one residual byte will be left + * in the SCSI FIFO, and the FIFO flags will never count to 0. + * When this happens, the residual byte should be retrieved + * via PIO following completion of the BLAST operation." + */ + if (p != NULL) { + p += trans; + *p = READ_ESPREG(esc, NCR_FIFO); + trans++; + } + + if (trans < 0) { /* transferred < 0 ? */ +#if 0 + /* + * This situation can happen in perfectly normal operation + * if the ESP is reselected while using DMA to select + * another target. As such, don't print the warning. + */ + device_printf(dev, "xfer (%d) > req (%d)\n", trans, dmasize); +#endif + trans = dmasize; + } + + NCR_DMA(("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n", __func__, + READ_ESPREG(esc, NCR_TCL), READ_ESPREG(esc, NCR_TCM), + READ_ESPREG(esc, NCR_TCH), trans, resid)); + + *esc->sc_dmalen -= trans; + *esc->sc_dmaaddr = (char *)*esc->sc_dmaaddr + trans; + + return (0); +} + +static int +esp_pci_dma_setup(struct ncr53c9x_softc *sc, void **addr, size_t *len, + int datain, size_t *dmasize) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + int error; + + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | (datain != 0 ? DMACMD_DIR : + 0)); + + *dmasize = esc->sc_dmasize = ulmin(*dmasize, MDL_SEG_SIZE); + esc->sc_dmaaddr = addr; + esc->sc_dmalen = len; + esc->sc_datain = datain; + + /* + * There's no need to set up DMA for a "Transfer Pad" operation. + */ + if (*dmasize == 0) + return (0); + + /* Set the transfer length. */ + WRITE_DMAREG(esc, DMA_STC, *dmasize); + + /* + * Load the transfer buffer and program the DMA address. + * Note that the NCR53C9x core can't handle EINPROGRESS so we set + * BUS_DMA_NOWAIT. + */ + error = bus_dmamap_load(esc->sc_xferdmat, esc->sc_xferdmam, + *esc->sc_dmaaddr, *dmasize, esp_pci_xfermap, sc, BUS_DMA_NOWAIT); + + return (error); +} + +static void +esp_pci_dma_go(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + int datain; + + datain = esc->sc_datain; + + /* No DMA transfer for a "Transfer Pad" operation */ + if (esc->sc_dmasize == 0) + return; + + /* Sync the transfer buffer. */ + bus_dmamap_sync(esc->sc_xferdmat, esc->sc_xferdmam, datain != 0 ? + BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE); + + /* Set the DMA engine to the IDLE state. */ + /* XXX DMA Transfer Interrupt Enable bit is broken? */ + WRITE_DMAREG(esc, DMA_CMD, DMACMD_IDLE | /* DMACMD_INTE | */ + (datain != 0 ? DMACMD_DIR : 0)); + + /* Issue a DMA start command. */ + WRITE_DMAREG(esc, DMA_CMD, DMACMD_START | /* DMACMD_INTE | */ + (datain != 0 ? DMACMD_DIR : 0)); + + esc->sc_active = 1; +} + +static void +esp_pci_dma_stop(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + + /* DMA stop */ + /* XXX what should we do here ? */ + WRITE_DMAREG(esc, DMA_CMD, + DMACMD_ABORT | (esc->sc_datain != 0 ? DMACMD_DIR : 0)); + bus_dmamap_unload(esc->sc_xferdmat, esc->sc_xferdmam); + + esc->sc_active = 0; +} + +static int +esp_pci_dma_isactive(struct ncr53c9x_softc *sc) +{ + struct esp_pci_softc *esc = (struct esp_pci_softc *)sc; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-freebsd-scsi@FreeBSD.ORG Mon Nov 7 15:36:27 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A505106566B; Mon, 7 Nov 2011 15:36:27 +0000 (UTC) (envelope-from dgilbert@interlog.com) Received: from smtp.infotech.no (smtp.infotech.no [82.134.31.41]) by mx1.freebsd.org (Postfix) with ESMTP id 310F68FC16; Mon, 7 Nov 2011 15:36:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.infotech.no (Postfix) with ESMTP id 0AFB02041B9; Mon, 7 Nov 2011 16:36:24 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.6.6 (20110518) (Debian) at infotech.no Received: from smtp.infotech.no ([127.0.0.1]) by localhost (smtp.infotech.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MMCwAQ3dzoTw; Mon, 7 Nov 2011 16:36:19 +0100 (CET) Received: from [192.168.48.66] (ip-180.53.99.216.dsl-cust.ca.inter.net [216.99.53.180]) by smtp.infotech.no (Postfix) with ESMTPA id C66352041B1; Mon, 7 Nov 2011 16:36:17 +0100 (CET) Message-ID: <4EB7FAEF.30505@interlog.com> Date: Mon, 07 Nov 2011 10:36:15 -0500 From: Douglas Gilbert User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Rich References: <82B38DBF-DD3A-46CD-93F6-02CDB6506E05@slu.se> <20111025193302.GA30409@nargothrond.kdm.org> <20111026101602.GA9768@icarus.home.lan> <75BDE9FA-6130-4BB4-8518-275D68BB3E49@slu.se> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: "freebsd-scsi@freebsd.org" , "Kenneth D. Merry" , Jeremy Chadwick , "fs@freebsd.org" , =?ISO-8859-1?Q?Karli_Sj=F6berg?= Subject: Re: AOC-USAS2-L8i zfs panics and SCSI errors in messages X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dgilbert@interlog.com List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 15:36:27 -0000 On 11-11-07 03:56 AM, Rich wrote: > Observation - the LSI SAS expanders, in my experience, sometimes > misbehave when there are drives which respond slower than some timeout > to commands (as far as I've seen it's only SATA drives it does this > for, but I don't have many SAS drives for comparison), leading to all > further commands to that drive for a bit not working, and then what > happens depending on the OS varies dramatically. > > If you could try without an expander (e.g. with 1->4 SAS->SATA fanout > cables), you may be surprised (and/or annoyed) to find your life gets > better. SAS-2 expanders are better than the original generation. [LSI makes both.] SAS-2 added the CONFIGURE GENERAL SMP function which contains various timeout tweaks for the STP protocol (i.e. the protocol that tunnels (S)ATA commands between a SAS HBA (initiator) and an expander). If you are using SAS-2 expanders and FreeBSD 9.0 then you can fetch my smp_utils package and use the smp_conf_general utility to change those timeout settings. If you have SAS-2 expanders but an older version of FreeBSD then you will need Solaris or Linux to run my smp_utils package in order to change those timeout values on the expander. Doug Gilbert BTW smp_rep_general will show the current settings of those STP timeouts. > On Mon, Nov 7, 2011 at 3:48 AM, Karli Sjöberg wrote: >> As a test, I have copied in about 1.5TB and scrubbed several times without any panic. It stayed solid until periodic weekly:( Same panic as with daily. >> >> /Karli Sjöberg >> >> 26 okt 2011 kl. 12.16 skrev Jeremy Chadwick: >> >> On Wed, Oct 26, 2011 at 11:36:44AM +0200, Karli Sj?berg wrote: >> Hi all, >> >> I tracked down what causes the panics! >> >> I got a tip from aragon and phoenix at the forum about >> /etc/periodic/security/100.chksetuid >> >> And to put: >> daily_status_security_chksetuid_enable="NO" >> into /etc/periodic.conf >> >> This is not truly the cause of the panic, it simply exacerbates it. >> >> Many of the periodic scripts will do things like iterate over all files >> on the filesystem looking for specific attributes, etc.. This tends to >> stress filesystems heavily. This isn't the only one. :-) >> >> I can now run periodic daily without any panics. I?m still wondering >> about the cause of this, the explanation from the forum was that that >> phase is too demanding for multi TB systems. But I have several multi >> TB servers with FreeBSD and ZFS, and none of them has ever behaved >> this way. Besides, the panic is instantaneous, not degenerative. I >> imagine that a run like that would start out OK and then just get >> worse and worse, getting gradually slower and slower until it just >> wouldn?t cope any more and hang. This feels more like hitting a wall. >> As if it found something that is couldn?t deal with and has no choice >> but to panic immediately. >> >> It may be possible that you have some underlying filesystem corruption >> that triggers this situation. Have you actually tried doing a "zpool >> scrub" of your pools and seeing if any errors happen or if the panic >> occurs there? >> >> I'm inclined to think what you're experiencing is probably a bug or >> "quirk" in the storage controller driver you're using. There are other >> drivers that have had fixes applied to them "to make them work decently >> with ZFS", meaning the kind of stressful I/O ZFS puts on them results in >> the controller driver behaving oddly or freaking out, case in point. It >> could also be a controller firmware bug/quirk/design issue. Seriously. >> >> I believe the AOC-USAS2-L8i controller has been discussed on >> freebsd-stable, re: mps(4) driver problems or equivalent, but I'm not >> going to CC that list given that there would be 3 cross-posted lists >> involved and that is liable to upset some folks. You should search the >> mailing lists for discussion of Supermicro controllers that work >> reliably with FreeBSD. >> >> It would be worthwhile to discuss this condition on -stable, mainly with >> something like "Anyone else using the AOC-USAS2-L8i reliably with ZFS?" >> You get the idea. >> >> -- >> | Jeremy Chadwick jdc at parodius.com | >> | Parodius Networking http://www.parodius.com/ | >> | UNIX Systems Administrator Mountain View, CA, US | >> | Making life hard for others since 1977. PGP 4BD6C0CB | >> >> >> >> >> Med Vänliga Hälsningar >> ------------------------------------------------------------------------------- >> Karli Sjöberg >> Swedish University of Agricultural Sciences >> Box 7079 (Visiting Address Kronåsvägen 8) >> S-750 07 Uppsala, Sweden >> Phone: +46-(0)18-67 15 66 >> karli.sjoberg@slu.se >> >> _______________________________________________ >> freebsd-fs@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-fs >> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" >> > _______________________________________________ > freebsd-scsi@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-scsi > To unsubscribe, send any mail to "freebsd-scsi-unsubscribe@freebsd.org" > From owner-freebsd-scsi@FreeBSD.ORG Mon Nov 7 23:32:11 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 106EC106564A for ; Mon, 7 Nov 2011 23:32:11 +0000 (UTC) (envelope-from nitroboost@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id C10468FC19 for ; Mon, 7 Nov 2011 23:32:10 +0000 (UTC) Received: by vcbfo14 with SMTP id fo14so5030086vcb.13 for ; Mon, 07 Nov 2011 15:32:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xsOl31vs2PJvH/1HlFcpItVqNsH1UYL8sw4dLUwWYFA=; b=DdcuefcAB0bzJ9mRK5ky5pL51FioB4OPh1eZcJjoNOsM7YjMgIAqx0KPbDJFwmR4xn bhw+N2kVmlb5I7oeoLFISx4rEqjw53JpeqmO63l1/8X3nROzQAaIfgGWasxhm9qJgG0C MM13EtkQVT98TRLTLOpyr2J6lkJN7eOyBEExQ= MIME-Version: 1.0 Received: by 10.182.73.36 with SMTP id i4mr9679006obv.24.1320708729949; Mon, 07 Nov 2011 15:32:09 -0800 (PST) Received: by 10.182.30.164 with HTTP; Mon, 7 Nov 2011 15:32:09 -0800 (PST) In-Reply-To: <4EB26D8B.1090804@brockmann-consult.de> References: <4EB26D8B.1090804@brockmann-consult.de> Date: Mon, 7 Nov 2011 16:32:09 -0700 Message-ID: From: Jason Wolfe To: Peter Maloney Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-scsi@freebsd.org Subject: Re: mps/LSI SAS2008 controller crashes when smartctl is run with upped disk tags X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 23:32:11 -0000 On Thu, Nov 3, 2011 at 3:31 AM, Peter Maloney < peter.maloney@brockmann-consult.de> wrote: > Dear Jason, > > Does this mean it didn't hang? or it ran your smartctl -a test for 10 > minutes before a hang? > > I am also trying the mpslsi driver now, but I couldn't reproduce the > problem using "smartctl -a" (also tried -A, -h and -i) with the mps > driver. Tags was set to 255 on all disks. I only tried it on the backup > server, which didn't crash randomly on its own either. So I will just > have to assume it works if it doesn't do the same thing in a month or two. > > However, with the mpslsi driver, during a scrub on the backup server > (probably during smartctl -a), I got these messages (including what > looks like a controller reset), and no disks were lost, with no read > errors reported in zpool status. But I can't get it to happen a second > time. So I hope that means our problems are over. > > Peter > Peter, No, the server remains stable in the wake of the errors, the mpslsi driver just appears to handle the time outs gracefully and is more verbose in its messages. I see it was mentioned prior in the 'AOC-USAS2-L8i zfs panics and SCSI errors in messages' thread, but we are basically waiting on LSI to release the code to us which is held up in legal currently. Seems the standard response will be 'use the LSI driver' for now as folks understandably don't want to duplicate the effort. I'll continue to run the mps driver with a smartctl wrapper until we manage to get the code from LSI. Either way I have to cycle my machines, so better it be to the open one when the time comes. Jason From owner-freebsd-scsi@FreeBSD.ORG Tue Nov 8 19:57:18 2011 Return-Path: Delivered-To: freebsd-scsi@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D25451065693; Tue, 8 Nov 2011 19:57:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id AA0B88FC23; Tue, 8 Nov 2011 19:57:18 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8JvIFk035644; Tue, 8 Nov 2011 19:57:18 GMT (envelope-from marius@freefall.freebsd.org) Received: (from marius@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id pA8JvIOK035640; Tue, 8 Nov 2011 19:57:18 GMT (envelope-from marius) Date: Tue, 8 Nov 2011 19:57:18 GMT Message-Id: <201111081957.pA8JvIOK035640@freefall.freebsd.org> To: karsten@photor.de, marius@FreeBSD.org, freebsd-scsi@FreeBSD.org From: marius@FreeBSD.org Cc: Subject: Re: kern/124667: [amd] [panic] FreeBSD-7 kernel page faults at amd-scsi-driver with TEKRAM DC-390 [regression] X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 19:57:18 -0000 Synopsis: [amd] [panic] FreeBSD-7 kernel page faults at amd-scsi-driver with TEKRAM DC-390 [regression] State-Changed-From-To: open->closed State-Changed-By: marius State-Changed-When: Tue Nov 8 19:56:45 UTC 2011 State-Changed-Why: Close; this was solved by replacing amd(4) with esp(4). http://www.freebsd.org/cgi/query-pr.cgi?pr=124667