public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Green <chris@isbd.co.uk>
To: linux-i2c@vger.kernel.org
Subject: A question about the mutex (or not) in the kernel's I2C handling
Date: Sun, 5 Nov 2023 12:57:31 +0000	[thread overview]
Message-ID: <ZUeRO9txnxdImAJG@esprimo> (raw)

I have spent quite a while searching in places such as stackoverflow
and in the docmentation at linux.kernel.org but I haven't found a very
conclusive answer (no to me anyway).

I have a single I2C bus connected to a single board computer
(Beaglebone Black) running Debian 11, Kernel: 5.10.168.

Is it safe to allow multiple processes to read and write various
devices on the I2C bus?  This may be either different processes
accessing the same device or different processes accessing different
devices on the I2C bus.

I.e. is there a mutex (or equivalent code) in the Linux Kernel I2C
drivers that guarantees completion of one process's I2C transaction
before another one starts?

The information I have managed to find suggests that there is such a
mutex and that I don't need to make sure my processes don't try to
read/write the I2C bus simultaneously but I can't find a definitive
statement to this effect.

So, I'm sorry to ask such a 'user' question here but I would really
like a definite answer please.

-- 
Chris Green

             reply	other threads:[~2023-11-05 13:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-05 12:57 Chris Green [this message]
2023-11-08 22:50 ` A question about the mutex (or not) in the kernel's I2C handling Stefan Lengfeld
2023-11-09 10:50   ` Chris Green

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=ZUeRO9txnxdImAJG@esprimo \
    --to=chris@isbd.co.uk \
    --cc=linux-i2c@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox