Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp920302pxb; Wed, 6 Apr 2022 04:19:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyVnX6azFWVKg/1Nn6livFNEPAb9LH0Bcq8m7b6YpsYorPeawvHtc2yTBrprkG+SDgqWH2 X-Received: by 2002:a05:6a00:2403:b0:4fd:e84a:4563 with SMTP id z3-20020a056a00240300b004fde84a4563mr8388636pfh.60.1649243944105; Wed, 06 Apr 2022 04:19:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649243944; cv=none; d=google.com; s=arc-20160816; b=L8lG9fpd8ErG2At/3VfWdbTo1YRprEnR4O1Sy+KvRzV1OZdohDq/9U4RyRdpRExqua n4QlZpZ1yracTwHGl5U+j5VjJeRtl5P8i3k2JDX/BhdKuhzLsrnNGUvP9/yAgStd30/l JVKK/Qb4/oD3ZE4iJSFHRbSGg5if8eXamiAYdn+odDbo8nOziSQYL+Lpz2Pfzu4Z1GPv H6xdH6Kvt0nnGXThFzhhBXALKUcUnAz+BYjmnVPqP9tUxzMfyqyPw/duZzKuO6ZBJG5K DQfVwlja7LoveIhH6PRXXt19IARJ6Q89+dS21vH5DGaUxhhs2gNjEUQJbrXpU4jTp6Yx Sb4g== 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=FHI4vzjs691RNKm0onY06VUQMr0QCc9nS+xodEmHhOQ=; b=VbbbhndJnABGr4jx/R+MEUx4MGJG+bcTWvOENckpRTU9D7c/QOxURGGqOuBONLFJDZ vabt/ltfDvynAEEbugrO02l6Wt0tQ0jl/kAcy6K+g4EcIyddpLJ5zHVgfayn2CbKwd/j oPf3RdkYcLiepQdU4LXpNKrB0ax4j0hG3Ks/LGxTsSaeeAZ4tA/Ia85eebYnvveXdBe5 37OUcrcq4rnky8fl5QlUKjHW4HeO9lSlqmlFCYUaoXnPdlnY9or0rMYIs0RyFXan3+ow T+hHzrCCOAOdCb+2DpO7xy7Wy6SyWoSVHztDXavgIDvh5ljPn0YYUL2Pbfpza+LVerC1 0lDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LZaaORXG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u6-20020a170902e5c600b00153b2d1651dsi17012933plf.293.2022.04.06.04.19.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:19:04 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LZaaORXG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C56395E40F4; Wed, 6 Apr 2022 02:42:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1577869AbiDEXRP (ORCPT + 99 others); Tue, 5 Apr 2022 19:17:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355724AbiDEKVn (ORCPT ); Tue, 5 Apr 2022 06:21:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20E3B83031; Tue, 5 Apr 2022 03:05:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4EF58616E7; Tue, 5 Apr 2022 10:05:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C3A8C385A1; Tue, 5 Apr 2022 10:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649153103; bh=WNP6Khvhm5d3jm0balr1Rh0ZzmOjXFEoQMP607kv07Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LZaaORXGZrzM8ACna2UqYMCn+X5a5WJdVs75my7PK07Tt9Tb/M10I2HXO8C7FeRyA 7ZJ3qBOhkt8Hy1+XlVjk/Q5u2YlzL5kdt2RZUk8yFuLc1GJ1N1BZlCThVip8x8XamD 8uMV3lna+ryZgURKTl71iHsyMOj1C/mqqEbUDgZg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jocelyn Falempe , Javier Martinez Canillas , Lyude Paul , Thomas Zimmermann Subject: [PATCH 5.10 103/599] mgag200 fix memmapsl configuration in GCTL6 register Date: Tue, 5 Apr 2022 09:26:37 +0200 Message-Id: <20220405070301.898742921@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070258.802373272@linuxfoundation.org> References: <20220405070258.802373272@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jocelyn Falempe commit 028a73e10705af1ffd51f2537460f616dc58680e upstream. On some servers with MGA G200_SE_A (rev 42), booting with Legacy BIOS, the hardware hangs when using kdump and kexec into the kdump kernel. This happens when the uncompress code tries to write "Decompressing Linux" to the VGA Console. It can be reproduced by writing to the VGA console (0xB8000) after booting to graphic mode, it generates the following error: kernel:NMI: PCI system error (SERR) for reason a0 on CPU 0. kernel:Dazed and confused, but trying to continue The root cause is the configuration of the MGA GCTL6 register According to the GCTL6 register documentation: bit 0 is gcgrmode: 0: Enables alpha mode, and the character generator addressing system is activated. 1: Enables graphics mode, and the character addressing system is not used. bit 1 is chainodd even: 0: The A0 signal of the memory address bus is used during system memory addressing. 1: Allows A0 to be replaced by either the A16 signal of the system address (ifmemmapsl is ‘00’), or by the hpgoddev (MISC<5>, odd/even page select) field, described on page 3-294). bit 3-2 are memmapsl: Memory map select bits 1 and 0. VGA. These bits select where the video memory is mapped, as shown below: 00 => A0000h - BFFFFh 01 => A0000h - AFFFFh 10 => B0000h - B7FFFh 11 => B8000h - BFFFFh bit 7-4 are reserved. Current code set it to 0x05 => memmapsl to b01 => 0xa0000 (graphic mode) But on x86, the VGA console is at 0xb8000 (text mode) In arch/x86/boot/compressed/misc.c debug strings are written to 0xb8000 As the driver doesn't use this mapping at 0xa0000, it is safe to set it to 0xb8000 instead, to avoid kernel hang on G200_SE_A rev42, with kexec/kdump. Thus changing the value 0x05 to 0x0d Signed-off-by: Jocelyn Falempe Reviewed-by: Javier Martinez Canillas Acked-by: Lyude Paul Cc: stable@vger.kernel.org Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220119102905.1194787-1-jfalempe@redhat.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/mgag200/mgag200_mode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -1243,7 +1243,10 @@ static void mgag200_set_format_regs(stru WREG_GFX(3, 0x00); WREG_GFX(4, 0x00); WREG_GFX(5, 0x40); - WREG_GFX(6, 0x05); + /* GCTL6 should be 0x05, but we configure memmapsl to 0xb8000 (text mode), + * so that it doesn't hang when running kexec/kdump on G200_SE rev42. + */ + WREG_GFX(6, 0x0d); WREG_GFX(7, 0x0f); WREG_GFX(8, 0x0f);