All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC 2/2] i2c: designware: Add AMD PSP I2C bus support
Date: Thu, 23 Dec 2021 01:46:49 +0800	[thread overview]
Message-ID: <202112230116.Z8RNaMCY-lkp@intel.com> (raw)
In-Reply-To: <20211222094558.2098791-3-jsd@semihalf.com>

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

Hi Jan,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on wsa/i2c/for-next]
[also build test WARNING on linux/master rafael-pm/linux-next linus/master v5.16-rc6 next-20211222]
[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/Jan-Dabros/i2c-designware-Add-support-for-AMD-PSP-semaphore/20211222-174729
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: ia64-allyesconfig (https://download.01.org/0day-ci/archive/20211223/202112230116.Z8RNaMCY-lkp(a)intel.com/config)
compiler: ia64-linux-gcc (GCC) 11.2.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
        # https://github.com/0day-ci/linux/commit/d0789fea89a6cfb42f237fd64068a7fbc9c7c283
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jan-Dabros/i2c-designware-Add-support-for-AMD-PSP-semaphore/20211222-174729
        git checkout d0789fea89a6cfb42f237fd64068a7fbc9c7c283
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/i2c/busses/

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-designware-amdpsp.c: In function 'psp_get_mbox_addr':
   drivers/i2c/busses/i2c-designware-amdpsp.c:65:13: error: implicit declaration of function 'rdmsrl_safe' [-Werror=implicit-function-declaration]
      65 |         if (rdmsrl_safe(MSR_AMD_PSP_ADDR, &psp_mmio))
         |             ^~~~~~~~~~~
   drivers/i2c/busses/i2c-designware-amdpsp.c: In function 'psp_wait_cmd':
>> drivers/i2c/busses/i2c-designware-amdpsp.c:98:32: warning: variable 'and_mask' set but not used [-Wunused-but-set-variable]
      98 |         union psp_mbox_cmd_reg and_mask = { .val = ~0 };
         |                                ^~~~~~~~
   In file included from include/linux/printk.h:559,
                    from include/linux/kernel.h:20,
                    from include/linux/kernfs.h:9,
                    from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/of.h:17,
                    from include/linux/irqdomain.h:35,
                    from include/linux/acpi.h:13,
                    from include/linux/i2c.h:13,
                    from drivers/i2c/busses/i2c-designware-amdpsp.c:3:
   drivers/i2c/busses/i2c-designware-amdpsp.c: In function 'psp_send_i2c_req':
>> drivers/i2c/busses/i2c-designware-amdpsp.c:188:46: warning: too many arguments for format [-Wformat-extra-args]
     188 |                         dev_dbg(psp_i2c_dev, "Request accepted by PSP after %ums\n",
         |                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dynamic_debug.h:134:29: note: in definition of macro '__dynamic_func_call'
     134 |                 func(&id, ##__VA_ARGS__);               \
         |                             ^~~~~~~~~~~
   include/linux/dynamic_debug.h:166:9: note: in expansion of macro '_dynamic_func_call'
     166 |         _dynamic_func_call(fmt,__dynamic_dev_dbg,               \
         |         ^~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:155:9: note: in expansion of macro 'dynamic_dev_dbg'
     155 |         dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~~~~~~~
   include/linux/dev_printk.h:155:30: note: in expansion of macro 'dev_fmt'
     155 |         dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                              ^~~~~~~
   drivers/i2c/busses/i2c-designware-amdpsp.c:188:25: note: in expansion of macro 'dev_dbg'
     188 |                         dev_dbg(psp_i2c_dev, "Request accepted by PSP after %ums\n",
         |                         ^~~~~~~
   cc1: some warnings being treated as errors


vim +/and_mask +98 drivers/i2c/busses/i2c-designware-amdpsp.c

    95	
    96	static int psp_wait_cmd(struct psp_mbox *mbox)
    97	{
  > 98		union psp_mbox_cmd_reg and_mask = { .val = ~0 };
    99		union psp_mbox_cmd_reg expected = { .val = 0 };
   100		u32 tmp;
   101	
   102		/* Expect mbox_cmd to be cleared and ready bit to be set by PSP */
   103		and_mask.fields.mbox_cmd = 0;
   104		and_mask.fields.ready = 0;
   105		expected.fields.ready = 1;
   106	
   107		return readl_poll_timeout(&mbox->fields.val, tmp, (tmp == expected.val),
   108					  0, 1000 * PSP_CMD_TIMEOUT_MS);
   109	}
   110	
   111	/* Status equal to 0 means that PSP succeed processing command */
   112	static int psp_check_mbox_sts(struct psp_mbox *mbox)
   113	{
   114		union psp_mbox_cmd_reg cmd_reg = {0};
   115	
   116		cmd_reg.val = readl(&mbox->fields.val);
   117		return cmd_reg.fields.mbox_status;
   118	}
   119	
   120	static int psp_send_cmd(struct psp_i2c_req *req)
   121	{
   122		struct psp_mbox *mbox = (struct psp_mbox *)mbox_iomem;
   123		union psp_mbox_cmd_reg cmd_reg = {0};
   124	
   125		if (psp_check_mbox_recovery(mbox))
   126			return -EIO;
   127	
   128		if (psp_wait_cmd(mbox))
   129			return -EBUSY;
   130	
   131		/* Fill address of command-response buffer */
   132		writeq((uintptr_t)__psp_pa((void *)req), &mbox->i2c_req_addr);
   133	
   134		/* Write command register to trigger processing */
   135		cmd_reg.fields.mbox_cmd = PSP_I2C_REQ_BUS_CMD;
   136		writel(cmd_reg.val, &mbox->fields.val);
   137	
   138		if (psp_wait_cmd(mbox))
   139			return -ETIMEDOUT;
   140	
   141		if (psp_check_mbox_sts(mbox))
   142			return -EIO;
   143	
   144		return 0;
   145	}
   146	
   147	/* Helper to verify status returned by PSP */
   148	static int check_i2c_req_sts(struct psp_i2c_req *req)
   149	{
   150		int status;
   151	
   152		status = readl(&req->hdr.status);
   153	
   154		switch (status) {
   155		case PSP_I2C_REQ_STS_OK:
   156			return 0;
   157		case PSP_I2C_REQ_STS_BUS_BUSY:
   158			return -EBUSY;
   159		case PSP_I2C_REQ_STS_INV_PARAM:
   160		default:
   161			return -EIO;
   162		};
   163	}
   164	
   165	static int psp_send_i2c_req(enum psp_i2c_req_type i2c_req_type)
   166	{
   167		int status, ret, retry_cnt = PSP_I2C_REQ_RETRY_CNT;
   168		struct psp_i2c_req *req;
   169		unsigned long start;
   170	
   171		/* Allocate command-response buffer */
   172		req = kzalloc(sizeof(*req), GFP_KERNEL);
   173		if (!req)
   174			return -ENOMEM;
   175	
   176		req->hdr.total_size = sizeof(*req);
   177		req->type = i2c_req_type;
   178	
   179		start = jiffies;
   180		do {
   181			if (psp_send_cmd(req)) {
   182				ret = -EIO;
   183				goto cleanup;
   184			}
   185	
   186			status = check_i2c_req_sts(req);
   187			if (!status) {
 > 188				dev_dbg(psp_i2c_dev, "Request accepted by PSP after %ums\n",
   189					i2c_req_type, jiffies_to_msecs(jiffies - start));
   190				ret = 0;
   191				goto cleanup;
   192			} else if (status == -EBUSY) {
   193				retry_cnt--;
   194			} else {
   195				ret = -EIO;
   196				goto cleanup;
   197			};
   198	
   199			/* IF EBUSY, give PSP time to finish its i2c activities */
   200			mdelay(PSP_I2C_REQ_RETRY_DELAY_MSEC);
   201		} while (retry_cnt);
   202	
   203	
   204		ret = -ETIMEDOUT;
   205	
   206	cleanup:
   207		kfree(req);
   208		return ret;
   209	}
   210	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

  reply	other threads:[~2021-12-22 17:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22  9:45 [RFC 0/2] i2c-designware: Add support for AMD PSP semaphore Jan Dabros
2021-12-22  9:45 ` [RFC 1/2] i2c: designware: Add missing locks Jan Dabros
2021-12-23 14:29   ` Jarkko Nikula
2021-12-23 15:50   ` Andy Shevchenko
2021-12-27  7:17     ` Jan Dąbroś
2021-12-22  9:45 ` [RFC 2/2] i2c: designware: Add AMD PSP I2C bus support Jan Dabros
2021-12-22 17:46   ` kernel test robot [this message]
2021-12-23  0:26   ` kernel test robot
2021-12-23 14:37   ` Jarkko Nikula
2021-12-27 11:34     ` Jan Dąbroś
2021-12-22 11:46 ` [RFC 0/2] i2c-designware: Add support for AMD PSP semaphore Andy Shevchenko
2021-12-22 17:56   ` Serge Semin
2021-12-22 18:21     ` Andy Shevchenko
2021-12-22 21:51       ` Jan Dąbroś
2021-12-25 15:58 ` Andy Shevchenko
2021-12-27  7:00   ` Jan Dąbroś

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=202112230116.Z8RNaMCY-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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.