From owner-freebsd-mobile@FreeBSD.ORG Sun Feb 1 12:32:28 2009 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 240AE1065670; Sun, 1 Feb 2009 12:32:28 +0000 (UTC) (envelope-from henry.hu.sh@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.29]) by mx1.freebsd.org (Postfix) with ESMTP id BFE678FC1E; Sun, 1 Feb 2009 12:32:27 +0000 (UTC) (envelope-from henry.hu.sh@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so439321yxb.13 for ; Sun, 01 Feb 2009 04:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=4mTnP7Cs6mABe0O4j+v/alYG1kBA+AhSHe/CwIRfQog=; b=iuh8u0upcCAWH4gqwMmiSEDKbCACozyEGA2dnuyhZpFdBCEn34A7oWQN0GurmWgjVo IbCNRgqFbfpT7/2FZ98DWl78RGsnRPnT1Z62SY0y0PIxUHLMErbiT9B79W7dhPEl6+2o aVjimglf8iHm/LYPt/VyRNd6Fbj3jJwUILS/Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; b=NhVyt9By0FxXCOjFcIgkfFafGPd/flG7PcjOWC7LACd2GMnAZzGL1Jo8A7Srp51tWE oowhVxElGGvSN7dhqa8VgVw7i5ir+Ekx9AoFJ+A7n6rUsLcHpwxlSrubu5Loz2NtNVcU 3lzAghmJ6PhsV38BWHlKQfq5Ld0++27Riheos= MIME-Version: 1.0 Received: by 10.100.13.6 with SMTP id 6mr2187815anm.9.1233491546364; Sun, 01 Feb 2009 04:32:26 -0800 (PST) In-Reply-To: <49857482.5080508@FreeBSD.org> References: <53a1e0710901311949x3b853404oe89cf2ae9a0903f7@mail.gmail.com> <49857482.5080508@FreeBSD.org> Date: Sun, 1 Feb 2009 20:32:25 +0800 Message-ID: <53a1e0710902010432j49111ecey8d9a93acfbe3c64d@mail.gmail.com> From: Henry Hu To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-mobile@freebsd.org Subject: Re: Problem about the new sdhci driver X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: hu.henry9@gmail.com List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2009 12:32:28 -0000 After doing more experiments, I found the cause: hw.pci.do_power_resume=3 If I set it to 0 and load the driver, it works well with and without the card. If I set it to 3 and load the driver, then 1. If the card is present, then it would detect the card and the disk shows up. If I remove the card and insert it again, it cannot detect it again. And if I unload the driver now and reload it with the card, it cannot detect the card and it cannot detect card insertion / removal. 2. If the card is not present, then it cannot detect the card, and if I remove the card and insert it again, nothing happens. The 0x01fa0000 state is normal: I found that the detection of write-protection is independent from card detection. If I pull the card out completely, the present register is 0x01f20000. If I pull the card out half-way, the present register is 0x01fa000, the write-protection bit is 1 and the card-present bit is 0... So the problem is about power states, not the driver, and no patch is needed. Since I rarely use the card reader when the laptop is using battery, I decided to remove it from sysctl .conf .... Thanks for the help. Good driver! Cheers, Henry On Sun, Feb 1, 2009 at 6:08 PM, Alexander Motin wrote: > Henry Hu wrote: >> >> I'm using FreeBSD 7-STABLE, with sdhci driver >> sdhci.20081029.tgz >> mmc.20081029.tgz >> >> I've found that if I load sdhci driver with card inserted, everything >> works fine. >> But if I load sdhci driver first, and then insert card, the card is >> not detected.Additionally, there is no interrupt. >> After I've load sdhci driver without card, the controller seems to be >> in a problematic state. The register dump outputed when the driver >> loaded showed that Present is 0x01f20000 which is correct since the >> card is not inserted then. But cards is not detected. >> Even if I unload the driver and reload with card inserted, the card >> still cannot be detected, and there's no interrupt. But the Present >> register changed to 0x01fa0000 which is strange. >> >> So I guess there's something wrong with the driver when the card is not >> present. >> >> sdhci0: mem 0xf0401000-0xf04010ff irq 18 at device 9.1 >> on pci5 >> sdhci0-slot0: 33MHz 4bits 3.3V DMA >> sdhci0-slot0: ============== REGISTER DUMP ============== >> sdhci0-slot0: Sys addr: 0x00000000 | Version: 0x00000200 >> sdhci0-slot0: Blk size: 0x00000000 | Blk cnt: 0x00000000 >> sdhci0-slot0: Argument: 0x00000000 | Trn mode: 0x00000000 >> sdhci0-slot0: Present: 0x01f20000 | Host ctl: 0x00000000 >> sdhci0-slot0: Power: 0x00000000 | Blk gap: 0x00000000 >> sdhci0-slot0: Wake-up: 0x00000000 | Clock: 0x00000000 >> sdhci0-slot0: Timeout: 0x0000000c | Int stat: 0x00000000 >> sdhci0-slot0: Int enab: 0x01ff00fb | Sig enab: 0x01ff00fb >> sdhci0-slot0: AC12 err: 0x00000000 | Slot int: 0x00000000 >> sdhci0-slot0: Caps: 0x01c021a1 | Max curr: 0x00000040 >> sdhci0-slot0: =========================================== > > Try this patch please: > --- sdhci.c.prev 2009-01-29 00:53:41.000000000 +0200 > +++ sdhci.c 2009-02-01 11:58:42.000000000 +0200 > @@ -82,7 +82,8 @@ static const struct sdhci_device { > u_int quirks; > } sdhci_devices[] = { > { 0x08221180, 0xffff, "RICOH R5C822 SD", > - SDHCI_QUIRK_FORCE_DMA }, > + SDHCI_QUIRK_FORCE_DMA | > + SDHCI_QUIRK_NO_CARD_NO_RESET }, > { 0x8034104c, 0xffff, "TI XX21/XX11 SD", > SDHCI_QUIRK_FORCE_DMA }, > { 0x05501524, 0xffff, "ENE CB712 SD", > > > Could everybody having this controller send me pciconf and Version register > from their controller and report me is this bug present on their system? I > would like to collect some statistics. > > -- > Alexander Motin > _______________________________________________ > freebsd-mobile@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mobile > To unsubscribe, send any mail to "freebsd-mobile-unsubscribe@freebsd.org" >