Skip to contentSkip to conversation

staging: gasket: remove X86 Kconfig restriction

PATCH RESEND Superseded Todd Poynor 3 participants 4 messages Jul 15, 2018 – Jul 19, 2018 Staging

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 staging: gasket: remove X86 Kconfig restriction

From: Todd Poynor <[email protected]>

The gasket and apex drivers are to be used on other architectures besides X86.

---
 drivers/staging/gasket/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/gasket/Kconfig +1 -1
index c836389c1402..ef40c4c75e0f 100644
@@ -2,7 +2,7 @@ menu "Gasket devices"
 
 config STAGING_GASKET_FRAMEWORK
 	tristate "Gasket framework"
-	depends on PCI && X86_64
+	depends on PCI
 	help
 	  This framework supports Gasket-compatible devices, such as Apex.
 	  It is required for any of the following module(s).
Signature · 4 lines
2.18.0.203.gfac676dfb9-goog

Resending, extracted from the previous stack of patches that needs
other cleanups.
#1 lore raw
Quoted 9 lines · Todd Poynor

From: Todd Poynor <[email protected]>

The gasket and apex drivers are to be used on other architectures besides X86.

---
 drivers/staging/gasket/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Why are these all a "resend"? They need to be in a v2 series, based on the changes requested, right? "resend" implies I somehow did not see them...

And always properly version your patch series, and number them in order, otherwise I have no idea what order to apply them in, and if I have missed any or not.

Remember, you need to make it as simple as possible for me not to mess things up :)

thanks,

greg k-h

#2 lore raw
In reply to Todd Poynor
Thank you for the patch! Yet something to improve:

Hi Todd,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on next-20180718]
[cannot apply to v4.18-rc5]
[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/Todd-Poynor/staging-gasket-remove-X86-Kconfig-restriction/20180716-031056
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 8.1.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=8.1.0 make.cross ARCH=xtensa

All errors (new ones prefixed by >>):

In file included from drivers/staging/gasket/gasket_page_table.h:19,
from drivers/staging/gasket/gasket_page_table.c:34:
drivers/staging/gasket/gasket_core.h: In function 'gasket_dev_read_64':

>> drivers/staging/gasket/gasket_core.h:651:9: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration]
     return readq(&gasket_dev->bar_data[bar].virt_base[location]);
            ^~~~~
            readl
   drivers/staging/gasket/gasket_core.h: In function 'gasket_dev_write_64':
>> drivers/staging/gasket/gasket_core.h:657:2: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Werror=implicit-function-declaration]
     writeq(value, &dev->bar_data[bar].virt_base[location]);
     ^~~~~~
     writel
   drivers/staging/gasket/gasket_page_table.c: In function 'gasket_is_extended_dev_addr_bad':
   drivers/staging/gasket/gasket_page_table.c:1373:11: warning: right shift count >= width of type [-Wshift-count-overflow]
     if (addr >> (GASKET_EXTENDED_LVL0_WIDTH + GASKET_EXTENDED_LVL0_SHIFT)) {
              ^~
   drivers/staging/gasket/gasket_page_table.c: In function 'gasket_alloc_coherent_memory':
   drivers/staging/gasket/gasket_page_table.c:1679:4: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
       (u64)mem + j * PAGE_SIZE;
       ^

cc1: some warnings being treated as errors
--
In file included from drivers/staging/gasket/gasket_sysfs.h:21,
from drivers/staging/gasket/gasket_sysfs.c:3:
drivers/staging/gasket/gasket_core.h: In function 'gasket_dev_read_64':

>> drivers/staging/gasket/gasket_core.h:651:9: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration]
     return readq(&gasket_dev->bar_data[bar].virt_base[location]);
            ^~~~~
            readl
   drivers/staging/gasket/gasket_core.h: In function 'gasket_dev_write_64':
>> drivers/staging/gasket/gasket_core.h:657:2: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Werror=implicit-function-declaration]
     writeq(value, &dev->bar_data[bar].virt_base[location]);
     ^~~~~~
     writel

cc1: some warnings being treated as errors
--
In file included from drivers/staging/gasket/gasket_ioctl.h:6,
from drivers/staging/gasket/gasket_ioctl.c:4:
drivers/staging/gasket/gasket_core.h: In function 'gasket_dev_read_64':

