Re: Problem about the new sdhci driver
Henry Hu <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.mobile |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> 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: <RICOH R5C822 SD> 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 > _______________________________________________ > [email protected] mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mobile > To unsubscribe, send any mail to "[email protected]" > _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-mobile To unsubscribe, send any mail to "[email protected]"