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 DE121C433EF for ; Mon, 14 Feb 2022 13:59:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF8576B0071; Mon, 14 Feb 2022 08:59:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DA7316B007B; Mon, 14 Feb 2022 08:59:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C6E966B007D; Mon, 14 Feb 2022 08:59:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id B3EDD6B0071 for ; Mon, 14 Feb 2022 08:59:47 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6E07C59DA for ; Mon, 14 Feb 2022 13:59:47 +0000 (UTC) X-FDA: 79141543614.27.492BFD4 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by imf06.hostedemail.com (Postfix) with ESMTP id CBE54180005 for ; Mon, 14 Feb 2022 13:59:46 +0000 (UTC) Received: by mail-pl1-f181.google.com with SMTP id w1so10588968plb.6 for ; Mon, 14 Feb 2022 05:59:46 -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=zBxkx8dublLjQSAGwZhXL0kFjoMhXGYa7nl8mC/lWt0=; b=XZg3FWMKLEULRxUA6KKl2JHQRowB6GUggbB9RJWRMDtx288srSLZwzEUXto2NqN2Ux Sl4i2qTvDVtkLOGGu7oEui5h+Th9xfzHP6a3p73WdGZQUJGa5B5mro9QVrk13uDL11Lz JagvbQ6lJpEaMo3U+bmpS+9hnVB3a44dxrrOVarKteXjJafSnsbSewbFia7Hrfd18apV fbEr0opHPRs4Ac2jViU5Rr9EL3/4EoIYcI/U1ywaFs2hhO5UX91i9AxFLCfQCdJGgfJn fz3wTYNgJGXa9ArsCqM9xhaegYUvmOmHnwwYV+3mGht84Cpvyii0SBM/wvkjohkHgx7T B+Yw== 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=zBxkx8dublLjQSAGwZhXL0kFjoMhXGYa7nl8mC/lWt0=; b=TmlQr6m2ihDuP1PYRbRhCfjKRK5+MBw3CBzGuVMru69d2JP3ldES4ZQtOjGChuY584 Jza3eW0ksiC872whfybZCACXuNuUDJ/NaojzsZuKnJAM9j8ccKq4pOGaCro4FOjKdjRL /aqIAUV7pghFSC7GabmgT6nOqUdiYzdKAqvOvmcrlWy10Cqp3c/YW/ovOHCkGFSs12jG QLII2yVKFSp7mAOy9mbmp/4YXEirWkxxkTWgD8/qFXxz383G9pQJQeCU2PVvNZRUSob7 2WLbGWcljxhOjiVxrcgLRVcICddzOrKuz2xhWWHBobQFf5ApLqO4KHWZRozs3k1ZZ/Ro 4d+g== X-Gm-Message-State: AOAM530bC8auzYYGl4BEMeh6bnWywnxz4z0ygeJwHnETdI75JtniVPVh w/q0jwAnFGZaLadPWKldyeSBs55iSwDPk+gCpDMv9Q== X-Google-Smtp-Source: ABdhPJzL25vTdhq1eQTcQBvuOGt2/n/RWDKigxvQzjNvVI98O4ubZathPTmOhnydkYjwNA4GckeAyY4pXuG3xQh+z6A= X-Received: by 2002:a17:90a:1944:: with SMTP id 4mr6237317pjh.4.1644847185691; Mon, 14 Feb 2022 05:59:45 -0800 (PST) MIME-Version: 1.0 References: <202202120520.NbWJGvF2-lkp@intel.com> In-Reply-To: From: =?UTF-8?B?SmFuIETEhWJyb8Wb?= Date: Mon, 14 Feb 2022 14:59:34 +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 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=semihalf-com.20210112.gappssmtp.com header.s=20210112 header.b=XZg3FWMK; dmarc=none; spf=none (imf06.hostedemail.com: domain of jsd@semihalf.com has no SPF policy when checking 209.85.214.181) smtp.mailfrom=jsd@semihalf.com X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: CBE54180005 X-Stat-Signature: un7kc84gnpzbjbtix37o17gtn1a36qkm X-HE-Tag: 1644847186-991455 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 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 need. > 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? Best Regards, Jan