linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Feng Tang <feng.tang@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Greg KH <greg@kroah.com>,
	spi-devel-list <spi-devel-general@lists.sourceforge.net>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	David Brownell <david-b@pacbell.net>,
	"alan@lxorguk.ukuu.org.uk" <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH v5] serial: spi: add spi-uart driver for Maxim 3110
Date: Tue, 2 Mar 2010 20:59:26 -0700	[thread overview]
Message-ID: <fa686aa41003021959o1ec09100t3a4cffa33f54a13d@mail.gmail.com> (raw)
In-Reply-To: <20100303105744.1eec10d7@feng-i7>

On Tue, Mar 2, 2010 at 7:57 PM, Feng Tang <feng.tang@intel.com> wrote:
> Hi All,
>
> Here is a driver for Maxim 3110 SPI-UART device, please help to review.
>
> It has been validated with Designware SPI controller (drivers/spi: dw_spi.c &
> dw_spi_pci.c). It supports polling and IRQ mode, supports batch read, and
> provides a console.
>
> change log:
>  since v4:
>        * Add explanation why not using DMA
>        * Fix a bug in max3110_read_multi()
>  since v3:
>        * Remove the Designware controller related stuff
>        * Remove some initialization code which should be done in the platform
>          setup code
>        * Add a missing change for drivers/serial/Makefile
>  since v2:
>        * Address comments from Andrew Morton
>        * Use test/set_bit to avoid race condition for SMP/preempt case
>        * Fix bug related with endian order
>  since v1:
>        * Address comments from Alan Cox
>        * Use a "use_irq" module parameter to runtime check whether
>          to use IRQ mode
>        * Add the suspend/resume implementation
[...]
> + *
> + * 3. This driver doesn't support work with a spi cotnroller in DMA mode, and
> + *    the reason for not using DMA is:
> + *    a) Maxim 3110 is a low speed UART device, whose tx/rx buffer are very few,
> + *    and using DMA may be over-killing when working as a system console(imaging
> + *    we edit a text file on it)
> + *    b) Handling only one 16b word transfer will be very common, but non-32b
> + *    aligned DMA operation is not supported by all kinds of DMA controllers
> + *
> + *    Some spi controller drivers like Pxa2xx, Designware have option for device
> + *    driver to chose to work in poll or DMA mode. And platform driver which
> + *    enumerates Max3110 device should leverage this option to not use DMA.

Between this, reading through the other comments, and the existence of
the max3100 driver, I'm less and less comfortable with this driver.
First, if this driver gets merged, then it is quite likely that
neither you or the 3100 author will get around to merging them.
Second, as others have pointed out, this driver is making assumptions
about the SPI bus that it has no business making.  The fact that it
doesn't work with DMA isn't a design choice, it is a bug and whether
or not it is a low speed uart device is completely beside the point.

I'm generally not involved with the serial device drivers, but FWIW,
I'm no longer in favor of this driver getting merged.  If you really
want to get it merged, then I recommend asking Greg to pick it up into
staging so that there is some imperative to fix it up and merge it
with the max3100 driver.

g.
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-03-03  3:59 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-29 14:20 [RFC][PATCH] serial: spi: add spi-uart driver for Maxim 3110 Feng Tang
2009-12-29 14:59 ` [spi-devel-general] " Baruch Siach
2009-12-29 16:05   ` Tang, Feng
2009-12-29 18:43     ` Erwin Authried
2009-12-30  1:54       ` Feng Tang
2010-02-25  4:47       ` David Brownell
2010-02-25  7:49         ` Feng Tang
2009-12-29 15:02 ` Alan Cox
2010-02-08  8:59 ` [RFC][PATCH v2] " Feng Tang
2010-02-09  0:20   ` Andrew Morton
2010-02-09  0:26     ` Grant Likely
2010-02-09  1:36       ` Feng Tang
2010-02-17 22:58         ` Greg KH
2010-02-24  5:11           ` [RFC][PATCH v3] " Feng Tang
2010-02-24 10:44             ` Alan Cox
2010-02-24 14:25               ` Grant Likely
2010-02-24 23:18             ` Andrew Morton
2010-02-25  6:39               ` Feng Tang
2010-02-25  4:43             ` David Brownell
2010-02-25  7:44               ` Feng Tang
2010-02-25  8:11                 ` David Brownell
2010-02-26  3:47             ` [PATCH v4] " Feng Tang
2010-02-26  9:59               ` Masakazu Mokuno
2010-02-26 19:41                 ` David Brownell
2010-03-01  2:30                   ` Feng Tang
2010-03-02  3:38                 ` Feng Tang
2010-02-09  9:25     ` [RFC][PATCH v2] " Alan Cox
2010-03-03  2:57   ` [PATCH v5] " Feng Tang
2010-03-03  3:59     ` Grant Likely [this message]
2010-03-03  4:51     ` David Brownell
2010-03-03  5:52       ` Feng Tang
2010-03-03  6:16         ` David Brownell
2010-03-03  6:37           ` Feng Tang
2010-03-03  7:25             ` David Brownell
2010-03-03  7:42               ` Feng Tang

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=fa686aa41003021959o1ec09100t3a4cffa33f54a13d@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=david-b@pacbell.net \
    --cc=feng.tang@intel.com \
    --cc=greg@kroah.com \
    --cc=linux-serial@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).