From: Dirk Brandewie <dirk.brandewie@gmail.com>
To: Feng Tang <feng.tang@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"spi-devel-general@lists.sourceforge.net"
<spi-devel-general@lists.sourceforge.net>,
alan@linux.intel.com, alek.du@intel.com
Subject: Re: [PATCH 3/5] dw_spi: rework message processing
Date: Thu, 16 Jun 2011 10:28:16 -0700 [thread overview]
Message-ID: <4DFA3D30.2070909@gmail.com> (raw)
In-Reply-To: <20110616220003.7ac89d56@feng-i7>
On 06/16/2011 07:00 AM, Feng Tang wrote:
> Hi Dirk,
>
> IMHO, the patch is too big, it contains too many changes to the original
> drivers, and we can't see clearly what you've changed to each logical
> code part or section, If possible, could you separate this patch to
> several small ones in a logical way.
>
> First, I have some questions, what devices have you tested with this patch?
> high speed, low speed? Do you have any performance data to show the benefit
> of this change? Current dw_spi driver has been tested with many devices, so
> to not break them or cause obvious regression, we have to be cautious.
See Thread with grant for list of environments where it has been tested.
The boot time of the platforms it is being used on decreased 2-5 seconds with no
regressions reported. It has been in use/under test for ~3 months in various
Meego and Android builds. It clears all the bugs reported against the driver
that I am aware of. If you can give me pointers to teams/projects that are
using v2.6.37+ kernels I would be more that happy to provide them with patches
for their kernel to ensure we get the most comprehensive test possible.
>
> Here are some general comments according to the commit logs:
> 1. I think the threaded irq handling is a good idea. And let driver chose to
> use poll or interrupt is good, some other spi controller driver has used
> that way for a long time
> 2. Why you remove the cs_change code, in some case, the controller is only
> be used by one device, we don't need do the config for every single
> spi_transfer
There is no guarantee that all the transfers in a given spi_message have the
same values for speed_hz, bits_per_word, cs_change and delay_usecs atleast
nothing I could find put that restriction in place. Since we need to deal with
possible changes (although unlikely) it gets rid some state we need to maintain
and makes the code path common for all transfers.
> 3. Why do you remove the chip select control code, dw_spi controller hw has
> some problem in chip select controller by SER, and thus many devices has
> to use external GPIO has their chip select, this is real world usages!
Which devices/platforms are you referring to? I was unable to find any
platforms or client drivers using this functionality. If they are not public
please respond internally. In any case it is mute since I already agreed to put
is back in in my response to Grant.
> 4. I saw you enable both TX/RX interrupt when doing interrupt transfer, spi
> devices' TX/RX are born to be simutaneous, when one word is sent over
> TX line, a RX word will be received from RX line, so both the orignal
> interrupt transfer handling written by me and the later optimization
> from Alek Du only enable TX interrupt, which will only generate half of
> IRQs comparing to enble both TX/RX, this is huge when the data rate is
> several Mb per second
I the current driver the txfltr register is set to 0 (FIFO empty) in the
interrupt transfer case which will drop chip select every FIFO length bytes.
In my transfer setup the RX FIFO interrupt is set to a value lower than the TX
threshold which will keep both interrupts from firing at the same time.
The TX interrupt will drive the transfer until there are less than tx_threshold
bytes left to transfer then by the RX interrupt to drive the remainder of the
transfer without dropping chip select.
> 5. Why do you change the logic of filling TX FIFO, the logic comes from use
> case that the dw_spi driver is dealing with several high speed devices.
>
The version of the driver that I started with did not have the current fifo
handling code. I finished my changes before they showed up in the AC tree or
the upstream kernel. I picked up most to the fifo handling logic from the
current driver with the exception of the rxtx_gap calculation which was not
needed with the way I am maintaining the state and the addition of a check to
avoid the register read in tx_max/rx_max if all bytes have been sent/received.
This avoids some overhead in the interrupt case.
> Thanks,
> Feng
>
next prev parent reply other threads:[~2011-06-16 17:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-15 17:23 [PATCH 0/5] Designware SPI driver update dirk.brandewie
2011-06-15 17:23 ` [PATCH 1/5] spi/makefile: Fix typo from reorganize drivers patch dirk.brandewie
2011-06-16 12:31 ` Grant Likely
2011-06-15 17:23 ` [PATCH 2/5] spi/dw_spi: expose dw_spi platform data stucture dirk.brandewie
[not found] ` <1308158588-17249-1-git-send-email-dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-06-15 17:23 ` [PATCH 3/5] dw_spi: rework message processing dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w
2011-06-16 13:14 ` Grant Likely
2011-06-16 16:03 ` Dirk Brandewie
2011-06-16 16:40 ` Grant Likely
2011-06-16 14:00 ` Feng Tang
2011-06-16 17:28 ` Dirk Brandewie [this message]
2011-06-16 17:38 ` Grant Likely
2011-06-16 19:52 ` Dirk Brandewie
2011-06-17 1:22 ` Feng Tang
2011-06-17 1:34 ` Du, Alek
2011-06-15 17:23 ` [PATCH 4/5] spi/spi-dw: update function naming convention dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w
2011-06-16 13:15 ` Grant Likely
2011-06-15 17:23 ` [PATCH 5/5] spi_dw_pci: Add runtime power management dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w
2011-06-16 13:16 ` Grant Likely
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=4DFA3D30.2070909@gmail.com \
--to=dirk.brandewie@gmail.com \
--cc=alan@linux.intel.com \
--cc=alek.du@intel.com \
--cc=feng.tang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=spi-devel-general@lists.sourceforge.net \
/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;
as well as URLs for NNTP newsgroup(s).