All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Wool <vitalywool@gmail.com>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: David Brownell <david-b@pacbell.net>, Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org,
	spi-devel-general@lists.sourceforge.net
Subject: Re: [spi-devel-general] [PATCH][2.16.17-rc1-mm2] spi: Added spi master driver for Freescale MPC83xx SPI controller
Date: Tue, 11 Apr 2006 00:03:38 +0400	[thread overview]
Message-ID: <443ABA1A.1060801@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0604101414500.5501-100000@gate.crashing.org>

Hi,

Kumar Gala wrote:

>+irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data,
>+			    struct pt_regs * ptregs)
>+{
>+	struct mpc83xx_spi *mpc83xx_spi = context_data;
>+	u32 event;
>+	irqreturn_t ret = IRQ_NONE;
>+
>+	/* Get interrupt events(tx/rx) */
>+	event = mpc83xx_spi_read_reg(&mpc83xx_spi->base->event);
>+
>+	/* We need handle RX first */
>+	if (event & SPIE_NE) {
>+		u32 rx_data = mpc83xx_spi_read_reg(&mpc83xx_spi->base->receive);
>+
>+		if (mpc83xx_spi->rx)
>+			mpc83xx_spi->get_rx(rx_data, mpc83xx_spi);
>+
>+		ret = IRQ_HANDLED;
>+	}
>+
>+	if ((event & SPIE_NF) == 0)
>+		/* spin until TX is done */
>+		while (((event =
>+			 mpc83xx_spi_read_reg(&mpc83xx_spi->base->event)) &
>+						SPIE_NF) == 0)
>+			 ;
>  
>
This is a potentially endless loop so two questions here.
First, did you do any measurements on how long it can loop here?
The, what if a bus error occurs and this bit is never set?

>+
>+	mpc83xx_spi->count -= 1;
>+	if (mpc83xx_spi->count) {
>+		if (mpc83xx_spi->tx) {
>+			u32 word = mpc83xx_spi->get_tx(mpc83xx_spi);
>+			mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit,
>+					      word);
>+		}
>+	} else {
>+		complete(&mpc83xx_spi->done);
>+	}
>  
>
So, if it's not SPIE_NF, it's not marked as HANDLED?

Vitaly

  reply	other threads:[~2006-04-10 20:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-06 18:30 [PATCH] spi: Added spi master driver for Freescale MPC83xx SPI controller Kumar Gala
2006-04-07  5:22 ` David Brownell
2006-04-07  9:16   ` [spi-devel-general] " Vitaly Wool
2006-04-07 16:09     ` David Brownell
2006-04-07 17:04       ` Kumar Gala
2006-04-08  1:25         ` David Brownell
2006-04-07 14:04   ` Kumar Gala
2006-04-07 15:54     ` David Brownell
2006-04-07 16:44       ` Kumar Gala
2006-04-10 17:38 ` [PATCH][UPDATE] " Kumar Gala
2006-04-10 19:01   ` David Brownell
2006-04-10 19:05     ` Kumar Gala
2006-04-10 19:17       ` [PATCH][2.16.17-rc1-mm2] " Kumar Gala
2006-04-10 20:03         ` Vitaly Wool [this message]
2006-04-10 20:22           ` [spi-devel-general] " Kumar Gala
2006-04-10 21:06             ` David Brownell
2006-04-10 21:10               ` Kumar Gala
2006-04-11 14:39         ` [PATCH][2.16.17-rc1-mm2][UPDATE] " Kumar Gala

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=443ABA1A.1060801@gmail.com \
    --to=vitalywool@gmail.com \
    --cc=david-b@pacbell.net \
    --cc=galak@kernel.crashing.org \
    --cc=greg@kroah.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 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.