All of lore.kernel.org
 help / color / mirror / Atom feed
From: r.marek@sh.cvut.cz (Rudolf Marek)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [patch 0/2] hwmon: add a superio_locks coordinator
Date: Sat, 25 Feb 2006 18:04:39 +0000	[thread overview]
Message-ID: <44009C37.1030601@sh.cvut.cz> (raw)

Hello

Sorry for the delay I have been rather busy with the school finishing stuff.
And now my comments. I studied both patches and I really like a simplistic aproach

So far I know sio is used in:

mmc card driver wbsd.c
parallel port drivers parport_pc.c
several watchdog drivers
irda drivers

After studying those drivers and your minimalistic approach in mind I came to this conclusion

what about to create this API:


unlock_seq[] = {0x87,0x87,0x00} maybe 0x00 to terminate the list?

sio_enter(u8 port, u8 *unlock_seq)
sio_exit(u8 port, u8 *lock_seq)
sio_inb(u8 port)
sio_outb(u8 port, u8 val)
sio_select(u8 port, u8 ldn)

Now the big thing ;) the semaphore/mutex for the access locking would be hidden in sio_enter
and sio_exit

there could be just some port-> index mapping so you will try to lock/unlock just a lock to right address
This would solve all problems with concurrent access.

This approach should work and it is consistent with the idea of SIO, just enter the configuration space,
alter something and exit... Just lock it between enter and exit.

The locking in some other places cannot be done because the drivers can switch the bank and this is
not good. They can try to lock/unlock the sio itself. This approach will solve those problems...

What do you say? If you like it maybe you can implement it or come with something else...

Regards
Rudolf


             reply	other threads:[~2006-02-25 18:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-25 18:04 Rudolf Marek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-03-10 17:42 [lm-sensors] [patch 0/2] hwmon: add a superio_locks coordinator Jim Cromie
2006-01-27  5:47 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=44009C37.1030601@sh.cvut.cz \
    --to=r.marek@sh.cvut.cz \
    --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.