Date: Fri, 28 Apr 2006 17:28:48 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96316 for review Message-ID: <200604281728.k3SHSmUk056886@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96316 Change 96316 by marcel@marcel_nfs on 2006/04/28 17:28:47 IFC @96315 Affected files ... .. //depot/projects/uart/amd64/conf/GENERIC#18 integrate .. //depot/projects/uart/amd64/conf/NOTES#7 integrate .. //depot/projects/uart/conf/files.amd64#21 integrate .. //depot/projects/uart/dev/bfe/if_bfe.c#12 integrate .. //depot/projects/uart/dev/sk/if_sk.c#5 integrate .. //depot/projects/uart/dev/sk/if_skreg.h#3 integrate .. //depot/projects/uart/geom/mirror/g_mirror.c#15 integrate .. //depot/projects/uart/geom/raid3/g_raid3.c#17 integrate .. //depot/projects/uart/i386/i386/vm_machdep.c#16 integrate .. //depot/projects/uart/kern/vfs_lookup.c#12 integrate .. //depot/projects/uart/kern/vfs_subr.c#28 integrate .. //depot/projects/uart/modules/Makefile#33 integrate .. //depot/projects/uart/modules/rr232x/Makefile#2 integrate .. //depot/projects/uart/sys/bufobj.h#7 integrate .. //depot/projects/uart/ufs/ffs/ffs_vfsops.c#22 integrate Differences ... ==== //depot/projects/uart/amd64/conf/GENERIC#18 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.453 2006/04/24 08:44:33 delphij Exp $ +# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.454 2006/04/28 05:23:10 scottl Exp $ cpu HAMMER ident GENERIC @@ -128,6 +128,7 @@ device ciss # Compaq Smart RAID 5* device dpt # DPT Smartcache III, IV - See NOTES for options device hptmv # Highpoint RocketRAID 182x +device rr232x # Highpoint RocketRAID 232x device iir # Intel Integrated RAID device ips # IBM (Adaptec) ServeRAID device mly # Mylex AcceleRAID/eXtremeRAID ==== //depot/projects/uart/amd64/conf/NOTES#7 (text+ko) ==== @@ -4,7 +4,7 @@ # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # -# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.52 2006/03/06 15:29:28 yar Exp $ +# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.53 2006/04/28 05:23:10 scottl Exp $ # # @@ -281,6 +281,11 @@ device hptmv # +# Highpoint RocketRAID 232x. This is software RAID but with hardware +# acceleration assistance for RAID_5. +device rr232x + +# # IBM (now Adaptec) ServeRAID controllers device ips ==== //depot/projects/uart/conf/files.amd64#21 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.amd64,v 1.85 2006/04/24 23:31:50 marcel Exp $ +# $FreeBSD: src/sys/conf/files.amd64,v 1.86 2006/04/28 05:23:09 scottl Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -72,6 +72,10 @@ dependency "$S/dev/hptmv/amd64-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/amd64-elf.raid.o.uu" \ no-implicit-rule +rr232x_lib.o optional rr232x \ + dependency "$S/dev/rr232x/amd64-elf.rr232x_lib.o.uu" \ + compile-with "uudecode < $S/dev/rr232x/amd64-elf.rr232x_lib.o.uu" \ + no-implicit-rule # amd64/acpica/OsdEnvironment.c optional acpi amd64/acpica/acpi_machdep.c optional acpi @@ -174,6 +178,9 @@ dev/kbd/kbd.c optional atkbd | sc | ukbd dev/mem/memutil.c optional mem dev/nve/if_nve.c optional nve pci +dev/rr232x/os_bsd.c optional rr232x +dev/rr232x/osm_bsd.c optional rr232x +dev/rr232x/rr232x_config.c optional rr232x dev/sio/sio.c optional sio dev/sio/sio_isa.c optional sio isa dev/speaker/spkr.c optional speaker ==== //depot/projects/uart/dev/bfe/if_bfe.c#12 (text+ko) ==== @@ -26,7 +26,7 @@ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/bfe/if_bfe.c,v 1.34 2006/04/27 23:03:00 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bfe/if_bfe.c,v 1.36 2006/04/28 05:38:12 silby Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -203,7 +203,7 @@ */ error = bus_dma_tag_create(NULL, /* parent */ PAGE_SIZE, 0, /* alignment, boundary */ - 0x40000000, /* lowaddr */ + 0x3FFFFFFF, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ MAXBSIZE, /* maxsize */ @@ -302,7 +302,7 @@ if(error) return (ENOMEM); - bus_dmamap_sync(sc->bfe_rx_tag, sc->bfe_rx_map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->bfe_rx_tag, sc->bfe_rx_map, BUS_DMASYNC_PREWRITE); error = bus_dmamem_alloc(sc->bfe_tx_tag, (void *)&sc->bfe_tx_list, BUS_DMA_NOWAIT, &sc->bfe_tx_map); @@ -317,7 +317,7 @@ return (ENOMEM); bzero(sc->bfe_tx_list, BFE_TX_LIST_SIZE); - bus_dmamap_sync(sc->bfe_tx_tag, sc->bfe_tx_map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->bfe_tx_tag, sc->bfe_tx_map, BUS_DMASYNC_PREWRITE); return (0); } @@ -527,7 +527,7 @@ } } bzero(sc->bfe_tx_list, BFE_TX_LIST_SIZE); - bus_dmamap_sync(sc->bfe_tx_tag, sc->bfe_tx_map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->bfe_tx_tag, sc->bfe_tx_map, BUS_DMASYNC_PREWRITE); } static void @@ -544,7 +544,7 @@ } } bzero(sc->bfe_rx_list, BFE_RX_LIST_SIZE); - bus_dmamap_sync(sc->bfe_rx_tag, sc->bfe_rx_map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->bfe_rx_tag, sc->bfe_rx_map, BUS_DMASYNC_PREWRITE); } static int @@ -557,7 +557,7 @@ return (ENOBUFS); } - bus_dmamap_sync(sc->bfe_rx_tag, sc->bfe_rx_map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->bfe_rx_tag, sc->bfe_rx_map, BUS_DMASYNC_PREWRITE); CSR_WRITE_4(sc, BFE_DMARX_PTR, (i * sizeof(struct bfe_desc))); sc->bfe_rx_cons = 0; @@ -595,7 +595,7 @@ r = &sc->bfe_rx_ring[c]; bus_dmamap_load(sc->bfe_tag, r->bfe_map, mtod(m, void *), MCLBYTES, bfe_dma_map_desc, d, 0); - bus_dmamap_sync(sc->bfe_tag, r->bfe_map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->bfe_tag, r->bfe_map, BUS_DMASYNC_PREWRITE); ctrl = ETHER_MAX_LEN + 32; @@ -604,7 +604,7 @@ d->bfe_ctrl = ctrl; r->bfe_mbuf = m; - bus_dmamap_sync(sc->bfe_rx_tag, sc->bfe_rx_map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->bfe_rx_tag, sc->bfe_rx_map, BUS_DMASYNC_PREWRITE); return (0); } @@ -1139,7 +1139,7 @@ r = &sc->bfe_rx_ring[cons]; m = r->bfe_mbuf; rxheader = mtod(m, struct bfe_rxheader*); - bus_dmamap_sync(sc->bfe_tag, r->bfe_map, BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(sc->bfe_tag, r->bfe_map, BUS_DMASYNC_POSTREAD); len = rxheader->len; r->bfe_mbuf = NULL; @@ -1301,7 +1301,7 @@ r->bfe_map, mtod(m, void*), m->m_len, bfe_dma_map_desc, d, 0); bus_dmamap_sync(sc->bfe_tag, r->bfe_map, - BUS_DMASYNC_PREREAD); + BUS_DMASYNC_PREWRITE); frag = cur; BFE_INC(cur, BFE_TX_LIST_CNT); @@ -1314,7 +1314,7 @@ sc->bfe_tx_list[frag].bfe_ctrl |= BFE_DESC_EOF; sc->bfe_tx_ring[frag].bfe_mbuf = m_head; - bus_dmamap_sync(sc->bfe_tx_tag, sc->bfe_tx_map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->bfe_tx_tag, sc->bfe_tx_map, BUS_DMASYNC_PREWRITE); *txidx = cur; sc->bfe_tx_cnt += cnt; ==== //depot/projects/uart/dev/sk/if_sk.c#5 (text) ==== @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/sk/if_sk.c,v 1.121 2006/04/27 05:59:09 yongari Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/sk/if_sk.c,v 1.122 2006/04/28 03:17:36 sobomax Exp $"); /* * SysKonnect SK-NET gigabit ethernet driver for FreeBSD. Supports @@ -140,7 +140,7 @@ #ifndef lint static const char rcsid[] = - "$FreeBSD: src/sys/dev/sk/if_sk.c,v 1.121 2006/04/27 05:59:09 yongari Exp $"; + "$FreeBSD: src/sys/dev/sk/if_sk.c,v 1.122 2006/04/28 03:17:36 sobomax Exp $"; #endif static struct sk_type sk_devs[] = { @@ -161,6 +161,21 @@ }, { VENDORID_MARVELL, + DEVICEID_MRVL_4360, + "Marvell 88E8052 Gigabit Ethernet Controller" + }, + { + VENDORID_MARVELL, + DEVICEID_MRVL_4361, + "Marvell 88E8050 Gigabit Ethernet Controller" + }, + { + VENDORID_MARVELL, + DEVICEID_MRVL_4362, + "Marvell 88E8053 Gigabit Ethernet Controller" + }, + { + VENDORID_MARVELL, DEVICEID_BELKIN_5005, "Belkin F5D5005 Gigabit Ethernet" }, @@ -571,6 +586,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: v = sk_marv_miibus_readreg(sc_if, phy, reg); break; default: @@ -600,6 +616,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: v = sk_marv_miibus_writereg(sc_if, phy, reg, val); break; default: @@ -627,6 +644,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: sk_marv_miibus_statchg(sc_if); break; } @@ -852,6 +870,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: SK_YU_WRITE_2(sc_if, YUKON_MCAH1, 0); SK_YU_WRITE_2(sc_if, YUKON_MCAH2, 0); SK_YU_WRITE_2(sc_if, YUKON_MCAH3, 0); @@ -893,6 +912,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: bcopy(LLADDR( (struct sockaddr_dl *)ifma->ifma_addr), maddr, ETHER_ADDR_LEN); @@ -917,6 +937,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: SK_YU_WRITE_2(sc_if, YUKON_MCAH1, hashes[0] & 0xffff); SK_YU_WRITE_2(sc_if, YUKON_MCAH2, (hashes[0] >> 16) & 0xffff); SK_YU_WRITE_2(sc_if, YUKON_MCAH3, hashes[1] & 0xffff); @@ -947,6 +968,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: if (ifp->if_flags & IFF_PROMISC) { SK_YU_CLRBIT_2(sc_if, YUKON_RCR, YU_RCR_UFLEN | YU_RCR_MUFLEN); @@ -1395,6 +1417,9 @@ case SK_GENESIS: sc->sk_int_ticks = SK_IMTIMER_TICKS_GENESIS; break; + case SK_YUKON_EC: + sc->sk_int_ticks = SK_IMTIMER_TICKS_YUKON_EC; + break; default: sc->sk_int_ticks = SK_IMTIMER_TICKS_YUKON; break; @@ -1432,6 +1457,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: device_set_desc(dev, "Marvell Semiconductor, Inc. Yukon"); break; } @@ -1527,8 +1553,12 @@ * receiver and b) between the two XMACs, if this is a * dual port NIC. Our algotithm is to divide up the memory * evenly so that everyone gets a fair share. + * + * Just to be contrary, Yukon2 appears to have separate memory + * for each MAC. */ - if (sk_win_read_1(sc, SK_CONFIG) & SK_CONFIG_SINGLEMAC) { + if (SK_IS_YUKON2(sc) || + sk_win_read_1(sc, SK_CONFIG) & SK_CONFIG_SINGLEMAC) { u_int32_t chunk, val; chunk = sc->sk_ramsize / 2; @@ -1555,22 +1585,32 @@ /* Read and save PHY type and set PHY address */ sc_if->sk_phytype = sk_win_read_1(sc, SK_EPROM1) & 0xF; - switch(sc_if->sk_phytype) { - case SK_PHYTYPE_XMAC: - sc_if->sk_phyaddr = SK_PHYADDR_XMAC; - break; - case SK_PHYTYPE_BCOM: - sc_if->sk_phyaddr = SK_PHYADDR_BCOM; - break; - case SK_PHYTYPE_MARV_COPPER: + if (!SK_YUKON_FAMILY(sc->sk_type)) { + switch(sc_if->sk_phytype) { + case SK_PHYTYPE_XMAC: + sc_if->sk_phyaddr = SK_PHYADDR_XMAC; + break; + case SK_PHYTYPE_BCOM: + sc_if->sk_phyaddr = SK_PHYADDR_BCOM; + break; + default: + device_printf(sc->sk_dev, "unsupported PHY type: %d\n", + sc_if->sk_phytype); + error = ENODEV; + SK_IF_UNLOCK(sc_if); + goto fail; + } + } else { + if (sc_if->sk_phytype < SK_PHYTYPE_MARV_COPPER && + sc->sk_pmd == IFM_1000_T) { + /* not initialized, punt */ + sc_if->sk_phytype = SK_PHYTYPE_MARV_COPPER; + } + sc_if->sk_phyaddr = SK_PHYADDR_MARV; - break; - default: - device_printf(sc->sk_dev, "unsupported PHY type: %d\n", - sc_if->sk_phytype); - error = ENODEV; - SK_IF_UNLOCK(sc_if); - goto fail; + + if (sc->sk_pmd != IFM_1000_T && sc->sk_pmd != IFM_1000_CX) + sc_if->sk_phytype = SK_PHYTYPE_MARV_FIBER; } /* @@ -1605,6 +1645,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: sk_init_yukon(sc_if); break; } @@ -1637,7 +1678,7 @@ device_t dev; { struct sk_softc *sc; - int error = 0, rid, *port; + int error = 0, rid, *port, sk_macs; uint8_t skrs; char *pname, *revstr; @@ -1759,6 +1800,12 @@ sc->sk_pmd = IFM_1000_T; break; default: + if (SK_YUKON_FAMILY(sc->sk_type) && (sk_win_read_1(sc, SK_EPROM1) + & 0xF) < SK_PHYTYPE_MARV_COPPER) { + /* not initialized, punt */ + sc->sk_pmd = IFM_1000_T; + break; + } device_printf(dev, "unknown media type: 0x%x\n", sk_win_read_1(sc, SK_PMDTYPE)); error = ENXIO; @@ -1777,6 +1824,9 @@ pname = sc->sk_vpd_prodname; break; case DEVICEID_SK_V2: + case DEVICEID_MRVL_4360: + case DEVICEID_MRVL_4361: + case DEVICEID_MRVL_4362: /* YUKON VPD PN might bear no resemblance to reality. */ switch (sc->sk_type) { case SK_GENESIS: @@ -1792,6 +1842,9 @@ case SK_YUKON_LP: pname = "Marvell Yukon LP Gigabit Ethernet"; break; + case SK_YUKON_EC: + pname = "Marvell Yukon-2 EC Gigabit Ethernet"; + break; default: pname = "Marvell Yukon (Unknown) Gigabit Ethernet"; break; @@ -1841,6 +1894,21 @@ revstr = ""; break; } + } else if (sc->sk_type == SK_YUKON_EC) { + switch (sc->sk_rev) { + case SK_YUKON_EC_REV_A1: + revstr = "A1"; + break; + case SK_YUKON_EC_REV_A2: + revstr = "A2"; + break; + case SK_YUKON_EC_REV_A3: + revstr = "A3"; + break; + default: + revstr = ""; + break; + } } else { revstr = ""; } @@ -1899,7 +1967,23 @@ *port = SK_PORT_A; device_set_ivars(sc->sk_devs[SK_PORT_A], port); - if (!(sk_win_read_1(sc, SK_CONFIG) & SK_CONFIG_SINGLEMAC)) { + sk_macs = 1; + + if (SK_IS_YUKON2(sc)) { + u_int8_t hw; + + hw = sk_win_read_1(sc, SK_Y2_HWRES); + if ((hw & SK_Y2_HWRES_LINK_MASK) == SK_Y2_HWRES_LINK_DUAL) { + if ((sk_win_read_1(sc, SK_Y2_CLKGATE) & + SK_Y2_CLKGATE_LINK2_INACTIVE) == 0) + sk_macs++; + } + } else { + if (!(sk_win_read_1(sc, SK_CONFIG) & SK_CONFIG_SINGLEMAC)) + sk_macs++; + } + + if (sk_macs > 1) { sc->sk_devs[SK_PORT_B] = device_add_child(dev, "sk", -1); if (sc->sk_devs[SK_PORT_B] == NULL) { device_printf(dev, "failed to add child for PORT_B\n"); @@ -3813,6 +3897,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: sk_init_yukon(sc_if); break; } @@ -3916,6 +4001,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: reg = SK_YU_READ_2(sc_if, YUKON_GPCR); reg |= YU_GPCR_TXEN | YU_GPCR_RXEN; #if 0 @@ -3937,6 +4023,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: callout_reset(&sc_if->sk_tick_ch, hz, sk_yukon_tick, sc_if); break; } @@ -4010,6 +4097,7 @@ case SK_YUKON: case SK_YUKON_LITE: case SK_YUKON_LP: + case SK_YUKON_EC: SK_IF_WRITE_1(sc_if,0, SK_RXMF1_CTRL_TEST, SK_RFCTL_RESET_SET); SK_IF_WRITE_1(sc_if,0, SK_TXMF1_CTRL_TEST, SK_TFCTL_RESET_SET); break; ==== //depot/projects/uart/dev/sk/if_skreg.h#3 (text) ==== @@ -31,7 +31,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/sk/if_skreg.h,v 1.33 2006/04/27 05:59:09 yongari Exp $ + * $FreeBSD: src/sys/dev/sk/if_skreg.h,v 1.34 2006/04/28 03:17:37 sobomax Exp $ */ /*- @@ -55,13 +55,23 @@ #define SK_YUKON 0xB0 #define SK_YUKON_LITE 0xB1 #define SK_YUKON_LP 0xB2 +#define SK_YUKON_XL 0xB3 +#define SK_YUKON_EC_U 0xB4 +#define SK_YUKON_EC 0xB6 +#define SK_YUKON_FE 0xB7 #define SK_YUKON_FAMILY(x) ((x) & 0xB0) +#define SK_IS_YUKON2(sc) \ + ((sc)->sk_type >= SK_YUKON_XL && (sc)->sk_type <= SK_YUKON_FE) /* Known revisions in SK_CONFIG. */ #define SK_YUKON_LITE_REV_A0 0x0 /* invented, see test in skc_attach. */ #define SK_YUKON_LITE_REV_A1 0x3 #define SK_YUKON_LITE_REV_A3 0x7 +#define SK_YUKON_EC_REV_A1 0x0 +#define SK_YUKON_EC_REV_A2 0x1 +#define SK_YUKON_EC_REV_A3 0x2 + /* * SysKonnect PCI vendor ID */ @@ -79,6 +89,13 @@ #define DEVICEID_SK_V2 0x4320 /* + * Marvell gigabit ethernet device IDs + */ +#define DEVICEID_MRVL_4360 0x4360 +#define DEVICEID_MRVL_4361 0x4361 +#define DEVICEID_MRVL_4362 0x4362 + +/* * Belkin F5D5005 */ #define DEVICEID_BELKIN_5005 0x5005 @@ -345,8 +362,10 @@ #define SK_CONFIG 0x011A #define SK_CHIPVER 0x011B #define SK_EPROM0 0x011C -#define SK_EPROM1 0x011D -#define SK_EPROM2 0x011E +#define SK_EPROM1 0x011D /* yukon/genesis */ +#define SK_Y2_CLKGATE 0x011D /* yukon 2 */ +#define SK_EPROM2 0x011E /* yukon/genesis */ +#define SK_Y2_HWRES 0x011E /* yukon 2 */ #define SK_EPROM3 0x011F #define SK_EP_ADDR 0x0120 #define SK_EP_DATA 0x0124 @@ -452,6 +471,13 @@ #define SK_GPIO_DIR8 0x01000000 #define SK_GPIO_DIR9 0x02000000 +#define SK_Y2_CLKGATE_LINK2_INACTIVE 0x80 /* port 2 inactive */ + +#define SK_Y2_HWRES_LINK_1 0x01 +#define SK_Y2_HWRES_LINK_2 0x02 +#define SK_Y2_HWRES_LINK_MASK (SK_Y2_HWRES_LINK_1 | SK_Y2_HWRES_LINK_2) +#define SK_Y2_HWRES_LINK_DUAL (SK_Y2_HWRES_LINK_1 | SK_Y2_HWRES_LINK_2) + /* Block 3 Ram interface and MAC arbiter registers */ #define SK_RAMADDR 0x0180 #define SK_RAMDATA0 0x0184 ==== //depot/projects/uart/geom/mirror/g_mirror.c#15 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/geom/mirror/g_mirror.c,v 1.81 2006/04/10 10:32:21 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/geom/mirror/g_mirror.c,v 1.83 2006/04/28 12:13:49 pjd Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -539,13 +539,11 @@ } } callout_drain(&sc->sc_callout); - gp->softc = NULL; g_topology_lock(); LIST_FOREACH_SAFE(cp, &sc->sc_sync.ds_geom->consumer, consumer, tmpcp) { g_mirror_disconnect_consumer(sc, cp); } - sc->sc_sync.ds_geom->softc = NULL; g_wither_geom(sc->sc_sync.ds_geom, ENXIO); G_MIRROR_DEBUG(0, "Device %s destroyed.", gp->name); g_wither_geom(gp, ENXIO); @@ -1660,6 +1658,8 @@ g_topology_assert(); gp = sc->sc_geom; + if (gp->softc == NULL) + return (1); LIST_FOREACH(cp, &gp->consumer, consumer) { if (g_mirror_is_busy(sc, cp)) return (0); @@ -1689,6 +1689,8 @@ g_topology_unlock(); return (0); } + sc->sc_geom->softc = NULL; + sc->sc_sync.ds_geom->softc = NULL; if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_WAIT) != 0) { g_topology_unlock(); G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, @@ -1782,14 +1784,6 @@ mtx_lock(&sc->sc_queue_mtx); bp = bioq_first(&sc->sc_queue); if (bp == NULL) { - if (ep != NULL) { - /* - * We have a pending even, try to serve it - * again. - */ - mtx_unlock(&sc->sc_queue_mtx); - continue; - } if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { mtx_unlock(&sc->sc_queue_mtx); @@ -1801,6 +1795,15 @@ mtx_lock(&sc->sc_queue_mtx); } sx_xunlock(&sc->sc_lock); + /* + * XXX: We can miss an event here, because an event + * can be added without sx-device-lock and without + * mtx-queue-lock. Maybe I should just stop using + * dedicated mutex for events synchronization and + * stick with the queue lock? + * The event will hang here until next I/O request + * or next event is received. + */ MSLEEP(sc, &sc->sc_queue_mtx, PRIBIO | PDROP, "m:w1", timeout * hz); sx_xlock(&sc->sc_lock); @@ -2886,6 +2889,15 @@ } } + g_topology_lock(); + if (sc->sc_geom->softc == NULL) { + g_topology_unlock(); + return (0); + } + sc->sc_geom->softc = NULL; + sc->sc_sync.ds_geom->softc = NULL; + g_topology_unlock(); + sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DESTROY; sc->sc_flags |= G_MIRROR_DEVICE_FLAG_WAIT; G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); ==== //depot/projects/uart/geom/raid3/g_raid3.c#17 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/geom/raid3/g_raid3.c,v 1.61 2006/04/18 13:52:11 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/geom/raid3/g_raid3.c,v 1.64 2006/04/28 12:18:03 pjd Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -602,12 +602,10 @@ } } callout_drain(&sc->sc_callout); - gp->softc = NULL; cp = LIST_FIRST(&sc->sc_sync.ds_geom->consumer); g_topology_lock(); if (cp != NULL) g_raid3_disconnect_consumer(sc, cp); - sc->sc_sync.ds_geom->softc = NULL; g_wither_geom(sc->sc_sync.ds_geom, ENXIO); G_RAID3_DEBUG(0, "Device %s destroyed.", gp->name); g_wither_geom(gp, ENXIO); @@ -1876,6 +1874,8 @@ g_topology_assert(); gp = sc->sc_geom; + if (gp->softc == NULL) + return (1); LIST_FOREACH(cp, &gp->consumer, consumer) { if (g_raid3_is_busy(sc, cp)) return (0); @@ -1909,6 +1909,8 @@ g_topology_unlock(); return (0); } + sc->sc_geom->softc = NULL; + sc->sc_sync.ds_geom->softc = NULL; if ((sc->sc_flags & G_RAID3_DEVICE_FLAG_WAIT) != 0) { g_topology_unlock(); G_RAID3_DEBUG(4, "%s: Waking up %p.", __func__, @@ -2003,15 +2005,6 @@ mtx_lock(&sc->sc_queue_mtx); bp = bioq_first(&sc->sc_queue); if (bp == NULL) { - if (ep != NULL) { - /* - * We have a pending even, try to serve it - * again. - */ - mtx_unlock(&sc->sc_queue_mtx); - tsleep(ep, PRIBIO, "r3:top1", hz / 5); - continue; - } if ((sc->sc_flags & G_RAID3_DEVICE_FLAG_DESTROY) != 0) { mtx_unlock(&sc->sc_queue_mtx); @@ -2023,12 +2016,22 @@ mtx_lock(&sc->sc_queue_mtx); } sx_xunlock(&sc->sc_lock); + /* + * XXX: We can miss an event here, because an event + * can be added without sx-device-lock and without + * mtx-queue-lock. Maybe I should just stop using + * dedicated mutex for events synchronization and + * stick with the queue lock? + * The event will hang here until next I/O request + * or next event is received. + */ MSLEEP(sc, &sc->sc_queue_mtx, PRIBIO | PDROP, "r3:w1", timeout * hz); sx_xlock(&sc->sc_lock); G_RAID3_DEBUG(5, "%s: I'm here 4.", __func__); continue; } +process: bioq_remove(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); @@ -2036,13 +2039,29 @@ g_raid3_regular_request(bp); else if ((bp->bio_cflags & G_RAID3_BIO_CFLAG_SYNC) != 0) g_raid3_sync_request(bp); - else { - if (g_raid3_register_request(bp) != 0) { - mtx_lock(&sc->sc_queue_mtx); - bioq_insert_head(&sc->sc_queue, bp); - MSLEEP(&sc->sc_queue, &sc->sc_queue_mtx, - PRIBIO | PDROP, "r3:lowmem", hz / 10); + else if (g_raid3_register_request(bp) != 0) { + mtx_lock(&sc->sc_queue_mtx); + bioq_insert_head(&sc->sc_queue, bp); + /* + * We are short in memory, let see if there are finished + * request we can free. + */ + TAILQ_FOREACH(bp, &sc->sc_queue.queue, bio_queue) { + if (bp->bio_cflags & G_RAID3_BIO_CFLAG_REGULAR) + goto process; + } + /* + * No finished regular request, so at least keep + * synchronization running. + */ + TAILQ_FOREACH(bp, &sc->sc_queue.queue, bio_queue) { + if (bp->bio_cflags & G_RAID3_BIO_CFLAG_SYNC) + goto process; } + sx_xunlock(&sc->sc_lock); + MSLEEP(&sc->sc_queue, &sc->sc_queue_mtx, PRIBIO | PDROP, + "r3:lowmem", hz / 10); + sx_xlock(&sc->sc_lock); } G_RAID3_DEBUG(5, "%s: I'm here 9.", __func__); } @@ -3112,6 +3131,15 @@ } } + g_topology_lock(); + if (sc->sc_geom->softc == NULL) { + g_topology_unlock(); + return (0); + } + sc->sc_geom->softc = NULL; + sc->sc_sync.ds_geom->softc = NULL; + g_topology_unlock(); + sc->sc_flags |= G_RAID3_DEVICE_FLAG_DESTROY; sc->sc_flags |= G_RAID3_DEVICE_FLAG_WAIT; G_RAID3_DEBUG(4, "%s: Waking up %p.", __func__, sc); ==== //depot/projects/uart/i386/i386/vm_machdep.c#16 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.270 2006/04/27 05:18:26 sobomax Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.271 2006/04/28 03:38:23 sobomax Exp $"); #include "opt_isa.h" #include "opt_npx.h" @@ -590,7 +590,9 @@ static void cpu_reset_real() { +#ifndef PC98 int b; +#endif disable_intr(); #ifdef CPU_ELAN ==== //depot/projects/uart/kern/vfs_lookup.c#12 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/vfs_lookup.c,v 1.89 2006/03/31 02:59:23 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/vfs_lookup.c,v 1.90 2006/04/28 00:59:48 jeff Exp $"); #include "opt_ktrace.h" #include "opt_mac.h" @@ -358,15 +358,15 @@ int dpunlocked = 0; /* dp has already been unlocked */ struct componentname *cnp = &ndp->ni_cnd; struct thread *td = cnp->cn_thread; - int vfslocked; + int vfslocked; /* VFS Giant state for child */ + int dvfslocked; /* VFS Giant state for parent */ int tvfslocked; - int dvfslocked; /* * Setup: break out flag bits into variables. */ - vfslocked = (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; - dvfslocked = 0; + dvfslocked = (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; + vfslocked = 0; ndp->ni_cnd.cn_flags &= ~GIANTHELD; wantparent = cnp->cn_flags & (LOCKPARENT | WANTPARENT); KASSERT(cnp->cn_nameiop == LOOKUP || wantparent, @@ -520,8 +520,8 @@ } tdp = dp; dp = dp->v_mount->mnt_vnodecovered; - tvfslocked = vfslocked; - vfslocked = VFS_LOCK_GIANT(dp->v_mount); + tvfslocked = dvfslocked; + dvfslocked = VFS_LOCK_GIANT(dp->v_mount); VREF(dp); vput(tdp); VFS_UNLOCK_GIANT(tvfslocked); @@ -543,6 +543,7 @@ ndp->ni_dvp = dp; ndp->ni_vp = NULL; ASSERT_VOP_LOCKED(dp, "lookup"); + VNASSERT(vfslocked == 0, dp, ("lookup: vfslocked %d", vfslocked)); /* * If we have a shared lock we may need to upgrade the lock for the * last operation. @@ -570,8 +571,8 @@ (dp->v_mount->mnt_flag & MNT_UNION)) { tdp = dp; dp = dp->v_mount->mnt_vnodecovered; - tvfslocked = vfslocked; - vfslocked = VFS_LOCK_GIANT(dp->v_mount); + tvfslocked = dvfslocked; + dvfslocked = VFS_LOCK_GIANT(dp->v_mount); VREF(dp); vput(tdp); VFS_UNLOCK_GIANT(tvfslocked); @@ -628,6 +629,7 @@ } dp = ndp->ni_vp; + vfslocked = VFS_LOCK_GIANT(dp->v_mount); /* * Check to see if the vnode has been mounted on; @@ -635,14 +637,13 @@ */ while (dp->v_type == VDIR && (mp = dp->v_mountedhere) && (cnp->cn_flags & NOCROSSMOUNT) == 0) { - KASSERT(dp != ndp->ni_dvp, ("XXX")); if (vfs_busy(mp, 0, 0, td)) continue; vput(dp); - VFS_UNLOCK_GIANT(dvfslocked); - dvfslocked = vfslocked; + VFS_UNLOCK_GIANT(vfslocked); vfslocked = VFS_LOCK_GIANT(mp); - VOP_UNLOCK(ndp->ni_dvp, 0, td); + if (dp != ndp->ni_dvp) + VOP_UNLOCK(ndp->ni_dvp, 0, td); error = VFS_ROOT(mp, cnp->cn_lkflags, &tdp, td); vfs_unbusy(mp, td); vn_lock(ndp->ni_dvp, cnp->cn_lkflags | LK_RETRY, td); @@ -704,7 +705,8 @@ else vrele(ndp->ni_dvp); VFS_UNLOCK_GIANT(dvfslocked); - dvfslocked = 0; + dvfslocked = vfslocked; /* dp becomes dvp in dirloop */ + vfslocked = 0; goto dirloop; } /* ==== //depot/projects/uart/kern/vfs_subr.c#28 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/vfs_subr.c,v 1.669 2006/04/04 06:46:10 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/vfs_subr.c,v 1.670 2006/04/28 01:05:31 jeff Exp $"); #include "opt_ddb.h" #include "opt_mac.h" @@ -1446,7 +1446,8 @@ ASSERT_VI_LOCKED(vp, "bgetvp"); vholdl(vp); - if (VFS_NEEDSGIANT(vp->v_mount)) + if (VFS_NEEDSGIANT(vp->v_mount) || + vp->v_bufobj.bo_flag & BO_NEEDSGIANT) bp->b_flags |= B_NEEDSGIANT; bp->b_vp = vp; bp->b_bufobj = &vp->v_bufobj; ==== //depot/projects/uart/modules/Makefile#33 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/modules/Makefile,v 1.489 2006/04/27 20:22:45 scottl Exp $ +# $FreeBSD: src/sys/modules/Makefile,v 1.490 2006/04/28 05:23:10 scottl Exp $ .include <bsd.own.mk> @@ -472,6 +472,7 @@ _mly= mly _ndis= ndis _nve= nve +_rr232x= rr232x _safe= safe _scsi_low= scsi_low _smbfs= smbfs ==== //depot/projects/uart/modules/rr232x/Makefile#2 (text) ==== @@ -1,8 +1,8 @@ # $Id: Makefile.def,v 1.14 2006/04/06 09:23:49 gmm Exp $ -# $FreeBSD: src/sys/modules/rr232x/Makefile,v 1.1 2006/04/27 20:22:46 scottl Exp $ +# $FreeBSD: src/sys/modules/rr232x/Makefile,v 1.2 2006/04/28 04:00:50 scottl Exp $ RR232X= ${.CURDIR}/../../dev/rr232x -PATH: ${RR232X} +.PATH: ${RR232X} KMOD = rr232x SRCS = opt_scsi.h opt_cam.h bus_if.h device_if.h pci_if.h os_bsd.h os_bsd.c osm_bsd.c rr232x_config.c ==== //depot/projects/uart/sys/bufobj.h#7 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604281728.k3SHSmUk056886>