[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181219163115.fdnl6kivywuxdgmu@ninjato>
Date: Wed, 19 Dec 2018 17:31:15 +0100
From: Wolfram Sang <wsa@...-dreams.de>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Peter Rosin <peda@...ntia.se>, Hans de Goede <hdegoede@...hat.com>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [RFC/RFT 01/10] i2c: add 'is_suspended' flag for i2c adapters
On Wed, Dec 19, 2018 at 10:39:05AM +0100, Geert Uytterhoeven wrote:
> Hi Wolfram,
>
> On Wed, Dec 19, 2018 at 12:34 AM Wolfram Sang <wsa@...-dreams.de> wrote:
> > > > + unsigned int is_suspended:1; /* owned by the I2C core */
> > >
> > > When more stuff is added to this bit field (which always happens at
> > > some point) updates to all members of the bit field will have to use
> > > the same root-adapter-locking, or we will suffer from RMW-races. So
> > > this feels like an invitation for future disaster. Maybe a comment
> > > about that to remind our future selves? Or perhaps the bit field
> > > should be avoided altogether?
> >
> > Changed to bool. Thanks!
>
> Does that help, given bool is smaller than the CPUs word size?
> Is it Alpha that cannot do atomic operations on bytes?
Yup, I overestimated bools :( I guess good old
unsigned long locked_flags;
#define <PREFIX>_IS_SUSPENDED 0
set_bit(), clear_bit(), and test_bit() is it then.
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists