From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id CBAB81BF3DB for ; Sun, 4 Nov 2018 10:50:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id AE76B87E2D for ; Sun, 4 Nov 2018 10:50:30 +0000 (UTC) Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fj+W8ywbs6c0 for ; Sun, 4 Nov 2018 10:50:30 +0000 (UTC) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by hemlock.osuosl.org (Postfix) with ESMTPS id 0058187E0D for ; Sun, 4 Nov 2018 10:50:28 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id i17-v6so6296713wre.7 for ; Sun, 04 Nov 2018 02:50:28 -0800 (PST) From: Sergio Paracuellos Subject: [PATCH v6 30/33] staging: mt7621-pci: enable interrupt when port is being enabled Date: Sun, 4 Nov 2018 11:49:56 +0100 Message-Id: <1541328599-18396-31-git-send-email-sergio.paracuellos@gmail.com> In-Reply-To: <1541328599-18396-1-git-send-email-sergio.paracuellos@gmail.com> References: <1541328599-18396-1-git-send-email-sergio.paracuellos@gmail.com> List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: gregkh@linuxfoundation.org Cc: neil@brown.name, driverdev-devel@linuxdriverproject.org Interrupt is being enabled in port initialization when the port phy has not been initialized yet. Just enable the interrupt when the port is being enabled which is a more accurate place for this. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index 8b7c63d..5f7ff70 100644 --- a/drivers/staging/mt7621-pci/pci-mt7621.c +++ b/drivers/staging/mt7621-pci/pci-mt7621.c @@ -601,10 +601,6 @@ static int mt7621_pcie_init_port(struct mt7621_pcie_port *port) port->enabled = false; } else { port->enabled = true; - /* enable pcie interrupt */ - val = pcie_read(pcie, RALINK_PCI_PCIMSK_ADDR); - val |= PCIE_PORT_INT_EN(slot); - pcie_write(pcie, val, RALINK_PCI_PCIMSK_ADDR); } mt7621_enable_phy(port); @@ -667,6 +663,11 @@ static void mt7621_pcie_enable_ports(struct mt7621_pcie *pcie) continue; } + /* enable pcie interrupt */ + val = pcie_read(pcie, RALINK_PCI_PCIMSK_ADDR); + val |= PCIE_PORT_INT_EN(slot); + pcie_write(pcie, val, RALINK_PCI_PCIMSK_ADDR); + /* map 2G DDR region */ pcie_write(pcie, PCIE_BAR_MAP_MAX | PCIE_BAR_ENABLE, offset + RALINK_PCI_BAR0SETUP_ADDR); -- 2.7.4 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel