linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] can: Kconfig: add missing COMPILE_TEST
@ 2025-07-13  8:02 Vincent Mailhol
  2025-07-13  8:02 ` [PATCH 1/3] can: ti_hecc: fix -Woverflow compiler warning Vincent Mailhol
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Vincent Mailhol @ 2025-07-13  8:02 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can, linux-kernel, Vincent Mailhol

The ti_hecc and tscan1 CAN drivers can not be built on an x86_64
platform. Add the COMPILE_TEST dependency to allow build testing.

Doing that, a so far unnoticed W=0 warning showed up in ti_hecc. Fix
this warning. To prevent any potential noise in some future git
bisect, the warning is fixed before introducing COMPILE_TEST.

Note that the mscan and mpc5xxx drivers have the same issue but those
two use some helper functions, such as in_8() and out_8(), which are
only available on the powerpc platform. Those two drivers would
require some deeper code refactor to be built on x86_64 and are thus
left out of scope.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
Vincent Mailhol (3):
      can: ti_hecc: fix -Woverflow compiler warning
      can: ti_hecc: Kconfig: add COMPILE_TEST
      can: tscan1: Kconfig: add COMPILE_TEST

 drivers/net/can/Kconfig         | 2 +-
 drivers/net/can/sja1000/Kconfig | 2 +-
 drivers/net/can/ti_hecc.c       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
base-commit: a52f9f0d77f20efc285908a28b5697603b6597c7
change-id: 20250713-can-compile-test-933d513473a1

Best regards,
-- 
Vincent Mailhol <mailhol.vincent@wanadoo.fr>


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

* [PATCH 1/3] can: ti_hecc: fix -Woverflow compiler warning
  2025-07-13  8:02 [PATCH 0/3] can: Kconfig: add missing COMPILE_TEST Vincent Mailhol
@ 2025-07-13  8:02 ` Vincent Mailhol
  2025-07-13  8:02 ` [PATCH 2/3] can: ti_hecc: Kconfig: add COMPILE_TEST Vincent Mailhol
  2025-07-13  8:02 ` [PATCH 3/3] can: tscan1: " Vincent Mailhol
  2 siblings, 0 replies; 7+ messages in thread
From: Vincent Mailhol @ 2025-07-13  8:02 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can, linux-kernel, Vincent Mailhol

Fix below default (W=0) warning:

  drivers/net/can/ti_hecc.c: In function 'ti_hecc_start':
  drivers/net/can/ti_hecc.c:386:20: warning: conversion from 'long unsigned int' to 'u32' {aka 'unsigned int'} changes value from '18446744073709551599' to '4294967279' [-Woverflow]
    386 |         mbx_mask = ~BIT(HECC_RX_LAST_MBOX);
        |                    ^

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/ti_hecc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 644e8b8eb91e74eec050841491f20d3e6796e9b7..e6d6661a908ab12eb4c7ec61c162848c18ef20f4 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -383,7 +383,7 @@ static void ti_hecc_start(struct net_device *ndev)
 	 * overflows instead of the hardware silently dropping the
 	 * messages.
 	 */
-	mbx_mask = ~BIT(HECC_RX_LAST_MBOX);
+	mbx_mask = ~BIT_U32(HECC_RX_LAST_MBOX);
 	hecc_write(priv, HECC_CANOPC, mbx_mask);
 
 	/* Enable interrupts */

-- 
2.49.1


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

