From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3416C001DE for ; Fri, 11 Aug 2023 16:12:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 716AF41E9C; Fri, 11 Aug 2023 16:12:23 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 716AF41E9C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1691770343; bh=tmdS/Cf9wtLnVlFOsI2paQIdfBbkj+JvUpynMTjnB0U=; h=Date:To:References:From:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=z3sAr2ojhL2s3R45ymqXbhCzIrvsQoVNJYfLZk5tVj1ekzPyDDjkeYRI12RB5ZVu1 eyeUArWgTjIg/erh2i98puaZ/fELlhppPpnagAnt33YqLeF9lnKrIQYUfLREbB86Ju VeWMAGcqkb+DglJ3bHgmEBGqUZ3RAu7TXNvZqx+bbPyLbH0o2Zse2Sco5xqLZdhlw6 UNirI8lc8A3FaoF1rC8uzrvvSfrlotTBIgLjijg2p0f4uOLM0SjGWknSeqpy84CSrL ytaQEBcSnWPf2l185ENnH2k+8UXc+CPVkFE2163QI/6NLhNiX+CPetb8zuc6T2ny/z 9qTqwFcs8aVAQ== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jq0Azgaf9AFx; Fri, 11 Aug 2023 16:12:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 450B641EA0; Fri, 11 Aug 2023 16:12:22 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 450B641EA0 Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id EBDF41BF831 for ; Fri, 11 Aug 2023 16:12:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8BEE54021C for ; Fri, 11 Aug 2023 16:12:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 8BEE54021C X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fPhXgpZpXS8H for ; Fri, 11 Aug 2023 16:12:19 +0000 (UTC) Received: from out-75.mta1.migadu.com (out-75.mta1.migadu.com [IPv6:2001:41d0:203:375::4b]) by smtp2.osuosl.org (Postfix) with ESMTPS id D447240186 for ; Fri, 11 Aug 2023 16:12:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D447240186 Message-ID: <33708eb5-d64f-53b4-5107-8f663ca22c4f@linux.dev> Date: Fri, 11 Aug 2023 17:12:08 +0100 MIME-Version: 1.0 Content-Language: en-US To: marshall.shao@dell.com, 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 References: <20230811120225.4133-1-marshall.shao@dell.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: <20230811120225.4133-1-marshall.shao@dell.com> X-Migadu-Flow: FLOW_OUT X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1691770335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Kv429vn4vrSk3k/7v41brV0Zux6uwlxmmzbB9l5tuo0=; b=cNArDGwshUnaLan3+ZQHwp/yQxNnjNwDYr5AnuuykMARyRZGX6XBHOBj+TMWDbT2sfsFyY koPL+1ZQjcVPbei/xPlRFXipRrPzkC5WuFC+Q8a+wFKmEjB68EtF/Oi6RXa67rdiX1i37I L80+sM4WXgpoBiCA2rNOprL3+YJF+dY= X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=cNArDGws Subject: Re: [Intel-wired-lan] [PATCH] Fix kernel panic issue after removing igb driver X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On 11/08/2023 13:02, marshall.shao@dell.com wrote: > 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. But should this work be inited in case there is no PTP support in the kernel? Maybe it's better to avoid any driver threads in this case and move the initialization to the if block where we know that PHC device is created and working? > > 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); _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6ACA4C0015E for ; Fri, 11 Aug 2023 16:12:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234834AbjHKQMW (ORCPT ); Fri, 11 Aug 2023 12:12:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbjHKQMU (ORCPT ); Fri, 11 Aug 2023 12:12:20 -0400 Received: from out-80.mta1.migadu.com (out-80.mta1.migadu.com [95.215.58.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD3E42712 for ; Fri, 11 Aug 2023 09:12:18 -0700 (PDT) Message-ID: <33708eb5-d64f-53b4-5107-8f663ca22c4f@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1691770335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Kv429vn4vrSk3k/7v41brV0Zux6uwlxmmzbB9l5tuo0=; b=cNArDGwshUnaLan3+ZQHwp/yQxNnjNwDYr5AnuuykMARyRZGX6XBHOBj+TMWDbT2sfsFyY koPL+1ZQjcVPbei/xPlRFXipRrPzkC5WuFC+Q8a+wFKmEjB68EtF/Oi6RXa67rdiX1i37I L80+sM4WXgpoBiCA2rNOprL3+YJF+dY= Date: Fri, 11 Aug 2023 17:12:08 +0100 MIME-Version: 1.0 Subject: Re: [PATCH] Fix kernel panic issue after removing igb driver Content-Language: en-US To: marshall.shao@dell.com, 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 References: <20230811120225.4133-1-marshall.shao@dell.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: <20230811120225.4133-1-marshall.shao@dell.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/08/2023 13:02, marshall.shao@dell.com wrote: > 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. But should this work be inited in case there is no PTP support in the kernel? Maybe it's better to avoid any driver threads in this case and move the initialization to the if block where we know that PHC device is created and working? > > 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);