From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sn1nam01on0102.outbound.protection.outlook.com ([104.47.32.102]:61147 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935357AbeCHE7B (ORCPT ); Wed, 7 Mar 2018 23:59:01 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Bjorn Helgaas , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 40/67] vgacon: Set VGA struct resource types Date: Thu, 8 Mar 2018 04:57:49 +0000 Message-ID: <20180308045641.7814-40-alexander.levin@microsoft.com> References: <20180308045641.7814-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045641.7814-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Bjorn Helgaas [ Upstream commit c82084117f79bcae085e40da526253736a247120 ] Set the resource type when we reserve VGA-related I/O port resources. The resource code doesn't actually look at the type, so it inserts resources without a type in the tree correctly even without this change. But if we ever print a resource without a type, it looks like this: vga+ [??? 0x000003c0-0x000003df flags 0x0] Setting the type means it will be printed correctly as: vga+ [io 0x000003c0-0x000003df] Signed-off-by: Bjorn Helgaas Signed-off-by: Sasha Levin --- arch/alpha/kernel/console.c | 1 + drivers/video/console/vgacon.c | 34 ++++++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/arch/alpha/kernel/console.c b/arch/alpha/kernel/console.c index 8e9a41966881..5476279329a6 100644 --- a/arch/alpha/kernel/console.c +++ b/arch/alpha/kernel/console.c @@ -21,6 +21,7 @@ struct pci_controller *pci_vga_hose; static struct resource alpha_vga =3D { .name =3D "alpha-vga+", + .flags =3D IORESOURCE_IO, .start =3D 0x3C0, .end =3D 0x3DF }; diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.= c index 445b1dc5d441..a17ba1465815 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -422,7 +422,10 @@ static const char *vgacon_startup(void) vga_video_port_val =3D VGA_CRT_DM; if ((screen_info.orig_video_ega_bx & 0xff) !=3D 0x10) { static struct resource ega_console_resource =3D - { .name =3D "ega", .start =3D 0x3B0, .end =3D 0x3BF }; + { .name =3D "ega", + .flags =3D IORESOURCE_IO, + .start =3D 0x3B0, + .end =3D 0x3BF }; vga_video_type =3D VIDEO_TYPE_EGAM; vga_vram_size =3D 0x8000; display_desc =3D "EGA+"; @@ -430,9 +433,15 @@ static const char *vgacon_startup(void) &ega_console_resource); } else { static struct resource mda1_console_resource =3D - { .name =3D "mda", .start =3D 0x3B0, .end =3D 0x3BB }; + { .name =3D "mda", + .flags =3D IORESOURCE_IO, + .start =3D 0x3B0, + .end =3D 0x3BB }; static struct resource mda2_console_resource =3D - { .name =3D "mda", .start =3D 0x3BF, .end =3D 0x3BF }; + { .name =3D "mda", + .flags =3D IORESOURCE_IO, + .start =3D 0x3BF, + .end =3D 0x3BF }; vga_video_type =3D VIDEO_TYPE_MDA; vga_vram_size =3D 0x2000; display_desc =3D "*MDA"; @@ -454,15 +463,21 @@ static const char *vgacon_startup(void) vga_vram_size =3D 0x8000; =20 if (!screen_info.orig_video_isVGA) { - static struct resource ega_console_resource - =3D { .name =3D "ega", .start =3D 0x3C0, .end =3D 0x3DF }; + static struct resource ega_console_resource =3D + { .name =3D "ega", + .flags =3D IORESOURCE_IO, + .start =3D 0x3C0, + .end =3D 0x3DF }; vga_video_type =3D VIDEO_TYPE_EGAC; display_desc =3D "EGA"; request_resource(&ioport_resource, &ega_console_resource); } else { - static struct resource vga_console_resource - =3D { .name =3D "vga+", .start =3D 0x3C0, .end =3D 0x3DF }; + static struct resource vga_console_resource =3D + { .name =3D "vga+", + .flags =3D IORESOURCE_IO, + .start =3D 0x3C0, + .end =3D 0x3DF }; vga_video_type =3D VIDEO_TYPE_VGAC; display_desc =3D "VGA+"; request_resource(&ioport_resource, @@ -494,7 +509,10 @@ static const char *vgacon_startup(void) } } else { static struct resource cga_console_resource =3D - { .name =3D "cga", .start =3D 0x3D4, .end =3D 0x3D5 }; + { .name =3D "cga", + .flags =3D IORESOURCE_IO, + .start =3D 0x3D4, + .end =3D 0x3D5 }; vga_video_type =3D VIDEO_TYPE_CGA; vga_vram_size =3D 0x2000; display_desc =3D "*CGA"; --=20 2.14.1