linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Pavel Machek <pavel@denx.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Daniel Drake <drake@endlessm.com>,
	Ian W MORRISON <ianwmorrison@gmail.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH 4.19 16/50] gpiolib: acpi: Add gpiolib_acpi_run_edge_events_on_boot option and blacklist
Date: Fri, 20 Sep 2019 15:56:05 +0200	[thread overview]
Message-ID: <511ae431-2a0e-6362-094a-988c0f3e0db6@redhat.com> (raw)
In-Reply-To: <20190919074601.GA6968@amd>

Hi,

On 9/19/19 9:46 AM, Pavel Machek wrote:
> On Wed 2019-09-18 08:18:59, Greg Kroah-Hartman wrote:
>> From: Hans de Goede <hdegoede@redhat.com>
>>
>> commit 61f7f7c8f978b1c0d80e43c83b7d110ca0496eb4 upstream.
>>
>> Another day; another DSDT bug we need to workaround...
>>
>> Since commit ca876c7483b6 ("gpiolib-acpi: make sure we trigger edge events
>> at least once on boot") we call _AEI edge handlers at boot.
>>
>> In some rare cases this causes problems. One example of this is the Minix
>> Neo Z83-4 mini PC, this device has a clear DSDT bug where it has some copy
>> and pasted code for dealing with Micro USB-B connector host/device role
>> switching, while the mini PC does not even have a micro-USB connector.
>> This code, which should not be there, messes with the DDC data pin from
>> the HDMI connector (switching it to GPIO mode) breaking HDMI support.
>>
>> To avoid problems like this, this commit adds a new
>> gpiolib_acpi.run_edge_events_on_boot kernel commandline option, which
>> allows disabling the running of _AEI edge event handlers at boot.
> 
> So... apparently Windows does _not_ run _AEI edge event handlers at
> boot, otherwise Minix would realize that fault.

Right, also came the conclusion that Windows likely does not run
_AEI edge event handlers at boot.

> Would it make sense not to do it by default, either?

Well as the commit-msg for the commit which originally added this
explains, there are at least 2 reasons to run them at boot:

1) This is necessary on at least some ms surface devices to get
the initial LID state correct, otherwise the LID will be report
being closed until the first time it is actually closed +
opened again. Now this case we can probably quirk ourselves
out of in some way.

2) The other case is Cherry Trail based tablets. The hw on these
can typically do both USB device and host mode on the tablets
micro-b or type-c connector. This involves a mux which switches
the data lines between the host and device controllers inside the
Cherry Trail SoC. This mux is controlled by an edge-triggered ACPI
eventhandler connected to the ID pin of the micro-b connector.

OOTB Windows only supports host mode, I guess there might be some
way to get device mode to work under Windows but tablet manufacturers
do not seem to care about this.

By default many UEFI firmwares put the mux in host mode during boot,
independent of the actual ID pin value since they only care about host
mode and want to support e.g. booting from USB or an external kbd.

By default the ID pin on the micro-b connector is high (pulled up)
an actual micro-b to host(A-female) cable pulls the ID-pin to gnd,
a USB-A to micro-B cable such as used to connect the tablet to a PC
leaves the ID pin floating (pulled high).

So without a host adapter inserted, we boot with the mux in host
mode, and the ID pin high. Now if the user connects the tablet to
a PC (or it was connected at boot) the ID pin does not change,
the mux is not change and device mode does not work since the
mux is set wrong. The only way to fix this is to force the ID
pin to change, so that would mean inserting a host-adapter, removing
it again and then connecting the tablet to a PC.

Running the _AEI handler at boot correctly puts the mux in
device position fixing this. Almost all Cherry Trall devices
suffer from this, makig it impossible to quirk our way out of this.

Now arguably we could limit the running of _AEI handlers at boot
to Cherry Trail, I would not object to that, but the
Minix Neo Z83-4 mini PC is a Cherry Trail device itself, as
mentioned in the commit msg, the  troublesome _AEI handler on this
device is the same ID pin handler which we want to run boot on all
Cherry Trail tablets. In this mini-pc case it is wrong though since
the mini-pc does not even have a micro-b connector.

I hope this explains.

Regards,

