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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 94456C433F5 for ; Fri, 14 Jan 2022 09:48:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EBA5310E394; Fri, 14 Jan 2022 09:48:36 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 089E110E1B1 for ; Fri, 14 Jan 2022 09:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642153714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dgXhkt2FWhOW083WXPlb1iCQkZ1DnlaQiXadTyPDwWs=; b=QBYfUquLh8UxBZuFP/HhEJf4A8PwnlWWSrS09wKWgsT8I2dfETmom9Pm7+f9/jZtzg0XvP Dx5RsqOvxKJLcvL8EGGzT5ULu4Hb7PiGO3f0iWNiYNYQWTpkAZEbqEPRTEvkpGJm7Q1NhW WIluXt4H15yKC3jkbTlG7EpvZzMbCS0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-41-HZRiUdlIOWyMIhDntHI9Hg-1; Fri, 14 Jan 2022 04:48:32 -0500 X-MC-Unique: HZRiUdlIOWyMIhDntHI9Hg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD16D83DD23; Fri, 14 Jan 2022 09:48:31 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.39.193.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DBCA7B9D1; Fri, 14 Jan 2022 09:48:30 +0000 (UTC) From: Jocelyn Falempe To: dri-devel@lists.freedesktop.org Subject: [PATCH] mgag200 fix memmapsl configuration in GCTL6 register Date: Fri, 14 Jan 2022 10:47:54 +0100 Message-Id: <20220114094754.522401-2-jfalempe@redhat.com> In-Reply-To: <20220114094754.522401-1-jfalempe@redhat.com> References: <20220114094754.522401-1-jfalempe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jfalempe@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: michel@daenzer.net, Jocelyn Falempe , tzimmermann@suse.de Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On some server with MGA G200e (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 a bad 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 (if memmapsl 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 driver code set it to 0x05 => memmapsl to b01 => 0xA0000 but on x86, the VGA console is at 0xB8000 arch/x86/boot/compressed/misc.c define vidmem to 0xb8000 in extract_kernel() so it's better to configure it to b11 Thus changing the value 0x05 to 0x0d Signed-off-by: Jocelyn Falempe --- drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index b983541a4c53..c7f63610b278 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -529,7 +529,7 @@ static void mgag200_set_format_regs(struct mga_device *mdev, WREG_GFX(3, 0x00); WREG_GFX(4, 0x00); WREG_GFX(5, 0x40); - WREG_GFX(6, 0x05); + WREG_GFX(6, 0x0d); WREG_GFX(7, 0x0f); WREG_GFX(8, 0x0f); -- 2.34.1