diff mbox series

[v2,3/5] i2c: aspeed: Mask IRQ status to relevant bits

Message ID 20200908200101.64974-4-eajames@linux.ibm.com (mailing list archive)
State Superseded
Headers show
Series input: misc: Add IBM Operation Panel driver | expand

Commit Message

Eddie James Sept. 8, 2020, 8 p.m. UTC
Mask the IRQ status to only the bits that the driver checks. This
prevents excessive driver warnings when operating in slave mode
when additional bits are set that the driver doesn't handle.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
 drivers/i2c/busses/i2c-aspeed.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Tao Ren Sept. 9, 2020, 2:59 a.m. UTC | #1
On Tue, Sep 08, 2020 at 03:00:59PM -0500, Eddie James wrote:
> Mask the IRQ status to only the bits that the driver checks. This
> prevents excessive driver warnings when operating in slave mode
> when additional bits are set that the driver doesn't handle.
> 
> Signed-off-by: Eddie James <eajames@linux.ibm.com>

Reviewed-by: Tao Ren <rentao.bupt@gmail.com>

> ---
>  drivers/i2c/busses/i2c-aspeed.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
> index 31268074c422..2a388911038a 100644
> --- a/drivers/i2c/busses/i2c-aspeed.c
> +++ b/drivers/i2c/busses/i2c-aspeed.c
> @@ -69,6 +69,7 @@
>   * These share bit definitions, so use the same values for the enable &
>   * status bits.
>   */
> +#define ASPEED_I2CD_INTR_ALL				0xf000ffff
>  #define ASPEED_I2CD_INTR_SDA_DL_TIMEOUT			BIT(14)
>  #define ASPEED_I2CD_INTR_BUS_RECOVER_DONE		BIT(13)
>  #define ASPEED_I2CD_INTR_SLAVE_MATCH			BIT(7)
> @@ -604,6 +605,7 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id)
>  	writel(irq_received & ~ASPEED_I2CD_INTR_RX_DONE,
>  	       bus->base + ASPEED_I2C_INTR_STS_REG);
>  	readl(bus->base + ASPEED_I2C_INTR_STS_REG);
> +	irq_received &= ASPEED_I2CD_INTR_ALL;
>  	irq_remaining = irq_received;
>  
>  #if IS_ENABLED(CONFIG_I2C_SLAVE)
> -- 
> 2.26.2
>
kernel test robot Sept. 9, 2020, 7:59 a.m. UTC | #2
Hi Eddie,

I love your patch! Perhaps something to improve:

[auto build test WARNING on joel-aspeed/for-next]
[also build test WARNING on wsa/i2c/for-next linus/master v5.9-rc4 next-20200908]
[cannot apply to input/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Eddie-James/input-misc-Add-IBM-Operation-Panel-driver/20200909-120637
base:   https://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed.git for-next
config: x86_64-randconfig-a016-20200909 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 8893d0816ccdf8998d2e21b5430e9d6abe7ef465)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/i2c/busses/i2c-aspeed.c:88:9: warning: 'ASPEED_I2CD_INTR_ALL' macro redefined [-Wmacro-redefined]
   #define ASPEED_I2CD_INTR_ALL                                                   \
           ^
   drivers/i2c/busses/i2c-aspeed.c:72:9: note: previous definition is here
   #define ASPEED_I2CD_INTR_ALL                            0xf000ffff
           ^
   1 warning generated.

# https://github.com/0day-ci/linux/commit/6d9e57527652ab1a348f68145e41e6a19d5dc0dc
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Eddie-James/input-misc-Add-IBM-Operation-Panel-driver/20200909-120637
git checkout 6d9e57527652ab1a348f68145e41e6a19d5dc0dc
vim +/ASPEED_I2CD_INTR_ALL +88 drivers/i2c/busses/i2c-aspeed.c

