From: "Serge E. Hallyn" <serue@us.ibm.com>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Rajiv Andrade <srajiv@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
serue@linux.vnet.ibm.com, zohar@linux.vnet.ibm.com,
safford@watson.ibm.com, debora@linux.vnet.ibm.com
Subject: Re: [PATCH 3/4] TPM: rcu locking
Date: Thu, 25 Sep 2008 09:59:30 -0500 [thread overview]
Message-ID: <20080925145930.GA20055@us.ibm.com> (raw)
In-Reply-To: <20080925143312.GE6725@linux.vnet.ibm.com>
Quoting Paul E. McKenney (paulmck@linux.vnet.ibm.com):
> On Thu, Sep 25, 2008 at 08:36:45AM -0500, Serge E. Hallyn wrote:
> > Quoting Paul E. McKenney (paulmck@linux.vnet.ibm.com):
> > > On Tue, Sep 23, 2008 at 05:18:17PM -0300, Rajiv Andrade wrote:
> > > > Paul,
> > > >
> > > > On Tue, 2008-09-23 at 11:19 -0700, Paul E. McKenney wrote:
> > > > >
> > > > > But here we are deleting from what appears to be some other list.
> > > > > And I don't see any insertiong into either list.
> > > > >
> > > > > What am I missing here?
> > > > >
> > > > > Thanx, Paul
> > > >
> > > > Sorry, forgot to change list_add() to list_add_rcu() in the code section
> > > > below:
> > > >
> > > > > > + /* Make chip available */
> > > > > > + spin_lock(&driver_lock);
> > > > > > + list_add(&chip->list, &tpm_chip_list);
> > > > > > + spin_unlock(&driver_lock);
> > > >
> > > > I'll resubmit.
> > >
> > > Cool!
> > >
> > > So tpm_chip_list and the not-obviously-identical list manipulated
> > > in tpm_remove_hardware() really are the same list?
> > >
> > > Thanx, Paul
> >
> > Hey Paul,
> >
> > curious, why do they not look like the same list?
>
> Because one of them is named &tpm_chip_list, a global variable, and the
> other seemed to be returned from a function taking a struct device as an
> argument. This is indeed consistent with an element in this list being
> hung off of the struct device, so perhaps I was just being insufficiently
> persistent in tracking things down.
>
> Thanx, Paul
Right, tpm_register_hardware both does
dev_set_drvdata(dev, chip)
to set dev->driver_data = chip, and list_add(chip->list, &tpm_chip_list).
The tpm_remove_hardware(), then, gets the device, gets the chip from
dev->driver_data, and removes it from the tpm_chip_list.
It does look kosher.
Though once this is all applied to some public git tree, I want to take
some time to look at the full result.
-serge
next prev parent reply other threads:[~2008-09-25 15:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-23 17:19 [PATCH 0/4] BKL removed, RCU addition and pnp remove Rajiv Andrade
2008-09-23 17:19 ` [PATCH 1/4] TPM: update char dev BKL pushdown Rajiv Andrade
2008-09-23 20:58 ` Jonathan Corbet
2008-09-24 13:14 ` Rajiv Andrade
2008-09-23 17:19 ` [PATCH 2/4] TPM: num_opens to is_open variable change Rajiv Andrade
2008-09-23 17:19 ` [PATCH 3/4] TPM: rcu locking Rajiv Andrade
2008-09-23 18:19 ` Paul E. McKenney
2008-09-23 20:18 ` Rajiv Andrade
2008-09-23 20:27 ` Paul E. McKenney
2008-09-25 13:36 ` Serge E. Hallyn
2008-09-25 14:33 ` Paul E. McKenney
2008-09-25 14:59 ` Serge E. Hallyn [this message]
2008-09-23 20:19 ` [PATCH 3/4][resubmit] " Rajiv Andrade
2008-09-23 21:01 ` Jonathan Corbet
2008-09-23 21:27 ` Mimi Zohar
2008-09-24 13:10 ` Rajiv Andrade
2008-09-25 13:39 ` Serge E. Hallyn
2008-09-25 13:29 ` [PATCH 3/4] " Serge E. Hallyn
2008-09-23 17:19 ` [PATCH 4/4] TPM: addition of pnp remove Rajiv Andrade
2008-09-23 17:38 ` about kernel_physical_mapping_init Joilnen Leite
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=20080925145930.GA20055@us.ibm.com \
--to=serue@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=debora@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=safford@watson.ibm.com \
--cc=serue@linux.vnet.ibm.com \
--cc=srajiv@linux.vnet.ibm.com \
--cc=zohar@linux.vnet.ibm.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