From owner-freebsd-bugs@FreeBSD.ORG Sat Oct 28 13:50:18 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A8E1316A415 for ; Sat, 28 Oct 2006 13:50:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id F186543D5D for ; Sat, 28 Oct 2006 13:50:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k9SDoHYX040289 for ; Sat, 28 Oct 2006 13:50:17 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k9SDoHG6040288; Sat, 28 Oct 2006 13:50:17 GMT (envelope-from gnats) Resent-Date: Sat, 28 Oct 2006 13:50:17 GMT Resent-Message-Id: <200610281350.k9SDoHG6040288@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, usleepless Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EE2C516A412 for ; Sat, 28 Oct 2006 13:45:59 +0000 (UTC) (envelope-from usleepless@gmail.com) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) by mx1.FreeBSD.org (Postfix) with SMTP id 0149643D81 for ; Sat, 28 Oct 2006 13:45:53 +0000 (GMT) (envelope-from usleepless@gmail.com) Received: (qmail 31757 invoked from network); 28 Oct 2006 13:45:52 -0000 Received: from unknown (HELO ?HOSTNAME?) (unknown) by unknown with SMTP; 28 Oct 2006 13:45:52 -0000 Received: by _HOSTNAME_ (sSMTP sendmail emulation); Sat, 28 Oct 2006 15:45:51 +0200 Message-Id: <20061028134553.0149643D81@mx1.FreeBSD.org> Date: Sat, 28 Oct 2006 15:45:51 +0200 From: "usleepless" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/104882: pvr250 and pvrxxx drivers need iicbb patched X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: usleepless List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Oct 2006 13:50:18 -0000 >Number: 104882 >Category: kern >Synopsis: pvr250 and pvrxxx drivers need iicbb patched >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Oct 28 13:50:17 GMT 2006 >Closed-Date: >Last-Modified: >Originator: usleepless >Release: FreeBSD 6.1-RELEASE-p10 i386 >Organization: none >Environment: System: FreeBSD x.y.z 6.1-RELEASE-p10 FreeBSD 6.1-RELEASE-p10 #18: Thu Oct 26 12:53:20 CEST 2006 usleepless@x.y.z:/usr/obj/usr/src/sys/CUSTOM_FBSD6 i386 >Description: The multimedia/pvr250 and multimedia/pvrxxx drivers need the kernel patched to function properly. This is confusing for not so savvy users, and an annoyance for others ( for example when updating your system, you will have to go through this again ). As far as i have been able to verify, this patch does not cause any harm to other iicbb users ( bktr for example ). >How-To-Repeat: Install multimedia/pvr250 or multimedia/pvrxxx >Fix: Please see attached patch ( which applies cleanly for 6.x as well ) --- Patch.iicbb-fbsd5 begins here --- *** dev/iicbus/iicbb.c.ORIGINAL Sun Aug 24 13:49:13 2003 --- dev/iicbus/iicbb.c Fri Jul 1 15:55:21 2005 *************** struct iicbb_softc { *** 66,71 **** --- 66,72 ---- static int iicbb_probe(device_t); static int iicbb_attach(device_t); static int iicbb_detach(device_t); + static void iicbb_child_detached(device_t, device_t); static int iicbb_print_child(device_t, device_t); static int iicbb_callback(device_t, int, caddr_t); *************** static device_method_t iicbb_methods[] = *** 82,87 **** --- 83,89 ---- DEVMETHOD(device_detach, iicbb_detach), /* bus interface */ + DEVMETHOD(bus_child_detached, iicbb_child_detached), DEVMETHOD(bus_print_child, iicbb_print_child), /* iicbus interface */ *************** static int iicbb_attach(device_t dev) *** 130,144 **** static int iicbb_detach(device_t dev) { struct iicbb_softc *sc = (struct iicbb_softc *)device_get_softc(dev); ! if (sc->iicbus) { ! bus_generic_detach(dev); ! device_delete_child(dev, sc->iicbus); ! } return (0); } static int iicbb_print_child(device_t bus, device_t dev) { --- 132,165 ---- static int iicbb_detach(device_t dev) { struct iicbb_softc *sc = (struct iicbb_softc *)device_get_softc(dev); + device_t child; ! /* ! * Detach the children before recursively deleting ! * in case a child has a pointer to a grandchild ! * which is used by the child's detach routine. ! * ! * Remember the child before detaching so we can ! * delete it (bus_generic_detach indirectly zeroes ! * sc->child_dev). ! */ ! child = sc->iicbus; ! bus_generic_detach(dev); ! if (child) ! device_delete_child(dev, child); return (0); } + static void + iicbb_child_detached( device_t dev, device_t child ) + { + struct iicbb_softc *sc = (struct iicbb_softc *)device_get_softc(dev); + + if (child == sc->iicbus) + sc->iicbus = NULL; + } + static int iicbb_print_child(device_t bus, device_t dev) { *************** static int iicbb_read(device_t dev, char *** 383,388 **** --- 404,410 ---- } DRIVER_MODULE(iicbb, bktr, iicbb_driver, iicbb_devclass, 0, 0); + DRIVER_MODULE(iicbb, cxm_iic, iicbb_driver, iicbb_devclass, 0, 0); DRIVER_MODULE(iicbb, lpbb, iicbb_driver, iicbb_devclass, 0, 0); DRIVER_MODULE(iicbb, viapm, iicbb_driver, iicbb_devclass, 0, 0); *** dev/iicbus/iicbus_if.m.ORIGINAL Wed Apr 13 14:25:01 2005 --- dev/iicbus/iicbus_if.m Mon Oct 24 00:51:05 2005 *************** METHOD int read { *** 90,96 **** # METHOD int write { device_t dev; ! char *buf; int len; int *bytes; int timeout; --- 90,96 ---- # METHOD int write { device_t dev; ! const char *buf; int len; int *bytes; int timeout; *** dev/iicbus/iiconf.h.ORIGINAL Wed Jun 16 22:51:57 2004 --- dev/iicbus/iiconf.h Mon Oct 24 00:43:41 2005 *************** extern int iicbus_started(device_t); *** 114,120 **** extern int iicbus_start(device_t, u_char, int); extern int iicbus_stop(device_t); extern int iicbus_repeated_start(device_t, u_char, int); ! extern int iicbus_write(device_t, char *, int, int *, int); extern int iicbus_read(device_t, char *, int, int *, int, int); /* single byte read/write functions, start/stop not managed */ --- 114,120 ---- extern int iicbus_start(device_t, u_char, int); extern int iicbus_stop(device_t); extern int iicbus_repeated_start(device_t, u_char, int); ! extern int iicbus_write(device_t, const char *, int, int *, int); extern int iicbus_read(device_t, char *, int, int *, int, int); /* single byte read/write functions, start/stop not managed */ *** dev/iicbus/iiconf.c.ORIGINAL Wed Jun 16 22:51:57 2004 --- dev/iicbus/iiconf.c Mon Oct 24 00:47:32 2005 *************** iicbus_stop(device_t bus) *** 234,240 **** * iicbus_start() call */ int ! iicbus_write(device_t bus, char *buf, int len, int *sent, int timeout) { struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus); --- 234,240 ---- * iicbus_start() call */ int ! iicbus_write(device_t bus, const char *buf, int len, int *sent, int timeout) { struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus); --- Patch.iicbb-fbsd5 ends here --- >Release-Note: >Audit-Trail: >Unformatted: