All of lore.kernel.org
 help / color / mirror / Atom feed
From: jcromie@divsol.com (Jim Cromie)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] Qs on chips/pc87360
Date: Wed, 22 Jun 2005 16:50:29 +0000	[thread overview]
Message-ID: <42B97A75.3060503@divsol.com> (raw)


Im working on a pc87366_gpio module, and it seems necessary
to coordinate locking in some way.

The simplest thing seems to be to EXPORT_SYMBOL the 2
semaphores in pc87360_data, but then I looked more closely,
and found something I dont understand...

/*
 * Client data (each client gets its own)
 */

struct pc87360_data {
        struct i2c_client client;
        struct semaphore lock;
        struct semaphore update_lock;


How is it possible to have each client get a separate struct
and separate locks, and still get any protection ?

Do semaphores magically interlock with other semaphores
protecting the same resource ?   And how do they know what
theyre protecting ? 

I see plenty of up/down ops on the lock, but no place where theyre
told what theyre locking access to.

Am I missing something ?


Do the earlier chips, 60, 65, etc also have a GPIO section,
or is it just the 66 ?


             reply	other threads:[~2005-06-22 16:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-22 16:50 Jim Cromie [this message]
2005-06-22 17:22 ` [lm-sensors] Re: Qs on chips/pc87360 Jean Delvare
2005-06-22 20:13 ` Jim Cromie

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=42B97A75.3060503@divsol.com \
    --to=jcromie@divsol.com \
    --cc=lm-sensors@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.