Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3349627pxb; Mon, 4 Apr 2022 14:18:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSWVxQC9oIT9CXOD2Uyizt/Xw1nK/dYmE5QYgPnYRy1902+35TLF9nmS+UStdAsV2xp+Nn X-Received: by 2002:a17:902:f543:b0:156:5f55:a75d with SMTP id h3-20020a170902f54300b001565f55a75dmr152406plf.72.1649107105370; Mon, 04 Apr 2022 14:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649107105; cv=none; d=google.com; s=arc-20160816; b=aGNugZ6Lh647TzF7X+HuHGWhk3CuOHNZO0fxkuvHlsIEXUtkzLLf1byczBmL0HQb00 rW5GYpSuvG7luLs/iuKGN5Rr/7/H7iR9amJEGdOQJwD05ebYWt/39tqs+kANWq+4klOA vkJA3KzrZ+DM5npmbpt6aU+itzZGg9uaKrG3+8uwc7S595mj6y+3lHNEiixFGHiJQs9c EIwbQKjwCw2Gct+w8iOsuH9IbFqbcmMFrNfeabr/7pTvurynN/dfR1eHRo1ER38dJIvi eRaVsbECIcS0MOiTvLBfwK7Wvgw29UUvXhstwkncsCNy3n/d5IYH9QHLopN7x0se448+ Kulw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VpZQTwmhS3wrqFRQOPXy7ByAe6cXhVDx1kczcQIDM+g=; b=MHXQPRkGDdW8qIroB1lb/O0HiYcaatef0U/7lBmsUfsugkqGBY4neTmokhC5pmkV/2 f4h8h2CSptWdco6CbdyuGI+lSU2la0RrkjVc1DdJZGH3/+MqLQk+GfA5wiwdmcJHN6EU F8w1dG28GwM+nWLFPOWDV65dlQGBJj5s6TfxCcCc+xuDp8eEGzmUnjVE4WfUIranjNjV tgz27idD+5jrRtAMBklrifiNozbHFLbpeVPJx6n9Rvanm5Mn540zXYP/s9QvmvzASGuA SYfjKRg/4FIssl66P40LXoRBZoAKntk38Qzxt5QORV8tpk3rBhvXVipiGPQhFys6XQ5B ml1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eoOqwg9C; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot6-20020a17090b3b4600b001bd14e01fbasi48945pjb.168.2022.04.04.14.18.10; Mon, 04 Apr 2022 14:18:25 -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=@kernel.org header.s=k20201202 header.b=eoOqwg9C; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347306AbiDAOcM (ORCPT + 99 others); Fri, 1 Apr 2022 10:32:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347295AbiDAOb1 (ORCPT ); Fri, 1 Apr 2022 10:31:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7809528B139; Fri, 1 Apr 2022 07:27:50 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 04E9661C33; Fri, 1 Apr 2022 14:27:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D93D8C36AE7; Fri, 1 Apr 2022 14:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648823269; bh=QsEnBO8My2ETVS8CVQvoiz31u6hCY6YY0ugyJqmKCUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eoOqwg9CwdGTfoshtAKgCUs4sT5p3BJbYMz/JDeJTdwPXjgopIOY/n+FLqT+SlyMd eLEIyNk1ZDq7FqdP3nzo32P/wGo1lvlRzuI+rOCVBuiPotCDEhlIeGiDllaFCgUu3Z 6erRh8tNuNLKdjqouJ8Pgzck5Djqgh5UaFjXHsXVUu/3u7LBmM3ed8kPdwnYyss6ow tA2S1gKW6Uo2rc9jc/1ve24VgG+t/ZGATBfWRM9m4xVg5d6FSdiHVs/97oZDrG1dGs BZp1QaEZODjX9oXh2dHgJK9gGg87/1MxIJ56L7L7kmpCTQVfJqwivBfDqweOpy47sa tce+AtxRMsEPg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jedrzej Jagielski , Witold Fijalkowski , Gurucharan G , Tony Nguyen , Sasha Levin , jesse.brandeburg@intel.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.17 041/149] i40e: Add sending commands in atomic context Date: Fri, 1 Apr 2022 10:23:48 -0400 Message-Id: <20220401142536.1948161-41-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220401142536.1948161-1-sashal@kernel.org> References: <20220401142536.1948161-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: Jedrzej Jagielski [ Upstream commit 59b3d7350ff35c939b8e173eb2eecac80a5ee046 ] Change functions: - i40e_aq_add_macvlan - i40e_aq_remove_macvlan - i40e_aq_delete_element - i40e_aq_add_vsi - i40e_aq_update_vsi_params to explicitly use i40e_asq_send_command_atomic(..., true) instead of i40e_asq_send_command, as they use mutexes and do some work in an atomic context. Without this change setting vlan via netdev will fail with call trace cased by bug "BUG: scheduling while atomic". Signed-off-by: Witold Fijalkowski Signed-off-by: Jedrzej Jagielski Tested-by: Gurucharan G Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e_common.c | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index 9ddeb015eb7e..e830987a8c6d 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c @@ -1899,8 +1899,9 @@ i40e_status i40e_aq_add_vsi(struct i40e_hw *hw, desc.flags |= cpu_to_le16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); - status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info, - sizeof(vsi_ctx->info), cmd_details); + status = i40e_asq_send_command_atomic(hw, &desc, &vsi_ctx->info, + sizeof(vsi_ctx->info), + cmd_details, true); if (status) goto aq_add_vsi_exit; @@ -2287,8 +2288,9 @@ i40e_status i40e_aq_update_vsi_params(struct i40e_hw *hw, desc.flags |= cpu_to_le16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); - status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info, - sizeof(vsi_ctx->info), cmd_details); + status = i40e_asq_send_command_atomic(hw, &desc, &vsi_ctx->info, + sizeof(vsi_ctx->info), + cmd_details, true); vsi_ctx->vsis_allocated = le16_to_cpu(resp->vsi_used); vsi_ctx->vsis_unallocated = le16_to_cpu(resp->vsi_free); @@ -2673,8 +2675,8 @@ i40e_status i40e_aq_add_macvlan(struct i40e_hw *hw, u16 seid, if (buf_size > I40E_AQ_LARGE_BUF) desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_LB); - status = i40e_asq_send_command(hw, &desc, mv_list, buf_size, - cmd_details); + status = i40e_asq_send_command_atomic(hw, &desc, mv_list, buf_size, + cmd_details, true); return status; } @@ -2715,8 +2717,8 @@ i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 seid, if (buf_size > I40E_AQ_LARGE_BUF) desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_LB); - status = i40e_asq_send_command(hw, &desc, mv_list, buf_size, - cmd_details); + status = i40e_asq_send_command_atomic(hw, &desc, mv_list, buf_size, + cmd_details, true); return status; } @@ -3868,7 +3870,8 @@ i40e_status i40e_aq_delete_element(struct i40e_hw *hw, u16 seid, cmd->seid = cpu_to_le16(seid); - status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + status = i40e_asq_send_command_atomic(hw, &desc, NULL, 0, + cmd_details, true); return status; } -- 2.34.1