From owner-svn-src-stable-8@FreeBSD.ORG Sun Jun 17 09:43:05 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5167010657A1; Sun, 17 Jun 2012 09:43:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2C98FC0A; Sun, 17 Jun 2012 09:43:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5H9h5Yu097616; Sun, 17 Jun 2012 09:43:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5H9h4cZ097613; Sun, 17 Jun 2012 09:43:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206170943.q5H9h4cZ097613@svn.freebsd.org> From: Marius Strobl Date: Sun, 17 Jun 2012 09:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237187 - stable/8/sys/dev/sym X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 09:43:05 -0000 Author: marius Date: Sun Jun 17 09:43:04 2012 New Revision: 237187 URL: http://svn.freebsd.org/changeset/base/237187 Log: MFC: r237101 Fix a braino in r236469 (MFC'ed to stable/8 in r236469); the number of DMA tags required for handling MAXPHYS should be based on PAGE_SIZE rather than SYM_CONF_DMA_BOUNDARY. While at it, reuse the SYM_CONF_MAX_SG macro for specifying the maximum number of DMA tags so sym(4) itself doesn't size memory beyond what's required for handling MAXPHYS. PR: 168928 Modified: stable/8/sys/dev/sym/sym_conf.h stable/8/sys/dev/sym/sym_hipd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (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/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/sym/sym_conf.h ============================================================================== --- stable/8/sys/dev/sym/sym_conf.h Sun Jun 17 09:42:56 2012 (r237186) +++ stable/8/sys/dev/sym/sym_conf.h Sun Jun 17 09:43:04 2012 (r237187) @@ -90,11 +90,12 @@ #define SYM_CONF_DMA_BOUNDARY (1UL << 24) /* - * Max number of scatter/gather entries for en IO. + * Max number of scatter/gather entries for an I/O. * Each entry costs 8 bytes in the internal CCB data structure. - * For now 65 should suffice given the BSD O/Ses capabilities. + * We use at most 33 segments but also no more than required for handling + * MAXPHYS. */ -#define SYM_CONF_MAX_SG (33) +#define SYM_CONF_MAX_SG (MIN(33, (MAXPHYS / PAGE_SIZE) + 1)) /* * Max number of targets. Modified: stable/8/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/8/sys/dev/sym/sym_hipd.c Sun Jun 17 09:42:56 2012 (r237186) +++ stable/8/sys/dev/sym/sym_hipd.c Sun Jun 17 09:43:04 2012 (r237187) @@ -1609,7 +1609,6 @@ struct sym_hcb { u_int features; /* Chip features map */ u_char myaddr; /* SCSI id of the adapter */ u_char maxburst; /* log base 2 of dwords burst */ - u_char maxsegcnt; /* Max DMA S/G segments */ u_char maxwide; /* Maximum transfer width */ u_char minsync; /* Min sync period factor (ST) */ u_char maxsync; /* Max sync period factor (ST) */ @@ -8135,7 +8134,7 @@ static void sym_action2(struct cam_sim * cpi->xport_specific.spi.ppr_options = SID_SPI_CLOCK_DT_ST; } - cpi->maxio = np->maxsegcnt * SYM_CONF_DMA_BOUNDARY; + cpi->maxio = SYM_CONF_MAX_SG * PAGE_SIZE; sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; case XPT_ABORT: @@ -8536,11 +8535,9 @@ sym_pci_attach(device_t dev) /* * Allocate a tag for the DMA of user data. */ - np->maxsegcnt = MIN(SYM_CONF_MAX_SG, - (MAXPHYS / SYM_CONF_DMA_BOUNDARY) + 1); if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - BUS_SPACE_MAXSIZE, np->maxsegcnt, SYM_CONF_DMA_BOUNDARY, + BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY, BUS_DMA_ALLOCNOW, busdma_lock_mutex, &np->mtx, &np->data_dmat)) { device_printf(dev, "failed to create DMA tag.\n"); goto attach_failed; From owner-svn-src-stable-8@FreeBSD.ORG Sun Jun 17 09:51:00 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63997106564A; Sun, 17 Jun 2012 09:51:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 341DA8FC0A; Sun, 17 Jun 2012 09:51:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5H9p0IY098075; Sun, 17 Jun 2012 09:51:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5H9oxZH098072; Sun, 17 Jun 2012 09:51:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206170951.q5H9oxZH098072@svn.freebsd.org> From: Marius Strobl Date: Sun, 17 Jun 2012 09:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237189 - in stable/8/sys/dev/usb: . serial X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 09:51:00 -0000 Author: marius Date: Sun Jun 17 09:50:59 2012 New Revision: 237189 URL: http://svn.freebsd.org/changeset/base/237189 Log: MFC: r230179 BeagleBone uses an FTDI chip with an altered Product ID. Modified: stable/8/sys/dev/usb/serial/uftdi.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (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/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/8/sys/dev/usb/serial/uftdi.c Sun Jun 17 09:50:56 2012 (r237188) +++ stable/8/sys/dev/usb/serial/uftdi.c Sun Jun 17 09:50:59 2012 (r237189) @@ -217,6 +217,7 @@ static STRUCT_USB_HOST_ID uftdi_devs[] = UFTDI_DEV(FTDI, SERIAL_8U100AX, SIO), UFTDI_DEV(FTDI, SERIAL_2232C, 8U232AM), UFTDI_DEV(FTDI, SERIAL_2232D, 8U232AM), + UFTDI_DEV(FTDI, BEAGLEBONE, 8U232AM), UFTDI_DEV(FTDI, SERIAL_4232H, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM4, 8U232AM), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Sun Jun 17 09:50:56 2012 (r237188) +++ stable/8/sys/dev/usb/usbdevs Sun Jun 17 09:50:59 2012 (r237189) @@ -1600,6 +1600,7 @@ product FTDI SERIAL_8U232AM 0x6001 8U232 product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial product FTDI SERIAL_2232C 0x6010 FT2232C Dual port Serial product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial +product FTDI BEAGLEBONE 0xA6D0 BeagleBone product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi From owner-svn-src-stable-8@FreeBSD.ORG Sun Jun 17 11:16:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0361D106566C; Sun, 17 Jun 2012 11:16:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E26228FC14; Sun, 17 Jun 2012 11:16:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5HBGHAA004751; Sun, 17 Jun 2012 11:16:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5HBGHTH004749; Sun, 17 Jun 2012 11:16:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206171116.q5HBGHTH004749@svn.freebsd.org> From: Marius Strobl Date: Sun, 17 Jun 2012 11:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237192 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 11:16:18 -0000 Author: marius Date: Sun Jun 17 11:16:17 2012 New Revision: 237192 URL: http://svn.freebsd.org/changeset/base/237192 Log: MFC: r237107 - As a baind-aid, disable ATAPI DMA when using ATA_CAM for these controllers as well as it causes the kernel to hang during boot. Reported and tested by: Kevin Oberman - Use NULL instead of 0 for a pointer. Modified: stable/8/sys/dev/ata/chipsets/ata-ite.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (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/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ite.c Sun Jun 17 11:16:14 2012 (r237191) +++ stable/8/sys/dev/ata/chipsets/ata-ite.c Sun Jun 17 11:16:17 2012 (r237192) @@ -105,10 +105,10 @@ ata_ite_chipinit(device_t dev) ctlr->setmode = ata_ite_821x_setmode; /* No timing restrictions initally. */ - ctlr->chipset_data = (void *)0; + ctlr->chipset_data = NULL; } ctlr->ch_attach = ata_ite_ch_attach; - return 0; + return (0); } static int @@ -119,6 +119,9 @@ ata_ite_ch_attach(device_t dev) error = ata_pci_ch_attach(dev); ch->flags |= ATA_CHECKS_CABLE; +#ifdef ATA_CAM + ch->flags |= ATA_NO_ATAPI_DMA; +#endif return (error); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Jun 17 21:07:01 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 510981065687; Sun, 17 Jun 2012 21:07:01 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2288A8FC0A; Sun, 17 Jun 2012 21:07:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5HL70ZH032695; Sun, 17 Jun 2012 21:07:00 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5HL70wQ032692; Sun, 17 Jun 2012 21:07:00 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201206172107.q5HL70wQ032692@svn.freebsd.org> From: Doug Barton Date: Sun, 17 Jun 2012 21:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237206 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2012 21:07:01 -0000 Author: dougb Date: Sun Jun 17 21:07:00 2012 New Revision: 237206 URL: http://svn.freebsd.org/changeset/base/237206 Log: Improve the functionality of the PORTS_MODULES knob by adding LOCALBASE/bin and sbin to PATH, which allows dependencies to be found; adding SRC_BASE and OSVERSION to match the new kernel, and putting the related builds under MAKEOBJDIRPREFIX so that they only need to be built once per kernel. In addition to the PR this includes ideas/contributions from crees and matthew. PR: ports/161452 Submitted by: Garrett Cooper Modified: stable/8/sys/conf/kern.post.mk Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/conf/kern.post.mk ============================================================================== --- stable/8/sys/conf/kern.post.mk Sun Jun 17 21:06:36 2012 (r237205) +++ stable/8/sys/conf/kern.post.mk Sun Jun 17 21:07:00 2012 (r237206) @@ -28,9 +28,30 @@ modules-${target}: .endif .endfor -# Handle out of tree ports +# Handle ports (as defined by the user) that build kernel modules .if !defined(NO_MODULES) && defined(PORTS_MODULES) -PORTSMODULESENV=SYSDIR=${SYSDIR} +# +# The ports tree needs some environment variables defined to match the new kernel +# +# Ports search for some dependencies in PATH, so add the location of the installed files +LOCALBASE?= /usr/local +# SRC_BASE is how the ports tree refers to the location of the base source files +.if !defined(SRC_BASE) +SRC_BASE!= realpath "${SYSDIR:H}/" +.endif +# OSVERSION is used by some ports to determine build options +.if !defined(OSRELDATE) +# Definition copied from src/Makefile.inc1 +OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ + ${MAKEOBJDIRPREFIX}${SRC_BASE}/include/osreldate.h +.endif +# Keep the related ports builds in the obj directory so that they are only rebuilt once per kernel build +WRKDIRPREFIX?= ${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF} +PORTSMODULESENV=\ + PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \ + SRC_BASE=${SRC_BASE} \ + OSVERSION=${OSRELDATE} \ + WRKDIRPREFIX=${WRKDIRPREFIX} .for __target in all install reinstall clean ${__target}: ports-${__target} ports-${__target}: From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 18 05:02:22 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EFC2010657BC; Mon, 18 Jun 2012 05:02:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F33E8FC12; Mon, 18 Jun 2012 05:02:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5I52LdO056035; Mon, 18 Jun 2012 05:02:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5I52Ll6056033; Mon, 18 Jun 2012 05:02:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206180502.q5I52Ll6056033@svn.freebsd.org> From: Eitan Adler Date: Mon, 18 Jun 2012 05:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237218 - stable/8/share/man/man5 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 05:02:22 -0000 Author: eadler Date: Mon Jun 18 05:02:21 2012 New Revision: 237218 URL: http://svn.freebsd.org/changeset/base/237218 Log: MFC 236352: Bump date for content missed in r236290 Approved by: cperciva (implicit) Modified: stable/8/share/man/man5/periodic.conf.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/periodic.conf.5 ============================================================================== --- stable/8/share/man/man5/periodic.conf.5 Mon Jun 18 05:01:57 2012 (r237217) +++ stable/8/share/man/man5/periodic.conf.5 Mon Jun 18 05:02:21 2012 (r237218) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2012 +.Dd May 30, 2012 .Dt PERIODIC.CONF 5 .Os .Sh NAME From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 18 17:21:03 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CC841065673; Mon, 18 Jun 2012 17:21:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1745E8FC14; Mon, 18 Jun 2012 17:21:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5IHL2LN091145; Mon, 18 Jun 2012 17:21:02 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5IHL2VU091143; Mon, 18 Jun 2012 17:21:02 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201206181721.q5IHL2VU091143@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 18 Jun 2012 17:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237231 - stable/8/usr.sbin/acpi/acpidump X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 17:21:03 -0000 Author: jkim Date: Mon Jun 18 17:21:02 2012 New Revision: 237231 URL: http://svn.freebsd.org/changeset/base/237231 Log: MFC: r235948 Catch up with realpath(3) changes (r236400) and unbreak acpidump(8). Modified: stable/8/usr.sbin/acpi/acpidump/acpi.c Directory Properties: stable/8/usr.sbin/acpi/acpidump/ (props changed) Modified: stable/8/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- stable/8/usr.sbin/acpi/acpidump/acpi.c Mon Jun 18 17:11:24 2012 (r237230) +++ stable/8/usr.sbin/acpi/acpidump/acpi.c Mon Jun 18 17:21:02 2012 (r237231) @@ -994,13 +994,13 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt, if (tmpdir == NULL) tmpdir = _PATH_TMP; strncpy(tmpstr, tmpdir, sizeof(tmpstr)); - strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(tmpdir)); if (realpath(tmpstr, buf) == NULL) { - perror("realpath tmp file"); + perror("realpath tmp dir"); return; } strncpy(tmpstr, buf, sizeof(tmpstr)); - len = strlen(buf); + strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(buf)); + len = strlen(tmpstr); tmpext = tmpstr + len; strncpy(tmpext, "XXXXXX", sizeof(tmpstr) - len); fd = mkstemp(tmpstr); From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 19 06:52:21 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA8AB1065672; Tue, 19 Jun 2012 06:52:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B8BE8FC12; Tue, 19 Jun 2012 06:52:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5J6qLfa026852; Tue, 19 Jun 2012 06:52:21 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5J6qLF2026848; Tue, 19 Jun 2012 06:52:21 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201206190652.q5J6qLF2026848@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 19 Jun 2012 06:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237262 - stable/8/lib/libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 06:52:21 -0000 Author: hselasky Date: Tue Jun 19 06:52:21 2012 New Revision: 237262 URL: http://svn.freebsd.org/changeset/base/237262 Log: MFC r236944: LibUSB v1.0 API compliance and bugfixes. Modified: stable/8/lib/libusb/Makefile stable/8/lib/libusb/libusb10.c stable/8/lib/libusb/libusb10_io.c Directory Properties: stable/8/lib/libusb/ (props changed) Modified: stable/8/lib/libusb/Makefile ============================================================================== --- stable/8/lib/libusb/Makefile Tue Jun 19 06:46:54 2012 (r237261) +++ stable/8/lib/libusb/Makefile Tue Jun 19 06:52:21 2012 (r237262) @@ -16,6 +16,9 @@ MAN= libusb.3 libusb20.3 MKLINT= no NOGCCERROR= +DPADD= ${LIBPTHREAD} +LDADD= -lpthread + MLINKS+= libusb.3 usb.3 # libusb 0.1 compat Modified: stable/8/lib/libusb/libusb10.c ============================================================================== --- stable/8/lib/libusb/libusb10.c Tue Jun 19 06:46:54 2012 (r237261) +++ stable/8/lib/libusb/libusb10.c Tue Jun 19 06:52:21 2012 (r237262) @@ -92,6 +92,7 @@ int libusb_init(libusb_context **context) { struct libusb_context *ctx; + pthread_condattr_t attr; char *debug; int ret; @@ -110,8 +111,28 @@ libusb_init(libusb_context **context) TAILQ_INIT(&ctx->pollfds); TAILQ_INIT(&ctx->tr_done); - pthread_mutex_init(&ctx->ctx_lock, NULL); - pthread_cond_init(&ctx->ctx_cond, NULL); + if (pthread_mutex_init(&ctx->ctx_lock, NULL) != 0) { + free(ctx); + return (LIBUSB_ERROR_NO_MEM); + } + if (pthread_condattr_init(&attr) != 0) { + pthread_mutex_destroy(&ctx->ctx_lock); + free(ctx); + return (LIBUSB_ERROR_NO_MEM); + } + if (pthread_condattr_setclock(&attr, CLOCK_MONOTONIC) != 0) { + pthread_mutex_destroy(&ctx->ctx_lock); + pthread_condattr_destroy(&attr); + free(ctx); + return (LIBUSB_ERROR_OTHER); + } + if (pthread_cond_init(&ctx->ctx_cond, &attr) != 0) { + pthread_mutex_destroy(&ctx->ctx_lock); + pthread_condattr_destroy(&attr); + free(ctx); + return (LIBUSB_ERROR_NO_MEM); + } + pthread_condattr_destroy(&attr); ctx->ctx_handler = NO_THREAD; Modified: stable/8/lib/libusb/libusb10_io.c ============================================================================== --- stable/8/lib/libusb/libusb10_io.c Tue Jun 19 06:46:54 2012 (r237261) +++ stable/8/lib/libusb/libusb10_io.c Tue Jun 19 06:52:21 2012 (r237262) @@ -307,12 +307,16 @@ libusb_wait_for_event(libusb_context *ct &ctx->ctx_lock); return (0); } - err = clock_gettime(CLOCK_REALTIME, &ts); + err = clock_gettime(CLOCK_MONOTONIC, &ts); if (err < 0) return (LIBUSB_ERROR_OTHER); - ts.tv_sec = tv->tv_sec; - ts.tv_nsec = tv->tv_usec * 1000; + /* + * The "tv" arguments points to a relative time structure and + * not an absolute time structure. + */ + ts.tv_sec += tv->tv_sec; + ts.tv_nsec += tv->tv_usec * 1000; if (ts.tv_nsec >= 1000000000) { ts.tv_nsec -= 1000000000; ts.tv_sec++; From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 06:58:38 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C677D10656F0; Wed, 20 Jun 2012 06:58:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B080B8FC08; Wed, 20 Jun 2012 06:58:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5K6wcWl024928; Wed, 20 Jun 2012 06:58:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5K6wcDj024926; Wed, 20 Jun 2012 06:58:38 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206200658.q5K6wcDj024926@svn.freebsd.org> From: Eitan Adler Date: Wed, 20 Jun 2012 06:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237288 - stable/8/share/examples/csh X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 06:58:38 -0000 Author: eadler Date: Wed Jun 20 06:58:38 2012 New Revision: 237288 URL: http://svn.freebsd.org/changeset/base/237288 Log: MFC r236999: Include a warning when using the example code as it may not work in unusual situations. Also slightly optimize the command. Approved by: cperciva (implicit) Modified: stable/8/share/examples/csh/dot.cshrc Directory Properties: stable/8/share/examples/csh/ (props changed) Modified: stable/8/share/examples/csh/dot.cshrc ============================================================================== --- stable/8/share/examples/csh/dot.cshrc Wed Jun 20 06:58:17 2012 (r237287) +++ stable/8/share/examples/csh/dot.cshrc Wed Jun 20 06:58:38 2012 (r237288) @@ -4,8 +4,12 @@ # # Sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running +# +# This has a couple caveats, the most notable being that if a user +# has multiple ssh-agent(1) processes running, this will very likely +# set SSH_AUTH_SOCK to point to the wrong file/domain socket. if (${?SSH_AUTH_SOCK} != "1") then - setenv SSH_AUTH_SOCK `sockstat | grep "^${USER} " | awk '/ssh-agent/ { print $6 }'` + setenv SSH_AUTH_SOCK `sockstat -u | awk '/^${USER}.+ ssh-agent/ { print $6 }' endif # Change only root's prompt From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 10:59:12 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46AB0106567A; Wed, 20 Jun 2012 10:59:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FA628FC08; Wed, 20 Jun 2012 10:59:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KAxCDP038069; Wed, 20 Jun 2012 10:59:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KAxBXM038064; Wed, 20 Jun 2012 10:59:11 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201206201059.q5KAxBXM038064@svn.freebsd.org> From: Christian Brueffer Date: Wed, 20 Jun 2012 10:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237298 - in stable/8: . share/man/man9 sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 10:59:12 -0000 Author: brueffer Date: Wed Jun 20 10:59:11 2012 New Revision: 237298 URL: http://svn.freebsd.org/changeset/base/237298 Log: MFC: r232051 Catch up with r195837 (2.5 years ago) which renamed net_add_domain() to domain_add(). Modified: stable/8/ObsoleteFiles.inc (contents, props changed) stable/8/share/man/man9/Makefile stable/8/share/man/man9/domain.9 stable/8/sys/kern/uipc_domain.c Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Wed Jun 20 10:15:45 2012 (r237297) +++ stable/8/ObsoleteFiles.inc Wed Jun 20 10:59:11 2012 (r237298) @@ -345,6 +345,8 @@ OLD_LIBS+=usr/lib32/pam_unix.so.4 .endif # 20090718: the gdm pam.d file is no longer required. OLD_FILES+=etc/pam.d/gdm +# 20090714: net_add_domain(9) renamed to domain_add(9) +OLD_FILES+=usr/share/man/man9/net_add_domain.9.gz # 20090713: vimage container structs removed. OLD_FILES+=usr/include/netinet/vinet.h OLD_FILES+=usr/include/netinet6/vinet6.h Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Wed Jun 20 10:15:45 2012 (r237297) +++ stable/8/share/man/man9/Makefile Wed Jun 20 10:59:11 2012 (r237298) @@ -612,7 +612,7 @@ MLINKS+=disk.9 disk_alloc.9 \ disk.9 disk_gone.9 \ disk.9 disk_destroy.9 MLINKS+=domain.9 DOMAIN_SET.9 \ - domain.9 net_add_domain.9 \ + domain.9 domain_add.9 \ domain.9 pfctlinput.9 \ domain.9 pfctlinput2.9 \ domain.9 pffindproto.9 \ Modified: stable/8/share/man/man9/domain.9 ============================================================================== --- stable/8/share/man/man9/domain.9 Wed Jun 20 10:15:45 2012 (r237297) +++ stable/8/share/man/man9/domain.9 Wed Jun 20 10:59:11 2012 (r237298) @@ -26,11 +26,11 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2008 +.Dd February 23, 2012 .Dt DOMAIN 9 .Os .Sh NAME -.Nm net_add_domain , +.Nm domain_add , .Nm pfctlinput , .Nm pfctlinput2 , .Nm pffindproto , @@ -43,7 +43,7 @@ .In sys/protosw.h .In sys/domain.h .Ft void -.Fn net_add_domain "void *data" +.Fn domain_add "void *data" .Ft void .Fn pfctlinput "int cmd" "struct sockaddr *sa" .Ft void @@ -142,7 +142,7 @@ have their .Fn pr_ctlinput function called. .Pp -.Fn net_add_domain +.Fn domain_add adds a new protocol domain to the system. The argument .Fa data @@ -153,13 +153,13 @@ within the function, but is declared in order to prevent compiler warnings when new domains are registered with .Fn SYSINIT . In most cases -.Fn net_add_domain +.Fn domain_add is not called directly, instead .Fn DOMAIN_SET is used. .Pp If the new domain has defined an initialization routine, it is called by -.Fn net_add_domain ; +.Fn domain_add ; as well, each of the protocols within the domain that have defined an initialization routine will have theirs called. .Pp Modified: stable/8/sys/kern/uipc_domain.c ============================================================================== --- stable/8/sys/kern/uipc_domain.c Wed Jun 20 10:15:45 2012 (r237297) +++ stable/8/sys/kern/uipc_domain.c Wed Jun 20 10:59:11 2012 (r237298) @@ -220,7 +220,7 @@ domain_add(void *data) domains = dp; KASSERT(domain_init_status >= 1, - ("attempt to net_add_domain(%s) before domaininit()", + ("attempt to domain_add(%s) before domaininit()", dp->dom_name)); #ifndef INVARIANTS if (domain_init_status < 1) From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 13:42:41 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69DE91065676; Wed, 20 Jun 2012 13:42:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54B878FC20; Wed, 20 Jun 2012 13:42:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KDgfeH045208; Wed, 20 Jun 2012 13:42:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KDgf4S045206; Wed, 20 Jun 2012 13:42:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201342.q5KDgf4S045206@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 13:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237304 - stable/8/sys/cam X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 13:42:41 -0000 Author: mav Date: Wed Jun 20 13:42:40 2012 New Revision: 237304 URL: http://svn.freebsd.org/changeset/base/237304 Log: MFC r236605: Replace #ifdef CAMDEBUG + if + panic() with single KASSERT(). Modified: stable/8/sys/cam/cam_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Wed Jun 20 13:41:20 2012 (r237303) +++ stable/8/sys/cam/cam_xpt.c Wed Jun 20 13:42:40 2012 (r237304) @@ -3179,13 +3179,8 @@ xpt_run_dev_allocq(struct cam_eb *bus) ("running device %p\n", device)); drvq = &device->drvq; - -#ifdef CAMDEBUG - if (drvq->entries <= 0) { - panic("xpt_run_dev_allocq: " - "Device on queue without any work to do"); - } -#endif + KASSERT(drvq->entries > 0, ("xpt_run_dev_allocq: " + "Device on queue without any work to do")); if ((work_ccb = xpt_get_ccb(device)) != NULL) { devq->alloc_openings--; devq->alloc_active++; From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 14:11:19 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A1851065675; Wed, 20 Jun 2012 14:11:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 129D38FC08; Wed, 20 Jun 2012 14:11:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KEBJuk046552; Wed, 20 Jun 2012 14:11:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEBI7f046544; Wed, 20 Jun 2012 14:11:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201411.q5KEBI7f046544@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237306 - in stable/8/sys/cam: ata scsi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:11:19 -0000 Author: mav Date: Wed Jun 20 14:11:18 2012 New Revision: 237306 URL: http://svn.freebsd.org/changeset/base/237306 Log: MFC r236602, r236613: Tune and add some missing CAM_DEBUG() points for better consistency. Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/ata/ata_pmp.c stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/cam/scsi/scsi_cd.c stable/8/sys/cam/scsi/scsi_da.c stable/8/sys/cam/scsi/scsi_pt.c stable/8/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/ata/ata_da.c Wed Jun 20 14:11:18 2012 (r237306) @@ -426,9 +426,8 @@ adaopen(struct disk *dp) softc = (struct ada_softc *)periph->softc; softc->flags |= ADA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("adaopen: disk=%s%d (unit %d)\n", dp->d_name, dp->d_unit, - periph->unit_number)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("adaopen\n")); if ((softc->flags & ADA_FLAG_PACK_INVALID) != 0) { /* Invalidate our pack information. */ @@ -459,6 +458,10 @@ adaclose(struct disk *dp) } softc = (struct ada_softc *)periph->softc; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("adaclose\n")); + /* We only sync the cache if the drive is capable of it. */ if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { @@ -532,6 +535,8 @@ adastrategy(struct bio *bp) cam_periph_lock(periph); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adastrategy(%p)\n", bp)); + /* * If the device has been made invalid, error out */ @@ -1113,6 +1118,8 @@ adastart(struct cam_periph *periph, unio struct ada_softc *softc = (struct ada_softc *)periph->softc; struct ccb_ataio *ataio = &start_ccb->ataio; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adastart\n")); + switch (softc->state) { case ADA_STATE_NORMAL: { @@ -1121,7 +1128,7 @@ adastart(struct cam_periph *periph, unio /* Execute immediate CCB if waiting. */ if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = ADA_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -1413,6 +1420,9 @@ adadone(struct cam_periph *periph, union softc = (struct ada_softc *)periph->softc; ataio = &done_ccb->ataio; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adadone\n")); + switch (ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) { case ADA_CCB_BUFFER_IO: case ADA_CCB_TRIM: Modified: stable/8/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/8/sys/cam/ata/ata_pmp.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/ata/ata_pmp.c Wed Jun 20 14:11:18 2012 (r237306) @@ -429,7 +429,9 @@ pmpstart(struct cam_periph *periph, unio softc = (struct pmp_softc *)periph->softc; ataio = &start_ccb->ataio; - + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("pmpstart\n")); + if (softc->restart) { softc->restart = 0; softc->state = min(softc->state, PMP_STATE_PRECONFIG); @@ -560,7 +562,7 @@ pmpdone(struct cam_periph *periph, union softc = (struct pmp_softc *)periph->softc; ataio = &done_ccb->ataio; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("pmpdone\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("pmpdone\n")); priority = done_ccb->ccb_h.pinfo.priority; Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/ata/ata_xpt.c Wed Jun 20 14:11:18 2012 (r237306) @@ -94,6 +94,7 @@ typedef enum { PROBE_FULL_INQUIRY, PROBE_PM_PID, PROBE_PM_PRV, + PROBE_DONE, PROBE_INVALID } probe_action; @@ -111,6 +112,7 @@ static char *probe_action_text[] = { "PROBE_FULL_INQUIRY", "PROBE_PM_PID", "PROBE_PM_PRV", + "PROBE_DONE", "PROBE_INVALID" }; @@ -118,7 +120,7 @@ static char *probe_action_text[] = { do { \ char **text; \ text = probe_action_text; \ - CAM_DEBUG((softc)->periph->path, CAM_DEBUG_INFO, \ + CAM_DEBUG((softc)->periph->path, CAM_DEBUG_PROBE, \ ("Probe %s to %s\n", text[(softc)->action], \ text[(newaction)])); \ (softc)->action = (newaction); \ @@ -247,6 +249,8 @@ proberegister(struct cam_periph *periph, if (status != CAM_REQ_CMP) { return (status); } + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); + /* * Ensure nobody slip in until probe finish. */ @@ -623,11 +627,8 @@ negotiate: 10 * 1000); ata_pm_read_cmd(ataio, 1, 15); break; - case PROBE_INVALID: - CAM_DEBUG(path, CAM_DEBUG_INFO, - ("probestart: invalid action state\n")); default: - break; + panic("probestart: invalid action state 0x%x\n", softc->action); } xpt_action(start_ccb); } @@ -729,6 +730,7 @@ probedone(struct cam_periph *periph, uni */ device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) xpt_async(AC_LOST_DEVICE, path, NULL); + PROBE_SET_ACTION(softc, PROBE_INVALID); found = 0; goto done; } @@ -740,8 +742,8 @@ noerror: { int sign = (done_ccb->ataio.res.lba_high << 8) + done_ccb->ataio.res.lba_mid; - if (bootverbose) - xpt_print(path, "SIGNATURE: %04x\n", sign); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("SIGNATURE: %04x\n", sign)); if (sign == 0x0000 && done_ccb->ccb_h.target_id != 15) { path->device->protocol = PROTO_ATA; @@ -986,6 +988,7 @@ notsata: xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; case PROBE_INQUIRY: case PROBE_FULL_INQUIRY: @@ -1029,6 +1032,7 @@ notsata: xpt_action(done_ccb); xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; } case PROBE_PM_PID: @@ -1100,12 +1104,10 @@ notsata: xpt_action(done_ccb); xpt_async(AC_SCSI_AEN, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); break; - case PROBE_INVALID: - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("probedone: invalid action state\n")); default: - break; + panic("probedone: invalid action state 0x%x\n", softc->action); } done: if (softc->restart) { @@ -1115,6 +1117,7 @@ done: return; } xpt_release_ccb(done_ccb); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe completed\n")); while ((done_ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs))) { TAILQ_REMOVE(&softc->request_ccbs, &done_ccb->ccb_h, periph_links.tqe); Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/scsi/scsi_cd.c Wed Jun 20 14:11:18 2012 (r237306) @@ -1006,6 +1006,9 @@ cdopen(struct disk *dp) return (error); } + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("cdopen\n")); + /* * Check for media, and set the appropriate flags. We don't bail * if we don't have media, but then we don't allow anything but the @@ -1043,6 +1046,9 @@ cdclose(struct disk *dp) cam_periph_lock(periph); cam_periph_hold(periph, PRIBIO); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("cdclose\n")); + if ((softc->flags & CD_FLAG_DISC_REMOVABLE) != 0) cdprevent(periph, PR_ALLOW); @@ -1387,7 +1393,8 @@ cdstrategy(struct bio *bp) } cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdstrategy\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, + ("cdstrategy(%p)\n", bp)); softc = (struct cd_softc *)periph->softc; @@ -1852,12 +1859,11 @@ cdioctl(struct disk *dp, u_long cmd, voi return(ENXIO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdioctl\n")); softc = (struct cd_softc *)periph->softc; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("trying to do ioctl %#lx\n", cmd)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, + ("cdioctl(%#lx)\n", cmd)); if ((error = cam_periph_hold(periph, PRIBIO | PCATCH)) != 0) { cam_periph_unlock(periph); Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/scsi/scsi_da.c Wed Jun 20 14:11:18 2012 (r237306) @@ -914,9 +914,8 @@ daopen(struct disk *dp) softc = (struct da_softc *)periph->softc; softc->flags |= DA_FLAG_OPEN; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, - ("daopen: disk=%s%d (unit %d)\n", dp->d_name, dp->d_unit, - unit)); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("daopen\n")); if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { /* Invalidate our pack information. */ @@ -972,6 +971,9 @@ daclose(struct disk *dp) softc = (struct da_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, + ("daclose\n")); + if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0 && (softc->flags & DA_FLAG_PACK_INVALID) == 0) { union ccb *ccb; @@ -1061,7 +1063,9 @@ dastrategy(struct bio *bp) biofinish(bp, NULL, ENXIO); return; } - + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastrategy(%p)\n", bp)); + /* * Place it in the queue of disk activities for this disk */ @@ -1576,6 +1580,8 @@ dastart(struct cam_periph *periph, union softc = (struct da_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dastart\n")); + switch (softc->state) { case DA_STATE_NORMAL: { @@ -1587,7 +1593,7 @@ dastart(struct cam_periph *periph, union */ bp = bioq_first(&softc->bio_queue); if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = DA_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -1784,6 +1790,9 @@ dadone(struct cam_periph *periph, union softc = (struct da_softc *)periph->softc; priority = done_ccb->ccb_h.pinfo.priority; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone\n")); + csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) { case DA_CCB_BUFFER_IO: Modified: stable/8/sys/cam/scsi/scsi_pt.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_pt.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/scsi/scsi_pt.c Wed Jun 20 14:11:18 2012 (r237306) @@ -425,12 +425,14 @@ ptstart(struct cam_periph *periph, union softc = (struct pt_softc *)periph->softc; + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ptstart\n")); + /* * See if there is a buf with work for us to do.. */ bp = bioq_first(&softc->bio_queue); if (periph->immediate_priority <= periph->pinfo.priority) { - CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); start_ccb->ccb_h.ccb_state = PT_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, @@ -483,6 +485,9 @@ ptdone(struct cam_periph *periph, union struct ccb_scsiio *csio; softc = (struct pt_softc *)periph->softc; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ptdone\n")); + csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state) { case PT_CCB_BUFFER_IO: Modified: stable/8/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_xpt.c Wed Jun 20 13:59:25 2012 (r237305) +++ stable/8/sys/cam/scsi/scsi_xpt.c Wed Jun 20 14:11:18 2012 (r237306) @@ -140,6 +140,7 @@ typedef enum { PROBE_INQUIRY_BASIC_DV1, PROBE_INQUIRY_BASIC_DV2, PROBE_DV_EXIT, + PROBE_DONE, PROBE_INVALID } probe_action; @@ -155,6 +156,7 @@ static char *probe_action_text[] = { "PROBE_INQUIRY_BASIC_DV1", "PROBE_INQUIRY_BASIC_DV2", "PROBE_DV_EXIT", + "PROBE_DONE", "PROBE_INVALID" }; @@ -162,7 +164,7 @@ static char *probe_action_text[] = { do { \ char **text; \ text = probe_action_text; \ - CAM_DEBUG((softc)->periph->path, CAM_DEBUG_INFO, \ + CAM_DEBUG((softc)->periph->path, CAM_DEBUG_PROBE, \ ("Probe %s to %s\n", text[(softc)->action], \ text[(newaction)])); \ (softc)->action = (newaction); \ @@ -639,7 +641,7 @@ proberegister(struct cam_periph *periph, if (status != CAM_REQ_CMP) { return (status); } - + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); /* * Ensure we've waited at least a bus settle @@ -927,11 +929,8 @@ again: probedone(periph, start_ccb); return; } - case PROBE_INVALID: - CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("probestart: invalid action state\n")); default: - break; + panic("probestart: invalid action state 0x%x\n", softc->action); } xpt_action(start_ccb); } @@ -1011,7 +1010,7 @@ proberequestbackoff(struct cam_periph *p } if (device->flags & CAM_DEV_DV_HIT_BOTTOM) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("hit async: giving up on DV\n")); return (0); } @@ -1031,7 +1030,7 @@ proberequestbackoff(struct cam_periph *p if (spi->sync_period >= 0xf) { spi->sync_period = 0; spi->sync_offset = 0; - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("setting to async for DV\n")); /* * Once we hit async, we don't want to try @@ -1039,7 +1038,7 @@ proberequestbackoff(struct cam_periph *p */ device->flags |= CAM_DEV_DV_HIT_BOTTOM; } else if (bootverbose) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("DV: period 0x%x\n", spi->sync_period)); printf("setting period to 0x%x\n", spi->sync_period); } @@ -1049,7 +1048,7 @@ proberequestbackoff(struct cam_periph *p if ((cts.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { break; } - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("DV: failed to set period 0x%x\n", spi->sync_period)); if (spi->sync_period == 0) { return (0); @@ -1194,6 +1193,7 @@ probedone(struct cam_periph *periph, uni if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) /* Send the async notification. */ xpt_async(AC_LOST_DEVICE, path, NULL); + PROBE_SET_ACTION(softc, PROBE_INVALID); xpt_release_ccb(done_ccb); break; @@ -1227,8 +1227,9 @@ probedone(struct cam_periph *periph, uni /* * Reallocate and retry to cover all luns */ - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, path, - ("reallocating REPORT_LUNS for %u luns\n", nlun)); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("Probe: reallocating REPORT_LUNS for %u luns\n", + nlun)); free(lp, M_CAMXPT); path->target->rpl_size = (nlun << 3) + 8; xpt_release_ccb(done_ccb); @@ -1251,8 +1252,8 @@ probedone(struct cam_periph *periph, uni lun_id_t lun; int idx; - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, path, - ("%u luns reported\n", nlun)); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("Probe: %u lun(s) reported\n", nlun)); CAM_GET_SIMPLE_LUN(lp, 0, lun); /* @@ -1274,8 +1275,8 @@ probedone(struct cam_periph *periph, uni lp->luns[idx].lundata, 8); memcpy(lp->luns[idx].lundata, tlun, 8); - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, - path, ("lun 0 in position %u\n", idx)); + CAM_DEBUG(path, CAM_DEBUG_PROBE, + ("lun 0 in position %u\n", idx)); } else { /* * There is no lun 0 in our list. Destroy @@ -1523,7 +1524,7 @@ probedone(struct cam_periph *periph, uni && done_ccb->ccb_h.target_lun == 0 && (path->device->inq_data.flags & SID_Sync) != 0 && (path->device->flags & CAM_DEV_IN_DV) == 0) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Begin Domain Validation\n")); path->device->flags |= CAM_DEV_IN_DV; xpt_release_ccb(done_ccb); @@ -1532,7 +1533,7 @@ probedone(struct cam_periph *periph, uni return; } if (softc->action == PROBE_DV_EXIT) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Leave Domain Validation\n")); } if (path->device->flags & CAM_DEV_UNCONFIGURED) { @@ -1548,6 +1549,7 @@ probedone(struct cam_periph *periph, uni xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); xpt_release_ccb(done_ccb); break; case PROBE_INQUIRY_BASIC_DV1: @@ -1587,7 +1589,7 @@ probedone(struct cam_periph *periph, uni return; } if (softc->action == PROBE_INQUIRY_BASIC_DV2) { - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Leave Domain Validation Successfully\n")); } if (path->device->flags & CAM_DEV_UNCONFIGURED) { @@ -1603,20 +1605,19 @@ probedone(struct cam_periph *periph, uni xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); } + PROBE_SET_ACTION(softc, PROBE_DONE); xpt_release_ccb(done_ccb); break; } - case PROBE_INVALID: - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_INFO, - ("probedone: invalid action state\n")); default: - break; + panic("probedone: invalid action state 0x%x\n", softc->action); } done_ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs); TAILQ_REMOVE(&softc->request_ccbs, &done_ccb->ccb_h, periph_links.tqe); done_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(done_ccb); if (TAILQ_FIRST(&softc->request_ccbs) == NULL) { + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe completed\n")); cam_periph_invalidate(periph); cam_release_devq(periph->path, RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_XPT + 1, FALSE); @@ -1829,7 +1830,7 @@ scsi_scan_bus(struct cam_periph *periph, xpt_done(request_ccb); return; } - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, request_ccb->ccb_h.path, + CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("SCAN start for %p\n", scan_info)); scan_info->request_ccb = request_ccb; scan_info->cpi = &work_ccb->cpi; @@ -1942,8 +1943,8 @@ scsi_scan_bus(struct cam_periph *periph, CAM_GET_SIMPLE_LUN(target->luns, scan_info->lunindex[target_id], lun_id); next_target = 0; - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, - request_ccb->ccb_h.path, + CAM_DEBUG(request_ccb->ccb_h.path, + CAM_DEBUG_PROBE, ("next lun to try at index %u is %u\n", scan_info->lunindex[target_id], lun_id)); scan_info->lunindex[target_id]++; @@ -2050,8 +2051,8 @@ scsi_scan_bus(struct cam_periph *periph, xpt_free_ccb(request_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; - CAM_DEBUG_PATH_PRINT(CAM_DEBUG_PROBE, - request_ccb->ccb_h.path, + CAM_DEBUG(request_ccb->ccb_h.path, + CAM_DEBUG_TRACE, ("SCAN done for %p\n", scan_info)); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = CAM_REQ_CMP; From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 14:15:14 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC8C81065674; Wed, 20 Jun 2012 14:15:14 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6FA78FC1C; Wed, 20 Jun 2012 14:15:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KEFEo5046874; Wed, 20 Jun 2012 14:15:14 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEFEan046872; Wed, 20 Jun 2012 14:15:14 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201206201415.q5KEFEan046872@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 20 Jun 2012 14:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237309 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:15:14 -0000 Author: melifaro Date: Wed Jun 20 14:15:14 2012 New Revision: 237309 URL: http://svn.freebsd.org/changeset/base/237309 Log: MFC r236819 Validate IPv4 network mask being passed to ipfw kernel interface. Incorrect mask can possibly be one of the reasons for kern/127209 existance. Approved by: ae(mentor) Modified: stable/8/sys/netinet/ipfw/ip_fw_table.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_table.c Wed Jun 20 14:14:27 2012 (r237308) +++ stable/8/sys/netinet/ipfw/ip_fw_table.c Wed Jun 20 14:15:14 2012 (r237309) @@ -153,6 +153,9 @@ ipfw_add_table_entry(struct ip_fw_chain case IPFW_TABLE_CIDR: if (plen == sizeof(in_addr_t)) { #ifdef INET + /* IPv4 case */ + if (mlen > 32) + return (EINVAL); ent = malloc(sizeof(*ent), M_IPFW_TBL, M_WAITOK | M_ZERO); ent->value = value; /* Set 'total' structure length */ From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 14:15:40 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3167A1065680; Wed, 20 Jun 2012 14:15:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0336F8FC14; Wed, 20 Jun 2012 14:15:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KEFde9046931; Wed, 20 Jun 2012 14:15:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEFdSl046928; Wed, 20 Jun 2012 14:15:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201415.q5KEFdSl046928@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237310 - stable/8/sbin/camcontrol X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:15:40 -0000 Author: mav Date: Wed Jun 20 14:15:39 2012 New Revision: 237310 URL: http://svn.freebsd.org/changeset/base/237310 Log: MFC r236555: Add -p argument for `camcontrol debug` to allow enabling CAM_DEBUG_PROBE added at r208911. Modified: stable/8/sbin/camcontrol/camcontrol.8 stable/8/sbin/camcontrol/camcontrol.c Directory Properties: stable/8/sbin/camcontrol/ (props changed) Modified: stable/8/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.8 Wed Jun 20 14:15:14 2012 (r237309) +++ stable/8/sbin/camcontrol/camcontrol.8 Wed Jun 20 14:15:39 2012 (r237310) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2010 +.Dd June 4, 2012 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -138,6 +138,7 @@ .Op Fl S .Op Fl X .Op Fl c +.Op Fl p .Aq all|off|bus Ns Op :target Ns Op :lun .Nm .Ic tags @@ -581,6 +582,8 @@ Enable CAM_DEBUG_XPT printfs. Enable CAM_DEBUG_CDB printfs. This will cause the kernel to print out the SCSI CDBs sent to the specified device(s). +.It Fl p +Enable CAM_DEBUG_PROBE printfs. .It all Enable debugging for all devices. .It off Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Wed Jun 20 14:15:14 2012 (r237309) +++ stable/8/sbin/camcontrol/camcontrol.c Wed Jun 20 14:15:39 2012 (r237310) @@ -113,6 +113,7 @@ typedef enum { CAM_ARG_DEBUG_CDB = 0x08000000, CAM_ARG_DEBUG_XPT = 0x10000000, CAM_ARG_DEBUG_PERIPH = 0x20000000, + CAM_ARG_DEBUG_PROBE = 0x40000000, } cam_argmask; struct camcontrol_opts { @@ -155,7 +156,7 @@ struct camcontrol_opts option_table[] = {"tags", CAM_CMD_TAG, CAM_ARG_NONE, "N:q"}, {"negotiate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts}, {"rate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts}, - {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXc"}, + {"debug", CAM_CMD_DEBUG, CAM_ARG_NONE, "IPTSXcp"}, {"format", CAM_CMD_FORMAT, CAM_ARG_NONE, "qrwy"}, {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, @@ -2568,6 +2569,10 @@ camdebug(int argc, char **argv, char *co arglist |= CAM_ARG_DEBUG_CDB; ccb.cdbg.flags |= CAM_DEBUG_CDB; break; + case 'p': + arglist |= CAM_ARG_DEBUG_PROBE; + ccb.cdbg.flags |= CAM_DEBUG_PROBE; + break; default: break; } @@ -2597,7 +2602,7 @@ camdebug(int argc, char **argv, char *co ccb.cdbg.flags = CAM_DEBUG_NONE; arglist &= ~(CAM_ARG_DEBUG_INFO|CAM_ARG_DEBUG_PERIPH| CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE| - CAM_ARG_DEBUG_XPT); + CAM_ARG_DEBUG_XPT|CAM_ARG_DEBUG_PROBE); } else if (strncmp(tstr, "all", 3) != 0) { tmpstr = (char *)strtok(tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')){ From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 14:23:10 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8720106566C; Wed, 20 Jun 2012 14:23:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A316F8FC1A; Wed, 20 Jun 2012 14:23:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KENAoJ047406; Wed, 20 Jun 2012 14:23:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KENAni047404; Wed, 20 Jun 2012 14:23:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201423.q5KENAni047404@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237313 - stable/8/sys/cam/ata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:23:10 -0000 Author: mav Date: Wed Jun 20 14:23:10 2012 New Revision: 237313 URL: http://svn.freebsd.org/changeset/base/237313 Log: MFC r236639: Use default error handler when flushing disk caches. Modified: stable/8/sys/cam/ata/ata_da.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Wed Jun 20 14:22:38 2012 (r237312) +++ stable/8/sys/cam/ata/ata_da.c Wed Jun 20 14:23:10 2012 (r237313) @@ -480,7 +480,7 @@ adaclose(struct disk *dp) ata_48bit_cmd(&ccb->ataio, ATA_FLUSHCACHE48, 0, 0, 0); else ata_28bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, 0); - cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0, + cam_periph_runccb(ccb, adaerror, /*cam_flags*/0, /*sense_flags*/0, softc->disk->d_devstat); if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 14:29:02 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CDF7106566B; Wed, 20 Jun 2012 14:29:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 575068FC16; Wed, 20 Jun 2012 14:29:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KET23i047868; Wed, 20 Jun 2012 14:29:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KET25d047866; Wed, 20 Jun 2012 14:29:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201429.q5KET25d047866@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237316 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:29:02 -0000 Author: mav Date: Wed Jun 20 14:29:01 2012 New Revision: 237316 URL: http://svn.freebsd.org/changeset/base/237316 Log: MFC r236689 (by ken): Fix a memory leak in the kernel case in scsi_command_string(). Submitted by: Kashyap Desai Modified: stable/8/sys/cam/scsi/scsi_all.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.c Wed Jun 20 14:27:55 2012 (r237315) +++ stable/8/sys/cam/scsi/scsi_all.c Wed Jun 20 14:29:01 2012 (r237316) @@ -3037,6 +3037,10 @@ scsi_command_string(struct cam_device *d sizeof(cdb_str))); } +#ifdef _KERNEL + xpt_free_ccb((union ccb *)cgd); +#endif + return(0); } From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 14:39:36 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C4121065672; Wed, 20 Jun 2012 14:39:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63C0A8FC17; Wed, 20 Jun 2012 14:39:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KEdaRB048433; Wed, 20 Jun 2012 14:39:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEdaF9048424; Wed, 20 Jun 2012 14:39:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201439.q5KEdaF9048424@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237318 - in stable/8: share/man/man4 sys/cam sys/cam/scsi sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:39:36 -0000 Author: mav Date: Wed Jun 20 14:39:35 2012 New Revision: 237318 URL: http://svn.freebsd.org/changeset/base/237318 Log: MFC r236712: To make CAM debugging easier, compile in some debug flags (CAM_DEBUG_INFO, CAM_DEBUG_CDB, CAM_DEBUG_PERIPH and CAM_DEBUG_PROBE) by default. List of these flags can be modified with CAM_DEBUG_COMPILE kernel option. CAMDEBUG kernel option still enables all possible debug, if not overriden. Additional 50KB of kernel size is a good price for the ability to debug problems without rebuilding the kernel. In case where size is important, debugging can be compiled out by setting CAM_DEBUG_COMPILE option to 0. Modified: stable/8/share/man/man4/scsi.4 stable/8/sys/cam/cam_debug.h stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/cam_xpt.h stable/8/sys/cam/scsi/scsi_sa.c stable/8/sys/cam/scsi/scsi_target.c stable/8/sys/conf/NOTES stable/8/sys/conf/options Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/share/man/man4/scsi.4 ============================================================================== --- stable/8/share/man/man4/scsi.4 Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/share/man/man4/scsi.4 Wed Jun 20 14:39:35 2012 (r237318) @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd March 4, 2010 +.Dd June 7, 2012 .Dt CAM 4 .Os .Sh NAME @@ -43,6 +43,7 @@ .Cd "options CAM_DEBUG_BUS=-1" .Cd "options CAM_DEBUG_TARGET=-1" .Cd "options CAM_DEBUG_LUN=-1" +.Cd "options CAM_DEBUG_COMPILE=CAM_DEBUG_INFO|CAM_DEBUG_CDB|CAM_DEBUG_PROBE" .Cd "options CAM_DEBUG_FLAGS=CAM_DEBUG_INFO|CAM_DEBUG_CDB" .Cd "options CAM_MAX_HIGHPOWER=4" .Cd "options SCSI_NO_SENSE_STRINGS" @@ -72,12 +73,11 @@ There are a number of generic kernel con subsystem: .Bl -tag -width SCSI_NO_SENSE_STRINGS .It Dv CAMDEBUG -This option enables the +This option compiles in all the .Nm debugging printf code. This will not actually cause any debugging information to be printed out when included by itself. -Enabling printouts requires additional configuration. See below for details. .It Dv "CAM_MAX_HIGHPOWER=4" This sets the maximum allowable number of concurrent "high power" commands. @@ -248,54 +248,53 @@ see other .Nm device entries. .Sh DIAGNOSTICS -When the kernel is compiled with options CAMDEBUG, an XPT_DEBUG CCB can be -used to enable various amounts of tracing information on any -specific device. -Devices not being traced will not produce trace information. -There are currently four debugging flags that may be turned on: +An XPT_DEBUG CCB can be used to enable various amounts of tracing information +on any specific bus/device from the list of options compiled into the kernel. +There are currently seven debugging flags that may be compiled in and used: .Bl -tag -width CAM_DEBUG_SUBTRACE .It Dv CAM_DEBUG_INFO -This debugging flag enables general informational printfs for the device +This flag enables general informational printfs for the device or devices in question. .It Dv CAM_DEBUG_TRACE -This debugging flag enables function-level command flow tracing. +This flag enables function-level command flow tracing. i.e.\& kernel printfs will happen at the entrance and exit of various functions. .It Dv CAM_DEBUG_SUBTRACE -This debugging flag enables debugging output internal to various functions. +This flag enables debugging output internal to various functions. .It Dv CAM_DEBUG_CDB -This debugging flag will cause the kernel to print out all +This flag will cause the kernel to print out all +.Tn ATA +and .Tn SCSI commands sent to a particular device or devices. +.It Dv CAM_DEBUG_XPT +This flag will enable command scheduler tracing. +.It Dv CAM_DEBUG_PERIPH +This flag will enable peripheral drivers messages. +.It Dv CAM_DEBUG_PROBE +This flag will enable devices probe process tracing. .El .Pp Some of these flags, most notably .Dv CAM_DEBUG_TRACE and -.Dv CAM_DEBUG_SUBTRACE -will produce kernel printfs in EXTREME numbers, -and because of that, they are not especially useful. -There are not many things logged at the -.Dv CAM_DEBUG_INFO -level, so it is not especially useful. -The most useful debugging flag is the -.Dv CAM_DEBUG_CDB -flag. +.Dv CAM_DEBUG_SUBTRACE , +will produce kernel printfs in EXTREME numbers. +.Pp Users can enable debugging from their kernel config file, by using the following kernel config options: -.Bl -tag -width CAM_DEBUG_TARGET +.Bl -tag -width CAM_DEBUG_COMPILE .It Dv CAMDEBUG -This enables +This builds into the kernel all possible .Nm debugging. -Without this option, users will not even be able -to turn on debugging from userland via -.Xr camcontrol 8 . -.It Dv CAM_DEBUG_FLAGS -This allows the user to set the various debugging flags described above -in a kernel config file. +.It Dv CAM_DEBUG_COMPILE +This allows to specify support for which debugging flags described above +should be built into the kernel. Flags may be ORed together if the user wishes to see printfs for multiple debugging levels. +.It Dv CAM_DEBUG_FLAGS +This allows to set the various debugging flags from a kernel config file. .It Dv CAM_DEBUG_BUS Specify a bus to debug. To debug all busses, set this to -1. @@ -307,17 +306,9 @@ Specify a lun to debug. To debug all luns, set this to -1. .El .Pp -When specifying a bus, target or lun to debug, you -.Em MUST -specify all three bus/target/lun options above. -Using wildcards, you -should be able to enable debugging on most anything. -.Pp -Users may also enable debugging printfs on the fly, if the -.Dv CAMDEBUG -option is their config file, by using the +Users may also enable debugging on the fly by using the .Xr camcontrol 8 -utility. +utility, if wanted options built into the kernel. See .Xr camcontrol 8 for details. Modified: stable/8/sys/cam/cam_debug.h ============================================================================== --- stable/8/sys/cam/cam_debug.h Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/cam/cam_debug.h Wed Jun 20 14:39:35 2012 (r237318) @@ -44,7 +44,35 @@ typedef enum { CAM_DEBUG_PROBE = 0x40 /* print out probe actions */ } cam_debug_flags; -#if defined(CAMDEBUG) && defined(_KERNEL) +#if defined(_KERNEL) + +#ifndef CAM_DEBUG_FLAGS +#define CAM_DEBUG_FLAGS CAM_DEBUG_NONE +#endif + +#ifndef CAM_DEBUG_COMPILE +#ifdef CAMDEBUG +#define CAM_DEBUG_COMPILE (-1) +#else +#define CAM_DEBUG_COMPILE (CAM_DEBUG_INFO | CAM_DEBUG_CDB | \ + CAM_DEBUG_PERIPH | CAM_DEBUG_PROBE | \ + CAM_DEBUG_FLAGS) +#endif +#endif + +#ifndef CAM_DEBUG_BUS +#define CAM_DEBUG_BUS (-1) +#endif +#ifndef CAM_DEBUG_TARGET +#define CAM_DEBUG_TARGET (-1) +#endif +#ifndef CAM_DEBUG_LUN +#define CAM_DEBUG_LUN (-1) +#endif + +#ifndef CAM_DEBUG_DELAY +#define CAM_DEBUG_DELAY 0 +#endif /* Path we want to debug */ extern struct cam_path *cam_dpath; @@ -52,48 +80,48 @@ extern struct cam_path *cam_dpath; extern u_int32_t cam_dflags; /* Printf delay value (to prevent scrolling) */ extern u_int32_t cam_debug_delay; - + /* Debugging macros. */ #define CAM_DEBUGGED(path, flag) \ - ((cam_dflags & (flag)) \ + (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \ && (cam_dpath != NULL) \ && (xpt_path_comp(cam_dpath, path) >= 0) \ && (xpt_path_comp(cam_dpath, path) < 2)) #define CAM_DEBUG(path, flag, printfargs) \ - if ((cam_dflags & (flag)) \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \ && (cam_dpath != NULL) \ && (xpt_path_comp(cam_dpath, path) >= 0) \ && (xpt_path_comp(cam_dpath, path) < 2)) { \ xpt_print_path(path); \ - printf printfargs; \ + printf printfargs; \ if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } #define CAM_DEBUG_PRINT(flag, printfargs) \ - if (cam_dflags & (flag)) { \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \ printf("cam_debug: "); \ - printf printfargs; \ + printf printfargs; \ if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } #define CAM_DEBUG_PATH_PRINT(flag, path, printfargs) \ - if (cam_dflags & (flag)) { \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \ xpt_print(path, "cam_debug: "); \ - printf printfargs; \ + printf printfargs; \ if (cam_debug_delay != 0) \ DELAY(cam_debug_delay); \ } -#else /* !CAMDEBUG || !_KERNEL */ +#else /* !_KERNEL */ #define CAM_DEBUGGED(A, B) 0 #define CAM_DEBUG(A, B, C) #define CAM_DEBUG_PRINT(A, B) #define CAM_DEBUG_PATH_PRINT(A, B, C) -#endif /* CAMDEBUG && _KERNEL */ +#endif /* _KERNEL */ #endif /* _CAM_CAM_DEBUG_H */ Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/cam/cam_xpt.c Wed Jun 20 14:39:35 2012 (r237318) @@ -189,21 +189,15 @@ static struct cdevsw xpt_cdevsw = { }; /* Storage for debugging datastructures */ -#ifdef CAMDEBUG struct cam_path *cam_dpath; -#ifdef CAM_DEBUG_FLAGS u_int32_t cam_dflags = CAM_DEBUG_FLAGS; -#else -u_int32_t cam_dflags = CAM_DEBUG_NONE; -#endif TUNABLE_INT("kern.cam.dflags", &cam_dflags); SYSCTL_INT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RW, - &cam_dflags, 0, "Cam Debug Flags"); -u_int32_t cam_debug_delay; + &cam_dflags, 0, "Enabled debug flags"); +u_int32_t cam_debug_delay = CAM_DEBUG_DELAY; TUNABLE_INT("kern.cam.debug_delay", &cam_debug_delay); SYSCTL_INT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RW, - &cam_debug_delay, 0, "Cam Debug Flags"); -#endif + &cam_debug_delay, 0, "Delay in us after each debug message"); /* Our boot-time initialization hook */ static int cam_module_event_handler(module_t, int /*modeventtype_t*/, void *); @@ -2428,9 +2422,7 @@ xpt_action(union ccb *start_ccb) void xpt_action_default(union ccb *start_ccb) { -#ifdef CAMDEBUG char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; -#endif struct cam_path *path; path = start_ccb->ccb_h.path; @@ -2935,16 +2927,17 @@ xpt_action_default(union ccb *start_ccb) break; } case XPT_DEBUG: { -#ifdef CAMDEBUG -#ifdef CAM_DEBUG_DELAY - cam_debug_delay = CAM_DEBUG_DELAY; -#endif + /* Check that all request bits are supported. */ + if (start_ccb->cdbg.flags & ~CAM_DEBUG_COMPILE) { + start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; + break; + } + cam_dflags = start_ccb->cdbg.flags; if (cam_dpath != NULL) { xpt_free_path(cam_dpath); cam_dpath = NULL; } - if (cam_dflags != CAM_DEBUG_NONE) { if (xpt_create_path(&cam_dpath, xpt_periph, start_ccb->ccb_h.path_id, @@ -2962,9 +2955,6 @@ xpt_action_default(union ccb *start_ccb) cam_dpath = NULL; start_ccb->ccb_h.status = CAM_REQ_CMP; } -#else /* !CAMDEBUG */ - start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; -#endif /* CAMDEBUG */ break; } case XPT_FREEZE_QUEUE: @@ -4707,9 +4697,7 @@ xpt_config(void *arg) * Now that interrupts are enabled, go find our devices */ -#ifdef CAMDEBUG - /* Setup debugging flags and path */ -#ifdef CAM_DEBUG_BUS + /* Setup debugging path */ if (cam_dflags != CAM_DEBUG_NONE) { /* * Locking is specifically omitted here. No SIMs have @@ -4726,10 +4714,6 @@ xpt_config(void *arg) } } else cam_dpath = NULL; -#else /* !CAM_DEBUG_BUS */ - cam_dpath = NULL; -#endif /* CAM_DEBUG_BUS */ -#endif /* CAMDEBUG */ periphdriver_init(1); xpt_hold_boot(); Modified: stable/8/sys/cam/cam_xpt.h ============================================================================== --- stable/8/sys/cam/cam_xpt.h Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/cam/cam_xpt.h Wed Jun 20 14:39:35 2012 (r237318) @@ -63,28 +63,6 @@ struct async_node { SLIST_HEAD(async_list, async_node); SLIST_HEAD(periph_list, cam_periph); -#if defined(CAM_DEBUG_FLAGS) && !defined(CAMDEBUG) -#error "You must have options CAMDEBUG to use options CAM_DEBUG_FLAGS" -#endif - -/* - * In order to enable the CAM_DEBUG_* options, the user must have CAMDEBUG - * enabled. Also, the user must have either none, or all of CAM_DEBUG_BUS, - * CAM_DEBUG_TARGET, and CAM_DEBUG_LUN specified. - */ -#if defined(CAM_DEBUG_BUS) || defined(CAM_DEBUG_TARGET) \ - || defined(CAM_DEBUG_LUN) -#ifdef CAMDEBUG -#if !defined(CAM_DEBUG_BUS) || !defined(CAM_DEBUG_TARGET) \ - || !defined(CAM_DEBUG_LUN) -#error "You must define all or none of CAM_DEBUG_BUS, CAM_DEBUG_TARGET \ - and CAM_DEBUG_LUN" -#endif /* !CAM_DEBUG_BUS || !CAM_DEBUG_TARGET || !CAM_DEBUG_LUN */ -#else /* !CAMDEBUG */ -#error "You must use options CAMDEBUG if you use the CAM_DEBUG_* options" -#endif /* CAMDEBUG */ -#endif /* CAM_DEBUG_BUS || CAM_DEBUG_TARGET || CAM_DEBUG_LUN */ - void xpt_action(union ccb *new_ccb); void xpt_action_default(union ccb *new_ccb); union ccb *xpt_alloc_ccb(void); Modified: stable/8/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_sa.c Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/cam/scsi/scsi_sa.c Wed Jun 20 14:39:35 2012 (r237318) @@ -1477,10 +1477,6 @@ saregister(struct cam_periph *periph, vo softc->quirks = ((struct sa_quirk_entry *)match)->quirks; softc->last_media_blksize = ((struct sa_quirk_entry *)match)->prefblk; -#ifdef CAMDEBUG - xpt_print(periph->path, "found quirk entry %d\n", - (int) (((struct sa_quirk_entry *) match) - sa_quirk_table)); -#endif } else softc->quirks = SA_QUIRK_NONE; @@ -1793,13 +1789,11 @@ sadone(struct cam_periph *periph, union */ if (error || (softc->flags & SA_FLAG_ERR_PENDING)) cam_release_devq(done_ccb->ccb_h.path, 0, 0, 0, 0); -#ifdef CAMDEBUG if (error || bp->bio_resid) { CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("error %d resid %ld count %ld\n", error, bp->bio_resid, bp->bio_bcount)); } -#endif biofinish(bp, softc->device_stats, 0); break; } Modified: stable/8/sys/cam/scsi/scsi_target.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_target.c Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/cam/scsi/scsi_target.c Wed Jun 20 14:39:35 2012 (r237318) @@ -302,7 +302,6 @@ targioctl(struct cdev *dev, u_long cmd, break; case TARGIOCDEBUG: { -#ifdef CAMDEBUG struct ccb_debug cdbg; /* If no periph available, disallow debugging changes */ @@ -323,9 +322,6 @@ targioctl(struct cdev *dev, u_long cmd, xpt_action((union ccb *)&cdbg); cam_periph_unlock(softc->periph); status = cdbg.ccb_h.status & CAM_STATUS_MASK; -#else - status = CAM_FUNC_NOTAVAIL; -#endif break; } default: Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/conf/NOTES Wed Jun 20 14:39:35 2012 (r237318) @@ -1264,14 +1264,13 @@ device sg #Linux SCSI passthrough # CAM OPTIONS: # debugging options: -# -- NOTE -- If you specify one of the bus/target/lun options, you must -# specify them all! -# CAMDEBUG: When defined enables debugging macros -# CAM_DEBUG_BUS: Debug the given bus. Use -1 to debug all busses. -# CAM_DEBUG_TARGET: Debug the given target. Use -1 to debug all targets. -# CAM_DEBUG_LUN: Debug the given lun. Use -1 to debug all luns. -# CAM_DEBUG_FLAGS: OR together CAM_DEBUG_INFO, CAM_DEBUG_TRACE, -# CAM_DEBUG_SUBTRACE, and CAM_DEBUG_CDB +# CAMDEBUG Compile in all possible debugging. +# CAM_DEBUG_COMPILE Debug levels to compile in. +# CAM_DEBUG_FLAGS Debug levels to enable on boot. +# CAM_DEBUG_BUS Limit debugging to the given bus. +# CAM_DEBUG_TARGET Limit debugging to the given target. +# CAM_DEBUG_LUN Limit debugging to the given lun. +# CAM_DEBUG_DELAY Delay in us after printing each debug line. # # CAM_MAX_HIGHPOWER: Maximum number of concurrent high power (start unit) cmds # SCSI_NO_SENSE_STRINGS: When defined disables sense descriptions @@ -1282,10 +1281,12 @@ device sg #Linux SCSI passthrough # can be changed at boot and runtime with the # kern.cam.scsi_delay tunable/sysctl. options CAMDEBUG +options CAM_DEBUG_COMPILE=-1 +options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH) options CAM_DEBUG_BUS=-1 options CAM_DEBUG_TARGET=-1 options CAM_DEBUG_LUN=-1 -options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_TRACE|CAM_DEBUG_CDB) +options CAM_DEBUG_DELAY=1 options CAM_MAX_HIGHPOWER=4 options SCSI_NO_SENSE_STRINGS options SCSI_NO_OP_STRINGS Modified: stable/8/sys/conf/options ============================================================================== --- stable/8/sys/conf/options Wed Jun 20 14:36:09 2012 (r237317) +++ stable/8/sys/conf/options Wed Jun 20 14:39:35 2012 (r237318) @@ -298,6 +298,7 @@ MAXSSIZ opt_param.h # Generic SCSI options. CAM_MAX_HIGHPOWER opt_cam.h CAMDEBUG opt_cam.h +CAM_DEBUG_COMPILE opt_cam.h CAM_DEBUG_DELAY opt_cam.h CAM_DEBUG_BUS opt_cam.h CAM_DEBUG_TARGET opt_cam.h From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 14:47:39 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A52CC1065670; Wed, 20 Jun 2012 14:47:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90B2E8FC17; Wed, 20 Jun 2012 14:47:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KEldow048880; Wed, 20 Jun 2012 14:47:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KEldRZ048877; Wed, 20 Jun 2012 14:47:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206201447.q5KEldRZ048877@svn.freebsd.org> From: Alexander Motin Date: Wed, 20 Jun 2012 14:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237320 - stable/8/sys/cam X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 14:47:39 -0000 Author: mav Date: Wed Jun 20 14:47:39 2012 New Revision: 237320 URL: http://svn.freebsd.org/changeset/base/237320 Log: MFC r236713: Add CAM_DEBUG_INFO debug messages for periph created/invalidated/destroyed and for asyncs sent. Modified: stable/8/sys/cam/cam_periph.c stable/8/sys/cam/cam_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/cam_periph.c ============================================================================== --- stable/8/sys/cam/cam_periph.c Wed Jun 20 14:43:40 2012 (r237319) +++ stable/8/sys/cam/cam_periph.c Wed Jun 20 14:47:39 2012 (r237320) @@ -239,6 +239,7 @@ cam_periph_alloc(periph_ctor_t *periph_c goto failure; init_level++; + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph created\n")); status = periph_ctor(periph, arg); @@ -251,6 +252,7 @@ failure: /* Initialized successfully */ break; case 3: + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); xpt_remove_periph(periph); /* FALLTHROUGH */ case 2: @@ -526,6 +528,7 @@ void cam_periph_invalidate(struct cam_periph *periph) { + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); /* * We only call this routine the first time a peripheral is * invalidated. @@ -564,6 +567,7 @@ camperiphfree(struct cam_periph *periph) if (periph->periph_dtor != NULL) periph->periph_dtor(periph); xpt_remove_periph(periph); + CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { union ccb ccb; Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Wed Jun 20 14:43:40 2012 (r237319) +++ stable/8/sys/cam/cam_xpt.c Wed Jun 20 14:47:39 2012 (r237320) @@ -2928,7 +2928,7 @@ xpt_action_default(union ccb *start_ccb) } case XPT_DEBUG: { /* Check that all request bits are supported. */ - if (start_ccb->cdbg.flags & ~CAM_DEBUG_COMPILE) { + if (start_ccb->cdbg.flags & ~(CAM_DEBUG_COMPILE)) { start_ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; break; } @@ -3992,6 +3992,27 @@ xptpathid(const char *sim_name, int sim_ return (pathid); } +static const char * +xpt_async_string(u_int32_t async_code) +{ + + switch (async_code) { + case AC_BUS_RESET: return ("AC_BUS_RESET"); + case AC_UNSOL_RESEL: return ("AC_UNSOL_RESEL"); + case AC_SCSI_AEN: return ("AC_SCSI_AEN"); + case AC_SENT_BDR: return ("AC_SENT_BDR"); + case AC_PATH_REGISTERED: return ("AC_PATH_REGISTERED"); + case AC_PATH_DEREGISTERED: return ("AC_PATH_DEREGISTERED"); + case AC_FOUND_DEVICE: return ("AC_FOUND_DEVICE"); + case AC_LOST_DEVICE: return ("AC_LOST_DEVICE"); + case AC_TRANSFER_NEG: return ("AC_TRANSFER_NEG"); + case AC_INQ_CHANGED: return ("AC_INQ_CHANGED"); + case AC_GETDEV_CHANGED: return ("AC_GETDEV_CHANGED"); + case AC_CONTRACT: return ("AC_CONTRACT"); + } + return ("AC_UNKNOWN"); +} + void xpt_async(u_int32_t async_code, struct cam_path *path, void *async_arg) { @@ -4000,8 +4021,8 @@ xpt_async(u_int32_t async_code, struct c struct cam_ed *device, *next_device; mtx_assert(path->bus->sim->mtx, MA_OWNED); - - CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_async\n")); + CAM_DEBUG(path, CAM_DEBUG_TRACE | CAM_DEBUG_INFO, + ("xpt_async(%s)\n", xpt_async_string(async_code))); /* * Most async events come from a CAM interrupt context. In From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 21:28:17 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FC9F106566B; Wed, 20 Jun 2012 21:28:17 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89A3F8FC1B; Wed, 20 Jun 2012 21:28:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KLSHdt068753; Wed, 20 Jun 2012 21:28:17 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KLSHUU068751; Wed, 20 Jun 2012 21:28:17 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <201206202128.q5KLSHUU068751@svn.freebsd.org> From: Robert Noland Date: Wed, 20 Jun 2012 21:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237340 - stable/8/sys/dev/wbwd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 21:28:17 -0000 Author: rnoland Date: Wed Jun 20 21:28:17 2012 New Revision: 237340 URL: http://svn.freebsd.org/changeset/base/237340 Log: MFC r236245 Fix a typo in wbwd so that CRF5 is actually written to the data register rather than the index register. Modified: stable/8/sys/dev/wbwd/wbwd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (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/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/wbwd/wbwd.c ============================================================================== --- stable/8/sys/dev/wbwd/wbwd.c Wed Jun 20 21:10:38 2012 (r237339) +++ stable/8/sys/dev/wbwd/wbwd.c Wed Jun 20 21:28:17 2012 (r237340) @@ -638,7 +638,7 @@ wb_attach(device_t dev) */ sc->reg_1 &= ~(WB_LDN8_CRF5_KEYB_P20); write_efir_1(sc, WB_LDN8_CRF5); - write_efir_1(sc, sc->reg_1); + write_efdr_1(sc, sc->reg_1); sc->reg_2 &= ~WB_LDN8_CRF7_CLEAR_MASK; write_efir_1(sc, WB_LDN8_CRF7); From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 21:29:20 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2056E106566B; Wed, 20 Jun 2012 21:29:20 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A0E58FC1B; Wed, 20 Jun 2012 21:29:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KLTJUn068839; Wed, 20 Jun 2012 21:29:19 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KLTJE7068837; Wed, 20 Jun 2012 21:29:19 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <201206202129.q5KLTJE7068837@svn.freebsd.org> From: Robert Noland Date: Wed, 20 Jun 2012 21:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237341 - stable/8/sys/dev/wbwd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 21:29:20 -0000 Author: rnoland Date: Wed Jun 20 21:29:19 2012 New Revision: 237341 URL: http://svn.freebsd.org/changeset/base/237341 Log: MFC r236246 Add device ids for the Winbond 83627DHG-P chip and set the registers to trigger the keyboard reset line on timeout. Modified: stable/8/sys/dev/wbwd/wbwd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (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/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/wbwd/wbwd.c ============================================================================== --- stable/8/sys/dev/wbwd/wbwd.c Wed Jun 20 21:28:17 2012 (r237340) +++ stable/8/sys/dev/wbwd/wbwd.c Wed Jun 20 21:29:19 2012 (r237341) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #define WB_LDN8_CRF5 0xF5 #define WB_LDN8_CRF5_SCALE 0x08 /* 0: 1s, 1: 60s */ #define WB_LDN8_CRF5_KEYB_P20 0x04 /* 1: keyb P20 forces timeout */ +#define WB_LDN8_CRF5_KBRST 0x02 /* 1: timeout causes pin60 kbd reset */ /* CRF6: Watchdog Timeout (0 == off). Mapped to reg_timeout. */ #define WB_LDN8_CRF6 0xF6 @@ -180,6 +181,12 @@ struct winbond_vendor_device_id { .device_rev = 0x25, .descr = "Winbond 83627DHG IC ver. 5", }, + { + .vendor_id = 0x5ca3, + .device_id = 0xb0, + .device_rev = 0x73, + .descr = "Winbond 83627DHG-P", + }, }; /* @@ -637,6 +644,7 @@ wb_attach(device_t dev) * Disable all all interrupt reset sources (defaults). */ sc->reg_1 &= ~(WB_LDN8_CRF5_KEYB_P20); + sc->reg_1 |= WB_LDN8_CRF5_KBRST; write_efir_1(sc, WB_LDN8_CRF5); write_efdr_1(sc, sc->reg_1); From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 20 23:47:49 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70E79106566B; Wed, 20 Jun 2012 23:47:49 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 579DA8FC12; Wed, 20 Jun 2012 23:47:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5KNlnRd074845; Wed, 20 Jun 2012 23:47:49 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5KNln28074825; Wed, 20 Jun 2012 23:47:49 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201206202347.q5KNln28074825@svn.freebsd.org> From: Warren Block Date: Wed, 20 Jun 2012 23:47:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237347 - in stable/8: lib/libpam/modules/pam_exec sbin/atacontrol sbin/geom/class/part sbin/geom/class/raid sbin/geom/class/virstor sbin/gvinum sbin/hastctl sbin/hastd sbin/mount sbin/... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 23:47:49 -0000 Author: wblock (doc committer) Date: Wed Jun 20 23:47:48 2012 New Revision: 237347 URL: http://svn.freebsd.org/changeset/base/237347 Log: MFC r235873: Fixes to man8 groff mandoc style, usage mistakes, or typos. Includes a partial MFC of r233648 for sbin/gvinum/gvinum.8. PR: 168016 Submitted by: Nobuyuki Koganemaru Approved by: gjb (mentor) Modified: stable/8/lib/libpam/modules/pam_exec/pam_exec.8 stable/8/sbin/atacontrol/atacontrol.8 stable/8/sbin/geom/class/part/gpart.8 stable/8/sbin/geom/class/raid/graid.8 stable/8/sbin/geom/class/virstor/gvirstor.8 stable/8/sbin/gvinum/gvinum.8 stable/8/sbin/hastctl/hastctl.8 stable/8/sbin/hastd/hastd.8 stable/8/sbin/mount/mount.8 stable/8/sbin/natd/natd.8 stable/8/share/man/man8/picobsd.8 stable/8/share/man/man8/rc.8 stable/8/usr.sbin/cpucontrol/cpucontrol.8 stable/8/usr.sbin/freebsd-update/freebsd-update.8 stable/8/usr.sbin/i2c/i2c.8 stable/8/usr.sbin/rtadvctl/rtadvctl.8 stable/8/usr.sbin/rtadvd/rtadvd.8 stable/8/usr.sbin/smbmsg/smbmsg.8 stable/8/usr.sbin/wpa/ndis_events/ndis_events.8 Directory Properties: stable/8/lib/libpam/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/raid/ (props changed) stable/8/sbin/geom/class/virstor/ (props changed) stable/8/sbin/gvinum/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/rtadvctl/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/wpa/ (props changed) Modified: stable/8/lib/libpam/modules/pam_exec/pam_exec.8 ============================================================================== --- stable/8/lib/libpam/modules/pam_exec/pam_exec.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/lib/libpam/modules/pam_exec/pam_exec.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -131,10 +131,10 @@ This is useful in shell scripts for inst .Xr pam 8 , .Xr pam_sm_acct_mgmt 8 , .Xr pam_sm_authenticate 8 , -.Xr pam_sm_chauthtok 8, +.Xr pam_sm_chauthtok 8 , .Xr pam_sm_close_session 8 , .Xr pam_sm_open_session 8 , -.Xr pam_sm_setcred 8 . +.Xr pam_sm_setcred 8 .Sh AUTHORS The .Nm Modified: stable/8/sbin/atacontrol/atacontrol.8 ============================================================================== --- stable/8/sbin/atacontrol/atacontrol.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/atacontrol/atacontrol.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -367,8 +367,8 @@ You should not set a spindown timeout on or syslog logging on it as the disk will be worn out spinning down and up all the time. .Sh SEE ALSO -.Xr ata 4 -.Xr cam 4 +.Xr ata 4 , +.Xr cam 4 , .Xr camcontrol 8 .Sh HISTORY The Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/geom/class/part/gpart.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -650,7 +650,7 @@ for MBR, for GPT. .It Cm ms-ldm-metadata A partition that contains Logical Disk Manager (LDM) database. -The scheme-specifig type is +The scheme-specific type is .Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3" for GPT. .El @@ -971,7 +971,7 @@ By default mirrored volumes are shown as .Sx "PARTITION TYPES" section). If this variable set to 1 each component of the mirrored volume will be -present as independet partition. +present as independent partition. .Em NOTE : This may break a mirrored volume and lead to data damage. .El Modified: stable/8/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/8/sbin/geom/class/raid/graid.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/geom/class/raid/graid.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -294,7 +294,7 @@ Debug level of the .Nm RAID GEOM class. .It Va kern.geom.raid.idle_threshold : No 1000000 -Time in microseconds to consider a volume idle for rebuild puroses. +Time in microseconds to consider a volume idle for rebuild purposes. .It Va kern.geom.raid.name_format : No 0 Providers name format: 0 -- raid/r{num}, 1 -- raid/{label}. .It Va kern.geom.raid.read_err_thresh : No 10 Modified: stable/8/sbin/geom/class/virstor/gvirstor.8 ============================================================================== --- stable/8/sbin/geom/class/virstor/gvirstor.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/geom/class/virstor/gvirstor.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -109,7 +109,7 @@ Adds new components to existing virtual The specified virstor device must exist and be active .Pq i.e. module loaded, device present in Pa /dev . This action can be safely performed while the virstor device is in use -.Pq Qo hot Qc operation +.Pq Qo hot Qc operation . .It Cm remove Removes components from existing virtual device with the given .Ar name . @@ -264,7 +264,8 @@ change once it is set, and that the size components will always remain constant during their existence. For alternative ways to implement virtual or resizable file systems see .Xr zfs 1M , -.Xr gconcat 8 and +.Xr gconcat 8 +and .Xr growfs 8 . .Pp Note that Modified: stable/8/sbin/gvinum/gvinum.8 ============================================================================== --- stable/8/sbin/gvinum/gvinum.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/gvinum/gvinum.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -42,7 +42,7 @@ .Bl -tag -width indent .It Ic attach Ar plex volume Op Cm rename .It Ic attach Ar subdisk plex Oo Ar offset Oc Op Cm rename -Attach a plex to a volume, or a subdisk to a plex. +Attach a plex to a volume, or a subdisk to a plex. If offset is specified, the subdisk will be attached to the given offset within the plex. If rename is specified, the subdisk or plex will change name according to the @@ -58,7 +58,8 @@ All subdisks in the plex must be up for a parity check. .It Ic concat Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives Create a concatenated volume from the specified drives. -If no name is specified, a unique name will be set by gvinum. +If no name is specified, a unique name will be set by +.Ic gvinum . .It Ic create Oo Fl f Oc Op Ar description-file Create a volume as described in .Ar description-file . @@ -103,10 +104,10 @@ and .Fl V flags provide progressively more detailed output. .It Ic mirror Oo Fl fsv Oc Oo Fl n Ar name Oc Ar drives -Create a mirrored volume from the specified drives. +Create a mirrored volume from the specified drives. It requires at least a multiple of 2 drives. If no name is specified, a unique name will be set by gvinum. -If the +If the .Fl s flag is specified, a striped mirror will be created, and thus requires a multiple of 4 drives. @@ -148,8 +149,8 @@ Normally this would be done by entering EOF character. .It Ic raid5 Oo Fl fv Oc Oo Fl s Ar stripesize Oc Oo Fl n Ar name Oc Ar drives Create a RAID-5 volume from the specified drives. -If no name is specified,a unique name will be set by -.Ic gvinum. +If no name is specified, a unique name will be set by +.Ic gvinum . This organization requires at least three drives. .It Ic rename Oo Fl r Oc Ar drive | subdisk | plex | volume newname Change the name of the specified object. @@ -202,8 +203,9 @@ Terminate access to the objects, or stop if no parameters are specified. .It Ic stripe Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives Create a striped volume from the specified drives. If no name is specified, -a unique name will be set by Ic gvinum. This organization requires at least two -drives. +a unique name will be set by +.Ic gvinum . +This organization requires at least two drives. .El .Sh DESCRIPTION The @@ -278,11 +280,12 @@ objects .El .Sh EXAMPLES To create a mirror on disks /dev/ad1 and /dev/ad2, create a filesystem, mount, -unmount and then stop Ic gvinum: +unmount and then stop +.Ic gvinum : .Pp .Dl "gvinum mirror /dev/ad1 /dev/ad2" .Dl "newfs /dev/gvinum/gvinumvolume0" -.Dl "mount /dev/gvinum/gvinumvolume0 /mnt" +.Dl "mount /dev/gvinum/gvinumvolume0 /mnt" .Dl "..." .Dl "unmount /mnt" .Dl "gvinum stop" Modified: stable/8/sbin/hastctl/hastctl.8 ============================================================================== --- stable/8/sbin/hastctl/hastctl.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/hastctl/hastctl.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -211,7 +211,7 @@ nodeB# application_start .Xr ggatel 8 , .Xr hastd 8 , .Xr mount 8 , -.Xr newfs 8 . +.Xr newfs 8 .Sh AUTHORS The .Nm Modified: stable/8/sbin/hastd/hastd.8 ============================================================================== --- stable/8/sbin/hastd/hastd.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/hastd/hastd.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -223,7 +223,7 @@ nodeA# mount -o noatime /dev/hast/shared .Xr hastctl 8 , .Xr mount 8 , .Xr newfs 8 , -.Xr g_bio 9 . +.Xr g_bio 9 .Sh AUTHORS The .Nm Modified: stable/8/sbin/mount/mount.8 ============================================================================== --- stable/8/sbin/mount/mount.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/mount/mount.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -448,7 +448,7 @@ However, for the following file system t .Cm smbfs , .Cm udf , and -.Cm unionfs , +.Cm unionfs . .Nm will not call .Xr nmount 2 Modified: stable/8/sbin/natd/natd.8 ============================================================================== --- stable/8/sbin/natd/natd.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/sbin/natd/natd.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -787,7 +787,7 @@ ipfw add allow ip from any to any .Pp Here the packet from internal network to Internet goes out via .Ql sis0 -(rule number 2000) and gets catched by the +(rule number 2000) and gets caught by the .Ic globalport socket (3000). After that, either a match is found in a translation table Modified: stable/8/share/man/man8/picobsd.8 ============================================================================== --- stable/8/share/man/man8/picobsd.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/share/man/man8/picobsd.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -54,7 +54,7 @@ The most important options for common op .Fl src , .Fl init , .Fl n and -.Fl v. +.Fl v . .Pp .Bl -tag -width indent .\" @@ -95,7 +95,10 @@ subtree as necessary to subsequently bui images. .\" .It Fl -iso -Generate an ISO image, picobsd.iso, in addition to the disk image picobsd.bin +Generate an ISO image, +.Pa picobsd.iso , +in addition to the disk image +.Pa picobsd.bin . .\" .It Fl -modules Also build kernel modules. Modified: stable/8/share/man/man8/rc.8 ============================================================================== --- stable/8/share/man/man8/rc.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/share/man/man8/rc.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -253,7 +253,7 @@ The boot does not stop if such a script but a script can stop the boot if necessary by invoking the .Fn stop_boot function (from -.Xr rc.subr 8 ). +.Xr rc.subr 8 ) . .El .Pp Each script should contain Modified: stable/8/usr.sbin/cpucontrol/cpucontrol.8 ============================================================================== --- stable/8/usr.sbin/cpucontrol/cpucontrol.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/cpucontrol/cpucontrol.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -31,7 +31,7 @@ .Nm cpucontrol .Nd control utility for the .Xr cpuctl 4 -device. +device .Sh SYNOPSIS .Nm .Op Fl vh Modified: stable/8/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- stable/8/usr.sbin/freebsd-update/freebsd-update.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/freebsd-update/freebsd-update.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -62,7 +62,7 @@ Release Engineering Team, e.g., .Fx 9.0-CURRENT. .Sh OPTIONS -The following options are supported +The following options are supported: .Bl -tag -width "-f conffile" .It Fl b Ar basedir Operate on a system mounted at Modified: stable/8/usr.sbin/i2c/i2c.8 ============================================================================== --- stable/8/usr.sbin/i2c/i2c.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/i2c/i2c.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -88,7 +88,7 @@ reset the controller. .It Fl s scan the bus for devices. .It Fl v -be verbose +be verbose. .It Fl w Ar 0|8|16 device addressing width (in bits). .El Modified: stable/8/usr.sbin/rtadvctl/rtadvctl.8 ============================================================================== --- stable/8/usr.sbin/rtadvctl/rtadvctl.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/rtadvctl/rtadvctl.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -31,7 +31,8 @@ .Sh NAME .Nm rtadvctl .Nd control program for -.Xr rtadvd 8 daemon +.Xr rtadvd 8 +daemon .Sh SYNOPSIS .Nm .Op Fl v Modified: stable/8/usr.sbin/rtadvd/rtadvd.8 ============================================================================== --- stable/8/usr.sbin/rtadvd/rtadvd.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/rtadvd/rtadvd.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -140,7 +140,7 @@ option, which enables routing renumberin .It Fl p Specify an alternative file in which to store the process ID. The default is -.Pa /var/run/rtadvd.pid. +.Pa /var/run/rtadvd.pid . .It Fl R Accept router renumbering requests. If you enable it, certain IPsec setup is suggested for security reasons. Modified: stable/8/usr.sbin/smbmsg/smbmsg.8 ============================================================================== --- stable/8/usr.sbin/smbmsg/smbmsg.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/smbmsg/smbmsg.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -70,7 +70,7 @@ and writeable, respectively. The only valid additional option for this modus of operation (besides the .Fl p -option that choses the modus) is +option that chooses the modus) is .Fl f Ar dev . See below for a description. .Pp Modified: stable/8/usr.sbin/wpa/ndis_events/ndis_events.8 ============================================================================== --- stable/8/usr.sbin/wpa/ndis_events/ndis_events.8 Wed Jun 20 23:25:47 2012 (r237346) +++ stable/8/usr.sbin/wpa/ndis_events/ndis_events.8 Wed Jun 20 23:47:48 2012 (r237347) @@ -71,7 +71,7 @@ When it detects an event that was genera interface, it transmits it via UDP packet on the loopback interface, where .Xr wpa_supplicant 8 -is presumeably listening. +is presumably listening. The standard .Xr wpa_supplicant 8 distribution includes its own version of this utility for use with From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 21 08:55:08 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A71D106564A; Thu, 21 Jun 2012 08:55:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC48C8FC17; Thu, 21 Jun 2012 08:55:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5L8t7Aq000157; Thu, 21 Jun 2012 08:55:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L8t7LV000155; Thu, 21 Jun 2012 08:55:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206210855.q5L8t7LV000155@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 21 Jun 2012 08:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237362 - stable/8/lib/libc/gen X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 08:55:08 -0000 Author: kib Date: Thu Jun 21 08:55:07 2012 New Revision: 237362 URL: http://svn.freebsd.org/changeset/base/237362 Log: MFC r237061: Make sure that fstab fd is not leaked on exec. PR: kern/169023 Modified: stable/8/lib/libc/gen/fstab.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/fstab.c ============================================================================== --- stable/8/lib/libc/gen/fstab.c Thu Jun 21 08:35:47 2012 (r237361) +++ stable/8/lib/libc/gen/fstab.c Thu Jun 21 08:55:07 2012 (r237362) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -246,6 +247,8 @@ getfsfile(name) int setfsent() { + int fd; + if (_fs_fp) { rewind(_fs_fp); LineNo = 0; @@ -257,11 +260,18 @@ setfsent() else setfstab(getenv("PATH_FSTAB")); } - if ((_fs_fp = fopen(path_fstab, "r")) != NULL) { + fd = _open(path_fstab, O_RDONLY | O_CLOEXEC); + if (fd == -1) { + error(errno); + return (0); + } + _fs_fp = fdopen(fd, "r"); + if (_fs_fp != NULL) { LineNo = 0; return(1); } error(errno); + _close(fd); return(0); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 21 09:48:22 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E39AA1065790; Thu, 21 Jun 2012 09:48:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2AF78FC16; Thu, 21 Jun 2012 09:48:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5L9mLWq003153; Thu, 21 Jun 2012 09:48:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L9mLe3003151; Thu, 21 Jun 2012 09:48:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206210948.q5L9mLe3003151@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 09:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237371 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 09:48:23 -0000 Author: marius Date: Thu Jun 21 09:48:21 2012 New Revision: 237371 URL: http://svn.freebsd.org/changeset/base/237371 Log: MFC: r237234 Avoid hard sentence break. Modified: stable/8/share/man/man4/ahci.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ahci.4 ============================================================================== --- stable/8/share/man/man4/ahci.4 Thu Jun 21 09:48:13 2012 (r237370) +++ stable/8/share/man/man4/ahci.4 Thu Jun 21 09:48:21 2012 (r237371) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2011 +.Dd June 18, 2012 .Dt AHCI 4 .Os .Sh NAME @@ -99,7 +99,8 @@ setting to nonzero value limits maximum Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. .It Va hw.ahci.force setting to nonzero value forces driver attach to some known AHCI-capable -chips even if they are configured for legacy IDE emulation. Default is 1. +chips even if they are configured for legacy IDE emulation. +Default is 1. .El .Sh DESCRIPTION This driver provides the From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 21 09:57:34 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D77CF106566B; Thu, 21 Jun 2012 09:57:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1EFB8FC08; Thu, 21 Jun 2012 09:57:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5L9vYTI003638; Thu, 21 Jun 2012 09:57:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5L9vYcd003635; Thu, 21 Jun 2012 09:57:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206210957.q5L9vYcd003635@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 09:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237373 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 09:57:35 -0000 Author: marius Date: Thu Jun 21 09:57:34 2012 New Revision: 237373 URL: http://svn.freebsd.org/changeset/base/237373 Log: MFC: r237235 Document the hw.ahci.force tunable here, too, as it's also used by ataahci(4) and atanvidia(4). Modified: stable/8/share/man/man4/ata.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ata.4 ============================================================================== --- stable/8/share/man/man4/ata.4 Thu Jun 21 09:57:29 2012 (r237372) +++ stable/8/share/man/man4/ata.4 Thu Jun 21 09:57:34 2012 (r237373) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2010 +.Dd June 18, 2012 .Dt ATA 4 .Os .Sh NAME @@ -90,10 +90,14 @@ APIs and periperal drivers): .Pp The following tunables are settable from the loader: .Bl -ohang +.It Va hw.ahci.force +set to nonzero value for forcing drivers to attach to some known AHCI-capable +chips even if they are configured for legacy IDE emulation (the default is 1, +force the attach). .It Va hw.ata.ata_dma set to 1 for DMA access, 0 for PIO (default is DMA). .It Va hw.ata.ata_dma_check_80pin -set to 0 to disable the 80pin cable check (default is 1, check the cable) +set to 0 to disable the 80pin cable check (default is 1, check the cable). .It Va hw.ata.atapi_dma set to 1 for DMA access, 0 for PIO (default is DMA). .It Va hw.ata.wc From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 21 10:41:28 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 064AA106566B; Thu, 21 Jun 2012 10:41:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E42438FC08; Thu, 21 Jun 2012 10:41:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5LAfRdr007480; Thu, 21 Jun 2012 10:41:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LAfRwH007476; Thu, 21 Jun 2012 10:41:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206211041.q5LAfRwH007476@svn.freebsd.org> From: Alexander Motin Date: Thu, 21 Jun 2012 10:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237379 - stable/8/sys/dev/mvs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 10:41:28 -0000 Author: mav Date: Thu Jun 21 10:41:27 2012 New Revision: 237379 URL: http://svn.freebsd.org/changeset/base/237379 Log: MFC r236952: - Limit r214102 workaround to only x86. On arm it causes more problems then solves because of cache coherency issues. This fixes periodic error messages on console and command timeouts. - Patch SATA PHY configuration for 65nm SoCs to improve SNR same as Linux does. Modified: stable/8/sys/dev/mvs/mvs.c stable/8/sys/dev/mvs/mvs.h stable/8/sys/dev/mvs/mvs_soc.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/mvs/mvs.c ============================================================================== --- stable/8/sys/dev/mvs/mvs.c Thu Jun 21 10:28:59 2012 (r237378) +++ stable/8/sys/dev/mvs/mvs.c Thu Jun 21 10:41:27 2012 (r237379) @@ -1047,14 +1047,19 @@ mvs_crbq_intr(device_t dev) * Handle only successfull completions here. * Errors will be handled by main intr handler. */ +#if defined(__i386__) || defined(__amd64__) if (crpb->id == 0xffff && crpb->rspflg == 0xffff) { device_printf(dev, "Unfilled CRPB " "%d (%d->%d) tag %d flags %04x rs %08x\n", cin_idx, fin_idx, in_idx, slot, flags, ch->rslots); - } else if (ch->numtslots != 0 || + } else +#endif + if (ch->numtslots != 0 || (flags & EDMA_IE_EDEVERR) == 0) { +#if defined(__i386__) || defined(__amd64__) crpb->id = 0xffff; crpb->rspflg = 0xffff; +#endif if (ch->slot[slot].state >= MVS_SLOT_RUNNING) { ccb = ch->slot[slot].ccb; ccb->ataio.res.status = @@ -1998,6 +2003,39 @@ mvs_reset_to(void *arg) } static void +mvs_errata(device_t dev) +{ + struct mvs_channel *ch = device_get_softc(dev); + uint32_t val; + + if (ch->quirks & MVS_Q_SOC65) { + val = ATA_INL(ch->r_mem, SATA_PHYM3); + val &= ~(0x3 << 27); /* SELMUPF = 1 */ + val |= (0x1 << 27); + val &= ~(0x3 << 29); /* SELMUPI = 1 */ + val |= (0x1 << 29); + ATA_OUTL(ch->r_mem, SATA_PHYM3, val); + + val = ATA_INL(ch->r_mem, SATA_PHYM4); + val &= ~0x1; /* SATU_OD8 = 0 */ + val |= (0x1 << 16); /* reserved bit 16 = 1 */ + ATA_OUTL(ch->r_mem, SATA_PHYM4, val); + + val = ATA_INL(ch->r_mem, SATA_PHYM9_GEN2); + val &= ~0xf; /* TXAMP[3:0] = 8 */ + val |= 0x8; + val &= ~(0x1 << 14); /* TXAMP[4] = 0 */ + ATA_OUTL(ch->r_mem, SATA_PHYM9_GEN2, val); + + val = ATA_INL(ch->r_mem, SATA_PHYM9_GEN1); + val &= ~0xf; /* TXAMP[3:0] = 8 */ + val |= 0x8; + val &= ~(0x1 << 14); /* TXAMP[4] = 0 */ + ATA_OUTL(ch->r_mem, SATA_PHYM9_GEN1, val); + } +} + +static void mvs_reset(device_t dev) { struct mvs_channel *ch = device_get_softc(dev); @@ -2043,6 +2081,7 @@ mvs_reset(device_t dev) ATA_OUTL(ch->r_mem, EDMA_CMD, EDMA_CMD_EATARST); DELAY(25); ATA_OUTL(ch->r_mem, EDMA_CMD, 0); + mvs_errata(dev); /* Reset and reconnect PHY, */ if (!mvs_sata_phy_reset(dev)) { if (bootverbose) Modified: stable/8/sys/dev/mvs/mvs.h ============================================================================== --- stable/8/sys/dev/mvs/mvs.h Thu Jun 21 10:28:59 2012 (r237378) +++ stable/8/sys/dev/mvs/mvs.h Thu Jun 21 10:41:27 2012 (r237379) @@ -379,6 +379,10 @@ #define SATA_FISDW5 0x384 /* FIS DW5 */ #define SATA_FISDW6 0x388 /* FIS DW6 */ +#define SATA_PHYM9_GEN2 0x398 +#define SATA_PHYM9_GEN1 0x39c +#define SATA_PHYCFG_OFS 0x3a0 /* 65nm SoCs only */ + #define MVS_MAX_PORTS 8 #define MVS_MAX_SLOTS 32 @@ -534,6 +538,7 @@ struct mvs_channel { #define MVS_Q_GENIIE 4 #define MVS_Q_SOC 8 #define MVS_Q_CT 16 +#define MVS_Q_SOC65 32 int pm_level; /* power management level */ struct mvs_slot slot[MVS_MAX_SLOTS]; Modified: stable/8/sys/dev/mvs/mvs_soc.c ============================================================================== --- stable/8/sys/dev/mvs/mvs_soc.c Thu Jun 21 10:28:59 2012 (r237378) +++ stable/8/sys/dev/mvs/mvs_soc.c Thu Jun 21 10:41:27 2012 (r237379) @@ -130,6 +130,8 @@ mvs_attach(device_t dev) if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &ctlr->r_rid, RF_ACTIVE))) return ENXIO; + if (ATA_INL(ctlr->r_mem, PORT_BASE(0) + SATA_PHYCFG_OFS) != 0) + ctlr->quirks |= MVS_Q_SOC65; /* Setup our own memory management for channels. */ ctlr->sc_iomem.rm_start = rman_get_start(ctlr->r_mem); ctlr->sc_iomem.rm_end = rman_get_end(ctlr->r_mem); From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 21 11:06:31 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD31E10656E1; Thu, 21 Jun 2012 11:06:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A60158FC12; Thu, 21 Jun 2012 11:06:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5LB6VPl008670; Thu, 21 Jun 2012 11:06:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LB6VYB008666; Thu, 21 Jun 2012 11:06:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211106.q5LB6VYB008666@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 11:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237381 - in stable/8/sys/dev/usb: . serial X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 11:06:31 -0000 Author: marius Date: Thu Jun 21 11:06:31 2012 New Revision: 237381 URL: http://svn.freebsd.org/changeset/base/237381 Log: MFC: r230242, r237102, r237236 - Add support for the FT2232 based egnite Turtelizer 2 JTAG/RS232 Adapter. This includes adding support for skipping FTDI interfaces used for JTAG leaving them for userland and just attaching to the RS232 half, similarly to how the corresponding Linux drivers handles these kind of adapters. While at it, sort uftdi_devs and return BUS_PROBE_SPECIFIC (because uftdi_probe() alters the instance variables for better or worse as do other probe routines of USB drivers) instead of 0. - Remove duplicated entries for BeagleBone. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. - Remove some stray lines. Modified: stable/8/sys/dev/usb/serial/uftdi.c stable/8/sys/dev/usb/serial/uftdi_reg.h stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (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/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/8/sys/dev/usb/serial/uftdi.c Thu Jun 21 11:06:29 2012 (r237380) +++ stable/8/sys/dev/usb/serial/uftdi.c Thu Jun 21 11:06:31 2012 (r237381) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); */ /* - * FTDI FT8U100AX serial adapter driver + * FTDI FT2232x, FT8U100AX and FT8U232AM serial adapter driver */ #include @@ -81,7 +81,7 @@ SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debu #endif #define UFTDI_CONFIG_INDEX 0 -#define UFTDI_IFACE_INDEX 0 +#define UFTDI_IFACE_INDEX_JTAG 0 #define UFTDI_OBUFSIZE 64 /* bytes, cannot be increased due to * do size encoding */ @@ -102,10 +102,10 @@ struct uftdi_softc { struct mtx sc_mtx; uint32_t sc_unit; - enum uftdi_type sc_type; uint16_t sc_last_lcr; + uint8_t sc_type; uint8_t sc_iface_index; uint8_t sc_hdrlen; uint8_t sc_msr; @@ -190,7 +190,7 @@ static device_method_t uftdi_methods[] = DEVMETHOD(device_attach, uftdi_attach), DEVMETHOD(device_detach, uftdi_detach), - {0, 0} + DEVMETHOD_END }; static devclass_t uftdi_devclass; @@ -201,58 +201,61 @@ static driver_t uftdi_driver = { .size = sizeof(struct uftdi_softc), }; -DRIVER_MODULE(uftdi, uhub, uftdi_driver, uftdi_devclass, NULL, 0); +DRIVER_MODULE(uftdi, uhub, uftdi_driver, uftdi_devclass, NULL, NULL); MODULE_DEPEND(uftdi, ucom, 1, 1, 1); MODULE_DEPEND(uftdi, usb, 1, 1, 1); MODULE_VERSION(uftdi, 1); -static STRUCT_USB_HOST_ID uftdi_devs[] = { -#define UFTDI_DEV(v,p,t) \ - { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, UFTDI_TYPE_##t) } - UFTDI_DEV(ATMEL, STK541, 8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 8U232AM), - UFTDI_DEV(FALCOM, TWIST, 8U232AM), - UFTDI_DEV(FTDI, GAMMASCOUT, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U100AX, SIO), - UFTDI_DEV(FTDI, SERIAL_2232C, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_2232D, 8U232AM), - UFTDI_DEV(FTDI, BEAGLEBONE, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_4232H, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U232AM, 8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U232AM4, 8U232AM), - UFTDI_DEV(FTDI, SEMC_DSS20, 8U232AM), - UFTDI_DEV(FTDI, CFA_631, 8U232AM), - UFTDI_DEV(FTDI, CFA_632, 8U232AM), - UFTDI_DEV(FTDI, CFA_633, 8U232AM), - UFTDI_DEV(FTDI, CFA_634, 8U232AM), - UFTDI_DEV(FTDI, CFA_635, 8U232AM), - UFTDI_DEV(FTDI, USB_UIRT, 8U232AM), - UFTDI_DEV(FTDI, USBSERIAL, 8U232AM), - UFTDI_DEV(FTDI, KBS, 8U232AM), - UFTDI_DEV(FTDI, MX2_3, 8U232AM), - UFTDI_DEV(FTDI, MX4_5, 8U232AM), - UFTDI_DEV(FTDI, LK202, 8U232AM), - UFTDI_DEV(FTDI, LK204, 8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, 8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, 8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, 8U232AM), - UFTDI_DEV(FTDI, EISCOU, 8U232AM), - UFTDI_DEV(FTDI, UOPTBR, 8U232AM), - UFTDI_DEV(FTDI, EMCU2D, 8U232AM), - UFTDI_DEV(FTDI, PCMSFU, 8U232AM), - UFTDI_DEV(FTDI, EMCU2H, 8U232AM), - UFTDI_DEV(FTDI, MAXSTREAM, 8U232AM), - UFTDI_DEV(FTDI, CTI_USB_NANO_485, 8U232AM), - UFTDI_DEV(FTDI, CTI_USB_MINI_485, 8U232AM), - UFTDI_DEV(SIIG2, US2308, 8U232AM), - UFTDI_DEV(INTREPIDCS, VALUECAN, 8U232AM), - UFTDI_DEV(INTREPIDCS, NEOVI, 8U232AM), - UFTDI_DEV(BBELECTRONICS, USOTL4, 8U232AM), - UFTDI_DEV(MATRIXORBITAL, MOUA, 8U232AM), - UFTDI_DEV(MARVELL, SHEEVAPLUG, 8U232AM), - UFTDI_DEV(MELCO, PCOPRS1, 8U232AM), - UFTDI_DEV(RATOC, REXUSB60F, 8U232AM), +static const STRUCT_USB_HOST_ID uftdi_devs[] = { +#define UFTDI_DEV(v, p, i) \ + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } + UFTDI_DEV(ATMEL, STK541, UFTDI_TYPE_8U232AM), + UFTDI_DEV(BBELECTRONICS, USOTL4, UFTDI_TYPE_8U232AM), + UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, + UFTDI_TYPE_8U232AM), + UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, + UFTDI_TYPE_8U232AM), + UFTDI_DEV(FALCOM, TWIST, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_631, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_632, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_633, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_634, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CFA_635, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CTI_USB_MINI_485, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, CTI_USB_NANO_485, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, EISCOU, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, EMCU2D, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, EMCU2H, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, GAMMASCOUT, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, KBS, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, LK202, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, LK204, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, MAXSTREAM, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, MX2_3, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, MX4_5, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, PCMSFU, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SEMC_DSS20, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_2232D, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_4232H, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_8U100AX, UFTDI_TYPE_SIO), + UFTDI_DEV(FTDI, SERIAL_8U232AM, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_8U232AM4, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, TURTELIZER2, UFTDI_TYPE_8U232AM | UFTDI_FLAG_JTAG), + UFTDI_DEV(FTDI, UOPTBR, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, USBSERIAL, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, USB_UIRT, UFTDI_TYPE_8U232AM), + UFTDI_DEV(INTREPIDCS, NEOVI, UFTDI_TYPE_8U232AM), + UFTDI_DEV(INTREPIDCS, VALUECAN, UFTDI_TYPE_8U232AM), + UFTDI_DEV(MARVELL, SHEEVAPLUG, UFTDI_TYPE_8U232AM), + UFTDI_DEV(MATRIXORBITAL, MOUA, UFTDI_TYPE_8U232AM), + UFTDI_DEV(MELCO, PCOPRS1, UFTDI_TYPE_8U232AM), + UFTDI_DEV(RATOC, REXUSB60F, UFTDI_TYPE_8U232AM), + UFTDI_DEV(SIIG2, US2308, UFTDI_TYPE_8U232AM) #undef UFTDI_DEV }; @@ -260,6 +263,7 @@ static int uftdi_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + const struct usb_device_id *id; if (uaa->usb_mode != USB_MODE_HOST) { return (ENXIO); @@ -267,9 +271,24 @@ uftdi_probe(device_t dev) if (uaa->info.bConfigIndex != UFTDI_CONFIG_INDEX) { return (ENXIO); } - /* attach to all present interfaces */ - return (usbd_lookup_id_by_uaa(uftdi_devs, sizeof(uftdi_devs), uaa)); + /* + * Attach to all present interfaces unless this is a JTAG one, which + * we leave for userland. + */ + id = usbd_lookup_id_by_info(uftdi_devs, sizeof(uftdi_devs), + &uaa->info); + if (id == NULL) + return (ENXIO); + if ((id->driver_info & UFTDI_FLAG_JTAG) != 0 && + uaa->info.bIfaceIndex == UFTDI_IFACE_INDEX_JTAG) { + printf("%s: skipping JTAG interface at %u.%u\n", + device_get_name(dev), usbd_get_bus_index(uaa->device), + usbd_get_device_index(uaa->device)); + return (ENXIO); + } + uaa->driver_info = id->driver_info; + return (BUS_PROBE_SPECIFIC); } static int @@ -292,7 +311,7 @@ uftdi_attach(device_t dev) DPRINTF("\n"); sc->sc_iface_index = uaa->info.bIfaceIndex; - sc->sc_type = USB_GET_DRIVER_INFO(uaa); + sc->sc_type = USB_GET_DRIVER_INFO(uaa) & UFTDI_TYPE_MASK; switch (sc->sc_type) { case UFTDI_TYPE_SIO: @@ -561,6 +580,7 @@ static int uftdi_set_parm_soft(struct termios *t, struct uftdi_param_config *cfg, uint8_t type) { + memset(cfg, 0, sizeof(*cfg)); switch (type) { @@ -823,5 +843,6 @@ static void uftdi_poll(struct ucom_softc *ucom) { struct uftdi_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UFTDI_N_TRANSFER); } Modified: stable/8/sys/dev/usb/serial/uftdi_reg.h ============================================================================== --- stable/8/sys/dev/usb/serial/uftdi_reg.h Thu Jun 21 11:06:29 2012 (r237380) +++ stable/8/sys/dev/usb/serial/uftdi_reg.h Thu Jun 21 11:06:31 2012 (r237381) @@ -35,10 +35,12 @@ #define FTDI_PIT_SIOB 2 /* SIOB */ #define FTDI_PIT_PARALLEL 3 /* Parallel */ -enum uftdi_type { - UFTDI_TYPE_SIO, - UFTDI_TYPE_8U232AM -}; +/* Values for driver_info */ +#define UFTDI_TYPE_MASK 0x000000ff +#define UFTDI_TYPE_SIO 0x00000001 +#define UFTDI_TYPE_8U232AM 0x00000002 +#define UFTDI_FLAG_MASK 0x0000ff00 +#define UFTDI_FLAG_JTAG 0x00000100 /* * BmRequestType: 0100 0000B @@ -63,14 +65,12 @@ enum uftdi_type { * baud and data format not reset * * The Purge RX and TX buffer commands affect nothing except the buffers - * */ /* FTDI_SIO_RESET */ #define FTDI_SIO_RESET_SIO 0 #define FTDI_SIO_RESET_PURGE_RX 1 #define FTDI_SIO_RESET_PURGE_TX 2 - /* * BmRequestType: 0100 0000B * bRequest: FTDI_SIO_SET_BAUDRATE @@ -135,7 +135,6 @@ enum { #define FTDI_SIO_SET_DATA_STOP_BITS_2 (0x2 << 11) #define FTDI_SIO_SET_BREAK (0x1 << 14) - /* * BmRequestType: 0100 0000B * bRequest: FTDI_SIO_MODEM_CTRL @@ -172,7 +171,6 @@ enum { #define FTDI_SIO_SET_RTS_HIGH (2 | ( FTDI_SIO_SET_RTS_MASK << 8)) #define FTDI_SIO_SET_RTS_LOW (0 | ( FTDI_SIO_SET_RTS_MASK << 8)) - /* * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_FLOW_CTRL @@ -203,7 +201,6 @@ enum { #define FTDI_SIO_DTR_DSR_HS 0x2 #define FTDI_SIO_XON_XOFF_HS 0x4 - /* * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_EVENT_CHAR @@ -227,8 +224,6 @@ enum { * which is what normally happens. */ - - /* * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_ERROR_CHAR @@ -243,14 +238,11 @@ enum { * 0 = disabled * 1 = enabled * B9..15 Reserved - * - * * FTDI_SIO_SET_ERROR_CHAR * Set the parity error replacement character for the specified communications * port. */ - /* * BmRequestType: 1100 0000b * bRequest: FTDI_SIO_GET_MODEM_STATUS @@ -282,10 +274,7 @@ enum { #define FTDI_SIO_RI_MASK 0x40 #define FTDI_SIO_RLSD_MASK 0x80 - - /* - * * DATA FORMAT * * IN Endpoint @@ -317,8 +306,6 @@ enum { * B5 Transmitter Holding Register (THRE) * B6 Transmitter Empty (TEMT) * B7 Error in RCVR FIFO - * - * * OUT Endpoint * * This device reserves the first bytes of data on this endpoint contain the @@ -330,7 +317,6 @@ enum { * Offset Description * B0..1 Port * B2..7 Length of message - (not including Byte 0) - * */ #define FTDI_PORT_MASK 0x0f #define FTDI_MSR_MASK 0xf0 Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Thu Jun 21 11:06:29 2012 (r237380) +++ stable/8/sys/dev/usb/usbdevs Thu Jun 21 11:06:31 2012 (r237381) @@ -1600,8 +1600,9 @@ product FTDI SERIAL_8U232AM 0x6001 8U232 product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial product FTDI SERIAL_2232C 0x6010 FT2232C Dual port Serial product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial -product FTDI BEAGLEBONE 0xA6D0 BeagleBone product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial +product FTDI BEAGLEBONE 0xa6d0 BeagleBone +product FTDI TURTELIZER2 0xbdc8 egnite Turtelizer 2 JTAG/RS232 Adapter /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi product FTDI TACTRIX_OPENPORT_13S 0xcc49 OpenPort 1.3 Subaru From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 21 11:10:55 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7D1C1065675; Thu, 21 Jun 2012 11:10:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1C6A8FC17; Thu, 21 Jun 2012 11:10:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5LBAtjj008957; Thu, 21 Jun 2012 11:10:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LBAtVd008955; Thu, 21 Jun 2012 11:10:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211110.q5LBAtVd008955@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 11:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237383 - stable/8/sys/arm/at91 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 11:10:56 -0000 Author: marius Date: Thu Jun 21 11:10:55 2012 New Revision: 237383 URL: http://svn.freebsd.org/changeset/base/237383 Log: MFC: r237239 Revert the part of r236495 (MFC'ed to stable/8 in r237096) that introduced checking of SPI_SR_TXEMPTY for TX transfer completion as for reasons unknown this occasionally causes SPI_SR_RXBUFF and SPI_SR_ENDRX to not rise. In any case, once the RX part of the transfer is done it's obvious that the preceding TX part had finished and checking of SPI_SR_TXEMPTY was introduced to rule out a possible cause for the data corruption mentioned in r236495 but which didn't turn out to be the problem anyway. Modified: stable/8/sys/arm/at91/at91_spi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (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/sys/dev/e1000/ (props changed) Modified: stable/8/sys/arm/at91/at91_spi.c ============================================================================== --- stable/8/sys/arm/at91/at91_spi.c Thu Jun 21 11:10:49 2012 (r237382) +++ stable/8/sys/arm/at91/at91_spi.c Thu Jun 21 11:10:55 2012 (r237383) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include @@ -59,7 +58,6 @@ struct at91_spi_softc bus_dma_tag_t dmatag; /* bus dma tag for transfers */ bus_dmamap_t map[4]; /* Maps for the transaction */ struct sx xfer_mtx; /* Enforce one transfer at a time */ - uint32_t xfer_mask; /* Bits to wait on for completion */ uint32_t xfer_done; /* interrupt<->mainthread signaling */ }; @@ -124,7 +122,6 @@ at91_spi_attach(device_t dev) * Set up the hardware. */ - sc->xfer_mask = SPI_SR_RXBUFF | (at91_is_rm92() ? 0 : SPI_SR_TXEMPTY); WR4(sc, SPI_CR, SPI_CR_SWRST); /* "Software Reset must be Written Twice" erratum */ WR4(sc, SPI_CR, SPI_CR_SWRST); @@ -272,7 +269,6 @@ at91_spi_transfer(device_t dev, device_t struct at91_spi_softc *sc; bus_addr_t addr; int err, i, j, mode[4]; - uint32_t mask; KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, ("%s: TX/RX command sizes should be equal", __func__)); @@ -356,12 +352,11 @@ at91_spi_transfer(device_t dev, device_t * Start the transfer, wait for it to complete. */ sc->xfer_done = 0; - mask = sc->xfer_mask; - WR4(sc, SPI_IER, mask); + WR4(sc, SPI_IER, SPI_SR_RXBUFF); WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN | PDC_PTCR_RXTEN); do err = tsleep(&sc->xfer_done, PCATCH | PZERO, "at91_spi", hz); - while (sc->xfer_done != mask && err != EINTR); + while (sc->xfer_done == 0 && err != EINTR); /* * Stop the transfer and clean things up. @@ -383,20 +378,19 @@ static void at91_spi_intr(void *arg) { struct at91_spi_softc *sc; - uint32_t mask, sr; + uint32_t sr; sc = (struct at91_spi_softc*)arg; - mask = sc->xfer_mask; sr = RD4(sc, SPI_SR) & RD4(sc, SPI_IMR); - if ((sr & mask) != 0) { - sc->xfer_done |= sr & mask; - WR4(sc, SPI_IDR, mask); + if ((sr & SPI_SR_RXBUFF) != 0) { + sc->xfer_done = 1; + WR4(sc, SPI_IDR, SPI_SR_RXBUFF); wakeup(&sc->xfer_done); } - if ((sr & ~mask) != 0) { + if ((sr & ~SPI_SR_RXBUFF) != 0) { device_printf(sc->dev, "Unexpected ISR %#x\n", sr); - WR4(sc, SPI_IDR, sr & ~mask); + WR4(sc, SPI_IDR, sr & ~SPI_SR_RXBUFF); } } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 21 11:16:15 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6F401065788; Thu, 21 Jun 2012 11:16:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D4F78FC14; Thu, 21 Jun 2012 11:16:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5LBGDvw009299; Thu, 21 Jun 2012 11:16:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LBGDCB009297; Thu, 21 Jun 2012 11:16:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211116.q5LBGDCB009297@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 11:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237385 - stable/8/sys/dev/flash X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 11:16:16 -0000 Author: marius Date: Thu Jun 21 11:16:13 2012 New Revision: 237385 URL: http://svn.freebsd.org/changeset/base/237385 Log: MFC: r236496 - Loop up to 3 seconds when waiting for a device to get ready. [1] - Make the device description match the driver name. - Identify the chip variant based on the JEDEC and use that information to use the proper values for page count, offset and size instead of hardcoding a AT45DB642x with 2^N byte page support disabled. - Take advantage of bioq_takefirst(). - Given that CONTINUOUS_ARRAY_READ_HF (0x0b) command isn't even mentioned in Atmel's DataFlash Application Note, as suggested by the previous comment may not work on all all devices and actually doesn't properly on at least AT45DB321D (JEDEC 0x1f2701), rewrite at45d_task() to use CONTINUOUS_ARRAY_READ (0xe8) for reading instead. This rewrite is laid out in a way allowing to easily add support for BIO_DELETE later on. - Add support for reads and writes not starting on a page boundary. - Verify the flash content after writing. - Let at45d_task() gracefully handle errors on SPI transfers and the device not becoming ready afterwards again. [1] - Use DEVMETHOD_END. [1] - Use NULL instead of 0 for pointers. [1] Additional testing by: Ian Lepore Submitted by: Ian Lepore [1] Modified: stable/8/sys/dev/flash/at45d.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (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/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/flash/at45d.c ============================================================================== --- stable/8/sys/dev/flash/at45d.c Thu Jun 21 11:16:05 2012 (r237384) +++ stable/8/sys/dev/flash/at45d.c Thu Jun 21 11:16:13 2012 (r237385) @@ -1,5 +1,8 @@ /*- - * Copyright (c) 2006 M. Warner Losh. All rights reserved. + * Copyright (c) 2006 M. Warner Losh + * Copyright (c) 2011-2012 Ian Lepore + * Copyright (c) 2012 Marius Strobl + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,44 +45,82 @@ __FBSDID("$FreeBSD$"); #include #include "spibus_if.h" -struct at45d_softc +struct at45d_flash_ident { - struct intr_config_hook config_intrhook; - device_t dev; - struct mtx sc_mtx; - struct disk *disk; - struct proc *p; - struct bio_queue_head bio_queue; + const char *name; + uint32_t jedec; + uint16_t pagecount; + uint16_t pageoffset; + uint16_t pagesize; + uint16_t pagesize2n; }; -#define AT45D_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +struct at45d_softc +{ + struct bio_queue_head bio_queue; + struct mtx sc_mtx; + struct disk *disk; + struct proc *p; + struct intr_config_hook config_intrhook; + device_t dev; + uint16_t pagecount; + uint16_t pageoffset; + uint16_t pagesize; +}; + +#define AT45D_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define AT45D_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define AT45D_LOCK_INIT(_sc) \ +#define AT45D_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ "at45d", MTX_DEF) -#define AT45D_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define AT45D_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define AT45D_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); - -static void at45d_delayed_attach(void *xsc); +#define AT45D_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define AT45D_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define AT45D_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); + +/* bus entry points */ +static device_attach_t at45d_attach; +static device_detach_t at45d_detach; +static device_probe_t at45d_probe; /* disk routines */ -static int at45d_open(struct disk *dp); static int at45d_close(struct disk *dp); +static int at45d_open(struct disk *dp); static void at45d_strategy(struct bio *bp); static void at45d_task(void *arg); -#define CONTINUOUS_ARRAY_READ 0xE8 -#define CONTINUOUS_ARRAY_READ_HF 0x0B -#define CONTINUOUS_ARRAY_READ_LF 0x03 -#define STATUS_REGISTER_READ 0xD7 -#define PROGRAM_THROUGH_BUFFER 0x82 -#define MANUFACTURER_ID 0x9F +/* helper routines */ +static void at45d_delayed_attach(void *xsc); +static int at45d_get_mfg_info(device_t dev, uint8_t *resp); +static int at45d_get_status(device_t dev, uint8_t *status); +static int at45d_wait_ready(device_t dev, uint8_t *status); + +#define BUFFER_TRANSFER 0x53 +#define BUFFER_COMPARE 0x60 +#define PROGRAM_THROUGH_BUFFER 0x82 +#define MANUFACTURER_ID 0x9f +#define STATUS_REGISTER_READ 0xd7 +#define CONTINUOUS_ARRAY_READ 0xe8 + +/* + * A sectorsize2n != 0 is used to indicate that a device optionally supports + * 2^N byte pages. If support for the latter is enabled, the sector offset + * has to be reduced by one. + */ +static const struct at45d_flash_ident const at45d_flash_devices[] = { + { "AT45DB011B", 0x1f2200, 512, 9, 264, 256 }, + { "AT45DB021B", 0x1f2300, 1024, 9, 264, 256 }, + { "AT45DB041x", 0x1f2400, 2028, 9, 264, 256 }, + { "AT45DB081B", 0x1f2500, 4096, 9, 264, 256 }, + { "AT45DB161x", 0x1f2600, 4096, 10, 528, 512 }, + { "AT45DB321x", 0x1f2700, 8192, 10, 528, 0 }, + { "AT45DB321x", 0x1f2701, 8192, 10, 528, 512 }, + { "AT45DB642x", 0x1f2800, 8192, 11, 1056, 1024 } +}; -static uint8_t -at45d_get_status(device_t dev) +static int +at45d_get_status(device_t dev, uint8_t *status) { - uint8_t txBuf[8], rxBuf[8]; + uint8_t rxBuf[8], txBuf[8]; struct spi_command cmd; int err; @@ -90,23 +131,16 @@ at45d_get_status(device_t dev) txBuf[0] = STATUS_REGISTER_READ; cmd.tx_cmd = txBuf; cmd.rx_cmd = rxBuf; - cmd.rx_cmd_sz = 2; - cmd.tx_cmd_sz = 2; + cmd.rx_cmd_sz = cmd.tx_cmd_sz = 2; err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); - return (rxBuf[1]); -} - -static void -at45d_wait_for_device_ready(device_t dev) -{ - while (!(at45d_get_status(dev) & 0x80)) - continue; + *status = rxBuf[1]; + return (err); } static int at45d_get_mfg_info(device_t dev, uint8_t *resp) { - uint8_t txBuf[8], rxBuf[8]; + uint8_t rxBuf[8], txBuf[8]; struct spi_command cmd; int err; @@ -117,22 +151,37 @@ at45d_get_mfg_info(device_t dev, uint8_t txBuf[0] = MANUFACTURER_ID; cmd.tx_cmd = &txBuf; cmd.rx_cmd = &rxBuf; - cmd.tx_cmd_sz = 5; - cmd.rx_cmd_sz = 5; + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 5; err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); if (err) return (err); memcpy(resp, rxBuf + 1, 4); - // XXX We really should 'decode' the reply into some kind of - // XXX structure. To be generic (and not just for atmel parts) - // XXX we'd have to loop until we got a full reply. return (0); } static int +at45d_wait_ready(device_t dev, uint8_t *status) +{ + struct timeval now, tout; + int err; + + getmicrouptime(&tout); + tout.tv_sec += 3; + do { + getmicrouptime(&now); + if (now.tv_sec > tout.tv_sec) + err = ETIMEDOUT; + else + err = at45d_get_status(dev, status); + } while (err == 0 && (*status & 0x80) == 0); + return (err); +} + +static int at45d_probe(device_t dev) { - device_set_desc(dev, "AT45 Flash Family"); + + device_set_desc(dev, "AT45D Flash Family"); return (0); } @@ -156,31 +205,66 @@ at45d_attach(device_t dev) static int at45d_detach(device_t dev) { - return EIO; + + return (EBUSY) /* XXX */; } static void at45d_delayed_attach(void *xsc) { - struct at45d_softc *sc = xsc; - uint8_t buf[4]; - - at45d_get_mfg_info(sc->dev, buf); - at45d_wait_for_device_ready(sc->dev); - - sc->disk = disk_alloc(); - sc->disk->d_open = at45d_open; - sc->disk->d_close = at45d_close; - sc->disk->d_strategy = at45d_strategy; - sc->disk->d_name = "flash/spi"; - sc->disk->d_drv1 = sc; - sc->disk->d_maxsize = DFLTPHYS; - sc->disk->d_sectorsize = 1056; /* XXX */ - sc->disk->d_mediasize = 8192 * 1056; /* XXX */ - sc->disk->d_unit = device_get_unit(sc->dev); - disk_create(sc->disk, DISK_VERSION); - bioq_init(&sc->bio_queue); - kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash"); + struct at45d_softc *sc; + const struct at45d_flash_ident *ident; + u_int i; + uint32_t jedec; + uint16_t pagesize; + uint8_t buf[4], status; + + sc = xsc; + ident = NULL; + jedec = 0; + + if (at45d_wait_ready(sc->dev, &status) != 0) + device_printf(sc->dev, "Error waiting for device-ready.\n"); + else if (at45d_get_mfg_info(sc->dev, buf) != 0) + device_printf(sc->dev, "Failed to get ID.\n"); + else { + jedec = buf[0] << 16 | buf[1] << 8 | buf[2]; + for (i = 0; i < nitems(at45d_flash_devices); i++) { + if (at45d_flash_devices[i].jedec == jedec) { + ident = &at45d_flash_devices[i]; + break; + } + } + } + if (ident == NULL) + device_printf(sc->dev, "JEDEC 0x%x not in list.\n", jedec); + else { + sc->pagecount = ident->pagecount; + sc->pageoffset = ident->pageoffset; + if (ident->pagesize2n != 0 && (status & 0x01) != 0) { + sc->pageoffset -= 1; + pagesize = ident->pagesize2n; + } else + pagesize = ident->pagesize; + sc->pagesize = pagesize; + + sc->disk = disk_alloc(); + sc->disk->d_open = at45d_open; + sc->disk->d_close = at45d_close; + sc->disk->d_strategy = at45d_strategy; + sc->disk->d_name = "flash/spi"; + sc->disk->d_drv1 = sc; + sc->disk->d_maxsize = DFLTPHYS; + sc->disk->d_sectorsize = pagesize; + sc->disk->d_mediasize = pagesize * ident->pagecount; + sc->disk->d_unit = device_get_unit(sc->dev); + disk_create(sc->disk, DISK_VERSION); + bioq_init(&sc->bio_queue); + kproc_create(&at45d_task, sc, &sc->p, 0, 0, + "task: at45d flash"); + device_printf(sc->dev, "%s, %d bytes per page, %d pages\n", + ident->name, pagesize, ident->pagecount); + } config_intrhook_disestablish(&sc->config_intrhook); } @@ -188,13 +272,15 @@ at45d_delayed_attach(void *xsc) static int at45d_open(struct disk *dp) { - return 0; + + return (0); } static int at45d_close(struct disk *dp) { - return 0; + + return (0); } static void @@ -212,53 +298,132 @@ at45d_strategy(struct bio *bp) static void at45d_task(void *arg) { - struct at45d_softc *sc = (struct at45d_softc*)arg; + uint8_t rxBuf[8], txBuf[8]; + struct at45d_softc *sc; struct bio *bp; - uint8_t txBuf[8], rxBuf[8]; struct spi_command cmd; - int sz; - daddr_t block, end; device_t dev, pdev; - int err; + caddr_t buf; + u_long len, resid; + u_int addr, berr, err, offset, page; + uint8_t status; + + sc = (struct at45d_softc*)arg; + dev = sc->dev; + pdev = device_get_parent(dev); + memset(&cmd, 0, sizeof(cmd)); + memset(txBuf, 0, sizeof(txBuf)); + memset(rxBuf, 0, sizeof(rxBuf)); + cmd.tx_cmd = txBuf; + cmd.rx_cmd = rxBuf; for (;;) { - dev = sc->dev; - pdev = device_get_parent(dev); AT45D_LOCK(sc); do { - bp = bioq_first(&sc->bio_queue); + bp = bioq_takefirst(&sc->bio_queue); if (bp == NULL) msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); } while (bp == NULL); - bioq_remove(&sc->bio_queue, bp); AT45D_UNLOCK(sc); - sz = sc->disk->d_sectorsize; - end = bp->bio_pblkno + (bp->bio_bcount / sz); - for (block = bp->bio_pblkno; block < end; block++) { - char *vaddr = bp->bio_data + (block - bp->bio_pblkno) * sz; - if (bp->bio_cmd == BIO_READ) { - txBuf[0] = CONTINUOUS_ARRAY_READ_HF; - cmd.tx_cmd_sz = 5; - cmd.rx_cmd_sz = 5; - } else { + + berr = 0; + buf = bp->bio_data; + len = resid = bp->bio_bcount; + page = bp->bio_offset / sc->pagesize; + offset = bp->bio_offset % sc->pagesize; + + switch (bp->bio_cmd) { + case BIO_READ: + txBuf[0] = CONTINUOUS_ARRAY_READ; + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 8; + cmd.tx_data = cmd.rx_data = buf; + break; + case BIO_WRITE: + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 4; + cmd.tx_data = cmd.rx_data = buf; + if (resid + offset > sc->pagesize) + len = sc->pagesize - offset; + break; + default: + berr = EINVAL; + goto out; + } + + /* + * NB: for BIO_READ, this loop is only traversed once. + */ + while (resid > 0) { + if (page > sc->pagecount) { + berr = EINVAL; + goto out; + } + addr = page << sc->pageoffset; + if (bp->bio_cmd == BIO_WRITE) { + if (len != sc->pagesize) { + txBuf[0] = BUFFER_TRANSFER; + txBuf[1] = ((addr >> 16) & 0xff); + txBuf[2] = ((addr >> 8) & 0xff); + txBuf[3] = 0; + cmd.tx_data_sz = cmd.rx_data_sz = 0; + err = SPIBUS_TRANSFER(pdev, dev, + &cmd); + if (err == 0) + err = at45d_wait_ready(dev, + &status); + if (err != 0) { + berr = EIO; + goto out; + } + } txBuf[0] = PROGRAM_THROUGH_BUFFER; - cmd.tx_cmd_sz = 4; - cmd.rx_cmd_sz = 4; } - // XXX only works on certain devices... Fixme - txBuf[1] = ((block >> 5) & 0xFF); - txBuf[2] = ((block << 3) & 0xF8); - txBuf[3] = 0; - txBuf[4] = 0; - cmd.tx_cmd = txBuf; - cmd.rx_cmd = rxBuf; - cmd.tx_data = vaddr; - cmd.tx_data_sz = sz; - cmd.rx_data = vaddr; - cmd.rx_data_sz = sz; + + addr += offset; + txBuf[1] = ((addr >> 16) & 0xff); + txBuf[2] = ((addr >> 8) & 0xff); + txBuf[3] = (addr & 0xff); + cmd.tx_data_sz = cmd.rx_data_sz = len; err = SPIBUS_TRANSFER(pdev, dev, &cmd); - // XXX err check? + if (err == 0 && bp->bio_cmd != BIO_READ) + err = at45d_wait_ready(dev, &status); + if (err != 0) { + berr = EIO; + goto out; + } + if (bp->bio_cmd == BIO_WRITE) { + addr = page << sc->pageoffset; + txBuf[0] = BUFFER_COMPARE; + txBuf[1] = ((addr >> 16) & 0xff); + txBuf[2] = ((addr >> 8) & 0xff); + txBuf[3] = 0; + cmd.tx_data_sz = cmd.rx_data_sz = 0; + err = SPIBUS_TRANSFER(pdev, dev, &cmd); + if (err == 0) + err = at45d_wait_ready(dev, &status); + if (err != 0 || (status & 0x40) != 0) { + device_printf(dev, "comparing page " + "%d failed (status=0x%x)\n", addr, + status); + berr = EIO; + goto out; + } + } + page++; + buf += len; + offset = 0; + resid -= len; + if (resid > sc->pagesize) + len = sc->pagesize; + else + len = resid; + cmd.tx_data = cmd.rx_data = buf; + } + out: + if (berr != 0) { + bp->bio_flags |= BIO_ERROR; + bp->bio_error = berr; } + bp->bio_resid = resid; biodone(bp); } } @@ -271,7 +436,7 @@ static device_method_t at45d_methods[] = DEVMETHOD(device_attach, at45d_attach), DEVMETHOD(device_detach, at45d_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t at45d_driver = { @@ -280,4 +445,4 @@ static driver_t at45d_driver = { sizeof(struct at45d_softc), }; -DRIVER_MODULE(at45d, spibus, at45d_driver, at45d_devclass, 0, 0); +DRIVER_MODULE(at45d, spibus, at45d_driver, at45d_devclass, NULL, NULL); From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 21 12:10:09 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2B89106567E; Thu, 21 Jun 2012 12:10:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6DB18FC12; Thu, 21 Jun 2012 12:10:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5LCA9di011788; Thu, 21 Jun 2012 12:10:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LCA9P3011786; Thu, 21 Jun 2012 12:10:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201206211210.q5LCA9P3011786@svn.freebsd.org> From: Marius Strobl Date: Thu, 21 Jun 2012 12:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237389 - stable/8/sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 12:10:10 -0000 Author: marius Date: Thu Jun 21 12:10:09 2012 New Revision: 237389 URL: http://svn.freebsd.org/changeset/base/237389 Log: MFC: r231617 Add ARM relocations types used for thread-local storage Reviewed by: cognet Modified: stable/8/sys/sys/elf_common.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (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/sys/dev/e1000/ (props changed) Modified: stable/8/sys/sys/elf_common.h ============================================================================== --- stable/8/sys/sys/elf_common.h Thu Jun 21 12:10:08 2012 (r237388) +++ stable/8/sys/sys/elf_common.h Thu Jun 21 12:10:09 2012 (r237389) @@ -630,6 +630,10 @@ typedef struct { #define R_ARM_THM_SWI8 14 #define R_ARM_XPC25 15 #define R_ARM_THM_XPC22 16 +/* TLS relocations */ +#define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */ +#define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */ +#define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */ #define R_ARM_COPY 20 /* Copy data from shared object. */ #define R_ARM_GLOB_DAT 21 /* Set GOT entry to data address. */ #define R_ARM_JUMP_SLOT 22 /* Set GOT entry to code address. */ From owner-svn-src-stable-8@FreeBSD.ORG Thu Jun 21 14:55:35 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B719210657A2; Thu, 21 Jun 2012 14:55:35 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 973D78FC1A; Thu, 21 Jun 2012 14:55:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5LEtZTN019444; Thu, 21 Jun 2012 14:55:35 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5LEtZOD019442; Thu, 21 Jun 2012 14:55:35 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201206211455.q5LEtZOD019442@svn.freebsd.org> From: Fabien Thomas Date: Thu, 21 Jun 2012 14:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237400 - stable/8/sys/dev/pci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 14:55:35 -0000 Author: fabient Date: Thu Jun 21 14:55:35 2012 New Revision: 237400 URL: http://svn.freebsd.org/changeset/base/237400 Log: MFC r221839: Allow direct children of PCI-ISA bridges to allocate resources from the parent PCI bus. Heavily inspired by jhb@ and a similar implementation present in sys/dev/pci/vga_pci.c. Modified: stable/8/sys/dev/pci/isa_pci.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/pci/isa_pci.c ============================================================================== --- stable/8/sys/dev/pci/isa_pci.c Thu Jun 21 14:37:05 2012 (r237399) +++ stable/8/sys/dev/pci/isa_pci.c Thu Jun 21 14:55:35 2012 (r237400) @@ -45,12 +45,22 @@ __FBSDID("$FreeBSD$"); #include #include -static int isab_probe(device_t dev); +#include +#include +#include + +static int isab_pci_probe(device_t dev); +static int isab_pci_attach(device_t dev); +static struct resource * isab_pci_alloc_resource(device_t dev, + device_t child, int type, int *rid, u_long start, u_long end, u_long count, + u_int flags); +static int isab_pci_release_resource(device_t dev, device_t child, + int type, int rid, struct resource *r); static device_method_t isab_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, isab_probe), - DEVMETHOD(device_attach, isab_attach), + DEVMETHOD(device_probe, isab_pci_probe), + DEVMETHOD(device_attach, isab_pci_attach), DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), @@ -58,8 +68,8 @@ static device_method_t isab_methods[] = /* Bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_alloc_resource, isab_pci_alloc_resource), + DEVMETHOD(bus_release_resource, isab_pci_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), @@ -68,10 +78,19 @@ static device_method_t isab_methods[] = DEVMETHOD_END }; +struct isab_pci_resource { + struct resource *ip_res; + int ip_refs; +}; + +struct isab_pci_softc { + struct isab_pci_resource isab_pci_res[PCIR_MAX_BAR_0 + 1]; +}; + static driver_t isab_driver = { "isab", isab_methods, - 0, + sizeof(struct isab_pci_softc), }; DRIVER_MODULE(isab, pci, isab_driver, isab_devclass, 0, 0); @@ -81,7 +100,7 @@ DRIVER_MODULE(isab, pci, isab_driver, is * report themselves. */ static int -isab_probe(device_t dev) +isab_pci_probe(device_t dev) { int matched = 0; @@ -139,3 +158,88 @@ isab_probe(device_t dev) } return(ENXIO); } + +static int +isab_pci_attach(device_t dev) +{ + + bus_generic_probe(dev); + return (isab_attach(dev)); +} + +static struct resource * +isab_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct isab_pci_softc *sc; + int bar; + + if (device_get_parent(child) != dev) + return bus_generic_alloc_resource(dev, child, type, rid, start, + end, count, flags); + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + /* + * For BARs, we cache the resource so that we only allocate it + * from the PCI bus once. + */ + bar = PCI_RID2BAR(*rid); + if (bar < 0 || bar > PCIR_MAX_BAR_0) + return (NULL); + sc = device_get_softc(dev); + if (sc->isab_pci_res[bar].ip_res == NULL) + sc->isab_pci_res[bar].ip_res = bus_alloc_resource(dev, type, + rid, start, end, count, flags); + if (sc->isab_pci_res[bar].ip_res != NULL) + sc->isab_pci_res[bar].ip_refs++; + return (sc->isab_pci_res[bar].ip_res); + } + + return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, + start, end, count, flags)); +} + +static int +isab_pci_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct isab_pci_softc *sc; + int bar, error; + + if (device_get_parent(child) != dev) + return bus_generic_release_resource(dev, child, type, rid, r); + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + /* + * For BARs, we release the resource from the PCI bus + * when the last child reference goes away. + */ + bar = PCI_RID2BAR(rid); + if (bar < 0 || bar > PCIR_MAX_BAR_0) + return (EINVAL); + sc = device_get_softc(dev); + if (sc->isab_pci_res[bar].ip_res == NULL) + return (EINVAL); + KASSERT(sc->isab_pci_res[bar].ip_res == r, + ("isa_pci resource mismatch")); + if (sc->isab_pci_res[bar].ip_refs > 1) { + sc->isab_pci_res[bar].ip_refs--; + return (0); + } + KASSERT(sc->isab_pci_res[bar].ip_refs > 0, + ("isa_pci resource reference count underflow")); + error = bus_release_resource(dev, type, rid, r); + if (error == 0) { + sc->isab_pci_res[bar].ip_res = NULL; + sc->isab_pci_res[bar].ip_refs = 0; + } + return (error); + } + + return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, type, + rid, r)); +} From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 22 05:23:49 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EBCD110657A3; Fri, 22 Jun 2012 05:23:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D60EA8FC0A; Fri, 22 Jun 2012 05:23:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5M5Nnc6057534; Fri, 22 Jun 2012 05:23:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5Nnd0057532; Fri, 22 Jun 2012 05:23:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220523.q5M5Nnd0057532@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237416 - stable/8/usr.sbin/kldxref X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:23:50 -0000 Author: eadler Date: Fri Jun 22 05:23:49 2012 New Revision: 237416 URL: http://svn.freebsd.org/changeset/base/237416 Log: MFC r237258: Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva (implicit) Modified: stable/8/usr.sbin/kldxref/ef.c Directory Properties: stable/8/usr.sbin/kldxref/ (props changed) Modified: stable/8/usr.sbin/kldxref/ef.c ============================================================================== --- stable/8/usr.sbin/kldxref/ef.c Fri Jun 22 05:23:39 2012 (r237415) +++ stable/8/usr.sbin/kldxref/ef.c Fri Jun 22 05:23:49 2012 (r237416) @@ -532,7 +532,7 @@ ef_open(const char *filename, struct elf int error; int phlen, res; int nsegs; - Elf_Phdr *phdr, *phdyn, *phphdr, *phlimit; + Elf_Phdr *phdr, *phdyn, *phlimit; if (filename == NULL) return EFTYPE; @@ -576,7 +576,6 @@ ef_open(const char *filename, struct elf phlimit = phdr + hdr->e_phnum; nsegs = 0; phdyn = NULL; - phphdr = NULL; while (phdr < phlimit) { if (verbose > 1) ef_print_phdr(phdr); @@ -590,7 +589,6 @@ ef_open(const char *filename, struct elf ef->ef_segs[nsegs++] = phdr; break; case PT_PHDR: - phphdr = phdr; break; case PT_DYNAMIC: phdyn = phdr; From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 22 05:36:43 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71BDD1065673; Fri, 22 Jun 2012 05:36:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51ECA8FC16; Fri, 22 Jun 2012 05:36:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5M5ahLG058269; Fri, 22 Jun 2012 05:36:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5ahAb058266; Fri, 22 Jun 2012 05:36:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220536.q5M5ahAb058266@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237419 - in stable/8: lib/libncp sys/netncp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:36:43 -0000 Author: eadler Date: Fri Jun 22 05:36:42 2012 New Revision: 237419 URL: http://svn.freebsd.org/changeset/base/237419 Log: MFC r236376: Add characters mapping for codepages used in Germany. PR: bin/163847 Approved by: cperciva (implicit) Modified: stable/8/lib/libncp/ncpl_nls.c stable/8/sys/netncp/ncp_nls.h Directory Properties: stable/8/lib/libncp/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/lib/libncp/ncpl_nls.c ============================================================================== --- stable/8/lib/libncp/ncpl_nls.c Fri Jun 22 05:36:37 2012 (r237418) +++ stable/8/lib/libncp/ncpl_nls.c Fri Jun 22 05:36:42 2012 (r237419) @@ -200,6 +200,79 @@ static u_int8_t se_unix2nw[] = { 0x9c, 0x9b, 0x87, 0x98, 0x9d, 0x99, 0x97, 0x9a }; +/* + * Characters mapping for codepages used in Germany. + */ +static u_int8_t de_nw2unix[] = { + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0xb6, 0xa7, 0x5f, 0x5f, /* 0x10 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0xc7, 0xfc, 0xe9, 0xe2, 0xe4, 0xe0, 0xe5, 0xe7, /* 0x80 */ + 0xea, 0xeb, 0xe8, 0xef, 0xee, 0xec, 0xc4, 0xc5, + 0xc9, 0xe6, 0xc6, 0xf4, 0xf6, 0xf2, 0xfb, 0xf9, /* 0x90 */ + 0xff, 0xd6, 0xdc, 0xa2, 0xa3, 0xa5, 0x5f, 0x5f, + 0xe1, 0xed, 0xf3, 0xfa, 0xf1, 0xd1, 0xaa, 0xba, /* 0xA0 */ + 0xbf, 0x5f, 0xac, 0xbd, 0xbc, 0xa1, 0xab, 0xbb, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xB0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xC0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xD0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0xdf, 0x5f, 0x5f, 0x5f, 0x5f, 0xb5, 0x5f, /* 0xE0 */ + 0x5f, 0x5f, 0x5f, 0xf0, 0x5f, 0xf8, 0x5f, 0x5f, + 0x5f, 0xb1, 0x5f, 0x5f, 0x5f, 0x5f, 0xf7, 0x5f, /* 0xF0 */ + 0xb0, 0x5f, 0xb7, 0x5f, 0x5f, 0xb2, 0x5f, 0xa0 +}; + +static u_int8_t de_unix2nw[] = { + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x10 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x80 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x90 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0xff, 0xad, 0x9b, 0x9c, 0x5f, 0x9d, 0x5f, 0x15, /* 0xA0 */ + 0x5f, 0x5f, 0xa6, 0xae, 0xaa, 0x5f, 0x5f, 0x5f, + 0xf8, 0xf1, 0xfd, 0x5f, 0x5f, 0xe6, 0x14, 0xfa, /* 0xB0 */ + 0x5f, 0x5f, 0xa7, 0xaf, 0xac, 0xab, 0x5f, 0xa8, + 0x5f, 0x5f, 0x5f, 0x5f, 0x8e, 0x8f, 0x92, 0x80, /* 0xC0 */ + 0x5f, 0x90, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, + 0x5f, 0xa5, 0x5f, 0x5f, 0x5f, 0x5f, 0x99, 0x5f, /* 0xD0 */ + 0x5f, 0x5f, 0x5f, 0x5f, 0x9a, 0x5f, 0x5f, 0xe1, + 0x85, 0xa0, 0x83, 0x5f, 0x84, 0x86, 0x91, 0x87, /* 0xE0 */ + 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, + 0xeb, 0xa4, 0x95, 0xa2, 0x93, 0x5f, 0x94, 0xf6, /* 0xF0 */ + 0xed, 0x97, 0xa3, 0x96, 0x81, 0x5f, 0x5f, 0x98 +}; + static u_int8_t def2lower[256]; static u_int8_t def2upper[256]; @@ -225,6 +298,9 @@ static struct ncp_nlsdesc ncp_nlslist[] {NCP_NLS_SE, NCP_NLS_SE_NAME, {def2lower, def2upper, se_nw2unix, se_unix2nw, 0} }, + {NCP_NLS_DE, NCP_NLS_DE_NAME, + {def2lower, def2upper, de_nw2unix, de_unix2nw, 0} + }, {0} }; Modified: stable/8/sys/netncp/ncp_nls.h ============================================================================== --- stable/8/sys/netncp/ncp_nls.h Fri Jun 22 05:36:37 2012 (r237418) +++ stable/8/sys/netncp/ncp_nls.h Fri Jun 22 05:36:42 2012 (r237419) @@ -58,9 +58,11 @@ struct ncp_nlstables { #define NCP_NLS_AS_IS 1 #define NCP_NLS_AS_IS_NAME "asis" #define NCP_NLS_KOI_866 2 -#define NCP_NLS_SE 3 #define NCP_NLS_KOI_866_NAME "koi2cp866" +#define NCP_NLS_SE 3 #define NCP_NLS_SE_NAME "se" +#define NCP_NLS_DE 4 +#define NCP_NLS_DE_NAME "de" extern struct ncp_nlstables ncp_nls; /* active nls */ From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 22 05:40:16 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66C3F106566B; Fri, 22 Jun 2012 05:40:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5181C8FC19; Fri, 22 Jun 2012 05:40:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5M5eGKe058602; Fri, 22 Jun 2012 05:40:16 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5eGq9058600; Fri, 22 Jun 2012 05:40:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220540.q5M5eGq9058600@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237423 - stable/8/usr.sbin/kbdmap X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:40:16 -0000 Author: eadler Date: Fri Jun 22 05:40:15 2012 New Revision: 237423 URL: http://svn.freebsd.org/changeset/base/237423 Log: MFC r237257: Remove variables which are initialized but never used thereafter reported by gcc46 warning PR: bin/163847 Approved by: cperciva (implicit) Modified: stable/8/usr.sbin/kbdmap/kbdmap.c Directory Properties: stable/8/usr.sbin/kbdmap/ (props changed) Modified: stable/8/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- stable/8/usr.sbin/kbdmap/kbdmap.c Fri Jun 22 05:40:15 2012 (r237422) +++ stable/8/usr.sbin/kbdmap/kbdmap.c Fri Jun 22 05:40:15 2012 (r237423) @@ -327,7 +327,6 @@ show_dialog(struct keymap **km_sorted, i FILE *fp; char *cmd, *dialog; char tmp_name[] = "/tmp/_kbd_lang.XXXX"; - const char *ext; int fd, i, size; fd = mkstemp(tmp_name); @@ -339,8 +338,6 @@ show_dialog(struct keymap **km_sorted, i asprintf(&dialog, "/usr/bin/dialog --clear --title \"Keyboard Menu\" " "--menu \"%s\" -1 -1 10", menu); - ext = extract_name(dir); - /* start right font, assume that current font is equal * to default font in /etc/rc.conf * From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 22 05:46:44 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99BD41065680; Fri, 22 Jun 2012 05:46:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 845408FC1D; Fri, 22 Jun 2012 05:46:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5M5ki8t059061; Fri, 22 Jun 2012 05:46:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5M5kiWn059059; Fri, 22 Jun 2012 05:46:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206220546.q5M5kiWn059059@svn.freebsd.org> From: Eitan Adler Date: Fri, 22 Jun 2012 05:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237426 - stable/8/usr.sbin/ifmcstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 05:46:44 -0000 Author: eadler Date: Fri Jun 22 05:46:43 2012 New Revision: 237426 URL: http://svn.freebsd.org/changeset/base/237426 Log: MFC r237256: Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva (implicit) Modified: stable/8/usr.sbin/ifmcstat/ifmcstat.c Directory Properties: stable/8/usr.sbin/ifmcstat/ (props changed) Modified: stable/8/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- stable/8/usr.sbin/ifmcstat/ifmcstat.c Fri Jun 22 05:44:38 2012 (r237425) +++ stable/8/usr.sbin/ifmcstat/ifmcstat.c Fri Jun 22 05:46:43 2012 (r237426) @@ -388,7 +388,6 @@ ll_addrlist(struct ifaddr *ifap) struct sockaddr sa; struct sockaddr_dl sdl; struct ifaddr *ifap0; - int error; if (af && af != AF_LINK) return; @@ -405,7 +404,7 @@ ll_addrlist(struct ifaddr *ifap) if (sdl.sdl_alen == 0) goto nextifap; addrbuf[0] = '\0'; - error = getnameinfo((struct sockaddr *)&sdl, sdl.sdl_len, + getnameinfo((struct sockaddr *)&sdl, sdl.sdl_len, addrbuf, sizeof(addrbuf), NULL, 0, NI_NUMERICHOST); printf("\tlink %s\n", addrbuf); nextifap: @@ -428,7 +427,7 @@ ll_addrlist(struct ifaddr *ifap) goto nextmulti; KREAD(ifm.ifma_addr, &sdl, struct sockaddr_dl); addrbuf[0] = '\0'; - error = getnameinfo((struct sockaddr *)&sdl, + getnameinfo((struct sockaddr *)&sdl, sdl.sdl_len, addrbuf, sizeof(addrbuf), NULL, 0, NI_NUMERICHOST); printf("\t\tgroup %s refcnt %d\n", From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 22 16:31:01 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C2A01065691; Fri, 22 Jun 2012 16:31:01 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D7BD8FC17; Fri, 22 Jun 2012 16:31:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5MGV122088414; Fri, 22 Jun 2012 16:31:01 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MGV1b4088411; Fri, 22 Jun 2012 16:31:01 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201206221631.q5MGV1b4088411@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 22 Jun 2012 16:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237447 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 16:31:01 -0000 Author: gnn Date: Fri Jun 22 16:31:00 2012 New Revision: 237447 URL: http://svn.freebsd.org/changeset/base/237447 Log: MFC 230063 Clean up a switch statement for uncore events on Westmere processors. Submitted by: Davide Italiano Reviewed by: gnn Modified: stable/8/sys/dev/hwpmc/hwpmc_uncore.c stable/8/sys/dev/hwpmc/hwpmc_uncore.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (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/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/hwpmc/hwpmc_uncore.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_uncore.c Fri Jun 22 16:20:13 2012 (r237446) +++ stable/8/sys/dev/hwpmc/hwpmc_uncore.c Fri Jun 22 16:31:00 2012 (r237447) @@ -974,26 +974,18 @@ ucp_start_pmc(int cpu, int ri) /* Event specific configuration. */ switch (pm->pm_event) { case PMC_EV_UCP_EVENT_0CH_04H_E: + case PMC_EV_UCP_EVENT_0CH_08H_E: wrmsr(MSR_GQ_SNOOP_MESF,0x2); break; case PMC_EV_UCP_EVENT_0CH_04H_F: + case PMC_EV_UCP_EVENT_0CH_08H_F: wrmsr(MSR_GQ_SNOOP_MESF,0x8); break; case PMC_EV_UCP_EVENT_0CH_04H_M: - wrmsr(MSR_GQ_SNOOP_MESF,0x1); - break; - case PMC_EV_UCP_EVENT_0CH_04H_S: - wrmsr(MSR_GQ_SNOOP_MESF,0x4); - break; - case PMC_EV_UCP_EVENT_0CH_08H_E: - wrmsr(MSR_GQ_SNOOP_MESF,0x2); - break; - case PMC_EV_UCP_EVENT_0CH_08H_F: - wrmsr(MSR_GQ_SNOOP_MESF,0x8); - break; case PMC_EV_UCP_EVENT_0CH_08H_M: wrmsr(MSR_GQ_SNOOP_MESF,0x1); break; + case PMC_EV_UCP_EVENT_0CH_04H_S: case PMC_EV_UCP_EVENT_0CH_08H_S: wrmsr(MSR_GQ_SNOOP_MESF,0x4); break; Modified: stable/8/sys/dev/hwpmc/hwpmc_uncore.h ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_uncore.h Fri Jun 22 16:20:13 2012 (r237446) +++ stable/8/sys/dev/hwpmc/hwpmc_uncore.h Fri Jun 22 16:31:00 2012 (r237447) @@ -87,7 +87,6 @@ struct pmc_md_ucp_op_pmcallocate { #define UC_GLOBAL_CTRL 0x391 #define UC_GLOBAL_OVF_CTRL 0x393 - #define UC_GLOBAL_STATUS_FLAG_CLRCHG (1ULL << 63) #define UC_GLOBAL_STATUS_FLAG_OVFPMI (1ULL << 61) #define UC_GLOBAL_CTRL_FLAG_FRZ (1ULL << 63) From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 22 19:19:54 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03B6A106564A; Fri, 22 Jun 2012 19:19:54 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E19738FC0C; Fri, 22 Jun 2012 19:19:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5MJJrI7095689; Fri, 22 Jun 2012 19:19:53 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MJJr9M095687; Fri, 22 Jun 2012 19:19:53 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201206221919.q5MJJr9M095687@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 22 Jun 2012 19:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237454 - stable/8/lib/libthr/thread X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 19:19:54 -0000 Author: gnn Date: Fri Jun 22 19:19:53 2012 New Revision: 237454 URL: http://svn.freebsd.org/changeset/base/237454 Log: MFC: 234424 Set SIGCANCEL to SIGTHR as part of some cleanup of DTrace code. Reviewed by: davidxu@ Modified: stable/8/lib/libthr/thread/thr_private.h Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_private.h ============================================================================== --- stable/8/lib/libthr/thread/thr_private.h Fri Jun 22 19:09:15 2012 (r237453) +++ stable/8/lib/libthr/thread/thr_private.h Fri Jun 22 19:19:53 2012 (r237454) @@ -61,7 +61,7 @@ typedef TAILQ_HEAD(atfork_head, pthread_ TAILQ_HEAD(mutex_queue, pthread_mutex); /* Signal to do cancellation */ -#define SIGCANCEL 32 +#define SIGCANCEL SIGTHR /* * Kernel fatal error handler macro. From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 22 18:41:47 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33FDA1065676; Fri, 22 Jun 2012 18:41:47 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1-6.sentex.ca [IPv6:2607:f3e0:0:1::12]) by mx1.freebsd.org (Postfix) with ESMTP id A95B48FC1B; Fri, 22 Jun 2012 18:41:46 +0000 (UTC) Received: from [192.168.43.26] (pyroxene.sentex.ca [199.212.134.18]) by smarthost1.sentex.ca (8.14.5/8.14.4) with ESMTP id q5MIfiXc095858; Fri, 22 Jun 2012 14:41:44 -0400 (EDT) (envelope-from mike@sentex.net) Message-ID: <4FE4BC5F.30002@sentex.net> Date: Fri, 22 Jun 2012 14:41:35 -0400 From: Mike Tancsa Organization: Sentex Communications User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Alexander Motin References: <201206201439.q5KEdaF9048424@svn.freebsd.org> In-Reply-To: <201206201439.q5KEdaF9048424@svn.freebsd.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.72 on 64.7.153.18 X-Mailman-Approved-At: Fri, 22 Jun 2012 20:16:30 +0000 Cc: FreeBSD-STABLE Mailing List Subject: Re: svn commit: r237318 - in stable/8: share/man/man4 sys/cam sys/cam/scsi sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 18:41:47 -0000 On 6/20/2012 10:39 AM, Alexander Motin wrote: > Author: mav > Date: Wed Jun 20 14:39:35 2012 > New Revision: 237318 > URL: http://svn.freebsd.org/changeset/base/237318 > > Log: > MFC r236712: > To make CAM debugging easier, compile in some debug flags (CAM_DEBUG_INFO, > CAM_DEBUG_CDB, CAM_DEBUG_PERIPH and CAM_DEBUG_PROBE) by default. > List of these flags can be modified with CAM_DEBUG_COMPILE kernel option. > CAMDEBUG kernel option still enables all possible debug, if not overriden. > > Additional 50KB of kernel size is a good price for the ability to debug > problems without rebuilding the kernel. In case where size is important, > debugging can be compiled out by setting CAM_DEBUG_COMPILE option to 0. Hi, Not sure if this is the commit or not, but a kernel from the 18th seems to function normally, and a kernel from today has a great deal of messages like the ones below. I also dont know if this is just exposing an existing bug in the driver that was upto now hidden ? Boot time, I see the following (probe1:twa0:0:1:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe1:twa0:0:1:0): CAM status: Invalid Target ID (probe1:twa0:0:1:0): Error 22, Unretryable error (probe2:twa0:0:2:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe2:twa0:0:2:0): CAM status: Invalid Target ID (probe2:twa0:0:2:0): Error 22, Unretryable error (probe3:twa0:0:3:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe3:twa0:0:3:0): CAM status: Invalid Target ID (probe3:twa0:0:3:0): Error 22, Unretryable error (probe4:twa0:0:4:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe4:twa0:0:4:0): CAM status: Invalid Target ID (probe4:twa0:0:4:0): Error 22, Unretryable error (probe15:twa0:0:15:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe15:twa0:0:15:0): CAM status: Invalid Target ID (probe15:twa0:0:15:0): Error 22, Unretryable error (probe16:twa0:0:16:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe16:twa0:0:16:0): CAM status: Invalid Target ID (probe16:twa0:0:16:0): Error 22, Unretryable error (probe17:twa0:0:17:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe17:twa0:0:17:0): CAM status: Invalid Target ID (probe17:twa0:0:17:0): Error 22, Unretryable error (probe18:twa0:0:18:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe18:twa0:0:18:0): CAM status: Invalid Target ID (probe18:twa0:0:18:0): Error 22, Unretryable error (probe19:twa0:0:19:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe19:twa0:0:19:0): CAM status: Invalid Target ID (probe19:twa0:0:19:0): Error 22, Unretryable error (probe20:twa0:0:20:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe20:twa0:0:20:0): CAM status: Invalid Target ID (probe20:twa0:0:20:0): Error 22, Unretryable error (probe21:twa0:0:21:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe21:twa0:0:21:0): CAM status: Invalid Target ID (probe21:twa0:0:21:0): Error 22, Unretryable error (probe22:twa0:0:22:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe22:twa0:0:22:0): CAM status: Invalid Target ID (probe22:twa0:0:22:0): Error 22, Unretryable error (probe23:twa0:0:23:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe23:twa0:0:23:0): CAM status: Invalid Target ID (probe23:twa0:0:23:0): Error 22, Unretryable error (probe24:twa0:0:24:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe24:twa0:0:24:0): CAM status: Invalid Target ID (probe24:twa0:0:24:0): Error 22, Unretryable error (probe25:twa0:0:25:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe25:twa0:0:25:0): CAM status: Invalid Target ID (probe25:twa0:0:25:0): Error 22, Unretryable error (probe26:twa0:0:26:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe26:twa0:0:26:0): CAM status: Invalid Target ID (probe26:twa0:0:26:0): Error 22, Unretryable error (probe5:twa0:0:5:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe5:twa0:0:5:0): CAM status: Invalid Target ID (probe5:twa0:0:5:0): Error 22, Unretryable error (probe6:twa0:0:6:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe6:twa0:0:6:0): CAM status: Invalid Target ID (probe6:twa0:0:6:0): Error 22, Unretryable error (probe7:twa0:0:7:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe7:twa0:0:7:0): CAM status: Invalid Target ID (probe7:twa0:0:7:0): Error 22, Unretryable error (probe8:twa0:0:8:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe8:twa0:0:8:0): CAM status: Invalid Target ID (probe8:twa0:0:8:0): Error 22, Unretryable error (probe9:twa0:0:9:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe9:twa0:0:9:0): CAM status: Invalid Target ID (probe9:twa0:0:9:0): Error 22, Unretryable error (probe10:twa0:0:10:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe10:twa0:0:10:0): CAM status: Invalid Target ID (probe10:twa0:0:10:0): Error 22, Unretryable error (probe11:twa0:0:11:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe11:twa0:0:11:0): CAM status: Invalid Target ID (probe11:twa0:0:11:0): Error 22, Unretryable error (probe12:twa0:0:12:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe12:twa0:0:12:0): CAM status: Invalid Target ID (probe12:twa0:0:12:0): Error 22, Unretryable error (probe13:twa0:0:13:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe13:twa0:0:13:0): CAM status: Invalid Target ID (probe13:twa0:0:13:0): Error 22, Unretryable error (probe14:twa0:0:14:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe14:twa0:0:14:0): CAM status: Invalid Target ID (probe14:twa0:0:14:0): Error 22, Unretryable error (probe27:twa0:0:27:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe27:twa0:0:27:0): CAM status: Invalid Target ID (probe27:twa0:0:27:0): Error 22, Unretryable error (probe28:twa0:0:28:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe28:twa0:0:28:0): CAM status: Invalid Target ID (probe28:twa0:0:28:0): Error 22, Unretryable error (probe29:twa0:0:29:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe29:twa0:0:29:0): CAM status: Invalid Target ID (probe29:twa0:0:29:0): Error 22, Unretryable error (probe30:twa0:0:30:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe30:twa0:0:30:0): CAM status: Invalid Target ID (probe30:twa0:0:30:0): Error 22, Unretryable error (probe31:twa0:0:31:0): INQUIRY. CDB: 12 0 0 0 24 0 (probe31:twa0:0:31:0): CAM status: Invalid Target ID (probe31:twa0:0:31:0): Error 22, Unretryable error da0 at twa0 bus 0 scbus0 target 0 lun 0 da0: Fixed Direct Access SCSI-5 device da0: 100.000MB/s transfers da0: 476827MB (976541696 512 byte sectors: 255H 63S/T 60786C) SMP: AP CPU #1 Launched! SMP: AP CPU #2 Launched! SMP: AP CPU #7 Launched! SMP: AP CPU #3 Launched! SMP: AP CPU #5 Launched! SMP: AP CPU #6 Launched! SMP: AP CPU #4 Launched! Timecounter "TSC-low" frequency 12471958 Hz quality 1000 Trying to mount root from ufs:/dev/da0p2 [rw]... And then with moderate disk activity, Jun 22 14:22:57 offsite2 kernel: (da0:twa0:0:0:0): WRITE(10). CDB: 2a 0 18 af 19 e2 0 0 40 0 Jun 22 14:22:57 offsite2 kernel: (da0:twa0:0:0:0): CAM status: Unconditionally Re-queue Request Jun 22 14:22:57 offsite2 kernel: (da0:twa0:0:0:0): Retrying command Jun 22 14:22:57 offsite2 kernel: (da0:twa0:0:0:0): WRITE(10). CDB: 2a 0 18 ad 78 92 0 0 10 0 Jun 22 14:22:57 offsite2 kernel: (da0:twa0:0:0:0): CAM status: Unconditionally Re-queue Request Jun 22 14:22:57 offsite2 kernel: (da0:twa0:0:0:0): Retrying command Jun 22 14:22:58 offsite2 kernel: (da0:twa0:0:0:0): WRITE(10). CDB: 2a 0 18 95 20 ba 0 0 8 0 Jun 22 14:22:58 offsite2 kernel: (da0:twa0:0:0:0): CAM status: Unconditionally Re-queue Request Jun 22 14:22:58 offsite2 kernel: (da0:twa0:0:0:0): Retrying command Jun 22 14:22:59 offsite2 kernel: (da0:twa0:0:0:0): WRITE(10). CDB: 2a 0 18 af 2f e2 0 0 40 0 Jun 22 14:22:59 offsite2 kernel: (da0:twa0:0:0:0): CAM status: Unconditionally Re-queue Request Jun 22 14:22:59 offsite2 kernel: (da0:twa0:0:0:0): Retrying command Jun 22 14:22:59 offsite2 kernel: (da0:twa0:0:0:0): WRITE(10). CDB: 2a 0 18 af 30 62 0 0 40 0 Jun 22 14:22:59 offsite2 kernel: (da0:twa0:0:0:0): CAM status: Unconditionally Re-queue Request Jun 22 14:22:59 offsite2 kernel: (da0:twa0:0:0:0): Retrying command 0{offsite2}# uname -a FreeBSD offsite2.sentex.ca 9.0-STABLE FreeBSD 9.0-STABLE #2: Thu Jun 21 09:48:07 EDT 2012 mdtancsa@offsite2.sentex.ca:/usr/obj/usr/src/sys/offsite amd64 0{offsite2}# Using jhb's handy pciconf from HEAD, I see (pciconf -lvcbe) twa0@pci0:2:0:0: class=0x010400 card=0x100413c1 chip=0x100413c1 rev=0x01 hdr=0x00 vendor = '3ware Inc' device = '9650SE SATA-II RAID PCIe' class = mass storage subclass = RAID bar [10] = type Prefetchable Memory, range 64, base 0x81c000000, size 33554432, enabled bar [18] = type Memory, range 64, base 0xe2420000, size 4096, enabled bar [20] = type I/O Port, range 32, base 0x4000, size 256, enabled cap 01[40] = powerspec 2 supports D0 D1 D2 D3 current D0 cap 05[50] = MSI supports 32 messages, 64 bit cap 10[70] = PCI-Express 1 legacy endpoint max data 128(512) link x1(x8) ecap 0001[100] = AER 1 1 fatal 0 non-fatal 0 corrected PCI-e errors = Fatal Error Detected Unsupported Request Detected Fatal = Unsupported Request Looking at the pciconf output from the older kernel, the unsupported request is there too twa0@pci0:2:0:0: class=0x010400 card=0x100413c1 chip=0x100413c1 rev=0x01 hdr=0x00 vendor = '3ware Inc' device = '9650SE SATA-II RAID PCIe' class = mass storage subclass = RAID bar [10] = type Prefetchable Memory, range 64, base 0x81c000000, size 33554432, enabled bar [18] = type Memory, range 64, base 0xe2420000, size 4096, enabled bar [20] = type I/O Port, range 32, base 0x4000, size 256, enabled cap 01[40] = powerspec 2 supports D0 D1 D2 D3 current D0 cap 05[50] = MSI supports 32 messages, 64 bit cap 10[70] = PCI-Express 1 legacy endpoint max data 128(512) link x1(x8) ecap 0001[100] = AER 1 1 fatal 0 non-fatal 0 corrected PCI-e errors = Fatal Error Detected Unsupported Request Detected Fatal = Unsupported Request 3ware device driver for 9000 series storage controllers, version: 3.80.06.003 twa0: <3ware 9000 series Storage Controller> port 0x4000-0x40ff mem 0x81c000000-0x81dffffff,0xe2420000-0xe2420fff irq 17 at device 0.0 on pci2 twa0: INFO: (0x15: 0x1300): Controller details:: Model 9650SE-2LP, 2 ports, Firmware FE9X 4.10.00.021, BIOS BE9X 4.08.00 .003 ---Mike From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 22 20:38:09 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA6131065787; Fri, 22 Jun 2012 20:38:09 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E3CE8FC0C; Fri, 22 Jun 2012 20:38:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5MKc9VF099095; Fri, 22 Jun 2012 20:38:09 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5MKc9Jp099093; Fri, 22 Jun 2012 20:38:09 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201206222038.q5MKc9Jp099093@svn.freebsd.org> From: Martin Matuska Date: Fri, 22 Jun 2012 20:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237457 - stable/8/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 20:38:10 -0000 Author: mm Date: Fri Jun 22 20:38:08 2012 New Revision: 237457 URL: http://svn.freebsd.org/changeset/base/237457 Log: MFC r237119: Do not remount ZFS dataset if changing canmount property to "on" and dataset is already mounted. PR: 167905 Submitted by: Bryan Drewery Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jun 22 20:38:00 2012 (r237456) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jun 22 20:38:08 2012 (r237457) @@ -1485,11 +1485,13 @@ zfs_prop_set(zfs_handle_t *zhp, const ch /* * If the dataset's canmount property is being set to noauto, + * or being set to on and the dataset is already mounted, * then we want to prevent unmounting & remounting it. */ do_prefix = !((prop == ZFS_PROP_CANMOUNT) && (zprop_string_to_index(prop, propval, &idx, - ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO)); + ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO || + (idx == ZFS_CANMOUNT_ON && zfs_is_mounted(zhp, NULL)))); if (do_prefix && (ret = changelist_prefix(cl)) != 0) goto error; From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 23 00:37:33 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43DBF1065732; Sat, 23 Jun 2012 00:37:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE0D8FC15; Sat, 23 Jun 2012 00:37:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5N0bXhU009254; Sat, 23 Jun 2012 00:37:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5N0bWfG009252; Sat, 23 Jun 2012 00:37:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201206230037.q5N0bWfG009252@svn.freebsd.org> From: Xin LI Date: Sat, 23 Jun 2012 00:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237464 - in stable: 7/usr.bin/makewhatis 8/usr.bin/makewhatis 9/usr.bin/makewhatis X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 00:37:33 -0000 Author: delphij Date: Sat Jun 23 00:37:32 2012 New Revision: 237464 URL: http://svn.freebsd.org/changeset/base/237464 Log: MFC r237348: Currently the code uses gzFile * for a zlib file descriptor, which is not correct. The code works by accident because gzFile is currently defined as void *, and internally it would be casted from or to its real type. A newer version of zlib will instead define it as a pointer to a specific type pointer (namely, struct gzFile_s *). This therefore would cause stricter checks and compiler would catch this type mismatch. This change does not cause any changes to the resulting binary, as validated with md5(1). Modified: stable/8/usr.bin/makewhatis/makewhatis.c Directory Properties: stable/8/usr.bin/makewhatis/ (props changed) Changes in other areas also in this revision: Modified: stable/7/usr.bin/makewhatis/makewhatis.c stable/9/usr.bin/makewhatis/makewhatis.c Directory Properties: stable/7/usr.bin/makewhatis/ (props changed) stable/9/usr.bin/makewhatis/ (props changed) Modified: stable/8/usr.bin/makewhatis/makewhatis.c ============================================================================== --- stable/8/usr.bin/makewhatis/makewhatis.c Fri Jun 22 22:59:42 2012 (r237463) +++ stable/8/usr.bin/makewhatis/makewhatis.c Sat Jun 23 00:37:32 2012 (r237464) @@ -693,7 +693,7 @@ enum { STATE_UNKNOWN, STATE_MANSTYLE, ST static void process_page(struct page_info *page, char *section_dir) { - gzFile *in; + gzFile in; char buffer[4096]; char *line; StringList *names; From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 23 07:46:33 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB2B01065670; Sat, 23 Jun 2012 07:46:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5CBF8FC08; Sat, 23 Jun 2012 07:46:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5N7kXb0027522; Sat, 23 Jun 2012 07:46:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5N7kXd2027520; Sat, 23 Jun 2012 07:46:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206230746.q5N7kXd2027520@svn.freebsd.org> From: Alexander Motin Date: Sat, 23 Jun 2012 07:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237470 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 07:46:34 -0000 Author: mav Date: Sat Jun 23 07:46:33 2012 New Revision: 237470 URL: http://svn.freebsd.org/changeset/base/237470 Log: MFC r237335: Check status of cam_periph_hold() inside cdclose(). If cd device was invalidated while open, cam_periph_hold() will return error and won't get the reference. Following reference release will crash the system. Sponsored by: iXsystems, Inc. Modified: stable/8/sys/cam/scsi/scsi_cd.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Sat Jun 23 07:45:14 2012 (r237469) +++ stable/8/sys/cam/scsi/scsi_cd.c Sat Jun 23 07:46:33 2012 (r237470) @@ -1036,6 +1036,7 @@ cdclose(struct disk *dp) { struct cam_periph *periph; struct cd_softc *softc; + int error; periph = (struct cam_periph *)dp->d_drv1; if (periph == NULL) @@ -1044,7 +1045,11 @@ cdclose(struct disk *dp) softc = (struct cd_softc *)periph->softc; cam_periph_lock(periph); - cam_periph_hold(periph, PRIBIO); + if ((error = cam_periph_hold(periph, PRIBIO)) != 0) { + cam_periph_unlock(periph); + cam_periph_release(periph); + return (0); + } CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, ("cdclose\n")); From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 23 07:49:11 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E35C106566B; Sat, 23 Jun 2012 07:49:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 583808FC12; Sat, 23 Jun 2012 07:49:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5N7nB80027889; Sat, 23 Jun 2012 07:49:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5N7nB23027886; Sat, 23 Jun 2012 07:49:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201206230749.q5N7nB23027886@svn.freebsd.org> From: Alexander Motin Date: Sat, 23 Jun 2012 07:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237472 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 07:49:11 -0000 Author: mav Date: Sat Jun 23 07:49:10 2012 New Revision: 237472 URL: http://svn.freebsd.org/changeset/base/237472 Log: MFC r237336: Remove unused error variables in cdclose() and daclose(). Modified: stable/8/sys/cam/scsi/scsi_cd.c stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Sat Jun 23 07:48:00 2012 (r237471) +++ stable/8/sys/cam/scsi/scsi_cd.c Sat Jun 23 07:49:10 2012 (r237472) @@ -1036,7 +1036,6 @@ cdclose(struct disk *dp) { struct cam_periph *periph; struct cd_softc *softc; - int error; periph = (struct cam_periph *)dp->d_drv1; if (periph == NULL) @@ -1045,7 +1044,7 @@ cdclose(struct disk *dp) softc = (struct cd_softc *)periph->softc; cam_periph_lock(periph); - if ((error = cam_periph_hold(periph, PRIBIO)) != 0) { + if (cam_periph_hold(periph, PRIBIO) != 0) { cam_periph_unlock(periph); cam_periph_release(periph); return (0); Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Sat Jun 23 07:48:00 2012 (r237471) +++ stable/8/sys/cam/scsi/scsi_da.c Sat Jun 23 07:49:10 2012 (r237472) @@ -956,14 +956,13 @@ daclose(struct disk *dp) { struct cam_periph *periph; struct da_softc *softc; - int error; periph = (struct cam_periph *)dp->d_drv1; if (periph == NULL) return (0); cam_periph_lock(periph); - if ((error = cam_periph_hold(periph, PRIBIO)) != 0) { + if (cam_periph_hold(periph, PRIBIO) != 0) { cam_periph_unlock(periph); cam_periph_release(periph); return (0); From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 23 17:42:38 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20BBB106566C; Sat, 23 Jun 2012 17:42:38 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BC638FC08; Sat, 23 Jun 2012 17:42:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5NHgbsg054906; Sat, 23 Jun 2012 17:42:37 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NHgbcK054904; Sat, 23 Jun 2012 17:42:37 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206231742.q5NHgbcK054904@svn.freebsd.org> From: Davide Italiano Date: Sat, 23 Jun 2012 17:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237486 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 17:42:38 -0000 Author: davide Date: Sat Jun 23 17:42:37 2012 New Revision: 237486 URL: http://svn.freebsd.org/changeset/base/237486 Log: MFC r237195: The variable 'error' in sys_poll() is initialized in declaration to value zero but in any case is overwritten by successive copyin(), making the previous initialization useless. Remove this. As an added bonus this fixes a style(9) bug. Approved by: gnn (mentor) Modified: stable/8/sys/kern/sys_generic.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/sys_generic.c ============================================================================== --- stable/8/sys/kern/sys_generic.c Sat Jun 23 17:39:40 2012 (r237485) +++ stable/8/sys/kern/sys_generic.c Sat Jun 23 17:42:37 2012 (r237486) @@ -1208,7 +1208,7 @@ poll(td, uap) struct pollfd *bits; struct pollfd smallbits[32]; struct timeval atv, rtv, ttv; - int error = 0, timo; + int error, timo; u_int nfds; size_t ni; From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 23 18:07:48 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BCD2F1065675; Sat, 23 Jun 2012 18:07:48 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A75D68FC1D; Sat, 23 Jun 2012 18:07:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5NI7mnu056124; Sat, 23 Jun 2012 18:07:48 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NI7mpU056122; Sat, 23 Jun 2012 18:07:48 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201206231807.q5NI7mpU056122@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 23 Jun 2012 18:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237489 - stable/8/usr.sbin/traceroute6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 18:07:48 -0000 Author: ume Date: Sat Jun 23 18:07:48 2012 New Revision: 237489 URL: http://svn.freebsd.org/changeset/base/237489 Log: MFC r235138: Add -a and -A option to the usage. Modified: stable/8/usr.sbin/traceroute6/traceroute6.c Directory Properties: stable/8/usr.sbin/traceroute6/ (props changed) Modified: stable/8/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- stable/8/usr.sbin/traceroute6/traceroute6.c Sat Jun 23 17:59:32 2012 (r237488) +++ stable/8/usr.sbin/traceroute6/traceroute6.c Sat Jun 23 18:07:48 2012 (r237489) @@ -1453,7 +1453,8 @@ usage() { fprintf(stderr, -"usage: traceroute6 [-dIlnNrUv] [-f firsthop] [-g gateway] [-m hoplimit]\n" -" [-p port] [-q probes] [-s src] [-w waittime] target [datalen]\n"); +"usage: traceroute6 [-adIlnNrUv] [-A as_server] [-f firsthop] [-g gateway]\n" +" [-m hoplimit] [-p port] [-q probes] [-s src] [-w waittime] target\n" +" [datalen]\n"); exit(1); } From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 23 19:42:07 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A151106567E; Sat, 23 Jun 2012 19:42:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 148EE8FC12; Sat, 23 Jun 2012 19:42:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5NJg6iI060972; Sat, 23 Jun 2012 19:42:06 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NJg6Tb060970; Sat, 23 Jun 2012 19:42:06 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206231942.q5NJg6Tb060970@svn.freebsd.org> From: Eitan Adler Date: Sat, 23 Jun 2012 19:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237503 - stable/8/sbin/geom/class/sched X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 19:42:07 -0000 Author: eadler Date: Sat Jun 23 19:42:06 2012 New Revision: 237503 URL: http://svn.freebsd.org/changeset/base/237503 Log: MFC r231992: Remove reference to gsched_as module, which doesn't actually exist. Approved by: cperciva (implicit) Modified: stable/8/sbin/geom/class/sched/gsched.8 (contents, props changed) Directory Properties: stable/8/sbin/geom/ (props changed) Modified: stable/8/sbin/geom/class/sched/gsched.8 ============================================================================== --- stable/8/sbin/geom/class/sched/gsched.8 Sat Jun 23 19:39:03 2012 (r237502) +++ stable/8/sbin/geom/class/sched/gsched.8 Sat Jun 23 19:42:06 2012 (r237503) @@ -141,7 +141,7 @@ and how to destroy it. # Load the geom_sched module: kldload geom_sched # Load some scheduler classes used by geom_sched: -kldload gsched_rr gsched_as +kldload gsched_rr # Configure device ad0 to use scheduler "rr": geom sched insert -a rr ad0 # Now provider ad0 uses the "rr" algorithm; From owner-svn-src-stable-8@FreeBSD.ORG Sat Jun 23 20:37:28 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 28090106566B; Sat, 23 Jun 2012 20:37:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F6608FC0A; Sat, 23 Jun 2012 20:37:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5NKbSW7063404; Sat, 23 Jun 2012 20:37:28 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5NKbRP5063393; Sat, 23 Jun 2012 20:37:27 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201206232037.q5NKbRP5063393@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 23 Jun 2012 20:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237508 - stable/8/contrib/libstdc++/include/bits X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2012 20:37:28 -0000 Author: pfg Date: Sat Jun 23 20:37:27 2012 New Revision: 237508 URL: http://svn.freebsd.org/changeset/base/237508 Log: MFC: r236829 Bring a couple of libstdc++ patches from Apple's llvm-gcc project. Modified Fri Jul 10 07:44:34 2009 CDT by rafael backport part of http://gcc.gnu.org/ml/gcc-cvs/2007-10/msg00118.html The patch is for libstdc++ and it was GPL2 at the time. Modified Tue Apr 29 01:20:19 2008 CDT by asl Backport from mainline (pre-GPLv3). Fix for sizeof(const void*) > sizeof(unsigned long). Modified: stable/8/contrib/libstdc++/include/bits/locale_facets.tcc stable/8/contrib/libstdc++/include/bits/stl_bvector.h stable/8/contrib/libstdc++/include/bits/stl_deque.h stable/8/contrib/libstdc++/include/bits/stl_list.h stable/8/contrib/libstdc++/include/bits/stl_map.h stable/8/contrib/libstdc++/include/bits/stl_multimap.h stable/8/contrib/libstdc++/include/bits/stl_multiset.h stable/8/contrib/libstdc++/include/bits/stl_set.h stable/8/contrib/libstdc++/include/bits/stl_tree.h stable/8/contrib/libstdc++/include/bits/stl_vector.h Directory Properties: stable/8/contrib/libstdc++/ (props changed) Modified: stable/8/contrib/libstdc++/include/bits/locale_facets.tcc ============================================================================== --- stable/8/contrib/libstdc++/include/bits/locale_facets.tcc Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/locale_facets.tcc Sat Jun 23 20:37:27 2012 (r237508) @@ -887,7 +887,11 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE const fmtflags __fmt = __io.flags(); __io.flags(__fmt & ~ios_base::basefield | ios_base::hex); - unsigned long __ul; + typedef __gnu_cxx::__conditional_type<(sizeof(void*) + <= sizeof(unsigned long)), + unsigned long, unsigned long long>::__type _UIntPtrType; + + _UIntPtrType __ul; __beg = _M_extract_int(__beg, __end, __io, __err, __ul); // Reset from hex formatted input. @@ -1309,8 +1313,12 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE | ios_base::internal); __io.flags(__flags & __fmt | (ios_base::hex | ios_base::showbase)); + typedef __gnu_cxx::__conditional_type<(sizeof(const void*) + <= sizeof(unsigned long)), + unsigned long, unsigned long long>::__type _UIntPtrType; + __s = _M_insert_int(__s, __io, __fill, - reinterpret_cast(__v)); + reinterpret_cast<_UIntPtrType>(__v)); __io.flags(__flags); return __s; } Modified: stable/8/contrib/libstdc++/include/bits/stl_bvector.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_bvector.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_bvector.h Sat Jun 23 20:37:27 2012 (r237508) @@ -385,6 +385,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL _Bit_iterator _M_start; _Bit_iterator _M_finish; _Bit_type* _M_end_of_storage; + + _Bvector_impl() + : _Bit_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage(0) + { } + _Bvector_impl(const _Bit_alloc_type& __a) : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0) { } @@ -405,7 +410,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL get_allocator() const { return allocator_type(_M_get_Bit_allocator()); } - _Bvector_base(const allocator_type& __a) : _M_impl(__a) { } + _Bvector_base() + : _M_impl() { } + + _Bvector_base(const allocator_type& __a) + : _M_impl(__a) { } ~_Bvector_base() { this->_M_deallocate(); } @@ -480,8 +489,11 @@ template using _Base::_M_get_Bit_allocator; public: + vector() + : _Base() { } + explicit - vector(const allocator_type& __a = allocator_type()) + vector(const allocator_type& __a) : _Base(__a) { } explicit @@ -678,7 +690,7 @@ template } void - swap(vector& __x) + swap(vector& __x) { std::swap(this->_M_impl._M_start, __x._M_impl._M_start); std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish); Modified: stable/8/contrib/libstdc++/include/bits/stl_deque.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_deque.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_deque.h Sat Jun 23 20:37:27 2012 (r237508) @@ -380,6 +380,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator; typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator; + _Deque_base() + : _M_impl() + { _M_initialize_map(0); } + _Deque_base(const allocator_type& __a, size_t __num_elements) : _M_impl(__a) { _M_initialize_map(__num_elements); } @@ -406,6 +410,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL iterator _M_start; iterator _M_finish; + _Deque_impl() + : _Tp_alloc_type(), _M_map(0), _M_map_size(0), + _M_start(), _M_finish() + { } + _Deque_impl(const _Tp_alloc_type& __a) : _Tp_alloc_type(__a), _M_map(0), _M_map_size(0), _M_start(), _M_finish() @@ -679,8 +688,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL /** * @brief Default constructor creates no elements. */ + deque() + : _Base() { } + explicit - deque(const allocator_type& __a = allocator_type()) + deque(const allocator_type& __a) : _Base(__a, 0) {} /** Modified: stable/8/contrib/libstdc++/include/bits/stl_list.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_list.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_list.h Sat Jun 23 20:37:27 2012 (r237508) @@ -305,6 +305,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL { _List_node_base _M_node; + _List_impl() + : _Node_alloc_type(), _M_node() + { } + _List_impl(const _Node_alloc_type& __a) : _Node_alloc_type(__a), _M_node() { } @@ -339,6 +343,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL get_allocator() const { return allocator_type(_M_get_Node_allocator()); } + _List_base() + : _M_impl() + { _M_init(); } + _List_base(const allocator_type& __a) : _M_impl(__a) { _M_init(); } @@ -468,8 +476,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL /** * @brief Default constructor creates no elements. */ + list() + : _Base() { } + explicit - list(const allocator_type& __a = allocator_type()) + list(const allocator_type& __a) : _Base(__a) { } /** Modified: stable/8/contrib/libstdc++/include/bits/stl_map.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_map.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_map.h Sat Jun 23 20:37:27 2012 (r237508) @@ -155,7 +155,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * @brief Default constructor creates no elements. */ map() - : _M_t(_Compare(), allocator_type()) { } + : _M_t() { } // for some reason this was made a separate function /** @@ -186,7 +186,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL */ template map(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) + : _M_t() { _M_t._M_insert_unique(__first, __last); } /** Modified: stable/8/contrib/libstdc++/include/bits/stl_multimap.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_multimap.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_multimap.h Sat Jun 23 20:37:27 2012 (r237508) @@ -152,7 +152,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * @brief Default constructor creates no elements. */ multimap() - : _M_t(_Compare(), allocator_type()) { } + : _M_t() { } // for some reason this was made a separate function /** @@ -184,8 +184,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL */ template multimap(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) - { _M_t._M_insert_equal(__first, __last); } + : _M_t() + { _M_t._M_insert_unique(__first, __last); } /** * @brief Builds a %multimap from a range. Modified: stable/8/contrib/libstdc++/include/bits/stl_multiset.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_multiset.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_multiset.h Sat Jun 23 20:37:27 2012 (r237508) @@ -134,7 +134,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * @brief Default constructor creates no elements. */ multiset() - : _M_t(_Compare(), allocator_type()) { } + : _M_t() { } explicit multiset(const _Compare& __comp, @@ -152,7 +152,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL */ template multiset(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) + : _M_t() { _M_t._M_insert_equal(__first, __last); } /** @@ -180,7 +180,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * The newly-created %multiset uses a copy of the allocation object used * by @a x. */ - multiset(const multiset<_Key,_Compare,_Alloc>& __x) + multiset(const multiset& __x) : _M_t(__x._M_t) { } /** @@ -190,8 +190,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * All the elements of @a x are copied, but unlike the copy constructor, * the allocator object is not copied. */ - multiset<_Key,_Compare,_Alloc>& - operator=(const multiset<_Key,_Compare,_Alloc>& __x) + multiset& + operator=(const multiset& __x) { _M_t = __x._M_t; return *this; @@ -275,7 +275,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * std::swap(s1,s2) will feed to this function. */ void - swap(multiset<_Key, _Compare, _Alloc>& __x) + swap(multiset& __x) { _M_t.swap(__x._M_t); } // insert/erase Modified: stable/8/contrib/libstdc++/include/bits/stl_set.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_set.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_set.h Sat Jun 23 20:37:27 2012 (r237508) @@ -138,7 +138,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL // allocation/deallocation /// Default constructor creates no elements. set() - : _M_t(_Compare(), allocator_type()) {} + : _M_t() { } /** * @brief Default constructor creates no elements. @@ -162,7 +162,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL */ template set(_InputIterator __first, _InputIterator __last) - : _M_t(_Compare(), allocator_type()) + : _M_t() { _M_t._M_insert_unique(__first, __last); } /** @@ -190,7 +190,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * The newly-created %set uses a copy of the allocation object used * by @a x. */ - set(const set<_Key,_Compare,_Alloc>& __x) + set(const set& __x) : _M_t(__x._M_t) { } /** @@ -200,8 +200,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * All the elements of @a x are copied, but unlike the copy constructor, * the allocator object is not copied. */ - set<_Key,_Compare,_Alloc>& - operator=(const set<_Key, _Compare, _Alloc>& __x) + set& + operator=(const set& __x) { _M_t = __x._M_t; return *this; @@ -283,7 +283,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL * std::swap(s1,s2) will feed to this function. */ void - swap(set<_Key,_Compare,_Alloc>& __x) + swap(set& __x) { _M_t.swap(__x._M_t); } // insert/erase Modified: stable/8/contrib/libstdc++/include/bits/stl_tree.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_tree.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_tree.h Sat Jun 23 20:37:27 2012 (r237508) @@ -410,10 +410,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _Rb_tree_node_base _M_header; size_type _M_node_count; // Keeps track of size of tree. - _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(), - const _Key_compare& __comp = _Key_compare()) - : _Node_allocator(__a), _M_key_compare(__comp), _M_header(), + _Rb_tree_impl() + : _Node_allocator(), _M_key_compare(), _M_header(), _M_node_count(0) + { _M_initialize(); } + + _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a) + : _Node_allocator(__a), _M_key_compare(__comp), _M_header(), + _M_node_count(0) + { _M_initialize(); } + + private: + void + _M_initialize() { this->_M_header._M_color = _S_red; this->_M_header._M_parent = 0; @@ -431,11 +440,20 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _Rb_tree_node_base _M_header; size_type _M_node_count; // Keeps track of size of tree. - _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(), - const _Key_compare& __comp = _Key_compare()) + _Rb_tree_impl() + : _Node_allocator(), _M_key_compare(), _M_header(), + _M_node_count(0) + { _M_initialize(); } + + _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a) : _Node_allocator(__a), _M_key_compare(__comp), _M_header(), _M_node_count(0) - { + { _M_initialize(); } + + private: + void + _M_initialize() + { this->_M_header._M_color = _S_red; this->_M_header._M_parent = 0; this->_M_header._M_left = &this->_M_header; @@ -568,16 +586,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _Rb_tree() { } - _Rb_tree(const _Compare& __comp) - : _M_impl(allocator_type(), __comp) - { } - - _Rb_tree(const _Compare& __comp, const allocator_type& __a) - : _M_impl(__a, __comp) + _Rb_tree(const _Compare& __comp, + const allocator_type& __a = allocator_type()) + : _M_impl(__comp, __a) { } - _Rb_tree(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x) - : _M_impl(__x._M_get_Node_allocator(), __x._M_impl._M_key_compare) + _Rb_tree(const _Rb_tree& __x) + : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator()) { if (__x._M_root() != 0) { @@ -591,8 +606,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ~_Rb_tree() { _M_erase(_M_begin()); } - _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& - operator=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x); + _Rb_tree& + operator=(const _Rb_tree& __x); // Accessors. _Compare @@ -653,7 +668,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { return get_allocator().max_size(); } void - swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t); + swap(_Rb_tree& __t); // Insert/erase. pair Modified: stable/8/contrib/libstdc++/include/bits/stl_vector.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/stl_vector.h Sat Jun 23 20:33:29 2012 (r237507) +++ stable/8/contrib/libstdc++/include/bits/stl_vector.h Sat Jun 23 20:37:27 2012 (r237508) @@ -84,6 +84,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL _Tp* _M_start; _Tp* _M_finish; _Tp* _M_end_of_storage; + + _Vector_impl() + : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0) + { } + _Vector_impl(_Tp_alloc_type const& __a) : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0) { } @@ -104,6 +109,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL get_allocator() const { return allocator_type(_M_get_Tp_allocator()); } + _Vector_base() + : _M_impl() { } + _Vector_base(const allocator_type& __a) : _M_impl(__a) { } @@ -194,8 +202,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL /** * @brief Default constructor creates no elements. */ + vector() + : _Base() { } + explicit - vector(const allocator_type& __a = allocator_type()) + vector(const allocator_type& __a) : _Base(__a) { }