Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp284662pxx; Thu, 29 Oct 2020 02:31:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzC5vLW6foAQXiJirDKfmrBPfjOJ9OdqcsiQGin3gThCLk3SeZP+iI9gykzSI9hivKQpl+5 X-Received: by 2002:a17:906:2e59:: with SMTP id r25mr3231053eji.520.1603963909660; Thu, 29 Oct 2020 02:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603963909; cv=none; d=google.com; s=arc-20160816; b=mTVF7xRsZcmKSDWF9N/OqnvjneIuNXGycPUu+C0MIWpO8nAKCquiJImbIdZ6faCBEg ydc18l3DCMU/mn9+/7IfUUT+FJpO39e0M9MGwr3ZK1oC3kr36EfLNSybrEbUvZEPVxM1 vGlTJkKGRD/13w15BDhO955R8JR2EhcyiSqVJy9qOLiWh0K9CZoUB37ic9fXOOZ1sih1 ntS/I8OJBD8gpGTleteI0XTr0Yf3/P5rXLFRv8lb6A2pHs+rwrxTwzlVCs6jB5+thEPz R+NdbcAixKxGpFot3E2MBMVVFmRQy9d+SX+hPoH27LZsdonw4gNCCgrfL9E416cKSNWM p4nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=FRXU2ioi3q3LYrXlpd7g9dmJ9xtnso+7A/POHwolFwU=; b=uINi4Ev7Who5y6RCHunsEpfJnkJp5qX4mN80TRYuSfGVz9cAMhYtum5s3eFvWl2KN8 7IXG+CrsEp9649UyYtEzSEnLqJgd8W8pqzc5VG8PB3HLY1/3X+t0xR64rQmO6wxplQ1i XrKd75/ZSuG/VVN8JhalE1WvCNxjcHGxiocn3qvpOeMqJHKa2VvIcqK+iYCNOptfjN7U p9D7owIicg+BlIvDnOFjPsocO+wN3Q/cj4L1MB9Xb/jewTdCD7XX6sg+/MGSAWcqZNkX RJIgh5ouXr2xyvgfSXRR2c8xYpKASMkeoEvK1dRURO3+fmu20WC59kJBdbH0Jx0fJXTj alzA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb6si1550886edb.533.2020.10.29.02.31.26; Thu, 29 Oct 2020 02:31:49 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726185AbgJ2JaE (ORCPT + 99 others); Thu, 29 Oct 2020 05:30:04 -0400 Received: from mga12.intel.com ([192.55.52.136]:64315 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbgJ2JaC (ORCPT ); Thu, 29 Oct 2020 05:30:02 -0400 IronPort-SDR: j3Ndt9KB/yDQyh9z3sdeGyLTz3YAvpsZwYqhTnpW9ArY7oaHFZrqR+4B7t2Oe3XWqWbg832OaQ B0WQyKOmOWZg== X-IronPort-AV: E=McAfee;i="6000,8403,9788"; a="147685399" X-IronPort-AV: E=Sophos;i="5.77,429,1596524400"; d="scan'208";a="147685399" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2020 02:30:02 -0700 IronPort-SDR: 9oMmPxJXPcUFT7rZNSb9AZfddF6HpV8s3RhFRzTKzoNHY2ikDC5AYif1R0PrcA7xx3FCUthsSV Ude9/FVyp/bg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,429,1596524400"; d="scan'208";a="424996821" Received: from glass.png.intel.com ([172.30.181.98]) by fmsmga001.fm.intel.com with ESMTP; 29 Oct 2020 02:29:59 -0700 From: Wong Vee Khee To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Maxime Coquelin Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ong Boon Leong , Voon Wei Feng , Wong Vee Khee Subject: [PATCH net 1/1] stmmac: intel: Fix kernel panic on pci probe Date: Thu, 29 Oct 2020 17:32:28 +0800 Message-Id: <20201029093228.1741-1-vee.khee.wong@intel.com> X-Mailer: git-send-email 2.17.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit "stmmac: intel: Adding ref clock 1us tic for LPI cntr" introduced a regression which leads to the kernel panic duing loading of the dwmac_intel module. Move the code block after pci resources is obtained. Fixes: b4c5f83ae3f3 ("stmmac: intel: Adding ref clock 1us tic for LPI cntr") Cc: Voon Weifeng Signed-off-by: Wong Vee Khee --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index b6e5e3e36b63..81ee0a071b4e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -625,13 +625,6 @@ static int intel_eth_pci_probe(struct pci_dev *pdev, if (ret) return ret; - if (plat->eee_usecs_rate > 0) { - u32 tx_lpi_usec; - - tx_lpi_usec = (plat->eee_usecs_rate / 1000000) - 1; - writel(tx_lpi_usec, res.addr + GMAC_1US_TIC_COUNTER); - } - ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); if (ret < 0) return ret; @@ -641,6 +634,13 @@ static int intel_eth_pci_probe(struct pci_dev *pdev, res.wol_irq = pci_irq_vector(pdev, 0); res.irq = pci_irq_vector(pdev, 0); + if (plat->eee_usecs_rate > 0) { + u32 tx_lpi_usec; + + tx_lpi_usec = (plat->eee_usecs_rate / 1000000) - 1; + writel(tx_lpi_usec, res.addr + GMAC_1US_TIC_COUNTER); + } + ret = stmmac_dvr_probe(&pdev->dev, plat, &res); if (ret) { pci_free_irq_vectors(pdev); -- 2.17.0