All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Aman Kumar Pandey <aman.kumarpandey@nxp.com>,
	linux-kernel@vger.kernel.org, linux-i3c@lists.infradead.org,
	alexandre.belloni@bootlin.com, krzk+dt@kernel.org,
	robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	vikash.bansal@nxp.com, priyanka.jain@nxp.com,
	shashank.rebbapragada@nxp.com, Frank.Li@nxp.com,
	Aman Kumar Pandey <aman.kumarpandey@nxp.com>
Subject: Re: [PATCH 2/2] drivers: i3c: Add driver for NXP P3H2x4x i3c-hub device
Date: Thu, 13 Feb 2025 19:49:42 +0800	[thread overview]
Message-ID: <202502131947.VmPYnXuz-lkp@intel.com> (raw)
In-Reply-To: <20250212132227.1348374-2-aman.kumarpandey@nxp.com>

Hi Aman,

kernel test robot noticed the following build warnings:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v6.14-rc2 next-20250213]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Aman-Kumar-Pandey/drivers-i3c-Add-driver-for-NXP-P3H2x4x-i3c-hub-device/20250212-213659
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/20250212132227.1348374-2-aman.kumarpandey%40nxp.com
patch subject: [PATCH 2/2] drivers: i3c: Add driver for NXP P3H2x4x i3c-hub device
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250213/202502131947.VmPYnXuz-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250213/202502131947.VmPYnXuz-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/202502131947.VmPYnXuz-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:6:
   In file included from drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub.h:12:
   In file included from include/linux/module.h:19:
   In file included from include/linux/elf.h:6:
   In file included from arch/s390/include/asm/elf.h:181:
   In file included from arch/s390/include/asm/mmu_context.h:11:
   In file included from arch/s390/include/asm/pgalloc.h:18:
   In file included from include/linux/mm.h:2224:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:52:7: warning: variable 'flag_clear' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
      52 |                 if (ret)
         |                     ^~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:80:62: note: uninitialized use occurs here
      80 |         regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear);
         |                                                                     ^~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:52:3: note: remove the 'if' if its condition is always false
      52 |                 if (ret)
         |                 ^~~~~~~~
      53 |                         goto ibi_err;
         |                         ~~~~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:45:6: warning: variable 'flag_clear' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
      45 |         if (ret)
         |             ^~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:80:62: note: uninitialized use occurs here
      80 |         regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear);
         |                                                                     ^~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:45:2: note: remove the 'if' if its condition is always false
      45 |         if (ret)
         |         ^~~~~~~~
      46 |                 goto ibi_err;
         |                 ~~~~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:32:6: warning: variable 'flag_clear' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
      32 |         if (ret)
         |             ^~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:80:62: note: uninitialized use occurs here
      80 |         regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear);
         |                                                                     ^~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:32:2: note: remove the 'if' if its condition is always false
      32 |         if (ret)
         |         ^~~~~~~~
      33 |                 goto ibi_err;
         |                 ~~~~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:27:6: warning: variable 'flag_clear' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
      27 |         if (ret)
         |             ^~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:80:62: note: uninitialized use occurs here
      80 |         regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear);
         |                                                                     ^~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:27:2: note: remove the 'if' if its condition is always false
      27 |         if (ret)
         |         ^~~~~~~~
      28 |                 goto ibi_err;
         |                 ~~~~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:20:35: note: initialize the variable 'flag_clear' to silence this warning
      20 |         u8 target_buffer_page, flag_clear, rx_data, temp, i;
         |                                          ^
         |                                           = '\0'
>> drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:453:2: warning: variable 'write_length' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
     453 |         default:
         |         ^~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:460:12: note: uninitialized use occurs here
     460 |         desc[2] = write_length;
         |                   ^~~~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:372:30: note: initialize the variable 'write_length' to silence this warning
     372 |         u8 read_length, write_length;
         |                                     ^
         |                                      = '\0'
>> drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:453:2: warning: variable 'read_length' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
     453 |         default:
         |         ^~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:461:12: note: uninitialized use occurs here
     461 |         desc[3] = read_length;
         |                   ^~~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:372:16: note: initialize the variable 'read_length' to silence this warning
     372 |         u8 read_length, write_length;
         |                       ^
         |                        = '\0'
   9 warnings generated.


vim +52 drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c

    12	
    13	static void p3h2x4x_read_smbus_agent_rx_buf(struct i3c_device *i3cdev, enum p3h2x4x_rcv_buf rfbuf,
    14									enum p3h2x4x_tp tp, bool is_of)
    15	{
    16		struct device *dev = i3cdev_to_dev(i3cdev);
    17		struct p3h2x4x *priv = dev_get_drvdata(dev);
    18		struct smbus_device *backend = NULL;
    19	
    20		u8 target_buffer_page, flag_clear, rx_data, temp, i;
    21		u8 slave_rx_buffer[P3H2x4x_SMBUS_TARGET_PAYLOAD_SIZE] = { 0 };
    22		u32 packet_len, slave_address, ret;
    23	
    24		target_buffer_page = (((rfbuf) ? P3H2x4x_TARGET_BUFF_1_PAGE : P3H2x4x_TARGET_BUFF_0_PAGE)
    25								+  (P3H2x4x_NO_PAGE_PER_TP * tp));
    26		ret = regmap_write(priv->regmap, P3H2x4x_PAGE_PTR, target_buffer_page);
    27		if (ret)
    28			goto ibi_err;
    29	
    30		/* read buffer length */
    31		ret = regmap_read(priv->regmap, P3H2x4x_TARGET_BUFF_LENGTH, &packet_len);
    32		if (ret)
    33			goto ibi_err;
    34	
    35		if (packet_len)
    36			packet_len = packet_len - 1;
    37	
    38		if (packet_len > P3H2x4x_SMBUS_TARGET_PAYLOAD_SIZE) {
    39			dev_err(dev, "Received message too big for p3h2x4x buffer\n");
    40			return;
    41		}
    42	
    43		/* read slave  address */
    44		ret = regmap_read(priv->regmap, P3H2x4x_TARGET_BUFF_ADDRESS, &slave_address);
    45		if (ret)
    46			goto ibi_err;
    47	
    48		/* read data */
    49		if (packet_len) {
    50			ret = regmap_bulk_read(priv->regmap, P3H2x4x_TARGET_BUFF_DATA,
    51					slave_rx_buffer, packet_len);
  > 52			if (ret)
    53				goto ibi_err;
    54		}
    55	
    56		if (is_of)
    57			flag_clear = BUF_RECEIVED_FLAG_TF_MASK;
    58		else
    59			flag_clear = (((rfbuf == RCV_BUF_0) ? P3H2x4x_TARGET_BUF_0_RECEIVE :
    60						P3H2x4x_TARGET_BUF_1_RECEIVE));
    61	
    62		/* notify slave driver about received data */
    63		list_for_each_entry(backend, &priv->tp_bus[tp].tp_device_entry, list) {
    64			if ((slave_address >> 1 == backend->addr) && (priv->is_slave_reg)) {
    65				i2c_slave_event(backend->client, I2C_SLAVE_WRITE_REQUESTED,
    66					(u8 *)&slave_address);
    67	
    68				for (i = 0; i < packet_len; i++) {
    69					rx_data = slave_rx_buffer[i];
    70					i2c_slave_event(backend->client, I2C_SLAVE_WRITE_RECEIVED,
    71							&rx_data);
    72				}
    73				i2c_slave_event(backend->client, I2C_SLAVE_STOP, &temp);
    74				break;
    75			}
    76		}
    77	
    78	ibi_err:
    79		regmap_write(priv->regmap, P3H2x4x_PAGE_PTR, 0x00);
    80		regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear);
    81	}
    82	

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

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Aman Kumar Pandey <aman.kumarpandey@nxp.com>,
	linux-kernel@vger.kernel.org, linux-i3c@lists.infradead.org,
	alexandre.belloni@bootlin.com, krzk+dt@kernel.org,
	robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	vikash.bansal@nxp.com, priyanka.jain@nxp.com,
	shashank.rebbapragada@nxp.com, Frank.Li@nxp.com,
	Aman Kumar Pandey <aman.kumarpandey@nxp.com>
Subject: Re: [PATCH 2/2] drivers: i3c: Add driver for NXP P3H2x4x i3c-hub device
Date: Thu, 13 Feb 2025 19:49:42 +0800	[thread overview]
Message-ID: <202502131947.VmPYnXuz-lkp@intel.com> (raw)
In-Reply-To: <20250212132227.1348374-2-aman.kumarpandey@nxp.com>

Hi Aman,

kernel test robot noticed the following build warnings:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v6.14-rc2 next-20250213]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Aman-Kumar-Pandey/drivers-i3c-Add-driver-for-NXP-P3H2x4x-i3c-hub-device/20250212-213659
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/20250212132227.1348374-2-aman.kumarpandey%40nxp.com
patch subject: [PATCH 2/2] drivers: i3c: Add driver for NXP P3H2x4x i3c-hub device
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250213/202502131947.VmPYnXuz-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250213/202502131947.VmPYnXuz-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/202502131947.VmPYnXuz-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:6:
   In file included from drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub.h:12:
   In file included from include/linux/module.h:19:
   In file included from include/linux/elf.h:6:
   In file included from arch/s390/include/asm/elf.h:181:
   In file included from arch/s390/include/asm/mmu_context.h:11:
   In file included from arch/s390/include/asm/pgalloc.h:18:
   In file included from include/linux/mm.h:2224:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:52:7: warning: variable 'flag_clear' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
      52 |                 if (ret)
         |                     ^~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:80:62: note: uninitialized use occurs here
      80 |         regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear);
         |                                                                     ^~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:52:3: note: remove the 'if' if its condition is always false
      52 |                 if (ret)
         |                 ^~~~~~~~
      53 |                         goto ibi_err;
         |                         ~~~~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:45:6: warning: variable 'flag_clear' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
      45 |         if (ret)
         |             ^~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:80:62: note: uninitialized use occurs here
      80 |         regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear);
         |                                                                     ^~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:45:2: note: remove the 'if' if its condition is always false
      45 |         if (ret)
         |         ^~~~~~~~
      46 |                 goto ibi_err;
         |                 ~~~~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:32:6: warning: variable 'flag_clear' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
      32 |         if (ret)
         |             ^~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:80:62: note: uninitialized use occurs here
      80 |         regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear);
         |                                                                     ^~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:32:2: note: remove the 'if' if its condition is always false
      32 |         if (ret)
         |         ^~~~~~~~
      33 |                 goto ibi_err;
         |                 ~~~~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:27:6: warning: variable 'flag_clear' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
      27 |         if (ret)
         |             ^~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:80:62: note: uninitialized use occurs here
      80 |         regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear);
         |                                                                     ^~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:27:2: note: remove the 'if' if its condition is always false
      27 |         if (ret)
         |         ^~~~~~~~
      28 |                 goto ibi_err;
         |                 ~~~~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:20:35: note: initialize the variable 'flag_clear' to silence this warning
      20 |         u8 target_buffer_page, flag_clear, rx_data, temp, i;
         |                                          ^
         |                                           = '\0'
>> drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:453:2: warning: variable 'write_length' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
     453 |         default:
         |         ^~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:460:12: note: uninitialized use occurs here
     460 |         desc[2] = write_length;
         |                   ^~~~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:372:30: note: initialize the variable 'write_length' to silence this warning
     372 |         u8 read_length, write_length;
         |                                     ^
         |                                      = '\0'
>> drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:453:2: warning: variable 'read_length' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
     453 |         default:
         |         ^~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:461:12: note: uninitialized use occurs here
     461 |         desc[3] = read_length;
         |                   ^~~~~~~~~~~
   drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c:372:16: note: initialize the variable 'read_length' to silence this warning
     372 |         u8 read_length, write_length;
         |                       ^
         |                        = '\0'
   9 warnings generated.


