Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp605948pxb; Tue, 5 Apr 2022 15:44:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwo6fbEgCBV88DEbfJGLbch25TM3SstIv9tP3/7+UTz4/nl1lQCANWccS6wkeQ0DGaLSwMd X-Received: by 2002:a05:6a00:174a:b0:4fd:ac35:6731 with SMTP id j10-20020a056a00174a00b004fdac356731mr5741670pfc.71.1649198661972; Tue, 05 Apr 2022 15:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649198661; cv=none; d=google.com; s=arc-20160816; b=vPAW4NnmkzhkLQ5bnlWtOG83/CfVat7UNN4xN9m6vWD/VSLxikzQDV95m1L6b91hbs lG8gwbKEWpXR7ObZabBEDi14QK3+nyG4zYrGqmUeOdgKKF38S/8tRJTt7MVLqsKyCVnf +JQ6aamYlgRHeD5ICUhyscA/8Dq99HOmoXpoomDwJcuSZDC72lS0dMozUOLfkZ6o8xc0 p43PnNq8mYy4LPSp8TV97vCPVA/nEvN6bVUgOqorSKMPGM1jARuzj2NxJpx8JGrUdYOi 5lSoU2+UJl6tzk4v6JZRaZu+EJtBjLL/JW1bPBPNoB2Xbl1m2Y1zRv+b98s/ZSNLw2Bg Jy0w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ngfbzL/qIzZ9EjVhknCqJhZBtHOByjGOZa66+2dPmZ0=; b=kP1uB07llJ76ANc1rYk9h8nhPDV2kR0/br5bBtFLDQclBVvETKRB0+rkUJBfhgzMGi 60wTfjr7gtyQDtk5jAd8lUJMvRCaG3w08H1LbNXvZJFV2tuXOsRLX2Eto1FigPhidWHs 5irCY6dVnVAVEWB/K43Z7ZPOZpAN/M6/FolCU3qIw1aRRTnuLeKiXEtZRUzL9cv1cSmL Zw8METuQyR/Z+OUyjm4C4L4tanPo7sBIs9nW59Uqxp2rP5AALcGwsaT+HdglNU7bLMdg sBrS+cAn9c3+w5txHiVfJTyQq3bEvw8K+4Umz73kj84sWwRujPalxjeqOwY5nzryDfX6 KfyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zy5RQS2j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q91-20020a17090a1b6400b001c74c0f7c62si2837642pjq.129.2022.04.05.15.44.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 15:44:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zy5RQS2j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D11E47892B; Tue, 5 Apr 2022 15:24:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390245AbiDENhr (ORCPT + 99 others); Tue, 5 Apr 2022 09:37:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343967AbiDEJQn (ORCPT ); Tue, 5 Apr 2022 05:16:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FAE4D5573; Tue, 5 Apr 2022 02:02:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DDBA1B80DA1; Tue, 5 Apr 2022 09:02:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51750C385A0; Tue, 5 Apr 2022 09:02:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149327; bh=PbU3Zy+C03rpWGayUy2MlpDNrRuZYXE7DvqU86BFgbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zy5RQS2jeJG3/HZF0ek9t+LIMLyfYtclN/kiY/dWkkTvYJ1JczavbFY1pSMrKa8N2 QN1drNQOiM5rQLJUBq0JdOERrVMoCh9jxHSgJ0rfP8y+/NUpxXX/gPLqLzlWcgCjgh hd4+Rn8ToMAOW5hl4K890nQgUx+GmZJas3dpoqII= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Lobakin , Michal Kubiak , Maciej Fijalkowski , Tony Nguyen , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.16 0638/1017] ice: dont allow to run ice_send_event_to_aux() in atomic ctx Date: Tue, 5 Apr 2022 09:25:51 +0200 Message-Id: <20220405070413.221449890@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Alexander Lobakin [ Upstream commit 5a3156932da06f09953764de113419f254086faf ] ice_send_event_to_aux() eventually descends to mutex_lock() (-> might_sched()), so it must not be called under non-task context. However, at least two fixes have happened already for the bug splats occurred due to this function being called from atomic context. To make the emergency landings softer, bail out early when executed in non-task context emitting a warn splat only once. This way we trade some events being potentially lost for system stability and avoid any related hangs and crashes. Fixes: 348048e724a0e ("ice: Implement iidc operations") Signed-off-by: Alexander Lobakin Tested-by: Michal Kubiak Reviewed-by: Maciej Fijalkowski Acked-by: Tony Nguyen Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_idc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_idc.c b/drivers/net/ethernet/intel/ice/ice_idc.c index adcc9a251595..a2714988dd96 100644 --- a/drivers/net/ethernet/intel/ice/ice_idc.c +++ b/drivers/net/ethernet/intel/ice/ice_idc.c @@ -34,6 +34,9 @@ void ice_send_event_to_aux(struct ice_pf *pf, struct iidc_event *event) { struct iidc_auxiliary_drv *iadrv; + if (WARN_ON_ONCE(!in_task())) + return; + if (!pf->adev) return; -- 2.34.1