All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [linux-next:master 4897/5417] drivers/i2c/busses/i2c-designware-amdpsp.c:165:25: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Mon, 14 Feb 2022 15:27:40 +0200	[thread overview]
Message-ID: <YgpYzKGJArF1ci5o@smile.fi.intel.com> (raw)
In-Reply-To: <CAOtMz3OF_c=OYY5y6Hame+RuLx0Rj68mdmM7V5xSHuboWqT-1Q@mail.gmail.com>

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

On Mon, Feb 14, 2022 at 01:27:35PM +0100, Jan Dąbroś wrote:
> pt., 11 lut 2022 o 22:24 kernel test robot <lkp@intel.com> napisał(a):

> >    159
> >    160  /* Helper to verify status returned by PSP */
> >    161  static int check_i2c_req_sts(struct psp_i2c_req *req)
> >    162  {
> >    163          int status;
> >    164
> >  > 165          status = readl(&req->hdr.status);
> 
> Actually the above error points to something hidden but important -
> for reading from command-response buffer, we shouldn't use __iomem
> specifier (nor readl() family of functions) since this is normal
> memory - however updated by PSP. Thus I will refactor this to use
> 'volatile u32 *' and reading status by de-referencing pointer.

Not sure volatile is a good idea. Perhaps READ_ONCE() is what you need.
Is this a system memory?

-- 
With Best Regards,
Andy Shevchenko


WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Jan Dąbroś" <jsd@semihalf.com>
Cc: kernel test robot <lkp@intel.com>,
	kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Wolfram Sang <wsa-dev@sang-engineering.com>
Subject: Re: [linux-next:master 4897/5417] drivers/i2c/busses/i2c-designware-amdpsp.c:165:25: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Mon, 14 Feb 2022 15:27:40 +0200	[thread overview]
Message-ID: <YgpYzKGJArF1ci5o@smile.fi.intel.com> (raw)
In-Reply-To: <CAOtMz3OF_c=OYY5y6Hame+RuLx0Rj68mdmM7V5xSHuboWqT-1Q@mail.gmail.com>

On Mon, Feb 14, 2022 at 01:27:35PM +0100, Jan Dąbroś wrote:
> pt., 11 lut 2022 o 22:24 kernel test robot <lkp@intel.com> napisał(a):

> >    159
> >    160  /* Helper to verify status returned by PSP */
> >    161  static int check_i2c_req_sts(struct psp_i2c_req *req)
> >    162  {
> >    163          int status;
> >    164
> >  > 165          status = readl(&req->hdr.status);
> 
> Actually the above error points to something hidden but important -
> for reading from command-response buffer, we shouldn't use __iomem
> specifier (nor readl() family of functions) since this is normal
> memory - however updated by PSP. Thus I will refactor this to use
> 'volatile u32 *' and reading status by de-referencing pointer.

Not sure volatile is a good idea. Perhaps READ_ONCE() is what you need.
Is this a system memory?

-- 
With Best Regards,
Andy Shevchenko




  reply	other threads:[~2022-02-14 13:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 21:24 [linux-next:master 4897/5417] drivers/i2c/busses/i2c-designware-amdpsp.c:165:25: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
2022-02-11 21:24 ` kernel test robot
2022-02-14 12:27 ` Jan Dąbroś
2022-02-14 12:27   ` Jan Dąbroś
2022-02-14 13:27   ` Andy Shevchenko [this message]
2022-02-14 13:27     ` Andy Shevchenko
2022-02-14 13:59     ` Jan Dąbroś
2022-02-14 13:59       ` Jan Dąbroś
2022-02-14 14:43       ` Andy Shevchenko
2022-02-14 14:43         ` Andy Shevchenko
2022-02-16 14:06         ` Jan Dąbroś
2022-02-16 14:06           ` 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=YgpYzKGJArF1ci5o@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.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.