linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH V6 1/8]  pvpanic: move pvpanic to misc as common driver
  2018-11-02 12:56 [PATCH V6 1/8] pvpanic: move pvpanic to misc as common driver Peng Hao
@ 2018-11-02  6:42 ` kbuild test robot
  2018-11-02  7:39 ` kbuild test robot
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: kbuild test robot @ 2018-11-02  6:42 UTC (permalink / raw)
  To: Peng Hao
  Cc: kbuild-all, robh+dt, mark.rutland, arnd, gregkh, andy, dvhart,
	linux-kernel, platform-driver-x86, hutao, linux-doc, Peng Hao

[-- Attachment #1: Type: text/plain, Size: 12822 bytes --]

Hi Peng,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on v4.19 next-20181102]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Peng-Hao/pvpanic-move-pvpanic-to-misc-as-common-driver/20181102-124907
config: openrisc-allyesconfig (attached as .config)
compiler: or1k-linux-gcc (GCC) 6.0.0 20160327 (experimental)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=openrisc 

All errors (new ones prefixed by >>):

   drivers/misc/pvpanic.c:36:36: error: array type has incomplete element type 'struct acpi_device_id'
    static const struct acpi_device_id pvpanic_device_ids[] = {
                                       ^~~~~~~~~~~~~~~~~~
   drivers/misc/pvpanic.c:46:15: error: variable 'pvpanic_driver' has initializer but incomplete type
    static struct acpi_driver pvpanic_driver = {
                  ^~~~~~~~~~~
>> drivers/misc/pvpanic.c:47:2: error: unknown field 'name' specified in initializer
     .name =  "pvpanic",
     ^
   drivers/misc/pvpanic.c:47:11: warning: excess elements in struct initializer
     .name =  "pvpanic",
              ^~~~~~~~~
   drivers/misc/pvpanic.c:47:11: note: (near initialization for 'pvpanic_driver')
>> drivers/misc/pvpanic.c:48:2: error: unknown field 'class' specified in initializer
     .class = "QEMU",
     ^
   drivers/misc/pvpanic.c:48:11: warning: excess elements in struct initializer
     .class = "QEMU",
              ^~~~~~
   drivers/misc/pvpanic.c:48:11: note: (near initialization for 'pvpanic_driver')
>> drivers/misc/pvpanic.c:49:2: error: unknown field 'ids' specified in initializer
     .ids =  pvpanic_device_ids,
     ^
   drivers/misc/pvpanic.c:49:10: warning: excess elements in struct initializer
     .ids =  pvpanic_device_ids,
             ^~~~~~~~~~~~~~~~~~
   drivers/misc/pvpanic.c:49:10: note: (near initialization for 'pvpanic_driver')
>> drivers/misc/pvpanic.c:50:2: error: unknown field 'ops' specified in initializer
     .ops =  {
     ^
   drivers/misc/pvpanic.c:50:10: error: extra brace group at end of initializer
     .ops =  {
             ^
   drivers/misc/pvpanic.c:50:10: note: (near initialization for 'pvpanic_driver')
   drivers/misc/pvpanic.c:50:10: warning: excess elements in struct initializer
   drivers/misc/pvpanic.c:50:10: note: (near initialization for 'pvpanic_driver')
>> drivers/misc/pvpanic.c:54:2: error: unknown field 'owner' specified in initializer
     .owner = THIS_MODULE,
     ^
   In file included from include/linux/linkage.h:7:0,
                    from include/linux/kernel.h:7,
                    from drivers/misc/pvpanic.c:23:
   include/linux/export.h:18:21: warning: excess elements in struct initializer
    #define THIS_MODULE ((struct module *)0)
                        ^
   drivers/misc/pvpanic.c:54:11: note: in expansion of macro 'THIS_MODULE'
     .owner = THIS_MODULE,
              ^~~~~~~~~~~
   include/linux/export.h:18:21: note: (near initialization for 'pvpanic_driver')
    #define THIS_MODULE ((struct module *)0)
                        ^
   drivers/misc/pvpanic.c:54:11: note: in expansion of macro 'THIS_MODULE'
     .owner = THIS_MODULE,
              ^~~~~~~~~~~
   drivers/misc/pvpanic.c: In function 'pvpanic_send_event':
   drivers/misc/pvpanic.c:60:2: error: implicit declaration of function 'outb' [-Werror=implicit-function-declaration]
     outb(event, port);
     ^~~~
   drivers/misc/pvpanic.c: In function 'pvpanic_add':
>> drivers/misc/pvpanic.c:97:8: error: implicit declaration of function 'acpi_bus_get_status' [-Werror=implicit-function-declaration]
     ret = acpi_bus_get_status(device);
           ^~~~~~~~~~~~~~~~~~~
   drivers/misc/pvpanic.c:101:13: error: dereferencing pointer to incomplete type 'struct acpi_device'
     if (!device->status.enabled || !device->status.functional)
                ^~
   drivers/misc/pvpanic.c: At top level:
   drivers/misc/pvpanic.c:124:1: warning: data definition has no type or storage class
    module_acpi_driver(pvpanic_driver);
    ^~~~~~~~~~~~~~~~~~
   drivers/misc/pvpanic.c:124:1: error: type defaults to 'int' in declaration of 'module_acpi_driver' [-Werror=implicit-int]
   drivers/misc/pvpanic.c:124:1: warning: parameter names (without types) in function declaration
   drivers/misc/pvpanic.c:46:27: error: storage size of 'pvpanic_driver' isn't known
    static struct acpi_driver pvpanic_driver = {
                              ^~~~~~~~~~~~~~
   drivers/misc/pvpanic.c:46:27: warning: 'pvpanic_driver' defined but not used [-Wunused-variable]
   drivers/misc/pvpanic.c:36:36: warning: 'pvpanic_device_ids' defined but not used [-Wunused-variable]
    static const struct acpi_device_id pvpanic_device_ids[] = {
                                       ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/name +47 drivers/misc/pvpanic.c

8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   35  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @36  static const struct acpi_device_id pvpanic_device_ids[] = {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   37  	{ "QEMU0001", 0 },
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   38  	{ "", 0 },
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   39  };
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   40  MODULE_DEVICE_TABLE(acpi, pvpanic_device_ids);
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   41  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   42  #define PVPANIC_PANICKED	(1 << 0)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   43  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   44  static u16 port;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   45  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   46  static struct acpi_driver pvpanic_driver = {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @47  	.name =		"pvpanic",
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @48  	.class =	"QEMU",
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @49  	.ids =		pvpanic_device_ids,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @50  	.ops =		{
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   51  				.add =		pvpanic_add,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   52  				.remove =	pvpanic_remove,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   53  			},
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @54  	.owner =	THIS_MODULE,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   55  };
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   56  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   57  static void
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   58  pvpanic_send_event(unsigned int event)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   59  {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   60  	outb(event, port);
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   61  }
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   62  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   63  static int
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   64  pvpanic_panic_notify(struct notifier_block *nb, unsigned long code,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   65  		     void *unused)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   66  {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   67  	pvpanic_send_event(PVPANIC_PANICKED);
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   68  	return NOTIFY_DONE;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   69  }
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   70  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   71  static struct notifier_block pvpanic_panic_nb = {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   72  	.notifier_call = pvpanic_panic_notify,
7939831ea drivers/platform/x86/pvpanic.c Takashi Iwai 2014-05-06   73  	.priority = 1, /* let this called before broken drm_fb_helper */
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   74  };
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   75  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   76  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   77  static acpi_status
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   78  pvpanic_walk_resources(struct acpi_resource *res, void *context)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   79  {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   80  	switch (res->type) {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   81  	case ACPI_RESOURCE_TYPE_END_TAG:
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   82  		return AE_OK;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   83  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   84  	case ACPI_RESOURCE_TYPE_IO:
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   85  		port = res->data.io.minimum;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   86  		return AE_OK;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   87  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   88  	default:
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   89  		return AE_ERROR;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   90  	}
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   91  }
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   92  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   93  static int pvpanic_add(struct acpi_device *device)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   94  {
55cd3f01d drivers/platform/x86/pvpanic.c Radim Krčmář 2015-05-29   95  	int ret;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   96  
55cd3f01d drivers/platform/x86/pvpanic.c Radim Krčmář 2015-05-29  @97  	ret = acpi_bus_get_status(device);
55cd3f01d drivers/platform/x86/pvpanic.c Radim Krčmář 2015-05-29   98  	if (ret < 0)
55cd3f01d drivers/platform/x86/pvpanic.c Radim Krčmář 2015-05-29   99  		return ret;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  100  
55cd3f01d drivers/platform/x86/pvpanic.c Radim Krčmář 2015-05-29  101  	if (!device->status.enabled || !device->status.functional)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  102  		return -ENODEV;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  103  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  104  	acpi_walk_resources(device->handle, METHOD_NAME__CRS,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  105  			    pvpanic_walk_resources, NULL);
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  106  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  107  	if (!port)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  108  		return -ENODEV;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  109  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  110  	atomic_notifier_chain_register(&panic_notifier_list,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  111  				       &pvpanic_panic_nb);
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  112  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  113  	return 0;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  114  }
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  115  

:::::: The code at line 47 was first introduced by commit
:::::: 8b10acd74cdad9063c7a63468e31759d9ac877d9 pvpanic: pvpanic device driver

:::::: TO: Hu Tao <hutao@cn.fujitsu.com>
:::::: CC: Matthew Garrett <matthew.garrett@nebula.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 47174 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH V6 1/8]  pvpanic: move pvpanic to misc as common driver
  2018-11-02 12:56 [PATCH V6 1/8] pvpanic: move pvpanic to misc as common driver Peng Hao
  2018-11-02  6:42 ` kbuild test robot
@ 2018-11-02  7:39 ` kbuild test robot
  2018-11-02  9:33 ` Andy Shevchenko
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: kbuild test robot @ 2018-11-02  7:39 UTC (permalink / raw)
  To: Peng Hao
  Cc: kbuild-all, robh+dt, mark.rutland, arnd, gregkh, andy, dvhart,
	linux-kernel, platform-driver-x86, hutao, linux-doc, Peng Hao

[-- Attachment #1: Type: text/plain, Size: 12935 bytes --]

Hi Peng,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on v4.19 next-20181102]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Peng-Hao/pvpanic-move-pvpanic-to-misc-as-common-driver/20181102-124907
config: sh-allyesconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=sh 

All error/warnings (new ones prefixed by >>):

   drivers/misc/pvpanic.c:36:36: error: array type has incomplete element type 'struct acpi_device_id'
    static const struct acpi_device_id pvpanic_device_ids[] = {
                                       ^~~~~~~~~~~~~~~~~~
>> drivers/misc/pvpanic.c:46:15: error: variable 'pvpanic_driver' has initializer but incomplete type
    static struct acpi_driver pvpanic_driver = {
                  ^~~~~~~~~~~
>> drivers/misc/pvpanic.c:47:3: error: 'struct acpi_driver' has no member named 'name'
     .name =  "pvpanic",
      ^~~~
>> drivers/misc/pvpanic.c:47:11: warning: excess elements in struct initializer
     .name =  "pvpanic",
              ^~~~~~~~~
   drivers/misc/pvpanic.c:47:11: note: (near initialization for 'pvpanic_driver')
>> drivers/misc/pvpanic.c:48:3: error: 'struct acpi_driver' has no member named 'class'
     .class = "QEMU",
      ^~~~~
   drivers/misc/pvpanic.c:48:11: warning: excess elements in struct initializer
     .class = "QEMU",
              ^~~~~~
   drivers/misc/pvpanic.c:48:11: note: (near initialization for 'pvpanic_driver')
>> drivers/misc/pvpanic.c:49:3: error: 'struct acpi_driver' has no member named 'ids'
     .ids =  pvpanic_device_ids,
      ^~~
   drivers/misc/pvpanic.c:49:10: warning: excess elements in struct initializer
     .ids =  pvpanic_device_ids,
             ^~~~~~~~~~~~~~~~~~
   drivers/misc/pvpanic.c:49:10: note: (near initialization for 'pvpanic_driver')
>> drivers/misc/pvpanic.c:50:3: error: 'struct acpi_driver' has no member named 'ops'
     .ops =  {
      ^~~
>> drivers/misc/pvpanic.c:50:10: error: extra brace group at end of initializer
     .ops =  {
             ^
   drivers/misc/pvpanic.c:50:10: note: (near initialization for 'pvpanic_driver')
   drivers/misc/pvpanic.c:50:10: warning: excess elements in struct initializer
   drivers/misc/pvpanic.c:50:10: note: (near initialization for 'pvpanic_driver')
>> drivers/misc/pvpanic.c:54:3: error: 'struct acpi_driver' has no member named 'owner'
     .owner = THIS_MODULE,
      ^~~~~
   In file included from include/linux/linkage.h:7:0,
                    from include/linux/kernel.h:7,
                    from drivers/misc/pvpanic.c:23:
   include/linux/export.h:18:21: warning: excess elements in struct initializer
    #define THIS_MODULE ((struct module *)0)
                        ^
>> drivers/misc/pvpanic.c:54:11: note: in expansion of macro 'THIS_MODULE'
     .owner = THIS_MODULE,
              ^~~~~~~~~~~
   include/linux/export.h:18:21: note: (near initialization for 'pvpanic_driver')
    #define THIS_MODULE ((struct module *)0)
                        ^
>> drivers/misc/pvpanic.c:54:11: note: in expansion of macro 'THIS_MODULE'
     .owner = THIS_MODULE,
              ^~~~~~~~~~~
   drivers/misc/pvpanic.c: In function 'pvpanic_send_event':
   drivers/misc/pvpanic.c:60:2: error: implicit declaration of function 'outb' [-Werror=implicit-function-declaration]
     outb(event, port);
     ^~~~
   drivers/misc/pvpanic.c: In function 'pvpanic_add':
>> drivers/misc/pvpanic.c:97:8: error: implicit declaration of function 'acpi_bus_get_status'; did you mean 'acpi_get_gpe_status'? [-Werror=implicit-function-declaration]
     ret = acpi_bus_get_status(device);
           ^~~~~~~~~~~~~~~~~~~
           acpi_get_gpe_status
>> drivers/misc/pvpanic.c:101:13: error: dereferencing pointer to incomplete type 'struct acpi_device'
     if (!device->status.enabled || !device->status.functional)
                ^~
   drivers/misc/pvpanic.c: At top level:
   drivers/misc/pvpanic.c:124:1: warning: data definition has no type or storage class
    module_acpi_driver(pvpanic_driver);
    ^~~~~~~~~~~~~~~~~~
   drivers/misc/pvpanic.c:124:1: error: type defaults to 'int' in declaration of 'module_acpi_driver' [-Werror=implicit-int]
   drivers/misc/pvpanic.c:124:1: warning: parameter names (without types) in function declaration
>> drivers/misc/pvpanic.c:46:27: error: storage size of 'pvpanic_driver' isn't known
    static struct acpi_driver pvpanic_driver = {
                              ^~~~~~~~~~~~~~
   drivers/misc/pvpanic.c:46:27: warning: 'pvpanic_driver' defined but not used [-Wunused-variable]
   drivers/misc/pvpanic.c:36:36: warning: 'pvpanic_device_ids' defined but not used [-Wunused-variable]
    static const struct acpi_device_id pvpanic_device_ids[] = {
                                       ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/pvpanic_driver +46 drivers/misc/pvpanic.c

8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   35  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @36  static const struct acpi_device_id pvpanic_device_ids[] = {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   37  	{ "QEMU0001", 0 },
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   38  	{ "", 0 },
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   39  };
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   40  MODULE_DEVICE_TABLE(acpi, pvpanic_device_ids);
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   41  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   42  #define PVPANIC_PANICKED	(1 << 0)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   43  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   44  static u16 port;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   45  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @46  static struct acpi_driver pvpanic_driver = {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @47  	.name =		"pvpanic",
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @48  	.class =	"QEMU",
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @49  	.ids =		pvpanic_device_ids,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @50  	.ops =		{
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   51  				.add =		pvpanic_add,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   52  				.remove =	pvpanic_remove,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   53  			},
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @54  	.owner =	THIS_MODULE,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   55  };
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   56  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   57  static void
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   58  pvpanic_send_event(unsigned int event)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   59  {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  @60  	outb(event, port);
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   61  }
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   62  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   63  static int
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   64  pvpanic_panic_notify(struct notifier_block *nb, unsigned long code,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   65  		     void *unused)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   66  {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   67  	pvpanic_send_event(PVPANIC_PANICKED);
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   68  	return NOTIFY_DONE;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   69  }
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   70  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   71  static struct notifier_block pvpanic_panic_nb = {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   72  	.notifier_call = pvpanic_panic_notify,
7939831ea drivers/platform/x86/pvpanic.c Takashi Iwai 2014-05-06   73  	.priority = 1, /* let this called before broken drm_fb_helper */
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   74  };
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   75  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   76  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   77  static acpi_status
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   78  pvpanic_walk_resources(struct acpi_resource *res, void *context)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   79  {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   80  	switch (res->type) {
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   81  	case ACPI_RESOURCE_TYPE_END_TAG:
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   82  		return AE_OK;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   83  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   84  	case ACPI_RESOURCE_TYPE_IO:
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   85  		port = res->data.io.minimum;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   86  		return AE_OK;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   87  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   88  	default:
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   89  		return AE_ERROR;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   90  	}
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   91  }
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   92  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   93  static int pvpanic_add(struct acpi_device *device)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   94  {
55cd3f01d drivers/platform/x86/pvpanic.c Radim Krčmář 2015-05-29   95  	int ret;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08   96  
55cd3f01d drivers/platform/x86/pvpanic.c Radim Krčmář 2015-05-29  @97  	ret = acpi_bus_get_status(device);
55cd3f01d drivers/platform/x86/pvpanic.c Radim Krčmář 2015-05-29   98  	if (ret < 0)
55cd3f01d drivers/platform/x86/pvpanic.c Radim Krčmář 2015-05-29   99  		return ret;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  100  
55cd3f01d drivers/platform/x86/pvpanic.c Radim Krčmář 2015-05-29 @101  	if (!device->status.enabled || !device->status.functional)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  102  		return -ENODEV;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  103  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  104  	acpi_walk_resources(device->handle, METHOD_NAME__CRS,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  105  			    pvpanic_walk_resources, NULL);
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  106  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  107  	if (!port)
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  108  		return -ENODEV;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  109  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  110  	atomic_notifier_chain_register(&panic_notifier_list,
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  111  				       &pvpanic_panic_nb);
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  112  
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  113  	return 0;
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  114  }
8b10acd74 drivers/platform/x86/pvpanic.c Hu Tao       2013-05-08  115  

:::::: The code at line 46 was first introduced by commit
:::::: 8b10acd74cdad9063c7a63468e31759d9ac877d9 pvpanic: pvpanic device driver

:::::: TO: Hu Tao <hutao@cn.fujitsu.com>
:::::: CC: Matthew Garrett <matthew.garrett@nebula.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 50483 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH V6 3/8]  misc/pvpanic: add MMIO support
  2018-11-02 12:56 ` [PATCH V6 3/8] misc/pvpanic: add MMIO support Peng Hao
@ 2018-11-02  8:28   ` kbuild test robot
  2018-11-02  9:37   ` Andy Shevchenko
  1 sibling, 0 replies; 16+ messages in thread
From: kbuild test robot @ 2018-11-02  8:28 UTC (permalink / raw)
  To: Peng Hao
  Cc: kbuild-all, robh+dt, mark.rutland, arnd, gregkh, andy, dvhart,
	linux-kernel, platform-driver-x86, hutao, linux-doc, Peng Hao

[-- Attachment #1: Type: text/plain, Size: 7719 bytes --]

Hi Peng,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on v4.19 next-20181102]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Peng-Hao/pvpanic-move-pvpanic-to-misc-as-common-driver/20181102-124907
config: openrisc-allyesconfig (attached as .config)
compiler: or1k-linux-gcc (GCC) 6.0.0 20160327 (experimental)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=openrisc 

All errors (new ones prefixed by >>):

   drivers//misc/pvpanic.c:36:36: error: array type has incomplete element type 'struct acpi_device_id'
    static const struct acpi_device_id pvpanic_device_ids[] = {
                                       ^~~~~~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:46:15: error: variable 'pvpanic_driver' has initializer but incomplete type
    static struct acpi_driver pvpanic_driver = {
                  ^~~~~~~~~~~
   drivers//misc/pvpanic.c:47:2: error: unknown field 'name' specified in initializer
     .name =  "pvpanic",
     ^
   drivers//misc/pvpanic.c:47:11: warning: excess elements in struct initializer
     .name =  "pvpanic",
              ^~~~~~~~~
   drivers//misc/pvpanic.c:47:11: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:48:2: error: unknown field 'class' specified in initializer
     .class = "QEMU",
     ^
   drivers//misc/pvpanic.c:48:11: warning: excess elements in struct initializer
     .class = "QEMU",
              ^~~~~~
   drivers//misc/pvpanic.c:48:11: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:49:2: error: unknown field 'ids' specified in initializer
     .ids =  pvpanic_device_ids,
     ^
   drivers//misc/pvpanic.c:49:10: warning: excess elements in struct initializer
     .ids =  pvpanic_device_ids,
             ^~~~~~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:49:10: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:50:2: error: unknown field 'ops' specified in initializer
     .ops =  {
     ^
   drivers//misc/pvpanic.c:50:10: error: extra brace group at end of initializer
     .ops =  {
             ^
   drivers//misc/pvpanic.c:50:10: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:50:10: warning: excess elements in struct initializer
   drivers//misc/pvpanic.c:50:10: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:54:2: error: unknown field 'owner' specified in initializer
     .owner = THIS_MODULE,
     ^
   In file included from include/linux/linkage.h:7:0,
                    from include/linux/kernel.h:7,
                    from drivers//misc/pvpanic.c:23:
   include/linux/export.h:18:21: warning: excess elements in struct initializer
    #define THIS_MODULE ((struct module *)0)
                        ^
   drivers//misc/pvpanic.c:54:11: note: in expansion of macro 'THIS_MODULE'
     .owner = THIS_MODULE,
              ^~~~~~~~~~~
   include/linux/export.h:18:21: note: (near initialization for 'pvpanic_driver')
    #define THIS_MODULE ((struct module *)0)
                        ^
   drivers//misc/pvpanic.c:54:11: note: in expansion of macro 'THIS_MODULE'
     .owner = THIS_MODULE,
              ^~~~~~~~~~~
   drivers//misc/pvpanic.c: In function 'pvpanic_send_event':
   drivers//misc/pvpanic.c:60:2: error: implicit declaration of function 'iowrite8' [-Werror=implicit-function-declaration]
     iowrite8(event, base);
     ^~~~~~~~
   drivers//misc/pvpanic.c: In function 'pvpanic_walk_resources':
   drivers//misc/pvpanic.c:82:6: error: implicit declaration of function 'acpi_dev_resource_io' [-Werror=implicit-function-declaration]
     if (acpi_dev_resource_io(res, &r)) {
         ^~~~~~~~~~~~~~~~~~~~
>> drivers//misc/pvpanic.c:83:27: error: implicit declaration of function 'ioport_map' [-Werror=implicit-function-declaration]
      base = (void __iomem *) ioport_map(r.start,
                              ^~~~~~~~~~
>> drivers//misc/pvpanic.c:86:13: error: implicit declaration of function 'acpi_dev_resource_memory' [-Werror=implicit-function-declaration]
     } else if (acpi_dev_resource_memory(res, &r)) {
                ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:87:10: error: implicit declaration of function 'ioremap' [-Werror=implicit-function-declaration]
      base = ioremap(r.start, r.end - r.start + 1);
             ^~~~~~~
   drivers//misc/pvpanic.c:87:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
      base = ioremap(r.start, r.end - r.start + 1);
           ^
   drivers//misc/pvpanic.c: In function 'pvpanic_add':
   drivers//misc/pvpanic.c:98:8: error: implicit declaration of function 'acpi_bus_get_status' [-Werror=implicit-function-declaration]
     ret = acpi_bus_get_status(device);
           ^~~~~~~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:102:13: error: dereferencing pointer to incomplete type 'struct acpi_device'
     if (!device->status.enabled || !device->status.functional)
                ^~
   drivers//misc/pvpanic.c: In function 'pvpanic_remove':
   drivers//misc/pvpanic.c:122:2: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
     iounmap(base);
     ^~~~~~~
   drivers//misc/pvpanic.c: At top level:
   drivers//misc/pvpanic.c:127:1: warning: data definition has no type or storage class
    module_acpi_driver(pvpanic_driver);
    ^~~~~~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:127:1: error: type defaults to 'int' in declaration of 'module_acpi_driver' [-Werror=implicit-int]
   drivers//misc/pvpanic.c:127:1: warning: parameter names (without types) in function declaration
   drivers//misc/pvpanic.c:46:27: error: storage size of 'pvpanic_driver' isn't known
    static struct acpi_driver pvpanic_driver = {
                              ^~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:46:27: warning: 'pvpanic_driver' defined but not used [-Wunused-variable]
   drivers//misc/pvpanic.c:36:36: warning: 'pvpanic_device_ids' defined but not used [-Wunused-variable]
    static const struct acpi_device_id pvpanic_device_ids[] = {
                                       ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/ioport_map +83 drivers//misc/pvpanic.c

    56	
    57	static void
    58	pvpanic_send_event(unsigned int event)
    59	{
  > 60		iowrite8(event, base);
    61	}
    62	
    63	static int
    64	pvpanic_panic_notify(struct notifier_block *nb, unsigned long code,
    65			     void *unused)
    66	{
    67		pvpanic_send_event(PVPANIC_PANICKED);
    68		return NOTIFY_DONE;
    69	}
    70	
    71	static struct notifier_block pvpanic_panic_nb = {
    72		.notifier_call = pvpanic_panic_notify,
    73		.priority = 1, /* let this called before broken drm_fb_helper */
    74	};
    75	
    76	
    77	static acpi_status
    78	pvpanic_walk_resources(struct acpi_resource *res, void *context)
    79	{
    80		struct resource r;
    81	
  > 82		if (acpi_dev_resource_io(res, &r)) {
  > 83			base = (void __iomem *) ioport_map(r.start,
    84						r.end - r.start + 1);
    85			return AE_OK;
  > 86		} else if (acpi_dev_resource_memory(res, &r)) {
    87			base = ioremap(r.start, r.end - r.start + 1);
    88			return AE_OK;
    89		}
    90	
    91		return AE_ERROR;
    92	}
    93	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 47174 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH V6 2/8]  misc/pvpanic: simplify the code using acpi_dev_resource_io
  2018-11-02 12:56 ` [PATCH V6 2/8] misc/pvpanic: simplify the code using acpi_dev_resource_io Peng Hao
@ 2018-11-02  9:29   ` kbuild test robot
  0 siblings, 0 replies; 16+ messages in thread
From: kbuild test robot @ 2018-11-02  9:29 UTC (permalink / raw)
  To: Peng Hao
  Cc: kbuild-all, robh+dt, mark.rutland, arnd, gregkh, andy, dvhart,
	linux-kernel, platform-driver-x86, hutao, linux-doc, Peng Hao

[-- Attachment #1: Type: text/plain, Size: 6899 bytes --]

Hi Peng,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on v4.19 next-20181102]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Peng-Hao/pvpanic-move-pvpanic-to-misc-as-common-driver/20181102-124907
config: sh-allyesconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=sh 

All errors (new ones prefixed by >>):

   drivers//misc/pvpanic.c:36:36: error: array type has incomplete element type 'struct acpi_device_id'
    static const struct acpi_device_id pvpanic_device_ids[] = {
                                       ^~~~~~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:46:15: error: variable 'pvpanic_driver' has initializer but incomplete type
    static struct acpi_driver pvpanic_driver = {
                  ^~~~~~~~~~~
   drivers//misc/pvpanic.c:47:3: error: 'struct acpi_driver' has no member named 'name'
     .name =  "pvpanic",
      ^~~~
   drivers//misc/pvpanic.c:47:11: warning: excess elements in struct initializer
     .name =  "pvpanic",
              ^~~~~~~~~
   drivers//misc/pvpanic.c:47:11: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:48:3: error: 'struct acpi_driver' has no member named 'class'
     .class = "QEMU",
      ^~~~~
   drivers//misc/pvpanic.c:48:11: warning: excess elements in struct initializer
     .class = "QEMU",
              ^~~~~~
   drivers//misc/pvpanic.c:48:11: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:49:3: error: 'struct acpi_driver' has no member named 'ids'
     .ids =  pvpanic_device_ids,
      ^~~
   drivers//misc/pvpanic.c:49:10: warning: excess elements in struct initializer
     .ids =  pvpanic_device_ids,
             ^~~~~~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:49:10: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:50:3: error: 'struct acpi_driver' has no member named 'ops'
     .ops =  {
      ^~~
   drivers//misc/pvpanic.c:50:10: error: extra brace group at end of initializer
     .ops =  {
             ^
   drivers//misc/pvpanic.c:50:10: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:50:10: warning: excess elements in struct initializer
   drivers//misc/pvpanic.c:50:10: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:54:3: error: 'struct acpi_driver' has no member named 'owner'
     .owner = THIS_MODULE,
      ^~~~~
   In file included from include/linux/linkage.h:7:0,
                    from include/linux/kernel.h:7,
                    from drivers//misc/pvpanic.c:23:
   include/linux/export.h:18:21: warning: excess elements in struct initializer
    #define THIS_MODULE ((struct module *)0)
                        ^
   drivers//misc/pvpanic.c:54:11: note: in expansion of macro 'THIS_MODULE'
     .owner = THIS_MODULE,
              ^~~~~~~~~~~
   include/linux/export.h:18:21: note: (near initialization for 'pvpanic_driver')
    #define THIS_MODULE ((struct module *)0)
                        ^
   drivers//misc/pvpanic.c:54:11: note: in expansion of macro 'THIS_MODULE'
     .owner = THIS_MODULE,
              ^~~~~~~~~~~
   drivers//misc/pvpanic.c: In function 'pvpanic_send_event':
   drivers//misc/pvpanic.c:60:2: error: implicit declaration of function 'outb' [-Werror=implicit-function-declaration]
     outb(event, port);
     ^~~~
   drivers//misc/pvpanic.c: In function 'pvpanic_walk_resources':
>> drivers//misc/pvpanic.c:82:6: error: implicit declaration of function 'acpi_dev_resource_io'; did you mean 'acpi_walk_resources'? [-Werror=implicit-function-declaration]
     if (acpi_dev_resource_io(res, &r)) {
         ^~~~~~~~~~~~~~~~~~~~
         acpi_walk_resources
   drivers//misc/pvpanic.c: In function 'pvpanic_add':
   drivers//misc/pvpanic.c:94:8: error: implicit declaration of function 'acpi_bus_get_status'; did you mean 'acpi_get_gpe_status'? [-Werror=implicit-function-declaration]
     ret = acpi_bus_get_status(device);
           ^~~~~~~~~~~~~~~~~~~
           acpi_get_gpe_status
   drivers//misc/pvpanic.c:98:13: error: dereferencing pointer to incomplete type 'struct acpi_device'
     if (!device->status.enabled || !device->status.functional)
                ^~
   drivers//misc/pvpanic.c: At top level:
   drivers//misc/pvpanic.c:121:1: warning: data definition has no type or storage class
    module_acpi_driver(pvpanic_driver);
    ^~~~~~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:121:1: error: type defaults to 'int' in declaration of 'module_acpi_driver' [-Werror=implicit-int]
   drivers//misc/pvpanic.c:121:1: warning: parameter names (without types) in function declaration
   drivers//misc/pvpanic.c:46:27: error: storage size of 'pvpanic_driver' isn't known
    static struct acpi_driver pvpanic_driver = {
                              ^~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:46:27: warning: 'pvpanic_driver' defined but not used [-Wunused-variable]
   drivers//misc/pvpanic.c:36:36: warning: 'pvpanic_device_ids' defined but not used [-Wunused-variable]
    static const struct acpi_device_id pvpanic_device_ids[] = {
                                       ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +82 drivers//misc/pvpanic.c

    45	
    46	static struct acpi_driver pvpanic_driver = {
    47		.name =		"pvpanic",
    48		.class =	"QEMU",
    49		.ids =		pvpanic_device_ids,
    50		.ops =		{
    51					.add =		pvpanic_add,
    52					.remove =	pvpanic_remove,
    53				},
  > 54		.owner =	THIS_MODULE,
    55	};
    56	
    57	static void
    58	pvpanic_send_event(unsigned int event)
    59	{
    60		outb(event, port);
    61	}
    62	
    63	static int
    64	pvpanic_panic_notify(struct notifier_block *nb, unsigned long code,
    65			     void *unused)
    66	{
    67		pvpanic_send_event(PVPANIC_PANICKED);
    68		return NOTIFY_DONE;
    69	}
    70	
    71	static struct notifier_block pvpanic_panic_nb = {
    72		.notifier_call = pvpanic_panic_notify,
    73		.priority = 1, /* let this called before broken drm_fb_helper */
    74	};
    75	
    76	
    77	static acpi_status
    78	pvpanic_walk_resources(struct acpi_resource *res, void *context)
    79	{
    80		struct resource r;
    81	
  > 82		if (acpi_dev_resource_io(res, &r)) {
    83			port = r.start;
    84			return AE_OK;
    85		}
    86	
    87		return AE_ERROR;
    88	}
    89	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 50483 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH V6 1/8] pvpanic: move pvpanic to misc as common driver
  2018-11-02 12:56 [PATCH V6 1/8] pvpanic: move pvpanic to misc as common driver Peng Hao
  2018-11-02  6:42 ` kbuild test robot
  2018-11-02  7:39 ` kbuild test robot
@ 2018-11-02  9:33 ` Andy Shevchenko
  2018-11-02 12:56 ` [PATCH V6 2/8] misc/pvpanic: simplify the code using acpi_dev_resource_io Peng Hao
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Andy Shevchenko @ 2018-11-02  9:33 UTC (permalink / raw)
  To: peng.hao2
  Cc: Rob Herring, Mark Rutland, Arnd Bergmann, Greg Kroah-Hartman,
	Andy Shevchenko, Darren Hart, Linux Kernel Mailing List,
	Platform Driver, hutao, Linux Documentation List

On Fri, Nov 2, 2018 at 6:46 AM Peng Hao <peng.hao2@zte.com.cn> wrote:
>
> Move pvpanic.c from drivers/platform/x86 to drivers/misc.
> Following patches will use pvpanic device as common driver.
>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Acked-by: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
> ---
>  drivers/misc/Kconfig                     | 8 ++++++++
>  drivers/misc/Makefile                    | 1 +
>  drivers/{platform/x86 => misc}/pvpanic.c | 0
>  drivers/platform/x86/Kconfig             | 8 --------
>  drivers/platform/x86/Makefile            | 1 -
>  5 files changed, 9 insertions(+), 9 deletions(-)
>  rename drivers/{platform/x86 => misc}/pvpanic.c (100%)
>
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 3726eac..642626a 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -513,6 +513,14 @@ config MISC_RTSX
>         tristate
>         default MISC_RTSX_PCI || MISC_RTSX_USB
>
> +config PVPANIC
> +       tristate "pvpanic device support"

> +       depends on ACPI || OF

0day bot is rightful in its complain.
From where OF comes here?

> +       help
> +         This driver provides support for the pvpanic device.  pvpanic is
> +         a paravirtualized device provided by QEMU; it lets a virtual machine
> +         (guest) communicate panic events to the host.
> +
>  source "drivers/misc/c2port/Kconfig"
>  source "drivers/misc/eeprom/Kconfig"
>  source "drivers/misc/cb710/Kconfig"
> diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
> index af22bbc..cd4b2f0 100644
> --- a/drivers/misc/Makefile
> +++ b/drivers/misc/Makefile
> @@ -58,3 +58,4 @@ obj-$(CONFIG_ASPEED_LPC_SNOOP)        += aspeed-lpc-snoop.o
>  obj-$(CONFIG_PCI_ENDPOINT_TEST)        += pci_endpoint_test.o
>  obj-$(CONFIG_OCXL)             += ocxl/
>  obj-$(CONFIG_MISC_RTSX)                += cardreader/
> +obj-$(CONFIG_PVPANIC)                  += pvpanic.o
> diff --git a/drivers/platform/x86/pvpanic.c b/drivers/misc/pvpanic.c
> similarity index 100%
> rename from drivers/platform/x86/pvpanic.c
> rename to drivers/misc/pvpanic.c
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index 0c1aa6c..4ac276c 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -1121,14 +1121,6 @@ config INTEL_SMARTCONNECT
>           This driver checks to determine whether the device has Intel Smart
>           Connect enabled, and if so disables it.
>
> -config PVPANIC
> -       tristate "pvpanic device support"
> -       depends on ACPI
> -       ---help---
> -         This driver provides support for the pvpanic device.  pvpanic is
> -         a paravirtualized device provided by QEMU; it lets a virtual machine
> -         (guest) communicate panic events to the host.
> -
>  config INTEL_PMC_IPC
>         tristate "Intel PMC IPC Driver"
>         depends on ACPI
> diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
> index e6d1bec..e88f44e 100644
> --- a/drivers/platform/x86/Makefile
> +++ b/drivers/platform/x86/Makefile
> @@ -75,7 +75,6 @@ obj-$(CONFIG_APPLE_GMUX)      += apple-gmux.o
>  obj-$(CONFIG_INTEL_RST)                += intel-rst.o
>  obj-$(CONFIG_INTEL_SMARTCONNECT)       += intel-smartconnect.o
>
> -obj-$(CONFIG_PVPANIC)           += pvpanic.o
>  obj-$(CONFIG_ALIENWARE_WMI)    += alienware-wmi.o
>  obj-$(CONFIG_INTEL_PMC_IPC)    += intel_pmc_ipc.o
>  obj-$(CONFIG_TOUCHSCREEN_DMI)  += touchscreen_dmi.o
> --
> 1.8.3.1
>


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH V6 3/8] misc/pvpanic: add MMIO support
  2018-11-02 12:56 ` [PATCH V6 3/8] misc/pvpanic: add MMIO support Peng Hao
  2018-11-02  8:28   ` kbuild test robot
@ 2018-11-02  9:37   ` Andy Shevchenko
       [not found]     ` <201811031027242806354@zte.com.cn>
  1 sibling, 1 reply; 16+ messages in thread
From: Andy Shevchenko @ 2018-11-02  9:37 UTC (permalink / raw)
  To: peng.hao2
  Cc: Rob Herring, Mark Rutland, Arnd Bergmann, Greg Kroah-Hartman,
	Andy Shevchenko, Darren Hart, Linux Kernel Mailing List,
	Platform Driver, hutao, Linux Documentation List

On Fri, Nov 2, 2018 at 6:46 AM Peng Hao <peng.hao2@zte.com.cn> wrote:
>
> On some architectures (e.g. arm64), it's preferable to use MMIO, since
> this can be used standalone. Add MMIO support to the pvpanic driver.
>

0day complains b/c of 1st patch in the series.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>

This wasn't suggested by me. It's your idea to support to MMIO.

> Acked-by: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
> ---
>  drivers/misc/pvpanic.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/misc/pvpanic.c b/drivers/misc/pvpanic.c
> index 49c59e1..22fb487 100644
> --- a/drivers/misc/pvpanic.c
> +++ b/drivers/misc/pvpanic.c
> @@ -41,7 +41,7 @@
>
>  #define PVPANIC_PANICKED       (1 << 0)
>
> -static u16 port;
> +static void __iomem *base;
>
>  static struct acpi_driver pvpanic_driver = {
>         .name =         "pvpanic",
> @@ -57,7 +57,7 @@
>  static void
>  pvpanic_send_event(unsigned int event)
>  {
> -       outb(event, port);
> +       iowrite8(event, base);
>  }
>
>  static int
> @@ -80,7 +80,11 @@
>         struct resource r;
>
>         if (acpi_dev_resource_io(res, &r)) {
> -               port = r.start;
> +               base = (void __iomem *) ioport_map(r.start,
> +                                       r.end - r.start + 1);
> +               return AE_OK;
> +       } else if (acpi_dev_resource_memory(res, &r)) {
> +               base = ioremap(r.start, r.end - r.start + 1);
>                 return AE_OK;
>         }
>
> @@ -101,7 +105,7 @@ static int pvpanic_add(struct acpi_device *device)
>         acpi_walk_resources(device->handle, METHOD_NAME__CRS,
>                             pvpanic_walk_resources, NULL);
>
> -       if (!port)
> +       if (!base)
>                 return -ENODEV;
>
>         atomic_notifier_chain_register(&panic_notifier_list,
> @@ -115,6 +119,8 @@ static int pvpanic_remove(struct acpi_device *device)
>
>         atomic_notifier_chain_unregister(&panic_notifier_list,
>                                          &pvpanic_panic_nb);
> +       iounmap(base);
> +
>         return 0;
>  }
>
> --
> 1.8.3.1
>


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH V6 5/8] misc/pvpanic: add support to get pvpanic device info by FDT
  2018-11-02 12:56 ` [PATCH V6 5/8] misc/pvpanic: add support to get pvpanic device info by FDT Peng Hao
@ 2018-11-02  9:39   ` Andy Shevchenko
  0 siblings, 0 replies; 16+ messages in thread
From: Andy Shevchenko @ 2018-11-02  9:39 UTC (permalink / raw)
  To: peng.hao2
  Cc: Rob Herring, Mark Rutland, Arnd Bergmann, Greg Kroah-Hartman,
	Andy Shevchenko, Darren Hart, Linux Kernel Mailing List,
	Platform Driver, hutao, Linux Documentation List

On Fri, Nov 2, 2018 at 6:46 AM Peng Hao <peng.hao2@zte.com.cn> wrote:
>
> By default, when ACPI tables and FDT coexist for ARM64,
> current kernel takes precedence over FDT to get device information.
> Virt machine in qemu provides both FDT and ACPI table. Increases the
> way to get information through FDT.
>

so OF dependency in Kconfig is a matter of this patch.
Since 0day bot complain you might need to add

#include <linux/mod_devicetable.h>

as well.

> Acked-by: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
> ---
>  drivers/misc/pvpanic.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 64 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/misc/pvpanic.c b/drivers/misc/pvpanic.c
> index 22fb487..5378d5f 100644
> --- a/drivers/misc/pvpanic.c
> +++ b/drivers/misc/pvpanic.c
> @@ -2,6 +2,7 @@
>   *  pvpanic.c - pvpanic Device Support
>   *
>   *  Copyright (C) 2013 Fujitsu.
> + *  Copyright (C) 2018 ZTE.
>   *
>   *  This program is free software; you can redistribute it and/or modify
>   *  it under the terms of the GNU General Public License as published by
> @@ -20,11 +21,14 @@
>
>  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> +#include <linux/acpi.h>
> +#include <linux/init.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> -#include <linux/init.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/platform_device.h>
>  #include <linux/types.h>
> -#include <linux/acpi.h>
>
>  MODULE_AUTHOR("Hu Tao <hutao@cn.fujitsu.com>");
>  MODULE_DESCRIPTION("pvpanic device driver");
> @@ -73,6 +77,32 @@
>         .priority = 1, /* let this called before broken drm_fb_helper */
>  };
>
> +static int pvpanic_mmio_probe(struct platform_device *pdev)
> +{
> +       struct resource *mem;
> +
> +       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +       if (!mem)
> +               return -EINVAL;
> +
> +       base = devm_ioremap_resource(&pdev->dev, mem);
> +       if (base == NULL)
> +               return -EFAULT;
> +
> +       atomic_notifier_chain_register(&panic_notifier_list,
> +                                      &pvpanic_panic_nb);
> +
> +       return 0;
> +}
> +
> +static int pvpanic_mmio_remove(struct platform_device *pdev)
> +{
> +
> +       atomic_notifier_chain_unregister(&panic_notifier_list,
> +                                        &pvpanic_panic_nb);
> +
> +       return 0;
> +}
>
>  static acpi_status
>  pvpanic_walk_resources(struct acpi_resource *res, void *context)
> @@ -124,4 +154,35 @@ static int pvpanic_remove(struct acpi_device *device)
>         return 0;
>  }
>
> -module_acpi_driver(pvpanic_driver);
> +static const struct of_device_id pvpanic_mmio_match[] = {
> +       { .compatible = "qemu,pvpanic-mmio", },
> +       {}
> +};
> +
> +static struct platform_driver pvpanic_mmio_driver = {
> +       .driver = {
> +               .name = "pvpanic-mmio",
> +               .of_match_table = pvpanic_mmio_match,
> +       },
> +       .probe = pvpanic_mmio_probe,
> +       .remove = pvpanic_mmio_remove,
> +};
> +
> +static int __init pvpanic_mmio_init(void)
> +{
> +       if (acpi_disabled)
> +               return platform_driver_register(&pvpanic_mmio_driver);
> +       else
> +               return acpi_bus_register_driver(&pvpanic_driver);
> +}
> +
> +static void __exit pvpanic_mmio_exit(void)
> +{
> +       if (acpi_disabled)
> +               platform_driver_unregister(&pvpanic_mmio_driver);
> +       else
> +               acpi_bus_unregister_driver(&pvpanic_driver);
> +}
> +
> +module_init(pvpanic_mmio_init);
> +module_exit(pvpanic_mmio_exit);
> --
> 1.8.3.1
>


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH V6 1/8]  pvpanic: move pvpanic to misc as common driver
@ 2018-11-02 12:56 Peng Hao
  2018-11-02  6:42 ` kbuild test robot
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Peng Hao @ 2018-11-02 12:56 UTC (permalink / raw)
  To: robh+dt, mark.rutland, arnd, gregkh, andy, dvhart
  Cc: linux-kernel, platform-driver-x86, hutao, linux-doc, Peng Hao

Move pvpanic.c from drivers/platform/x86 to drivers/misc.
Following patches will use pvpanic device as common driver.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 drivers/misc/Kconfig                     | 8 ++++++++
 drivers/misc/Makefile                    | 1 +
 drivers/{platform/x86 => misc}/pvpanic.c | 0
 drivers/platform/x86/Kconfig             | 8 --------
 drivers/platform/x86/Makefile            | 1 -
 5 files changed, 9 insertions(+), 9 deletions(-)
 rename drivers/{platform/x86 => misc}/pvpanic.c (100%)

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 3726eac..642626a 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -513,6 +513,14 @@ config MISC_RTSX
 	tristate
 	default MISC_RTSX_PCI || MISC_RTSX_USB
 
+config PVPANIC
+	tristate "pvpanic device support"
+	depends on ACPI || OF
+	help
+	  This driver provides support for the pvpanic device.  pvpanic is
+	  a paravirtualized device provided by QEMU; it lets a virtual machine
+	  (guest) communicate panic events to the host.
+
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
 source "drivers/misc/cb710/Kconfig"
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index af22bbc..cd4b2f0 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -58,3 +58,4 @@ obj-$(CONFIG_ASPEED_LPC_SNOOP)	+= aspeed-lpc-snoop.o
 obj-$(CONFIG_PCI_ENDPOINT_TEST)	+= pci_endpoint_test.o
 obj-$(CONFIG_OCXL)		+= ocxl/
 obj-$(CONFIG_MISC_RTSX)		+= cardreader/
+obj-$(CONFIG_PVPANIC)  		+= pvpanic.o
diff --git a/drivers/platform/x86/pvpanic.c b/drivers/misc/pvpanic.c
similarity index 100%
rename from drivers/platform/x86/pvpanic.c
rename to drivers/misc/pvpanic.c
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 0c1aa6c..4ac276c 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -1121,14 +1121,6 @@ config INTEL_SMARTCONNECT
 	  This driver checks to determine whether the device has Intel Smart
 	  Connect enabled, and if so disables it.
 
-config PVPANIC
-	tristate "pvpanic device support"
-	depends on ACPI
-	---help---
-	  This driver provides support for the pvpanic device.  pvpanic is
-	  a paravirtualized device provided by QEMU; it lets a virtual machine
-	  (guest) communicate panic events to the host.
-
 config INTEL_PMC_IPC
 	tristate "Intel PMC IPC Driver"
 	depends on ACPI
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
index e6d1bec..e88f44e 100644
--- a/drivers/platform/x86/Makefile
+++ b/drivers/platform/x86/Makefile
@@ -75,7 +75,6 @@ obj-$(CONFIG_APPLE_GMUX)	+= apple-gmux.o
 obj-$(CONFIG_INTEL_RST)		+= intel-rst.o
 obj-$(CONFIG_INTEL_SMARTCONNECT)	+= intel-smartconnect.o
 
-obj-$(CONFIG_PVPANIC)           += pvpanic.o
 obj-$(CONFIG_ALIENWARE_WMI)	+= alienware-wmi.o
 obj-$(CONFIG_INTEL_PMC_IPC)	+= intel_pmc_ipc.o
 obj-$(CONFIG_TOUCHSCREEN_DMI)	+= touchscreen_dmi.o
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH V6 2/8]  misc/pvpanic: simplify the code using acpi_dev_resource_io
  2018-11-02 12:56 [PATCH V6 1/8] pvpanic: move pvpanic to misc as common driver Peng Hao
                   ` (2 preceding siblings ...)
  2018-11-02  9:33 ` Andy Shevchenko
@ 2018-11-02 12:56 ` Peng Hao
  2018-11-02  9:29   ` kbuild test robot
  2018-11-02 12:56 ` [PATCH V6 3/8] misc/pvpanic: add MMIO support Peng Hao
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 16+ messages in thread
From: Peng Hao @ 2018-11-02 12:56 UTC (permalink / raw)
  To: robh+dt, mark.rutland, arnd, gregkh, andy, dvhart
  Cc: linux-kernel, platform-driver-x86, hutao, linux-doc, Peng Hao

Use acpi_dev_resource_io API.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 drivers/misc/pvpanic.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/misc/pvpanic.c b/drivers/misc/pvpanic.c
index fd86dab..49c59e1 100644
--- a/drivers/misc/pvpanic.c
+++ b/drivers/misc/pvpanic.c
@@ -77,17 +77,14 @@
 static acpi_status
 pvpanic_walk_resources(struct acpi_resource *res, void *context)
 {
-	switch (res->type) {
-	case ACPI_RESOURCE_TYPE_END_TAG:
-		return AE_OK;
+	struct resource r;
 
-	case ACPI_RESOURCE_TYPE_IO:
-		port = res->data.io.minimum;
+	if (acpi_dev_resource_io(res, &r)) {
+		port = r.start;
 		return AE_OK;
-
-	default:
-		return AE_ERROR;
 	}
+
+	return AE_ERROR;
 }
 
 static int pvpanic_add(struct acpi_device *device)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH V6 3/8]  misc/pvpanic: add MMIO support
  2018-11-02 12:56 [PATCH V6 1/8] pvpanic: move pvpanic to misc as common driver Peng Hao
                   ` (3 preceding siblings ...)
  2018-11-02 12:56 ` [PATCH V6 2/8] misc/pvpanic: simplify the code using acpi_dev_resource_io Peng Hao
@ 2018-11-02 12:56 ` Peng Hao
  2018-11-02  8:28   ` kbuild test robot
  2018-11-02  9:37   ` Andy Shevchenko
  2018-11-02 12:56 ` [PATCH V6 4/8] dt-bindings: misc/pvpanic: add document for pvpanic-mmio Peng Hao
                   ` (4 subsequent siblings)
  9 siblings, 2 replies; 16+ messages in thread
From: Peng Hao @ 2018-11-02 12:56 UTC (permalink / raw)
  To: robh+dt, mark.rutland, arnd, gregkh, andy, dvhart
  Cc: linux-kernel, platform-driver-x86, hutao, linux-doc, Peng Hao

On some architectures (e.g. arm64), it's preferable to use MMIO, since
this can be used standalone. Add MMIO support to the pvpanic driver.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 drivers/misc/pvpanic.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/pvpanic.c b/drivers/misc/pvpanic.c
index 49c59e1..22fb487 100644
--- a/drivers/misc/pvpanic.c
+++ b/drivers/misc/pvpanic.c
@@ -41,7 +41,7 @@
 
 #define PVPANIC_PANICKED	(1 << 0)
 
-static u16 port;
+static void __iomem *base;
 
 static struct acpi_driver pvpanic_driver = {
 	.name =		"pvpanic",
@@ -57,7 +57,7 @@
 static void
 pvpanic_send_event(unsigned int event)
 {
-	outb(event, port);
+	iowrite8(event, base);
 }
 
 static int
@@ -80,7 +80,11 @@
 	struct resource r;
 
 	if (acpi_dev_resource_io(res, &r)) {
-		port = r.start;
+		base = (void __iomem *) ioport_map(r.start,
+					r.end - r.start + 1);
+		return AE_OK;
+	} else if (acpi_dev_resource_memory(res, &r)) {
+		base = ioremap(r.start, r.end - r.start + 1);
 		return AE_OK;
 	}
 
@@ -101,7 +105,7 @@ static int pvpanic_add(struct acpi_device *device)
 	acpi_walk_resources(device->handle, METHOD_NAME__CRS,
 			    pvpanic_walk_resources, NULL);
 
-	if (!port)
+	if (!base)
 		return -ENODEV;
 
 	atomic_notifier_chain_register(&panic_notifier_list,
@@ -115,6 +119,8 @@ static int pvpanic_remove(struct acpi_device *device)
 
 	atomic_notifier_chain_unregister(&panic_notifier_list,
 					 &pvpanic_panic_nb);
+	iounmap(base);
+
 	return 0;
 }
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH V6 4/8]  dt-bindings: misc/pvpanic: add document for pvpanic-mmio
  2018-11-02 12:56 [PATCH V6 1/8] pvpanic: move pvpanic to misc as common driver Peng Hao
                   ` (4 preceding siblings ...)
  2018-11-02 12:56 ` [PATCH V6 3/8] misc/pvpanic: add MMIO support Peng Hao
@ 2018-11-02 12:56 ` Peng Hao
  2018-11-02 12:56 ` [PATCH V6 5/8] misc/pvpanic: add support to get pvpanic device info by FDT Peng Hao
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Peng Hao @ 2018-11-02 12:56 UTC (permalink / raw)
  To: robh+dt, mark.rutland, arnd, gregkh, andy, dvhart
  Cc: linux-kernel, platform-driver-x86, hutao, linux-doc, Peng Hao

Add dt-bindings document for "qemu:pvpanic-mmio".

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 .../devicetree/bindings/misc/pvpanic-mmio.txt      | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/pvpanic-mmio.txt

diff --git a/Documentation/devicetree/bindings/misc/pvpanic-mmio.txt b/Documentation/devicetree/bindings/misc/pvpanic-mmio.txt
new file mode 100644
index 0000000..985e907
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/pvpanic-mmio.txt
@@ -0,0 +1,29 @@
+* QEMU PVPANIC MMIO Configuration bindings
+
+QEMU's emulation / virtualization targets provide the following PVPANIC
+MMIO Configuration interface on the "virt" machine.
+type:
+
+- a read-write, 16-bit wide data register.
+
+QEMU exposes the data register to guests as memory mapped registers.
+
+Required properties:
+
+- compatible: "qemu,pvpanic-mmio".
+- reg: the MMIO region used by the device.
+  * Bytes 0x0  Write panic event to the reg when guest OS panics.
+  * Bytes 0x1  Reserved.
+
+Example:
+
+/ {
+        #size-cells = <0x2>;
+        #address-cells = <0x2>;
+
+        pvpanic-mmio@9060000 {
+                compatible = "qemu,pvpanic-mmio";
+                reg = <0x0 0x9060000 0x0 0x2>;
+        };
+};
+
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH V6 5/8]  misc/pvpanic: add support to get pvpanic device info by FDT
  2018-11-02 12:56 [PATCH V6 1/8] pvpanic: move pvpanic to misc as common driver Peng Hao
                   ` (5 preceding siblings ...)
  2018-11-02 12:56 ` [PATCH V6 4/8] dt-bindings: misc/pvpanic: add document for pvpanic-mmio Peng Hao
@ 2018-11-02 12:56 ` Peng Hao
  2018-11-02  9:39   ` Andy Shevchenko
  2018-11-02 12:56 ` [PATCH V6 6/8] misc/pvpanic: remove unnecessary header file Peng Hao
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 16+ messages in thread
From: Peng Hao @ 2018-11-02 12:56 UTC (permalink / raw)
  To: robh+dt, mark.rutland, arnd, gregkh, andy, dvhart
  Cc: linux-kernel, platform-driver-x86, hutao, linux-doc, Peng Hao

By default, when ACPI tables and FDT coexist for ARM64,
current kernel takes precedence over FDT to get device information.
Virt machine in qemu provides both FDT and ACPI table. Increases the
way to get information through FDT.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 drivers/misc/pvpanic.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 64 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/pvpanic.c b/drivers/misc/pvpanic.c
index 22fb487..5378d5f 100644
--- a/drivers/misc/pvpanic.c
+++ b/drivers/misc/pvpanic.c
@@ -2,6 +2,7 @@
  *  pvpanic.c - pvpanic Device Support
  *
  *  Copyright (C) 2013 Fujitsu.
+ *  Copyright (C) 2018 ZTE.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -20,11 +21,14 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
+#include <linux/acpi.h>
+#include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/init.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/platform_device.h>
 #include <linux/types.h>
-#include <linux/acpi.h>
 
 MODULE_AUTHOR("Hu Tao <hutao@cn.fujitsu.com>");
 MODULE_DESCRIPTION("pvpanic device driver");
@@ -73,6 +77,32 @@
 	.priority = 1, /* let this called before broken drm_fb_helper */
 };
 
+static int pvpanic_mmio_probe(struct platform_device *pdev)
+{
+	struct resource *mem;
+
+	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!mem)
+		return -EINVAL;
+
+	base = devm_ioremap_resource(&pdev->dev, mem);
+	if (base == NULL)
+		return -EFAULT;
+
+	atomic_notifier_chain_register(&panic_notifier_list,
+				       &pvpanic_panic_nb);
+
+	return 0;
+}
+
+static int pvpanic_mmio_remove(struct platform_device *pdev)
+{
+
+	atomic_notifier_chain_unregister(&panic_notifier_list,
+					 &pvpanic_panic_nb);
+
+	return 0;
+}
 
 static acpi_status
 pvpanic_walk_resources(struct acpi_resource *res, void *context)
@@ -124,4 +154,35 @@ static int pvpanic_remove(struct acpi_device *device)
 	return 0;
 }
 
-module_acpi_driver(pvpanic_driver);
+static const struct of_device_id pvpanic_mmio_match[] = {
+	{ .compatible = "qemu,pvpanic-mmio", },
+	{}
+};
+
+static struct platform_driver pvpanic_mmio_driver = {
+	.driver = {
+		.name = "pvpanic-mmio",
+		.of_match_table = pvpanic_mmio_match,
+	},
+	.probe = pvpanic_mmio_probe,
+	.remove = pvpanic_mmio_remove,
+};
+
+static int __init pvpanic_mmio_init(void)
+{
+	if (acpi_disabled)
+		return platform_driver_register(&pvpanic_mmio_driver);
+	else
+		return acpi_bus_register_driver(&pvpanic_driver);
+}
+
+static void __exit pvpanic_mmio_exit(void)
+{
+	if (acpi_disabled)
+		platform_driver_unregister(&pvpanic_mmio_driver);
+	else
+		acpi_bus_unregister_driver(&pvpanic_driver);
+}
+
+module_init(pvpanic_mmio_init);
+module_exit(pvpanic_mmio_exit);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH V6 6/8]  misc/pvpanic: remove unnecessary header file
  2018-11-02 12:56 [PATCH V6 1/8] pvpanic: move pvpanic to misc as common driver Peng Hao
                   ` (6 preceding siblings ...)
  2018-11-02 12:56 ` [PATCH V6 5/8] misc/pvpanic: add support to get pvpanic device info by FDT Peng Hao
@ 2018-11-02 12:56 ` Peng Hao
  2018-11-02 12:56 ` [PATCH V6 7/8] misc/pvpanic: convert to SPDX license tags Peng Hao
  2018-11-02 12:56 ` [PATCH V6 8/8] misc/pvpanic: remove a redundant comma Peng Hao
  9 siblings, 0 replies; 16+ messages in thread
From: Peng Hao @ 2018-11-02 12:56 UTC (permalink / raw)
  To: robh+dt, mark.rutland, arnd, gregkh, andy, dvhart
  Cc: linux-kernel, platform-driver-x86, hutao, linux-doc, Peng Hao

Remove unnecessary header file init.h.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 drivers/misc/pvpanic.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/misc/pvpanic.c b/drivers/misc/pvpanic.c
index 5378d5f..9c9d9f8 100644
--- a/drivers/misc/pvpanic.c
+++ b/drivers/misc/pvpanic.c
@@ -22,7 +22,6 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/acpi.h>
-#include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of.h>
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH V6 7/8]  misc/pvpanic: convert to SPDX license tags
  2018-11-02 12:56 [PATCH V6 1/8] pvpanic: move pvpanic to misc as common driver Peng Hao
                   ` (7 preceding siblings ...)
  2018-11-02 12:56 ` [PATCH V6 6/8] misc/pvpanic: remove unnecessary header file Peng Hao
@ 2018-11-02 12:56 ` Peng Hao
  2018-11-02 12:56 ` [PATCH V6 8/8] misc/pvpanic: remove a redundant comma Peng Hao
  9 siblings, 0 replies; 16+ messages in thread
From: Peng Hao @ 2018-11-02 12:56 UTC (permalink / raw)
  To: robh+dt, mark.rutland, arnd, gregkh, andy, dvhart
  Cc: linux-kernel, platform-driver-x86, hutao, linux-doc, Peng Hao

Updates license to use SPDX-License-Identifier instead of
verbose license text.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 drivers/misc/pvpanic.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/misc/pvpanic.c b/drivers/misc/pvpanic.c
index 9c9d9f8..1826cdf 100644
--- a/drivers/misc/pvpanic.c
+++ b/drivers/misc/pvpanic.c
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  pvpanic.c - pvpanic Device Support
  *
  *  Copyright (C) 2013 Fujitsu.
  *  Copyright (C) 2018 ZTE.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH V6 8/8]  misc/pvpanic: remove a redundant comma
  2018-11-02 12:56 [PATCH V6 1/8] pvpanic: move pvpanic to misc as common driver Peng Hao
                   ` (8 preceding siblings ...)
  2018-11-02 12:56 ` [PATCH V6 7/8] misc/pvpanic: convert to SPDX license tags Peng Hao
@ 2018-11-02 12:56 ` Peng Hao
  9 siblings, 0 replies; 16+ messages in thread
From: Peng Hao @ 2018-11-02 12:56 UTC (permalink / raw)
  To: robh+dt, mark.rutland, arnd, gregkh, andy, dvhart
  Cc: linux-kernel, platform-driver-x86, hutao, linux-doc, Peng Hao

Remove a redundant comma in pvpanic_device_ids.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 drivers/misc/pvpanic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/pvpanic.c b/drivers/misc/pvpanic.c
index 1826cdf..07149db 100644
--- a/drivers/misc/pvpanic.c
+++ b/drivers/misc/pvpanic.c
@@ -25,7 +25,7 @@
 
 static const struct acpi_device_id pvpanic_device_ids[] = {
 	{ "QEMU0001", 0 },
-	{ "", 0 },
+	{ "", 0 }
 };
 MODULE_DEVICE_TABLE(acpi, pvpanic_device_ids);
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: Re: [PATCH V6 3/8] misc/pvpanic: add MMIO support
       [not found]     ` <201811031027242806354@zte.com.cn>
@ 2018-11-03 15:51       ` Andy Shevchenko
  0 siblings, 0 replies; 16+ messages in thread
From: Andy Shevchenko @ 2018-11-03 15:51 UTC (permalink / raw)
  To: peng.hao2
  Cc: Rob Herring, Mark Rutland, Arnd Bergmann, Greg Kroah-Hartman,
	Andy Shevchenko, Darren Hart, Linux Kernel Mailing List,
	Platform Driver, hutao, Linux Documentation List

On Sat, Nov 3, 2018 at 4:27 AM <peng.hao2@zte.com.cn> wrote:
>
> >>
> >> On some architectures (e.g. arm64), it's preferable to use MMIO, since
> >> this can be used standalone. Add MMIO support to the pvpanic driver.
> >>
> >
> >0day complains b/c of 1st patch in the series.
> >
> >Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> >
> >> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> >
> >This wasn't suggested by me. It's your idea to support to MMIO.
> >
> oh, I just want to express that acpi_dev_resource_memory is your suggestion.
> I misunderstood the use of the "Suggested-by'.

No problem.

Actually there is a room for interpretation.

From my point of view Suggested-by can be used in the following cases:
- idea came from other person
- the implementation of something is heavily based on other person's
view (usually with provided code samples)

In the patch which converts to use specific API idea was mine, but
here I just reviewed one small part of the code, while idea is
completely yours IIUC.

Of course, you are free to give a credit if you would like to do so,
just be little more specific.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-11-03 15:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-02 12:56 [PATCH V6 1/8] pvpanic: move pvpanic to misc as common driver Peng Hao
2018-11-02  6:42 ` kbuild test robot
2018-11-02  7:39 ` kbuild test robot
2018-11-02  9:33 ` Andy Shevchenko
2018-11-02 12:56 ` [PATCH V6 2/8] misc/pvpanic: simplify the code using acpi_dev_resource_io Peng Hao
2018-11-02  9:29   ` kbuild test robot
2018-11-02 12:56 ` [PATCH V6 3/8] misc/pvpanic: add MMIO support Peng Hao
2018-11-02  8:28   ` kbuild test robot
2018-11-02  9:37   ` Andy Shevchenko
     [not found]     ` <201811031027242806354@zte.com.cn>
2018-11-03 15:51       ` Andy Shevchenko
2018-11-02 12:56 ` [PATCH V6 4/8] dt-bindings: misc/pvpanic: add document for pvpanic-mmio Peng Hao
2018-11-02 12:56 ` [PATCH V6 5/8] misc/pvpanic: add support to get pvpanic device info by FDT Peng Hao
2018-11-02  9:39   ` Andy Shevchenko
2018-11-02 12:56 ` [PATCH V6 6/8] misc/pvpanic: remove unnecessary header file Peng Hao
2018-11-02 12:56 ` [PATCH V6 7/8] misc/pvpanic: convert to SPDX license tags Peng Hao
2018-11-02 12:56 ` [PATCH V6 8/8] misc/pvpanic: remove a redundant comma Peng Hao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).