From owner-svn-src-stable-9@FreeBSD.ORG Sun Feb 2 00:34:32 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF3F2FDF; Sun, 2 Feb 2014 00:34:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AAA091CCD; Sun, 2 Feb 2014 00:34:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s120YWiG052973; Sun, 2 Feb 2014 00:34:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s120YWx6052972; Sun, 2 Feb 2014 00:34:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402020034.s120YWx6052972@svn.freebsd.org> From: Alexander Motin Date: Sun, 2 Feb 2014 00:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261392 - stable/9/sys/geom/multipath X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 00:34:32 -0000 Author: mav Date: Sun Feb 2 00:34:32 2014 New Revision: 261392 URL: http://svnweb.freebsd.org/changeset/base/261392 Log: MFC r260883: Remove unneeded and dangerous assignment. It would probably cause NULL refererence panic if compiler not optimize it out. Modified: stable/9/sys/geom/multipath/g_multipath.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/geom/multipath/g_multipath.c ============================================================================== --- stable/9/sys/geom/multipath/g_multipath.c Sun Feb 2 00:33:17 2014 (r261391) +++ stable/9/sys/geom/multipath/g_multipath.c Sun Feb 2 00:34:32 2014 (r261392) @@ -984,7 +984,6 @@ g_multipath_ctl_create(struct gctl_req * gctl_error(req, "Device %s already exist", mpname); return; } - sc = gp->softc; memset(&md, 0, sizeof(md)); strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic)); From owner-svn-src-stable-9@FreeBSD.ORG Mon Feb 3 03:35:44 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2B0A652; Mon, 3 Feb 2014 03:35:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C55431639; Mon, 3 Feb 2014 03:35:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s133ZhkJ003643; Mon, 3 Feb 2014 03:35:43 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s133Zhn9003642; Mon, 3 Feb 2014 03:35:43 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201402030335.s133Zhn9003642@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 3 Feb 2014 03:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261427 - stable/9/tools/tools/mcgrab X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 03:35:44 -0000 Author: gnn Date: Mon Feb 3 03:35:43 2014 New Revision: 261427 URL: http://svnweb.freebsd.org/changeset/base/261427 Log: MFC: 260791 Add a command line argument to turn off blocking waiting for the user to press Ctrl-C (-b). This allows tests with tight loops of mcgrabs that can stress the multicast tables. Modified: stable/9/tools/tools/mcgrab/mcgrab.cc Directory Properties: stable/9/tools/tools/mcgrab/ (props changed) Modified: stable/9/tools/tools/mcgrab/mcgrab.cc ============================================================================== --- stable/9/tools/tools/mcgrab/mcgrab.cc Mon Feb 3 03:34:36 2014 (r261426) +++ stable/9/tools/tools/mcgrab/mcgrab.cc Mon Feb 3 03:35:43 2014 (r261427) @@ -88,7 +88,7 @@ void usage(string message) // // @return 0 for 0K, -1 for error, sets errno // -void grab(char *interface, struct in_addr *group, int number) { +void grab(char *interface, struct in_addr *group, int number, int block) { int sock; @@ -138,8 +138,10 @@ void grab(char *interface, struct in_add group->s_addr = htonl(ntohl(group->s_addr) + 1); } - printf("Press Control-C to exit.\n"); - sleep(INT_MAX); + if (block > 0) { + printf("Press Control-C to exit.\n"); + sleep(INT_MAX); + } } @@ -160,11 +162,12 @@ int main(int argc, char**argv) char* interface = 0; ///< Name of the interface struct in_addr *group = NULL; ///< the multicast group address int number = 0; ///< Number of addresses to grab + int block = 1; ///< Do we block or just return? - if (argc != 7) + if ((argc < 7) || (argc > 8)) usage(); - while ((ch = getopt(argc, argv, "g:i:n:h")) != -1) { + while ((ch = getopt(argc, argv, "g:i:n:bh")) != -1) { switch (ch) { case 'g': group = new (struct in_addr ); @@ -178,12 +181,15 @@ int main(int argc, char**argv) case 'n': number = atoi(optarg); break; + case 'b': + block = 0; + break; case 'h': usage(string("Help\n")); break; } } - grab(interface, group, number); + grab(interface, group, number, block); } From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 4 00:52:08 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF5DEB64; Tue, 4 Feb 2014 00:52:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9BEB01A54; Tue, 4 Feb 2014 00:52:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s140q8nD075408; Tue, 4 Feb 2014 00:52:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s140q8S4075407; Tue, 4 Feb 2014 00:52:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402040052.s140q8S4075407@svn.freebsd.org> From: Alexander Motin Date: Tue, 4 Feb 2014 00:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261451 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 00:52:08 -0000 Author: mav Date: Tue Feb 4 00:52:08 2014 New Revision: 261451 URL: http://svnweb.freebsd.org/changeset/base/261451 Log: MFC r260996: Fix memory and references leak due to unfreed path in case we can't allocate bus scan CCB. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Tue Feb 4 00:51:06 2014 (r261450) +++ stable/9/sys/cam/cam_xpt.c Tue Feb 4 00:52:08 2014 (r261451) @@ -3982,9 +3982,11 @@ xpt_bus_register(struct cam_sim *sim, de scan_ccb->ccb_h.func_code = XPT_SCAN_BUS; scan_ccb->crcn.flags = 0; xpt_rescan(scan_ccb); - } else + } else { xpt_print(path, "Can't allocate CCB to scan bus\n"); + xpt_free_path(path); + } } else xpt_free_path(path); } else From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 4 08:37:48 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B9918B9; Tue, 4 Feb 2014 08:37:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76E601174; Tue, 4 Feb 2014 08:37:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s148bmoQ054740; Tue, 4 Feb 2014 08:37:48 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s148bmUq054736; Tue, 4 Feb 2014 08:37:48 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402040837.s148bmUq054736@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 4 Feb 2014 08:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261464 - in stable/9/sys/dev/usb: . quirk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 08:37:48 -0000 Author: hselasky Date: Tue Feb 4 08:37:47 2014 New Revision: 261464 URL: http://svnweb.freebsd.org/changeset/base/261464 Log: MFC r261003: Add new quirk. PR: usb/185968 Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Tue Feb 4 08:37:39 2014 (r261463) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Tue Feb 4 08:37:47 2014 (r261464) @@ -285,6 +285,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(NETCHIP, CLIK_40, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(NETCHIP, POCKETBOOK, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(NIKON, D300, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(OLYMPUS, C1, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Tue Feb 4 08:37:39 2014 (r261463) +++ stable/9/sys/dev/usb/usbdevs Tue Feb 4 08:37:47 2014 (r261464) @@ -3108,6 +3108,7 @@ product NETCHIP TURBOCONNECT 0x1080 Turb product NETCHIP CLIK_40 0xa140 USB Clik! 40 product NETCHIP GADGETZERO 0xa4a0 Linux Gadget Zero product NETCHIP ETHERNETGADGET 0xa4a2 Linux Ethernet/RNDIS gadget on pxa210/25x/26x +product NETCHIP POCKETBOOK 0xa4a5 PocketBook /* Netgear products */ product NETGEAR EA101 0x1001 Ethernet From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 4 08:44:34 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA88DDDE; Tue, 4 Feb 2014 08:44:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B20D1210; Tue, 4 Feb 2014 08:44:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s148iYSN058293; Tue, 4 Feb 2014 08:44:34 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s148iXcN058288; Tue, 4 Feb 2014 08:44:33 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402040844.s148iXcN058288@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 4 Feb 2014 08:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261466 - in stable/9/sys/dev/usb: . controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 08:44:34 -0000 Author: hselasky Date: Tue Feb 4 08:44:33 2014 New Revision: 261466 URL: http://svnweb.freebsd.org/changeset/base/261466 Log: MFC r261004, r261005 and r261033: Adjust the DMA delay logic so that the DMA delay does not become too small. Modified: stable/9/sys/dev/usb/controller/ehci.c stable/9/sys/dev/usb/usb_freebsd.h stable/9/sys/dev/usb/usb_transfer.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ehci.c Tue Feb 4 08:44:12 2014 (r261465) +++ stable/9/sys/dev/usb/controller/ehci.c Tue Feb 4 08:44:33 2014 (r261466) @@ -3778,7 +3778,7 @@ ehci_get_dma_delay(struct usb_device *ud * Wait until the hardware has finished any possible use of * the transfer descriptor(s) and QH */ - *pus = (188); /* microseconds */ + *pus = (1125); /* microseconds */ } static void Modified: stable/9/sys/dev/usb/usb_freebsd.h ============================================================================== --- stable/9/sys/dev/usb/usb_freebsd.h Tue Feb 4 08:44:12 2014 (r261465) +++ stable/9/sys/dev/usb/usb_freebsd.h Tue Feb 4 08:44:33 2014 (r261466) @@ -43,6 +43,9 @@ #define USB_HAVE_MSCTEST 1 #define USB_HAVE_PF 1 +/* define zero ticks callout value */ +#define USB_CALLOUT_ZERO_TICKS 1 + #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid Modified: stable/9/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/9/sys/dev/usb/usb_transfer.c Tue Feb 4 08:44:12 2014 (r261465) +++ stable/9/sys/dev/usb/usb_transfer.c Tue Feb 4 08:44:33 2014 (r261466) @@ -2657,7 +2657,7 @@ usbd_transfer_timeout_ms(struct usb_xfer /* defer delay */ usb_callout_reset(&xfer->timeout_handle, - USB_MS_TO_TICKS(ms), cb, xfer); + USB_MS_TO_TICKS(ms) + USB_CALLOUT_ZERO_TICKS, cb, xfer); } /*------------------------------------------------------------------------* From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 4 08:47:08 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C122A327; Tue, 4 Feb 2014 08:47:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB613123B; Tue, 4 Feb 2014 08:47:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s148l8aV058685; Tue, 4 Feb 2014 08:47:08 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s148l8Sn058684; Tue, 4 Feb 2014 08:47:08 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402040847.s148l8Sn058684@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 4 Feb 2014 08:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261467 - stable/9/sys/dev/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 08:47:08 -0000 Author: hselasky Date: Tue Feb 4 08:47:08 2014 New Revision: 261467 URL: http://svnweb.freebsd.org/changeset/base/261467 Log: MFC r261123: Reduce dmesg verbosity. Modified: stable/9/sys/dev/usb/usb_dev.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usb_dev.c ============================================================================== --- stable/9/sys/dev/usb/usb_dev.c Tue Feb 4 08:44:33 2014 (r261466) +++ stable/9/sys/dev/usb/usb_dev.c Tue Feb 4 08:47:08 2014 (r261467) @@ -926,7 +926,7 @@ usb_close(void *arg) err = usb_ref_device(cpd, &refs, 2 /* uref and allow detached state */); if (err) { - DPRINTFN(0, "Cannot grab USB reference when " + DPRINTFN(2, "Cannot grab USB reference when " "closing USB file handle\n"); goto done; } From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 4 08:55:45 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FF14C21; Tue, 4 Feb 2014 08:55:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D31BF131A; Tue, 4 Feb 2014 08:55:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s148tiIL062563; Tue, 4 Feb 2014 08:55:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s148ti0d062561; Tue, 4 Feb 2014 08:55:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402040855.s148ti0d062561@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 4 Feb 2014 08:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261472 - in stable/9/sys/dev/usb: . quirk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 08:55:45 -0000 Author: hselasky Date: Tue Feb 4 08:55:44 2014 New Revision: 261472 URL: http://svnweb.freebsd.org/changeset/base/261472 Log: MFC r261134: Add more USB quirks. Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Tue Feb 4 08:54:59 2014 (r261471) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Tue Feb 4 08:55:44 2014 (r261472) @@ -163,6 +163,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(ASAHIOPTICAL, OPTIO330, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), + USB_QUIRK(ATP, EUSB, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(BELKIN, USB2SCSI, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(CASIO, QV_DIGICAM, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Tue Feb 4 08:54:59 2014 (r261471) +++ stable/9/sys/dev/usb/usbdevs Tue Feb 4 08:55:44 2014 (r261472) @@ -643,6 +643,7 @@ vendor ABOCOM2 0x1482 AboCom Systems vendor SILICOM 0x1485 Silicom vendor RALINK 0x148f Ralink Technology vendor IMAGINATION 0x149a Imagination Technologies +vendor ATP 0x14af ATP Electronics vendor CONCEPTRONIC2 0x14b2 Conceptronic vendor SUPERTOP 0x14cd Super Top vendor PLANEX3 0x14ea Planex Communications @@ -1159,6 +1160,9 @@ product ATEN UC232A 0x2008 Serial product ATEN UC210T 0x2009 UC-210T Ethernet product ATEN DSB650C 0x4000 DSB-650C +/* ATP Electronics products */ +product ATP EUSB 0xaf01 ATP IG eUSB SSD + /* Atheros Communications products */ product ATHEROS AR5523 0x0001 AR5523 product ATHEROS AR5523_NF 0x0002 AR5523 (no firmware) From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 4 08:59:03 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E741EC3; Tue, 4 Feb 2014 08:59:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 78DA9133E; Tue, 4 Feb 2014 08:59:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s148x3hK063036; Tue, 4 Feb 2014 08:59:03 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s148x3ZU063035; Tue, 4 Feb 2014 08:59:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402040859.s148x3ZU063035@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 4 Feb 2014 08:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261474 - stable/9/lib/libusb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 08:59:03 -0000 Author: hselasky Date: Tue Feb 4 08:59:02 2014 New Revision: 261474 URL: http://svnweb.freebsd.org/changeset/base/261474 Log: MFC r261224: Comply to the official LibUSB v1.0 API: "It is legal to attempt to claim an already-claimed interface." Modified: stable/9/lib/libusb/libusb10.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libusb/ (props changed) Modified: stable/9/lib/libusb/libusb10.c ============================================================================== --- stable/9/lib/libusb/libusb10.c Tue Feb 4 08:58:12 2014 (r261473) +++ stable/9/lib/libusb/libusb10.c Tue Feb 4 08:59:02 2014 (r261474) @@ -605,7 +605,6 @@ int libusb_claim_interface(struct libusb20_device *pdev, int interface_number) { libusb_device *dev; - int err = 0; dev = libusb_get_device(pdev); if (dev == NULL) @@ -615,13 +614,10 @@ libusb_claim_interface(struct libusb20_d return (LIBUSB_ERROR_INVALID_PARAM); CTX_LOCK(dev->ctx); - if (dev->claimed_interfaces & (1 << interface_number)) - err = LIBUSB_ERROR_BUSY; - - if (!err) - dev->claimed_interfaces |= (1 << interface_number); + dev->claimed_interfaces |= (1 << interface_number); CTX_UNLOCK(dev->ctx); - return (err); + + return (0); } int From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 4 09:06:07 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAE9745C; Tue, 4 Feb 2014 09:06:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5E171437; Tue, 4 Feb 2014 09:06:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14967KO067138; Tue, 4 Feb 2014 09:06:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14967J7067137; Tue, 4 Feb 2014 09:06:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402040906.s14967J7067137@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 4 Feb 2014 09:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261477 - stable/9/sys/dev/usb/input X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 09:06:07 -0000 Author: hselasky Date: Tue Feb 4 09:06:07 2014 New Revision: 261477 URL: http://svnweb.freebsd.org/changeset/base/261477 Log: MFC r261228: When detaching a [USB] keyboard, keys might still be pressed. Ensure that all pressed keys are released before completing the USB keyboard detach. This will prevent so-called "ghost-keys" from appearing after that the USB device generating the key event(s) has been detached. Modified: stable/9/sys/dev/usb/input/ukbd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/9/sys/dev/usb/input/ukbd.c Tue Feb 4 09:03:14 2014 (r261476) +++ stable/9/sys/dev/usb/input/ukbd.c Tue Feb 4 09:06:07 2014 (r261477) @@ -469,7 +469,8 @@ ukbd_get_key(struct ukbd_softc *sc, uint || (sc->sc_flags & UKBD_FLAG_POLLING) != 0, ("not polling in kdb or panic\n")); - if (sc->sc_inputs == 0) { + if (sc->sc_inputs == 0 && + (sc->sc_flags & UKBD_FLAG_GONE) == 0) { /* start transfer, if not already started */ usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT]); } @@ -1300,6 +1301,18 @@ ukbd_detach(device_t dev) usb_callout_stop(&sc->sc_callout); + /* kill any stuck keys */ + if (sc->sc_flags & UKBD_FLAG_ATTACHED) { + /* stop receiving events from the USB keyboard */ + usbd_transfer_stop(sc->sc_xfer[UKBD_INTR_DT]); + + /* release all leftover keys, if any */ + memset(&sc->sc_ndata, 0, sizeof(sc->sc_ndata)); + + /* process releasing of all keys */ + ukbd_interrupt(sc); + } + ukbd_disable(&sc->sc_kbd); #ifdef KBD_INSTALL_CDEV From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 4 10:22:29 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5802C162; Tue, 4 Feb 2014 10:22:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3FD131AC2; Tue, 4 Feb 2014 10:22:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14AMTAc098874; Tue, 4 Feb 2014 10:22:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14AMShr098869; Tue, 4 Feb 2014 10:22:28 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402041022.s14AMShr098869@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 4 Feb 2014 10:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261483 - stable/9/lib/libusb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 10:22:29 -0000 Author: hselasky Date: Tue Feb 4 10:22:28 2014 New Revision: 261483 URL: http://svnweb.freebsd.org/changeset/base/261483 Log: MFC r260315: Implement two new libusb API functions. PR: usb/185454 Modified: stable/9/lib/libusb/Makefile stable/9/lib/libusb/libusb.3 stable/9/lib/libusb/libusb.h stable/9/lib/libusb/libusb10_io.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libusb/ (props changed) Modified: stable/9/lib/libusb/Makefile ============================================================================== --- stable/9/lib/libusb/Makefile Tue Feb 4 10:18:29 2014 (r261482) +++ stable/9/lib/libusb/Makefile Tue Feb 4 10:22:28 2014 (r261483) @@ -98,6 +98,8 @@ MLINKS += libusb.3 libusb_event_handler_ MLINKS += libusb.3 libusb_lock_event_waiters.3 MLINKS += libusb.3 libusb_unlock_event_waiters.3 MLINKS += libusb.3 libusb_wait_for_event.3 +MLINKS += libusb.3 libusb_handle_events_timeout_completed.3 +MLINKS += libusb.3 libusb_handle_events_completed.3 MLINKS += libusb.3 libusb_handle_events_timeout.3 MLINKS += libusb.3 libusb_handle_events.3 MLINKS += libusb.3 libusb_handle_events_locked.3 Modified: stable/9/lib/libusb/libusb.3 ============================================================================== --- stable/9/lib/libusb/libusb.3 Tue Feb 4 10:18:29 2014 (r261482) +++ stable/9/lib/libusb/libusb.3 Tue Feb 4 10:22:28 2014 (r261483) @@ -485,11 +485,40 @@ transfer completes or another thread sto timeout expired. .Pp .Ft int +.Fn libusb_handle_events_timeout_completed "libusb_context *ctx" "struct timeval *tv" "int *completed" +Handle any pending events by checking if timeouts have expired and by +checking the set of file descriptors for activity. +If the +.Fa completed +argument is not equal to NULL, this function will +loop until a transfer completion callback sets the variable pointed to +by the +.Fa completed +argument to non-zero. +If the +.Fa tv +argument is not equal to NULL, this function will return +LIBUSB_ERROR_TIMEOUT after the given timeout. +Returns 0 on success, or a LIBUSB_ERROR code on failure or timeout. +.Pp +.Ft int +.Fn libusb_handle_events_completed "libusb_context *ctx" "int *completed" +Handle any pending events by checking the set of file descriptors for activity. +If the +.Fa completed +argument is not equal to NULL, this function will +loop until a transfer completion callback sets the variable pointed to +by the +.Fa completed +argument to non-zero. +Returns 0 on success, or a LIBUSB_ERROR code on failure. +.Pp +.Ft int .Fn libusb_handle_events_timeout "libusb_context *ctx" "struct timeval *tv" Handle any pending events by checking if timeouts have expired and by checking the set of file descriptors for activity. Returns 0 on success, or a -LIBUSB_ERROR code on failure. +LIBUSB_ERROR code on failure or timeout. .Pp .Ft int .Fn libusb_handle_events "libusb_context *ctx" @@ -508,7 +537,7 @@ Must be called with the event lock held. Determine the next internal timeout that libusb needs to handle. Returns 0 if there are no pending timeouts, 1 if a timeout was returned, or a LIBUSB_ERROR -code on failure. +code on failure or timeout. .Pp .Ft void .Fn libusb_set_pollfd_notifiers "libusb_context *ctx" "libusb_pollfd_added_cb added_cb" "libusb_pollfd_removed_cb remove_cb" "void *user_data" Modified: stable/9/lib/libusb/libusb.h ============================================================================== --- stable/9/lib/libusb/libusb.h Tue Feb 4 10:18:29 2014 (r261482) +++ stable/9/lib/libusb/libusb.h Tue Feb 4 10:22:28 2014 (r261483) @@ -436,6 +436,8 @@ int libusb_event_handler_active(libusb_c void libusb_lock_event_waiters(libusb_context * ctx); void libusb_unlock_event_waiters(libusb_context * ctx); int libusb_wait_for_event(libusb_context * ctx, struct timeval *tv); +int libusb_handle_events_timeout_completed(libusb_context * ctx, struct timeval *tv, int *completed); +int libusb_handle_events_completed(libusb_context * ctx, int *completed); int libusb_handle_events_timeout(libusb_context * ctx, struct timeval *tv); int libusb_handle_events(libusb_context * ctx); int libusb_handle_events_locked(libusb_context * ctx, struct timeval *tv); Modified: stable/9/lib/libusb/libusb10_io.c ============================================================================== --- stable/9/lib/libusb/libusb10_io.c Tue Feb 4 10:18:29 2014 (r261482) +++ stable/9/lib/libusb/libusb10_io.c Tue Feb 4 10:22:28 2014 (r261483) @@ -331,29 +331,50 @@ libusb_wait_for_event(libusb_context *ct } int -libusb_handle_events_timeout(libusb_context *ctx, struct timeval *tv) +libusb_handle_events_timeout_completed(libusb_context *ctx, + struct timeval *tv, int *completed) { - int err; + int err = 0; ctx = GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_handle_events_timeout enter"); + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_handle_events_timeout_completed enter"); libusb_lock_events(ctx); - err = libusb_handle_events_locked(ctx, tv); + while (1) { + if (completed != NULL) { + if (*completed != 0 || err != 0) + break; + } + err = libusb_handle_events_locked(ctx, tv); + if (completed == NULL) + break; + } libusb_unlock_events(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_handle_events_timeout leave"); + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_handle_events_timeout_completed exit"); return (err); } int +libusb_handle_events_completed(libusb_context *ctx, int *completed) +{ + return (libusb_handle_events_timeout_completed(ctx, NULL, completed)); +} + +int +libusb_handle_events_timeout(libusb_context *ctx, struct timeval *tv) +{ + return (libusb_handle_events_timeout_completed(ctx, tv, NULL)); +} + +int libusb_handle_events(libusb_context *ctx) { - return (libusb_handle_events_timeout(ctx, NULL)); + return (libusb_handle_events_timeout_completed(ctx, NULL, NULL)); } int @@ -366,8 +387,9 @@ libusb_handle_events_locked(libusb_conte if (libusb_event_handling_ok(ctx)) { err = libusb10_handle_events_sub(ctx, tv); } else { - libusb_wait_for_event(ctx, tv); - err = 0; + err = libusb_wait_for_event(ctx, tv); + if (err != 0) + err = LIBUSB_ERROR_TIMEOUT; } return (err); } From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 4 10:27:40 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C9AB61A; Tue, 4 Feb 2014 10:27:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 771AF1B02; Tue, 4 Feb 2014 10:27:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14ARe41099539; Tue, 4 Feb 2014 10:27:40 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14AReVN099538; Tue, 4 Feb 2014 10:27:40 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402041027.s14AReVN099538@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 4 Feb 2014 10:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261485 - stable/9/sys/dev/usb/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 10:27:40 -0000 Author: hselasky Date: Tue Feb 4 10:27:39 2014 New Revision: 261485 URL: http://svnweb.freebsd.org/changeset/base/261485 Log: MFC r260903: Add support for GPS ports to UHSO driver. Modified: stable/9/sys/dev/usb/net/uhso.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/net/uhso.c ============================================================================== --- stable/9/sys/dev/usb/net/uhso.c Tue Feb 4 10:25:31 2014 (r261484) +++ stable/9/sys/dev/usb/net/uhso.c Tue Feb 4 10:27:39 2014 (r261485) @@ -816,6 +816,8 @@ uhso_probe_iface_auto(struct usb_device UHSO_PORT_SERIAL | UHSO_PORT_NETWORK, port)); case UHSO_PORT_TYPE_DIAG: case UHSO_PORT_TYPE_DIAG2: + case UHSO_PORT_TYPE_GPS: + case UHSO_PORT_TYPE_GPSCTL: case UHSO_PORT_TYPE_CTL: case UHSO_PORT_TYPE_APP: case UHSO_PORT_TYPE_APP2: From owner-svn-src-stable-9@FreeBSD.ORG Tue Feb 4 14:30:34 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B4C1CA8; Tue, 4 Feb 2014 14:30:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 868C01384; Tue, 4 Feb 2014 14:30:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s14EUYBB099824; Tue, 4 Feb 2014 14:30:34 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s14EUYuU099823; Tue, 4 Feb 2014 14:30:34 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201402041430.s14EUYuU099823@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 4 Feb 2014 14:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261488 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 14:30:34 -0000 Author: pluknet Date: Tue Feb 4 14:30:34 2014 New Revision: 261488 URL: http://svnweb.freebsd.org/changeset/base/261488 Log: Typo in the EXAMPLES section: this is regexp, not a shell wildcard expression. This is a direct commit to stable/9. Submitted by: Ilya Noskov Modified: stable/9/share/man/man4/carp.4 Modified: stable/9/share/man/man4/carp.4 ============================================================================== --- stable/9/share/man/man4/carp.4 Tue Feb 4 12:34:08 2014 (r261487) +++ stable/9/share/man/man4/carp.4 Tue Feb 4 14:30:34 2014 (r261488) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2011 +.Dd February 4, 2014 .Dt CARP 4 .Os .Sh NAME @@ -276,7 +276,7 @@ status change events can be set up by us notify 0 { match "system" "IFNET"; match "type" "LINK_UP"; - match "subsystem" "carp*"; + match "subsystem" "carp.*"; action "/root/carpcontrol.sh $type $subsystem"; }; From owner-svn-src-stable-9@FreeBSD.ORG Wed Feb 5 08:43:00 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7FC65C7; Wed, 5 Feb 2014 08:43:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A05251E59; Wed, 5 Feb 2014 08:43:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s158h0HP036896; Wed, 5 Feb 2014 08:43:00 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s158gxlr036879; Wed, 5 Feb 2014 08:42:59 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402050842.s158gxlr036879@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 5 Feb 2014 08:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261510 - in stable/9: etc sys/conf sys/dev/usb sys/dev/usb/input sys/modules/usb sys/modules/usb/wsp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Feb 2014 08:43:00 -0000 Author: hselasky Date: Wed Feb 5 08:42:59 2014 New Revision: 261510 URL: http://svnweb.freebsd.org/changeset/base/261510 Log: MFC r261260, r261262, r261315 and r261343: Add support for trackpads found in Apple MacBook products. While at it add some missing devd entries. Added: stable/9/sys/dev/usb/input/wsp.c - copied, changed from r261260, head/sys/dev/usb/input/wsp.c stable/9/sys/modules/usb/wsp/ - copied from r261260, head/sys/modules/usb/wsp/ Modified: stable/9/etc/devd.conf stable/9/sys/conf/NOTES stable/9/sys/conf/files stable/9/sys/dev/usb/usbdevs stable/9/sys/modules/usb/Makefile Directory Properties: stable/9/etc/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/etc/devd.conf ============================================================================== --- stable/9/etc/devd.conf Wed Feb 5 08:40:02 2014 (r261509) +++ stable/9/etc/devd.conf Wed Feb 5 08:42:59 2014 (r261510) @@ -119,6 +119,15 @@ notify 100 { match "system" "DEVFS"; match "subsystem" "CDEV"; match "type" "CREATE"; + match "cdev" "atp[0-9]+"; + + action "/etc/rc.d/moused quietstart $cdev"; +}; + +notify 100 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "CREATE"; match "cdev" "ums[0-9]+"; action "/etc/rc.d/moused quietstart $cdev"; @@ -127,6 +136,15 @@ notify 100 { notify 100 { match "system" "DEVFS"; match "subsystem" "CDEV"; + match "type" "CREATE"; + match "cdev" "wsp[0-9]+"; + + action "/etc/rc.d/moused quietstart $cdev"; +}; + +notify 100 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; match "type" "DESTROY"; match "cdev" "ums[0-9]+"; Modified: stable/9/sys/conf/NOTES ============================================================================== --- stable/9/sys/conf/NOTES Wed Feb 5 08:40:02 2014 (r261509) +++ stable/9/sys/conf/NOTES Wed Feb 5 08:42:59 2014 (r261510) @@ -2667,6 +2667,9 @@ device umct device umodem # USB mouse device ums +# USB touchpad(s) +device atp +device wsp # eGalax USB touch screen device uep # Diamond Rio 500 MP3 player Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Wed Feb 5 08:40:02 2014 (r261509) +++ stable/9/sys/conf/files Wed Feb 5 08:42:59 2014 (r261510) @@ -2089,6 +2089,7 @@ dev/usb/input/uep.c optional uep dev/usb/input/uhid.c optional uhid dev/usb/input/ukbd.c optional ukbd dev/usb/input/ums.c optional ums +dev/usb/input/wsp.c optional wsp # # USB quirks # Copied and modified: stable/9/sys/dev/usb/input/wsp.c (from r261260, head/sys/dev/usb/input/wsp.c) ============================================================================== --- head/sys/dev/usb/input/wsp.c Wed Jan 29 10:42:01 2014 (r261260, copy source) +++ stable/9/sys/dev/usb/input/wsp.c Wed Feb 5 08:42:59 2014 (r261510) @@ -123,6 +123,25 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scr_ho #define WSP_IFACE_INDEX 1 +/* + * Some tables, structures, definitions and initialisation values for + * the touchpad protocol has been copied from Linux's + * "drivers/input/mouse/bcm5974.c" which has the following copyright + * holders under GPLv2. All device specific code in this driver has + * been written from scratch. The decoding algorithm is based on + * output from usbdump. + * + * Copyright (C) 2008 Henrik Rydberg (rydberg@euromail.se) + * Copyright (C) 2008 Scott Shawcroft (scott.shawcroft@gmail.com) + * Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com) + * Copyright (C) 2005 Johannes Berg (johannes@sipsolutions.net) + * Copyright (C) 2005 Stelian Pop (stelian@popies.net) + * Copyright (C) 2005 Frank Arnold (frank@scirocco-5v-turbo.de) + * Copyright (C) 2005 Peter Osterlund (petero2@telia.com) + * Copyright (C) 2005 Michael Hanselmann (linux-kernel@hansmi.ch) + * Copyright (C) 2006 Nicolas Boichat (nicolas@boichat.ch) + */ + /* button data structure */ struct bt_data { uint8_t unknown1; /* constant */ @@ -569,15 +588,11 @@ static const STRUCT_USB_HOST_ID wsp_devs enum { WSP_INTR_DT, - WSP_RESET, WSP_N_TRANSFER, }; struct wsp_softc { - device_t sc_dev; struct usb_device *sc_usb_device; -#define MODE_LENGTH 8 - uint8_t sc_mode_bytes[MODE_LENGTH]; /* device mode */ struct mtx sc_mutex; /* for synchronization */ struct usb_xfer *sc_xfer[WSP_N_TRANSFER]; struct usb_fifo_sc sc_fifo; @@ -609,7 +624,8 @@ struct wsp_softc { int dz_count; #define WSP_DZ_MAX_COUNT 32 int dt_sum; /* T-axis cumulative movement */ - + + uint8_t o_ntouch; /* old touch finger status */ uint8_t finger; /* 0 or 1 *, check which finger moving */ uint16_t intr_count; #define WSP_TAP_THRESHOLD 3 @@ -648,8 +664,6 @@ static struct usb_fifo_methods wsp_fifo_ }; /* device initialization and shutdown */ -static usb_error_t wsp_req_get_report(struct usb_device *udev, void *data); -static int wsp_set_device_mode(device_t dev, interface_mode mode); static int wsp_enable(struct wsp_softc *sc); static void wsp_disable(struct wsp_softc *sc); @@ -662,7 +676,6 @@ static device_probe_t wsp_probe; static device_attach_t wsp_attach; static device_detach_t wsp_detach; static usb_callback_t wsp_intr_callback; -static usb_callback_t wsp_reset_callback; static struct usb_config wsp_config[WSP_N_TRANSFER] = { [WSP_INTR_DT] = { @@ -676,87 +689,36 @@ static struct usb_config wsp_config[WSP_ .bufsize = 0, /* use wMaxPacketSize */ .callback = &wsp_intr_callback, }, - [WSP_RESET] = { - .type = UE_CONTROL, - .endpoint = 0, /* Control pipe */ - .direction = UE_DIR_ANY, - .bufsize = sizeof(struct usb_device_request) + MODE_LENGTH, - .callback = &wsp_reset_callback, - .interval = 0, /* no pre-delay */ - }, }; -usb_error_t -wsp_req_get_report(struct usb_device *udev, void *data) -{ - struct usb_device_request req; - - req.bmRequestType = UT_READ_CLASS_INTERFACE; - req.bRequest = UR_GET_REPORT; - USETW2(req.wValue, (uint8_t)0x03 /* type */ , (uint8_t)0x00 /* id */ ); - USETW(req.wIndex, 0); - USETW(req.wLength, MODE_LENGTH); - - return (usbd_do_request(udev, NULL /* mutex */ , &req, data)); -} - -static int -wsp_set_device_mode(device_t dev, interface_mode mode) +static usb_error_t +wsp_set_device_mode(struct wsp_softc *sc, interface_mode mode) { - struct wsp_softc *sc; - usb_device_request_t req; + uint8_t mode_bytes[8]; usb_error_t err; - if ((mode != RAW_SENSOR_MODE) && (mode != HID_MODE)) - return (ENXIO); + err = usbd_req_get_report(sc->sc_usb_device, NULL, + mode_bytes, sizeof(mode_bytes), 0, + 0x03, 0x00); - sc = device_get_softc(dev); - - sc->sc_mode_bytes[0] = mode; - req.bmRequestType = UT_WRITE_CLASS_INTERFACE; - req.bRequest = UR_SET_REPORT; - USETW2(req.wValue, (uint8_t)0x03 /* type */ , (uint8_t)0x00 /* id */ ); - USETW(req.wIndex, 0); - USETW(req.wLength, MODE_LENGTH); - err = usbd_do_request(sc->sc_usb_device, NULL, &req, sc->sc_mode_bytes); - if (err != USB_ERR_NORMAL_COMPLETION) - return (ENXIO); - - return (0); -} - -static void -wsp_reset_callback(struct usb_xfer *xfer, usb_error_t error) -{ - usb_device_request_t req; - struct usb_page_cache *pc; - struct wsp_softc *sc = usbd_xfer_softc(xfer); + if (err != USB_ERR_NORMAL_COMPLETION) { + DPRINTF("Failed to read device mode (%d)\n", err); + return (err); + } - switch (USB_GET_STATE(xfer)) { - case USB_ST_SETUP: - sc->sc_mode_bytes[0] = RAW_SENSOR_MODE; - req.bmRequestType = UT_WRITE_CLASS_INTERFACE; - req.bRequest = UR_SET_REPORT; - USETW2(req.wValue, - (uint8_t)0x03 /* type */ , (uint8_t)0x00 /* id */ ); - USETW(req.wIndex, 0); - USETW(req.wLength, MODE_LENGTH); + /* + * XXX Need to wait at least 250ms for hardware to get + * ready. The device mode handling appears to be handled + * asynchronously and we should not issue these commands too + * quickly. + */ + pause("WHW", hz / 4); - pc = usbd_xfer_get_frame(xfer, 0); - usbd_copy_in(pc, 0, &req, sizeof(req)); - pc = usbd_xfer_get_frame(xfer, 1); - usbd_copy_in(pc, 0, sc->sc_mode_bytes, MODE_LENGTH); - - usbd_xfer_set_frame_len(xfer, 0, sizeof(req)); - usbd_xfer_set_frame_len(xfer, 1, MODE_LENGTH); - usbd_xfer_set_frames(xfer, 2); - usbd_transfer_submit(xfer); - break; + mode_bytes[0] = mode; - case USB_ST_TRANSFERRED: - default: - break; - } + return (usbd_req_set_report(sc->sc_usb_device, NULL, + mode_bytes, sizeof(mode_bytes), 0, + 0x03, 0x00)); } static int @@ -820,27 +782,35 @@ wsp_attach(device_t dev) DPRINTFN(WSP_LLEVEL_INFO, "sc=%p\n", sc); - sc->sc_dev = dev; sc->sc_usb_device = uaa->device; /* - * By default the touchpad behaves like an HID device, sending + * By default the touchpad behaves like a HID device, sending * packets with reportID = 8. Such reports contain only * limited information. They encode movement deltas and button * events, but do not include data from the pressure * sensors. The device input mode can be switched from HID * reports to raw sensor data using vendor-specific USB - * control commands; but first the mode must be read. + * control commands: */ - err = wsp_req_get_report(sc->sc_usb_device, sc->sc_mode_bytes); + + /* + * During re-enumeration of the device we need to force the + * device back into HID mode before switching it to RAW + * mode. Else the device does not work like expected. + */ + err = wsp_set_device_mode(sc, HID_MODE); if (err != USB_ERR_NORMAL_COMPLETION) { - DPRINTF("failed to read device mode (%d)\n", err); + DPRINTF("Failed to set mode to HID MODE (%d)\n", err); return (ENXIO); } - if (wsp_set_device_mode(dev, RAW_SENSOR_MODE) != 0) { - DPRINTF("failed to set mode to 'RAW_SENSOR' (%d)\n", err); + + err = wsp_set_device_mode(sc, RAW_SENSOR_MODE); + if (err != USB_ERR_NORMAL_COMPLETION) { + DPRINTF("failed to set mode to RAW MODE (%d)\n", err); return (ENXIO); } + mtx_init(&sc->sc_mutex, "wspmtx", NULL, MTX_DEF | MTX_RECURSE); /* get device specific configuration */ @@ -891,7 +861,7 @@ wsp_detach(device_t dev) { struct wsp_softc *sc = device_get_softc(dev); - wsp_set_device_mode(dev, HID_MODE); + (void) wsp_set_device_mode(sc, HID_MODE); mtx_lock(&sc->sc_mutex); if (sc->sc_state & WSP_ENABLED) @@ -921,7 +891,6 @@ wsp_intr_callback(struct usb_xfer *xfer, int dx = 0; int dy = 0; int dz = 0; - int n = 0; int len; int i; @@ -986,13 +955,9 @@ wsp_intr_callback(struct usb_xfer *xfer, f[i].tool_major, f[i].tool_minor, f[i].orientation, f[i].touch_major, f[i].touch_minor, f[i].multi); - if (f[i].touch_major < tun.pressure_untouch_threshold) - continue; - - sc->pos_x[n] = f[i].abs_x; - sc->pos_y[n] = params->y.min + params->y.max - f[i].abs_y; - sc->index[n] = &f[i]; - n++; + sc->pos_x[i] = f[i].abs_x; + sc->pos_y[i] = params->y.min + params->y.max - f[i].abs_y; + sc->index[i] = &f[i]; } sc->sc_status.flags &= ~MOUSE_POSCHANGED; @@ -1007,8 +972,8 @@ wsp_intr_callback(struct usb_xfer *xfer, if (h->q2 == 4) sc->intr_count++; - if (sc->ntaps < n) { - switch (n) { + if (sc->ntaps < ntouch) { + switch (ntouch) { case 1: if (f[0].touch_major > tun.pressure_tap_threshold) sc->ntaps = 1; @@ -1028,7 +993,7 @@ wsp_intr_callback(struct usb_xfer *xfer, break; } } - if (n == 2) { + if (ntouch == 2) { sc->distance = max(sc->distance, max( abs(sc->pos_x[0] - sc->pos_x[1]), abs(sc->pos_y[0] - sc->pos_y[1]))); @@ -1100,15 +1065,34 @@ wsp_intr_callback(struct usb_xfer *xfer, if (sc->sc_touch == WSP_SECOND_TOUCH) sc->sc_touch = WSP_TOUCHING; - if (n != 0 && + if (ntouch != 0 && h->q2 == 4 && f[0].touch_major >= tun.pressure_touch_threshold) { dx = sc->pos_x[0] - sc->pre_pos_x; dy = sc->pos_y[0] - sc->pre_pos_y; - if (n == 2 && sc->sc_status.button != 0) { + + /* Ignore movement from ibt=1 to ibt=0 */ + if (sc->sc_status.obutton != 0 && + sc->sc_status.button == 0) { + dx = 0; + dy = 0; + } + /* Ignore movement if ntouch changed */ + if (sc->o_ntouch != ntouch) { + dx = 0; + dy = 0; + } + + if (ntouch == 2 && sc->sc_status.button != 0) { dx = sc->pos_x[sc->finger] - sc->pre_pos_x; dy = sc->pos_y[sc->finger] - sc->pre_pos_y; - if (f[0].origin == 0 || f[1].origin == 0) { + + /* + * Ignore movement of switch finger or + * movement from ibt=0 to ibt=1 + */ + if (f[0].origin == 0 || f[1].origin == 0 || + sc->sc_status.obutton != sc->sc_status.button) { dx = 0; dy = 0; sc->finger = 0; @@ -1142,7 +1126,7 @@ wsp_intr_callback(struct usb_xfer *xfer, sc->dx_sum += dx; sc->dy_sum += dy; - if (n == 2 && sc->sc_status.button == 0) { + if (ntouch == 2 && sc->sc_status.button == 0) { if (sc->scr_mode == WSP_SCR_NONE && abs(sc->dx_sum) + abs(sc->dy_sum) > 50) sc->scr_mode = abs(sc->dx_sum) > @@ -1184,10 +1168,12 @@ wsp_intr_callback(struct usb_xfer *xfer, sc->pre_pos_x = sc->pos_x[0]; sc->pre_pos_y = sc->pos_y[0]; - if (n == 2 && sc->sc_status.button != 0) { + if (ntouch == 2 && sc->sc_status.button != 0) { sc->pre_pos_x = sc->pos_x[sc->finger]; sc->pre_pos_y = sc->pos_y[sc->finger]; } + sc->o_ntouch = ntouch; + case USB_ST_SETUP: tr_setup: /* check if we can put more data into the FIFO */ Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Wed Feb 5 08:40:02 2014 (r261509) +++ stable/9/sys/dev/usb/usbdevs Wed Feb 5 08:42:59 2014 (r261510) @@ -1077,12 +1077,54 @@ product APPLE DUMMY 0x0000 Dummy produc product APPLE IMAC_KBD 0x0201 USB iMac Keyboard product APPLE KBD 0x0202 USB Keyboard M2452 product APPLE EXT_KBD 0x020c Apple Extended USB Keyboard -product APPLE KBD_TP_ANSI 0x0223 Apple Internal Keyboard/Trackpad (Wellspring/ANSI) -product APPLE KBD_TP_ISO 0x0224 Apple Internal Keyboard/Trackpad (Wellspring/ISO) -product APPLE KBD_TP_JIS 0x0225 Apple Internal Keyboard/Trackpad (Wellspring/JIS) -product APPLE KBD_TP_ANSI2 0x0230 Apple Internal Keyboard/Trackpad (Wellspring2/ANSI) -product APPLE KBD_TP_ISO2 0x0231 Apple Internal Keyboard/Trackpad (Wellspring2/ISO) -product APPLE KBD_TP_JIS2 0x0232 Apple Internal Keyboard/Trackpad (Wellspring2/JIS) +/* MacbookAir, aka wellspring */ +product APPLE WELLSPRING_ANSI 0x0223 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING_ISO 0x0224 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING_JIS 0x0225 Apple Internal Keyboard/Trackpad +/* MacbookProPenryn, aka wellspring2 */ +product APPLE WELLSPRING2_ANSI 0x0230 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING2_ISO 0x0231 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING2_JIS 0x0232 Apple Internal Keyboard/Trackpad +/* Macbook5,1 (unibody), aka wellspring3 */ +product APPLE WELLSPRING3_ANSI 0x0236 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING3_ISO 0x0237 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING3_JIS 0x0238 Apple Internal Keyboard/Trackpad +/* MacbookAir3,2 (unibody), aka wellspring4 */ +product APPLE WELLSPRING4_ANSI 0x023f Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING4_ISO 0x0240 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING4_JIS 0x0241 Apple Internal Keyboard/Trackpad +/* MacbookAir3,1 (unibody), aka wellspring4 */ +product APPLE WELLSPRING4A_ANSI 0x0242 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING4A_ISO 0x0243 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING4A_JIS 0x0244 Apple Internal Keyboard/Trackpad +/* Macbook8 (unibody, March 2011) */ +product APPLE WELLSPRING5_ANSI 0x0245 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING5_ISO 0x0246 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING5_JIS 0x0247 Apple Internal Keyboard/Trackpad +/* MacbookAir4,1 (unibody, July 2011) */ +product APPLE WELLSPRING6A_ANSI 0x0249 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING6A_ISO 0x024a Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING6A_JIS 0x024b Apple Internal Keyboard/Trackpad +/* MacbookAir4,2 (unibody, July 2011) */ +product APPLE WELLSPRING6_ANSI 0x024c Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING6_ISO 0x024d Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING6_JIS 0x024e Apple Internal Keyboard/Trackpad +/* Macbook8,2 (unibody) */ +product APPLE WELLSPRING5A_ANSI 0x0252 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING5A_ISO 0x0253 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING5A_JIS 0x0254 Apple Internal Keyboard/Trackpad +/* MacbookPro10,1 (unibody, June 2012) */ +product APPLE WELLSPRING7_ANSI 0x0262 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING7_ISO 0x0263 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING7_JIS 0x0264 Apple Internal Keyboard/Trackpad +/* MacbookPro10,2 (unibody, October 2012) */ +product APPLE WELLSPRING7A_ANSI 0x0259 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING7A_ISO 0x025a Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING7A_JIS 0x025b Apple Internal Keyboard/Trackpad +/* MacbookAir6,2 (unibody, June 2013) */ +product APPLE WELLSPRING8_ANSI 0x0290 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING8_ISO 0x0291 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRING8_JIS 0x0292 Apple Internal Keyboard/Trackpad product APPLE MOUSE 0x0301 Mouse M4848 product APPLE OPTMOUSE 0x0302 Optical mouse product APPLE MIGHTYMOUSE 0x0304 Mighty Mouse Modified: stable/9/sys/modules/usb/Makefile ============================================================================== --- stable/9/sys/modules/usb/Makefile Wed Feb 5 08:40:02 2014 (r261509) +++ stable/9/sys/modules/usb/Makefile Wed Feb 5 08:42:59 2014 (r261510) @@ -33,7 +33,7 @@ SUBDIR = usb SUBDIR += ehci musb ohci uhci xhci uss820dci ${_at91dci} ${_atmegadci} ${_avr32dci} SUBDIR += ${_rum} run ${_uath} upgt usie ural ${_zyd} ${_urtw} -SUBDIR += atp uhid ukbd ums udbp ufm uep +SUBDIR += atp uhid ukbd ums udbp ufm uep wsp SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umcs umodem umoscom uplcom uslcom uvisor uvscom SUBDIR += uether aue axe cdce cue ${_kue} mos rue udav uhso ipheth From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 6 07:55:51 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 685D350C; Thu, 6 Feb 2014 07:55:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 51FEA11AE; Thu, 6 Feb 2014 07:55:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s167tpV0003741; Thu, 6 Feb 2014 07:55:51 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s167tpq3003740; Thu, 6 Feb 2014 07:55:51 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402060755.s167tpq3003740@svn.freebsd.org> From: Christian Brueffer Date: Thu, 6 Feb 2014 07:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261539 - stable/9/sys/modules/mps X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 07:55:51 -0000 Author: brueffer Date: Thu Feb 6 07:55:50 2014 New Revision: 261539 URL: http://svnweb.freebsd.org/changeset/base/261539 Log: MFC: r233049 by rmh Remove gratuitous DEBUG_FLAGS="-g" setting (this is already the default option with GENERIC kernels). PR: 179536 Submitted by: Alexey Markov Modified: stable/9/sys/modules/mps/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/modules/mps/Makefile ============================================================================== --- stable/9/sys/modules/mps/Makefile Thu Feb 6 03:54:58 2014 (r261538) +++ stable/9/sys/modules/mps/Makefile Thu Feb 6 07:55:50 2014 (r261539) @@ -9,7 +9,6 @@ SRCS+= opt_cam.h opt_compat.h SRCS+= device_if.h bus_if.h pci_if.h #CFLAGS += -DMPS_DEBUG -DEBUG_FLAGS += -g .include From owner-svn-src-stable-9@FreeBSD.ORG Thu Feb 6 19:47:52 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63E07671; Thu, 6 Feb 2014 19:47:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3EB131D4C; Thu, 6 Feb 2014 19:47:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s16Jlqmj095922; Thu, 6 Feb 2014 19:47:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s16Jlp1V095916; Thu, 6 Feb 2014 19:47:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201402061947.s16Jlp1V095916@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 6 Feb 2014 19:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261561 - in stable/9: lib/libc/gen lib/libc/sys sys/compat/freebsd32 sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 19:47:52 -0000 Author: kib Date: Thu Feb 6 19:47:50 2014 New Revision: 261561 URL: http://svnweb.freebsd.org/changeset/base/261561 Log: MFC r261080: The posix_fallocate(2) syscall should return error number on error, without modifying errno. MFC r261290: The posix_madvise(3) and posix_fadvise(2) should return error on failure, same as posix_fallocate(2). Modified: stable/9/lib/libc/gen/pmadvise.c stable/9/lib/libc/sys/madvise.2 stable/9/lib/libc/sys/posix_fadvise.2 stable/9/lib/libc/sys/posix_fallocate.2 stable/9/sys/compat/freebsd32/freebsd32_misc.c stable/9/sys/kern/vfs_syscalls.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/lib/libc/gen/pmadvise.c ============================================================================== --- stable/9/lib/libc/gen/pmadvise.c Thu Feb 6 19:47:17 2014 (r261560) +++ stable/9/lib/libc/gen/pmadvise.c Thu Feb 6 19:47:50 2014 (r261561) @@ -8,9 +8,19 @@ __FBSDID("$FreeBSD$"); #include +#include int posix_madvise(void *address, size_t size, int how) { - return madvise(address, size, how); + int ret, saved_errno; + + saved_errno = errno; + if (madvise(address, size, how) == -1) { + ret = errno; + errno = saved_errno; + } else { + ret = 0; + } + return (ret); } Modified: stable/9/lib/libc/sys/madvise.2 ============================================================================== --- stable/9/lib/libc/sys/madvise.2 Thu Feb 6 19:47:17 2014 (r261560) +++ stable/9/lib/libc/sys/madvise.2 Thu Feb 6 19:47:50 2014 (r261561) @@ -28,7 +28,7 @@ .\" @(#)madvise.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd July 19, 1996 +.Dd January 30, 2014 .Dt MADVISE 2 .Os .Sh NAME @@ -50,7 +50,10 @@ allows a process that has knowledge of i to describe it to the system. The .Fn posix_madvise -interface is identical and is provided for standards conformance. +interface is identical, except it returns an error number on error and does +not modify +.Va errno , +and is provided for standards conformance. .Pp The known behaviors are: .Bl -tag -width MADV_SEQUENTIAL Modified: stable/9/lib/libc/sys/posix_fadvise.2 ============================================================================== --- stable/9/lib/libc/sys/posix_fadvise.2 Thu Feb 6 19:47:17 2014 (r261560) +++ stable/9/lib/libc/sys/posix_fadvise.2 Thu Feb 6 19:47:50 2014 (r261561) @@ -28,7 +28,7 @@ .\" @(#)madvise.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 19, 2012 +.Dd January 30, 2014 .Dt POSIX_FADVISE 2 .Os .Sh NAME @@ -94,7 +94,7 @@ Future access to this data may require a .Sh ERRORS The .Fn posix_fadvise -system call will fail if: +system call returns zero on success, and an error on failure: .Bl -tag -width Er .It Bq Er EBADF The Modified: stable/9/lib/libc/sys/posix_fallocate.2 ============================================================================== --- stable/9/lib/libc/sys/posix_fallocate.2 Thu Feb 6 19:47:17 2014 (r261560) +++ stable/9/lib/libc/sys/posix_fallocate.2 Thu Feb 6 19:47:50 2014 (r261561) @@ -84,9 +84,8 @@ that reduces the file size to a size sma If successful, .Fn posix_fallocate returns zero. -It returns -1 on failure, and sets -.Va errno -to indicate the error. +It returns an error on failure, without setting +.Va errno . .Sh ERRORS Possible failure conditions: .Bl -tag -width Er Modified: stable/9/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_misc.c Thu Feb 6 19:47:17 2014 (r261560) +++ stable/9/sys/compat/freebsd32/freebsd32_misc.c Thu Feb 6 19:47:50 2014 (r261561) @@ -2953,8 +2953,9 @@ freebsd32_posix_fallocate(struct thread struct freebsd32_posix_fallocate_args *uap) { - return (kern_posix_fallocate(td, uap->fd, - PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len))); + td->td_retval[0] = kern_posix_fallocate(td, uap->fd, + PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len)); + return (0); } int @@ -2962,8 +2963,10 @@ freebsd32_posix_fadvise(struct thread *t struct freebsd32_posix_fadvise_args *uap) { - return (kern_posix_fadvise(td, uap->fd, PAIR32TO64(off_t, uap->offset), - PAIR32TO64(off_t, uap->len), uap->advice)); + td->td_retval[0] = kern_posix_fadvise(td, uap->fd, + PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len), + uap->advice); + return (0); } int Modified: stable/9/sys/kern/vfs_syscalls.c ============================================================================== --- stable/9/sys/kern/vfs_syscalls.c Thu Feb 6 19:47:17 2014 (r261560) +++ stable/9/sys/kern/vfs_syscalls.c Thu Feb 6 19:47:50 2014 (r261561) @@ -4880,7 +4880,9 @@ int sys_posix_fallocate(struct thread *td, struct posix_fallocate_args *uap) { - return (kern_posix_fallocate(td, uap->fd, uap->offset, uap->len)); + td->td_retval[0] = kern_posix_fallocate(td, uap->fd, uap->offset, + uap->len); + return (0); } /* @@ -5018,6 +5020,7 @@ int sys_posix_fadvise(struct thread *td, struct posix_fadvise_args *uap) { - return (kern_posix_fadvise(td, uap->fd, uap->offset, uap->len, - uap->advice)); + td->td_retval[0] = kern_posix_fadvise(td, uap->fd, uap->offset, + uap->len, uap->advice); + return (0); } From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 7 04:10:31 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38285D7C; Fri, 7 Feb 2014 04:10:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 13C431B0E; Fri, 7 Feb 2014 04:10:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s174AU4g002953; Fri, 7 Feb 2014 04:10:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s174AUwr002951; Fri, 7 Feb 2014 04:10:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402070410.s174AUwr002951@svn.freebsd.org> From: Alexander Motin Date: Fri, 7 Feb 2014 04:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261574 - in stable/9/sys/boot: i386/libi386 pc98/libpc98 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 04:10:31 -0000 Author: mav Date: Fri Feb 7 04:10:30 2014 New Revision: 261574 URL: http://svnweb.freebsd.org/changeset/base/261574 Log: MFC r260949: Make comconsole options set before its activation to be remembered. Modified: stable/9/sys/boot/i386/libi386/comconsole.c stable/9/sys/boot/pc98/libpc98/comconsole.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/libi386/comconsole.c ============================================================================== --- stable/9/sys/boot/i386/libi386/comconsole.c Fri Feb 7 04:09:15 2014 (r261573) +++ stable/9/sys/boot/i386/libi386/comconsole.c Fri Feb 7 04:10:30 2014 (r261574) @@ -181,8 +181,7 @@ comc_speed_set(struct env_var *ev, int f return (CMD_ERROR); } - if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && - comc_curspeed != speed) + if (comc_curspeed != speed) comc_setup(speed, comc_port); env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -200,8 +199,7 @@ comc_port_set(struct env_var *ev, int fl return (CMD_ERROR); } - if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && - comc_port != port) + if (comc_port != port) comc_setup(comc_curspeed, port); env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -309,6 +307,8 @@ comc_setup(int speed, int port) unsetenv("hw.uart.console"); comc_curspeed = speed; comc_port = port; + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) == 0) + return; outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT); outb(comc_port + com_dlbl, COMC_BPS(speed) & 0xff); Modified: stable/9/sys/boot/pc98/libpc98/comconsole.c ============================================================================== --- stable/9/sys/boot/pc98/libpc98/comconsole.c Fri Feb 7 04:09:15 2014 (r261573) +++ stable/9/sys/boot/pc98/libpc98/comconsole.c Fri Feb 7 04:10:30 2014 (r261574) @@ -181,8 +181,7 @@ comc_speed_set(struct env_var *ev, int f return (CMD_ERROR); } - if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && - comc_curspeed != speed) + if (comc_curspeed != speed) comc_setup(speed, comc_port); env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -200,8 +199,7 @@ comc_port_set(struct env_var *ev, int fl return (CMD_ERROR); } - if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && - comc_port != port) + if (comc_port != port) comc_setup(comc_curspeed, port); env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -309,6 +307,8 @@ comc_setup(int speed, int port) unsetenv("hw.uart.console"); comc_curspeed = speed; comc_port = port; + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) == 0) + return; outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT); outb(comc_port + com_dlbl, COMC_BPS(speed) & 0xff); From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 7 04:35:21 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ADB12FA; Fri, 7 Feb 2014 04:35:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 234261CE4; Fri, 7 Feb 2014 04:35:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s174ZLda013664; Fri, 7 Feb 2014 04:35:21 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s174ZK0p013663; Fri, 7 Feb 2014 04:35:20 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201402070435.s174ZK0p013663@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 7 Feb 2014 04:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261576 - stable/9/sys/dev/e1000 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 04:35:21 -0000 Author: gnn Date: Fri Feb 7 04:35:20 2014 New Revision: 261576 URL: http://svnweb.freebsd.org/changeset/base/261576 Log: MFC: 261291 The timestamp bit is number 17, and not number 9, in the stat error field of the receive descriptor. Modified: stable/9/sys/dev/e1000/e1000_defines.h Directory Properties: stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) Modified: stable/9/sys/dev/e1000/e1000_defines.h ============================================================================== --- stable/9/sys/dev/e1000/e1000_defines.h Fri Feb 7 04:34:04 2014 (r261575) +++ stable/9/sys/dev/e1000/e1000_defines.h Fri Feb 7 04:35:20 2014 (r261576) @@ -129,7 +129,7 @@ #define E1000_RXD_ERR_RXE 0x80 /* Rx Data Error */ #define E1000_RXD_SPC_VLAN_MASK 0x0FFF /* VLAN ID is in lower 12 bits */ -#define E1000_RXDEXT_STATERR_TST 0x00000100 /* Time Stamp taken */ +#define E1000_RXDEXT_STATERR_TST 0x00010000 /* Time Stamp taken */ #define E1000_RXDEXT_STATERR_LB 0x00040000 #define E1000_RXDEXT_STATERR_CE 0x01000000 #define E1000_RXDEXT_STATERR_SE 0x02000000 From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 7 05:23:05 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 099F3F67; Fri, 7 Feb 2014 05:23:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E6BAB1171; Fri, 7 Feb 2014 05:23:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s175N4Zq032015; Fri, 7 Feb 2014 05:23:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s175N4RI032014; Fri, 7 Feb 2014 05:23:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402070523.s175N4RI032014@svn.freebsd.org> From: Alexander Motin Date: Fri, 7 Feb 2014 05:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261578 - stable/9/sys/rpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 05:23:05 -0000 Author: mav Date: Fri Feb 7 05:23:04 2014 New Revision: 261578 URL: http://svnweb.freebsd.org/changeset/base/261578 Log: MFC r261449: Fix lock acquisition in case no request space available, missed in r260097. Modified: stable/9/sys/rpc/svc.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/rpc/svc.c ============================================================================== --- stable/9/sys/rpc/svc.c Fri Feb 7 05:08:59 2014 (r261577) +++ stable/9/sys/rpc/svc.c Fri Feb 7 05:23:04 2014 (r261578) @@ -1180,9 +1180,9 @@ svc_run_internal(SVCPOOL *pool, bool_t i */ xprt->xp_lastactive = time_uptime; do { - mtx_unlock(&pool->sp_lock); if (!svc_request_space_available(pool)) break; + mtx_unlock(&pool->sp_lock); rqstp = NULL; stat = svc_getreq(xprt, &rqstp); if (rqstp) { From owner-svn-src-stable-9@FreeBSD.ORG Fri Feb 7 07:31:55 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62EA6BE6; Fri, 7 Feb 2014 07:31:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 314231AB9; Fri, 7 Feb 2014 07:31:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s177VtHW084592; Fri, 7 Feb 2014 07:31:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s177VtVG084591; Fri, 7 Feb 2014 07:31:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402070731.s177VtVG084591@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 7 Feb 2014 07:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261580 - stable/9/sys/dev/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 07:31:55 -0000 Author: hselasky Date: Fri Feb 7 07:31:54 2014 New Revision: 261580 URL: http://svnweb.freebsd.org/changeset/base/261580 Log: MFC r244535, r245995, r261505 and r258961: - Use a boundary of zero, hence a PAGE_SIZE boundary is implied by all memory allocations. - Fix an external compiler warning about write-only assigned variable. Modified: stable/9/sys/dev/usb/usb_busdma.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usb_busdma.c ============================================================================== --- stable/9/sys/dev/usb/usb_busdma.c Fri Feb 7 07:18:52 2014 (r261579) +++ stable/9/sys/dev/usb/usb_busdma.c Fri Feb 7 07:31:54 2014 (r261580) @@ -211,9 +211,7 @@ usbd_m_copy_in(struct usb_page_cache *ca struct mbuf *m, usb_size_t src_offset, usb_frlength_t src_len) { struct usb_m_copy_in_arg arg = {cache, dst_offset}; - int error; - - error = m_apply(m, src_offset, src_len, &usbd_m_copy_in_cb, &arg); + (void) m_apply(m, src_offset, src_len, &usbd_m_copy_in_cb, &arg); } #endif @@ -358,8 +356,7 @@ usb_dma_tag_create(struct usb_dma_tag *u if (bus_dma_tag_create ( /* parent */ udt->tag_parent->tag, /* alignment */ align, - /* boundary */ (align == 1) ? - USB_PAGE_SIZE : 0, + /* boundary */ 0, /* lowaddr */ (2ULL << (udt->tag_parent->dma_bits - 1)) - 1, /* highaddr */ BUS_SPACE_MAXADDR, /* filter */ NULL, @@ -418,6 +415,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ struct usb_page_cache *pc; struct usb_page *pg; usb_size_t rem; + bus_size_t off; uint8_t owned; pc = arg; @@ -433,12 +431,13 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ if (error) { goto done; } + + off = 0; pg = pc->page_start; pg->physaddr = segs->ds_addr & ~(USB_PAGE_SIZE - 1); rem = segs->ds_addr & (USB_PAGE_SIZE - 1); pc->page_offset_buf = rem; pc->page_offset_end += rem; - nseg--; #ifdef USB_DEBUG if (rem != (USB_P2U(pc->buffer) & (USB_PAGE_SIZE - 1))) { /* @@ -449,11 +448,19 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ goto done; } #endif - while (nseg > 0) { - nseg--; - segs++; + while (pc->ismultiseg) { + off += USB_PAGE_SIZE; + if (off >= (segs->ds_len + rem)) { + /* page crossing */ + nseg--; + segs++; + off = 0; + rem = 0; + if (nseg == 0) + break; + } pg++; - pg->physaddr = segs->ds_addr & ~(USB_PAGE_SIZE - 1); + pg->physaddr = (segs->ds_addr + off) & ~(USB_PAGE_SIZE - 1); } done: From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 8 07:53:40 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BAA757E; Sat, 8 Feb 2014 07:53:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 26A9913DE; Sat, 8 Feb 2014 07:53:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s187reYh066030; Sat, 8 Feb 2014 07:53:40 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s187rdx3066028; Sat, 8 Feb 2014 07:53:39 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201402080753.s187rdx3066028@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 8 Feb 2014 07:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261622 - stable/9/sys/dev/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 07:53:40 -0000 Author: dumbbell Date: Sat Feb 8 07:53:39 2014 New Revision: 261622 URL: http://svnweb.freebsd.org/changeset/base/261622 Log: MFC r254882, r254883, r255571: vga_pci: Add API to map the Video BIOS Here are two new functions to map and unmap the Video BIOS: void * vga_pci_map_bios(device_t dev, size_t *size); void vga_pci_unmap_bios(device_t dev, void *bios); The BIOS is either taken from the shadow copy made by the System BIOS at boot time if the given device was used for the default display (i386, amd64 and ia64 only), or from the PCI expansion ROM. Additionally, one can determine if a given device was the default display at boot time using the following new function: int vga_pci_is_boot_display(device_t dev); Submitted by: jhb@ (r255571) Modified: stable/9/sys/dev/pci/pcivar.h stable/9/sys/dev/pci/vga_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/pci/pcivar.h ============================================================================== --- stable/9/sys/dev/pci/pcivar.h Sat Feb 8 06:22:09 2014 (r261621) +++ stable/9/sys/dev/pci/pcivar.h Sat Feb 8 07:53:39 2014 (r261622) @@ -490,4 +490,11 @@ extern uint32_t pci_generation; struct pci_map *pci_find_bar(device_t dev, int reg); int pci_bar_enabled(device_t dev, struct pci_map *pm); +#define VGA_PCI_BIOS_SHADOW_ADDR 0xC0000 +#define VGA_PCI_BIOS_SHADOW_SIZE 131072 + +int vga_pci_is_boot_display(device_t dev); +void * vga_pci_map_bios(device_t dev, size_t *size); +void vga_pci_unmap_bios(device_t dev, void *bios); + #endif /* _PCIVAR_H_ */ Modified: stable/9/sys/dev/pci/vga_pci.c ============================================================================== --- stable/9/sys/dev/pci/vga_pci.c Sat Feb 8 06:22:09 2014 (r261621) +++ stable/9/sys/dev/pci/vga_pci.c Sat Feb 8 07:53:39 2014 (r261622) @@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) +#include +#include +#endif + #include #include @@ -62,11 +67,95 @@ struct vga_pci_softc { SYSCTL_DECL(_hw_pci); +static struct vga_resource *lookup_res(struct vga_pci_softc *sc, int rid); +static struct resource *vga_pci_alloc_resource(device_t dev, device_t child, + int type, int *rid, u_long start, u_long end, u_long count, u_int flags); +static int vga_pci_release_resource(device_t dev, device_t child, int type, + int rid, struct resource *r); + int vga_pci_default_unit = -1; TUNABLE_INT("hw.pci.default_vgapci_unit", &vga_pci_default_unit); SYSCTL_INT(_hw_pci, OID_AUTO, default_vgapci_unit, CTLFLAG_RDTUN, &vga_pci_default_unit, -1, "Default VGA-compatible display"); +int +vga_pci_is_boot_display(device_t dev) +{ + + /* + * Return true if the given device is the default display used + * at boot time. + */ + return ( + (pci_get_class(dev) == PCIC_DISPLAY || + (pci_get_class(dev) == PCIC_OLD && + pci_get_subclass(dev) == PCIS_OLD_VGA)) && + device_get_unit(dev) == vga_pci_default_unit); +} + +void * +vga_pci_map_bios(device_t dev, size_t *size) +{ + int rid; + struct resource *res; + +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) + if (vga_pci_is_boot_display(dev)) { + /* + * On x86, the System BIOS copy the default display + * device's Video BIOS at a fixed location in system + * memory (0xC0000, 128 kBytes long) at boot time. + * + * We use this copy for the default boot device, because + * the original ROM may not be valid after boot. + */ + + *size = VGA_PCI_BIOS_SHADOW_SIZE; + return (pmap_mapbios(VGA_PCI_BIOS_SHADOW_ADDR, *size)); + } +#endif + + rid = PCIR_BIOS; + res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, &rid, 0ul, + ~0ul, 1, RF_ACTIVE); + if (res == NULL) { + return (NULL); + } + + *size = rman_get_size(res); + return (rman_get_virtual(res)); +} + +void +vga_pci_unmap_bios(device_t dev, void *bios) +{ + struct vga_resource *vr; + + if (bios == NULL) { + return; + } + +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) + if (vga_pci_is_boot_display(dev)) { + /* We mapped the BIOS shadow copy located at 0xC0000. */ + pmap_unmapdev((vm_offset_t)bios, VGA_PCI_BIOS_SHADOW_SIZE); + + return; + } +#endif + + /* + * Look up the PCIR_BIOS resource in our softc. It should match + * the address we returned previously. + */ + vr = lookup_res(device_get_softc(dev), PCIR_BIOS); + KASSERT(vr->vr_res != NULL, ("vga_pci_unmap_bios: bios not mapped")); + KASSERT(rman_get_virtual(vr->vr_res) == bios, + ("vga_pci_unmap_bios: mismatch")); + vga_pci_release_resource(dev, NULL, SYS_RES_MEMORY, PCIR_BIOS, + vr->vr_res); +} + static int vga_pci_probe(device_t dev) { From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 8 08:16:39 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FB79A4D; Sat, 8 Feb 2014 08:16:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4AEAF15AF; Sat, 8 Feb 2014 08:16:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s188Gd8H074758; Sat, 8 Feb 2014 08:16:39 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s188GdUL074757; Sat, 8 Feb 2014 08:16:39 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201402080816.s188GdUL074757@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 8 Feb 2014 08:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261623 - stable/9/sys/dev/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 08:16:39 -0000 Author: dumbbell Date: Sat Feb 8 08:16:38 2014 New Revision: 261623 URL: http://svnweb.freebsd.org/changeset/base/261623 Log: MFC r259679: vga_pci: Improve boot display detection The previous code was checking the "VGA Enable" bit on the video card's parent PCI-to-PCI bridge only. This didn't work for the case where the video card is attached to the root PCI bus (ie. the card has no parent PCI-to-PCI bridge). Now, the new code: 1. checks the "VGA Enable" bit on the parent bridge only if it's a PCI-to-PCI bridge; 2. always checks the "I/O" and "Memory address space decoding" bits on the video card itself. However, vendor-specific bits are not used. This fixes the use of many integrated Radeon cards: without this patch, we fail to detect them as the boot display and, when radeonkms looks for the Video BIOS, it skips the shadow copy made by the System BIOS. It then fails to fully initialize the card, because the shadow copy is the only way to read the Video BIOS in these situations. A workaround was to force the boot display selection using the "hw.pci.default_vgapci_unit" tunable. A previous version of this patch added a new function doing the checks. Now, the vga_pci_is_boot_display() function is used to perform the checks (only until the boot display is found) and return if the given device is the boot display or not. Furthermore, vga_pci_attach() logs "Boot video device" if the card being attached it the Chosen One: vgapci0: [...] vgapci0: Boot video device Reviewed by: kib@, jhb@ (both a previous version) Tested by: lunatic_ (#freebsd-xorg, integrated Radeon card, xmj (#freebsd-xorg, i915+NVIDIA cards) Modified: stable/9/sys/dev/pci/vga_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/pci/vga_pci.c ============================================================================== --- stable/9/sys/dev/pci/vga_pci.c Sat Feb 8 07:53:39 2014 (r261622) +++ stable/9/sys/dev/pci/vga_pci.c Sat Feb 8 08:16:38 2014 (r261623) @@ -81,16 +81,58 @@ SYSCTL_INT(_hw_pci, OID_AUTO, default_vg int vga_pci_is_boot_display(device_t dev) { + int unit; + device_t pcib; + uint16_t config; + + /* Check that the given device is a video card */ + if ((pci_get_class(dev) != PCIC_DISPLAY && + (pci_get_class(dev) != PCIC_OLD || + pci_get_subclass(dev) != PCIS_OLD_VGA))) + return (0); + + unit = device_get_unit(dev); + + if (vga_pci_default_unit >= 0) { + /* + * The boot display device was determined by a previous + * call to this function, or the user forced it using + * the hw.pci.default_vgapci_unit tunable. + */ + return (vga_pci_default_unit == unit); + } /* - * Return true if the given device is the default display used - * at boot time. + * The primary video card used as a boot display must have the + * "I/O" and "Memory Address Space Decoding" bits set in its + * Command register. + * + * Furthermore, if the card is attached to a bridge, instead of + * the root PCI bus, the bridge must have the "VGA Enable" bit + * set in its Control register. */ - return ( - (pci_get_class(dev) == PCIC_DISPLAY || - (pci_get_class(dev) == PCIC_OLD && - pci_get_subclass(dev) == PCIS_OLD_VGA)) && - device_get_unit(dev) == vga_pci_default_unit); + + pcib = device_get_parent(device_get_parent(dev)); + if (device_get_devclass(device_get_parent(pcib)) == + devclass_find("pci")) { + /* + * The parent bridge is a PCI-to-PCI bridge: check the + * value of the "VGA Enable" bit. + */ + config = pci_read_config(pcib, PCIR_BRIDGECTL_1, 2); + if ((config & PCIB_BCR_VGA_ENABLE) == 0) + return (0); + } + + config = pci_read_config(dev, PCIR_COMMAND, 2); + if ((config & (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN)) == 0) + return (0); + + /* This video card is the boot display: record its unit number. */ + vga_pci_default_unit = unit; + device_set_flags(dev, 1); + + return (1); } void * @@ -159,9 +201,6 @@ vga_pci_unmap_bios(device_t dev, void *b static int vga_pci_probe(device_t dev) { - device_t bdev; - int unit; - uint16_t bctl; switch (pci_get_class(dev)) { case PCIC_DISPLAY: @@ -175,13 +214,7 @@ vga_pci_probe(device_t dev) } /* Probe default display. */ - unit = device_get_unit(dev); - bdev = device_get_parent(device_get_parent(dev)); - bctl = pci_read_config(bdev, PCIR_BRIDGECTL_1, 2); - if (vga_pci_default_unit < 0 && (bctl & PCIB_BCR_VGA_ENABLE) != 0) - vga_pci_default_unit = unit; - if (vga_pci_default_unit == unit) - device_set_flags(dev, 1); + vga_pci_is_boot_display(dev); device_set_desc(dev, "VGA-compatible display"); return (BUS_PROBE_GENERIC); @@ -197,6 +230,10 @@ vga_pci_attach(device_t dev) device_add_child(dev, "drm", -1); device_add_child(dev, "drmn", -1); bus_generic_attach(dev); + + if (vga_pci_is_boot_display(dev)) + device_printf(dev, "Boot video device\n"); + return (0); } From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 8 08:50:45 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 930BDFAC; Sat, 8 Feb 2014 08:50:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DF05181D; Sat, 8 Feb 2014 08:50:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s188ojir087201; Sat, 8 Feb 2014 08:50:45 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s188ojNL087200; Sat, 8 Feb 2014 08:50:45 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201402080850.s188ojNL087200@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 8 Feb 2014 08:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261624 - stable/9/sys/dev/drm2 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 08:50:45 -0000 Author: dumbbell Date: Sat Feb 8 08:50:44 2014 New Revision: 261624 URL: http://svnweb.freebsd.org/changeset/base/261624 Log: MFC r248061: Import Linux commit a1b7736dac5f2d5876e68c47a0fce3f423840070 Author: Sascha Hauer Date: Wed Feb 1 11:38:22 2012 +0100 drm drm_fb_helper: destroy modes drm_setup_crtcs allocated modes using drm_mode_duplicate. Free them in drm_fb_helper_crtc_free. Signed-off-by: Sascha Hauer Signed-off-by: Dave Airlie Discussed with: Konstantin Belousov (kib@) Modified: stable/9/sys/dev/drm2/drm_fb_helper.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- stable/9/sys/dev/drm2/drm_fb_helper.c Sat Feb 8 08:16:38 2014 (r261623) +++ stable/9/sys/dev/drm2/drm_fb_helper.c Sat Feb 8 08:50:44 2014 (r261624) @@ -555,8 +555,11 @@ static void drm_fb_helper_crtc_free(stru for (i = 0; i < helper->connector_count; i++) free(helper->connector_info[i], DRM_MEM_KMS); free(helper->connector_info, DRM_MEM_KMS); - for (i = 0; i < helper->crtc_count; i++) + for (i = 0; i < helper->crtc_count; i++) { free(helper->crtc_info[i].mode_set.connectors, DRM_MEM_KMS); + if (helper->crtc_info[i].mode_set.mode) + drm_mode_destroy(helper->dev, helper->crtc_info[i].mode_set.mode); + } free(helper->crtc_info, DRM_MEM_KMS); } From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 8 09:25:58 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49FA0498; Sat, 8 Feb 2014 09:25:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 270D219FB; Sat, 8 Feb 2014 09:25:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s189Pw6u001907; Sat, 8 Feb 2014 09:25:58 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s189PvjC001902; Sat, 8 Feb 2014 09:25:57 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201402080925.s189PvjC001902@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 8 Feb 2014 09:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261625 - in stable/9/sys/dev/drm2: . i915 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 09:25:58 -0000 Author: dumbbell Date: Sat Feb 8 09:25:56 2014 New Revision: 261625 URL: http://svnweb.freebsd.org/changeset/base/261625 Log: MFC r249041, r249249: drm and i915: Left-shift iic_msg.slave at creation time This is required because, in the radeon driver, we can't left-shift in a central place, like it was done in the i915 driver. Reviewed by: kib@, kan@, avg@ Tested by: kib@, avg@, Olivier Cochard-Labbé Modified: stable/9/sys/dev/drm2/drm_dp_iic_helper.c stable/9/sys/dev/drm2/drm_edid.c stable/9/sys/dev/drm2/i915/intel_iic.c stable/9/sys/dev/drm2/i915/intel_modes.c stable/9/sys/dev/drm2/i915/intel_sdvo.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/drm_dp_iic_helper.c ============================================================================== --- stable/9/sys/dev/drm2/drm_dp_iic_helper.c Sat Feb 8 08:50:44 2014 (r261624) +++ stable/9/sys/dev/drm2/drm_dp_iic_helper.c Sat Feb 8 09:25:56 2014 (r261625) @@ -146,7 +146,7 @@ iic_dp_aux_xfer(device_t idev, struct ii len = msgs[m].len; buf = msgs[m].buf; reading = (msgs[m].flags & IIC_M_RD) != 0; - ret = iic_dp_aux_address(idev, msgs[m].slave, reading); + ret = iic_dp_aux_address(idev, msgs[m].slave >> 1, reading); if (ret != 0) break; if (reading) { Modified: stable/9/sys/dev/drm2/drm_edid.c ============================================================================== --- stable/9/sys/dev/drm2/drm_edid.c Sat Feb 8 08:50:44 2014 (r261624) +++ stable/9/sys/dev/drm2/drm_edid.c Sat Feb 8 09:25:56 2014 (r261625) @@ -264,12 +264,12 @@ drm_do_probe_ddc_edid(device_t adapter, do { struct iic_msg msgs[] = { { - .slave = DDC_ADDR, + .slave = DDC_ADDR << 1, .flags = IIC_M_WR, .len = 1, .buf = &start, }, { - .slave = DDC_ADDR, + .slave = DDC_ADDR << 1, .flags = IIC_M_RD, .len = len, .buf = buf, Modified: stable/9/sys/dev/drm2/i915/intel_iic.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_iic.c Sat Feb 8 08:50:44 2014 (r261624) +++ stable/9/sys/dev/drm2/i915/intel_iic.c Sat Feb 8 09:25:56 2014 (r261625) @@ -256,7 +256,7 @@ intel_gmbus_transfer(device_t idev, stru I915_WRITE(GMBUS1 + reg_offset, GMBUS_CYCLE_WAIT | (i + 1 == nmsgs ? GMBUS_CYCLE_STOP : 0) | (len << GMBUS_BYTE_COUNT_SHIFT) | - (msgs[i].slave << GMBUS_SLAVE_ADDR_SHIFT) | + (msgs[i].slave << (GMBUS_SLAVE_ADDR_SHIFT - 1)) | GMBUS_SLAVE_READ | GMBUS_SW_RDY); POSTING_READ(GMBUS2 + reg_offset); do { @@ -287,7 +287,7 @@ intel_gmbus_transfer(device_t idev, stru I915_WRITE(GMBUS1 + reg_offset, GMBUS_CYCLE_WAIT | (i + 1 == nmsgs ? GMBUS_CYCLE_STOP : 0) | (msgs[i].len << GMBUS_BYTE_COUNT_SHIFT) | - (msgs[i].slave << GMBUS_SLAVE_ADDR_SHIFT) | + (msgs[i].slave << (GMBUS_SLAVE_ADDR_SHIFT - 1)) | GMBUS_SLAVE_WRITE | GMBUS_SW_RDY); POSTING_READ(GMBUS2+reg_offset); @@ -397,17 +397,11 @@ intel_iic_quirk_xfer(device_t idev, stru IICBB_SETSCL(bridge_dev, 1); DELAY(I2C_RISEFALL_TIME); - /* convert slave addresses to format expected by iicbb */ - for (i = 0; i < nmsgs; i++) { - msgs[i].slave <<= 1; + for (i = 0; i < nmsgs - 1; i++) { /* force use of repeated start instead of default stop+start */ - if (i != (nmsgs - 1)) - msgs[i].flags |= IIC_M_NOSTOP; + msgs[i].flags |= IIC_M_NOSTOP; } ret = iicbus_transfer(idev, msgs, nmsgs); - /* restore the addresses */ - for (i = 0; i < nmsgs; i++) - msgs[i].slave >>= 1; IICBB_SETSDA(bridge_dev, 1); IICBB_SETSCL(bridge_dev, 1); intel_iic_quirk_set(dev_priv, false); Modified: stable/9/sys/dev/drm2/i915/intel_modes.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_modes.c Sat Feb 8 08:50:44 2014 (r261624) +++ stable/9/sys/dev/drm2/i915/intel_modes.c Sat Feb 8 09:25:56 2014 (r261625) @@ -45,13 +45,13 @@ bool intel_ddc_probe(struct intel_encode u8 buf[2]; struct iic_msg msgs[] = { { - .slave = DDC_ADDR, + .slave = DDC_ADDR << 1, .flags = IIC_M_WR, .len = 1, .buf = out_buf, }, { - .slave = DDC_ADDR, + .slave = DDC_ADDR << 1, .flags = IIC_M_RD, .len = 1, .buf = buf, Modified: stable/9/sys/dev/drm2/i915/intel_sdvo.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_sdvo.c Sat Feb 8 08:50:44 2014 (r261624) +++ stable/9/sys/dev/drm2/i915/intel_sdvo.c Sat Feb 8 09:25:56 2014 (r261625) @@ -266,13 +266,13 @@ static bool intel_sdvo_read_byte(struct { struct iic_msg msgs[] = { { - .slave = intel_sdvo->slave_addr, + .slave = intel_sdvo->slave_addr << 1, .flags = 0, .len = 1, .buf = &addr, }, { - .slave = intel_sdvo->slave_addr, + .slave = intel_sdvo->slave_addr << 1, .flags = IIC_M_RD, .len = 1, .buf = ch, @@ -454,14 +454,14 @@ intel_sdvo_write_cmd(struct intel_sdvo * intel_sdvo_debug_write(intel_sdvo, cmd, args, args_len); for (i = 0; i < args_len; i++) { - msgs[i].slave = intel_sdvo->slave_addr; + msgs[i].slave = intel_sdvo->slave_addr << 1; msgs[i].flags = 0; msgs[i].len = 2; msgs[i].buf = buf + 2 *i; buf[2*i + 0] = SDVO_I2C_ARG_0 - i; buf[2*i + 1] = ((const u8*)args)[i]; } - msgs[i].slave = intel_sdvo->slave_addr; + msgs[i].slave = intel_sdvo->slave_addr << 1; msgs[i].flags = 0; msgs[i].len = 2; msgs[i].buf = buf + 2*i; @@ -470,12 +470,12 @@ intel_sdvo_write_cmd(struct intel_sdvo * /* the following two are to read the response */ status = SDVO_I2C_CMD_STATUS; - msgs[i+1].slave = intel_sdvo->slave_addr; + msgs[i+1].slave = intel_sdvo->slave_addr << 1; msgs[i+1].flags = 0; msgs[i+1].len = 1; msgs[i+1].buf = &status; - msgs[i+2].slave = intel_sdvo->slave_addr; + msgs[i+2].slave = intel_sdvo->slave_addr << 1; msgs[i+2].flags = IIC_M_RD; msgs[i+2].len = 1; msgs[i+2].buf = &status; From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 8 09:50:03 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87EB5BD1; Sat, 8 Feb 2014 09:50:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 65E231B91; Sat, 8 Feb 2014 09:50:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s189o3Ng010205; Sat, 8 Feb 2014 09:50:03 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s189o3Je010202; Sat, 8 Feb 2014 09:50:03 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201402080950.s189o3Je010202@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 8 Feb 2014 09:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261626 - stable/9/sys/dev/drm2 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 09:50:03 -0000 Author: dumbbell Date: Sat Feb 8 09:50:02 2014 New Revision: 261626 URL: http://svnweb.freebsd.org/changeset/base/261626 Log: MFC r254792: drm: Call drm_global_init() & drm_global_release() at module load/unload Added: stable/9/sys/dev/drm2/drm_core.h - copied unchanged from r254792, head/sys/dev/drm2/drm_core.h Modified: stable/9/sys/dev/drm2/drm_drv.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Copied: stable/9/sys/dev/drm2/drm_core.h (from r254792, head/sys/dev/drm2/drm_core.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/drm2/drm_core.h Sat Feb 8 09:50:02 2014 (r261626, copy of r254792, head/sys/dev/drm2/drm_core.h) @@ -0,0 +1,38 @@ +/* + * Copyright 2004 Jon Smirl + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#define CORE_AUTHOR "Gareth Hughes, Leif Delgass, José Fonseca, Jon Smirl" + +#define CORE_NAME "drm" +#define CORE_DESC "DRM shared core routines" +#define CORE_DATE "20060810" + +#define DRM_IF_MAJOR 1 +#define DRM_IF_MINOR 4 + +#define CORE_MAJOR 1 +#define CORE_MINOR 1 +#define CORE_PATCHLEVEL 0 Modified: stable/9/sys/dev/drm2/drm_drv.c ============================================================================== --- stable/9/sys/dev/drm2/drm_drv.c Sat Feb 8 09:25:56 2014 (r261625) +++ stable/9/sys/dev/drm2/drm_drv.c Sat Feb 8 09:50:02 2014 (r261626) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -76,7 +78,7 @@ static moduledata_t drm_mod = { "drmn", drm_modevent, 0 -}; +}; DECLARE_MODULE(drmn, drm_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); MODULE_VERSION(drmn, 1); MODULE_DEPEND(drmn, agp, 1, 1, 1); @@ -208,7 +210,7 @@ static struct drm_msi_blacklist_entry dr static int drm_msi_is_blacklisted(int vendor, int device) { int i = 0; - + for (i = 0; drm_msi_blacklist[i].vendor != 0; i++) { if ((drm_msi_blacklist[i].vendor == vendor) && (drm_msi_blacklist[i].device == device)) { @@ -347,7 +349,7 @@ drm_pci_id_list_t *drm_find_description( drm_pci_id_list_t *idlist) { int i = 0; - + for (i = 0; idlist[i].vendor != 0; i++) { if ((idlist[i].vendor == vendor) && ((idlist[i].device == device) || @@ -744,7 +746,7 @@ void drm_close(void *data) drm_lock_free(&dev->lock, _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock)); - + /* FIXME: may require heavy-handed reset of hardware at this point, possibly processed via a callback to the X @@ -807,7 +809,7 @@ extern drm_ioctl_desc_t drm_compat_ioctl /* drm_ioctl is called whenever a process performs an ioctl on /dev/drm. */ -int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags, +int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags, DRM_STRUCTPROC *p) { struct drm_device *dev = drm_get_device_from_kdev(kdev); @@ -965,14 +967,9 @@ MODULE_DEPEND(DRIVER_NAME, linux, 1, 1, #define LINUX_IOCTL_DRM_MAX 0x64ff static linux_ioctl_function_t drm_linux_ioctl; -static struct linux_ioctl_handler drm_handler = {drm_linux_ioctl, +static struct linux_ioctl_handler drm_handler = {drm_linux_ioctl, LINUX_IOCTL_DRM_MIN, LINUX_IOCTL_DRM_MAX}; -SYSINIT(drm_register, SI_SUB_KLD, SI_ORDER_MIDDLE, - linux_ioctl_register_handler, &drm_handler); -SYSUNINIT(drm_unregister, SI_SUB_KLD, SI_ORDER_MIDDLE, - linux_ioctl_unregister_handler, &drm_handler); - /* The bits for in/out are switched on Linux */ #define LINUX_IOC_IN IOC_OUT #define LINUX_IOC_OUT IOC_IN @@ -988,13 +985,45 @@ drm_linux_ioctl(DRM_STRUCTPROC *p, struc args->cmd |= IOC_IN; if (cmd & LINUX_IOC_OUT) args->cmd |= IOC_OUT; - + error = ioctl(p, (struct ioctl_args *)args); return error; } #endif /* DRM_LINUX */ + +static int +drm_core_init(void *arg) +{ + + drm_global_init(); + +#if DRM_LINUX + linux_ioctl_register_handler(&drm_handler); +#endif /* DRM_LINUX */ + + DRM_INFO("Initialized %s %d.%d.%d %s\n", + CORE_NAME, CORE_MAJOR, CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE); + return 0; +} + +static void +drm_core_exit(void *arg) +{ + +#if DRM_LINUX + linux_ioctl_unregister_handler(&drm_handler); +#endif /* DRM_LINUX */ + + drm_global_release(); +} + +SYSINIT(drm_register, SI_SUB_KLD, SI_ORDER_MIDDLE, + drm_core_init, NULL); +SYSUNINIT(drm_unregister, SI_SUB_KLD, SI_ORDER_MIDDLE, + drm_core_exit, NULL); + bool dmi_check_system(const struct dmi_system_id *sysid) { @@ -1002,4 +1031,3 @@ dmi_check_system(const struct dmi_system /* XXXKIB */ return (false); } - From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 8 10:33:24 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AECED830; Sat, 8 Feb 2014 10:33:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96EA61F76; Sat, 8 Feb 2014 10:33:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18AXOqI029503; Sat, 8 Feb 2014 10:33:24 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18AXOPX029499; Sat, 8 Feb 2014 10:33:24 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201402081033.s18AXOPX029499@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 8 Feb 2014 10:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261629 - in stable/9/sys: dev/drm2 modules/drm2/drm2 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 10:33:24 -0000 Author: dumbbell Date: Sat Feb 8 10:33:23 2014 New Revision: 261629 URL: http://svnweb.freebsd.org/changeset/base/261629 Log: MFC r254794: drm: Import drm_buffer.[ch] from Linux 3.8-rc3 This will be used by the Radeon KMS driver. Added: stable/9/sys/dev/drm2/drm_buffer.c - copied unchanged from r254794, head/sys/dev/drm2/drm_buffer.c stable/9/sys/dev/drm2/drm_buffer.h - copied unchanged from r254794, head/sys/dev/drm2/drm_buffer.h Modified: stable/9/sys/modules/drm2/drm2/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Copied: stable/9/sys/dev/drm2/drm_buffer.c (from r254794, head/sys/dev/drm2/drm_buffer.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/drm2/drm_buffer.c Sat Feb 8 10:33:23 2014 (r261629, copy of r254794, head/sys/dev/drm2/drm_buffer.c) @@ -0,0 +1,183 @@ +/************************************************************************** + * + * Copyright 2010 Pauli Nieminen. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * + **************************************************************************/ +/* + * Multipart buffer for coping data which is larger than the page size. + * + * Authors: + * Pauli Nieminen + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +/** + * Allocate the drm buffer object. + * + * buf: Pointer to a pointer where the object is stored. + * size: The number of bytes to allocate. + */ +int drm_buffer_alloc(struct drm_buffer **buf, int size) +{ + int nr_pages = size / PAGE_SIZE + 1; + int idx; + + /* Allocating pointer table to end of structure makes drm_buffer + * variable sized */ + *buf = malloc(sizeof(struct drm_buffer) + nr_pages*sizeof(char *), + DRM_MEM_DRIVER, M_ZERO | M_WAITOK); + + if (*buf == NULL) { + DRM_ERROR("Failed to allocate drm buffer object to hold" + " %d bytes in %d pages.\n", + size, nr_pages); + return -ENOMEM; + } + + (*buf)->size = size; + + for (idx = 0; idx < nr_pages; ++idx) { + + (*buf)->data[idx] = + malloc(min(PAGE_SIZE, size - idx * PAGE_SIZE), + DRM_MEM_DRIVER, M_WAITOK); + + + if ((*buf)->data[idx] == NULL) { + DRM_ERROR("Failed to allocate %dth page for drm" + " buffer with %d bytes and %d pages.\n", + idx + 1, size, nr_pages); + goto error_out; + } + + } + + return 0; + +error_out: + + /* Only last element can be null pointer so check for it first. */ + if ((*buf)->data[idx]) + free((*buf)->data[idx], DRM_MEM_DRIVER); + + for (--idx; idx >= 0; --idx) + free((*buf)->data[idx], DRM_MEM_DRIVER); + + free(*buf, DRM_MEM_DRIVER); + return -ENOMEM; +} + +/** + * Copy the user data to the begin of the buffer and reset the processing + * iterator. + * + * user_data: A pointer the data that is copied to the buffer. + * size: The Number of bytes to copy. + */ +int drm_buffer_copy_from_user(struct drm_buffer *buf, + void __user *user_data, int size) +{ + int nr_pages = size / PAGE_SIZE + 1; + int idx; + + if (size > buf->size) { + DRM_ERROR("Requesting to copy %d bytes to a drm buffer with" + " %d bytes space\n", + size, buf->size); + return -EFAULT; + } + + for (idx = 0; idx < nr_pages; ++idx) { + + if (DRM_COPY_FROM_USER(buf->data[idx], + (char *)user_data + idx * PAGE_SIZE, + min(PAGE_SIZE, size - idx * PAGE_SIZE))) { + DRM_ERROR("Failed to copy user data (%p) to drm buffer" + " (%p) %dth page.\n", + user_data, buf, idx); + return -EFAULT; + + } + } + buf->iterator = 0; + return 0; +} + +/** + * Free the drm buffer object + */ +void drm_buffer_free(struct drm_buffer *buf) +{ + + if (buf != NULL) { + + int nr_pages = buf->size / PAGE_SIZE + 1; + int idx; + for (idx = 0; idx < nr_pages; ++idx) + free(buf->data[idx], DRM_MEM_DRIVER); + + free(buf, DRM_MEM_DRIVER); + } +} + +/** + * Read an object from buffer that may be split to multiple parts. If object + * is not split function just returns the pointer to object in buffer. But in + * case of split object data is copied to given stack object that is suplied + * by caller. + * + * The processing location of the buffer is also advanced to the next byte + * after the object. + * + * objsize: The size of the objet in bytes. + * stack_obj: A pointer to a memory location where object can be copied. + */ +void *drm_buffer_read_object(struct drm_buffer *buf, + int objsize, void *stack_obj) +{ + int idx = drm_buffer_index(buf); + int page = drm_buffer_page(buf); + void *obj = NULL; + + if (idx + objsize <= PAGE_SIZE) { + obj = &buf->data[page][idx]; + } else { + /* The object is split which forces copy to temporary object.*/ + int beginsz = PAGE_SIZE - idx; + memcpy(stack_obj, &buf->data[page][idx], beginsz); + + memcpy((char *)stack_obj + beginsz, &buf->data[page + 1][0], + objsize - beginsz); + + obj = stack_obj; + } + + drm_buffer_advance(buf, objsize); + return obj; +} Copied: stable/9/sys/dev/drm2/drm_buffer.h (from r254794, head/sys/dev/drm2/drm_buffer.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/drm2/drm_buffer.h Sat Feb 8 10:33:23 2014 (r261629, copy of r254794, head/sys/dev/drm2/drm_buffer.h) @@ -0,0 +1,151 @@ +/************************************************************************** + * + * Copyright 2010 Pauli Nieminen. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * + **************************************************************************/ +/* + * Multipart buffer for coping data which is larger than the page size. + * + * Authors: + * Pauli Nieminen + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifndef _DRM_BUFFER_H_ +#define _DRM_BUFFER_H_ + +#include + +struct drm_buffer { + int iterator; + int size; + char *data[]; +}; + + +/** + * Return the index of page that buffer is currently pointing at. + */ +static inline int drm_buffer_page(struct drm_buffer *buf) +{ + return buf->iterator / PAGE_SIZE; +} +/** + * Return the index of the current byte in the page + */ +static inline int drm_buffer_index(struct drm_buffer *buf) +{ + return buf->iterator & (PAGE_SIZE - 1); +} +/** + * Return number of bytes that is left to process + */ +static inline int drm_buffer_unprocessed(struct drm_buffer *buf) +{ + return buf->size - buf->iterator; +} + +/** + * Advance the buffer iterator number of bytes that is given. + */ +static inline void drm_buffer_advance(struct drm_buffer *buf, int bytes) +{ + buf->iterator += bytes; +} + +/** + * Allocate the drm buffer object. + * + * buf: A pointer to a pointer where the object is stored. + * size: The number of bytes to allocate. + */ +extern int drm_buffer_alloc(struct drm_buffer **buf, int size); + +/** + * Copy the user data to the begin of the buffer and reset the processing + * iterator. + * + * user_data: A pointer the data that is copied to the buffer. + * size: The Number of bytes to copy. + */ +extern int drm_buffer_copy_from_user(struct drm_buffer *buf, + void __user *user_data, int size); + +/** + * Free the drm buffer object + */ +extern void drm_buffer_free(struct drm_buffer *buf); + +/** + * Read an object from buffer that may be split to multiple parts. If object + * is not split function just returns the pointer to object in buffer. But in + * case of split object data is copied to given stack object that is suplied + * by caller. + * + * The processing location of the buffer is also advanced to the next byte + * after the object. + * + * objsize: The size of the objet in bytes. + * stack_obj: A pointer to a memory location where object can be copied. + */ +extern void *drm_buffer_read_object(struct drm_buffer *buf, + int objsize, void *stack_obj); + +/** + * Returns the pointer to the dword which is offset number of elements from the + * current processing location. + * + * Caller must make sure that dword is not split in the buffer. This + * requirement is easily met if all the sizes of objects in buffer are + * multiples of dword and PAGE_SIZE is multiple dword. + * + * Call to this function doesn't change the processing location. + * + * offset: The index of the dword relative to the internat iterator. + */ +static inline void *drm_buffer_pointer_to_dword(struct drm_buffer *buffer, + int offset) +{ + int iter = buffer->iterator + offset * 4; + return &buffer->data[iter / PAGE_SIZE][iter & (PAGE_SIZE - 1)]; +} +/** + * Returns the pointer to the dword which is offset number of elements from + * the current processing location. + * + * Call to this function doesn't change the processing location. + * + * offset: The index of the byte relative to the internat iterator. + */ +static inline void *drm_buffer_pointer_to_byte(struct drm_buffer *buffer, + int offset) +{ + int iter = buffer->iterator + offset; + return &buffer->data[iter / PAGE_SIZE][iter & (PAGE_SIZE - 1)]; +} + +#endif Modified: stable/9/sys/modules/drm2/drm2/Makefile ============================================================================== --- stable/9/sys/modules/drm2/drm2/Makefile Sat Feb 8 09:57:52 2014 (r261628) +++ stable/9/sys/modules/drm2/drm2/Makefile Sat Feb 8 10:33:23 2014 (r261629) @@ -6,6 +6,7 @@ SRCS = \ drm_agpsupport.c \ drm_auth.c \ drm_bufs.c \ + drm_buffer.c \ drm_context.c \ drm_crtc.c \ drm_crtc_helper.c \ From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 8 10:45:49 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8901A62; Sat, 8 Feb 2014 10:45:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A68081033; Sat, 8 Feb 2014 10:45:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18Ajn9P033566; Sat, 8 Feb 2014 10:45:49 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18AjnKt033565; Sat, 8 Feb 2014 10:45:49 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201402081045.s18AjnKt033565@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 8 Feb 2014 10:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261630 - stable/9/sys/dev/drm2/i915 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 10:45:50 -0000 Author: dumbbell Date: Sat Feb 8 10:45:49 2014 New Revision: 261630 URL: http://svnweb.freebsd.org/changeset/base/261630 Log: MFC r254796: drm/i915: Import Linux commit 71244653a8fb0f46bc12ae421f1d5f72af6a75da Author: Daniel Vetter Date: Mon Jun 4 18:39:20 2012 +0200 drm/i915: adjusted_mode->clock in the dp mode_fixup ... instead of changing mode->clock, which we should leave as-is. After the previous patch we only touch that if it's a panel, and then adjusted mode->clock equals adjusted_mode->clock. Outside of intel_dp.c we only use ajusted_mode->clock in the mode_set functions. Within intel_dp.c we only use it to calculate the dp dithering and link bw parameters, so that's the only thing we need to fix up. As a temporary ugliness (until the cleanup in the next patch) we pass the adjusted_mode into dp_dither for both parameters (because that one still looks at mode->clock). Note that we do overwrite adjusted_mode->clock with the selected dp link clock, but that only happens after we've calculated everything we need based on the dotclock of the adjusted output configuration. Outside of intel_dp.c only intel_display.c uses adjusted_mode->clock, and that stays the same after this patch (still equals the selected dp link clock). intel_display.c also needs the actual dotclock (as target_clock), but that has been fixed up in the previous patch. v2: Adjust the debug message to also use adjusted_mode->clock. Reviewed-by: Chris Wilson Reviewed-by: Jesse Barnes Signed-off-by: Daniel Vetter Modified: stable/9/sys/dev/drm2/i915/intel_dp.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/i915/intel_dp.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_dp.c Sat Feb 8 10:33:23 2014 (r261629) +++ stable/9/sys/dev/drm2/i915/intel_dp.c Sat Feb 8 10:45:49 2014 (r261630) @@ -691,14 +691,9 @@ intel_dp_mode_fixup(struct drm_encoder * intel_fixed_panel_mode(intel_dp->panel_fixed_mode, adjusted_mode); intel_pch_panel_fitting(dev, DRM_MODE_SCALE_FULLSCREEN, mode, adjusted_mode); - /* - * the mode->clock is used to calculate the Data&Link M/N - * of the pipe. For the eDP the fixed clock should be used. - */ - mode->clock = intel_dp->panel_fixed_mode->clock; } - if (!intel_dp_adjust_dithering(intel_dp, mode, adjusted_mode)) + if (!intel_dp_adjust_dithering(intel_dp, adjusted_mode, adjusted_mode)) return false; bpp = adjusted_mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24; @@ -707,7 +702,7 @@ intel_dp_mode_fixup(struct drm_encoder * for (clock = 0; clock <= max_clock; clock++) { int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); - if (intel_dp_link_required(mode->clock, bpp) + if (intel_dp_link_required(adjusted_mode->clock, bpp) <= link_avail) { intel_dp->link_bw = bws[clock]; intel_dp->lane_count = lane_count; From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 8 10:57:49 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BDFD2FC; Sat, 8 Feb 2014 10:57:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 189091146; Sat, 8 Feb 2014 10:57:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18Avmp9037721; Sat, 8 Feb 2014 10:57:48 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18AvkJQ037710; Sat, 8 Feb 2014 10:57:46 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201402081057.s18AvkJQ037710@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 8 Feb 2014 10:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261631 - in stable/9/sys/dev/drm2: . i915 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 10:57:49 -0000 Author: dumbbell Date: Sat Feb 8 10:57:46 2014 New Revision: 261631 URL: http://svnweb.freebsd.org/changeset/base/261631 Log: MFC r254797: drm: Const'ify the 1st "drm_display_mode" passed to "mode_fixup" callbacks This will be needed by the Radeon KMS driver. Modified: stable/9/sys/dev/drm2/drm_crtc.h stable/9/sys/dev/drm2/drm_crtc_helper.h stable/9/sys/dev/drm2/i915/intel_crt.c stable/9/sys/dev/drm2/i915/intel_display.c stable/9/sys/dev/drm2/i915/intel_dp.c stable/9/sys/dev/drm2/i915/intel_drv.h stable/9/sys/dev/drm2/i915/intel_hdmi.c stable/9/sys/dev/drm2/i915/intel_lvds.c stable/9/sys/dev/drm2/i915/intel_panel.c stable/9/sys/dev/drm2/i915/intel_sdvo.c stable/9/sys/dev/drm2/i915/intel_tv.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/drm_crtc.h ============================================================================== --- stable/9/sys/dev/drm2/drm_crtc.h Sat Feb 8 10:45:49 2014 (r261630) +++ stable/9/sys/dev/drm2/drm_crtc.h Sat Feb 8 10:57:46 2014 (r261631) @@ -659,7 +659,7 @@ struct drm_mode_config { int min_width, min_height; int max_width, max_height; - struct drm_mode_config_funcs *funcs; + const struct drm_mode_config_funcs *funcs; resource_size_t fb_base; /* output poll support */ Modified: stable/9/sys/dev/drm2/drm_crtc_helper.h ============================================================================== --- stable/9/sys/dev/drm2/drm_crtc_helper.h Sat Feb 8 10:45:49 2014 (r261630) +++ stable/9/sys/dev/drm2/drm_crtc_helper.h Sat Feb 8 10:57:46 2014 (r261631) @@ -51,7 +51,7 @@ struct drm_crtc_helper_funcs { /* Provider can fixup or change mode timings before modeset occurs */ bool (*mode_fixup)(struct drm_crtc *crtc, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode); /* Actually set the mode */ int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode, @@ -78,7 +78,7 @@ struct drm_encoder_helper_funcs { void (*restore)(struct drm_encoder *encoder); bool (*mode_fixup)(struct drm_encoder *encoder, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode); void (*prepare)(struct drm_encoder *encoder); void (*commit)(struct drm_encoder *encoder); Modified: stable/9/sys/dev/drm2/i915/intel_crt.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_crt.c Sat Feb 8 10:45:49 2014 (r261630) +++ stable/9/sys/dev/drm2/i915/intel_crt.c Sat Feb 8 10:57:46 2014 (r261631) @@ -111,7 +111,7 @@ static int intel_crt_mode_valid(struct d } static bool intel_crt_mode_fixup(struct drm_encoder *encoder, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { return true; Modified: stable/9/sys/dev/drm2/i915/intel_display.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_display.c Sat Feb 8 10:45:49 2014 (r261630) +++ stable/9/sys/dev/drm2/i915/intel_display.c Sat Feb 8 10:57:46 2014 (r261631) @@ -3512,7 +3512,7 @@ void intel_encoder_destroy(struct drm_en } static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { struct drm_device *dev = crtc->dev; Modified: stable/9/sys/dev/drm2/i915/intel_dp.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_dp.c Sat Feb 8 10:45:49 2014 (r261630) +++ stable/9/sys/dev/drm2/i915/intel_dp.c Sat Feb 8 10:57:46 2014 (r261631) @@ -224,7 +224,7 @@ intel_dp_max_data_rate(int max_link_cloc static bool intel_dp_adjust_dithering(struct intel_dp *intel_dp, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp)); @@ -676,7 +676,7 @@ intel_dp_i2c_init(struct intel_dp *intel } static bool -intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, +intel_dp_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { struct drm_device *dev = encoder->dev; Modified: stable/9/sys/dev/drm2/i915/intel_drv.h ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_drv.h Sat Feb 8 10:45:49 2014 (r261630) +++ stable/9/sys/dev/drm2/i915/intel_drv.h Sat Feb 8 10:57:46 2014 (r261631) @@ -320,7 +320,7 @@ extern void intel_fixed_panel_mode(struc struct drm_display_mode *adjusted_mode); extern void intel_pch_panel_fitting(struct drm_device *dev, int fitting_mode, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode); extern u32 intel_panel_get_max_backlight(struct drm_device *dev); extern u32 intel_panel_get_backlight(struct drm_device *dev); Modified: stable/9/sys/dev/drm2/i915/intel_hdmi.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_hdmi.c Sat Feb 8 10:45:49 2014 (r261630) +++ stable/9/sys/dev/drm2/i915/intel_hdmi.c Sat Feb 8 10:57:46 2014 (r261631) @@ -318,7 +318,7 @@ static int intel_hdmi_mode_valid(struct } static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { return true; Modified: stable/9/sys/dev/drm2/i915/intel_lvds.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_lvds.c Sat Feb 8 10:45:49 2014 (r261630) +++ stable/9/sys/dev/drm2/i915/intel_lvds.c Sat Feb 8 10:57:46 2014 (r261631) @@ -230,7 +230,7 @@ static inline u32 panel_fitter_scaling(u } static bool intel_lvds_mode_fixup(struct drm_encoder *encoder, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { struct drm_device *dev = encoder->dev; Modified: stable/9/sys/dev/drm2/i915/intel_panel.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_panel.c Sat Feb 8 10:45:49 2014 (r261630) +++ stable/9/sys/dev/drm2/i915/intel_panel.c Sat Feb 8 10:57:46 2014 (r261631) @@ -59,7 +59,7 @@ intel_fixed_panel_mode(struct drm_displa void intel_pch_panel_fitting(struct drm_device *dev, int fitting_mode, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { struct drm_i915_private *dev_priv = dev->dev_private; Modified: stable/9/sys/dev/drm2/i915/intel_sdvo.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_sdvo.c Sat Feb 8 10:45:49 2014 (r261630) +++ stable/9/sys/dev/drm2/i915/intel_sdvo.c Sat Feb 8 10:57:46 2014 (r261631) @@ -924,7 +924,7 @@ static bool intel_sdvo_set_tv_format(str static bool intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo, - struct drm_display_mode *mode) + const struct drm_display_mode *mode) { struct intel_sdvo_dtd output_dtd; @@ -941,7 +941,7 @@ intel_sdvo_set_output_timings_from_mode( static bool intel_sdvo_set_input_timings_for_mode(struct intel_sdvo *intel_sdvo, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { /* Reset the input timing to the screen. Assume always input 0. */ @@ -964,7 +964,7 @@ intel_sdvo_set_input_timings_for_mode(st } static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { struct intel_sdvo *intel_sdvo = to_intel_sdvo(encoder); Modified: stable/9/sys/dev/drm2/i915/intel_tv.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_tv.c Sat Feb 8 10:45:49 2014 (r261630) +++ stable/9/sys/dev/drm2/i915/intel_tv.c Sat Feb 8 10:57:46 2014 (r261631) @@ -846,7 +846,7 @@ intel_tv_mode_valid(struct drm_connector static bool -intel_tv_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, +intel_tv_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { struct drm_device *dev = encoder->dev; From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 8 11:05:48 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94459498; Sat, 8 Feb 2014 11:05:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F72611C9; Sat, 8 Feb 2014 11:05:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18B5mgE041628; Sat, 8 Feb 2014 11:05:48 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18B5mP4041627; Sat, 8 Feb 2014 11:05:48 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201402081105.s18B5mP4041627@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 8 Feb 2014 11:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261632 - stable/9/sys/dev/drm2 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 11:05:48 -0000 Author: dumbbell Date: Sat Feb 8 11:05:48 2014 New Revision: 261632 URL: http://svnweb.freebsd.org/changeset/base/261632 Log: MFC r254798: drm: Fix leak of connector->edid_blob_ptr Modified: stable/9/sys/dev/drm2/drm_crtc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/drm_crtc.c ============================================================================== --- stable/9/sys/dev/drm2/drm_crtc.c Sat Feb 8 10:57:46 2014 (r261631) +++ stable/9/sys/dev/drm2/drm_crtc.c Sat Feb 8 11:05:48 2014 (r261632) @@ -170,6 +170,9 @@ static struct drm_prop_enum_list drm_enc { DRM_MODE_ENCODER_TVDAC, "TV" }, }; +static void drm_property_destroy_blob(struct drm_device *dev, + struct drm_property_blob *blob); + char *drm_get_encoder_name(struct drm_encoder *encoder) { static char buf[32]; @@ -520,6 +523,8 @@ void drm_connector_cleanup(struct drm_co drm_mode_remove(connector, mode); sx_xlock(&dev->mode_config.mutex); + if (connector->edid_blob_ptr) + drm_property_destroy_blob(dev, connector->edid_blob_ptr); drm_mode_object_put(dev, &connector->base); list_del(&connector->head); dev->mode_config.num_connector--; From owner-svn-src-stable-9@FreeBSD.ORG Sat Feb 8 15:51:42 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 985CFCE0; Sat, 8 Feb 2014 15:51:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 82B5C1674; Sat, 8 Feb 2014 15:51:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18Fpgkb055550; Sat, 8 Feb 2014 15:51:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18FpgRY055549; Sat, 8 Feb 2014 15:51:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201402081551.s18FpgRY055549@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 8 Feb 2014 15:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261637 - stable/9/lib/libthr/thread X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 15:51:42 -0000 Author: kib Date: Sat Feb 8 15:51:42 2014 New Revision: 261637 URL: http://svnweb.freebsd.org/changeset/base/261637 Log: MFC r261354: In _pthread_kill(), if passed pthread is current thread, do not send the signal second time, by adding the missed else before if statement. PR: threads/186309 Modified: stable/9/lib/libthr/thread/thr_kill.c Directory Properties: stable/9/lib/libthr/ (props changed) Modified: stable/9/lib/libthr/thread/thr_kill.c ============================================================================== --- stable/9/lib/libthr/thread/thr_kill.c Sat Feb 8 15:51:24 2014 (r261636) +++ stable/9/lib/libthr/thread/thr_kill.c Sat Feb 8 15:51:42 2014 (r261637) @@ -42,24 +42,27 @@ __weak_reference(_pthread_kill, pthread_ int _pthread_kill(pthread_t pthread, int sig) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; int ret; /* Check for invalid signal numbers: */ if (sig < 0 || sig > _SIG_MAXSIG) /* Invalid signal: */ - ret = EINVAL; + return (EINVAL); + + curthread = _get_curthread(); + /* * Ensure the thread is in the list of active threads, and the * signal is valid (signal 0 specifies error checking only) and * not being ignored: */ - else if (curthread == pthread) { + if (curthread == pthread) { if (sig > 0) _thr_send_sig(pthread, sig); ret = 0; - } if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0)) - == 0) { + } else if ((ret = _thr_find_thread(curthread, pthread, + /*include dead*/0)) == 0) { if (sig > 0) _thr_send_sig(pthread, sig); THR_THREAD_UNLOCK(curthread, pthread);