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 smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 68B69C77B78 for ; Thu, 4 May 2023 15:14:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id EACF840BD2; Thu, 4 May 2023 15:14:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org EACF840BD2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1683213255; bh=nxO0JHPa6eqpB7T/nAAiJ94wcDRdI7gP3svDCFqem9k=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=fJ25Zgwp7R+7fU+Ww34DaZv2fDmfGYeTGqvzGk2FY6hVLlu1ptjuHdBXmYXt6SrYY UXzpvnXTc3MZRP4sNsG0OTjBA4uurDj6MFnZzppY2EgG3BBZYnRnL4TsD/j+wPe5py FYR31GLpeITPAmbsKnKa0Qw9wVp6oqyenwKEpF8vdbC/52avAnDacDq+Qsd4o1iAsZ /jsZiECu0rdP++ONo2V3Bh8dtK55MhqmggWB1erspLGwwaUG7oKS2v73OYbMRughlp h8ynuXjpoOGNJ1L+w8SIYQR0kSCPVifLzUd/KHFV5uimnWrEVNWs90aAwY5MTHNAI/ rcEZ2707p51MA== 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 yY0SAWXhs_d1; Thu, 4 May 2023 15:14:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 074E440BAF; Thu, 4 May 2023 15:14:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 074E440BAF Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id D76B91BF3C1 for ; Thu, 4 May 2023 13:16:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B016841E30 for ; Thu, 4 May 2023 13:16:22 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org B016841E30 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 PlYF3653N-jW for ; Thu, 4 May 2023 13:16:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org EAF12400F8 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by smtp2.osuosl.org (Postfix) with ESMTPS id EAF12400F8 for ; Thu, 4 May 2023 13:16:21 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6600,9927,10700"; a="414399601" X-IronPort-AV: E=Sophos;i="5.99,249,1677571200"; d="scan'208";a="414399601" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2023 06:08:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10700"; a="786535829" X-IronPort-AV: E=Sophos;i="5.99,249,1677571200"; d="scan'208";a="786535829" Received: from mr10p30.jer.intel.com ([10.12.133.253]) by FMSMGA003.fm.intel.com with ESMTP; 04 May 2023 06:08:36 -0700 From: Yochai Hagvi To: intel-wired-lan@lists.osuosl.org Date: Thu, 4 May 2023 16:08:14 +0300 Message-Id: <20230504130814.6502-1-yochai.hagvi@intel.com> X-Mailer: git-send-email 2.21.3 MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 04 May 2023 15:14:12 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683206182; x=1714742182; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=lpow6FI9JiFtLpB4alXQwh19bClDeN8zNgqD9iz36uw=; b=SeJsdBt7f/44FvPsEleKEDhZSDzaPFjM5rvip1+2GecTmQnLjSrwtew1 jk2PVB5tfOTFb0gTYxX3KbiwK3d/tiEX5Xgd9Iolgq4Kqm/jpEbcG1tpl plZeubknHC3V4s93BjnvYUX/TVZIBty2sW+CrZGbSLqQ6OChoxs0/AQsp UM0KQyD6IrzMpBZUo08+zYrH6jUu+MEDFz6872cLjbVTp2zxJbmI++sNY haNhm1KvNCf/N6dmOhOqUBO2ODkHC5il1wcBH8jgAplDSV79yCjg9ZTDi a5hp66LJVnkreHFKdFMFYzWS72LTlaD5Sog7Q79cnEq6Ts6Md98mihsRG A==; X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=SeJsdBt7 Subject: [Intel-wired-lan] [PATCH net v1] ice: Schedule service task in IRQ thread_fn 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: , Cc: Karol Kolacinski , Yochai Hagvi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On some RT kernels, scheduling service task in interrupt context may result in a kernel panic. This is happenning due to queue_work call. Move ice_service_task_schedule to IRQ bottom half. Signed-off-by: Karol Kolacinski Signed-off-by: Yochai Hagvi --- drivers/net/ethernet/intel/ice/ice_main.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 7c04057c524c..ecaf51b28b40 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -3058,7 +3058,6 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data) { struct ice_pf *pf = (struct ice_pf *)data; struct ice_hw *hw = &pf->hw; - irqreturn_t ret = IRQ_NONE; struct device *dev; u32 oicr, ena_mask; @@ -3137,11 +3136,8 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data) } } - if (oicr & PFINT_OICR_TSYN_TX_M) { + if (oicr & PFINT_OICR_TSYN_TX_M) ena_mask &= ~PFINT_OICR_TSYN_TX_M; - if (!hw->reset_ongoing) - ret = IRQ_WAKE_THREAD; - } if (oicr & PFINT_OICR_TSYN_EVNT_M) { u8 tmr_idx = hw->func_caps.ts_func_info.tmr_index_owned; @@ -3172,16 +3168,12 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data) if (oicr & (PFINT_OICR_PCI_EXCEPTION_M | PFINT_OICR_ECC_ERR_M)) { set_bit(ICE_PFR_REQ, pf->state); - ice_service_task_schedule(pf); } } - if (!ret) - ret = IRQ_HANDLED; - ice_service_task_schedule(pf); ice_irq_dynamic_ena(hw, NULL, NULL); - return ret; + return IRQ_WAKE_THREAD; } /** @@ -3196,6 +3188,8 @@ static irqreturn_t ice_misc_intr_thread_fn(int __always_unused irq, void *data) if (ice_is_reset_in_progress(pf->state)) return IRQ_HANDLED; + ice_service_task_schedule(pf); + while (!ice_ptp_process_ts(pf)) usleep_range(50, 100); base-commit: d15a5df649ee6351197170c855148f07caf69d0b -- 2.21.1 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan