From owner-freebsd-stable@FreeBSD.ORG Mon Mar 24 18:09:23 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 359561065678 for ; Mon, 24 Mar 2008 18:09:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 371F08FC1C for ; Mon, 24 Mar 2008 18:09:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8s) with ESMTP id 236586105-1834499 for multiple; Mon, 24 Mar 2008 14:10:42 -0400 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m2OI9DAa065041; Mon, 24 Mar 2008 14:09:13 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-stable@freebsd.org Date: Mon, 24 Mar 2008 14:07:24 -0400 User-Agent: KMail/1.9.7 References: <47E7D003.3070009@incunabulum.net> In-Reply-To: <47E7D003.3070009@incunabulum.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803241407.24749.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 24 Mar 2008 14:09:13 -0400 (EDT) X-Virus-Scanned: ClamAV 0.91.2/6368/Mon Mar 24 10:14:22 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Bruce M Simpson , nsouch@freebsd.org Subject: Re: lpbb broken in 6.x? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2008 18:09:23 -0000 On Monday 24 March 2008 12:00:03 pm Bruce M Simpson wrote: > Hi, > > Just for giggles, I decided to solder up the circuit in lpbb(4) and try > to use it to talk to a 24LC64 EEPROM with its i2c address set to 0. > (Yes, I am using 74LS05s specifically for this circuit.) > > Imagine my surprise and dismay, when I try to test out the i2c bus using > this tool: > http://www.ricin.com/freebsd/kbtv/kbtv-1.1.3/saa/saa/support/scan_i2c.c > > ...and keep seeing this on the console, presumably whenever scan_i2c > issues an iic(4) ioctl: > lpbb0: can't allocate ppbus > > I made sure that no other devices were attached to ppbus0. Voltages on > the port and the bus looked sane... SCL and SDA stable below 0.1V, > nothing floating, good solid +5V on the supply rail using a 7805 > regulator on a 9V battery to avoid any nasty current surprises -- I > haven't fried my laptop's LPT port. > > Initially I had ppi loaded as well, I booted a clean kernel and loaded > lpbb from the loader: > > Mar 24 15:40:39 empiric kernel: lpbb0: interface> on ppbus0 > Mar 24 15:40:39 empiric kernel: iicbb0: on lpbb0 > Mar 24 15:40:39 empiric kernel: iicbus0: on iicbb0 > master-only > Mar 24 15:41:10 empiric kernel: iic0: on iicbus0 > Mar 24 15:41:10 empiric kernel: iic1: on iicbus0 > > Not sure why iic attaches twice to the iicbus created by lpbb. > > However, I still got the same message when I re-ran scan_i2c: > > Mar 24 15:41:19 empiric kernel: lpbb0: can't allocate ppbus > Mar 24 15:41:55 empiric last message repeated 1020 times > > There are real uses for this code, so I'm wondering, what's wrong with lpbb? > > Does lpbb explicitly require hints to be told where to attach? > IMO it shouldn't, it already seems to attach to the first ppbus instance > in the system. > > If I get free time otherwise, I'll try to investigate further. What other devices do you have on your ppbus? Do you have lpt0, etc.? Are your running lpd? The way that ppbus works is that only one child driver (ppi0, lpt0, etc.) can "own" the actual ppc device at a time, so when a child driver wants to do something, it requests ownership of the bus first. You need to find out which other child driver owns the bus. -- John Baldwin