Hans


  reply	other threads:[~2019-09-20 13:56 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18  6:18 [PATCH 4.19 00/50] 4.19.74-stable review Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 01/50] bridge/mdb: remove wrong use of NLM_F_MULTI Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 02/50] cdc_ether: fix rndis support for Mediatek based smartphones Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 03/50] ipv6: Fix the link time qualifier of ping_v6_proc_exit_net() Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 04/50] isdn/capi: check message length in capi_write() Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 05/50] ixgbe: Fix secpath usage for IPsec TX offload Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 06/50] net: Fix null de-reference of device refcount Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 07/50] net: gso: Fix skb_segment splat when splitting gso_size mangled skb having linear-headed frag_list Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 08/50] net: phylink: Fix flow control resolution Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 09/50] net: sched: fix reordering issues Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 10/50] sch_hhf: ensure quantum and hhf_non_hh_weight are non-zero Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 11/50] sctp: Fix the link time qualifier of sctp_ctrlsock_exit() Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 12/50] sctp: use transport pf_retrans in sctp_do_8_2_transport_strike Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 13/50] tcp: fix tcp_ecn_withdraw_cwr() to clear TCP_ECN_QUEUE_CWR Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 14/50] tipc: add NULL pointer check before calling kfree_rcu Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 15/50] tun: fix use-after-free when register netdev failed Greg Kroah-Hartman
2019-09-18  6:18 ` [PATCH 4.19 16/50] gpiolib: acpi: Add gpiolib_acpi_run_edge_events_on_boot option and blacklist Greg Kroah-Hartman
2019-09-19  7:46   ` Pavel Machek
2019-09-20 13:56     ` Hans de Goede [this message]
2019-09-18  6:19 ` [PATCH 4.19 17/50] gpio: fix line flag validation in linehandle_create Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 18/50] Btrfs: fix assertion failure during fsync and use of stale transaction Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 19/50] ixgbe: Prevent u8 wrapping of ITR value to something less than 10us Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 20/50] genirq: Prevent NULL pointer dereference in resend_irqs() Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 21/50] KVM: s390: kvm_s390_vm_start_migration: check dirty_bitmap before using it as target for memset() Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 22/50] KVM: s390: Do not leak kernel stack data in the KVM_S390_INTERRUPT ioctl Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 23/50] KVM: x86: work around leak of uninitialized stack contents Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 24/50] KVM: nVMX: handle page fault in vmread Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 25/50] x86/purgatory: Change compiler flags from -mcmodel=kernel to -mcmodel=large to fix kexec relocation errors Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 26/50] powerpc: Add barrier_nospec to raw_copy_in_user() Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 27/50] drm/meson: Add support for XBGR8888 & ABGR8888 formats Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 28/50] clk: rockchip: Dont yell about bad mmc phases when getting Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 29/50] mtd: rawnand: mtk: Fix wrongly assigned OOB buffer pointer issue Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 30/50] PCI: Always allow probing with driver_override Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 31/50] gpio: fix line flag validation in lineevent_create Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 32/50] ubifs: Correctly use tnc_next() in search_dh_cookie() Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 33/50] driver core: Fix use-after-free and double free on glue directory Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 34/50] crypto: talitos - check AES key size Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 35/50] crypto: talitos - fix CTR alg blocksize Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 36/50] crypto: talitos - check data blocksize in ablkcipher Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 37/50] crypto: talitos - fix ECB algs ivsize Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 38/50] crypto: talitos - Do not modify req->cryptlen on decryption Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 39/50] crypto: talitos - HMAC SNOOP NO AFEU mode requires SW icv checking Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 40/50] firmware: ti_sci: Always request response from firmware Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 41/50] drm: panel-orientation-quirks: Add extra quirk table entry for GPD MicroPC Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 42/50] drm/mediatek: mtk_drm_drv.c: Add of_node_put() before goto Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 43/50] Revert "Bluetooth: btusb: driver to enable the usb-wakeup feature" Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 44/50] iio: adc: stm32-dfsdm: fix data type Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 45/50] modules: fix BUG when load module with rodata=n Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 46/50] modules: fix compile error if dont have strict module rwx Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 47/50] platform/x86: pmc_atom: Add CB4063 Beckhoff Automation board to critclk_systems DMI table Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 48/50] rsi: fix a double free bug in rsi_91x_deinit() Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 49/50] nvmem: Use the same permissions for eeprom as for nvmem Greg Kroah-Hartman
2019-09-18  6:19 ` [PATCH 4.19 50/50] x86/build: Add -Wnoaddress-of-packed-member to REALMODE_CFLAGS, to silence GCC9 build warning Greg Kroah-Hartman
2019-09-18 11:59 ` [PATCH 4.19 00/50] 4.19.74-stable review kernelci.org bot
2019-09-18 12:59 ` Guenter Roeck
2019-09-18 13:40   ` Greg Kroah-Hartman
2019-09-18 13:51     ` Greg Kroah-Hartman
2019-09-18 16:28 ` Jon Hunter
2019-09-18 19:15 ` Naresh Kamboju
2019-09-18 19:37 ` Guenter Roeck
2019-09-19  6:37   ` Greg Kroah-Hartman
2019-09-19  1:24 ` shuah

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=511ae431-2a0e-6362-094a-988c0f3e0db6@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=drake@endlessm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ianwmorrison@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=pavel@denx.de \
    --cc=stable@vger.kernel.org \
    /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).