From patchwork Wed Aug 9 13:43:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Chopra X-Patchwork-Id: 13348056 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EEAA182BE for ; Wed, 9 Aug 2023 13:44:02 +0000 (UTC) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C82CC2107 for ; Wed, 9 Aug 2023 06:43:56 -0700 (PDT) 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 379CjbDi024278; Wed, 9 Aug 2023 06:43:49 -0700 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=ezS9SWbx8tDQlME/SczLZSWHUxOlIi5YQxkfAiWvp6Y=; b=JJ/cuL63stbBpnBcCFragmbeXDHWLzrTS2FVFvXUcgLilC1GHTg7fYyU+g7INF3TMX2G UuU80vMiwn1MHjBJ8TEMdvL4ntHaldtIfN/sUFhXhtQba/1kLXZF518NUFie9175UgmA DBamibQZIFGmVXKy1EKg16pXV1j9j7eKuOP037ROjJ6OMznX9D5HZHlznycfB+MbqrpR i1/cBOkWW0In/b52vV7m0UBPCaCowx7LvyL7cV3ObdVNXheuo4/kGvk9SDPdcBJK5fNi /8LLo4I91ucXUmcVyxTaVdgNCiozZLo2WeVjfgjaFZE5QtsWJRElE4cxl8zqbgdBqRXp 0A== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3sbkntmwea-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 09 Aug 2023 06:43:49 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 9 Aug 2023 06:43:47 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 9 Aug 2023 06:43:47 -0700 Received: from falcon.marvell.com (unknown [10.30.46.95]) by maili.marvell.com (Postfix) with ESMTP id 5B0023F704D; Wed, 9 Aug 2023 06:43:43 -0700 (PDT) From: Manish Chopra To: CC: , , , , , , , , , , , David Miller Subject: [PATCH v2 net] qede: fix firmware halt over suspend and resume Date: Wed, 9 Aug 2023 19:13:39 +0530 Message-ID: <20230809134339.698074-1-manishc@marvell.com> X-Mailer: git-send-email 2.27.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: 7MGVQI0NCsTFLzSPDa612xoPwnPITiCP X-Proofpoint-ORIG-GUID: 7MGVQI0NCsTFLzSPDa612xoPwnPITiCP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-09_10,2023-08-09_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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org While performing certain power-off sequences, PCI drivers are called to suspend and resume their underlying devices through PCI PM (power management) interface. However this NIC hardware does not support PCI PM suspend/resume operations so system wide suspend/resume leads to bad MFW (management firmware) state which causes various follow-up errors in driver when communicating with the device/firmware afterwards. To fix this driver implements PCI PM suspend handler to indicate unsupported operation to the PCI subsystem explicitly, thus avoiding system to go into suspended/standby mode. Fixes: 2950219d87b0 ("qede: Add basic network device support") Cc: David Miller Signed-off-by: Manish Chopra Signed-off-by: Alok Prasad Reviewed-by: Simon Horman --- V1->V2: * Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS --- drivers/net/ethernet/qlogic/qede/qede_main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c index d57e52a97f85..18ae7af1764c 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_main.c +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c @@ -177,6 +177,18 @@ static int qede_sriov_configure(struct pci_dev *pdev, int num_vfs_param) } #endif +static int __maybe_unused qede_suspend(struct device *dev) +{ + if (!dev) + return -ENODEV; + + dev_info(dev, "Device does not support suspend operation\n"); + + return -EOPNOTSUPP; +} + +static DEFINE_SIMPLE_DEV_PM_OPS(qede_pm_ops, qede_suspend, NULL); + static const struct pci_error_handlers qede_err_handler = { .error_detected = qede_io_error_detected, }; @@ -191,6 +203,7 @@ static struct pci_driver qede_pci_driver = { .sriov_configure = qede_sriov_configure, #endif .err_handler = &qede_err_handler, + .driver.pm = &qede_pm_ops, }; static struct qed_eth_cb_ops qede_ll_ops = {