* [PATCH 2/3] can: ti_hecc: Kconfig: add COMPILE_TEST
  2025-07-13  8:02 [PATCH 0/3] can: Kconfig: add missing COMPILE_TEST Vincent Mailhol
  2025-07-13  8:02 ` [PATCH 1/3] can: ti_hecc: fix -Woverflow compiler warning Vincent Mailhol
@ 2025-07-13  8:02 ` Vincent Mailhol
  2025-07-13  8:02 ` [PATCH 3/3] can: tscan1: " Vincent Mailhol
  2 siblings, 0 replies; 7+ messages in thread
From: Vincent Mailhol @ 2025-07-13  8:02 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can, linux-kernel, Vincent Mailhol

ti_hecc depends on ARM. Add COMPILE_TEST so that this driver can also
be built on other platforms.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig
index cf989bea9aa33356a94a9bb495d4c22ae907d436..d58fab0161b3ea6e12047c3fa0f884d0142002e7 100644
--- a/drivers/net/can/Kconfig
+++ b/drivers/net/can/Kconfig
@@ -201,7 +201,7 @@ config CAN_SUN4I
 	  be called sun4i_can.
 
 config CAN_TI_HECC
-	depends on ARM
+	depends on ARM || COMPILE_TEST
 	tristate "TI High End CAN Controller"
 	select CAN_RX_OFFLOAD
 	help

-- 
2.49.1


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

* [PATCH 3/3] can: tscan1: Kconfig: add COMPILE_TEST
  2025-07-13  8:02 [PATCH 0/3] can: Kconfig: add missing COMPILE_TEST Vincent Mailhol
  2025-07-13  8:02 ` [PATCH 1/3] can: ti_hecc: fix -Woverflow compiler warning Vincent Mailhol
  2025-07-13  8:02 ` [PATCH 2/3] can: ti_hecc: Kconfig: add COMPILE_TEST Vincent Mailhol
@ 2025-07-13  8:02 ` Vincent Mailhol
  2025-07-14  7:40   ` kernel test robot
  2025-07-15  9:13   ` Marc Kleine-Budde
  2 siblings, 2 replies; 7+ messages in thread
From: Vincent Mailhol @ 2025-07-13  8:02 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can, linux-kernel, Vincent Mailhol

tscan1 depends on ISA. Add COMPILE_TEST so that this driver can also be
built on other platforms.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/sja1000/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/sja1000/Kconfig b/drivers/net/can/sja1000/Kconfig
index 2f516cc6d22c4028b1de383baa6b3d3a7605b791..fee9d6f84f5fb9d6a81df00be9d216219723a854 100644
--- a/drivers/net/can/sja1000/Kconfig
+++ b/drivers/net/can/sja1000/Kconfig
@@ -105,7 +105,7 @@ config CAN_SJA1000_PLATFORM
 
 config CAN_TSCAN1
 	tristate "TS-CAN1 PC104 boards"
-	depends on ISA
+	depends on ISA || COMPILE_TEST
 	help
 	  This driver is for Technologic Systems' TSCAN-1 PC104 boards.
 	  https://www.embeddedts.com/products/TS-CAN1

-- 
2.49.1


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