>> drivers/staging/gasket/gasket_core.h:651:9: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration]
     return readq(&gasket_dev->bar_data[bar].virt_base[location]);
            ^~~~~
            readl
   drivers/staging/gasket/gasket_core.h: In function 'gasket_dev_write_64':
>> drivers/staging/gasket/gasket_core.h:657:2: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Werror=implicit-function-declaration]
     writeq(value, &dev->bar_data[bar].virt_base[location]);
     ^~~~~~
     writel
   drivers/staging/gasket/gasket_ioctl.c: In function 'gasket_config_coherent_allocator':
>> drivers/staging/gasket/gasket_ioctl.c:434:27: error: passing argument 3 of 'gasket_alloc_coherent_memory' from incompatible pointer type [-Werror=incompatible-pointer-types]
       gasket_dev, ibuf.size, &ibuf.dma_address,
                              ^~~~~~~~~~~~~~~~~
   In file included from drivers/staging/gasket/gasket_ioctl.c:9:
   drivers/staging/gasket/gasket_page_table.h:227:18: note: expected 'dma_addr_t *' {aka 'unsigned int *'} but argument is of type 'u64 *' {aka 'long long unsigned int *'}
         dma_addr_t *dma_address, uint64_t index);
         ~~~~~~~~~~~~^~~~~~~~~~~

cc1: some warnings being treated as errors

vim +651 drivers/staging/gasket/gasket_core.h

9a69f508 Simon Que 2018-06-29  620  
9a69f508 Simon Que 2018-06-29  621  /*
9a69f508 Simon Que 2018-06-29  622   * Memory management functions. These will likely be spun off into their own
9a69f508 Simon Que 2018-06-29  623   * file in the future.
9a69f508 Simon Que 2018-06-29  624   */
9a69f508 Simon Que 2018-06-29  625  
9a69f508 Simon Que 2018-06-29  626  /* Unmaps the specified mappable region from a VMA. */
9a69f508 Simon Que 2018-06-29  627  int gasket_mm_unmap_region(
9a69f508 Simon Que 2018-06-29  628  	const struct gasket_dev *gasket_dev, struct vm_area_struct *vma,
9a69f508 Simon Que 2018-06-29  629  	const struct gasket_mappable_region *map_region);
9a69f508 Simon Que 2018-06-29  630  
9a69f508 Simon Que 2018-06-29  631  /*
9a69f508 Simon Que 2018-06-29  632   * Get the ioctl permissions callback.
9a69f508 Simon Que 2018-06-29  633   * @gasket_dev: Gasket device structure.
9a69f508 Simon Que 2018-06-29  634   */
9a69f508 Simon Que 2018-06-29  635  gasket_ioctl_permissions_cb_t gasket_get_ioctl_permissions_cb(
9a69f508 Simon Que 2018-06-29  636  	struct gasket_dev *gasket_dev);
9a69f508 Simon Que 2018-06-29  637  
9a69f508 Simon Que 2018-06-29  638  /**
9a69f508 Simon Que 2018-06-29  639   * Lookup a name by number in a num_name table.
9a69f508 Simon Que 2018-06-29  640   * @num: Number to lookup.
9a69f508 Simon Que 2018-06-29  641   * @table: Array of num_name structures, the table for the lookup.
9a69f508 Simon Que 2018-06-29  642   *
9a69f508 Simon Que 2018-06-29  643   */
9a69f508 Simon Que 2018-06-29  644  const char *gasket_num_name_lookup(
9a69f508 Simon Que 2018-06-29  645  	uint num, const struct gasket_num_name *table);
9a69f508 Simon Que 2018-06-29  646  
9a69f508 Simon Que 2018-06-29  647  /* Handy inlines */
9a69f508 Simon Que 2018-06-29  648  static inline ulong gasket_dev_read_64(
9a69f508 Simon Que 2018-06-29  649  	struct gasket_dev *gasket_dev, int bar, ulong location)
9a69f508 Simon Que 2018-06-29  650  {
9a69f508 Simon Que 2018-06-29 @651  	return readq(&gasket_dev->bar_data[bar].virt_base[location]);
9a69f508 Simon Que 2018-06-29  652  }
9a69f508 Simon Que 2018-06-29  653  
9a69f508 Simon Que 2018-06-29  654  static inline void gasket_dev_write_64(
9a69f508 Simon Que 2018-06-29  655  	struct gasket_dev *dev, u64 value, int bar, ulong location)
9a69f508 Simon Que 2018-06-29  656  {

9a69f508 Simon Que 2018-06-29 @657 writeq(value, &dev->bar_data[bar].virt_base[location]);
9a69f508 Simon Que 2018-06-29 658 }
9a69f508 Simon Que 2018-06-29 659

