lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 29 Dec 2020 15:06:35 +0000
From:   Charles Keepax <ckeepax@...nsource.cirrus.com>
To:     Hans de Goede <hdegoede@...hat.com>
CC:     Mark Brown <broonie@...nel.org>, Lee Jones <lee.jones@...aro.org>,
        MyungJoo Ham <myungjoo.ham@...sung.com>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        Cezary Rojewski <cezary.rojewski@...el.com>,
        Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        Liam Girdwood <liam.r.girdwood@...ux.intel.com>,
        Jie Yang <yang.jie@...ux.intel.com>,
        <patches@...nsource.cirrus.com>, <linux-kernel@...r.kernel.org>,
        <alsa-devel@...a-project.org>
Subject: Re: [PATCH 01/14] mfd: arizona: Add jack pointer to struct arizona

On Tue, Dec 29, 2020 at 02:57:38PM +0100, Hans de Goede wrote:
> On 12/29/20 2:06 PM, Charles Keepax wrote:
> > On Mon, Dec 28, 2020 at 04:28:07PM +0000, Mark Brown wrote:
> >> On Mon, Dec 28, 2020 at 02:16:04PM +0100, Hans de Goede wrote:
> >>
> >>> And more in general AFAIK extcon is sort of deprecated and it is
> >>> not advised to use it for new code. I would esp. not expect it to
> >>> be used for new jack-detection code since we already have standard
> >>> uAPI support for that through sound/core/jack.c .
> >>
> >> Has Android been fixed to use the ALSA/input layer interfaces?  That's
> >> why that code is there, long term the goal was to have ALSA generate
> >> extcon events too so userspace could fall over to using that.  The basic
> >> thing at the time was that nobody liked any of the existing interfaces
> >> (the input layer thing is a total bodge stemming from it having been
> >> easy to hack in a key for GPIO detection and using ALSA controls means
> >> having to link against alsa-lib which is an awful faff for system level
> >> UI stuff) and there were three separate userspace interfaces used by
> >> different software stacks which needed to be joined together, extcon was
> >> felt to be a bit more designed and is a superset so that was the
> >> direction we were heading in.
> > 
> > Android has been updated to have the option to catch input events
> > for jack detection now.
> > 
> > I have always been slightly confused between extcon and the ALSA
> > jack reporting and have been unsure as to what is the longer term
> > plan here. I vaguely thought there was a gentle plan to move to
> > extcon, it is interesting to see Hans basically saying the
> > opposite that extcon is intended to be paritially deprecated. I
> > assume you just mean with respect to audio jacks, not other
> > connector types?
> 
> No I mean that afaik extcon is being deprecated in general. Extcon
> is mostly meant for kernel internal use, to allow things like
> charger-type-detection done by e.g. a fsa micro-usb mux or a
> Type-C PD controller to be hooked up to the actual charger chip
> and set the input-current-limit based on this.
> 

Fascinating thanks for taking the time to write such detailed
answers. I thought it was mostly intended for user-space usage,
but I guess I never really thought through that most of this
stuff you don't really need to know from user-space.

> > I would agree with Mark though that if extcon exists for external
> > connectors it seems odd that audio jacks would have their own
> > special way rather than just using the connector stuff.
> 
> Well as I said above in me experience the extcon code is (was) mostly
> meant for kernel internal use. The sysfs API is more of a debugging
> tool then anything else (IMHO).
> 
> Also the kernel has support for a lot of sound devices, including
> many with jack-detection support. Yet a grep for EXTCON_JACK_HEADPHONE
> over the entire mainline kernel tree shows that only extcon-arizona.c
> is using it. So given that we have dozens of drivers providing jack
> functionality through the sound/core/jack.c core and only 1 driver
> using the extcon interface I believe that the ship on how to export
> this to userspace has long sailed, since most userspace code will
> clearly expect the sound/core/jack.c way of doing things to be used.
> 
> Arguably we should/could maybe even drop the extcon part of extcon-arizona.c
> but I did not do that as I did not want to regress existing userspace
> code which may depend on this (on specific embedded/android devices).
> 

All reasonable arguments, with Android now supporting input
events for jacks I guess there would be no need for us to use
extcon for future devices.

There is maybe more argument for porting the Arizona code across
anyways, since for a long time Android didn't properly support extcon
either. It supported the earlier out of tree switch stuff, extcon
had a switch compatibility mode, but that didn't actually work I
think due to android hard coding some sysfs naming or something
(memory is a little fuzzy on the details was a while ago now).

I think extcon support was fixed in Android at about the same time
the support for input events was added. So it might be harmless but
someone probably needs to go and check the timeline before we go
changing stuff.

Thanks,
Charles

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