From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18110C46CD3 for ; Thu, 21 Dec 2023 12:40:48 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.658864.1028279 (Exim 4.92) (envelope-from ) id 1rGILf-0006zU-CI; Thu, 21 Dec 2023 12:40:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 658864.1028279; Thu, 21 Dec 2023 12:40:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rGILf-0006zN-8c; Thu, 21 Dec 2023 12:40:23 +0000 Received: by outflank-mailman (input) for mailman id 658864; Thu, 21 Dec 2023 12:40:22 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rGILe-0006zH-GP for xen-devel@lists.xenproject.org; Thu, 21 Dec 2023 12:40:22 +0000 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [2a00:1450:4864:20::433]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 1a50ceef-9ffe-11ee-98eb-6d05b1d4d9a1; Thu, 21 Dec 2023 13:40:20 +0100 (CET) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-33679c49fe5so611959f8f.3 for ; Thu, 21 Dec 2023 04:40:20 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id c18-20020a5d4152000000b0033609b71825sm1956258wrq.35.2023.12.21.04.40.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Dec 2023 04:40:19 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 1a50ceef-9ffe-11ee-98eb-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1703162420; x=1703767220; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=eWiGAjoKj5nsfdR0+g/h457i1lzUsHRttMiW/lyiqxE=; b=dRCIpOBRI/Yh3V0WpygkmeQRQ7gST8A8cZS3XRFZq+bsqPALgWIbjBUAFP2CnCa6ls Q+JAPDfHaS2bpO7EWnb1+uMsUlSWfMXTsyxJkgSqGIiqfHEdxnJegTYElow+HRshdxcr Efnx2NbUTOZ/1PCeue7Xpy4ED2G4LkOwym+pzdPwJ4lLrG1wf7V8Hoo6IAhT8k3hdWs5 zjFLRhDIFEELRbcHf0dmaeUZ+Q3J/039vLud+tPBEFtLZaSq7Hv2BZ0ya3ifzNIkahKt IFbDBq/U04aQruG6H/mnB/A5agONTSSbcJXu9CLI9d6SpcVdLYnnjtCTmbCWs7xAf+OS iQVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703162420; x=1703767220; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eWiGAjoKj5nsfdR0+g/h457i1lzUsHRttMiW/lyiqxE=; b=C7N3ZGwOguH7h3wSYVxAy7V1rZ4p6kZy5Xti2NVy5UBHf63wRt4u69R0f6kKpmRb+Y D7Qi4RsDJGRN4tdagjE1capHihIrNa/1MTAUWY1yz4TKmjXAPy6LJYMe5eBxMujS4ZTL l/MvbJ5oWd/r5w5DnKT50Pj25yiUVNhGf46AfueJvAxYM1qgAaoS/waS8Q9bgqM/bha0 F8SN4JwId9MeH4c6aEAOQIQpXToBlTWq8uX+GSU8mTeFo63IqTQuGQotoR5dn+lR0dOn vNYRezoWr0y+umGAnXOSHKiPb2tYr7cIZoMESWWiy2IHJ7keXA0RQX3bSAizaCfG5ydY D5AA== X-Gm-Message-State: AOJu0Yx76GK3xR64idhk+TSokX2WHrcoPLlxiMB44WEkT0CvMu3Z2yWi CeUcxqR5tObbtrYlxEg8Gykz X-Google-Smtp-Source: AGHT+IELQlWo9K8uMMZOoFsxOoDl73Nmk5sSabaO8kP9l5oy0tiS3Lb7gQRsm4suIjzVU7ZhGckrhw== X-Received: by 2002:a5d:514c:0:b0:336:8b4e:3437 with SMTP id u12-20020a5d514c000000b003368b4e3437mr391966wrt.111.1703162420261; Thu, 21 Dec 2023 04:40:20 -0800 (PST) Message-ID: Date: Thu, 21 Dec 2023 13:40:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [BUG]i2c_hid_acpi broken with 4.17.2 on Framework Laptop 13 AMD Content-Language: en-US To: =?UTF-8?Q?S=C3=A9bastien_Chaumat?= , Juergen Gross Cc: xen-devel@lists.xenproject.org References: <64d738b7-08c1-4b2c-a828-a137c870408e@suse.com> <6ba9568a-ff8e-48ad-907f-74303e04d3a2@suse.com> From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRi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cjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 20.12.2023 17:34, Sébastien Chaumat wrote: > Here are the patches I made to xen and linux kernel > Plus dmesg (bare metal,xen) and "xl dmesg" So the problem looks to be that pci_xen_initial_domain() results in permanent setup of IRQ7, when there only "static" ACPI tables (in particular source overrides in MADT) are consulted. The necessary settings, however, are known only after _CRS for the device was evaluated (and possibly _PRS followed by invocation of _SRS). All of this happens before xen_register_gsi() is called. But that function's call to xen_register_pirq() is short-circuited by the very first if() in xen_register_pirq() when there was an earlier invocation. Hence the (wrong) "edge" binding remains in place, as was established by the earlier call here. Jürgen, there's an interesting comment in xen_bind_pirq_gsi_to_irq(), right before invoking irq_set_chip_and_handler_name(). Despite what the comment says (according to my reading), the fasteoi one is _not_ used in all cases. Assuming there's a reason for this, it's not clear to me whether updating the handler later on is a valid thing to do. __irq_set_handler() being even an exported symbol suggests that might be an option to use here. Then again merely updating the handler may not be sufficient, seeing there are also e.g. IRQD_TRIGGER_MASK and IRQD_LEVEL. Sébastien, to prove the (still pretty weak) theory that the change in handler is all that's needed to make things work in your case, could you fiddle with pci_xen_initial_domain() to have it skip IRQ7? (That of course won't be a proper solution, but ought to be okay for your system.) The main weakness of the theory is that IRQ7 really isn't very special in this regard - other PCI IRQs routed to the low 16 IO-APIC pins ought to have similar issues (from the log, on your system this would be at least IRQ6 and IRQ10, except that they happen to be edge/low, so fitting the ISA defaults); only IRQ16 and up would work okay. Furthermore it might be interesting to know whether ELCR would give us any hint in this case. Sadly depending on where you look, applicability of this pair of registers (I/O ports 0x4d0 and 0x4d1) to other than EISA systems is claimed true or false. Could you perhaps make Xen simply log the values read from those two ports, by e.g. inserting printk("ELCR: %02x, %02x\n", inb(0x4d0), inb(0x4d1)); in, say, setup_dump_irqs()? Jürgen, looking at pci_xen_initial_domain(), what's the purpose of the loop in the final if()? Can this ever do anything useful when the earlier comment suggests nr_legacy_irqs() is zero anyway? Or is the comment simply inaccurate in not covering the "no IO-APICs" case? Jan