Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3768303pxt; Tue, 10 Aug 2021 10:52:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8svV/SfxACIuz/BwcfZ9niU+LjCUAhBVFXu4QG7mCZnhMVTVAfZoKE2MLL82br9Lx1v6s X-Received: by 2002:a92:da07:: with SMTP id z7mr693129ilm.73.1628617962159; Tue, 10 Aug 2021 10:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617962; cv=none; d=google.com; s=arc-20160816; b=Ur5ZvOsfHNSTMMrn8MbL9KhvXf8XNBSVmblFh++H/TWkHO/NVqgTmWkoY7MX7izd++ rk+uU0LQQX9mh3MnpxrG9kgFCyq6LDm9jpXdZUBnxIOj7svws4opdqMhjhirs5hkTGNO 5IAA5gEWYv8gB+f/4rdDqIZaKMv88tMwn/MrTst6cIlIOamc8Kk93RtFSKvDtSxvwgyT z0NI2o/S4VfUZrM1iuYliD8BQMbzaLOBH4oh8iuNSSxVwTMX31KAHaunMLWs0tD7duAg wYPszTswITVoaUXkmP05Hrv2n/uMDvbXjPcFu2LUZ/yfqQCRCgQPA8PSdEws7y7HYszE EumA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FDVLgLVz4KMV+sbdDSL/qKoRYpg0b/6EW+SPRin/ZOM=; b=aqFRGilRlRbhDcDM8F5sBxr+9NCSKO/QhsYQXXTinunjEAhUSwulMP6glJQnTvLqMI lmXWz7wwgnAyBbmolua7ylds8LWOjCMFBenyLCvQE3M6zM8MyZQxkkGjConodSsMmCKZ J2CTsadI9mcX57U3TQtABcgkTp4/HY23/+Xe0DD/xoh3IKqUay3a8WVWhfKoJM464cz+ kJcOtpbpQUWsQNExyVZziCffZq+OU9iScsiEh57D4bP+6Dios+4htoq44D0x6zhVQBOh O8x4IaD8LwIrlmXN8FLUsmzdmMYXeucEnlF8kZr02Csbda5OsQZ6mOElf619kO5gDfuI 14mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=glMeAsAD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m16si12376579jat.17.2021.08.10.10.52.30; Tue, 10 Aug 2021 10:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=glMeAsAD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235620AbhHJRu7 (ORCPT + 99 others); Tue, 10 Aug 2021 13:50:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:57234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235310AbhHJRsC (ORCPT ); Tue, 10 Aug 2021 13:48:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C567B610A3; Tue, 10 Aug 2021 17:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617272; bh=TSSu0j/Y42OwHoJ9tyDjSyyjc/nHSELfyyCW/jHTfD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=glMeAsADqK8ep+4xhQbmiWwIX4zLOpoitWDbCNJ07fxRWSnuAK1bZAz06+eByWCe3 /jjt8bvbadQo+J1sbjYfXj3CIE2xxOjsr+dU7NptWaSEaEv6kEL7lT4rTx7F2jJXsT 7xpTW/pob1KSpCs0BqiGxd+y4wBFNLAKJifDKFdg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Arnd Bergmann Subject: [PATCH 5.10 122/135] soc: ixp4xx/qmgr: fix invalid __iomem access Date: Tue, 10 Aug 2021 19:30:56 +0200 Message-Id: <20210810172959.943307814@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172955.660225700@linuxfoundation.org> References: <20210810172955.660225700@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit a8eee86317f11e97990d755d4615c1c0db203d08 upstream. Sparse reports a compile time warning when dereferencing an __iomem pointer: drivers/soc/ixp4xx/ixp4xx-qmgr.c:149:37: warning: dereference of noderef expression drivers/soc/ixp4xx/ixp4xx-qmgr.c:153:40: warning: dereference of noderef expression drivers/soc/ixp4xx/ixp4xx-qmgr.c:154:40: warning: dereference of noderef expression drivers/soc/ixp4xx/ixp4xx-qmgr.c:174:38: warning: dereference of noderef expression drivers/soc/ixp4xx/ixp4xx-qmgr.c:174:44: warning: dereference of noderef expression Use __raw_readl() here for consistency with the rest of the file. This should really get converted to some proper accessor, as the __raw functions are not meant to be used in drivers, but the driver has used these since the start, so for the moment, let's only fix the warning. Reported-by: kernel test robot Fixes: d4c9e9fc9751 ("IXP42x: Add QMgr support for IXP425 rev. A0 processors.") Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/soc/ixp4xx/ixp4xx-qmgr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/drivers/soc/ixp4xx/ixp4xx-qmgr.c +++ b/drivers/soc/ixp4xx/ixp4xx-qmgr.c @@ -145,12 +145,12 @@ static irqreturn_t qmgr_irq1_a0(int irq, /* ACK - it may clear any bits so don't rely on it */ __raw_writel(0xFFFFFFFF, &qmgr_regs->irqstat[0]); - en_bitmap = qmgr_regs->irqen[0]; + en_bitmap = __raw_readl(&qmgr_regs->irqen[0]); while (en_bitmap) { i = __fls(en_bitmap); /* number of the last "low" queue */ en_bitmap &= ~BIT(i); - src = qmgr_regs->irqsrc[i >> 3]; - stat = qmgr_regs->stat1[i >> 3]; + src = __raw_readl(&qmgr_regs->irqsrc[i >> 3]); + stat = __raw_readl(&qmgr_regs->stat1[i >> 3]); if (src & 4) /* the IRQ condition is inverted */ stat = ~stat; if (stat & BIT(src & 3)) { @@ -170,7 +170,8 @@ static irqreturn_t qmgr_irq2_a0(int irq, /* ACK - it may clear any bits so don't rely on it */ __raw_writel(0xFFFFFFFF, &qmgr_regs->irqstat[1]); - req_bitmap = qmgr_regs->irqen[1] & qmgr_regs->statne_h; + req_bitmap = __raw_readl(&qmgr_regs->irqen[1]) & + __raw_readl(&qmgr_regs->statne_h); while (req_bitmap) { i = __fls(req_bitmap); /* number of the last "high" queue */ req_bitmap &= ~BIT(i);