From: Mark Brown <broonie@kernel.org>
To: Paul Osmialowski <p.osmialowsk@samsung.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
Jonathan Corbet <corbet@lwn.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kukjin Kim <kgene@kernel.org>,
linux-i2c@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org
Subject: Re: [RFC 2/3] regmap: Use the enhancement of i2c API to address circular dependency problem
Date: Mon, 19 Jan 2015 19:25:57 +0000 [thread overview]
Message-ID: <20150119192557.GI2809@sirena.org.uk> (raw)
In-Reply-To: <alpine.DEB.2.10.1501191031080.13777@AMDC1262.digital.local>
[-- Attachment #1: Type: text/plain, Size: 2944 bytes --]
On Mon, Jan 19, 2015 at 10:31:22AM +0100, Paul Osmialowski wrote:
> On Fri, 16 Jan 2015, Mark Brown wrote:
> >What I'm saying is that I want to understand this change from a point of
> >view that isn't tied to I2C - at the regmap level what is this doing,
> From the regmap point of view, it allows its functions to have a chance to
> prepare transfer medium for (synchronous) transfer (no matter what bus
> handles it) before it actually start to happen (then unprepare it when it's
> done) and crucially before any lock is obtained in functions like
> regmap_write(), regmap_read() or regmap_update_bits.
OK, so that's what should go in the changelog (along with an explanation
of why this preparation is required at all) - but I still don't see the
async bit of this I'm afraid.
> Maybe adding a pair of callbacks (map->reg_write_sync_prepared(),
> map->reg_read_sync_prepared()) would make situation clearer.
No, I don't think so - it'd just complicate the callers.
> >I2C is a bus that has some properties which you're saying needs some
> >changes, what are those properties and those changes?
> I'm not saying I2C as a bus requires changes. What I'm saying is that I2C
> API can be extended to allow more detailed control on what happens with the
> transfer.
My point here is that your explanation is in terms of I2C specifics and
not really at a generic regmap level.
> >Can you be more specific please? If something needs preparing it seems
> >like it'd need preparing over an async transaction just as much as over
> >a synchronous one.
> Even with those preparation and unpreparation stages, this transfer is still
> synchronous. For example, it starts when regmap_read() starts and ends when
> regmap_read() ends. Nothing is queued or deferred. Namely, when
> max_gen_clk_unprepare() function calls regmap_update_bits() it expects that
> when regmap_update_bits() returned, no outstanding transfer are happening
> nor waiting to proceed. Everything must be completed before returning to
> max_gen_clk_unprepare().
That doesn't address my question - all you're saying is that in a
synchronous call path things are synchronous which is fine but obviously
regmap supports async I/O too.
> >Not in this pattern where the caller needs to check too.
> I don't persist on that. Apparently, you're the author of this file, though
> regmap_init() function was later expanded by other guys. They never assigned
> bus callback function pointers directly to map operation callbacks. It is
> possible to replace 'map->reg_prepare_sync_io = regmap_bus_prepare_sync_io'
> with 'map->reg_prepare_sync_io = map->bus->prepare_sync_io' - this will
> compile and this will work properly. But IMHO it wouldn't match with what
> the others did.
If you look at the other callbacks they're doing other things beyond
simply forwarding the functions on. That's the problem here, the
functions just add a layer of indirection and nothing else.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-01-19 19:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-16 14:39 [RFC 1/3] i2c: Enhancement of i2c API to address circular lock dependency problem Paul Osmialowski
2015-01-16 14:39 ` [RFC 2/3] regmap: Use the enhancement of i2c API to address circular " Paul Osmialowski
2015-01-16 16:23 ` Mark Brown
2015-01-16 17:36 ` Paul Osmialowski
[not found] ` <alpine.DEB.2.10.1501161811280.21618-rWxBz+Dn3+580y0nlK0+ubjjLBE8jN/0@public.gmane.org>
2015-01-16 18:36 ` Mark Brown
2015-01-16 18:36 ` Mark Brown
2015-01-19 9:31 ` Paul Osmialowski
2015-01-19 19:25 ` Mark Brown [this message]
2015-01-20 11:14 ` Paul Osmialowski
[not found] ` <alpine.DEB.2.10.1501201214200.8428-rWxBz+Dn3+580y0nlK0+ubjjLBE8jN/0@public.gmane.org>
2015-01-27 18:12 ` Mark Brown
2015-01-27 18:12 ` Mark Brown
2015-01-16 14:39 ` [RFC 3/3] i2c: s3c2410: Adopt i2c-s3c2410 driver for new enhancement of i2c API Paul Osmialowski
[not found] ` <1421419194-1849-3-git-send-email-p.osmialowsk-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-01-16 16:28 ` Mark Brown
2015-01-16 16:28 ` Mark Brown
[not found] ` <1421419194-1849-1-git-send-email-p.osmialowsk-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-01-18 6:30 ` [RFC 1/3] i2c: Enhancement of i2c API to address circular lock dependency problem Tomasz Figa
2015-01-18 6:30 ` Tomasz Figa
2015-01-18 10:54 ` Krzysztof Kozlowski
2015-01-18 13:41 ` Mark Brown
2015-02-25 19:47 ` Mike Turquette
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=20150119192557.GI2809@sirena.org.uk \
--to=broonie@kernel.org \
--cc=corbet@lwn.net \
--cc=gregkh@linuxfoundation.org \
--cc=kgene@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=p.osmialowsk@samsung.com \
--cc=wsa@the-dreams.de \
/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.