Re: [PATCH v4 2/3] ACPI:RAS2: Add ACPI RAS2 driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on linus/master v6.15-rc5]
[cannot apply to rafael-pm/bleeding-edge next-20250506]
[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/shiju-jose-huawei-com/ACPI-ACPI-6-5-RAS2-Rename-RAS2-table-structure-and-field-names/20250424-003740
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link:    https://lore.kernel.org/r/20250423163511.1412-3-shiju.jose%40huawei.com
patch subject: [PATCH v4 2/3] ACPI:RAS2: Add ACPI RAS2 driver
config: riscv-randconfig-r112-20250426 (https://download.01.org/0day-ci/archive/20250507/202505071717.QhRmXFUq-lkp@xxxxxxxxx/config)
compiler: riscv64-linux-gcc (GCC) 8.5.0
reproduce: (https://download.01.org/0day-ci/archive/20250507/202505071717.QhRmXFUq-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505071717.QhRmXFUq-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/acpi/ras2.c:143:61: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct acpi_ras2_shmem *gen_comm_base @@     got struct acpi_ras2_shmem [noderef] __iomem *comm_addr @@
   drivers/acpi/ras2.c:143:61: sparse:     expected struct acpi_ras2_shmem *gen_comm_base
   drivers/acpi/ras2.c:143:61: sparse:     got struct acpi_ras2_shmem [noderef] __iomem *comm_addr
>> drivers/acpi/ras2.c:193:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned short * @@
   drivers/acpi/ras2.c:193:9: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/acpi/ras2.c:193:9: sparse:     got unsigned short *
   drivers/acpi/ras2.c:196:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned short * @@
   drivers/acpi/ras2.c:196:9: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/acpi/ras2.c:196:9: sparse:     got unsigned short *

vim +143 drivers/acpi/ras2.c

   132	
   133	/**
   134	 * ras2_send_pcc_cmd() - Send RAS2 command via PCC channel
   135	 * @ras2_ctx:	pointer to the RAS2 context structure
   136	 * @cmd:	command to send
   137	 *
   138	 * Returns: 0 on success, an error otherwise
   139	 */
   140	int ras2_send_pcc_cmd(struct ras2_mem_ctx *ras2_ctx, u16 cmd)
   141	{
   142		struct ras2_pcc_subspace *pcc_subspace = ras2_ctx->pcc_subspace;
 > 143		struct acpi_ras2_shmem *gen_comm_base = pcc_subspace->comm_addr;
   144		struct mbox_chan *pcc_channel;
   145		unsigned int time_delta;
   146		int rc;
   147	
   148		rc = ras2_check_pcc_chan(pcc_subspace);
   149		if (rc < 0)
   150			return rc;
   151	
   152		pcc_channel = pcc_subspace->pcc_chan->mchan;
   153	
   154		/*
   155		 * Handle the Minimum Request Turnaround Time(MRTT).
   156		 * "The minimum amount of time that OSPM must wait after the completion
   157		 * of a command before issuing the next command, in microseconds."
   158		 */
   159		if (pcc_subspace->pcc_mrtt) {
   160			time_delta = ktime_us_delta(ktime_get(),
   161						    pcc_subspace->last_cmd_cmpl_time);
   162			if (pcc_subspace->pcc_mrtt > time_delta)
   163				udelay(pcc_subspace->pcc_mrtt - time_delta);
   164		}
   165	
   166		/*
   167		 * Handle the non-zero Maximum Periodic Access Rate(MPAR).
   168		 * "The maximum number of periodic requests that the subspace channel can
   169		 * support, reported in commands per minute. 0 indicates no limitation."
   170		 *
   171		 * This parameter should be ideally zero or large enough so that it can
   172		 * handle maximum number of requests that all the cores in the system can
   173		 * collectively generate. If it is not, we will follow the spec and just
   174		 * not send the request to the platform after hitting the MPAR limit in
   175		 * any 60s window.
   176		 */
   177		if (pcc_subspace->pcc_mpar) {
   178			if (pcc_subspace->mpar_count == 0) {
   179				time_delta = ktime_ms_delta(ktime_get(),
   180							    pcc_subspace->last_mpar_reset);
   181				if (time_delta < 60 * MSEC_PER_SEC) {
   182					dev_dbg(ras2_ctx->dev,
   183						"PCC cmd not sent due to MPAR limit");
   184					return -EIO;
   185				}
   186				pcc_subspace->last_mpar_reset = ktime_get();
   187				pcc_subspace->mpar_count = pcc_subspace->pcc_mpar;
   188			}
   189			pcc_subspace->mpar_count--;
   190		}
   191	
   192		/* Write to the shared comm region */
 > 193		writew_relaxed(cmd, &gen_comm_base->command);
   194	
   195		/* Flip CMD COMPLETE bit */
   196		writew_relaxed(0, &gen_comm_base->status);
   197	
   198		/* Ring doorbell */
   199		rc = mbox_send_message(pcc_channel, &cmd);
   200		if (rc < 0) {
   201			dev_warn(ras2_ctx->dev,
   202				 "Err sending PCC mbox message. cmd:%d, rc:%d\n", cmd, rc);
   203			return rc;
   204		}
   205	
   206		/*
   207		 * If Minimum Request Turnaround Time is non-zero, we need
   208		 * to record the completion time of both READ and WRITE
   209		 * command for proper handling of MRTT, so we need to check
   210		 * for pcc_mrtt in addition to CMD_READ.
   211		 */
   212		if (cmd == PCC_CMD_EXEC_RAS2 || pcc_subspace->pcc_mrtt) {
   213			rc = ras2_check_pcc_chan(pcc_subspace);
   214			if (pcc_subspace->pcc_mrtt)
   215				pcc_subspace->last_cmd_cmpl_time = ktime_get();
   216		}
   217	
   218		if (pcc_channel->mbox->txdone_irq)
   219			mbox_chan_txdone(pcc_channel, rc);
   220		else
   221			mbox_client_txdone(pcc_channel, rc);
   222	
   223		return rc >= 0 ? 0 : rc;
   224	}
   225	EXPORT_SYMBOL_GPL(ras2_send_pcc_cmd);
   226	

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




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux