Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: kernel test robot <lkp@intel.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	oe-kbuild-all@lists.linux.dev, intel-gfx@lists.freedesktop.org,
	Javier Martinez Canillas <javierm@redhat.com>,
	Helge Deller <deller@gmx.de>, Sam Ravnborg <sam@ravnborg.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	stable@vger.kernel.org
Subject: Re: [PATCH] video/aperture: match the pci device when calling sysfb_disable()
Date: Mon, 19 Aug 2024 10:04:22 +0200	[thread overview]
Message-ID: <8bbf3f92-3719-4ff4-9587-e076635758d1@suse.de> (raw)
In-Reply-To: <CADnq5_NjCFyy+bQY+uyijcZwvwXYkvVLLUQdtzN_ODvHAj193Q@mail.gmail.com>

Hi

Am 16.08.24 um 22:57 schrieb Alex Deucher:
> On Mon, Aug 12, 2024 at 8:10 AM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>> Hi
>>
>> Am 10.08.24 um 13:44 schrieb kernel test robot:
>>> Hi Alex,
>>>
>>> kernel test robot noticed the following build errors:
>>>
>>> [auto build test ERROR on drm-misc/drm-misc-next]
>>> [also build test ERROR on linus/master v6.11-rc2 next-20240809]
>>> [If your patch is applied to the wrong git tree, kindly drop us a note.
>>> And when submitting patch, we suggest to use '--base' as documented in
>>> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>>>
>>> url:    https://github.com/intel-lab-lkp/linux/commits/Alex-Deucher/video-aperture-match-the-pci-device-when-calling-sysfb_disable/20240810-021357
>>> base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
>>> patch link:    https://lore.kernel.org/r/20240809150327.2485848-1-alexander.deucher%40amd.com
>>> patch subject: [PATCH] video/aperture: match the pci device when calling sysfb_disable()
>>> config: csky-randconfig-001-20240810 (https://download.01.org/0day-ci/archive/20240810/202408101951.tXyqYOzv-lkp@intel.com/config)
>>> compiler: csky-linux-gcc (GCC) 14.1.0
>>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240810/202408101951.tXyqYOzv-lkp@intel.com/reproduce)
>>>
>>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>>> the same patch/commit), kindly add following tags
>>> | Reported-by: kernel test robot <lkp@intel.com>
>>> | Closes: https://lore.kernel.org/oe-kbuild-all/202408101951.tXyqYOzv-lkp@intel.com/
>>>
>>> All errors (new ones prefixed by >>):
>>>
>>>      csky-linux-ld: drivers/video/aperture.o: in function `aperture_remove_conflicting_pci_devices':
>>>>> aperture.c:(.text+0x222): undefined reference to `screen_info_pci_dev'
>> Strange. There's a already placeholder [1] for architectures without
>> PCI. Otherwise the source file is listed at [2].
> So I dug into this, and the problem seems to be that
> CONFIG_SCREEN_INFO is not defined in that config.  I can't figure out
> how this should work in that case or why this is not a problem in
> drivers/firmware/sysfb.c.
>
> Something like this works:
> diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c
> index 56a5a0bc2b1af..50e98210c9fe5 100644
> --- a/drivers/video/aperture.c
> +++ b/drivers/video/aperture.c
> @@ -347,7 +347,9 @@ EXPORT_SYMBOL(__aperture_remove_legacy_vga_devices);
>    */
>   int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev,
> const char *name)
>   {
> +#if defined(CONFIG_SCREEN_INFO)
>          struct screen_info *si = &screen_info;
> +#endif
>          bool primary = false;
>          resource_size_t base, size;
>          int bar, ret = 0;
> @@ -355,8 +357,10 @@ int
> aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const
> char *na
>          if (pdev == vga_default_device())
>                  primary = true;
>
> +#if defined(CONFIG_SCREEN_INFO)
>          if (pdev == screen_info_pci_dev(si))
>                  sysfb_disable();
> +#endif
>
>          for (bar = 0; bar < PCI_STD_NUM_BARS; ++bar) {
>                  if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))
>
> But that can't be the right fix...  Any ideas?

Thanks for investigating. I'd say we should pass the device (pdev->dev) 
to sysfb_disable() and  do the test there. In sysfb.c, next to 
sysfb_disable(), you'll find sysfb_parent_dev(), which gives the Linux 
device of the screen_info.

The code then looks something like this:

sysfb_disable(struct device *dev)
{
     if (dev && dev == sysfb_parent_dev(screen_info))
       return

   /* else do the current code */
}

there's an invocation of sysfb_disable() in drivers/of/platform.c where 
you can pass NULL.

Best regards
Thomas

>
> Alex
>
>> [1]
>> https://elixir.bootlin.com/linux/v6.10/source/include/linux/screen_info.h#L127
>> [2] https://elixir.bootlin.com/linux/v6.10/source/drivers/video/Makefile#L11
>>
>> Best regards
>> Thomas
>>
>>>      csky-linux-ld: drivers/video/aperture.o: in function `devm_aperture_acquire_release':
>>>>> aperture.c:(.text+0x2c0): undefined reference to `screen_info'
>>>>> csky-linux-ld: aperture.c:(.text+0x2c4): undefined reference to `screen_info_pci_dev'
>> --
>> --
>> Thomas Zimmermann
>> Graphics Driver Developer
>> SUSE Software Solutions Germany GmbH
>> Frankenstrasse 146, 90461 Nuernberg, Germany
>> GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
>> HRB 36809 (AG Nuernberg)
>>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


  reply	other threads:[~2024-08-19  8:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09 15:03 [PATCH] video/aperture: match the pci device when calling sysfb_disable() Alex Deucher
2024-08-09 15:39 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2024-08-09 15:46 ` ✓ Fi.CI.BAT: success " Patchwork
2024-08-10 11:44 ` [PATCH] " kernel test robot
2024-08-12 12:10   ` Thomas Zimmermann
2024-08-16 20:57     ` Alex Deucher
2024-08-19  8:04       ` Thomas Zimmermann [this message]
2024-08-19 13:36         ` Javier Martinez Canillas
2024-08-19 15:14         ` Thomas Zimmermann
2024-08-10 12:25 ` kernel test robot
2024-08-10 18:49 ` ✗ Fi.CI.IGT: failure for " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bbf3f92-3719-4ff4-9587-e076635758d1@suse.de \
    --to=tzimmermann@suse.de \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=sam@ravnborg.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox