Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp971731rdg; Fri, 11 Aug 2023 06:05:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6JemqF23JncHx7qTVTFie6vmIhGgZuZKOd/n6KQpQ9RHT0EKAioddIA1TwhKBOoPnSlHe X-Received: by 2002:a05:6512:3b9a:b0:4fe:df7:bcf1 with SMTP id g26-20020a0565123b9a00b004fe0df7bcf1mr1563681lfv.57.1691759156973; Fri, 11 Aug 2023 06:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691759156; cv=none; d=google.com; s=arc-20160816; b=kmkUARf7ZRbVbYWuugan0C6wlQltGFs/FSUWOUZzghbaaqrqIrdVjxz3Rn9JFKsOGS XGHBjfi5jgdc8lxQ9Pp0bmlCa04J4yQgrSUW92QRKbjAp1/l0Gs7yu8CnJ2tGYXsfpGT psk+cTFM6ZNjLsPPPgArWZvCPr5tKhbWG5cDbMYKDt8J2PQ3Ga9lyXGxWB9JxE4oZ6QQ Y4qayp9U2fw2Y+6LkqF8CbXESMyl+r3TlLdTtofGII5FyM85kxqAE7oPZsQ5Gd5OuTys NVzT954KqW+mjLGXLh6COKaJKhUH2xvoLUmRiDPPolSUZ2Eo/Ctq2eqiGcVX1aa3DIKc mGLg== 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=p6jahmSM5j9URq+MhJY2E9TDTS+pJyj4/GHeF5aXaek=; fh=vE+OWXOg+zoz/BaP3ZJWNkc9aMoTK4UpoIz5YqaDNyE=; b=gFpfAkq8Z/jncVsMXtivij5cqLYni3Tl5sBnV1f+PgVM8C/RDWZ+8iOg8m/wO3AGJ4 0XiEYxC6UWLG8qr1D6PSkFduGJ5t+jtnhc5Qx51h0B3vBLQCoHin1TJ4Y6bThzmTjfah zNDtl067quY9Oy5itneyHDndo4UYAtizJ3WYrfW1IFvtL3ovn8IVuyU+b29SMNfHp/RT WzI5lKe9H/Y5En122jyOi2hZ5mpsM4aZlJkbKuxYLmeB+XfOe2pOYw/PWp5oCTYMF14V O+VC8cupCrUSuXg+2YJ/7NT1Lm1nDTNL2hnRNExTJ8E/QOZ11Pj+aFxh8woWCU+GN6Ao cbDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dell.com header.s=smtpout1 header.b=RB4fK6xK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=dell.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9-20020aa7c589000000b0052337971893si3443769edq.78.2023.08.11.06.05.31; Fri, 11 Aug 2023 06:05:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@dell.com header.s=smtpout1 header.b=RB4fK6xK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=dell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234240AbjHKMZJ (ORCPT + 99 others); Fri, 11 Aug 2023 08:25:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbjHKMZI (ORCPT ); Fri, 11 Aug 2023 08:25:08 -0400 X-Greylist: delayed 1334 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 11 Aug 2023 05:25:07 PDT Received: from mx0b-00154904.pphosted.com (mx0b-00154904.pphosted.com [148.163.137.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7393BE5F; Fri, 11 Aug 2023 05:25:07 -0700 (PDT) Received: from pps.filterd (m0170397.ppops.net [127.0.0.1]) by mx0b-00154904.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37B6wmxu025115; Fri, 11 Aug 2023 08:02:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=smtpout1; bh=p6jahmSM5j9URq+MhJY2E9TDTS+pJyj4/GHeF5aXaek=; b=RB4fK6xKe2YHyF2C0WCLV8rjYq+xHIH7BIitew4MdsJ3/9Ja0GfgG3iCg2k6FlvRrtOW H68tPSdFQeeishV4vlvvP2rp/LSMRBk8ceRffaKE/0zmE5/pdrh0xYr0uJq/RGR92Vd4 JJDRiOkly1tZzlUL9QnrdoblRQwzbHew9w15UDjA3gSJ0SrQMXaSnzQaBS4gTcYkZ0CM 43pW7heb/eUuqmyaI6cEbyxYtaHEdLJrvg6j3pxwRQbsJrs2H42YJUK/xp0iNjrRTm/F UW9EyYm4k2ckL4ihSeyp71ixwNg3irneNybu2Kjr6Xp+xVwUUTY5+Kab24u2stY4zx/I oA== Received: from mx0a-00154901.pphosted.com (mx0a-00154901.pphosted.com [67.231.149.39]) by mx0b-00154904.pphosted.com (PPS) with ESMTPS id 3sd97rjm34-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Aug 2023 08:02:52 -0400 Received: from pps.filterd (m0133268.ppops.net [127.0.0.1]) by mx0a-00154901.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37BBMg5s038544; Fri, 11 Aug 2023 08:02:51 -0400 Received: from esaploutpc104.us.dell.com (smtp-outbound-pc1.dell.com [143.166.24.15]) by mx0a-00154901.pphosted.com (PPS) with ESMTPS id 3sd9durnve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Aug 2023 08:02:50 -0400 X-LoopCount0: from 10.95.135.182 X-PREM-Routing: D-Outbound X-MS-Exchange-CrossPremises-AuthAs: Internal X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="192727359" Received: from unknown (HELO marshall-virtual-machine.localdomain) ([10.95.135.182]) by esaploutpc104.us.dell.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2023 07:02:44 -0500 From: marshall.shao@dell.com To: Jesse Brandeburg , Tony Nguyen , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jacob Keller , Simon Horman , Akihiko Odaki , Kees Cook , Bjorn Helgaas , Aleksandr Loktionov , Lin Ma , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Marshall Shao Subject: [PATCH] Fix kernel panic issue after removing igb driver Date: Fri, 11 Aug 2023 20:02:25 +0800 Message-Id: <20230811120225.4133-1-marshall.shao@dell.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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-11_03,2023-08-10_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 priorityscore=1501 clxscore=1011 adultscore=0 lowpriorityscore=0 mlxscore=0 suspectscore=0 spamscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308110110 X-Proofpoint-GUID: xqGwpcQLF5tzQcuKVkEEZC-RroAGpiWE X-Proofpoint-ORIG-GUID: xqGwpcQLF5tzQcuKVkEEZC-RroAGpiWE X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 phishscore=0 impostorscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308110110 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE 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 From: Marshall Shao This patch fixes a kernel panic issue after removing the igb driver from the usermode. A delayed work will be schedule in igb_ptp_init(), if (adapter->ptp_flags & IGB_PTP_OVERFLOW_CHECK) INIT_DELAYED_WORK(&adapter->ptp_overflow_work, igb_ptp_overflow_check); If CONFIG_PTP_1588_CLOCK is not enabled, the delayed work cannot be cancelled when igb_ptp_suspend is called. Signed-off-by: Marshall Shao --- drivers/net/ethernet/intel/igb/igb_ptp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c index 405886ee5261..b21822ea1c7d 100644 --- a/drivers/net/ethernet/intel/igb/igb_ptp.c +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c @@ -1435,12 +1435,12 @@ void igb_ptp_sdp_init(struct igb_adapter *adapter) */ void igb_ptp_suspend(struct igb_adapter *adapter) { - if (!(adapter->ptp_flags & IGB_PTP_ENABLED)) - return; - if (adapter->ptp_flags & IGB_PTP_OVERFLOW_CHECK) cancel_delayed_work_sync(&adapter->ptp_overflow_work); + if (!(adapter->ptp_flags & IGB_PTP_ENABLED)) + return; + cancel_work_sync(&adapter->ptp_tx_work); if (adapter->ptp_tx_skb) { dev_kfree_skb_any(adapter->ptp_tx_skb); -- 2.34.1