vim +52 drivers/i3c/p3h2x4x/p3h2x4x_i3c_hub_smbus.c

    12	
    13	static void p3h2x4x_read_smbus_agent_rx_buf(struct i3c_device *i3cdev, enum p3h2x4x_rcv_buf rfbuf,
    14									enum p3h2x4x_tp tp, bool is_of)
    15	{
    16		struct device *dev = i3cdev_to_dev(i3cdev);
    17		struct p3h2x4x *priv = dev_get_drvdata(dev);
    18		struct smbus_device *backend = NULL;
    19	
    20		u8 target_buffer_page, flag_clear, rx_data, temp, i;
    21		u8 slave_rx_buffer[P3H2x4x_SMBUS_TARGET_PAYLOAD_SIZE] = { 0 };
    22		u32 packet_len, slave_address, ret;
    23	
    24		target_buffer_page = (((rfbuf) ? P3H2x4x_TARGET_BUFF_1_PAGE : P3H2x4x_TARGET_BUFF_0_PAGE)
    25								+  (P3H2x4x_NO_PAGE_PER_TP * tp));
    26		ret = regmap_write(priv->regmap, P3H2x4x_PAGE_PTR, target_buffer_page);
    27		if (ret)
    28			goto ibi_err;
    29	
    30		/* read buffer length */
    31		ret = regmap_read(priv->regmap, P3H2x4x_TARGET_BUFF_LENGTH, &packet_len);
    32		if (ret)
    33			goto ibi_err;
    34	
    35		if (packet_len)
    36			packet_len = packet_len - 1;
    37	
    38		if (packet_len > P3H2x4x_SMBUS_TARGET_PAYLOAD_SIZE) {
    39			dev_err(dev, "Received message too big for p3h2x4x buffer\n");
    40			return;
    41		}
    42	
    43		/* read slave  address */
    44		ret = regmap_read(priv->regmap, P3H2x4x_TARGET_BUFF_ADDRESS, &slave_address);
    45		if (ret)
    46			goto ibi_err;
    47	
    48		/* read data */
    49		if (packet_len) {
    50			ret = regmap_bulk_read(priv->regmap, P3H2x4x_TARGET_BUFF_DATA,
    51					slave_rx_buffer, packet_len);
  > 52			if (ret)
    53				goto ibi_err;
    54		}
    55	
    56		if (is_of)
    57			flag_clear = BUF_RECEIVED_FLAG_TF_MASK;
    58		else
    59			flag_clear = (((rfbuf == RCV_BUF_0) ? P3H2x4x_TARGET_BUF_0_RECEIVE :
    60						P3H2x4x_TARGET_BUF_1_RECEIVE));
    61	
    62		/* notify slave driver about received data */
    63		list_for_each_entry(backend, &priv->tp_bus[tp].tp_device_entry, list) {
    64			if ((slave_address >> 1 == backend->addr) && (priv->is_slave_reg)) {
    65				i2c_slave_event(backend->client, I2C_SLAVE_WRITE_REQUESTED,
    66					(u8 *)&slave_address);
    67	
    68				for (i = 0; i < packet_len; i++) {
    69					rx_data = slave_rx_buffer[i];
    70					i2c_slave_event(backend->client, I2C_SLAVE_WRITE_RECEIVED,
    71							&rx_data);
    72				}
    73				i2c_slave_event(backend->client, I2C_SLAVE_STOP, &temp);
    74				break;
    75			}
    76		}
    77	
    78	ibi_err:
    79		regmap_write(priv->regmap, P3H2x4x_PAGE_PTR, 0x00);
    80		regmap_write(priv->regmap, P3H2x4x_TP0_SMBUS_AGNT_STS + tp, flag_clear);
    81	}
    82	

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

  parent reply	other threads:[~2025-02-13 11:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 13:22 [PATCH 1/2] dt-bindings: i3c: Add NXP P3H2x4x i3c-hub support Aman Kumar Pandey
2025-02-12 13:22 ` Aman Kumar Pandey
2025-02-12 13:22 ` [PATCH 2/2] drivers: i3c: Add driver for NXP P3H2x4x i3c-hub device Aman Kumar Pandey
2025-02-12 13:22   ` Aman Kumar Pandey
2025-02-12 16:42   ` Frank Li
2025-02-12 16:42     ` Frank Li
2025-02-12 16:53   ` Krzysztof Kozlowski
2025-02-12 16:53     ` Krzysztof Kozlowski
2025-02-12 18:20   ` Alexandre Belloni
2025-02-12 18:20     ` Alexandre Belloni
2025-02-13 11:49   ` kernel test robot [this message]
2025-02-13 11:49     ` kernel test robot
2025-02-13 17:46   ` kernel test robot
2025-02-13 17:46     ` kernel test robot
2025-02-14  4:21   ` kernel test robot
2025-02-14  4:21     ` kernel test robot
2025-02-16 15:17   ` Dan Carpenter
2025-02-16 15:17     ` Dan Carpenter
2025-02-19  4:52   ` kernel test robot
2025-02-19  4:52     ` kernel test robot
2025-02-12 15:25 ` [PATCH 1/2] dt-bindings: i3c: Add NXP P3H2x4x i3c-hub support Rob Herring (Arm)
2025-02-12 15:25   ` Rob Herring (Arm)
2025-02-12 16:23 ` Frank Li
2025-02-12 16:23   ` Frank Li
2025-02-12 16:49 ` Krzysztof Kozlowski
2025-02-12 16:49   ` Krzysztof Kozlowski
  -- strict thread matches above, loose matches on Subject: below --
2025-02-15  1:02 [PATCH 2/2] drivers: i3c: Add driver for NXP P3H2x4x i3c-hub device kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202502131947.VmPYnXuz-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Frank.Li@nxp.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=aman.kumarpandey@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=priyanka.jain@nxp.com \
    --cc=robh@kernel.org \
    --cc=shashank.rebbapragada@nxp.com \
    --cc=vikash.bansal@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.