Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3761525pxt; Tue, 10 Aug 2021 10:42:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9J1Ke7mji/VpguT0xw0mOlSWBbheDP14OSfzEXz6V22u0YlPODNsJePvXFru11dytLn05 X-Received: by 2002:a50:d6db:: with SMTP id l27mr6306454edj.309.1628617358898; Tue, 10 Aug 2021 10:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617358; cv=none; d=google.com; s=arc-20160816; b=PgomJZE28JxPyjItGLgdddqL01lrOAJ+Ag4OcDyJDyp7+DA553q2eri8zE1PDb8yOl +o/JKFFKhZYqqYimsd6GHiLvQHCZ4TG/KuGJ9B9LIoZFqF6FY/txOR9XZ7EazKpcgG0s YnrdJF6bxGezrwVYKICRVU1Ypq3TH/AppZL1nhoQdn6vV34WecZTNkfA5M5t7EHUArfc kWATtdr59i1F5PB8XpsjjWlXQ+z3uHWITeJGvdGSCKk+McyYY8pjjhhJQFrl47etBkTZ zFBLGaZOMcLNJJlMN2Az7FTNQqqjma+oMmb10tQ11Vf/bl8ym82Ee1g8KAVVAUDm+T4i xmvQ== 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=eHGkP9WIGl2iyCiNU/iVvHdqnRzxREXfZlVLDj0Zy54EokPSVpk9sZNhyC8BPY8Uov Mnr1I1CSYvyRD8x/Wpg356m0ugDuAH3L/8vaByf8R8Sm5zvljAtgsWkO9402ABYIlP3y FSLAjM3uHQIbSecMnXuhL6Y1dsBZ1kD8CzwO//Te0FHsvIMHrBric0yrDhL+7sKu/g0R cGUDtou+i+DZW7RPT45gHdHM/1zrWiJSdsbL2W8G1RPVT9yatN58WHP3YR9GMYCCm8q+ UIGnfUF/dgsluQRHMrZEadextfl1BGFKdpKdfrWYOrjslK/caFwUg6PWLmymrcDnMHMu bA5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n5R+L0qy; 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 ne42si1059501ejc.633.2021.08.10.10.42.15; Tue, 10 Aug 2021 10:42:38 -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=n5R+L0qy; 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 S233723AbhHJRlO (ORCPT + 99 others); Tue, 10 Aug 2021 13:41:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:38896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234729AbhHJRhx (ORCPT ); Tue, 10 Aug 2021 13:37:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4DB6C61186; Tue, 10 Aug 2021 17:36:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616977; bh=TSSu0j/Y42OwHoJ9tyDjSyyjc/nHSELfyyCW/jHTfD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n5R+L0qyuV9qmk3bVesa323DiyN3qCOYSLfbri6uh5ZYTb0XqTKzD9kZxInodzkaD 5c2BFr417KzpRQqvDwNjigihC/0ZUwvAIciTNC2KV6ZccqS2CY80K39SmE8WHupNQZ 1bTTfoRbMsiKsOmkjTD8FNZbjCAqfu5e/FymSsZs= 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.4 76/85] soc: ixp4xx/qmgr: fix invalid __iomem access Date: Tue, 10 Aug 2021 19:30:49 +0200 Message-Id: <20210810172950.803063610@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172948.192298392@linuxfoundation.org> References: <20210810172948.192298392@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);