From patchwork Sat Dec 2 15:08:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinas Rasheed X-Patchwork-Id: 172853 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1808164vqy; Sat, 2 Dec 2023 07:08:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGMVc+v75tnIxt/srsBzlloSg2Fl2POku8QCeOWf2FLnUD5BVC8ZVnGxw+uJCDuZWiEdVJ1 X-Received: by 2002:a17:90b:2245:b0:286:1cbf:b0e0 with SMTP id hk5-20020a17090b224500b002861cbfb0e0mr535819pjb.26.1701529717341; Sat, 02 Dec 2023 07:08:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701529717; cv=none; d=google.com; s=arc-20160816; b=hMcoQa4nKxfVR6fqEgDQu6EUllmumsTLb+Y+/NTOMUcxN5/1JMtbbUGI92VYazyThZ sOK7ufNTgruvnE5ZOaQVfSkLbRjqruhdl+Z2TfSMq6YyAhahTJSqe7TwukIqjjJbdhnK K0eE+9MkiGMVrvb4v+LduwCIfRZIMTQjTpZKnMNWchKpoE4JSU4+i/nZMLlPlcpqZ5Ix MtyATiXDDVQlVGZW/1obaN7LPGwGyVhlEbnPQ4Bu+9BxuR5LxEpVaPfljU+12fkztr8B HZhwK6hGNglG4EyjGeWLV5fmaAqMni7lFgLRWoeY6/xCvzsU7abDMKoNJlFXgLI2ZI4Y 8q6A== 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=ebvhMGYZfFXqPW9szGU1GX5lx6iPZW3kOny7Mv67BhY=; fh=PUbSZjf2dtyqulLdd5rISVghnntgSGxvYpWMBobeHB0=; b=N3IikkKbey0EvVB64EAmhqHlW0vU7mOjhlqMFPgQBe5Wu5AWUFDE4FPd47SYRiBmL2 s0B4VUFSuWjMHRi9IAHbwlm2R7EjBpRNlTT3schWFrnhStB8YHL1HBNYE2ViPPhHngUZ 1EUYwwxeaGWhz7tNWwsDH4R9k7Yl1W9ggn1iS4pKVikVe5EcCzFFdk4GDx/H2BsIlTwi qFjvEV6m8rjJZyuKxrnCXUSYrlq2jYVMdi9I3Rml/5QFyvWTPbd4IgQdQRkqYUdotMp8 LuufOyi8ieE2oZmHPbnW3Rh00pvR6MLGVqaHiQmdcrwPQRgNu0FyyRi8bnHz01i2aO6z xW0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=JvEza2vj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id t22-20020a17090aba9600b002865967fa43si2951245pjr.112.2023.12.02.07.08.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 07:08:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=JvEza2vj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 277DE80793F1; Sat, 2 Dec 2023 07:08:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230181AbjLBPIT (ORCPT + 99 others); Sat, 2 Dec 2023 10:08:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjLBPIS (ORCPT ); Sat, 2 Dec 2023 10:08:18 -0500 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6864DCD; Sat, 2 Dec 2023 07:08:25 -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 3B2Ecusj013427; Sat, 2 Dec 2023 07:08:12 -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=ebvhMGYZfFXqPW9szGU1GX5lx6iPZW3kOny7Mv67BhY=; b=JvEza2vjrexsNm7zSqt14VAx7WsFFnkzVBKqulOTYCaRJK2Yj7IkaqPM79PVG46U7xUF R1HefUasLr68mjBq1cZ9AyIAEvFePGAIl1gb9EUw3AYp5hxav1KhmcNATYDFsrujpKpm lA76iPzrwm8Lh53NeJ7+Wz7Cwt0gc4EB83r1bU/758J/dR08Y3s9d1iBkm2eymg179QO B+kXRYa2wfnsfBNtZIlrpGlAyB1b9jYbGRDxvRS7WKVsHM1NSNH54PqMFZrmT5szN9I4 U/zAuis9l0eCXpkLthk8OX9Y0d7qImQtReLbgnihGqgyxfd4HiwD//BZ5pz8DpJGyxyZ jw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3ur4yrg5v1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 02 Dec 2023 07:08:12 -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; Sat, 2 Dec 2023 07:08:10 -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; Sat, 2 Dec 2023 07:08:10 -0800 Received: from ubuntu-PowerEdge-T110-II.sclab.marvell.com (unknown [10.106.27.86]) by maili.marvell.com (Postfix) with ESMTP id 13CF83F707A; Sat, 2 Dec 2023 07:08:10 -0800 (PST) From: Shinas Rasheed To: , CC: , , , , , , , , , , Shinas Rasheed , "Veerasenareddy Burru" , Sathesh Edara , Eric Dumazet Subject: [PATCH net v1] octeon_ep: initialise control mbox tasks before using APIs Date: Sat, 2 Dec 2023 07:08:07 -0800 Message-ID: <20231202150807.2571103-1-srasheed@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: H-y_2-0nBCf_wb2zWehq-JUKi3w-SKED X-Proofpoint-ORIG-GUID: H-y_2-0nBCf_wb2zWehq-JUKi3w-SKED 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-02_13,2023-11-30_01,2023-05-22_02 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Sat, 02 Dec 2023 07:08:36 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784183225169476260 X-GMAIL-MSGID: 1784183225169476260 Do INIT_WORK for the various workqueue tasks 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 even initialised, the function call wasn't returning actual firmware info queried from Octeon. Fixes: 8d6198a14e2b ("octeon_ep: support to fetch firmware info") Signed-off-by: Shinas Rasheed --- .../net/ethernet/marvell/octeon_ep/octep_main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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..3e7bfd3e0f56 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); @@ -1333,13 +1340,6 @@ static int octep_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 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);