Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2001 12:37:26 -0700
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        sos@freebsd.org
Cc:        hackers@freebsd.org
Subject:   tunable support for ata interrupt sharing
Message-ID:  <20010821123726.A15204@Odin.AC.HMC.Edu>

next in thread | raw e-mail | index | archive | help

--mYCpIKhGyMATD0i+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Attached it a patch to make sharing of the main ata control interrupts
dependent on a tunable, hw.ata.shared_irqs.  This is required for my new
HP Omnibook 500 to use the CMD 648 in the expansion base to work as it
appears hardwired to interrupt 15 (which is fairly logical given that
there is no where to attach devices to the secondary channel.)  If this
looks ok and you don't have time to deal with it, I'd be happy to commit
it myself.

-- Brooks

--=20
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

Index: sys/dev/ata/ata-pci.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /usr/cvs/src/sys/dev/ata/ata-pci.c,v
retrieving revision 1.6
diff -u -r1.6 ata-pci.c
--- sys/dev/ata/ata-pci.c	8 Jun 2001 09:51:33 -0000	1.6
+++ sys/dev/ata/ata-pci.c	21 Aug 2001 05:08:32 -0000
@@ -49,6 +49,15 @@
 #include <pci/pcireg.h>
 #include <dev/ata/ata-all.h>
=20
+/* internal vars */
+static int shared_irqs =3D 0;
+TUNABLE_INT("hw.ata.shared_irqs", &shared_irqs);
+
+/* systcl vars */
+SYSCTL_DECL(_hw_ata);
+SYSCTL_INT(_hw_ata, OID_AUTO, shared_irqs, CTLFLAG_RD, &shared_irqs, 0,
+           "Share PCI IRQs?");
+
 /* misc defines */
 #define IOMASK	0xfffffffc
 #define ATA_MASTERDEV(dev)		((pci_get_progif(dev) & 0x80) && \
@@ -515,7 +524,8 @@
=20
 	    return BUS_ALLOC_RESOURCE(device_get_parent(dev), child,
 				      SYS_RES_IRQ, rid,
-				      irq, irq, 1, flags & ~RF_SHAREABLE);
+				      irq, irq, 1, flags &
+				      (shared_irqs ? ~0 : ~RF_SHAREABLE));
 #endif
 	}
 	else {
Index: share/man/man4/ata.4
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /usr/cvs/src/share/man/man4/ata.4,v
retrieving revision 1.20
diff -u -r1.20 ata.4
--- share/man/man4/ata.4	14 Jul 2001 19:40:46 -0000	1.20
+++ share/man/man4/ata.4	21 Aug 2001 19:19:56 -0000
@@ -71,6 +71,9 @@
 .It Va hw.ata.tags
 set to 1 to enable Tagged Queuing support (default is disabled)
 (only IBM DPTA and DTLA drives support that)
+.It Va hw.ata.shared_irqs
+set to 1 to allow sharing interrupts with the main controler
+(default is disabled)
 .El
 .Sh DESCRIPTION
 This driver provides access to disk drives, ATAPI CD-ROM and DVD drives,

--mYCpIKhGyMATD0i+
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7grh0XY6L6fI4GtQRAlrqAKDaFEALwkJj3a5YIQxhkfME/QdSCgCfYuDG
1b2y4IcMRrxcyzUeMM8A7BQ=
=dQu/
-----END PGP SIGNATURE-----

--mYCpIKhGyMATD0i+--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010821123726.A15204>