From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760154AbbCDMwS (ORCPT ); Wed, 4 Mar 2015 07:52:18 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:59859 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754488AbbCDMwP (ORCPT ); Wed, 4 Mar 2015 07:52:15 -0500 Message-ID: <54F6FFE9.7030409@canonical.com> Date: Wed, 04 Mar 2015 13:51:53 +0100 From: Stefan Bader User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org CC: stable@vger.kernel.org, Jiang Liu , Sander Eikelenboom , Tony Luck , xen-devel@lists.xenproject.org, Konrad Rzeszutek Wilk , David Vrabel , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Bjorn Helgaas , Thomas Gleixner Subject: Re: [PATCH 3.18 129/151] x86/xen: Treat SCI interrupt as normal GSI interrupt References: <20150304055457.084276421@linuxfoundation.org> <20150304055518.612312946@linuxfoundation.org> In-Reply-To: <20150304055518.612312946@linuxfoundation.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Mjfs06PffNahFQ487of11Q4TRJIF2A1q3" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Mjfs06PffNahFQ487of11Q4TRJIF2A1q3 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 04.03.2015 07:14, Greg Kroah-Hartman wrote: > 3.18-stable review patch. If anyone has any objections, please let me = know. I thought I replied earlier today but I cannot seem to find it coming bac= k via the mailing list. Hope this is not duplicating too much... There was a regression with that patch and it requires the below commit as well to pr= event that: commit 1ea76fbadd667b19c4fa4466f3a3b55a505e83d9 Author: Jiang Liu Date: Mon Feb 16 10:11:13 2015 +0800 x86/irq: Fix regression caused by commit b568b8601f05 Commit b568b8601f05 ("Treat SCI interrupt as normal GSI interrupt") accidently removes support of legacy PIC interrupt when fixing a regression for Xen, which causes a nasty regression on HP/Compaq nc6000 where we fail to register the ACPI interrupt, and thus lose eg. thermal notifications leading a potentially overheated machine. -Stefan >=20 > ------------------ >=20 > From: Jiang Liu >=20 > commit b568b8601f05a591a7ff09d8ee1cedb5b2e815fe upstream. >=20 > Currently Xen Domain0 has special treatment for ACPI SCI interrupt, > that is initialize irq for ACPI SCI at early stage in a special way as:= > xen_init_IRQ() > ->pci_xen_initial_domain() > ->xen_setup_acpi_sci() > Allocate and initialize irq for ACPI SCI >=20 > Function xen_setup_acpi_sci() calls acpi_gsi_to_irq() to get an irq > number for ACPI SCI. But unfortunately acpi_gsi_to_irq() depends on > IOAPIC irqdomains through following path > acpi_gsi_to_irq() > ->mp_map_gsi_to_irq() > ->mp_map_pin_to_irq() > ->check IOAPIC irqdomain >=20 > For PV domains, it uses Xen event based interrupt manangement and > doesn't make uses of native IOAPIC, so no irqdomains created for IOAPIC= =2E > This causes Xen domain0 fail to install interrupt handler for ACPI SCI > and all ACPI events will be lost. Please refer to: > https://lkml.org/lkml/2014/12/19/178 >=20 > So the fix is to get rid of special treatment for ACPI SCI, just treat > ACPI SCI as normal GSI interrupt as: > acpi_gsi_to_irq() > ->acpi_register_gsi() > ->acpi_register_gsi_xen() > ->xen_register_gsi() >=20 > With above change, there's no need for xen_setup_acpi_sci() anymore. > The above change also works with bare metal kernel too. >=20 > Signed-off-by: Jiang Liu > Tested-by: Sander Eikelenboom > Cc: Tony Luck > Cc: xen-devel@lists.xenproject.org > Cc: Konrad Rzeszutek Wilk > Cc: David Vrabel > Cc: Rafael J. Wysocki > Cc: Len Brown > Cc: Pavel Machek > Cc: Bjorn Helgaas > Link: http://lkml.kernel.org/r/1421720467-7709-2-git-send-email-jiang.l= iu@linux.intel.com > Signed-off-by: Thomas Gleixner > Signed-off-by: Stefan Bader > Signed-off-by: Greg Kroah-Hartman >=20 > --- > arch/x86/kernel/acpi/boot.c | 21 ++++++++++--------- > arch/x86/pci/xen.c | 47 -----------------------------------= --------- > 2 files changed, 11 insertions(+), 57 deletions(-) >=20 > --- a/arch/x86/kernel/acpi/boot.c > +++ b/arch/x86/kernel/acpi/boot.c > @@ -604,18 +604,19 @@ void __init acpi_pic_sci_set_trigger(uns > =20 > int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp) > { > - int irq; > + int rc, irq, trigger, polarity; > =20 > - if (acpi_irq_model =3D=3D ACPI_IRQ_MODEL_PIC) { > - *irqp =3D gsi; > - } else { > - irq =3D mp_map_gsi_to_irq(gsi, > - IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK); > - if (irq < 0) > - return -1; > - *irqp =3D irq; > + rc =3D acpi_get_override_irq(gsi, &trigger, &polarity); > + if (rc =3D=3D 0) { > + trigger =3D trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE; > + polarity =3D polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH; > + irq =3D acpi_register_gsi(NULL, gsi, trigger, polarity); > + if (irq >=3D 0) { > + *irqp =3D irq; > + return 0; > + } > } > - return 0; > + return -1; > } > EXPORT_SYMBOL_GPL(acpi_gsi_to_irq); > =20 > --- a/arch/x86/pci/xen.c > +++ b/arch/x86/pci/xen.c > @@ -452,52 +452,6 @@ int __init pci_xen_hvm_init(void) > } > =20 > #ifdef CONFIG_XEN_DOM0 > -static __init void xen_setup_acpi_sci(void) > -{ > - int rc; > - int trigger, polarity; > - int gsi =3D acpi_sci_override_gsi; > - int irq =3D -1; > - int gsi_override =3D -1; > - > - if (!gsi) > - return; > - > - rc =3D acpi_get_override_irq(gsi, &trigger, &polarity); > - if (rc) { > - printk(KERN_WARNING "xen: acpi_get_override_irq failed for acpi" > - " sci, rc=3D%d\n", rc); > - return; > - } > - trigger =3D trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE; > - polarity =3D polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH; > - > - printk(KERN_INFO "xen: sci override: global_irq=3D%d trigger=3D%d " > - "polarity=3D%d\n", gsi, trigger, polarity); > - > - /* Before we bind the GSI to a Linux IRQ, check whether > - * we need to override it with bus_irq (IRQ) value. Usually for > - * IRQs below IRQ_LEGACY_IRQ this holds IRQ =3D=3D GSI, as so: > - * ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level) > - * but there are oddballs where the IRQ !=3D GSI: > - * ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 20 low level) > - * which ends up being: gsi_to_irq[9] =3D=3D 20 > - * (which is what acpi_gsi_to_irq ends up calling when starting the > - * the ACPI interpreter and keels over since IRQ 9 has not been > - * setup as we had setup IRQ 20 for it). > - */ > - if (acpi_gsi_to_irq(gsi, &irq) =3D=3D 0) { > - /* Use the provided value if it's valid. */ > - if (irq >=3D 0) > - gsi_override =3D irq; > - } > - > - gsi =3D xen_register_gsi(gsi, gsi_override, trigger, polarity); > - printk(KERN_INFO "xen: acpi sci %d\n", gsi); > - > - return; > -} > - > int __init pci_xen_initial_domain(void) > { > int irq; > @@ -509,7 +463,6 @@ int __init pci_xen_initial_domain(void) > x86_msi.msi_mask_irq =3D xen_nop_msi_mask_irq; > x86_msi.msix_mask_irq =3D xen_nop_msix_mask_irq; > #endif > - xen_setup_acpi_sci(); > __acpi_register_gsi =3D acpi_register_gsi_xen; > /* Pre-allocate legacy irqs */ > for (irq =3D 0; irq < nr_legacy_irqs(); irq++) { >=20 >=20 --Mjfs06PffNahFQ487of11Q4TRJIF2A1q3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJU9v/yAAoJEOhnXe7L7s6j/aYQAL3Vg7/CCyTrftUgAgO4N9/b L1deK4VhYm+lYoN5JgKXQseVBtRguElLDxcV/ony3h6FWk6c7dZrZ7pJUvv+dyOP ozQRpbIpCZxG0rtVAoBHNGqKO8uurpPPJ4NoyELyzpUptn63m/16oEnqUYAJqXnE 8qUKCGx3vFZ+BdM6ks4SxdNkqSBpLwVB8c+Y+iqn3Tz3dWuvmFtHdirWw85sapjn aPKxAUpE53rLn7ebbju4xBnBm64Q5KwpgRIyWGgakoF56JLxRZ6ytqlIeg8VNBGJ BMTDFHkjSkKifjZqc7qN12WTZhMx5NtMZqQRcmDAL+ykJfMOVGOZMbyXUEfUfmNw qGu6Xci45f0YiP5J7AyQAwa27bLUnzoS4KdDMIhwSRMxTO7QUYtW5pP9M7oarXxK wVvZgV/WcwzxBn9oNDORpfYjLqh5jAm/lET3KDZEXAAHEMptVO07iGcSVzecnLfR 8B2DyzXhHlCstZyTYeg6afVgqGHRF4R4Va+WLRbu7g16aLkrhnxm6+na1aw3Dxjf e1puqej6ZvkMPqBZ+F//m4VpjRje8c20i6ebaD5lzaJKAFgVDV1nNj+/FEW+mxMw R6FKV85WVDMQiOYKVPPbtFk4VnUHjgYPeT0V3SaVK/rEPKtZiQ/a/dKevr+cgdvh HtFMkuoeuyGbFY9GucsJ =w16e -----END PGP SIGNATURE----- --Mjfs06PffNahFQ487of11Q4TRJIF2A1q3--