* Re: [PATCH 3/3] can: tscan1: Kconfig: add COMPILE_TEST
  2025-07-13  8:02 ` [PATCH 3/3] can: tscan1: " Vincent Mailhol
@ 2025-07-14  7:40   ` kernel test robot
  2025-07-15  9:13   ` Marc Kleine-Budde
  1 sibling, 0 replies; 7+ messages in thread
From: kernel test robot @ 2025-07-14  7:40 UTC (permalink / raw)
  To: Vincent Mailhol, Marc Kleine-Budde
  Cc: llvm, oe-kbuild-all, linux-can, linux-kernel, Vincent Mailhol

Hi Vincent,

kernel test robot noticed the following build errors:

[auto build test ERROR on a52f9f0d77f20efc285908a28b5697603b6597c7]

url:    https://github.com/intel-lab-lkp/linux/commits/Vincent-Mailhol/can-ti_hecc-fix-Woverflow-compiler-warning/20250713-160616
base:   a52f9f0d77f20efc285908a28b5697603b6597c7
patch link:    https://lore.kernel.org/r/20250713-can-compile-test-v1-3-b4485e057375%40wanadoo.fr
patch subject: [PATCH 3/3] can: tscan1: Kconfig: add COMPILE_TEST
config: um-allmodconfig (https://download.01.org/0day-ci/archive/20250714/202507141417.qAMrchyV-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250714/202507141417.qAMrchyV-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507141417.qAMrchyV-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/net/can/sja1000/tscan1.c:14:
   In file included from include/linux/io.h:12:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:1175:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
    1175 |         return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
         |                                                   ~~~~~~~~~~ ^
>> drivers/net/can/sja1000/tscan1.c:89:6: error: call to '_inb' declared with 'error' attribute: inb()) requires CONFIG_HAS_IOPORT
      89 |         if (inb(pld_base + TSCAN1_ID1) != TSCAN1_ID1_VALUE ||
         |             ^
   include/asm-generic/io.h:643:13: note: expanded from macro 'inb'
     643 | #define inb _inb
         |             ^
   include/asm-generic/io.h:542:14: note: expanded from macro '_inb'
     542 | #define _inb _inb
         |              ^
   drivers/net/can/sja1000/tscan1.c:90:6: error: call to '_inb' declared with 'error' attribute: inb()) requires CONFIG_HAS_IOPORT
      90 |             inb(pld_base + TSCAN1_ID2) != TSCAN1_ID2_VALUE) {
         |             ^
   include/asm-generic/io.h:643:13: note: expanded from macro 'inb'
     643 | #define inb _inb
         |             ^
   include/asm-generic/io.h:542:14: note: expanded from macro '_inb'
     542 | #define _inb _inb
         |              ^
   drivers/net/can/sja1000/tscan1.c:95:10: error: call to '_inb' declared with 'error' attribute: inb()) requires CONFIG_HAS_IOPORT
      95 |         switch (inb(pld_base + TSCAN1_JUMPERS) & (TSCAN1_JP4 | TSCAN1_JP5)) {
         |                 ^
   include/asm-generic/io.h:643:13: note: expanded from macro 'inb'
     643 | #define inb _inb
         |             ^
   include/asm-generic/io.h:542:14: note: expanded from macro '_inb'
     542 | #define _inb _inb
         |              ^
>> drivers/net/can/sja1000/tscan1.c:138:3: error: call to '_outb' declared with 'error' attribute: outb() requires CONFIG_HAS_IOPORT
     138 |                 outb(TSCAN1_MODE_ENABLE | i, pld_base + TSCAN1_MODE);
         |                 ^
   include/asm-generic/io.h:655:14: note: expanded from macro 'outb'
     655 | #define outb _outb
         |              ^
   include/asm-generic/io.h:596:15: note: expanded from macro '_outb'
     596 | #define _outb _outb
         |               ^
   drivers/net/can/sja1000/tscan1.c:150:3: error: call to '_outb' declared with 'error' attribute: outb() requires CONFIG_HAS_IOPORT
     150 |                 outb(0, pld_base + TSCAN1_MODE);
         |                 ^
   include/asm-generic/io.h:655:14: note: expanded from macro 'outb'
     655 | #define outb _outb
         |              ^
   include/asm-generic/io.h:596:15: note: expanded from macro '_outb'
     596 | #define _outb _outb
         |               ^
   drivers/net/can/sja1000/tscan1.c:143:4: error: call to '_outb' declared with 'error' attribute: outb() requires CONFIG_HAS_IOPORT
     143 |                         outb(0, pld_base + TSCAN1_LED);
         |                         ^
   include/asm-generic/io.h:655:14: note: expanded from macro 'outb'
     655 | #define outb _outb
         |              ^
   include/asm-generic/io.h:596:15: note: expanded from macro '_outb'
     596 | #define _outb _outb
         |               ^
   drivers/net/can/sja1000/tscan1.c:175:2: error: call to '_outb' declared with 'error' attribute: outb() requires CONFIG_HAS_IOPORT
     175 |         outb(0, pld_base + TSCAN1_MODE);        /* disable SJA1000 IO space */
         |         ^
   include/asm-generic/io.h:655:14: note: expanded from macro 'outb'
     655 | #define outb _outb
         |              ^
   include/asm-generic/io.h:596:15: note: expanded from macro '_outb'
     596 | #define _outb _outb
         |               ^
   drivers/net/can/sja1000/tscan1.c:68:9: error: call to '_inb' declared with 'error' attribute: inb()) requires CONFIG_HAS_IOPORT
      68 |         return inb((unsigned long)priv->reg_base + reg);
         |                ^
   include/asm-generic/io.h:643:13: note: expanded from macro 'inb'
     643 | #define inb _inb
         |             ^
   include/asm-generic/io.h:542:14: note: expanded from macro '_inb'
     542 | #define _inb _inb
         |              ^
   drivers/net/can/sja1000/tscan1.c:74:2: error: call to '_outb' declared with 'error' attribute: outb() requires CONFIG_HAS_IOPORT
      74 |         outb(val, (unsigned long)priv->reg_base + reg);
         |         ^
   include/asm-generic/io.h:655:14: note: expanded from macro 'outb'
     655 | #define outb _outb
         |              ^
   include/asm-generic/io.h:596:15: note: expanded from macro '_outb'
     596 | #define _outb _outb
         |               ^
   1 warning and 9 errors generated.


vim +89 drivers/net/can/sja1000/tscan1.c

2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  @14  #include <linux/io.h>
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   15  #include <linux/ioport.h>
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   16  #include <linux/isa.h>
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   17  #include <linux/module.h>
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   18  #include <linux/netdevice.h>
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   19  #include "sja1000.h"
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   20  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   21  MODULE_DESCRIPTION("Driver for Technologic Systems TS-CAN1 PC104 boards");
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   22  MODULE_AUTHOR("Andre B. Oliveira <anbadeol@gmail.com>");
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   23  MODULE_LICENSE("GPL");
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   24  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   25  /* Maximum number of boards (one in each JP1:JP2 setting of IO address) */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   26  #define TSCAN1_MAXDEV 4
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   27  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   28  /* PLD registers address offsets */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   29  #define TSCAN1_ID1	0
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   30  #define TSCAN1_ID2	1
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   31  #define TSCAN1_VERSION	2
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   32  #define TSCAN1_LED	3
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   33  #define TSCAN1_PAGE	4
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   34  #define TSCAN1_MODE	5
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   35  #define TSCAN1_JUMPERS	6
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   36  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   37  /* PLD board identifier registers magic values */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   38  #define TSCAN1_ID1_VALUE 0xf6
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   39  #define TSCAN1_ID2_VALUE 0xb9
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   40  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   41  /* PLD mode register SJA1000 IO enable bit */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   42  #define TSCAN1_MODE_ENABLE 0x40
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   43  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   44  /* PLD jumpers register bits */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   45  #define TSCAN1_JP4 0x10
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   46  #define TSCAN1_JP5 0x20
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   47  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   48  /* PLD IO base addresses start */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   49  #define TSCAN1_PLD_ADDRESS 0x150
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   50  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   51  /* PLD register space size */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   52  #define TSCAN1_PLD_SIZE 8
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   53  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   54  /* SJA1000 register space size */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   55  #define TSCAN1_SJA1000_SIZE 32
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   56  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   57  /* SJA1000 crystal frequency (16MHz) */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   58  #define TSCAN1_SJA1000_XTAL 16000000
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   59  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   60  /* SJA1000 IO base addresses */
3c8ac0f2ad53a9 Bill Pemberton    2012-12-03   61  static const unsigned short tscan1_sja1000_addresses[] = {
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   62  	0x100, 0x120, 0x180, 0x1a0, 0x200, 0x240, 0x280, 0x320
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   63  };
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   64  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   65  /* Read SJA1000 register */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   66  static u8 tscan1_read(const struct sja1000_priv *priv, int reg)
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   67  {
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   68  	return inb((unsigned long)priv->reg_base + reg);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   69  }
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   70  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   71  /* Write SJA1000 register */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   72  static void tscan1_write(const struct sja1000_priv *priv, int reg, u8 val)
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   73  {
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   74  	outb(val, (unsigned long)priv->reg_base + reg);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   75  }
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   76  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   77  /* Probe for a TS-CAN1 board with JP2:JP1 jumper setting ID */
3c8ac0f2ad53a9 Bill Pemberton    2012-12-03   78  static int tscan1_probe(struct device *dev, unsigned id)
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   79  {
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   80  	struct net_device *netdev;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   81  	struct sja1000_priv *priv;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   82  	unsigned long pld_base, sja1000_base;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   83  	int irq, i;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   84  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   85  	pld_base = TSCAN1_PLD_ADDRESS + id * TSCAN1_PLD_SIZE;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   86  	if (!request_region(pld_base, TSCAN1_PLD_SIZE, dev_name(dev)))
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   87  		return -EBUSY;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   88  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  @89  	if (inb(pld_base + TSCAN1_ID1) != TSCAN1_ID1_VALUE ||
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   90  	    inb(pld_base + TSCAN1_ID2) != TSCAN1_ID2_VALUE) {
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   91  		release_region(pld_base, TSCAN1_PLD_SIZE);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   92  		return -ENODEV;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   93  	}
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   94  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  @95  	switch (inb(pld_base + TSCAN1_JUMPERS) & (TSCAN1_JP4 | TSCAN1_JP5)) {
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   96  	case TSCAN1_JP4:
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   97  		irq = 6;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   98  		break;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18   99  	case TSCAN1_JP5:
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  100  		irq = 7;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  101  		break;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  102  	case TSCAN1_JP4 | TSCAN1_JP5:
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  103  		irq = 5;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  104  		break;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  105  	default:
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  106  		dev_err(dev, "invalid JP4:JP5 setting (no IRQ)\n");
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  107  		release_region(pld_base, TSCAN1_PLD_SIZE);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  108  		return -EINVAL;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  109  	}
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  110  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  111  	netdev = alloc_sja1000dev(0);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  112  	if (!netdev) {
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  113  		release_region(pld_base, TSCAN1_PLD_SIZE);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  114  		return -ENOMEM;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  115  	}
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  116  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  117  	dev_set_drvdata(dev, netdev);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  118  	SET_NETDEV_DEV(netdev, dev);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  119  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  120  	netdev->base_addr = pld_base;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  121  	netdev->irq = irq;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  122  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  123  	priv = netdev_priv(netdev);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  124  	priv->read_reg = tscan1_read;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  125  	priv->write_reg = tscan1_write;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  126  	priv->can.clock.freq = TSCAN1_SJA1000_XTAL / 2;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  127  	priv->cdr = CDR_CBP | CDR_CLK_OFF;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  128  	priv->ocr = OCR_TX0_PUSHPULL;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  129  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  130  	/* Select the first SJA1000 IO address that is free and that works */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  131  	for (i = 0; i < ARRAY_SIZE(tscan1_sja1000_addresses); i++) {
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  132  		sja1000_base = tscan1_sja1000_addresses[i];
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  133  		if (!request_region(sja1000_base, TSCAN1_SJA1000_SIZE,
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  134  								dev_name(dev)))
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  135  			continue;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  136  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  137  		/* Set SJA1000 IO base address and enable it */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18 @138  		outb(TSCAN1_MODE_ENABLE | i, pld_base + TSCAN1_MODE);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  139  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  140  		priv->reg_base = (void __iomem *)sja1000_base;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  141  		if (!register_sja1000dev(netdev)) {
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  142  			/* SJA1000 probe succeeded; turn LED off and return */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  143  			outb(0, pld_base + TSCAN1_LED);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  144  			netdev_info(netdev, "TS-CAN1 at 0x%lx 0x%lx irq %d\n",
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  145  						pld_base, sja1000_base, irq);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  146  			return 0;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  147  		}
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  148  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  149  		/* SJA1000 probe failed; release and try next address */
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  150  		outb(0, pld_base + TSCAN1_MODE);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  151  		release_region(sja1000_base, TSCAN1_SJA1000_SIZE);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  152  	}
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  153  
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  154  	dev_err(dev, "failed to assign SJA1000 IO address\n");
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  155  	dev_set_drvdata(dev, NULL);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  156  	free_sja1000dev(netdev);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  157  	release_region(pld_base, TSCAN1_PLD_SIZE);
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  158  	return -ENXIO;
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  159  }
2d3359f8b9e6b3 Andre B. Oliveira 2010-10-18  160  

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

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

* Re: [PATCH 3/3] can: tscan1: Kconfig: add COMPILE_TEST
  2025-07-13  8:02 ` [PATCH 3/3] can: tscan1: " Vincent Mailhol
  2025-07-14  7:40   ` kernel test robot
@ 2025-07-15  9:13   ` Marc Kleine-Budde
  2025-07-15 11:02     ` Vincent Mailhol
  1 sibling, 1 reply; 7+ messages in thread
From: Marc Kleine-Budde @ 2025-07-15  9:13 UTC (permalink / raw)
  To: Vincent Mailhol; +Cc: linux-can, linux-kernel

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

On 13.07.2025 17:02:45, Vincent Mailhol wrote:
> tscan1 depends on ISA. Add COMPILE_TEST so that this driver can also be
> built on other platforms.
> 
> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
> ---
>  drivers/net/can/sja1000/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/can/sja1000/Kconfig b/drivers/net/can/sja1000/Kconfig
> index 2f516cc6d22c4028b1de383baa6b3d3a7605b791..fee9d6f84f5fb9d6a81df00be9d216219723a854 100644
> --- a/drivers/net/can/sja1000/Kconfig
> +++ b/drivers/net/can/sja1000/Kconfig
> @@ -105,7 +105,7 @@ config CAN_SJA1000_PLATFORM
>  
>  config CAN_TSCAN1
>  	tristate "TS-CAN1 PC104 boards"
> -	depends on ISA
> +	depends on ISA || COMPILE_TEST
>  	help
>  	  This driver is for Technologic Systems' TSCAN-1 PC104 boards.
>  	  https://www.embeddedts.com/products/TS-CAN1
> 

What about making it:

--- a/drivers/net/can/sja1000/Kconfig
+++ b/drivers/net/can/sja1000/Kconfig
@@ -105,7 +105,7 @@ config CAN_SJA1000_PLATFORM
 
 config CAN_TSCAN1
         tristate "TS-CAN1 PC104 boards"
-        depends on ISA
+        depends on ISA || (COMPILE_TEST && HAS_IOPORT)
         help
           This driver is for Technologic Systems' TSCAN-1 PC104 boards.
           https://www.embeddedts.com/products/TS-CAN1

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 3/3] can: tscan1: Kconfig: add COMPILE_TEST
  2025-07-15  9:13   ` Marc Kleine-Budde
