Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1259376pxb; Fri, 22 Jan 2021 10:47:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJywyloy0GKHq/CxHnLTmJ3qJE4wOzOZJ9KBjk92K5S6CAFNqjz4MExikQOZc4PE3JPc2z3u X-Received: by 2002:aa7:ca55:: with SMTP id j21mr810493edt.172.1611341276469; Fri, 22 Jan 2021 10:47:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611341276; cv=none; d=google.com; s=arc-20160816; b=aPWyxqteSinGNBTDDewN/uPZlMYJ1jar+vi3V5hO2oTE43fCf9tWtAntQzuUInJsV+ J9qslOhl+j4xYACbJ1fTlcHs5Nh4qUo96QCiIqB+DeObgKZgbOECHomsyec5QwGisqiJ XELmELNrgaTje6n6LjmmMr5MtMenKpZLvOkI0e+A9ujNgbJvHotDw5OsAkMT5hirLG8g GElds7aAGHfQis2A7LJ0lPaCVkmtPj6l6218ki+0i/ZrHfpjcud4AMlRoPV+IOMDIxW8 wnEl5R72VXgUEQSA98XxH/GRWmL7XhFLslY7DzGqfHu6SOTw/hcKIkfCrps0W4IYHQcY iL6g== 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=RhdP8W62ZB1GkjPkw+ov7iqEJgPhlCaqtfmuPaJW864=; b=OK/Tr51MCfc2H+WpflYIu9V5MZLdAsOkKqlX58X1+Jcwf89UMohNE8MydudClMSKIc L3n5DknztB07YpUwYEfp/BX0EPBmYyhVLh0AYMJ1FFYanKuDE2wEBtBw2q7XCaNcl0Sv R5fr0gkrrb0yJzQvlDawGTKI22YjVQndDD0EDF5exfASlvuYdZhxDnuIIaT0rMADUNJ+ jWH+vYz/3x5ybuBSFR0Wr14FUP5A7s2a3eSD9vb3itM8SyvkIkzInS2ZCRyIz8cfhB/W 3aOdUG4q6Pof2x67Cjq5Z16KKWo86b80uudleiFfJfEb74H0y4XC5pj/2nay8xVyvAlF /Z1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HVaBfmkb; 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 hr35si3263223ejc.274.2021.01.22.10.47.30; Fri, 22 Jan 2021 10:47:56 -0800 (PST) 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=HVaBfmkb; 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 S1729097AbhAVSq6 (ORCPT + 99 others); Fri, 22 Jan 2021 13:46:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:40006 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728315AbhAVOWy (ORCPT ); Fri, 22 Jan 2021 09:22:54 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B07E723AAA; Fri, 22 Jan 2021 14:16:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1611325003; bh=BDBwdx4A9Le1xM2NMbXCJbK10ocruVqk176hAUfzWBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HVaBfmkb7ERbgty7P13RILROx2lPhslFgFx5t1BxdZXAHaiKW8cnMQWeHM6n+MpJn jO/uh5dp0HRo7Ep/T7le29ueqQ/k/FIOJVVMgHlKcIc2CIQR9bcekA1PcJkvW00NzN iY4RQCToCv2vn+yK9GfkDuoebuF31rxP8AWPGxjw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manish Chopra , Igor Russkikh , Jakub Kicinski Subject: [PATCH 5.4 13/33] netxen_nic: fix MSI/MSI-x interrupts Date: Fri, 22 Jan 2021 15:12:29 +0100 Message-Id: <20210122135734.114133937@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210122135733.565501039@linuxfoundation.org> References: <20210122135733.565501039@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: Manish Chopra [ Upstream commit a2bc221b972db91e4be1970e776e98f16aa87904 ] For all PCI functions on the netxen_nic adapter, interrupt mode (INTx or MSI) configuration is dependent on what has been configured by the PCI function zero in the shared interrupt register, as these adapters do not support mixed mode interrupts among the functions of a given adapter. Logic for setting MSI/MSI-x interrupt mode in the shared interrupt register based on PCI function id zero check is not appropriate for all family of netxen adapters, as for some of the netxen family adapters PCI function zero is not really meant to be probed/loaded in the host but rather just act as a management function on the device, which caused all the other PCI functions on the adapter to always use legacy interrupt (INTx) mode instead of choosing MSI/MSI-x interrupt mode. This patch replaces that check with port number so that for all type of adapters driver attempts for MSI/MSI-x interrupt modes. Fixes: b37eb210c076 ("netxen_nic: Avoid mixed mode interrupts") Signed-off-by: Manish Chopra Signed-off-by: Igor Russkikh Link: https://lore.kernel.org/r/20210107101520.6735-1-manishc@marvell.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c @@ -564,11 +564,6 @@ static const struct net_device_ops netxe .ndo_set_features = netxen_set_features, }; -static inline bool netxen_function_zero(struct pci_dev *pdev) -{ - return (PCI_FUNC(pdev->devfn) == 0) ? true : false; -} - static inline void netxen_set_interrupt_mode(struct netxen_adapter *adapter, u32 mode) { @@ -664,7 +659,7 @@ static int netxen_setup_intr(struct netx netxen_initialize_interrupt_registers(adapter); netxen_set_msix_bit(pdev, 0); - if (netxen_function_zero(pdev)) { + if (adapter->portnum == 0) { if (!netxen_setup_msi_interrupts(adapter, num_msix)) netxen_set_interrupt_mode(adapter, NETXEN_MSI_MODE); else