devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
	Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
	Gregory Clement <gregory.clement@free-electrons.com>,
	Gabriel Dobato <dobatog@gmail.com>,
	linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/4] i2c: mux-pinctrl: Rework to honor disabled child nodes
Date: Fri, 27 Mar 2015 22:08:06 +0100	[thread overview]
Message-ID: <5515C6B6.7080903@gmail.com> (raw)
In-Reply-To: <20150323183211.GB1128@katana>

On 23.03.2015 19:32, Wolfram Sang wrote:
>> If modifying i2c-mux-pinctrl to respect the sub-bus status property is
>> such a big issue, I'd rather leave the driver as is and expose all
>> sub-busses to userspace.
>
> Well, dunno what 'big issue' is in your book :) What definately needs to
> be done is:

Wolfram,

I had a look at the code in question again and prepared some patches
to return ERR_PTRs from i2c_add_mux_adapter(), rework users to check
for IS_ERR() and finally skip i2c_add_adapter for the OF disabled case.

I have them compile-tested but I don't have any hardware available
right now.

Anyway, I still have some questions.

> * handle "status" at mux-core level, not mux-driver

I get that.. but:

> * that probably needs us to convert i2c_add_mux_adapter() to return
>    ERR_PTRs instead of NULL, so we can distinguish the "disabled" case

What do you want to return from i2c_add_mux_adapter() if you find an OF
disabled child node?

AFAIKS, there is no explicit errno for a disabled device (node) so all
I can imagine here is to return either the &priv->adap before actually
calling i2c_add_adapter on it or NULL now that we explicitly check for
errors.

> * that would mean to fix all existing users

If we choose to return NULL, those users who can deal with a
missing/disabled sub-bus on the mux can check with IS_ERR()
the others should check with IS_ERR_OR_NULL().

We could also choose to return some other errno (-ENODEV maybe)
but still we'd have to double-check that return value on i2c-mux-pinctrl
and the others too if we don't care that i2c_add_adapter() wasn't
called for a mux.

> That's all not groundbreaking stuff, but needs caution and thoroughness.
> There might be some gory details left, though...

As I said before, the intention was not disable a possible i2c bus that
can be dynamically added/removed on that specific Dove SBC/CM-A510
board but to have a single i2c-mux-pinctrl in the SoC dtsi just because
the SoC has the optional i2c bus muxing.

While thinking about it (and I still think of it as a 'big issue'
compared to the intention of the initial patch) I came to the
conclusion that I should maybe just go for a board-specific
i2c-mux-pinctrl node instead of adding it to the SoC dtsi. That will
also avoid doubled i2c busses on boards with just the default i2c
option.

Sebastian

  reply	other threads:[~2015-03-27 21:08 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-17 18:52 [PATCH 0/8] Add proper support for Compulab CM-A510/SBC-A510 Sebastian Hesselbarth
2015-02-17 18:52 ` [PATCH 1/8] i2c: mux-pinctrl: Rework to honor disabled child nodes Sebastian Hesselbarth
     [not found]   ` <1424199129-22099-2-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-02-17 20:46     ` Stephen Warren
     [not found]       ` <54E3A8A7.8080703-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-02-17 21:08         ` Sebastian Hesselbarth
2015-02-17 21:15           ` Stephen Warren
2015-02-17 21:19             ` Sebastian Hesselbarth
2015-02-26 21:46   ` Stephen Warren
2015-02-17 18:52 ` [PATCH 2/8] devicetree: vendor-prefixes: Add CompuLab to known vendors Sebastian Hesselbarth
2015-02-17 19:37   ` Rob Herring
2015-02-17 18:52 ` [PATCH 7/8] ARM: dts: dove: Add internal i2c multiplexer node Sebastian Hesselbarth
     [not found]   ` <1424199129-22099-8-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-02-23 15:07     ` Gregory CLEMENT
     [not found] ` <1424199129-22099-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-02-26 17:55   ` [PATCH 0/8] Add proper support for Compulab CM-A510/SBC-A510 Gregory CLEMENT
2015-02-26 19:39     ` Sebastian Hesselbarth
2015-02-26 20:01       ` Stephen Warren
2015-02-26 20:35         ` Sebastian Hesselbarth
2015-02-27 12:24   ` [PATCH v2 0/4] " Sebastian Hesselbarth
     [not found]     ` <1425039885-5137-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-02-27 12:24       ` [PATCH v2 1/4] i2c: mux-pinctrl: Rework to honor disabled child nodes Sebastian Hesselbarth
     [not found]         ` <1425039885-5137-2-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-02 20:01           ` Stephen Warren
     [not found]             ` <54F4C185.9080808-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-03-04  9:10               ` Sebastian Hesselbarth
2015-03-09 12:21           ` [PATCH v3 " Sebastian Hesselbarth
     [not found]             ` <1425903665-19343-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-10 16:28               ` Stephen Warren
     [not found]                 ` <54FF1BAA.3060409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-03-16 20:15                   ` Sebastian Hesselbarth
2015-03-18 12:30             ` Wolfram Sang
2015-03-18 13:23               ` Sebastian Hesselbarth
2015-03-18 14:00                 ` Wolfram Sang
2015-03-18 23:10                   ` Sebastian Hesselbarth
     [not found]                     ` <550A05E5.3050100-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-19 10:09                       ` Wolfram Sang
2015-03-19 10:48                         ` Wolfram Sang
2015-03-19 15:47                         ` Stephen Warren
     [not found]                           ` <550AEF9D.6090307-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-03-19 16:02                             ` Wolfram Sang
2015-03-19 16:49                               ` Stephen Warren
2015-03-19 20:52                               ` Sebastian Hesselbarth
2015-03-20 10:19                                 ` Wolfram Sang
2015-03-21 21:00                                   ` Wolfram Sang
2015-03-22 13:03                                     ` Sebastian Hesselbarth
     [not found]                                       ` <550EBDBC.9000903-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-23 18:32                                         ` Wolfram Sang
2015-03-27 21:08                                           ` Sebastian Hesselbarth [this message]
     [not found]                                             ` <5515C6B6.7080903-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-04-03 18:17                                               ` Wolfram Sang
2015-02-27 12:24     ` [PATCH v2 2/4] devicetree: vendor-prefixes: Add CompuLab to known vendors Sebastian Hesselbarth
2015-02-27 12:24     ` [PATCH v2 3/4] ARM: dts: dove: Add internal i2c multiplexer node Sebastian Hesselbarth

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=5515C6B6.7080903@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dobatog@gmail.com \
    --cc=gregory.clement@free-electrons.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swarren@wwwdotorg.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).