From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94901C433F5 for ; Wed, 16 Feb 2022 14:06:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EAF956B0073; Wed, 16 Feb 2022 09:06:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E5E646B0074; Wed, 16 Feb 2022 09:06:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D26D46B0078; Wed, 16 Feb 2022 09:06:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C34FA6B0073 for ; Wed, 16 Feb 2022 09:06:31 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7D9508249980 for ; Wed, 16 Feb 2022 14:06:31 +0000 (UTC) X-FDA: 79148818182.23.6B14C81 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by imf13.hostedemail.com (Postfix) with ESMTP id 2C1942000E for ; Wed, 16 Feb 2022 14:06:31 +0000 (UTC) Received: by mail-pg1-f178.google.com with SMTP id 132so2253381pga.5 for ; Wed, 16 Feb 2022 06:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=yNMzz6xA//GNRfosQx85MNQuxZc/c6bExSux6+yw2vY=; b=ah/QdQAhvJOJBNPrgCiV/2Sle0w/XFMwQEoYb+u7/1C/blF7zmNCY088VGZaEqaFCJ j5iLKh2eUI4NcpFfGcD8VUPldS+SD8MTFusncjO7mJbJrnGxgUSxTgx+H7V8CtAzx2yz sBQVwdo/TgNkaGsSS1g9550V8+shhYF81zrMCS4Gu7uMxFvysH8KpvHLDovkSdrS09Wt lZme6nMUToX9aUvnqV5ub2V4LfM/8amxlZKfQUhHwnD1p804HEg9CfNdmg9MLzkG0zIe IMYS6L98XOZLK4WYZDmR7F3yRZTxmS1b1jvKjq2ee4KIgGjy+aVKa+Pj+YxF3oktXH4t 9jPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=yNMzz6xA//GNRfosQx85MNQuxZc/c6bExSux6+yw2vY=; b=xdOxvmmF+kE6ufx5px/iY1KaqWp5GctsGias2cIGR/hDDe0clDAR8wfuDg22f6dj2t 4aL3n7heawi673AgCFn8osbHgyjWG/o48/Pos58rgjAWEIIE/9jJzYtRId+muQVIfatj wEil6BUCpZKYglmCxWobDlTVCqYD+prdyH0zY7rkRe4Edikx79VcRyJnB/z2kkitL21k YWW17dZ/ggPH5yyWv5hN5c/yhM2sBojTEkSGasppdGmbt4+0rSDpPAvCUG87tcLbWK/r 4OFwqtwbUcfgld01Wp9CfXdrRAqiOzNOQJqp2mgts5fclyM/D72dUofQWaiqLOYQ30Dp lgBw== X-Gm-Message-State: AOAM532SffByoFy1QqD3Atd2luDNOq+h7WXssQ6Swg4nRlBTGRJGNIvX y3JrgW64CUfJi7Mk+Xvp9XUK3LWwyQWsZclXSlt9Rw== X-Google-Smtp-Source: ABdhPJx9B9EJ11tBk8t+k3LyhQyG+WYJ5Df7WE4n3bzPdb4L3xF9NglB+r42Pf0vjF94I6c/gvk0t/hs8UTlwOSc6aU= X-Received: by 2002:a63:e50c:0:b0:363:96b8:4334 with SMTP id r12-20020a63e50c000000b0036396b84334mr2475487pgh.18.1645020390007; Wed, 16 Feb 2022 06:06:30 -0800 (PST) MIME-Version: 1.0 References: <202202120520.NbWJGvF2-lkp@intel.com> In-Reply-To: From: =?UTF-8?B?SmFuIETEhWJyb8Wb?= Date: Wed, 16 Feb 2022 15:06:19 +0100 Message-ID: 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) To: Andy Shevchenko Cc: kernel test robot , kbuild-all@lists.01.org, Linux Memory Management List , Wolfram Sang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: upzbtdcqbmpaf9dm1ocj4mhekzomdbc6 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2C1942000E Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=semihalf-com.20210112.gappssmtp.com header.s=20210112 header.b="ah/QdQAh"; dmarc=none; spf=none (imf13.hostedemail.com: domain of jsd@semihalf.com has no SPF policy when checking 209.85.215.178) smtp.mailfrom=jsd@semihalf.com X-Rspam-User: X-HE-Tag: 1645020391-414214 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: pon., 14 lut 2022 o 15:44 Andy Shevchenko napisa=C5=82(a): > > On Mon, Feb 14, 2022 at 02:59:34PM +0100, Jan D=C4=85bro=C5=9B wrote: > > pon., 14 lut 2022 o 14:28 Andy Shevchenko > > napisa=C5=82(a): > > > > > > On Mon, Feb 14, 2022 at 01:27:35PM +0100, Jan D=C4=85bro=C5=9B wrote: > > > > pt., 11 lut 2022 o 22:24 kernel test robot napisa= =C5=82(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 =3D 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 nee= d. > > > Is this a system memory? > > > > Yes, this is system memory. > > > > Actually looking at asm-generic/rwonce.h: > > #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&= (x)) > > it is more-less based on volatile, so that compiler will not be able > > to (among others) optimize out such reads of memory which may be > > changed outside of the scope of "program". > > > > I believe that I will get the same outcome from using READ_ONCE and > > explicit volatile, is the first way preferred in the kernel? > > READ_ONCE() may be different on different arches. I believe that's why > it's preferred. OK, I see. Let me send a commit with this change this week. Best Regards, Jan > > -- > With Best Regards, > Andy Shevchenko > >