Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp266725rdb; Tue, 5 Dec 2023 05:06:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSWFfXCfTT+7pGGzjxzhcGSeVJ1fc4m0Zbb/TJjxyCzVKNUUdeJ8x4RR3ASFc31fNklLwo X-Received: by 2002:a17:902:720c:b0:1cf:d2c5:ae87 with SMTP id ba12-20020a170902720c00b001cfd2c5ae87mr2595654plb.11.1701781618821; Tue, 05 Dec 2023 05:06:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701781618; cv=none; d=google.com; s=arc-20160816; b=iaTOK1XWICDCLK35Y21zc0ghApTxZFR5GtdaVuq87CRUP3zoYytMhTp3IZHZ2ENmZv 4z8EBIu/Pg7IzhfxsEyKAKRol37zr/qKo3p65E17HZ+VFdiqsEB1n0K4kt00pCYDRbQs 5WidXvLWS1svBJBgmkHO/FbTyotaEk5+/xmULWnrZoKhPW3X7iVA+dzrKVro1CoCeNkp JaEEpqW3+vUpCUw26fr2xKqa/kL0lZ9sIJcC8iVm/3gRtG4IN07DbjTZ18xlmYsezGo6 IKGiX7QScYdiu7Dbx8zsRWF/qrdHVm2Da5UnnCICqTgcSiOLeTrHy9dJLiBCpJZ/hI5I rF5Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=2rDup1rK28BIzol1uUQ+jfQcdpFyk9LG+2EZtkJphPs=; fh=PUbSZjf2dtyqulLdd5rISVghnntgSGxvYpWMBobeHB0=; b=pAC21aNIoap64ysjsMWCQJlYSQCEe2rZM4zI9SMmIDSWe6+R49OoAhpbXHFCbdJGzv hNNnCi0XN8WM/88luxXx7xV8RfHe2T7rZXYxdmBepmDxK97U+tpFJIztqq0API3g4v0+ b3ISJSjhVXvIdqJqD3pTe/nzvlkdmf6U+1heKq4gMc/gnmliwAYFzi3QYeXj+fE+hfmf G6WKxIVie6zXoKefJXixdDhgoYbOjEnDkrZU0Yt6whdAUw9sbD+zR11jx9T9Xb3pgqhp /kfZnbdnii33WgF+b5HTjp0rrHN+LtSdHyFf9h8kWWi/NXThfOIAWIzidwapQNFp4PBN hYag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=BaMQBimE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id l19-20020a170902d35300b001d07f2e166csi4694066plk.261.2023.12.05.05.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 05:06:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=BaMQBimE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E38C380A5651; Tue, 5 Dec 2023 05:06:53 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345344AbjLENGf (ORCPT + 99 others); Tue, 5 Dec 2023 08:06:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232027AbjLENGe (ORCPT ); Tue, 5 Dec 2023 08:06:34 -0500 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D84BB120; Tue, 5 Dec 2023 05:06:40 -0800 (PST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B5CngxR032564; Tue, 5 Dec 2023 05:06:30 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=2rDup1rK28BIzol1uUQ+jfQcdpFyk9LG+2EZtkJphPs=; b=BaMQBimEQ6WSgGtR6ubmWd6KfTmYUjQtbsBslvG00pXH4qcbvULkQCUR7sjc8du3aj32 2UlXiiOsJG9AoBmwDZmCIJsW3suBaqEjjeagEa0U3E/c1yi87icW5TeQY6VEhQZnvB3K uWlYnNQlPbsIM3VTS4eiR+KOYhePtnEiJit5mA82HTwUlRXiT7X+Sjeq2JspiM0KYQ10 ATj/Jx0MK+9+IEtyHtsSzdKUdgZR2khmNEB21xNXcsXuo1sQboKWvuoge64wgpXXHex5 UH3hDoNqyl7B7nubN5yVzv0mupZAoWFfYTcLLSiZyFrfhn6MagZA8vwAh2qA+G4QcUmX 6A== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3ut0e68rb9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 05 Dec 2023 05:06:29 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 5 Dec 2023 05:06:28 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 5 Dec 2023 05:06:27 -0800 Received: from ubuntu-PowerEdge-T110-II.sclab.marvell.com (unknown [10.106.27.86]) by maili.marvell.com (Postfix) with ESMTP id 951B03F70A6; Tue, 5 Dec 2023 05:06:27 -0800 (PST) From: Shinas Rasheed To: , CC: , , , , , , , , , , Shinas Rasheed , "Veerasenareddy Burru" , Sathesh Edara , Eric Dumazet Subject: [PATCH net v2] octeon_ep: initialise control mbox tasks before using APIs Date: Tue, 5 Dec 2023 05:06:24 -0800 Message-ID: <20231205130625.2586755-1-srasheed@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: NVyDbGDbPraZgKiXtghGi3WQdONDNsjJ X-Proofpoint-ORIG-GUID: NVyDbGDbPraZgKiXtghGi3WQdONDNsjJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-05_07,2023-12-05_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 05 Dec 2023 05:06:54 -0800 (PST) Initialise various workqueue tasks and queue interrupt poll task before the first invocation of any control net APIs. Since octep_ctrl_net_get_info was called before the control net receive work task was initialised or even the interrupt poll task was queued, the function call wasn't returning actual firmware info queried from Octeon. Signed-off-by: Shinas Rasheed --- V2: - Updated changelog. - Handled error return for octep_ctrl_net_get_info V1: https://lore.kernel.org/all/20231202150807.2571103-1-srasheed@marvell.com/ .../ethernet/marvell/octeon_ep/octep_main.c | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c index 552970c7dec0..d400a221d82c 100644 --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c @@ -1193,6 +1193,13 @@ int octep_device_setup(struct octep_device *oct) if (ret) return ret; + INIT_WORK(&oct->tx_timeout_task, octep_tx_timeout_task); + INIT_WORK(&oct->ctrl_mbox_task, octep_ctrl_mbox_task); + INIT_DELAYED_WORK(&oct->intr_poll_task, octep_intr_poll_task); + oct->poll_non_ioq_intr = true; + queue_delayed_work(octep_wq, &oct->intr_poll_task, + msecs_to_jiffies(OCTEP_INTR_POLL_TIME_MSECS)); + atomic_set(&oct->hb_miss_cnt, 0); INIT_DELAYED_WORK(&oct->hb_task, octep_hb_timeout_task); @@ -1325,21 +1332,18 @@ static int octep_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_octep_config; } - octep_ctrl_net_get_info(octep_dev, OCTEP_CTRL_NET_INVALID_VFID, + err = octep_ctrl_net_get_info(octep_dev, OCTEP_CTRL_NET_INVALID_VFID, &octep_dev->conf->fw_info); + if (err) { + dev_err(&pdev->dev, "Failed to get firware info\n"); + goto register_dev_err; + } dev_info(&octep_dev->pdev->dev, "Heartbeat interval %u msecs Heartbeat miss count %u\n", octep_dev->conf->fw_info.hb_interval, octep_dev->conf->fw_info.hb_miss_count); queue_delayed_work(octep_wq, &octep_dev->hb_task, msecs_to_jiffies(octep_dev->conf->fw_info.hb_interval)); - INIT_WORK(&octep_dev->tx_timeout_task, octep_tx_timeout_task); - INIT_WORK(&octep_dev->ctrl_mbox_task, octep_ctrl_mbox_task); - INIT_DELAYED_WORK(&octep_dev->intr_poll_task, octep_intr_poll_task); - octep_dev->poll_non_ioq_intr = true; - queue_delayed_work(octep_wq, &octep_dev->intr_poll_task, - msecs_to_jiffies(OCTEP_INTR_POLL_TIME_MSECS)); - netdev->netdev_ops = &octep_netdev_ops; octep_set_ethtool_ops(netdev); netif_carrier_off(netdev); -- 2.25.1