xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Roman Shaposhnik <roman@zededa.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Paul Durrant" <paul@xen.org>, "Jan Beulich" <jbeulich@suse.com>,
	sstabellini@kernel.org
Subject: Re: Xen 4.14.0 is busted on Dell 300x IoT Gateways
Date: Thu, 20 Aug 2020 18:39:01 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.21.2008201823050.6005@sstabellini-ThinkPad-T480s> (raw)
In-Reply-To: <CAMmSBy9-cJuxC0jLPh6O-UCraThzg2wvNO29ZvxrBmVkatt_sg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2230 bytes --]

On Tue, 18 Aug 2020, Roman Shaposhnik wrote:
> Hi!
> first things first -- booting on those devices have always
> required efi=no-rs -- but it seems that Xen 4.14 is now 
> busted at a more fundamental level. I'm attaching two
> boot sequences (one with kernel 4.19.5 and one with 5.4.51)
> in the hopes that this may provide some clues right away.
> 
> Any help would be greatly appreciated!
> 
> Oh, and finally it appears that this is NOT a regression from
> Xen 4.13 -- it fails the same way. I haven't tried Xen's earlier
> than that.

FYI Roman and I tracked down the issue and it is due to the gpio
controller driver (drivers/pinctrl/intel/pinctrl-baytrail.c) overwriting
the interrupt handler data used by Xen to store the irq_data structure.

I have a very small tentative workaround, see below. It allows the
kernel to boot successfully as dom0 and gpio writes work. I am still
thinking on how to fix the issue properly in an upstreamable way, but I
wanted to send this out to the list right away in case somebody else is
stuck on this problem.


diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
index f38d596efa05..acd28a9e6a8a 100644
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -1604,8 +1604,8 @@ static struct irq_chip byt_irqchip = {
 static void byt_gpio_irq_handler(struct irq_desc *desc)
 {
 	struct irq_data *data = irq_desc_get_irq_data(desc);
-	struct byt_gpio *vg = gpiochip_get_data(
-				irq_desc_get_handler_data(desc));
+	struct gpio_chip *gc = irq_desc_get_chip_data(desc);
+	struct byt_gpio *vg = (struct byt_gpio *)gc;
 	struct irq_chip *chip = irq_data_get_irq_chip(data);
 	u32 base, pin;
 	void __iomem *reg;
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index a2b3d9de999c..b9551fb41ed1 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -1003,7 +1003,8 @@ irq_set_chained_handler_and_data(unsigned int irq, irq_flow_handler_t handle,
 	if (!desc)
 		return;
 
-	desc->irq_common_data.handler_data = data;
+	if (!desc->irq_common_data.handler_data)
+		desc->irq_common_data.handler_data = data;
 	__irq_do_set_handler(desc, handle, 1, NULL);
 
 	irq_put_desc_busunlock(desc, flags);

  parent reply	other threads:[~2020-08-21  1:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 22:09 Xen 4.14.0 is busted on Dell 300x IoT Gateways Roman Shaposhnik
2020-08-18 22:20 ` Andrew Cooper
2020-08-18 22:34   ` Roman Shaposhnik
2020-08-21  1:39 ` Stefano Stabellini [this message]
2020-08-21  7:15 ` [PATCH 0/2] Xen: Use a dedicated pointer for IRQ data Sergey Temerkhanov
2020-08-21  7:15   ` [PATCH 1/2] Xen: Use a dedicated irq_info structure pointer Sergey Temerkhanov
2020-08-21  7:15   ` [PATCH 2/2] Xen: Rename irq_info structure Sergey Temerkhanov
2020-08-21 10:18   ` [PATCH 0/2] Xen: Use a dedicated pointer for IRQ data Jürgen Groß
2020-08-21 11:19     ` Sergei Temerkhanov
2020-08-21 12:17       ` Jürgen Groß
2020-08-21 20:07         ` Thomas Gleixner
2020-08-21 20:38           ` Sergei Temerkhanov
2020-08-22  0:16             ` Thomas Gleixner
2020-08-25  3:14           ` Stefano Stabellini
2020-08-25  8:58             ` Thomas Gleixner
2020-08-25 13:49               ` Jürgen Groß
2020-08-25 15:22                 ` [PATCH] xen/events: Use chip data for storing per IRQ XEN data pointer, Thomas Gleixner
2020-08-25 15:43                   ` [PATCH] xen/events: Use chip data for storing per IRQ XEN data pointer Jürgen Groß
2020-08-25 22:04                     ` Roman Shaposhnik

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=alpine.DEB.2.21.2008201823050.6005@sstabellini-ThinkPad-T480s \
    --to=sstabellini@kernel.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=paul@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=roman@zededa.com \
    --cc=xen-devel@lists.xenproject.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).