diff mbox

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

Message ID f6db4d0a-3578-4162-5de7-6e699f7a02c2@de.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Christian Borntraeger Feb. 21, 2018, 11:49 a.m. UTC
On 02/21/2018 12:29 PM, Thomas Huth wrote:
> On 21.02.2018 12:22, Christian Borntraeger wrote:
>>
>>
>> On 02/21/2018 12:14 PM, Thomas Huth wrote:
>>> On 21.02.2018 12:09, Christian Borntraeger wrote:
>>>>
>>>>
>>>> On 02/21/2018 11:32 AM, Cornelia Huck wrote:
>>>>> On Wed, 21 Feb 2018 11:22:38 +0100
>>>>> Christian Borntraeger <borntraeger@de.ibm.com> wrote:
>>>>>
>>>>>> On 02/21/2018 11:05 AM, Christian Borntraeger wrote:
>>>>>>>
>>>>>>>
>>>>>>> On 02/19/2018 05:38 PM, Farhan Ali wrote:  
>>>>>>>>
>>>>>>>>
>>>>>>>> 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 <alifm@linux.vnet.ibm.com>
>>>>>>>>>> ---
>>>>>>>>>>   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"  
>>>>>>>
>>>>>>>
>>>>>>> Hmmm, looks like that this makes it impossible to select VIRTIO_GPU - need still more
>>>>>>> work.
>>>>>>>   
>>>>>> Sorry my fault. I had CONFIG_PCI disabled.
>>>>>
>>>>> That smells like the s390 HAS_IOMEM stuff needs more work -- I guess
>>>>> that you want to enable a ccw virtio-gpu device, not a pci one, right?
>>>>
>>>> It is a ccw virtio-gpu. But s390 has no IOMEM without CONFIG_PCI, so you cannot
>>>> select VIRTIO_GPU, which needs DRM, which need IOMEM.
>>>
>>> So the 'source "drivers/gpu/drm/Kconfig"' should maybe rather reside
>>> outside of the "if HAS_IOMEM" path? Or does it not compile anymore that way?
>>
>> virtio-gpu depends on drm. So in essence it boils down to if you want virtio-gpu
>> you also need to enable PCI, even if the actual channel is ccw.
> 
> 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. This patches goal was to always enable dummy console even without
PCI, but it obviously fails to do so.

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



--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Cornelia Huck Feb. 21, 2018, 12:07 p.m. UTC | #1
On Wed, 21 Feb 2018 12:49:35 +0100
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> On 02/21/2018 12:29 PM, Thomas Huth wrote:
> > On 21.02.2018 12:22, Christian Borntraeger wrote:  
> >>
> >>
> >> On 02/21/2018 12:14 PM, Thomas Huth wrote:  
> >>> On 21.02.2018 12:09, Christian Borntraeger wrote:  
> >>>>
> >>>>
> >>>> On 02/21/2018 11:32 AM, Cornelia Huck wrote:  
> >>>>> On Wed, 21 Feb 2018 11:22:38 +0100
> >>>>> Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> >>>>>  
> >>>>>> On 02/21/2018 11:05 AM, Christian Borntraeger wrote:  
> >>>>>>>
> >>>>>>>
> >>>>>>> On 02/19/2018 05:38 PM, Farhan Ali wrote:    
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> 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 <alifm@linux.vnet.ibm.com>
> >>>>>>>>>> ---
> >>>>>>>>>>   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"    
> >>>>>>>
> >>>>>>>
> >>>>>>> Hmmm, looks like that this makes it impossible to select VIRTIO_GPU - need still more
> >>>>>>> work.
> >>>>>>>     
> >>>>>> Sorry my fault. I had CONFIG_PCI disabled.  
> >>>>>
> >>>>> That smells like the s390 HAS_IOMEM stuff needs more work -- I guess
> >>>>> that you want to enable a ccw virtio-gpu device, not a pci one, right?  
> >>>>
> >>>> It is a ccw virtio-gpu. But s390 has no IOMEM without CONFIG_PCI, so you cannot
> >>>> select VIRTIO_GPU, which needs DRM, which need IOMEM.  
> >>>
> >>> So the 'source "drivers/gpu/drm/Kconfig"' should maybe rather reside
> >>> outside of the "if HAS_IOMEM" path? Or does it not compile anymore that way?  
> >>
> >> virtio-gpu depends on drm. So in essence it boils down to if you want virtio-gpu
> >> you also need to enable PCI, even if the actual channel is ccw.  
> > 
> > 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. 

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

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

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 :/
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christian Borntraeger Feb. 21, 2018, 12:11 p.m. UTC | #2
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. 
> 
> 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.

> 
>> This patches goal was to always enable dummy console even without
>> PCI, but it obviously fails to do so.
> 
> 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 :/
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Farhan Ali Feb. 21, 2018, 4:39 p.m. UTC | #3
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 :/
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christian Borntraeger Feb. 22, 2018, 7:34 a.m. UTC | #4
On 02/21/2018 05:39 PM, Farhan Ali wrote:
> 
> 
> 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.


All right. This patch then makes sure that VT does not crash since it guarantees
that DUMMY_CONSOLE is available. If the user want to have virtio-gpu it needs to
enable PCI due to the dependencies, but this is a different issue that we can fix
later.
So the patch is fine as long as you take care of these things

- add missing HAS_IOMEM dependency to VGA_CONSOLE

- extend "if HAS_IOMEM" in drivers/video/Kconfig to cover config items
  previously covered by this dependency (it should start before config
  HAVE_FB_ATMEL and end after config HDMI)

as requested by Bartlomiej 

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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---