All of lore.kernel.org
 help / color / mirror / Atom feed
* question about concurrent regmap i2c usage
@ 2017-04-04  8:28 ` Michael Hennerich
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Hennerich @ 2017-04-04  8:28 UTC (permalink / raw)
  To: broonie, , linus.walleij, wsa; +Cc: linux-gpio, linux-i2c, linux-kernel

Hi Mark,

During the discussion here: https://lkml.org/lkml/2017/4/4/76

A question came up, regarding whether it's recommended to mix regmap_i2c 
and plain i2c_smbus or direct adapter transfers.

In this specific case for the i2c MUX portion we need to avoid double 
locks, and therefore use un-locked direct adapter transfers.

The same time we also implement a small gpiochip, where we would like to 
use regmap to avoid some boilerplate code for the register cache.


What is your thought on this?


-- 
Greetings,
Michael

--
Analog Devices GmbH      Otl-Aicher Strasse 60-64      80807 München
Sitz der Gesellschaft München, Registergericht München HRB 40368,
Geschäftsführer: Peter Kolberg, Ali Raza Husain, Eileen Wynne

^ permalink raw reply	[flat|nested] 5+ messages in thread

* question about concurrent regmap i2c usage
@ 2017-04-04  8:28 ` Michael Hennerich
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Hennerich @ 2017-04-04  8:28 UTC (permalink / raw)
  To: broonie, , linus.walleij, wsa; +Cc: linux-gpio, linux-i2c, linux-kernel

Hi Mark,

During the discussion here: https://lkml.org/lkml/2017/4/4/76

A question came up, regarding whether it's recommended to mix regmap_i2c 
and plain i2c_smbus or direct adapter transfers.

In this specific case for the i2c MUX portion we need to avoid double 
locks, and therefore use un-locked direct adapter transfers.

The same time we also implement a small gpiochip, where we would like to 
use regmap to avoid some boilerplate code for the register cache.


What is your thought on this?


-- 
Greetings,
Michael

--
Analog Devices GmbH      Otl-Aicher Strasse 60-64      80807 München
Sitz der Gesellschaft München, Registergericht München HRB 40368,
Geschäftsführer: Peter Kolberg, Ali Raza Husain, Eileen Wynne

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: question about concurrent regmap i2c usage
  2017-04-04  8:28 ` Michael Hennerich
  (?)
@ 2017-04-04 12:26 ` Mark Brown
  2017-04-05  6:31     ` Michael Hennerich
  -1 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2017-04-04 12:26 UTC (permalink / raw)
  To: Michael Hennerich; +Cc: linus.walleij, wsa, linux-gpio, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

On Tue, Apr 04, 2017 at 10:28:23AM +0200, Michael Hennerich wrote:

> A question came up, regarding whether it's recommended to mix regmap_i2c and
> plain i2c_smbus or direct adapter transfers.

> In this specific case for the i2c MUX portion we need to avoid double locks,
> and therefore use un-locked direct adapter transfers.

> The same time we also implement a small gpiochip, where we would like to use
> regmap to avoid some boilerplate code for the register cache.

That should work fine providing nothing tries to change cached registers
underneath the regmap.  regmap won't be able to tell anything's changed
otherwise.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: question about concurrent regmap i2c usage
  2017-04-04 12:26 ` Mark Brown
@ 2017-04-05  6:31     ` Michael Hennerich
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Hennerich @ 2017-04-05  6:31 UTC (permalink / raw)
  To: Mark Brown; +Cc: linus.walleij, wsa, linux-gpio, linux-i2c, linux-kernel

On 04.04.2017 14:26, Mark Brown wrote:
> On Tue, Apr 04, 2017 at 10:28:23AM +0200, Michael Hennerich wrote:
>
>> A question came up, regarding whether it's recommended to mix regmap_i2c and
>> plain i2c_smbus or direct adapter transfers.
>
>> In this specific case for the i2c MUX portion we need to avoid double locks,
>> and therefore use un-locked direct adapter transfers.
>
>> The same time we also implement a small gpiochip, where we would like to use
>> regmap to avoid some boilerplate code for the register cache.
>
> That should work fine providing nothing tries to change cached registers
> underneath the regmap.  regmap won't be able to tell anything's changed
> otherwise.

Hi Mark,

Thanks for confirmation!

-- 
Greetings,
Michael

--
Analog Devices GmbH      Otl-Aicher Strasse 60-64      80807 München
Sitz der Gesellschaft München, Registergericht München HRB 40368,
Geschäftsführer: Peter Kolberg, Ali Raza Husain, Eileen Wynne

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: question about concurrent regmap i2c usage
@ 2017-04-05  6:31     ` Michael Hennerich
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Hennerich @ 2017-04-05  6:31 UTC (permalink / raw)
  To: Mark Brown; +Cc: linus.walleij, wsa, linux-gpio, linux-i2c, linux-kernel

On 04.04.2017 14:26, Mark Brown wrote:
> On Tue, Apr 04, 2017 at 10:28:23AM +0200, Michael Hennerich wrote:
>
>> A question came up, regarding whether it's recommended to mix regmap_i2c and
>> plain i2c_smbus or direct adapter transfers.
>
>> In this specific case for the i2c MUX portion we need to avoid double locks,
>> and therefore use un-locked direct adapter transfers.
>
>> The same time we also implement a small gpiochip, where we would like to use
>> regmap to avoid some boilerplate code for the register cache.
>
> That should work fine providing nothing tries to change cached registers
> underneath the regmap.  regmap won't be able to tell anything's changed
> otherwise.

Hi Mark,

Thanks for confirmation!

-- 
Greetings,
Michael

--
Analog Devices GmbH      Otl-Aicher Strasse 60-64      80807 München
Sitz der Gesellschaft München, Registergericht München HRB 40368,
Geschäftsführer: Peter Kolberg, Ali Raza Husain, Eileen Wynne

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-05  6:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04  8:28 question about concurrent regmap i2c usage Michael Hennerich
2017-04-04  8:28 ` Michael Hennerich
2017-04-04 12:26 ` Mark Brown
2017-04-05  6:31   ` Michael Hennerich
2017-04-05  6:31     ` Michael Hennerich

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.