Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp264660pxj; Thu, 13 May 2021 04:32:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNIAxj0ENpE0J4/xoQG87ogkoz0MbgbUaWvljjGL0DMRgUKJpWKezi8P7AwclOeuX0k7DC X-Received: by 2002:a05:6e02:507:: with SMTP id d7mr2643427ils.19.1620905555232; Thu, 13 May 2021 04:32:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620905555; cv=none; d=google.com; s=arc-20160816; b=oJY6G6TgOsfTTsjexvyKCrTav2wsWn7it83kuFOUEYEiahUk4gy8pMEj+PNHubbNlo geiRcZD7CnWPy77XOPj2JuINavfqXyJK+Hdbw4Arg9vUCLl2lmqNQEM7S4FXgGOc16yV McQTukDmiKafdulPP8UClyhULehaVpiI7/YAxSjJNGqEQVE079X6llEo9mVYsmS+QkR1 e72cKmmjv3M48OT8yDXPjy2ePkuvAzBpOCZ6IQGO5ierVR5UV7q+Hbu0EGWbRyBEKEDt qGG43qlsZJ/6JAXkvQSfYAJMQXx2arP9OHBlLbzNjZPfTSx0NsAZw4+n4MaFP8KEdKZO 8eGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=La321s4CZU0bPmAeqpbhR07/5MbTy0zEdX1bFYFt688=; b=0+L5ku94XFCUVsVU16pnrXiSgiRsYYBc/vFUTUwGWAj7JXcn/tKCVfwCUqZ6a47VzV GoS4aIbZRUe8C6cmQ55yL2WIAJaoccAIJPm53RiIff002GHgoGo0hlL2PYHAWOzXgcgO 2YG5Uhs68YDtFTJacCRW8nqjNqtx46sXguckppRLq3xd56uQ/tuvt/k0AvQ+lJQfEjDS ieWUfL6Hy4msQNED1Es8hTtJyHKO028B6gEX4QbPmS4KE3Jm07nXUFg0T/Y6lkrUARLt nR5u9V9cwiX3oHR4W4gZuQFinlVa6ImS1h8voWglkR5SeRBswTAusG4KT9IX6z7gnvVX 8yHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FXl490aa; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si3782561ila.138.2021.05.13.04.32.21; Thu, 13 May 2021 04:32:35 -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=@gmail.com header.s=20161025 header.b=FXl490aa; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232178AbhEMKNH (ORCPT + 99 others); Thu, 13 May 2021 06:13:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230393AbhEMKNG (ORCPT ); Thu, 13 May 2021 06:13:06 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25A45C061574; Thu, 13 May 2021 03:11:55 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id b11-20020a7bc24b0000b0290148da0694ffso1096909wmj.2; Thu, 13 May 2021 03:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=La321s4CZU0bPmAeqpbhR07/5MbTy0zEdX1bFYFt688=; b=FXl490aa2FwvDKZV/tDAkD3/iELc/MtK7XHteo9p3C9q3RSdEOS1rh+LWMO5RMWq9g 8VGNNA7zfDxEkywwfSsXGyX6bLAYcwE+kwHSFqLkCqODOgvYBbsTL2+6GGIM1aZG/yn0 qLpiCBtg0oSQ3ampNK35mdOWKSx2S94lRoVGjWmwY9mF5qf7SImVaPjPWbNr2GIXSsJ4 TfENxE292YaUqq9IWkKrlakC3e8voEsR84in4nPmPc2siszJga+h8YlK336my0JKPx5p 0acjVLGkKbzcLP2yD4Qfj3U3InfCbCWqt7lyvSNoQvAVspctIv79nmxEh81LT151z6/Y t/TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=La321s4CZU0bPmAeqpbhR07/5MbTy0zEdX1bFYFt688=; b=rWA9YrZ0I+4fyYoqOLW3bmPh/9FZ/e2Wlu6UJOcaDUWobOTqItOM8MnAjacbMKAvvU Pi6UGVcSlnso7CotprOQ3Mt25ZvP6OraxFVqYGAAUMSqn+kXYiAIBM3NLUuBd5BGmdJn /Bvtkq6rIl0N6ELuyDUFPODD9rdS7WUeO8GKu3OIvmBPYojWmxTJ2obC1B7e5PzRrEgD YOSR6FuWdWUkHCwO6iztwaBwoTxp7uAKRZJgEImQIhdE/TZqWWILLBAHp9Iu2PAlNnW9 FIB/frBaF4nM2ScOLvwErfcO+i/u11OwX9YLpFNAepG2v9T5jHmpDR56c2uenQyGxnZS jYqw== X-Gm-Message-State: AOAM53004FsUsDqkHqQF6qV4xImWL00eW7mmvwszhmyqxw78lUc3hgBG M9uRJkXy3xKyGHdr9X4Kcj+sy0bWwh4= X-Received: by 2002:a1c:7419:: with SMTP id p25mr3047896wmc.79.1620900713557; Thu, 13 May 2021 03:11:53 -0700 (PDT) Received: from [192.168.2.202] (pd9e5a254.dip0.t-ipconnect.de. [217.229.162.84]) by smtp.gmail.com with ESMTPSA id c14sm2341108wrt.77.2021.05.13.03.11.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 May 2021 03:11:53 -0700 (PDT) Subject: Re: [PATCH] x86/i8259: Work around buggy legacy PIC To: David Laight , Thomas Gleixner , Ingo Molnar , Borislav Petkov Cc: "H. Peter Anvin" , Sachi King , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" References: <20210512210459.1983026-1-luzmaximilian@gmail.com> <9b70d8113c084848b8d9293c4428d71b@AcuMS.aculab.com> From: Maximilian Luz Message-ID: Date: Thu, 13 May 2021 12:11:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <9b70d8113c084848b8d9293c4428d71b@AcuMS.aculab.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/13/21 10:10 AM, David Laight wrote: > From: Maximilian Luz >> Sent: 12 May 2021 22:05 >> >> The legacy PIC on the AMD variant of the Microsoft Surface Laptop 4 has >> some problems on boot. For some reason it consistently does not respond >> on the first try, requiring a couple more tries before it finally >> responds. > > That seems very strange, something else must be going on that causes the grief. > The 8259 will be built into to the one of the cpu support chips. > I can't imagine that requires anything special. Right, it's definitely strange. Both Sachi (I imagine) and I don't know much about these devices, so we're open for suggestions. For reference: [1] and following comments are the discussion where we (mostly Sachi) discovered the issue, tracking this from platform_get_irq() returning -EINVAL to the PIC not probing. It also has a dmesg log [2] attached, but as far as we can tell [ 0.105820] Using NULL legacy PIC is the only relevant line to that in there. And lastly, if that's any help at all: The PIC device is described in ACPI in [3]. The Surface Laptop 3 also has an AMD CPU (although a prior generation) and has the PIC described in the exact same way (can also be found in that repository), but doesn't exhibit that behavior (and doesn't show the "Using NULL legacy PIC" line). I expect there's not much you can change to that definition so that's probably irrelevant here. Again, I don't really know anything about these devices, so my guess would be bad hardware revision or bad firmware revision. All I know is that retrying seems to "fix" it. > It's not as though you have a real 8259 - which even a 286 can > break the inter-cycle recovery on (with the circuit from the > application note). Right, I imagine that's some emulation for legacy reasons? Regards, Max [1]: https://github.com/linux-surface/linux-surface/issues/425#issuecomment-831921098 [2]: https://github.com/linux-surface/linux-surface/files/6421166/dmesg-2021-05-04_22-11.txt [3]: https://github.com/linux-surface/acpidumps/blob/69d5ecc1954ea5e90829b8e33541308e7451e951/surface_laptop_4_amd/dsdt.dsl#L1201-L1221