From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 02:48:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F604106566B; Sun, 25 Oct 2009 02:48:29 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E6EA8FC12; Sun, 25 Oct 2009 02:48:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9P2mTFc027746; Sun, 25 Oct 2009 02:48:29 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9P2mT9i027744; Sun, 25 Oct 2009 02:48:29 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200910250248.n9P2mT9i027744@svn.freebsd.org> From: Alan Cox Date: Sun, 25 Oct 2009 02:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198463 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 02:48:29 -0000 Author: alc Date: Sun Oct 25 02:48:29 2009 New Revision: 198463 URL: http://svn.freebsd.org/changeset/base/198463 Log: Update a comment to reflect the previous change. Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Sun Oct 25 01:19:55 2009 (r198462) +++ head/sys/kern/sys_process.c Sun Oct 25 02:48:29 2009 (r198463) @@ -279,7 +279,7 @@ proc_rwmem(struct proc *p, struct uio *u } /* - * Now we need to get the page. out_entry, out_prot, wired, + * Now we need to get the page. out_entry, wired, * and single_use aren't used. One would think the vm code * would be a *bit* nicer... We use tmap because * vm_map_lookup() can change the map argument. From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 04:34:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C7E1106566B; Sun, 25 Oct 2009 04:34:48 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BEE88FC12; Sun, 25 Oct 2009 04:34:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9P4Yl1k041031; Sun, 25 Oct 2009 04:34:47 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9P4YlhC041029; Sun, 25 Oct 2009 04:34:47 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200910250434.n9P4YlhC041029@svn.freebsd.org> From: Joseph Koshy Date: Sun, 25 Oct 2009 04:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198464 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 04:34:48 -0000 Author: jkoshy Date: Sun Oct 25 04:34:47 2009 New Revision: 198464 URL: http://svn.freebsd.org/changeset/base/198464 Log: Inform hwpmc(4) of a thread's impending demise prior to invoking sched_throw(). Debugging help: fabient Review and testing by: fabient Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sun Oct 25 02:48:29 2009 (r198463) +++ head/sys/kern/kern_thread.c Sun Oct 25 04:34:47 2009 (r198464) @@ -27,6 +27,7 @@ */ #include "opt_witness.h" +#include "opt_hwpmc_hooks.h" #include __FBSDID("$FreeBSD$"); @@ -47,6 +48,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef HWPMC_HOOKS +#include +#endif #include @@ -417,6 +421,14 @@ thread_exit(void) panic ("thread_exit: Last thread exiting on its own"); } } +#ifdef HWPMC_HOOKS + /* + * If this thread is part of a process that is being tracked by hwpmc(4), + * inform the module of the thread's impending exit. + */ + if (PMC_PROC_IS_USING_PMCS(td->td_proc)) + PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); +#endif PROC_UNLOCK(p); thread_lock(td); /* Save our tick information with both the thread and proc locked */ From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 09:48:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FAB3106566B; Sun, 25 Oct 2009 09:48:22 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EA4E8FC08; Sun, 25 Oct 2009 09:48:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9P9mMBi053462; Sun, 25 Oct 2009 09:48:22 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9P9mMxo053461; Sun, 25 Oct 2009 09:48:22 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200910250948.n9P9mMxo053461@svn.freebsd.org> From: Rui Paulo Date: Sun, 25 Oct 2009 09:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198466 - head/sys/tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 09:48:22 -0000 Author: rpaulo Date: Sun Oct 25 09:48:21 2009 New Revision: 198466 URL: http://svn.freebsd.org/changeset/base/198466 Log: Output a comment on top of each generated file explaining where it came from. Modified: head/sys/tools/fw_stub.awk Modified: head/sys/tools/fw_stub.awk ============================================================================== --- head/sys/tools/fw_stub.awk Sun Oct 25 08:43:38 2009 (r198465) +++ head/sys/tools/fw_stub.awk Sun Oct 25 09:48:21 2009 (r198466) @@ -121,7 +121,11 @@ ctmpfilename = cfilename ".tmp"; modname = opt_m; gsub(/[-\.]/, "_", modname); -printc("#include \ +printc("/*\ + * Automatically generated by:\ + * $FreeBSD$\ + */\ +#include \ #include \ #include \ #include \ From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 09:58:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 908C4106566B; Sun, 25 Oct 2009 09:58:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7148FC13; Sun, 25 Oct 2009 09:58:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9P9wuvG053678; Sun, 25 Oct 2009 09:58:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9P9wuoP053676; Sun, 25 Oct 2009 09:58:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200910250958.n9P9wuoP053676@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 25 Oct 2009 09:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198467 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 09:58:56 -0000 Author: bz Date: Sun Oct 25 09:58:56 2009 New Revision: 198467 URL: http://svn.freebsd.org/changeset/base/198467 Log: Unconditionally call the setsockopt for IPV6_V6ONLY for v6 linux sockets no matter whether we are compiled as module or if our default of the net.inet6.ip6.v6only sysctl already matches what we would set. This avoids unnecessary complications with modules, VIMAGES, INET6 and the sysctl value, especially considering that most users will use linux compat as a module. Discussed with: kib, rwatson (weeks ago) Reviewed by: rwatson MFC after: 6 weeks Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun Oct 25 09:48:21 2009 (r198466) +++ head/sys/compat/linux/linux_socket.c Sun Oct 25 09:58:56 2009 (r198467) @@ -639,19 +639,12 @@ linux_socket(struct thread *td, struct l } #ifdef INET6 /* - * Linux AF_INET6 socket has IPV6_V6ONLY setsockopt set to 0 by - * default and some apps depend on this. So, set V6ONLY to 0 - * for Linux apps if the sysctl value is set to 1. + * Linux AF_INET6 socket has IPV6_V6ONLY setsockopt set to 0 by default + * and some apps depend on this. So, set V6ONLY to 0 for Linux apps. + * For simplicity we do this unconditionally of the net.inet6.ip6.v6only + * sysctl value. */ - if (bsd_args.domain == PF_INET6 -#ifndef KLD_MODULE - /* - * XXX: Avoid undefined symbol error with an IPv4 only - * kernel. - */ - && V_ip6_v6only -#endif - ) { + if (bsd_args.domain == PF_INET6) { int v6only; v6only = 0; From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 10:23:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED428106566C; Sun, 25 Oct 2009 10:23:11 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D210F8FC1F; Sun, 25 Oct 2009 10:23:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9PANBUA054205; Sun, 25 Oct 2009 10:23:11 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9PANBGD054203; Sun, 25 Oct 2009 10:23:11 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200910251023.n9PANBGD054203@svn.freebsd.org> From: Rui Paulo Date: Sun, 25 Oct 2009 10:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198468 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 10:23:12 -0000 Author: rpaulo Date: Sun Oct 25 10:23:11 2009 New Revision: 198468 URL: http://svn.freebsd.org/changeset/base/198468 Log: Update firmware images according to the latest iwn updated. "device iwnfw" includes all firmware images, but you can pick just one by using the model number, e.g.: "device iwn4965fw". Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Oct 25 09:58:56 2009 (r198467) +++ head/sys/conf/files Sun Oct 25 10:23:11 2009 (r198468) @@ -1082,20 +1082,48 @@ iwi_monitor.fw optional iwimonitorfw | no-obj no-implicit-rule \ clean "iwi_monitor.fw" dev/iwn/if_iwn.c optional iwn -iwnfw.c optional iwnfw \ - compile-with "${AWK} -f $S/tools/fw_stub.awk iwn.fw:iwnfw:44417 -lintel_iwn -miwn -c${.TARGET}" \ +iwn4965fw.c optional iwn4965fw | iwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwn4965.fw:iwn4965fw -miwn4965fw -c${.TARGET}" \ no-implicit-rule before-depend local \ - clean "iwnfw.c" -iwnfw.fwo optional iwnfw \ - dependency "iwn.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn.fw" \ + clean "iwn4965fw.c" +iwn4965fw.fwo optional iwn4965fw | iwnfw \ + dependency "iwn4965.fw" \ + compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn4965.fw" \ no-implicit-rule \ - clean "iwnfw.fwo" -iwn.fw optional iwnfw \ + clean "iwn4965fw.fwo" +iwn4965.fw optional iwn4965fw | iwnfw \ dependency ".PHONY" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-4.44.17.fw.uu" \ + compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-228.57.2.23.fw.uu" \ no-obj no-implicit-rule \ - clean "iwn.fw" + clean "iwn4965.fw" +iwn5000fw.c optional iwn5000fw | iwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwn5000.fw:iwn5000fw -miwn5000fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwn5000fw.c" +iwn5000fw.fwo optional iwn5000fw | iwnfw \ + dependency "iwn5000.fw" \ + compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5000.fw" \ + no-implicit-rule \ + clean "iwn5000fw.fwo" +iwn5000.fw optional iwn5000fw | iwnfw \ + dependency ".PHONY" \ + compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5000-5.4.A.11.fw.uu" \ + no-obj no-implicit-rule \ + clean "iwn5000.fw" +iwn5150fw.c optional iwn5150fw | iwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwn5150.fw:iwn5150fw -miwn5150fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwn5150fw.c" +iwn5150fw.fwo optional iwn5150fw | iwnfw \ + dependency "iwn5150.fw" \ + compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5150.fw" \ + no-implicit-rule \ + clean "iwn5150fw.fwo" +iwn5150.fw optional iwn5150fw | iwnfw \ + dependency ".PHONY" \ + compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu" \ + no-obj no-implicit-rule \ + clean "iwn5150.fw" dev/ixgb/if_ixgb.c optional ixgb dev/ixgb/ixgb_ee.c optional ixgb dev/ixgb/ixgb_hw.c optional ixgb From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 10:23:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6532F1065670; Sun, 25 Oct 2009 10:23:42 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by mx1.freebsd.org (Postfix) with ESMTP id 6F7DE8FC0A; Sun, 25 Oct 2009 10:23:41 +0000 (UTC) Received: by ewy18 with SMTP id 18so9719415ewy.43 for ; Sun, 25 Oct 2009 03:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=SyWXbjwXIRf1ciyeCfPy2pBgAB191ET8Ah/sFVJn68E=; b=TDTtfXz6PKk5+CgbssMzYWLV5Umha1ACAY2VDk4conl8yTDjI/7PlHRI7R2Q2Kw/F/ F9DexkxZGORCtqBw5EAgaNhwGQHfKH9agQnRqDKc0lbU4CWlgsEVySXMbFmEXd3N3+7B ZYPuTOpdzwzwB57XQPC4+ABAQIodoSNbAjktM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=CPuhQD4H5HHjKvo5N8N8IwDsh41gd3a5tzfWAm9rQV0ChbD1x4ie6JfFqkyfWNIovn v6dpm0u7Gl0zgmLB2xxjpauolJTlGuj6aO3vdIxkkxfQgF/Y3pz1JVum40N6tQy1kYDS 0DVVfD/tuE+U1QCNpo28e+o1L/GxCwBtmK8PY= Received: by 10.210.93.4 with SMTP id q4mr1287281ebb.3.1256466220497; Sun, 25 Oct 2009 03:23:40 -0700 (PDT) Received: from mac-mini.lan (bl7-91-11.dsl.telepac.pt [85.240.91.11]) by mx.google.com with ESMTPS id 10sm1022414eyz.19.2009.10.25.03.23.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 25 Oct 2009 03:23:39 -0700 (PDT) Sender: Rui Paulo Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Rui Paulo In-Reply-To: <4AE32A9C.10400@freebsd.org> Date: Sun, 25 Oct 2009 10:23:37 +0000 Content-Transfer-Encoding: 7bit Message-Id: References: <200910240955.n9O9tCXP087115@svn.freebsd.org> <4AE32A9C.10400@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1076) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198439 - in head/sys: dev/iwn modules/iwnfw modules/iwnfw/iwn4965 modules/iwnfw/iwn5000 modules/iwnfw/iwn5150 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 10:23:42 -0000 On 24 Oct 2009, at 17:26, Nathan Whitehorn wrote: > Rui Paulo wrote: >> Author: rpaulo >> Date: Sat Oct 24 09:55:11 2009 >> New Revision: 198439 >> URL: http://svn.freebsd.org/changeset/base/198439 >> >> Log: >> Updates to the iwn driver: >> * iwnfw has now been split into individual modules so autoloading of >> firmware module(s) does work again. >> * Changes have been made to RUN -> AUTH transition, this should >> fix the >> issue reported by Glen and others. >> * Brandon reported issues in iwn_cmd() with large commands, those >> have >> been fixed to. >> * DEAUTH is now handled correctly. >> Submitted by: Bernhard Schmidt >> > I think you missed some changes to /sys/conf/files, if you want to > build iwnfw into the kernel. /sys/conf/files still references the > old 4965 firmware (breaking the build for kernels including device > iwnfw), and doesn't include the 5000-series firmware at all. Thanks > to you and Bernhard for the update! Oops, thanks for pointing out. I've fixed it. REgards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 10:29:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D642E106566C; Sun, 25 Oct 2009 10:29:37 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C59B98FC16; Sun, 25 Oct 2009 10:29:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9PATbdq054336; Sun, 25 Oct 2009 10:29:37 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9PATbkZ054334; Sun, 25 Oct 2009 10:29:37 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200910251029.n9PATbkZ054334@svn.freebsd.org> From: Rui Paulo Date: Sun, 25 Oct 2009 10:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198469 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 10:29:37 -0000 Author: rpaulo Date: Sun Oct 25 10:29:37 2009 New Revision: 198469 URL: http://svn.freebsd.org/changeset/base/198469 Log: Explain that iwn was updated and the firmware images are now split. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Oct 25 10:23:11 2009 (r198468) +++ head/UPDATING Sun Oct 25 10:29:37 2009 (r198469) @@ -22,6 +22,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20091025: + The iwn(4) driver has been updated to support the 5000 and 5150 series. + There's one kernel module for each firmware. Adding "device iwnfw" + to the kernel configuration file means including all three firmware + images inside the kernel. If you want to include just the one for + your wireless card, use the the devices iwn4965fw, iwn5000fw or + iwn5150fw. + 20090926: The rc.d/network_ipv6, IPv6 configuration script has been integrated into rc.d/netif. The changes are the following: From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 10:30:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46BF81065698; Sun, 25 Oct 2009 10:30:55 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by mx1.freebsd.org (Postfix) with ESMTP id 571B88FC20; Sun, 25 Oct 2009 10:30:54 +0000 (UTC) Received: by ewy18 with SMTP id 18so9721798ewy.43 for ; Sun, 25 Oct 2009 03:30:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=0UzxJbkpLmKSDud3aWi5sVmAfOv3FJ4O31TsN5V7JTA=; b=nfnrBHn9qbXm+Ayhc2eaGs6aBzw6jkHreS74a3p4ZgHdtbUKPecUENmoiiqzlz5mFL zJTBfDASfUvqjeJHZAOzSQcfVB9JfHeQcHcSptuAmuZ2+0lHgEa55eevzq5ycVBifqJv ZPpTvdnSnzNBhHcK8JnPdTyxH2xrsxRQBgTR0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=upgaciqi0BZOlLyfXEBlZaSP+Usfk8jCpeEL+k4/R3P1/iIv0Wv6THEvojLahRUYAh xU6sJDrwBnproRgE40OcUkWo0uLHPti+AlbePEUbswP3XH7/892HXt0yWxMZ2j/7fYxb VixHgnFnx+x5DPkJQsI/G1DX2JYRxQ5J59XrA= Received: by 10.210.15.14 with SMTP id 14mr2988331ebo.49.1256466653490; Sun, 25 Oct 2009 03:30:53 -0700 (PDT) Received: from mac-mini.lan (bl7-91-11.dsl.telepac.pt [85.240.91.11]) by mx.google.com with ESMTPS id 7sm10096701eyg.25.2009.10.25.03.30.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 25 Oct 2009 03:30:52 -0700 (PDT) Sender: Rui Paulo Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Rui Paulo In-Reply-To: <200910251023.n9PANBGD054203@svn.freebsd.org> Date: Sun, 25 Oct 2009 10:30:49 +0000 Content-Transfer-Encoding: 7bit Message-Id: References: <200910251023.n9PANBGD054203@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.1076) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198468 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 10:30:55 -0000 On 25 Oct 2009, at 10:23, Rui Paulo wrote: > Author: rpaulo > Date: Sun Oct 25 10:23:11 2009 > New Revision: 198468 > URL: http://svn.freebsd.org/changeset/base/198468 > > Log: > Update firmware images according to the latest iwn updated. > "device iwnfw" includes all firmware images, but you can pick just > one > by using the model number, e.g.: "device iwn4965fw". Pointed out by: nwhitehorn@ -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 11:01:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB755106568D; Sun, 25 Oct 2009 11:01:53 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99CF38FC17; Sun, 25 Oct 2009 11:01:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9PB1r9D056148; Sun, 25 Oct 2009 11:01:53 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9PB1rIu056145; Sun, 25 Oct 2009 11:01:53 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200910251101.n9PB1rIu056145@svn.freebsd.org> From: Rui Paulo Date: Sun, 25 Oct 2009 11:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198470 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 11:01:53 -0000 Author: rpaulo Date: Sun Oct 25 11:01:53 2009 New Revision: 198470 URL: http://svn.freebsd.org/changeset/base/198470 Log: Update according to the latest iwn(4) driver import. Modified: head/share/man/man4/iwn.4 head/share/man/man4/iwnfw.4 Modified: head/share/man/man4/iwn.4 ============================================================================== --- head/share/man/man4/iwn.4 Sun Oct 25 10:29:37 2009 (r198469) +++ head/share/man/man4/iwn.4 Sun Oct 25 11:01:53 2009 (r198470) @@ -25,36 +25,52 @@ .\" .\" $FreeBSD$ .\" -.Dd April 13, 2008 +.Dd October 25, 2009 .Os .Dt IWN 4 .Sh NAME .Nm iwn -.Nd "Intel Wireless WiFi Link 4965AGN IEEE 802.11n driver" +.Nd "Intel Wireless WiFi Link 4965/5000 IEEE 802.11n driver" .Sh SYNOPSIS To compile this driver into the kernel, include the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device iwn" -.Cd "device iwnfw" .Cd "device pci" .Cd "device wlan" .Cd "device firmware" .Ed .Pp +You also need to select a firmware for your device. Chose one from: +.Bd -ragged -offset indent +.Cd "device iwn4965fw" +.Cd "device iwn5000fw" +.Cd "device iwn5100fw" +.Ed +.Pp +Or you can use +.Bd -ragged -offset indent +.Cd "device iwnfw" +.Ed +.Pp +to include them all. +.Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent if_iwn_load="YES" +iwn4965fw_load="YES" +iwn5000fw_load="YES" +iwn5100fw_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for .Tn Intel -Wireless WiFi Link 4965AGN PCI-Express network adapters. +Wireless WiFi Link 4965 and 5000 series of PCI-Express network adapters. .Nm supports .Cm station , Modified: head/share/man/man4/iwnfw.4 ============================================================================== --- head/share/man/man4/iwnfw.4 Sun Oct 25 10:29:37 2009 (r198469) +++ head/share/man/man4/iwnfw.4 Sun Oct 25 11:01:53 2009 (r198470) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2009 +.Dd October 25, 2009 .Dt IWNFW 4 .Os .Sh NAME @@ -36,15 +36,26 @@ kernel configuration file: .Cd "device iwnfw" .Ed .Pp +This will include three firmware images inside the kernel. +If you want to pick only the firmware image for your network adapter choose one +of the following: +.Bd -ragged -offset indent +.Cd "device iwn4965fw" +.Cd "device iwn5000fw" +.Cd "device iwn5100fw" +.Ed +.Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -iwnfw_load="YES" +iwn4965fw_load="YES" +iwn5000fw_load="YES" +iwn5100fw_load="YES" .Ed .Sh DESCRIPTION This module provides access to firmware sets for the -Intel Wireless WiFi Link 4965AGN IEEE 802.11n adapters. +Intel Wireless WiFi Link 4965 and 5000 series of IEEE 802.11n adapters. It may be statically linked into the kernel, or loaded as a module. .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 13:00:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BFD9106568B; Sun, 25 Oct 2009 13:00:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id EAB498FC1B; Sun, 25 Oct 2009 13:00:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id E286341C6A1; Sun, 25 Oct 2009 14:00:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id Um2OUprslVPb; Sun, 25 Oct 2009 14:00:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 3B94341C67E; Sun, 25 Oct 2009 14:00:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 5BB5F4448E6; Sun, 25 Oct 2009 12:56:56 +0000 (UTC) Date: Sun, 25 Oct 2009 12:56:56 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Marcel Moolenaar In-Reply-To: <200910211838.n9LIc2wp007206@svn.freebsd.org> Message-ID: <20091025125628.Y91695@maildrop.int.zabbadoz.net> References: <200910211838.n9LIc2wp007206@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc64/sparc64 sun4v/sun4v vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 13:00:09 -0000 On Wed, 21 Oct 2009, Marcel Moolenaar wrote: > Author: marcel > Date: Wed Oct 21 18:38:02 2009 > New Revision: 198341 > URL: http://svn.freebsd.org/changeset/base/198341 > > Log: > o Introduce vm_sync_icache() for making the I-cache coherent with > the memory or D-cache, depending on the semantics of the platform. > vm_sync_icache() is basically a wrapper around pmap_sync_icache(), > that translates the vm_map_t argumument to pmap_t. > o Introduce pmap_sync_icache() to all PMAP implementation. For powerpc > it replaces the pmap_page_executable() function, added to solve > the I-cache problem in uiomove_fromphys(). > o In proc_rwmem() call vm_sync_icache() when writing to a page that > has execute permissions. This assures that when breakpoints are > written, the I-cache will be coherent and the process will actually > hit the breakpoint. > o This also fixes the Book-E PMAP implementation that was missing > necessary locking while trying to deal with the I-cache coherency > in pmap_enter() (read: mmu_booke_enter_locked). > > The key property of this change is that the I-cache is made coherent > *after* writes have been done. Doing it in the PMAP layer when adding > or changing a mapping means that the I-cache is made coherent *before* > any writes happen. The difference is key when the I-cache prefetches. mumble, yet another pmap function that lacks a man page:( /bz -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 15:52:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B2CE106566B; Sun, 25 Oct 2009 15:52:32 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AA508FC0A; Sun, 25 Oct 2009 15:52:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9PFqV4q062064; Sun, 25 Oct 2009 15:52:31 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9PFqVSv062063; Sun, 25 Oct 2009 15:52:31 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200910251552.n9PFqVSv062063@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 25 Oct 2009 15:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198471 - head/gnu/lib/libgcov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 15:52:32 -0000 Author: kan Date: Sun Oct 25 15:52:31 2009 New Revision: 198471 URL: http://svn.freebsd.org/changeset/base/198471 Log: Compile libgcov without stack protection. It can be linked into both static and dynamic binaries compiled with or without stack protection and should not depend on libssp_nonshared.a symbols. Discussed with: kib PR: bin/139052 Modified: head/gnu/lib/libgcov/Makefile Modified: head/gnu/lib/libgcov/Makefile ============================================================================== --- head/gnu/lib/libgcov/Makefile Sun Oct 25 11:01:53 2009 (r198470) +++ head/gnu/lib/libgcov/Makefile Sun Oct 25 15:52:31 2009 (r198471) @@ -2,6 +2,7 @@ NO_PROFILE= .include +MK_SSP= no .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" GCCDIR= ${.CURDIR}/../../../contrib/gcc From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 17:30:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5135C1065693; Sun, 25 Oct 2009 17:30:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40C608FC17; Sun, 25 Oct 2009 17:30:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9PHUpRo064546; Sun, 25 Oct 2009 17:30:51 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9PHUpLK064544; Sun, 25 Oct 2009 17:30:51 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200910251730.n9PHUpLK064544@svn.freebsd.org> From: Alan Cox Date: Sun, 25 Oct 2009 17:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198472 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 17:30:51 -0000 Author: alc Date: Sun Oct 25 17:30:50 2009 New Revision: 198472 URL: http://svn.freebsd.org/changeset/base/198472 Log: Eliminate an unnecessary check from vm_fault_prefault(). Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Oct 25 15:52:31 2009 (r198471) +++ head/sys/vm/vm_fault.c Sun Oct 25 17:30:50 2009 (r198472) @@ -1011,8 +1011,8 @@ vm_fault_prefault(pmap_t pmap, vm_offset while ((m = vm_page_lookup(lobject, pindex)) == NULL && lobject->type == OBJT_DEFAULT && (backing_object = lobject->backing_object) != NULL) { - if (lobject->backing_object_offset & PAGE_MASK) - break; + KASSERT((lobject->backing_object_offset & PAGE_MASK) == + 0, ("vm_fault_prefault: unaligned object offset")); pindex += lobject->backing_object_offset >> PAGE_SHIFT; VM_OBJECT_LOCK(backing_object); VM_OBJECT_UNLOCK(lobject); From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 17:47:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00512106566B; Sun, 25 Oct 2009 17:47:52 +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 CA2988FC12; Sun, 25 Oct 2009 17:47:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9PHlqaU064869; Sun, 25 Oct 2009 17:47:52 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9PHlqDF064867; Sun, 25 Oct 2009 17:47:52 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910251747.n9PHlqDF064867@svn.freebsd.org> From: Christian Brueffer Date: Sun, 25 Oct 2009 17:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198473 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 17:47:53 -0000 Author: brueffer Date: Sun Oct 25 17:47:52 2009 New Revision: 198473 URL: http://svn.freebsd.org/changeset/base/198473 Log: Spell out the name of the month. Modified: head/share/man/man4/bge.4 Modified: head/share/man/man4/bge.4 ============================================================================== --- head/share/man/man4/bge.4 Sun Oct 25 17:30:50 2009 (r198472) +++ head/share/man/man4/bge.4 Sun Oct 25 17:47:52 2009 (r198473) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 7, 2009 +.Dd October 7, 2009 .Dt BGE 4 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 20:25:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A0CE106568D; Sun, 25 Oct 2009 20:25:43 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 0FFF78FC1C; Sun, 25 Oct 2009 20:25:42 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id n9PKPft7083717; Sun, 25 Oct 2009 21:25:41 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id n9PKPfjm083716; Sun, 25 Oct 2009 21:25:41 +0100 (CET) (envelope-from marius) Date: Sun, 25 Oct 2009 21:25:41 +0100 From: Marius Strobl To: Marcel Moolenaar Message-ID: <20091025202541.GC94979@alchemy.franken.de> References: <200910211838.n9LIc2wp007206@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200910211838.n9LIc2wp007206@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc64/sparc64 sun4v/sun4v vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 20:25:43 -0000 On Wed, Oct 21, 2009 at 06:38:02PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Wed Oct 21 18:38:02 2009 > New Revision: 198341 > URL: http://svn.freebsd.org/changeset/base/198341 > > Log: > o Introduce vm_sync_icache() for making the I-cache coherent with > the memory or D-cache, depending on the semantics of the platform. > vm_sync_icache() is basically a wrapper around pmap_sync_icache(), > that translates the vm_map_t argumument to pmap_t. > o Introduce pmap_sync_icache() to all PMAP implementation. For powerpc > it replaces the pmap_page_executable() function, added to solve > the I-cache problem in uiomove_fromphys(). > o In proc_rwmem() call vm_sync_icache() when writing to a page that > has execute permissions. This assures that when breakpoints are > written, the I-cache will be coherent and the process will actually > hit the breakpoint. > o This also fixes the Book-E PMAP implementation that was missing > necessary locking while trying to deal with the I-cache coherency > in pmap_enter() (read: mmu_booke_enter_locked). > > The key property of this change is that the I-cache is made coherent > *after* writes have been done. Doing it in the PMAP layer when adding > or changing a mapping means that the I-cache is made coherent *before* > any writes happen. The difference is key when the I-cache prefetches. > Do you have a simple test case demonstrating the need for I-cache synchronisation? Marius From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 21:37:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 564D91065670; Sun, 25 Oct 2009 21:37:56 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout024.mac.com (asmtpout024.mac.com [17.148.16.99]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2B98FC08; Sun, 25 Oct 2009 21:37:56 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii; format=flowed Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp024.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KS300F74AQV8N10@asmtp024.mac.com>; Sun, 25 Oct 2009 14:37:55 -0700 (PDT) From: Marcel Moolenaar In-reply-to: <20091025202541.GC94979@alchemy.franken.de> Date: Sun, 25 Oct 2009 14:37:40 -0700 Message-id: <36313C38-9B60-4BF3-885C-5BAAA915DCFE@mac.com> References: <200910211838.n9LIc2wp007206@svn.freebsd.org> <20091025202541.GC94979@alchemy.franken.de> To: Marius Strobl X-Mailer: Apple Mail (2.1076) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc64/sparc64 sun4v/sun4v vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 21:37:56 -0000 On Oct 25, 2009, at 1:25 PM, Marius Strobl wrote: > > Do you have a simple test case demonstrating the need for > I-cache synchronisation? I typically use GDB. If breakpoints aren't being hit or next isn't behaving correctly, you typically have an I-cache problem. If you get to run GDB, you probably already know whether it's needed, because processes tend to die with random signals at startup when the architecture needs explicit I-cache coherency logic and the kernel doesn't have it. A special case I would say is executing from a memory disk. The I/O path contains bcopy() operations, which dirty the D-cache and trigger I-cache coherency bugs pretty well. I didn't have issues with that on my Netra, so I didn't implement pmap_sync_icache for sparc64. This is not to say that it's absolutely not needed, just that GDB didn't expose problems. If sparc64 has some of the same kluges powerpc had, then I-cache coherency is handled in some other (most likely a sub-optimal) way. FYI, -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Sun Oct 25 21:46:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3D301065696; Sun, 25 Oct 2009 21:46:39 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92CC48FC14; Sun, 25 Oct 2009 21:46:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9PLkd52069517; Sun, 25 Oct 2009 21:46:39 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9PLkdo3069516; Sun, 25 Oct 2009 21:46:39 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200910252146.n9PLkdo3069516@svn.freebsd.org> From: Ulf Lilleengen Date: Sun, 25 Oct 2009 21:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198475 - in head: share/man/man4 sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2009 21:46:39 -0000 Author: lulf Date: Sun Oct 25 21:46:38 2009 New Revision: 198475 URL: http://svn.freebsd.org/changeset/base/198475 Log: - Add support for Marvell Yukon 88E8042 device. Submitted by: Mario Lobo Approved by: yongari Modified: head/share/man/man4/msk.4 head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/share/man/man4/msk.4 ============================================================================== --- head/share/man/man4/msk.4 Sun Oct 25 19:13:39 2009 (r198474) +++ head/share/man/man4/msk.4 Sun Oct 25 21:46:38 2009 (r198475) @@ -190,6 +190,8 @@ Marvell Yukon 88E8040 Fast Ethernet .It Marvell Yukon 88E8040T Fast Ethernet .It +Marvell Yukon 88E8042 Fast Ethernet +.It Marvell Yukon 88E8048 Fast Ethernet .It Marvell Yukon 88E8050 Gigabit Ethernet Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Sun Oct 25 19:13:39 2009 (r198474) +++ head/sys/dev/msk/if_msk.c Sun Oct 25 21:46:38 2009 (r198475) @@ -201,6 +201,8 @@ static struct msk_product { "Marvell Yukon 88E8040 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_8040T, "Marvell Yukon 88E8040T Fast Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_8042, + "Marvell Yukon 88E8042 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_8048, "Marvell Yukon 88E8048 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4361, Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Sun Oct 25 19:13:39 2009 (r198474) +++ head/sys/dev/msk/if_mskreg.h Sun Oct 25 21:46:38 2009 (r198475) @@ -133,6 +133,7 @@ #define DEVICEID_MRVL_8039 0x4353 #define DEVICEID_MRVL_8040 0x4354 #define DEVICEID_MRVL_8040T 0x4355 +#define DEVICEID_MRVL_8042 0x4357 #define DEVICEID_MRVL_8048 0x435A #define DEVICEID_MRVL_4360 0x4360 #define DEVICEID_MRVL_4361 0x4361 From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 00:01:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 981FD1065676; Mon, 26 Oct 2009 00:01:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF458FC12; Mon, 26 Oct 2009 00:01:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9Q01qa5071921; Mon, 26 Oct 2009 00:01:52 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9Q01qcw071919; Mon, 26 Oct 2009 00:01:52 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200910260001.n9Q01qcw071919@svn.freebsd.org> From: Alan Cox Date: Mon, 26 Oct 2009 00:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198476 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 00:01:52 -0000 Author: alc Date: Mon Oct 26 00:01:52 2009 New Revision: 198476 URL: http://svn.freebsd.org/changeset/base/198476 Log: Simplify the inner loop of vm_fault_copy_entry(). Reviewed by: kib Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Oct 25 21:46:38 2009 (r198475) +++ head/sys/vm/vm_fault.c Mon Oct 26 00:01:52 2009 (r198476) @@ -1133,20 +1133,20 @@ vm_fault_copy_entry(vm_map_t dst_map, vm { vm_object_t backing_object, dst_object, object; vm_object_t src_object; - vm_ooffset_t dst_offset; - vm_ooffset_t src_offset; - vm_pindex_t pindex; + vm_pindex_t dst_pindex, pindex, src_pindex; vm_prot_t prot; vm_offset_t vaddr; vm_page_t dst_m; vm_page_t src_m; + boolean_t src_readonly; #ifdef lint src_map++; #endif /* lint */ src_object = src_entry->object.vm_object; - src_offset = src_entry->offset; + src_pindex = OFF_TO_IDX(src_entry->offset); + src_readonly = (src_entry->protection & VM_PROT_WRITE) == 0; /* * Create the top-level object for the destination entry. (Doesn't @@ -1177,16 +1177,16 @@ vm_fault_copy_entry(vm_map_t dst_map, vm * one from the source object (it should be there) to the destination * object. */ - for (vaddr = dst_entry->start, dst_offset = 0; + for (vaddr = dst_entry->start, dst_pindex = 0; vaddr < dst_entry->end; - vaddr += PAGE_SIZE, dst_offset += PAGE_SIZE) { + vaddr += PAGE_SIZE, dst_pindex++) { /* - * Allocate a page in the destination object + * Allocate a page in the destination object. */ do { - dst_m = vm_page_alloc(dst_object, - OFF_TO_IDX(dst_offset), VM_ALLOC_NORMAL); + dst_m = vm_page_alloc(dst_object, dst_pindex, + VM_ALLOC_NORMAL); if (dst_m == NULL) { VM_OBJECT_UNLOCK(dst_object); VM_WAIT; @@ -1201,10 +1201,9 @@ vm_fault_copy_entry(vm_map_t dst_map, vm */ VM_OBJECT_LOCK(src_object); object = src_object; - pindex = 0; - while ((src_m = vm_page_lookup(object, pindex + - OFF_TO_IDX(dst_offset + src_offset))) == NULL && - (src_entry->protection & VM_PROT_WRITE) == 0 && + pindex = src_pindex + dst_pindex; + while ((src_m = vm_page_lookup(object, pindex)) == NULL && + src_readonly && (backing_object = object->backing_object) != NULL) { /* * Allow fallback to backing objects if we are reading. From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 06:51:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 982DF106566B; Mon, 26 Oct 2009 06:51:21 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 875DD8FC12; Mon, 26 Oct 2009 06:51:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9Q6pLeo080068; Mon, 26 Oct 2009 06:51:21 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9Q6pLfU080067; Mon, 26 Oct 2009 06:51:21 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200910260651.n9Q6pLfU080067@svn.freebsd.org> From: Colin Percival Date: Mon, 26 Oct 2009 06:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198477 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 06:51:21 -0000 Author: cperciva Date: Mon Oct 26 06:51:20 2009 New Revision: 198477 URL: http://svn.freebsd.org/changeset/base/198477 Log: Eject CDROM after installation if used as source media. Submitted by: randi MFC after: 1 month Modified: head/usr.sbin/sysinstall/cdrom.c Modified: head/usr.sbin/sysinstall/cdrom.c ============================================================================== --- head/usr.sbin/sysinstall/cdrom.c Mon Oct 26 00:01:52 2009 (r198476) +++ head/usr.sbin/sysinstall/cdrom.c Mon Oct 26 06:51:20 2009 (r198477) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -58,6 +59,8 @@ static Boolean previouslyMounted; /* Was static char mountpoint[MAXPATHLEN] = "/dist"; int CDROMInitQuiet; +static void mediaEjectCDROM(Device *dev); + static properties read_props(char *name) { @@ -218,4 +221,23 @@ mediaShutdownCDROM(Device *dev) msgConfirm("Could not unmount the CDROM/DVD from %s: %s", mountpoint, strerror(errno)); else cdromMounted = FALSE; + + mediaEjectCDROM(dev); +} + +static void +mediaEjectCDROM(Device *dev) +{ + int fd = -1; + + msgDebug("Ejecting CDROM/DVD at %s", dev->devname); + + fd = open(dev->devname, O_RDONLY); + + if (fd < 0) + msgDebug("Could not eject the CDROM/DVD from %s: %s", dev->devname, strerror(errno)); + else { + ioctl(fd, CDIOCALLOW); + ioctl(fd, CDIOCEJECT); + } } From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 07:43:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8132D1065676; Mon, 26 Oct 2009 07:43:42 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 705BA8FC13; Mon, 26 Oct 2009 07:43:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9Q7hgW3081071; Mon, 26 Oct 2009 07:43:42 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9Q7hgap081068; Mon, 26 Oct 2009 07:43:42 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200910260743.n9Q7hgap081068@svn.freebsd.org> From: Ulf Lilleengen Date: Mon, 26 Oct 2009 07:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198478 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 07:43:42 -0000 Author: lulf Date: Mon Oct 26 07:43:41 2009 New Revision: 198478 URL: http://svn.freebsd.org/changeset/base/198478 Log: - Initialize variable in order to avoid GCC warning and enable WARNS=6. PR: bin/139970 Submitted by: Ulrich Spörlein Modified: head/sbin/geom/class/part/Makefile head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/Makefile ============================================================================== --- head/sbin/geom/class/part/Makefile Mon Oct 26 06:51:20 2009 (r198477) +++ head/sbin/geom/class/part/Makefile Mon Oct 26 07:43:41 2009 (r198478) @@ -6,6 +6,4 @@ CLASS= part LDADD= -lutil -WARNS?= 4 - .include Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Mon Oct 26 06:51:20 2009 (r198477) +++ head/sbin/geom/class/part/geom_part.c Mon Oct 26 07:43:41 2009 (r198478) @@ -192,6 +192,7 @@ find_provider(struct ggeom *gp, unsigned unsigned long long sector, bestsector; bestpp = NULL; + bestsector = 0; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "start"); if (s == NULL) { From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 08:41:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8EFF106566B; Mon, 26 Oct 2009 08:41: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 97F3A8FC19; Mon, 26 Oct 2009 08:41:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9Q8fAb0082169; Mon, 26 Oct 2009 08:41:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9Q8fAiK082167; Mon, 26 Oct 2009 08:41:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200910260841.n9Q8fAiK082167@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Oct 2009 08:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198479 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 08:41:10 -0000 Author: mav Date: Mon Oct 26 08:41:10 2009 New Revision: 198479 URL: http://svn.freebsd.org/changeset/base/198479 Log: Fix SATA on nVidia MCP55 chipset. It needs some short time to allow BAR(5) memory access. PR: amd64/128686, amd64/132372, amd64/139156 MFC after: 3 days Modified: head/sys/dev/ata/chipsets/ata-nvidia.c Modified: head/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-nvidia.c Mon Oct 26 07:43:41 2009 (r198478) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Mon Oct 26 08:41:10 2009 (r198479) @@ -165,7 +165,8 @@ ata_nvidia_chipinit(device_t dev) /* enable control access */ pci_write_config(dev, 0x50, pci_read_config(dev, 0x50, 1) | 0x04,1); - + /* MCP55 seems to need some time to allow r_res2 read. */ + DELAY(10); if (ctlr->chip->cfg1 & NVQ) { /* clear interrupt status */ ATA_OUTL(ctlr->r_res2, offset, 0x00ff00ff); From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 09:16:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C05C1065693; Mon, 26 Oct 2009 09:16:09 +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 2B0648FC16; Mon, 26 Oct 2009 09:16:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9Q9G91b082901; Mon, 26 Oct 2009 09:16:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9Q9G9ab082899; Mon, 26 Oct 2009 09:16:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200910260916.n9Q9G9ab082899@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Oct 2009 09:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198480 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 09:16:09 -0000 Author: mav Date: Mon Oct 26 09:16:08 2009 New Revision: 198480 URL: http://svn.freebsd.org/changeset/base/198480 Log: Document atapci kernel module split. PR: amd64/139859 MFC after: 3 days Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Oct 26 08:41:10 2009 (r198479) +++ head/UPDATING Mon Oct 26 09:16:08 2009 (r198480) @@ -632,6 +632,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. userland (libpmc(3)) and the kernel module (hwpmc(4)) in sync. +20081009: + atapci kernel module now includes only generic PCI ATA + driver. AHCI driver moved to ataahci kernel module. + All vendor-specific code moved into separate kernel modules: + ataacard, ataacerlabs, ataadaptec, ataamd, ataati, atacenatek, + atacypress, atacyrix, atahighpoint, ataintel, ataite, atajmicron, + atamarvell, atamicron, atanational, atanetcell, atanvidia, + atapromise, ataserverworks, atasiliconimage, atasis, atavia + 20080820: The TTY subsystem of the kernel has been replaced by a new implementation, which provides better scalability and an From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 10:01:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60FA5106568D; Mon, 26 Oct 2009 10:01:00 +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 4F4258FC19; Mon, 26 Oct 2009 10:01:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QA10Xm083749; Mon, 26 Oct 2009 10:01:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QA10sk083746; Mon, 26 Oct 2009 10:01:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200910261001.n9QA10sk083746@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Oct 2009 10:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198481 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 10:01:00 -0000 Author: mav Date: Mon Oct 26 10:00:59 2009 New Revision: 198481 URL: http://svn.freebsd.org/changeset/base/198481 Log: Add two more VIA SATA chip IDs. PR: kern/135057 Modified: head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-via.c Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Mon Oct 26 09:16:08 2009 (r198480) +++ head/sys/dev/ata/ata-pci.h Mon Oct 26 10:00:59 2009 (r198481) @@ -415,6 +415,8 @@ struct ata_pci_controller { #define ATA_VIA8237 0x32271106 #define ATA_VIA8237A 0x05911106 #define ATA_VIA8237S 0x53371106 +#define ATA_VIA8237_5372 0x53721106 +#define ATA_VIA8237_7372 0x73721106 #define ATA_VIA8251 0x33491106 #define ATA_VIA8361 0x31121106 #define ATA_VIA8363 0x03051106 Modified: head/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-via.c Mon Oct 26 09:16:08 2009 (r198480) +++ head/sys/dev/ata/chipsets/ata-via.c Mon Oct 26 10:00:59 2009 (r198481) @@ -103,6 +103,8 @@ ata_via_probe(device_t dev) { ATA_VIA6421, 0x00, 6, VIABAR, ATA_SA150, "6421" }, { ATA_VIA8237A, 0x00, 7, 0x00, ATA_SA150, "8237A" }, { ATA_VIA8237S, 0x00, 7, 0x00, ATA_SA150, "8237S" }, + { ATA_VIA8237_5372, 0x00, 7, 0x00, ATA_SA300, "8237" }, + { ATA_VIA8237_7372, 0x00, 7, 0x00, ATA_SA300, "8237" }, { ATA_VIA8251, 0x00, 0, VIAAHCI, ATA_SA300, "8251" }, { 0, 0, 0, 0, 0, 0 }}; From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 10:07:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C03BB1065693; Mon, 26 Oct 2009 10:07:41 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [66.246.138.153]) by mx1.freebsd.org (Postfix) with ESMTP id 673DC8FC18; Mon, 26 Oct 2009 10:07:41 +0000 (UTC) Received: from unknown (87-194-158-129.bethere.co.uk [87.194.158.129]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 2546A832A; Mon, 26 Oct 2009 10:07:40 +0000 (UTC) Date: Mon, 26 Oct 2009 10:07:35 +0000 From: Bruce Cran To: Alexander Motin Message-ID: <20091026100735.00006cf5@unknown> In-Reply-To: <200910260916.n9Q9G9ab082899@svn.freebsd.org> References: <200910260916.n9Q9G9ab082899@svn.freebsd.org> X-Mailer: Claws Mail 3.7.2cvs15 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198480 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 10:07:41 -0000 On Mon, 26 Oct 2009 09:16:09 +0000 (UTC) Alexander Motin wrote: > Author: mav > Date: Mon Oct 26 09:16:08 2009 > New Revision: 198480 > URL: http://svn.freebsd.org/changeset/base/198480 > > Log: > Document atapci kernel module split. > > PR: amd64/139859 > MFC after: 3 days Could you take a look at kern/133162 please? It contains a patch which adds documentation of the ata modules to /sys/conf/NOTES . -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 10:07:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEB80106568B; Mon, 26 Oct 2009 10:07:52 +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 9D5A28FC1A; Mon, 26 Oct 2009 10:07:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QA7qmU083896; Mon, 26 Oct 2009 10:07:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QA7qB6083894; Mon, 26 Oct 2009 10:07:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200910261007.n9QA7qB6083894@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Oct 2009 10:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198482 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 10:07:52 -0000 Author: mav Date: Mon Oct 26 10:07:52 2009 New Revision: 198482 URL: http://svn.freebsd.org/changeset/base/198482 Log: Add IDs for PATA part also. Modified: head/sys/dev/ata/chipsets/ata-via.c Modified: head/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-via.c Mon Oct 26 10:00:59 2009 (r198481) +++ head/sys/dev/ata/chipsets/ata-via.c Mon Oct 26 10:07:52 2009 (r198482) @@ -95,6 +95,8 @@ ata_via_probe(device_t dev) { ATA_VIA8237, 0x00, VIA133, 0x00, ATA_UDMA6, "8237" }, { ATA_VIA8237A, 0x00, VIA133, 0x00, ATA_UDMA6, "8237A" }, { ATA_VIA8237S, 0x00, VIA133, 0x00, ATA_UDMA6, "8237S" }, + { ATA_VIA8237_5372, 0x00, VIA133, 0x00, ATA_UDMA6, "8237" }, + { ATA_VIA8237_7372, 0x00, VIA133, 0x00, ATA_UDMA6, "8237" }, { ATA_VIA8251, 0x00, VIA133, 0x00, ATA_UDMA6, "8251" }, { 0, 0, 0, 0, 0, 0 }}; static struct ata_chip_id new_ids[] = From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 10:35:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61083106566C; Mon, 26 Oct 2009 10:35:17 +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 3657C8FC0C; Mon, 26 Oct 2009 10:35:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QAZHd4084490; Mon, 26 Oct 2009 10:35:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QAZHGR084488; Mon, 26 Oct 2009 10:35:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200910261035.n9QAZHGR084488@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Oct 2009 10:35:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198483 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 10:35:17 -0000 Author: mav Date: Mon Oct 26 10:35:16 2009 New Revision: 198483 URL: http://svn.freebsd.org/changeset/base/198483 Log: Document new modularised ATA kernel options. PR: kern/133162 MFC after: 3 days Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Oct 26 10:07:52 2009 (r198482) +++ head/sys/conf/NOTES Mon Oct 26 10:35:16 2009 (r198483) @@ -1657,6 +1657,10 @@ device siis # The 'ATA' driver supports all ATA and ATAPI devices, including PC Card # devices. You only need one "device ata" for it to find all # PCI and PC Card ATA/ATAPI devices on modern machines. +# Alternatively, individual bus and chipset drivers may be chosen by using +# the 'atacore' driver then selecting the drivers on a per vendor basis. +# For example to build a system which only supports a VIA chipset, +# omit 'ata' and include the 'atacore', 'atapci' and 'atavia' drivers. device ata device atadisk # ATA disk drives device ataraid # ATA RAID drives @@ -1665,6 +1669,39 @@ device atapifd # ATAPI floppy drives device atapist # ATAPI tape drives device atapicam # emulate ATAPI devices as SCSI ditto via CAM # needs CAM to be present (scbus & pass) + +# Modular ATA +#device atacore # Core ATA functionality +#device atacard # CARDBUS support +#device atabus # PC98 cbus support +#device ataisa # ISA bus support +#device atapci # PCI bus support; only generic chipset support + +# PCI ATA chipsets +#device ataahci # AHCI SATA +#device ataacard # ACARD +#device ataacerlabs # Acer Labs Inc. (ALI) +#device ataadaptec # Adaptec +#device ataamd # American Micro Devices (AMD) +#device ataati # ATI +#device atacenatek # Cenatek +#device atacypress # Cypress +#device atacyrix # Cyrix +#device atahighpoint # HighPoint +#device ataintel # Intel +#device ataite # Integrated Technology Inc. (ITE) +#device atajmicron # JMicron +#device atamarvell # Marvell +#device atamicron # Micron +#device atanational # National +#device atanetcell # NetCell +#device atanvidia # nVidia +#device atapromise # Promise +#device ataserverworks # ServerWorks +#device atasiliconimage # Silicon Image Inc. (SiI) (formerly CMD) +#device atasis # Silicon Integrated Systems Corp.(SiS) +#device atavia # VIA Technologies Inc. + # # For older non-PCI, non-PnPBIOS systems, these are the hints lines to add: hint.ata.0.at="isa" From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 11:20:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58F2C1065679; Mon, 26 Oct 2009 11:20:15 +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 47B088FC0C; Mon, 26 Oct 2009 11:20:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QBKFpQ086931; Mon, 26 Oct 2009 11:20:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QBKFUw086926; Mon, 26 Oct 2009 11:20:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200910261120.n9QBKFUw086926@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Oct 2009 11:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198486 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 11:20:15 -0000 Author: mav Date: Mon Oct 26 11:20:14 2009 New Revision: 198486 URL: http://svn.freebsd.org/changeset/base/198486 Log: Increase ATA command timeouts. Some drives need more then 5s to spin-up. PR: kern/111023 Modified: head/sys/dev/ata/ata-disk.c head/sys/dev/ata/ata-queue.c head/sys/dev/ata/ata-raid.c head/sys/dev/ata/atapi-cd.c Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Mon Oct 26 11:00:37 2009 (r198485) +++ head/sys/dev/ata/ata-disk.c Mon Oct 26 11:20:14 2009 (r198486) @@ -230,7 +230,7 @@ ad_spindown(void *priv) } request->dev = dev; request->flags = ATA_R_CONTROL; - request->timeout = 5; + request->timeout = 10; request->retries = 1; request->callback = ad_power_callback; request->u.ata.command = ATA_STANDBY_IMMEDIATE; @@ -265,7 +265,7 @@ ad_strategy(struct bio *bp) request->timeout = 31; } else { - request->timeout = 5; + request->timeout = 10; } request->retries = 2; request->data = bp->bio_data; @@ -468,7 +468,7 @@ ad_set_geometry(device_t dev) request->u.ata.count = 0; request->u.ata.feature = 0; request->flags = ATA_R_CONTROL | ATA_R_QUIET; - request->timeout = 5; + request->timeout = 10; request->retries = 0; ata_queue_request(request); if (request->status & ATA_S_ERROR) @@ -487,7 +487,7 @@ ad_set_geometry(device_t dev) request->u.ata.count = 1; request->u.ata.feature = 0; request->flags = ATA_R_CONTROL; - request->timeout = 5; + request->timeout = 10; request->retries = 0; ata_queue_request(request); if (request->status & ATA_S_ERROR) Modified: head/sys/dev/ata/ata-queue.c ============================================================================== --- head/sys/dev/ata/ata-queue.c Mon Oct 26 11:00:37 2009 (r198485) +++ head/sys/dev/ata/ata-queue.c Mon Oct 26 11:20:14 2009 (r198486) @@ -135,7 +135,7 @@ ata_controlcmd(device_t dev, u_int8_t co atadev->spindown_state = 0; request->timeout = 31; } else { - request->timeout = 5; + request->timeout = 10; } request->retries = 0; ata_queue_request(request); @@ -389,7 +389,7 @@ ata_completed(void *context, int dummy) request->bytecount = sizeof(struct atapi_sense); request->donecount = 0; request->transfersize = sizeof(struct atapi_sense); - request->timeout = 5; + request->timeout = 10; request->flags &= (ATA_R_ATAPI | ATA_R_QUIET | ATA_R_DEBUG); request->flags |= (ATA_R_READ | ATA_R_AT_HEAD | ATA_R_REQUEUE); ATA_DEBUG_RQ(request, "autoissue request sense"); Modified: head/sys/dev/ata/ata-raid.c ============================================================================== --- head/sys/dev/ata/ata-raid.c Mon Oct 26 11:00:37 2009 (r198485) +++ head/sys/dev/ata/ata-raid.c Mon Oct 26 11:20:14 2009 (r198486) @@ -273,7 +273,7 @@ ata_raid_flush(struct bio *bp) request->u.ata.lba = 0; request->u.ata.count = 0; request->u.ata.feature = 0; - request->timeout = 1; + request->timeout = 10; request->retries = 0; request->flags |= ATA_R_ORDERED | ATA_R_DIRECT; ata_queue_request(request); @@ -4371,7 +4371,7 @@ ata_raid_init_request(device_t dev, stru return NULL; } request->dev = dev; - request->timeout = 5; + request->timeout = 10; request->retries = 2; request->callback = ata_raid_done; request->driver = rdp; Modified: head/sys/dev/ata/atapi-cd.c ============================================================================== --- head/sys/dev/ata/atapi-cd.c Mon Oct 26 11:00:37 2009 (r198485) +++ head/sys/dev/ata/atapi-cd.c Mon Oct 26 11:20:14 2009 (r198486) @@ -700,7 +700,7 @@ acd_geom_access(struct g_provider *pp, i request->dev = dev; bcopy(ccb, request->u.atapi.ccb, 16); request->flags = ATA_R_ATAPI; - request->timeout = 5; + request->timeout = 10; ata_queue_request(request); if (!request->error && (request->u.atapi.sense.key == 2 || From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 11:23:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F70110656BC; Mon, 26 Oct 2009 11:23:42 +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 1C8368FC16; Mon, 26 Oct 2009 11:23:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QBNf3D087030; Mon, 26 Oct 2009 11:23:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QBNfJY087028; Mon, 26 Oct 2009 11:23:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200910261123.n9QBNfJY087028@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Oct 2009 11:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198487 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 11:23:42 -0000 Author: mav Date: Mon Oct 26 11:23:41 2009 New Revision: 198487 URL: http://svn.freebsd.org/changeset/base/198487 Log: Round timeout up when converting CAM milliseconds to ATA seconds. Modified: head/sys/dev/ata/atapi-cam.c Modified: head/sys/dev/ata/atapi-cam.c ============================================================================== --- head/sys/dev/ata/atapi-cam.c Mon Oct 26 11:20:14 2009 (r198486) +++ head/sys/dev/ata/atapi-cam.c Mon Oct 26 11:23:41 2009 (r198487) @@ -629,7 +629,7 @@ atapi_action(struct cam_sim *sim, union request->data = buf; request->bytecount = len; request->transfersize = min(request->bytecount, 65534); - request->timeout = ccb_h->timeout / 1000; /* XXX lost granularity */ + request->timeout = (ccb_h->timeout + 999) / 1000; request->callback = &atapi_cb; request->flags = request_flags; @@ -732,7 +732,7 @@ atapi_cb(struct ata_request *request) request->data = (caddr_t)&csio->sense_data; request->bytecount = sizeof(struct atapi_sense); request->transfersize = min(request->bytecount, 65534); - request->timeout = csio->ccb_h.timeout / 1000; + request->timeout = (csio->ccb_h.timeout + 999) / 1000; request->retries = 2; request->flags = ATA_R_QUIET|ATA_R_ATAPI|ATA_R_IMMEDIATE; hcb->flags |= AUTOSENSE; From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 11:26:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 812BB10656A3; Mon, 26 Oct 2009 11:26:49 +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 7060B8FC22; Mon, 26 Oct 2009 11:26:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QBQnFX087113; Mon, 26 Oct 2009 11:26:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QBQnVp087111; Mon, 26 Oct 2009 11:26:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200910261126.n9QBQnVp087111@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Oct 2009 11:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198488 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 11:26:49 -0000 Author: mav Date: Mon Oct 26 11:26:49 2009 New Revision: 198488 URL: http://svn.freebsd.org/changeset/base/198488 Log: Report SATA speeds to CAM, to not confuse users with low numbers logged. Modified: head/sys/dev/ata/atapi-cam.c Modified: head/sys/dev/ata/atapi-cam.c ============================================================================== --- head/sys/dev/ata/atapi-cam.c Mon Oct 26 11:23:41 2009 (r198487) +++ head/sys/dev/ata/atapi-cam.c Mon Oct 26 11:26:49 2009 (r198488) @@ -414,6 +414,12 @@ atapi_action(struct cam_sim *sim, union case ATA_UDMA6: cpi->base_transfer_speed = 133000; break; + case ATA_SA150: + cpi->base_transfer_speed = 150000; + break; + case ATA_SA300: + cpi->base_transfer_speed = 300000; + break; default: break; } From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 13:03:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A94C5106566C; Mon, 26 Oct 2009 13:03:52 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 982158FC13; Mon, 26 Oct 2009 13:03:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QD3qLv091177; Mon, 26 Oct 2009 13:03:52 GMT (envelope-from rafan@svn.freebsd.org) Received: (from rafan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QD3qX5091175; Mon, 26 Oct 2009 13:03:52 GMT (envelope-from rafan@svn.freebsd.org) Message-Id: <200910261303.n9QD3qX5091175@svn.freebsd.org> From: Rong-En Fan Date: Mon, 26 Oct 2009 13:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198490 - in head/contrib/ncurses: . ncurses/base X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 13:03:52 -0000 Author: rafan Date: Mon Oct 26 13:03:52 2009 New Revision: 198490 URL: http://svn.freebsd.org/changeset/base/198490 Log: Merge r198489 from vendor/ncurses/dist: Pull upstream patch to fix ee(1) crash when received SIGWINCH: modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a SIGWINCH, and discard that value, to avoid confusing application (patch by Eygene Ryabinkin, FreeBSD bin/136223). PR: 136223 Submitted by: Eygene Ryabinkin Obtained from: ncurses-5.7-20091024 snapshot MFC after: 3 days Modified: head/contrib/ncurses/ (props changed) head/contrib/ncurses/ncurses/base/lib_getch.c Modified: head/contrib/ncurses/ncurses/base/lib_getch.c ============================================================================== --- head/contrib/ncurses/ncurses/base/lib_getch.c Mon Oct 26 13:01:29 2009 (r198489) +++ head/contrib/ncurses/ncurses/base/lib_getch.c Mon Oct 26 13:03:52 2009 (r198490) @@ -476,6 +476,12 @@ _nc_wgetch(WINDOW *win, /* resizeterm can push KEY_RESIZE */ if (cooked_key_in_fifo()) { *result = fifo_pull(sp); + /* + * Get the ERR from queue -- it is from WINCH, + * so we should take it out, the "error" is handled. + */ + if (fifo_peek(sp) == -1) + fifo_pull(sp); returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK); } } From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 14:42:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 6417F1065694; Mon, 26 Oct 2009 14:42:52 +0000 (UTC) Date: Mon, 26 Oct 2009 14:42:52 +0000 From: Alexey Dokuchaev To: Alexander Motin Message-ID: <20091026144252.GA11752@FreeBSD.org> References: <200910261120.n9QBKFUw086926@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <200910261120.n9QBKFUw086926@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198486 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 14:42:52 -0000 On Mon, Oct 26, 2009 at 11:20:15AM +0000, Alexander Motin wrote: > Author: mav > Date: Mon Oct 26 11:20:14 2009 > New Revision: 198486 > URL: http://svn.freebsd.org/changeset/base/198486 > > Log: > Increase ATA command timeouts. Some drives need more then 5s to spin-up. Can't it be factored out into a macro so one does not have to make a bunch of those identical changes over several files shall it be required to adjust timeout again some time in the future? ./danfe From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 14:51:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4DD4106568B; Mon, 26 Oct 2009 14:51:56 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1783B8FC24; Mon, 26 Oct 2009 14:51:54 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA01518; Mon, 26 Oct 2009 16:51:53 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <4AE5B788.5060407@freebsd.org> Date: Mon, 26 Oct 2009 16:51:52 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Alexey Dokuchaev References: <200910261120.n9QBKFUw086926@svn.freebsd.org> <20091026144252.GA11752@FreeBSD.org> In-Reply-To: <20091026144252.GA11752@FreeBSD.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r198486 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 14:51:56 -0000 on 26/10/2009 16:42 Alexey Dokuchaev said the following: > On Mon, Oct 26, 2009 at 11:20:15AM +0000, Alexander Motin wrote: >> Author: mav >> Date: Mon Oct 26 11:20:14 2009 >> New Revision: 198486 >> URL: http://svn.freebsd.org/changeset/base/198486 >> >> Log: >> Increase ATA command timeouts. Some drives need more then 5s to spin-up. > > Can't it be factored out into a macro so one does not have to make a bunch > of those identical changes over several files shall it be required to > adjust timeout again some time in the future? If this is to happen, then I'd like them to become sysctls too. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 14:57:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F86F1065670; Mon, 26 Oct 2009 14:57:34 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EBCD8FC0A; Mon, 26 Oct 2009 14:57:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QEvY3C093315; Mon, 26 Oct 2009 14:57:34 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QEvYtc093313; Mon, 26 Oct 2009 14:57:34 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200910261457.n9QEvYtc093313@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 26 Oct 2009 14:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198491 - head/sbin/mount_nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 14:57:34 -0000 Author: jh Date: Mon Oct 26 14:57:33 2009 New Revision: 198491 URL: http://svn.freebsd.org/changeset/base/198491 Log: Fix parsing of mount options specified with -o in case an option with value is preceded by an option without value (for example -o option1,option2=value). Options must be separated before searching for '='. Also compare pnextopt explicitly against NULL. PR: bin/134069 Approved by: trasz (mentor) Modified: head/sbin/mount_nfs/mount_nfs.c Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Mon Oct 26 13:03:52 2009 (r198490) +++ head/sbin/mount_nfs/mount_nfs.c Mon Oct 26 14:57:33 2009 (r198491) @@ -232,16 +232,16 @@ main(int argc, char *argv[]) char *pnextopt = NULL; char *val = ""; pass_flag_to_nmount = 1; - pval = strchr(opt, '='); pnextopt = strchr(opt, ','); + if (pnextopt != NULL) { + *pnextopt = '\0'; + pnextopt++; + } + pval = strchr(opt, '='); if (pval != NULL) { *pval = '\0'; val = pval + 1; } - if (pnextopt) { - *pnextopt = '\0'; - pnextopt++; - } if (strcmp(opt, "bg") == 0) { opflags |= BGRND; pass_flag_to_nmount=0; From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 15:45:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 412F3106568F; Mon, 26 Oct 2009 15:45:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 12C4D8FC0A; Mon, 26 Oct 2009 15:45:18 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id B934046B0D; Mon, 26 Oct 2009 11:45:17 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id EDCD58A01F; Mon, 26 Oct 2009 11:45:16 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Date: Mon, 26 Oct 2009 08:37:23 -0400 User-Agent: KMail/1.9.7 References: <200910232253.n9NMr10R074584@svn.freebsd.org> In-Reply-To: <200910232253.n9NMr10R074584@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910260837.23479.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 26 Oct 2009 11:45:17 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_03_06,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198431 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 15:45:18 -0000 On Friday 23 October 2009 6:53:01 pm Marcel Moolenaar wrote: > Author: marcel > Date: Fri Oct 23 22:53:01 2009 > New Revision: 198431 > URL: http://svn.freebsd.org/changeset/base/198431 > > Log: > BIOSes, buggy or otherwise, are i386 or amd64 specific. > Have the early USB takeover enabled for i386 and amd64 > by default. > This also avoids a panic on PowerPC where the resource > isn't released properly and we find a busy resource > when the USB host controller wants to allocate it... Presumably such systems won't set the 'BIOS owned' bit in the their legacy support registers in which case these routines are NOPs (they just read the register, see the bit is clear, and exit). The resource bug sounds like a real one that should be fixed and would probably affect any x86 systems who have USB disabled in the BIOS, so that should be fixed rather than papered over. Please revert. Note that the legacy support register stuff is part of the uhci/ohci/ehci specifications, and that the code to frob it has been part of the same drivers since their inception. If it had been an actual problem then it would have been disabled back when USB was enabled for other architectures. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 15:45:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84340106568B; Mon, 26 Oct 2009 15:45:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 55BF18FC0C; Mon, 26 Oct 2009 15:45:19 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 07A3A46B03; Mon, 26 Oct 2009 11:45:19 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 4BB118A020; Mon, 26 Oct 2009 11:45:18 -0400 (EDT) From: John Baldwin To: Alexander Motin Date: Mon, 26 Oct 2009 08:40:44 -0400 User-Agent: KMail/1.9.7 References: <200910261035.n9QAZHGR084488@svn.freebsd.org> In-Reply-To: <200910261035.n9QAZHGR084488@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910260840.45033.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 26 Oct 2009 11:45:18 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_03_06,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198483 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 15:45:19 -0000 On Monday 26 October 2009 6:35:17 am Alexander Motin wrote: > Author: mav > Date: Mon Oct 26 10:35:16 2009 > New Revision: 198483 > URL: http://svn.freebsd.org/changeset/base/198483 > > Log: > Document new modularised ATA kernel options. Presumably it wouldn't actually hurt to leave these enabled. config(8) is ok with having a file enabled via multiple matching lines in sys/conf/files* IIRC. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 15:47:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1DAF106566B; Mon, 26 Oct 2009 15:47:15 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f209.google.com (mail-bw0-f209.google.com [209.85.218.209]) by mx1.freebsd.org (Postfix) with ESMTP id BA9D98FC24; Mon, 26 Oct 2009 15:47:14 +0000 (UTC) Received: by bwz1 with SMTP id 1so2507166bwz.13 for ; Mon, 26 Oct 2009 08:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=6+EmMMBbLLbMedj8wcrMg+b0MyDOTwmt8n/wB4zqwmU=; b=tbxYhxnDZXgE1o868BfHg3kvHzxctyihFxzzCZJ453AyvqQWDwGMG/S+Tct0rPs7cb FigcY+l+BWmmgI0Q6Ax+rXq+mHKzvE1Uk/HR9FfgBNeqJlQ2roVb9G9+Q9hU+f9e8peF qr2lFT0MAAfYPonEkQXlhfBc1oyzQja8ZzQlI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=AoLPPMfNCTTpV6922t6BSSBVdIHB7txMhkmdxfX73BuiHnJLE7bQ3ribhUsOF0yk9j tzv1tPyrzpewpLgQSok4qHPqKk7rhbLdM8SeohNTbhb+Yh+WF4vqAK5zax4LV+S+CZ1H ZOTyOEwofQzGyqJn+uQS2w51sRGxV0y8UouJM= Received: by 10.103.127.32 with SMTP id e32mr2543038mun.70.1256570270799; Mon, 26 Oct 2009 08:17:50 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id n10sm13854513mue.17.2009.10.26.08.17.48 (version=SSLv3 cipher=RC4-MD5); Mon, 26 Oct 2009 08:17:49 -0700 (PDT) Sender: Alexander Motin Message-ID: <4AE5CBA9.4080605@FreeBSD.org> Date: Mon, 26 Oct 2009 18:17:45 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20090901) MIME-Version: 1.0 To: Andriy Gapon References: <200910261120.n9QBKFUw086926@svn.freebsd.org> <20091026144252.GA11752@FreeBSD.org> <4AE5B788.5060407@freebsd.org> In-Reply-To: <4AE5B788.5060407@freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r198486 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 15:47:15 -0000 Andriy Gapon wrote: > on 26/10/2009 16:42 Alexey Dokuchaev said the following: >> On Mon, Oct 26, 2009 at 11:20:15AM +0000, Alexander Motin wrote: >>> Author: mav >>> Date: Mon Oct 26 11:20:14 2009 >>> New Revision: 198486 >>> URL: http://svn.freebsd.org/changeset/base/198486 >>> >>> Log: >>> Increase ATA command timeouts. Some drives need more then 5s to spin-up. >> Can't it be factored out into a macro so one does not have to make a bunch >> of those identical changes over several files shall it be required to >> adjust timeout again some time in the future? You are right, but I still hope to obsolete that code some time in the future. > If this is to happen, then I'd like them to become sysctls too. I think it is a bit excessive. System should work just out of the box without such tunings. Timeout is a fatal condition that should not happen within normal operation. The only reason to reduce it is faster fault recovery. But if faults happen often enough to require tuning, you should probably replace hardware. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 15:50:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 307331065679; Mon, 26 Oct 2009 15:50:42 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 851F08FC18; Mon, 26 Oct 2009 15:50:41 +0000 (UTC) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 2345FEB46E8; Mon, 26 Oct 2009 17:50:40 +0200 (EET) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id F27BD451B2; Mon, 26 Oct 2009 17:50:39 +0200 (EET) X-Quarantine-ID: <4CwU9y8-aMp5> X-Virus-Scanned: amavisd-new at ceid.upatras.gr X-Amavis-Alert: BAD HEADER, Duplicate header field: "Cc" Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4CwU9y8-aMp5; Mon, 26 Oct 2009 17:50:39 +0200 (EET) Received: from kobe.laptop (ppp-94-64-232-242.home.otenet.gr [94.64.232.242]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 81717450C6; Mon, 26 Oct 2009 17:50:39 +0200 (EET) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n9QFodNm010191 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 Oct 2009 17:50:39 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n9QFocFn010190; Mon, 26 Oct 2009 17:50:38 +0200 (EET) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Alexander Motin References: <200910261120.n9QBKFUw086926@svn.freebsd.org> Date: Mon, 26 Oct 2009 17:50:38 +0200 In-Reply-To: <200910261120.n9QBKFUw086926@svn.freebsd.org> (Alexander Motin's message of "Mon, 26 Oct 2009 11:20:15 +0000 (UTC)") Message-ID: <87zl7e2lyp.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon Subject: Re: svn commit: r198486 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 15:50:42 -0000 On Mon, 26 Oct 2009 11:20:15 +0000 (UTC), Alexander Motin wrote: > Author: mav > Date: Mon Oct 26 11:20:14 2009 > New Revision: 198486 > URL: http://svn.freebsd.org/changeset/base/198486 > > Log: > Increase ATA command timeouts. Some drives need more then 5s to spin-up. On Mon, 26 Oct 2009 14:42:52 +0000, Alexey Dokuchaev wrote: > Can't it be factored out into a macro so one does not have to make a bunch > of those identical changes over several files shall it be required to > adjust timeout again some time in the future? Yes it can. See attached patch below. On Mon, 26 Oct 2009 16:51:52 +0200, Andriy Gapon wrote: > If this is to happen, then I'd like them to become sysctls too. If it's not a problem, we can add the macro first and then work on making it a sysctl. FWIW, it may also be nice to have a different sysctl for each ata device, or something that can be tuned per bus or per-device with atacontrol. The patch attached below is what we need to make this a compile-time option for kernel config files. It's small enough that I think we can commit this now, and work on the sysctl/atacontrol tunable in the meantime. %%% diff -r 912fc3591cda UPDATING --- a/UPDATING Mon Oct 26 15:41:28 2009 +0200 +++ b/UPDATING Mon Oct 26 17:46:11 2009 +0200 @@ -22,6 +22,11 @@ machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20091026: + The ata(4) driver has been updated to allow rebuilding with a custom + request timeout. ATA_REQUEST_TIMEOUT now defaults to 10 seconds, but + may be set in the kernel configuration file to another value. + 20091025: The iwn(4) driver has been updated to support the 5000 and 5150 series. There's one kernel module for each firmware. Adding "device iwnfw" diff -r 912fc3591cda sys/conf/NOTES --- a/sys/conf/NOTES Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/conf/NOTES Mon Oct 26 17:46:11 2009 +0200 @@ -1716,8 +1716,11 @@ # # ATA_STATIC_ID: controller numbering is static ie depends on location # else the device numbers are dynamically allocated. +# ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request +# before timing out. options ATA_STATIC_ID +#options ATA_REQUEST_TIMEOUT=10 # # Standard floppy disk controllers and floppy tapes, supports diff -r 912fc3591cda sys/conf/options --- a/sys/conf/options Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/conf/options Mon Oct 26 17:46:11 2009 +0200 @@ -350,6 +350,7 @@ # Options used in the 'ata' ATA/ATAPI driver ATA_STATIC_ID opt_ata.h ATA_NOPCI opt_ata.h +ATA_REQUEST_TIMEOUT opt_ata.h # Net stuff. ACCEPT_FILTER_DATA diff -r 912fc3591cda sys/dev/ata/ata-all.h --- a/sys/dev/ata/ata-all.h Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/dev/ata/ata-all.h Mon Oct 26 17:46:11 2009 +0200 @@ -336,6 +336,10 @@ #define ATA_OP_FINISHED 1 #define ATA_MAX_28BIT_LBA 268435455UL +#ifndef ATA_REQUEST_TIMEOUT +#define ATA_REQUEST_TIMEOUT 10 +#endif + /* structure used for composite atomic operations */ #define MAX_COMPOSITES 32 /* u_int32_t bits */ struct ata_composite { diff -r 912fc3591cda sys/dev/ata/ata-disk.c --- a/sys/dev/ata/ata-disk.c Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/dev/ata/ata-disk.c Mon Oct 26 17:46:11 2009 +0200 @@ -230,7 +230,7 @@ } request->dev = dev; request->flags = ATA_R_CONTROL; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->retries = 1; request->callback = ad_power_callback; request->u.ata.command = ATA_STANDBY_IMMEDIATE; @@ -265,7 +265,7 @@ request->timeout = 31; } else { - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; } request->retries = 2; request->data = bp->bio_data; @@ -468,7 +468,7 @@ request->u.ata.count = 0; request->u.ata.feature = 0; request->flags = ATA_R_CONTROL | ATA_R_QUIET; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->retries = 0; ata_queue_request(request); if (request->status & ATA_S_ERROR) @@ -487,7 +487,7 @@ request->u.ata.count = 1; request->u.ata.feature = 0; request->flags = ATA_R_CONTROL; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->retries = 0; ata_queue_request(request); if (request->status & ATA_S_ERROR) diff -r 912fc3591cda sys/dev/ata/ata-queue.c --- a/sys/dev/ata/ata-queue.c Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/dev/ata/ata-queue.c Mon Oct 26 17:46:11 2009 +0200 @@ -135,7 +135,7 @@ atadev->spindown_state = 0; request->timeout = 31; } else { - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; } request->retries = 0; ata_queue_request(request); @@ -389,7 +389,7 @@ request->bytecount = sizeof(struct atapi_sense); request->donecount = 0; request->transfersize = sizeof(struct atapi_sense); - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; request->flags &= (ATA_R_ATAPI | ATA_R_QUIET | ATA_R_DEBUG); request->flags |= (ATA_R_READ | ATA_R_AT_HEAD | ATA_R_REQUEUE); ATA_DEBUG_RQ(request, "autoissue request sense"); diff -r 912fc3591cda sys/dev/ata/atapi-cd.c --- a/sys/dev/ata/atapi-cd.c Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/dev/ata/atapi-cd.c Mon Oct 26 17:46:11 2009 +0200 @@ -700,7 +700,7 @@ request->dev = dev; bcopy(ccb, request->u.atapi.ccb, 16); request->flags = ATA_R_ATAPI; - request->timeout = 10; + request->timeout = ATA_REQUEST_TIMEOUT; ata_queue_request(request); if (!request->error && (request->u.atapi.sense.key == 2 || diff -r 912fc3591cda sys/i386/conf/KOBE --- a/sys/i386/conf/KOBE Mon Oct 26 15:41:28 2009 +0200 +++ b/sys/i386/conf/KOBE Mon Oct 26 17:46:11 2009 +0200 @@ -90,6 +90,7 @@ device atapicam # emulate ATAPI devices as SCSI ditto via CAM # needs CAM to be present (scbus & pass) options ATA_STATIC_ID # Static device numbering +options ATA_REQUEST_TIMEOUT=12 # SCSI peripherals device scbus # SCSI bus (required for SCSI) %%% From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 16:22:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB1DA106566B; Mon, 26 Oct 2009 16:22:10 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 6176B8FC19; Mon, 26 Oct 2009 16:22:10 +0000 (UTC) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 8BF4FEB46E6; Mon, 26 Oct 2009 17:58:00 +0200 (EET) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 6CFCA451B2; Mon, 26 Oct 2009 17:58:00 +0200 (EET) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YEfVAqDRR-vL; Mon, 26 Oct 2009 17:58:00 +0200 (EET) Received: from kobe.laptop (ppp-94-64-232-242.home.otenet.gr [94.64.232.242]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 32D8D450C6; Mon, 26 Oct 2009 17:58:00 +0200 (EET) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n9QFvxqE010242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 Oct 2009 17:57:59 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n9QFvxnE010241; Mon, 26 Oct 2009 17:57:59 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Alexander Motin References: <200910261120.n9QBKFUw086926@svn.freebsd.org> <87zl7e2lyp.fsf@kobe.laptop> Date: Mon, 26 Oct 2009 17:57:59 +0200 In-Reply-To: <87zl7e2lyp.fsf@kobe.laptop> (Giorgos Keramidas's message of "Mon, 26 Oct 2009 17:50:38 +0200") Message-ID: <87r5sq2lmg.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon Subject: Re: svn commit: r198486 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 16:22:10 -0000 On Mon, 26 Oct 2009 17:50:38 +0200, Giorgos Keramidas wrote: > diff -r 912fc3591cda sys/i386/conf/KOBE > --- a/sys/i386/conf/KOBE Mon Oct 26 15:41:28 2009 +0200 > +++ b/sys/i386/conf/KOBE Mon Oct 26 17:46:11 2009 +0200 > @@ -90,6 +90,7 @@ > device atapicam # emulate ATAPI devices as SCSI ditto via CAM > # needs CAM to be present (scbus & pass) > options ATA_STATIC_ID # Static device numbering > +options ATA_REQUEST_TIMEOUT=12 > > # SCSI peripherals > device scbus # SCSI bus (required for SCSI) This hunk is for my local kernel config file. Please ignore it. From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 16:33:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F319106568B; Mon, 26 Oct 2009 16:33:05 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id 55DEC8FC17; Mon, 26 Oct 2009 16:33:04 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii; format=flowed; delsp=yes Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KS4006WARAONC40@asmtp029.mac.com>; Mon, 26 Oct 2009 09:33:04 -0700 (PDT) From: Marcel Moolenaar In-reply-to: <200910260837.23479.jhb@freebsd.org> Date: Mon, 26 Oct 2009 09:32:48 -0700 Message-id: <8082A638-C5BA-42F9-8C2E-DA31EF084840@mac.com> References: <200910232253.n9NMr10R074584@svn.freebsd.org> <200910260837.23479.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1076) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198431 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 16:33:05 -0000 On Oct 26, 2009, at 5:37 AM, John Baldwin wrote: >> Log: >> BIOSes, buggy or otherwise, are i386 or amd64 specific. >> Have the early USB takeover enabled for i386 and amd64 >> by default. >> This also avoids a panic on PowerPC where the resource >> isn't released properly and we find a busy resource >> when the USB host controller wants to allocate it... > > Presumably such systems won't set the 'BIOS owned' bit in the their > legacy > support registers in which case these routines are NOPs (they just > read the > register, see the bit is clear, and exit). The resource bug sounds > like a > real one that should be fixed and would probably affect any x86 > systems who > have USB disabled in the BIOS, so that should be fixed rather than > papered > over. Please revert. *sigh* The change was made because 1) doing this as part of the PCI code is unnecessary for non-PC HW, and 2) it's entirely untested on non-PC HW and the gratuitous change can therefore only do harm -- he, guess what, it did do harm. Unless people fix the resource stuff this change cannot be reverted. After the resource fix has gone in, I still object to this being reverted on grounds of gratuitous code bloat. I say this with ARM, MIPS and PowerPC/Book-E in mind. > Note that the legacy support register stuff is part of the uhci/ohci/ > ehci > specifications, and that the code to frob it has been part of the same > drivers since their inception. If it had been an actual problem > then it > would have been disabled back when USB was enabled for other > architectures. This is entirely besides the point... -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 16:50:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32E48106566C; Mon, 26 Oct 2009 16:50:35 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C0A2A8FC08; Mon, 26 Oct 2009 16:50:33 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA04151; Mon, 26 Oct 2009 18:50:29 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <4AE5D355.8020107@freebsd.org> Date: Mon, 26 Oct 2009 18:50:29 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Marcel Moolenaar References: <200910232253.n9NMr10R074584@svn.freebsd.org> <200910260837.23479.jhb@freebsd.org> <8082A638-C5BA-42F9-8C2E-DA31EF084840@mac.com> In-Reply-To: <8082A638-C5BA-42F9-8C2E-DA31EF084840@mac.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r198431 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 16:50:35 -0000 on 26/10/2009 18:32 Marcel Moolenaar said the following: > > The change was made because 1) doing this as part of the PCI code is > unnecessary for non-PC HW, and 2) it's entirely untested on non-PC > HW and the gratuitous change can therefore only do harm -- he, guess > what, it did do harm. > > Unless people fix the resource stuff this change cannot be reverted. Well, I think that maybe people who could fix this might not have the hardware that is need to reproduce and test the problem. So they need help of people who do have the hardware and can reproduce the problem. Perhaps, just disabling the code _and_ stopping there is what should not be done. > After the resource fix has gone in, I still object to this being > reverted on grounds of gratuitous code bloat. I say this with ARM, > MIPS and PowerPC/Book-E in mind. Well, PCI USB controller drivers would also have this bloat, but I am not sure if hardware for the platforms you listed has PCI *HCI controllers. Besides, only code execution is now disabled, the code itself is still present, which also can be considered as a form of bloat. Perhaps #if defined (arch1) ... would be more appropriate here? I am not sure. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 16:57:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BB951065696; Mon, 26 Oct 2009 16:57:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6B4838FC17; Mon, 26 Oct 2009 16:57:24 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id E9E0946B3B; Mon, 26 Oct 2009 12:57:23 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 363858A01B; Mon, 26 Oct 2009 12:57:23 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Date: Mon, 26 Oct 2009 12:54:49 -0400 User-Agent: KMail/1.9.7 References: <200910232253.n9NMr10R074584@svn.freebsd.org> <200910260837.23479.jhb@freebsd.org> <8082A638-C5BA-42F9-8C2E-DA31EF084840@mac.com> In-Reply-To: <8082A638-C5BA-42F9-8C2E-DA31EF084840@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910261254.49768.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 26 Oct 2009 12:57:23 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198431 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 16:57:24 -0000 On Monday 26 October 2009 12:32:48 pm Marcel Moolenaar wrote: > > On Oct 26, 2009, at 5:37 AM, John Baldwin wrote: > > >> Log: > >> BIOSes, buggy or otherwise, are i386 or amd64 specific. > >> Have the early USB takeover enabled for i386 and amd64 > >> by default. > >> This also avoids a panic on PowerPC where the resource > >> isn't released properly and we find a busy resource > >> when the USB host controller wants to allocate it... > > > > > > Presumably such systems won't set the 'BIOS owned' bit in the their > > legacy > > support registers in which case these routines are NOPs (they just > > read the > > register, see the bit is clear, and exit). The resource bug sounds > > like a > > real one that should be fixed and would probably affect any x86 > > systems who > > have USB disabled in the BIOS, so that should be fixed rather than > > papered > > over. Please revert. > > *sigh* > > The change was made because 1) doing this as part of the PCI code is > unnecessary for non-PC HW, and 2) it's entirely untested on non-PC > HW and the gratuitous change can therefore only do harm -- he, guess > what, it did do harm. > > Unless people fix the resource stuff this change cannot be reverted. > > After the resource fix has gone in, I still object to this being > reverted on grounds of gratuitous code bloat. I say this with ARM, > MIPS and PowerPC/Book-E in mind. You didn't remove anything, you merely toggled the setting of a variable. Code bloat is a non-argument in that case. Could you care to provide details on the resource issue you are encountering? I don't see any obvious resource leaks, etc. in the current set of changes. > > Note that the legacy support register stuff is part of the uhci/ohci/ > > ehci > > specifications, and that the code to frob it has been part of the same > > drivers since their inception. If it had been an actual problem > > then it > > would have been disabled back when USB was enabled for other > > architectures. > > This is entirely besides the point... It is not beside the point because the code was not just added, it is being moved. Presumably the code will be removed from the host controller drivers shortly since it is no longer needed. I repeat that if the code caused real problems it would not be present in the actual host controller drivers. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 17:27:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEB47106566B; Mon, 26 Oct 2009 17:27:30 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D9028FC08; Mon, 26 Oct 2009 17:27:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QHRUVU096259; Mon, 26 Oct 2009 17:27:30 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QHRULf096257; Mon, 26 Oct 2009 17:27:30 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200910261727.n9QHRULf096257@svn.freebsd.org> From: Maksim Yevmenkin Date: Mon, 26 Oct 2009 17:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198492 - head/lib/libbluetooth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 17:27:30 -0000 Author: emax Date: Mon Oct 26 17:27:30 2009 New Revision: 198492 URL: http://svn.freebsd.org/changeset/base/198492 Log: Fix typo in bluetooth.3 Do not use reserved C++ keyword "new" MFC after: 1 month Modified: head/lib/libbluetooth/bluetooth.3 head/lib/libbluetooth/bluetooth.h Modified: head/lib/libbluetooth/bluetooth.3 ============================================================================== --- head/lib/libbluetooth/bluetooth.3 Mon Oct 26 14:57:33 2009 (r198491) +++ head/lib/libbluetooth/bluetooth.3 Mon Oct 26 17:27:30 2009 (r198492) @@ -272,7 +272,7 @@ otherwise 0. .Pp The .Fn bt_devinfo -function populates prodivded +function populates provided .Vt bt_devinfo structure with the information about given Bluetooth device. The caller is expected to pass Bluetooth device name in the Modified: head/lib/libbluetooth/bluetooth.h ============================================================================== --- head/lib/libbluetooth/bluetooth.h Mon Oct 26 14:57:33 2009 (r198491) +++ head/lib/libbluetooth/bluetooth.h Mon Oct 26 17:27:30 2009 (r198492) @@ -163,8 +163,8 @@ int bt_devclose(int s); int bt_devsend (int s, uint16_t opcode, void *param, size_t plen); ssize_t bt_devrecv (int s, void *buf, size_t size, time_t to); int bt_devreq (int s, struct bt_devreq *r, time_t to); -int bt_devfilter(int s, struct bt_devfilter const *new, - struct bt_devfilter *old); +int bt_devfilter(int s, struct bt_devfilter const *newp, + struct bt_devfilter *oldp); void bt_devfilter_pkt_set(struct bt_devfilter *filter, uint8_t type); void bt_devfilter_pkt_clr(struct bt_devfilter *filter, uint8_t type); int bt_devfilter_pkt_tst(struct bt_devfilter const *filter, uint8_t type); From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 17:37:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34565106566B; Mon, 26 Oct 2009 17:37:34 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout024.mac.com (asmtpout024.mac.com [17.148.16.99]) by mx1.freebsd.org (Postfix) with ESMTP id 1BBB08FC15; Mon, 26 Oct 2009 17:37:33 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii; format=flowed; delsp=yes Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp024.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KS400LH1UADJXA0@asmtp024.mac.com>; Mon, 26 Oct 2009 10:37:27 -0700 (PDT) From: Marcel Moolenaar In-reply-to: <200910261254.49768.jhb@freebsd.org> Date: Mon, 26 Oct 2009 10:37:25 -0700 Message-id: <936EBD5F-31D2-4B6A-94E7-D9DB8FD236FE@mac.com> References: <200910232253.n9NMr10R074584@svn.freebsd.org> <200910260837.23479.jhb@freebsd.org> <8082A638-C5BA-42F9-8C2E-DA31EF084840@mac.com> <200910261254.49768.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1076) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198431 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 17:37:34 -0000 On Oct 26, 2009, at 9:54 AM, John Baldwin wrote: > On Monday 26 October 2009 12:32:48 pm Marcel Moolenaar wrote: >> >> On Oct 26, 2009, at 5:37 AM, John Baldwin wrote: >> >>>> Log: >>>> BIOSes, buggy or otherwise, are i386 or amd64 specific. >>>> Have the early USB takeover enabled for i386 and amd64 >>>> by default. >>>> This also avoids a panic on PowerPC where the resource >>>> isn't released properly and we find a busy resource >>>> when the USB host controller wants to allocate it... >>> >> >> >>> Presumably such systems won't set the 'BIOS owned' bit in the their >>> legacy >>> support registers in which case these routines are NOPs (they just >>> read the >>> register, see the bit is clear, and exit). The resource bug sounds >>> like a >>> real one that should be fixed and would probably affect any x86 >>> systems who >>> have USB disabled in the BIOS, so that should be fixed rather than >>> papered >>> over. Please revert. >> >> *sigh* >> >> The change was made because 1) doing this as part of the PCI code is >> unnecessary for non-PC HW, and 2) it's entirely untested on non-PC >> HW and the gratuitous change can therefore only do harm -- he, guess >> what, it did do harm. >> >> Unless people fix the resource stuff this change cannot be reverted. >> >> After the resource fix has gone in, I still object to this being >> reverted on grounds of gratuitous code bloat. I say this with ARM, >> MIPS and PowerPC/Book-E in mind. > > You didn't remove anything, you merely toggled the setting of a > variable. Oops... Brainfart. I thought I did wrapped the whole logic... /me resets brain If someone is willing to fix the resource issue, I'm more than happy to test patches. In the mean time we should keep the change to avoid unnecessary productivity loss by people impacted by the kernel panic. Once the resource issue is fixed, I don't care in particular what the default is as long as the logic gets executed some time... -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 17:42:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25270106566C; Mon, 26 Oct 2009 17:42:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E95FC8FC13; Mon, 26 Oct 2009 17:42:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QHg3Xg096578; Mon, 26 Oct 2009 17:42:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QHg37O096576; Mon, 26 Oct 2009 17:42:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200910261742.n9QHg37O096576@svn.freebsd.org> From: John Baldwin Date: Mon, 26 Oct 2009 17:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198493 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 17:42:04 -0000 Author: jhb Date: Mon Oct 26 17:42:03 2009 New Revision: 198493 URL: http://svn.freebsd.org/changeset/base/198493 Log: Fix some spelling nits. Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Mon Oct 26 17:27:30 2009 (r198492) +++ head/sys/kern/kern_cpuset.c Mon Oct 26 17:42:03 2009 (r198493) @@ -79,7 +79,7 @@ __FBSDID("$FreeBSD$"); * not. This means that anonymous sets are immutable because they may be * shared. To modify an anonymous set a new set is created with the desired * mask and the same parent as the existing anonymous set. This gives the - * illusion of each thread having a private mask.A + * illusion of each thread having a private mask. * * Via the syscall apis a user may ask to retrieve or modify the root, base, * or mask that is discovered via a pid, tid, or setid. Modifying a set @@ -87,7 +87,7 @@ __FBSDID("$FreeBSD$"); * Modifying a pid or tid's mask applies only to that tid but must still * exist within the assigned parent set. * - * A thread may not be assigned to a a group seperate from other threads in + * A thread may not be assigned to a a group separate from other threads in * the process. This is to remove ambiguity when the setid is queried with * a pid argument. There is no other technical limitation. * @@ -98,7 +98,7 @@ __FBSDID("$FreeBSD$"); * * A simple application should not concern itself with sets at all and * rather apply masks to its own threads via CPU_WHICH_TID and a -1 id - * meaning 'curthread'. It may query availble cpus for that tid with a + * meaning 'curthread'. It may query available cpus for that tid with a * getaffinity call using (CPU_LEVEL_CPUSET, CPU_WHICH_PID, -1, ...). */ static uma_zone_t cpuset_zone; @@ -153,7 +153,7 @@ cpuset_refbase(struct cpuset *set) } /* - * Release a reference in a context where it is safe to allocte. + * Release a reference in a context where it is safe to allocate. */ void cpuset_rel(struct cpuset *set) @@ -752,7 +752,7 @@ cpuset_setproc_update_set(struct proc *p /* * This is called once the final set of system cpus is known. Modifies - * the root set and all children and mark the root readonly. + * the root set and all children and mark the root read-only. */ static void cpuset_init(void *arg) From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 17:45:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DB6A106568D; Mon, 26 Oct 2009 17:45:41 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 1AB788FC1C; Mon, 26 Oct 2009 17:45:40 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 264C0581BD; Mon, 26 Oct 2009 12:45:40 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id YMxWXhPSxvFF; Mon, 26 Oct 2009 12:45:40 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-dhcp-172-16-55-200.icecube.wisc.edu [172.16.55.200]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 0512C581A0; Mon, 26 Oct 2009 12:45:39 -0500 (CDT) Message-ID: <4AE5E043.8070804@freebsd.org> Date: Mon, 26 Oct 2009 12:45:39 -0500 From: Nathan Whitehorn User-Agent: Thunderbird 2.0.0.23 (X11/20090909) MIME-Version: 1.0 To: John Baldwin References: <200910232253.n9NMr10R074584@svn.freebsd.org> <200910260837.23479.jhb@freebsd.org> <8082A638-C5BA-42F9-8C2E-DA31EF084840@mac.com> <200910261254.49768.jhb@freebsd.org> In-Reply-To: <200910261254.49768.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r198431 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 17:45:41 -0000 John Baldwin wrote: > On Monday 26 October 2009 12:32:48 pm Marcel Moolenaar wrote: > >> On Oct 26, 2009, at 5:37 AM, John Baldwin wrote: >> >> >>>> Log: >>>> BIOSes, buggy or otherwise, are i386 or amd64 specific. >>>> Have the early USB takeover enabled for i386 and amd64 >>>> by default. >>>> This also avoids a panic on PowerPC where the resource >>>> isn't released properly and we find a busy resource >>>> when the USB host controller wants to allocate it... >>>> >> >>> Presumably such systems won't set the 'BIOS owned' bit in the their >>> legacy >>> support registers in which case these routines are NOPs (they just >>> read the >>> register, see the bit is clear, and exit). The resource bug sounds >>> like a >>> real one that should be fixed and would probably affect any x86 >>> systems who >>> have USB disabled in the BIOS, so that should be fixed rather than >>> papered >>> over. Please revert. >>> >> *sigh* >> >> The change was made because 1) doing this as part of the PCI code is >> unnecessary for non-PC HW, and 2) it's entirely untested on non-PC >> HW and the gratuitous change can therefore only do harm -- he, guess >> what, it did do harm. >> >> Unless people fix the resource stuff this change cannot be reverted. >> >> After the resource fix has gone in, I still object to this being >> reverted on grounds of gratuitous code bloat. I say this with ARM, >> MIPS and PowerPC/Book-E in mind. >> > > You didn't remove anything, you merely toggled the setting of a variable. > Code bloat is a non-argument in that case. Could you care to provide details > on the resource issue you are encountering? I don't see any obvious resource > leaks, etc. in the current set of changes. > > The real problem in this case is that the bus_(deactivate|release)_resource methods are not implemented on several PCI bus drivers on PowerPC (e.g. uninorth, where this problem arose). Up until now, I guess it has never mattered. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 18:02:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D92AE1065694; Mon, 26 Oct 2009 18:02:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 935E08FC19; Mon, 26 Oct 2009 18:02:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QI250S097096; Mon, 26 Oct 2009 18:02:05 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QI25bB097094; Mon, 26 Oct 2009 18:02:05 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200910261802.n9QI25bB097094@svn.freebsd.org> From: Alan Cox Date: Mon, 26 Oct 2009 18:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198494 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 18:02:05 -0000 Author: alc Date: Mon Oct 26 18:02:05 2009 New Revision: 198494 URL: http://svn.freebsd.org/changeset/base/198494 Log: There is no need to "busy" a page when the object is locked for the duration of the operation. Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Mon Oct 26 17:42:03 2009 (r198493) +++ head/sys/fs/tmpfs/tmpfs_subr.c Mon Oct 26 18:02:05 2009 (r198494) @@ -906,10 +906,9 @@ tmpfs_reg_resize(struct vnode *vp, off_t if (zerolen > 0) { m = vm_page_grab(uobj, OFF_TO_IDX(newsize), - VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + VM_ALLOC_NOBUSY | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); pmap_zero_page_area(m, PAGE_SIZE - zerolen, zerolen); - vm_page_wakeup(m); } VM_OBJECT_UNLOCK(uobj); From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 18:13:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3BC3106568F; Mon, 26 Oct 2009 18:13:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 74BEE8FC1E; Mon, 26 Oct 2009 18:13:59 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 167BF46B2C; Mon, 26 Oct 2009 14:13:59 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 37ED28A01B; Mon, 26 Oct 2009 14:13:58 -0400 (EDT) From: John Baldwin To: Nathan Whitehorn Date: Mon, 26 Oct 2009 14:13:03 -0400 User-Agent: KMail/1.9.7 References: <200910232253.n9NMr10R074584@svn.freebsd.org> <200910261254.49768.jhb@freebsd.org> <4AE5E043.8070804@freebsd.org> In-Reply-To: <4AE5E043.8070804@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910261413.04317.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 26 Oct 2009 14:13:58 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r198431 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 18:13:59 -0000 On Monday 26 October 2009 1:45:39 pm Nathan Whitehorn wrote: > John Baldwin wrote: > > On Monday 26 October 2009 12:32:48 pm Marcel Moolenaar wrote: > > > >> On Oct 26, 2009, at 5:37 AM, John Baldwin wrote: > >> > >> > >>>> Log: > >>>> BIOSes, buggy or otherwise, are i386 or amd64 specific. > >>>> Have the early USB takeover enabled for i386 and amd64 > >>>> by default. > >>>> This also avoids a panic on PowerPC where the resource > >>>> isn't released properly and we find a busy resource > >>>> when the USB host controller wants to allocate it... > >>>> > >> > >>> Presumably such systems won't set the 'BIOS owned' bit in the their > >>> legacy > >>> support registers in which case these routines are NOPs (they just > >>> read the > >>> register, see the bit is clear, and exit). The resource bug sounds > >>> like a > >>> real one that should be fixed and would probably affect any x86 > >>> systems who > >>> have USB disabled in the BIOS, so that should be fixed rather than > >>> papered > >>> over. Please revert. > >>> > >> *sigh* > >> > >> The change was made because 1) doing this as part of the PCI code is > >> unnecessary for non-PC HW, and 2) it's entirely untested on non-PC > >> HW and the gratuitous change can therefore only do harm -- he, guess > >> what, it did do harm. > >> > >> Unless people fix the resource stuff this change cannot be reverted. > >> > >> After the resource fix has gone in, I still object to this being > >> reverted on grounds of gratuitous code bloat. I say this with ARM, > >> MIPS and PowerPC/Book-E in mind. > >> > > > > You didn't remove anything, you merely toggled the setting of a variable. > > Code bloat is a non-argument in that case. Could you care to provide details > > on the resource issue you are encountering? I don't see any obvious resource > > leaks, etc. in the current set of changes. > > > > > The real problem in this case is that the > bus_(deactivate|release)_resource methods are not implemented on several > PCI bus drivers on PowerPC (e.g. uninorth, where this problem arose). Up > until now, I guess it has never mattered. Ahh, ok. I'm fine with having it off for those architectures that can't yet handle it with the hope they will be fixed. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 18:32:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93EBF10656A4; Mon, 26 Oct 2009 18:32:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8307D8FC1B; Mon, 26 Oct 2009 18:32:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QIW6lW097772; Mon, 26 Oct 2009 18:32:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QIW6In097770; Mon, 26 Oct 2009 18:32:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200910261832.n9QIW6In097770@svn.freebsd.org> From: John Baldwin Date: Mon, 26 Oct 2009 18:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198495 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 18:32:06 -0000 Author: jhb Date: Mon Oct 26 18:32:06 2009 New Revision: 198495 URL: http://svn.freebsd.org/changeset/base/198495 Log: Another nit that both I and ispell missed. Submitted by: Ben Kaduk minimarmot of gmail Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Mon Oct 26 18:02:05 2009 (r198494) +++ head/sys/kern/kern_cpuset.c Mon Oct 26 18:32:06 2009 (r198495) @@ -87,7 +87,7 @@ __FBSDID("$FreeBSD$"); * Modifying a pid or tid's mask applies only to that tid but must still * exist within the assigned parent set. * - * A thread may not be assigned to a a group separate from other threads in + * A thread may not be assigned to a group separate from other threads in * the process. This is to remove ambiguity when the setid is queried with * a pid argument. There is no other technical limitation. * From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 19:10:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 264CF106566B; Mon, 26 Oct 2009 19:10:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F005E8FC1C; Mon, 26 Oct 2009 19:10:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QJAsgb001250; Mon, 26 Oct 2009 19:10:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QJAsPE001249; Mon, 26 Oct 2009 19:10:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200910261910.n9QJAsPE001249@svn.freebsd.org> From: John Baldwin Date: Mon, 26 Oct 2009 19:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198498 - head/usr.sbin/mfiutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 19:10:55 -0000 Author: jhb Date: Mon Oct 26 19:10:54 2009 New Revision: 198498 URL: http://svn.freebsd.org/changeset/base/198498 Log: Trim empty mergeinfo. Modified: head/usr.sbin/mfiutil/mfiutil.8 (props changed) From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 19:23:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62A9B1065679; Mon, 26 Oct 2009 19:23:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 517928FC15; Mon, 26 Oct 2009 19:23:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QJNYoA002422; Mon, 26 Oct 2009 19:23:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QJNYop002420; Mon, 26 Oct 2009 19:23:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200910261923.n9QJNYop002420@svn.freebsd.org> From: Michael Tuexen Date: Mon, 26 Oct 2009 19:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198499 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 19:23:35 -0000 Author: tuexen Date: Mon Oct 26 19:23:34 2009 New Revision: 198499 URL: http://svn.freebsd.org/changeset/base/198499 Log: Improve the round robin stream scheduler. Approved by: rrs (mentor) MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Oct 26 19:10:54 2009 (r198498) +++ head/sys/netinet/sctp_output.c Mon Oct 26 19:23:34 2009 (r198499) @@ -7169,20 +7169,14 @@ sctp_select_a_stream(struct sctp_tcb *st /* Find the next stream to use */ if (asoc->last_out_stream == NULL) { - strq = asoc->last_out_stream = TAILQ_FIRST(&asoc->out_wheel); - if (asoc->last_out_stream == NULL) { - /* huh nothing on the wheel, TSNH */ - return (NULL); - } - goto done_it; - } - strq = TAILQ_NEXT(asoc->last_out_stream, next_spoke); -done_it: - if (strq == NULL) { - strq = asoc->last_out_stream = TAILQ_FIRST(&asoc->out_wheel); + strq = TAILQ_FIRST(&asoc->out_wheel); + } else { + strq = TAILQ_NEXT(asoc->last_out_stream, next_spoke); + if (strq == NULL) { + strq = TAILQ_FIRST(&asoc->out_wheel); + } } return (strq); - } From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 20:11:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8627A106566B; Mon, 26 Oct 2009 20:11:18 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id E609F8FC1D; Mon, 26 Oct 2009 20:11:17 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id n9QKBGY5095749; Mon, 26 Oct 2009 21:11:16 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id n9QKBGAO095748; Mon, 26 Oct 2009 21:11:16 +0100 (CET) (envelope-from marius) Date: Mon, 26 Oct 2009 21:11:16 +0100 From: Marius Strobl To: Marcel Moolenaar Message-ID: <20091026201116.GS27159@alchemy.franken.de> References: <200910211838.n9LIc2wp007206@svn.freebsd.org> <20091025202541.GC94979@alchemy.franken.de> <36313C38-9B60-4BF3-885C-5BAAA915DCFE@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <36313C38-9B60-4BF3-885C-5BAAA915DCFE@mac.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc64/sparc64 sun4v/sun4v vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 20:11:18 -0000 On Sun, Oct 25, 2009 at 02:37:40PM -0700, Marcel Moolenaar wrote: > > On Oct 25, 2009, at 1:25 PM, Marius Strobl wrote: > > > >Do you have a simple test case demonstrating the need for > >I-cache synchronisation? > > I typically use GDB. If breakpoints aren't being hit or > next isn't behaving correctly, you typically have an > I-cache problem. If you get to run GDB, you probably > already know whether it's needed, because processes > tend to die with random signals at startup when the > architecture needs explicit I-cache coherency logic > and the kernel doesn't have it. A special case I would > say is executing from a memory disk. The I/O path > contains bcopy() operations, which dirty the D-cache > and trigger I-cache coherency bugs pretty well. > > I didn't have issues with that on my Netra, so I didn't > implement pmap_sync_icache for sparc64. This is not to > say that it's absolutely not needed, just that GDB didn't > expose problems. If sparc64 has some of the same kluges > powerpc had, then I-cache coherency is handled in some > other (most likely a sub-optimal) way. > The cheetah-class CPUs, i.e. USIII and later, take care of I$ coherency themselves, unlike the spitfire ones (see also cheetah_icache_page_inval() vs. spitfire_icache_page_inval()). So your Netra 20/T4 shouldn't exhibit such problems while spitfire-based machines likely require the I$ to be flushed. I currently can't think of any existing code which would ensure I$ consistency after the writes have been performed, not even as a side-effect. The proper solution probalby is to make pmap_sync_icache() a wrapper around icache_page_inval(). Marius From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 20:23:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFC1B1065676; Mon, 26 Oct 2009 20:23:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD9E58FC14; Mon, 26 Oct 2009 20:23:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QKNFtQ008162; Mon, 26 Oct 2009 20:23:15 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QKNF19008158; Mon, 26 Oct 2009 20:23:15 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200910262023.n9QKNF19008158@svn.freebsd.org> From: Andrew Thompson Date: Mon, 26 Oct 2009 20:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198500 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 20:23:15 -0000 Author: thompsa Date: Mon Oct 26 20:23:15 2009 New Revision: 198500 URL: http://svn.freebsd.org/changeset/base/198500 Log: Remove usb controller takeover code now that it is handled by the pci code. Reminded by: jhb Reviewed by: HPS Modified: head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Mon Oct 26 19:23:34 2009 (r198499) +++ head/sys/dev/usb/controller/ehci_pci.c Mon Oct 26 20:23:15 2009 (r198500) @@ -102,8 +102,6 @@ __FBSDID("$FreeBSD$"); #define PCI_EHCI_BASE_REG 0x10 -static void ehci_pci_takecontroller(device_t self); - static device_probe_t ehci_pci_probe; static device_attach_t ehci_pci_attach; static device_detach_t ehci_pci_detach; @@ -129,7 +127,6 @@ ehci_pci_resume(device_t self) { ehci_softc_t *sc = device_get_softc(self); - ehci_pci_takecontroller(self); ehci_resume(sc); bus_generic_resume(self); @@ -414,7 +411,6 @@ ehci_pci_attach(device_t self) sc->sc_intr_hdl = NULL; goto error; } - ehci_pci_takecontroller(self); /* Undocumented quirks taken from Linux */ @@ -506,51 +502,6 @@ ehci_pci_detach(device_t self) return (0); } -static void -ehci_pci_takecontroller(device_t self) -{ - ehci_softc_t *sc = device_get_softc(self); - uint32_t cparams; - uint32_t eec; - uint16_t to; - uint8_t eecp; - uint8_t bios_sem; - - cparams = EREAD4(sc, EHCI_HCCPARAMS); - - /* Synchronise with the BIOS if it owns the controller. */ - for (eecp = EHCI_HCC_EECP(cparams); eecp != 0; - eecp = EHCI_EECP_NEXT(eec)) { - eec = pci_read_config(self, eecp, 4); - if (EHCI_EECP_ID(eec) != EHCI_EC_LEGSUP) { - continue; - } - bios_sem = pci_read_config(self, eecp + - EHCI_LEGSUP_BIOS_SEM, 1); - if (bios_sem == 0) { - continue; - } - device_printf(sc->sc_bus.bdev, "waiting for BIOS " - "to give up control\n"); - pci_write_config(self, eecp + - EHCI_LEGSUP_OS_SEM, 1, 1); - to = 500; - while (1) { - bios_sem = pci_read_config(self, eecp + - EHCI_LEGSUP_BIOS_SEM, 1); - if (bios_sem == 0) - break; - - if (--to == 0) { - device_printf(sc->sc_bus.bdev, - "timed out waiting for BIOS\n"); - break; - } - usb_pause_mtx(NULL, hz / 100); /* wait 10ms */ - } - } -} - static driver_t ehci_driver = { .name = "ehci", Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Mon Oct 26 19:23:34 2009 (r198499) +++ head/sys/dev/usb/controller/ohci.c Mon Oct 26 20:23:15 2009 (r198500) @@ -175,30 +175,6 @@ ohci_controller_init(ohci_softc_t *sc) uint32_t per; uint32_t desca; - /* Determine in what context we are running. */ - ctl = OREAD4(sc, OHCI_CONTROL); - if (ctl & OHCI_IR) { - /* SMM active, request change */ - DPRINTF("SMM active, request owner change\n"); - OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_OCR); - for (i = 0; (i < 100) && (ctl & OHCI_IR); i++) { - usb_pause_mtx(NULL, hz / 1000); - ctl = OREAD4(sc, OHCI_CONTROL); - } - if (ctl & OHCI_IR) { - device_printf(sc->sc_bus.bdev, - "SMM does not respond, resetting\n"); - OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); - goto reset; - } - } else { - DPRINTF("cold started\n"); -reset: - /* controller was cold started */ - usb_pause_mtx(NULL, - USB_MS_TO_TICKS(USB_BUS_RESET_DELAY)); - } - /* * This reset should not be necessary according to the OHCI spec, but * without it some controllers do not start. Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Mon Oct 26 19:23:34 2009 (r198499) +++ head/sys/dev/usb/controller/uhci_pci.c Mon Oct 26 20:23:15 2009 (r198500) @@ -115,8 +115,6 @@ uhci_pci_resume(device_t self) { uhci_softc_t *sc = device_get_softc(self); - pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2); - uhci_resume(sc); bus_generic_resume(self); @@ -363,19 +361,6 @@ uhci_pci_attach(device_t self) sc->sc_intr_hdl = NULL; goto error; } - /* - * Set the PIRQD enable bit and switch off all the others. We don't - * want legacy support to interfere with us XXX Does this also mean - * that the BIOS won't touch the keyboard anymore if it is connected - * to the ports of the root hub? - */ -#ifdef USB_DEBUG - if (pci_read_config(self, PCI_LEGSUP, 2) != PCI_LEGSUP_USBPIRQDEN) { - device_printf(self, "LegSup = 0x%04x\n", - pci_read_config(self, PCI_LEGSUP, 2)); - } -#endif - pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2); err = uhci_init(sc); if (!err) { From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 20:33:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3B57106566B; Mon, 26 Oct 2009 20:33:03 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smtp-out2.tiscali.nl (smtp-out2.tiscali.nl [195.241.79.177]) by mx1.freebsd.org (Postfix) with ESMTP id 8537D8FC0C; Mon, 26 Oct 2009 20:33:03 +0000 (UTC) Received: from [212.123.145.58] (helo=sjakie.klop.ws) by smtp-out2.tiscali.nl with esmtp (Exim) (envelope-from ) id 1N2W35-0007xZ-Uj; Mon, 26 Oct 2009 21:20:16 +0100 Received: from 82-170-177-25.ip.telfort.nl (localhost [127.0.0.1]) by sjakie.klop.ws (Postfix) with ESMTP id B150F13353; Mon, 26 Oct 2009 21:20:08 +0100 (CET) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: "Colin Percival" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <200910260651.n9Q6pLfU080067@svn.freebsd.org> Date: Mon, 26 Oct 2009 21:20:08 +0100 MIME-Version: 1.0 From: "Ronald Klop" Message-ID: In-Reply-To: <200910260651.n9Q6pLfU080067@svn.freebsd.org> User-Agent: Opera Mail/10.00 (FreeBSD) Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r198477 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 20:33:04 -0000 I'm no committer, but isn't it nice to close the fd? Ronald. On Mon, 26 Oct 2009 07:51:21 +0100, Colin Percival = =20 wrote: > Author: cperciva > Date: Mon Oct 26 06:51:20 2009 > New Revision: 198477 > URL: http://svn.freebsd.org/changeset/base/198477 > > Log: > Eject CDROM after installation if used as source media. > Submitted by: randi > MFC after: 1 month > > Modified: > head/usr.sbin/sysinstall/cdrom.c > > Modified: head/usr.sbin/sysinstall/cdrom.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/sysinstall/cdrom.c Mon Oct 26 00:01:52 2009 (r198476) > +++ head/usr.sbin/sysinstall/cdrom.c Mon Oct 26 06:51:20 2009 (r198477) > @@ -43,6 +43,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -58,6 +59,8 @@ static Boolean previouslyMounted; /* Was > static char mountpoint[MAXPATHLEN] =3D "/dist"; > int CDROMInitQuiet; > +static void mediaEjectCDROM(Device *dev); > + > static properties > read_props(char *name) > { > @@ -218,4 +221,23 @@ mediaShutdownCDROM(Device *dev) > msgConfirm("Could not unmount the CDROM/DVD from %s: %s", mountpoint,= =20 > strerror(errno)); > else > cdromMounted =3D FALSE; > + > + mediaEjectCDROM(dev); > +} > + > +static void > +mediaEjectCDROM(Device *dev) > +{ > + int fd =3D -1; > + > + msgDebug("Ejecting CDROM/DVD at %s", dev->devname); > + > + fd =3D open(dev->devname, O_RDONLY); > +=09 > + if (fd < 0) > + msgDebug("Could not eject the CDROM/DVD from %s: %s", dev->devname, = =20 > strerror(errno)); > + else { > + ioctl(fd, CDIOCALLOW); > + ioctl(fd, CDIOCEJECT); > + } > } > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 20:53:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E047106566B; Mon, 26 Oct 2009 20:53:50 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout023.mac.com (asmtpout023.mac.com [17.148.16.98]) by mx1.freebsd.org (Postfix) with ESMTP id 340CE8FC08; Mon, 26 Oct 2009 20:53:49 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii; format=flowed Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp023.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KS5001RK3DO6U60@asmtp023.mac.com>; Mon, 26 Oct 2009 13:53:48 -0700 (PDT) From: Marcel Moolenaar In-reply-to: <20091026201116.GS27159@alchemy.franken.de> Date: Mon, 26 Oct 2009 13:53:47 -0700 Message-id: <63FB238C-D66F-486B-AB5B-DA7C2423A78B@mac.com> References: <200910211838.n9LIc2wp007206@svn.freebsd.org> <20091025202541.GC94979@alchemy.franken.de> <36313C38-9B60-4BF3-885C-5BAAA915DCFE@mac.com> <20091026201116.GS27159@alchemy.franken.de> To: Marius Strobl X-Mailer: Apple Mail (2.1076) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc64/sparc64 sun4v/sun4v vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 20:53:50 -0000 On Oct 26, 2009, at 1:11 PM, Marius Strobl wrote: > The cheetah-class CPUs, i.e. USIII and later, take care of > I$ coherency themselves, unlike the spitfire ones (see also > cheetah_icache_page_inval() vs. spitfire_icache_page_inval()). This explains why I didn't see any I-cache coherency issues :-) > I currently can't think of any existing code which would > ensure I$ consistency after the writes have been performed, > not even as a side-effect. The proper solution probalby is to > make pmap_sync_icache() a wrapper around icache_page_inval(). I concur. Do we have any spitfire-based sparc64 boxes in the cluster or do you have one? -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 21:14:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2E67106566B; Mon, 26 Oct 2009 21:14:03 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id 9B3C08FC15; Mon, 26 Oct 2009 21:14:03 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii; format=flowed; delsp=yes Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KS500K5P4AUOB10@asmtp029.mac.com>; Mon, 26 Oct 2009 14:13:43 -0700 (PDT) From: Marcel Moolenaar In-reply-to: <200910262023.n9QKNF19008158@svn.freebsd.org> Date: Mon, 26 Oct 2009 14:13:42 -0700 Message-id: References: <200910262023.n9QKNF19008158@svn.freebsd.org> To: Andrew Thompson X-Mailer: Apple Mail (2.1076) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198500 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 21:14:03 -0000 On Oct 26, 2009, at 1:23 PM, Andrew Thompson wrote: > Author: thompsa > Date: Mon Oct 26 20:23:15 2009 > New Revision: 198500 > URL: http://svn.freebsd.org/changeset/base/198500 > > Log: > Remove usb controller takeover code now that it is handled by the > pci code. Uhm.. PCI does it conditionally, based on a tunable. If the handover is not done early by the PCI code, then it may still need to be done "late" by the USB drivers, right? When and where is it done "late" now that this code is removed? -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 21:38:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07E351065679; Mon, 26 Oct 2009 21:38:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id CE0548FC12; Mon, 26 Oct 2009 21:38:51 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 55CA846B06; Mon, 26 Oct 2009 17:38:51 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 8CC7D8A01B; Mon, 26 Oct 2009 17:38:50 -0400 (EDT) From: John Baldwin To: Andrew Thompson Date: Mon, 26 Oct 2009 17:38:45 -0400 User-Agent: KMail/1.9.7 References: <200910262023.n9QKNF19008158@svn.freebsd.org> In-Reply-To: <200910262023.n9QKNF19008158@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910261738.46087.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 26 Oct 2009 17:38:50 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198500 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 21:38:52 -0000 On Monday 26 October 2009 4:23:15 pm Andrew Thompson wrote: > Author: thompsa > Date: Mon Oct 26 20:23:15 2009 > New Revision: 198500 > URL: http://svn.freebsd.org/changeset/base/198500 > > Log: > Remove usb controller takeover code now that it is handled by the pci code. > > Reminded by: jhb > Reviewed by: HPS Hmm, the drivers might still need it for resume actually. Either that or the PCI bus will need to do the takeover work during resume. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 21:44:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D99A2106566B; Mon, 26 Oct 2009 21:44:15 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by mx1.freebsd.org (Postfix) with ESMTP id 61C138FC0A; Mon, 26 Oct 2009 21:44:15 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 9so768140qwb.7 for ; Mon, 26 Oct 2009 14:44:14 -0700 (PDT) MIME-Version: 1.0 Sender: andy@fud.org.nz Received: by 10.220.122.229 with SMTP id m37mr9129164vcr.15.1256593454734; Mon, 26 Oct 2009 14:44:14 -0700 (PDT) In-Reply-To: <200910261738.46087.jhb@freebsd.org> References: <200910262023.n9QKNF19008158@svn.freebsd.org> <200910261738.46087.jhb@freebsd.org> Date: Tue, 27 Oct 2009 10:44:14 +1300 X-Google-Sender-Auth: 5e35dac8e8406f1b Message-ID: <1280352d0910261444v57c6c97aue6ae06fc6dc36641@mail.gmail.com> From: Andrew Thompson To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198500 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 21:44:15 -0000 2009/10/27 John Baldwin : > On Monday 26 October 2009 4:23:15 pm Andrew Thompson wrote: >> Author: thompsa >> Date: Mon Oct 26 20:23:15 2009 >> New Revision: 198500 >> URL: http://svn.freebsd.org/changeset/base/198500 >> >> Log: >> =A0 Remove usb controller takeover code now that it is handled by the pc= i > code. >> >> =A0 Reminded by: =A0 =A0 =A0 =A0jhb >> =A0 Reviewed by: =A0 =A0 =A0 =A0HPS > > Hmm, the drivers might still need it for resume actually. =A0Either that = or the > PCI bus will need to do the takeover work during resume. As Marcel points out having hw.pci.usb_early_takeover set to zero will break. I should revert this for now. Andrew From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 21:47:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AEE0106568F; Mon, 26 Oct 2009 21:47:17 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED7768FC1C; Mon, 26 Oct 2009 21:47:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QLlG4x011295; Mon, 26 Oct 2009 21:47:16 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QLlG3E011291; Mon, 26 Oct 2009 21:47:16 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200910262147.n9QLlG3E011291@svn.freebsd.org> From: Andrew Thompson Date: Mon, 26 Oct 2009 21:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198501 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 21:47:17 -0000 Author: thompsa Date: Mon Oct 26 21:47:16 2009 New Revision: 198501 URL: http://svn.freebsd.org/changeset/base/198501 Log: Revert r198500 for now, this will break situations when hw.pci.usb_early_takeover is set to zero and the SMM release is never done. Pointed out by: marcel Modified: head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Mon Oct 26 20:23:15 2009 (r198500) +++ head/sys/dev/usb/controller/ehci_pci.c Mon Oct 26 21:47:16 2009 (r198501) @@ -102,6 +102,8 @@ __FBSDID("$FreeBSD$"); #define PCI_EHCI_BASE_REG 0x10 +static void ehci_pci_takecontroller(device_t self); + static device_probe_t ehci_pci_probe; static device_attach_t ehci_pci_attach; static device_detach_t ehci_pci_detach; @@ -127,6 +129,7 @@ ehci_pci_resume(device_t self) { ehci_softc_t *sc = device_get_softc(self); + ehci_pci_takecontroller(self); ehci_resume(sc); bus_generic_resume(self); @@ -411,6 +414,7 @@ ehci_pci_attach(device_t self) sc->sc_intr_hdl = NULL; goto error; } + ehci_pci_takecontroller(self); /* Undocumented quirks taken from Linux */ @@ -502,6 +506,51 @@ ehci_pci_detach(device_t self) return (0); } +static void +ehci_pci_takecontroller(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + uint32_t cparams; + uint32_t eec; + uint16_t to; + uint8_t eecp; + uint8_t bios_sem; + + cparams = EREAD4(sc, EHCI_HCCPARAMS); + + /* Synchronise with the BIOS if it owns the controller. */ + for (eecp = EHCI_HCC_EECP(cparams); eecp != 0; + eecp = EHCI_EECP_NEXT(eec)) { + eec = pci_read_config(self, eecp, 4); + if (EHCI_EECP_ID(eec) != EHCI_EC_LEGSUP) { + continue; + } + bios_sem = pci_read_config(self, eecp + + EHCI_LEGSUP_BIOS_SEM, 1); + if (bios_sem == 0) { + continue; + } + device_printf(sc->sc_bus.bdev, "waiting for BIOS " + "to give up control\n"); + pci_write_config(self, eecp + + EHCI_LEGSUP_OS_SEM, 1, 1); + to = 500; + while (1) { + bios_sem = pci_read_config(self, eecp + + EHCI_LEGSUP_BIOS_SEM, 1); + if (bios_sem == 0) + break; + + if (--to == 0) { + device_printf(sc->sc_bus.bdev, + "timed out waiting for BIOS\n"); + break; + } + usb_pause_mtx(NULL, hz / 100); /* wait 10ms */ + } + } +} + static driver_t ehci_driver = { .name = "ehci", Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Mon Oct 26 20:23:15 2009 (r198500) +++ head/sys/dev/usb/controller/ohci.c Mon Oct 26 21:47:16 2009 (r198501) @@ -175,6 +175,30 @@ ohci_controller_init(ohci_softc_t *sc) uint32_t per; uint32_t desca; + /* Determine in what context we are running. */ + ctl = OREAD4(sc, OHCI_CONTROL); + if (ctl & OHCI_IR) { + /* SMM active, request change */ + DPRINTF("SMM active, request owner change\n"); + OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_OCR); + for (i = 0; (i < 100) && (ctl & OHCI_IR); i++) { + usb_pause_mtx(NULL, hz / 1000); + ctl = OREAD4(sc, OHCI_CONTROL); + } + if (ctl & OHCI_IR) { + device_printf(sc->sc_bus.bdev, + "SMM does not respond, resetting\n"); + OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); + goto reset; + } + } else { + DPRINTF("cold started\n"); +reset: + /* controller was cold started */ + usb_pause_mtx(NULL, + USB_MS_TO_TICKS(USB_BUS_RESET_DELAY)); + } + /* * This reset should not be necessary according to the OHCI spec, but * without it some controllers do not start. Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Mon Oct 26 20:23:15 2009 (r198500) +++ head/sys/dev/usb/controller/uhci_pci.c Mon Oct 26 21:47:16 2009 (r198501) @@ -115,6 +115,8 @@ uhci_pci_resume(device_t self) { uhci_softc_t *sc = device_get_softc(self); + pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2); + uhci_resume(sc); bus_generic_resume(self); @@ -361,6 +363,19 @@ uhci_pci_attach(device_t self) sc->sc_intr_hdl = NULL; goto error; } + /* + * Set the PIRQD enable bit and switch off all the others. We don't + * want legacy support to interfere with us XXX Does this also mean + * that the BIOS won't touch the keyboard anymore if it is connected + * to the ports of the root hub? + */ +#ifdef USB_DEBUG + if (pci_read_config(self, PCI_LEGSUP, 2) != PCI_LEGSUP_USBPIRQDEN) { + device_printf(self, "LegSup = 0x%04x\n", + pci_read_config(self, PCI_LEGSUP, 2)); + } +#endif + pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2); err = uhci_init(sc); if (!err) { From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 22:00:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59711106566B; Mon, 26 Oct 2009 22:00:27 +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 4868F8FC17; Mon, 26 Oct 2009 22:00:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QM0QVA011601; Mon, 26 Oct 2009 22:00:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QM0QEg011599; Mon, 26 Oct 2009 22:00:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200910262200.n9QM0QEg011599@svn.freebsd.org> From: Marius Strobl Date: Mon, 26 Oct 2009 22:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198502 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 22:00:27 -0000 Author: marius Date: Mon Oct 26 22:00:26 2009 New Revision: 198502 URL: http://svn.freebsd.org/changeset/base/198502 Log: Sync with the other archs and wrapper the prototype of in_cksum_skip(9) in #ifdef _KERNEL. Submitted by: Ulrich Spoerlein MFC after: 1 month Modified: head/sys/sparc64/include/in_cksum.h Modified: head/sys/sparc64/include/in_cksum.h ============================================================================== --- head/sys/sparc64/include/in_cksum.h Mon Oct 26 21:47:16 2009 (r198501) +++ head/sys/sparc64/include/in_cksum.h Mon Oct 26 22:00:26 2009 (r198502) @@ -164,6 +164,8 @@ in_cksum_hdr(struct ip *ip) return (__ret); } +#ifdef _KERNEL u_short in_cksum_skip(struct mbuf *m, int len, int skip); +#endif #endif /* _MACHINE_IN_CKSUM_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 23:24:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9CB8106566B; Mon, 26 Oct 2009 23:24:59 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8EB98FC18; Mon, 26 Oct 2009 23:24:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9QNOxkK013445; Mon, 26 Oct 2009 23:24:59 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9QNOxFM013443; Mon, 26 Oct 2009 23:24:59 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200910262324.n9QNOxFM013443@svn.freebsd.org> From: Colin Percival Date: Mon, 26 Oct 2009 23:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198503 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 23:24:59 -0000 Author: cperciva Date: Mon Oct 26 23:24:59 2009 New Revision: 198503 URL: http://svn.freebsd.org/changeset/base/198503 Log: Don't leak a file descriptor when ejecting a CDROM. Submitted by: Ronald Klop, trhodes Note to self: don't do commits while half-asleep Modified: head/usr.sbin/sysinstall/cdrom.c Modified: head/usr.sbin/sysinstall/cdrom.c ============================================================================== --- head/usr.sbin/sysinstall/cdrom.c Mon Oct 26 22:00:26 2009 (r198502) +++ head/usr.sbin/sysinstall/cdrom.c Mon Oct 26 23:24:59 2009 (r198503) @@ -239,5 +239,6 @@ mediaEjectCDROM(Device *dev) else { ioctl(fd, CDIOCALLOW); ioctl(fd, CDIOCEJECT); + close(fd); } } From owner-svn-src-head@FreeBSD.ORG Mon Oct 26 23:26:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 5F41410656FF for ; Mon, 26 Oct 2009 23:26:48 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 8AAE3156D57 for ; Mon, 26 Oct 2009 23:26:45 +0000 (UTC) Received: (qmail 18793 invoked from network); 26 Oct 2009 23:26:45 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 26 Oct 2009 23:26:45 -0000 Message-ID: <4AE63034.3040308@freebsd.org> Date: Mon, 26 Oct 2009 16:26:44 -0700 From: Colin Percival User-Agent: Thunderbird 2.0.0.23 (X11/20090919) MIME-Version: 1.0 To: Ronald Klop References: <200910260651.n9Q6pLfU080067@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198477 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 23:26:48 -0000 Ronald Klop wrote: > I'm no committer, but isn't it nice to close the fd? Indeed -- I need to be more awake when I do commits in the future. :-) I've fixed this now; thanks for pointing it out. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 00:05:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 164C810656AC; Tue, 27 Oct 2009 00:05:33 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by mx1.freebsd.org (Postfix) with ESMTP id 2AA3D8FC1F; Tue, 27 Oct 2009 00:05:31 +0000 (UTC) Received: by ewy18 with SMTP id 18so11028856ewy.43 for ; Mon, 26 Oct 2009 17:05:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=i+s2jtK9YMxp1jjbYO40/LmSJjmFUwJuDCZtwzK3V74=; b=pxzVQ6fPCfEHzWsMnVMm6GINWr5UNjwr+ZT5G7S8Dx+/hOoL9sRjGp/msDPTvt2mok MHs1LvahKK3w9N/3Z9ft9Z4xPXFXGgH149C59AOULZNRjZfjtxUeTLmBO5YidR4anHMz MDRS3+mrzNLeDdcnuoaOkHoPSl1eJZYq3AMU0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=iCYFLAnFVYUd9siF/1+wCiuypbShH82lhwYd4w5fgmKdc/Bt37C/MYsp9/HHtyY7ni yCws1JpZk0/IVlhsdTfWzjMsMgYlypspRvrpCAmTLdo7TB++0U4ZJyLLis85N4HLWKnV z2j332X5qrj3oFEy52JQzlXOP6tNqOZrXxXwY= MIME-Version: 1.0 Received: by 10.211.173.11 with SMTP id a11mr7993662ebp.42.1256601931102; Mon, 26 Oct 2009 17:05:31 -0700 (PDT) In-Reply-To: <200910212059.n9LKxDDQ010447@svn.freebsd.org> References: <200910212059.n9LKxDDQ010447@svn.freebsd.org> Date: Mon, 26 Oct 2009 20:05:31 -0400 Message-ID: <47d0403c0910261705s68cd23dcq67433dd831603416@mail.gmail.com> From: Ben Kaduk To: Edwin Groothuis Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198351 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 00:05:33 -0000 On Wed, Oct 21, 2009 at 4:59 PM, Edwin Groothuis wrote: > Author: edwin > Date: Wed Oct 21 20:59:12 2009 > New Revision: 198351 > URL: http://svn.freebsd.org/changeset/base/198351 > > Log: > After the installation of the /usr/share/zoneinfo, run tzsetup if > /var/db/zoneinfo exists. > > MFC after: 1 week > > Modified: > head/share/zoneinfo/Makefile > > Modified: head/share/zoneinfo/Makefile > ============================================================================== > --- head/share/zoneinfo/Makefile Wed Oct 21 20:55:04 2009 (r198350) > +++ head/share/zoneinfo/Makefile Wed Oct 21 20:59:12 2009 (r198351) > @@ -54,4 +54,24 @@ beforeinstall: > ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ > ${.CURDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ > > +afterinstall: > + @# > + @# If the file /var/db/zoneinfo exists, and it is owned by root:wheel, > + @# and the contents of it exists in /usr/share/zoneinfo, then reinstall > + @# it. > + @# > + @if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \ > + -a -G ${DESTDIR}/var/db/zoneinfo ]; then \ > + zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \ > + if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \ > + if [ ! -z "${DESTDIR}" ]; then \ > + optC="-C ${DESTDIR}"; \ > + fi; \ > + echo "Updating /etc/localtime"; \ > + tzsetup ${optC} -r; \ This breaks installworld for me. Replacing tzsetup with a hardcoded /usr/sbin/tzsetup allowed installworld to finish. The end of the installworld log is up at http://stuff.mit.edu/afs/sipb.mit.edu/user/kaduk/freebsd/iw.txt -Ben Kaduk > + fi; \ > + else \ > + echo "Run tzsetup(8) manually to update /etc/localtime."; \ > + fi > + > .include > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 00:43:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A73E106568B; Tue, 27 Oct 2009 00:43:03 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from k7.mavetju.org (ppp113-58.static.internode.on.net [150.101.113.58]) by mx1.freebsd.org (Postfix) with ESMTP id C1EB68FC21; Tue, 27 Oct 2009 00:43:02 +0000 (UTC) Received: by k7.mavetju.org (Postfix, from userid 1001) id 957BA4515E; Tue, 27 Oct 2009 11:42:13 +1100 (EST) Date: Tue, 27 Oct 2009 11:42:13 +1100 From: Edwin Groothuis To: Ben Kaduk Message-ID: <20091027004213.GA13626@mavetju.org> References: <200910212059.n9LKxDDQ010447@svn.freebsd.org> <47d0403c0910261705s68cd23dcq67433dd831603416@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47d0403c0910261705s68cd23dcq67433dd831603416@mail.gmail.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198351 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 00:43:03 -0000 On Mon, Oct 26, 2009 at 08:05:31PM -0400, Ben Kaduk wrote: > > + fi; \ > > + echo "Updating /etc/localtime"; \ > > + tzsetup ${optC} -r; \ > > > This breaks installworld for me. Replacing tzsetup with a hardcoded > /usr/sbin/tzsetup allowed installworld to finish. ===> share/zoneinfo (install) umask 022; cd /usr/src/share/zoneinfo; zic -D -d /usr/share/zoneinfo -p America/New_York -u root -g wheel -m 444 -y /usr/obj/usr/src/share/zoneinfo/yearistype africa antarctica asia australasia etcetera europe factory northamerica southamerica "factory", line 11: warning: time zone abbreviation differs from POSIX standard (Local time zone must be set--use tzsetup) install -o root -g wheel -m 444 /usr/src/share/zoneinfo/zone.tab /usr/share/zoneinfo/ Updating /etc/localtime tzsetup: not found *** Error code 127 I'll check it out, just wonder why you can run zic(8) but not tzsetup(8). They are both in /usr/sbin. Edwin -- Edwin Groothuis Website: http://www.mavetju.org/ edwin@mavetju.org Weblog: http://www.mavetju.org/weblog/ From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 04:53:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B00C106566B; Tue, 27 Oct 2009 04:53:33 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2593D8FC0A; Tue, 27 Oct 2009 04:53:31 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id GAA13705; Tue, 27 Oct 2009 06:53:15 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1N2e3X-000NyQ-DJ; Tue, 27 Oct 2009 06:53:15 +0200 Message-ID: <4AE67CA3.5080109@freebsd.org> Date: Tue, 27 Oct 2009 06:52:51 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20090823) MIME-Version: 1.0 To: Edwin Groothuis References: <200910212059.n9LKxDDQ010447@svn.freebsd.org> <47d0403c0910261705s68cd23dcq67433dd831603416@mail.gmail.com> <20091027004213.GA13626@mavetju.org> In-Reply-To: <20091027004213.GA13626@mavetju.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ben Kaduk Subject: Re: svn commit: r198351 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 04:53:33 -0000 on 27/10/2009 02:42 Edwin Groothuis said the following: > On Mon, Oct 26, 2009 at 08:05:31PM -0400, Ben Kaduk wrote: >>> + fi; \ >>> + echo "Updating /etc/localtime"; \ >>> + tzsetup ${optC} -r; \ >> >> This breaks installworld for me. Replacing tzsetup with a hardcoded >> /usr/sbin/tzsetup allowed installworld to finish. > > ===> share/zoneinfo (install) > umask 022; cd /usr/src/share/zoneinfo; zic -D -d /usr/share/zoneinfo -p America/New_York -u root -g wheel -m 444 -y /usr/obj/usr/src/share/zoneinfo/yearistype africa antarctica asia australasia etcetera europe factory northamerica southamerica > "factory", line 11: warning: time zone abbreviation differs from POSIX standard (Local time zone must be set--use tzsetup) > install -o root -g wheel -m 444 /usr/src/share/zoneinfo/zone.tab /usr/share/zoneinfo/ > Updating /etc/localtime > tzsetup: not found > *** Error code 127 > > I'll check it out, just wonder why you can run zic(8) but not > tzsetup(8). They are both in /usr/sbin. Perhaps ITOOLS variable has something to do with this. (installworld may be executed from a rather unpopulated environment). -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 06:46:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97954106566B; Tue, 27 Oct 2009 06:46:07 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from k7.mavetju.org (ppp113-58.static.internode.on.net [150.101.113.58]) by mx1.freebsd.org (Postfix) with ESMTP id 35E5C8FC13; Tue, 27 Oct 2009 06:46:06 +0000 (UTC) Received: by k7.mavetju.org (Postfix, from userid 1001) id BA80045167; Tue, 27 Oct 2009 17:45:17 +1100 (EST) Date: Tue, 27 Oct 2009 17:45:17 +1100 From: Edwin Groothuis To: Ben Kaduk Message-ID: <20091027064517.GA34072@mavetju.org> References: <200910212059.n9LKxDDQ010447@svn.freebsd.org> <47d0403c0910261705s68cd23dcq67433dd831603416@mail.gmail.com> <20091027004213.GA13626@mavetju.org> <4AE67CA3.5080109@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AE67CA3.5080109@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r198351 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 06:46:07 -0000 On Tue, Oct 27, 2009 at 06:52:51AM +0200, Andriy Gapon wrote: > on 27/10/2009 02:42 Edwin Groothuis said the following: > > On Mon, Oct 26, 2009 at 08:05:31PM -0400, Ben Kaduk wrote: > >>> + fi; \ > >>> + echo "Updating /etc/localtime"; \ > >>> + tzsetup ${optC} -r; \ > >> > >> This breaks installworld for me. Replacing tzsetup with a hardcoded > >> /usr/sbin/tzsetup allowed installworld to finish. > > > > ===> share/zoneinfo (install) > > umask 022; cd /usr/src/share/zoneinfo; zic -D -d /usr/share/zoneinfo -p America/New_York -u root -g wheel -m 444 -y /usr/obj/usr/src/share/zoneinfo/yearistype africa antarctica asia australasia etcetera europe factory northamerica southamerica > > "factory", line 11: warning: time zone abbreviation differs from POSIX standard (Local time zone must be set--use tzsetup) > > install -o root -g wheel -m 444 /usr/src/share/zoneinfo/zone.tab /usr/share/zoneinfo/ > > Updating /etc/localtime > > tzsetup: not found > > *** Error code 127 > > > > I'll check it out, just wonder why you can run zic(8) but not > > tzsetup(8). They are both in /usr/sbin. > > Perhaps ITOOLS variable has something to do with this. > (installworld may be executed from a rather unpopulated environment). Ben, Can you confirm that this resolves it? Index: Makefile.inc1 =================================================================== --- Makefile.inc1 (revision 198253) +++ Makefile.inc1 (working copy) @@ -599,11 +599,14 @@ .if ${MK_INFO} != "no" _install-info= install-info .endif +.if ${MK_ZONEINFO} != "no" +_zoneinfo= zic tzsetup +.endif ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ date echo egrep find grep ${_install-info} \ ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \ - test true uname wc zic + test true uname wc ${_zoneinfo} # # distributeworld Edwin -- Edwin Groothuis Website: http://www.mavetju.org/ edwin@mavetju.org Weblog: http://www.mavetju.org/weblog/ From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 10:15:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F1AA1065676; Tue, 27 Oct 2009 10:15:58 +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 5E5158FC12; Tue, 27 Oct 2009 10:15:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RAFwqw028190; Tue, 27 Oct 2009 10:15:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RAFwZJ028187; Tue, 27 Oct 2009 10:15:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910271015.n9RAFwZJ028187@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Oct 2009 10:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198505 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 10:15:58 -0000 Author: kib Date: Tue Oct 27 10:15:58 2009 New Revision: 198505 URL: http://svn.freebsd.org/changeset/base/198505 Log: When protection of wired read-only mapping is changed to read-write, install new shadow object behind the map entry and copy the pages from the underlying objects to it. This makes the mprotect(2) call to actually perform the requested operation instead of silently do nothing and return success, that causes SIGSEGV on later write access to the mapping. Reuse vm_fault_copy_entry() to do the copying, modifying it to behave correctly when src_entry == dst_entry. Reviewed by: alc MFC after: 3 weeks Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_map.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon Oct 26 23:39:07 2009 (r198504) +++ head/sys/vm/vm_fault.c Tue Oct 27 10:15:58 2009 (r198505) @@ -1119,7 +1119,10 @@ vm_fault_unwire(vm_map_t map, vm_offset_ * Routine: * vm_fault_copy_entry * Function: - * Copy all of the pages from a wired-down map entry to another. + * Create new shadow object backing dst_entry with private copy of + * all underlying pages. When src_entry is equal to dst_entry, + * function implements COW for wired-down map entry. Otherwise, + * it forks wired entry into dst_map. * * In/out conditions: * The source and destination maps must be locked for write. @@ -1131,19 +1134,20 @@ vm_fault_copy_entry(vm_map_t dst_map, vm vm_map_entry_t dst_entry, vm_map_entry_t src_entry, vm_ooffset_t *fork_charge) { - vm_object_t backing_object, dst_object, object; - vm_object_t src_object; + vm_object_t backing_object, dst_object, object, src_object; vm_pindex_t dst_pindex, pindex, src_pindex; - vm_prot_t prot; + vm_prot_t access, prot; vm_offset_t vaddr; vm_page_t dst_m; vm_page_t src_m; - boolean_t src_readonly; + boolean_t src_readonly, upgrade; #ifdef lint src_map++; #endif /* lint */ + upgrade = src_entry == dst_entry; + src_object = src_entry->object.vm_object; src_pindex = OFF_TO_IDX(src_entry->offset); src_readonly = (src_entry->protection & VM_PROT_WRITE) == 0; @@ -1160,17 +1164,34 @@ vm_fault_copy_entry(vm_map_t dst_map, vm #endif VM_OBJECT_LOCK(dst_object); - KASSERT(dst_entry->object.vm_object == NULL, + KASSERT(upgrade || dst_entry->object.vm_object == NULL, ("vm_fault_copy_entry: vm_object not NULL")); dst_entry->object.vm_object = dst_object; dst_entry->offset = 0; - dst_object->uip = curthread->td_ucred->cr_ruidinfo; - uihold(dst_object->uip); dst_object->charge = dst_entry->end - dst_entry->start; - KASSERT(dst_entry->uip == NULL, - ("vm_fault_copy_entry: leaked swp charge")); - *fork_charge += dst_object->charge; - prot = dst_entry->max_protection; + if (fork_charge != NULL) { + KASSERT(dst_entry->uip == NULL, + ("vm_fault_copy_entry: leaked swp charge")); + dst_object->uip = curthread->td_ucred->cr_ruidinfo; + uihold(dst_object->uip); + *fork_charge += dst_object->charge; + } else { + dst_object->uip = dst_entry->uip; + dst_entry->uip = NULL; + } + access = prot = dst_entry->max_protection; + /* + * If not an upgrade, then enter the mappings in the pmap as + * read and/or execute accesses. Otherwise, enter them as + * write accesses. + * + * A writeable large page mapping is only created if all of + * the constituent small page mappings are modified. Marking + * PTEs as modified on inception allows promotion to happen + * without taking potentially large number of soft faults. + */ + if (!upgrade) + access &= ~VM_PROT_WRITE; /* * Loop through all of the pages in the entry's range, copying each @@ -1221,21 +1242,30 @@ vm_fault_copy_entry(vm_map_t dst_map, vm VM_OBJECT_UNLOCK(dst_object); /* - * Enter it in the pmap as a read and/or execute access. + * Enter it in the pmap. If a wired, copy-on-write + * mapping is being replaced by a write-enabled + * mapping, then wire that new mapping. */ - pmap_enter(dst_map->pmap, vaddr, prot & ~VM_PROT_WRITE, dst_m, - prot, FALSE); + pmap_enter(dst_map->pmap, vaddr, access, dst_m, prot, upgrade); /* * Mark it no longer busy, and put it on the active list. */ VM_OBJECT_LOCK(dst_object); vm_page_lock_queues(); - vm_page_activate(dst_m); + if (upgrade) { + vm_page_unwire(src_m, 0); + vm_page_wire(dst_m); + } else + vm_page_activate(dst_m); vm_page_unlock_queues(); vm_page_wakeup(dst_m); } VM_OBJECT_UNLOCK(dst_object); + if (upgrade) { + dst_entry->eflags &= ~(MAP_ENTRY_COW | MAP_ENTRY_NEEDS_COPY); + vm_object_deallocate(src_object); + } } Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Oct 26 23:39:07 2009 (r198504) +++ head/sys/vm/vm_map.c Tue Oct 27 10:15:58 2009 (r198505) @@ -1805,10 +1805,10 @@ int vm_map_protect(vm_map_t map, vm_offset_t start, vm_offset_t end, vm_prot_t new_prot, boolean_t set_max) { - vm_map_entry_t current; - vm_map_entry_t entry; + vm_map_entry_t current, entry; vm_object_t obj; struct uidinfo *uip; + vm_prot_t old_prot; vm_map_lock(map); @@ -1897,9 +1897,8 @@ vm_map_protect(vm_map_t map, vm_offset_t */ current = entry; while ((current != &map->header) && (current->start < end)) { - vm_prot_t old_prot; - old_prot = current->protection; + if (set_max) current->protection = (current->max_protection = new_prot) & @@ -1907,6 +1906,13 @@ vm_map_protect(vm_map_t map, vm_offset_t else current->protection = new_prot; + if ((current->eflags & (MAP_ENTRY_COW | MAP_ENTRY_USER_WIRED)) + == (MAP_ENTRY_COW | MAP_ENTRY_USER_WIRED) && + (current->protection & VM_PROT_WRITE) != 0 && + (old_prot & VM_PROT_WRITE) == 0) { + vm_fault_copy_entry(map, map, current, current, NULL); + } + /* * Update physical map if necessary. Worry about copy-on-write * here. From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 10:19:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 377311065679; Tue, 27 Oct 2009 10:19:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 9C38F8FC1F; Tue, 27 Oct 2009 10:19:20 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n9RAJGqB033937 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 27 Oct 2009 12:19:16 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n9RAJG7D000925; Tue, 27 Oct 2009 12:19:16 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n9RAJGRE000924; Tue, 27 Oct 2009 12:19:16 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 27 Oct 2009 12:19:16 +0200 From: Kostik Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20091027101915.GD2160@deviant.kiev.zoral.com.ua> References: <200910271015.n9RAFwZJ028187@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/4AxN65oSelVOBJV" Content-Disposition: inline In-Reply-To: <200910271015.n9RAFwZJ028187@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r198505 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 10:19:21 -0000 --/4AxN65oSelVOBJV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 27, 2009 at 10:15:58AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Tue Oct 27 10:15:58 2009 > New Revision: 198505 > URL: http://svn.freebsd.org/changeset/base/198505 >=20 > Log: > When protection of wired read-only mapping is changed to read-write, of private wired read-only mapping > install new shadow object behind the map entry and copy the pages > from the underlying objects to it. This makes the mprotect(2) call to > actually perform the requested operation instead of silently do nothing > and return success, that causes SIGSEGV on later write access to the > mapping. --/4AxN65oSelVOBJV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrmySMACgkQC3+MBN1Mb4giKQCfcPWCg+UStNc4qGocYZrFFN2W zqEAn1Lb88i/VpbKFiIQw5CqFYWcj8Ve =Z7vS -----END PGP SIGNATURE----- --/4AxN65oSelVOBJV-- From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 10:42:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41AA6106566B; Tue, 27 Oct 2009 10:42:25 +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 303D58FC08; Tue, 27 Oct 2009 10:42:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RAgO1O028755; Tue, 27 Oct 2009 10:42:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RAgOcT028750; Tue, 27 Oct 2009 10:42:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910271042.n9RAgOcT028750@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Oct 2009 10:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198506 - in head/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 10:42:25 -0000 Author: kib Date: Tue Oct 27 10:42:24 2009 New Revision: 198506 URL: http://svn.freebsd.org/changeset/base/198506 Log: In kern_sigsuspend(), better manipulate thread signal mask using kern_sigprocmask() to properly notify other possible candidate threads for signal delivery. Since sigsuspend() shall only return to usermode after a signal was delivered, do cursig/postsig loop immediately after waiting for signal, repeating the wait if wakeup was spurious due to race with other thread fetching signal from the process queue before us. Add thread_suspend_check() call to allow the thread to be stopped or killed while in loop. Modify last argument of kern_sigprocmask() from boolean to flags, allowing the function to be called with locked proc. Convertion of the callers that supplied 1 to the old argument will be done in the next commit, and due to SIGPROCMASK_OLD value equial to 1, code is formally correct in between. Reviewed by: davidxu Tested by: pho MFC after: 1 month Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_sig.c head/sys/sys/signalvar.h head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Oct 27 10:15:58 2009 (r198505) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Oct 27 10:42:24 2009 (r198506) @@ -2579,21 +2579,10 @@ int ofreebsd32_sigsuspend(struct thread *td, struct ofreebsd32_sigsuspend_args *uap) { - struct proc *p = td->td_proc; sigset_t mask; - PROC_LOCK(p); - td->td_oldsigmask = td->td_sigmask; - td->td_pflags |= TDP_OLDMASK; OSIG2SIG(uap->mask, mask); - SIG_CANTMASK(mask); - SIGSETLO(td->td_sigmask, mask); - signotify(td); - while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "opause", 0) == 0) - /* void */; - PROC_UNLOCK(p); - /* always return EINTR rather than ERESTART... */ - return (EINTR); + return (kern_sigsuspend(td, mask)); } struct sigstack32 { Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Oct 27 10:15:58 2009 (r198505) +++ head/sys/kern/kern_sig.c Tue Oct 27 10:42:24 2009 (r198506) @@ -970,14 +970,15 @@ execsigs(struct proc *p) */ int kern_sigprocmask(struct thread *td, int how, sigset_t *set, sigset_t *oset, - int old) + int flags) { sigset_t new_block, oset1; struct proc *p; int error; p = td->td_proc; - PROC_LOCK(p); + if (!(flags & SIGPROCMASK_PROC_LOCKED)) + PROC_LOCK(p); if (oset != NULL) *oset = td->td_sigmask; @@ -999,7 +1000,7 @@ kern_sigprocmask(struct thread *td, int case SIG_SETMASK: SIG_CANTMASK(*set); oset1 = td->td_sigmask; - if (old) + if (flags & SIGPROCMASK_OLD) SIGSETLO(td->td_sigmask, *set); else td->td_sigmask = *set; @@ -1025,7 +1026,8 @@ kern_sigprocmask(struct thread *td, int if (p->p_numthreads != 1) reschedule_signals(p, new_block); - PROC_UNLOCK(p); + if (!(flags & SIGPROCMASK_PROC_LOCKED)) + PROC_UNLOCK(p); return (error); } @@ -1458,6 +1460,7 @@ int kern_sigsuspend(struct thread *td, sigset_t mask) { struct proc *p = td->td_proc; + int has_sig, sig; /* * When returning from sigsuspend, we want @@ -1467,13 +1470,28 @@ kern_sigsuspend(struct thread *td, sigse * to indicate this. */ PROC_LOCK(p); - td->td_oldsigmask = td->td_sigmask; + kern_sigprocmask(td, SIG_SETMASK, &mask, &td->td_oldsigmask, + SIGPROCMASK_PROC_LOCKED); td->td_pflags |= TDP_OLDMASK; - SIG_CANTMASK(mask); - td->td_sigmask = mask; - signotify(td); - while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "pause", 0) == 0) - /* void */; + + /* + * Process signals now. Otherwise, we can get spurious wakeup + * due to signal entered process queue, but delivered to other + * thread. But sigsuspend should return only on signal + * delivery. + */ + for (has_sig = 0; !has_sig;) { + while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "pause", + 0) == 0) + /* void */; + thread_suspend_check(0); + mtx_lock(&p->p_sigacts->ps_mtx); + while ((sig = cursig(td, SIG_STOP_ALLOWED)) != 0) { + postsig(sig); + has_sig = 1; + } + mtx_unlock(&p->p_sigacts->ps_mtx); + } PROC_UNLOCK(p); /* always return EINTR rather than ERESTART... */ return (EINTR); @@ -1495,21 +1513,10 @@ osigsuspend(td, uap) struct thread *td; struct osigsuspend_args *uap; { - struct proc *p = td->td_proc; sigset_t mask; - PROC_LOCK(p); - td->td_oldsigmask = td->td_sigmask; - td->td_pflags |= TDP_OLDMASK; OSIG2SIG(uap->mask, mask); - SIG_CANTMASK(mask); - SIGSETLO(td->td_sigmask, mask); - signotify(td); - while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "opause", 0) == 0) - /* void */; - PROC_UNLOCK(p); - /* always return EINTR rather than ERESTART... */ - return (EINTR); + return (kern_sigsuspend(td, mask)); } #endif /* COMPAT_43 */ Modified: head/sys/sys/signalvar.h ============================================================================== --- head/sys/sys/signalvar.h Tue Oct 27 10:15:58 2009 (r198505) +++ head/sys/sys/signalvar.h Tue Oct 27 10:42:24 2009 (r198506) @@ -316,6 +316,10 @@ extern int kern_logsigexit; /* Sysctl va #define SIG_STOP_ALLOWED 100 #define SIG_STOP_NOT_ALLOWED 101 +/* flags for kern_sigprocmask */ +#define SIGPROCMASK_OLD 0x0001 +#define SIGPROCMASK_PROC_LOCKED 0x0002 + /* * Machine-independent functions: */ @@ -359,7 +363,8 @@ void sigqueue_delete_stopmask_proc(struc void sigqueue_take(ksiginfo_t *ksi); int kern_sigtimedwait(struct thread *, sigset_t, ksiginfo_t *, struct timespec *); - +int kern_sigprocmask(struct thread *td, int how, + sigset_t *set, sigset_t *oset, int flags); /* * Machine-dependent functions: */ Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Tue Oct 27 10:15:58 2009 (r198505) +++ head/sys/sys/syscallsubr.h Tue Oct 27 10:42:24 2009 (r198506) @@ -190,8 +190,6 @@ int kern_shmctl(struct thread *td, int s int kern_sigaction(struct thread *td, int sig, struct sigaction *act, struct sigaction *oact, int flags); int kern_sigaltstack(struct thread *td, stack_t *ss, stack_t *oss); -int kern_sigprocmask(struct thread *td, int how, - sigset_t *set, sigset_t *oset, int old); int kern_sigsuspend(struct thread *td, sigset_t mask); int kern_stat(struct thread *td, char *path, enum uio_seg pathseg, struct stat *sbp); From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 10:47:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DB49106566B; Tue, 27 Oct 2009 10:47:59 +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 694C58FC14; Tue, 27 Oct 2009 10:47:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RAlxtG028917; Tue, 27 Oct 2009 10:47:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RAlxTw028900; Tue, 27 Oct 2009 10:47:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910271047.n9RAlxTw028900@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Oct 2009 10:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198507 - in head/sys: amd64/amd64 amd64/ia32 amd64/linux32 arm/arm compat/freebsd32 i386/i386 i386/linux ia64/ia64 kern mips/mips pc98/pc98 powerpc/aim powerpc/booke sparc64/sparc64 su... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 10:47:59 -0000 Author: kib Date: Tue Oct 27 10:47:58 2009 New Revision: 198507 URL: http://svn.freebsd.org/changeset/base/198507 Log: In r197963, a race with thread being selected for signal delivery while in kernel mode, and later changing signal mask to block the signal, was fixed for sigprocmask(2) and ptread_exit(3). The same race exists for sigreturn(2), setcontext(2) and swapcontext(2) syscalls. Use kern_sigprocmask() instead of direct manipulation of td_sigmask to reschedule newly blocked signals, closing the race. Reviewed by: davidxu Tested by: pho MFC after: 1 month Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/machdep.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/i386/i386/machdep.c head/sys/i386/linux/linux_sysvec.c head/sys/ia64/ia64/machdep.c head/sys/kern/kern_context.c head/sys/kern/kern_sig.c head/sys/mips/mips/pm_machdep.c head/sys/pc98/pc98/machdep.c head/sys/powerpc/aim/machdep.c head/sys/powerpc/booke/machdep.c head/sys/sparc64/sparc64/machdep.c head/sys/sun4v/sun4v/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/amd64/amd64/machdep.c Tue Oct 27 10:47:58 2009 (r198507) @@ -415,7 +415,7 @@ sigreturn(td, uap) ucontext_t uc; struct proc *p = td->td_proc; struct trapframe *regs; - const ucontext_t *ucp; + ucontext_t *ucp; long rflags; int cs, error, ret; ksiginfo_t ksi; @@ -478,7 +478,6 @@ sigreturn(td, uap) td->td_pcb->pcb_fsbase = ucp->uc_mcontext.mc_fsbase; td->td_pcb->pcb_gsbase = ucp->uc_mcontext.mc_gsbase; - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; @@ -486,10 +485,7 @@ sigreturn(td, uap) td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); td->td_pcb->pcb_flags |= PCB_FULLCTX; td->td_pcb->pcb_full_iret = 1; return (EJUSTRETURN); Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/amd64/ia32/ia32_signal.c Tue Oct 27 10:47:58 2009 (r198507) @@ -244,10 +244,8 @@ freebsd32_setcontext(struct thread *td, if (ret == 0) { ret = ia32_set_mcontext(td, &uc.uc_mcontext); if (ret == 0) { - SIG_CANTMASK(uc.uc_sigmask); - PROC_LOCK(td->td_proc); - td->td_sigmask = uc.uc_sigmask; - PROC_UNLOCK(td->td_proc); + kern_sigprocmask(td, SIG_SETMASK, + &uc.uc_sigmask, NULL, 0); } } } @@ -273,10 +271,8 @@ freebsd32_swapcontext(struct thread *td, if (ret == 0) { ret = ia32_set_mcontext(td, &uc.uc_mcontext); if (ret == 0) { - SIG_CANTMASK(uc.uc_sigmask); - PROC_LOCK(td->td_proc); - td->td_sigmask = uc.uc_sigmask; - PROC_UNLOCK(td->td_proc); + kern_sigprocmask(td, SIG_SETMASK, + &uc.uc_sigmask, NULL, 0); } } } @@ -544,9 +540,8 @@ freebsd4_freebsd32_sigreturn(td, uap) } */ *uap; { struct ia32_ucontext4 uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const struct ia32_ucontext4 *ucp; + struct ia32_ucontext4 *ucp; int cs, eflags, error; ksiginfo_t ksi; @@ -610,11 +605,7 @@ freebsd4_freebsd32_sigreturn(td, uap) regs->tf_fs = ucp->uc_mcontext.mc_fs; regs->tf_gs = ucp->uc_mcontext.mc_gs; - PROC_LOCK(p); - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); td->td_pcb->pcb_full_iret = 1; return (EJUSTRETURN); } @@ -631,9 +622,8 @@ freebsd32_sigreturn(td, uap) } */ *uap; { struct ia32_ucontext uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const struct ia32_ucontext *ucp; + struct ia32_ucontext *ucp; int cs, eflags, error, ret; ksiginfo_t ksi; @@ -702,11 +692,7 @@ freebsd32_sigreturn(td, uap) regs->tf_gs = ucp->uc_mcontext.mc_gs; regs->tf_flags = TF_HASSEGS; - PROC_LOCK(p); - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); td->td_pcb->pcb_full_iret = 1; return (EJUSTRETURN); } Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Oct 27 10:47:58 2009 (r198507) @@ -565,9 +565,9 @@ linux_sendsig(sig_t catcher, ksiginfo_t int linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args) { - struct proc *p = td->td_proc; struct l_sigframe frame; struct trapframe *regs; + sigset_t bmask; l_sigset_t lmask; int eflags, i; ksiginfo_t ksi; @@ -623,11 +623,8 @@ linux_sigreturn(struct thread *td, struc lmask.__bits[0] = frame.sf_sc.sc_mask; for (i = 0; i < (LINUX_NSIG_WORDS-1); i++) lmask.__bits[i+1] = frame.sf_extramask[i]; - PROC_LOCK(p); - linux_to_bsd_sigset(&lmask, &td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + linux_to_bsd_sigset(&lmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); /* * Restore signal context. @@ -666,9 +663,9 @@ linux_sigreturn(struct thread *td, struc int linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) { - struct proc *p = td->td_proc; struct l_ucontext uc; struct l_sigcontext *context; + sigset_t bmask; l_stack_t *lss; stack_t ss; struct trapframe *regs; @@ -725,11 +722,8 @@ linux_rt_sigreturn(struct thread *td, st return(EINVAL); } - PROC_LOCK(p); - linux_to_bsd_sigset(&uc.uc_sigmask, &td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + linux_to_bsd_sigset(&uc.uc_sigmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); /* * Restore signal context Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/arm/arm/machdep.c Tue Oct 27 10:47:58 2009 (r198507) @@ -605,7 +605,6 @@ sigreturn(td, uap) const struct __ucontext *sigcntxp; } */ *uap; { - struct proc *p = td->td_proc; struct sigframe sf; struct trapframe *tf; int spsr; @@ -627,11 +626,7 @@ sigreturn(td, uap) set_mcontext(td, &sf.sf_uc.uc_mcontext); /* Restore signal mask. */ - PROC_LOCK(p); - td->td_sigmask = sf.sf_uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &sf.sf_uc.uc_sigmask, NULL, 0); return (EJUSTRETURN); } Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Oct 27 10:47:58 2009 (r198507) @@ -2482,7 +2482,7 @@ ofreebsd32_sigprocmask(struct thread *td int error; OSIG2SIG(uap->mask, set); - error = kern_sigprocmask(td, uap->how, &set, &oset, 1); + error = kern_sigprocmask(td, uap->how, &set, &oset, SIGPROCMASK_OLD); SIG2OSIG(oset, td->td_retval[0]); return (error); } @@ -2546,15 +2546,11 @@ int ofreebsd32_sigblock(struct thread *td, struct ofreebsd32_sigblock_args *uap) { - struct proc *p = td->td_proc; - sigset_t set; + sigset_t set, oset; OSIG2SIG(uap->mask, set); - SIG_CANTMASK(set); - PROC_LOCK(p); - SIG2OSIG(td->td_sigmask, td->td_retval[0]); - SIGSETOR(td->td_sigmask, set); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_BLOCK, &set, &oset, 0); + SIG2OSIG(oset, td->td_retval[0]); return (0); } @@ -2562,16 +2558,11 @@ int ofreebsd32_sigsetmask(struct thread *td, struct ofreebsd32_sigsetmask_args *uap) { - struct proc *p = td->td_proc; - sigset_t set; + sigset_t set, oset; OSIG2SIG(uap->mask, set); - SIG_CANTMASK(set); - PROC_LOCK(p); - SIG2OSIG(td->td_sigmask, td->td_retval[0]); - SIGSETLO(td->td_sigmask, set); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &set, &oset, 0); + SIG2OSIG(oset, td->td_retval[0]); return (0); } Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/i386/i386/machdep.c Tue Oct 27 10:47:58 2009 (r198507) @@ -756,7 +756,6 @@ osigreturn(td, uap) struct osigcontext sc; struct trapframe *regs; struct osigcontext *scp; - struct proc *p = td->td_proc; int eflags, error; ksiginfo_t ksi; @@ -856,17 +855,14 @@ osigreturn(td, uap) regs->tf_eip = scp->sc_pc; regs->tf_eflags = eflags; - PROC_LOCK(p); #if defined(COMPAT_43) if (scp->sc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - SIGSETOLD(td->td_sigmask, scp->sc_mask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, (sigset_t *)&scp->sc_mask, NULL, + SIGPROCMASK_OLD); return (EJUSTRETURN); } #endif /* COMPAT_43 */ @@ -883,9 +879,8 @@ freebsd4_sigreturn(td, uap) } */ *uap; { struct ucontext4 uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const struct ucontext4 *ucp; + struct ucontext4 *ucp; int cs, eflags, error; ksiginfo_t ksi; @@ -973,18 +968,13 @@ freebsd4_sigreturn(td, uap) bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); } - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); return (EJUSTRETURN); } #endif /* COMPAT_FREEBSD4 */ @@ -1000,9 +990,8 @@ sigreturn(td, uap) } */ *uap; { ucontext_t uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const ucontext_t *ucp; + ucontext_t *ucp; int cs, eflags, error, ret; ksiginfo_t ksi; @@ -1094,7 +1083,6 @@ sigreturn(td, uap) bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); } - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; @@ -1102,10 +1090,7 @@ sigreturn(td, uap) td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); return (EJUSTRETURN); } Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/i386/linux/linux_sysvec.c Tue Oct 27 10:47:58 2009 (r198507) @@ -667,10 +667,10 @@ linux_sendsig(sig_t catcher, ksiginfo_t int linux_sigreturn(struct thread *td, struct linux_sigreturn_args *args) { - struct proc *p = td->td_proc; struct l_sigframe frame; struct trapframe *regs; l_sigset_t lmask; + sigset_t bmask; int eflags, i; ksiginfo_t ksi; @@ -725,11 +725,8 @@ linux_sigreturn(struct thread *td, struc lmask.__bits[0] = frame.sf_sc.sc_mask; for (i = 0; i < (LINUX_NSIG_WORDS-1); i++) lmask.__bits[i+1] = frame.sf_extramask[i]; - PROC_LOCK(p); - linux_to_bsd_sigset(&lmask, &td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + linux_to_bsd_sigset(&lmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); /* * Restore signal context. @@ -767,9 +764,9 @@ linux_sigreturn(struct thread *td, struc int linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) { - struct proc *p = td->td_proc; struct l_ucontext uc; struct l_sigcontext *context; + sigset_t bmask; l_stack_t *lss; stack_t ss; struct trapframe *regs; @@ -826,11 +823,8 @@ linux_rt_sigreturn(struct thread *td, st return(EINVAL); } - PROC_LOCK(p); - linux_to_bsd_sigset(&uc.uc_sigmask, &td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + linux_to_bsd_sigset(&uc.uc_sigmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); /* * Restore signal context Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/ia64/ia64/machdep.c Tue Oct 27 10:47:58 2009 (r198507) @@ -1056,11 +1056,9 @@ sigreturn(struct thread *td, { ucontext_t uc; struct trapframe *tf; - struct proc *p; struct pcb *pcb; tf = td->td_frame; - p = td->td_proc; pcb = td->td_pcb; /* @@ -1072,17 +1070,13 @@ sigreturn(struct thread *td, set_mcontext(td, &uc.uc_mcontext); - PROC_LOCK(p); #if defined(COMPAT_43) if (sigonstack(tf->tf_special.sp)) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); return (EJUSTRETURN); } Modified: head/sys/kern/kern_context.c ============================================================================== --- head/sys/kern/kern_context.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/kern/kern_context.c Tue Oct 27 10:47:58 2009 (r198507) @@ -89,10 +89,8 @@ setcontext(struct thread *td, struct set if (ret == 0) { ret = set_mcontext(td, &uc.uc_mcontext); if (ret == 0) { - SIG_CANTMASK(uc.uc_sigmask); - PROC_LOCK(td->td_proc); - td->td_sigmask = uc.uc_sigmask; - PROC_UNLOCK(td->td_proc); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, + NULL, 0); } } } @@ -118,10 +116,8 @@ swapcontext(struct thread *td, struct sw if (ret == 0) { ret = set_mcontext(td, &uc.uc_mcontext); if (ret == 0) { - SIG_CANTMASK(uc.uc_sigmask); - PROC_LOCK(td->td_proc); - td->td_sigmask = uc.uc_sigmask; - PROC_UNLOCK(td->td_proc); + kern_sigprocmask(td, SIG_SETMASK, + &uc.uc_sigmask, NULL, 0); } } } Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/kern/kern_sig.c Tue Oct 27 10:47:58 2009 (r198507) @@ -1396,15 +1396,11 @@ osigblock(td, uap) register struct thread *td; struct osigblock_args *uap; { - struct proc *p = td->td_proc; - sigset_t set; + sigset_t set, oset; OSIG2SIG(uap->mask, set); - SIG_CANTMASK(set); - PROC_LOCK(p); - SIG2OSIG(td->td_sigmask, td->td_retval[0]); - SIGSETOR(td->td_sigmask, set); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_BLOCK, &set, &oset, 0); + SIG2OSIG(oset, td->td_retval[0]); return (0); } @@ -1418,16 +1414,11 @@ osigsetmask(td, uap) struct thread *td; struct osigsetmask_args *uap; { - struct proc *p = td->td_proc; - sigset_t set; + sigset_t set, oset; OSIG2SIG(uap->mask, set); - SIG_CANTMASK(set); - PROC_LOCK(p); - SIG2OSIG(td->td_sigmask, td->td_retval[0]); - SIGSETLO(td->td_sigmask, set); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &set, &oset, 0); + SIG2OSIG(oset, td->td_retval[0]); return (0); } #endif /* COMPAT_43 */ @@ -1845,6 +1836,7 @@ void trapsignal(struct thread *td, ksiginfo_t *ksi) { struct sigacts *ps; + sigset_t mask; struct proc *p; int sig; int code; @@ -1868,8 +1860,11 @@ trapsignal(struct thread *td, ksiginfo_t (*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)], ksi, &td->td_sigmask); SIGSETOR(td->td_sigmask, ps->ps_catchmask[_SIG_IDX(sig)]); - if (!SIGISMEMBER(ps->ps_signodefer, sig)) - SIGADDSET(td->td_sigmask, sig); + if (!SIGISMEMBER(ps->ps_signodefer, sig)) { + SIGEMPTYSET(mask); + SIGADDSET(mask, sig); + kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, 0); + } if (SIGISMEMBER(ps->ps_sigreset, sig)) { /* * See kern_sigaction() for origin of this code. @@ -2683,7 +2678,7 @@ postsig(sig) struct sigacts *ps; sig_t action; ksiginfo_t ksi; - sigset_t returnmask; + sigset_t returnmask, mask; KASSERT(sig != 0, ("postsig")); @@ -2738,9 +2733,15 @@ postsig(sig) } else returnmask = td->td_sigmask; - SIGSETOR(td->td_sigmask, ps->ps_catchmask[_SIG_IDX(sig)]); - if (!SIGISMEMBER(ps->ps_signodefer, sig)) - SIGADDSET(td->td_sigmask, sig); + kern_sigprocmask(td, SIG_BLOCK, + &ps->ps_catchmask[_SIG_IDX(sig)], NULL, + SIGPROCMASK_PROC_LOCKED); + if (!SIGISMEMBER(ps->ps_signodefer, sig)) { + SIGEMPTYSET(mask); + SIGADDSET(mask, sig); + kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, + SIGPROCMASK_PROC_LOCKED); + } if (SIGISMEMBER(ps->ps_sigreset, sig)) { /* Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/mips/mips/pm_machdep.c Tue Oct 27 10:47:58 2009 (r198507) @@ -213,13 +213,11 @@ int sigreturn(struct thread *td, struct sigreturn_args *uap) { struct trapframe *regs; - const ucontext_t *ucp; - struct proc *p; + ucontext_t *ucp; ucontext_t uc; int error; ucp = &uc; - p = td->td_proc; error = copyin(uap->sigcntxp, &uc, sizeof(uc)); if (error != 0) @@ -229,7 +227,7 @@ sigreturn(struct thread *td, struct sigr /* #ifdef DEBUG */ if (ucp->uc_mcontext.mc_regs[ZERO] != UCONTEXT_MAGIC) { - printf("sigreturn: pid %d, ucp %p\n", p->p_pid, ucp); + printf("sigreturn: pid %d, ucp %p\n", td->td_proc->p_pid, ucp); printf(" old sp %x ra %x pc %x\n", regs->sp, regs->ra, regs->pc); printf(" new sp %x ra %x pc %x z %x\n", @@ -253,11 +251,8 @@ sigreturn(struct thread *td, struct sigr regs->mullo = ucp->uc_mcontext.mullo; regs->mulhi = ucp->uc_mcontext.mulhi; - PROC_LOCK(p); - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); + return(EJUSTRETURN); } Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/pc98/pc98/machdep.c Tue Oct 27 10:47:58 2009 (r198507) @@ -686,7 +686,6 @@ osigreturn(td, uap) struct osigcontext sc; struct trapframe *regs; struct osigcontext *scp; - struct proc *p = td->td_proc; int eflags, error; ksiginfo_t ksi; @@ -786,17 +785,14 @@ osigreturn(td, uap) regs->tf_eip = scp->sc_pc; regs->tf_eflags = eflags; - PROC_LOCK(p); #if defined(COMPAT_43) if (scp->sc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - SIGSETOLD(td->td_sigmask, scp->sc_mask); - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, (sigset_t *)&scp->sc_mask, NULL, + SIGPROCMASK_OLD); return (EJUSTRETURN); } #endif /* COMPAT_43 */ @@ -813,9 +809,8 @@ freebsd4_sigreturn(td, uap) } */ *uap; { struct ucontext4 uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const struct ucontext4 *ucp; + struct ucontext4 *ucp; int cs, eflags, error; ksiginfo_t ksi; @@ -903,18 +898,13 @@ freebsd4_sigreturn(td, uap) bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); } - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif - - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); return (EJUSTRETURN); } #endif /* COMPAT_FREEBSD4 */ @@ -930,9 +920,8 @@ sigreturn(td, uap) } */ *uap; { ucontext_t uc; - struct proc *p = td->td_proc; struct trapframe *regs; - const ucontext_t *ucp; + ucontext_t *ucp; int cs, eflags, error, ret; ksiginfo_t ksi; @@ -1024,18 +1013,14 @@ sigreturn(td, uap) bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); } - PROC_LOCK(p); #if defined(COMPAT_43) if (ucp->uc_mcontext.mc_onstack & 1) td->td_sigstk.ss_flags |= SS_ONSTACK; else td->td_sigstk.ss_flags &= ~SS_ONSTACK; #endif + kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); - td->td_sigmask = ucp->uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); return (EJUSTRETURN); } Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/powerpc/aim/machdep.c Tue Oct 27 10:47:58 2009 (r198507) @@ -692,7 +692,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, int sigreturn(struct thread *td, struct sigreturn_args *uap) { - struct proc *p; ucontext_t uc; int error; @@ -707,12 +706,7 @@ sigreturn(struct thread *td, struct sigr if (error != 0) return (error); - p = td->td_proc; - PROC_LOCK(p); - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR3(KTR_SIG, "sigreturn: return td=%p pc=%#x sp=%#x", td, uc.uc_mcontext.mc_srr0, uc.uc_mcontext.mc_gpr[1]); Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/powerpc/booke/machdep.c Tue Oct 27 10:47:58 2009 (r198507) @@ -665,7 +665,6 @@ set_mcontext(struct thread *td, const mc int sigreturn(struct thread *td, struct sigreturn_args *uap) { - struct proc *p; ucontext_t uc; int error; @@ -680,12 +679,7 @@ sigreturn(struct thread *td, struct sigr if (error != 0) return (error); - p = td->td_proc; - PROC_LOCK(p); - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR3(KTR_SIG, "sigreturn: return td=%p pc=%#x sp=%#x", td, uc.uc_mcontext.mc_srr0, uc.uc_mcontext.mc_gpr[1]); Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/sparc64/sparc64/machdep.c Tue Oct 27 10:47:58 2009 (r198507) @@ -653,11 +653,7 @@ sigreturn(struct thread *td, struct sigr if (error != 0) return (error); - PROC_LOCK(p); - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR4(KTR_SIG, "sigreturn: return td=%p pc=%#lx sp=%#lx tstate=%#lx", td, mc->mc_tpc, mc->mc_sp, mc->mc_tstate); Modified: head/sys/sun4v/sun4v/machdep.c ============================================================================== --- head/sys/sun4v/sun4v/machdep.c Tue Oct 27 10:42:24 2009 (r198506) +++ head/sys/sun4v/sun4v/machdep.c Tue Oct 27 10:47:58 2009 (r198507) @@ -667,11 +667,7 @@ sigreturn(struct thread *td, struct sigr if (error != 0) return (error); - PROC_LOCK(p); - td->td_sigmask = uc.uc_sigmask; - SIG_CANTMASK(td->td_sigmask); - signotify(td); - PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); CTR4(KTR_SIG, "sigreturn: return td=%p pc=%#lx sp=%#lx tstate=%#lx", td, mc->mc_tpc, mc->mc_sp, mc->mc_tstate); From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 10:55:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA41F106568D; Tue, 27 Oct 2009 10:55:34 +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 A79D68FC0A; Tue, 27 Oct 2009 10:55:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RAtYQk029115; Tue, 27 Oct 2009 10:55:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RAtYM5029106; Tue, 27 Oct 2009 10:55:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910271055.n9RAtYM5029106@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Oct 2009 10:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198508 - in head: lib/libc/gen lib/libc/sys lib/libthr/thread sys/compat/freebsd32 sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 10:55:34 -0000 Author: kib Date: Tue Oct 27 10:55:34 2009 New Revision: 198508 URL: http://svn.freebsd.org/changeset/base/198508 Log: Current pselect(3) is implemented in usermode and thus vulnerable to well-known race condition, which elimination was the reason for the function appearance in first place. If sigmask supplied as argument to pselect() enables a signal, the signal might be delivered before thread called select(2), causing lost wakeup. Reimplement pselect() in kernel, making change of sigmask and sleep atomic. Since signal shall be delivered to the usermode, but sigmask restored, set TDP_OLDMASK and save old mask in td_oldsigmask. The TDP_OLDMASK should be cleared by ast() in case signal was not gelivered during syscall execution. Reviewed by: davidxu Tested by: pho MFC after: 1 month Deleted: head/lib/libc/gen/pselect.c Modified: head/lib/libc/sys/Symbol.map head/lib/libthr/thread/thr_syscalls.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/subr_trap.c head/sys/kern/sys_generic.c head/sys/kern/syscalls.master head/sys/sys/syscallsubr.h Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Tue Oct 27 10:47:58 2009 (r198507) +++ head/lib/libc/sys/Symbol.map Tue Oct 27 10:55:34 2009 (r198508) @@ -211,6 +211,7 @@ FBSD_1.0 { posix_openpt; preadv; profil; + pselect; ptrace; pwritev; quotactl; @@ -781,6 +782,8 @@ FBSDprivate_1.0 { __sys_preadv; _profil; __sys_profil; + _pselect; + __sys_pselect; _ptrace; __sys_ptrace; _pwritev; Modified: head/lib/libthr/thread/thr_syscalls.c ============================================================================== --- head/lib/libthr/thread/thr_syscalls.c Tue Oct 27 10:47:58 2009 (r198507) +++ head/lib/libthr/thread/thr_syscalls.c Tue Oct 27 10:55:34 2009 (r198508) @@ -104,6 +104,8 @@ extern int __sys_accept(int, struct sock extern int __sys_connect(int, const struct sockaddr *, socklen_t); extern int __sys_fsync(int); extern int __sys_msync(void *, size_t, int); +extern int __sys_pselect(int, fd_set *, fd_set *, fd_set *, + const struct timespec *, const sigset_t *); extern int __sys_poll(struct pollfd *, unsigned, int); extern ssize_t __sys_recv(int, void *, size_t, int); extern ssize_t __sys_recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *); @@ -394,7 +396,7 @@ ___pselect(int count, fd_set *rfds, fd_s int ret; _thr_cancel_enter(curthread); - ret = __pselect(count, rfds, wfds, efds, timo, mask); + ret = __sys_pselect(count, rfds, wfds, efds, timo, mask); _thr_cancel_leave(curthread); return (ret); Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Oct 27 10:47:58 2009 (r198507) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Oct 27 10:55:34 2009 (r198508) @@ -593,6 +593,41 @@ freebsd32_select(struct thread *td, stru sizeof(int32_t) * 8)); } +int +freebsd32_pselect(struct thread *td, struct freebsd32_pselect_args *uap) +{ + struct timespec32 ts32; + struct timespec ts; + struct timeval tv, *tvp; + sigset_t set, *uset; + int error; + + if (uap->ts != NULL) { + error = copyin(uap->ts, &ts32, sizeof(ts32)); + if (error != 0) + return (error); + CP(ts32, ts, tv_sec); + CP(ts32, ts, tv_nsec); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + tvp = &tv; + } else + tvp = NULL; + if (uap->sm != NULL) { + error = copyin(uap->sm, &set, sizeof(set)); + if (error != 0) + return (error); + uset = &set; + } else + uset = NULL; + /* + * XXX big-endian needs to convert the fd_sets too. + * XXX Do pointers need PTRIN()? + */ + error = kern_pselect(td, uap->nd, uap->in, uap->ou, uap->ex, tvp, + uset, sizeof(int32_t) * 8); + return (error); +} + /* * Copy 'count' items into the destination list pointed to by uap->eventlist. */ Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Tue Oct 27 10:47:58 2009 (r198507) +++ head/sys/compat/freebsd32/syscalls.master Tue Oct 27 10:55:34 2009 (r198508) @@ -909,3 +909,7 @@ 519 AUE_PDKILL UNIMPL pdkill 520 AUE_PDGETPID UNIMPL pdgetpid 521 AUE_PDWAIT UNIMPL pdwait +522 AUE_SELECT STD { int freebsd32_pselect(int nd, fd_set *in, \ + fd_set *ou, fd_set *ex, \ + const struct timespec32 *ts, \ + const sigset_t *sm); } Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Tue Oct 27 10:47:58 2009 (r198507) +++ head/sys/kern/subr_trap.c Tue Oct 27 10:55:34 2009 (r198508) @@ -245,6 +245,11 @@ ast(struct trapframe *framep) PROC_UNLOCK(p); } + if (td->td_pflags & TDP_OLDMASK) { + td->td_pflags &= ~TDP_OLDMASK; + kern_sigprocmask(td, SIG_SETMASK, &td->td_oldsigmask, NULL, 0); + } + userret(td, framep); mtx_assert(&Giant, MA_NOTOWNED); } Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Tue Oct 27 10:47:58 2009 (r198507) +++ head/sys/kern/sys_generic.c Tue Oct 27 10:55:34 2009 (r198508) @@ -751,6 +751,58 @@ poll_no_poll(int events) return (events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); } +int +pselect(struct thread *td, struct pselect_args *uap) +{ + struct timespec ts; + struct timeval tv, *tvp; + sigset_t set, *uset; + int error; + + if (uap->ts != NULL) { + error = copyin(uap->ts, &ts, sizeof(ts)); + if (error != 0) + return (error); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + tvp = &tv; + } else + tvp = NULL; + if (uap->sm != NULL) { + error = copyin(uap->sm, &set, sizeof(set)); + if (error != 0) + return (error); + uset = &set; + } else + uset = NULL; + return (kern_pselect(td, uap->nd, uap->in, uap->ou, uap->ex, tvp, + uset, NFDBITS)); +} + +int +kern_pselect(struct thread *td, int nd, fd_set *in, fd_set *ou, fd_set *ex, + struct timeval *tvp, sigset_t *uset, int abi_nfdbits) +{ + int error; + + if (uset != NULL) { + error = kern_sigprocmask(td, SIG_SETMASK, uset, + &td->td_oldsigmask, 0); + if (error != 0) + return (error); + td->td_pflags |= TDP_OLDMASK; + /* + * Make sure that ast() is called on return to + * usermode and TDP_OLDMASK is cleared, restoring old + * sigmask. + */ + thread_lock(td); + td->td_flags |= TDF_ASTPENDING; + thread_unlock(td); + } + error = kern_select(td, nd, in, ou, ex, tvp, abi_nfdbits); + return (error); +} + #ifndef _SYS_SYSPROTO_H_ struct select_args { int nd; @@ -759,9 +811,7 @@ struct select_args { }; #endif int -select(td, uap) - register struct thread *td; - register struct select_args *uap; +select(struct thread *td, struct select_args *uap) { struct timeval tv, *tvp; int error; Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Tue Oct 27 10:47:58 2009 (r198507) +++ head/sys/kern/syscalls.master Tue Oct 27 10:55:34 2009 (r198508) @@ -919,5 +919,9 @@ 519 AUE_PDKILL UNIMPL pdkill 520 AUE_PDGETPID UNIMPL pdgetpid 521 AUE_PDWAIT UNIMPL pdwait +522 AUE_SELECT STD { int pselect(int nd, fd_set *in, \ + fd_set *ou, fd_set *ex, \ + const struct timespec *ts, \ + const sigset_t *sm); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Tue Oct 27 10:47:58 2009 (r198507) +++ head/sys/sys/syscallsubr.h Tue Oct 27 10:55:34 2009 (r198508) @@ -148,6 +148,8 @@ int kern_pathconf(struct thread *td, cha int name, u_long flags); int kern_pipe(struct thread *td, int fildes[2]); int kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset); +int kern_pselect(struct thread *td, int nd, fd_set *in, fd_set *ou, + fd_set *ex, struct timeval *tvp, sigset_t *uset, int abi_nfdbits); int kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data); int kern_pwritev(struct thread *td, int fd, struct uio *auio, off_t offset); From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 10:57:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96D921065670; Tue, 27 Oct 2009 10:57:53 +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 86BF78FC24; Tue, 27 Oct 2009 10:57:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RAvrZk029236; Tue, 27 Oct 2009 10:57:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RAvrfn029233; Tue, 27 Oct 2009 10:57:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910271057.n9RAvrfn029233@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Oct 2009 10:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198509 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 10:57:53 -0000 Author: kib Date: Tue Oct 27 10:57:53 2009 New Revision: 198509 URL: http://svn.freebsd.org/changeset/base/198509 Log: Commit libc files missed in r198508 Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/pselect.3 Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Tue Oct 27 10:55:34 2009 (r198508) +++ head/lib/libc/gen/Makefile.inc Tue Oct 27 10:57:53 2009 (r198509) @@ -21,7 +21,7 @@ SRCS+= __getosreldate.c __xuname.c \ initgroups.c isatty.c isinf.c isnan.c jrand48.c lcong48.c \ lockf.c lrand48.c mrand48.c nftw.c nice.c \ nlist.c nrand48.c opendir.c \ - pause.c pmadvise.c popen.c posix_spawn.c pselect.c \ + pause.c pmadvise.c popen.c posix_spawn.c \ psignal.c pw_scan.c pwcache.c \ raise.c readdir.c readpassphrase.c rewinddir.c \ scandir.c seed48.c seekdir.c sem.c semctl.c \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Tue Oct 27 10:55:34 2009 (r198508) +++ head/lib/libc/gen/Symbol.map Tue Oct 27 10:57:53 2009 (r198509) @@ -223,7 +223,6 @@ FBSD_1.0 { posix_madvise; popen; pclose; - pselect; psignal; raise; readdir; @@ -454,7 +453,6 @@ FBSDprivate_1.0 { __opendir2; __pause; _pause; - __pselect; __pw_scan; /* Used by (at least) libutil */ __raise; _raise; Modified: head/lib/libc/gen/pselect.3 ============================================================================== --- head/lib/libc/gen/pselect.3 Tue Oct 27 10:55:34 2009 (r198508) +++ head/lib/libc/gen/pselect.3 Tue Oct 27 10:57:53 2009 (r198509) @@ -88,11 +88,6 @@ for a more detailed discussion of the se for macros used to manipulate the .Vt "fd_set" data type. -.Sh IMPLEMENTATION NOTES -The -.Fn pselect -function is implemented in the C library as a wrapper around -.Fn select . .Sh RETURN VALUES The .Fn pselect From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 11:01:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00A501065676; Tue, 27 Oct 2009 11:01:16 +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 E48CB8FC1D; Tue, 27 Oct 2009 11:01:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RB1FYK029439; Tue, 27 Oct 2009 11:01:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RB1F1i029435; Tue, 27 Oct 2009 11:01:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910271101.n9RB1F1i029435@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Oct 2009 11:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198510 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 11:01:16 -0000 Author: kib Date: Tue Oct 27 11:01:15 2009 New Revision: 198510 URL: http://svn.freebsd.org/changeset/base/198510 Log: Regenerate Modified: head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Tue Oct 27 10:57:53 2009 (r198509) +++ head/sys/kern/init_sysent.c Tue Oct 27 11:01:15 2009 (r198510) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 197636 2009-09-30 08:46:01Z rwatson + * created from FreeBSD: head/sys/kern/syscalls.master 198508 2009-10-27 10:55:34Z kib */ #include "opt_compat.h" @@ -556,4 +556,5 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 519 = pdkill */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ + { AS(pselect_args), (sy_call_t *)pselect, AUE_SELECT, NULL, 0, 0, 0 }, /* 522 = pselect */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Tue Oct 27 10:57:53 2009 (r198509) +++ head/sys/kern/syscalls.c Tue Oct 27 11:01:15 2009 (r198510) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 197636 2009-09-30 08:46:01Z rwatson + * created from FreeBSD: head/sys/kern/syscalls.master 198508 2009-10-27 10:55:34Z kib */ const char *syscallnames[] = { @@ -529,4 +529,5 @@ const char *syscallnames[] = { "#519", /* 519 = pdkill */ "#520", /* 520 = pdgetpid */ "#521", /* 521 = pdwait */ + "pselect", /* 522 = pselect */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Tue Oct 27 10:57:53 2009 (r198509) +++ head/sys/kern/systrace_args.c Tue Oct 27 11:01:15 2009 (r198510) @@ -3072,6 +3072,18 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } + /* pselect */ + case 522: { + struct pselect_args *p = params; + iarg[0] = p->nd; /* int */ + uarg[1] = (intptr_t) p->in; /* fd_set * */ + uarg[2] = (intptr_t) p->ou; /* fd_set * */ + uarg[3] = (intptr_t) p->ex; /* fd_set * */ + uarg[4] = (intptr_t) p->ts; /* const struct timespec * */ + uarg[5] = (intptr_t) p->sm; /* const sigset_t * */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8154,6 +8166,31 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* pselect */ + case 522: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "fd_set *"; + break; + case 2: + p = "fd_set *"; + break; + case 3: + p = "fd_set *"; + break; + case 4: + p = "const struct timespec *"; + break; + case 5: + p = "const sigset_t *"; + break; + default: + break; + }; + break; default: break; }; From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 11:01:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8653F1065679; Tue, 27 Oct 2009 11:01:40 +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 75EA28FC17; Tue, 27 Oct 2009 11:01:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RB1eSV029483; Tue, 27 Oct 2009 11:01:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RB1eM1029479; Tue, 27 Oct 2009 11:01:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910271101.n9RB1eM1029479@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Oct 2009 11:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198511 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 11:01:40 -0000 Author: kib Date: Tue Oct 27 11:01:40 2009 New Revision: 198511 URL: http://svn.freebsd.org/changeset/base/198511 Log: Regenerate Modified: head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Tue Oct 27 11:01:15 2009 (r198510) +++ head/sys/sys/syscall.h Tue Oct 27 11:01:40 2009 (r198511) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 197636 2009-09-30 08:46:01Z rwatson + * created from FreeBSD: head/sys/kern/syscalls.master 198508 2009-10-27 10:55:34Z kib */ #define SYS_syscall 0 @@ -428,4 +428,5 @@ #define SYS_msgctl 511 #define SYS_shmctl 512 #define SYS_lpathconf 513 -#define SYS_MAXSYSCALL 522 +#define SYS_pselect 522 +#define SYS_MAXSYSCALL 523 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Tue Oct 27 11:01:15 2009 (r198510) +++ head/sys/sys/syscall.mk Tue Oct 27 11:01:40 2009 (r198511) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 197636 2009-09-30 08:46:01Z rwatson +# created from FreeBSD: head/sys/kern/syscalls.master 198508 2009-10-27 10:55:34Z kib MIASM = \ syscall.o \ exit.o \ @@ -376,4 +376,5 @@ MIASM = \ __semctl.o \ msgctl.o \ shmctl.o \ - lpathconf.o + lpathconf.o \ + pselect.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Tue Oct 27 11:01:15 2009 (r198510) +++ head/sys/sys/sysproto.h Tue Oct 27 11:01:40 2009 (r198511) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 197636 2009-09-30 08:46:01Z rwatson + * created from FreeBSD: head/sys/kern/syscalls.master 198508 2009-10-27 10:55:34Z kib */ #ifndef _SYS_SYSPROTO_H_ @@ -1641,6 +1641,14 @@ struct lpathconf_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)]; }; +struct pselect_args { + char nd_l_[PADL_(int)]; int nd; char nd_r_[PADR_(int)]; + char in_l_[PADL_(fd_set *)]; fd_set * in; char in_r_[PADR_(fd_set *)]; + char ou_l_[PADL_(fd_set *)]; fd_set * ou; char ou_r_[PADR_(fd_set *)]; + char ex_l_[PADL_(fd_set *)]; fd_set * ex; char ex_r_[PADR_(fd_set *)]; + char ts_l_[PADL_(const struct timespec *)]; const struct timespec * ts; char ts_r_[PADR_(const struct timespec *)]; + char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_exit(struct thread *, struct sys_exit_args *); int fork(struct thread *, struct fork_args *); @@ -1999,6 +2007,7 @@ int __semctl(struct thread *, struct __s int msgctl(struct thread *, struct msgctl_args *); int shmctl(struct thread *, struct shmctl_args *); int lpathconf(struct thread *, struct lpathconf_args *); +int pselect(struct thread *, struct pselect_args *); #ifdef COMPAT_43 @@ -2671,6 +2680,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_msgctl AUE_MSGCTL #define SYS_AUE_shmctl AUE_SHMCTL #define SYS_AUE_lpathconf AUE_LPATHCONF +#define SYS_AUE_pselect AUE_SELECT #undef PAD_ #undef PADL_ From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 11:02:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 291D6106568D; Tue, 27 Oct 2009 11:02:05 +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 189AD8FC27; Tue, 27 Oct 2009 11:02:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RB248n029532; Tue, 27 Oct 2009 11:02:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RB24WA029527; Tue, 27 Oct 2009 11:02:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910271102.n9RB24WA029527@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Oct 2009 11:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198512 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 11:02:05 -0000 Author: kib Date: Tue Oct 27 11:02:04 2009 New Revision: 198512 URL: http://svn.freebsd.org/changeset/base/198512 Log: Regenerate Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Tue Oct 27 11:01:40 2009 (r198511) +++ head/sys/compat/freebsd32/freebsd32_proto.h Tue Oct 27 11:02:04 2009 (r198512) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 197636 2009-09-30 08:46:01Z rwatson + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 198508 2009-10-27 10:55:34Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -453,6 +453,14 @@ struct freebsd32_shmctl_args { char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char buf_l_[PADL_(struct shmid_ds32 *)]; struct shmid_ds32 * buf; char buf_r_[PADR_(struct shmid_ds32 *)]; }; +struct freebsd32_pselect_args { + char nd_l_[PADL_(int)]; int nd; char nd_r_[PADR_(int)]; + char in_l_[PADL_(fd_set *)]; fd_set * in; char in_r_[PADR_(fd_set *)]; + char ou_l_[PADL_(fd_set *)]; fd_set * ou; char ou_r_[PADR_(fd_set *)]; + char ex_l_[PADL_(fd_set *)]; fd_set * ex; char ex_r_[PADR_(fd_set *)]; + char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * ts; char ts_r_[PADR_(const struct timespec32 *)]; + char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; +}; int freebsd32_wait4(struct thread *, struct freebsd32_wait4_args *); int freebsd32_recvmsg(struct thread *, struct freebsd32_recvmsg_args *); int freebsd32_sendmsg(struct thread *, struct freebsd32_sendmsg_args *); @@ -536,6 +544,7 @@ int freebsd32_jail_set(struct thread *, int freebsd32_semctl(struct thread *, struct freebsd32_semctl_args *); int freebsd32_msgctl(struct thread *, struct freebsd32_msgctl_args *); int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *); +int freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *); #ifdef COMPAT_43 @@ -814,6 +823,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_semctl AUE_SEMCTL #define FREEBSD32_SYS_AUE_freebsd32_msgctl AUE_MSGCTL #define FREEBSD32_SYS_AUE_freebsd32_shmctl AUE_SHMCTL +#define FREEBSD32_SYS_AUE_freebsd32_pselect AUE_SELECT #undef PAD_ #undef PADL_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Tue Oct 27 11:01:40 2009 (r198511) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Tue Oct 27 11:02:04 2009 (r198512) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 197636 2009-09-30 08:46:01Z rwatson + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 198508 2009-10-27 10:55:34Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -382,4 +382,5 @@ #define FREEBSD32_SYS_freebsd32_msgctl 511 #define FREEBSD32_SYS_freebsd32_shmctl 512 #define FREEBSD32_SYS_lpathconf 513 -#define FREEBSD32_SYS_MAXSYSCALL 522 +#define FREEBSD32_SYS_freebsd32_pselect 522 +#define FREEBSD32_SYS_MAXSYSCALL 523 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Tue Oct 27 11:01:40 2009 (r198511) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Tue Oct 27 11:02:04 2009 (r198512) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 197636 2009-09-30 08:46:01Z rwatson + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 198508 2009-10-27 10:55:34Z kib */ const char *freebsd32_syscallnames[] = { @@ -529,4 +529,5 @@ const char *freebsd32_syscallnames[] = { "#519", /* 519 = pdkill */ "#520", /* 520 = pdgetpid */ "#521", /* 521 = pdwait */ + "freebsd32_pselect", /* 522 = freebsd32_pselect */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Tue Oct 27 11:01:40 2009 (r198511) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Tue Oct 27 11:02:04 2009 (r198512) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 197636 2009-09-30 08:46:01Z rwatson + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 198508 2009-10-27 10:55:34Z kib */ #include "opt_compat.h" @@ -566,4 +566,5 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 519 = pdkill */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ + { AS(freebsd32_pselect_args), (sy_call_t *)freebsd32_pselect, AUE_SELECT, NULL, 0, 0, 0 }, /* 522 = freebsd32_pselect */ }; From owner-svn-src-head@FreeBSD.ORG Tue Oct 27 11:13:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A358F1065676; Tue, 27 Oct 2009 11:13:51 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91E348FC08; Tue, 27 Oct 2009 11:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RBDpvs029900; Tue, 27 Oct 2009 11:13:51 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RBDpSt029898; Tue, 27 Oct 2009 11:13:51 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200910271113.n9RBDpSt029898@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 27 Oct 2009 11:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198515 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2009 11:13:51 -0000 Author: edwin Date: Tue Oct 27 11:13:51 2009 New Revision: 198515 URL: http://svn.freebsd.org/changeset/base/198515 Log: MFV of tzdata2009p Merge of r198513 - Argentina does not go to DST this year. Modified: head/share/zoneinfo/ (props changed) head/share/zoneinfo/southamerica Modified: head/share/zoneinfo/southamerica ============================================================================== --- head/share/zoneinfo/southamerica Tue Oct 27 11:09:03 2009 (r198514) +++ head/share/zoneinfo/southamerica Tue Oct 27 11:13:51 2009 (r198515) @@ -1,5 +1,5 @@ #
-# @(#)southamerica	8.37
+# @(#)southamerica	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -215,9 +215,23 @@ Rule	Arg	2000	only	-	Mar	3	0:00	0	-
 # http://www.jujuy.gov.ar/index2/partes_prensa/18_10_08/235-181008.doc
 # 
 
+# From fullinet (2009-10-18):
+# As announced in
+# 
+# http://www.argentina.gob.ar/argentina/portal/paginas.dhtml?pagina=356
+# 
+# (an official .gob.ar) under title: "Sin Cambio de Hora" (english: "No hour change")
+#
+# "Por el momento, el Gobierno Nacional resolvio no modificar la hora
+# oficial, decision que estaba en estudio para su implementacion el
+# domingo 18 de octubre. Desde el Ministerio de Planificacion se anuncio
+# que la Argentina hoy, en estas condiciones meteorologicas, no necesita
+# la modificacion del huso horario, ya que 2009 nos encuentra con
+# crecimiento en la produccion y distribucion energetica."
+
 Rule	Arg	2007	only	-	Dec	30	0:00	1:00	S
-Rule	Arg	2008	max	-	Mar	Sun>=15	0:00	0	-
-Rule	Arg	2008	max	-	Oct	Sun>=15	0:00	1:00	S
+Rule	Arg	2008	2009	-	Mar	Sun>=15	0:00	0	-
+Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:00	S
  
 # From Mariano Absatz (2004-05-21):
 # Today it was officially published that the Province of Mendoza is changing
@@ -389,44 +403,39 @@ Rule	Arg	2008	max	-	Oct	Sun>=15	0:00	1:0
 # during 2009, this timezone change will run from 00:00 the third Sunday
 # in March until 24:00 of the second Saturday in October.
 
-# From Arthur David Olson (2009-03-16):
-# The unofficial claim at
-# 
-# http://www.timeanddate.com/news/time/san-luis-new-time-zone.html
-# 
-# is that "The province will most likely follow the next daylight saving schedule,
-# which is planned for the second Sunday in October."
-
-# From Alexander Krivenyshev (2009-09-19):
-# Some  Argentinian Provinces (Buenos Aires, Entre Ríos) are opposing to the
-# Daylight Saving Time for the 2009-2010 season.
-#
-# (Spanish)
-# "El cambio de huso horario en Entre Ríos deberá ser aprobado por la
-# Legislatura":
-# 
-# http://www.analisisdigital.com.ar/noticias.php?ed=1&di=0&no=110168
-# 
-# English translation - "The time zone change in Entre Rios must be approved by
-# the Legislature."
-#
-# (Spanish)
-# "Mar del Plata no quiere cambiar la hora."
-# 
-# http://www.mensajeroweb.com.ar/index.php?x=nota/33861/1/mar-del-plata-no-quiere-cambiar-la-hora
-# 
-# English translation - "Mar del Plata is not to change the time"
-#
-# or
-# (some English translation)
-# 
-# http://www.worldtimezone.com/dst_news/dst_news_argentina07.html
-# 
-
-# From Arthur David Olson (2009-09-22):
-# "Mar del Plata no quiere cambiar la hora" translates to
-# "Mar del Plata doesn't want to change the time"
-# (less definitive than "is not to").
+# From Mariano Absatz (2009-10-16):
+# ...the Province of San Luis is a case in itself.
+#
+# The Law at
+# 
+# is ambiguous because establishes a calendar from the 2nd Sunday in
+# October at 0:00 thru the 2nd Saturday in March at 24:00 and the
+# complement of that starting on the 2nd Sunday of March at 0:00 and
+# ending on the 2nd Saturday of March at 24:00.
+#
+# This clearly breaks every time the 1st of March or October is a Sunday.
+#
+# IMHO, the "spirit of the Law" is to make the changes at 0:00 on the 2nd
+# Sunday of October and March.
+#
+# The problem is that the changes in the rest of the Provinces that did
+# change in 2007/2008, were made according to the Federal Law and Decrees
+# that did so on the 3rd Sunday of October and March.
+#
+# In fact, San Luis actually switched from UTC-4 to UTC-3 last Sunday
+# (October 11th) at 0:00.
+#
+# So I guess a new set of rules, besides "Arg", must be made and the last
+# America/Argentina/San_Luis entries should change to use these...
+#
+# I'm enclosing a patch that does what I say... regretfully, the San Luis
+# timezone must be called "WART/WARST" even when most of the time (like,
+# right now) WARST == ART... that is, since last Sunday, all the country
+# is using UTC-3, but in my patch, San Luis calls it "WARST" and the rest
+# of the country calls it "ART".
+# ...
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
@@ -560,6 +569,10 @@ Zone America/Argentina/Mendoza -4:35:16 
 			-3:00	-	ART
 #
 # San Luis (SL)
+
+Rule	SanLuis	2008	max	-	Mar	Sun>=8	0:00	0	-
+Rule	SanLuis	2007	max	-	Oct	Sun>=8	0:00	1:00	S
+
 Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
 			-4:00	-	ART	1930 Dec
@@ -574,8 +587,7 @@ Zone America/Argentina/San_Luis -4:25:24
 			-3:00	-	ART	2004 May 31
 			-4:00	-	WART	2004 Jul 25
 			-3:00	Arg	AR%sT	2008 Jan 21
-			-3:00	-	ART	2009 Mar 15
-			-4:00	Arg	WAR%sT
+			-4:00	SanLuis	WAR%sT
 #
 # Santa Cruz (SC)
 Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 14:37:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 74335106566B;
	Tue, 27 Oct 2009 14:37:25 +0000 (UTC)
	(envelope-from emaste@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 635288FC13;
	Tue, 27 Oct 2009 14:37:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9REbPJp033870;
	Tue, 27 Oct 2009 14:37:25 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9REbPhW033868;
	Tue, 27 Oct 2009 14:37:25 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <200910271437.n9REbPhW033868@svn.freebsd.org>
From: Ed Maste 
Date: Tue, 27 Oct 2009 14:37:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198518 - head/share/man/man9
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 14:37:25 -0000

Author: emaste
Date: Tue Oct 27 14:37:25 2009
New Revision: 198518
URL: http://svn.freebsd.org/changeset/base/198518

Log:
  Add link for callout_schedule(9).

Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Tue Oct 27 14:36:37 2009	(r198517)
+++ head/share/man/man9/Makefile	Tue Oct 27 14:37:25 2009	(r198518)
@@ -1222,6 +1222,7 @@ MLINKS+=timeout.9 callout.9 \
 	timeout.9 callout_init_rw.9 \
 	timeout.9 callout_pending.9 \
 	timeout.9 callout_reset.9 \
+	timeout.9 callout_schedule.9 \
 	timeout.9 callout_stop.9 \
 	timeout.9 untimeout.9
 MLINKS+=ucred.9 crcopy.9 \

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 17:12:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CDC6C106566C;
	Tue, 27 Oct 2009 17:12:59 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BCF448FC17;
	Tue, 27 Oct 2009 17:12:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RHCxcr037013;
	Tue, 27 Oct 2009 17:12:59 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RHCxgV037011;
	Tue, 27 Oct 2009 17:12:59 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <200910271712.n9RHCxgV037011@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Tue, 27 Oct 2009 17:12:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198519 - head/sys/dev/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 17:12:59 -0000

Author: jh
Date: Tue Oct 27 17:12:59 2009
New Revision: 198519
URL: http://svn.freebsd.org/changeset/base/198519

Log:
  Don't ignore the return value of g_modevent() in acd_modevent().
  
  Approved by:	trasz (mentor)

Modified:
  head/sys/dev/ata/atapi-cd.c

Modified: head/sys/dev/ata/atapi-cd.c
==============================================================================
--- head/sys/dev/ata/atapi-cd.c	Tue Oct 27 14:37:25 2009	(r198518)
+++ head/sys/dev/ata/atapi-cd.c	Tue Oct 27 17:12:59 2009	(r198519)
@@ -1905,8 +1905,7 @@ static devclass_t acd_devclass;
 static int
 acd_modevent(module_t mod, int what, void *arg)  
 {
-    g_modevent(0, what, &acd_class);
-    return 0;
+    return g_modevent(0, what, &acd_class);
 }
  
 DRIVER_MODULE(acd, ata, acd_driver, acd_devclass, acd_modevent, NULL);

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 17:14:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0E6A4106568B;
	Tue, 27 Oct 2009 17:14:23 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F1E658FC1B;
	Tue, 27 Oct 2009 17:14:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RHEM1u037071;
	Tue, 27 Oct 2009 17:14:22 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RHEMfM037069;
	Tue, 27 Oct 2009 17:14:22 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <200910271714.n9RHEMfM037069@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Tue, 27 Oct 2009 17:14:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198520 - head/sys/dev/fdc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 17:14:23 -0000

Author: jh
Date: Tue Oct 27 17:14:22 2009
New Revision: 198520
URL: http://svn.freebsd.org/changeset/base/198520

Log:
  Don't ignore the return value of g_modevent() in fdc_modevent().
  
  Approved by:	trasz (mentor)

Modified:
  head/sys/dev/fdc/fdc.c

Modified: head/sys/dev/fdc/fdc.c
==============================================================================
--- head/sys/dev/fdc/fdc.c	Tue Oct 27 17:12:59 2009	(r198519)
+++ head/sys/dev/fdc/fdc.c	Tue Oct 27 17:14:22 2009	(r198520)
@@ -2068,8 +2068,7 @@ static int
 fdc_modevent(module_t mod, int type, void *data)
 {
 
-	g_modevent(NULL, type, &g_fd_class);
-	return (0);
+	return (g_modevent(NULL, type, &g_fd_class));
 }
 
 DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, fdc_modevent, 0);

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 17:22:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0187D106568B;
	Tue, 27 Oct 2009 17:22:04 +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 E406B8FC08;
	Tue, 27 Oct 2009 17:22:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RHM3dP037257;
	Tue, 27 Oct 2009 17:22:03 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RHM33c037255;
	Tue, 27 Oct 2009 17:22:03 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910271722.n9RHM33c037255@svn.freebsd.org>
From: Christian Brueffer 
Date: Tue, 27 Oct 2009 17:22:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198521 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 17:22:04 -0000

Author: brueffer
Date: Tue Oct 27 17:22:03 2009
New Revision: 198521
URL: http://svn.freebsd.org/changeset/base/198521

Log:
  Fix typos and mdoc style.

Modified:
  head/share/man/man4/iwn.4

Modified: head/share/man/man4/iwn.4
==============================================================================
--- head/share/man/man4/iwn.4	Tue Oct 27 17:14:22 2009	(r198520)
+++ head/share/man/man4/iwn.4	Tue Oct 27 17:22:03 2009	(r198521)
@@ -42,7 +42,8 @@ kernel configuration file:
 .Cd "device firmware"
 .Ed
 .Pp
-You also need to select a firmware for your device. Chose one from:
+You also need to select a firmware for your device.
+Choose one from:
 .Bd -ragged -offset indent
 .Cd "device iwn4965fw"
 .Cd "device iwn5000fw"
@@ -57,7 +58,7 @@ Or you can use
 to include them all.
 .Pp
 Alternatively, to load the driver as a
-module at boot time, place the following line in
+module at boot time, place the following lines in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 if_iwn_load="YES"

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 17:54:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E3FA1106566C;
	Tue, 27 Oct 2009 17:54:35 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id B7C598FC0C;
	Tue, 27 Oct 2009 17:54:35 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 3FA2346B03;
	Tue, 27 Oct 2009 13:54:35 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 843638A01D;
	Tue, 27 Oct 2009 13:54:34 -0400 (EDT)
From: John Baldwin 
To: Konstantin Belousov 
Date: Tue, 27 Oct 2009 10:23:52 -0400
User-Agent: KMail/1.9.7
References: <200910271057.n9RAvrfn029233@svn.freebsd.org>
In-Reply-To: <200910271057.n9RAvrfn029233@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200910271023.52882.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Tue, 27 Oct 2009 13:54:34 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,
	DATE_IN_PAST_03_06,RDNS_NONE autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198509 - head/lib/libc/gen
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 17:54:36 -0000

On Tuesday 27 October 2009 6:57:53 am Konstantin Belousov wrote:
> Author: kib
> Date: Tue Oct 27 10:57:53 2009
> New Revision: 198509
> URL: http://svn.freebsd.org/changeset/base/198509
> 
> Log:
>   Commit libc files missed in r198508
> 
> Modified:
>   head/lib/libc/gen/Makefile.inc
>   head/lib/libc/gen/Symbol.map
>   head/lib/libc/gen/pselect.3

Hmm, shouldn't gen/pselect.3 get moved to sys/pselect.2 now?

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 18:17:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3D3BF106566C;
	Tue, 27 Oct 2009 18:17:08 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2C6448FC08;
	Tue, 27 Oct 2009 18:17:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RIH7dL038430;
	Tue, 27 Oct 2009 18:17:07 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RIH7x9038428;
	Tue, 27 Oct 2009 18:17:07 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <200910271817.n9RIH7x9038428@svn.freebsd.org>
From: Michael Tuexen 
Date: Tue, 27 Oct 2009 18:17:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198522 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 18:17:08 -0000

Author: tuexen
Date: Tue Oct 27 18:17:07 2009
New Revision: 198522
URL: http://svn.freebsd.org/changeset/base/198522

Log:
  Bugfix: Use formula from section 7.2.3 of RFC 4960. Reported by Martin Becke.
  
  Approved by: rrs (mentor)
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_cc_functions.c

Modified: head/sys/netinet/sctp_cc_functions.c
==============================================================================
--- head/sys/netinet/sctp_cc_functions.c	Tue Oct 27 17:22:03 2009	(r198521)
+++ head/sys/netinet/sctp_cc_functions.c	Tue Oct 27 18:17:07 2009	(r198522)
@@ -348,7 +348,7 @@ sctp_cwnd_update_after_timeout(struct sc
 {
 	int old_cwnd = net->cwnd;
 
-	net->ssthresh = max(net->cwnd / 2, 2 * net->mtu);
+	net->ssthresh = max(net->cwnd / 2, 4 * net->mtu);
 	net->cwnd = net->mtu;
 	net->partial_bytes_acked = 0;
 

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 19:13:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7E56A1065679;
	Tue, 27 Oct 2009 19:13:00 +0000 (UTC)
	(envelope-from marius@alchemy.franken.de)
Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214])
	by mx1.freebsd.org (Postfix) with ESMTP id 089BB8FC08;
	Tue, 27 Oct 2009 19:12:59 +0000 (UTC)
Received: from alchemy.franken.de (localhost [127.0.0.1])
	by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id
	n9RJCwfC010588; Tue, 27 Oct 2009 20:12:58 +0100 (CET)
	(envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
	by alchemy.franken.de (8.14.3/8.14.3/Submit) id n9RJCwsp010587;
	Tue, 27 Oct 2009 20:12:58 +0100 (CET) (envelope-from marius)
Date: Tue, 27 Oct 2009 20:12:58 +0100
From: Marius Strobl 
To: Marcel Moolenaar 
Message-ID: <20091027191258.GU27159@alchemy.franken.de>
References: <200910211838.n9LIc2wp007206@svn.freebsd.org>
	<20091025202541.GC94979@alchemy.franken.de>
	<36313C38-9B60-4BF3-885C-5BAAA915DCFE@mac.com>
	<20091026201116.GS27159@alchemy.franken.de>
	<63FB238C-D66F-486B-AB5B-DA7C2423A78B@mac.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <63FB238C-D66F-486B-AB5B-DA7C2423A78B@mac.com>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv
	i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim
	powerpc/booke powerpc/include powerpc/powerpc sparc64/sparc64
	sun4v/sun4v vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 19:13:00 -0000

On Mon, Oct 26, 2009 at 01:53:47PM -0700, Marcel Moolenaar wrote:
> 
> On Oct 26, 2009, at 1:11 PM, Marius Strobl wrote:
> 
> >The cheetah-class CPUs, i.e. USIII and later, take care of
> >I$ coherency themselves, unlike the spitfire ones (see also
> >cheetah_icache_page_inval() vs. spitfire_icache_page_inval()).
> 
> This explains why I didn't see any I-cache coherency issues :-)
> 
> >I currently can't think of any existing code which would
> >ensure I$ consistency after the writes have been performed,
> >not even as a side-effect. The proper solution probalby is to
> >make pmap_sync_icache() a wrapper around icache_page_inval().
> 
> I concur. Do we have any spitfire-based sparc64 boxes in the
> cluster or do you have one?

We don't have any sparc64 machine in the cluster since panther
died although there we're some nice replacements offered for
donation but unfortunately it seems getting a machine into the
cluster is next to impossible.
Do you want something particularly tested on a spitfire-based
machine?

Marius


From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 19:37:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 45D50106566B;
	Tue, 27 Oct 2009 19:37:38 +0000 (UTC)
	(envelope-from emaste@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1BEA08FC27;
	Tue, 27 Oct 2009 19:37:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9RJbc6v040163;
	Tue, 27 Oct 2009 19:37:38 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9RJbbC5040160;
	Tue, 27 Oct 2009 19:37:37 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <200910271937.n9RJbbC5040160@svn.freebsd.org>
From: Ed Maste 
Date: Tue, 27 Oct 2009 19:37:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198525 - head/sys/dev/aac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 19:37:38 -0000

Author: emaste
Date: Tue Oct 27 19:37:37 2009
New Revision: 198525
URL: http://svn.freebsd.org/changeset/base/198525

Log:
  Whitespace fixup: 8 spaces -> tab

Modified:
  head/sys/dev/aac/aac.c
  head/sys/dev/aac/aac_cam.c

Modified: head/sys/dev/aac/aac.c
==============================================================================
--- head/sys/dev/aac/aac.c	Tue Oct 27 18:30:56 2009	(r198524)
+++ head/sys/dev/aac/aac.c	Tue Oct 27 19:37:37 2009	(r198525)
@@ -229,7 +229,7 @@ static int		aac_query_disk(struct aac_so
 static int		aac_get_pci_info(struct aac_softc *sc, caddr_t uptr);
 static int		aac_supported_features(struct aac_softc *sc, caddr_t uptr);
 static void		aac_ioctl_event(struct aac_softc *sc,
-				        struct aac_event *event, void *arg);
+					struct aac_event *event, void *arg);
 static struct aac_mntinforesp *
 	aac_get_container_info(struct aac_softc *sc, struct aac_fib *fib, int cid);
 
@@ -3618,7 +3618,7 @@ aac_query_disk(struct aac_softc *sc, cad
 		query_disk.Lun = 0;
 		query_disk.UnMapped = 0;
 		sprintf(&query_disk.diskDeviceName[0], "%s%d",
-		        disk->ad_disk->d_name, disk->ad_disk->d_unit);
+			disk->ad_disk->d_name, disk->ad_disk->d_unit);
 	}
 	mtx_unlock(&sc->aac_container_lock);
 

Modified: head/sys/dev/aac/aac_cam.c
==============================================================================
--- head/sys/dev/aac/aac_cam.c	Tue Oct 27 18:30:56 2009	(r198524)
+++ head/sys/dev/aac/aac_cam.c	Tue Oct 27 19:37:37 2009	(r198525)
@@ -272,10 +272,10 @@ aac_cam_action(struct cam_sim *sim, unio
 		strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
 		strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
 		cpi->unit_number = cam_sim_unit(sim);
-                cpi->transport = XPORT_SPI;
-                cpi->transport_version = 2;
-                cpi->protocol = PROTO_SCSI;
-                cpi->protocol_version = SCSI_REV_2;
+		cpi->transport = XPORT_SPI;
+		cpi->transport_version = 2;
+		cpi->protocol = PROTO_SCSI;
+		cpi->protocol_version = SCSI_REV_2;
 		ccb->ccb_h.status = CAM_REQ_CMP;
 		xpt_done(ccb);
 		return;

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 19:56:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 57747106568D;
	Tue, 27 Oct 2009 19:56:22 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout024.mac.com (asmtpout024.mac.com [17.148.16.99])
	by mx1.freebsd.org (Postfix) with ESMTP id 3CE708FC16;
	Tue, 27 Oct 2009 19:56:22 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=us-ascii; format=flowed
Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36])
	by asmtp024.mac.com
	(Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008;
	32bit)) with ESMTPSA id <0KS600E1GVDI4X20@asmtp024.mac.com>; Tue,
	27 Oct 2009 12:56:07 -0700 (PDT)
From: Marcel Moolenaar 
In-reply-to: <20091027191258.GU27159@alchemy.franken.de>
Date: Tue, 27 Oct 2009 12:56:06 -0700
Message-id: <767E6364-0F58-447F-A6EA-9E08A8065C8F@mac.com>
References: <200910211838.n9LIc2wp007206@svn.freebsd.org>
	<20091025202541.GC94979@alchemy.franken.de>
	<36313C38-9B60-4BF3-885C-5BAAA915DCFE@mac.com>
	<20091026201116.GS27159@alchemy.franken.de>
	<63FB238C-D66F-486B-AB5B-DA7C2423A78B@mac.com>
	<20091027191258.GU27159@alchemy.franken.de>
To: Marius Strobl 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv
 i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim powerpc/booke
 powerpc/include powerpc/powerpc sparc64/sparc64 sun4v/sun4v vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 19:56:22 -0000


On Oct 27, 2009, at 12:12 PM, Marius Strobl wrote:

>> I concur. Do we have any spitfire-based sparc64 boxes in the
>> cluster or do you have one?
>

> Do you want something particularly tested on a spitfire-based
> machine?

Any I-cache related change, really. My Netra is not going to
tell me anything. I'm fine leaving it up to spitfire-based
sparc64 owners to fill in the gaps, but I generally prefer to
be as complete as possible when making infrastructure changes.

FYI,

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 20:55:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8EC13106566B;
	Tue, 27 Oct 2009 20:55:03 +0000 (UTC) (envelope-from simon@nitro.dk)
Received: from mx.nitro.dk (unknown [77.75.165.90])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A72C8FC13;
	Tue, 27 Oct 2009 20:55:03 +0000 (UTC)
Received: from arthur.nitro.dk (arthur.bofh [192.168.2.3])
	by mx.nitro.dk (Postfix) with ESMTP id 933E22D4866;
	Tue, 27 Oct 2009 20:55:02 +0000 (UTC)
Received: by arthur.nitro.dk (Postfix, from userid 1000)
	id 72C6D5C0A; Tue, 27 Oct 2009 21:55:02 +0100 (CET)
Date: Tue, 27 Oct 2009 21:55:02 +0100
From: "Simon L. Nielsen" 
To: Marius Strobl 
Message-ID: <20091027205501.GA1245@arthur.nitro.dk>
References: <200910211838.n9LIc2wp007206@svn.freebsd.org>
	<20091025202541.GC94979@alchemy.franken.de>
	<36313C38-9B60-4BF3-885C-5BAAA915DCFE@mac.com>
	<20091026201116.GS27159@alchemy.franken.de>
	<63FB238C-D66F-486B-AB5B-DA7C2423A78B@mac.com>
	<20091027191258.GU27159@alchemy.franken.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20091027191258.GU27159@alchemy.franken.de>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Marcel Moolenaar , src-committers@freebsd.org
Subject: Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv
 i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim powerpc/booke
 powerpc/include powerpc/powerpc sparc64/sparc64 sun4v/sun4v vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 20:55:03 -0000

On 2009.10.27 20:12:58 +0100, Marius Strobl wrote:

> We don't have any sparc64 machine in the cluster since panther
> died although there we're some nice replacements offered for
> donation but unfortunately it seems getting a machine into the
> cluster is next to impossible.

We have some sparc64 systems at ISC which are currently use for
package building, though they seem to be all Ultra Sparc IIi (at least
from the docs I could find now).

-- 
Simon L. Nielsen

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 21:05:11 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 987201065676;
	Tue, 27 Oct 2009 21:05:11 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (unknown [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 4D9BA8FC0A;
	Tue, 27 Oct 2009 21:05:11 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n9RKxAs2083503;
	Tue, 27 Oct 2009 14:59:10 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Tue, 27 Oct 2009 14:59:23 -0600 (MDT)
Message-Id: <20091027.145923.1661903621.imp@bsdimp.com>
To: rwatson@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: 
References: <200910242028.n9OKSg2u010197@svn.freebsd.org>
	
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r198451 - head/sys/ia64/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 21:05:11 -0000

In message: 
            Robert Watson  writes:
: 
: On Sat, 24 Oct 2009, Marcel Moolenaar wrote:
: 
: > Log:
: >  A 32KB kernel stack is not quite enough. The new USB stack is a bit
: >  more stack hungry as compared to the old one that my RX2660 gets
: >  a machine check and spontaneously reboots at the time the USB DVD
: >  drive is found and attached to CAM as a mass storage device. This
: >  doesn't happen always, but definitely varies per kernel build.
: >  Likewise when using a 128-byte printf buffer. The additional 128
: >  bytes that printf needs seems to be enough to have the memory stack
: >  and register stack collide and causing a machine check.
: 
: I recently noticed, somewhat to my surprise, that BPF drops a 512-byte buffer 
: on the stack while running filters...

Would another pass of huge stack function scrubbing be useful?

Warner

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 21:11:33 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 37EAF1065692;
	Tue, 27 Oct 2009 21:11:33 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (unknown [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id D2A438FC27;
	Tue, 27 Oct 2009 21:11:32 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n9RL76XN083549;
	Tue, 27 Oct 2009 15:07:06 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Tue, 27 Oct 2009 15:07:19 -0600 (MDT)
Message-Id: <20091027.150719.-1219478921.imp@bsdimp.com>
To: mav@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: <200910261123.n9QBNfJY087028@svn.freebsd.org>
References: <200910261123.n9QBNfJY087028@svn.freebsd.org>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r198487 - head/sys/dev/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 21:11:33 -0000

In message: <200910261123.n9QBNfJY087028@svn.freebsd.org>
            Alexander Motin  writes:
: Author: mav
: Date: Mon Oct 26 11:23:41 2009
: New Revision: 198487
: URL: http://svn.freebsd.org/changeset/base/198487
: 
: Log:
:   Round timeout up when converting CAM milliseconds to ATA seconds.

This implements ceil(timeout) rather than round(timeout).  Is that
intended?

Warner

: -	request->timeout = ccb_h->timeout / 1000; /* XXX lost granularity */
: +	request->timeout = (ccb_h->timeout + 999) / 1000;
...
: -		request->timeout = csio->ccb_h.timeout / 1000;
: +		request->timeout = (csio->ccb_h.timeout + 999) / 1000;

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 21:17:51 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9F7631065670;
	Tue, 27 Oct 2009 21:17:51 +0000 (UTC)
	(envelope-from marius@alchemy.franken.de)
Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E1668FC14;
	Tue, 27 Oct 2009 21:17:50 +0000 (UTC)
Received: from alchemy.franken.de (localhost [127.0.0.1])
	by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id
	n9RLHncv021222; Tue, 27 Oct 2009 22:17:49 +0100 (CET)
	(envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
	by alchemy.franken.de (8.14.3/8.14.3/Submit) id n9RLHnxa021221;
	Tue, 27 Oct 2009 22:17:49 +0100 (CET) (envelope-from marius)
Date: Tue, 27 Oct 2009 22:17:49 +0100
From: Marius Strobl 
To: "Simon L. Nielsen" 
Message-ID: <20091027211749.GV27159@alchemy.franken.de>
References: <200910211838.n9LIc2wp007206@svn.freebsd.org>
	<20091025202541.GC94979@alchemy.franken.de>
	<36313C38-9B60-4BF3-885C-5BAAA915DCFE@mac.com>
	<20091026201116.GS27159@alchemy.franken.de>
	<63FB238C-D66F-486B-AB5B-DA7C2423A78B@mac.com>
	<20091027191258.GU27159@alchemy.franken.de>
	<20091027205501.GA1245@arthur.nitro.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20091027205501.GA1245@arthur.nitro.dk>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	Marcel Moolenaar , src-committers@FreeBSD.org
Subject: Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv
	i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim
	powerpc/booke powerpc/include powerpc/powerpc sparc64/sparc64
	sun4v/sun4v vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 21:17:51 -0000

On Tue, Oct 27, 2009 at 09:55:02PM +0100, Simon L. Nielsen wrote:
> On 2009.10.27 20:12:58 +0100, Marius Strobl wrote:
> 
> > We don't have any sparc64 machine in the cluster since panther
> > died although there we're some nice replacements offered for
> > donation but unfortunately it seems getting a machine into the
> > cluster is next to impossible.
> 
> We have some sparc64 systems at ISC which are currently use for
> package building, though they seem to be all Ultra Sparc IIi (at least
> from the docs I could find now).

I of course meant the lack of a sparc64 machine in the cluster
at Yahoo! with dumpster mounted and available to all developers.

Marius


From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 21:28:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F0A5106566B;
	Tue, 27 Oct 2009 21:28:55 +0000 (UTC)
	(envelope-from mavbsd@gmail.com)
Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159])
	by mx1.freebsd.org (Postfix) with ESMTP id C27A38FC0A;
	Tue, 27 Oct 2009 21:28:54 +0000 (UTC)
Received: by fg-out-1718.google.com with SMTP id d23so114175fga.13
	for ; Tue, 27 Oct 2009 14:28:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:message-id:date:from
	:user-agent:mime-version:to:cc:subject:references:in-reply-to
	:x-enigmail-version:content-type:content-transfer-encoding;
	bh=2yCJzr4T8BIybonudztHoIUWhygWgmGfmLThgfrnnWU=;
	b=vAu8qRHRySdJQcKD10m9zhmokckzKBBin69sbEVfP1R+fuV5x7omAsprq3AvX9dJRO
	UuIPN6j4dLLu3cVB1TmbiNzkCUkKSuK/cTJZc6SQKPJW1bZyod++UJQECMT3HRoWwK92
	eke0/ALfzqn1wTT7IvKjO8JvwhHJuSHaXD+RI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:x-enigmail-version:content-type
	:content-transfer-encoding;
	b=ts9oAiu4TOeZCyCq0QZBIYQ0xnN3k4UNv+l901WfVmNNVgbwOziCnyDVbcjsm7X5u7
	f8NWA3PmS+s8ZRLDX3PRQY3BXrSO4cLtZXVanWl4D6cFYu65f3XiJffk5BFI4FdmdFs7
	+0d9g5vFlJKigqBhGvg/TrwQCLPBk2qQZpYyw=
Received: by 10.102.197.14 with SMTP id u14mr6917388muf.39.1256678933583;
	Tue, 27 Oct 2009 14:28:53 -0700 (PDT)
Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226])
	by mx.google.com with ESMTPS id 23sm1679194mum.14.2009.10.27.14.28.52
	(version=SSLv3 cipher=RC4-MD5); Tue, 27 Oct 2009 14:28:52 -0700 (PDT)
Sender: Alexander Motin 
Message-ID: <4AE76611.4030104@FreeBSD.org>
Date: Tue, 27 Oct 2009 23:28:49 +0200
From: Alexander Motin 
User-Agent: Thunderbird 2.0.0.23 (X11/20090901)
MIME-Version: 1.0
To: "M. Warner Losh" 
References: <200910261123.n9QBNfJY087028@svn.freebsd.org>
	<20091027.150719.-1219478921.imp@bsdimp.com>
In-Reply-To: <20091027.150719.-1219478921.imp@bsdimp.com>
X-Enigmail-Version: 0.96.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r198487 - head/sys/dev/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 21:28:55 -0000

M. Warner Losh wrote:
> In message: <200910261123.n9QBNfJY087028@svn.freebsd.org>
>             Alexander Motin  writes:
> : Author: mav
> : Date: Mon Oct 26 11:23:41 2009
> : New Revision: 198487
> : URL: http://svn.freebsd.org/changeset/base/198487
> : 
> : Log:
> :   Round timeout up when converting CAM milliseconds to ATA seconds.
> 
> This implements ceil(timeout) rather than round(timeout).  Is that
> intended?

Yes. It is better to turn 400ms to 1s rather then 0. Usually timeouts
aren't so short to make it important, but I have seen such case once, so
it is possible to predict another.

-- 
Alexander Motin

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 21:47:31 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6D5D0106566B;
	Tue, 27 Oct 2009 21:47:31 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (unknown [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A82F8FC0C;
	Tue, 27 Oct 2009 21:47:30 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n9RLg0hq083780;
	Tue, 27 Oct 2009 15:42:00 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Tue, 27 Oct 2009 15:42:13 -0600 (MDT)
Message-Id: <20091027.154213.1640491474.imp@bsdimp.com>
To: mav@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: <4AE76611.4030104@FreeBSD.org>
References: <200910261123.n9QBNfJY087028@svn.freebsd.org>
	<20091027.150719.-1219478921.imp@bsdimp.com>
	<4AE76611.4030104@FreeBSD.org>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r198487 - head/sys/dev/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 21:47:31 -0000

In message: <4AE76611.4030104@FreeBSD.org>
            Alexander Motin  writes:
: M. Warner Losh wrote:
: > In message: <200910261123.n9QBNfJY087028@svn.freebsd.org>
: >             Alexander Motin  writes:
: > : Author: mav
: > : Date: Mon Oct 26 11:23:41 2009
: > : New Revision: 198487
: > : URL: http://svn.freebsd.org/changeset/base/198487
: > : 
: > : Log:
: > :   Round timeout up when converting CAM milliseconds to ATA seconds.
: > 
: > This implements ceil(timeout) rather than round(timeout).  Is that
: > intended?
: 
: Yes. It is better to turn 400ms to 1s rather then 0. Usually timeouts
: aren't so short to make it important, but I have seen such case once, so
: it is possible to predict another.

OK.  I was curious because the commit message was ambiguous and could
be taken to mean two different things.  If that's the real intent,
then the code does that and I'm happy.

Warner

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 27 23:48:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4FD57106566C;
	Tue, 27 Oct 2009 23:48:56 +0000 (UTC)
	(envelope-from minimarmot@gmail.com)
Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24])
	by mx1.freebsd.org (Postfix) with ESMTP id 8A35C8FC20;
	Tue, 27 Oct 2009 23:48:54 +0000 (UTC)
Received: by ey-out-2122.google.com with SMTP id 9so87850eyd.9
	for ; Tue, 27 Oct 2009 16:48:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:date:message-id:subject:from:to:cc:content-type;
	bh=ysfEfC0aRUg5GUMHco5NrCmdi1MI76+P+jeJGYlfBqQ=;
	b=uvDwrz6I+201L3zxNolrZxyTLgjzRkrIGDtiEB0stZNRqzOBxfgWBt6/311MmVvzjB
	P8flwu7Nve8SXNoEcKb8rTRsc81JAZ5B/uepahBzWj44JkOnHa3TnyF2N/9L2wTGtbOE
	HgCOvfRqje6xUxrfvJqe4BGEAV5xJ9tvUkbNs=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	b=MUpnn26BxCUNMyGpiOdUU7xnNuchdTr6eozd3sLVpKdjm81PQsN/3JkgmFYZzVzXQR
	/20K/RIyXAZPYNDAfs6Rk64BBDZjYBQYU82nrqmLh/nlSM6iDg+qoxsEUkkhPeL7saIi
	IeJwPDwOGvIbM2/B292EGSpXDGI6Hz3y2eZk0=
MIME-Version: 1.0
Received: by 10.211.131.36 with SMTP id i36mr446747ebn.33.1256687334231; Tue, 
	27 Oct 2009 16:48:54 -0700 (PDT)
In-Reply-To: <20091027064517.GA34072@mavetju.org>
References: <200910212059.n9LKxDDQ010447@svn.freebsd.org>
	<47d0403c0910261705s68cd23dcq67433dd831603416@mail.gmail.com>
	<20091027004213.GA13626@mavetju.org> <4AE67CA3.5080109@freebsd.org>
	<20091027064517.GA34072@mavetju.org>
Date: Tue, 27 Oct 2009 19:48:54 -0400
Message-ID: <47d0403c0910271648v71670fecn4ef3a9e2b80d6eaa@mail.gmail.com>
From: Ben Kaduk 
To: Edwin Groothuis 
Content-Type: text/plain; charset=ISO-8859-1
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Andriy Gapon 
Subject: Re: svn commit: r198351 - head/share/zoneinfo
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 27 Oct 2009 23:48:56 -0000

On Tue, Oct 27, 2009 at 2:45 AM, Edwin Groothuis  wrote:
> On Tue, Oct 27, 2009 at 06:52:51AM +0200, Andriy Gapon wrote:
>> on 27/10/2009 02:42 Edwin Groothuis said the following:
>> > On Mon, Oct 26, 2009 at 08:05:31PM -0400, Ben Kaduk wrote:
>> >>> +                       fi; \
>> >>> +                       echo "Updating /etc/localtime"; \
>> >>> +                       tzsetup ${optC} -r; \
>> >>
>> >> This breaks installworld for me.  Replacing tzsetup with a hardcoded
>> >> /usr/sbin/tzsetup allowed installworld to finish.
>> >
>> > ===> share/zoneinfo (install)
>> > umask 022; cd /usr/src/share/zoneinfo;  zic -D -d /usr/share/zoneinfo -p America/New_York  -u root -g wheel -m 444   -y /usr/obj/usr/src/share/zoneinfo/yearistype africa antarctica asia australasia etcetera europe  factory northamerica southamerica
>> > "factory", line 11: warning: time zone abbreviation differs from POSIX standard (Local time zone must be set--use tzsetup)
>> > install -o root -g wheel -m 444  /usr/src/share/zoneinfo/zone.tab /usr/share/zoneinfo/
>> > Updating /etc/localtime
>> > tzsetup: not found
>> > *** Error code 127
>> >
>> > I'll check it out, just wonder why you can run zic(8) but not
>> > tzsetup(8). They are both in /usr/sbin.
>>
>> Perhaps ITOOLS variable has something to do with this.
>> (installworld may be executed from a rather unpopulated environment).
>
> Ben,
>
> Can you confirm that this resolves it?

Edwin,

Yes, this patch works well.  (Reverting my hack caused installworld to
fail again, and applying this patch allowed it to work.)

Thanks!

-Ben Kaduk



>
> Index: Makefile.inc1
> ===================================================================
> --- Makefile.inc1       (revision 198253)
> +++ Makefile.inc1       (working copy)
> @@ -599,11 +599,14 @@
>  .if ${MK_INFO} != "no"
>  _install-info= install-info
>  .endif
> +.if ${MK_ZONEINFO} != "no"
> +_zoneinfo=     zic tzsetup
> +.endif
>
>  ITOOLS=        [ awk cap_mkdb cat chflags chmod chown \
>        date echo egrep find grep ${_install-info} \
>        ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
> -       test true uname wc zic
> +       test true uname wc ${_zoneinfo}
>
>  #
>  # distributeworld
>
> Edwin
> --
> Edwin Groothuis         Website: http://www.mavetju.org/
> edwin@mavetju.org       Weblog:  http://www.mavetju.org/weblog/
>

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 28 07:05:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 418421065676;
	Wed, 28 Oct 2009 07:05:33 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3184D8FC12;
	Wed, 28 Oct 2009 07:05:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9S75WkG053311;
	Wed, 28 Oct 2009 07:05:32 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9S75WSa053309;
	Wed, 28 Oct 2009 07:05:32 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200910280705.n9S75WSa053309@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 28 Oct 2009 07:05:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198535 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 28 Oct 2009 07:05:33 -0000

Author: edwin
Date: Wed Oct 28 07:05:32 2009
New Revision: 198535
URL: http://svn.freebsd.org/changeset/base/198535

Log:
  Now that the zoneinfo data is automatically updated when a new world
  is installed, we should at least have the tzsetup tool available!
  
  Suggested by:	Andriy Gapon 
  Noticed by:	Ben Kaduk 
  MFC after:	1 week

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Wed Oct 28 03:34:05 2009	(r198534)
+++ head/Makefile.inc1	Wed Oct 28 07:05:32 2009	(r198535)
@@ -599,11 +599,14 @@ installcheck_UGID:
 .if ${MK_INFO} != "no"
 _install-info=	install-info
 .endif
+.if ${MK_ZONEINFO} != "no"
+_zoneinfo=	zic tzsetup
+.endif
 
 ITOOLS=	[ awk cap_mkdb cat chflags chmod chown \
 	date echo egrep find grep ${_install-info} \
 	ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
-	test true uname wc zic
+	test true uname wc ${_zoneinfo}
 
 #
 # distributeworld

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 28 10:06:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 57722106568B;
	Wed, 28 Oct 2009 10:06:28 +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 46ACF8FC23;
	Wed, 28 Oct 2009 10:06:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9SA6RwR057815;
	Wed, 28 Oct 2009 10:06:27 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9SA6R5t057813;
	Wed, 28 Oct 2009 10:06:27 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910281006.n9SA6R5t057813@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 28 Oct 2009 10:06:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198537 - head/sys/boot/common
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 28 Oct 2009 10:06:28 -0000

Author: brueffer
Date: Wed Oct 28 10:06:27 2009
New Revision: 198537
URL: http://svn.freebsd.org/changeset/base/198537

Log:
  Close a file descriptor leak in an error case.
  
  PR:		138374
  Submitted by:	Patroklos Argyroudis 
  MFC after:	1 week

Modified:
  head/sys/boot/common/commands.c

Modified: head/sys/boot/common/commands.c
==============================================================================
--- head/sys/boot/common/commands.c	Wed Oct 28 09:55:42 2009	(r198536)
+++ head/sys/boot/common/commands.c	Wed Oct 28 10:06:27 2009	(r198537)
@@ -150,6 +150,7 @@ command_help(int argc, char *argv[]) 
 	break;
     default:
 	command_errmsg = "usage is 'help  []";
+	close(hfd);
 	return(CMD_ERROR);
     }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 28 11:14:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0657F106566C;
	Wed, 28 Oct 2009 11:14:33 +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 DD0908FC18;
	Wed, 28 Oct 2009 11:14:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9SBEWiq060185;
	Wed, 28 Oct 2009 11:14:32 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9SBEWh0060180;
	Wed, 28 Oct 2009 11:14:32 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200910281114.n9SBEWh0060180@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 28 Oct 2009 11:14:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198538 - in head: . lib/libc/gen lib/libc/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 28 Oct 2009 11:14:33 -0000

Author: kib
Date: Wed Oct 28 11:14:32 2009
New Revision: 198538
URL: http://svn.freebsd.org/changeset/base/198538

Log:
  Move pselect(3) man page to section 2.
  
  Noted by:	jhb
  MFC after:	1 month

Added:
  head/lib/libc/sys/pselect.2
     - copied, changed from r198524, head/lib/libc/gen/pselect.3
Deleted:
  head/lib/libc/gen/pselect.3
Modified:
  head/ObsoleteFiles.inc
  head/lib/libc/gen/Makefile.inc
  head/lib/libc/sys/Makefile.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Wed Oct 28 10:06:27 2009	(r198537)
+++ head/ObsoleteFiles.inc	Wed Oct 28 11:14:32 2009	(r198538)
@@ -14,6 +14,8 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20091027: pselect.3 implemented as syscall
+OLD_FILES+=usr/share/man/man3/pselect.3.gz
 # 20091005: fusword.9 and susword.9 removed
 OLD_FILES+=usr/share/man/man9/fusword.9.gz
 OLD_FILES+=usr/share/man/man9/susword.9.gz

Modified: head/lib/libc/gen/Makefile.inc
==============================================================================
--- head/lib/libc/gen/Makefile.inc	Wed Oct 28 10:06:27 2009	(r198537)
+++ head/lib/libc/gen/Makefile.inc	Wed Oct 28 11:14:32 2009	(r198538)
@@ -62,7 +62,7 @@ MAN+=	alarm.3 arc4random.3 \
 	posix_spawnattr_getpgroup.3 posix_spawnattr_getschedparam.3 \
 	posix_spawnattr_getschedpolicy.3 posix_spawnattr_init.3 \
 	posix_spawnattr_getsigdefault.3 posix_spawnattr_getsigmask.3 \
-	pselect.3 psignal.3 pwcache.3 \
+	psignal.3 pwcache.3 \
 	raise.3 rand48.3 readpassphrase.3 rfork_thread.3 \
 	scandir.3 sem_destroy.3 sem_getvalue.3 sem_init.3 \
 	sem_open.3 sem_post.3 sem_timedwait.3 sem_wait.3 \

Modified: head/lib/libc/sys/Makefile.inc
==============================================================================
--- head/lib/libc/sys/Makefile.inc	Wed Oct 28 10:06:27 2009	(r198537)
+++ head/lib/libc/sys/Makefile.inc	Wed Oct 28 11:14:32 2009	(r198538)
@@ -83,7 +83,8 @@ MAN+=	abort2.2 accept.2 access.2 acct.2 
 	mq_setattr.2 \
 	msgctl.2 msgget.2 msgrcv.2 msgsnd.2 \
 	msync.2 munmap.2 nanosleep.2 nfssvc.2 ntp_adjtime.2 open.2 \
-	pathconf.2 pipe.2 poll.2 posix_openpt.2 profil.2 ptrace.2 quotactl.2 \
+	pathconf.2 pipe.2 poll.2 posix_openpt.2 profil.2 \
+	pselect.2 ptrace.2 quotactl.2 \
 	read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \
 	rtprio.2
 .if !defined(NO_P1003_1B)

Copied and modified: head/lib/libc/sys/pselect.2 (from r198524, head/lib/libc/gen/pselect.3)
==============================================================================
--- head/lib/libc/gen/pselect.3	Tue Oct 27 18:30:56 2009	(r198524, copy source)
+++ head/lib/libc/sys/pselect.2	Wed Oct 28 11:14:32 2009	(r198538)
@@ -28,8 +28,8 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 16, 2002
-.Dt PSELECT 3
+.Dd October 27, 2009
+.Dt PSELECT 2
 .Os
 .Sh NAME
 .Nm pselect
@@ -116,7 +116,7 @@ The
 function first appeared in
 .Fx 5.0 .
 .Sh AUTHORS
-The
+The first implementation of
 .Fn pselect
 function and this manual page were written by
 .An Garrett Wollman Aq wollman@FreeBSD.org .

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 28 12:10:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 984161065676;
	Wed, 28 Oct 2009 12:10:29 +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 8683F8FC28;
	Wed, 28 Oct 2009 12:10:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9SCATQw061161;
	Wed, 28 Oct 2009 12:10:29 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9SCAT61061159;
	Wed, 28 Oct 2009 12:10:29 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910281210.n9SCAT61061159@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 28 Oct 2009 12:10:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198539 - head/sys/netinet/libalias
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 28 Oct 2009 12:10:29 -0000

Author: brueffer
Date: Wed Oct 28 12:10:29 2009
New Revision: 198539
URL: http://svn.freebsd.org/changeset/base/198539

Log:
  Close a stream file descriptor leak.
  
  PR:		138130
  Submitted by:	Patroklos Argyroudis 
  MFC after:	1 week

Modified:
  head/sys/netinet/libalias/alias.c

Modified: head/sys/netinet/libalias/alias.c
==============================================================================
--- head/sys/netinet/libalias/alias.c	Wed Oct 28 11:14:32 2009	(r198538)
+++ head/sys/netinet/libalias/alias.c	Wed Oct 28 12:10:29 2009	(r198539)
@@ -1669,6 +1669,7 @@ LibAliasRefreshModules(void)
 			LibAliasLoadModule(buf);
 		}
 	}
+	fclose(fd);
 	return (0);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 28 13:50:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A6495106568B;
	Wed, 28 Oct 2009 13:50:28 +0000 (UTC)
	(envelope-from emaste@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 94FE88FC2B;
	Wed, 28 Oct 2009 13:50:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9SDoS50063012;
	Wed, 28 Oct 2009 13:50:28 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9SDoSDY063010;
	Wed, 28 Oct 2009 13:50:28 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <200910281350.n9SDoSDY063010@svn.freebsd.org>
From: Ed Maste 
Date: Wed, 28 Oct 2009 13:50:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198541 - head/sys/dev/aac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 28 Oct 2009 13:50:28 -0000

Author: emaste
Date: Wed Oct 28 13:50:28 2009
New Revision: 198541
URL: http://svn.freebsd.org/changeset/base/198541

Log:
  Do first controller time sync after 1 minute, as in Adaptec's vendor
  driver.

Modified:
  head/sys/dev/aac/aac.c

Modified: head/sys/dev/aac/aac.c
==============================================================================
--- head/sys/dev/aac/aac.c	Wed Oct 28 13:38:07 2009	(r198540)
+++ head/sys/dev/aac/aac.c	Wed Oct 28 13:50:28 2009	(r198541)
@@ -354,7 +354,7 @@ aac_attach(struct aac_softc *sc)
 	}
 
 	mtx_lock(&sc->aac_io_lock);
-	callout_reset(&sc->aac_daemontime, 30 * 60 * hz, aac_daemon, sc);
+	callout_reset(&sc->aac_daemontime, 60 * hz, aac_daemon, sc);
 	mtx_unlock(&sc->aac_io_lock);
 
 	return(0);

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 28 14:13:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3A74F106568D;
	Wed, 28 Oct 2009 14:13:46 +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 292C98FC35;
	Wed, 28 Oct 2009 14:13:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9SEDkWl063461;
	Wed, 28 Oct 2009 14:13:46 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9SEDkjd063459;
	Wed, 28 Oct 2009 14:13:46 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910281413.n9SEDkjd063459@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 28 Oct 2009 14:13:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198542 - head/lib/libstand
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 28 Oct 2009 14:13:46 -0000

Author: brueffer
Date: Wed Oct 28 14:13:45 2009
New Revision: 198542
URL: http://svn.freebsd.org/changeset/base/198542

Log:
  Initialize f_rabuf in the raw device case. A subsequent close()
  later on would try to free it, leading to a crash.
  
  PR:		93998
  Submitted by:	neel
  MFC after:	1 week

Modified:
  head/lib/libstand/open.c

Modified: head/lib/libstand/open.c
==============================================================================
--- head/lib/libstand/open.c	Wed Oct 28 13:50:28 2009	(r198541)
+++ head/lib/libstand/open.c	Wed Oct 28 14:13:45 2009	(r198542)
@@ -113,6 +113,7 @@ open(const char *fname, int mode)
     /* see if we opened a raw device; otherwise, 'file' is the file name. */
     if (file == (char *)0 || *file == '\0') {
 	f->f_flags |= F_RAW;
+	f->f_rabuf = NULL;
 	return (fd);
     }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 28 14:39:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC4F3106568D;
	Wed, 28 Oct 2009 14:39:27 +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 AB1CA8FC1E;
	Wed, 28 Oct 2009 14:39:27 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9SEdREb064025;
	Wed, 28 Oct 2009 14:39:27 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9SEdR5V064023;
	Wed, 28 Oct 2009 14:39:27 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910281439.n9SEdR5V064023@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 28 Oct 2009 14:39:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198543 - head/share/man/man5
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 28 Oct 2009 14:39:27 -0000

Author: brueffer
Date: Wed Oct 28 14:39:27 2009
New Revision: 198543
URL: http://svn.freebsd.org/changeset/base/198543

Log:
  Fix date (1) and SEE ALSO section.
  
  Submitted by:	Ulrich Spoerlein (1)
  MFC after:	1 week

Modified:
  head/share/man/man5/regdomain.5

Modified: head/share/man/man5/regdomain.5
==============================================================================
--- head/share/man/man5/regdomain.5	Wed Oct 28 14:13:45 2009	(r198542)
+++ head/share/man/man5/regdomain.5	Wed Oct 28 14:39:27 2009	(r198543)
@@ -23,7 +23,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd Apri 13, 2008
+.Dd April 13, 2008
 .Dt REGDOMAIN 5
 .Os
 .Sh NAME
@@ -44,5 +44,5 @@ This file should be changed only to refl
 XML database of 802.11 regulatory constraints
 .El
 .Sh SEE ALSO
-.Xr wlan 4
-.Xr ifconfig 8 ,
+.Xr wlan 4 ,
+.Xr ifconfig 8

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 28 15:22:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1F9CF10656A4;
	Wed, 28 Oct 2009 15:22:59 +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 0EFA88FC1A;
	Wed, 28 Oct 2009 15:22:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9SFMwYT065066;
	Wed, 28 Oct 2009 15:22:58 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9SFMwKF065064;
	Wed, 28 Oct 2009 15:22:58 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910281522.n9SFMwKF065064@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 28 Oct 2009 15:22:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198546 - head/sys/dev/amr
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 28 Oct 2009 15:22:59 -0000

Author: brueffer
Date: Wed Oct 28 15:22:58 2009
New Revision: 198546
URL: http://svn.freebsd.org/changeset/base/198546

Log:
  Remove spurious `)`
  
  PR:		137758
  Submitted by:	Henning Petersen 
  MFC after:	1 week

Modified:
  head/sys/dev/amr/amr.c

Modified: head/sys/dev/amr/amr.c
==============================================================================
--- head/sys/dev/amr/amr.c	Wed Oct 28 15:09:21 2009	(r198545)
+++ head/sys/dev/amr/amr.c	Wed Oct 28 15:22:58 2009	(r198546)
@@ -225,7 +225,7 @@ amr_attach(struct amr_softc *sc)
     }
 
 #ifdef AMR_BOARD_INIT
-    if ((AMR_IS_QUARTZ(sc) ? amr_quartz_init(sc) : amr_std_init(sc))))
+    if ((AMR_IS_QUARTZ(sc) ? amr_quartz_init(sc) : amr_std_init(sc)))
 	return(ENXIO);
 #endif
 

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 28 20:17:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CBE72106568D;
	Wed, 28 Oct 2009 20:17:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B9F138FC22;
	Wed, 28 Oct 2009 20:17:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9SKHsUC070970;
	Wed, 28 Oct 2009 20:17:54 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9SKHsSb070967;
	Wed, 28 Oct 2009 20:17:54 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200910282017.n9SKHsSb070967@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 28 Oct 2009 20:17:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198554 - in head/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 28 Oct 2009 20:17:55 -0000

Author: jhb
Date: Wed Oct 28 20:17:54 2009
New Revision: 198554
URL: http://svn.freebsd.org/changeset/base/198554

Log:
  Fix some problems with effective mmap() offsets > 32 bits.  This was
  partially fixed on amd64 earlier.  Rather than forcing linux_mmap_common()
  to use a 32-bit offset, have it accept a 64-bit file offset.  This offset
  is then passed to the real mmap() call.  Rather than inventing a structure
  to hold the normal linux_mmap args that has a 64-bit offset, just pass
  each of the arguments individually to linux_mmap_common() since that more
  closes matches the existing style of various kern_foo() functions.
  
  Submitted by:	Christian Zander @ Nvidia
  MFC after:	1 week

Modified:
  head/sys/amd64/linux32/linux32_machdep.c
  head/sys/i386/linux/linux_machdep.c

Modified: head/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- head/sys/amd64/linux32/linux32_machdep.c	Wed Oct 28 17:46:52 2009	(r198553)
+++ head/sys/amd64/linux32/linux32_machdep.c	Wed Oct 28 20:17:54 2009	(r198554)
@@ -91,6 +91,10 @@ linux_to_bsd_sigaltstack(int lsa)
 	return (bsa);
 }
 
+static int	linux_mmap_common(struct thread *td, l_uintptr_t addr,
+		    l_size_t len, l_int prot, l_int flags, l_int fd,
+		    l_loff_t pos);
+
 int
 bsd_to_linux_sigaltstack(int bsa)
 {
@@ -759,12 +763,9 @@ linux_clone(struct thread *td, struct li
 #define STACK_SIZE  (2 * 1024 * 1024)
 #define GUARD_SIZE  (4 * PAGE_SIZE)
 
-static int linux_mmap_common(struct thread *, struct l_mmap_argv *);
-
 int
 linux_mmap2(struct thread *td, struct linux_mmap2_args *args)
 {
-	struct l_mmap_argv linux_args;
 
 #ifdef DEBUG
 	if (ldebug(mmap2))
@@ -773,14 +774,9 @@ linux_mmap2(struct thread *td, struct li
 		    args->flags, args->fd, args->pgoff);
 #endif
 
-	linux_args.addr = PTROUT(args->addr);
-	linux_args.len = args->len;
-	linux_args.prot = args->prot;
-	linux_args.flags = args->flags;
-	linux_args.fd = args->fd;
-	linux_args.pgoff = args->pgoff;
-
-	return (linux_mmap_common(td, &linux_args));
+	return (linux_mmap_common(td, PTROUT(args->addr), args->len, args->prot,
+		args->flags, args->fd, (uint64_t)(uint32_t)args->pgoff *
+		PAGE_SIZE));
 }
 
 int
@@ -799,15 +795,15 @@ linux_mmap(struct thread *td, struct lin
 		    linux_args.addr, linux_args.len, linux_args.prot,
 		    linux_args.flags, linux_args.fd, linux_args.pgoff);
 #endif
-	if ((linux_args.pgoff % PAGE_SIZE) != 0)
-		return (EINVAL);
-	linux_args.pgoff /= PAGE_SIZE;
 
-	return (linux_mmap_common(td, &linux_args));
+	return (linux_mmap_common(td, linux_args.addr, linux_args.len,
+	    linux_args.prot, linux_args.flags, linux_args.fd,
+	    (uint32_t)linux_args.pgoff));
 }
 
 static int
-linux_mmap_common(struct thread *td, struct l_mmap_argv *linux_args)
+linux_mmap_common(struct thread *td, l_uintptr_t addr, l_size_t len, l_int prot,
+    l_int flags, l_int fd, l_loff_t pos)
 {
 	struct proc *p = td->td_proc;
 	struct mmap_args /* {
@@ -830,21 +826,20 @@ linux_mmap_common(struct thread *td, str
 	 * Linux mmap(2):
 	 * You must specify exactly one of MAP_SHARED and MAP_PRIVATE
 	 */
-	if (! ((linux_args->flags & LINUX_MAP_SHARED) ^
-	    (linux_args->flags & LINUX_MAP_PRIVATE)))
+	if (!((flags & LINUX_MAP_SHARED) ^ (flags & LINUX_MAP_PRIVATE)))
 		return (EINVAL);
 
-	if (linux_args->flags & LINUX_MAP_SHARED)
+	if (flags & LINUX_MAP_SHARED)
 		bsd_args.flags |= MAP_SHARED;
-	if (linux_args->flags & LINUX_MAP_PRIVATE)
+	if (flags & LINUX_MAP_PRIVATE)
 		bsd_args.flags |= MAP_PRIVATE;
-	if (linux_args->flags & LINUX_MAP_FIXED)
+	if (flags & LINUX_MAP_FIXED)
 		bsd_args.flags |= MAP_FIXED;
-	if (linux_args->flags & LINUX_MAP_ANON)
+	if (flags & LINUX_MAP_ANON)
 		bsd_args.flags |= MAP_ANON;
 	else
 		bsd_args.flags |= MAP_NOSYNC;
-	if (linux_args->flags & LINUX_MAP_GROWSDOWN)
+	if (flags & LINUX_MAP_GROWSDOWN)
 		bsd_args.flags |= MAP_STACK;
 
 	/*
@@ -852,12 +847,12 @@ linux_mmap_common(struct thread *td, str
 	 * on Linux/i386. We do this to ensure maximum compatibility.
 	 * Linux/ia64 does the same in i386 emulation mode.
 	 */
-	bsd_args.prot = linux_args->prot;
+	bsd_args.prot = prot;
 	if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC))
 		bsd_args.prot |= PROT_READ | PROT_EXEC;
 
 	/* Linux does not check file descriptor when MAP_ANONYMOUS is set. */
-	bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : linux_args->fd;
+	bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : fd;
 	if (bsd_args.fd != -1) {
 		/*
 		 * Linux follows Solaris mmap(2) description:
@@ -882,7 +877,7 @@ linux_mmap_common(struct thread *td, str
 		fdrop(fp, td);
 	}
 
-	if (linux_args->flags & LINUX_MAP_GROWSDOWN) {
+	if (flags & LINUX_MAP_GROWSDOWN) {
 		/*
 		 * The Linux MAP_GROWSDOWN option does not limit auto
 		 * growth of the region.  Linux mmap with this option
@@ -905,8 +900,7 @@ linux_mmap_common(struct thread *td, str
 		 * fixed size of (STACK_SIZE - GUARD_SIZE).
 		 */
 
-		if ((caddr_t)PTRIN(linux_args->addr) + linux_args->len >
-		    p->p_vmspace->vm_maxsaddr) {
+		if ((caddr_t)PTRIN(addr) + len > p->p_vmspace->vm_maxsaddr) {
 			/*
 			 * Some Linux apps will attempt to mmap
 			 * thread stacks near the top of their
@@ -937,19 +931,19 @@ linux_mmap_common(struct thread *td, str
 		 * we map the full stack, since we don't have a way
 		 * to autogrow it.
 		 */
-		if (linux_args->len > STACK_SIZE - GUARD_SIZE) {
-			bsd_args.addr = (caddr_t)PTRIN(linux_args->addr);
-			bsd_args.len = linux_args->len;
+		if (len > STACK_SIZE - GUARD_SIZE) {
+			bsd_args.addr = (caddr_t)PTRIN(addr);
+			bsd_args.len = len;
 		} else {
-			bsd_args.addr = (caddr_t)PTRIN(linux_args->addr) -
-			    (STACK_SIZE - GUARD_SIZE - linux_args->len);
+			bsd_args.addr = (caddr_t)PTRIN(addr) -
+			    (STACK_SIZE - GUARD_SIZE - len);
 			bsd_args.len = STACK_SIZE - GUARD_SIZE;
 		}
 	} else {
-		bsd_args.addr = (caddr_t)PTRIN(linux_args->addr);
-		bsd_args.len  = linux_args->len;
+		bsd_args.addr = (caddr_t)PTRIN(addr);
+		bsd_args.len  = len;
 	}
-	bsd_args.pos = (off_t)linux_args->pgoff * PAGE_SIZE;
+	bsd_args.pos = pos;
 
 #ifdef DEBUG
 	if (ldebug(mmap))

Modified: head/sys/i386/linux/linux_machdep.c
==============================================================================
--- head/sys/i386/linux/linux_machdep.c	Wed Oct 28 17:46:52 2009	(r198553)
+++ head/sys/i386/linux/linux_machdep.c	Wed Oct 28 20:17:54 2009	(r198554)
@@ -93,6 +93,10 @@ struct l_old_select_argv {
 	struct l_timeval	*timeout;
 };
 
+static int	linux_mmap_common(struct thread *td, l_uintptr_t addr,
+		    l_size_t len, l_int prot, l_int flags, l_int fd,
+		    l_loff_t pos);
+
 int
 linux_to_bsd_sigaltstack(int lsa)
 {
@@ -591,12 +595,9 @@ linux_clone(struct thread *td, struct li
 #define STACK_SIZE  (2 * 1024 * 1024)
 #define GUARD_SIZE  (4 * PAGE_SIZE)
 
-static int linux_mmap_common(struct thread *, struct l_mmap_argv *);
-
 int
 linux_mmap2(struct thread *td, struct linux_mmap2_args *args)
 {
-	struct l_mmap_argv linux_args;
 
 #ifdef DEBUG
 	if (ldebug(mmap2))
@@ -605,14 +606,9 @@ linux_mmap2(struct thread *td, struct li
 		    args->flags, args->fd, args->pgoff);
 #endif
 
-	linux_args.addr = args->addr;
-	linux_args.len = args->len;
-	linux_args.prot = args->prot;
-	linux_args.flags = args->flags;
-	linux_args.fd = args->fd;
-	linux_args.pgoff = args->pgoff * PAGE_SIZE;
-
-	return (linux_mmap_common(td, &linux_args));
+	return (linux_mmap_common(td, args->addr, args->len, args->prot,
+		args->flags, args->fd, (uint64_t)(uint32_t)args->pgoff *
+		PAGE_SIZE));
 }
 
 int
@@ -632,11 +628,14 @@ linux_mmap(struct thread *td, struct lin
 		    linux_args.flags, linux_args.fd, linux_args.pgoff);
 #endif
 
-	return (linux_mmap_common(td, &linux_args));
+	return (linux_mmap_common(td, linux_args.addr, linux_args.len,
+	    linux_args.prot, linux_args.flags, linux_args.fd,
+	    (uint32_t)linux_args.pgoff));
 }
 
 static int
-linux_mmap_common(struct thread *td, struct l_mmap_argv *linux_args)
+linux_mmap_common(struct thread *td, l_uintptr_t addr, l_size_t len, l_int prot,
+    l_int flags, l_int fd, l_loff_t pos)
 {
 	struct proc *p = td->td_proc;
 	struct mmap_args /* {
@@ -659,21 +658,20 @@ linux_mmap_common(struct thread *td, str
 	 * Linux mmap(2):
 	 * You must specify exactly one of MAP_SHARED and MAP_PRIVATE
 	 */
-	if (! ((linux_args->flags & LINUX_MAP_SHARED) ^
-	    (linux_args->flags & LINUX_MAP_PRIVATE)))
+	if (!((flags & LINUX_MAP_SHARED) ^ (flags & LINUX_MAP_PRIVATE)))
 		return (EINVAL);
 
-	if (linux_args->flags & LINUX_MAP_SHARED)
+	if (flags & LINUX_MAP_SHARED)
 		bsd_args.flags |= MAP_SHARED;
-	if (linux_args->flags & LINUX_MAP_PRIVATE)
+	if (flags & LINUX_MAP_PRIVATE)
 		bsd_args.flags |= MAP_PRIVATE;
-	if (linux_args->flags & LINUX_MAP_FIXED)
+	if (flags & LINUX_MAP_FIXED)
 		bsd_args.flags |= MAP_FIXED;
-	if (linux_args->flags & LINUX_MAP_ANON)
+	if (flags & LINUX_MAP_ANON)
 		bsd_args.flags |= MAP_ANON;
 	else
 		bsd_args.flags |= MAP_NOSYNC;
-	if (linux_args->flags & LINUX_MAP_GROWSDOWN)
+	if (flags & LINUX_MAP_GROWSDOWN)
 		bsd_args.flags |= MAP_STACK;
 
 	/*
@@ -681,12 +679,12 @@ linux_mmap_common(struct thread *td, str
 	 * on Linux/i386. We do this to ensure maximum compatibility.
 	 * Linux/ia64 does the same in i386 emulation mode.
 	 */
-	bsd_args.prot = linux_args->prot;
+	bsd_args.prot = prot;
 	if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC))
 		bsd_args.prot |= PROT_READ | PROT_EXEC;
 
 	/* Linux does not check file descriptor when MAP_ANONYMOUS is set. */
-	bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : linux_args->fd;
+	bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : fd;
 	if (bsd_args.fd != -1) {
 		/*
 		 * Linux follows Solaris mmap(2) description:
@@ -711,9 +709,9 @@ linux_mmap_common(struct thread *td, str
 		fdrop(fp, td);
 	}
 
-	if (linux_args->flags & LINUX_MAP_GROWSDOWN) {
+	if (flags & LINUX_MAP_GROWSDOWN) {
 		/* 
-		 * The linux MAP_GROWSDOWN option does not limit auto
+		 * The Linux MAP_GROWSDOWN option does not limit auto
 		 * growth of the region.  Linux mmap with this option
 		 * takes as addr the inital BOS, and as len, the initial
 		 * region size.  It can then grow down from addr without
@@ -734,8 +732,7 @@ linux_mmap_common(struct thread *td, str
 		 * fixed size of (STACK_SIZE - GUARD_SIZE).
 		 */
 
-		if ((caddr_t)PTRIN(linux_args->addr) + linux_args->len >
-		    p->p_vmspace->vm_maxsaddr) {
+		if ((caddr_t)PTRIN(addr) + len > p->p_vmspace->vm_maxsaddr) {
 			/* 
 			 * Some linux apps will attempt to mmap
 			 * thread stacks near the top of their
@@ -766,19 +763,19 @@ linux_mmap_common(struct thread *td, str
 		 * we map the full stack, since we don't have a way
 		 * to autogrow it.
 		 */
-		if (linux_args->len > STACK_SIZE - GUARD_SIZE) {
-			bsd_args.addr = (caddr_t)PTRIN(linux_args->addr);
-			bsd_args.len = linux_args->len;
+		if (len > STACK_SIZE - GUARD_SIZE) {
+			bsd_args.addr = (caddr_t)PTRIN(addr);
+			bsd_args.len = len;
 		} else {
-			bsd_args.addr = (caddr_t)PTRIN(linux_args->addr) -
-			    (STACK_SIZE - GUARD_SIZE - linux_args->len);
+			bsd_args.addr = (caddr_t)PTRIN(addr) -
+			    (STACK_SIZE - GUARD_SIZE - len);
 			bsd_args.len = STACK_SIZE - GUARD_SIZE;
 		}
 	} else {
-		bsd_args.addr = (caddr_t)PTRIN(linux_args->addr);
-		bsd_args.len  = linux_args->len;
+		bsd_args.addr = (caddr_t)PTRIN(addr);
+		bsd_args.len  = len;
 	}
-	bsd_args.pos = linux_args->pgoff;
+	bsd_args.pos = pos;
 
 #ifdef DEBUG
 	if (ldebug(mmap))

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 09:27:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 84058106568B;
	Thu, 29 Oct 2009 09:27:10 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7279F8FC14;
	Thu, 29 Oct 2009 09:27:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9T9RAGI089992;
	Thu, 29 Oct 2009 09:27:10 GMT (envelope-from ru@svn.freebsd.org)
Received: (from ru@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9T9RAS4089990;
	Thu, 29 Oct 2009 09:27:10 GMT (envelope-from ru@svn.freebsd.org)
Message-Id: <200910290927.n9T9RAS4089990@svn.freebsd.org>
From: Ruslan Ermilov 
Date: Thu, 29 Oct 2009 09:27:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198570 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 09:27:10 -0000

Author: ru
Date: Thu Oct 29 09:27:09 2009
New Revision: 198570
URL: http://svn.freebsd.org/changeset/base/198570

Log:
  HZ is now 1000 on most platforms, update a comment.
  
  Reviewed by:	phk, markm

Modified:
  head/sys/sys/time.h

Modified: head/sys/sys/time.h
==============================================================================
--- head/sys/sys/time.h	Thu Oct 29 05:18:02 2009	(r198569)
+++ head/sys/sys/time.h	Thu Oct 29 09:27:09 2009	(r198570)
@@ -283,7 +283,7 @@ extern struct timeval boottime;
  *
  * Functions with the "get" prefix returns a less precise result
  * much faster than the functions without "get" prefix and should
- * be used where a precision of 10 msec is acceptable or where
+ * be used where a precision of 1/hz seconds is acceptable or where
  * performance is priority. (NB: "precision", _not_ "resolution" !) 
  * 
  */

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 09:45:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7F5AD1065753;
	Thu, 29 Oct 2009 09:45:05 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6E9D58FC12;
	Thu, 29 Oct 2009 09:45:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9T9j5ph090377;
	Thu, 29 Oct 2009 09:45:05 GMT (envelope-from ru@svn.freebsd.org)
Received: (from ru@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9T9j5NQ090375;
	Thu, 29 Oct 2009 09:45:05 GMT (envelope-from ru@svn.freebsd.org)
Message-Id: <200910290945.n9T9j5NQ090375@svn.freebsd.org>
From: Ruslan Ermilov 
Date: Thu, 29 Oct 2009 09:45:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198571 - head/share/man/man9
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 09:45:05 -0000

Author: ru
Date: Thu Oct 29 09:45:05 2009
New Revision: 198571
URL: http://svn.freebsd.org/changeset/base/198571

Log:
  Back in 2003, get_cyclecount() was changed to use binuptime() instead
  of nanotime().  Reflect this change in a manpage.
  
  Reviewed by:	phk, markm

Modified:
  head/share/man/man9/get_cyclecount.9

Modified: head/share/man/man9/get_cyclecount.9
==============================================================================
--- head/share/man/man9/get_cyclecount.9	Thu Oct 29 09:27:09 2009	(r198570)
+++ head/share/man/man9/get_cyclecount.9	Thu Oct 29 09:45:05 2009	(r198571)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 20, 2000
+.Dd October 24, 2009
 .Dt GET_CYCLECOUNT 9
 .Os
 .Sh NAME
@@ -65,10 +65,10 @@ do not have such a register,
 so
 .Fn get_cyclecount
 on these platforms
-returns the number of nanoseconds
+returns a (non-monotonic) combination of numbers
 represented by the
 structure returned by
-.Xr nanotime 9 .
+.Xr binuptime 9 .
 .Pp
 The
 .Tn Pentium
@@ -77,18 +77,12 @@ processors all use the
 register.
 .Pp
 The
-.Tn Alpha
-processors use the
-.Li PCC
-register.
-.Pp
-The
 .Tn IA64
 processors use the
 .Li AR.ITC
 register.
 .Sh SEE ALSO
-.Xr nanotime 9
+.Xr binuptime 9
 .Sh HISTORY
 The
 .Fn get_cyclecount

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 09:51:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DAABF1065698;
	Thu, 29 Oct 2009 09:51:13 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B0C488FC12;
	Thu, 29 Oct 2009 09:51:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9T9pDgp090619;
	Thu, 29 Oct 2009 09:51:13 GMT (envelope-from ru@svn.freebsd.org)
Received: (from ru@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9T9pDFt090617;
	Thu, 29 Oct 2009 09:51:13 GMT (envelope-from ru@svn.freebsd.org)
Message-Id: <200910290951.n9T9pDFt090617@svn.freebsd.org>
From: Ruslan Ermilov 
Date: Thu, 29 Oct 2009 09:51:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198573 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 09:51:14 -0000

Author: ru
Date: Thu Oct 29 09:51:13 2009
New Revision: 198573
URL: http://svn.freebsd.org/changeset/base/198573

Log:
  Update some comments regarding ktr(4).

Modified:
  head/sys/conf/NOTES

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Thu Oct 29 09:45:48 2009	(r198572)
+++ head/sys/conf/NOTES	Thu Oct 29 09:51:13 2009	(r198573)
@@ -402,8 +402,7 @@ options 	KTRACE			#kernel tracing
 options 	KTRACE_REQUEST_POOL=101
 
 #
-# KTR is a kernel tracing mechanism imported from BSD/OS.  Currently
-# it has no userland interface aside from a few sysctl's.  It is
+# KTR is a kernel tracing facility imported from BSD/OS.  It is
 # enabled with the KTR option.  KTR_ENTRIES defines the number of
 # entries in the circular trace buffer; it must be a power of two.
 # KTR_COMPILE defines the mask of events to compile into the kernel as
@@ -413,7 +412,7 @@ options 	KTRACE_REQUEST_POOL=101
 # events, with bit X corresponding to CPU X.  KTR_VERBOSE enables
 # dumping of KTR events to the console by default.  This functionality
 # can be toggled via the debug.ktr_verbose sysctl and defaults to off
-# if KTR_VERBOSE is not defined.
+# if KTR_VERBOSE is not defined.  See ktr(4) and ktrdump(8) for details.
 #
 options 	KTR
 options 	KTR_ENTRIES=1024
@@ -424,7 +423,7 @@ options 	KTR_VERBOSE
 
 #
 # ALQ(9) is a facility for the asynchronous queuing of records from the kernel
-# to a vnode, and is employed by services such as KTR(4) to produce trace
+# to a vnode, and is employed by services such as ktr(4) to produce trace
 # files based on a kernel event stream.  Records are written asynchronously
 # in a worker thread.
 #
@@ -618,9 +617,9 @@ options 	SCTP_WITH_NO_CSUM
 # I have not yet commited the tools to get and print
 # the logs, I will do that eventually .. before then
 # if you want them send me an email rrs@freebsd.org
-# You basically must have KTR enabled for these
+# You basically must have ktr(4) enabled for these
 # and you then set the sysctl to turn on/off various
-# logging bits. Use ktrdump to pull the log and run
+# logging bits. Use ktrdump(8) to pull the log and run
 # it through a dispaly program.. and graphs and other
 # things too.
 #

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 10:03:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0483C106566B;
	Thu, 29 Oct 2009 10:03:09 +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 E807B8FC16;
	Thu, 29 Oct 2009 10:03:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TA38xQ091070;
	Thu, 29 Oct 2009 10:03:08 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TA38an091068;
	Thu, 29 Oct 2009 10:03:08 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200910291003.n9TA38an091068@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 29 Oct 2009 10:03:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198575 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 10:03:09 -0000

Author: kib
Date: Thu Oct 29 10:03:08 2009
New Revision: 198575
URL: http://svn.freebsd.org/changeset/base/198575

Log:
  Fix style issue.

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c	Thu Oct 29 09:58:16 2009	(r198574)
+++ head/sys/kern/uipc_syscalls.c	Thu Oct 29 10:03:08 2009	(r198575)
@@ -2016,7 +2016,7 @@ retry_space:
 		 * Loop and construct maximum sized mbuf chain to be bulk
 		 * dumped into socket buffer.
 		 */
-		while(space > loopbytes) {
+		while (space > loopbytes) {
 			vm_pindex_t pindex;
 			vm_offset_t pgoff;
 			struct mbuf *m0;

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 12:19:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D38B4106566B;
	Thu, 29 Oct 2009 12:19:10 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C27238FC17;
	Thu, 29 Oct 2009 12:19:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TCJAgP096068;
	Thu, 29 Oct 2009 12:19:10 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TCJAR7096066;
	Thu, 29 Oct 2009 12:19:10 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910291219.n9TCJAR7096066@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 29 Oct 2009 12:19:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198581 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 12:19:10 -0000

Author: rpaulo
Date: Thu Oct 29 12:19:10 2009
New Revision: 198581
URL: http://svn.freebsd.org/changeset/base/198581

Log:
  Update the route's sequence number upon receiving a RANN.
  
  MFC after:	3 days

Modified:
  head/sys/net80211/ieee80211_hwmp.c

Modified: head/sys/net80211/ieee80211_hwmp.c
==============================================================================
--- head/sys/net80211/ieee80211_hwmp.c	Thu Oct 29 11:52:26 2009	(r198580)
+++ head/sys/net80211/ieee80211_hwmp.c	Thu Oct 29 12:19:10 2009	(r198581)
@@ -1239,15 +1239,18 @@ hwmp_recv_rann(struct ieee80211vap *vap,
 		return;
 	}
 	hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route);
-	if (HWMP_SEQ_GT(rann->rann_seq, hr->hr_seq) && rann->rann_ttl > 1 &&
-	    rann->rann_hopcount < hs->hs_maxhops &&
-	    (ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) {
-		memcpy(&prann, rann, sizeof(prann));
-		prann.rann_hopcount += 1;
-		prann.rann_ttl -= 1;
-		prann.rann_metric += ms->ms_pmetric->mpm_metric(ni);
-		hwmp_send_rann(vap->iv_bss, vap->iv_myaddr, broadcastaddr,
-		    &prann);
+	if (HWMP_SEQ_GT(rann->rann_seq, hr->hr_seq)) {
+		hr->hr_seq = rann->rann_seq;
+		if (rann->rann_ttl > 1 &&
+		    rann->rann_hopcount < hs->hs_maxhops &&
+		    (ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) {
+			memcpy(&prann, rann, sizeof(prann));
+			prann.rann_hopcount += 1;
+			prann.rann_ttl -= 1;
+			prann.rann_metric += ms->ms_pmetric->mpm_metric(ni);
+			hwmp_send_rann(vap->iv_bss, vap->iv_myaddr,
+			    broadcastaddr, &prann);
+		}
 	}
 }
 

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 13:27:15 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2C9A1106566C;
	Thu, 29 Oct 2009 13:27:15 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1B4D08FC13;
	Thu, 29 Oct 2009 13:27:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TDRESR097508;
	Thu, 29 Oct 2009 13:27:15 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TDREeJ097506;
	Thu, 29 Oct 2009 13:27:14 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910291327.n9TDREeJ097506@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Thu, 29 Oct 2009 13:27:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198582 - head/sys/dev/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 13:27:15 -0000

Author: nwhitehorn
Date: Thu Oct 29 13:27:14 2009
New Revision: 198582
URL: http://svn.freebsd.org/changeset/base/198582

Log:
  Turn off use of ATA_A_4BIT on modern hardware. This flag was already
  obsoleted in 1996 by ATA-2, and crashes some modern hardware like some
  revisions of the Serverworks K2 SATA controller. Even very ancient
  hardware seems not to require it. In the unlikely event this causes
  problems, the previous behavior can be re-enabled by defining
  ATA_LEGACY_SUPPORT at the top of this file.
  
  Reviewed by:	Alexander Motin 

Modified:
  head/sys/dev/ata/ata-all.h

Modified: head/sys/dev/ata/ata-all.h
==============================================================================
--- head/sys/dev/ata/ata-all.h	Thu Oct 29 12:19:10 2009	(r198581)
+++ head/sys/dev/ata/ata-all.h	Thu Oct 29 13:27:14 2009	(r198582)
@@ -26,6 +26,11 @@
  * $FreeBSD$
  */
 
+#if 0
+#define	ATA_LEGACY_SUPPORT		/* Enable obsolete features that break
+					 * some modern devices */
+#endif
+
 /* ATA register defines */
 #define ATA_DATA                        0       /* (RW) data */
 
@@ -81,7 +86,11 @@
 #define ATA_PC98_CTLOFFSET              0x10c   /* do for PC98 devices */
 #define         ATA_A_IDS               0x02    /* disable interrupts */
 #define         ATA_A_RESET             0x04    /* RESET controller */
-#define         ATA_A_4BIT              0x08    /* 4 head bits */
+#ifdef	ATA_LEGACY_SUPPORT			
+#define         ATA_A_4BIT              0x08    /* 4 head bits: obsolete 1996 */
+#else
+#define         ATA_A_4BIT              0x00 
+#endif
 #define         ATA_A_HOB               0x80    /* High Order Byte enable */
 
 /* SATA register defines */

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 13:28:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 013D21065696;
	Thu, 29 Oct 2009 13:28:38 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CA9888FC15;
	Thu, 29 Oct 2009 13:28:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TDSbHF097571;
	Thu, 29 Oct 2009 13:28:37 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TDSbUC097569;
	Thu, 29 Oct 2009 13:28:37 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910291328.n9TDSbUC097569@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Thu, 29 Oct 2009 13:28:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198583 - head/sys/dev/ata/chipsets
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 13:28:38 -0000

Author: nwhitehorn
Date: Thu Oct 29 13:28:37 2009
New Revision: 198583
URL: http://svn.freebsd.org/changeset/base/198583

Log:
  Add some magic taken from OS X and Linux to support early revision K2
  SATA controllers, like those found on the G5 Xserve.
  
  Reviewed by:	mav

Modified:
  head/sys/dev/ata/chipsets/ata-serverworks.c

Modified: head/sys/dev/ata/chipsets/ata-serverworks.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-serverworks.c	Thu Oct 29 13:27:14 2009	(r198582)
+++ head/sys/dev/ata/chipsets/ata-serverworks.c	Thu Oct 29 13:28:37 2009	(r198583)
@@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef __powerpc__
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -106,6 +109,13 @@ static int
 ata_serverworks_status(device_t dev)
 {
     struct ata_channel *ch = device_get_softc(dev);
+    struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
+
+    /*
+     * Check if this interrupt belongs to our channel.
+     */
+    if (!(ATA_INL(ctlr->r_res2, 0x1f80) & (1 << ch->unit)))
+	return (0);
 
     /*
      * We need to do a 4-byte read on the status reg before the values
@@ -208,8 +218,29 @@ ata_serverworks_ch_attach(device_t dev)
     ch->hw.tf_write = ata_serverworks_tf_write;
 #ifdef __powerpc__
     ch->hw.status = ata_serverworks_status;
+
+    /* Make sure that our interrupt is edge triggered */
+    powerpc_config_intr(bus_get_resource_start(device_get_parent(dev),
+	SYS_RES_IRQ, 0), INTR_TRIGGER_EDGE, INTR_POLARITY_HIGH);
 #endif
 
+    if (ctlr->chip->chipid == ATA_K2) {
+	/*
+	 * The revision 1 K2 SATA controller has interesting bugs. Patch them.
+	 * These magic numbers regulate interrupt delivery in the first few
+	 * cases and are pure magic in the last case.
+	 *
+	 * Values obtained from the Darwin driver.
+	 */
+
+	ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, 0x04);
+	ATA_IDX_OUTL(ch, ATA_SERROR, 0xffffffff);
+	ATA_IDX_OUTL(ch, ATA_SCONTROL, 0x00000300);
+	ATA_OUTL(ctlr->r_res2, ch_offset + 0x88, 0);
+	ATA_OUTL(ctlr->r_res2, ch_offset + 0x80,
+	    ATA_INL(ctlr->r_res2, ch_offset + 0x80) & ~0x00040000);
+    }
+
     /* chip does not reliably do 64K DMA transfers */
     ch->dma.max_iosize = 64 * DEV_BSIZE;
 

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 13:45:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E323106568D;
	Thu, 29 Oct 2009 13:45:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3364C8FC08;
	Thu, 29 Oct 2009 13:45:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TDiwrK097996;
	Thu, 29 Oct 2009 13:44:58 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TDiwTO097994;
	Thu, 29 Oct 2009 13:44:58 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200910291344.n9TDiwTO097994@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 29 Oct 2009 13:44:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198585 - head/sbin/ddb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 13:45:00 -0000

Author: jhb
Date: Thu Oct 29 13:44:58 2009
New Revision: 198585
URL: http://svn.freebsd.org/changeset/base/198585

Log:
  When extracting the capture buffer from a crashdump, only read the valid
  portion of the capture buffer (db_capture_bufoff vs db_capture_bufsize).
  This could result in outputting garbage (e.g. lots of 'p' characters if
  DIAGNOSTIC is enabled) after the end of the capture buffer.  While here,
  fix a spelling nit.
  
  Reported by:	Mikolaj Golub  to my trociny of gmail
  MFC after:	3 days

Modified:
  head/sbin/ddb/ddb_capture.c

Modified: head/sbin/ddb/ddb_capture.c
==============================================================================
--- head/sbin/ddb/ddb_capture.c	Thu Oct 29 13:41:05 2009	(r198584)
+++ head/sbin/ddb/ddb_capture.c	Thu Oct 29 13:44:58 2009	(r198585)
@@ -95,24 +95,24 @@ kread_symbol(kvm_t *kvm, int index, void
 static void
 ddb_capture_print_kvm(kvm_t *kvm)
 {
-	u_int db_capture_bufsize;
+	u_int db_capture_bufoff;
 	char *buffer, *db_capture_buf;
 
 	if (kread_symbol(kvm, X_DB_CAPTURE_BUF, &db_capture_buf,
 	    sizeof(db_capture_buf), 0) < 0)
 		errx(-1, "kvm: unable to read db_capture_buf");
 
-	if (kread_symbol(kvm, X_DB_CAPTURE_BUFSIZE, &db_capture_bufsize,
-	    sizeof(db_capture_bufsize), 0) < 0)
-		errx(-1, "kvm: unable to read db_capture_bufsize");
+	if (kread_symbol(kvm, X_DB_CAPTURE_BUFOFF, &db_capture_bufoff,
+	    sizeof(db_capture_bufoff), 0) < 0)
+		errx(-1, "kvm: unable to read db_capture_bufoff");
 
-	buffer = malloc(db_capture_bufsize + 1);
+	buffer = malloc(db_capture_bufoff + 1);
 	if (buffer == NULL)
-		err(-1, "malloc: db_capture_bufsize (%u)",
-		    db_capture_bufsize);
-	bzero(buffer, db_capture_bufsize + 1);
+		err(-1, "malloc: db_capture_bufoff (%u)",
+		    db_capture_bufoff);
+	bzero(buffer, db_capture_bufoff + 1);
 
-	if (kread(kvm, db_capture_buf, buffer, db_capture_bufsize, 0) < 0)
+	if (kread(kvm, db_capture_buf, buffer, db_capture_bufoff, 0) < 0)
 		errx(-1, "kvm: unable to read buffer");
 
 	printf("%s\n", buffer);
@@ -161,7 +161,7 @@ ddb_capture_status_kvm(kvm_t *kvm)
 		errx(-1, "kvm: unable to read db_capture_bufsize");
 	if (kread_symbol(kvm, X_DB_CAPTURE_INPROGRESS,
 	    &db_capture_inprogress, sizeof(db_capture_inprogress), 0) < 0)
-		err(-1, "kvm: unable to read db_capture_inpgoress");
+		err(-1, "kvm: unable to read db_capture_inprogress");
 	printf("%u/%u bytes used\n", db_capture_bufoff, db_capture_bufsize);
 	if (db_capture_inprogress)
 		printf("capture is on\n");

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 13:45:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 95281106568D;
	Thu, 29 Oct 2009 13:45:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 847D18FC1F;
	Thu, 29 Oct 2009 13:45:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TDjXER098055;
	Thu, 29 Oct 2009 13:45:33 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TDjXAV098053;
	Thu, 29 Oct 2009 13:45:33 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200910291345.n9TDjXAV098053@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 29 Oct 2009 13:45:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198586 - head/usr.sbin/crashinfo
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 13:45:33 -0000

Author: jhb
Date: Thu Oct 29 13:45:33 2009
New Revision: 198586
URL: http://svn.freebsd.org/changeset/base/198586

Log:
  Include the output of the ddb(4) capture buffer.
  
  Submitted by:	Mikolaj Golub  to my trociny of gmail
  MFC after:	3 days

Modified:
  head/usr.sbin/crashinfo/crashinfo.sh

Modified: head/usr.sbin/crashinfo/crashinfo.sh
==============================================================================
--- head/usr.sbin/crashinfo/crashinfo.sh	Thu Oct 29 13:44:58 2009	(r198585)
+++ head/usr.sbin/crashinfo/crashinfo.sh	Thu Oct 29 13:45:33 2009	(r198586)
@@ -304,3 +304,10 @@ echo "----------------------------------
 echo "kernel config"
 echo
 config -x $KERNEL
+
+echo
+echo "------------------------------------------------------------------------"
+echo "ddb capture buffer"
+echo
+
+ddb capture -M $VMCORE -N $KERNEL print

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 13:52:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7E0B6106566B;
	Thu, 29 Oct 2009 13:52:34 +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 6D9048FC1E;
	Thu, 29 Oct 2009 13:52:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TDqY8h098258;
	Thu, 29 Oct 2009 13:52:34 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TDqYCT098256;
	Thu, 29 Oct 2009 13:52:34 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910291352.n9TDqYCT098256@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 29 Oct 2009 13:52:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198587 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 13:52:34 -0000

Author: mav
Date: Thu Oct 29 13:52:34 2009
New Revision: 198587
URL: http://svn.freebsd.org/changeset/base/198587

Log:
  Define identify fields described in CF specification.

Modified:
  head/sys/sys/ata.h

Modified: head/sys/sys/ata.h
==============================================================================
--- head/sys/sys/ata.h	Thu Oct 29 13:45:33 2009	(r198586)
+++ head/sys/sys/ata.h	Thu Oct 29 13:52:34 2009	(r198587)
@@ -226,7 +226,11 @@ struct ata_params {
 /*128*/ u_int16_t       security_status;
 	u_int16_t       reserved129[31];
 /*160*/ u_int16_t       cfa_powermode1;
-	u_int16_t       reserved161[15];
+	u_int16_t       reserved161;
+/*162*/ u_int16_t       cfa_kms_support;
+/*163*/ u_int16_t       cfa_trueide_modes;
+/*164*/ u_int16_t       cfa_memory_modes;
+	u_int16_t       reserved165[11];
 /*176*/ u_int8_t        media_serial[60];
 /*206*/ u_int16_t       sct;
 	u_int16_t       reserved206[2];

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 14:22:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 728021065693;
	Thu, 29 Oct 2009 14:22:09 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 619CE8FC1C;
	Thu, 29 Oct 2009 14:22:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TEM9rw098993;
	Thu, 29 Oct 2009 14:22:09 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TEM9iL098991;
	Thu, 29 Oct 2009 14:22:09 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910291422.n9TEM9iL098991@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Thu, 29 Oct 2009 14:22:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198588 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 14:22:09 -0000

Author: nwhitehorn
Date: Thu Oct 29 14:22:09 2009
New Revision: 198588
URL: http://svn.freebsd.org/changeset/base/198588

Log:
  Turn off Altivec data-stream prefetching before going into power-save
  mode on those CPUs that need it.

Modified:
  head/sys/powerpc/aim/machdep.c

Modified: head/sys/powerpc/aim/machdep.c
==============================================================================
--- head/sys/powerpc/aim/machdep.c	Thu Oct 29 13:52:34 2009	(r198587)
+++ head/sys/powerpc/aim/machdep.c	Thu Oct 29 14:22:09 2009	(r198588)
@@ -897,8 +897,10 @@ void
 cpu_idle(int busy)
 {
 	uint32_t msr;
+	uint16_t vers;
 
 	msr = mfmsr();
+	vers = mfpvr() >> 16;
 
 #ifdef INVARIANTS
 	if ((msr & PSL_EE) != PSL_EE) {
@@ -908,9 +910,25 @@ cpu_idle(int busy)
 	}
 #endif
 	if (powerpc_pow_enabled) {
-		powerpc_sync();
-		mtmsr(msr | PSL_POW);
-		isync();
+		switch (vers) {
+		case IBM970:
+		case IBM970FX:
+		case IBM970MP:
+		case MPC7447A:
+		case MPC7448:
+		case MPC7450:
+		case MPC7455:
+		case MPC7457:
+			__asm __volatile("\
+			    dssall; sync; mtmsr %0; isync"
+			    :: "r"(msr | PSL_POW));
+			break;
+		default:
+			powerpc_sync();
+			mtmsr(msr | PSL_POW);
+			isync();
+			break;
+		}
 	}
 }
 

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 14:34:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 463501065700;
	Thu, 29 Oct 2009 14:34:25 +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 35A7B8FC0C;
	Thu, 29 Oct 2009 14:34:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TEYO89099390;
	Thu, 29 Oct 2009 14:34:24 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TEYOVJ099388;
	Thu, 29 Oct 2009 14:34:24 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200910291434.n9TEYOVJ099388@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 29 Oct 2009 14:34:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198590 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 14:34:25 -0000

Author: kib
Date: Thu Oct 29 14:34:24 2009
New Revision: 198590
URL: http://svn.freebsd.org/changeset/base/198590

Log:
  Trapsignal() calls kern_sigprocmask() when delivering catched signal
  with proc lock held.
  
  Reported and tested by:	Mykola Dzham  freebsd at levsha org ua
  MFC after:	1 month

Modified:
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_sig.c
==============================================================================
--- head/sys/kern/kern_sig.c	Thu Oct 29 14:34:02 2009	(r198589)
+++ head/sys/kern/kern_sig.c	Thu Oct 29 14:34:24 2009	(r198590)
@@ -1863,7 +1863,8 @@ trapsignal(struct thread *td, ksiginfo_t
 		if (!SIGISMEMBER(ps->ps_signodefer, sig)) {
 			SIGEMPTYSET(mask);
 			SIGADDSET(mask, sig);
-			kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, 0);
+			kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
+			    SIGPROCMASK_PROC_LOCKED);
 		}
 		if (SIGISMEMBER(ps->ps_sigreset, sig)) {
 			/*

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 14:53:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F41671065676;
	Thu, 29 Oct 2009 14:53:45 +0000 (UTC)
	(envelope-from emaste@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E373E8FC0A;
	Thu, 29 Oct 2009 14:53:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TErjrp099931;
	Thu, 29 Oct 2009 14:53:45 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TErjJu099928;
	Thu, 29 Oct 2009 14:53:45 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <200910291453.n9TErjJu099928@svn.freebsd.org>
From: Ed Maste 
Date: Thu, 29 Oct 2009 14:53:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198593 - head/sys/dev/aac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 14:53:46 -0000

Author: emaste
Date: Thu Oct 29 14:53:45 2009
New Revision: 198593
URL: http://svn.freebsd.org/changeset/base/198593

Log:
  Rename aac_fast_intr to aac_filter to reflect its current use.  Eliminate
  the fallback of using the filter as an interrupt handler, as it is no
  longer needed.
  
  Discussed with:	scottl, jhb

Modified:
  head/sys/dev/aac/aac.c
  head/sys/dev/aac/aacvar.h

Modified: head/sys/dev/aac/aac.c
==============================================================================
--- head/sys/dev/aac/aac.c	Thu Oct 29 14:52:32 2009	(r198592)
+++ head/sys/dev/aac/aac.c	Thu Oct 29 14:53:45 2009	(r198593)
@@ -909,8 +909,11 @@ aac_new_intr(void *arg)
 	mtx_unlock(&sc->aac_io_lock);
 }
 
+/*
+ * Interrupt filter for !NEW_COMM interface.
+ */
 int
-aac_fast_intr(void *arg)
+aac_filter(void *arg)
 {
 	struct aac_softc *sc;
 	u_int16_t reason;
@@ -2032,18 +2035,11 @@ aac_setup_intr(struct aac_softc *sc)
 		}
 	} else {
 		if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
-				   INTR_TYPE_BIO, aac_fast_intr, NULL,
+				   INTR_TYPE_BIO, aac_filter, NULL,
 				   sc, &sc->aac_intr)) {
 			device_printf(sc->aac_dev,
-				      "can't set up FAST interrupt\n");
-			if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
-					   INTR_MPSAFE|INTR_TYPE_BIO,
-					   NULL, (driver_intr_t *)aac_fast_intr,
-					   sc, &sc->aac_intr)) {
-				device_printf(sc->aac_dev,
-					     "can't set up MPSAFE interrupt\n");
-				return (EINVAL);
-			}
+				      "can't set up interrupt filter\n");
+			return (EINVAL);
 		}
 	}
 	return (0);

Modified: head/sys/dev/aac/aacvar.h
==============================================================================
--- head/sys/dev/aac/aacvar.h	Thu Oct 29 14:52:32 2009	(r198592)
+++ head/sys/dev/aac/aacvar.h	Thu Oct 29 14:53:45 2009	(r198593)
@@ -448,7 +448,7 @@ extern int		aac_shutdown(device_t dev);
 extern int		aac_suspend(device_t dev); 
 extern int		aac_resume(device_t dev);
 extern void		aac_new_intr(void *arg);
-extern int		aac_fast_intr(void *arg);
+extern int		aac_filter(void *arg);
 extern void		aac_submit_bio(struct bio *bp);
 extern void		aac_biodone(struct bio *bp);
 extern void		aac_startio(struct aac_softc *sc);

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 15:59:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A4532106566B;
	Thu, 29 Oct 2009 15:59:28 +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 93C268FC14;
	Thu, 29 Oct 2009 15:59:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TFxRBb002291;
	Thu, 29 Oct 2009 15:59:27 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TFxRXN002288;
	Thu, 29 Oct 2009 15:59:27 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910291559.n9TFxRXN002288@svn.freebsd.org>
From: Christian Brueffer 
Date: Thu, 29 Oct 2009 15:59:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198609 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 15:59:28 -0000

Author: brueffer
Date: Thu Oct 29 15:59:27 2009
New Revision: 198609
URL: http://svn.freebsd.org/changeset/base/198609

Log:
  Revert part of r198363, there is no "device cam", it is
  included in "device scbus".
  
  MFC after:	3 days

Modified:
  head/share/man/man4/atapicam.4
  head/share/man/man4/umass.4

Modified: head/share/man/man4/atapicam.4
==============================================================================
--- head/share/man/man4/atapicam.4	Thu Oct 29 15:55:58 2009	(r198608)
+++ head/share/man/man4/atapicam.4	Thu Oct 29 15:59:27 2009	(r198609)
@@ -39,7 +39,6 @@ place the following lines in your
 kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "device scbus"
-.Cd "device cam"
 .Cd "device ata"
 .Cd "device atapicam"
 .Ed

Modified: head/share/man/man4/umass.4
==============================================================================
--- head/share/man/man4/umass.4	Thu Oct 29 15:55:58 2009	(r198608)
+++ head/share/man/man4/umass.4	Thu Oct 29 15:59:27 2009	(r198609)
@@ -39,7 +39,6 @@ place the following line in your
 kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "device scbus"
-.Cd "device cam"
 .Cd "device usb"
 .Cd "device umass"
 .Ed

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 17:14:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D90F8106566B;
	Thu, 29 Oct 2009 17:14:18 +0000 (UTC)
	(envelope-from emaste@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C8DBA8FC1D;
	Thu, 29 Oct 2009 17:14:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9THEI2g004430;
	Thu, 29 Oct 2009 17:14:18 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9THEIS9004427;
	Thu, 29 Oct 2009 17:14:18 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <200910291714.n9THEIS9004427@svn.freebsd.org>
From: Ed Maste 
Date: Thu, 29 Oct 2009 17:14:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198617 - head/sys/dev/aac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 17:14:18 -0000

Author: emaste
Date: Thu Oct 29 17:14:18 2009
New Revision: 198617
URL: http://svn.freebsd.org/changeset/base/198617

Log:
  Rename aac_srb32 to aac_srb, to match Adaptec's vendor driver.

Modified:
  head/sys/dev/aac/aac_cam.c
  head/sys/dev/aac/aacreg.h

Modified: head/sys/dev/aac/aac_cam.c
==============================================================================
--- head/sys/dev/aac/aac_cam.c	Thu Oct 29 16:39:27 2009	(r198616)
+++ head/sys/dev/aac/aac_cam.c	Thu Oct 29 17:14:18 2009	(r198617)
@@ -211,7 +211,7 @@ aac_cam_action(struct cam_sim *sim, unio
 {
 	struct	aac_cam *camsc;
 	struct	aac_softc *sc;
-	struct	aac_srb32 *srb;
+	struct	aac_srb *srb;
 	struct	aac_fib *fib;
 	struct	aac_command *cm;
 
@@ -351,7 +351,7 @@ aac_cam_action(struct cam_sim *sim, unio
 	}
 
 	fib = cm->cm_fib;
-	srb = (struct aac_srb32 *)&fib->data[0];
+	srb = (struct aac_srb *)&fib->data[0];
 	cm->cm_datalen = 0;
 
 	switch (ccb->ccb_h.flags & CAM_DIR_MASK) {
@@ -459,7 +459,7 @@ aac_cam_action(struct cam_sim *sim, unio
 	    AAC_FIBSTATE_REXPECTED	|
 	    AAC_FIBSTATE_NORM;
 	fib->Header.Size = sizeof(struct aac_fib_header) +
-	    sizeof(struct aac_srb32);
+	    sizeof(struct aac_srb);
 
 	aac_enqueue_ready(cm);
 	aac_startio(cm->cm_sc);

Modified: head/sys/dev/aac/aacreg.h
==============================================================================
--- head/sys/dev/aac/aacreg.h	Thu Oct 29 16:39:27 2009	(r198616)
+++ head/sys/dev/aac/aacreg.h	Thu Oct 29 17:14:18 2009	(r198617)
@@ -1363,7 +1363,7 @@ struct aac_close_command {
 /*
  * SCSI Passthrough structures
  */
-struct aac_srb32 {
+struct aac_srb {
 	u_int32_t		function;
 	u_int32_t		bus;
 	u_int32_t		target;

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 17:21:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BDC8A106566B;
	Thu, 29 Oct 2009 17:21:41 +0000 (UTC)
	(envelope-from emaste@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AD9F48FC18;
	Thu, 29 Oct 2009 17:21:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9THLfNm004664;
	Thu, 29 Oct 2009 17:21:41 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9THLf6W004662;
	Thu, 29 Oct 2009 17:21:41 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <200910291721.n9THLf6W004662@svn.freebsd.org>
From: Ed Maste 
Date: Thu, 29 Oct 2009 17:21:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198619 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 17:21:41 -0000

Author: emaste
Date: Thu Oct 29 17:21:41 2009
New Revision: 198619
URL: http://svn.freebsd.org/changeset/base/198619

Log:
  Add additional featuresState.fBits entries to simplify compiling and
  testing Adaptec's vendor driver.
  
  Submitted by:	Adaptec, driver 17517

Modified:
  head/sys/sys/aac_ioctl.h

Modified: head/sys/sys/aac_ioctl.h
==============================================================================
--- head/sys/sys/aac_ioctl.h	Thu Oct 29 17:15:22 2009	(r198618)
+++ head/sys/sys/aac_ioctl.h	Thu Oct 29 17:21:41 2009	(r198619)
@@ -192,7 +192,10 @@ struct aac_query_disk {
 typedef union {
 	struct {
 		u_int32_t largeLBA  : 1;	/* disk support greater 2TB */
-		u_int32_t fReserved : 31;
+		u_int32_t IoctlBuf  : 1;	/* ARCIOCTL call support */
+		u_int32_t AIFSupport: 1;	/* AIF support */
+		u_int32_t JBODSupport:1;	/* fw + driver support JBOD */
+		u_int32_t fReserved : 28;
 	} fBits;
 	u_int32_t fValue;
 } featuresState;

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 17:34:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 246F61065679;
	Thu, 29 Oct 2009 17:34:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 13F218FC0C;
	Thu, 29 Oct 2009 17:34:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9THY27E004989;
	Thu, 29 Oct 2009 17:34:02 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9THY2VT004987;
	Thu, 29 Oct 2009 17:34:02 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200910291734.n9THY2VT004987@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 29 Oct 2009 17:34:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198620 - head/usr.bin/vmstat
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 17:34:03 -0000

Author: jhb
Date: Thu Oct 29 17:34:02 2009
New Revision: 198620
URL: http://svn.freebsd.org/changeset/base/198620

Log:
  When fetching sum stats (vmstat -s) from a crash dump, fetch per-CPU counts
  and sum them to form the total counts.
  
  PR:		bin/135893
  Submitted by:	Mikolaj Golub  to my trociny of gmail
  MFC after:	1 week

Modified:
  head/usr.bin/vmstat/vmstat.c

Modified: head/usr.bin/vmstat/vmstat.c
==============================================================================
--- head/usr.bin/vmstat/vmstat.c	Thu Oct 29 17:21:41 2009	(r198619)
+++ head/usr.bin/vmstat/vmstat.c	Thu Oct 29 17:34:02 2009	(r198620)
@@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -418,10 +419,90 @@ getuptime(void)
 }
 
 static void
+fill_pcpu(struct pcpu ***pcpup, int* maxcpup)
+{
+	struct pcpu **pcpu;
+	
+	int maxcpu, size, i;
+
+	*pcpup = NULL;
+	
+	if (kd == NULL)
+		return;
+
+	maxcpu = kvm_getmaxcpu(kd);
+	if (maxcpu < 0)
+		errx(1, "kvm_getmaxcpu: %s", kvm_geterr(kd));
+
+	pcpu = calloc(maxcpu, sizeof(struct pcpu *));
+	if (pcpu == NULL)
+		err(1, "calloc");
+
+	for (i = 0; i < maxcpu; i++) {
+		pcpu[i] = kvm_getpcpu(kd, i);
+		if (pcpu[i] == (struct pcpu *)-1)
+			errx(1, "kvm_getpcpu: %s", kvm_geterr(kd));
+	}
+
+	*maxcpup = maxcpu;
+	*pcpup = pcpu;
+}
+
+static void
+free_pcpu(struct pcpu **pcpu, int maxcpu)
+{
+	int i;
+
+	for (i = 0; i < maxcpu; i++)
+		free(pcpu[i]);
+	free(pcpu);
+}
+
+static void
 fill_vmmeter(struct vmmeter *vmmp)
 {
+	struct pcpu **pcpu;
+	int maxcpu, i;
+
 	if (kd != NULL) {
 		kread(X_SUM, vmmp, sizeof(*vmmp));
+		fill_pcpu(&pcpu, &maxcpu);
+		for (i = 0; i < maxcpu; i++) {
+			if (pcpu[i] == NULL)
+				continue;
+#define ADD_FROM_PCPU(i, name) \
+			vmmp->name += pcpu[i]->pc_cnt.name
+			ADD_FROM_PCPU(i, v_swtch);
+			ADD_FROM_PCPU(i, v_trap);
+			ADD_FROM_PCPU(i, v_syscall);
+			ADD_FROM_PCPU(i, v_intr);
+			ADD_FROM_PCPU(i, v_soft);
+			ADD_FROM_PCPU(i, v_vm_faults);
+			ADD_FROM_PCPU(i, v_cow_faults);
+			ADD_FROM_PCPU(i, v_cow_optim);
+			ADD_FROM_PCPU(i, v_zfod);
+			ADD_FROM_PCPU(i, v_ozfod);
+			ADD_FROM_PCPU(i, v_swapin);
+			ADD_FROM_PCPU(i, v_swapout);
+			ADD_FROM_PCPU(i, v_swappgsin);
+			ADD_FROM_PCPU(i, v_swappgsout);
+			ADD_FROM_PCPU(i, v_vnodein);
+			ADD_FROM_PCPU(i, v_vnodeout);
+			ADD_FROM_PCPU(i, v_vnodepgsin);
+			ADD_FROM_PCPU(i, v_vnodepgsout);
+			ADD_FROM_PCPU(i, v_intrans);
+			ADD_FROM_PCPU(i, v_tfree);
+			ADD_FROM_PCPU(i, v_forks);
+			ADD_FROM_PCPU(i, v_vforks);
+			ADD_FROM_PCPU(i, v_rforks);
+			ADD_FROM_PCPU(i, v_kthreads);
+			ADD_FROM_PCPU(i, v_forkpages);
+			ADD_FROM_PCPU(i, v_vforkpages);
+			ADD_FROM_PCPU(i, v_rforkpages);
+			ADD_FROM_PCPU(i, v_kthreadpages);
+#undef ADD_FROM_PCPU
+		}
+		free_pcpu(pcpu, maxcpu);
 	} else {
 		size_t size = sizeof(unsigned int);
 #define GET_VM_STATS(cat, name) \

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 17:40:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D1D78106566C;
	Thu, 29 Oct 2009 17:40:33 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B69538FC1A;
	Thu, 29 Oct 2009 17:40:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9THeX54005158;
	Thu, 29 Oct 2009 17:40:33 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9THeXTs005156;
	Thu, 29 Oct 2009 17:40:33 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <200910291740.n9THeXTs005156@svn.freebsd.org>
From: Michael Tuexen 
Date: Thu, 29 Oct 2009 17:40:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198621 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 17:40:34 -0000

Author: tuexen
Date: Thu Oct 29 17:40:33 2009
New Revision: 198621
URL: http://svn.freebsd.org/changeset/base/198621

Log:
  Improve round robin stream scheduler and cleanup some code.
  
  Approved by: rrs (mentor)
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Thu Oct 29 17:34:02 2009	(r198620)
+++ head/sys/netinet/sctp_output.c	Thu Oct 29 17:40:33 2009	(r198621)
@@ -5605,13 +5605,10 @@ sctp_insert_on_wheel(struct sctp_tcb *st
 	if (holds_lock == 0) {
 		SCTP_TCB_SEND_LOCK(stcb);
 	}
-	if ((strq->next_spoke.tqe_next) ||
-	    (strq->next_spoke.tqe_prev)) {
-		/* already on wheel */
-		goto outof_here;
+	if ((strq->next_spoke.tqe_next == NULL) &&
+	    (strq->next_spoke.tqe_prev == NULL)) {
+		TAILQ_INSERT_TAIL(&asoc->out_wheel, strq, next_spoke);
 	}
-	TAILQ_INSERT_TAIL(&asoc->out_wheel, strq, next_spoke);
-outof_here:
 	if (holds_lock == 0) {
 		SCTP_TCB_SEND_UNLOCK(stcb);
 	}
@@ -5624,19 +5621,26 @@ sctp_remove_from_wheel(struct sctp_tcb *
     int holds_lock)
 {
 	/* take off and then setup so we know it is not on the wheel */
-	if (holds_lock == 0)
+	if (holds_lock == 0) {
 		SCTP_TCB_SEND_LOCK(stcb);
-	if (TAILQ_FIRST(&strq->outqueue)) {
-		/* more was added */
-		if (holds_lock == 0)
-			SCTP_TCB_SEND_UNLOCK(stcb);
-		return;
 	}
-	TAILQ_REMOVE(&asoc->out_wheel, strq, next_spoke);
-	strq->next_spoke.tqe_next = NULL;
-	strq->next_spoke.tqe_prev = NULL;
-	if (holds_lock == 0)
+	if (TAILQ_EMPTY(&strq->outqueue)) {
+		if (asoc->last_out_stream == strq) {
+			asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, next_spoke);
+			if (asoc->last_out_stream == NULL) {
+				asoc->last_out_stream = TAILQ_LAST(&asoc->out_wheel, sctpwheel_listhead);
+			}
+			if (asoc->last_out_stream == strq) {
+				asoc->last_out_stream = NULL;
+			}
+		}
+		TAILQ_REMOVE(&asoc->out_wheel, strq, next_spoke);
+		strq->next_spoke.tqe_next = NULL;
+		strq->next_spoke.tqe_prev = NULL;
+	}
+	if (holds_lock == 0) {
 		SCTP_TCB_SEND_UNLOCK(stcb);
+	}
 }
 
 static void
@@ -7185,7 +7189,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb
     struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now)
 {
 	struct sctp_association *asoc;
-	struct sctp_stream_out *strq, *strqn, *strqt;
+	struct sctp_stream_out *strq, *strqn;
 	int goal_mtu, moved_how_much, total_moved = 0, bail = 0;
 	int locked, giveup;
 	struct sctp_stream_queue_pending *sp;
@@ -7261,11 +7265,10 @@ sctp_fill_outqueue(struct sctp_tcb *stcb
 				break;
 		} else {
 			asoc->locked_on_sending = NULL;
-			strqt = sctp_select_a_stream(stcb, asoc);
-			if (TAILQ_FIRST(&strq->outqueue) == NULL) {
+			if (TAILQ_EMPTY(&strq->outqueue)) {
 				if (strq == strqn) {
 					/* Must move start to next one */
-					strqn = TAILQ_NEXT(asoc->last_out_stream, next_spoke);
+					strqn = TAILQ_NEXT(strq, next_spoke);
 					if (strqn == NULL) {
 						strqn = TAILQ_FIRST(&asoc->out_wheel);
 						if (strqn == NULL) {
@@ -7278,7 +7281,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb
 			if ((giveup) || bail) {
 				break;
 			}
-			strq = strqt;
+			strq = sctp_select_a_stream(stcb, asoc);
 			if (strq == NULL) {
 				break;
 			}

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 18:03:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 913B31065670;
	Thu, 29 Oct 2009 18:03:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7FB9B8FC0C;
	Thu, 29 Oct 2009 18:03:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TI3GXe005659;
	Thu, 29 Oct 2009 18:03:16 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TI3GXQ005657;
	Thu, 29 Oct 2009 18:03:16 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200910291803.n9TI3GXQ005657@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 29 Oct 2009 18:03:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198622 - head/sys/dev/acpi_support
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 18:03:16 -0000

Author: jhb
Date: Thu Oct 29 18:03:16 2009
New Revision: 198622
URL: http://svn.freebsd.org/changeset/base/198622

Log:
  - Numerous whitespace and style fixes.
  - More descriptive error messages when failing to parse components during
    attach.

Modified:
  head/sys/dev/acpi_support/acpi_aiboost.c

Modified: head/sys/dev/acpi_support/acpi_aiboost.c
==============================================================================
--- head/sys/dev/acpi_support/acpi_aiboost.c	Thu Oct 29 17:40:33 2009	(r198621)
+++ head/sys/dev/acpi_support/acpi_aiboost.c	Thu Oct 29 18:03:16 2009	(r198622)
@@ -41,23 +41,25 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#define _COMPONENT	ACPI_OEM
+#define	_COMPONENT	ACPI_OEM
 ACPI_MODULE_NAME("AIBOOST")
 
-#define DESCSTRLEN 32
-struct acpi_aiboost_element{
+#define	DESCSTRLEN	32
+
+struct acpi_aiboost_element {
 	uint32_t id;
-	char desc[DESCSTRLEN];
+	char	desc[DESCSTRLEN];
 };
+
 ACPI_SERIAL_DECL(aiboost, "ACPI AIBOOST");
-/**/
-struct acpi_aiboost_component{
-	unsigned int num;
-	struct acpi_aiboost_element elem[1];
+
+struct acpi_aiboost_component {
+	u_int	num;
+	struct acpi_aiboost_element elem[0];
 };
 
 struct acpi_aiboost_softc {
-	int pid;
+	int	pid;
 	struct acpi_aiboost_component *temp;
 	struct acpi_aiboost_component *volt;
 	struct acpi_aiboost_component *fan;
@@ -65,7 +67,7 @@ struct acpi_aiboost_softc {
 
 static int	acpi_aiboost_probe(device_t dev);
 static int	acpi_aiboost_attach(device_t dev);
-static int 	acpi_aiboost_detach(device_t dev);
+static int	acpi_aiboost_detach(device_t dev);
 
 static device_method_t acpi_aiboost_methods[] = {
 	/* Device interface */
@@ -85,46 +87,56 @@ static driver_t	acpi_aiboost_driver = {
 static devclass_t acpi_aiboost_devclass;
 
 DRIVER_MODULE(acpi_aiboost, acpi, acpi_aiboost_driver, acpi_aiboost_devclass,
-	      0, 0);
+    0, 0);
 MODULE_DEPEND(acpi_aiboost, acpi, 1, 1, 1);
+
 static char    *abs_id[] = {"ATK0110", NULL};
 
-/*VSIF, RVLT, SVLT,  TSIF, RTMP, STMP FSIF, RFAN, SFAN */
+/* VSIF, RVLT, SVLT, TSIF, RTMP, STMP, FSIF, RFAN, SFAN */
 
-static ACPI_STATUS acpi_aiboost_getcomponent(device_t dev, char *name, struct  acpi_aiboost_component **comp)
+static ACPI_STATUS
+acpi_aiboost_getcomponent(device_t dev, char *name,
+    struct acpi_aiboost_component **comp)
 {
-	ACPI_BUFFER		buf, buf2;
-	ACPI_OBJECT            *o,*elem,*subobj;
+	ACPI_BUFFER buf, buf2;
+	ACPI_OBJECT *elem, *o, *subobj;
 	ACPI_STATUS status;
-	struct acpi_aiboost_component *c = NULL;
-
+	struct acpi_aiboost_component *c;
 	int i;
 
+	c = NULL;
 	buf.Pointer = NULL;
 	buf.Length = ACPI_ALLOCATE_BUFFER;
 	buf2.Pointer = NULL;
-
 	status = AcpiEvaluateObject(acpi_get_handle(dev), name, NULL, &buf);
-	
-	if(ACPI_FAILURE(status))
-		return status;
-	
+
+	if (ACPI_FAILURE(status))
+		return (status);
+
 	o = buf.Pointer;
-	if(o->Type != ACPI_TYPE_PACKAGE)
+	if (o->Type != ACPI_TYPE_PACKAGE) {
+		device_printf(dev, "%s is not a package\n", name);
 		goto error;
-	
+	}
+
 	elem = o->Package.Elements;
-	if(elem->Type != ACPI_TYPE_INTEGER)
+	if (elem->Type != ACPI_TYPE_INTEGER) {
+		device_printf(dev, "First item in %s is not a count\n", name);
 		goto error;
+	}
 
-	c = malloc(sizeof(struct acpi_aiboost_component)
-		   + sizeof(struct acpi_aiboost_element)
-		   * (elem->Integer.Value -1),
-		   M_DEVBUF, M_ZERO|M_WAITOK);
+	if (elem->Integer.Value != o->Package.Count - 1) {
+		device_printf(dev, "Device count mismatch in %s\n", name);
+		goto error;
+	}
+
+	c = malloc(sizeof(struct acpi_aiboost_component) +
+	    sizeof(struct acpi_aiboost_element) * elem->Integer.Value, M_DEVBUF,
+	    M_WAITOK | M_ZERO);
 	*comp = c;
 	c->num = elem->Integer.Value;
-	
-	for(i = 1 ; i < o->Package.Count; i++){
+
+	for (i = 1; i < o->Package.Count; i++) {
 		elem = &o->Package.Elements[i];
 		if (elem->Type == ACPI_TYPE_ANY) {
 			buf2.Pointer = NULL;
@@ -132,196 +144,195 @@ static ACPI_STATUS acpi_aiboost_getcompo
 
 			status = AcpiEvaluateObject(elem->Reference.Handle,
 			    NULL, NULL, &buf2);
-			if (ACPI_FAILURE(status)){
-				printf("FETCH OBJECT\n");
+			if (ACPI_FAILURE(status)) {
+				device_printf(dev,
+				    "Failed to fetch object for %s\n", name);
 				goto error;
 			}
 			subobj = buf2.Pointer;
 		} else if (elem->Type == ACPI_TYPE_PACKAGE)
 			subobj = elem;
 		else {
-			printf("NO PACKAGE\n");
+			device_printf(dev,
+			    "Subitem %d was not a package for %s\n", i, name);
 			goto error;
 		}
-		if(ACPI_FAILURE(acpi_PkgInt32(subobj,0, &c->elem[i -1].id))){
-			printf("ID FAILED\n");
+		status = acpi_PkgInt32(subobj, 0, &c->elem[i - 1].id);
+		if (ACPI_FAILURE(status)) {
+			device_printf(dev,
+			    "Failed to fetch ID for subobject %d in %s\n", i,
+			    name);
 			goto error;
 		}
-		status = acpi_PkgStr(subobj, 1, c->elem[i - 1].desc, 
-				     sizeof(c->elem[i - 1].desc));
-		if(ACPI_FAILURE(status)){
-			if(status == E2BIG){
+		status = acpi_PkgStr(subobj, 1, c->elem[i - 1].desc,
+		    sizeof(c->elem[i - 1].desc));
+		if (ACPI_FAILURE(status)){
+			if (status == E2BIG) {
 				c->elem[i - 1].desc[DESCSTRLEN-1] = 0;
-			}else{
-				printf("DESC FAILED %d\n", i-1);
+			} else {
+				device_printf(dev,
+		    "Failed to fetch description for subobject %d in %s\n",
+				    i, name);
 				goto error;
 			}
 		}
-		
+
 		if (buf2.Pointer) {
 			AcpiOsFree(buf2.Pointer);
 			buf2.Pointer = NULL;
 		}
 	}
 
-	if(buf.Pointer)
+	if (buf.Pointer)
 		AcpiOsFree(buf.Pointer);
 
-	return 0;
+	return (0);
 
- error:
-	printf("BAD DATA\n");
-	if(buf.Pointer)
+error:
+	if (buf.Pointer)
 		AcpiOsFree(buf.Pointer);
-	if(buf2.Pointer)
+	if (buf2.Pointer)
 		AcpiOsFree(buf2.Pointer);
-	if(c)
+	if (c)
 		free(c, M_DEVBUF);
-	return AE_BAD_DATA;
+	return (AE_BAD_DATA);
 }
 
-static int 
+static int
 acpi_aiboost_get_value(ACPI_HANDLE handle, char *path, UINT32 number)
 {
 	ACPI_OBJECT arg1, *ret;
 	ACPI_OBJECT_LIST args;
 	ACPI_BUFFER buf;
-	buf.Length = ACPI_ALLOCATE_BUFFER;
-	buf.Pointer = 0;
 	int val;
 
 	arg1.Type = ACPI_TYPE_INTEGER;
 	arg1.Integer.Value = number;
 	args.Count = 1;
 	args.Pointer = &arg1;
-
-	if(ACPI_FAILURE(AcpiEvaluateObject(handle, path, &args, &buf))){
-		return -1;
-	}
+	buf.Length = ACPI_ALLOCATE_BUFFER;
+	buf.Pointer = NULL;
+	if (ACPI_FAILURE(AcpiEvaluateObject(handle, path, &args, &buf)))
+		return (-1);
 
 	ret = buf.Pointer;
-	val = (ret->Type == ACPI_TYPE_INTEGER)? ret->Integer.Value : -1;
+	if (ret->Type == ACPI_TYPE_INTEGER)
+		val = ret->Integer.Value;
+	else
+		val = -1;
 
 	AcpiOsFree(buf.Pointer);
-	return val;
+	return (val);
 }
 
 
-static int acpi_aiboost_temp_sysctl(SYSCTL_HANDLER_ARGS)
+static int
+acpi_aiboost_temp_sysctl(SYSCTL_HANDLER_ARGS)
 {
-	device_t dev = arg1;
-	int function = oidp->oid_arg2;
-	int error = 0, val;
+	device_t dev;
+	int error, val;
+
+	dev = arg1;
 	ACPI_SERIAL_BEGIN(aiboost);
-	val = acpi_aiboost_get_value(acpi_get_handle(dev), "RTMP",function );
-	error = sysctl_handle_int(oidp, &val, 0 , req);
+	val = acpi_aiboost_get_value(acpi_get_handle(dev), "RTMP", arg2);
+	error = sysctl_handle_int(oidp, &val, 0, req);
 	ACPI_SERIAL_END(aiboost);
-	
-	return 0;
+	return (error);
 }
 
-static int acpi_aiboost_volt_sysctl(SYSCTL_HANDLER_ARGS)
+static int
+acpi_aiboost_volt_sysctl(SYSCTL_HANDLER_ARGS)
 {
-	device_t dev = arg1;
-	int function = oidp->oid_arg2;
-	int error = 0, val;
+	device_t dev;
+	int error, val;
+
+	dev = arg1;
 	ACPI_SERIAL_BEGIN(aiboost);
-	val = acpi_aiboost_get_value(acpi_get_handle(dev), "RVLT", function);
-	error = sysctl_handle_int(oidp, &val, 0 , req);
+	val = acpi_aiboost_get_value(acpi_get_handle(dev), "RVLT", arg2);
+	error = sysctl_handle_int(oidp, &val, 0, req);
 	ACPI_SERIAL_END(aiboost);
-	
-	return 0;
+	return (error);
 }
 
-static int acpi_aiboost_fan_sysctl(SYSCTL_HANDLER_ARGS)
+static int
+acpi_aiboost_fan_sysctl(SYSCTL_HANDLER_ARGS)
 {
-	device_t dev = arg1;
-	int function = oidp->oid_arg2;
-	int error = 0, val;
+	device_t dev;
+	int error, val;
+
+	dev = arg1;
 	ACPI_SERIAL_BEGIN(aiboost);
-	val = acpi_aiboost_get_value(acpi_get_handle(dev), "RFAN", function);
-	error = sysctl_handle_int(oidp, &val, 0 , req);
+	val = acpi_aiboost_get_value(acpi_get_handle(dev), "RFAN", arg2);
+	error = sysctl_handle_int(oidp, &val, 0, req);
 	ACPI_SERIAL_END(aiboost);
-	
-	return 0;
+	return (error);
 }
 
 static int
 acpi_aiboost_probe(device_t dev)
 {
-	int		ret = ENXIO;
 
-	if (ACPI_ID_PROBE(device_get_parent(dev), dev, abs_id)) {
-		device_set_desc(dev, "ASUStek AIBOOSTER");
-		ret = 0;
-	}
-	return (ret);
+	if (ACPI_ID_PROBE(device_get_parent(dev), dev, abs_id) == NULL)
+		return (ENXIO);
+
+	device_set_desc(dev, "ASUStek AIBOOSTER");
+	return (0);
 }
 
 static int
 acpi_aiboost_attach(device_t dev)
 {
 	struct acpi_aiboost_softc *sc;
-	char nambuf[]="tempXXX";
+	char nambuf[16];
 	int i;
 
 	sc = device_get_softc(dev);
-	if(ACPI_FAILURE(acpi_aiboost_getcomponent(dev, "TSIF", &sc->temp)))
+	if (ACPI_FAILURE(acpi_aiboost_getcomponent(dev, "TSIF", &sc->temp)))
 		goto error;
-	for(i= 0; i < sc->temp->num; i++){
-		sprintf(nambuf,"temp%d", i);
+	for (i = 0; i < sc->temp->num; i++) {
+		snprintf(nambuf, sizeof(nambuf), "temp%d", i);
 		SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
-				SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
-				OID_AUTO, nambuf,
-				CTLTYPE_INT|CTLFLAG_RD, dev, 
-				sc->temp->elem[i].id,
-				acpi_aiboost_temp_sysctl,
-				"I", sc->temp->elem[i].desc);
+		    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+		    nambuf, CTLTYPE_INT | CTLFLAG_RD, dev, sc->temp->elem[i].id,
+		    acpi_aiboost_temp_sysctl, "I", sc->temp->elem[i].desc);
 	}
-	if(ACPI_FAILURE(acpi_aiboost_getcomponent(dev, "VSIF", &sc->volt)))
-		goto error;
 
-	for(i= 0; i < sc->volt->num; i++){
-		sprintf(nambuf,"volt%d", i);
+	if (ACPI_FAILURE(acpi_aiboost_getcomponent(dev, "VSIF", &sc->volt)))
+		goto error;
+	for (i = 0; i < sc->volt->num; i++) {
+		snprintf(nambuf, sizeof(nambuf), "volt%d", i);
 		SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
-				SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
-				OID_AUTO, nambuf,
-				CTLTYPE_INT|CTLFLAG_RD, dev, 
-				sc->volt->elem[i].id,
-				acpi_aiboost_volt_sysctl,
-				"I", sc->volt->elem[i].desc);
+		    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+		    nambuf, CTLTYPE_INT | CTLFLAG_RD, dev, sc->volt->elem[i].id,
+		    acpi_aiboost_volt_sysctl, "I", sc->volt->elem[i].desc);
 	}
 
-	if(ACPI_FAILURE(acpi_aiboost_getcomponent(dev, "FSIF", &sc->fan)))
+	if (ACPI_FAILURE(acpi_aiboost_getcomponent(dev, "FSIF", &sc->fan)))
 		goto error;
-
-	for(i= 0; i < sc->fan->num; i++){
-		sprintf(nambuf,"fan%d", i);
+	for (i = 0; i < sc->fan->num; i++) {
+		snprintf(nambuf, sizeof(nambuf), "fan%d", i);
 		SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
-				SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
-				OID_AUTO, nambuf,
-				CTLTYPE_INT|CTLFLAG_RD, dev, 
-				sc->fan->elem[i].id,
-				acpi_aiboost_fan_sysctl,
-				"I", sc->fan->elem[i].desc);
+		    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+		    nambuf, CTLTYPE_INT | CTLFLAG_RD, dev, sc->fan->elem[i].id,
+		    acpi_aiboost_fan_sysctl, "I", sc->fan->elem[i].desc);
 	}
 
-	
 	return (0);
  error:
-	return EINVAL;
+	return (EINVAL);
 }
 
-static int 
+static int
 acpi_aiboost_detach(device_t dev)
 {
-	struct acpi_aiboost_softc *sc = device_get_softc(dev);
+	struct acpi_aiboost_softc *sc;
 
-	if(sc->temp)
+	sc = device_get_softc(dev);
+	if (sc->temp)
 		free(sc->temp, M_DEVBUF);
-	if(sc->volt)
+	if (sc->volt)
 		free(sc->volt, M_DEVBUF);
-	if(sc->fan)
+	if (sc->fan)
 		free(sc->fan, M_DEVBUF);
 	return (0);
 }

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 18:32:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6745D106568D;
	Thu, 29 Oct 2009 18:32:40 +0000 (UTC)
	(envelope-from peterjeremy@acm.org)
Received: from mail16.syd.optusnet.com.au (mail16.syd.optusnet.com.au
	[211.29.132.197])
	by mx1.freebsd.org (Postfix) with ESMTP id EBB738FC12;
	Thu, 29 Oct 2009 18:32:39 +0000 (UTC)
Received: from server.vk2pj.dyndns.org
	(c122-106-233-13.belrs3.nsw.optusnet.com.au [122.106.233.13])
	by mail16.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n9TIWa1g026063
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Oct 2009 05:32:37 +1100
X-Bogosity: Ham, spamicity=0.000000
Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])
	by server.vk2pj.dyndns.org (8.14.3/8.14.3) with ESMTP id n9TIWaGp009499;
	Fri, 30 Oct 2009 05:32:36 +1100 (EST)
	(envelope-from peter@server.vk2pj.dyndns.org)
Received: (from peter@localhost)
	by server.vk2pj.dyndns.org (8.14.3/8.14.3/Submit) id n9TIWabX009498;
	Fri, 30 Oct 2009 05:32:36 +1100 (EST) (envelope-from peter)
Date: Fri, 30 Oct 2009 05:32:36 +1100
From: Peter Jeremy 
To: Alexander Motin 
Message-ID: <20091029183236.GA9461@server.vk2pj.dyndns.org>
References: <200910261035.n9QAZHGR084488@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="gKMricLos+KVdGMg"
Content-Disposition: inline
In-Reply-To: <200910261035.n9QAZHGR084488@svn.freebsd.org>
X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198483 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 18:32:40 -0000


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

On 2009-Oct-26 10:35:17 +0000, Alexander Motin  wrote:
>Log:
>  Document new modularised ATA kernel options.

IMO, these either need a bit more documentation because there are
non-intuitive interdependencies, or some of the dependencies need to
be pruned.  Eg a kernel with:

device          atadisk         # ATA disk drives
device          atapicd         # ATAPI CDROM drives
options         ATA_STATIC_ID   # Static device numbering
device          atacore         # Core ATA functionality
device          atapci          # PCI bus support; only generic chipset sup=
port
device          ataahci         # AHCI SATA
device          ataati          # ATI

blows up whilst linking with:
linking kernel.debug
ata-ati.o(.text+0xe5): In function `ata_ati_probe':
/tank/src9/sys/dev/ata/chipsets/ata-ati.c:110: undefined reference to `ata_=
sii_chipinit'
*** Error code 1

--=20
Peter Jeremy

--gKMricLos+KVdGMg
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.13 (FreeBSD)

iEYEARECAAYFAkrp38QACgkQ/opHv/APuIfIBQCdE4I/QWhBkD1xh4SVnd/xrZ7H
NTMAnREoJLdyKFDVKrSPI46jA3FJNA6m
=itnk
-----END PGP SIGNATURE-----

--gKMricLos+KVdGMg--

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 19:42:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7630F1065676;
	Thu, 29 Oct 2009 19:42:28 +0000 (UTC)
	(envelope-from mavbsd@gmail.com)
Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153])
	by mx1.freebsd.org (Postfix) with ESMTP id AC0948FC0C;
	Thu, 29 Oct 2009 19:42:27 +0000 (UTC)
Received: by fg-out-1718.google.com with SMTP id 16so2258575fgg.13
	for ; Thu, 29 Oct 2009 12:42:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:message-id:date:from
	:user-agent:mime-version:to:cc:subject:references:in-reply-to
	:x-enigmail-version:content-type:content-transfer-encoding;
	bh=VsNiksbKJdEnQRS9zEWgAAqubDk91IWg7NWASgcB9Mg=;
	b=P3EvduuiTbTtr6+xbaaWB3yMdxVlJrHS87bvLlVJubmyxZfRQpgapLdeqbA+b0nrgi
	mSJhbO+NET3znr010OTCSBs7TupaA+Kn6YqWSh94cssU3Gm9GajEmT1BapSlM02e6Uiu
	oAXl8wUTfX1i+gbO39vS97Cd4PSE8QnsnvEC4=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:x-enigmail-version:content-type
	:content-transfer-encoding;
	b=Ysk0j/DBX9ox/nL78nqnWyoYQ8ihsYx1wfeORvMaqmHnU77Jj4O5F1UQArI2BN4059
	/J5iB5cbaCcg3ap4sa1wmCwRtjTUvu6mUjLR6fJFxpn6Xs48QCY16MZyXu6mPidKqYRM
	UANcr8UWNaLxtCC7CTVHdbzXUhkjrN6T3Gsus=
Received: by 10.103.126.27 with SMTP id d27mr213550mun.56.1256845346571;
	Thu, 29 Oct 2009 12:42:26 -0700 (PDT)
Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226])
	by mx.google.com with ESMTPS id t10sm1586935muh.13.2009.10.29.12.42.24
	(version=SSLv3 cipher=RC4-MD5); Thu, 29 Oct 2009 12:42:25 -0700 (PDT)
Sender: Alexander Motin 
Message-ID: <4AE9F01E.7010309@FreeBSD.org>
Date: Thu, 29 Oct 2009 21:42:22 +0200
From: Alexander Motin 
User-Agent: Thunderbird 2.0.0.23 (X11/20090901)
MIME-Version: 1.0
To: Peter Jeremy 
References: <200910261035.n9QAZHGR084488@svn.freebsd.org>
	<20091029183236.GA9461@server.vk2pj.dyndns.org>
In-Reply-To: <20091029183236.GA9461@server.vk2pj.dyndns.org>
X-Enigmail-Version: 0.96.0
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198483 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 19:42:28 -0000

Peter Jeremy wrote:
> On 2009-Oct-26 10:35:17 +0000, Alexander Motin  wrote:
>> Log:
>>  Document new modularised ATA kernel options.
> 
> IMO, these either need a bit more documentation because there are
> non-intuitive interdependencies, or some of the dependencies need to
> be pruned.

I'll check dependencies. It is the right way.

-- 
Alexander Motin

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 20:53:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 10266106566B;
	Thu, 29 Oct 2009 20:53:27 +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 F3BEB8FC08;
	Thu, 29 Oct 2009 20:53:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9TKrQJN009241;
	Thu, 29 Oct 2009 20:53:26 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9TKrQtC009239;
	Thu, 29 Oct 2009 20:53:26 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910292053.n9TKrQtC009239@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 29 Oct 2009 20:53:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198623 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 20:53:27 -0000

Author: mav
Date: Thu Oct 29 20:53:26 2009
New Revision: 198623
URL: http://svn.freebsd.org/changeset/base/198623

Log:
  Add missing ATA kernel options dependencies.
  
  MFC after:	3 days

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Thu Oct 29 18:03:16 2009	(r198622)
+++ head/sys/conf/files	Thu Oct 29 20:53:26 2009	(r198623)
@@ -520,14 +520,14 @@ dev/ata/chipsets/ata-highpoint.c	optiona
 dev/ata/chipsets/ata-intel.c	optional ata pci | ataintel
 dev/ata/chipsets/ata-ite.c	optional ata pci | ataite
 dev/ata/chipsets/ata-jmicron.c	optional ata pci | atajmicron
-dev/ata/chipsets/ata-marvell.c	optional ata pci | atamarvell
+dev/ata/chipsets/ata-marvell.c	optional ata pci | atamarvell | ataadaptec
 dev/ata/chipsets/ata-micron.c	optional ata pci | atamicron
 dev/ata/chipsets/ata-national.c	optional ata pci | atanational
 dev/ata/chipsets/ata-netcell.c	optional ata pci | atanetcell
 dev/ata/chipsets/ata-nvidia.c	optional ata pci | atanvidia
 dev/ata/chipsets/ata-promise.c	optional ata pci | atapromise
 dev/ata/chipsets/ata-serverworks.c	optional ata pci | ataserverworks
-dev/ata/chipsets/ata-siliconimage.c	optional ata pci | atasiliconimage
+dev/ata/chipsets/ata-siliconimage.c	optional ata pci | atasiliconimage | ataati
 dev/ata/chipsets/ata-sis.c	optional ata pci | atasis
 dev/ata/chipsets/ata-via.c	optional ata pci | atavia
 dev/ata/ata-disk.c		optional atadisk

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 23:08:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 822901065670;
	Thu, 29 Oct 2009 23:08:13 +0000 (UTC)
	(envelope-from keramida@freebsd.org)
Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr
	[150.140.141.169])
	by mx1.freebsd.org (Postfix) with ESMTP id E09958FC19;
	Thu, 29 Oct 2009 23:08:12 +0000 (UTC)
Received: from mail.ceid.upatras.gr (unknown [10.1.0.143])
	by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 02009EB4760;
	Fri, 30 Oct 2009 01:08:11 +0200 (EET)
Received: from localhost (europa.ceid.upatras.gr [127.0.0.1])
	by mail.ceid.upatras.gr (Postfix) with ESMTP id B25B3451BC;
	Fri, 30 Oct 2009 01:08:11 +0200 (EET)
X-Virus-Scanned: amavisd-new at ceid.upatras.gr
Received: from mail.ceid.upatras.gr ([127.0.0.1])
	by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id DQBWbQ-d6syL; Fri, 30 Oct 2009 01:08:11 +0200 (EET)
Received: from kobe.laptop (ppp-94-64-196-111.home.otenet.gr [94.64.196.111])
	by mail.ceid.upatras.gr (Postfix) with ESMTP id 5F92B451B2;
	Fri, 30 Oct 2009 01:08:11 +0200 (EET)
Received: from kobe.laptop (kobe.laptop [127.0.0.1])
	by kobe.laptop (8.14.3/8.14.3) with ESMTP id n9TN8AgA003267
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Oct 2009 01:08:10 +0200 (EET)
	(envelope-from keramida@freebsd.org)
Received: (from keramida@localhost)
	by kobe.laptop (8.14.3/8.14.3/Submit) id n9TN89r2003266;
	Fri, 30 Oct 2009 01:08:09 +0200 (EET)
	(envelope-from keramida@freebsd.org)
From: Giorgos Keramidas 
To: Konstantin Belousov 
References: <200910291434.n9TEYOVJ099388@svn.freebsd.org>
Date: Fri, 30 Oct 2009 01:08:08 +0200
In-Reply-To: <200910291434.n9TEYOVJ099388@svn.freebsd.org> (Konstantin
	Belousov's message of "Thu, 29 Oct 2009 14:34:24 +0000 (UTC)")
Message-ID: <871vklbxyf.fsf@kobe.laptop>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198590 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 23:08:13 -0000

On Thu, 29 Oct 2009 14:34:24 +0000 (UTC), Konstantin Belousov  wrote:
> Author: kib
> Date: Thu Oct 29 14:34:24 2009
> New Revision: 198590
> URL: http://svn.freebsd.org/changeset/base/198590
>
> Log:
>   Trapsignal() calls kern_sigprocmask() when delivering catched signal
>   with proc lock held.
>
>   Reported and tested by:	Mykola Dzham  freebsd at levsha org ua
>   MFC after:	1 month

Hi Konstantin,

Some of the recent kern_sig changes end up recursing on a non-recursive
mutex in kern_sigprocmask() -> reschedule_signals():

panic: _mtx_lock_sleep: recursed on non-recursive mutex sigacts @ /usr/src/sys/kern/kern_sig.c:2422
(kgdb) bt
#0  doadump () at pcpu.h:246
#1  0xc0680bee in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:416
#2  0xc0680ec2 in panic (fmt=Variable "fmt" is not available.
    ) at /usr/src/sys/kern/kern_shutdown.c:579
#3  0xc06716ea in _mtx_lock_sleep (m=0xc8154aa8, tid=3332925072, opts=0, file=0xc09bb332 "/usr/src/sys/kern/kern_sig.c", line=2422)
    at /usr/src/sys/kern/kern_mutex.c:341
#4  0xc0671907 in _mtx_lock_flags (m=0xc8154aa8, opts=0, file=0xc09bb332 "/usr/src/sys/kern/kern_sig.c", line=2422)
    at /usr/src/sys/kern/kern_mutex.c:203
#5  0xc0683434 in reschedule_signals (p=0xc71172a8, block={__bits = {0, 0, 0, 0}}) at /usr/src/sys/kern/kern_sig.c:2422
#6  0xc0683751 in kern_sigprocmask (td=0xc6a86690, how=1, set=0xe9005cd4, oset=0x0, flags=2) at /usr/src/sys/kern/kern_sig.c:1027
#7  0xc0684801 in postsig (sig=20) at /usr/src/sys/kern/kern_sig.c:2743
#8  0xc06be228 in ast (framep=0xe9005d38) at /usr/src/sys/kern/subr_trap.c:234
#9  0xc0920624 in doreti_ast () at /usr/src/sys/i386/i386/exception.s:365

I think the change that started causing this for MT applications was
change 197963 in /head that added this bit of code in kern_sig.c inside
kern_sigprocmask():

: @@ -1012,7 +1012,20 @@
:                          break;
:                  }
:          }
: -        PROC_UNLOCK(td->td_proc);
: +        /*
: +         * The new_block set contains signals that were not previosly
: +         * blocked, but are blocked now.
: +         *
: +         * In case we block any signal that was not previously blocked
: +         * for td, and process has the signal pending, try to schedule
: +         * signal delivery to some thread that does not block the signal,
: +         * possibly waking it up.
: +         */
: +        if (p->p_numthreads != 1)
: +                reschedule_signals(p, new_block);
: +
: +        PROC_UNLOCK(p);
:          return (error);

AFAICT, postsig() is called with proc->p_sigacts->ps_mtx locked, so when
we are recursing when reschedule_signals() tries to lock it once more.

Since we are holding the proc lock in kern_sigprocmask(), is it safe to
assert that we own ps_mtx, drop it and re-acquire it immediately after
calling reschedule_signals()?


From owner-svn-src-head@FreeBSD.ORG  Thu Oct 29 23:50:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0F84C106566C;
	Thu, 29 Oct 2009 23:50:56 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id A5DEE8FC24;
	Thu, 29 Oct 2009 23:50:55 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n9TNbN75019601;
	Thu, 29 Oct 2009 17:37:23 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Thu, 29 Oct 2009 17:37:34 -0600 (MDT)
Message-Id: <20091029.173734.404970008.imp@bsdimp.com>
To: nwhitehorn@freebsd.org
From: "M. Warner Losh" 
In-Reply-To: <200910291327.n9TDREeJ097506@svn.freebsd.org>
References: <200910291327.n9TDREeJ097506@svn.freebsd.org>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198582 - head/sys/dev/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 29 Oct 2009 23:50:56 -0000

In message: <200910291327.n9TDREeJ097506@svn.freebsd.org>
            Nathan Whitehorn  writes:
: +#if 0
: +#define	ATA_LEGACY_SUPPORT		/* Enable obsolete features that break
: +					 * some modern devices */
: +#endif

Shouldn't this just be a kernel option?

Warner

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 03:22:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C4A98106566B;
	Fri, 30 Oct 2009 03:22:45 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194])
	by mx1.freebsd.org (Postfix) with ESMTP id 1F2968FC14;
	Fri, 30 Oct 2009 03:22:44 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n9U3MekK043978
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Oct 2009 05:22:40 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id
	n9U3Medt089964; Fri, 30 Oct 2009 05:22:40 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n9U3Mehc089963; 
	Fri, 30 Oct 2009 05:22:40 +0200 (EET)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Fri, 30 Oct 2009 05:22:40 +0200
From: Kostik Belousov 
To: Giorgos Keramidas 
Message-ID: <20091030032240.GD2147@deviant.kiev.zoral.com.ua>
References: <200910291434.n9TEYOVJ099388@svn.freebsd.org>
	<871vklbxyf.fsf@kobe.laptop>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="IMjqdzrDRly81ofr"
Content-Disposition: inline
In-Reply-To: <871vklbxyf.fsf@kobe.laptop>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00
	autolearn=ham version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198590 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 03:22:46 -0000


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

On Fri, Oct 30, 2009 at 01:08:08AM +0200, Giorgos Keramidas wrote:
> On Thu, 29 Oct 2009 14:34:24 +0000 (UTC), Konstantin Belousov  wrote:
> > Author: kib
> > Date: Thu Oct 29 14:34:24 2009
> > New Revision: 198590
> > URL: http://svn.freebsd.org/changeset/base/198590
> >
> > Log:
> >   Trapsignal() calls kern_sigprocmask() when delivering catched signal
> >   with proc lock held.
> >
> >   Reported and tested by:	Mykola Dzham  freebsd at levsha org ua
> >   MFC after:	1 month
>=20
> Hi Konstantin,
>=20
> Some of the recent kern_sig changes end up recursing on a non-recursive
> mutex in kern_sigprocmask() -> reschedule_signals():
>=20
> panic: _mtx_lock_sleep: recursed on non-recursive mutex sigacts @ /usr/sr=
c/sys/kern/kern_sig.c:2422
> (kgdb) bt
> #0  doadump () at pcpu.h:246
> #1  0xc0680bee in boot (howto=3D260) at /usr/src/sys/kern/kern_shutdown.c=
:416
> #2  0xc0680ec2 in panic (fmt=3DVariable "fmt" is not available.
>     ) at /usr/src/sys/kern/kern_shutdown.c:579
> #3  0xc06716ea in _mtx_lock_sleep (m=3D0xc8154aa8, tid=3D3332925072, opts=
=3D0, file=3D0xc09bb332 "/usr/src/sys/kern/kern_sig.c", line=3D2422)
>     at /usr/src/sys/kern/kern_mutex.c:341
> #4  0xc0671907 in _mtx_lock_flags (m=3D0xc8154aa8, opts=3D0, file=3D0xc09=
bb332 "/usr/src/sys/kern/kern_sig.c", line=3D2422)
>     at /usr/src/sys/kern/kern_mutex.c:203
> #5  0xc0683434 in reschedule_signals (p=3D0xc71172a8, block=3D{__bits =3D=
 {0, 0, 0, 0}}) at /usr/src/sys/kern/kern_sig.c:2422
> #6  0xc0683751 in kern_sigprocmask (td=3D0xc6a86690, how=3D1, set=3D0xe90=
05cd4, oset=3D0x0, flags=3D2) at /usr/src/sys/kern/kern_sig.c:1027
> #7  0xc0684801 in postsig (sig=3D20) at /usr/src/sys/kern/kern_sig.c:2743
> #8  0xc06be228 in ast (framep=3D0xe9005d38) at /usr/src/sys/kern/subr_tra=
p.c:234
> #9  0xc0920624 in doreti_ast () at /usr/src/sys/i386/i386/exception.s:365
>=20
> I think the change that started causing this for MT applications was
> change 197963 in /head that added this bit of code in kern_sig.c inside
> kern_sigprocmask():
>=20
> : @@ -1012,7 +1012,20 @@
> :                          break;
> :                  }
> :          }
> : -        PROC_UNLOCK(td->td_proc);
> : +        /*
> : +         * The new_block set contains signals that were not previosly
> : +         * blocked, but are blocked now.
> : +         *
> : +         * In case we block any signal that was not previously blocked
> : +         * for td, and process has the signal pending, try to schedule
> : +         * signal delivery to some thread that does not block the sign=
al,
> : +         * possibly waking it up.
> : +         */
> : +        if (p->p_numthreads !=3D 1)
> : +                reschedule_signals(p, new_block);
> : +
> : +        PROC_UNLOCK(p);
> :          return (error);
No, this was caused by the r198507 fragment of postsig(), as well as a
fragment from the trapsignal(), that added the call to kern_sigprocmask()
instead of direct manipulation of thread signal mask.

>=20
> AFAICT, postsig() is called with proc->p_sigacts->ps_mtx locked, so when
> we are recursing when reschedule_signals() tries to lock it once more.
Yes, the same statement holds for trapsignal().

>=20
> Since we are holding the proc lock in kern_sigprocmask(), is it safe to
> assert that we own ps_mtx, drop it and re-acquire it immediately after
> calling reschedule_signals()?

No. Most callers of kern_sigprocmask() do not hold curproc->ps_mtx.
Only postsig() and trapsig() call kern_sigprocmask() with ps_mtx locked,
so I have to special-case them.

Could you, please, test the following patch ? What application did
exposed the issue ?

diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 7f5cfa3..e174df1 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -220,7 +220,7 @@ static int sigproptbl[NSIG] =3D {
         SA_KILL|SA_PROC,		/* SIGUSR2 */
 };
=20
-static void reschedule_signals(struct proc *p, sigset_t block);
+static void reschedule_signals(struct proc *p, sigset_t block, int flags);
=20
 static void
 sigqueue_start(void)
@@ -1024,7 +1024,7 @@ kern_sigprocmask(struct thread *td, int how, sigset_t=
 *set, sigset_t *oset,
 	 * possibly waking it up.
 	 */
 	if (p->p_numthreads !=3D 1)
-		reschedule_signals(p, new_block);
+		reschedule_signals(p, new_block, flags);
=20
 	if (!(flags & SIGPROCMASK_PROC_LOCKED))
 		PROC_UNLOCK(p);
@@ -1859,13 +1859,11 @@ trapsignal(struct thread *td, ksiginfo_t *ksi)
 #endif
 		(*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)],=20
 				ksi, &td->td_sigmask);
-		SIGSETOR(td->td_sigmask, ps->ps_catchmask[_SIG_IDX(sig)]);
-		if (!SIGISMEMBER(ps->ps_signodefer, sig)) {
-			SIGEMPTYSET(mask);
+		mask =3D ps->ps_catchmask[_SIG_IDX(sig)];
+		if (!SIGISMEMBER(ps->ps_signodefer, sig))
 			SIGADDSET(mask, sig);
-			kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
-			    SIGPROCMASK_PROC_LOCKED);
-		}
+		kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
+		    SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED);
 		if (SIGISMEMBER(ps->ps_sigreset, sig)) {
 			/*
 			 * See kern_sigaction() for origin of this code.
@@ -2401,7 +2399,7 @@ stopme:
 }
=20
 static void
-reschedule_signals(struct proc *p, sigset_t block)
+reschedule_signals(struct proc *p, sigset_t block, int flags)
 {
 	struct sigacts *ps;
 	struct thread *td;
@@ -2419,12 +2417,14 @@ reschedule_signals(struct proc *p, sigset_t block)
=20
 		td =3D sigtd(p, i, 0);
 		signotify(td);
-		mtx_lock(&ps->ps_mtx);
+		if (!(flags & SIGPROCMASK_PS_LOCKED))
+			mtx_lock(&ps->ps_mtx);
 		if (p->p_flag & P_TRACED || SIGISMEMBER(ps->ps_sigcatch, i))
 			tdsigwakeup(td, i, SIG_CATCH,
 			    (SIGISMEMBER(ps->ps_sigintr, i) ? EINTR :
 			     ERESTART));
-		mtx_unlock(&ps->ps_mtx);
+		if (!(flags & SIGPROCMASK_PS_LOCKED))
+			mtx_unlock(&ps->ps_mtx);
 	}
 }
=20
@@ -2452,7 +2452,7 @@ tdsigcleanup(struct thread *td)
 	SIGFILLSET(unblocked);
 	SIGSETNAND(unblocked, td->td_sigmask);
 	SIGFILLSET(td->td_sigmask);
-	reschedule_signals(p, unblocked);
+	reschedule_signals(p, unblocked, 0);
=20
 }
=20
@@ -2734,15 +2734,11 @@ postsig(sig)
 		} else
 			returnmask =3D td->td_sigmask;
=20
-		kern_sigprocmask(td, SIG_BLOCK,
-		    &ps->ps_catchmask[_SIG_IDX(sig)], NULL,
-		    SIGPROCMASK_PROC_LOCKED);
-		if (!SIGISMEMBER(ps->ps_signodefer, sig)) {
-			SIGEMPTYSET(mask);
+		mask =3D ps->ps_catchmask[_SIG_IDX(sig)];
+		if (!SIGISMEMBER(ps->ps_signodefer, sig))
 			SIGADDSET(mask, sig);
-			kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
-			    SIGPROCMASK_PROC_LOCKED);
-		}
+		kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
+		    SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED);
=20
 		if (SIGISMEMBER(ps->ps_sigreset, sig)) {
 			/*
diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h
index b9a54f0..c27a128 100644
--- a/sys/sys/signalvar.h
+++ b/sys/sys/signalvar.h
@@ -319,6 +319,7 @@ extern int kern_logsigexit;	/* Sysctl variable kern.log=
sigexit */
 /* flags for kern_sigprocmask */
 #define	SIGPROCMASK_OLD		0x0001
 #define	SIGPROCMASK_PROC_LOCKED	0x0002
+#define	SIGPROCMASK_PS_LOCKED	0x0004
=20
 /*
  * Machine-independent functions:

--IMjqdzrDRly81ofr
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkrqW/8ACgkQC3+MBN1Mb4ji0QCdHnCI7qNdkGRvk84c1/STUiGc
9VoAnRViQHhckK3jz0HmdWoBWbbtI2aE
=h/98
-----END PGP SIGNATURE-----

--IMjqdzrDRly81ofr--

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 04:12:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 93F7C106568D;
	Fri, 30 Oct 2009 04:12:22 +0000 (UTC)
	(envelope-from keramida@freebsd.org)
Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr
	[150.140.141.169])
	by mx1.freebsd.org (Postfix) with ESMTP id E62068FC1C;
	Fri, 30 Oct 2009 04:12:21 +0000 (UTC)
Received: from mail.ceid.upatras.gr (unknown [10.1.0.143])
	by poseidon.ceid.upatras.gr (Postfix) with ESMTP id D36C1EB4721;
	Fri, 30 Oct 2009 06:12:20 +0200 (EET)
Received: from localhost (europa.ceid.upatras.gr [127.0.0.1])
	by mail.ceid.upatras.gr (Postfix) with ESMTP id AB12D451B2;
	Fri, 30 Oct 2009 06:12:20 +0200 (EET)
X-Virus-Scanned: amavisd-new at ceid.upatras.gr
Received: from mail.ceid.upatras.gr ([127.0.0.1])
	by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id 7GzRfE5vEW2i; Fri, 30 Oct 2009 06:12:20 +0200 (EET)
Received: from kobe.laptop (ppp-94-64-196-111.home.otenet.gr [94.64.196.111])
	by mail.ceid.upatras.gr (Postfix) with ESMTP id 4AC2A45152;
	Fri, 30 Oct 2009 06:12:20 +0200 (EET)
Received: from kobe.laptop (kobe.laptop [127.0.0.1])
	by kobe.laptop (8.14.3/8.14.3) with ESMTP id n9U4CJ55011875
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Oct 2009 06:12:19 +0200 (EET)
	(envelope-from keramida@freebsd.org)
Received: (from keramida@localhost)
	by kobe.laptop (8.14.3/8.14.3/Submit) id n9U4CI50011874;
	Fri, 30 Oct 2009 06:12:18 +0200 (EET)
	(envelope-from keramida@freebsd.org)
From: Giorgos Keramidas 
To: Kostik Belousov 
References: <200910291434.n9TEYOVJ099388@svn.freebsd.org>
	<871vklbxyf.fsf@kobe.laptop>
	<20091030032240.GD2147@deviant.kiev.zoral.com.ua>
Date: Fri, 30 Oct 2009 06:12:11 +0200
In-Reply-To: <20091030032240.GD2147@deviant.kiev.zoral.com.ua> (Kostik
	Belousov's message of "Fri, 30 Oct 2009 05:22:40 +0200")
Message-ID: <87d445a5b8.fsf@kobe.laptop>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
	micalg=pgp-sha1; protocol="application/pgp-signature"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198590 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 04:12:22 -0000

--=-=-=

> No, this was caused by the r198507 fragment of postsig(), as well as a
> fragment from the trapsignal(), that added the call to kern_sigprocmask()
> instead of direct manipulation of thread signal mask.
>
>> AFAICT, postsig() is called with proc->p_sigacts->ps_mtx locked, so when
>> we are recursing when reschedule_signals() tries to lock it once more.
>
> Yes, the same statement holds for trapsignal().
>
>> Since we are holding the proc lock in kern_sigprocmask(), is it safe to
>> assert that we own ps_mtx, drop it and re-acquire it immediately after
>> calling reschedule_signals()?
>
> No. Most callers of kern_sigprocmask() do not hold curproc->ps_mtx.
> Only postsig() and trapsig() call kern_sigprocmask() with ps_mtx locked,
> so I have to special-case them.
>
> Could you, please, test the following patch ? What application did
> exposed the issue ?

Logging out of GNOME consistently triggers this.  The thread that is
active in kgdb is gnome-session:

(kgdb) info threads
  ...
  138 Thread 100142 (PID=2314: gnome-session)  doadump () at pcpu.h:246
  137 Thread 100100 (PID=2314: gnome-session/initial thread)
        sched_switch (td=0xc6a86230, newtd=0xc6564230, flags=1538)
        at /usr/src/sys/kern/sched_ule.c:1864
  ...

I'll try the patch in a few hours and report back.  Thanks! :)

> diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
> index 7f5cfa3..e174df1 100644
> --- a/sys/kern/kern_sig.c
> +++ b/sys/kern/kern_sig.c
> @@ -220,7 +220,7 @@ static int sigproptbl[NSIG] = {
>          SA_KILL|SA_PROC,		/* SIGUSR2 */
>  };
>
> -static void reschedule_signals(struct proc *p, sigset_t block);
> +static void reschedule_signals(struct proc *p, sigset_t block, int flags);
>
>  static void
>  sigqueue_start(void)
> @@ -1024,7 +1024,7 @@ kern_sigprocmask(struct thread *td, int how, sigset_t *set, sigset_t *oset,
>  	 * possibly waking it up.
>  	 */
>  	if (p->p_numthreads != 1)
> -		reschedule_signals(p, new_block);
> +		reschedule_signals(p, new_block, flags);
>
>  	if (!(flags & SIGPROCMASK_PROC_LOCKED))
>  		PROC_UNLOCK(p);
> @@ -1859,13 +1859,11 @@ trapsignal(struct thread *td, ksiginfo_t *ksi)
>  #endif
>  		(*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)],
>  				ksi, &td->td_sigmask);
> -		SIGSETOR(td->td_sigmask, ps->ps_catchmask[_SIG_IDX(sig)]);
> -		if (!SIGISMEMBER(ps->ps_signodefer, sig)) {
> -			SIGEMPTYSET(mask);
> +		mask = ps->ps_catchmask[_SIG_IDX(sig)];
> +		if (!SIGISMEMBER(ps->ps_signodefer, sig))
>  			SIGADDSET(mask, sig);
> -			kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
> -			    SIGPROCMASK_PROC_LOCKED);
> -		}
> +		kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
> +		    SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED);
>  		if (SIGISMEMBER(ps->ps_sigreset, sig)) {
>  			/*
>  			 * See kern_sigaction() for origin of this code.
> @@ -2401,7 +2399,7 @@ stopme:
>  }
>
>  static void
> -reschedule_signals(struct proc *p, sigset_t block)
> +reschedule_signals(struct proc *p, sigset_t block, int flags)
>  {
>  	struct sigacts *ps;
>  	struct thread *td;
> @@ -2419,12 +2417,14 @@ reschedule_signals(struct proc *p, sigset_t block)
>
>  		td = sigtd(p, i, 0);
>  		signotify(td);
> -		mtx_lock(&ps->ps_mtx);
> +		if (!(flags & SIGPROCMASK_PS_LOCKED))
> +			mtx_lock(&ps->ps_mtx);
>  		if (p->p_flag & P_TRACED || SIGISMEMBER(ps->ps_sigcatch, i))
>  			tdsigwakeup(td, i, SIG_CATCH,
>  			    (SIGISMEMBER(ps->ps_sigintr, i) ? EINTR :
>  			     ERESTART));
> -		mtx_unlock(&ps->ps_mtx);
> +		if (!(flags & SIGPROCMASK_PS_LOCKED))
> +			mtx_unlock(&ps->ps_mtx);
>  	}
>  }
>
> @@ -2452,7 +2452,7 @@ tdsigcleanup(struct thread *td)
>  	SIGFILLSET(unblocked);
>  	SIGSETNAND(unblocked, td->td_sigmask);
>  	SIGFILLSET(td->td_sigmask);
> -	reschedule_signals(p, unblocked);
> +	reschedule_signals(p, unblocked, 0);
>
>  }
>
> @@ -2734,15 +2734,11 @@ postsig(sig)
>  		} else
>  			returnmask = td->td_sigmask;
>
> -		kern_sigprocmask(td, SIG_BLOCK,
> -		    &ps->ps_catchmask[_SIG_IDX(sig)], NULL,
> -		    SIGPROCMASK_PROC_LOCKED);
> -		if (!SIGISMEMBER(ps->ps_signodefer, sig)) {
> -			SIGEMPTYSET(mask);
> +		mask = ps->ps_catchmask[_SIG_IDX(sig)];
> +		if (!SIGISMEMBER(ps->ps_signodefer, sig))
>  			SIGADDSET(mask, sig);
> -			kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
> -			    SIGPROCMASK_PROC_LOCKED);
> -		}
> +		kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
> +		    SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED);
>
>  		if (SIGISMEMBER(ps->ps_sigreset, sig)) {
>  			/*
> diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h
> index b9a54f0..c27a128 100644
> --- a/sys/sys/signalvar.h
> +++ b/sys/sys/signalvar.h
> @@ -319,6 +319,7 @@ extern int kern_logsigexit;	/* Sysctl variable kern.logsigexit */
>  /* flags for kern_sigprocmask */
>  #define	SIGPROCMASK_OLD		0x0001
>  #define	SIGPROCMASK_PROC_LOCKED	0x0002
> +#define	SIGPROCMASK_PS_LOCKED	0x0004
>
>  /*
>   * Machine-independent functions:

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)

iEYEARECAAYFAkrqZ6IACgkQ1g+UGjGGA7Yt8ACfRNfjWFWhjV4Ntic7dAXOZh5D
7CgAn2r+bLuCSbWm/sOugWfUcZ4DzST2
=gTB4
-----END PGP SIGNATURE-----
--=-=-=--

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 07:48:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD496106566B;
	Fri, 30 Oct 2009 07:48:18 +0000 (UTC)
	(envelope-from mavbsd@gmail.com)
Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com
	[209.85.218.213])
	by mx1.freebsd.org (Postfix) with ESMTP id AD5DC8FC0A;
	Fri, 30 Oct 2009 07:48:17 +0000 (UTC)
Received: by bwz5 with SMTP id 5so3252527bwz.3
	for ; Fri, 30 Oct 2009 00:48:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:message-id:date:from
	:user-agent:mime-version:to:cc:subject:references:in-reply-to
	:x-enigmail-version:content-type:content-transfer-encoding;
	bh=+x6PdL930LXubSAOvgZQ0kUiIBl3iY02OT826ytVlDs=;
	b=hscM9BF1oYbR56ywPkw4Eq+kuQuHIgExpZTJWGkQRSILUkNR/Uy7e+UBSwIXL0UxMi
	bNS+M3PO6Bo23scVbXFIBnMXWFnpX1aPROzdly7tnz5lWf432AznARwcQBP4SZe9C0xb
	ddR2ymnkutlpLxXSKnlUZNOUvNqPHYA4i8bn8=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:x-enigmail-version:content-type
	:content-transfer-encoding;
	b=qDiRCQSO3/h1ouD/vUh8IE7e++wloUiugPgxFeeOQ9BniCMunAA20W2OpUUvt9jCPJ
	UDLavHAZxnoPLO20ZwO4H2Q44jsSgsyHW/AjST8SBopa5wDVCexsNxcXoMgSdOTxWTmJ
	VPRVeO0teRWPcPjfjBIzvxmLM6mMZfJq0gZh0=
Received: by 10.103.50.29 with SMTP id c29mr473470muk.61.1256888896358;
	Fri, 30 Oct 2009 00:48:16 -0700 (PDT)
Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226])
	by mx.google.com with ESMTPS id 14sm2388575muo.15.2009.10.30.00.48.14
	(version=SSLv3 cipher=RC4-MD5); Fri, 30 Oct 2009 00:48:15 -0700 (PDT)
Sender: Alexander Motin 
Message-ID: <4AEA9A3C.3000406@FreeBSD.org>
Date: Fri, 30 Oct 2009 09:48:12 +0200
From: Alexander Motin 
User-Agent: Thunderbird 2.0.0.23 (X11/20090901)
MIME-Version: 1.0
To: "M. Warner Losh" 
References: <200910291327.n9TDREeJ097506@svn.freebsd.org>
	<20091029.173734.404970008.imp@bsdimp.com>
In-Reply-To: <20091029.173734.404970008.imp@bsdimp.com>
X-Enigmail-Version: 0.96.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, nwhitehorn@freebsd.org
Subject: Re: svn commit: r198582 - head/sys/dev/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 07:48:18 -0000

M. Warner Losh wrote:
> In message: <200910291327.n9TDREeJ097506@svn.freebsd.org>
>             Nathan Whitehorn  writes:
> : +#if 0
> : +#define	ATA_LEGACY_SUPPORT		/* Enable obsolete features that break
> : +					 * some modern devices */
> : +#endif
> 
> Shouldn't this just be a kernel option?

We decided to make it an option after first real problem report. If
there will be none in a year, we can just remove this code.

-- 
Alexander Motin

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 09:41:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 002AA106568D;
	Fri, 30 Oct 2009 09:41:18 +0000 (UTC)
	(envelope-from keramida@freebsd.org)
Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr
	[150.140.141.169])
	by mx1.freebsd.org (Postfix) with ESMTP id 60F5A8FC1C;
	Fri, 30 Oct 2009 09:41:18 +0000 (UTC)
Received: from mail.ceid.upatras.gr (unknown [10.1.0.143])
	by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 66BC3EB4784;
	Fri, 30 Oct 2009 11:41:17 +0200 (EET)
Received: from localhost (europa.ceid.upatras.gr [127.0.0.1])
	by mail.ceid.upatras.gr (Postfix) with ESMTP id 3308D45152;
	Fri, 30 Oct 2009 11:41:17 +0200 (EET)
X-Virus-Scanned: amavisd-new at ceid.upatras.gr
Received: from mail.ceid.upatras.gr ([127.0.0.1])
	by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id BaVzj8bQg+DD; Fri, 30 Oct 2009 11:41:17 +0200 (EET)
Received: from kobe.laptop (ppp-94-64-196-111.home.otenet.gr [94.64.196.111])
	by mail.ceid.upatras.gr (Postfix) with ESMTP id B9BCC450C6;
	Fri, 30 Oct 2009 11:41:16 +0200 (EET)
Received: from kobe.laptop (kobe.laptop [127.0.0.1])
	by kobe.laptop (8.14.3/8.14.3) with ESMTP id n9U9fF7s004274
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 30 Oct 2009 11:41:15 +0200 (EET)
	(envelope-from keramida@freebsd.org)
Received: (from keramida@localhost)
	by kobe.laptop (8.14.3/8.14.3/Submit) id n9U9fE4n004273;
	Fri, 30 Oct 2009 11:41:14 +0200 (EET)
	(envelope-from keramida@freebsd.org)
From: Giorgos Keramidas 
To: Kostik Belousov 
References: <200910291434.n9TEYOVJ099388@svn.freebsd.org>
	<871vklbxyf.fsf@kobe.laptop>
	<20091030032240.GD2147@deviant.kiev.zoral.com.ua>
Date: Fri, 30 Oct 2009 11:41:06 +0200
In-Reply-To: <20091030032240.GD2147@deviant.kiev.zoral.com.ua> (Kostik
	Belousov's message of "Fri, 30 Oct 2009 05:22:40 +0200")
Message-ID: <87r5slw765.fsf@kobe.laptop>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
	micalg=pgp-sha1; protocol="application/pgp-signature"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198590 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 09:41:19 -0000

--=-=-=
Content-Transfer-Encoding: quoted-printable

The patch works fine so far.  I haven't seen any other panics of this
sort, for around 5 hours of running with a patched kernel.

On Fri, 30 Oct 2009 05:22:40 +0200, Kostik Belousov  w=
rote:
> Could you, please, test the following patch ? What application did
> exposed the issue ?
>
> diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
> index 7f5cfa3..e174df1 100644
> --- a/sys/kern/kern_sig.c
> +++ b/sys/kern/kern_sig.c
> @@ -220,7 +220,7 @@ static int sigproptbl[NSIG] =3D {
>          SA_KILL|SA_PROC,		/* SIGUSR2 */
>  };
>=20=20
> -static void reschedule_signals(struct proc *p, sigset_t block);
> +static void reschedule_signals(struct proc *p, sigset_t block, int flags=
);
>=20=20
>  static void
>  sigqueue_start(void)
> @@ -1024,7 +1024,7 @@ kern_sigprocmask(struct thread *td, int how, sigset=
_t *set, sigset_t *oset,
>  	 * possibly waking it up.
>  	 */
>  	if (p->p_numthreads !=3D 1)
> -		reschedule_signals(p, new_block);
> +		reschedule_signals(p, new_block, flags);
>=20=20
>  	if (!(flags & SIGPROCMASK_PROC_LOCKED))
>  		PROC_UNLOCK(p);
> @@ -1859,13 +1859,11 @@ trapsignal(struct thread *td, ksiginfo_t *ksi)
>  #endif
>  		(*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)],=20
>  				ksi, &td->td_sigmask);
> -		SIGSETOR(td->td_sigmask, ps->ps_catchmask[_SIG_IDX(sig)]);
> -		if (!SIGISMEMBER(ps->ps_signodefer, sig)) {
> -			SIGEMPTYSET(mask);
> +		mask =3D ps->ps_catchmask[_SIG_IDX(sig)];
> +		if (!SIGISMEMBER(ps->ps_signodefer, sig))
>  			SIGADDSET(mask, sig);
> -			kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
> -			    SIGPROCMASK_PROC_LOCKED);
> -		}
> +		kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
> +		    SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED);
>  		if (SIGISMEMBER(ps->ps_sigreset, sig)) {
>  			/*
>  			 * See kern_sigaction() for origin of this code.
> @@ -2401,7 +2399,7 @@ stopme:
>  }
>=20=20
>  static void
> -reschedule_signals(struct proc *p, sigset_t block)
> +reschedule_signals(struct proc *p, sigset_t block, int flags)
>  {
>  	struct sigacts *ps;
>  	struct thread *td;
> @@ -2419,12 +2417,14 @@ reschedule_signals(struct proc *p, sigset_t block)
>=20=20
>  		td =3D sigtd(p, i, 0);
>  		signotify(td);
> -		mtx_lock(&ps->ps_mtx);
> +		if (!(flags & SIGPROCMASK_PS_LOCKED))
> +			mtx_lock(&ps->ps_mtx);
>  		if (p->p_flag & P_TRACED || SIGISMEMBER(ps->ps_sigcatch, i))
>  			tdsigwakeup(td, i, SIG_CATCH,
>  			    (SIGISMEMBER(ps->ps_sigintr, i) ? EINTR :
>  			     ERESTART));
> -		mtx_unlock(&ps->ps_mtx);
> +		if (!(flags & SIGPROCMASK_PS_LOCKED))
> +			mtx_unlock(&ps->ps_mtx);
>  	}
>  }
>=20=20
> @@ -2452,7 +2452,7 @@ tdsigcleanup(struct thread *td)
>  	SIGFILLSET(unblocked);
>  	SIGSETNAND(unblocked, td->td_sigmask);
>  	SIGFILLSET(td->td_sigmask);
> -	reschedule_signals(p, unblocked);
> +	reschedule_signals(p, unblocked, 0);
>=20=20
>  }
>=20=20
> @@ -2734,15 +2734,11 @@ postsig(sig)
>  		} else
>  			returnmask =3D td->td_sigmask;
>=20=20
> -		kern_sigprocmask(td, SIG_BLOCK,
> -		    &ps->ps_catchmask[_SIG_IDX(sig)], NULL,
> -		    SIGPROCMASK_PROC_LOCKED);
> -		if (!SIGISMEMBER(ps->ps_signodefer, sig)) {
> -			SIGEMPTYSET(mask);
> +		mask =3D ps->ps_catchmask[_SIG_IDX(sig)];
> +		if (!SIGISMEMBER(ps->ps_signodefer, sig))
>  			SIGADDSET(mask, sig);
> -			kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
> -			    SIGPROCMASK_PROC_LOCKED);
> -		}
> +		kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
> +		    SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED);
>=20=20
>  		if (SIGISMEMBER(ps->ps_sigreset, sig)) {
>  			/*
> diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h
> index b9a54f0..c27a128 100644
> --- a/sys/sys/signalvar.h
> +++ b/sys/sys/signalvar.h
> @@ -319,6 +319,7 @@ extern int kern_logsigexit;	/* Sysctl variable kern.l=
ogsigexit */
>  /* flags for kern_sigprocmask */
>  #define	SIGPROCMASK_OLD		0x0001
>  #define	SIGPROCMASK_PROC_LOCKED	0x0002
> +#define	SIGPROCMASK_PS_LOCKED	0x0004
>=20=20
>  /*
>   * Machine-independent functions:

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)

iEYEARECAAYFAkrqtLoACgkQ1g+UGjGGA7bPZgCfWSOKfFZN7HmFICqWCJVUqzIv
yR4AoIyr62tfa0EnGmWeRmHlrVCKRwhJ
=TDFr
-----END PGP SIGNATURE-----
--=-=-=--

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 10:10:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EF4B8106566B;
	Fri, 30 Oct 2009 10:10:39 +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 DCFDA8FC1F;
	Fri, 30 Oct 2009 10:10:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UAAdUM037870;
	Fri, 30 Oct 2009 10:10:39 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UAAdnm037867;
	Fri, 30 Oct 2009 10:10:39 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200910301010.n9UAAdnm037867@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 30 Oct 2009 10:10:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198670 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 10:10:40 -0000

Author: kib
Date: Fri Oct 30 10:10:39 2009
New Revision: 198670
URL: http://svn.freebsd.org/changeset/base/198670

Log:
  Trapsignal() and postsig() call kern_sigprocmask() with both process
  lock and curproc->p_sigacts->ps_mtx. Reschedule_signals may need to have
  ps_mtx locked to decide and wakeup a thread, causing recursion on the
  mutex.
  
  Inform kern_sigprocmask() and reschedule_signals() about lock state
  of the ps_mtx by new flag SIGPROCMASK_PS_LOCKED to avoid recursion.
  
  Reported and tested by:	keramida
  MFC after:	1 month

Modified:
  head/sys/kern/kern_sig.c
  head/sys/sys/signalvar.h

Modified: head/sys/kern/kern_sig.c
==============================================================================
--- head/sys/kern/kern_sig.c	Fri Oct 30 08:53:11 2009	(r198669)
+++ head/sys/kern/kern_sig.c	Fri Oct 30 10:10:39 2009	(r198670)
@@ -220,7 +220,7 @@ static int sigproptbl[NSIG] = {
         SA_KILL|SA_PROC,		/* SIGUSR2 */
 };
 
-static void reschedule_signals(struct proc *p, sigset_t block);
+static void reschedule_signals(struct proc *p, sigset_t block, int flags);
 
 static void
 sigqueue_start(void)
@@ -1024,7 +1024,7 @@ kern_sigprocmask(struct thread *td, int 
 	 * possibly waking it up.
 	 */
 	if (p->p_numthreads != 1)
-		reschedule_signals(p, new_block);
+		reschedule_signals(p, new_block, flags);
 
 	if (!(flags & SIGPROCMASK_PROC_LOCKED))
 		PROC_UNLOCK(p);
@@ -1859,13 +1859,11 @@ trapsignal(struct thread *td, ksiginfo_t
 #endif
 		(*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)], 
 				ksi, &td->td_sigmask);
-		SIGSETOR(td->td_sigmask, ps->ps_catchmask[_SIG_IDX(sig)]);
-		if (!SIGISMEMBER(ps->ps_signodefer, sig)) {
-			SIGEMPTYSET(mask);
+		mask = ps->ps_catchmask[_SIG_IDX(sig)];
+		if (!SIGISMEMBER(ps->ps_signodefer, sig))
 			SIGADDSET(mask, sig);
-			kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
-			    SIGPROCMASK_PROC_LOCKED);
-		}
+		kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
+		    SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED);
 		if (SIGISMEMBER(ps->ps_sigreset, sig)) {
 			/*
 			 * See kern_sigaction() for origin of this code.
@@ -2401,7 +2399,7 @@ stopme:
 }
 
 static void
-reschedule_signals(struct proc *p, sigset_t block)
+reschedule_signals(struct proc *p, sigset_t block, int flags)
 {
 	struct sigacts *ps;
 	struct thread *td;
@@ -2419,12 +2417,14 @@ reschedule_signals(struct proc *p, sigse
 
 		td = sigtd(p, i, 0);
 		signotify(td);
-		mtx_lock(&ps->ps_mtx);
+		if (!(flags & SIGPROCMASK_PS_LOCKED))
+			mtx_lock(&ps->ps_mtx);
 		if (p->p_flag & P_TRACED || SIGISMEMBER(ps->ps_sigcatch, i))
 			tdsigwakeup(td, i, SIG_CATCH,
 			    (SIGISMEMBER(ps->ps_sigintr, i) ? EINTR :
 			     ERESTART));
-		mtx_unlock(&ps->ps_mtx);
+		if (!(flags & SIGPROCMASK_PS_LOCKED))
+			mtx_unlock(&ps->ps_mtx);
 	}
 }
 
@@ -2452,7 +2452,7 @@ tdsigcleanup(struct thread *td)
 	SIGFILLSET(unblocked);
 	SIGSETNAND(unblocked, td->td_sigmask);
 	SIGFILLSET(td->td_sigmask);
-	reschedule_signals(p, unblocked);
+	reschedule_signals(p, unblocked, 0);
 
 }
 
@@ -2734,15 +2734,11 @@ postsig(sig)
 		} else
 			returnmask = td->td_sigmask;
 
-		kern_sigprocmask(td, SIG_BLOCK,
-		    &ps->ps_catchmask[_SIG_IDX(sig)], NULL,
-		    SIGPROCMASK_PROC_LOCKED);
-		if (!SIGISMEMBER(ps->ps_signodefer, sig)) {
-			SIGEMPTYSET(mask);
+		mask = ps->ps_catchmask[_SIG_IDX(sig)];
+		if (!SIGISMEMBER(ps->ps_signodefer, sig))
 			SIGADDSET(mask, sig);
-			kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
-			    SIGPROCMASK_PROC_LOCKED);
-		}
+		kern_sigprocmask(td, SIG_BLOCK, &mask, NULL,
+		    SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED);
 
 		if (SIGISMEMBER(ps->ps_sigreset, sig)) {
 			/*

Modified: head/sys/sys/signalvar.h
==============================================================================
--- head/sys/sys/signalvar.h	Fri Oct 30 08:53:11 2009	(r198669)
+++ head/sys/sys/signalvar.h	Fri Oct 30 10:10:39 2009	(r198670)
@@ -319,6 +319,7 @@ extern int kern_logsigexit;	/* Sysctl va
 /* flags for kern_sigprocmask */
 #define	SIGPROCMASK_OLD		0x0001
 #define	SIGPROCMASK_PROC_LOCKED	0x0002
+#define	SIGPROCMASK_PS_LOCKED	0x0004
 
 /*
  * Machine-independent functions:

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 11:13:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04A9F106566B;
	Fri, 30 Oct 2009 11:13:01 +0000 (UTC)
	(envelope-from cperciva@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CCBAF8FC25;
	Fri, 30 Oct 2009 11:13:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UBD0o5041924;
	Fri, 30 Oct 2009 11:13:00 GMT
	(envelope-from cperciva@svn.freebsd.org)
Received: (from cperciva@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UBD0ET041921;
	Fri, 30 Oct 2009 11:13:00 GMT
	(envelope-from cperciva@svn.freebsd.org)
Message-Id: <200910301113.n9UBD0ET041921@svn.freebsd.org>
From: Colin Percival 
Date: Fri, 30 Oct 2009 11:13:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198671 - in head/usr.bin/bsdiff: bsdiff bspatch
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 11:13:01 -0000

Author: cperciva
Date: Fri Oct 30 11:13:00 2009
New Revision: 198671
URL: http://svn.freebsd.org/changeset/base/198671

Log:
  Add notes pointing out that bsdiff does not store file hashes and
  bspatch thus does not verify file hashes, and that consequently it
  is recommended that users store hashes separately and verify files
  before and after running bspatch.
  
  Requested by:	BugMagnet
  MFC after:	1 week

Modified:
  head/usr.bin/bsdiff/bsdiff/bsdiff.1
  head/usr.bin/bsdiff/bspatch/bspatch.1

Modified: head/usr.bin/bsdiff/bsdiff/bsdiff.1
==============================================================================
--- head/usr.bin/bsdiff/bsdiff/bsdiff.1	Fri Oct 30 10:10:39 2009	(r198670)
+++ head/usr.bin/bsdiff/bsdiff/bsdiff.1	Fri Oct 30 11:13:00 2009	(r198671)
@@ -65,5 +65,24 @@ an absolute minimum working set size of 
 .Ar oldfile .
 .Sh SEE ALSO
 .Xr bspatch 1
+.Sh BUGS
+The
+.Nm
+utility does not store the hashes of
+.Ar oldfile
+or 
+.Ar newfile
+in
+.Ar patchfile .
+As a result, it is possible to apply a patch to the wrong file; this
+will usually produce garbage.
+It is recommended that users of
+.Nm
+store the hashes of
+.Ar oldfile
+and
+.Ar newfile
+and compare against them before and after applying
+.Ar patchfile .
 .Sh AUTHORS
 .An Colin Percival Aq cperciva@FreeBSD.org

Modified: head/usr.bin/bsdiff/bspatch/bspatch.1
==============================================================================
--- head/usr.bin/bsdiff/bspatch/bspatch.1	Fri Oct 30 10:10:39 2009	(r198670)
+++ head/usr.bin/bsdiff/bspatch/bspatch.1	Fri Oct 30 11:13:00 2009	(r198671)
@@ -61,5 +61,26 @@ but can tolerate a very small working se
 of performance.
 .Sh SEE ALSO
 .Xr bsdiff 1
+.Sh BUGS
+The
+.Nm
+utility does not verify that
+.Ar oldfile
+is the correct source file for
+.Ar patchfile .
+Attempting to apply a patch to the wrong file will usually produce
+garbage; consequently it is strongly recommended that users of
+.Nm
+verify that
+.Ar oldfile
+matches the source file from which
+.Ar patchfile
+was built, by comparing cryptographic hashes, for example.
+Users may also wish to verify after running
+.Nm
+that
+.Ar newfile
+matches the target file from which
+.Ar was built.
 .Sh AUTHORS
 .An Colin Percival Aq cperciva@FreeBSD.org

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 16:00:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C1654106568B;
	Fri, 30 Oct 2009 16:00:34 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AFFB78FC66;
	Fri, 30 Oct 2009 16:00:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UG0YuE050061;
	Fri, 30 Oct 2009 16:00:34 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UG0Ype050059;
	Fri, 30 Oct 2009 16:00:34 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910301600.n9UG0Ype050059@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 30 Oct 2009 16:00:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198678 - head/sys/powerpc/powerpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 16:00:34 -0000

Author: nwhitehorn
Date: Fri Oct 30 16:00:34 2009
New Revision: 198678
URL: http://svn.freebsd.org/changeset/base/198678

Log:
  Make procstat -k work on PowerPC by avoiding mistakenly using signed
  compares with a low address (0x1000) and a high address
  (the KVA kernel stack).

Modified:
  head/sys/powerpc/powerpc/stack_machdep.c

Modified: head/sys/powerpc/powerpc/stack_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/stack_machdep.c	Fri Oct 30 15:45:40 2009	(r198677)
+++ head/sys/powerpc/powerpc/stack_machdep.c	Fri Oct 30 16:00:34 2009	(r198678)
@@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 static void
-stack_capture(struct stack *st, register_t frame)
+stack_capture(struct stack *st, vm_offset_t frame)
 {
 	vm_offset_t callpc;
 
@@ -76,7 +76,7 @@ stack_capture(struct stack *st, register
 void
 stack_save_td(struct stack *st, struct thread *td)
 {
-	register_t frame;
+	vm_offset_t frame;
 
 	if (TD_IS_SWAPPED(td))
 		panic("stack_save_td: swapped");

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 16:23:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 757D31065670;
	Fri, 30 Oct 2009 16:23:57 +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 6488B8FC16;
	Fri, 30 Oct 2009 16:23:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UGNvMR050977;
	Fri, 30 Oct 2009 16:23:57 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UGNvuI050975;
	Fri, 30 Oct 2009 16:23:57 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910301623.n9UGNvuI050975@svn.freebsd.org>
From: Christian Brueffer 
Date: Fri, 30 Oct 2009 16:23:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198684 - head/sys/dev/aic7xxx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 16:23:57 -0000

Author: brueffer
Date: Fri Oct 30 16:23:56 2009
New Revision: 198684
URL: http://svn.freebsd.org/changeset/base/198684

Log:
  Add support for Adaptec 39320LPE adapters.
  
  PR:		124202
  Submitted by:	Andre Albsmeier 
  Reviewed by:	gibbs
  MFC after:	1 week

Modified:
  head/sys/dev/aic7xxx/aic79xx_pci.c

Modified: head/sys/dev/aic7xxx/aic79xx_pci.c
==============================================================================
--- head/sys/dev/aic7xxx/aic79xx_pci.c	Fri Oct 30 16:21:09 2009	(r198683)
+++ head/sys/dev/aic7xxx/aic79xx_pci.c	Fri Oct 30 16:23:56 2009	(r198684)
@@ -89,6 +89,7 @@ ahd_compose_id(u_int device, u_int vendo
 #define ID_AHA_39320D_B			0x801C900500419005ull
 #define ID_AHA_39320D_HP		0x8011900500AC0E11ull
 #define ID_AHA_39320D_B_HP		0x801C900500AC0E11ull
+#define ID_AHA_39320LPE 		0x8017900500459005ull
 #define ID_AIC7902_PCI_REV_A4		0x3
 #define ID_AIC7902_PCI_REV_B0		0x10
 #define SUBID_HP			0x0E11
@@ -204,6 +205,12 @@ struct ahd_pci_identity ahd_pci_ident_ta
 		"Adaptec (HP OEM) 39320D Ultra320 SCSI adapter",
 		ahd_aic7902_setup
 	},
+	{
+		ID_AHA_39320LPE,
+		ID_ALL_MASK,
+		"Adaptec 39320LPE Ultra320 SCSI adapter",
+		ahd_aic7902_setup
+	},
 	/* Generic chip probes for devices we don't know 'exactly' */
 	{
 		ID_AIC7901 & ID_9005_GENERIC_MASK,

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 16:55:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 38B5D106566C;
	Fri, 30 Oct 2009 16:55:32 +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 27B9C8FC0C;
	Fri, 30 Oct 2009 16:55:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UGtWp5052122;
	Fri, 30 Oct 2009 16:55:32 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UGtWSL052120;
	Fri, 30 Oct 2009 16:55:32 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200910301655.n9UGtWSL052120@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 30 Oct 2009 16:55:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198691 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 16:55:32 -0000

Author: rnoland
Date: Fri Oct 30 16:55:31 2009
New Revision: 198691
URL: http://svn.freebsd.org/changeset/base/198691

Log:
  Fix blitter support for RS880 chips
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/r600_blit.c

Modified: head/sys/dev/drm/r600_blit.c
==============================================================================
--- head/sys/dev/drm/r600_blit.c	Fri Oct 30 16:49:38 2009	(r198690)
+++ head/sys/dev/drm/r600_blit.c	Fri Oct 30 16:55:31 2009	(r198691)
@@ -1367,7 +1367,7 @@ set_vtx_resource(drm_radeon_private_t *d
 	if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) ||
 	    ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) ||
 	    ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780) ||
-	    /*((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880) ||*/
+	    ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880) ||
 	    ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV710))
 		cp_set_surface_sync(dev_priv,
 				    R600_TC_ACTION_ENA, 48, gpu_addr);
@@ -1509,7 +1509,7 @@ set_default_state(drm_radeon_private_t *
 	case CHIP_RV610:
 	case CHIP_RV620:
 	case CHIP_RS780:
-	/*case CHIP_RS880:*/
+	case CHIP_RS880:
 	default:
 		num_ps_gprs = 84;
 		num_vs_gprs = 36;
@@ -1591,7 +1591,7 @@ set_default_state(drm_radeon_private_t *
 	if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610) ||
 	    ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620) ||
 	    ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780) ||
-	    /*((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880) ||*/
+	    ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS880) ||
 	    ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV710))
 		sq_config = 0;
 	else

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 16:59:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A957F106568B;
	Fri, 30 Oct 2009 16:59:58 +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 9871D8FC08;
	Fri, 30 Oct 2009 16:59:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UGxwoF052264;
	Fri, 30 Oct 2009 16:59:58 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UGxw2E052262;
	Fri, 30 Oct 2009 16:59:58 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200910301659.n9UGxw2E052262@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 30 Oct 2009 16:59:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198692 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 16:59:58 -0000

Author: rnoland
Date: Fri Oct 30 16:59:58 2009
New Revision: 198692
URL: http://svn.freebsd.org/changeset/base/198692

Log:
  Use system specified memory barriers rather than rolling our own.

Modified:
  head/sys/dev/drm/drmP.h

Modified: head/sys/dev/drm/drmP.h
==============================================================================
--- head/sys/dev/drm/drmP.h	Fri Oct 30 16:55:31 2009	(r198691)
+++ head/sys/dev/drm/drmP.h	Fri Oct 30 16:59:58 2009	(r198692)
@@ -223,23 +223,9 @@ typedef u_int8_t u8;
  * DRM_WRITEMEMORYBARRIER() prevents reordering of writes.
  * DRM_MEMORYBARRIER() prevents reordering of reads and writes.
  */
-#if defined(__i386__)
-#define DRM_READMEMORYBARRIER()		__asm __volatile( \
-					"lock; addl $0,0(%%esp)" : : : "memory");
-#define DRM_WRITEMEMORYBARRIER()	__asm __volatile("" : : : "memory");
-#define DRM_MEMORYBARRIER()		__asm __volatile( \
-					"lock; addl $0,0(%%esp)" : : : "memory");
-#elif defined(__alpha__)
-#define DRM_READMEMORYBARRIER()		alpha_mb();
-#define DRM_WRITEMEMORYBARRIER()	alpha_wmb();
-#define DRM_MEMORYBARRIER()		alpha_mb();
-#elif defined(__amd64__)
-#define DRM_READMEMORYBARRIER()		__asm __volatile( \
-					"lock; addl $0,0(%%rsp)" : : : "memory");
-#define DRM_WRITEMEMORYBARRIER()	__asm __volatile("" : : : "memory");
-#define DRM_MEMORYBARRIER()		__asm __volatile( \
-					"lock; addl $0,0(%%rsp)" : : : "memory");
-#endif
+#define DRM_READMEMORYBARRIER()		rmb()
+#define DRM_WRITEMEMORYBARRIER()	wmb()
+#define DRM_MEMORYBARRIER()		mb()
 
 #define DRM_READ8(map, offset)						\
 	*(volatile u_int8_t *)(((vm_offset_t)(map)->handle) +		\

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 18:02:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 507F0106566B;
	Fri, 30 Oct 2009 18:02:11 +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 3F29E8FC13;
	Fri, 30 Oct 2009 18:02:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UI2BnD053661;
	Fri, 30 Oct 2009 18:02:11 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UI2B0B053659;
	Fri, 30 Oct 2009 18:02:11 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200910301802.n9UI2B0B053659@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 30 Oct 2009 18:02:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198694 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 18:02:11 -0000

Author: rnoland
Date: Fri Oct 30 18:02:10 2009
New Revision: 198694
URL: http://svn.freebsd.org/changeset/base/198694

Log:
  Some general cleanup of scatter/gather memory allocation
  
   - We don't need to check malloc return values with M_WAITOK
   - remove variables that we don't really need
   - cleanup the error paths by just calling drm_sg_cleanup()
   - fix drm_sg_cleanup() to be safe to call at any time
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/drm/drm_scatter.c

Modified: head/sys/dev/drm/drm_scatter.c
==============================================================================
--- head/sys/dev/drm/drm_scatter.c	Fri Oct 30 17:28:35 2009	(r198693)
+++ head/sys/dev/drm/drm_scatter.c	Fri Oct 30 18:02:10 2009	(r198694)
@@ -47,35 +47,20 @@ drm_sg_alloc(struct drm_device *dev, str
 {
 	struct drm_sg_mem *entry;
 	struct drm_dma_handle *dmah;
-	unsigned long pages;
 	int ret;
 
 	if (dev->sg)
 		return EINVAL;
 
 	entry = malloc(sizeof(*entry), DRM_MEM_SGLISTS, M_WAITOK | M_ZERO);
-	if (!entry)
-		return ENOMEM;
-
-	pages = round_page(request->size) / PAGE_SIZE;
-	DRM_DEBUG("sg size=%ld pages=%ld\n", request->size, pages);
-
-	entry->pages = pages;
-
-	entry->busaddr = malloc(pages * sizeof(*entry->busaddr), DRM_MEM_PAGES,
-	    M_WAITOK | M_ZERO);
-	if (!entry->busaddr) {
-		free(entry, DRM_MEM_SGLISTS);
-		return ENOMEM;
-	}
+	entry->pages = round_page(request->size) / PAGE_SIZE;
+	DRM_DEBUG("sg size=%ld pages=%d\n", request->size, entry->pages);
 
+	entry->busaddr = malloc(entry->pages * sizeof(*entry->busaddr),
+	    DRM_MEM_PAGES, M_WAITOK | M_ZERO);
 	dmah = malloc(sizeof(struct drm_dma_handle), DRM_MEM_DMA,
-	    M_ZERO | M_NOWAIT);
-	if (dmah == NULL) {
-		free(entry->busaddr, DRM_MEM_PAGES);
-		free(entry, DRM_MEM_SGLISTS);
-		return ENOMEM;
-	}
+	    M_WAITOK | M_ZERO);
+	entry->dmah = dmah;
 
 	ret = bus_dma_tag_create(NULL, PAGE_SIZE, 0, /* tag, align, boundary */
 	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */
@@ -85,41 +70,27 @@ drm_sg_alloc(struct drm_device *dev, str
 	    NULL, NULL, /* lockfunc, lockfuncargs */
 	    &dmah->tag);
 	if (ret != 0) {
-		free(dmah, DRM_MEM_DMA);
-		free(entry->busaddr, DRM_MEM_PAGES);
-		free(entry, DRM_MEM_SGLISTS);
+		drm_sg_cleanup(entry);
 		return ENOMEM;
 	}
 
 	ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr,
 	    BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map);
 	if (ret != 0) {
-		bus_dma_tag_destroy(dmah->tag);
-		free(dmah, DRM_MEM_DMA);
-		free(entry->busaddr, DRM_MEM_PAGES);
-		free(entry, DRM_MEM_SGLISTS);
+		drm_sg_cleanup(entry);
 		return ENOMEM;
 	}
 
+	entry->handle = (unsigned long)dmah->vaddr;
+	entry->virtual = dmah->vaddr;
+
 	ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr,
 	    request->size, drm_sg_alloc_cb, entry, BUS_DMA_NOWAIT);
 	if (ret != 0) {
-		bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
-		bus_dma_tag_destroy(dmah->tag);
-		free(dmah, DRM_MEM_DMA);
-		free(entry->busaddr, DRM_MEM_PAGES);
-		free(entry, DRM_MEM_SGLISTS);
+		drm_sg_cleanup(entry);
 		return ENOMEM;
 	}
 
-	entry->dmah = dmah;
-	entry->handle = (unsigned long)dmah->vaddr;
-	
-	DRM_DEBUG("sg alloc handle  = %08lx\n", entry->handle);
-
-	entry->virtual = (void *)entry->handle;
-	request->handle = entry->handle;
-
 	DRM_LOCK();
 	if (dev->sg) {
 		DRM_UNLOCK();
@@ -129,6 +100,11 @@ drm_sg_alloc(struct drm_device *dev, str
 	dev->sg = entry;
 	DRM_UNLOCK();
 
+	DRM_DEBUG("handle=%08lx, kva=%p, contents=%08lx\n", entry->handle,
+	    entry->virtual, *(unsigned long *)entry->virtual);
+
+	request->handle = entry->handle;
+
 	return 0;
 }
 
@@ -143,6 +119,8 @@ drm_sg_alloc_cb(void *arg, bus_dma_segme
 
 	for(i = 0 ; i < nsegs ; i++) {
 		entry->busaddr[i] = segs[i].ds_addr;
+		DRM_DEBUG("segment %d @ 0x%016lx\n", i,
+		    (unsigned long)segs[i].ds_addr);
 	}
 }
 
@@ -162,9 +140,12 @@ drm_sg_cleanup(struct drm_sg_mem *entry)
 {
 	struct drm_dma_handle *dmah = entry->dmah;
 
-	bus_dmamap_unload(dmah->tag, dmah->map);
-	bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
-	bus_dma_tag_destroy(dmah->tag);
+	if (dmah->map != NULL)
+		bus_dmamap_unload(dmah->tag, dmah->map);
+	if (dmah->vaddr != NULL)
+		bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
+	if (dmah->tag != NULL)
+		bus_dma_tag_destroy(dmah->tag);
 	free(dmah, DRM_MEM_DMA);
 	free(entry->busaddr, DRM_MEM_PAGES);
 	free(entry, DRM_MEM_SGLISTS);

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 18:07:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 06B5B106568B;
	Fri, 30 Oct 2009 18:07:23 +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 D0C148FC08;
	Fri, 30 Oct 2009 18:07:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UI7MBL053780;
	Fri, 30 Oct 2009 18:07:22 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UI7MQd053778;
	Fri, 30 Oct 2009 18:07:22 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200910301807.n9UI7MQd053778@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 30 Oct 2009 18:07:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198695 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 18:07:23 -0000

Author: rnoland
Date: Fri Oct 30 18:07:22 2009
New Revision: 198695
URL: http://svn.freebsd.org/changeset/base/198695

Log:
  A bit of cleanup work on radeon_freelist_get()
  
    * Fix the main loop to search all buffers before sleeping.
    * Remove dead code
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/radeon_cp.c

Modified: head/sys/dev/drm/radeon_cp.c
==============================================================================
--- head/sys/dev/drm/radeon_cp.c	Fri Oct 30 18:02:10 2009	(r198694)
+++ head/sys/dev/drm/radeon_cp.c	Fri Oct 30 18:07:22 2009	(r198695)
@@ -1860,8 +1860,8 @@ struct drm_buf *radeon_freelist_get(stru
 	for (t = 0; t < dev_priv->usec_timeout; t++) {
 		u32 done_age = GET_SCRATCH(dev_priv, 1);
 		DRM_DEBUG("done_age = %d\n", done_age);
-		for (i = start; i < dma->buf_count; i++) {
-			buf = dma->buflist[i];
+		for (i = 0; i < dma->buf_count; i++) {
+			buf = dma->buflist[start];
 			buf_priv = buf->dev_private;
 			if (buf->file_priv == NULL || (buf->pending &&
 						       buf_priv->age <=
@@ -1870,7 +1870,8 @@ struct drm_buf *radeon_freelist_get(stru
 				buf->pending = 0;
 				return buf;
 			}
-			start = 0;
+			if (++start >= dma->buf_count)
+				start = 0;
 		}
 
 		if (t) {
@@ -1879,47 +1880,9 @@ struct drm_buf *radeon_freelist_get(stru
 		}
 	}
 
-	DRM_DEBUG("returning NULL!\n");
 	return NULL;
 }
 
-#if 0
-struct drm_buf *radeon_freelist_get(struct drm_device * dev)
-{
-	struct drm_device_dma *dma = dev->dma;
-	drm_radeon_private_t *dev_priv = dev->dev_private;
-	drm_radeon_buf_priv_t *buf_priv;
-	struct drm_buf *buf;
-	int i, t;
-	int start;
-	u32 done_age;
-
-	done_age = radeon_read_ring_rptr(dev_priv, RADEON_SCRATCHOFF(1));
-	if (++dev_priv->last_buf >= dma->buf_count)
-		dev_priv->last_buf = 0;
-
-	start = dev_priv->last_buf;
-	dev_priv->stats.freelist_loops++;
-
-	for (t = 0; t < 2; t++) {
-		for (i = start; i < dma->buf_count; i++) {
-			buf = dma->buflist[i];
-			buf_priv = buf->dev_private;
-			if (buf->file_priv == 0 || (buf->pending &&
-						    buf_priv->age <=
-						    done_age)) {
-				dev_priv->stats.requested_bufs++;
-				buf->pending = 0;
-				return buf;
-			}
-		}
-		start = 0;
-	}
-
-	return NULL;
-}
-#endif
-
 void radeon_freelist_reset(struct drm_device * dev)
 {
 	struct drm_device_dma *dma = dev->dma;

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 18:08:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B78E1065694;
	Fri, 30 Oct 2009 18:08:46 +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 6A7A38FC1D;
	Fri, 30 Oct 2009 18:08:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UI8ks4053840;
	Fri, 30 Oct 2009 18:08:46 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UI8kkn053838;
	Fri, 30 Oct 2009 18:08:46 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200910301808.n9UI8kkn053838@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 30 Oct 2009 18:08:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198696 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 18:08:46 -0000

Author: rnoland
Date: Fri Oct 30 18:08:46 2009
New Revision: 198696
URL: http://svn.freebsd.org/changeset/base/198696

Log:
  Cleanup in r600_blit
  
   - Don't bother to assign vb until we know we have enough space
   - Add variables for sx2, sy2, dx2, dy2 so that these aren't
     calculated over and over, also reduce chance of errors.
   - Use switch to assign color/format
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/r600_blit.c

Modified: head/sys/dev/drm/r600_blit.c
==============================================================================
--- head/sys/dev/drm/r600_blit.c	Fri Oct 30 18:07:22 2009	(r198695)
+++ head/sys/dev/drm/r600_blit.c	Fri Oct 30 18:08:46 2009	(r198696)
@@ -1719,7 +1719,10 @@ r600_blit_copy(struct drm_device *dev,
 	u32 *vb;
 
 	vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
-		      dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
+	    dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
+	DRM_DEBUG("src=0x%016llx, dst=0x%016llx, size=%d\n",
+	    (unsigned long long)src_gpu_addr,
+	    (unsigned long long)dst_gpu_addr, size_bytes);
 
 	if ((size_bytes & 3) || (src_gpu_addr & 3) || (dst_gpu_addr & 3)) {
 		max_bytes = 8192;
@@ -1757,7 +1760,7 @@ r600_blit_copy(struct drm_device *dev,
 					return;
 				set_shaders(dev);
 				vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
-					      dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
+				    dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
 			}
 
 			vb[0] = i2f(dst_x);
@@ -1847,7 +1850,7 @@ r600_blit_copy(struct drm_device *dev,
 					return;
 				set_shaders(dev);
 				vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
-					      dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
+				    dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
 			}
 
 			vb[0] = i2f(dst_x / 4);
@@ -1913,12 +1916,10 @@ r600_blit_swap(struct drm_device *dev,
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
 	int cb_format, tex_format;
+	int sx2, sy2, dx2, dy2;
 	u64 vb_addr;
 	u32 *vb;
 
-	vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
-		      dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
-
 	if ((dev_priv->blit_vb->used + 48) > dev_priv->blit_vb->total) {
 		dev_priv->blit_vb->used = 0;
 		radeon_cp_discard_buffer(dev, dev_priv->blit_vb);
@@ -1926,20 +1927,14 @@ r600_blit_swap(struct drm_device *dev,
 		if (!dev_priv->blit_vb)
 			return;
 		set_shaders(dev);
-		vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
-			      dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
 	}
+	vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
+	    dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
 
-	if (cpp == 4) {
-		cb_format = COLOR_8_8_8_8;
-		tex_format = FMT_8_8_8_8;
-	} else if (cpp == 2) {
-		cb_format = COLOR_5_6_5;
-		tex_format = FMT_5_6_5;
-	} else {
-		cb_format = COLOR_8;
-		tex_format = FMT_8;
-	}
+	sx2 = sx + w;
+	sy2 = sy + h;
+	dx2 = dx + w;
+	dy2 = dy + h;
 
 	vb[0] = i2f(dx);
 	vb[1] = i2f(dy);
@@ -1947,31 +1942,46 @@ r600_blit_swap(struct drm_device *dev,
 	vb[3] = i2f(sy);
 
 	vb[4] = i2f(dx);
-	vb[5] = i2f(dy + h);
+	vb[5] = i2f(dy2);
 	vb[6] = i2f(sx);
-	vb[7] = i2f(sy + h);
+	vb[7] = i2f(sy2);
+
+	vb[8] = i2f(dx2);
+	vb[9] = i2f(dy2);
+	vb[10] = i2f(sx2);
+	vb[11] = i2f(sy2);
 
-	vb[8] = i2f(dx + w);
-	vb[9] = i2f(dy + h);
-	vb[10] = i2f(sx + w);
-	vb[11] = i2f(sy + h);
+	switch(cpp) {
+	case 4:
+		cb_format = COLOR_8_8_8_8;
+		tex_format = FMT_8_8_8_8;
+		break;
+	case 2:
+		cb_format = COLOR_5_6_5;
+		tex_format = FMT_5_6_5;
+		break;
+	default:
+		cb_format = COLOR_8;
+		tex_format = FMT_8;
+		break;
+	}
 
 	/* src */
 	set_tex_resource(dev_priv, tex_format,
 			 src_pitch / cpp,
-			 sy + h, src_pitch / cpp,
+			 sy2, src_pitch / cpp,
 			 src_gpu_addr);
 
 	cp_set_surface_sync(dev_priv,
-			    R600_TC_ACTION_ENA, (src_pitch * (sy + h)), src_gpu_addr);
+			    R600_TC_ACTION_ENA, src_pitch * sy2, src_gpu_addr);
 
 	/* dst */
 	set_render_target(dev_priv, cb_format,
-			  dst_pitch / cpp, dy + h,
+			  dst_pitch / cpp, dy2,
 			  dst_gpu_addr);
 
 	/* scissors */
-	set_scissors(dev_priv, dx, dy, dx + w, dy + h);
+	set_scissors(dev_priv, dx, dy, dx2, dy2);
 
 	/* Vertex buffer setup */
 	vb_addr = dev_priv->gart_buffers_offset +
@@ -1984,7 +1994,7 @@ r600_blit_swap(struct drm_device *dev,
 
 	cp_set_surface_sync(dev_priv,
 			    R600_CB_ACTION_ENA | R600_CB0_DEST_BASE_ENA,
-			    dst_pitch * (dy + h), dst_gpu_addr);
+			    dst_pitch * dy2, dst_gpu_addr);
 
 	dev_priv->blit_vb->used += 12 * 4;
 }

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 18:30:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0C9CA106566B;
	Fri, 30 Oct 2009 18:30:14 +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 EFDBD8FC19;
	Fri, 30 Oct 2009 18:30:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UIUDFJ054355;
	Fri, 30 Oct 2009 18:30:13 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UIUDFJ054353;
	Fri, 30 Oct 2009 18:30:13 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200910301830.n9UIUDFJ054353@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 30 Oct 2009 18:30:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198697 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 18:30:14 -0000

Author: rnoland
Date: Fri Oct 30 18:30:13 2009
New Revision: 198697
URL: http://svn.freebsd.org/changeset/base/198697

Log:
  Fix botched git -> svn merge.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/drm/drm_scatter.c

Modified: head/sys/dev/drm/drm_scatter.c
==============================================================================
--- head/sys/dev/drm/drm_scatter.c	Fri Oct 30 18:08:46 2009	(r198696)
+++ head/sys/dev/drm/drm_scatter.c	Fri Oct 30 18:30:13 2009	(r198697)
@@ -65,7 +65,7 @@ drm_sg_alloc(struct drm_device *dev, str
 	ret = bus_dma_tag_create(NULL, PAGE_SIZE, 0, /* tag, align, boundary */
 	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */
 	    NULL, NULL, /* filtfunc, filtfuncargs */
-	    request->size, pages, /* maxsize, nsegs */
+	    request->size, entry->pages, /* maxsize, nsegs */
 	    PAGE_SIZE, 0, /* maxsegsize, flags */
 	    NULL, NULL, /* lockfunc, lockfuncargs */
 	    &dmah->tag);

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 20:28:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E2BB106566B;
	Fri, 30 Oct 2009 20:28:50 +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 3C8E28FC0A;
	Fri, 30 Oct 2009 20:28:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UKSnVX056828;
	Fri, 30 Oct 2009 20:28:49 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UKSnce056824;
	Fri, 30 Oct 2009 20:28:49 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910302028.n9UKSnce056824@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 30 Oct 2009 20:28:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198700 - in head/sys/dev/ata: . chipsets
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 20:28:50 -0000

Author: mav
Date: Fri Oct 30 20:28:49 2009
New Revision: 198700
URL: http://svn.freebsd.org/changeset/base/198700

Log:
  Add support for different request block format used by Gen-IIe Marvell SATA.
  This adds support for Marvell 6042/7042 chips and Adaptec 1430SA controller.

Modified:
  head/sys/dev/ata/ata-pci.h
  head/sys/dev/ata/chipsets/ata-adaptec.c
  head/sys/dev/ata/chipsets/ata-marvell.c

Modified: head/sys/dev/ata/ata-pci.h
==============================================================================
--- head/sys/dev/ata/ata-pci.h	Fri Oct 30 19:59:50 2009	(r198699)
+++ head/sys/dev/ata/ata-pci.h	Fri Oct 30 20:28:49 2009	(r198700)
@@ -97,6 +97,7 @@ struct ata_pci_controller {
 
 #define ATA_ADAPTEC_ID          0x9005
 #define ATA_ADAPTEC_1420        0x02419005
+#define ATA_ADAPTEC_1430        0x02439005
 
 #define ATA_ATI_ID              0x1002
 #define ATA_ATI_IXP200          0x43491002
@@ -216,7 +217,9 @@ struct ata_pci_controller {
 #define ATA_M88SX5080           0x508011ab
 #define ATA_M88SX5081           0x508111ab
 #define ATA_M88SX6041           0x604111ab
+#define ATA_M88SX6042           0x604211ab
 #define ATA_M88SX6081           0x608111ab
+#define ATA_M88SX7042           0x704211ab
 #define ATA_M88SX6101           0x610111ab
 #define ATA_M88SX6121           0x612111ab
 #define ATA_M88SX6145           0x614511ab

Modified: head/sys/dev/ata/chipsets/ata-adaptec.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-adaptec.c	Fri Oct 30 19:59:50 2009	(r198699)
+++ head/sys/dev/ata/chipsets/ata-adaptec.c	Fri Oct 30 20:28:49 2009	(r198700)
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
 
 /* misc defines */
 #define MV_60XX		60		//must match ata_marvell.c's definition
+#define MV_7042		72		//must match ata_marvell.c's definition
 
 
 /*
@@ -64,6 +65,7 @@ ata_adaptec_probe(device_t dev)
     struct ata_pci_controller *ctlr = device_get_softc(dev);
     static struct ata_chip_id ids[] =
     {{ ATA_ADAPTEC_1420, 0, 4, MV_60XX, ATA_SA300, "1420SA" },
+     { ATA_ADAPTEC_1430, 0, 4, MV_7042, ATA_SA300, "1430SA" },
      { 0, 0, 0, 0, 0, 0}};
 
     if (pci_get_vendor(dev) != ATA_ADAPTEC_ID)

Modified: head/sys/dev/ata/chipsets/ata-marvell.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-marvell.c	Fri Oct 30 19:59:50 2009	(r198699)
+++ head/sys/dev/ata/chipsets/ata-marvell.c	Fri Oct 30 20:28:49 2009	(r198700)
@@ -67,6 +67,8 @@ static void ata_marvell_edma_dmainit(dev
 /* misc defines */
 #define MV_50XX		50
 #define MV_60XX		60
+#define MV_6042		62
+#define MV_7042		72
 #define MV_61XX		61
 
 
@@ -102,7 +104,9 @@ ata_marvell_probe(device_t dev)
      { ATA_M88SX5080, 0, 8, MV_50XX, ATA_SA150, "88SX5080" },
      { ATA_M88SX5081, 0, 8, MV_50XX, ATA_SA150, "88SX5081" },
      { ATA_M88SX6041, 0, 4, MV_60XX, ATA_SA300, "88SX6041" },
+     { ATA_M88SX6042, 0, 4, MV_6042, ATA_SA300, "88SX6042" },
      { ATA_M88SX6081, 0, 8, MV_60XX, ATA_SA300, "88SX6081" },
+     { ATA_M88SX7042, 0, 4, MV_7042, ATA_SA300, "88SX7042" },
      { ATA_M88SX6101, 0, 1, MV_61XX, ATA_UDMA6, "88SX6101" },
      { ATA_M88SX6121, 0, 1, MV_61XX, ATA_UDMA6, "88SX6121" },
      { ATA_M88SX6145, 0, 2, MV_61XX, ATA_UDMA6, "88SX6145" },
@@ -119,6 +123,8 @@ ata_marvell_probe(device_t dev)
     switch (ctlr->chip->cfg2) {
     case MV_50XX:
     case MV_60XX:
+    case MV_6042:
+    case MV_7042:
 	ctlr->chipinit = ata_marvell_edma_chipinit;
 	break;
     case MV_61XX:
@@ -251,6 +257,8 @@ ata_marvell_edma_ch_attach(device_t dev)
 	ch->r_io[ATA_SCONTROL].offset = 0x00108 + ATA_MV_HOST_BASE(ch);
 	break;
     case MV_60XX:
+    case MV_6042:
+    case MV_7042:
 	ch->r_io[ATA_SSTATUS].res = ctlr->r_res1;
 	ch->r_io[ATA_SSTATUS].offset =  0x02300 + ATA_MV_EDMA_BASE(ch);
 	ch->r_io[ATA_SERROR].res = ctlr->r_res1;
@@ -384,35 +392,61 @@ ata_marvell_edma_begin_transaction(struc
 	request->dma->sg_bus & 0xffffffff);
     le32enc(bytep + 1 * sizeof(u_int32_t),
 	(u_int64_t)request->dma->sg_bus >> 32);
-    le16enc(bytep + 4 * sizeof(u_int16_t),
-	(request->flags & ATA_R_READ ? 0x01 : 0x00) | (request->tag << 1));
-
-    i = 10;
-    bytep[i++] = (request->u.ata.count >> 8) & 0xff;
-    bytep[i++] = 0x10 | ATA_COUNT;
-    bytep[i++] = request->u.ata.count & 0xff;
-    bytep[i++] = 0x10 | ATA_COUNT;
-
-    bytep[i++] = (request->u.ata.lba >> 24) & 0xff;
-    bytep[i++] = 0x10 | ATA_SECTOR;
-    bytep[i++] = request->u.ata.lba & 0xff;
-    bytep[i++] = 0x10 | ATA_SECTOR;
-
-    bytep[i++] = (request->u.ata.lba >> 32) & 0xff;
-    bytep[i++] = 0x10 | ATA_CYL_LSB;
-    bytep[i++] = (request->u.ata.lba >> 8) & 0xff;
-    bytep[i++] = 0x10 | ATA_CYL_LSB;
-
-    bytep[i++] = (request->u.ata.lba >> 40) & 0xff;
-    bytep[i++] = 0x10 | ATA_CYL_MSB;
-    bytep[i++] = (request->u.ata.lba >> 16) & 0xff;
-    bytep[i++] = 0x10 | ATA_CYL_MSB;
-
-    bytep[i++] = ATA_D_LBA | ATA_D_IBM | ((request->u.ata.lba >> 24) & 0xf);
-    bytep[i++] = 0x10 | ATA_DRIVE;
-
-    bytep[i++] = request->u.ata.command;
-    bytep[i++] = 0x90 | ATA_COMMAND;
+    if (ctlr->chip->cfg2 != MV_6042 && ctlr->chip->cfg2 != MV_7042) {
+	    le16enc(bytep + 4 * sizeof(u_int16_t),
+		(request->flags & ATA_R_READ ? 0x01 : 0x00) | (request->tag << 1));
+
+	    i = 10;
+	    bytep[i++] = (request->u.ata.count >> 8) & 0xff;
+	    bytep[i++] = 0x10 | ATA_COUNT;
+	    bytep[i++] = request->u.ata.count & 0xff;
+	    bytep[i++] = 0x10 | ATA_COUNT;
+
+	    bytep[i++] = (request->u.ata.lba >> 24) & 0xff;
+	    bytep[i++] = 0x10 | ATA_SECTOR;
+	    bytep[i++] = request->u.ata.lba & 0xff;
+	    bytep[i++] = 0x10 | ATA_SECTOR;
+
+	    bytep[i++] = (request->u.ata.lba >> 32) & 0xff;
+	    bytep[i++] = 0x10 | ATA_CYL_LSB;
+	    bytep[i++] = (request->u.ata.lba >> 8) & 0xff;
+	    bytep[i++] = 0x10 | ATA_CYL_LSB;
+
+	    bytep[i++] = (request->u.ata.lba >> 40) & 0xff;
+	    bytep[i++] = 0x10 | ATA_CYL_MSB;
+	    bytep[i++] = (request->u.ata.lba >> 16) & 0xff;
+	    bytep[i++] = 0x10 | ATA_CYL_MSB;
+
+	    bytep[i++] = ATA_D_LBA | ATA_D_IBM | ((request->u.ata.lba >> 24) & 0xf);
+	    bytep[i++] = 0x10 | ATA_DRIVE;
+
+	    bytep[i++] = request->u.ata.command;
+	    bytep[i++] = 0x90 | ATA_COMMAND;
+    } else {
+	    le32enc(bytep + 2 * sizeof(u_int32_t),
+		(request->flags & ATA_R_READ ? 0x01 : 0x00) | (request->tag << 1));
+
+	    i = 16;
+	    bytep[i++] = 0;
+	    bytep[i++] = 0;
+	    bytep[i++] = request->u.ata.command;
+	    bytep[i++] = request->u.ata.feature & 0xff;
+
+	    bytep[i++] = request->u.ata.lba & 0xff;
+	    bytep[i++] = (request->u.ata.lba >> 8) & 0xff;
+	    bytep[i++] = (request->u.ata.lba >> 16) & 0xff;
+	    bytep[i++] = ATA_D_LBA | ATA_D_IBM | ((request->u.ata.lba >> 24) & 0x0f);
+
+	    bytep[i++] = (request->u.ata.lba >> 24) & 0xff;
+	    bytep[i++] = (request->u.ata.lba >> 32) & 0xff;
+	    bytep[i++] = (request->u.ata.lba >> 40) & 0xff;
+	    bytep[i++] = (request->u.ata.feature >> 8) & 0xff;
+
+	    bytep[i++] = request->u.ata.count & 0xff;
+	    bytep[i++] = (request->u.ata.count >> 8) & 0xff;
+	    bytep[i++] = 0;
+	    bytep[i++] = 0;
+    }
 
     bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
 	BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
@@ -557,7 +591,8 @@ ata_marvell_edma_dmainit(device_t dev)
 	ch->dma.max_address = BUS_SPACE_MAXADDR;
 
     /* chip does not reliably do 64K DMA transfers */
-    ch->dma.max_iosize = 64 * DEV_BSIZE; 
+    if (ctlr->chip->cfg2 == MV_50XX || ctlr->chip->cfg2 == MV_60XX)
+	ch->dma.max_iosize = 64 * DEV_BSIZE; 
 }
 
 ATA_DECLARE_DRIVER(ata_marvell);

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 21:54:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 15A5C1065670;
	Fri, 30 Oct 2009 21:54:54 +0000 (UTC)
	(envelope-from mckusick@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 04E2E8FC13;
	Fri, 30 Oct 2009 21:54:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9ULsrU2058508;
	Fri, 30 Oct 2009 21:54:53 GMT
	(envelope-from mckusick@svn.freebsd.org)
Received: (from mckusick@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ULsrvF058506;
	Fri, 30 Oct 2009 21:54:53 GMT
	(envelope-from mckusick@svn.freebsd.org)
Message-Id: <200910302154.n9ULsrvF058506@svn.freebsd.org>
From: Kirk McKusick 
Date: Fri, 30 Oct 2009 21:54:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198702 - head/usr.bin/logger
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 21:54:54 -0000

Author: mckusick
Date: Fri Oct 30 21:54:53 2009
New Revision: 198702
URL: http://svn.freebsd.org/changeset/base/198702

Log:
  When reading input from a file or device (via -f option) set the
  input to be in non-buffering mode so that input lines are logged
  as they occur rather than being saved up until a buffer's worth of
  input has been logged.

Modified:
  head/usr.bin/logger/logger.c

Modified: head/usr.bin/logger/logger.c
==============================================================================
--- head/usr.bin/logger/logger.c	Fri Oct 30 21:00:58 2009	(r198701)
+++ head/usr.bin/logger/logger.c	Fri Oct 30 21:54:53 2009	(r198702)
@@ -114,6 +114,7 @@ main(int argc, char *argv[])
 		case 'f':		/* file to log */
 			if (freopen(optarg, "r", stdin) == NULL)
 				err(1, "%s", optarg);
+			setvbuf(stdin, 0, _IONBF, 0);
 			break;
 		case 'h':		/* hostname to deliver to */
 			host = optarg;

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 30 23:33:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3C2F1065670;
	Fri, 30 Oct 2009 23:33:06 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E12928FC08;
	Fri, 30 Oct 2009 23:33:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UNX6gh061976;
	Fri, 30 Oct 2009 23:33:06 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UNX6BX061974;
	Fri, 30 Oct 2009 23:33:06 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <200910302333.n9UNX6BX061974@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Fri, 30 Oct 2009 23:33:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198703 - in head/sys/cddl: compat/opensolaris/sys
	contrib/opensolaris/uts/common/fs/zfs
	contrib/opensolaris/uts/common/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 30 Oct 2009 23:33:07 -0000

Author: pjd
Date: Fri Oct 30 23:33:06 2009
New Revision: 198703
URL: http://svn.freebsd.org/changeset/base/198703

Log:
  - zfs_zaccess() can handle VAPPEND too, so map V_APPEND to VAPPEND and call
    zfs_access() instead of vaccess() in this case as well.
  - If VADMIN is specified with another V* flag (unlikely) call both
    zfs_access() and vaccess() after spliting V* flags.
  
  This fixes "dirtying snapshot!" panic.
  
  PR:		kern/139806
  Reported by:	Carl Chave 
  In co-operation with:	jh
  MFC after:	3 days

Modified:
  head/sys/cddl/compat/opensolaris/sys/vnode.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h

Modified: head/sys/cddl/compat/opensolaris/sys/vnode.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/vnode.h	Fri Oct 30 21:54:53 2009	(r198702)
+++ head/sys/cddl/compat/opensolaris/sys/vnode.h	Fri Oct 30 23:33:06 2009	(r198703)
@@ -57,6 +57,8 @@ typedef	struct vop_vector	vnodeops_t;
 
 #define	v_count	v_usecount
 
+#define	V_APPEND	VAPPEND
+
 static __inline int
 vn_is_readonly(vnode_t *vp)
 {

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Fri Oct 30 21:54:53 2009	(r198702)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Fri Oct 30 23:33:06 2009	(r198703)
@@ -3989,21 +3989,33 @@ zfs_freebsd_access(ap)
 		struct thread *a_td;
 	} */ *ap;
 {
+	accmode_t accmode;
+	int error = 0;
 
 	/*
-	 * ZFS itself only knowns about VREAD, VWRITE and VEXEC, the rest
-	 * we have to handle by calling vaccess().
+	 * ZFS itself only knowns about VREAD, VWRITE, VEXEC and VAPPEND,
 	 */
-	if ((ap->a_accmode & ~(VREAD|VWRITE|VEXEC)) != 0) {
-		vnode_t *vp = ap->a_vp;
-		znode_t *zp = VTOZ(vp);
-		znode_phys_t *zphys = zp->z_phys;
+	accmode = ap->a_accmode & (VREAD|VWRITE|VEXEC|VAPPEND);
+	if (accmode != 0)
+		error = zfs_access(ap->a_vp, accmode, 0, ap->a_cred, NULL);
 
-		return (vaccess(vp->v_type, zphys->zp_mode, zphys->zp_uid,
-		    zphys->zp_gid, ap->a_accmode, ap->a_cred, NULL));
+	/*
+	 * VADMIN has to be handled by vaccess().
+	 */
+	if (error == 0) {
+		accmode = ap->a_accmode & ~(VREAD|VWRITE|VEXEC|VAPPEND);
+		if (accmode != 0) {
+			vnode_t *vp = ap->a_vp;
+			znode_t *zp = VTOZ(vp);
+			znode_phys_t *zphys = zp->z_phys;
+
+			error = vaccess(vp->v_type, zphys->zp_mode,
+			    zphys->zp_uid, zphys->zp_gid, accmode, ap->a_cred,
+			    NULL);
+		}
 	}
 
-	return (zfs_access(ap->a_vp, ap->a_accmode, 0, ap->a_cred, NULL));
+	return (error);
 }
 
 static int

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h	Fri Oct 30 21:54:53 2009	(r198702)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h	Fri Oct 30 23:33:06 2009	(r198703)
@@ -304,7 +304,6 @@ typedef struct xvattr {
  * VOP_ACCESS flags
  */
 #define	V_ACE_MASK	0x1	/* mask represents  NFSv4 ACE permissions */
-#define	V_APPEND	0x2	/* want to do append only check */
 
 /*
  * Flags for vnode operations.

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 09:03:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EFE5D106568B;
	Sat, 31 Oct 2009 09:03:48 +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 A9B558FC1A;
	Sat, 31 Oct 2009 09:03:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9V93mUA076416;
	Sat, 31 Oct 2009 09:03:48 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9V93m6m076414;
	Sat, 31 Oct 2009 09:03:48 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910310903.n9V93m6m076414@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 31 Oct 2009 09:03:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198705 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 09:03:49 -0000

Author: mav
Date: Sat Oct 31 09:03:48 2009
New Revision: 198705
URL: http://svn.freebsd.org/changeset/base/198705

Log:
  MFp4:
  Ensure target/lun passed from user-level supported on this bus.
  Scanning unsupported IDs causes different issues from duplicate
  devices to system crash.

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Sat Oct 31 06:35:40 2009	(r198704)
+++ head/sys/cam/cam_xpt.c	Sat Oct 31 09:03:48 2009	(r198705)
@@ -452,7 +452,34 @@ xptioctl(struct cdev *dev, u_long cmd, c
 			ccb = xpt_alloc_ccb();
 
 			CAM_SIM_LOCK(bus->sim);
-
+			/* Ensure passed in target/lun supported on this bus. */
+			if ((inccb->ccb_h.target_id != CAM_TARGET_WILDCARD) ||
+			    (inccb->ccb_h.target_lun != CAM_LUN_WILDCARD)) {
+				if (xpt_create_path(&ccb->ccb_h.path,
+					    xpt_periph,
+					    inccb->ccb_h.path_id,
+					    CAM_TARGET_WILDCARD,
+					    CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
+					error = EINVAL;
+					CAM_SIM_UNLOCK(bus->sim);
+					xpt_free_ccb(ccb);
+					break;
+				}
+				xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path,
+				    inccb->ccb_h.pinfo.priority);
+				ccb->ccb_h.func_code = XPT_PATH_INQ;
+				xpt_action(ccb);
+				xpt_free_path(ccb->ccb_h.path);
+				if ((inccb->ccb_h.target_id != CAM_TARGET_WILDCARD &&
+				    inccb->ccb_h.target_id > ccb->cpi.max_target) ||
+				    (inccb->ccb_h.target_lun != CAM_LUN_WILDCARD &&
+				    inccb->ccb_h.target_lun > ccb->cpi.max_lun)) {
+					error = EINVAL;
+					CAM_SIM_UNLOCK(bus->sim);
+					xpt_free_ccb(ccb);
+					break;
+				}
+			}
 			/*
 			 * Create a path using the bus, target, and lun the
 			 * user passed in.

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 10:35:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E50D9106568B;
	Sat, 31 Oct 2009 10:35:41 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D50D18FC22;
	Sat, 31 Oct 2009 10:35:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VAZfkc082934;
	Sat, 31 Oct 2009 10:35:41 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VAZfIb082932;
	Sat, 31 Oct 2009 10:35:41 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200910311035.n9VAZfIb082932@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 31 Oct 2009 10:35:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198706 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 10:35:42 -0000

Author: ed
Date: Sat Oct 31 10:35:41 2009
New Revision: 198706
URL: http://svn.freebsd.org/changeset/base/198706

Log:
  Turn unused structure fields of cdevsw into spares.
  
  d_uid, d_gid and d_mode are unused, because permissions are stored in
  cdevpriv nowadays. d_kind doesn't seem to be used at all. We no longer
  keep a list of cdevsw's, so d_list is also unused.
  
  uid_t and gid_t are 32 bits, but mode_t is 16 bits, Because of alignment
  constraints of d_kind, we can safely turn it into three 32-bit integers.
  d_kind and d_list is equal in size to three pointers.
  
  Discussed with:	kib

Modified:
  head/sys/sys/conf.h

Modified: head/sys/sys/conf.h
==============================================================================
--- head/sys/sys/conf.h	Sat Oct 31 09:03:48 2009	(r198705)
+++ head/sys/sys/conf.h	Sat Oct 31 10:35:41 2009	(r198706)
@@ -210,15 +210,13 @@ struct cdevsw {
 	d_kqfilter_t		*d_kqfilter;
 	d_purge_t		*d_purge;
 	d_mmap_single_t		*d_mmap_single;
-	uid_t			d_uid;
-	gid_t			d_gid;
-	mode_t			d_mode;
-	const char		*d_kind;
+
+	int32_t			d_spare0[3];
+	void			*d_spare1[3];
 
 	/* These fields should not be messed with by drivers */
-	LIST_ENTRY(cdevsw)	d_list;
 	LIST_HEAD(, cdev)	d_devs;
-	int			d_spare3;
+	int			d_spare2;
 	union {
 		struct cdevsw		*gianttrick;
 		SLIST_ENTRY(cdevsw)	postfree_list;

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 10:38:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E85371065676;
	Sat, 31 Oct 2009 10:38:30 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BE4CF8FC19;
	Sat, 31 Oct 2009 10:38:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VAcUaC083172;
	Sat, 31 Oct 2009 10:38:30 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VAcU3h083170;
	Sat, 31 Oct 2009 10:38:30 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200910311038.n9VAcU3h083170@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 31 Oct 2009 10:38:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198707 - head/sys/i386/bios
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 10:38:31 -0000

Author: ed
Date: Sat Oct 31 10:38:30 2009
New Revision: 198707
URL: http://svn.freebsd.org/changeset/base/198707

Log:
  Unobfuscate unit number handling in apm(4).
  
  There is no need to use the lower 4 bits of the unit number to store the
  device type number. Just use 0 and 1 to distinguish them. devfs also
  guarantees that there can never be an open call on a device that has a
  unit number different to 0 and 1, so there is no need to check for this
  in open().

Modified:
  head/sys/i386/bios/apm.c

Modified: head/sys/i386/bios/apm.c
==============================================================================
--- head/sys/i386/bios/apm.c	Sat Oct 31 10:35:41 2009	(r198706)
+++ head/sys/i386/bios/apm.c	Sat Oct 31 10:38:30 2009	(r198707)
@@ -79,9 +79,8 @@ int	apm_evindex;
 #define	SCFLAG_OCTL	0x0000002
 #define	SCFLAG_OPEN	(SCFLAG_ONORMAL|SCFLAG_OCTL)
 
-#define APMDEV(dev)	(dev2unit(dev)&0x0f)
 #define APMDEV_NORMAL	0
-#define APMDEV_CTL	8
+#define APMDEV_CTL	1
 
 #ifdef PC98
 extern int bios32_apm98(struct bios_regs *, u_int, u_short);
@@ -1249,8 +1248,10 @@ apm_attach(device_t dev)
 	sc->suspending = 0;
 	sc->running = 0;
 
-	make_dev(&apm_cdevsw, 0, 0, 5, 0664, "apm");
-	make_dev(&apm_cdevsw, 8, 0, 5, 0660, "apmctl");
+	make_dev(&apm_cdevsw, APMDEV_NORMAL,
+	    UID_ROOT, GID_OPERATOR, 0664, "apm");
+	make_dev(&apm_cdevsw, APMDEV_CTL,
+	    UID_ROOT, GID_OPERATOR, 0660, "apmctl");
 	return 0;
 }
 
@@ -1258,12 +1259,11 @@ static int
 apmopen(struct cdev *dev, int flag, int fmt, struct thread *td)
 {
 	struct apm_softc *sc = &apm_softc;
-	int ctl = APMDEV(dev);
 
 	if (sc == NULL || sc->initialized == 0)
 		return (ENXIO);
 
-	switch (ctl) {
+	switch (dev2unit(dev)) {
 	case APMDEV_CTL:
 		if (!(flag & FWRITE))
 			return EINVAL;
@@ -1275,9 +1275,6 @@ apmopen(struct cdev *dev, int flag, int 
 	case APMDEV_NORMAL:
 		sc->sc_flags |= SCFLAG_ONORMAL;
 		break;
-	default:
-		return ENXIO;
-		break;
 	}
 	return 0;
 }
@@ -1286,9 +1283,8 @@ static int
 apmclose(struct cdev *dev, int flag, int fmt, struct thread *td)
 {
 	struct apm_softc *sc = &apm_softc;
-	int ctl = APMDEV(dev);
 
-	switch (ctl) {
+	switch (dev2unit(dev)) {
 	case APMDEV_CTL:
 		apm_lastreq_rejected();
 		sc->sc_flags &= ~SCFLAG_OCTL;
@@ -1429,7 +1425,7 @@ apmioctl(struct cdev *dev, u_long cmd, c
 	}
 
 	/* for /dev/apmctl */
-	if (APMDEV(dev) == APMDEV_CTL) {
+	if (dev2unit(dev) == APMDEV_CTL) {
 		struct apm_event_info *evp;
 		int i;
 
@@ -1468,7 +1464,7 @@ apmwrite(struct cdev *dev, struct uio *u
 	int error;
 	u_char enabled;
 
-	if (APMDEV(dev) != APMDEV_CTL)
+	if (dev2unit(dev) != APMDEV_CTL)
 		return(ENODEV);
 	if (uio->uio_resid != sizeof(u_int))
 		return(E2BIG);

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 10:43:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E526E106566C;
	Sat, 31 Oct 2009 10:43:38 +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 C2C7C8FC08;
	Sat, 31 Oct 2009 10:43:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VAhcuK083574;
	Sat, 31 Oct 2009 10:43:38 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VAhc19083569;
	Sat, 31 Oct 2009 10:43:38 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910311043.n9VAhc19083569@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 31 Oct 2009 10:43:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198708 - in head/sys/cam: . ata scsi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 10:43:39 -0000

Author: mav
Date: Sat Oct 31 10:43:38 2009
New Revision: 198708
URL: http://svn.freebsd.org/changeset/base/198708

Log:
  MFp4:
  - Reduce code duplication in ATA XPT and PMP driver.
  - Move PIO size setting from ada driver to ATA XPT. It is XPT business
  to negotiate transfer details. ada driver is now stateless.
  - Report PIO size to SIM. It is required for correct PATA SIM operation.
  - Tune PMP scan timings. It workarounds some problems with SiI.
  - If reset hapens during PMP initialization - restart it.
  - Introduce early-initialized periph drivers, which are used during initial
  scan process. Use it for xpt, probe, aprobe and pmp. It gives pmp chance
  to finish scan before mountroot and numerate devices in right order.

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_pmp.c
  head/sys/cam/ata/ata_xpt.c
  head/sys/cam/cam.h
  head/sys/cam/cam_ccb.h
  head/sys/cam/cam_periph.h
  head/sys/cam/cam_xpt.c
  head/sys/cam/scsi/scsi_da.c
  head/sys/cam/scsi/scsi_sg.c
  head/sys/cam/scsi/scsi_xpt.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Sat Oct 31 10:38:30 2009	(r198707)
+++ head/sys/cam/ata/ata_da.c	Sat Oct 31 10:43:38 2009	(r198708)
@@ -63,8 +63,7 @@ __FBSDID("$FreeBSD$");
 #define ATA_MAX_28BIT_LBA               268435455UL
 
 typedef enum {
-	ADA_STATE_NORMAL,
-	ADA_STATE_SET_MULTI
+	ADA_STATE_NORMAL
 } ada_state;
 
 typedef enum {
@@ -84,7 +83,6 @@ typedef enum {
 } ada_quirks;
 
 typedef enum {
-	ADA_CCB_SET_MULTI	= 0x01,
 	ADA_CCB_BUFFER_IO	= 0x03,
 	ADA_CCB_WAITING		= 0x04,
 	ADA_CCB_DUMP		= 0x05,
@@ -112,7 +110,6 @@ struct ada_softc {
 	ada_quirks quirks;
 	int	 ordered_tag_count;
 	int	 outstanding_cmds;
-	int	 secsperint;
 	struct	 disk_params params;
 	struct	 disk *disk;
 	union	 ccb saved_ccb;
@@ -550,22 +547,6 @@ adaasync(void *callback_arg, u_int32_t c
 				"due to status 0x%x\n", status);
 		break;
 	}
-	case AC_SENT_BDR:
-	case AC_BUS_RESET:
-	{
-		struct ada_softc *softc = (struct ada_softc *)periph->softc;
-
-		cam_periph_async(periph, code, path, arg);
-		if (softc->state != ADA_STATE_NORMAL)
-			break;
-		/*
-		 * Restore device configuration.
-		 */
-		softc->state = ADA_STATE_SET_MULTI;
-		cam_periph_acquire(periph);
-		xpt_schedule(periph, CAM_PRIORITY_DEV);
-		break;
-	}
 	default:
 		cam_periph_async(periph, code, path, arg);
 		break;
@@ -644,8 +625,7 @@ adaregister(struct cam_periph *periph, v
 	if (cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ &&
 	    cgd->ident_data.queue >= 31)
 		softc->flags |= ADA_FLAG_CAN_NCQ;
-	softc->secsperint = max(1, min(cgd->ident_data.sectors_intr, 16));
-	softc->state = ADA_STATE_SET_MULTI;
+	softc->state = ADA_STATE_NORMAL;
 
 	periph->softc = softc;
 
@@ -734,18 +714,10 @@ adaregister(struct cam_periph *periph, v
 	 * them and the only alternative would be to
 	 * not attach the device on failure.
 	 */
-	xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE,
+	xpt_register_async(AC_LOST_DEVICE,
 			   adaasync, periph, periph->path);
 
 	/*
-	 * Take an exclusive refcount on the periph while adastart is called
-	 * to finish the probe.  The reference will be dropped in adadone at
-	 * the end of probe.
-	 */
-	cam_periph_acquire(periph);
-	xpt_schedule(periph, /*priority*/5);
-
-	/*
 	 * Schedule a periodic event to occasionally send an
 	 * ordered tag to a device.
 	 */
@@ -901,21 +873,6 @@ adastart(struct cam_periph *periph, unio
 		}
 		break;
 	}
-	case ADA_STATE_SET_MULTI:
-	{
-		cam_fill_ataio(ataio,
-		    ada_retry_count,
-		    adadone,
-		    CAM_DIR_NONE,
-		    0,
-		    NULL,
-		    0,
-		    ada_default_timeout*1000);
-
-		ata_28bit_cmd(ataio, ATA_SET_MULTI, 0, 0, softc->secsperint);
-		start_ccb->ccb_h.ccb_state = ADA_CCB_SET_MULTI;
-		xpt_action(start_ccb);
-	}
 	}
 }
 
@@ -1003,35 +960,6 @@ adadone(struct cam_periph *periph, union
 		wakeup(&done_ccb->ccb_h.cbfcnp);
 		return;
 	}
-	case ADA_CCB_SET_MULTI:
-	{
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-		} else {
-			int	error;
-
-			error = adaerror(done_ccb, 0, 0);
-			if (error == ERESTART) {
-				/* A retry was scheduled, so just return. */
-				return;
-			}
-		}
-		softc->state = ADA_STATE_NORMAL;
-		/*
-		 * Since our peripheral may be invalidated by an error
-		 * above or an external event, we must release our CCB
-		 * before releasing the probe lock on the peripheral.
-		 * The peripheral will only go away once the last lock
-		 * is removed, and we need it around for the CCB release
-		 * operation.
-		 */
-		xpt_release_ccb(done_ccb);
-		if (bioq_first(&softc->bio_queue) != NULL) {
-			/* Have more work to do, so ensure we stay scheduled */
-			xpt_schedule(periph, CAM_PRIORITY_NORMAL);
-		}
-		cam_periph_release_locked(periph);
-		return;
-	}
 	case ADA_CCB_DUMP:
 		/* No-op.  We're polling */
 		return;

Modified: head/sys/cam/ata/ata_pmp.c
==============================================================================
--- head/sys/cam/ata/ata_pmp.c	Sat Oct 31 10:38:30 2009	(r198707)
+++ head/sys/cam/ata/ata_pmp.c	Sat Oct 31 10:43:38 2009	(r198708)
@@ -93,7 +93,9 @@ struct pmp_softc {
 	int			pm_step;
 	int			pm_try;
 	int			found;
+	int			reset;
 	int			frozen;
+	int			restart;
 	union			ccb saved_ccb;
 	struct task		sysctl_task;
 	struct sysctl_ctx_list	sysctl_ctx;
@@ -134,7 +136,8 @@ TUNABLE_INT("kern.cam.pmp.default_timeou
 static struct periph_driver pmpdriver =
 {
 	pmpinit, "pmp",
-	TAILQ_HEAD_INITIALIZER(pmpdriver.units), /* generation */ 0
+	TAILQ_HEAD_INITIALIZER(pmpdriver.units), /* generation */ 0,
+	CAM_PERIPH_DRV_EARLY
 };
 
 PERIPHDRIVER_DECLARE(pmp, pmpdriver);
@@ -292,14 +295,21 @@ pmpasync(void *callback_arg, u_int32_t c
 	case AC_BUS_RESET:
 		softc = (struct pmp_softc *)periph->softc;
 		cam_periph_async(periph, code, path, arg);
-		if (softc->state != PMP_STATE_NORMAL)
+		if (code == AC_SCSI_AEN && softc->state != PMP_STATE_NORMAL &&
+		    softc->state != PMP_STATE_SCAN)
 			break;
-		pmpfreeze(periph, softc->found);
+		if (softc->state != PMP_STATE_SCAN)
+			pmpfreeze(periph, softc->found);
+		else
+			pmpfreeze(periph, softc->found & ~(1 << softc->pm_step));
 		if (code == AC_SENT_BDR || code == AC_BUS_RESET)
 			softc->found = 0; /* We have to reset everything. */
-		softc->state = PMP_STATE_PORTS;
-		cam_periph_acquire(periph);
-		xpt_schedule(periph, CAM_PRIORITY_DEV);
+		if (softc->state == PMP_STATE_NORMAL) {
+			softc->state = PMP_STATE_PORTS;
+			cam_periph_acquire(periph);
+			xpt_schedule(periph, CAM_PRIORITY_BUS);
+		} else
+			softc->restart = 1;
 		break;
 	default:
 		cam_periph_async(periph, code, path, arg);
@@ -395,7 +405,7 @@ pmpregister(struct cam_periph *periph, v
 	 * the end of probe.
 	 */
 	(void)cam_periph_acquire(periph);
-	xpt_schedule(periph, CAM_PRIORITY_DEV);
+	xpt_schedule(periph, CAM_PRIORITY_BUS);
 
 	return(CAM_REQ_CMP);
 }
@@ -408,6 +418,11 @@ pmpstart(struct cam_periph *periph, unio
 
 	softc = (struct pmp_softc *)periph->softc;
 	ataio = &start_ccb->ataio;
+	
+	if (softc->restart) {
+		softc->restart = 0;
+		softc->state = PMP_STATE_PORTS;
+	}
 
 	switch (softc->state) {
 	case PMP_STATE_PORTS:
@@ -469,6 +484,7 @@ printf("PM RESET %d%s\n", softc->pm_step
 		ata_pm_read_cmd(ataio, 0, softc->pm_step);
 		break;
 	case PMP_STATE_CLEAR:
+		softc->reset = 0;
 		cam_fill_ataio(ataio,
 		      pmp_retry_count,
 		      pmpdone,
@@ -492,7 +508,7 @@ pmpdone(struct cam_periph *periph, union
 	struct ccb_ataio *ataio;
 	union ccb *work_ccb;
 	struct cam_path *path, *dpath;
-	u_int32_t  priority;
+	u_int32_t  priority, res;
 
 	softc = (struct pmp_softc *)periph->softc;
 	ataio = &done_ccb->ataio;
@@ -502,193 +518,158 @@ pmpdone(struct cam_periph *periph, union
 	path = done_ccb->ccb_h.path;
 	priority = done_ccb->ccb_h.pinfo.priority;
 
-	switch (softc->state) {
-	case PMP_STATE_PORTS:
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-			softc->pm_ports = (done_ccb->ataio.res.lba_high << 24) +
-			    (done_ccb->ataio.res.lba_mid << 16) +
-			    (done_ccb->ataio.res.lba_low << 8) +
-			    done_ccb->ataio.res.sector_count;
-			/* This PM declares 6 ports, while only 5 of them are real.
-			 * Port 5 is enclosure management bridge port, which has implementation
-			 * problems, causing probe faults. Hide it for now. */
-			if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6)
-				softc->pm_ports = 5;
-			/* This PM declares 7 ports, while only 5 of them are real.
-			 * Port 5 is some fake "Config  Disk" with 640 sectors size,
-			 * port 6 is enclosure management bridge port.
-			 * Both fake ports has implementation problems, causing
-			 * probe faults. Hide them for now. */
-			if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7)
-				softc->pm_ports = 5;
-			printf("PM ports: %d\n", softc->pm_ports);
-			softc->state = PMP_STATE_CONFIG;
-			xpt_release_ccb(done_ccb);
-			xpt_schedule(periph, priority);
-			return;
-		} else if (cam_periph_error(done_ccb, 0, 0,
-					    &softc->saved_ccb) == ERESTART) {
+	if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+		if (cam_periph_error(done_ccb, 0, 0,
+		    &softc->saved_ccb) == ERESTART) {
 			return;
 		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
-				cam_release_devq(done_ccb->ccb_h.path,
-						 /*relsim_flags*/0,
-						 /*reduction*/0,
-						 /*timeout*/0,
-						 /*getcount_only*/0);
+			cam_release_devq(done_ccb->ccb_h.path,
+			    /*relsim_flags*/0,
+			    /*reduction*/0,
+			    /*timeout*/0,
+			    /*getcount_only*/0);
+		}
+		goto done;
+	}
+
+	if (softc->restart) {
+		softc->restart = 0;
+		if (softc->state == PMP_STATE_SCAN) {
+			pmpfreeze(periph, 1 << softc->pm_step);
+			work_ccb = done_ccb;
+			done_ccb = (union ccb*)work_ccb->ccb_h.ppriv_ptr0;
+			/* Free the current request path- we're done with it. */
+		    	xpt_free_path(work_ccb->ccb_h.path);
+			xpt_free_ccb(work_ccb);
 		}
 		xpt_release_ccb(done_ccb);
-		break;
+		softc->state = PMP_STATE_PORTS;
+		xpt_schedule(periph, priority);
+		return;
+	}
+
+	switch (softc->state) {
+	case PMP_STATE_PORTS:
+		softc->pm_ports = (done_ccb->ataio.res.lba_high << 24) +
+		    (done_ccb->ataio.res.lba_mid << 16) +
+		    (done_ccb->ataio.res.lba_low << 8) +
+		    done_ccb->ataio.res.sector_count;
+		/* This PM declares 6 ports, while only 5 of them are real.
+		 * Port 5 is enclosure management bridge port, which has implementation
+		 * problems, causing probe faults. Hide it for now. */
+		if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6)
+			softc->pm_ports = 5;
+		/* This PM declares 7 ports, while only 5 of them are real.
+		 * Port 5 is some fake "Config  Disk" with 640 sectors size,
+		 * port 6 is enclosure management bridge port.
+		 * Both fake ports has implementation problems, causing
+		 * probe faults. Hide them for now. */
+		if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7)
+			softc->pm_ports = 5;
+		printf("PM ports: %d\n", softc->pm_ports);
+		softc->state = PMP_STATE_CONFIG;
+		xpt_release_ccb(done_ccb);
+		xpt_schedule(periph, priority);
+		return;
 	case PMP_STATE_CONFIG:
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-			softc->pm_step = 0;
-			softc->state = PMP_STATE_RESET;
-			xpt_release_ccb(done_ccb);
-			xpt_schedule(periph, priority);
-			return;
-		} else if (cam_periph_error(done_ccb, 0, 0,
-					    &softc->saved_ccb) == ERESTART) {
-			return;
-		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
-				cam_release_devq(done_ccb->ccb_h.path,
-						 /*relsim_flags*/0,
-						 /*reduction*/0,
-						 /*timeout*/0,
-						 /*getcount_only*/0);
-		}
+		softc->pm_step = 0;
+		softc->state = PMP_STATE_RESET;
+		softc->reset |= ~softc->found;
 		xpt_release_ccb(done_ccb);
-		break;
+		xpt_schedule(periph, priority);
+		return;
 	case PMP_STATE_RESET:
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-			softc->pm_step++;
-			if (softc->pm_step < softc->pm_ports) {
-				xpt_release_ccb(done_ccb);
-				xpt_schedule(periph, priority);
-				return;
-			} else {
-				softc->pm_step = 0;
-				DELAY(5000);
-				printf("PM reset done\n");
-				softc->state = PMP_STATE_CONNECT;
-				xpt_release_ccb(done_ccb);
-				xpt_schedule(periph, priority);
-				return;
-			}
-		} else if (cam_periph_error(done_ccb, 0, 0,
-					    &softc->saved_ccb) == ERESTART) {
-			return;
-		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
-				cam_release_devq(done_ccb->ccb_h.path,
-						 /*relsim_flags*/0,
-						 /*reduction*/0,
-						 /*timeout*/0,
-						 /*getcount_only*/0);
+		softc->pm_step++;
+		if (softc->pm_step >= softc->pm_ports) {
+			softc->pm_step = 0;
+			cam_freeze_devq(periph->path);
+			cam_release_devq(periph->path,
+			    RELSIM_RELEASE_AFTER_TIMEOUT,
+			    /*reduction*/0,
+			    /*timeout*/5,
+			    /*getcount_only*/0);
+			printf("PM reset done\n");
+			softc->state = PMP_STATE_CONNECT;
 		}
 		xpt_release_ccb(done_ccb);
-		break;
+		xpt_schedule(periph, priority);
+		return;
 	case PMP_STATE_CONNECT:
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-			softc->pm_step++;
-			if (softc->pm_step < softc->pm_ports) {
-				xpt_release_ccb(done_ccb);
-				xpt_schedule(periph, priority);
-				return;
-			} else {
-				softc->pm_step = 0;
-				softc->pm_try = 0;
-				printf("PM connect done\n");
-				softc->state = PMP_STATE_CHECK;
-				xpt_release_ccb(done_ccb);
-				xpt_schedule(periph, priority);
-				return;
-			}
-		} else if (cam_periph_error(done_ccb, 0, 0,
-					    &softc->saved_ccb) == ERESTART) {
-			return;
-		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
-				cam_release_devq(done_ccb->ccb_h.path,
-						 /*relsim_flags*/0,
-						 /*reduction*/0,
-						 /*timeout*/0,
-						 /*getcount_only*/0);
+		softc->pm_step++;
+		if (softc->pm_step >= softc->pm_ports) {
+			softc->pm_step = 0;
+			softc->pm_try = 0;
+			cam_freeze_devq(periph->path);
+			cam_release_devq(periph->path,
+			    RELSIM_RELEASE_AFTER_TIMEOUT,
+			    /*reduction*/0,
+			    /*timeout*/10,
+			    /*getcount_only*/0);
+			printf("PM connect done\n");
+			softc->state = PMP_STATE_CHECK;
 		}
 		xpt_release_ccb(done_ccb);
-		break;
+		xpt_schedule(periph, priority);
+		return;
 	case PMP_STATE_CHECK:
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-			int res = (done_ccb->ataio.res.lba_high << 24) +
-			    (done_ccb->ataio.res.lba_mid << 16) +
-			    (done_ccb->ataio.res.lba_low << 8) +
-			    done_ccb->ataio.res.sector_count;
-			if ((res & 0xf0f) == 0x103 && (res & 0x0f0) != 0) {
-				printf("PM status: %d - %08x\n", softc->pm_step, res);
-				softc->found |= (1 << softc->pm_step);
-				softc->pm_step++;
+		res = (done_ccb->ataio.res.lba_high << 24) +
+		    (done_ccb->ataio.res.lba_mid << 16) +
+		    (done_ccb->ataio.res.lba_low << 8) +
+		    done_ccb->ataio.res.sector_count;
+		if ((res & 0xf0f) == 0x103 && (res & 0x0f0) != 0) {
+			printf("PM status: %d - %08x\n", softc->pm_step, res);
+			softc->found |= (1 << softc->pm_step);
+			softc->pm_step++;
+		} else {
+			if (softc->pm_try < 10) {
+				cam_freeze_devq(periph->path);
+				cam_release_devq(periph->path,
+				    RELSIM_RELEASE_AFTER_TIMEOUT,
+				    /*reduction*/0,
+				    /*timeout*/10,
+				    /*getcount_only*/0);
+				softc->pm_try++;
 			} else {
-				if (softc->pm_try < 100) {
-					DELAY(10000);
-					softc->pm_try++;
-				} else {
-					printf("PM status: %d - %08x\n", softc->pm_step, res);
-					softc->found &= ~(1 << softc->pm_step);
-					if (xpt_create_path(&dpath, periph,
-					    done_ccb->ccb_h.path_id,
-					    softc->pm_step, 0) == CAM_REQ_CMP) {
-						xpt_async(AC_LOST_DEVICE, dpath, NULL);
-						xpt_free_path(dpath);
-					}
-					softc->pm_step++;
+				printf("PM status: %d - %08x\n", softc->pm_step, res);
+				softc->found &= ~(1 << softc->pm_step);
+				if (xpt_create_path(&dpath, periph,
+				    done_ccb->ccb_h.path_id,
+				    softc->pm_step, 0) == CAM_REQ_CMP) {
+					xpt_async(AC_LOST_DEVICE, dpath, NULL);
+					xpt_free_path(dpath);
 				}
+				softc->pm_step++;
 			}
-			if (softc->pm_step < softc->pm_ports) {
-				xpt_release_ccb(done_ccb);
-				xpt_schedule(periph, priority);
-				return;
-			} else {
-				softc->pm_step = 0;
-				softc->state = PMP_STATE_CLEAR;
-				xpt_release_ccb(done_ccb);
-				xpt_schedule(periph, priority);
-				return;
+		}
+		if (softc->pm_step >= softc->pm_ports) {
+			if (softc->reset & softc->found) {
+				cam_freeze_devq(periph->path);
+				cam_release_devq(periph->path,
+				    RELSIM_RELEASE_AFTER_TIMEOUT,
+				    /*reduction*/0,
+				    /*timeout*/1000,
+				    /*getcount_only*/0);
 			}
-		} else if (cam_periph_error(done_ccb, 0, 0,
-					    &softc->saved_ccb) == ERESTART) {
-			return;
-		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
-				cam_release_devq(done_ccb->ccb_h.path,
-						 /*relsim_flags*/0,
-						 /*reduction*/0,
-						 /*timeout*/0,
-						 /*getcount_only*/0);
+			softc->state = PMP_STATE_CLEAR;
+			softc->pm_step = 0;
 		}
 		xpt_release_ccb(done_ccb);
-		break;
+		xpt_schedule(periph, priority);
+		return;
 	case PMP_STATE_CLEAR:
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-			softc->pm_step++;
-			if (softc->pm_step < softc->pm_ports) {
-				xpt_release_ccb(done_ccb);
-				xpt_schedule(periph, priority);
-				return;
-			} else if (softc->found) {
-				softc->pm_step = 0;
-				softc->state = PMP_STATE_SCAN;
-				work_ccb = xpt_alloc_ccb_nowait();
-				if (work_ccb != NULL)
-					goto do_scan;
-				xpt_release_ccb(done_ccb);
-			}
-			break;
-		} else if (cam_periph_error(done_ccb, 0, 0,
-					    &softc->saved_ccb) == ERESTART) {
+		softc->pm_step++;
+		if (softc->pm_step < softc->pm_ports) {
+			xpt_release_ccb(done_ccb);
+			xpt_schedule(periph, priority);
 			return;
-		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
-				cam_release_devq(done_ccb->ccb_h.path,
-						 /*relsim_flags*/0,
-						 /*reduction*/0,
-						 /*timeout*/0,
-						 /*getcount_only*/0);
+		} else if (softc->found) {
+			softc->pm_step = 0;
+			softc->state = PMP_STATE_SCAN;
+			work_ccb = xpt_alloc_ccb_nowait();
+			if (work_ccb != NULL)
+				goto do_scan;
+			xpt_release_ccb(done_ccb);
 		}
-		xpt_release_ccb(done_ccb);
 		break;
 	case PMP_STATE_SCAN:
 		work_ccb = done_ccb;
@@ -703,7 +684,6 @@ do_scan:
 		}
 		if (softc->pm_step >= softc->pm_ports) {
 			xpt_free_ccb(work_ccb);
-			xpt_release_ccb(done_ccb);
 			break;
 		}
 		if (xpt_create_path(&dpath, periph,
@@ -712,7 +692,6 @@ do_scan:
 			printf("pmpdone: xpt_create_path failed"
 			    ", bus scan halted\n");
 			xpt_free_ccb(work_ccb);
-			xpt_release_ccb(done_ccb);
 			break;
 		}
 		xpt_setup_ccb(&work_ccb->ccb_h, dpath,
@@ -727,6 +706,8 @@ do_scan:
 	default:
 		break;
 	}
+done:
+	xpt_release_ccb(done_ccb);
 	softc->state = PMP_STATE_NORMAL;
 	pmprelease(periph, -1);
 	cam_periph_release_locked(periph);

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c	Sat Oct 31 10:38:30 2009	(r198707)
+++ head/sys/cam/ata/ata_xpt.c	Sat Oct 31 10:43:38 2009	(r198708)
@@ -83,7 +83,8 @@ static periph_init_t probe_periph_init;
 static struct periph_driver probe_driver =
 {
 	probe_periph_init, "aprobe",
-	TAILQ_HEAD_INITIALIZER(probe_driver.units)
+	TAILQ_HEAD_INITIALIZER(probe_driver.units), /* generation */ 0,
+	CAM_PERIPH_DRV_EARLY
 };
 
 PERIPHDRIVER_DECLARE(aprobe, probe_driver);
@@ -92,6 +93,7 @@ typedef enum {
 	PROBE_RESET,
 	PROBE_IDENTIFY,
 	PROBE_SETMODE,
+	PROBE_SET_MULTI,
 	PROBE_INQUIRY,
 	PROBE_FULL_INQUIRY,
 	PROBE_PM_PID,
@@ -103,6 +105,7 @@ static char *probe_action_text[] = {
 	"PROBE_RESET",
 	"PROBE_IDENTIFY",
 	"PROBE_SETMODE",
+	"PROBE_SET_MULTI",
 	"PROBE_INQUIRY",
 	"PROBE_FULL_INQUIRY",
 	"PROBE_PM_PID",
@@ -282,12 +285,16 @@ probestart(struct cam_periph *periph, un
 	struct ccb_ataio *ataio;
 	struct ccb_scsiio *csio;
 	probe_softc *softc;
+	struct cam_path *path;
+	struct ata_params *ident_buf;
 
 	CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probestart\n"));
 
 	softc = (probe_softc *)periph->softc;
+	path = start_ccb->ccb_h.path;
 	ataio = &start_ccb->ataio;
 	csio = &start_ccb->csio;
+	ident_buf = &periph->path->device->ident_data;
 
 	switch (softc->action) {
 	case PROBE_RESET:
@@ -302,10 +309,6 @@ probestart(struct cam_periph *periph, un
 		ata_reset_cmd(ataio);
 		break;
 	case PROBE_IDENTIFY:
-	{
-		struct ata_params *ident_buf =
-		    &periph->path->device->ident_data;
-
 		if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) {
 			/* Prepare check that it is the same device. */
 			MD5_CTX context;
@@ -335,12 +338,7 @@ probestart(struct cam_periph *periph, un
 		else
 			ata_28bit_cmd(ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0);
 		break;
-	}
 	case PROBE_SETMODE:
-	{
-		struct ata_params *ident_buf =
-		    &periph->path->device->ident_data;
-
 		cam_fill_ataio(ataio,
 		      1,
 		      probedone,
@@ -352,6 +350,37 @@ probestart(struct cam_periph *periph, un
 		ata_28bit_cmd(ataio, ATA_SETFEATURES, ATA_SF_SETXFER, 0,
 		    ata_max_mode(ident_buf, ATA_UDMA6, ATA_UDMA6));
 		break;
+	case PROBE_SET_MULTI:
+	{
+		struct ccb_trans_settings cts;
+		u_int sectors;
+
+		sectors = max(1, min(ident_buf->sectors_intr & 0xff, 16));
+
+		/* Report bytecount to SIM. */
+		bzero(&cts, sizeof(cts));
+		xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL);
+		cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
+		cts.type = CTS_TYPE_CURRENT_SETTINGS;
+		if (path->device->transport == XPORT_ATA) {
+			cts.xport_specific.ata.bytecount = sectors * 512;
+			cts.xport_specific.ata.valid = CTS_ATA_VALID_BYTECOUNT;
+		} else {
+			cts.xport_specific.sata.bytecount = sectors * 512;
+			cts.xport_specific.sata.valid = CTS_SATA_VALID_BYTECOUNT;
+		}
+		xpt_action((union ccb *)&cts);
+
+		cam_fill_ataio(ataio,
+		    1,
+		    probedone,
+		    CAM_DIR_NONE,
+		    0,
+		    NULL,
+		    0,
+		    30*1000);
+		ata_28bit_cmd(ataio, ATA_SET_MULTI, 0, 0, sectors);
+		break;
 	}
 	case PROBE_INQUIRY:
 	case PROBE_FULL_INQUIRY:
@@ -406,7 +435,7 @@ probestart(struct cam_periph *periph, un
 		ata_pm_read_cmd(ataio, 1, 15);
 		break;
 	case PROBE_INVALID:
-		CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_INFO,
+		CAM_DEBUG(path, CAM_DEBUG_INFO,
 		    ("probestart: invalid action state\n"));
 	default:
 		break;
@@ -552,101 +581,119 @@ probedone(struct cam_periph *periph, uni
 	priority = done_ccb->ccb_h.pinfo.priority;
 	ident_buf = &path->device->ident_data;
 
-	switch (softc->action) {
-	case PROBE_RESET:
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-			int sign = (done_ccb->ataio.res.lba_high << 8) +
-			    done_ccb->ataio.res.lba_mid;
-			xpt_print(path, "SIGNATURE: %04x\n", sign);
-			if (sign == 0x0000 &&
-			    done_ccb->ccb_h.target_id != 15) {
-				path->device->protocol = PROTO_ATA;
-				PROBE_SET_ACTION(softc, PROBE_IDENTIFY);
-			} else if (sign == 0x9669 &&
-			    done_ccb->ccb_h.target_id == 15) {
-				struct ccb_trans_settings cts;
-
-				/* Report SIM that PM is present. */
-				bzero(&cts, sizeof(cts));
-				xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL);
-				cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
-				cts.type = CTS_TYPE_CURRENT_SETTINGS;
-				cts.xport_specific.sata.pm_present = 1;
-				cts.xport_specific.sata.valid = CTS_SATA_VALID_PM;
-				xpt_action((union ccb *)&cts);
-				path->device->protocol = PROTO_SATAPM;
-				PROBE_SET_ACTION(softc, PROBE_PM_PID);
-			} else if (sign == 0xeb14 &&
-			    done_ccb->ccb_h.target_id != 15) {
-				path->device->protocol = PROTO_SCSI;
-				PROBE_SET_ACTION(softc, PROBE_IDENTIFY);
-			} else {
-				if (done_ccb->ccb_h.target_id != 15) {
-					xpt_print(path,
-					    "Unexpected signature 0x%04x\n", sign);
-				}
-				goto device_fail;
-			}
-			xpt_release_ccb(done_ccb);
-			xpt_schedule(periph, priority);
-			return;
-		} else if (cam_periph_error(done_ccb, 0, 0,
-					    &softc->saved_ccb) == ERESTART) {
+	if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+device_fail:	if (cam_periph_error(done_ccb, 0, 0,
+		    &softc->saved_ccb) == ERESTART) {
 			return;
 		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
 			/* Don't wedge the queue */
 			xpt_release_devq(done_ccb->ccb_h.path, /*count*/1,
 					 /*run_queue*/TRUE);
 		}
-		goto device_fail;
-	case PROBE_IDENTIFY:
+		/* Old PIO2 devices may not support mode setting. */
+		if (softc->action == PROBE_SETMODE &&
+		    ata_max_pmode(ident_buf) <= ATA_PIO2 &&
+		    (ident_buf->capabilities1 & ATA_SUPPORT_IORDY) == 0)
+			goto noerror;
+		/*
+		 * If we get to this point, we got an error status back
+		 * from the inquiry and the error status doesn't require
+		 * automatically retrying the command.  Therefore, the
+		 * inquiry failed.  If we had inquiry information before
+		 * for this device, but this latest inquiry command failed,
+		 * the device has probably gone away.  If this device isn't
+		 * already marked unconfigured, notify the peripheral
+		 * drivers that this device is no more.
+		 */
+		if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0)
+			xpt_async(AC_LOST_DEVICE, path, NULL);
+		found = 0;
+		goto done;
+	}
+noerror:
+	switch (softc->action) {
+	case PROBE_RESET:
 	{
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-			int16_t *ptr;
+		int sign = (done_ccb->ataio.res.lba_high << 8) +
+		    done_ccb->ataio.res.lba_mid;
+		xpt_print(path, "SIGNATURE: %04x\n", sign);
+		if (sign == 0x0000 &&
+		    done_ccb->ccb_h.target_id != 15) {
+			path->device->protocol = PROTO_ATA;
+			PROBE_SET_ACTION(softc, PROBE_IDENTIFY);
+		} else if (sign == 0x9669 &&
+		    done_ccb->ccb_h.target_id == 15) {
+			struct ccb_trans_settings cts;
 
-			for (ptr = (int16_t *)ident_buf;
-			     ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) {
-				*ptr = le16toh(*ptr);
-			}
-			if (strncmp(ident_buf->model, "FX", 2) &&
-			    strncmp(ident_buf->model, "NEC", 3) &&
-			    strncmp(ident_buf->model, "Pioneer", 7) &&
-			    strncmp(ident_buf->model, "SHARP", 5)) {
-				ata_bswap(ident_buf->model, sizeof(ident_buf->model));
-				ata_bswap(ident_buf->revision, sizeof(ident_buf->revision));
-				ata_bswap(ident_buf->serial, sizeof(ident_buf->serial));
-			}
-			ata_btrim(ident_buf->model, sizeof(ident_buf->model));
-			ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model));
-			ata_btrim(ident_buf->revision, sizeof(ident_buf->revision));
-			ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision));
-			ata_btrim(ident_buf->serial, sizeof(ident_buf->serial));
-			ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial));
-
-			if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) {
-				/* Check that it is the same device. */
-				MD5_CTX context;
-				u_int8_t digest[16];
-
-				MD5Init(&context);
-				MD5Update(&context,
-				    (unsigned char *)ident_buf->model,
-				    sizeof(ident_buf->model));
-				MD5Update(&context,
-				    (unsigned char *)ident_buf->revision,
-				    sizeof(ident_buf->revision));
-				MD5Update(&context,
-				    (unsigned char *)ident_buf->serial,
-				    sizeof(ident_buf->serial));
-				MD5Final(digest, &context);
-				if (bcmp(digest, softc->digest, sizeof(digest))) {
-					/* Device changed. */
-					xpt_async(AC_LOST_DEVICE, path, NULL);
-				}
-				xpt_release_ccb(done_ccb);
-				break;
+				/* Report SIM that PM is present. */
+			bzero(&cts, sizeof(cts));
+			xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL);
+			cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
+			cts.type = CTS_TYPE_CURRENT_SETTINGS;
+			cts.xport_specific.sata.pm_present = 1;
+			cts.xport_specific.sata.valid = CTS_SATA_VALID_PM;
+			xpt_action((union ccb *)&cts);
+			path->device->protocol = PROTO_SATAPM;
+			PROBE_SET_ACTION(softc, PROBE_PM_PID);
+		} else if (sign == 0xeb14 &&
+		    done_ccb->ccb_h.target_id != 15) {
+			path->device->protocol = PROTO_SCSI;
+			PROBE_SET_ACTION(softc, PROBE_IDENTIFY);
+		} else {
+			if (done_ccb->ccb_h.target_id != 15) {
+				xpt_print(path,
+				    "Unexpected signature 0x%04x\n", sign);
 			}
+			goto device_fail;
+		}
+		xpt_release_ccb(done_ccb);
+		xpt_schedule(periph, priority);
+		return;
+	}
+	case PROBE_IDENTIFY:
+	{
+		int16_t *ptr;
+
+		for (ptr = (int16_t *)ident_buf;
+		     ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) {
+			*ptr = le16toh(*ptr);
+		}
+		if (strncmp(ident_buf->model, "FX", 2) &&
+		    strncmp(ident_buf->model, "NEC", 3) &&
+		    strncmp(ident_buf->model, "Pioneer", 7) &&
+		    strncmp(ident_buf->model, "SHARP", 5)) {
+			ata_bswap(ident_buf->model, sizeof(ident_buf->model));
+			ata_bswap(ident_buf->revision, sizeof(ident_buf->revision));
+			ata_bswap(ident_buf->serial, sizeof(ident_buf->serial));
+		}
+		ata_btrim(ident_buf->model, sizeof(ident_buf->model));
+		ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model));
+		ata_btrim(ident_buf->revision, sizeof(ident_buf->revision));
+		ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision));
+		ata_btrim(ident_buf->serial, sizeof(ident_buf->serial));
+		ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial));
 
+		if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) {
+			/* Check that it is the same device. */
+			MD5_CTX context;
+			u_int8_t digest[16];
+
+			MD5Init(&context);
+			MD5Update(&context,
+			    (unsigned char *)ident_buf->model,
+			    sizeof(ident_buf->model));
+			MD5Update(&context,
+			    (unsigned char *)ident_buf->revision,
+			    sizeof(ident_buf->revision));
+			MD5Update(&context,
+			    (unsigned char *)ident_buf->serial,
+			    sizeof(ident_buf->serial));
+			MD5Final(digest, &context);
+			if (bcmp(digest, softc->digest, sizeof(digest))) {
+				/* Device changed. */
+				xpt_async(AC_LOST_DEVICE, path, NULL);
+			}
+		} else {
 			/* Clean up from previous instance of this device */
 			if (path->device->serial_num != NULL) {
 				free(path->device->serial_num, M_CAMXPT);
@@ -655,7 +702,7 @@ probedone(struct cam_periph *periph, uni
 			}
 			path->device->serial_num =
 				(u_int8_t *)malloc((sizeof(ident_buf->serial) + 1),
-						   M_CAMXPT, M_NOWAIT);
+					   M_CAMXPT, M_NOWAIT);
 			if (path->device->serial_num != NULL) {
 				bcopy(ident_buf->serial,
 				      path->device->serial_num,
@@ -667,188 +714,120 @@ probedone(struct cam_periph *periph, uni
 			}
 
 			path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID;
-			ata_device_transport(path);
-			PROBE_SET_ACTION(softc, PROBE_SETMODE);
-			xpt_release_ccb(done_ccb);
-			xpt_schedule(periph, priority);
-			return;
-		} else if (cam_periph_error(done_ccb, 0, 0,
-					    &softc->saved_ccb) == ERESTART) {
-			return;
-		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
-			/* Don't wedge the queue */
-			xpt_release_devq(done_ccb->ccb_h.path, /*count*/1,
-					 /*run_queue*/TRUE);
 		}
-device_fail:
-		/*
-		 * If we get to this point, we got an error status back
-		 * from the inquiry and the error status doesn't require
-		 * automatically retrying the command.  Therefore, the
-		 * inquiry failed.  If we had inquiry information before
-		 * for this device, but this latest inquiry command failed,
-		 * the device has probably gone away.  If this device isn't
-		 * already marked unconfigured, notify the peripheral
-		 * drivers that this device is no more.
-		 */
-		if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0)
-			xpt_async(AC_LOST_DEVICE, path, NULL);
-		found = 0;
+		ata_device_transport(path);
+		PROBE_SET_ACTION(softc, PROBE_SETMODE);
 		xpt_release_ccb(done_ccb);
-		break;
+		xpt_schedule(periph, priority);
+		return;
 	}
 	case PROBE_SETMODE:
-	{
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-modedone:		if (path->device->protocol == PROTO_ATA) {
-				path->device->flags &= ~CAM_DEV_UNCONFIGURED;
-				done_ccb->ccb_h.func_code = XPT_GDEV_TYPE;
-				xpt_action(done_ccb);
-				xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path,
-				    done_ccb);
-				xpt_release_ccb(done_ccb);
-				break;
-			} else {
-				PROBE_SET_ACTION(softc, PROBE_INQUIRY);
-				xpt_release_ccb(done_ccb);
-				xpt_schedule(periph, priority);
-				return;
-			}
-		} else if (cam_periph_error(done_ccb, 0, 0,
-					    &softc->saved_ccb) == ERESTART) {
-			return;
-		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
-			/* Don't wedge the queue */
-			xpt_release_devq(done_ccb->ccb_h.path, /*count*/1,
-					 /*run_queue*/TRUE);
+		if (path->device->protocol == PROTO_ATA) {
+			PROBE_SET_ACTION(softc, PROBE_SET_MULTI);
+		} else {
+			PROBE_SET_ACTION(softc, PROBE_INQUIRY);
 		}
-		/* Old PIO2 devices may not support mode setting. */
-		if (ata_max_pmode(ident_buf) <= ATA_PIO2 &&
-		    (ident_buf->capabilities1 & ATA_SUPPORT_IORDY) == 0)
-			goto modedone;
-		goto device_fail;
-	}
+		xpt_release_ccb(done_ccb);
+		xpt_schedule(periph, priority);
+		return;
+	case PROBE_SET_MULTI:
+		if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) {
+			path->device->flags &= ~CAM_DEV_UNCONFIGURED;
+			done_ccb->ccb_h.func_code = XPT_GDEV_TYPE;
+			xpt_action(done_ccb);
+			xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path,
+			    done_ccb);
+		}
+		break;
 	case PROBE_INQUIRY:
 	case PROBE_FULL_INQUIRY:
 	{
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-			struct scsi_inquiry_data *inq_buf;
-			u_int8_t periph_qual;
+		struct scsi_inquiry_data *inq_buf;
+		u_int8_t periph_qual, len;
 
-			path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 10:47:47 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EB2E0106568F;
	Sat, 31 Oct 2009 10:47:47 +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 DABEE8FC1B;
	Sat, 31 Oct 2009 10:47:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VAllox083914;
	Sat, 31 Oct 2009 10:47:47 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VAllqg083912;
	Sat, 31 Oct 2009 10:47:47 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910311047.n9VAllqg083912@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 31 Oct 2009 10:47:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198709 - head/sbin/camcontrol
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 10:47:48 -0000

Author: mav
Date: Sat Oct 31 10:47:47 2009
New Revision: 198709
URL: http://svn.freebsd.org/changeset/base/198709

Log:
  MFp4:
  Sync connection speed reporting with kernel.
  Report speed in identify command, same as done by inquiry.

Modified:
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.c
==============================================================================
--- head/sbin/camcontrol/camcontrol.c	Sat Oct 31 10:43:38 2009	(r198708)
+++ head/sbin/camcontrol/camcontrol.c	Sat Oct 31 10:47:47 2009	(r198709)
@@ -186,7 +186,7 @@ static int scsidoinquiry(struct cam_devi
 			 char *combinedopt, int retry_count, int timeout);
 static int scsiinquiry(struct cam_device *device, int retry_count, int timeout);
 static int scsiserial(struct cam_device *device, int retry_count, int timeout);
-static int scsixferrate(struct cam_device *device);
+static int camxferrate(struct cam_device *device);
 #endif /* MINIMALISTIC */
 static int parse_btl(char *tstr, int *bus, int *target, int *lun,
 		     cam_argmask *arglst);
@@ -663,7 +663,7 @@ scsidoinquiry(struct cam_device *device,
 		return(error);
 
 	if (arglist & CAM_ARG_GET_XFERRATE)
-		error = scsixferrate(device);
+		error = camxferrate(device);
 
 	return(error);
 }
@@ -873,14 +873,18 @@ scsiserial(struct cam_device *device, in
 }
 
 static int
-scsixferrate(struct cam_device *device)
+camxferrate(struct cam_device *device)
 {
+	struct ccb_pathinq cpi;
 	u_int32_t freq = 0;
 	u_int32_t speed = 0;
 	union ccb *ccb;
 	u_int mb;
 	int retval = 0;
 
+	if ((retval = get_cpi(device, &cpi)) != 0)
+		return (1);
+
 	ccb = cam_getccb(device);
 
 	if (ccb == NULL) {
@@ -913,6 +917,8 @@ scsixferrate(struct cam_device *device)
 
 	}
 
+	speed = cpi.base_transfer_speed;
+	freq = 0;
 	if (ccb->cts.transport == XPORT_SPI) {
 		struct ccb_trans_settings_spi *spi =
 		    &ccb->cts.xport_specific.spi;
@@ -920,31 +926,44 @@ scsixferrate(struct cam_device *device)
 		if ((spi->valid & CTS_SPI_VALID_SYNC_RATE) != 0) {
 			freq = scsi_calc_syncsrate(spi->sync_period);
 			speed = freq;
-		} else {
-			struct ccb_pathinq cpi;
-
-			retval = get_cpi(device, &cpi);
-			if (retval == 0) {
-				speed = cpi.base_transfer_speed;
-				freq = 0;
-			}
 		}
-
-		fprintf(stdout, "%s%d: ", device->device_name,
-			device->dev_unit_num);
-
 		if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) {
 			speed *= (0x01 << spi->bus_width);
 		}
+	} else if (ccb->cts.transport == XPORT_FC) {
+		struct ccb_trans_settings_fc *fc =
+		    &ccb->cts.xport_specific.fc;
+
+		if (fc->valid & CTS_FC_VALID_SPEED)
+			speed = fc->bitrate;
+	} else if (ccb->cts.transport == XPORT_SAS) {
+		struct ccb_trans_settings_sas *sas =
+		    &ccb->cts.xport_specific.sas;
+
+		if (sas->valid & CTS_SAS_VALID_SPEED)
+			speed = sas->bitrate;
+	} else if (ccb->cts.transport == XPORT_SATA) {
+		struct ccb_trans_settings_sata *sata =
+		    &ccb->cts.xport_specific.sata;
+
+		if (sata->valid & CTS_SATA_VALID_SPEED)
+			speed = sata->bitrate;
+	}
+
+	mb = speed / 1000;
+	if (mb > 0) {
+		fprintf(stdout, "%s%d: %d.%03dMB/s transfers ",
+			device->device_name, device->dev_unit_num,
+			mb, speed % 1000);
+	} else {
+		fprintf(stdout, "%s%d: %dKB/s transfers ",
+			device->device_name, device->dev_unit_num,
+			speed);
+	}
 
-		mb = speed / 1000;
-
-		if (mb > 0) 
-			fprintf(stdout, "%d.%03dMB/s transfers ",
-				mb, speed % 1000);
-		else
-			fprintf(stdout, "%dKB/s transfers ",
-				speed);
+	if (ccb->cts.transport == XPORT_SPI) {
+		struct ccb_trans_settings_spi *spi =
+		    &ccb->cts.xport_specific.spi;
 
 		if (((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0)
 		 && (spi->sync_offset != 0))
@@ -964,25 +983,22 @@ scsixferrate(struct cam_device *device)
 		 && (spi->sync_offset != 0)) {
 			fprintf(stdout, ")");
 		}
-	} else {
-		struct ccb_pathinq cpi;
-
-		retval = get_cpi(device, &cpi);
-
-		if (retval != 0)
-			goto xferrate_bailout;
-
-		speed = cpi.base_transfer_speed;
-		freq = 0;
-
-		mb = speed / 1000;
-
-		if (mb > 0) 
-			fprintf(stdout, "%d.%03dMB/s transfers ",
-				mb, speed % 1000);
-		else
-			fprintf(stdout, "%dKB/s transfers ",
-				speed);
+	} else if (ccb->cts.transport == XPORT_ATA) {
+		struct ccb_trans_settings_ata *ata =
+		    &ccb->cts.xport_specific.ata;
+
+		if (ata->valid & CTS_ATA_VALID_BYTECOUNT) {
+			fprintf(stdout, "(PIO size %dbytes)",
+			    ata->bytecount);
+		}
+	} else if (ccb->cts.transport == XPORT_SATA) {
+		struct ccb_trans_settings_sata *sata =
+		    &ccb->cts.xport_specific.sata;
+
+		if (sata->valid & CTS_SATA_VALID_BYTECOUNT) {
+			fprintf(stdout, "(PIO size %dbytes)",
+			    sata->bytecount);
+		}
 	}
 
 	if (ccb->cts.protocol == PROTO_SCSI) {
@@ -1305,6 +1321,7 @@ ataidentify(struct cam_device *device, i
 	fprintf(stdout, "%s%d: ", device->device_name,
 		device->dev_unit_num);
 	ata_print_ident(ident_buf);
+	camxferrate(device);
 	atacapprint(ident_buf);
 
 	free(ident_buf);

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 11:40:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DCC351065670;
	Sat, 31 Oct 2009 11:40:55 +0000 (UTC)
	(envelope-from chris@brueffer.de)
Received: from moutng.kundenserver.de (moutng.kundenserver.de
	[212.227.126.177])
	by mx1.freebsd.org (Postfix) with ESMTP id 6BA8D8FC1E;
	Sat, 31 Oct 2009 11:40:55 +0000 (UTC)
Received: from brueffer.de (host1.allnav.ch [212.55.212.50])
	by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis)
	id 0LfFcq-1MOXn92s80-00p0TW; Sat, 31 Oct 2009 12:28:19 +0100
Received: by brueffer.de (Postfix, from userid 1001)
	id BC7CE17040; Sat, 31 Oct 2009 12:28:09 +0100 (CET)
Date: Sat, 31 Oct 2009 12:28:09 +0100
From: Christian Brueffer 
To: src-committers@freebsd.org
Message-ID: <20091031112809.GB1426@serenity>
References: <200910291559.n9TFxRXN002288@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="TRYliJ5NKNqkz5bu"
Content-Disposition: inline
In-Reply-To: <200910291559.n9TFxRXN002288@svn.freebsd.org>
X-Operating-System: FreeBSD 9.0-CURRENT
X-PGP-Key: http://people.FreeBSD.org/~brueffer/brueffer.key.asc
X-PGP-Fingerprint: A5C8 2099 19FF AACA F41B  B29B 6C76 178C A0ED 982D
User-Agent: Mutt/1.5.19 (2009-01-05)
X-Provags-ID: V01U2FsdGVkX19qS9vtiOAObCXwYi/J5hYzA4EPRVYEz52BP/i
	dU3pOra6had624ixK0KXViXLr9WHNhIJstf6nyPXRWBrfoOYYB
	GRZVWBGnN4NsdvAukgFo5Uyhylkwc5f
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r198609 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 11:40:56 -0000


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

On Thu, Oct 29, 2009 at 03:59:27PM +0000, Christian Brueffer wrote:
> Author: brueffer
> Date: Thu Oct 29 15:59:27 2009
> New Revision: 198609
> URL: http://svn.freebsd.org/changeset/base/198609
>=20
> Log:
>   Revert part of r198363, there is no "device cam", it is
>   included in "device scbus".
>  =20
>   MFC after:	3 days
>=20
> Modified:
>   head/share/man/man4/atapicam.4
>   head/share/man/man4/umass.4
>=20

Noticed by:	jhell 

- Christian

--=20
Christian Brueffer	chris@unixpages.org	brueffer@FreeBSD.org
GPG Key:	 http://people.freebsd.org/~brueffer/brueffer.key.asc
GPG Fingerprint: A5C8 2099 19FF AACA F41B  B29B 6C76 178C A0ED 982D

--TRYliJ5NKNqkz5bu
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkrsH0kACgkQbHYXjKDtmC0FkACdHrA5xWCCTza2/VEb4xCiQPxO
IdcAnRXu1ANeh4oYnr3XpokBoZ5IGpi/
=WA6o
-----END PGP SIGNATURE-----

--TRYliJ5NKNqkz5bu--

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 12:22:24 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 423C1106568D;
	Sat, 31 Oct 2009 12:22:24 +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 319BB8FC32;
	Sat, 31 Oct 2009 12:22:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VCMOpY089117;
	Sat, 31 Oct 2009 12:22:24 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VCMOGk089115;
	Sat, 31 Oct 2009 12:22:24 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910311222.n9VCMOGk089115@svn.freebsd.org>
From: Christian Brueffer 
Date: Sat, 31 Oct 2009 12:22:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198714 - head/sbin/mknod
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 12:22:24 -0000

Author: brueffer
Date: Sat Oct 31 12:22:23 2009
New Revision: 198714
URL: http://svn.freebsd.org/changeset/base/198714

Log:
  The majors file was removed long ago, 0 should be used instead.
  
  PR:		139230
  Submitted by:	pluknet 
  MFC after:	1 week

Modified:
  head/sbin/mknod/mknod.8

Modified: head/sbin/mknod/mknod.8
==============================================================================
--- head/sbin/mknod/mknod.8	Sat Oct 31 11:23:54 2009	(r198713)
+++ head/sbin/mknod/mknod.8	Sat Oct 31 12:22:23 2009	(r198714)
@@ -28,7 +28,7 @@
 .\"     @(#)mknod.8	8.2 (Berkeley) 12/11/93
 .\" $FreeBSD$
 .\"
-.Dd December 15, 2004
+.Dd October 31, 2009
 .Dt MKNOD 8
 .Os
 .Sh NAME
@@ -74,9 +74,7 @@ and pseudo devices, and are type
 .It Ar major
 The major device number is an integer number which tells the kernel
 which device driver entry point to use.
-To learn what
-major device number to use for a particular device, check
-.Pa /usr/src/sys/conf/majors .
+This is a compatibility shim and should be left zero.
 .It Ar minor
 The minor device number tells the kernel which subunit
 the node corresponds to on the device; for example,

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 13:24:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0B40F106566C;
	Sat, 31 Oct 2009 13:24:16 +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 ED5D78FC19;
	Sat, 31 Oct 2009 13:24:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VDOEkq090633;
	Sat, 31 Oct 2009 13:24:14 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VDOEwB090618;
	Sat, 31 Oct 2009 13:24:14 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910311324.n9VDOEwB090618@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 31 Oct 2009 13:24:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198717 - in head/sys: arm/mv dev/ata dev/ata/chipsets
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 13:24:16 -0000

Author: mav
Date: Sat Oct 31 13:24:14 2009
New Revision: 198717
URL: http://svn.freebsd.org/changeset/base/198717

Log:
  MFp4:
  - Remove most of direct relations between ATA(4) peripherial and controller
  levels. It makes logic more transparent and is a mandatory step to wrap
  ATA(4) controller level into ATA-native CAM SIM.
  - Tune AHCI and SATA2 SiI drivers memory allocation a bit to allow bigger
  I/O transaction sizes without additional cost.

Modified:
  head/sys/arm/mv/mv_sata.c
  head/sys/dev/ata/ata-all.c
  head/sys/dev/ata/ata-all.h
  head/sys/dev/ata/ata-dma.c
  head/sys/dev/ata/ata-lowlevel.c
  head/sys/dev/ata/ata-pci.c
  head/sys/dev/ata/ata-queue.c
  head/sys/dev/ata/ata-sata.c
  head/sys/dev/ata/chipsets/ata-ahci.c
  head/sys/dev/ata/chipsets/ata-intel.c
  head/sys/dev/ata/chipsets/ata-marvell.c
  head/sys/dev/ata/chipsets/ata-promise.c
  head/sys/dev/ata/chipsets/ata-serverworks.c
  head/sys/dev/ata/chipsets/ata-siliconimage.c

Modified: head/sys/arm/mv/mv_sata.c
==============================================================================
--- head/sys/arm/mv/mv_sata.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/arm/mv/mv_sata.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -548,14 +548,16 @@ sata_channel_begin_transaction(struct at
 	uint32_t req_in;
 	int error, slot;
 
-	sc = device_get_softc(GRANDPARENT(request->dev));
+	sc = device_get_softc(device_get_parent(request->parent));
 	ch = device_get_softc(request->parent);
 
 	mtx_assert(&ch->state_mtx, MA_OWNED);
 
 	/* Only DMA R/W goes through the EDMA machine. */
 	if (request->u.ata.command != ATA_READ_DMA &&
-	    request->u.ata.command != ATA_WRITE_DMA) {
+	    request->u.ata.command != ATA_WRITE_DMA &&
+	    request->u.ata.command != ATA_READ_DMA48 &&
+	    request->u.ata.command != ATA_WRITE_DMA48) {
 
 		/* Disable EDMA before accessing legacy registers */
 		if (sata_edma_is_running(request->parent)) {
@@ -569,12 +571,9 @@ sata_channel_begin_transaction(struct at
 		return (ata_begin_transaction(request));
 	}
 
-	/* Check for 48 bit access and convert if needed */
-	ata_modify_if_48bit(request);
-
 	/* Prepare data for DMA */
 	if ((error = ch->dma.load(request, NULL, NULL))) {
-		device_printf(request->dev, "setting up DMA failed!\n");
+		device_printf(request->parent, "setting up DMA failed!\n");
 		request->result = error;
 		return ATA_OP_FINISHED;
 	}
@@ -633,7 +632,7 @@ sata_channel_end_transaction(struct ata_
 	uint32_t res_in, res_out, icr;
 	int slot;
 
-	sc = device_get_softc(GRANDPARENT(request->dev));
+	sc = device_get_softc(device_get_parent(request->parent));
 	ch = device_get_softc(request->parent);
 
 	mtx_assert(&ch->state_mtx, MA_OWNED);

Modified: head/sys/dev/ata/ata-all.c
==============================================================================
--- head/sys/dev/ata/ata-all.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/ata-all.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -798,10 +798,10 @@ ata_default_registers(device_t dev)
 void
 ata_modify_if_48bit(struct ata_request *request)
 {
-    struct ata_channel *ch = device_get_softc(device_get_parent(request->dev));
+    struct ata_channel *ch = device_get_softc(request->parent);
     struct ata_device *atadev = device_get_softc(request->dev);
 
-    atadev->flags &= ~ATA_D_48BIT_ACTIVE;
+    request->flags &= ~ATA_R_48BIT;
 
     if (((request->u.ata.lba + request->u.ata.count) >= ATA_MAX_28BIT_LBA ||
 	 request->u.ata.count > 256) &&
@@ -875,7 +875,7 @@ ata_modify_if_48bit(struct ata_request *
 	default:
 	    return;
 	}
-	atadev->flags |= ATA_D_48BIT_ACTIVE;
+	request->flags |= ATA_R_48BIT;
     }
     else if (atadev->param.support.command2 & ATA_SUPPORT_ADDRESS48) {
 
@@ -893,7 +893,7 @@ ata_modify_if_48bit(struct ata_request *
 	default:
 	    return;
 	}
-	atadev->flags |= ATA_D_48BIT_ACTIVE;
+	request->flags |= ATA_R_48BIT;
     }
 }
 

Modified: head/sys/dev/ata/ata-all.h
==============================================================================
--- head/sys/dev/ata/ata-all.h	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/ata-all.h	Sat Oct 31 13:24:14 2009	(r198717)
@@ -255,7 +255,7 @@
 #define ATA_AHCI_CL_OFFSET              0
 #define ATA_AHCI_FB_OFFSET              (ATA_AHCI_CL_SIZE * 32)
 #define ATA_AHCI_CT_OFFSET              (ATA_AHCI_FB_OFFSET + 4096)
-#define ATA_AHCI_CT_SIZE                (1024 + 128)
+#define ATA_AHCI_CT_SIZE                (2176 + 128)
 
 struct ata_ahci_dma_prd {
     u_int64_t                   dba;
@@ -269,7 +269,7 @@ struct ata_ahci_cmd_tab {
     u_int8_t                    cfis[64];
     u_int8_t                    acmd[32];
     u_int8_t                    reserved[32];
-#define ATA_AHCI_DMA_ENTRIES            64
+#define ATA_AHCI_DMA_ENTRIES            129
     struct ata_ahci_dma_prd     prd_tab[ATA_AHCI_DMA_ENTRIES];
 } __packed;
 
@@ -364,6 +364,7 @@ struct ata_composite {
 struct ata_request {
     device_t                    dev;            /* device handle */
     device_t                    parent;         /* channel handle */
+    int				unit;		/* physical unit */
     union {
 	struct {
 	    u_int8_t            command;        /* command reg */
@@ -389,6 +390,7 @@ struct ata_request {
 #define         ATA_R_DMA               0x00000010
 #define         ATA_R_QUIET             0x00000020
 #define         ATA_R_TIMEOUT           0x00000040
+#define         ATA_R_48BIT             0x00000080
 
 #define         ATA_R_ORDERED           0x00000100
 #define         ATA_R_AT_HEAD           0x00000200
@@ -396,6 +398,9 @@ struct ata_request {
 #define         ATA_R_THREAD            0x00000800
 #define         ATA_R_DIRECT            0x00001000
 
+#define         ATA_R_ATAPI16           0x00010000
+#define         ATA_R_ATAPI_INTR        0x00020000
+
 #define         ATA_R_DEBUG             0x10000000
 #define         ATA_R_DANGER1           0x20000000
 #define         ATA_R_DANGER2           0x40000000
@@ -423,7 +428,7 @@ struct ata_request {
 #define ATA_DEBUG_RQ(request, string) \
     { \
     if (request->flags & ATA_R_DEBUG) \
-	device_printf(request->dev, "req=%p %s " string "\n", \
+	device_printf(request->parent, "req=%p %s " string "\n", \
 		      request, ata_cmd2str(request)); \
     }
 #else
@@ -449,7 +454,6 @@ struct ata_device {
 #define         ATA_D_USE_CHS           0x0001
 #define         ATA_D_MEDIA_CHANGED     0x0002
 #define         ATA_D_ENC_PRESENT       0x0004
-#define         ATA_D_48BIT_ACTIVE      0x0008
 };
 
 /* structure for holding DMA Physical Region Descriptors (PRD) entries */
@@ -483,7 +487,7 @@ struct ata_dma {
     u_int8_t                    *work;          /* workspace */
     bus_addr_t                  work_bus;       /* bus address of dmatab */
 
-#define ATA_DMA_SLOTS			32
+#define ATA_DMA_SLOTS			1
     int				dma_slots;	/* DMA slots allocated */
     struct ata_dmaslot		slot[ATA_DMA_SLOTS];
     u_int32_t                   alignment;      /* DMA SG list alignment */

Modified: head/sys/dev/ata/ata-dma.c
==============================================================================
--- head/sys/dev/ata/ata-dma.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/ata-dma.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -78,7 +78,7 @@ ata_dmainit(device_t dev)
     ch->dma.segsize = 65536;
     ch->dma.max_iosize = 128 * DEV_BSIZE;
     ch->dma.max_address = BUS_SPACE_MAXADDR_32BIT;
-    ch->dma.dma_slots = 6;
+    ch->dma.dma_slots = 1;
 
     if (bus_dma_tag_create(bus_get_dma_tag(dev), ch->dma.alignment, 0,
 			   ch->dma.max_address, BUS_SPACE_MAXADDR,
@@ -256,37 +256,36 @@ static int
 ata_dmaload(struct ata_request *request, void *addr, int *entries)
 {
     struct ata_channel *ch = device_get_softc(request->parent);
-    struct ata_device *atadev = device_get_softc(request->dev);
     struct ata_dmasetprd_args dspa;
     int error;
 
     ATA_DEBUG_RQ(request, "dmaload");
 
     if (request->dma) {
-	device_printf(request->dev,
+	device_printf(request->parent,
 		      "FAILURE - already active DMA on this device\n");
 	return EIO;
     }
     if (!request->bytecount) {
-	device_printf(request->dev,
+	device_printf(request->parent,
 		      "FAILURE - zero length DMA transfer attempted\n");
 	return EIO;
     }
     if (request->bytecount & (ch->dma.alignment - 1)) {
-	device_printf(request->dev,
+	device_printf(request->parent,
 		      "FAILURE - odd-sized DMA transfer attempt %d %% %d\n",
 		      request->bytecount, ch->dma.alignment);
 	return EIO;
     }
     if (request->bytecount > ch->dma.max_iosize) {
-	device_printf(request->dev,
+	device_printf(request->parent,
 		      "FAILURE - oversized DMA transfer attempt %d > %d\n",
 		      request->bytecount, ch->dma.max_iosize);
 	return EIO;
     }
 
-    /* set our slot, unit for simplicity XXX SOS NCQ will change that */
-    request->dma = &ch->dma.slot[atadev->unit];
+    /* set our slot. XXX SOS NCQ will change that */
+    request->dma = &ch->dma.slot[0];
 
     if (addr)
 	dspa.dmatab = addr;
@@ -297,7 +296,7 @@ ata_dmaload(struct ata_request *request,
 				 request->data, request->bytecount,
 				 ch->dma.setprd, &dspa, BUS_DMA_NOWAIT)) ||
 				 (error = dspa.error)) {
-	device_printf(request->dev, "FAILURE - load data\n");
+	device_printf(request->parent, "FAILURE - load data\n");
 	goto error;
     }
 

Modified: head/sys/dev/ata/ata-lowlevel.c
==============================================================================
--- head/sys/dev/ata/ata-lowlevel.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/ata-lowlevel.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
 
 /* prototypes */
 static int ata_generic_status(device_t dev);
-static int ata_wait(struct ata_channel *ch, struct ata_device *, u_int8_t);
+static int ata_wait(struct ata_channel *ch, int unit, u_int8_t);
 static void ata_pio_read(struct ata_request *, int);
 static void ata_pio_write(struct ata_request *, int);
 static void ata_tf_read(struct ata_request *);
@@ -77,7 +77,6 @@ int
 ata_begin_transaction(struct ata_request *request)
 {
     struct ata_channel *ch = device_get_softc(request->parent);
-    struct ata_device *atadev = device_get_softc(request->dev);
     int dummy, error;
 
     ATA_DEBUG_RQ(request, "begin transaction");
@@ -88,9 +87,6 @@ ata_begin_transaction(struct ata_request
 	 (ATA_R_ATAPI | ATA_R_DMA | ATA_R_WRITE)))
 	request->flags &= ~ATA_R_DMA;
 
-    /* check for 48 bit access and convert if needed */
-    ata_modify_if_48bit(request);
-
     switch (request->flags & (ATA_R_ATAPI | ATA_R_DMA)) {
 
     /* ATA PIO data transfer and control commands */
@@ -101,7 +97,7 @@ ata_begin_transaction(struct ata_request
 
 	    /* issue command */
 	    if (ch->hw.command(request)) {
-		device_printf(request->dev, "error issuing %s command\n",
+		device_printf(request->parent, "error issuing %s command\n",
 			   ata_cmd2str(request));
 		request->result = EIO;
 		goto begin_finished;
@@ -122,8 +118,8 @@ ata_begin_transaction(struct ata_request
 
 	    /* if write command output the data */
 	    if (write) {
-		if (ata_wait(ch, atadev, (ATA_S_READY | ATA_S_DRQ)) < 0) {
-		    device_printf(request->dev,
+		if (ata_wait(ch, request->unit, (ATA_S_READY | ATA_S_DRQ)) < 0) {
+		    device_printf(request->parent,
 				  "timeout waiting for write DRQ\n");
 		    request->result = EIO;
 		    goto begin_finished;
@@ -137,14 +133,14 @@ ata_begin_transaction(struct ata_request
     case ATA_R_DMA:
 	/* check sanity, setup SG list and DMA engine */
 	if ((error = ch->dma.load(request, NULL, &dummy))) {
-	    device_printf(request->dev, "setting up DMA failed\n");
+	    device_printf(request->parent, "setting up DMA failed\n");
 	    request->result = error;
 	    goto begin_finished;
 	}
 
 	/* issue command */
 	if (ch->hw.command(request)) {
-	    device_printf(request->dev, "error issuing %s command\n",
+	    device_printf(request->parent, "error issuing %s command\n",
 		       ata_cmd2str(request));
 	    request->result = EIO;
 	    goto begin_finished;
@@ -152,7 +148,7 @@ ata_begin_transaction(struct ata_request
 
 	/* start DMA engine */
 	if (ch->dma.start && ch->dma.start(request)) {
-	    device_printf(request->dev, "error starting DMA\n");
+	    device_printf(request->parent, "error starting DMA\n");
 	    request->result = EIO;
 	    goto begin_finished;
 	}
@@ -162,7 +158,7 @@ ata_begin_transaction(struct ata_request
     case ATA_R_ATAPI:
 	/* is this just a POLL DSC command ? */
 	if (request->u.atapi.ccb[0] == ATAPI_POLL_DSC) {
-	    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(atadev->unit));
+	    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(request->unit));
 	    DELAY(10);
 	    if (!(ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_DSC))
 		request->result = EBUSY;
@@ -171,7 +167,7 @@ ata_begin_transaction(struct ata_request
 
 	/* start ATAPI operation */
 	if (ch->hw.command(request)) {
-	    device_printf(request->dev, "error issuing ATA PACKET command\n");
+	    device_printf(request->parent, "error issuing ATA PACKET command\n");
 	    request->result = EIO;
 	    goto begin_finished;
 	}
@@ -181,7 +177,7 @@ ata_begin_transaction(struct ata_request
     case ATA_R_ATAPI|ATA_R_DMA:
 	/* is this just a POLL DSC command ? */
 	if (request->u.atapi.ccb[0] == ATAPI_POLL_DSC) {
-	    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(atadev->unit));
+	    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(request->unit));
 	    DELAY(10);
 	    if (!(ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_DSC))
 		request->result = EBUSY;
@@ -190,14 +186,14 @@ ata_begin_transaction(struct ata_request
 
 	/* check sanity, setup SG list and DMA engine */
 	if ((error = ch->dma.load(request, NULL, &dummy))) {
-	    device_printf(request->dev, "setting up DMA failed\n");
+	    device_printf(request->parent, "setting up DMA failed\n");
 	    request->result = error;
 	    goto begin_finished;
 	}
 
 	/* start ATAPI operation */
 	if (ch->hw.command(request)) {
-	    device_printf(request->dev, "error issuing ATA PACKET command\n");
+	    device_printf(request->parent, "error issuing ATA PACKET command\n");
 	    request->result = EIO;
 	    goto begin_finished;
 	}
@@ -229,7 +225,6 @@ int
 ata_end_transaction(struct ata_request *request)
 {
     struct ata_channel *ch = device_get_softc(request->parent);
-    struct ata_device *atadev = device_get_softc(request->dev);
     int length;
 
     ATA_DEBUG_RQ(request, "end transaction");
@@ -266,8 +261,8 @@ ata_end_transaction(struct ata_request *
 
 		if (request->u.ata.command != ATA_ATAPI_IDENTIFY)
 		    flags |= ATA_S_READY;
-		if (ata_wait(ch, atadev, flags) < 0) {
-		    device_printf(request->dev,
+		if (ata_wait(ch, request->unit, flags) < 0) {
+		    device_printf(request->parent,
 				  "timeout waiting for read DRQ\n");
 		    request->result = EIO;
 		    goto end_finished;
@@ -290,8 +285,8 @@ ata_end_transaction(struct ata_request *
 		if (request->flags & ATA_R_WRITE) {
 
 		    /* if we get an error here we are done with the HW */
-		    if (ata_wait(ch, atadev, (ATA_S_READY | ATA_S_DRQ)) < 0) {
-			device_printf(request->dev,
+		    if (ata_wait(ch, request->unit, (ATA_S_READY | ATA_S_DRQ)) < 0) {
+			device_printf(request->parent,
 				      "timeout waiting for write DRQ\n");
 			request->status = ATA_IDX_INB(ch, ATA_STATUS);
 			goto end_finished;
@@ -347,20 +342,19 @@ ata_end_transaction(struct ata_request *
 	    DELAY(10);
 
 	    if (!(request->status & ATA_S_DRQ)) {
-		device_printf(request->dev, "command interrupt without DRQ\n");
+		device_printf(request->parent, "command interrupt without DRQ\n");
 		request->status = ATA_S_ERROR;
 		goto end_finished;
 	    }
 	    ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (int16_t *)request->u.atapi.ccb,
-			       (atadev->param.config &
-				ATA_PROTO_MASK)== ATA_PROTO_ATAPI_12 ? 6 : 8);
+			       (request->flags & ATA_R_ATAPI16) ? 8 : 6);
 	    /* return wait for interrupt */
 	    goto end_continue;
 
 	case ATAPI_P_WRITE:
 	    if (request->flags & ATA_R_READ) {
 		request->status = ATA_S_ERROR;
-		device_printf(request->dev,
+		device_printf(request->parent,
 			      "%s trying to write on read buffer\n",
 			   ata_cmd2str(request));
 		goto end_finished;
@@ -378,7 +372,7 @@ ata_end_transaction(struct ata_request *
 	case ATAPI_P_READ:
 	    if (request->flags & ATA_R_WRITE) {
 		request->status = ATA_S_ERROR;
-		device_printf(request->dev,
+		device_printf(request->parent,
 			      "%s trying to read on write buffer\n",
 			   ata_cmd2str(request));
 		goto end_finished;
@@ -393,7 +387,7 @@ ata_end_transaction(struct ata_request *
 	    goto end_continue;
 
 	case ATAPI_P_DONEDRQ:
-	    device_printf(request->dev,
+	    device_printf(request->parent,
 			  "WARNING - %s DONEDRQ non conformant device\n",
 			  ata_cmd2str(request));
 	    if (request->flags & ATA_R_READ) {
@@ -415,7 +409,7 @@ ata_end_transaction(struct ata_request *
 	    goto end_finished;
 
 	default:
-	    device_printf(request->dev, "unknown transfer phase\n");
+	    device_printf(request->parent, "unknown transfer phase\n");
 	    request->status = ATA_S_ERROR;
 	}
 
@@ -603,7 +597,7 @@ ata_generic_status(device_t dev)
 }
 
 static int
-ata_wait(struct ata_channel *ch, struct ata_device *atadev, u_int8_t mask)
+ata_wait(struct ata_channel *ch, int unit, u_int8_t mask)
 {
     u_int8_t status;
     int timeout = 0;
@@ -616,7 +610,7 @@ ata_wait(struct ata_channel *ch, struct 
 
 	/* if drive fails status, reselect the drive and try again */
 	if (status == 0xff) {
-	    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(atadev->unit));
+	    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(unit));
 	    timeout += 1000;
 	    DELAY(1000);
 	    continue;
@@ -657,14 +651,13 @@ int
 ata_generic_command(struct ata_request *request)
 {
     struct ata_channel *ch = device_get_softc(request->parent);
-    struct ata_device *atadev = device_get_softc(request->dev);
 
     /* select device */
-    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_D_LBA | ATA_DEV(atadev->unit));
+    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit));
 
     /* ready to issue command ? */
-    if (ata_wait(ch, atadev, 0) < 0) { 
-	device_printf(request->dev, "timeout waiting to issue command\n");
+    if (ata_wait(ch, request->unit, 0) < 0) { 
+	device_printf(request->parent, "timeout waiting to issue command\n");
 	return -1;
     }
 
@@ -673,6 +666,7 @@ ata_generic_command(struct ata_request *
 
     if (request->flags & ATA_R_ATAPI) {
 	int timeout = 5000;
+	int res;
 
 	/* issue packet command to controller */
 	if (request->flags & ATA_R_DMA) {
@@ -688,9 +682,16 @@ ata_generic_command(struct ata_request *
 	ATA_IDX_OUTB(ch, ATA_COMMAND, ATA_PACKET_CMD);
 
 	/* command interrupt device ? just return and wait for interrupt */
-	if ((atadev->param.config & ATA_DRQ_MASK) == ATA_DRQ_INTR)
+	if (request->flags & ATA_R_ATAPI_INTR)
 	    return 0;
 
+	/* command processed ? */
+	res = ata_wait(ch, request->unit, 0);
+	if (res != 0) {
+	    if (res < 0)
+		    device_printf(request->parent, "timeout waiting for PACKET command\n");
+	    return (-1);
+	}
 	/* wait for ready to write ATAPI command block */
 	while (timeout--) {
 	    int reason = ATA_IDX_INB(ch, ATA_IREASON);
@@ -702,7 +703,7 @@ ata_generic_command(struct ata_request *
 	    DELAY(20);
 	}
 	if (timeout <= 0) {
-	    device_printf(request->dev, "timeout waiting for ATAPI ready\n");
+	    device_printf(request->parent, "timeout waiting for ATAPI ready\n");
 	    request->result = EIO;
 	    return -1;
 	}
@@ -712,8 +713,7 @@ ata_generic_command(struct ata_request *
 		    
 	/* output command block */
 	ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (int16_t *)request->u.atapi.ccb,
-			   (atadev->param.config & ATA_PROTO_MASK) ==
-			   ATA_PROTO_ATAPI_12 ? 6 : 8);
+			   (request->flags & ATA_R_ATAPI16) ? 8 : 6);
     }
     else {
 	ch->hw.tf_write(request);
@@ -728,9 +728,8 @@ static void
 ata_tf_read(struct ata_request *request)
 {
     struct ata_channel *ch = device_get_softc(request->parent);
-    struct ata_device *atadev = device_get_softc(request->dev);
 
-    if (atadev->flags & ATA_D_48BIT_ACTIVE) {
+    if (request->flags & ATA_R_48BIT) {
 	ATA_IDX_OUTB(ch, ATA_CONTROL, ATA_A_4BIT | ATA_A_HOB);
 	request->u.ata.count = (ATA_IDX_INB(ch, ATA_COUNT) << 8);
 	request->u.ata.lba =
@@ -760,7 +759,7 @@ ata_tf_write(struct ata_request *request
     struct ata_channel *ch = device_get_softc(request->parent);
     struct ata_device *atadev = device_get_softc(request->dev);
 
-    if (atadev->flags & ATA_D_48BIT_ACTIVE) {
+    if (request->flags & ATA_R_48BIT) {
 	ATA_IDX_OUTB(ch, ATA_FEATURE, request->u.ata.feature >> 8);
 	ATA_IDX_OUTB(ch, ATA_FEATURE, request->u.ata.feature);
 	ATA_IDX_OUTB(ch, ATA_COUNT, request->u.ata.count >> 8);
@@ -771,7 +770,7 @@ ata_tf_write(struct ata_request *request
 	ATA_IDX_OUTB(ch, ATA_CYL_LSB, request->u.ata.lba >> 8);
 	ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->u.ata.lba >> 40);
 	ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->u.ata.lba >> 16);
-	ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(atadev->unit));
+	ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(request->unit));
     }
     else {
 	ATA_IDX_OUTB(ch, ATA_FEATURE, request->u.ata.feature);
@@ -793,7 +792,7 @@ ata_tf_write(struct ata_request *request
 			 (request->u.ata.lba / (sectors * heads)));
 	    ATA_IDX_OUTB(ch, ATA_CYL_MSB,
 			 (request->u.ata.lba / (sectors * heads)) >> 8);
-	    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(atadev->unit) | 
+	    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(request->unit) | 
 			 (((request->u.ata.lba% (sectors * heads)) /
 			   sectors) & 0xf));
 	}
@@ -802,7 +801,7 @@ ata_tf_write(struct ata_request *request
 	    ATA_IDX_OUTB(ch, ATA_CYL_LSB, request->u.ata.lba >> 8);
 	    ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->u.ata.lba >> 16);
 	    ATA_IDX_OUTB(ch, ATA_DRIVE,
-			 ATA_D_IBM | ATA_D_LBA | ATA_DEV(atadev->unit) |
+			 ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit) |
 			 ((request->u.ata.lba >> 24) & 0x0f));
 	}
     }
@@ -825,7 +824,7 @@ ata_pio_read(struct ata_request *request
 			  size / sizeof(int32_t));
 
     if (request->transfersize < length) {
-	device_printf(request->dev, "WARNING - %s read data overrun %d>%d\n",
+	device_printf(request->parent, "WARNING - %s read data overrun %d>%d\n",
 		   ata_cmd2str(request), length, request->transfersize);
 	for (resid = request->transfersize; resid < length;
 	     resid += sizeof(int16_t))
@@ -850,7 +849,7 @@ ata_pio_write(struct ata_request *reques
 			   size / sizeof(int32_t));
 
     if (request->transfersize < length) {
-	device_printf(request->dev, "WARNING - %s write data underrun %d>%d\n",
+	device_printf(request->parent, "WARNING - %s write data underrun %d>%d\n",
 		   ata_cmd2str(request), length, request->transfersize);
 	for (resid = request->transfersize; resid < length;
 	     resid += sizeof(int16_t))

Modified: head/sys/dev/ata/ata-pci.c
==============================================================================
--- head/sys/dev/ata/ata-pci.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/ata-pci.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -477,7 +477,7 @@ ata_pci_dmareset(device_t dev)
     ch->dma.flags &= ~ATA_DMA_ACTIVE;
     ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR);
     if ((request = ch->running)) {
-	device_printf(request->dev, "DMA reset calling unload\n");
+	device_printf(dev, "DMA reset calling unload\n");
 	ch->dma.unload(request);
     }
 }

Modified: head/sys/dev/ata/ata-queue.c
==============================================================================
--- head/sys/dev/ata/ata-queue.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/ata-queue.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -52,17 +52,25 @@ void
 ata_queue_request(struct ata_request *request)
 {
     struct ata_channel *ch;
+    struct ata_device *atadev = device_get_softc(request->dev);
 
     /* treat request as virgin (this might be an ATA_R_REQUEUE) */
     request->result = request->status = request->error = 0;
 
-    /* check that the device is still valid */
+    /* Prepare paramers required by low-level code. */
+    request->unit = atadev->unit;
     if (!(request->parent = device_get_parent(request->dev))) {
 	request->result = ENXIO;
 	if (request->callback)
 	    (request->callback)(request);
 	return;
     }
+    if ((atadev->param.config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_16)
+	request->flags |= ATA_R_ATAPI16;
+    if ((atadev->param.config & ATA_DRQ_MASK) == ATA_DRQ_INTR)
+	request->flags |= ATA_R_ATAPI_INTR;
+    if ((request->flags & ATA_R_ATAPI) == 0)
+	ata_modify_if_48bit(request);
     ch = device_get_softc(request->parent);
     callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED);
     if (!request->callback && !(request->flags & ATA_R_REQUEUE))

Modified: head/sys/dev/ata/ata-sata.c
==============================================================================
--- head/sys/dev/ata/ata-sata.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/ata-sata.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -246,11 +246,10 @@ ata_sata_setmode(device_t dev, int mode)
 int
 ata_request2fis_h2d(struct ata_request *request, u_int8_t *fis)
 {
-    struct ata_device *atadev = device_get_softc(request->dev);
 
     if (request->flags & ATA_R_ATAPI) {
 	fis[0] = 0x27;  		/* host to device */
-	fis[1] = 0x80 | (atadev->unit & 0x0f);
+	fis[1] = 0x80 | (request->unit & 0x0f);
 	fis[2] = ATA_PACKET_CMD;
 	if (request->flags & (ATA_R_READ | ATA_R_WRITE))
 	    fis[3] = ATA_F_DMA;
@@ -263,16 +262,15 @@ ata_request2fis_h2d(struct ata_request *
 	return 20;
     }
     else {
-	ata_modify_if_48bit(request);
 	fis[0] = 0x27;			/* host to device */
-	fis[1] = 0x80 | (atadev->unit & 0x0f);
+	fis[1] = 0x80 | (request->unit & 0x0f);
 	fis[2] = request->u.ata.command;
 	fis[3] = request->u.ata.feature;
 	fis[4] = request->u.ata.lba;
 	fis[5] = request->u.ata.lba >> 8;
 	fis[6] = request->u.ata.lba >> 16;
 	fis[7] = ATA_D_LBA;
-	if (!(atadev->flags & ATA_D_48BIT_ACTIVE))
+	if (!(request->flags & ATA_R_48BIT))
 	    fis[7] |= (ATA_D_IBM | (request->u.ata.lba >> 24 & 0x0f));
 	fis[8] = request->u.ata.lba >> 24;
 	fis[9] = request->u.ata.lba >> 32; 
@@ -339,9 +337,6 @@ ata_pm_identify(device_t dev)
 		      pm_chipid, pm_revision, pm_ports);
     }
 
-    /* realloc space for needed DMA slots */
-    ch->dma.dma_slots = pm_ports;
-
     /* reset all ports and register if anything connected */
     for (port=0; port < pm_ports; port++) {
 	u_int32_t signature;

Modified: head/sys/dev/ata/chipsets/ata-ahci.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-ahci.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/chipsets/ata-ahci.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -385,23 +385,22 @@ ata_ahci_status(device_t dev)
 static int
 ata_ahci_begin_transaction(struct ata_request *request)
 {
-    struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev));
+    struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent));
     struct ata_channel *ch = device_get_softc(request->parent);
-    struct ata_device *atadev = device_get_softc(request->dev);
     struct ata_ahci_cmd_tab *ctp;
     struct ata_ahci_cmd_list *clp;
     int offset = ch->unit << 7;
-    int port = atadev->unit & 0x0f;
+    int port = request->unit & 0x0f;
     int entries = 0;
     int fis_size;
 	
     /* get a piece of the workspace for this request */
     ctp = (struct ata_ahci_cmd_tab *)
-	  (ch->dma.work + ATA_AHCI_CT_OFFSET + (ATA_AHCI_CT_SIZE*request->tag));
+	  (ch->dma.work + ATA_AHCI_CT_OFFSET);
 
     /* setup the FIS for this request */
     if (!(fis_size = ata_ahci_setup_fis(ctp, request))) {
-	device_printf(request->dev, "setting up SATA FIS failed\n");
+	device_printf(request->parent, "setting up SATA FIS failed\n");
 	request->result = EIO;
 	return ATA_OP_FINISHED;
     }
@@ -409,7 +408,7 @@ ata_ahci_begin_transaction(struct ata_re
     /* if request moves data setup and load SG list */
     if (request->flags & (ATA_R_READ | ATA_R_WRITE)) {
 	if (ch->dma.load(request, ctp->prd_tab, &entries)) {
-	    device_printf(request->dev, "setting up DMA failed\n");
+	    device_printf(request->parent, "setting up DMA failed\n");
 	    request->result = EIO;
 	    return ATA_OP_FINISHED;
 	}
@@ -417,7 +416,7 @@ ata_ahci_begin_transaction(struct ata_re
 
     /* setup the command list entry */
     clp = (struct ata_ahci_cmd_list *)
-	  (ch->dma.work + ATA_AHCI_CL_OFFSET + (ATA_AHCI_CL_SIZE*request->tag));
+	  (ch->dma.work + ATA_AHCI_CL_OFFSET);
 
     clp->prd_length = entries;
     clp->cmd_flags = (request->flags & ATA_R_WRITE ? ATA_AHCI_CMD_WRITE : 0) |
@@ -426,12 +425,7 @@ ata_ahci_begin_transaction(struct ata_re
 		     (fis_size / sizeof(u_int32_t)) |
     		     (port << 12);
     clp->bytecount = 0;
-    clp->cmd_table_phys = htole64(ch->dma.work_bus + ATA_AHCI_CT_OFFSET +
-				  (ATA_AHCI_CT_SIZE * request->tag));
-
-    /* clear eventual ACTIVE bit */
-    ATA_IDX_OUTL(ch, ATA_SACTIVE,
-		 ATA_IDX_INL(ch, ATA_SACTIVE) & (1 << request->tag));
+    clp->cmd_table_phys = htole64(ch->dma.work_bus + ATA_AHCI_CT_OFFSET);
 
     /* set command type bit */
     if (request->flags & ATA_R_ATAPI)
@@ -444,7 +438,7 @@ ata_ahci_begin_transaction(struct ata_re
 		 ~ATA_AHCI_P_CMD_ATAPI);
 
     /* issue command to controller */
-    ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, (1 << request->tag));
+    ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, 1);
     
     if (!(request->flags & ATA_R_ATAPI)) {
 	/* device reset doesn't interrupt */
@@ -476,7 +470,7 @@ ata_ahci_begin_transaction(struct ata_re
 static int
 ata_ahci_end_transaction(struct ata_request *request)
 {
-    struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev));
+    struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent));
     struct ata_channel *ch = device_get_softc(request->parent);
     struct ata_ahci_cmd_list *clp;
     u_int32_t tf_data;
@@ -495,13 +489,12 @@ ata_ahci_end_transaction(struct ata_requ
 
     /* on control commands read back registers to the request struct */
     if (request->flags & ATA_R_CONTROL) {
-	struct ata_device *atadev = device_get_softc(request->dev);
 	u_int8_t *fis = ch->dma.work + ATA_AHCI_FB_OFFSET + 0x40;
 
 	request->u.ata.count = fis[12] | ((u_int16_t)fis[13] << 8);
 	request->u.ata.lba = fis[4] | ((u_int64_t)fis[5] << 8) |
 			     ((u_int64_t)fis[6] << 16);
-	if (atadev->flags & ATA_D_48BIT_ACTIVE)
+	if (request->flags & ATA_R_48BIT)
 	    request->u.ata.lba |= ((u_int64_t)fis[8] << 24) |
 				  ((u_int64_t)fis[9] << 32) |
 				  ((u_int64_t)fis[10] << 40);
@@ -511,7 +504,7 @@ ata_ahci_end_transaction(struct ata_requ
 
     /* record how much data we actually moved */
     clp = (struct ata_ahci_cmd_list *)
-	  (ch->dma.work + ATA_AHCI_CL_OFFSET + (ATA_AHCI_CL_SIZE*request->tag));
+	  (ch->dma.work + ATA_AHCI_CL_OFFSET);
     request->donecount = clp->bytecount;
 
     /* release SG list etc */

Modified: head/sys/dev/ata/chipsets/ata-intel.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-intel.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/chipsets/ata-intel.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -466,10 +466,10 @@ ata_intel_31244_status(device_t dev)
 static void
 ata_intel_31244_tf_write(struct ata_request *request)
 {
-    struct ata_channel *ch = device_get_softc(device_get_parent(request->dev));
+    struct ata_channel *ch = device_get_softc(request->parent);
     struct ata_device *atadev = device_get_softc(request->dev);
 
-    if (atadev->flags & ATA_D_48BIT_ACTIVE) {
+    if (request->flags & ATA_R_48BIT) {
 	ATA_IDX_OUTW(ch, ATA_FEATURE, request->u.ata.feature);
 	ATA_IDX_OUTW(ch, ATA_COUNT, request->u.ata.count);
 	ATA_IDX_OUTW(ch, ATA_SECTOR, ((request->u.ata.lba >> 16) & 0xff00) |
@@ -478,7 +478,7 @@ ata_intel_31244_tf_write(struct ata_requ
 				       ((request->u.ata.lba >> 8) & 0x00ff));
 	ATA_IDX_OUTW(ch, ATA_CYL_MSB, ((request->u.ata.lba >> 32) & 0xff00) | 
 				       ((request->u.ata.lba >> 16) & 0x00ff));
-	ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(atadev->unit));
+	ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(request->unit));
     }
     else {
 	ATA_IDX_OUTB(ch, ATA_FEATURE, request->u.ata.feature);
@@ -499,7 +499,7 @@ ata_intel_31244_tf_write(struct ata_requ
 			 (request->u.ata.lba / (sectors * heads)));
 	    ATA_IDX_OUTB(ch, ATA_CYL_MSB,
 			 (request->u.ata.lba / (sectors * heads)) >> 8);
-	    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(atadev->unit) | 
+	    ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(request->unit) | 
 			 (((request->u.ata.lba% (sectors * heads)) /
 			   sectors) & 0xf));
 	}
@@ -508,7 +508,7 @@ ata_intel_31244_tf_write(struct ata_requ
 	    ATA_IDX_OUTB(ch, ATA_CYL_LSB, request->u.ata.lba >> 8);
 	    ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->u.ata.lba >> 16);
 	    ATA_IDX_OUTB(ch, ATA_DRIVE,
-			 ATA_D_IBM | ATA_D_LBA | ATA_DEV(atadev->unit) |
+			 ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit) |
 			 ((request->u.ata.lba >> 24) & 0x0f));
 	}
     }

Modified: head/sys/dev/ata/chipsets/ata-marvell.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-marvell.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/chipsets/ata-marvell.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -354,7 +354,7 @@ ata_marvell_edma_status(device_t dev)
 static int
 ata_marvell_edma_begin_transaction(struct ata_request *request)
 {
-    struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev));
+    struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent));
     struct ata_channel *ch = device_get_softc(request->parent);
     u_int32_t req_in;
     u_int8_t *bytep;
@@ -363,7 +363,9 @@ ata_marvell_edma_begin_transaction(struc
 
     /* only DMA R/W goes through the EMDA machine */
     if (request->u.ata.command != ATA_READ_DMA &&
-	request->u.ata.command != ATA_WRITE_DMA) {
+	request->u.ata.command != ATA_WRITE_DMA &&
+	request->u.ata.command != ATA_READ_DMA48 &&
+	request->u.ata.command != ATA_WRITE_DMA48) {
 
 	/* disable the EDMA machinery */
 	if (ATA_INL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch)) & 0x00000001)
@@ -371,12 +373,9 @@ ata_marvell_edma_begin_transaction(struc
 	return ata_begin_transaction(request);
     }
 
-    /* check for 48 bit access and convert if needed */
-    ata_modify_if_48bit(request);
-
     /* check sanity, setup SG list and DMA engine */
     if ((error = ch->dma.load(request, NULL, NULL))) {
-	device_printf(request->dev, "setting up DMA failed\n");
+	device_printf(request->parent, "setting up DMA failed\n");
 	request->result = error;
 	return ATA_OP_FINISHED;
     }
@@ -472,7 +471,7 @@ ata_marvell_edma_begin_transaction(struc
 static int
 ata_marvell_edma_end_transaction(struct ata_request *request)
 {
-    struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev));
+    struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent));
     struct ata_channel *ch = device_get_softc(request->parent);
     int offset = (ch->unit > 3 ? 0x30014 : 0x20014);
     u_int32_t icr = ATA_INL(ctlr->r_res1, offset);

Modified: head/sys/dev/ata/chipsets/ata-promise.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-promise.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/chipsets/ata-promise.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -387,11 +387,10 @@ ata_promise_status(device_t dev)
 static int
 ata_promise_dmastart(struct ata_request *request)
 {
-    struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev));
+    struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent));
     struct ata_channel *ch = device_get_softc(request->parent);
-    struct ata_device *atadev  = device_get_softc(request->dev);
 
-    if (atadev->flags & ATA_D_48BIT_ACTIVE) {
+    if (request->flags & ATA_R_48BIT) {
 	ATA_OUTB(ctlr->r_res1, 0x11,
 		 ATA_INB(ctlr->r_res1, 0x11) | (ch->unit ? 0x08 : 0x02));
 	ATA_OUTL(ctlr->r_res1, ch->unit ? 0x24 : 0x20,
@@ -411,12 +410,11 @@ ata_promise_dmastart(struct ata_request 
 static int
 ata_promise_dmastop(struct ata_request *request)
 {
-    struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev));
+    struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent));
     struct ata_channel *ch = device_get_softc(request->parent);
-    struct ata_device *atadev  = device_get_softc(request->dev);
     int error;
 
-    if (atadev->flags & ATA_D_48BIT_ACTIVE) {
+    if (request->flags & ATA_R_48BIT) {
 	ATA_OUTB(ctlr->r_res1, 0x11,
 		 ATA_INB(ctlr->r_res1, 0x11) & ~(ch->unit ? 0x08 : 0x02));
 	ATA_OUTL(ctlr->r_res1, ch->unit ? 0x24 : 0x20, 0);
@@ -682,9 +680,8 @@ ata_promise_mio_status(device_t dev)
 static int
 ata_promise_mio_command(struct ata_request *request)
 {
-    struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev));
+    struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent));
     struct ata_channel *ch = device_get_softc(request->parent);
-    struct ata_device *atadev = device_get_softc(request->dev);
 
     u_int32_t *wordp = (u_int32_t *)ch->dma.work;
 
@@ -693,7 +690,7 @@ ata_promise_mio_command(struct ata_reque
     if ((ctlr->chip->cfg2 == PR_SATA2) ||
         ((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2))) {
 	/* set portmultiplier port */
-	ATA_OUTB(ctlr->r_res2, 0x4e8 + (ch->unit << 8), atadev->unit & 0x0f);
+	ATA_OUTB(ctlr->r_res2, 0x4e8 + (ch->unit << 8), request->unit & 0x0f);
     }
 
     /* XXX SOS add ATAPI commands support later */
@@ -1051,7 +1048,7 @@ ata_promise_sx4_intr(void *data)
 static int
 ata_promise_sx4_command(struct ata_request *request)
 {
-    device_t gparent = GRANDPARENT(request->dev);
+    device_t gparent = device_get_parent(request->parent);
     struct ata_pci_controller *ctlr = device_get_softc(gparent);
     struct ata_channel *ch = device_get_softc(request->parent);
     struct ata_dma_prdentry *prd;
@@ -1158,15 +1155,14 @@ ata_promise_sx4_command(struct ata_reque
 static int
 ata_promise_apkt(u_int8_t *bytep, struct ata_request *request)
 { 
-    struct ata_device *atadev = device_get_softc(request->dev);
     int i = 12;
 
     bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_REG | ATA_PDC_WAIT_NBUSY|ATA_DRIVE;
-    bytep[i++] = ATA_D_IBM | ATA_D_LBA | ATA_DEV(atadev->unit);
+    bytep[i++] = ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit);
     bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_CTL;
     bytep[i++] = ATA_A_4BIT;
 
-    if (atadev->flags & ATA_D_48BIT_ACTIVE) {
+    if (request->flags & ATA_R_48BIT) {
 	bytep[i++] = ATA_PDC_2B | ATA_PDC_WRITE_REG | ATA_FEATURE;
 	bytep[i++] = request->u.ata.feature >> 8;
 	bytep[i++] = request->u.ata.feature;
@@ -1183,7 +1179,7 @@ ata_promise_apkt(u_int8_t *bytep, struct
 	bytep[i++] = request->u.ata.lba >> 40;
 	bytep[i++] = request->u.ata.lba >> 16;
 	bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_REG | ATA_DRIVE;
-	bytep[i++] = ATA_D_LBA | ATA_DEV(atadev->unit);
+	bytep[i++] = ATA_D_LBA | ATA_DEV(request->unit);
     }
     else {
 	bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_REG | ATA_FEATURE;
@@ -1197,8 +1193,7 @@ ata_promise_apkt(u_int8_t *bytep, struct
 	bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_REG | ATA_CYL_MSB;
 	bytep[i++] = request->u.ata.lba >> 16;
 	bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_REG | ATA_DRIVE;
-	bytep[i++] = (atadev->flags & ATA_D_USE_CHS ? 0 : ATA_D_LBA) |
-		     ATA_D_IBM | ATA_DEV(atadev->unit) |
+	bytep[i++] = ATA_D_LBA | ATA_D_IBM | ATA_DEV(request->unit) |
 		     ((request->u.ata.lba >> 24)&0xf);
     }
     bytep[i++] = ATA_PDC_1B | ATA_PDC_WRITE_END | ATA_COMMAND;

Modified: head/sys/dev/ata/chipsets/ata-serverworks.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-serverworks.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/chipsets/ata-serverworks.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -259,9 +259,8 @@ static void
 ata_serverworks_tf_read(struct ata_request *request)
 {
     struct ata_channel *ch = device_get_softc(request->parent);
-    struct ata_device *atadev = device_get_softc(request->dev);
 
-    if (atadev->flags & ATA_D_48BIT_ACTIVE) {
+    if (request->flags & ATA_R_48BIT) {
 	u_int16_t temp;
 
 	request->u.ata.count = ATA_IDX_INW(ch, ATA_COUNT);
@@ -290,7 +289,7 @@ ata_serverworks_tf_write(struct ata_requ
     struct ata_channel *ch = device_get_softc(request->parent);
     struct ata_device *atadev = device_get_softc(request->dev);
 
-    if (atadev->flags & ATA_D_48BIT_ACTIVE) {
+    if (request->flags & ATA_R_48BIT) {
 	ATA_IDX_OUTW(ch, ATA_FEATURE, request->u.ata.feature);
 	ATA_IDX_OUTW(ch, ATA_COUNT, request->u.ata.count);
 	ATA_IDX_OUTW(ch, ATA_SECTOR, ((request->u.ata.lba >> 16) & 0xff00) |
@@ -299,7 +298,7 @@ ata_serverworks_tf_write(struct ata_requ
 				       ((request->u.ata.lba >> 8) & 0x00ff));
 	ATA_IDX_OUTW(ch, ATA_CYL_MSB, ((request->u.ata.lba >> 32) & 0xff00) | 
 				       ((request->u.ata.lba >> 16) & 0x00ff));
-	ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(atadev->unit));
+	ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(request->unit));
     }
     else {
 	ATA_IDX_OUTW(ch, ATA_FEATURE, request->u.ata.feature);
@@ -320,7 +319,7 @@ ata_serverworks_tf_write(struct ata_requ
 			 (request->u.ata.lba / (sectors * heads)));
 	    ATA_IDX_OUTW(ch, ATA_CYL_MSB,
 			 (request->u.ata.lba / (sectors * heads)) >> 8);
-	    ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(atadev->unit) | 
+	    ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(request->unit) | 
 			 (((request->u.ata.lba% (sectors * heads)) /
 			   sectors) & 0xf));
 	}
@@ -329,7 +328,7 @@ ata_serverworks_tf_write(struct ata_requ
 	    ATA_IDX_OUTW(ch, ATA_CYL_LSB, request->u.ata.lba >> 8);
 	    ATA_IDX_OUTW(ch, ATA_CYL_MSB, request->u.ata.lba >> 16);
 	    ATA_IDX_OUTW(ch, ATA_DRIVE,
-			 ATA_D_IBM | ATA_D_LBA | ATA_DEV(atadev->unit) |
+			 ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit) |
 			 ((request->u.ata.lba >> 24) & 0x0f));
 	}
     }

Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-siliconimage.c	Sat Oct 31 12:58:13 2009	(r198716)
+++ head/sys/dev/ata/chipsets/ata-siliconimage.c	Sat Oct 31 13:24:14 2009	(r198717)
@@ -457,7 +457,7 @@ struct ata_siiprb_dma_prdentry {
     u_int32_t control;
 } __packed;
 
-#define ATA_SIIPRB_DMA_ENTRIES		125
+#define ATA_SIIPRB_DMA_ENTRIES		129
 struct ata_siiprb_ata_command {
     struct ata_siiprb_dma_prdentry prd[ATA_SIIPRB_DMA_ENTRIES];
 } __packed;
@@ -542,7 +542,7 @@ ata_siiprb_status(device_t dev)
 static int
 ata_siiprb_begin_transaction(struct ata_request *request)
 {
-    struct ata_pci_controller *ctlr=device_get_softc(GRANDPARENT(request->dev));
+    struct ata_pci_controller *ctlr=device_get_softc(device_get_parent(request->parent));
     struct ata_channel *ch = device_get_softc(request->parent);
     struct ata_siiprb_command *prb;
     struct ata_siiprb_dma_prdentry *prd;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 14:19:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 66BDB106568F;
	Sat, 31 Oct 2009 14:19:50 +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 562E88FC16;
	Sat, 31 Oct 2009 14:19:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VEJoiD092016;
	Sat, 31 Oct 2009 14:19:50 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VEJoPp092014;
	Sat, 31 Oct 2009 14:19:50 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910311419.n9VEJoPp092014@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 31 Oct 2009 14:19:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198718 - head/sys/dev/ata/chipsets
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 14:19:50 -0000

Author: mav
Date: Sat Oct 31 14:19:50 2009
New Revision: 198718
URL: http://svn.freebsd.org/changeset/base/198718

Log:
  Allow newly added controllers to use full I/O sizes.

Modified:
  head/sys/dev/ata/chipsets/ata-marvell.c

Modified: head/sys/dev/ata/chipsets/ata-marvell.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-marvell.c	Sat Oct 31 13:24:14 2009	(r198717)
+++ head/sys/dev/ata/chipsets/ata-marvell.c	Sat Oct 31 14:19:50 2009	(r198718)
@@ -591,7 +591,9 @@ ata_marvell_edma_dmainit(device_t dev)
 
     /* chip does not reliably do 64K DMA transfers */
     if (ctlr->chip->cfg2 == MV_50XX || ctlr->chip->cfg2 == MV_60XX)
-	ch->dma.max_iosize = 64 * DEV_BSIZE; 
+	ch->dma.max_iosize = 64 * DEV_BSIZE;
+    else
+	ch->dma.max_iosize = (ATA_DMA_ENTRIES - 1) * PAGE_SIZE;
 }
 
 ATA_DECLARE_DRIVER(ata_marvell);

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 17:06:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 636D2106566B;
	Sat, 31 Oct 2009 17:06:37 +0000 (UTC) (envelope-from se@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1CCA58FC16;
	Sat, 31 Oct 2009 17:06:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VH6aAV096749;
	Sat, 31 Oct 2009 17:06:37 GMT (envelope-from se@svn.freebsd.org)
Received: (from se@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VH6abO096748;
	Sat, 31 Oct 2009 17:06:36 GMT (envelope-from se@svn.freebsd.org)
Message-Id: <200910311706.n9VH6abO096748@svn.freebsd.org>
From: Stefan Esser 
Date: Sat, 31 Oct 2009 17:06:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198719 - head/sys/dev/sym
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 17:06:37 -0000

Author: se
Date: Sat Oct 31 17:06:36 2009
New Revision: 198719
URL: http://svn.freebsd.org/changeset/base/198719

Log:
  While certain supported Symbios/LSI SCSI chips (532c896, 53c1000, 53c1010)
  do support 64bit addresses, the current SCRIPTS code supports only 32bit
  addresses causing data corruption for buffer addresses >4GB. This problem
  affects 64bit machines with more than 4GB RAM or amd64 with 4GB and
  memory hole remapping.
  Work-around this problem with a bus_dma tag that requests bounce-buffers
  for addresses >4GB. This causes some overhead, but given the maximum SCSI
  bus speed of 160MB/s compared, the effect should hardly be noticeable.
  The problem was reported by Mike Watters (mike at mwatters net) who also
  verified that this fix cures the problem.
  
  Since this change is a NOOP on systems with less than 4GB RAM and fixes
  data corruption (in RAM and on disk) on systems with more than 4GB, I hope
  that this change is accepted for 8.0.
  
  MFC after:	3 days (pending approval)

Modified:
  head/sys/dev/sym/sym_hipd.c

Modified: head/sys/dev/sym/sym_hipd.c
==============================================================================
--- head/sys/dev/sym/sym_hipd.c	Sat Oct 31 14:19:50 2009	(r198718)
+++ head/sys/dev/sym/sym_hipd.c	Sat Oct 31 17:06:36 2009	(r198719)
@@ -8582,7 +8582,7 @@ sym_pci_attach(device_t dev)
 	 *  Allocate a tag for the DMA of user data.
 	 */
 	if (bus_dma_tag_create(np->bus_dmat, 1, (1<<24),
-				BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
+				BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
 				NULL, NULL,
 				BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG,
 				(1<<24), 0, busdma_lock_mutex, &np->mtx,

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 17:39:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ACBF61065676;
	Sat, 31 Oct 2009 17:39:56 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9BD418FC18;
	Sat, 31 Oct 2009 17:39:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VHduJI097563;
	Sat, 31 Oct 2009 17:39:56 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VHdu6T097561;
	Sat, 31 Oct 2009 17:39:56 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <200910311739.n9VHdu6T097561@svn.freebsd.org>
From: Alan Cox 
Date: Sat, 31 Oct 2009 17:39:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198721 - head/sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 17:39:56 -0000

Author: alc
Date: Sat Oct 31 17:39:56 2009
New Revision: 198721
URL: http://svn.freebsd.org/changeset/base/198721

Log:
  Correct an error in vm_fault_copy_entry() that has existed since the first
  version of this file.  When a process forks, any wired pages are immediately
  copied because copy-on-write is not supported for wired pages.  In other
  words, the child process is given its own private copy of each wired page
  from its parent's address space.  Unfortunately, to date, these copied pages
  have been mapped into the child's address space with the wrong permissions,
  typically VM_PROT_ALL.  This change corrects the permissions.
  
  Reviewed by:	kib

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==============================================================================
--- head/sys/vm/vm_fault.c	Sat Oct 31 17:28:08 2009	(r198720)
+++ head/sys/vm/vm_fault.c	Sat Oct 31 17:39:56 2009	(r198721)
@@ -1179,7 +1179,7 @@ vm_fault_copy_entry(vm_map_t dst_map, vm
 		dst_object->uip = dst_entry->uip;
 		dst_entry->uip = NULL;
 	}
-	access = prot = dst_entry->max_protection;
+	access = prot = dst_entry->protection;
 	/*
 	 * If not an upgrade, then enter the mappings in the pmap as
 	 * read and/or execute accesses.  Otherwise, enter them as

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 17:46:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C1A01065694;
	Sat, 31 Oct 2009 17:46:50 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4AC728FC1D;
	Sat, 31 Oct 2009 17:46:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VHko7j097775;
	Sat, 31 Oct 2009 17:46:50 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VHkofi097773;
	Sat, 31 Oct 2009 17:46:50 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910311746.n9VHkofi097773@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sat, 31 Oct 2009 17:46:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198722 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 17:46:50 -0000

Author: nwhitehorn
Date: Sat Oct 31 17:46:50 2009
New Revision: 198722
URL: http://svn.freebsd.org/changeset/base/198722

Log:
  Garbage collect set_user_sr(), which is declared static inline and
  never called.

Modified:
  head/sys/powerpc/aim/trap.c

Modified: head/sys/powerpc/aim/trap.c
==============================================================================
--- head/sys/powerpc/aim/trap.c	Sat Oct 31 17:39:56 2009	(r198721)
+++ head/sys/powerpc/aim/trap.c	Sat Oct 31 17:46:50 2009	(r198722)
@@ -85,8 +85,6 @@ static int	fix_unaligned(struct thread *
 static int	handle_onfault(struct trapframe *frame);
 static void	syscall(struct trapframe *frame);
 
-static __inline void	setusr(u_int);
-
 int	setfault(faultbuf);		/* defined in locore.S */
 
 /* Why are these not defined in a header? */
@@ -558,13 +556,6 @@ trap_pfault(struct trapframe *frame, int
 	return (SIGSEGV);
 }
 
-static __inline void
-setusr(u_int content)
-{
-	__asm __volatile ("isync; mtsr %0,%1; isync"
-		      :: "n"(USER_SR), "r"(content));
-}
-
 int
 badaddr(void *addr, size_t size)
 {

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 17:55:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C64C4106566C;
	Sat, 31 Oct 2009 17:55:48 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9B6BD8FC13;
	Sat, 31 Oct 2009 17:55:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VHtmV1098020;
	Sat, 31 Oct 2009 17:55:48 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VHtmcM098018;
	Sat, 31 Oct 2009 17:55:48 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910311755.n9VHtmcM098018@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sat, 31 Oct 2009 17:55:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198723 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 17:55:48 -0000

Author: nwhitehorn
Date: Sat Oct 31 17:55:48 2009
New Revision: 198723
URL: http://svn.freebsd.org/changeset/base/198723

Log:
  Loop on blocked threads when using ULE scheduler, removing an
  XXX MP comment.

Modified:
  head/sys/powerpc/aim/swtch.S

Modified: head/sys/powerpc/aim/swtch.S
==============================================================================
--- head/sys/powerpc/aim/swtch.S	Sat Oct 31 17:46:50 2009	(r198722)
+++ head/sys/powerpc/aim/swtch.S	Sat Oct 31 17:55:48 2009	(r198723)
@@ -57,6 +57,7 @@
  */
 
 #include "assym.s"
+#include "opt_sched.h"
 
 #include 
 
@@ -81,25 +82,23 @@ ENTRY(cpu_throw)
  * Switch to a new thread saving the current state in the old thread.
  */
 ENTRY(cpu_switch)
-	stw	%r5,TD_LOCK(%r3)	/* ULE:	update old thread's lock */
-					/* XXX needs to change for MP */
-
-	lwz	%r5,TD_PCB(%r3)		/* Get the old thread's PCB ptr */
+	lwz	%r6,TD_PCB(%r3)		/* Get the old thread's PCB ptr */
 	mr	%r12,%r2	
-	stmw	%r12,PCB_CONTEXT(%r5)	/* Save the non-volatile GP regs.
+	stmw	%r12,PCB_CONTEXT(%r6)	/* Save the non-volatile GP regs.
 					   These can now be used for scratch */
 
 	mfcr	%r16			/* Save the condition register */
-	stw	%r16,PCB_CR(%r5)
+	stw	%r16,PCB_CR(%r6)
 	mflr	%r16			/* Save the link register */
-	stw	%r16,PCB_LR(%r5)
+	stw	%r16,PCB_LR(%r6)
 	mfsr	%r16,USER_SR		/* Save USER_SR for copyin/out */
 	isync
-	stw	%r16,PCB_AIM_USR(%r5)
-	stw	%r1,PCB_SP(%r5)		/* Save the stack pointer */
+	stw	%r16,PCB_AIM_USR(%r6)
+	stw	%r1,PCB_SP(%r6)		/* Save the stack pointer */
 
 	mr	%r14,%r3		/* Copy the old thread ptr... */
 	mr	%r15,%r4		/* and the new thread ptr in scratch */
+	mr	%r16,%r5		/* and the new lock */
 	
 	lwz	%r6,PCB_FLAGS(%r5)
 	/* Save FPU context if needed */
@@ -118,7 +117,20 @@ ENTRY(cpu_switch)
 	mr	%r3,%r14		/* restore old thread ptr */
 	bl	pmap_deactivate		/* Deactivate the current pmap */
 
+	stw	%r16,TD_LOCK(%r14)	/* ULE:	update old thread's lock */
+
 cpu_switchin:
+#if defined(SMP) && defined(SCHED_ULE)
+	/* Wait for the new thread to become unblocked */
+	sync
+	lis	%r6,blocked_lock@ha
+	addi	%r6,%r6,blocked_lock@l
+blocked_loop:
+	lwz	%r7,TD_LOCK(%r15)
+	cmpw	%r6,%r7 
+	beq	blocked_loop
+#endif
+
 	mfsprg	%r7,0			/* Get the pcpu pointer */
 	stw	%r15,PC_CURTHREAD(%r7)	/* Store new current thread */
 	lwz	%r17,TD_PCB(%r15)	/* Store new current PCB */

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 17:59:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 31E171065670;
	Sat, 31 Oct 2009 17:59:25 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 205DE8FC0C;
	Sat, 31 Oct 2009 17:59:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VHxPYb098124;
	Sat, 31 Oct 2009 17:59:25 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VHxP4U098122;
	Sat, 31 Oct 2009 17:59:25 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910311759.n9VHxP4U098122@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sat, 31 Oct 2009 17:59:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198724 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 17:59:25 -0000

Author: nwhitehorn
Date: Sat Oct 31 17:59:24 2009
New Revision: 198724
URL: http://svn.freebsd.org/changeset/base/198724

Log:
  Fix a race in casuword() exposed by csup. casuword() non-atomically read
  the current value of its argument before atomically replacing it, which
  could occasionally return the wrong value on an SMP system. This resulted
  in user mutex operations hanging when using threaded applications.

Modified:
  head/sys/powerpc/aim/copyinout.c

Modified: head/sys/powerpc/aim/copyinout.c
==============================================================================
--- head/sys/powerpc/aim/copyinout.c	Sat Oct 31 17:55:48 2009	(r198723)
+++ head/sys/powerpc/aim/copyinout.c	Sat Oct 31 17:59:24 2009	(r198724)
@@ -347,8 +347,19 @@ casuword(volatile u_long *addr, u_long o
 		return (-1);
 	}
 
-	val = *p;
-	(void) atomic_cmpset_32((volatile uint32_t *)p, old, new);
+	__asm __volatile (
+		"1:\tlwarx %0, 0, %2\n\t"	/* load old value */
+		"cmplw %3, %0\n\t"		/* compare */
+		"bne 2f\n\t"			/* exit if not equal */
+		"stwcx. %4, 0, %2\n\t"      	/* attempt to store */
+		"bne- 1b\n\t"			/* spin if failed */
+		"b 3f\n\t"			/* we've succeeded */
+		"2:\n\t"
+		"stwcx. %0, 0, %2\n\t"       	/* clear reservation (74xx) */
+		"3:\n\t"
+		: "=&r" (val), "=m" (*p)
+		: "r" (p), "r" (old), "r" (new), "m" (*p)
+		: "cc", "memory");
 
 	td->td_pcb->pcb_onfault = NULL;
 

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 18:04:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1B8DA10656AC;
	Sat, 31 Oct 2009 18:04:35 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0A29B8FC20;
	Sat, 31 Oct 2009 18:04:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VI4Y2V098369;
	Sat, 31 Oct 2009 18:04:34 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VI4Yqe098367;
	Sat, 31 Oct 2009 18:04:34 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910311804.n9VI4Yqe098367@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sat, 31 Oct 2009 18:04:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198725 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 18:04:35 -0000

Author: nwhitehorn
Date: Sat Oct 31 18:04:34 2009
New Revision: 198725
URL: http://svn.freebsd.org/changeset/base/198725

Log:
  Remove an unnecessary sync that crept in the last commit.

Modified:
  head/sys/powerpc/aim/swtch.S

Modified: head/sys/powerpc/aim/swtch.S
==============================================================================
--- head/sys/powerpc/aim/swtch.S	Sat Oct 31 17:59:24 2009	(r198724)
+++ head/sys/powerpc/aim/swtch.S	Sat Oct 31 18:04:34 2009	(r198725)
@@ -122,7 +122,6 @@ ENTRY(cpu_switch)
 cpu_switchin:
 #if defined(SMP) && defined(SCHED_ULE)
 	/* Wait for the new thread to become unblocked */
-	sync
 	lis	%r6,blocked_lock@ha
 	addi	%r6,%r6,blocked_lock@l
 blocked_loop:

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 18:54:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 46CCB10656C0;
	Sat, 31 Oct 2009 18:54:45 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211])
	by mx1.freebsd.org (Postfix) with ESMTP id DB1B98FC15;
	Sat, 31 Oct 2009 18:54:44 +0000 (UTC)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id F1EEE1CC4D; Sat, 31 Oct 2009 19:54:43 +0100 (CET)
Date: Sat, 31 Oct 2009 19:54:43 +0100
From: Ed Schouten 
To: Christian Brueffer 
Message-ID: <20091031185443.GE1293@hoeg.nl>
References: <200910311222.n9VCMOGk089115@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="Rm5rkB9L8kG9H2n8"
Content-Disposition: inline
In-Reply-To: <200910311222.n9VCMOGk089115@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198714 - head/sbin/mknod
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 18:54:45 -0000


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

Hello Christian,

* Christian Brueffer  wrote:
> The majors file was removed long ago, 0 should be used instead.

It's a bit more complex than that. Right now devices are automatically
numbered, using a 32-bits integer. The following macros are used to
obtain the minor and major numbers (see ):

| #define major(x)	((int)(((u_int)(x) >> 8)&0xff))	/* major number */
| #define minor(x)	((int)((x)&0xffff00ff))		/* minor number */

This means that a device number above 255 may (or may not) have a
non-zero major number. Just run the following code:

| #include 
| #include 
| #include 
|=20
| int
| main(int argc, char *argv[])
| {
|=20
| 	while (posix_openpt(O_RDWR|O_NOCTTY) >=3D 0);
| 	sleep(30);
| 	return (0);
| }

On my system it even generates device nodes in /dev/pts with a major
number of 4. I wrote a manpage for these macros some time ago. See
makedev(3).

--=20
 Ed Schouten 
 WWW: http://80386.nl/

--Rm5rkB9L8kG9H2n8
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkrsh/MACgkQ52SDGA2eCwVVuACfe4j8+CKF2Hb4Rxn3pEbz3Zpz
yYcAnjCOF15CDu9zQoIwL76KydvkWvU1
=A2LX
-----END PGP SIGNATURE-----

--Rm5rkB9L8kG9H2n8--

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 19:05:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BE1C6106566B;
	Sat, 31 Oct 2009 19:05:26 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211])
	by mx1.freebsd.org (Postfix) with ESMTP id 8308A8FC1B;
	Sat, 31 Oct 2009 19:05:26 +0000 (UTC)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id AF7E21CC4D; Sat, 31 Oct 2009 20:05:25 +0100 (CET)
Date: Sat, 31 Oct 2009 20:05:25 +0100
From: Ed Schouten 
To: Christian Brueffer 
Message-ID: <20091031190525.GF1293@hoeg.nl>
References: <200910311222.n9VCMOGk089115@svn.freebsd.org>
	<20091031185443.GE1293@hoeg.nl>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="YfqBrEkRVu0wMIYz"
Content-Disposition: inline
In-Reply-To: <20091031185443.GE1293@hoeg.nl>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198714 - head/sbin/mknod
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 19:05:26 -0000


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

* Ed Schouten  wrote:
> It's a bit more complex than that. Right now devices are automatically
> numbered, using a 32-bits integer. The following macros are used to
> obtain the minor and major numbers (see ):
>=20
> | #define major(x)	((int)(((u_int)(x) >> 8)&0xff))	/* major number */
> | #define minor(x)	((int)((x)&0xffff00ff))		/* minor number */
>=20
> This means that a device number above 255 may (or may not) have a
> non-zero major number. Just run the following code:

That said, I really couldn't care less if we eventually just nuked the
entire major/minor number distinction and let applications just print
the dev_t directly. This means `ls -l' would just print a single number.
POSIX doesn't standardize major/minor numbers anyway. Just the dev_t.

Unfortunately I do realize this probably breaks a lot of high profile
software.

--=20
 Ed Schouten 
 WWW: http://80386.nl/

--YfqBrEkRVu0wMIYz
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkrsinUACgkQ52SDGA2eCwXmAgCfZ/lLmeSjmhVTHTnlJjk7N50C
CggAn0ciIHm47trl3f51TQHGIdX79PTF
=6kfo
-----END PGP SIGNATURE-----

--YfqBrEkRVu0wMIYz--

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 20:59:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B63B7106566B;
	Sat, 31 Oct 2009 20:59:13 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A5EE18FC13;
	Sat, 31 Oct 2009 20:59:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VKxDxD002789;
	Sat, 31 Oct 2009 20:59:13 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VKxDjG002787;
	Sat, 31 Oct 2009 20:59:13 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910312059.n9VKxDjG002787@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sat, 31 Oct 2009 20:59:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198731 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 20:59:13 -0000

Author: nwhitehorn
Date: Sat Oct 31 20:59:13 2009
New Revision: 198731
URL: http://svn.freebsd.org/changeset/base/198731

Log:
  Unbreak cpu_switch(). The register allocator in my brain is clearly
  broken. Also, Altivec context switching worked before only by accident,
  but should work now by design.

Modified:
  head/sys/powerpc/aim/swtch.S

Modified: head/sys/powerpc/aim/swtch.S
==============================================================================
--- head/sys/powerpc/aim/swtch.S	Sat Oct 31 19:22:12 2009	(r198730)
+++ head/sys/powerpc/aim/swtch.S	Sat Oct 31 20:59:13 2009	(r198731)
@@ -99,17 +99,19 @@ ENTRY(cpu_switch)
 	mr	%r14,%r3		/* Copy the old thread ptr... */
 	mr	%r15,%r4		/* and the new thread ptr in scratch */
 	mr	%r16,%r5		/* and the new lock */
+	mr	%r17,%r6		/* and the PCB */
 	
-	lwz	%r6,PCB_FLAGS(%r5)
+	lwz	%r7,PCB_FLAGS(%r17)
 	/* Save FPU context if needed */
-	andi.	%r6, %r6, PCB_FPU
+	andi.	%r7, %r7, PCB_FPU
 	beq	.L1
 	bl	save_fpu
 
 .L1:
-	lwz	%r6,PCB_FLAGS(%r5)
+	mr	%r3,%r14		/* restore old thread ptr */
+	lwz	%r7,PCB_FLAGS(%r17)
 	/* Save Altivec context if needed */
-	andi.	%r6, %r6, PCB_VEC
+	andi.	%r7, %r7, PCB_VEC
 	beq	.L2
 	bl	save_vec
 	

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 22:15:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A9118106566B;
	Sat, 31 Oct 2009 22:15:00 +0000 (UTC)
	(envelope-from peterjeremy@acm.org)
Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au
	[211.29.132.198])
	by mx1.freebsd.org (Postfix) with ESMTP id 1FCB68FC18;
	Sat, 31 Oct 2009 22:14:59 +0000 (UTC)
Received: from server.vk2pj.dyndns.org
	(c122-106-233-13.belrs3.nsw.optusnet.com.au [122.106.233.13])
	by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n9VMEuvD016131
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sun, 1 Nov 2009 09:14:57 +1100
X-Bogosity: Ham, spamicity=0.000000
Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])
	by server.vk2pj.dyndns.org (8.14.3/8.14.3) with ESMTP id n9VMEtTJ059455;
	Sun, 1 Nov 2009 09:14:55 +1100 (EST)
	(envelope-from peter@server.vk2pj.dyndns.org)
Received: (from peter@localhost)
	by server.vk2pj.dyndns.org (8.14.3/8.14.3/Submit) id n9VMEtAe059454;
	Sun, 1 Nov 2009 09:14:55 +1100 (EST) (envelope-from peter)
Date: Sun, 1 Nov 2009 09:14:55 +1100
From: Peter Jeremy 
To: Alexander Motin 
Message-ID: <20091031221455.GA58662@server.vk2pj.dyndns.org>
References: <200910292053.n9TKrQtC009239@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD"
Content-Disposition: inline
In-Reply-To: <200910292053.n9TKrQtC009239@svn.freebsd.org>
X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198623 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 22:15:00 -0000


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

On 2009-Oct-29 20:53:26 +0000, Alexander Motin  wrote:
>  Add missing ATA kernel options dependencies.

Thanks.

--=20
Peter Jeremy

--HlL+5n6rz5pIUxbD
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.13 (FreeBSD)

iEYEARECAAYFAkrstt8ACgkQ/opHv/APuIc6fwCfU3cdm7XyLDFaWje2xDfT+Cmh
63oAoJ44a40f+S6RPmW/+AleKheA955r
=m/8a
-----END PGP SIGNATURE-----

--HlL+5n6rz5pIUxbD--

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 31 22:27:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D0791065676;
	Sat, 31 Oct 2009 22:27:32 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6C51D8FC15;
	Sat, 31 Oct 2009 22:27:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9VMRWPA004981;
	Sat, 31 Oct 2009 22:27:32 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VMRWB4004972;
	Sat, 31 Oct 2009 22:27:32 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200910312227.n9VMRWB4004972@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sat, 31 Oct 2009 22:27:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198733 - in head/sys: conf ia64/ia64 ia64/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 31 Oct 2009 22:27:32 -0000

Author: marcel
Date: Sat Oct 31 22:27:31 2009
New Revision: 198733
URL: http://svn.freebsd.org/changeset/base/198733

Log:
  Reimplement the lazy FP context switching:
  o   Move all code into a single file for easier maintenance.
  o   Use a single global lock to avoid having to handle either
      multiple locks or race conditions.
  o   Make sure to disable the high FP registers after saving
      or dropping them.
  o   use msleep() to wait for the other CPU to save the high
      FP registers.
  
  This change fixes the high FP inconsistency panics.
  
  A single global lock typically serializes too much, which may
  be noticable when a lot of threads use the high FP registers,
  but in that case it's probably better to switch the high FP
  context synchronuously. Put differently: cpu_switch() should
  switch the high FP registers if the incoming and outgoing
  threads both use the high FP registers.

Added:
  head/sys/ia64/ia64/highfp.c   (contents, props changed)
Modified:
  head/sys/conf/files.ia64
  head/sys/ia64/ia64/interrupt.c
  head/sys/ia64/ia64/machdep.c
  head/sys/ia64/ia64/trap.c
  head/sys/ia64/ia64/vm_machdep.c
  head/sys/ia64/include/md_var.h
  head/sys/ia64/include/proc.h

Modified: head/sys/conf/files.ia64
==============================================================================
--- head/sys/conf/files.ia64	Sat Oct 31 21:22:18 2009	(r198732)
+++ head/sys/conf/files.ia64	Sat Oct 31 22:27:31 2009	(r198733)
@@ -84,6 +84,7 @@ ia64/ia64/elf_machdep.c		standard
 ia64/ia64/emulate.c		standard
 ia64/ia64/exception.S		standard
 ia64/ia64/gdb_machdep.c		optional	gdb
+ia64/ia64/highfp.c		standard
 ia64/ia64/in_cksum.c		optional	inet
 ia64/ia64/interrupt.c		standard
 ia64/ia64/locore.S		standard	no-obj

Added: head/sys/ia64/ia64/highfp.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/ia64/ia64/highfp.c	Sat Oct 31 22:27:31 2009	(r198733)
@@ -0,0 +1,181 @@
+/*-
+ * Copyright (c) 2009 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+static struct mtx ia64_highfp_mtx;
+
+static void
+ia64_highfp_init(void *_)
+{
+	mtx_init(&ia64_highfp_mtx, "High FP lock", NULL, MTX_SPIN);
+}
+SYSINIT(ia64_highfp_init, SI_SUB_LOCK, SI_ORDER_ANY, ia64_highfp_init, NULL);
+
+#ifdef SMP
+static int
+ia64_highfp_ipi(struct pcpu *cpu)
+{
+	int error;
+
+	ipi_send(cpu, IPI_HIGH_FP);
+	error = msleep_spin(&cpu->pc_fpcurthread, &ia64_highfp_mtx,
+	    "High FP", 0);
+	return (error);
+}
+#endif
+
+int
+ia64_highfp_drop(struct thread *td)
+{
+	struct pcb *pcb;
+	struct pcpu *cpu;
+
+	pcb = td->td_pcb;
+
+	mtx_lock_spin(&ia64_highfp_mtx);
+	cpu = pcb->pcb_fpcpu;
+	if (cpu != NULL) {
+		KASSERT(cpu->pc_fpcurthread == td,
+		    ("cpu->pc_fpcurthread != td"));
+		td->td_frame->tf_special.psr |= IA64_PSR_DFH;
+		pcb->pcb_fpcpu = NULL;
+		cpu->pc_fpcurthread = NULL;
+	}
+	mtx_unlock_spin(&ia64_highfp_mtx);
+
+	return ((cpu != NULL) ? 1 : 0);
+}
+
+int
+ia64_highfp_enable(struct thread *td, struct trapframe *tf)
+{
+	struct pcb *pcb;
+	struct pcpu *cpu;
+	struct thread *td1;
+
+	pcb = td->td_pcb;
+
+	mtx_lock_spin(&ia64_highfp_mtx);
+	KASSERT((tf->tf_special.psr & IA64_PSR_DFH) != 0,
+	    ("(tf->tf_special.psr & IA64_PSR_DFH) == 0"));
+	cpu = pcb->pcb_fpcpu;
+#ifdef SMP
+	if (cpu != NULL && cpu != pcpup) {
+		KASSERT(cpu->pc_fpcurthread == td,
+		    ("cpu->pc_fpcurthread != td"));
+		ia64_highfp_ipi(cpu);
+	}
+#endif
+	td1 = PCPU_GET(fpcurthread);
+	if (td1 != NULL && td1 != td) {
+		KASSERT(td1->td_pcb->pcb_fpcpu == pcpup,
+		    ("td1->td_pcb->pcb_fpcpu != pcpup"));
+		save_high_fp(&td1->td_pcb->pcb_high_fp);
+		td1->td_frame->tf_special.psr |= IA64_PSR_DFH;
+		td1->td_pcb->pcb_fpcpu = NULL;
+		PCPU_SET(fpcurthread, NULL);
+		td1 = NULL;
+	}
+	if (td1 == NULL) {
+		KASSERT(pcb->pcb_fpcpu == NULL, ("pcb->pcb_fpcpu != NULL"));
+		KASSERT(PCPU_GET(fpcurthread) == NULL,
+		    ("PCPU_GET(fpcurthread) != NULL"));
+		restore_high_fp(&pcb->pcb_high_fp);
+		PCPU_SET(fpcurthread, td);
+		pcb->pcb_fpcpu = pcpup;
+		tf->tf_special.psr &= ~IA64_PSR_MFH;
+	}
+	tf->tf_special.psr &= ~IA64_PSR_DFH;
+	mtx_unlock_spin(&ia64_highfp_mtx);
+
+	return ((td1 != NULL) ? 1 : 0);
+}
+
+int
+ia64_highfp_save(struct thread *td)
+{
+	struct pcb *pcb;
+	struct pcpu *cpu;
+
+	pcb = td->td_pcb;
+
+	mtx_lock_spin(&ia64_highfp_mtx);
+	cpu = pcb->pcb_fpcpu;
+#ifdef SMP
+	if (cpu != NULL && cpu != pcpup) {
+		KASSERT(cpu->pc_fpcurthread == td,
+		    ("cpu->pc_fpcurthread != td"));
+		ia64_highfp_ipi(cpu);
+	} else
+#endif
+	if (cpu != NULL) {
+		KASSERT(cpu->pc_fpcurthread == td,
+		    ("cpu->pc_fpcurthread != td"));
+		save_high_fp(&pcb->pcb_high_fp);
+		td->td_frame->tf_special.psr |= IA64_PSR_DFH;
+		pcb->pcb_fpcpu = NULL;
+		cpu->pc_fpcurthread = NULL;
+	}
+	mtx_unlock_spin(&ia64_highfp_mtx);
+
+	return ((cpu != NULL) ? 1 : 0);
+}
+
+#ifdef SMP
+int
+ia64_highfp_save_ipi(void)
+{
+	struct thread *td;
+
+	mtx_lock_spin(&ia64_highfp_mtx);
+	td = PCPU_GET(fpcurthread);
+	if (td != NULL) {
+		KASSERT(td->td_pcb->pcb_fpcpu == pcpup,
+		    ("td->td_pcb->pcb_fpcpu != pcpup"));
+		save_high_fp(&td->td_pcb->pcb_high_fp);
+		td->td_frame->tf_special.psr |= IA64_PSR_DFH;
+		td->td_pcb->pcb_fpcpu = NULL;
+		PCPU_SET(fpcurthread, NULL);
+	}
+	mtx_unlock_spin(&ia64_highfp_mtx);
+	wakeup(&PCPU_GET(fpcurthread));
+
+	return ((td != NULL) ? 1 : 0);
+}
+#endif

Modified: head/sys/ia64/ia64/interrupt.c
==============================================================================
--- head/sys/ia64/ia64/interrupt.c	Sat Oct 31 21:22:18 2009	(r198732)
+++ head/sys/ia64/ia64/interrupt.c	Sat Oct 31 22:27:31 2009	(r198733)
@@ -216,14 +216,7 @@ interrupt(struct trapframe *tf)
 		asts[PCPU_GET(cpuid)]++;
 		CTR1(KTR_SMP, "IPI_AST, cpuid=%d", PCPU_GET(cpuid));
 	} else if (vector == ipi_vector[IPI_HIGH_FP]) {
-		struct thread *thr = PCPU_GET(fpcurthread);
-		if (thr != NULL) {
-			mtx_lock_spin(&thr->td_md.md_highfp_mtx);
-			save_high_fp(&thr->td_pcb->pcb_high_fp);
-			thr->td_pcb->pcb_fpcpu = NULL;
-			PCPU_SET(fpcurthread, NULL);
-			mtx_unlock_spin(&thr->td_md.md_highfp_mtx);
-		}
+		ia64_highfp_save_ipi();
 	} else if (vector == ipi_vector[IPI_RENDEZVOUS]) {
 		rdvs[PCPU_GET(cpuid)]++;
 		CTR1(KTR_SMP, "IPI_RENDEZVOUS, cpuid=%d", PCPU_GET(cpuid));

Modified: head/sys/ia64/ia64/machdep.c
==============================================================================
--- head/sys/ia64/ia64/machdep.c	Sat Oct 31 21:22:18 2009	(r198732)
+++ head/sys/ia64/ia64/machdep.c	Sat Oct 31 22:27:31 2009	(r198733)
@@ -1461,81 +1461,6 @@ set_fpregs(struct thread *td, struct fpr
 	return (0);
 }
 
-/*
- * High FP register functions.
- */
-
-int
-ia64_highfp_drop(struct thread *td)
-{
-	struct pcb *pcb;
-	struct pcpu *cpu;
-	struct thread *thr;
-
-	mtx_lock_spin(&td->td_md.md_highfp_mtx);
-	pcb = td->td_pcb;
-	cpu = pcb->pcb_fpcpu;
-	if (cpu == NULL) {
-		mtx_unlock_spin(&td->td_md.md_highfp_mtx);
-		return (0);
-	}
-	pcb->pcb_fpcpu = NULL;
-	thr = cpu->pc_fpcurthread;
-	cpu->pc_fpcurthread = NULL;
-	mtx_unlock_spin(&td->td_md.md_highfp_mtx);
-
-	/* Post-mortem sanity checking. */
-	KASSERT(thr == td, ("Inconsistent high FP state"));
-	return (1);
-}
-
-int
-ia64_highfp_save(struct thread *td)
-{
-	struct pcb *pcb;
-	struct pcpu *cpu;
-	struct thread *thr;
-
-	/* Don't save if the high FP registers weren't modified. */
-	if ((td->td_frame->tf_special.psr & IA64_PSR_MFH) == 0)
-		return (ia64_highfp_drop(td));
-
-	mtx_lock_spin(&td->td_md.md_highfp_mtx);
-	pcb = td->td_pcb;
-	cpu = pcb->pcb_fpcpu;
-	if (cpu == NULL) {
-		mtx_unlock_spin(&td->td_md.md_highfp_mtx);
-		return (0);
-	}
-#ifdef SMP
-	if (td == curthread)
-		sched_pin();
-	if (cpu != pcpup) {
-		mtx_unlock_spin(&td->td_md.md_highfp_mtx);
-		ipi_send(cpu, IPI_HIGH_FP);
-		if (td == curthread)
-			sched_unpin();
-		while (pcb->pcb_fpcpu == cpu)
-			DELAY(100);
-		return (1);
-	} else {
-		save_high_fp(&pcb->pcb_high_fp);
-		if (td == curthread)
-			sched_unpin();
-	}
-#else
-	save_high_fp(&pcb->pcb_high_fp);
-#endif
-	pcb->pcb_fpcpu = NULL;
-	thr = cpu->pc_fpcurthread;
-	cpu->pc_fpcurthread = NULL;
-	mtx_unlock_spin(&td->td_md.md_highfp_mtx);
-
-	/* Post-mortem sanity cxhecking. */
-	KASSERT(thr == td, ("Inconsistent high FP state"));
-	return (1);
-}
-
 void
 ia64_sync_icache(vm_offset_t va, vm_offset_t sz)
 {

Modified: head/sys/ia64/ia64/trap.c
==============================================================================
--- head/sys/ia64/ia64/trap.c	Sat Oct 31 21:22:18 2009	(r198732)
+++ head/sys/ia64/ia64/trap.c	Sat Oct 31 22:27:31 2009	(r198733)
@@ -652,66 +652,10 @@ trap(int vector, struct trapframe *tf)
 		break;
 
 	case IA64_VEC_DISABLED_FP: {
-		struct pcpu *pcpu;
-		struct pcb *pcb;
-		struct thread *thr;
-
-		/* Always fatal in kernel. Should never happen. */
-		if (!user)
+		if (user)
+			ia64_highfp_enable(td, tf);
+		else
 			trap_panic(vector, tf);
-
-		sched_pin();
-		thr = PCPU_GET(fpcurthread);
-		if (thr == td) {
-			/*
-			 * Short-circuit handling the trap when this CPU
-			 * already holds the high FP registers for this
-			 * thread.  We really shouldn't get the trap in the
-			 * first place, but since it's only a performance
-			 * issue and not a correctness issue, we emit a
-			 * message for now, enable the high FP registers and
-			 * return.
-			 */
-			printf("XXX: bogusly disabled high FP regs\n");
-			tf->tf_special.psr &= ~IA64_PSR_DFH;
-			sched_unpin();
-			goto out;
-		} else if (thr != NULL) {
-			mtx_lock_spin(&thr->td_md.md_highfp_mtx);
-			pcb = thr->td_pcb;
-			save_high_fp(&pcb->pcb_high_fp);
-			pcb->pcb_fpcpu = NULL;
-			PCPU_SET(fpcurthread, NULL);
-			mtx_unlock_spin(&thr->td_md.md_highfp_mtx);
-			thr = NULL;
-		}
-
-		mtx_lock_spin(&td->td_md.md_highfp_mtx);
-		pcb = td->td_pcb;
-		pcpu = pcb->pcb_fpcpu;
-
-#ifdef SMP
-		if (pcpu != NULL) {
-			mtx_unlock_spin(&td->td_md.md_highfp_mtx);
-			ipi_send(pcpu, IPI_HIGH_FP);
-			while (pcb->pcb_fpcpu == pcpu)
-				DELAY(100);
-			mtx_lock_spin(&td->td_md.md_highfp_mtx);
-			pcpu = pcb->pcb_fpcpu;
-			thr = PCPU_GET(fpcurthread);
-		}
-#endif
-
-		if (thr == NULL && pcpu == NULL) {
-			restore_high_fp(&pcb->pcb_high_fp);
-			PCPU_SET(fpcurthread, td);
-			pcb->pcb_fpcpu = pcpup;
-			tf->tf_special.psr &= ~IA64_PSR_MFH;
-			tf->tf_special.psr &= ~IA64_PSR_DFH;
-		}
-
-		mtx_unlock_spin(&td->td_md.md_highfp_mtx);
-		sched_unpin();
 		goto out;
 	}
 

Modified: head/sys/ia64/ia64/vm_machdep.c
==============================================================================
--- head/sys/ia64/ia64/vm_machdep.c	Sat Oct 31 21:22:18 2009	(r198732)
+++ head/sys/ia64/ia64/vm_machdep.c	Sat Oct 31 22:27:31 2009	(r198733)
@@ -120,14 +120,11 @@ cpu_thread_alloc(struct thread *td)
 	sp -= sizeof(struct trapframe);
 	td->td_frame = (struct trapframe *)sp;
 	td->td_frame->tf_length = sizeof(struct trapframe);
-	mtx_init(&td->td_md.md_highfp_mtx, "High FP lock", NULL, MTX_SPIN);
 }
 
 void
 cpu_thread_free(struct thread *td)
 {
-
-	mtx_destroy(&td->td_md.md_highfp_mtx);
 }
 
 void
@@ -148,6 +145,8 @@ cpu_set_upcall(struct thread *td, struct
 	struct pcb *pcb;
 	struct trapframe *tf;
 
+	ia64_highfp_save(td0);
+
 	tf = td->td_frame;
 	KASSERT(tf != NULL, ("foo"));
 	bcopy(td0->td_frame, tf, sizeof(*tf));

Modified: head/sys/ia64/include/md_var.h
==============================================================================
--- head/sys/ia64/include/md_var.h	Sat Oct 31 21:22:18 2009	(r198732)
+++ head/sys/ia64/include/md_var.h	Sat Oct 31 22:27:31 2009	(r198733)
@@ -86,7 +86,9 @@ int	ia64_emulate(struct trapframe *, str
 int	ia64_flush_dirty(struct thread *, struct _special *);
 uint64_t ia64_get_hcdp(void);
 int	ia64_highfp_drop(struct thread *);
+int	ia64_highfp_enable(struct thread *, struct trapframe *);
 int	ia64_highfp_save(struct thread *);
+int	ia64_highfp_save_ipi(void);
 struct ia64_init_return ia64_init(void);
 void	ia64_probe_sapics(void);
 void	ia64_sync_icache(vm_offset_t, vm_size_t);

Modified: head/sys/ia64/include/proc.h
==============================================================================
--- head/sys/ia64/include/proc.h	Sat Oct 31 21:22:18 2009	(r198732)
+++ head/sys/ia64/include/proc.h	Sat Oct 31 22:27:31 2009	(r198733)
@@ -30,7 +30,6 @@
 #define	_MACHINE_PROC_H_
 
 struct mdthread {
-	struct mtx md_highfp_mtx;
 	int	md_spinlock_count;	/* (k) */
 	int	md_saved_intr;		/* (k) */
 };