mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vz@mleia.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Laurent Meunier <laurent.meunier@st.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Russell King <linux@arm.linux.org.uk>
Subject: [PATCH v2 0/2] pinctrl: remove unused 'pinconf-config' debugfs interface
Date: Tue, 22 Jan 2019 23:18:20 +0200	[thread overview]
Message-ID: <20190122211822.7016-1-vz@mleia.com> (raw)

The main goal of the change is to remove .pin_config_dbg_parse_modify
callback before a driver with its support appears. So far the in-kernel
interface did not attract any users since its introduction 5 years ago.

Originally .pin_config_dbg_parse_modify callback and the associated
'pinconf-config' debugfs file were introduced in commit f07512e615dd
("pinctrl/pinconfig: add debug interface"), a short description of
'pinconf-config' usage for debugging can be expressed this way:

Write to 'pinconf-config' (see pinconf_dbg_config_write() function):

% echo -n modify $map_type $device_name $state_name $pin_name $config > \
	/sys/kernel/debug/pinctrl/$pinctrl/pinconf-config

It supposes to update a global (therefore single!) 'pinconf_dbg_conf'
variable with an alternative setting, the arguments should match
an existing pinconf device and some registered pinctrl mapping 'map':

* $map_type is either 'config_pin' or 'config_group', it should match
  'map->type' value of PIN_MAP_TYPE_CONFIGS_PIN or
   PIN_MAP_TYPE_CONFIGS_GROUP accordingly,
* $device_name should match 'map->dev_name' string value,
* $state_name should match 'map->name' string value,
* $pin_name should match 'map->data.configs.group_or_pin' string value,

If all above has matched, then $config is a new value to be set by calling
pinconfops->pin_config_dbg_parse_modify(pctldev, config, matched_config).

After a successful write into 'pinconf-config' a user can read the file
to get information about that single modified pin configuration.

The fact is .pin_config_dbg_parse_modify callback has never been defined
in 'struct pinconf_ops' of any pinconf driver, thus an actual modification
of a pin or group state on any present pinconf controller does not happen,
and it declares that all related code is no more than dead code.

I discovered the issue while attempting to add .pin_config_dbg_parse_modify
support in some drivers and found that too short 'MAX_NAME_LEN' set by

  drivers/pinctrl/pinconf.c:372:#define MAX_NAME_LEN 15

is practically insufficient to store a regular pinctrl device name,
which are like 'e6060000.pin-controller-sh-pfc' or pin names like
'MX6QDL_PAD_ENET_REF_CLK', thus it is another indicator that the code
is barely usable, insufficiently tested and unprepossessing.

Of course it might be possible to increase MAX_NAME_LEN, and then add
.pin_config_dbg_parse_modify callbacks to the drivers, but the whole
idea of such a limited debug option looks inviable. A more flexible
way to functionally substitute the original approach is to implicitly
or explicitly use pinctrl_select_state() function whenever needed.

The proposal is to remove the changes added by commit f07512e615dd
("pinctrl/pinconfig: add debug interface") for now, as described in
patch 2/2 commit message it may affect only non-vanilla kernels formally.

Note that still it is a debugfs UAPI change, which is supposed to be
unstable, however, since 'pinconf-config' file is plainly unusable
on vanilla, I won't expect any user reports or asks to restore it back,
this my assumption nudges me not to add an RFC tag to the published
change.

Changes from v1 to v2:
* added one patch against cirrus/pinctrl-madera-core.c to avoid a compile
  time warning due to a removed header inclusion

Vladimir Zapolskiy (2):
  pinctrl: remove pinctrl/machine.h inclusion from pinctrl/pinconf.h
  pinctrl: remove unused 'pinconf-config' debugfs interface

 drivers/pinctrl/cirrus/pinctrl-madera-core.c |   1 +
 drivers/pinctrl/pinconf.c                    | 222 -------------------
 include/linux/pinctrl/pinconf.h              |   6 -
 3 files changed, 1 insertion(+), 228 deletions(-)

-- 
2.20.1


             reply	other threads:[~2019-01-22 21:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 21:18 Vladimir Zapolskiy [this message]
2019-01-22 21:18 ` [PATCH v2 1/2] pinctrl: remove pinctrl/machine.h inclusion from pinctrl/pinconf.h Vladimir Zapolskiy
2019-01-23 11:42   ` Richard Fitzgerald
2019-01-22 21:18 ` [PATCH v2 2/2] pinctrl: remove unused 'pinconf-config' debugfs interface Vladimir Zapolskiy
2019-01-28 13:41 ` [PATCH v2 0/2] " Linus Walleij

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=20190122211822.7016-1-vz@mleia.com \
    --to=vz@mleia.com \
    --cc=laurent.meunier@st.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=yamada.masahiro@socionext.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

all inboxes | Powered by JetHome®