From owner-freebsd-current@FreeBSD.ORG Mon Mar 20 18:55:53 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD52A16A41F for ; Mon, 20 Mar 2006 18:55:53 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA33243D5C for ; Mon, 20 Mar 2006 18:55:45 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id k2KIsLL6094419; Mon, 20 Mar 2006 11:54:26 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 20 Mar 2006 11:54:38 -0700 (MST) Message-Id: <20060320.115438.97293590.imp@bsdimp.com> To: anderson@centtech.com From: "M. Warner Losh" In-Reply-To: <441ED6F2.3020504@centtech.com> References: <441ED31B.6030500@centtech.com> <20060320.091339.133982805.imp@bsdimp.com> <441ED6F2.3020504@centtech.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Mon, 20 Mar 2006 11:54:26 -0700 (MST) Cc: freebsd-current@freebsd.org Subject: Re: Seagate 4GB CF drive in pccard slot won't work X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Mar 2006 18:55:53 -0000 In message: <441ED6F2.3020504@centtech.com> Eric Anderson writes: : M. Warner Losh wrote: : > In message: <441ED31B.6030500@centtech.com> : > Eric Anderson writes: : > : M. Warner Losh wrote: : > : > In message: <441EBC32.2070508@centtech.com> : > : > Eric Anderson writes: : > : > : Warner Losh wrote: : > : > : >> I'm running the latest 6.1-*, and inserting a cf->pccard reader with a : > : > : >> 4GB seagate cf drive installed gives me these messages: : > : > : >> : > : > : >> cbb0: ready never happened, status = 0d : > : > : >> pcib3: pccard0 requested memory range 0xdfb00000-0xdfbfffff: good : > : > : >> pccard0: Card has no functions! : > : > : >> cbb0: PC Card card activation failed : > : > : >> : > : > : > : > : > : > Something bad happened on the way to the forum... Please set : > : > : > hw.cbb.debug=1 and hw.pccard.debug=1 and try again. : > : > : > : > : > : : > : > : Here's the latest snippet from /var/log/messages with those two set: : > : > : : > : > : Mar 20 08:27:47 neutrino kernel: Status is 0x30001911 : > : > : Mar 20 08:27:47 neutrino kernel: cbb0: card inserted: event=0x00000000, : > : > : state=30001911 : > : > : Mar 20 08:27:47 neutrino kernel: pccard0: chip_socket_enable : > : > : Mar 20 08:27:47 neutrino kernel: cbb_pcic_socket_enable: : > : > : Mar 20 08:27:47 neutrino kernel: cbb0: cbb_power: 2V : > : > : Mar 20 08:27:47 neutrino kernel: cbb0: ready never happened, status = 0d : > : > : Mar 20 08:27:47 neutrino kernel: pccard0: read_cis : > : > : Mar 20 08:27:47 neutrino kernel: pcib3: pccard0 requested memory range : > : > : 0xdfb00000-0xdfbfffff: good : > : > : Mar 20 08:27:47 neutrino kernel: pccard0: check_cis_quirks : > : > : Mar 20 08:27:47 neutrino kernel: pccard0: Card has no functions! : > : > : Mar 20 08:27:47 neutrino kernel: cbb0: PC Card card activation failed : > : > : : > : > : : > : > : Anything else I can provide? : > : > : : > : > : Also - when inserting this card in the slot, my system freezes for about : > : > : 5-6 seconds. : > : > : > : > hw.pccard.cis_debug=1 may help. : > : > : > : > The 2V cbb power looks very wrong, however... : > : > : > : > Warner : > : > : > : : > : Here's what I get with that enabled: : > : : > : Mar 20 10:06:16 neutrino kernel: Status is 0x30001911 : > : Mar 20 10:06:16 neutrino kernel: cbb0: card inserted: event=0x00000000, : > : state=30001911 : > : Mar 20 10:06:16 neutrino kernel: pccard0: chip_socket_enable : > : Mar 20 10:06:16 neutrino kernel: cbb_pcic_socket_enable: : > : Mar 20 10:06:16 neutrino kernel: cbb0: cbb_power: 2V : > : Mar 20 10:06:16 neutrino kernel: cbb0: ready never happened, status = 0d : > : Mar 20 10:06:16 neutrino kernel: pccard0: read_cis : > : Mar 20 10:06:16 neutrino kernel: pcib3: pccard0 requested memory range : > : 0xdfb00000-0xdfbfffff: good : > : Mar 20 10:06:16 neutrino kernel: cis mem map 0xe7642000 (resource: : > : 0xdfb10000) : > : Mar 20 10:06:16 neutrino kernel: pccard0: CIS tuple chain: : > : Mar 20 10:06:16 neutrino kernel: CISTPL_END : > : Mar 20 10:06:16 neutrino kernel: ff : > : Mar 20 10:06:16 neutrino kernel: cis mem map e7642000 : > : Mar 20 10:06:16 neutrino kernel: CISTPL_LINKTARGET expected, code ff : > : observed : > : Mar 20 10:06:16 neutrino kernel: pccard0: check_cis_quirks : > : Mar 20 10:06:16 neutrino kernel: pccard0: Card has no functions! : > : Mar 20 10:06:16 neutrino kernel: cbb0: PC Card card activation failed : > : : > : : > : Thanks for the quick reply! : > : > Based on what you've provided, here's my current theory of the crime: : > : > (1) The card is inserted. : > (2) The bridge somehow thinks it is a X.X V card. It reports this as : > 2V in the dmesg because I arbitarily assigned numbers to X and Y. : > (3) There's two ways this can happen. One: is that new cards have been : > released that implement this standard and your bridge is detecting : > it, but either the card or bridge fails to implement it : > correctly. Two: There is a problem with the bridge's memory : > allocation, so the cbb driver is really talking to something : > else. Three: the bridge has a bug in detecting X.X V cards and : > they should be ignored. : > : > I'm guessing 'Three' is most likely. How's your hacking skills? : > : : :) well, I'm really good at breaking things. Point in the direction, : and I'll start looking. Try apply the following (you'll have to do it by hand). This turns off the XV and YV bits always. This code is src/sys/dev/pccbb/pccbb.c Warner static int cbb_do_power(device_t brdev) { struct cbb_softc *sc = device_get_softc(brdev); uint32_t voltage, curpwr; uint32_t status; /* Don't enable OE (output enable) until power stable */ exca_clrb(&sc->exca[0], EXCA_PWRCTL, EXCA_PWRCTL_OE); - voltage = cbb_detect_voltage(brdev); + voltage = cbb_detect_voltage(brdev) & ~(CARD_XV_CARD | CARD_YV_CARD); curpwr = cbb_current_voltage(brdev); status = cbb_get(sc, CBB_SOCKET_STATE); if ((status & CBB_STATE_POWER_CYCLE) && (voltage & curpwr)) return 0; /* Prefer lowest voltage supported */ cbb_power(brdev, CARD_OFF); if (voltage & CARD_YV_CARD) cbb_power(brdev, CARD_VCC(YV)); else if (voltage & CARD_XV_CARD) cbb_power(brdev, CARD_VCC(XV)); else if (voltage & CARD_3V_CARD) cbb_power(brdev, CARD_VCC(3)); else if (voltage & CARD_5V_CARD) cbb_power(brdev, CARD_VCC(5)); else { device_printf(brdev, "Unknown card voltage\n"); return (ENXIO); } return (0); }