From patchwork Mon Nov 22 19:04:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12693359 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00958C433F5 for ; Mon, 22 Nov 2021 19:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6EHjfprNpl9eJTXix78WIWopmcp6aKgvKZIapIcBLw0=; b=ZQUcESfeNhbFXz sJ9WdV3GQRsunZB1ZYqIRQTiARfNw09uvgbxTxRnaO2Cv2o0Idvm3mxWvumjagBNH1zhuTUGDYEji Bsfheorwpu8Yfo5SKAO09Gvg0V38knyhwCVJ2DU+6fNElVNexnuu9/zlFLauhkv+C7+AIYS3479Ea fqAEq22qoZx8p/xX5Sjovxh4I6qu5O0dfDPkfdrO15S2KzcN+qm3krBUphdMrs+CsF54/lTcQkuf2 2JhRqnGvQ9Y182nKCq/owqvEvyf27qJqL8GJqOmyzvkOoc8nF6AWBjcQgLFDAamRDBV5u1fC9pp3K SCTZHISGMhKh2VinIXiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpEcu-00HS4H-N6; Mon, 22 Nov 2021 19:05:16 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpEcr-00HS3O-EM; Mon, 22 Nov 2021 19:05:14 +0000 Received: by mail-pj1-x1030.google.com with SMTP id fv9-20020a17090b0e8900b001a6a5ab1392so721721pjb.1; Mon, 22 Nov 2021 11:05:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wsUPjYRSa+cVuPmeOccQvohC2mlPhYpnjuTt833pevA=; b=Bnfiah7sQM+j87SrG5I0wv4eVF/apTdvxarka+1o/gH06RgU1VCS5bsrY9Q/3Zz7W9 8mxflCCb7v9jxD1WFro+THrRF1kGecSk2OSFh/C1SlAGIQLSYKU+cEswL935s2gT9lmR 2INaE/xUBS36dh7UjWUmqW96bdr2qL4l1xQ6OhC1E0V2oczo1vTFXny0YFbowiLHmfmv GzDATb7Q2/UbAyo+8bfsgWGbe4kd2YtRXU4Hhe8/ppZcIrhI/5FsIGls7iUmLiQPgJEf pA+oNflZP1OpMvg8r0c3wzEDkZtYiQ6eGDusiHYh+5K7gnfPFO5ewyhsTSk5+vHlH3UQ 3q0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wsUPjYRSa+cVuPmeOccQvohC2mlPhYpnjuTt833pevA=; b=mgkvApss2paM7V8Z7f2c5ILHo+Edvh4tH+HkqMqbTCkNszcl9vyaJ5vSJeatDKEoeD KbpuZ5LPTcfeoeo9xdU8vFOo+RwW0Y0QnZQdNfM3585X/GLXJ7mvCL74qAMGZtDfcMxa jjP/QYXMqAXVW/VgSecVCnKVr7U3Dbzq6YrPKBqvvUC0us1NEEaAh9c+hJ7CvjxTFtK6 7YPSvxoxDz7WpfyCKNuifdRiybzXZlbkxkSFLCTD6hcMpPJr8tbipCdDqlNJpUVhdlrC WMftxL4ZVHfMkGuG8/URgZxM798fJD3pIbFIwtZAba9fAnHlGsZOjRObezI4CP1qr9I6 F9ag== X-Gm-Message-State: AOAM5327/RMiJ1/e4VKG8df4QY44I9XJdXmUQf1WZjj3wf8u3K4iolTy XZ7ejlciTKLVrvzXxUpGJ6Q= X-Google-Smtp-Source: ABdhPJwQrX5J8WhPnfYU+bmzPaJ4iDA3831y0oX5B3bNlEZ5LDf0g4YYefDfo8BqsuVItfG4Ijjxiw== X-Received: by 2002:a17:90b:1d0b:: with SMTP id on11mr33223962pjb.163.1637607910934; Mon, 22 Nov 2021 11:05:10 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id q32sm8127059pja.4.2021.11.22.11.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Nov 2021 11:05:10 -0800 (PST) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Andy Shevchenko , Nicolas Saenz Julienne , Jim Quinlan , bcm-kernel-feedback-list@broadcom.com (maintainer:BROADCOM STB PCIE DRIVER), Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-pci@vger.kernel.org (open list:BROADCOM STB PCIE DRIVER) Subject: [PATCH] PCI: brcmstb: Do not use __GENMASK Date: Mon, 22 Nov 2021 11:04:58 -0800 Message-Id: <20211122190459.3189616-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211122_110513_509667_777E8E60 X-CRM114-Status: UNSURE ( 9.85 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Define the legacy MSI intterupt bitmask as well as the non-legacy interrupt bitmask using GENMASK and then use them in brcm_msi_set_regs() in place of __GENMASK(). Reported-by: Andy Shevchenko Signed-off-by: Florian Fainelli Reviewed-by: Andy Shevchenko --- drivers/pci/controller/pcie-brcmstb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 1fc7bd49a7ad..3391b4135b65 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -144,6 +144,9 @@ #define BRCM_INT_PCI_MSI_NR 32 #define BRCM_INT_PCI_MSI_LEGACY_NR 8 #define BRCM_INT_PCI_MSI_SHIFT 0 +#define BRCM_INT_PCI_MSI_MASK GENMASK(BRCM_INT_PCI_MSI_NR - 1, 0) +#define BRCM_INT_PCI_MSI_LEGACY_MASK GENMASK(31, \ + 32 - BRCM_INT_PCI_MSI_LEGACY_NR) /* MSI target addresses */ #define BRCM_MSI_TARGET_ADDR_LT_4GB 0x0fffffffcULL @@ -619,7 +622,8 @@ static void brcm_msi_remove(struct brcm_pcie *pcie) static void brcm_msi_set_regs(struct brcm_msi *msi) { - u32 val = __GENMASK(31, msi->legacy_shift); + u32 val = msi->legacy ? BRCM_INT_PCI_MSI_LEGACY_MASK : + BRCM_INT_PCI_MSI_MASK; writel(val, msi->intr_base + MSI_INT_MASK_CLR); writel(val, msi->intr_base + MSI_INT_CLR);