Re: [PATCH v3 3/8] firmware/sysfb: Set firmware-framebuffer parent device

2024-02-08 Thread kernel test robot
Hi Thomas,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-misc/drm-misc-next]
[also build test ERROR on drm-tip/drm-tip linus/master v6.8-rc3 next-20240208]
[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/Thomas-Zimmermann/video-Add-helpers-for-decoding-screen_info/20240207-215100
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link:
https://lore.kernel.org/r/20240207134932.7321-4-tzimmermann%40suse.de
patch subject: [PATCH v3 3/8] firmware/sysfb: Set firmware-framebuffer parent 
device
config: i386-randconfig-141-20240208 
(https://download.01.org/0day-ci/archive/20240209/202402091444.glvqhceh-...@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20240209/202402091444.glvqhceh-...@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 
| Closes: 
https://lore.kernel.org/oe-kbuild-all/202402091444.glvqhceh-...@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/video/aperture.c:10:
>> include/linux/sysfb.h:108:1: error: expected identifier or '(' before '{' 
>> token
 108 | {
 | ^
   include/linux/sysfb.h:105:39: warning: 'sysfb_create_simplefb' declared 
'static' but never defined [-Wunused-function]
 105 | static inline struct platform_device *sysfb_create_simplefb(const 
struct screen_info *si,
 |   ^
--
   In file included from drivers/firmware/sysfb.c:36:
>> include/linux/sysfb.h:108:1: error: expected identifier or '(' before '{' 
>> token
 108 | {
 | ^
   include/linux/sysfb.h:105:39: warning: 'sysfb_create_simplefb' used but 
never defined
 105 | static inline struct platform_device *sysfb_create_simplefb(const 
struct screen_info *si,
 |   ^
--
   In file included from drivers/firmware/efi/sysfb_efi.c:26:
>> include/linux/sysfb.h:108:1: error: expected identifier or '(' before '{' 
>> token
 108 | {
 | ^
   include/linux/sysfb.h:105:39: warning: 'sysfb_create_simplefb' declared 
'static' but never defined [-Wunused-function]
 105 | static inline struct platform_device *sysfb_create_simplefb(const 
struct screen_info *si,
 |   ^
   drivers/firmware/efi/sysfb_efi.c:345:39: warning: 'efifb_fwnode_ops' defined 
but not used [-Wunused-const-variable=]
 345 | static const struct fwnode_operations efifb_fwnode_ops = {
 |   ^~~~
   drivers/firmware/efi/sysfb_efi.c:238:35: warning: 
'efifb_dmi_swap_width_height' defined but not used [-Wunused-const-variable=]
 238 | static const struct dmi_system_id efifb_dmi_swap_width_height[] 
__initconst = {
 |   ^~~
   drivers/firmware/efi/sysfb_efi.c:188:35: warning: 'efifb_dmi_system_table' 
defined but not used [-Wunused-const-variable=]
 188 | static const struct dmi_system_id efifb_dmi_system_table[] 
__initconst = {
 |   ^~


vim +108 include/linux/sysfb.h

e3263ab389a7bc arch/x86/include/asm/sysfb.h David Rheinsberg 2013-08-02 
 104  
9e121040e54abe include/linux/sysfb.hJavier Martinez Canillas 2022-06-07 
 105  static inline struct platform_device *sysfb_create_simplefb(const struct 
screen_info *si,
c0a4e7e120d3e9 include/linux/sysfb.hThomas Zimmermann2024-02-07 
 106const struct 
simplefb_platform_data *mode,
c0a4e7e120d3e9 include/linux/sysfb.hThomas Zimmermann2024-02-07 
 107struct device 
*parent);
e3263ab389a7bc arch/x86/include/asm/sysfb.h David Rheinsberg 2013-08-02 
@108  {
9e121040e54abe include/linux/sysfb.hJavier Martinez Canillas 2022-06-07 
 109return ERR_PTR(-EINVAL);
e3263ab389a7bc arch/x86/include/asm/sysfb.h David Rheinsberg 2013-08-02 
 110  }
e3263ab389a7bc arch/x86/include/asm/sysfb.h David Rheinsberg 2013-08-02 
 111  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


Re: [PATCH v3 3/8] firmware/sysfb: Set firmware-framebuffer parent device

2024-02-08 Thread kernel test robot
Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on drm-tip/drm-tip linus/master v6.8-rc3 next-20240208]
[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/Thomas-Zimmermann/video-Add-helpers-for-decoding-screen_info/20240207-215100
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link:
https://lore.kernel.org/r/20240207134932.7321-4-tzimmermann%40suse.de
patch subject: [PATCH v3 3/8] firmware/sysfb: Set firmware-framebuffer parent 
device
config: i386-randconfig-141-20240208 
(https://download.01.org/0day-ci/archive/20240208/202402081952.wlklcxmw-...@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20240208/202402081952.wlklcxmw-...@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 
| Closes: 
https://lore.kernel.org/oe-kbuild-all/202402081952.wlklcxmw-...@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/firmware/sysfb.c:36:
   include/linux/sysfb.h:108:1: error: expected identifier or '(' before '{' 
token
 108 | {
 | ^
>> include/linux/sysfb.h:105:39: warning: 'sysfb_create_simplefb' used but 
>> never defined
 105 | static inline struct platform_device *sysfb_create_simplefb(const 
struct screen_info *si,
 |   ^
--
   In file included from drivers/video/aperture.c:10:
   include/linux/sysfb.h:108:1: error: expected identifier or '(' before '{' 
token
 108 | {
 | ^
>> include/linux/sysfb.h:105:39: warning: 'sysfb_create_simplefb' declared 
>> 'static' but never defined [-Wunused-function]
 105 | static inline struct platform_device *sysfb_create_simplefb(const 
struct screen_info *si,
 |   ^
--
   In file included from drivers/firmware/efi/sysfb_efi.c:26:
   include/linux/sysfb.h:108:1: error: expected identifier or '(' before '{' 
token
 108 | {
 | ^
>> include/linux/sysfb.h:105:39: warning: 'sysfb_create_simplefb' declared 
>> 'static' but never defined [-Wunused-function]
 105 | static inline struct platform_device *sysfb_create_simplefb(const 
struct screen_info *si,
 |   ^
   drivers/firmware/efi/sysfb_efi.c:345:39: warning: 'efifb_fwnode_ops' defined 
but not used [-Wunused-const-variable=]
 345 | static const struct fwnode_operations efifb_fwnode_ops = {
 |   ^~~~
   drivers/firmware/efi/sysfb_efi.c:238:35: warning: 
'efifb_dmi_swap_width_height' defined but not used [-Wunused-const-variable=]
 238 | static const struct dmi_system_id efifb_dmi_swap_width_height[] 
__initconst = {
 |   ^~~
   drivers/firmware/efi/sysfb_efi.c:188:35: warning: 'efifb_dmi_system_table' 
defined but not used [-Wunused-const-variable=]
 188 | static const struct dmi_system_id efifb_dmi_system_table[] 
__initconst = {
 |   ^~


vim +/sysfb_create_simplefb +105 include/linux/sysfb.h

e3263ab389a7bc arch/x86/include/asm/sysfb.h David Rheinsberg 2013-08-02 
 104  
9e121040e54abe include/linux/sysfb.hJavier Martinez Canillas 2022-06-07 
@105  static inline struct platform_device *sysfb_create_simplefb(const struct 
screen_info *si,
c0a4e7e120d3e9 include/linux/sysfb.hThomas Zimmermann2024-02-07 
 106const struct 
simplefb_platform_data *mode,
c0a4e7e120d3e9 include/linux/sysfb.hThomas Zimmermann2024-02-07 
 107struct device 
*parent);
e3263ab389a7bc arch/x86/include/asm/sysfb.h David Rheinsberg 2013-08-02 
@108  {
9e121040e54abe include/linux/sysfb.hJavier Martinez Canillas 2022-06-07 
 109return ERR_PTR(-EINVAL);
e3263ab389a7bc arch/x86/include/asm/sysfb.h David Rheinsberg 2013-08-02 
 110  }
e3263ab389a7bc arch/x86/include/asm/sysfb.h David Rheinsberg 2013-08-02 
 111  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


Re: [PATCH v3 3/8] firmware/sysfb: Set firmware-framebuffer parent device

2024-02-08 Thread kernel test robot
Hi Thomas,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-misc/drm-misc-next]
[also build test ERROR on drm-tip/drm-tip linus/master v6.8-rc3 next-20240208]
[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/Thomas-Zimmermann/video-Add-helpers-for-decoding-screen_info/20240207-215100
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link:
https://lore.kernel.org/r/20240207134932.7321-4-tzimmermann%40suse.de
patch subject: [PATCH v3 3/8] firmware/sysfb: Set firmware-framebuffer parent 
device
config: x86_64-rhel-8.3-bpf 
(https://download.01.org/0day-ci/archive/20240208/202402081758.cyllkurz-...@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 
6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20240208/202402081758.cyllkurz-...@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 
| Closes: 
https://lore.kernel.org/oe-kbuild-all/202402081758.cyllkurz-...@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/firmware/sysfb.c:36:
>> include/linux/sysfb.h:108:1: error: expected identifier or '('
 108 | {
 | ^
   1 error generated.


vim +108 include/linux/sysfb.h

e3263ab389a7bc arch/x86/include/asm/sysfb.h David Rheinsberg 2013-08-02 
 104  
9e121040e54abe include/linux/sysfb.hJavier Martinez Canillas 2022-06-07 
 105  static inline struct platform_device *sysfb_create_simplefb(const struct 
screen_info *si,
c0a4e7e120d3e9 include/linux/sysfb.hThomas Zimmermann2024-02-07 
 106const struct 
simplefb_platform_data *mode,
c0a4e7e120d3e9 include/linux/sysfb.hThomas Zimmermann2024-02-07 
 107struct device 
*parent);
e3263ab389a7bc arch/x86/include/asm/sysfb.h David Rheinsberg 2013-08-02 
@108  {
9e121040e54abe include/linux/sysfb.hJavier Martinez Canillas 2022-06-07 
 109return ERR_PTR(-EINVAL);
e3263ab389a7bc arch/x86/include/asm/sysfb.h David Rheinsberg 2013-08-02 
 110  }
e3263ab389a7bc arch/x86/include/asm/sysfb.h David Rheinsberg 2013-08-02 
 111  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


[PATCH v3 3/8] firmware/sysfb: Set firmware-framebuffer parent device

2024-02-07 Thread Thomas Zimmermann
Set the firmware framebuffer's parent device, which usually is the
graphics hardware's physical device. Integrates the framebuffer in
the Linux device hierarchy and lets Linux handle dependencies among
devices. For example, the graphics hardware won't be suspended while
the firmware device is still active.

v3:
* fix build for CONFIG_SYSFB_SIMPLEFB=n (Sui)
* test result of screen_info_pci_dev() for errors (Sui)
v2:
* detect parent device in sysfb_parent_dev()

Signed-off-by: Thomas Zimmermann 
Reviewed-by: Javier Martinez Canillas 
---
 drivers/firmware/sysfb.c  | 21 -
 drivers/firmware/sysfb_simplefb.c |  5 -
 include/linux/sysfb.h |  6 --
 3 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c
index 3c197db42c9d9..4e104f3de4b95 100644
--- a/drivers/firmware/sysfb.c
+++ b/drivers/firmware/sysfb.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -69,9 +70,23 @@ void sysfb_disable(void)
 }
 EXPORT_SYMBOL_GPL(sysfb_disable);
 
+static __init struct device *sysfb_parent_dev(const struct screen_info *si)
+{
+   struct pci_dev *pdev;
+
+   pdev = screen_info_pci_dev(si);
+   if (IS_ERR(pdev))
+   return ERR_CAST(pdev);
+   else if (pdev)
+   return &pdev->dev;
+
+   return NULL;
+}
+
 static __init int sysfb_init(void)
 {
struct screen_info *si = &screen_info;
+   struct device *parent;
struct simplefb_platform_data mode;
const char *name;
bool compatible;
@@ -83,10 +98,12 @@ static __init int sysfb_init(void)
 
sysfb_apply_efi_quirks();
 
+   parent = sysfb_parent_dev(si);
+
/* try to create a simple-framebuffer device */
compatible = sysfb_parse_mode(si, &mode);
if (compatible) {
-   pd = sysfb_create_simplefb(si, &mode);
+   pd = sysfb_create_simplefb(si, &mode, parent);
if (!IS_ERR(pd))
goto unlock_mutex;
}
@@ -109,6 +126,8 @@ static __init int sysfb_init(void)
goto unlock_mutex;
}
 
+   pd->dev.parent = parent;
+
sysfb_set_efifb_fwnode(pd);
 
ret = platform_device_add_data(pd, si, sizeof(*si));
diff --git a/drivers/firmware/sysfb_simplefb.c 
b/drivers/firmware/sysfb_simplefb.c
index 74363ed7501f6..75a186bf8f8ec 100644
--- a/drivers/firmware/sysfb_simplefb.c
+++ b/drivers/firmware/sysfb_simplefb.c
@@ -91,7 +91,8 @@ __init bool sysfb_parse_mode(const struct screen_info *si,
 }
 
 __init struct platform_device *sysfb_create_simplefb(const struct screen_info 
*si,
-const struct 
simplefb_platform_data *mode)
+const struct 
simplefb_platform_data *mode,
+struct device *parent)
 {
struct platform_device *pd;
struct resource res;
@@ -143,6 +144,8 @@ __init struct platform_device *sysfb_create_simplefb(const 
struct screen_info *s
if (!pd)
return ERR_PTR(-ENOMEM);
 
+   pd->dev.parent = parent;
+
sysfb_set_efifb_fwnode(pd);
 
ret = platform_device_add_resources(pd, &res, 1);
diff --git a/include/linux/sysfb.h b/include/linux/sysfb.h
index 19cb803dd5ecd..9a007ea2d3635 100644
--- a/include/linux/sysfb.h
+++ b/include/linux/sysfb.h
@@ -91,7 +91,8 @@ static inline void sysfb_set_efifb_fwnode(struct 
platform_device *pd)
 bool sysfb_parse_mode(const struct screen_info *si,
  struct simplefb_platform_data *mode);
 struct platform_device *sysfb_create_simplefb(const struct screen_info *si,
- const struct 
simplefb_platform_data *mode);
+ const struct 
simplefb_platform_data *mode,
+ struct device *parent);
 
 #else /* CONFIG_SYSFB_SIMPLE */
 
@@ -102,7 +103,8 @@ static inline bool sysfb_parse_mode(const struct 
screen_info *si,
 }
 
 static inline struct platform_device *sysfb_create_simplefb(const struct 
screen_info *si,
-   const struct 
simplefb_platform_data *mode)
+   const struct 
simplefb_platform_data *mode,
+   struct device 
*parent);
 {
return ERR_PTR(-EINVAL);
 }
-- 
2.43.0