public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Wan ZongShun <mcuos.com@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-spi <spi-devel-general@lists.sourceforge.net>,
	David Brownell-sourceforge <dbrownell@users.sourceforge.net>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: Add spi controller driver support for NUC900
Date: Thu, 19 Nov 2009 22:41:51 +0000	[thread overview]
Message-ID: <20091119224151.GF22232@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <e68bb3470911190149k3bc77ef6h26475bc7272784b8@mail.gmail.com>

On Thu, Nov 19, 2009 at 05:49:22PM +0800, Wan ZongShun wrote:
> 2009/11/19 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> > On Thu, Nov 19, 2009 at 04:40:50PM +0800, Wan ZongShun wrote:
> >> 2009/11/19 Andrew Morton <akpm@linux-foundation.org>:
> >> > I don't know, because I don't know what operation the hardware needs to
> >> > stop it from generating interrupts.  Perhaps that's clk_disable()?
> >>
> >> The interrupt will be not occur as long as I run clk_disable().
> >>
> >> > Once you've stopped the source of interrupts then the code should wait
> >> > for the IRQ handler to complete if it's running on another CPU.  Yes,
> >> > free_irq() does that.
> >>
> >> So, regarding my system of single CPU, maybe I need put this
> >> 'clk_disable()' in the front of function of w90p910_spi_remove().
> >>
> >> right?
> >
> > Depending on the hardware, that's not the right answer.  If turning off
> > the clock also causes register accesses to the device to abort, it is
> > a very dangerous thing to do.
> >
> > It can also be dangerous if the clock is used to synchronise the interrupt
> > output - it can lead to the output being permanently asserted if the clock
> > is turned off with it asserted.
> >
> > Normally devices have an "interrupt enable" register.  You should disable
> > all interrupts from the device using this register after unregistering
> > the driver from the (SPI) subsystem.
> 
> sir, so I need implement a API to disable spi device interrupt by
> "interrupt enable" register?
> but I did not find the operation in other ARM platform when they close
> your spi driver.
> 
> or something I missed?

No, I think you need to reverse the effects of w90p910_enable_int()
by clearing the ENINT bit.  I'm making the assumption that doing so
prevents interrupts being generated by the device.

      reply	other threads:[~2009-11-19 22:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17  6:48 [PATCH] ARM: Add spi controller driver support for NUC900 Wan ZongShun
2009-11-18 22:21 ` Andrew Morton
2009-11-19  6:23   ` Wan ZongShun
2009-11-19  7:49     ` Andrew Morton
2009-11-19  8:40       ` Wan ZongShun
2009-11-19  9:02         ` Russell King - ARM Linux
2009-11-19  9:49           ` Wan ZongShun
2009-11-19 22:41             ` Russell King - ARM Linux [this message]

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=20091119224151.GF22232@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=dbrownell@users.sourceforge.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcuos.com@gmail.com \
    --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