Date: Tue, 2 Aug 2011 18:34:56 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 197083 for review Message-ID: <201108021834.p72IYuSn027514@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@197083?ac=10 Change 197083 by jhb@jhb_jhbbsd on 2011/08/02 18:34:46 IFC @197082 Affected files ... .. //depot/projects/pci/sys/amd64/amd64/machdep.c#5 integrate .. //depot/projects/pci/sys/arm/arm/irq_dispatch.S#3 integrate .. //depot/projects/pci/sys/arm/sa11x0/sa11x0_irq.S#3 integrate .. //depot/projects/pci/sys/boot/forth/loader.conf#4 integrate .. //depot/projects/pci/sys/cam/ata/ata_da.c#5 integrate .. //depot/projects/pci/sys/cam/cam_periph.c#4 integrate .. //depot/projects/pci/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c#2 integrate .. //depot/projects/pci/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#4 integrate .. //depot/projects/pci/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c#2 integrate .. //depot/projects/pci/sys/compat/linprocfs/linprocfs.c#5 integrate .. //depot/projects/pci/sys/conf/NOTES#7 integrate .. //depot/projects/pci/sys/conf/newvers.sh#3 integrate .. //depot/projects/pci/sys/conf/options#9 integrate .. //depot/projects/pci/sys/dev/ahci/ahci.c#6 integrate .. //depot/projects/pci/sys/dev/ahci/ahci.h#4 integrate .. //depot/projects/pci/sys/dev/ata/chipsets/ata-nvidia.c#2 integrate .. //depot/projects/pci/sys/dev/ath/ath_dfs/null/dfs_null.c#3 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ah.h#7 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ah_desc.h#4 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ah_eeprom.h#4 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ah_eeprom_9287.c#2 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ah_eeprom_v14.c#5 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ah_eeprom_v14.h#5 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ah_eeprom_v4k.c#3 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c#2 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ar5416/ar5416.h#5 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c#4 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c#6 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c#5 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c#7 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c#3 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ar9002/ar9280.c#3 integrate .. //depot/projects/pci/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c#6 integrate .. //depot/projects/pci/sys/dev/ath/if_ath.c#8 integrate .. //depot/projects/pci/sys/dev/ath/if_ath_sysctl.c#6 integrate .. //depot/projects/pci/sys/dev/ath/if_athvar.h#5 integrate .. //depot/projects/pci/sys/dev/hptiop/hptiop.c#2 integrate .. //depot/projects/pci/sys/dev/mpt/mpt.c#4 integrate .. //depot/projects/pci/sys/dev/mpt/mpt.h#4 integrate .. //depot/projects/pci/sys/dev/mpt/mpt_cam.c#4 integrate .. //depot/projects/pci/sys/dev/mpt/mpt_debug.c#3 integrate .. //depot/projects/pci/sys/dev/mpt/mpt_pci.c#4 integrate .. //depot/projects/pci/sys/dev/mpt/mpt_raid.c#2 integrate .. //depot/projects/pci/sys/dev/mpt/mpt_raid.h#2 integrate .. //depot/projects/pci/sys/dev/mpt/mpt_user.c#3 integrate .. //depot/projects/pci/sys/dev/re/if_re.c#3 integrate .. //depot/projects/pci/sys/dev/usb/input/ums.c#5 integrate .. //depot/projects/pci/sys/fs/cd9660/iso.h#2 integrate .. //depot/projects/pci/sys/fs/msdosfs/msdosfsmount.h#2 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfs_clnode.c#4 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfs_clvnops.c#6 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfsnode.h#3 integrate .. //depot/projects/pci/sys/fs/nfsserver/nfs_nfsdserv.c#5 integrate .. //depot/projects/pci/sys/fs/ntfs/ntfs.h#2 integrate .. //depot/projects/pci/sys/fs/smbfs/smbfs.h#2 integrate .. //depot/projects/pci/sys/i386/i386/machdep.c#5 integrate .. //depot/projects/pci/sys/i386/ibcs2/imgact_coff.c#2 integrate .. //depot/projects/pci/sys/kern/kern_conf.c#3 integrate .. //depot/projects/pci/sys/kern/kern_jail.c#5 integrate .. //depot/projects/pci/sys/kern/kern_linker.c#4 integrate .. //depot/projects/pci/sys/kern/kern_lock.c#2 integrate .. //depot/projects/pci/sys/kern/kern_shutdown.c#4 integrate .. //depot/projects/pci/sys/kern/subr_smp.c#6 integrate .. //depot/projects/pci/sys/kern/vfs_mount.c#6 integrate .. //depot/projects/pci/sys/kern/vfs_subr.c#7 integrate .. //depot/projects/pci/sys/mips/mips/exception.S#3 integrate .. //depot/projects/pci/sys/net/if_lagg.c#5 integrate .. //depot/projects/pci/sys/netgraph/ng_ether.c#4 integrate .. //depot/projects/pci/sys/netgraph/ng_mppc.c#3 integrate .. //depot/projects/pci/sys/netgraph/ng_parse.c#2 integrate .. //depot/projects/pci/sys/netinet/ip_divert.c#4 integrate .. //depot/projects/pci/sys/nfsclient/nfs_node.c#2 integrate .. //depot/projects/pci/sys/nfsclient/nfsnode.h#2 integrate .. //depot/projects/pci/sys/pc98/pc98/machdep.c#5 integrate .. //depot/projects/pci/sys/pci/if_rlreg.h#2 integrate .. //depot/projects/pci/sys/powerpc/aim/locore32.S#5 integrate .. //depot/projects/pci/sys/powerpc/booke/locore.S#4 integrate .. //depot/projects/pci/sys/powerpc/booke/platform_bare.c#3 integrate .. //depot/projects/pci/sys/powerpc/booke/pmap.c#4 integrate .. //depot/projects/pci/sys/powerpc/conf/MPC85XX#3 integrate .. //depot/projects/pci/sys/powerpc/mpc85xx/atpic.c#2 integrate .. //depot/projects/pci/sys/powerpc/powermac/fcu.c#4 integrate .. //depot/projects/pci/sys/sys/mount.h#3 integrate .. //depot/projects/pci/sys/sys/systm.h#7 integrate .. //depot/projects/pci/sys/ufs/ffs/ffs_alloc.c#8 integrate .. //depot/projects/pci/sys/ufs/ffs/ffs_softdep.c#7 integrate .. //depot/projects/pci/sys/ufs/ffs/ffs_vfsops.c#5 integrate .. //depot/projects/pci/sys/ufs/ffs/ffs_vnops.c#4 integrate .. //depot/projects/pci/sys/ufs/ufs/inode.h#3 integrate .. //depot/projects/pci/sys/vm/device_pager.c#4 integrate .. //depot/projects/pci/sys/vm/swap_pager.c#4 integrate .. //depot/projects/pci/sys/vm/swap_pager.h#2 integrate Differences ... ==== //depot/projects/pci/sys/amd64/amd64/machdep.c#5 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.751 2011/06/08 08:12:15 avg Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.752 2011/07/30 13:33:05 bz Exp $"); #include "opt_atalk.h" #include "opt_atpic.h" @@ -1309,7 +1309,7 @@ { int i, physmap_idx, pa_indx, da_indx; vm_paddr_t pa, physmap[PHYSMAP_SIZE]; - u_long physmem_tunable; + u_long physmem_tunable, memtest, tmpul; pt_entry_t *pte; struct bios_smap *smapbase, *smap, *smapend; u_int32_t smapsize; @@ -1372,6 +1372,14 @@ Maxmem = atop(physmem_tunable); /* + * By default keep the memtest enabled. Use a general name so that + * one could eventually do more with the code than just disable it. + */ + memtest = 1; + if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul)) + memtest = tmpul; + + /* * Don't allow MAXMEM or hw.physmem to extend the amount of memory * in the system. */ @@ -1433,6 +1441,8 @@ goto do_dump_avail; page_bad = FALSE; + if (memtest == 0) + goto skip_memtest; /* * map page into kernel: valid, read/write,non-cacheable @@ -1470,6 +1480,7 @@ */ *(int *)ptr = tmp; +skip_memtest: /* * Adjust array of valid/good pages. */ ==== //depot/projects/pci/sys/arm/arm/irq_dispatch.S#3 (text+ko) ==== @@ -72,7 +72,7 @@ #include <machine/asm.h> #include <machine/asmacros.h> #include <machine/armreg.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/irq_dispatch.S,v 1.5 2011/07/18 15:19:40 attilio Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/irq_dispatch.S,v 1.6 2011/08/02 17:49:27 attilio Exp $"); /* * irq_entry: @@ -109,9 +109,9 @@ _C_LABEL(intrcnt): .space NIRQ * 4 _C_LABEL(sintrnames): - .word NIRQ * (MAXCOMLEN + 1) + .int NIRQ * (MAXCOMLEN + 1) _C_LABEL(sintrcnt): - .word NIRQ * 4 + .int NIRQ * 4 .global _C_LABEL(current_intr_depth) _C_LABEL(current_intr_depth): ==== //depot/projects/pci/sys/arm/sa11x0/sa11x0_irq.S#3 (text+ko) ==== @@ -36,7 +36,7 @@ #include <machine/armreg.h> #include <machine/asmacros.h> #include <arm/sa11x0/sa11x0_reg.h> -__FBSDID("$FreeBSD: src/sys/arm/sa11x0/sa11x0_irq.S,v 1.5 2011/07/18 15:19:40 attilio Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/sa11x0/sa11x0_irq.S,v 1.6 2011/08/02 17:49:27 attilio Exp $"); Lcurrent_intr_depth: .word _C_LABEL(current_intr_depth) @@ -122,7 +122,7 @@ .global _C_LABEL(intrnames), _C_LABEL(sintrnames) _C_LABEL(intrnames): _C_LABEL(sintrnames): - .word 0 + .int 0 .globl _C_LABEL(intrcnt), _C_LABEL(sintrcnt) ==== //depot/projects/pci/sys/boot/forth/loader.conf#4 (text+ko) ==== @@ -6,7 +6,7 @@ # # All arguments must be in double quotes. # -# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.157 2011/04/13 12:19:03 pluknet Exp $ +# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.158 2011/07/25 21:52:17 rodrigc Exp $ ############################################################## ### Basic configuration options ############################ @@ -55,6 +55,11 @@ #prompt="\\${interpret}" # Set the command prompt #root_disk_unit="0" # Force the root disk unit number #rootdev="disk1s1a" # Set the root filesystem +#tftp.blksize="1428" # Set the RFC 2348 TFTP block size. + # If the TFTP server does not support RFC 2348, + # the block size is set to 512. If the value + # is out of range ( < 8 || > 9008 ) an error is + # returned. ############################################################## ==== //depot/projects/pci/sys/cam/ata/ata_da.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/cam/ata/ata_da.c,v 1.35 2011/06/18 22:26:58 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/ata/ata_da.c,v 1.38 2011/07/30 21:42:53 mav Exp $"); #include "opt_ada.h" #include "opt_ata.h" @@ -69,6 +69,7 @@ #define ATA_MAX_28BIT_LBA 268435455UL typedef enum { + ADA_STATE_RAHEAD, ADA_STATE_WCACHE, ADA_STATE_NORMAL } ada_state; @@ -94,7 +95,8 @@ } ada_quirks; typedef enum { - ADA_CCB_WCACHE = 0x01, + ADA_CCB_RAHEAD = 0x01, + ADA_CCB_WCACHE = 0x02, ADA_CCB_BUFFER_IO = 0x03, ADA_CCB_WAITING = 0x04, ADA_CCB_DUMP = 0x05, @@ -132,6 +134,7 @@ int outstanding_cmds; int trim_max_ranges; int trim_running; + int read_ahead; int write_cache; #ifdef ADA_TEST_FAILURE int force_read_error; @@ -294,10 +297,19 @@ #define ADA_DEFAULT_SPINDOWN_SUSPEND 1 #endif +#ifndef ADA_DEFAULT_READ_AHEAD +#define ADA_DEFAULT_READ_AHEAD 1 +#endif + #ifndef ADA_DEFAULT_WRITE_CACHE #define ADA_DEFAULT_WRITE_CACHE 1 #endif +#define ADA_RA (softc->read_ahead >= 0 ? \ + softc->read_ahead : ada_read_ahead) +#define ADA_WC (softc->write_cache >= 0 ? \ + softc->write_cache : ada_write_cache) + /* * Most platforms map firmware geometry to actual, but some don't. If * not overridden, default to nothing. @@ -312,6 +324,7 @@ static int ada_send_ordered = ADA_DEFAULT_SEND_ORDERED; static int ada_spindown_shutdown = ADA_DEFAULT_SPINDOWN_SHUTDOWN; static int ada_spindown_suspend = ADA_DEFAULT_SPINDOWN_SUSPEND; +static int ada_read_ahead = ADA_DEFAULT_READ_AHEAD; static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE; SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, @@ -334,6 +347,9 @@ SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_suspend, CTLFLAG_RW, &ada_spindown_suspend, 0, "Spin down upon suspend"); TUNABLE_INT("kern.cam.ada.spindown_suspend", &ada_spindown_suspend); +SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLAG_RW, + &ada_read_ahead, 0, "Enable disk read-ahead"); +TUNABLE_INT("kern.cam.ada.read_ahead", &ada_read_ahead); SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RW, &ada_write_cache, 0, "Enable disk write cache"); TUNABLE_INT("kern.cam.ada.write_cache", &ada_write_cache); @@ -425,7 +441,8 @@ softc = (struct ada_softc *)periph->softc; /* We only sync the cache if the drive is capable of it. */ - if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) { + if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && + (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); cam_fill_ataio(&ccb->ataio, @@ -467,12 +484,20 @@ adaschedule(struct cam_periph *periph) { struct ada_softc *softc = (struct ada_softc *)periph->softc; + uint32_t prio; + /* Check if cam_periph_getccb() was called. */ + prio = periph->immediate_priority; + + /* Check if we have more work to do. */ if (bioq_first(&softc->bio_queue) || (!softc->trim_running && bioq_first(&softc->trim_queue))) { - /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + prio = CAM_PRIORITY_NORMAL; } + + /* Schedule CCB if any of above is true. */ + if (prio != CAM_PRIORITY_NONE) + xpt_schedule(periph, prio); } /* @@ -736,16 +761,19 @@ softc = (struct ada_softc *)periph->softc; cam_periph_async(periph, code, path, arg); - if (ada_write_cache < 0 && softc->write_cache < 0) - break; if (softc->state != ADA_STATE_NORMAL) break; xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); - if ((cgd.ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) == 0) - break; - softc->state = ADA_STATE_WCACHE; + if (ADA_RA >= 0 && + cgd.ident_data.support.command1 & ATA_SUPPORT_LOOKAHEAD) + softc->state = ADA_STATE_RAHEAD; + else if (ADA_WC >= 0 && + cgd.ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) + softc->state = ADA_STATE_WCACHE; + else + break; cam_periph_acquire(periph); cam_freeze_devq_arg(periph->path, RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); @@ -788,6 +816,9 @@ } SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "read_ahead", CTLFLAG_RW | CTLFLAG_MPSAFE, + &softc->read_ahead, 0, "Enable disk read ahead."); + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "write_cache", CTLFLAG_RW | CTLFLAG_MPSAFE, &softc->write_cache, 0, "Enable disk write cache."); #ifdef ADA_TEST_FAILURE @@ -921,6 +952,10 @@ quirks = softc->quirks; TUNABLE_INT_FETCH(announce_buf, &quirks); softc->quirks = quirks; + softc->read_ahead = -1; + snprintf(announce_buf, sizeof(announce_buf), + "kern.cam.ada.%d.read_ahead", periph->unit_number); + TUNABLE_INT_FETCH(announce_buf, &softc->read_ahead); softc->write_cache = -1; snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.write_cache", periph->unit_number); @@ -1043,7 +1078,14 @@ (ADA_DEFAULT_TIMEOUT * hz) / ADA_ORDEREDTAG_INTERVAL, adasendorderedtag, softc); - if ((ada_write_cache >= 0 || softc->write_cache >= 0) && + if (ADA_RA >= 0 && + cgd->ident_data.support.command1 & ATA_SUPPORT_LOOKAHEAD) { + softc->state = ADA_STATE_RAHEAD; + cam_periph_acquire(periph); + cam_freeze_devq_arg(periph->path, + RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); + xpt_schedule(periph, CAM_PRIORITY_DEV); + } else if (ADA_WC >= 0 && cgd->ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) { softc->state = ADA_STATE_WCACHE; cam_periph_acquire(periph); @@ -1316,8 +1358,19 @@ adaschedule(periph); break; } + case ADA_STATE_RAHEAD: case ADA_STATE_WCACHE: { + if (softc->flags & ADA_FLAG_PACK_INVALID) { + softc->state = ADA_STATE_NORMAL; + xpt_release_ccb(start_ccb); + cam_release_devq(periph->path, + RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); + adaschedule(periph); + cam_periph_release_locked(periph); + return; + } + cam_fill_ataio(ataio, 1, adadone, @@ -1327,10 +1380,15 @@ 0, ada_default_timeout*1000); - ata_28bit_cmd(ataio, ATA_SETFEATURES, (softc->write_cache > 0 || - (softc->write_cache < 0 && ada_write_cache)) ? - ATA_SF_ENAB_WCACHE : ATA_SF_DIS_WCACHE, 0, 0); - start_ccb->ccb_h.ccb_state = ADA_CCB_WCACHE; + if (softc->state == ADA_STATE_RAHEAD) { + ata_28bit_cmd(ataio, ATA_SETFEATURES, ADA_RA ? + ATA_SF_ENAB_RCACHE : ATA_SF_DIS_RCACHE, 0, 0); + start_ccb->ccb_h.ccb_state = ADA_CCB_RAHEAD; + } else { + ata_28bit_cmd(ataio, ATA_SETFEATURES, ADA_WC ? + ATA_SF_ENAB_WCACHE : ATA_SF_DIS_WCACHE, 0, 0); + start_ccb->ccb_h.ccb_state = ADA_CCB_WCACHE; + } xpt_action(start_ccb); break; } @@ -1342,6 +1400,7 @@ { struct ada_softc *softc; struct ccb_ataio *ataio; + struct ccb_getdev *cgd; softc = (struct ada_softc *)periph->softc; ataio = &done_ccb->ataio; @@ -1361,7 +1420,8 @@ return; } if (error != 0) { - if (error == ENXIO) { + if (error == ENXIO && + (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { /* * Catastrophic error. Mark our pack as * invalid. @@ -1421,6 +1481,47 @@ biodone(bp); break; } + case ADA_CCB_RAHEAD: + { + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if (adaerror(done_ccb, 0, 0) == ERESTART) { + return; + } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + } + + /* + * Since our peripheral may be invalidated by an error + * above or an external event, we must release our CCB + * before releasing the reference on the peripheral. + * The peripheral will only go away once the last reference + * is removed, and we need it around for the CCB release + * operation. + */ + cgd = (struct ccb_getdev *)done_ccb; + xpt_setup_ccb(&cgd->ccb_h, periph->path, CAM_PRIORITY_NORMAL); + cgd->ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action((union ccb *)cgd); + if (ADA_WC >= 0 && + cgd->ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) { + softc->state = ADA_STATE_WCACHE; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, CAM_PRIORITY_DEV); + return; + } + softc->state = ADA_STATE_NORMAL; + xpt_release_ccb(done_ccb); + cam_release_devq(periph->path, + RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); + adaschedule(periph); + cam_periph_release_locked(periph); + return; + } case ADA_CCB_WCACHE: { if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { ==== //depot/projects/pci/sys/cam/cam_periph.c#4 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.96 2011/06/14 14:53:17 gibbs Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.97 2011/07/29 20:30:28 mav Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1550,7 +1550,8 @@ * make sure we actually have retries available. */ if ((err_action & SSQ_DECREMENT_COUNT) != 0) { - if (ccb->ccb_h.retry_count > 0) + if (ccb->ccb_h.retry_count > 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) ccb->ccb_h.retry_count--; else { *action_string = "Retries exhausted"; @@ -1718,6 +1719,7 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags, union ccb *save_ccb) { + struct cam_periph *periph; const char *action_string; cam_status status; int frozen; @@ -1725,7 +1727,8 @@ int openings; u_int32_t relsim_flags; u_int32_t timeout = 0; - + + periph = xpt_path_periph(ccb->ccb_h.path); action_string = NULL; status = ccb->ccb_h.status; frozen = (status & CAM_DEV_QFRZN) != 0; @@ -1787,9 +1790,9 @@ xpt_print(ccb->ccb_h.path, "Data overrun\n"); printed++; } - error = EIO; /* we have to kill the command */ /* decrement the number of retries */ - if (ccb->ccb_h.retry_count > 0) { + if (ccb->ccb_h.retry_count > 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb->ccb_h.retry_count--; error = ERESTART; } else { @@ -1808,7 +1811,8 @@ struct cam_path *newpath; if ((camflags & CAM_RETRY_SELTO) != 0) { - if (ccb->ccb_h.retry_count > 0) { + if (ccb->ccb_h.retry_count > 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb->ccb_h.retry_count--; error = ERESTART; @@ -1826,10 +1830,11 @@ timeout = periph_selto_delay; break; } + action_string = "Retries exhausted"; } error = ENXIO; /* Should we do more if we can't create the path?? */ - if (xpt_create_path(&newpath, xpt_path_periph(ccb->ccb_h.path), + if (xpt_create_path(&newpath, periph, xpt_path_path_id(ccb->ccb_h.path), xpt_path_target_id(ccb->ccb_h.path), CAM_LUN_WILDCARD) != CAM_REQ_CMP) @@ -1874,11 +1879,16 @@ /* FALLTHROUGH */ case CAM_REQUEUE_REQ: /* Unconditional requeue */ - error = ERESTART; if (bootverbose && printed == 0) { xpt_print(ccb->ccb_h.path, "Request requeued\n"); printed++; } + if ((periph->flags & CAM_PERIPH_INVALID) == 0) + error = ERESTART; + else { + action_string = "Retries exhausted"; + error = EIO; + } break; case CAM_RESRC_UNAVAIL: /* Wait a bit for the resource shortage to abate. */ @@ -1893,7 +1903,8 @@ /* FALLTHROUGH */ default: /* decrement the number of retries */ - if (ccb->ccb_h.retry_count > 0) { + if (ccb->ccb_h.retry_count > 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb->ccb_h.retry_count--; error = ERESTART; if (bootverbose && printed == 0) { ==== //depot/projects/pci/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c#2 (text+ko) ==== @@ -488,7 +488,7 @@ txg_delay(dsl_pool_t *dp, uint64_t txg, int ticks) { tx_state_t *tx = &dp->dp_tx; - int timeout = ddi_get_lbolt() + ticks; + clock_t timeout = ddi_get_lbolt() + ticks; /* don't delay if this txg could transition to quiesing immediately */ if (tx->tx_open_txg > txg || ==== //depot/projects/pci/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#4 (text+ko) ==== @@ -612,7 +612,8 @@ /* * If we're in FRSYNC mode, sync out this znode before reading it. */ - if (ioflag & FRSYNC || zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) + if (zfsvfs->z_log && + (ioflag & FRSYNC || zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)) zil_commit(zfsvfs->z_log, zp->z_id); /* @@ -6340,7 +6341,7 @@ if (error == 0) *ap->a_size = (size_t)va.va_size; } else if (ap->a_uio != NULL) - error = VOP_READ(vp, ap->a_uio, IO_UNIT | IO_SYNC, ap->a_cred); + error = VOP_READ(vp, ap->a_uio, IO_UNIT, ap->a_cred); VOP_UNLOCK(vp, 0); vn_close(vp, flags, ap->a_cred, td); ==== //depot/projects/pci/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c#2 (text+ko) ==== @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -567,7 +568,7 @@ if (!list_is_empty(&zilog->zl_lwb_list)) { ASSERT(zh->zh_claim_txg == 0); - ASSERT(!keep_first); + VERIFY(!keep_first); while ((lwb = list_head(&zilog->zl_lwb_list)) != NULL) { list_remove(&zilog->zl_lwb_list, lwb); if (lwb->lwb_buf != NULL) @@ -1668,20 +1669,9 @@ void zil_free(zilog_t *zilog) { - lwb_t *head_lwb; - zilog->zl_stop_sync = 1; - /* - * After zil_close() there should only be one lwb with a buffer. - */ - head_lwb = list_head(&zilog->zl_lwb_list); - if (head_lwb) { - ASSERT(head_lwb == list_tail(&zilog->zl_lwb_list)); - list_remove(&zilog->zl_lwb_list, head_lwb); - zio_buf_free(head_lwb->lwb_buf, head_lwb->lwb_sz); - kmem_cache_free(zil_lwb_cache, head_lwb); - } + ASSERT(list_is_empty(&zilog->zl_lwb_list)); list_destroy(&zilog->zl_lwb_list); avl_destroy(&zilog->zl_vdev_tree); @@ -1721,6 +1711,10 @@ { zilog_t *zilog = dmu_objset_zil(os); + ASSERT(zilog->zl_clean_taskq == NULL); + ASSERT(zilog->zl_get_data == NULL); + ASSERT(list_is_empty(&zilog->zl_lwb_list)); + zilog->zl_get_data = get_data; zilog->zl_clean_taskq = taskq_create("zil_clean", 1, minclsyspri, 2, 2, TASKQ_PREPOPULATE); @@ -1734,7 +1728,7 @@ void zil_close(zilog_t *zilog) { - lwb_t *tail_lwb; + lwb_t *lwb; uint64_t txg = 0; zil_commit(zilog, 0); /* commit all itx */ @@ -1746,9 +1740,9 @@ * destroy the zl_clean_taskq. */ mutex_enter(&zilog->zl_lock); - tail_lwb = list_tail(&zilog->zl_lwb_list); - if (tail_lwb != NULL) - txg = tail_lwb->lwb_max_txg; + lwb = list_tail(&zilog->zl_lwb_list); + if (lwb != NULL) + txg = lwb->lwb_max_txg; mutex_exit(&zilog->zl_lock); if (txg) txg_wait_synced(zilog->zl_dmu_pool, txg); @@ -1756,6 +1750,19 @@ taskq_destroy(zilog->zl_clean_taskq); zilog->zl_clean_taskq = NULL; zilog->zl_get_data = NULL; + + /* + * We should have only one LWB left on the list; remove it now. + */ + mutex_enter(&zilog->zl_lock); + lwb = list_head(&zilog->zl_lwb_list); + if (lwb != NULL) { + ASSERT(lwb == list_tail(&zilog->zl_lwb_list)); + list_remove(&zilog->zl_lwb_list, lwb); + zio_buf_free(lwb->lwb_buf, lwb->lwb_sz); + kmem_cache_free(zil_lwb_cache, lwb); + } + mutex_exit(&zilog->zl_lock); } /* ==== //depot/projects/pci/sys/compat/linprocfs/linprocfs.c#5 (text+ko) ==== @@ -42,7 +42,7 @@ #include "opt_compat.h" #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.160 2011/06/17 07:30:56 pluknet Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.161 2011/08/01 19:12:15 kib Exp $"); #include <sys/param.h> #include <sys/queue.h> @@ -502,6 +502,33 @@ return (0); } +static int +linprocfs_doswaps(PFS_FILL_ARGS) +{ + struct xswdev xsw; + uintmax_t total, used; + int n; + char devname[SPECNAMELEN + 1]; + + sbuf_printf(sb, "Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n"); + mtx_lock(&Giant); + for (n = 0; ; n++) { + if (swap_dev_info(n, &xsw, devname, sizeof(devname)) != 0) + break; + total = (uintmax_t)xsw.xsw_nblks * PAGE_SIZE / 1024; + used = (uintmax_t)xsw.xsw_used * PAGE_SIZE / 1024; + + /* + * The space and not tab after the device name is on + * purpose. Linux does so. + */ + sbuf_printf(sb, "/dev/%-34s unknown\t\t%jd\t%jd\t-1\n", + devname, total, used); + } + mtx_unlock(&Giant); + return (0); +} + /* * Filler function for proc/uptime */ @@ -1490,6 +1517,8 @@ NULL, NULL, NULL, 0); pfs_create_file(root, "stat", &linprocfs_dostat, NULL, NULL, NULL, PFS_RD); + pfs_create_file(root, "swaps", &linprocfs_doswaps, + NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "uptime", &linprocfs_douptime, NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "version", &linprocfs_doversion, ==== //depot/projects/pci/sys/conf/NOTES#7 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1617 2011/07/19 00:37:24 attilio Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1618 2011/07/25 09:12:48 avg Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -499,16 +499,6 @@ options REGRESSION # -# RESTARTABLE_PANICS allows one to continue from a panic as if it were -# a call to the debugger to continue from a panic as instead. It is only -# useful if a kernel debugger is present. To restart from a panic, reset -# the panicstr variable to NULL and continue execution. This option is -# for development use only and should NOT be used in production systems -# to "workaround" a panic. -# -#options RESTARTABLE_PANICS - -# # This option lets some drivers co-exist that can't co-exist in a running # system. This is used to be able to compile all kernel code in one go for # quality assurance purposes (like this file, which the option takes it name ==== //depot/projects/pci/sys/conf/newvers.sh#3 (text+ko) ==== @@ -28,11 +28,11 @@ # SUCH DAMAGE. # # @(#)newvers.sh 8.1 (Berkeley) 4/20/94 -# $FreeBSD: src/sys/conf/newvers.sh,v 1.93 2011/05/23 19:57:12 ru Exp $ +# $FreeBSD: src/sys/conf/newvers.sh,v 1.94 2011/07/26 04:00:00 kensmith Exp $ TYPE="FreeBSD" REVISION="9.0" -BRANCH="CURRENT" +BRANCH="BETA1" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi ==== //depot/projects/pci/sys/conf/options#9 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.737 2011/07/19 00:37:24 attilio Exp $ +# $FreeBSD: src/sys/conf/options,v 1.738 2011/07/25 09:12:48 avg Exp $ # # On the handling of kernel options # @@ -579,7 +579,6 @@ LOCK_PROFILING_FAST opt_global.h MSIZE opt_global.h REGRESSION opt_global.h -RESTARTABLE_PANICS opt_global.h RWLOCK_NOINLINE opt_global.h SX_NOINLINE opt_global.h VFS_BIO_DEBUG opt_global.h ==== //depot/projects/pci/sys/dev/ahci/ahci.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ahci/ahci.c,v 1.71 2011/06/30 19:23:17 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ahci/ahci.c,v 1.73 2011/08/02 11:07:47 mav Exp $"); #include <sys/param.h> #include <sys/module.h> @@ -264,7 +264,7 @@ {0x0abe10de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, {0x0abf10de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, {0x0d8410de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8510de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, + {0x0d8510de, 0x00, "NVIDIA MCP89", AHCI_Q_NOFORCE|AHCI_Q_NOAA}, {0x0d8610de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8710de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8810de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, @@ -1879,12 +1879,13 @@ device_printf(dev, "Poll timeout on slot %d port %d\n", slot->slot, port); device_printf(dev, "is %08x cs %08x ss %08x " - "rs %08x tfd %02x serr %08x\n", + "rs %08x tfd %02x serr %08x cmd %08x\n", ATA_INL(ch->r_mem, AHCI_P_IS), ATA_INL(ch->r_mem, AHCI_P_CI), ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots, ATA_INL(ch->r_mem, AHCI_P_TFD), - ATA_INL(ch->r_mem, AHCI_P_SERR)); + ATA_INL(ch->r_mem, AHCI_P_SERR), + ATA_INL(ch->r_mem, AHCI_P_CMD)); et = AHCI_ERR_TIMEOUT; } @@ -1960,8 +1961,12 @@ ccs = (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_CCS_MASK) >> AHCI_P_CMD_CCS_SHIFT; if ((sstatus & (1 << slot->slot)) != 0 || ccs == slot->slot || - ch->fbs_enabled) + ch->fbs_enabled || ch->wrongccs) + slot->state = AHCI_SLOT_EXECUTING; + else if ((ch->rslots & (1 << ccs)) == 0) { + ch->wrongccs = 1; slot->state = AHCI_SLOT_EXECUTING; + } callout_reset(&slot->timeout, (int)slot->ccb->ccb_h.timeout * hz / 2000, @@ -1971,10 +1976,12 @@ device_printf(dev, "Timeout on slot %d port %d\n", slot->slot, slot->ccb->ccb_h.target_id & 0x0f); - device_printf(dev, "is %08x cs %08x ss %08x rs %08x tfd %02x serr %08x\n", + device_printf(dev, "is %08x cs %08x ss %08x rs %08x tfd %02x " + "serr %08x cmd %08x\n", ATA_INL(ch->r_mem, AHCI_P_IS), ATA_INL(ch->r_mem, AHCI_P_CI), ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots, - ATA_INL(ch->r_mem, AHCI_P_TFD), ATA_INL(ch->r_mem, AHCI_P_SERR)); + ATA_INL(ch->r_mem, AHCI_P_TFD), ATA_INL(ch->r_mem, AHCI_P_SERR), + ATA_INL(ch->r_mem, AHCI_P_CMD)); /* Handle frozen command. */ if (ch->frozen) { @@ -1987,7 +1994,7 @@ } xpt_done(fccb); } - if (!ch->fbs_enabled) { + if (!ch->fbs_enabled && !ch->wrongccs) { /* Without FBS we know real timeout source. */ ch->fatalerr = 1; /* Handle command with timeout. */ @@ -2585,6 +2592,7 @@ xpt_release_simq(ch->sim, TRUE); ch->eslots = 0; ch->toslots = 0; + ch->wrongccs = 0; ch->fatalerr = 0; /* Tell the XPT about the event */ xpt_async(AC_BUS_RESET, ch->path, NULL); ==== //depot/projects/pci/sys/dev/ahci/ahci.h#4 (text+ko) ==== @@ -24,7 +24,7 @@ * (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: src/sys/dev/ahci/ahci.h,v 1.18 2011/05/17 22:07:45 mav Exp $ + * $FreeBSD: src/sys/dev/ahci/ahci.h,v 1.19 2011/07/29 20:35:23 mav Exp $ */ /* ATA register defines */ @@ -426,6 +426,7 @@ int resetting; /* Hard-reset in progress. */ int resetpolldiv; /* Hard-reset poll divider. */ int listening; /* SUD bit is cleared. */ + int wrongccs; /* CCS field in CMD was wrong */ union ccb *frozen; /* Frozen command */ struct callout pm_timer; /* Power management events */ struct callout reset_timer; /* Hard-reset timeout */ ==== //depot/projects/pci/sys/dev/ata/chipsets/ata-nvidia.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/chipsets/ata-nvidia.c,v 1.14 2010/10/18 11:30:13 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/chipsets/ata-nvidia.c,v 1.15 2011/08/02 11:07:47 mav Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -54,6 +54,7 @@ /* local prototypes */ static int ata_nvidia_chipinit(device_t dev); static int ata_nvidia_ch_attach(device_t dev); +static int ata_nvidia_ch_attach_dumb(device_t dev); static int ata_nvidia_status(device_t dev); static void ata_nvidia_reset(device_t dev); static int ata_nvidia_setmode(device_t dev, int target, int mode); @@ -62,6 +63,7 @@ #define NV4 0x01 #define NVQ 0x02 #define NVAHCI 0x04 +#define NVNOFORCE 0x08 /* @@ -158,7 +160,7 @@ { ATA_NFORCE_MCP79_AA, 0, NVAHCI, 0, ATA_SA300, "nForce MCP79" }, { ATA_NFORCE_MCP79_AB, 0, NVAHCI, 0, ATA_SA300, "nForce MCP79" }, { ATA_NFORCE_MCP89_A0, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, - { ATA_NFORCE_MCP89_A1, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, + { ATA_NFORCE_MCP89_A1, 0, NVAHCI|NVNOFORCE, 0, ATA_SA300, "nForce MCP89" }, { ATA_NFORCE_MCP89_A2, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, { ATA_NFORCE_MCP89_A3, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, { ATA_NFORCE_MCP89_A4, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, @@ -178,7 +180,9 @@ return ENXIO; ata_set_desc(dev); - if (ctlr->chip->cfg1 & NVAHCI) + if ((ctlr->chip->cfg1 & NVAHCI) && + ((ctlr->chip->cfg1 & NVNOFORCE) == 0 || + pci_get_subclass(dev) != PCIS_STORAGE_IDE)) ctlr->chipinit = ata_ahci_chipinit; else ctlr->chipinit = ata_nvidia_chipinit; @@ -193,7 +197,10 @@ if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108021834.p72IYuSn027514>