All of lore.kernel.org
 help / color / mirror / Atom feed
From: Holger Schurig <hs4233@mail.mn-solutions.de>
To: Dan Williams <dcbw@redhat.com>
Cc: libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] libertas: fix spinlock recursion bug
Date: Wed, 26 Mar 2008 16:37:45 +0100	[thread overview]
Message-ID: <200803261637.45549.hs4233@mail.mn-solutions.de> (raw)
In-Reply-To: <1206544650.31383.15.camel@localhost.localdomain>

> I agree the indirection in the current SDIO and USB drivers
> sucks, but I'm getting more and more convinced that the way
> that the CF driver is handling this sucks too.

I don't really can say anything about CF/SDIO driver, but for me 
several things aren't coming into picture:

a) in "struct lbs_private", we have "struct mutex lock". What 
exactly does it lock?  Above it is a comment "/* protected with 
big lock */" but it's not clear to me to what this comment 
refers. Some lines below is the same comment, so maybe this 
should be a /* this variables are protected by 'lock' */" 
and "/* end of protection by 'lock' */".

b) some lines later there is a comment "/* command related 
variables protected by priv->driver_lock */", but some 
variables, like priv->seqnum, are command-related, but in 
the "struct mutex lock" section.

c) then there is the "spinlock_t driver_lock" later. Maybe this 
is what is meant to protect command-related things.

d) my knowledge about locks is so non-existant that I currently 
don't know why one lock is a "struct mutex" and the other is 
a "spinlock_t".

e) I also don't know (yet) when to use spin_lock_irq, 
spin_lock_irqsave or a plain spin_lock. However, I hope to fill 
this knowledge gap with 
http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/

But for clarification of the other points I'd need a helping 
hand :-)  Once we know which variables should be protected by 
which lock we can go and fix this thing. It might even be the 
case that one lock is enought.

  reply	other threads:[~2008-03-26 15:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-19 14:24 [PATCH] libertas: fix spinlock recursion bug Holger Schurig
2008-03-19 15:02 ` Dan Williams
2008-03-26  7:48   ` Holger Schurig
2008-03-26 14:41 ` Holger Schurig
2008-03-26 15:17   ` Dan Williams
2008-03-26 15:37     ` Holger Schurig [this message]
2008-03-26 17:33       ` Dan Williams
2008-03-27  8:17         ` Holger Schurig
2008-03-27 10:08         ` Holger Schurig
2008-03-27 11:34           ` Dan Williams
2008-03-27 11:57             ` Holger Schurig
2008-03-27 14:31               ` Dan Williams

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=200803261637.45549.hs4233@mail.mn-solutions.de \
    --to=hs4233@mail.mn-solutions.de \
    --cc=dcbw@redhat.com \
    --cc=libertas-dev@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    /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.