public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Gérard Roudier" <groudier@club-internet.fr>
To: Tim Hockin <thockin@sun.com>
Cc: <alan@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH]  sym53c8xx timer rework
Date: Tue, 10 Jul 2001 21:00:35 +0200 (CEST)	[thread overview]
Message-ID: <20010710203327.Q1488-100000@> (raw)
In-Reply-To: <3B4AAC7D.A86AF1F3@sun.com>



On Tue, 10 Jul 2001, Tim Hockin wrote:

> Gerard (and all)
>
> Attached is a small patch to re-work the timer in the sym53c8xx driver.  I
> submitted this patch against 2.4.5, but don't see it in 2.4.6, so I am
> re-submitting against 2.4.6.
>
> Please let me know if there are any problems with this patch.

Hmmm... How much are you sure there isn't any race in your patch ?

If the timer handler is spinning on the lock embedded in the driver
instance and you free this instance under its knees, it will just
reference random memory.

That was the reason I preferred to leave the timer die by itself prior to
releasing the HBA instance. The 'release_stage' was the trick, but
probably some memory barriers or atomic operations were missing.

If you want to delete the timer on HBA instance release, then you also
want to check if the pointer to the HBA instance is still valid in the
timer handler and just return if it isn't so.

Btw, is there a simple and clean way to deal with such concurrency (I mean
a timer embedded in a data structure we want to free concurrently ? Given
the current sheme of Linux requiring a synchronous HBA instance release, I
am under the impression that there is no such way.

  Gérard.


  reply	other threads:[~2001-07-10 19:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-10  7:19 [PATCH] sym53c8xx timer rework Tim Hockin
2001-07-10 19:00 ` Gérard Roudier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-07-10  9:48 Studierende der Universitaet des Saarlandes
2001-07-10 18:21 ` Tim Hockin

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=20010710203327.Q1488-100000@ \
    --to=groudier@club-internet.fr \
    --cc=alan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thockin@sun.com \
    /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