f327c686d3ba44e Brendan Higgins 2017-06-20  65  
f327c686d3ba44e Brendan Higgins 2017-06-20  66  /* 0x0c : I2CD Interrupt Control Register &
f327c686d3ba44e Brendan Higgins 2017-06-20  67   * 0x10 : I2CD Interrupt Status Register
f327c686d3ba44e Brendan Higgins 2017-06-20  68   *
f327c686d3ba44e Brendan Higgins 2017-06-20  69   * These share bit definitions, so use the same values for the enable &
f327c686d3ba44e Brendan Higgins 2017-06-20  70   * status bits.
f327c686d3ba44e Brendan Higgins 2017-06-20  71   */
6d9e57527652ab1 Eddie James     2020-09-08  72  #define ASPEED_I2CD_INTR_ALL				0xf000ffff
f327c686d3ba44e Brendan Higgins 2017-06-20  73  #define ASPEED_I2CD_INTR_SDA_DL_TIMEOUT			BIT(14)
f327c686d3ba44e Brendan Higgins 2017-06-20  74  #define ASPEED_I2CD_INTR_BUS_RECOVER_DONE		BIT(13)
f9eb91350bb20b3 Brendan Higgins 2017-06-20  75  #define ASPEED_I2CD_INTR_SLAVE_MATCH			BIT(7)
f327c686d3ba44e Brendan Higgins 2017-06-20  76  #define ASPEED_I2CD_INTR_SCL_TIMEOUT			BIT(6)
f327c686d3ba44e Brendan Higgins 2017-06-20  77  #define ASPEED_I2CD_INTR_ABNORMAL			BIT(5)
f327c686d3ba44e Brendan Higgins 2017-06-20  78  #define ASPEED_I2CD_INTR_NORMAL_STOP			BIT(4)
f327c686d3ba44e Brendan Higgins 2017-06-20  79  #define ASPEED_I2CD_INTR_ARBIT_LOSS			BIT(3)
f327c686d3ba44e Brendan Higgins 2017-06-20  80  #define ASPEED_I2CD_INTR_RX_DONE			BIT(2)
f327c686d3ba44e Brendan Higgins 2017-06-20  81  #define ASPEED_I2CD_INTR_TX_NAK				BIT(1)
f327c686d3ba44e Brendan Higgins 2017-06-20  82  #define ASPEED_I2CD_INTR_TX_ACK				BIT(0)
3e9efc3299dd78a Jae Hyun Yoo    2018-08-23  83  #define ASPEED_I2CD_INTR_MASTER_ERRORS					       \
3e9efc3299dd78a Jae Hyun Yoo    2018-08-23  84  		(ASPEED_I2CD_INTR_SDA_DL_TIMEOUT |			       \
3e9efc3299dd78a Jae Hyun Yoo    2018-08-23  85  		 ASPEED_I2CD_INTR_SCL_TIMEOUT |				       \
3e9efc3299dd78a Jae Hyun Yoo    2018-08-23  86  		 ASPEED_I2CD_INTR_ABNORMAL |				       \
3e9efc3299dd78a Jae Hyun Yoo    2018-08-23  87  		 ASPEED_I2CD_INTR_ARBIT_LOSS)
f327c686d3ba44e Brendan Higgins 2017-06-20 @88  #define ASPEED_I2CD_INTR_ALL						       \
f327c686d3ba44e Brendan Higgins 2017-06-20  89  		(ASPEED_I2CD_INTR_SDA_DL_TIMEOUT |			       \
f327c686d3ba44e Brendan Higgins 2017-06-20  90  		 ASPEED_I2CD_INTR_BUS_RECOVER_DONE |			       \
f327c686d3ba44e Brendan Higgins 2017-06-20  91  		 ASPEED_I2CD_INTR_SCL_TIMEOUT |				       \
f327c686d3ba44e Brendan Higgins 2017-06-20  92  		 ASPEED_I2CD_INTR_ABNORMAL |				       \
f327c686d3ba44e Brendan Higgins 2017-06-20  93  		 ASPEED_I2CD_INTR_NORMAL_STOP |				       \
f327c686d3ba44e Brendan Higgins 2017-06-20  94  		 ASPEED_I2CD_INTR_ARBIT_LOSS |				       \
f327c686d3ba44e Brendan Higgins 2017-06-20  95  		 ASPEED_I2CD_INTR_RX_DONE |				       \
f327c686d3ba44e Brendan Higgins 2017-06-20  96  		 ASPEED_I2CD_INTR_TX_NAK |				       \
f327c686d3ba44e Brendan Higgins 2017-06-20  97  		 ASPEED_I2CD_INTR_TX_ACK)
f327c686d3ba44e Brendan Higgins 2017-06-20  98  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot Sept. 9, 2020, 8:01 a.m. UTC | #3
Hi Eddie,

