Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2530851pxj; Mon, 10 May 2021 05:17:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvlcvYE+5qGjccft617EerKCo46O0lLYBnYHzuK0198ApPBZDtRa0o1vjmNsh9akx8+QUR X-Received: by 2002:a92:ad07:: with SMTP id w7mr20668617ilh.98.1620649078677; Mon, 10 May 2021 05:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620649078; cv=none; d=google.com; s=arc-20160816; b=MUH/ModJ1k66YU9vCcjZcJyrGCsNdN+qtqriEBStxpHPvVngkYoX+nm4Poukv1AnvS Z5WrEaP2gpVZyRBTapS/5pM7H0JQ+uMfhnpxGOaLbJa7WhdfvvEmISkwR+GjXrwFjQ27 1KjeFC82Tmc6IwKPYqM+EfdyPD2X/GyahC2NsaWEwveN0SxxCf6yrzYUwsx1KA3TgRa7 fLb3pb/zmtBvGjWP5cp+zUrkG9U1uehyM948MI+Woeh11nPWwZFoJBoFqGaFUxrsqaQ2 EIfl7FYtSBSM69vchAPQO5KBtW7upepANHPtxlYMr+s30lbY7plhdIMRoyHEiSfQw/0Z 6iSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Xxw4fhZwneBvK5AjJ9wQRjs33093PNxQTuOKxLSA2sI=; b=vIacLsstPYoVt4+ksarQIV6yefQXT0GFU8ZrXl+/JJpcGsfkofqDjI0IKAAzhF+2mE PuwQp3GPYLG6sew9INqJP2IZ6KGLEtCVyYUNYjDEelDwxxRgXtZUkeJowk8VraJ/gyGH ELKRssKNw21DrSIMIkcOJC/bfbUKDTYWwzVK850dFUtO2Nq7GNCEWaYZRrYAqKpqEr9O 8SrIVbxM1uMZE9LF+mS7MaahGnpPWqLVyUkLuZ6+Vgklo44ZeHvmJY5yet2P3iHEQ75s H+qUOySMyr3r+2uP6tgCfo2CJlbdn6XpF+oJTONcL/mseKfsT43jTU7MNctQAVeBvfjd p+vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wQrk7CQ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l24si14511406ioh.105.2021.05.10.05.17.46; Mon, 10 May 2021 05:17:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wQrk7CQ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344710AbhEJMQM (ORCPT + 99 others); Mon, 10 May 2021 08:16:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:41148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236667AbhEJLI1 (ORCPT ); Mon, 10 May 2021 07:08:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2B29A619B1; Mon, 10 May 2021 11:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620644580; bh=jAp4gb9NGpPWN1wVCjD1tzyOhWefvb5pIYs3Jpfd0PM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wQrk7CQ+xC/leFNM0gXfP2BUWYWd6sxhXFL9bd9T254scZdG5L833KQqLIL7Ddw2z i/Z8u+D+gFwB/aI7N8qjTBy4+8lvaLplOtzXlQABAoXUn7M2RMvKG3pvJY4mhWJI+j FNPhFCOmp6Sb/YlqyPfxKtSKhylmHOklg9CpNyhE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Angela Czubak , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.12 113/384] resource: Prevent irqresource_disabled() from erasing flags Date: Mon, 10 May 2021 12:18:22 +0200 Message-Id: <20210510102018.621884564@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102014.849075526@linuxfoundation.org> References: <20210510102014.849075526@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Angela Czubak [ Upstream commit d08a745729646f407277e904b02991458f20d261 ] Some Chromebooks use hard-coded interrupts in their ACPI tables. This is an excerpt as dumped on Relm: ... Name (_HID, "ELAN0001") // _HID: Hardware ID Name (_DDN, "Elan Touchscreen ") // _DDN: DOS Device Name Name (_UID, 0x05) // _UID: Unique ID Name (ISTP, Zero) Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings { Name (BUF0, ResourceTemplate () { I2cSerialBusV2 (0x0010, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.I2C1", 0x00, ResourceConsumer, , Exclusive, ) Interrupt (ResourceConsumer, Edge, ActiveLow, Exclusive, ,, ) { 0x000000B8, } }) Return (BUF0) /* \_SB_.I2C1.ETSA._CRS.BUF0 */ } ... This interrupt is hard-coded to 0xB8 = 184 which is too high to be mapped to IO-APIC, so no triggering information is propagated as acpi_register_gsi() fails and irqresource_disabled() is issued, which leads to erasing triggering and polarity information. Do not overwrite flags as it leads to erasing triggering and polarity information which might be useful in case of hard-coded interrupts. This way the information can be read later on even though mapping to APIC domain failed. Signed-off-by: Angela Czubak [ rjw: Changelog rearrangement ] Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- include/linux/ioport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 55de385c839c..647744d8514e 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -331,7 +331,7 @@ static inline void irqresource_disabled(struct resource *res, u32 irq) { res->start = irq; res->end = irq; - res->flags = IORESOURCE_IRQ | IORESOURCE_DISABLED | IORESOURCE_UNSET; + res->flags |= IORESOURCE_IRQ | IORESOURCE_DISABLED | IORESOURCE_UNSET; } extern struct address_space *iomem_get_mapping(void); -- 2.30.2