From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Todd Fischer <todd.fischer@ridgerun.com>
Cc: linux-kernel@vger.kernel.org,
davinci-linux-open-source@linux.davincidsp.com,
sameo@linux.intel.com, lrg@slimlogic.co.uk
Subject: Re: [PATCH 4/4]-V2 Add MFD driver for TPS6507x family of multi-function chips and move TPS6507x regulator driver from being stand-alone to using the MFD driver.
Date: Mon, 5 Apr 2010 14:56:58 +0100 [thread overview]
Message-ID: <20100405135657.GI6580@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <1270244253-4234-5-git-send-email-todd.fischer@ridgerun.com>
On Fri, Apr 02, 2010 at 03:37:33PM -0600, Todd Fischer wrote:
> Add MFD driver for TPS6507x family of multi-function chips. Move TPS6507x
> regulator driver from being stand-alone driver to using the MFD TPS6507x driver.
>
> Signed-off-by: Todd Fischer <todd.fischer@ridgerun.com>
One issue...
> +static int tps6507x_i2c_read_device(struct tps6507x_dev *tps6507x, char reg,
> + int bytes, void *dest)
> +{
> + struct i2c_client *i2c = tps6507x->i2c_client;
> + int ret;
> +
> + ret = i2c_master_send(i2c, ®, 1);
> + if (ret < 0)
> + return ret;
> +
> + ret = i2c_master_recv(i2c, dest, bytes);
> + if (ret < 0)
> + return ret;
> + if (ret != bytes)
> + return -EIO;
> + return 0;
> +}
Your register I/O functions don't have anything protecting them against
concurrent access. This isn't really an issue for the writes by
themselves since they do a single transaction on the I2C bus so the I2C
layer concurrency protection ought to be enough but for reads you need
to send the register address first then read back the data, opening up
an issue. A simple mutex in the read and write functions ought to cover
this.
next prev parent reply other threads:[~2010-04-05 13:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-02 21:37 [PATCH 0/4]-V2 TPS6507x MFD driver Todd Fischer
2010-04-02 21:37 ` [PATCH 1/4]-V2 Move TPS6507x register definition to header file Todd Fischer
2010-04-02 21:37 ` [PATCH 2/4]-V2 Make room for other tps6507x drivers to have board specific initialization data Todd Fischer
2010-04-02 21:37 ` [PATCH 3/4]-V2 Cleaned up name space so each MFD sub-driver uses a different name space Todd Fischer
2010-04-02 21:37 ` [PATCH 4/4]-V2 Add MFD driver for TPS6507x family of multi-function chips and move TPS6507x regulator driver from being stand-alone to using the MFD driver Todd Fischer
2010-04-05 13:56 ` Mark Brown [this message]
2010-04-05 13:49 ` [PATCH 3/4]-V2 Cleaned up name space so each MFD sub-driver uses a different name space Mark Brown
2010-04-05 13:48 ` [PATCH 2/4]-V2 Make room for other tps6507x drivers to have board specific initialization data Mark Brown
2010-04-05 13:46 ` [PATCH 1/4]-V2 Move TPS6507x register definition to header file Mark Brown
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=20100405135657.GI6580@rakim.wolfsonmicro.main \
--to=broonie@opensource.wolfsonmicro.com \
--cc=davinci-linux-open-source@linux.davincidsp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=sameo@linux.intel.com \
--cc=todd.fischer@ridgerun.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