:::::: The code at line 651 was first introduced by commit
:::::: 9a69f5087ccc20bb411025decab455836df04168 drivers/staging: Gasket driver framework + Apex driver

:::::: TO: Simon Que <[email protected]>
:::::: CC: Greg Kroah-Hartman <[email protected]>

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

#3 lore raw
Quoted 18 lines · kbuild test robot

Hi Todd,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on next-20180718]
[cannot apply to v4.18-rc5]
[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/Todd-Poynor/staging-gasket-remove-X86-Kconfig-restriction/20180716-031056
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 8.1.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=8.1.0 make.cross ARCH=xtensa

Quoted 6 lines

All errors (new ones prefixed by >>):

In file included from drivers/staging/gasket/gasket_page_table.h:19,
from drivers/staging/gasket/gasket_page_table.c:34:
drivers/staging/gasket/gasket_core.h: In function 'gasket_dev_read_64':

Quoted 1 line
Quoted 1 line

drivers/staging/gasket/gasket_core.h:651:9: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration]

Will respin this patch to explicitly list X86_64 and ARM64 as the only architectures to build for now, and fixup some of these other issues soon.

Quoted 106 lines
     return readq(&gasket_dev->bar_data[bar].virt_base[location]);
            ^~~~~
            readl

drivers/staging/gasket/gasket_core.h: In function 'gasket_dev_write_64':

Quoted 1 line
Quoted 1 line

drivers/staging/gasket/gasket_core.h:657:2: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Werror=implicit-function-declaration]

     writeq(value, &dev->bar_data[bar].virt_base[location]);
     ^~~~~~
     writel
   drivers/staging/gasket/gasket_page_table.c: In function 'gasket_is_extended_dev_addr_bad':
   drivers/staging/gasket/gasket_page_table.c:1373:11: warning: right shift count >= width of type [-Wshift-count-overflow]
     if (addr >> (GASKET_EXTENDED_LVL0_WIDTH + GASKET_EXTENDED_LVL0_SHIFT)) {
              ^~
   drivers/staging/gasket/gasket_page_table.c: In function 'gasket_alloc_coherent_memory':
   drivers/staging/gasket/gasket_page_table.c:1679:4: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
       (u64)mem + j * PAGE_SIZE;
       ^

cc1: some warnings being treated as errors
--
In file included from drivers/staging/gasket/gasket_sysfs.h:21,
from drivers/staging/gasket/gasket_sysfs.c:3:
drivers/staging/gasket/gasket_core.h: In function 'gasket_dev_read_64':

Quoted 1 line
Quoted 1 line

drivers/staging/gasket/gasket_core.h:651:9: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration]

     return readq(&gasket_dev->bar_data[bar].virt_base[location]);
            ^~~~~
            readl

drivers/staging/gasket/gasket_core.h: In function 'gasket_dev_write_64':

Quoted 1 line
Quoted 1 line

drivers/staging/gasket/gasket_core.h:657:2: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Werror=implicit-function-declaration]

     writeq(value, &dev->bar_data[bar].virt_base[location]);
     ^~~~~~
     writel

cc1: some warnings being treated as errors
--
In file included from drivers/staging/gasket/gasket_ioctl.h:6,
from drivers/staging/gasket/gasket_ioctl.c:4:
drivers/staging/gasket/gasket_core.h: In function 'gasket_dev_read_64':

Quoted 1 line
Quoted 1 line

drivers/staging/gasket/gasket_core.h:651:9: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration]

     return readq(&gasket_dev->bar_data[bar].virt_base[location]);
            ^~~~~
            readl

drivers/staging/gasket/gasket_core.h: In function 'gasket_dev_write_64':

Quoted 1 line
Quoted 1 line

drivers/staging/gasket/gasket_core.h:657:2: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Werror=implicit-function-declaration]

     writeq(value, &dev->bar_data[bar].virt_base[location]);
     ^~~~~~
     writel

drivers/staging/gasket/gasket_ioctl.c: In function 'gasket_config_coherent_allocator':

Quoted 1 line
Quoted 1 line

