mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kristian Høgsberg" <krh@bitplanet.net>
To: "Stefan Richter" <stefanr@s5r6.in-berlin.de>
Cc: linux1394-devel@lists.sourceforge.net,
	"Jarod Wilson" <jwilson@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] firewire: fix crash in automatic module unloading
Date: Mon, 3 Mar 2008 12:37:29 -0500	[thread overview]
Message-ID: <59ad55d30803030937h7e8b6487s134aec2d87e00c62@mail.gmail.com> (raw)
In-Reply-To: <47CC326D.3070604@s5r6.in-berlin.de>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1766 bytes --]

On Mon, Mar 3, 2008 at 12:16 PM, Stefan Richter<stefanr@s5r6.in-berlin.de> wrote:> Kristian Høgsberg wrote:>  > I would want to use a kref and a completion for tracking this though>  > instead of the atomic.  Just use kref_get() instead of incrementing>  > the atomic and use kref_put() instead of decrementing it.  The release>  > function for kref_put() should complete the completion struct and>  > instead of the busy loop in fw_core_remove_card() we just wait for the>  > completion.>>  Sounds like the way to go.  Since I already passed that patch upwards, I>  will do an incremental rework.  (But perhaps not before spending some>  time on ticket number 9617 at bugzilla.kernel.org's...)>>>  > And I'm not sure I agree that it's a device_count, it>  > really just is a ref-count.  The core should also hold a reference to>  > the card and release it in fw_core_remove_card(), just before waiting>  > on the completion.>>  Right; we just shouldn't mix fw-ohci's refcounting (which isn't really>  needed since the lifetime rules for the card are as simple as they can>  get for fw-ohci) and fw-core's refcounting.
Yup, we should keep the fw-ohci side of things simple.  And they stillare: it calls add_card() to add a new card at which point the corestarts using the card.  On removal, it calls remove_card() and whenthat returns the core no knows or cares about the card and fw-ohci.cis free to tear it down however it wants.  When I mention that thecore should hold a ref-count, it's really just that somebody needs toown the initial ref-count and make sure it's dropped on the removepath.
Kristianÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2008-03-03 17:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-24 17:56 [PATCH 0/5] firewire: fix crashes in workqueue jobs Stefan Richter
2008-02-24 17:57 ` [PATCH 1/5] firewire: invalid pointers used in fw_card_bm_work Stefan Richter
2008-02-24 17:59 ` [PATCH 2/5] firewire: fix crash in automatic module unloading Stefan Richter
2008-03-03 16:45   ` Kristian Høgsberg
2008-03-03 17:16     ` Stefan Richter
2008-03-03 17:37       ` Kristian Høgsberg [this message]
2008-02-24 17:59 ` [PATCH 3/5] firewire: remove superfluous reference counting Stefan Richter
2008-02-24 18:00 ` [PATCH 4/5] firewire: fw-sbp2: fix " Stefan Richter
2008-02-24 18:01 ` [PATCH 5/5] firewire: refactor fw_unit " Stefan Richter
2008-03-01  5:17 ` [PATCH 0/5] firewire: fix crashes in workqueue jobs Jarod Wilson

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=59ad55d30803030937h7e8b6487s134aec2d87e00c62@mail.gmail.com \
    --to=krh@bitplanet.net \
    --cc=jwilson@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=stefanr@s5r6.in-berlin.de \
    /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®