From: Tony Olech <tony.olech@elandigitalsystems.com>
To: David Vrabel <david.vrabel@csr.com>
Cc: Chris Ball <cjb@laptop.org>, linux-mmc@vger.kernel.org
Subject: Re: [PATCH] mmc: USB SDIO/SD/MMC Host Controller (VUB300) driver
Date: Thu, 20 Jan 2011 16:11:25 +0000 [thread overview]
Message-ID: <1295539885.9794.50.camel@apple-mac> (raw)
In-Reply-To: <4D25C0DA.4040204@csr.com>
Hi,
the answers to your questions and comments are embedded below.
Because a few changes in the patch are required and also because
the current kernel version is now 2.6.27 I am re-doing the patch
and it will be included in a second e-mail by itself.
Tony Olech
Elan Digital Systems Limited
On Thu, 2011-01-06 at 13:17 +0000, David Vrabel wrote:
> I've not given this driver a detailed review, just skimmed it and
> noticed a few things.
> Tony Olech wrote:
> > + Some SDIO cards will need a firmware file to be loaded and
> > + sent to VUB300 chip in order to achieve better data throughput.
> > + Download these "Offload Pseudocode" from Elan Digital Systems'
> > + web-site http://www.elandigitalsystems.com/support/downloads.php
> > + and put them in /lib/firmware. Note that without these additional
> > + firmware files the VUB300 chip will still function, but not at
> > + the best obtainable data rate.
> It would be useful to document (in the driver) what this "offload
> pseudocode" does. Looking at the driver it looks like it's pre-fetching
> SDIO register values, yes?
Yes it does does pre-fetch and pre-set some register values.
At this point in time the only available documentation is
the interface document referred to in a previous e-mail which
can be downloaded from:
www.elandigitalsystems.com/eng/drivers/vub300/Linux-v2-10.zip
> > +#pragma pack(1)
> You probably want __attribute__((packed)) on each structure here. (Not
> sure if GCC even supports this #pragma).
Thank you for this comment. I have changed the patch accordingly.
> > +static DEVICE_ATTR(OperatingMode, S_IRUGO, show_OperatingMode, NULL);
> > +static struct attribute *vub300_attrs[] = {
> > + &dev_attr_OperatingMode.attr,
> > + NULL,
> > +};
> Suggest removing this unless it's actually useful. If it is useful, it
> should use all lower case for the name and it should be documented in
> Documentation/ABI.
This sysfs interface is a very useful read-only diagnostic and
will enable us to support customers. In particular it identifies
the SDIO bus speed actually being used as well as the identity
of the offload pseudocode firmware file, if any, that has
been downloaded into the VUB300 adapter. I have modified the
patch to use lower case for the sysfs file name (even though
other sysfs users use camel case) and have added documentation
as requested.vub300->irqs_queued
> > +static void snoop_block_size_and_bus_width(struct vub300_mmc_host *vub300,
> > + u32 cmd_arg)
> This doesn't seem necessary. The block size is available in the datavub300->irqs_queued
> request and the bus width is supplied to the set_ios() call.
Unfortunately you are incorrect in your assertion.
The "block size" given in the data request is NOT
ALWAYS equal to the function block size. Therefore
the snooping of the function block size must remain.
> > + if (6 == cmd->opcode) {
> > + ResponseType = SDRT_1;
> > + vub300->resp_len = 6;
> You don't need to check the opcode to determine the response format. Seevub300->irqs_queued
> cmd->flags.
Unfortunately you are incorrect in your assertion.
It is impossible, for example, from a flag setting
of 0x15 to determine whether a response type of
R5, R6 or R7 is to be expected. Therefore the
snooping of the opcode must remain.
> > +static void vub300_enable_sdio_irq(struct mmc_host *mmc, int enable)
> > +{ /* NOT irq */
> > + struct vub300_mmc_host *vub300 = mmc_priv(mmc);vub300->irqs_queued
> > + if (!vub300->interface)
> > + return;
> > + kref_get(&vub300->kref);
> > + if (enable) {vub300->irqs_queued
> > + mutex_lock(&vub300->irq_mutex);
> > + if (vub300->irqs_queued) {
> > + vub300->irqs_queued -= 1;
> > + mmc_signal_sdio_irq(vub300->mmc);
> This might signal a spurious interrupt as it's not checking if the
> interrupt is still asserted. This should be avoided.
You are correct in your implied assertion that spurious
interrupts cause havoc and ultimately failure in the
operation of the device. However this code segment is
absolutely required for the correct operation of our
offload processing. The key thing to note is that the
variable vub300->irqs_queued prevents spurious interrupts.
> David
next prev parent reply other threads:[~2011-01-20 16:11 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20B0EAA71DD7413A9A29D0493C6C1D87@AN00536>
[not found] ` <20101116150022.GA27726@void.printf.net>
[not found] ` <27884BED0E3C489C8849EE12A803F536@AN00536>
[not found] ` <m3oc9pnt6g.fsf@pullcord.laptop.org>
[not found] ` <4CE41BE3.1060806@elandigitalsystems.com>
[not found] ` <m3oc9n241c.fsf@pullcord.laptop.org>
2010-11-22 15:05 ` [PATCH] mmc: USB SDIO/SD/MMC Host Controller (VUB300) driver Tony Olech
2010-11-30 6:15 ` Chris Ball
2010-11-30 12:23 ` David Vrabel
2010-12-17 0:43 ` Chris Ball
2010-12-21 15:03 ` Tony Olech
2011-01-06 4:56 ` Chris Ball
2011-01-06 13:18 ` David Vrabel
2011-01-06 13:17 ` David Vrabel
2011-01-20 16:09 ` Tony Olech
2011-01-20 16:11 ` Tony Olech [this message]
2011-01-21 10:50 ` [PATCH] mmc: USB SDIO/SD/MMC Host Controller (VUB300) driver Resubmission Tony Olech
2011-01-21 21:14 ` Nicolas Pitre
2011-01-22 14:21 ` Wolfram Sang
2011-01-22 19:07 ` Nicolas Pitre
2011-01-23 10:09 ` Wolfram Sang
2011-01-23 14:01 ` Nicolas Pitre
2011-01-24 15:35 ` Wolfram Sang
2011-01-24 16:27 ` Tony Olech
2011-01-24 16:21 ` Tony Olech
2011-01-25 9:13 ` Wolfram Sang
2011-01-25 9:35 ` Tony Olech
2011-01-25 20:40 ` Nicolas Pitre
2011-01-24 16:17 ` Tony Olech
2011-01-24 8:49 ` Tony Olech
2011-01-24 14:43 ` Nicolas Pitre
2011-01-24 15:10 ` Tony Olech
2011-01-24 15:55 ` Nicolas Pitre
2011-01-24 16:08 ` Tony Olech
2011-01-24 16:28 ` Nicolas Pitre
2011-01-24 16:43 ` Tony Olech
2011-03-10 16:13 ` [PATCH] mmc: USB SDIO/SD/MMC Host Controller (VUB300) driver Re-Resubmission Tony Olech
2011-03-15 3:01 ` Chris Ball
2011-03-15 9:40 ` Wolfram Sang
2011-03-15 15:06 ` Chris Ball
2011-03-15 15:41 ` Arnd Bergmann
2011-03-15 16:23 ` Arnd Bergmann
2011-03-15 16:55 ` Tony Olech
2011-04-19 9:05 ` Tony Olech
2011-04-19 12:10 ` Arnd Bergmann
2011-04-19 12:32 ` Tony Olech
2011-04-19 13:21 ` Arnd Bergmann
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=1295539885.9794.50.camel@apple-mac \
--to=tony.olech@elandigitalsystems.com \
--cc=cjb@laptop.org \
--cc=david.vrabel@csr.com \
--cc=linux-mmc@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox