[PATCH v1 2/2] fbdev: Kconfig: Add HAS_IOMEM dependency for FB_OPENCORES

2018-01-25 Thread Farhan Ali
The Opencores framebuffer device uses I/O memory and with
CONFIG_HAS_IOMEM disabled will lead to build errors:

ERROR: "devm_ioremap_resource" [drivers/video/fbdev/ocfb.ko] undefined!

Fix this by adding HAS_IOMEM dependency for FB_OPENCORES.

Signed-off-by: Farhan Ali 
---
 drivers/video/fbdev/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 5e58f5e..8667e5d 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -976,7 +976,7 @@ config FB_PVR2
 
 config FB_OPENCORES
tristate "OpenCores VGA/LCD core 2.0 framebuffer support"
-   depends on FB && HAS_DMA
+   depends on FB && HAS_DMA && HAS_IOMEM
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
-- 
2.7.4



[PATCH v1 0/2] Kconfig changes to enable Graphics Support for S390

2018-01-25 Thread Farhan Ali
Hi,

This series of patches are in preparation for enabling an additional
tty and console for a S390 KVM guest using a virtio-gpu device[1].
One of the steps to do this would be to enable CONFIG_VT for S390,
and this would also require the dummy console (CONFIG_DUMMY_CONSOLE).

Patch 1 enables the "Graphics support" menu which is
needed to enable dummy console, since the VT layer needs it.

Patch 2 fixes a Kconfig dependency issue for opencores
framebuffer devices. This issue was exposed by the previous
patch.

Thanks
Farhan


[1] https://lists.nongnu.org/archive/html/qemu-devel/2017-09/msg04184.html

Farhan Ali (2):
  Kconfig : Remove HAS_IOMEM dependency for Graphics support
  fbdev: Kconfig: Add HAS_IOMEM dependency for FB_OPENCORES

 drivers/video/Kconfig   | 1 -
 drivers/video/fbdev/Kconfig | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

-- 
2.7.4



[PATCH v1 1/2] Kconfig : Remove HAS_IOMEM dependency for Graphics support

2018-01-25 Thread Farhan Ali
The 'commit e25df1205f37 ("[S390] Kconfig: menus with depends on HAS_IOMEM.")'
added the HAS_IOMEM dependecy for "Graphics support". This disabled the
"Graphics support" menu for S390. But if we enable VT layer for S390,
we would also need to enable the dummy console. So let's remove the
HAS_IOMEM dependency.

Signed-off-by: Farhan Ali 
Tested-by: Dong Jia Shi 
---
 drivers/video/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 3c20af9..41e7ba9 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -3,7 +3,6 @@
 #
 
 menu "Graphics support"
-   depends on HAS_IOMEM
 
 config HAVE_FB_ATMEL
bool
-- 
2.7.4



[PATCH v2 3/3] s390/setup : enable display support for KVM guest

2018-02-01 Thread Farhan Ali
The S390 architecture does not support any graphics hardware,
but with the latest support for Virtio GPU in Linux and Virtio
GPU emulation in QEMU, it's possible to enable graphics for
S390 using the Virtio GPU device.

To enable display we need to enable the Linux Virtual Terminal (VT)
layer for S390. But the VT subsystem initializes quite early
at boot so we need a dummy console driver till the Virtio GPU
driver is initialized and we can run the framebuffer console.

The framebuffer console over a Virtio GPU device can be run
in combination with the serial SCLP console (default on S390).
The SCLP console can still be accessed by management applications
(eg: via Libvirt's virsh console).

Signed-off-by: Farhan Ali 
Acked-by: Christian Borntraeger 
---
 arch/s390/kernel/setup.c  | 2 ++
 drivers/tty/Kconfig   | 2 +-
 drivers/video/console/Kconfig | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 793da97..0c1070c 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -220,6 +220,8 @@ static void __init conmode_default(void)
SET_CONSOLE_SCLP;
 #endif
}
+   if (IS_ENABLED(CONFIG_VT) && IS_ENABLED(CONFIG_DUMMY_CONSOLE))
+   conswitchp = &dummy_con;
 }
 
 #ifdef CONFIG_CRASH_DUMP
diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index cc2b4d9..8481007 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -11,7 +11,7 @@ if TTY
 
 config VT
bool "Virtual terminal" if EXPERT
-   depends on !S390 && !UML
+   depends on !UML
select INPUT
default y
---help---
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 7f1f1fb..8ba2565 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -9,7 +9,7 @@ config VGA_CONSOLE
depends on !4xx && !PPC_8xx && !SPARC && !M68K && !PARISC && !FRV && \
!SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \
(!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) 
&& \
-   !ARM64 && !ARC && !MICROBLAZE && !OPENRISC
+   !ARM64 && !ARC && !MICROBLAZE && !OPENRISC && !S390
default y
help
  Saying Y here will allow you to use Linux in text mode through a
-- 
2.7.4



[PATCH v2 0/3]Enable CONFIG_VT support for S390

2018-02-01 Thread Farhan Ali
Hi,

This series of patches add support for an additional tty
and console for a S390 KVM guest using a virtio-gpu device[1].

Patch 1 enables the "Graphics support" menu which is
needed to enable dummy console, since the VT layer needs it.
It also fixes a build error for Opencore framebuffer driver. 

Patch 2 fixes few linker issues.

Patch 3 add support for enabling VT layer for S390.


ChangeLog
-
v1 -> v2

v1 was posted under a different subject and here is a link to it:
https://www.spinics.net/lists/linux-s390/msg18175.html

   - Combine patch 1 and 2 from v1 into one patch (patch 1).
   - Additional patches to enable CONFIG_VT for S390.


Thanks
Farhan


[1] https://lists.nongnu.org/archive/html/qemu-devel/2017-09/msg04184.html


Farhan Ali (3):
  Kconfig : Remove HAS_IOMEM dependency for Graphics support
  s390/char : Rename EBCDIC keymap variables
  s390/setup : enable display support for KVM guest

 arch/s390/kernel/setup.c  |  2 ++
 drivers/s390/char/defkeymap.c | 66 ++-
 drivers/s390/char/keyboard.c  | 32 ++---
 drivers/s390/char/keyboard.h  | 11 
 drivers/tty/Kconfig   |  2 +-
 drivers/video/Kconfig |  1 -
 drivers/video/console/Kconfig |  2 +-
 drivers/video/fbdev/Kconfig   |  2 +-
 8 files changed, 66 insertions(+), 52 deletions(-)

-- 
2.7.4



[PATCH v2 2/3] s390/char : Rename EBCDIC keymap variables

2018-02-01 Thread Farhan Ali
The Linux Virtual Terminal (VT) layer provides a default keymap
which is compiled when VT layer is enabled. But at the same time
we are also compiling the EBCDIC keymap and this causes the linker
to complain.

So let's rename the EBCDIC keymap variables to prevent linker
conflict.

Signed-off-by: Farhan Ali 
Acked-by: Christian Borntraeger 
---
 drivers/s390/char/defkeymap.c | 66 ++-
 drivers/s390/char/keyboard.c  | 32 ++---
 drivers/s390/char/keyboard.h  | 11 
 3 files changed, 61 insertions(+), 48 deletions(-)

diff --git a/drivers/s390/char/defkeymap.c b/drivers/s390/char/defkeymap.c
index 98a5c45..193142c 100644
--- a/drivers/s390/char/defkeymap.c
+++ b/drivers/s390/char/defkeymap.c
@@ -9,7 +9,9 @@
 #include 
 #include 
 
-u_short plain_map[NR_KEYS] = {
+#include "keyboard.h"
+
+u_short ebc_plain_map[NR_KEYS] = {
0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000,
0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000,
0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000,
@@ -85,12 +87,12 @@ static u_short shift_ctrl_map[NR_KEYS] = {
0xf20a, 0xf108, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
 };
 
-ushort *key_maps[MAX_NR_KEYMAPS] = {
-   plain_map, shift_map, NULL, NULL,
+ushort *ebc_key_maps[MAX_NR_KEYMAPS] = {
+   ebc_plain_map, shift_map, NULL, NULL,
ctrl_map, shift_ctrl_map, NULL,
 };
 
-unsigned int keymap_count = 4;
+unsigned int ebc_keymap_count = 4;
 
 
 /*
@@ -99,7 +101,7 @@ unsigned int keymap_count = 4;
  * the default and allocate dynamically in chunks of 512 bytes.
  */
 
-char func_buf[] = {
+char ebc_func_buf[] = {
'\033', '[', '[', 'A', 0, 
'\033', '[', '[', 'B', 0, 
'\033', '[', '[', 'C', 0, 
@@ -123,37 +125,37 @@ char func_buf[] = {
 };
 
 
-char *funcbufptr = func_buf;
-int funcbufsize = sizeof(func_buf);
-int funcbufleft = 0;  /* space left */
-
-char *func_table[MAX_NR_FUNC] = {
-   func_buf + 0,
-   func_buf + 5,
-   func_buf + 10,
-   func_buf + 15,
-   func_buf + 20,
-   func_buf + 25,
-   func_buf + 31,
-   func_buf + 37,
-   func_buf + 43,
-   func_buf + 49,
-   func_buf + 55,
-   func_buf + 61,
-   func_buf + 67,
-   func_buf + 73,
-   func_buf + 79,
-   func_buf + 85,
-   func_buf + 91,
-   func_buf + 97,
-   func_buf + 103,
-   func_buf + 109,
+char *ebc_funcbufptr = ebc_func_buf;
+int ebc_funcbufsize = sizeof(ebc_func_buf);
+int ebc_funcbufleft = 0;  /* space left */
+
+char *ebc_func_table[MAX_NR_FUNC] = {
+   ebc_func_buf + 0,
+   ebc_func_buf + 5,
+   ebc_func_buf + 10,
+   ebc_func_buf + 15,
+   ebc_func_buf + 20,
+   ebc_func_buf + 25,
+   ebc_func_buf + 31,
+   ebc_func_buf + 37,
+   ebc_func_buf + 43,
+   ebc_func_buf + 49,
+   ebc_func_buf + 55,
+   ebc_func_buf + 61,
+   ebc_func_buf + 67,
+   ebc_func_buf + 73,
+   ebc_func_buf + 79,
+   ebc_func_buf + 85,
+   ebc_func_buf + 91,
+   ebc_func_buf + 97,
+   ebc_func_buf + 103,
+   ebc_func_buf + 109,
NULL,
 };
 
-struct kbdiacruc accent_table[MAX_DIACR] = {
+struct kbdiacruc ebc_accent_table[MAX_DIACR] = {
{'^', 'c', 0003},   {'^', 'd', 0004},
{'^', 'z', 0032},   {'^', 0012, },
 };
 
-unsigned int accent_table_size = 4;
+unsigned int ebc_accent_table_size = 4;
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c
index 5b505fd..db1fbf9 100644
--- a/drivers/s390/char/keyboard.c
+++ b/drivers/s390/char/keyboard.c
@@ -54,24 +54,24 @@ kbd_alloc(void) {
kbd = kzalloc(sizeof(struct kbd_data), GFP_KERNEL);
if (!kbd)
goto out;
-   kbd->key_maps = kzalloc(sizeof(key_maps), GFP_KERNEL);
+   kbd->key_maps = kzalloc(sizeof(ebc_key_maps), GFP_KERNEL);
if (!kbd->key_maps)
goto out_kbd;
-   for (i = 0; i < ARRAY_SIZE(key_maps); i++) {
-   if (key_maps[i]) {
-   kbd->key_maps[i] = kmemdup(key_maps[i],
+   for (i = 0; i < ARRAY_SIZE(ebc_key_maps); i++) {
+   if (ebc_key_maps[i]) {
+   kbd->key_maps[i] = kmemdup(ebc_key_maps[i],
   sizeof(u_short) * NR_KEYS,
   GFP_KERNEL);
if (!kbd->key_maps[i])
goto out_maps;
}
}
-   kbd->func_table = kzalloc(sizeof(func_table), GFP_KERNEL);
+   kbd->func_table = kzalloc(sizeof(ebc_func_table), GFP_KERNEL);
if (!kbd->func_table)
  

[PATCH v2 1/3] Kconfig : Remove HAS_IOMEM dependency for Graphics support

2018-02-01 Thread Farhan Ali
The 'commit e25df1205f37 ("[S390] Kconfig: menus with depends on HAS_IOMEM.")'
added the HAS_IOMEM dependecy for "Graphics support". This disabled the
"Graphics support" menu for S390. But if we enable VT layer for S390,
we would also need to enable the dummy console. So let's remove the
HAS_IOMEM dependency.

Move this dependency to Opencores framebuffer driver which would fail to build
with CONFIG_HAS_IOMEM disabled:

ERROR: "devm_ioremap_resource" [drivers/video/fbdev/ocfb.ko] undefined!

Signed-off-by: Farhan Ali 
Tested-by: Dong Jia Shi 
---
 drivers/video/Kconfig   | 1 -
 drivers/video/fbdev/Kconfig | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 3c20af9..41e7ba9 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -3,7 +3,6 @@
 #
 
 menu "Graphics support"
-   depends on HAS_IOMEM
 
 config HAVE_FB_ATMEL
bool
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 2f615b7..ec9c9ce 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -966,7 +966,7 @@ config FB_PVR2
 
 config FB_OPENCORES
tristate "OpenCores VGA/LCD core 2.0 framebuffer support"
-   depends on FB && HAS_DMA
+   depends on FB && HAS_DMA && HAS_IOMEM
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
-- 
2.7.4



Re: [PATCH v1 2/2] fbdev: Kconfig: Add HAS_IOMEM dependency for FB_OPENCORES

2018-01-26 Thread Farhan Ali



On 01/26/2018 07:38 AM, Tomi Valkeinen wrote:

On 26/01/18 14:33, Thomas Huth wrote:

On 25.01.2018 16:47, Farhan Ali wrote:

The Opencores framebuffer device uses I/O memory and with
CONFIG_HAS_IOMEM disabled will lead to build errors:

ERROR: "devm_ioremap_resource" [drivers/video/fbdev/ocfb.ko] undefined!

Fix this by adding HAS_IOMEM dependency for FB_OPENCORES.

Signed-off-by: Farhan Ali 
---
  drivers/video/fbdev/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 5e58f5e..8667e5d 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -976,7 +976,7 @@ config FB_PVR2
  
  config FB_OPENCORES

tristate "OpenCores VGA/LCD core 2.0 framebuffer support"
-   depends on FB && HAS_DMA
+   depends on FB && HAS_DMA && HAS_IOMEM
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT


I think it would be better if fbdevs in general would depend on
HAS_IOMEM ... or could there be any frame buffer devices without IOMEM ?


There are some small ones which are updated with, say, i2c
(ssd1307fb.c). I think those don't need iomem.

  Tomi



Most of the other framebuffer devices are fenced of by architecture 
dependency or PCI dependency. So I am hesitant to introduce a blanket 
dependency for all fbdevs.


Thank you guys for reviewing!

Thanks
Farhan



Re: [PATCH v1 0/2] Kconfig changes to enable Graphics Support for S390

2018-01-26 Thread Farhan Ali



On 01/26/2018 08:41 AM, Geert Uytterhoeven wrote:

Hi Farhan,

On Thu, Jan 25, 2018 at 4:47 PM, Farhan Ali  wrote:

This series of patches are in preparation for enabling an additional
tty and console for a S390 KVM guest using a virtio-gpu device[1].
One of the steps to do this would be to enable CONFIG_VT for S390,
and this would also require the dummy console (CONFIG_DUMMY_CONSOLE).

Patch 1 enables the "Graphics support" menu which is
needed to enable dummy console, since the VT layer needs it.

Patch 2 fixes a Kconfig dependency issue for opencores
framebuffer devices. This issue was exposed by the previous
patch.

Thanks
Farhan


[1] https://lists.nongnu.org/archive/html/qemu-devel/2017-09/msg04184.html

Farhan Ali (2):
   Kconfig : Remove HAS_IOMEM dependency for Graphics support
   fbdev: Kconfig: Add HAS_IOMEM dependency for FB_OPENCORES

  drivers/video/Kconfig   | 1 -
  drivers/video/fbdev/Kconfig | 2 +-
  2 files changed, 1 insertion(+), 2 deletions(-)


Shouldn't the order of your two patches be inverted, to avoid patch 1
introducing
build breakage fixed by patch 2?

Gr{oetje,eeting}s,

 Geert



Hi Geert,

I wasn't sure what would be the best ordering since we would never hit 
the issue if patch 1 didn't exist. But if the preference is to invert 
the ordering of patches, then I will change the ordering.


Thank you for reviewing.

Thanks
Farhan



--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
 -- Linus Torvalds





Re: [PATCH v1 0/2] Kconfig changes to enable Graphics Support for S390

2018-01-26 Thread Farhan Ali



On 01/26/2018 10:06 AM, Geert Uytterhoeven wrote:

Hi Geert,

I wasn't sure what would be the best ordering since we would never hit the
issue if patch 1 didn't exist. But if the preference is to invert the
ordering of patches, then I will change the ordering.

Alternatively, you can combine two patches into a single patch, which
moves the dependency from the whole subsystem to the driver that needs
it (are there more?).

Gr{oetje,eeting}s,

 Geert



I like the idea of combining both patches into one.

There are other fbdev drivers that use iomem (found by grepping for 
"devm_ioremap_resource"):


CONFIG_FB_S3C (s3c-fb.c)

CONFIG_FB_CLPS711X (clps711x-fb.c)

CONFIG_FB_JZ4740 (jz4740_fb.c)

CONFIG_FB_DA8XX (da8xx-fb.c)

CONFIG_FB_WM8505 (wm8505fb.c)

CONFIG_OMAP2_VRFB (omap2/omapfb/vrfb.c)

CONFIG_FB_OMAP2 (omap2/omapfb/dss/*

CONFIG_FB_MXS (mxsfb.c)

CONFIG_PXA3XX_GCU (pxa3xx-gcu.c)

CONFIG_FB_XILINX (xilinxfb.c)


All of these are already fenced off by architecture dependencies (which 
I am assuming enables CONFIG_HAS_IOMEM by default). If we want to be 
cautious I can add HAS_IOMEM dependency for all of them.


Thanks
Farhan



Re: [PATCH] MAINTAINERS/vfio-ccw: add Farhan and Eric, make Halil Reviewer

2018-12-12 Thread Farhan Ali




On 12/12/2018 09:59 AM, Christian Borntraeger wrote:

Eric and Farhan will help with maintaining vfio-ccw.

Cc: Cornelia Huck 
Cc: Halil Pasic 
Cc: Farhan Ali 
Cc: Eric Farman 
Signed-off-by: Christian Borntraeger 
---
  MAINTAINERS | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 8119141a926f..879594b93385 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13026,7 +13026,9 @@ F:  drivers/pci/hotplug/s390_pci_hpc.c
  
  S390 VFIO-CCW DRIVER

  M:Cornelia Huck 
-M: Halil Pasic 
+M: Farhan Ali 
+M: Eric Farman 
+R: Halil Pasic 
  L:linux-s...@vger.kernel.org
  L:k...@vger.kernel.org
  S:Supported




Acked-by: Farhan Ali 



Re: [PATCH v3 0/3] Enable CONFIG_VT support for S390

2018-02-20 Thread Farhan Ali



On 02/20/2018 04:43 AM, Christian Borntraeger wrote:

Added to my linux next tree to check for any fallout.


Thanks!



Re: [PATCH v3 1/3] Kconfig : Remove HAS_IOMEM dependency for Graphics support

2018-02-21 Thread Farhan Ali



On 02/21/2018 07:11 AM, Christian Borntraeger wrote:



On 02/21/2018 01:07 PM, Cornelia Huck wrote:
[...]

But if you need to enable PCI to get IOMEM, I wonder why this patch here
is needed at all? The Graphics menu / VT dummy console should be
available in the config if IOMEM is enabled anyway?


That is a good question. With CONFIG_PCI=y I can select virtio-gpu and 
dummy-console.
IIRC the issue was that with patch 3 we can have the situation where we have
CONFIG_VT = y and CONFIG_DUMMY_CONSOLE=n and this will crash early during boot 
as
conswitchp is NULL.


Yes, VT layer initializes very early in the boot process and looks for a 
console. If it can't find any it will crash. I believe that was the 
whole point of having the dummy console.




So in practice, CONFIG_VT depends on "there's a console available, even
if it's only the dummy one"?


Yes. Maybe we should simple move dummy_console outside of 
drivers/video/console/Kconfig
into something that is always available.



I agree, but where should it go? consoles are kinda tightly tied to 
video/Graphics Support.





This patches goal was to always enable dummy console even without
PCI, but it obviously fails to do so.


This patch should enable the dummy console even without PCI but we won't 
have DRM/Virtio GPU.



OTOH, the dummy console really should not depend on anything, as it is
only doing dummy things.



So what about allowing CONFIG_VT on s390 only if we have PCI?


diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index 84810075a6a0..1c7fe09d6f90 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -11,7 +11,7 @@ if TTY
  
  config VT

 bool "Virtual terminal" if EXPERT
-   depends on !UML
+   depends on !UML && (!S390 || PCI)
 select INPUT
 default y
 ---help---



Would cover your use case, but feels wrong to me... config dependencies
aren't fun :/





[PATCH v4 3/3] s390/setup : enable display support for KVM guest

2018-02-22 Thread Farhan Ali
The S390 architecture does not support any graphics hardware,
but with the latest support for Virtio GPU in Linux and Virtio
GPU emulation in QEMU, it's possible to enable graphics for
S390 using the Virtio GPU device.

To enable display we need to enable the Linux Virtual Terminal (VT)
layer for S390. But the VT subsystem initializes quite early
at boot so we need a dummy console driver till the Virtio GPU
driver is initialized and we can run the framebuffer console.

The framebuffer console over a Virtio GPU device can be run
in combination with the serial SCLP console (default on S390).
The SCLP console can still be accessed by management applications
(eg: via Libvirt's virsh console).

Signed-off-by: Farhan Ali 
Acked-by: Christian Borntraeger 
Reviewed-by: Thomas Huth 
---
 arch/s390/kernel/setup.c  | 2 ++
 drivers/tty/Kconfig   | 2 +-
 drivers/video/console/Kconfig | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index a6a91f0..f98a0f3 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -221,6 +221,8 @@ static void __init conmode_default(void)
SET_CONSOLE_SCLP;
 #endif
}
+   if (IS_ENABLED(CONFIG_VT) && IS_ENABLED(CONFIG_DUMMY_CONSOLE))
+   conswitchp = &dummy_con;
 }
 
 #ifdef CONFIG_CRASH_DUMP
diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index b811442..5ca53fa 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -11,7 +11,7 @@ if TTY
 
 config VT
bool "Virtual terminal" if EXPERT
-   depends on !S390 && !UML
+   depends on !UML
select INPUT
default y
---help---
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 9485857..b9c2c91 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -9,7 +9,7 @@ config VGA_CONSOLE
depends on !4xx && !PPC_8xx && !SPARC && !M68K && !PARISC && !FRV && \
!SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \
(!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) 
&& \
-   !ARM64 && !ARC && !MICROBLAZE && !OPENRISC && HAS_IOMEM
+   !ARM64 && !ARC && !MICROBLAZE && !OPENRISC && HAS_IOMEM && !S390
default y
help
  Saying Y here will allow you to use Linux in text mode through a
-- 
2.7.4



[PATCH v4 2/3] s390/char : Rename EBCDIC keymap variables

2018-02-22 Thread Farhan Ali
The Linux Virtual Terminal (VT) layer provides a default keymap
which is compiled when VT layer is enabled. But at the same time
we are also compiling the EBCDIC keymap and this causes the linker
to complain.

So let's rename the EBCDIC keymap variables to prevent linker
conflict.

Signed-off-by: Farhan Ali 
Acked-by: Christian Borntraeger 
Reviewed-by: Thomas Huth 
---
 drivers/s390/char/defkeymap.c | 66 ++-
 drivers/s390/char/keyboard.c  | 32 ++---
 drivers/s390/char/keyboard.h  | 11 
 3 files changed, 61 insertions(+), 48 deletions(-)

diff --git a/drivers/s390/char/defkeymap.c b/drivers/s390/char/defkeymap.c
index 98a5c45..193142c 100644
--- a/drivers/s390/char/defkeymap.c
+++ b/drivers/s390/char/defkeymap.c
@@ -9,7 +9,9 @@
 #include 
 #include 
 
-u_short plain_map[NR_KEYS] = {
+#include "keyboard.h"
+
+u_short ebc_plain_map[NR_KEYS] = {
0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000,
0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000,
0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000,
@@ -85,12 +87,12 @@ static u_short shift_ctrl_map[NR_KEYS] = {
0xf20a, 0xf108, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
 };
 
-ushort *key_maps[MAX_NR_KEYMAPS] = {
-   plain_map, shift_map, NULL, NULL,
+ushort *ebc_key_maps[MAX_NR_KEYMAPS] = {
+   ebc_plain_map, shift_map, NULL, NULL,
ctrl_map, shift_ctrl_map, NULL,
 };
 
-unsigned int keymap_count = 4;
+unsigned int ebc_keymap_count = 4;
 
 
 /*
@@ -99,7 +101,7 @@ unsigned int keymap_count = 4;
  * the default and allocate dynamically in chunks of 512 bytes.
  */
 
-char func_buf[] = {
+char ebc_func_buf[] = {
'\033', '[', '[', 'A', 0, 
'\033', '[', '[', 'B', 0, 
'\033', '[', '[', 'C', 0, 
@@ -123,37 +125,37 @@ char func_buf[] = {
 };
 
 
-char *funcbufptr = func_buf;
-int funcbufsize = sizeof(func_buf);
-int funcbufleft = 0;  /* space left */
-
-char *func_table[MAX_NR_FUNC] = {
-   func_buf + 0,
-   func_buf + 5,
-   func_buf + 10,
-   func_buf + 15,
-   func_buf + 20,
-   func_buf + 25,
-   func_buf + 31,
-   func_buf + 37,
-   func_buf + 43,
-   func_buf + 49,
-   func_buf + 55,
-   func_buf + 61,
-   func_buf + 67,
-   func_buf + 73,
-   func_buf + 79,
-   func_buf + 85,
-   func_buf + 91,
-   func_buf + 97,
-   func_buf + 103,
-   func_buf + 109,
+char *ebc_funcbufptr = ebc_func_buf;
+int ebc_funcbufsize = sizeof(ebc_func_buf);
+int ebc_funcbufleft = 0;  /* space left */
+
+char *ebc_func_table[MAX_NR_FUNC] = {
+   ebc_func_buf + 0,
+   ebc_func_buf + 5,
+   ebc_func_buf + 10,
+   ebc_func_buf + 15,
+   ebc_func_buf + 20,
+   ebc_func_buf + 25,
+   ebc_func_buf + 31,
+   ebc_func_buf + 37,
+   ebc_func_buf + 43,
+   ebc_func_buf + 49,
+   ebc_func_buf + 55,
+   ebc_func_buf + 61,
+   ebc_func_buf + 67,
+   ebc_func_buf + 73,
+   ebc_func_buf + 79,
+   ebc_func_buf + 85,
+   ebc_func_buf + 91,
+   ebc_func_buf + 97,
+   ebc_func_buf + 103,
+   ebc_func_buf + 109,
NULL,
 };
 
-struct kbdiacruc accent_table[MAX_DIACR] = {
+struct kbdiacruc ebc_accent_table[MAX_DIACR] = {
{'^', 'c', 0003},   {'^', 'd', 0004},
{'^', 'z', 0032},   {'^', 0012, },
 };
 
-unsigned int accent_table_size = 4;
+unsigned int ebc_accent_table_size = 4;
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c
index 5b505fd..db1fbf9 100644
--- a/drivers/s390/char/keyboard.c
+++ b/drivers/s390/char/keyboard.c
@@ -54,24 +54,24 @@ kbd_alloc(void) {
kbd = kzalloc(sizeof(struct kbd_data), GFP_KERNEL);
if (!kbd)
goto out;
-   kbd->key_maps = kzalloc(sizeof(key_maps), GFP_KERNEL);
+   kbd->key_maps = kzalloc(sizeof(ebc_key_maps), GFP_KERNEL);
if (!kbd->key_maps)
goto out_kbd;
-   for (i = 0; i < ARRAY_SIZE(key_maps); i++) {
-   if (key_maps[i]) {
-   kbd->key_maps[i] = kmemdup(key_maps[i],
+   for (i = 0; i < ARRAY_SIZE(ebc_key_maps); i++) {
+   if (ebc_key_maps[i]) {
+   kbd->key_maps[i] = kmemdup(ebc_key_maps[i],
   sizeof(u_short) * NR_KEYS,
   GFP_KERNEL);
if (!kbd->key_maps[i])
goto out_maps;
}
}
-   kbd->func_table = kzalloc(sizeof(func_table), GFP_KERNEL);
+   kbd->func_table = kzalloc(sizeof(ebc_func_table), GFP_KERNEL);
if (!kbd->

[PATCH v4 1/3] Kconfig : Remove HAS_IOMEM dependency for Graphics support

2018-02-22 Thread Farhan Ali
The 'commit e25df1205f37 ("[S390] Kconfig: menus with depends on HAS_IOMEM.")'
added the HAS_IOMEM dependecy for "Graphics support". This disabled the
"Graphics support" menu for S390. But if we enable VT layer for S390,
we would also need to enable the dummy console. So let's remove the
HAS_IOMEM dependency.

Move this dependency to sub menu items and console drivers that use
io memory.

Signed-off-by: Farhan Ali 
Reviewed-by: Thomas Huth 
---
 drivers/video/Kconfig | 5 -
 drivers/video/console/Kconfig | 6 +++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 3c20af9..4f950c6 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -3,7 +3,8 @@
 #
 
 menu "Graphics support"
-   depends on HAS_IOMEM
+
+if HAS_IOMEM
 
 config HAVE_FB_ATMEL
bool
@@ -36,6 +37,8 @@ config VIDEOMODE_HELPERS
 config HDMI
bool
 
+endif # HAS_IOMEM
+
 if VT
source "drivers/video/console/Kconfig"
 endif
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 7f1f1fb..9485857 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -9,7 +9,7 @@ config VGA_CONSOLE
depends on !4xx && !PPC_8xx && !SPARC && !M68K && !PARISC && !FRV && \
!SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \
(!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) 
&& \
-   !ARM64 && !ARC && !MICROBLAZE && !OPENRISC
+   !ARM64 && !ARC && !MICROBLAZE && !OPENRISC && HAS_IOMEM
default y
help
  Saying Y here will allow you to use Linux in text mode through a
@@ -85,7 +85,7 @@ config MDA_CONSOLE
 
 config SGI_NEWPORT_CONSOLE
 tristate "SGI Newport Console support"
-depends on SGI_IP22 
+depends on SGI_IP22 && HAS_IOMEM
 select FONT_SUPPORT
 help
   Say Y here if you want the console on the Newport aka XL graphics
@@ -153,7 +153,7 @@ config FRAMEBUFFER_CONSOLE_ROTATION
 
 config STI_CONSOLE
 bool "STI text console"
-depends on PARISC
+depends on PARISC && HAS_IOMEM
 select FONT_SUPPORT
 default y
 help
-- 
2.7.4



[PATCH v4 0/3] Enable CONFIG_VT support for S390

2018-02-22 Thread Farhan Ali
Hi,

This series of patches add support for an additional tty
and console for a S390 KVM guest using a virtio-gpu device[1].

Patch 1 enables the "Graphics support" menu which is
needed to enable dummy console, since the VT layer needs it.
The dependency is moved to sub menu items and console
drivers now.

Patch 2 fixes few linker issues.

Patch 3 add support for enabling VT layer for S390.


ChangeLog
-
v3 -> v4
   - Add r-b's.
   - Move HAS_IOMEM dependency in drivers/video/Kconfig to cover
 from config HAVE_FB_ATMEL to config HDMI (patch 1).
   - Add HAS_IOMEM for VGA_CONSOLE (patch 1).

v2 -> v3
- Move HAS_IOMEM dependency to sub menu items and console
drivers (patch 1)

v1 -> v2

v1 was posted under a different subject and here is a link to it:
https://www.spinics.net/lists/linux-s390/msg18175.html

   - Combine patch 1 and 2 from v1 into one patch (patch 1).
   - Additional patches to enable CONFIG_VT for S390.


Thanks
Farhan

Farhan Ali (3):
  Kconfig : Remove HAS_IOMEM dependency for Graphics support
  s390/char : Rename EBCDIC keymap variables
  s390/setup : enable display support for KVM guest

 arch/s390/kernel/setup.c  |  2 ++
 drivers/s390/char/defkeymap.c | 66 ++-
 drivers/s390/char/keyboard.c  | 32 ++---
 drivers/s390/char/keyboard.h  | 11 
 drivers/tty/Kconfig   |  2 +-
 drivers/video/Kconfig |  5 +++-
 drivers/video/console/Kconfig |  6 ++--
 7 files changed, 71 insertions(+), 53 deletions(-)

-- 
2.7.4



Re: [PATCH v2 1/3] Kconfig : Remove HAS_IOMEM dependency for Graphics support

2018-02-08 Thread Farhan Ali



On 02/08/2018 08:11 AM, Bartlomiej Zolnierkiewicz wrote:


Hi,

[ dri-devel ML & arch/[score,um] Maintainers added to Cc: ]

On Friday, February 02, 2018 08:59:57 AM Christian Borntraeger wrote:

On 02/01/2018 07:41 PM, Farhan Ali wrote:

The 'commit e25df1205f37 ("[S390] Kconfig: menus with depends on HAS_IOMEM.")'
added the HAS_IOMEM dependecy for "Graphics support". This disabled the
"Graphics support" menu for S390. But if we enable VT layer for S390,
we would also need to enable the dummy console. So let's remove the
HAS_IOMEM dependency.

Move this dependency to Opencores framebuffer driver which would fail to build
with CONFIG_HAS_IOMEM disabled:

ERROR: "devm_ioremap_resource" [drivers/video/fbdev/ocfb.ko] undefined!


"Graphics support" menu covers other things (i.e. DRM), I assume that
they were also checked to not break due to this change?

Yes, DRM compiled fine. And we (s390) would need the DRM subsystem for 
Virtio GPU as well.



Moreover it seems that after this change "Graphics support" menu will
be also enabled (besides s390) for score, tile and um architectures,
I assume that this is okay?


Signed-off-by: Farhan Ali 
Tested-by: Dong Jia Shi 


This also enables several PCI based graphic device driver on s390.
This makes no sense but they all compile fine so I guess this is ok.

I think patch 2 and 3 are clearly for the s390 tree, patch 1 seems trivial
Also ccing Bart. Can we maybe get an ack to carry this patch also via the s390
tree?



---
  drivers/video/Kconfig   | 1 -
  drivers/video/fbdev/Kconfig | 2 +-
  2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 3c20af9..41e7ba9 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -3,7 +3,6 @@
  #

  menu "Graphics support"
-   depends on HAS_IOMEM

  config HAVE_FB_ATMEL
bool
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 2f615b7..ec9c9ce 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -966,7 +966,7 @@ config FB_PVR2

  config FB_OPENCORES
tristate "OpenCores VGA/LCD core 2.0 framebuffer support"
-   depends on FB && HAS_DMA
+   depends on FB && HAS_DMA && HAS_IOMEM
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT


Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics





Re: [PATCH] s390/console: enable dummy console for vt

2018-02-19 Thread Farhan Ali



On 02/15/2018 07:02 AM, Christian Borntraeger wrote:



On 02/15/2018 12:57 PM, Thomas Huth wrote:

On 15.02.2018 12:26, Geert Uytterhoeven wrote:

Hi Christian,

On Thu, Feb 15, 2018 at 12:14 PM, Christian Borntraeger
 wrote:

To enable the virtual terminal layer with virtio-gpu, we need to
provide the dummy console. This console is hidden behind CONFIG_IOMEM
via the graphics support. Instead of fully enabling the graphic
drivers lets just provide a Kconfig option for the dummy console.

Signed-off-by: Christian Borntraeger 
---
New version: instead of moving around the graphic and console stuff,
let's just keep an s390 specific variant of CONFIG_DUMMY_CONSOLE
  arch/s390/Kconfig | 5 +
  1 file changed, 5 insertions(+)

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index cbe1d978693a..a69690f616f3 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -952,6 +952,11 @@ config S390_HYPFS_FS

  source "arch/s390/kvm/Kconfig"

+config DUMMY_CONSOLE
+   bool
+   depends on VT
+   default y
+
  config S390_GUEST
 def_bool y
 prompt "s390 support for virtio devices"


Really?

You already have your own copy of HAS_IOMEM, which makes it hard for
people to track which one applies where.


I think I agree with Geert - let's better fix this in a proper way
instead of doing hacks like this. I guess there will be other
architectures in the future that might want to use the dummy console
without CONFIG_IOMEM, so fixing this in drivers/video/ instead sounds
better to me.


The question is, what is the proper fix?



How about we only fence off sub menu items such as DRM or GPU or Fbdev, 
which actually uses io memory, in drivers/video/Kconfig? Similar to what 
Thomas suggested for moving the CONFIG_IOMEM dependency for fbdevs?




Re: [PATCH] s390/console: enable dummy console for vt

2018-02-19 Thread Farhan Ali



On 02/19/2018 08:37 AM, Christian Borntraeger wrote:



On 02/19/2018 02:35 PM, Farhan Ali wrote:



On 02/15/2018 07:02 AM, Christian Borntraeger wrote:



On 02/15/2018 12:57 PM, Thomas Huth wrote:

On 15.02.2018 12:26, Geert Uytterhoeven wrote:

Hi Christian,

On Thu, Feb 15, 2018 at 12:14 PM, Christian Borntraeger
 wrote:

To enable the virtual terminal layer with virtio-gpu, we need to
provide the dummy console. This console is hidden behind CONFIG_IOMEM
via the graphics support. Instead of fully enabling the graphic
drivers lets just provide a Kconfig option for the dummy console.

Signed-off-by: Christian Borntraeger 
---
New version: instead of moving around the graphic and console stuff,
let's just keep an s390 specific variant of CONFIG_DUMMY_CONSOLE
   arch/s390/Kconfig | 5 +
   1 file changed, 5 insertions(+)

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index cbe1d978693a..a69690f616f3 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -952,6 +952,11 @@ config S390_HYPFS_FS

   source "arch/s390/kvm/Kconfig"

+config DUMMY_CONSOLE
+   bool
+   depends on VT
+   default y
+
   config S390_GUEST
  def_bool y
  prompt "s390 support for virtio devices"


Really?

You already have your own copy of HAS_IOMEM, which makes it hard for
people to track which one applies where.


I think I agree with Geert - let's better fix this in a proper way
instead of doing hacks like this. I guess there will be other
architectures in the future that might want to use the dummy console
without CONFIG_IOMEM, so fixing this in drivers/video/ instead sounds
better to me.


The question is, what is the proper fix?



How about we only fence off sub menu items such as DRM or GPU or Fbdev, which 
actually uses io memory, in drivers/video/Kconfig? Similar to what Thomas 
suggested for moving the CONFIG_IOMEM dependency for fbdevs?


Can you spin a patch?


Yes, I will post it as V3.



[PATCH v3 3/3] s390/setup : enable display support for KVM guest

2018-02-19 Thread Farhan Ali
The S390 architecture does not support any graphics hardware,
but with the latest support for Virtio GPU in Linux and Virtio
GPU emulation in QEMU, it's possible to enable graphics for
S390 using the Virtio GPU device.

To enable display we need to enable the Linux Virtual Terminal (VT)
layer for S390. But the VT subsystem initializes quite early
at boot so we need a dummy console driver till the Virtio GPU
driver is initialized and we can run the framebuffer console.

The framebuffer console over a Virtio GPU device can be run
in combination with the serial SCLP console (default on S390).
The SCLP console can still be accessed by management applications
(eg: via Libvirt's virsh console).

Signed-off-by: Farhan Ali 
Acked-by: Christian Borntraeger 
---
 arch/s390/kernel/setup.c  | 2 ++
 drivers/tty/Kconfig   | 2 +-
 drivers/video/console/Kconfig | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index a6a91f0..f98a0f3 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -221,6 +221,8 @@ static void __init conmode_default(void)
SET_CONSOLE_SCLP;
 #endif
}
+   if (IS_ENABLED(CONFIG_VT) && IS_ENABLED(CONFIG_DUMMY_CONSOLE))
+   conswitchp = &dummy_con;
 }
 
 #ifdef CONFIG_CRASH_DUMP
diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index b811442..5ca53fa 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -11,7 +11,7 @@ if TTY
 
 config VT
bool "Virtual terminal" if EXPERT
-   depends on !S390 && !UML
+   depends on !UML
select INPUT
default y
---help---
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 0023b16..7aa721e 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -9,7 +9,7 @@ config VGA_CONSOLE
depends on !4xx && !PPC_8xx && !SPARC && !M68K && !PARISC && !FRV && \
!SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \
(!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) 
&& \
-   !ARM64 && !ARC && !MICROBLAZE && !OPENRISC
+   !ARM64 && !ARC && !MICROBLAZE && !OPENRISC && !S390
default y
help
  Saying Y here will allow you to use Linux in text mode through a
-- 
2.7.4



[PATCH v3 0/3] Enable CONFIG_VT support for S390

2018-02-19 Thread Farhan Ali
Hi,

This series of patches add support for an additional tty
and console for a S390 KVM guest using a virtio-gpu device[1].

Patch 1 enables the "Graphics support" menu which is
needed to enable dummy console, since the VT layer needs it.
The dependency is moved to sub menu items and console
drivers now.

Patch 2 fixes few linker issues.

Patch 3 add support for enabling VT layer for S390.


ChangeLog
-
v2 -> v3
- Move HAS_IOMEM dependency to sub menu items and console
drivers (patch 1)

v1 -> v2

v1 was posted under a different subject and here is a link to it:
https://www.spinics.net/lists/linux-s390/msg18175.html

   - Combine patch 1 and 2 from v1 into one patch (patch 1).
   - Additional patches to enable CONFIG_VT for S390.


Thanks
Farhan


Farhan Ali (3):
  Kconfig : Remove HAS_IOMEM dependency for Graphics support
  s390/char : Rename EBCDIC keymap variables
  s390/setup : enable display support for KVM guest

 arch/s390/kernel/setup.c  |  2 ++
 drivers/s390/char/defkeymap.c | 66 ++-
 drivers/s390/char/keyboard.c  | 32 ++---
 drivers/s390/char/keyboard.h  | 11 
 drivers/tty/Kconfig   |  2 +-
 drivers/video/Kconfig | 21 +++---
 drivers/video/console/Kconfig |  6 ++--
 7 files changed, 78 insertions(+), 62 deletions(-)

-- 
2.7.4



[PATCH v3 1/3] Kconfig : Remove HAS_IOMEM dependency for Graphics support

2018-02-19 Thread Farhan Ali
The 'commit e25df1205f37 ("[S390] Kconfig: menus with depends on HAS_IOMEM.")'
added the HAS_IOMEM dependecy for "Graphics support". This disabled the
"Graphics support" menu for S390. But if we enable VT layer for S390,
we would also need to enable the dummy console. So let's remove the
HAS_IOMEM dependency.

Move this dependency to sub menu items and console drivers that use
io memory.

Signed-off-by: Farhan Ali 
---
 drivers/video/Kconfig | 21 +++--
 drivers/video/console/Kconfig |  4 ++--
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 3c20af9..8f10915 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -3,7 +3,6 @@
 #
 
 menu "Graphics support"
-   depends on HAS_IOMEM
 
 config HAVE_FB_ATMEL
bool
@@ -11,20 +10,22 @@ config HAVE_FB_ATMEL
 config SH_LCD_MIPI_DSI
bool
 
-source "drivers/char/agp/Kconfig"
+if HAS_IOMEM
+   source "drivers/char/agp/Kconfig"
 
-source "drivers/gpu/vga/Kconfig"
+   source "drivers/gpu/vga/Kconfig"
 
-source "drivers/gpu/host1x/Kconfig"
-source "drivers/gpu/ipu-v3/Kconfig"
+   source "drivers/gpu/host1x/Kconfig"
+   source "drivers/gpu/ipu-v3/Kconfig"
 
-source "drivers/gpu/drm/Kconfig"
+   source "drivers/gpu/drm/Kconfig"
 
-menu "Frame buffer Devices"
-source "drivers/video/fbdev/Kconfig"
-endmenu
+   menu "Frame buffer Devices"
+   source "drivers/video/fbdev/Kconfig"
+   endmenu
 
-source "drivers/video/backlight/Kconfig"
+source "drivers/video/backlight/Kconfig"
+endif
 
 config VGASTATE
tristate
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 7f1f1fb..0023b16 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -85,7 +85,7 @@ config MDA_CONSOLE
 
 config SGI_NEWPORT_CONSOLE
 tristate "SGI Newport Console support"
-depends on SGI_IP22 
+depends on SGI_IP22 && HAS_IOMEM
 select FONT_SUPPORT
 help
   Say Y here if you want the console on the Newport aka XL graphics
@@ -153,7 +153,7 @@ config FRAMEBUFFER_CONSOLE_ROTATION
 
 config STI_CONSOLE
 bool "STI text console"
-depends on PARISC
+depends on PARISC && HAS_IOMEM
 select FONT_SUPPORT
 default y
 help
-- 
2.7.4



[PATCH v3 2/3] s390/char : Rename EBCDIC keymap variables

2018-02-19 Thread Farhan Ali
The Linux Virtual Terminal (VT) layer provides a default keymap
which is compiled when VT layer is enabled. But at the same time
we are also compiling the EBCDIC keymap and this causes the linker
to complain.

So let's rename the EBCDIC keymap variables to prevent linker
conflict.

Signed-off-by: Farhan Ali 
Acked-by: Christian Borntraeger 
---
 drivers/s390/char/defkeymap.c | 66 ++-
 drivers/s390/char/keyboard.c  | 32 ++---
 drivers/s390/char/keyboard.h  | 11 
 3 files changed, 61 insertions(+), 48 deletions(-)

diff --git a/drivers/s390/char/defkeymap.c b/drivers/s390/char/defkeymap.c
index 98a5c45..193142c 100644
--- a/drivers/s390/char/defkeymap.c
+++ b/drivers/s390/char/defkeymap.c
@@ -9,7 +9,9 @@
 #include 
 #include 
 
-u_short plain_map[NR_KEYS] = {
+#include "keyboard.h"
+
+u_short ebc_plain_map[NR_KEYS] = {
0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000,
0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000,
0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000,
@@ -85,12 +87,12 @@ static u_short shift_ctrl_map[NR_KEYS] = {
0xf20a, 0xf108, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
 };
 
-ushort *key_maps[MAX_NR_KEYMAPS] = {
-   plain_map, shift_map, NULL, NULL,
+ushort *ebc_key_maps[MAX_NR_KEYMAPS] = {
+   ebc_plain_map, shift_map, NULL, NULL,
ctrl_map, shift_ctrl_map, NULL,
 };
 
-unsigned int keymap_count = 4;
+unsigned int ebc_keymap_count = 4;
 
 
 /*
@@ -99,7 +101,7 @@ unsigned int keymap_count = 4;
  * the default and allocate dynamically in chunks of 512 bytes.
  */
 
-char func_buf[] = {
+char ebc_func_buf[] = {
'\033', '[', '[', 'A', 0, 
'\033', '[', '[', 'B', 0, 
'\033', '[', '[', 'C', 0, 
@@ -123,37 +125,37 @@ char func_buf[] = {
 };
 
 
-char *funcbufptr = func_buf;
-int funcbufsize = sizeof(func_buf);
-int funcbufleft = 0;  /* space left */
-
-char *func_table[MAX_NR_FUNC] = {
-   func_buf + 0,
-   func_buf + 5,
-   func_buf + 10,
-   func_buf + 15,
-   func_buf + 20,
-   func_buf + 25,
-   func_buf + 31,
-   func_buf + 37,
-   func_buf + 43,
-   func_buf + 49,
-   func_buf + 55,
-   func_buf + 61,
-   func_buf + 67,
-   func_buf + 73,
-   func_buf + 79,
-   func_buf + 85,
-   func_buf + 91,
-   func_buf + 97,
-   func_buf + 103,
-   func_buf + 109,
+char *ebc_funcbufptr = ebc_func_buf;
+int ebc_funcbufsize = sizeof(ebc_func_buf);
+int ebc_funcbufleft = 0;  /* space left */
+
+char *ebc_func_table[MAX_NR_FUNC] = {
+   ebc_func_buf + 0,
+   ebc_func_buf + 5,
+   ebc_func_buf + 10,
+   ebc_func_buf + 15,
+   ebc_func_buf + 20,
+   ebc_func_buf + 25,
+   ebc_func_buf + 31,
+   ebc_func_buf + 37,
+   ebc_func_buf + 43,
+   ebc_func_buf + 49,
+   ebc_func_buf + 55,
+   ebc_func_buf + 61,
+   ebc_func_buf + 67,
+   ebc_func_buf + 73,
+   ebc_func_buf + 79,
+   ebc_func_buf + 85,
+   ebc_func_buf + 91,
+   ebc_func_buf + 97,
+   ebc_func_buf + 103,
+   ebc_func_buf + 109,
NULL,
 };
 
-struct kbdiacruc accent_table[MAX_DIACR] = {
+struct kbdiacruc ebc_accent_table[MAX_DIACR] = {
{'^', 'c', 0003},   {'^', 'd', 0004},
{'^', 'z', 0032},   {'^', 0012, },
 };
 
-unsigned int accent_table_size = 4;
+unsigned int ebc_accent_table_size = 4;
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c
index 5b505fd..db1fbf9 100644
--- a/drivers/s390/char/keyboard.c
+++ b/drivers/s390/char/keyboard.c
@@ -54,24 +54,24 @@ kbd_alloc(void) {
kbd = kzalloc(sizeof(struct kbd_data), GFP_KERNEL);
if (!kbd)
goto out;
-   kbd->key_maps = kzalloc(sizeof(key_maps), GFP_KERNEL);
+   kbd->key_maps = kzalloc(sizeof(ebc_key_maps), GFP_KERNEL);
if (!kbd->key_maps)
goto out_kbd;
-   for (i = 0; i < ARRAY_SIZE(key_maps); i++) {
-   if (key_maps[i]) {
-   kbd->key_maps[i] = kmemdup(key_maps[i],
+   for (i = 0; i < ARRAY_SIZE(ebc_key_maps); i++) {
+   if (ebc_key_maps[i]) {
+   kbd->key_maps[i] = kmemdup(ebc_key_maps[i],
   sizeof(u_short) * NR_KEYS,
   GFP_KERNEL);
if (!kbd->key_maps[i])
goto out_maps;
}
}
-   kbd->func_table = kzalloc(sizeof(func_table), GFP_KERNEL);
+   kbd->func_table = kzalloc(sizeof(ebc_func_table), GFP_KERNEL);
if (!kbd->func_table)
  

Re: [PATCH v3 1/3] Kconfig : Remove HAS_IOMEM dependency for Graphics support

2018-02-19 Thread Farhan Ali



On 02/19/2018 11:25 AM, Thomas Huth wrote:

On 19.02.2018 16:47, Farhan Ali wrote:

The 'commit e25df1205f37 ("[S390] Kconfig: menus with depends on HAS_IOMEM.")'
added the HAS_IOMEM dependecy for "Graphics support". This disabled the
"Graphics support" menu for S390. But if we enable VT layer for S390,
we would also need to enable the dummy console. So let's remove the
HAS_IOMEM dependency.

Move this dependency to sub menu items and console drivers that use
io memory.

Signed-off-by: Farhan Ali 
---
  drivers/video/Kconfig | 21 +++--
  drivers/video/console/Kconfig |  4 ++--
  2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 3c20af9..8f10915 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -3,7 +3,6 @@
  #
  
  menu "Graphics support"

-   depends on HAS_IOMEM
  
  config HAVE_FB_ATMEL

bool
@@ -11,20 +10,22 @@ config HAVE_FB_ATMEL
  config SH_LCD_MIPI_DSI
bool
  
-source "drivers/char/agp/Kconfig"

+if HAS_IOMEM
+   source "drivers/char/agp/Kconfig"
  
-source "drivers/gpu/vga/Kconfig"

+   source "drivers/gpu/vga/Kconfig"
  
-source "drivers/gpu/host1x/Kconfig"

-source "drivers/gpu/ipu-v3/Kconfig"
+   source "drivers/gpu/host1x/Kconfig"
+   source "drivers/gpu/ipu-v3/Kconfig"
  
-source "drivers/gpu/drm/Kconfig"

+   source "drivers/gpu/drm/Kconfig"
  
-menu "Frame buffer Devices"

-source "drivers/video/fbdev/Kconfig"
-endmenu
+   menu "Frame buffer Devices"
+   source "drivers/video/fbdev/Kconfig"
+   endmenu
  
-source "drivers/video/backlight/Kconfig"

+source "drivers/video/backlight/Kconfig"
+endif
  
  config VGASTATE

 tristate
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 7f1f1fb..0023b16 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -85,7 +85,7 @@ config MDA_CONSOLE
  
  config SGI_NEWPORT_CONSOLE

  tristate "SGI Newport Console support"
-depends on SGI_IP22
+depends on SGI_IP22 && HAS_IOMEM
  select FONT_SUPPORT
  help
Say Y here if you want the console on the Newport aka XL graphics
@@ -153,7 +153,7 @@ config FRAMEBUFFER_CONSOLE_ROTATION
  
  config STI_CONSOLE

  bool "STI text console"
-depends on PARISC
+depends on PARISC && HAS_IOMEM
  select FONT_SUPPORT
  default y
  help



Maybe config VGA_CONSOLE should depend on HAS_IOMEM, too? I think you
can hardly use a VGA card without IOMEM, can you?


True, you can't. And I did think of adding the dependency for VGA, but 
VGA already is fenced off by many (almost all) architectures and I 
wasn't sure if it would be necessary. But I can add it.



Anyway, this approach now looks reasonable to me, so either way, feel
free to add my:

Reviewed-by: Thomas Huth 



Thank you so much for reviewing. Appreciate your feedback :)