From: Chris Ball <cjb@laptop.org>
To: "Jennifer Li (TP)" <Jennifer.Li@o2micro.com>
Cc: linux-mmc@vger.kernel.org, Mario_Limonciello@Dell.com,
Joseph_Yeh@Dell.com, Chris Van Hoof <vanhoof@canonical.com>,
Rezwanul_Kabir@Dell.com,
"Shirley Her (SC)" <shirley.her@o2micro.com>,
"Rich Lin (TP)" <RichLin@o2micro.com>,
"Samuel Guan(WH)" <samuel.guan@o2micro.com>,
"Hardys Lv(WH)" <hardys.lv@o2micro.com>,
"William Lian (TP)" <William.Lian@o2micro.com>
Subject: Re: [PATCH 2.6.32]: Add new device IDs and registers forMULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) cards.
Date: Thu, 18 Nov 2010 04:15:59 +0000 [thread overview]
Message-ID: <20101118041559.GE23555@void.printf.net> (raw)
In-Reply-To: <FC57104DF444434A9D1D8A7B4EBB292307D13E8A@HC-EXCHANGE.nt-fsrvr.o2micro.com>
Hi Jennifer,
This is looking better, thanks -- just a few more questions:
On Tue, Nov 16, 2010 at 02:05:16PM +0800, Jennifer Li (TP) wrote:
> Root cause:
> O2Micro's ADMA and related functions can't work by default Linux SD
> driver. We need mark those related registers.
If the goal is to disable ADMA, have you tried using the BROKEN_ADMA
quirk? Like this:
static const struct sdhci_pci_fixes sdhci_o2 = {
.probe = o2_probe,
.quirks = SDHCI_QUIRK_BROKEN_ADMA,
};
If you do this, do you still need to perform the PCI writes?
> + ret = pci_read_config_byte(chip->pdev, O2_SDMMC_MULTI_VCC3V, &scratch);
> + if (ret)
> + return ret;
> +
> + scratch = 0x08;
> + ret = pci_write_config_byte(chip->pdev, O2_SDMMC_MULTI_VCC3V, scratch);
Here you read in a value to scratch, but then you go ahead and write
0x08 to the register regardless. We can skip the read here, right?
> + ret = pci_read_config_byte(chip->pdev, O2_SDMMC_CAPABILITIES, &scratch);
> + if (ret)
> + return ret;
> +
> + scratch |= 0x01;
> + ret = pci_write_config_byte(chip->pdev, O2_SDMMC_CAPABILITIES, scratch);
> +
> + ret = pci_read_config_byte(chip->pdev, O2_SDMMC_CAPABILITIES, &scratch);
> + if (ret)
> + return ret;
> +
> + scratch = 0x73;
> + ret = pci_write_config_byte(chip->pdev, O2_SDMMC_CAPABILITIES, scratch);
Here you write a value to O2_SDMMC_CAPABILITIES that's dependent on the
read value, but then after that you immediately overwrite the register
with 0x73 regardless of what was in it before. Why perform the first
read-and-write cycle and the second read, if you're just going to write
0x73 in the end?
> +
> + ret = pci_read_config_byte(chip->pdev, O2_SDMMC_ADMA1, &scratch);
> + if (ret)
> + return ret;
> +
> + scratch = 0x39;
> + ret = pci_write_config_byte(chip->pdev, O2_SDMMC_ADMA1, scratch);
> +
> + ret = pci_read_config_byte(chip->pdev, O2_SDMMC_ADMA2, &scratch);
> + if (ret)
> + return ret;
> +
> + scratch = 0x08;
> + ret = pci_write_config_byte(chip->pdev, O2_SDMMC_ADMA2, scratch);
Same as above -- if the write isn't dependent on the read, I don't see
why to bother with the read. Also, you can avoid assigning the return
value of pci_write_config_byte() to "ret" now that we aren't testing that.
> Signed-off-by: Jennifer Li Developer <Jennifer.li@o2micro.com>
I don't think "Developer" should be here, since the text should just be
your name.
Thanks,
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
next prev parent reply other threads:[~2010-11-18 4:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-16 6:05 [PATCH 2.6.32]: Add new device IDs and registers forMULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) cards Jennifer Li (TP)
2010-11-18 4:15 ` Chris Ball [this message]
2010-11-22 7:58 ` [PATCH 2.6.32]: Add new device IDs and registers forMULTIMEDIACARD " Jennifer Li (TP)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101118041559.GE23555@void.printf.net \
--to=cjb@laptop.org \
--cc=Jennifer.Li@o2micro.com \
--cc=Joseph_Yeh@Dell.com \
--cc=Mario_Limonciello@Dell.com \
--cc=Rezwanul_Kabir@Dell.com \
--cc=RichLin@o2micro.com \
--cc=William.Lian@o2micro.com \
--cc=hardys.lv@o2micro.com \
--cc=linux-mmc@vger.kernel.org \
--cc=samuel.guan@o2micro.com \
--cc=shirley.her@o2micro.com \
--cc=vanhoof@canonical.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.