Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3713527ybv; Mon, 10 Feb 2020 05:10:38 -0800 (PST) X-Google-Smtp-Source: APXvYqyDGTpwIxNnWIAXAZKCcaczTn1HtHz4u51mQt1zrWcdVDzkzckph0K13bghECsp72hwZsc0 X-Received: by 2002:aca:4a0b:: with SMTP id x11mr736295oia.37.1581340238451; Mon, 10 Feb 2020 05:10:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581340238; cv=none; d=google.com; s=arc-20160816; b=nSWDVhtTho06iVJ10NoiubYHSvbCNGBLQZH+QGYMZ2dYc3xVQmZ+SuBwtKdYlzbR36 eG8j1KWoFmYM4oosAW44cxzBE2r/iBmJ50jloQQBzQ9xj9yhN+4JQV+f0jIvWM8HDuQw RH6gp8y7S8u/BSuLx90VqrSYxZwfW4m/uLzaprN3K9qxqNIfWgiQX8qg9Cj8/bCM3DRV mLxQ1VCdZGnML/HezVRY4vySx14j/pCVs0A4k7CjogHaO7LBuKbLc+gksbL0l4PyV5B0 0GP8bLvhGY8qO9ahygp0xx/sRMqObtY6LxU4A3Z/04/kXnSg64W/+GYoso8GUVWUtLTl ReGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BrwVcbK7GFF4g+SEY4vyKbmy1F6C5ygvsivFt+lPz8Q=; b=aK+eBteAUaBc5kylMLdn6Qiefud3xiEVTV8PM/aePefLC8q+siFLXTqdfWrNHBcFiw /aWb94oSSU+Z1reMUliVHxY6e7Jb8ja4Z/etkfpEyGaRL8tAYAfXm0yOiVETWTUwCOAy Wm0XkEdxGGUwLAUqgcD/vbtsHxcG/0ffnoiagYA8UqmMYDx5BHRdE4AEIXTc71rJe9jL gJqJ4UuMldWoNrXscj6grMkkMu7Pq98ungpVil1pOOChWQ0C0jY3e5X7tDyFwA+Jfoah puvya1hFMx8M5gNfaeWOW7CeoujZ+OIece27ppe6ycJpGG0RAj6x671/+vTGv1SjdctB Okbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="KKuZwNW/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s128si140911oig.204.2020.02.10.05.10.27; Mon, 10 Feb 2020 05:10:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="KKuZwNW/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730701AbgBJNJW (ORCPT + 99 others); Mon, 10 Feb 2020 08:09:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:36882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729399AbgBJMjU (ORCPT ); Mon, 10 Feb 2020 07:39:20 -0500 Received: from localhost (unknown [209.37.97.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C24E720733; Mon, 10 Feb 2020 12:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338359; bh=OR8aHjYil6DSiTAuNKe4AkTAl8Dsbgx1++0yiXkrjtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KKuZwNW/+6mxNJg66PMgk8CB3d1vBGfhI944029nT8OSg1yBIJ+fSgctDoe6o0aXy DR7bh1EHhWlle8fLlcLBL/ekto/9yjfHYyh0SAfMoABSr3SxcpVye5xmkq8Xgn6XZ0 OFebrnD/pcuZatx/nfjRrsUOXDsmtEv1BQ50Y3gI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Pirko , Vasundhara Volam , Michael Chan , "David S. Miller" Subject: [PATCH 5.5 002/367] bnxt_en: Move devlink_register before registering netdev Date: Mon, 10 Feb 2020 04:28:35 -0800 Message-Id: <20200210122423.996838240@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vasundhara Volam [ Upstream commit cda2cab0771183932d6ba73c5ac63bb63decdadf ] Latest kernels get the phys_port_name via devlink, if ndo_get_phys_port_name is not defined. To provide the phys_port_name correctly, register devlink before registering netdev. Also call devlink_port_type_eth_set() after registering netdev as devlink port updates the netdev structure and notifies user. Cc: Jiri Pirko Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 12 ++++++++---- drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 1 - 2 files changed, 8 insertions(+), 5 deletions(-) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11433,9 +11433,9 @@ static void bnxt_remove_one(struct pci_d bnxt_sriov_disable(bp); bnxt_dl_fw_reporters_destroy(bp, true); - bnxt_dl_unregister(bp); pci_disable_pcie_error_reporting(pdev); unregister_netdev(dev); + bnxt_dl_unregister(bp); bnxt_shutdown_tc(bp); bnxt_cancel_sp_work(bp); bp->sp_event = 0; @@ -11905,11 +11905,14 @@ static int bnxt_init_one(struct pci_dev bnxt_init_tc(bp); } + bnxt_dl_register(bp); + rc = register_netdev(dev); if (rc) - goto init_err_cleanup_tc; + goto init_err_cleanup; - bnxt_dl_register(bp); + if (BNXT_PF(bp)) + devlink_port_type_eth_set(&bp->dl_port, bp->dev); bnxt_dl_fw_reporters_create(bp); netdev_info(dev, "%s found at mem %lx, node addr %pM\n", @@ -11919,7 +11922,8 @@ static int bnxt_init_one(struct pci_dev return 0; -init_err_cleanup_tc: +init_err_cleanup: + bnxt_dl_unregister(bp); bnxt_shutdown_tc(bp); bnxt_clear_int_mode(bp); --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c @@ -526,7 +526,6 @@ int bnxt_dl_register(struct bnxt *bp) netdev_err(bp->dev, "devlink_port_register failed"); goto err_dl_param_unreg; } - devlink_port_type_eth_set(&bp->dl_port, bp->dev); rc = devlink_port_params_register(&bp->dl_port, bnxt_dl_port_params, ARRAY_SIZE(bnxt_dl_port_params));