From patchwork Tue Aug 10 17:31:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 494373 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp4198828jap; Tue, 10 Aug 2021 11:05:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIZwhFiRRUA+3aj9V+MF4kG5pzvtW/klSn9nP7vzDEjr4M0SwQAvej6Bsabj1qN+8e7gOj X-Received: by 2002:a7b:c40e:: with SMTP id k14mr6037389wmi.46.1628618741023; Tue, 10 Aug 2021 11:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628618741; cv=none; d=google.com; s=arc-20160816; b=jAbuHKu6wh7ABivw9GbbFgdpK04s+a/jq9e4A4A2ecBlI/WRHythiFPzC0FWCVmDnf Xrk7A7B7LI4vDilSvDuvp2YY9MpcCEZU041uZoWjpCMSJ+xd+yNH8GVov6Koc0eEpG3r MwnlBe710QP9d9vsWENUAMgO0NXao5ZkpxqL0hhQxoeYGCmS3X5Z2wiFZ6NWJznKXOuM 6vHQuuSTGEdHMuWnLWTNp+lHBu2q5Q4yjQ125nkkkQ/bksstF5Yflahedbn7Wh3NciWb GWmJf5tbD5b5lnBkjR2epw10D/WktfmCUuESh/WWyjNHeE4On/AIaf52b38xOFiWs6nO pEqw== 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=e4xHHdYVKGfl4zbMOwXGOw3IzTvxn429eTQdmKMHLY/muTQDxdeDQV7wh8N7PItJeq MYCd2mqr2t4zYSguHWcvZdQLeBvXmejf+qljpk5/2kGW9+qXT+4CvAqXw0e+/YwJtTu2 mSAFFRFOV54ZtetZvKp73pwKeTQ/cjEUAGKWXOI4FEap7DVnguepKWtsJs8hYES4yFEQ xO1gri0yEKehcVoKskV6zZvZNgslebRl/2WOmojb752SF1CIPJ7vOuRi00gGr+GEHuyW WV3EY+D8XRPrTq/HwdLzUUqSF3rlx9u7e1UCQfRsPGPjIyFF/mqDu7e59+ZovLWbVLfq hJLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ae1G4KiM; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 p18si407484ejg.598.2021.08.10.11.05.40; Tue, 10 Aug 2021 11:05:41 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=ae1G4KiM; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S235964AbhHJSFn (ORCPT + 12 others); Tue, 10 Aug 2021 14:05:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:37208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236957AbhHJSDb (ORCPT ); Tue, 10 Aug 2021 14:03:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BDA676124F; Tue, 10 Aug 2021 17:47:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617671; bh=TSSu0j/Y42OwHoJ9tyDjSyyjc/nHSELfyyCW/jHTfD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ae1G4KiMuFHwIW59nbIVYjUxPU7dzHo/pk/oIWssqqElppRh9CvoJDxlyRkAVgexD H0XjzOVPohMiq035MKYjOOtlOFlp55hcjwZ7OiOq+uY7b7pShfQo3LEMXJRr8NHl20 ydVLTHzr/pQYfqk0Zjw0KdHzIgPQv3EiOKaoQnGM= 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.13 161/175] soc: ixp4xx/qmgr: fix invalid __iomem access Date: Tue, 10 Aug 2021 19:31:09 +0200 Message-Id: <20210810173006.264923245@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810173000.928681411@linuxfoundation.org> References: <20210810173000.928681411@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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);