drivers/staging/gasket/gasket_ioctl.c:434:27: error: passing argument 3 of 'gasket_alloc_coherent_memory' from incompatible pointer type [-Werror=incompatible-pointer-types]

gasket_dev, ibuf.size, &ibuf.dma_address,
^~~~~~~~~~~~~~~~~
In file included from drivers/staging/gasket/gasket_ioctl.c:9:

   drivers/staging/gasket/gasket_page_table.h:227:18: note: expected 'dma_addr_t *' {aka 'unsigned int *'} but argument is of type 'u64 *' {aka 'long long unsigned int *'}
         dma_addr_t *dma_address, uint64_t index);
         ~~~~~~~~~~~~^~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +651 drivers/staging/gasket/gasket_core.h

9a69f508 Simon Que 2018-06-29  620
9a69f508 Simon Que 2018-06-29  621  /*
9a69f508 Simon Que 2018-06-29  622   * Memory management functions. These will likely be spun off into their own
9a69f508 Simon Que 2018-06-29  623   * file in the future.
9a69f508 Simon Que 2018-06-29  624   */
9a69f508 Simon Que 2018-06-29  625
9a69f508 Simon Que 2018-06-29  626  /* Unmaps the specified mappable region from a VMA. */
9a69f508 Simon Que 2018-06-29  627  int gasket_mm_unmap_region(
9a69f508 Simon Que 2018-06-29  628      const struct gasket_dev *gasket_dev, struct vm_area_struct *vma,
9a69f508 Simon Que 2018-06-29  629      const struct gasket_mappable_region *map_region);
9a69f508 Simon Que 2018-06-29  630
9a69f508 Simon Que 2018-06-29  631  /*
9a69f508 Simon Que 2018-06-29  632   * Get the ioctl permissions callback.
9a69f508 Simon Que 2018-06-29  633   * @gasket_dev: Gasket device structure.
9a69f508 Simon Que 2018-06-29  634   */
9a69f508 Simon Que 2018-06-29  635  gasket_ioctl_permissions_cb_t gasket_get_ioctl_permissions_cb(
9a69f508 Simon Que 2018-06-29  636      struct gasket_dev *gasket_dev);
9a69f508 Simon Que 2018-06-29  637
9a69f508 Simon Que 2018-06-29  638  /**
9a69f508 Simon Que 2018-06-29  639   * Lookup a name by number in a num_name table.
9a69f508 Simon Que 2018-06-29  640   * @num: Number to lookup.
9a69f508 Simon Que 2018-06-29  641   * @table: Array of num_name structures, the table for the lookup.
9a69f508 Simon Que 2018-06-29  642   *
9a69f508 Simon Que 2018-06-29  643   */
9a69f508 Simon Que 2018-06-29  644  const char *gasket_num_name_lookup(
9a69f508 Simon Que 2018-06-29  645      uint num, const struct gasket_num_name *table);
9a69f508 Simon Que 2018-06-29  646
9a69f508 Simon Que 2018-06-29  647  /* Handy inlines */
9a69f508 Simon Que 2018-06-29  648  static inline ulong gasket_dev_read_64(
9a69f508 Simon Que 2018-06-29  649      struct gasket_dev *gasket_dev, int bar, ulong location)
9a69f508 Simon Que 2018-06-29  650  {
9a69f508 Simon Que 2018-06-29 @651      return readq(&gasket_dev->bar_data[bar].virt_base[location]);
9a69f508 Simon Que 2018-06-29  652  }
9a69f508 Simon Que 2018-06-29  653
9a69f508 Simon Que 2018-06-29  654  static inline void gasket_dev_write_64(
9a69f508 Simon Que 2018-06-29  655      struct gasket_dev *dev, u64 value, int bar, ulong location)
9a69f508 Simon Que 2018-06-29  656  {

9a69f508 Simon Que 2018-06-29 @657 writeq(value, &dev->bar_data[bar].virt_base[location]);
9a69f508 Simon Que 2018-06-29 658 }
9a69f508 Simon Que 2018-06-29 659

:::::: The code at line 651 was first introduced by commit
:::::: 9a69f5087ccc20bb411025decab455836df04168 drivers/staging: Gasket driver framework + Apex driver

:::::: TO: Simon Que <[email protected]>
:::::: CC: Greg Kroah-Hartman <[email protected]>

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

Signature · 1 line
Todd