@ 2025-07-15 11:02     ` Vincent Mailhol
  0 siblings, 0 replies; 7+ messages in thread
From: Vincent Mailhol @ 2025-07-15 11:02 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can, linux-kernel

On 15/07/2025 at 18:13, Marc Kleine-Budde wrote:
> On 13.07.2025 17:02:45, Vincent Mailhol wrote:
>> tscan1 depends on ISA. Add COMPILE_TEST so that this driver can also be
>> built on other platforms.
>>
>> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
>> ---
>>  drivers/net/can/sja1000/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/can/sja1000/Kconfig b/drivers/net/can/sja1000/Kconfig
>> index 2f516cc6d22c4028b1de383baa6b3d3a7605b791..fee9d6f84f5fb9d6a81df00be9d216219723a854 100644
>> --- a/drivers/net/can/sja1000/Kconfig
>> +++ b/drivers/net/can/sja1000/Kconfig
>> @@ -105,7 +105,7 @@ config CAN_SJA1000_PLATFORM
>>  
>>  config CAN_TSCAN1
>>  	tristate "TS-CAN1 PC104 boards"
>> -	depends on ISA
>> +	depends on ISA || COMPILE_TEST
>>  	help
>>  	  This driver is for Technologic Systems' TSCAN-1 PC104 boards.
>>  	  https://www.embeddedts.com/products/TS-CAN1
>>
> 
> What about making it:
> 
> --- a/drivers/net/can/sja1000/Kconfig
> +++ b/drivers/net/can/sja1000/Kconfig
> @@ -105,7 +105,7 @@ config CAN_SJA1000_PLATFORM
>  
>  config CAN_TSCAN1
>          tristate "TS-CAN1 PC104 boards"
> -        depends on ISA
> +        depends on ISA || (COMPILE_TEST && HAS_IOPORT)
>          help
>            This driver is for Technologic Systems' TSCAN-1 PC104 boards.
>            https://www.embeddedts.com/products/TS-CAN1

Yes, I was thinking of the exact same thing after seeing the bot's error
message. I just did not yet find some time to test.

The kernel test robot actually gives instructions on how to reproduce, but for
some reasons which I have not yet troubleshot, it did not work on first try on
my machine.

Well, you know what, because we reached the same conclusion, allow me to be a
bit lazy here. I will just send the v2 and let the bot test it for me.


Yours sincerely,
Vincent Mailhol


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

end of thread, other threads:[~2025-07-15 11:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-13  8:02 [PATCH 0/3] can: Kconfig: add missing COMPILE_TEST Vincent Mailhol
2025-07-13  8:02 ` [PATCH 1/3] can: ti_hecc: fix -Woverflow compiler warning Vincent Mailhol
2025-07-13  8:02 ` [PATCH 2/3] can: ti_hecc: Kconfig: add COMPILE_TEST Vincent Mailhol
2025-07-13  8:02 ` [PATCH 3/3] can: tscan1: " Vincent Mailhol
2025-07-14  7:40   ` kernel test robot
2025-07-15  9:13   ` Marc Kleine-Budde
2025-07-15 11:02     ` Vincent Mailhol

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