I love your patch! Perhaps something to improve:

[auto build test WARNING on joel-aspeed/for-next]
[also build test WARNING on wsa/i2c/for-next linus/master v5.9-rc4 next-20200908]
[cannot apply to input/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Eddie-James/input-misc-Add-IBM-Operation-Panel-driver/20200909-120637
base:   https://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed.git for-next
config: h8300-randconfig-r016-20200909 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        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
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=h8300 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/i2c/busses/i2c-aspeed.c:88: warning: "ASPEED_I2CD_INTR_ALL" redefined
      88 | #define ASPEED_I2CD_INTR_ALL             \
         | 
   drivers/i2c/busses/i2c-aspeed.c:72: note: this is the location of the previous definition
      72 | #define ASPEED_I2CD_INTR_ALL    0xf000ffff
         | 

# https://github.com/0day-ci/linux/commit/6d9e57527652ab1a348f68145e41e6a19d5dc0dc
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Eddie-James/input-misc-Add-IBM-Operation-Panel-driver/20200909-120637
git checkout 6d9e57527652ab1a348f68145e41e6a19d5dc0dc
vim +/ASPEED_I2CD_INTR_ALL +88 drivers/i2c/busses/i2c-aspeed.c

f327c686d3ba44e Brendan Higgins 2017-06-20  65  
f327c686d3ba44e Brendan Higgins 2017-06-20  66  /* 0x0c : I2CD Interrupt Control Register &
f327c686d3ba44e Brendan Higgins 2017-06-20  67   * 0x10 : I2CD Interrupt Status Register
f327c686d3ba44e Brendan Higgins 2017-06-20  68   *
f327c686d3ba44e Brendan Higgins 2017-06-20  69   * These share bit definitions, so use the same values for the enable &
f327c686d3ba44e Brendan Higgins 2017-06-20  70   * status bits.
f327c686d3ba44e Brendan Higgins 2017-06-20  71   */
6d9e57527652ab1 Eddie James     2020-09-08  72  #define ASPEED_I2CD_INTR_ALL				0xf000ffff
f327c686d3ba44e Brendan Higgins 2017-06-20  73  #define ASPEED_I2CD_INTR_SDA_DL_TIMEOUT			BIT(14)
f327c686d3ba44e Brendan Higgins 2017-06-20  74  #define ASPEED_I2CD_INTR_BUS_RECOVER_DONE		BIT(13)
f9eb91350bb20b3 Brendan Higgins 2017-06-20  75  #define ASPEED_I2CD_INTR_SLAVE_MATCH			BIT(7)
f327c686d3ba44e Brendan Higgins 2017-06-20  76  #define ASPEED_I2CD_INTR_SCL_TIMEOUT			BIT(6)
f327c686d3ba44e Brendan Higgins 2017-06-20  77  #define ASPEED_I2CD_INTR_ABNORMAL			BIT(5)
f327c686d3ba44e Brendan Higgins 2017-06-20  78  #define ASPEED_I2CD_INTR_NORMAL_STOP			BIT(4)
f327c686d3ba44e Brendan Higgins 2017-06-20  79  #define ASPEED_I2CD_INTR_ARBIT_LOSS			BIT(3)
f327c686d3ba44e Brendan Higgins 2017-06-20  80  #define ASPEED_I2CD_INTR_RX_DONE			BIT(2)
f327c686d3ba44e Brendan Higgins 2017-06-20  81  #define ASPEED_I2CD_INTR_TX_NAK				BIT(1)
f327c686d3ba44e Brendan Higgins 2017-06-20  82  #define ASPEED_I2CD_INTR_TX_ACK				BIT(0)
3e9efc3299dd78a Jae Hyun Yoo    2018-08-23  83  #define ASPEED_I2CD_INTR_MASTER_ERRORS					       \
3e9efc3299dd78a Jae Hyun Yoo    2018-08-23  84  		(ASPEED_I2CD_INTR_SDA_DL_TIMEOUT |			       \
3e9efc3299dd78a Jae Hyun Yoo    2018-08-23  85  		 ASPEED_I2CD_INTR_SCL_TIMEOUT |				       \
3e9efc3299dd78a Jae Hyun Yoo    2018-08-23  86  		 ASPEED_I2CD_INTR_ABNORMAL |				       \
3e9efc3299dd78a Jae Hyun Yoo    2018-08-23  87  		 ASPEED_I2CD_INTR_ARBIT_LOSS)
f327c686d3ba44e Brendan Higgins 2017-06-20 @88  #define ASPEED_I2CD_INTR_ALL						       \
f327c686d3ba44e Brendan Higgins 2017-06-20  89  		(ASPEED_I2CD_INTR_SDA_DL_TIMEOUT |			       \
f327c686d3ba44e Brendan Higgins 2017-06-20  90  		 ASPEED_I2CD_INTR_BUS_RECOVER_DONE |			       \
f327c686d3ba44e Brendan Higgins 2017-06-20  91  		 ASPEED_I2CD_INTR_SCL_TIMEOUT |				       \
f327c686d3ba44e Brendan Higgins 2017-06-20  92  		 ASPEED_I2CD_INTR_ABNORMAL |				       \
f327c686d3ba44e Brendan Higgins 2017-06-20  93  		 ASPEED_I2CD_INTR_NORMAL_STOP |				       \
f327c686d3ba44e Brendan Higgins 2017-06-20  94  		 ASPEED_I2CD_INTR_ARBIT_LOSS |				       \
f327c686d3ba44e Brendan Higgins 2017-06-20  95  		 ASPEED_I2CD_INTR_RX_DONE |				       \
f327c686d3ba44e Brendan Higgins 2017-06-20  96  		 ASPEED_I2CD_INTR_TX_NAK |				       \
f327c686d3ba44e Brendan Higgins 2017-06-20  97  		 ASPEED_I2CD_INTR_TX_ACK)
f327c686d3ba44e Brendan Higgins 2017-06-20  98  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index 31268074c422..2a388911038a 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -69,6 +69,7 @@ 
  * These share bit definitions, so use the same values for the enable &
  * status bits.
  */
+#define ASPEED_I2CD_INTR_ALL				0xf000ffff
 #define ASPEED_I2CD_INTR_SDA_DL_TIMEOUT			BIT(14)
 #define ASPEED_I2CD_INTR_BUS_RECOVER_DONE		BIT(13)
 #define ASPEED_I2CD_INTR_SLAVE_MATCH			BIT(7)
@@ -604,6 +605,7 @@  static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id)
 	writel(irq_received & ~ASPEED_I2CD_INTR_RX_DONE,
 	       bus->base + ASPEED_I2C_INTR_STS_REG);
 	readl(bus->base + ASPEED_I2C_INTR_STS_REG);
+	irq_received &= ASPEED_I2CD_INTR_ALL;
 	irq_remaining = irq_received;
 
 #if IS_ENABLED(CONFIG_I2C_SLAVE)