mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Michal Simek <monstr@monstr.eu>
Cc: Michal Simek <michal.simek@xilinx.com>,
	linux-kernel@vger.kernel.org,
	linux-spi <linux-spi@vger.kernel.org>,
	Grant Likely <grant.likely@linaro.org>,
	spi-devel-general@lists.sourceforge.net
Subject: Re: [PATCH v1 3/4] spi/xilinx: Simplify irq allocation
Date: Mon, 8 Jul 2013 17:26:42 +0100	[thread overview]
Message-ID: <20130708162642.GM27646@sirena.org.uk> (raw)
In-Reply-To: <51DADF3E.1000802@monstr.eu>

[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]

On Mon, Jul 08, 2013 at 05:48:14PM +0200, Michal Simek wrote:
> On 07/08/2013 04:49 PM, Mark Brown wrote:

> > Is it definitely safe to leave the IRQ hanging around after the master
> > has been freed - there's no possibility of a late error interrupt or
> > something?

> I think it is more generic question if this race condition is fine
> for all drivers which are using devres groups.

Well, it's mainly an issue for IRQs - the other resources don't initiate
events by themselves which is what causes the issue.  It just needs a
bit of extra care so I wanted to check that this has been thought of.

> I have just looked at it and devres_release_all() is called where
> driver is unload and irq are disabled there.

The problem is the gap between the resources used to handle the IRQ
being freed and the IRQ itself being freed - if the hardware can be
guaranteed to be idle then that's fine but we need to be sure that is
OK.  Otherwise the interrupt handler may get run and be looking at a
resource which was freed which would be unfortunate.

> btw: What's the proper way for spi driver unregistration?

> spi_unregistered_master() (which also free private structure)
> and
> spi_master_put()?

Yes.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-07-08 16:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 13:29 [PATCH v1 1/4] spi/xilinx: Remove CONFIG_OF from the driver Michal Simek
2013-07-08 13:29 ` [PATCH v1 2/4] spi/xilinx: Clean ioremap calling Michal Simek
2013-07-08 14:50   ` Mark Brown
2013-07-08 13:29 ` [PATCH v1 3/4] spi/xilinx: Simplify irq allocation Michal Simek
2013-07-08 14:49   ` Mark Brown
2013-07-08 15:48     ` Michal Simek
2013-07-08 16:26       ` Mark Brown [this message]
2013-07-09 14:15         ` Michal Simek
2013-07-09 14:47           ` Mark Brown
2013-07-09 14:53             ` Michal Simek
2013-07-12 14:00         ` Michal Simek
2013-08-22 13:10           ` Mark Brown
2013-07-08 13:29 ` [PATCH v1 4/4] spi/xilinx: Use of_property_read_u32 for reading value from node Michal Simek
2013-07-08 14:51   ` Mark Brown
2013-07-09  5:26     ` Michal Simek
2013-07-09  9:14       ` Mark Brown
2013-07-08 14:49 ` [PATCH v1 1/4] spi/xilinx: Remove CONFIG_OF from the driver Mark Brown

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=20130708162642.GM27646@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=monstr@monstr.eu \
    --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

all inboxes | Powered by JetHome®