Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1769024rwb; Sun, 15 Jan 2023 04:05:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXvi4O8ZxVOk/lzKkUSR+7uVT4wVUaXwffl3iCW8iNoOea0gsVHToxTA3tV6VaoAPtHdXNtO X-Received: by 2002:a17:90a:1642:b0:219:ba34:a60 with SMTP id x2-20020a17090a164200b00219ba340a60mr92176463pje.43.1673784338246; Sun, 15 Jan 2023 04:05:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673784338; cv=none; d=google.com; s=arc-20160816; b=TF4dBJonms4EO25f/LUsn5DSCBhck59fL0LVHJZFuyogllhuIV1FumPfD1O41AOzWd XUZe9P0GEbIbTJeEGIgzPugAIARxqw2PAPyab0bwuk6pWZk8AgYcqr8N3J/UaSWjRcY3 uS9WbqmqpgIT5P/okMRqUDRizwOD2hVWmWs0cAJTZkdCeqHwz3wiPEHw0xf1c7TUn1zS d0jbbikbrvzJSSdW7Mw4lD7zrBKqMT3DGah7gnKYrbtVt+osh9Qw1xzJplW+xYsBVo99 qvSkN7LGBmvGyp87cK1BrgoT9O3h+3nUrl4klqL8Tw+CJin9mIuEX1RCT+JaHtcM8GOx 3DrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=frfQ62JsAKz2uBrYyyjUtNNltSVulT6xfUPK7tKTqCQ=; b=fT5avJsRf/uL0TECP05Ft7ZHTL9do2EDHh7tCfoiotD026jTEtbCBElgVakjBwVSOo UyjAU/MMZIAdc3L/NSNNnU1MM2RBaEaPuxn5QkE3cS3DEuT8WDZdrcKQ47nYBUKT87an Is9YaLL+5uDcZeWlEyt0bnYkRNoPxuVNZoK8jHy74TvcbjvpnIMp0/Eu1/cor/zesNN4 aZ/u+1egWn3NMJSU9rtxqOji8QTTn/ly9T+ZbNRa2TBtZSEqjNbIYTJUqtpd+fUOds3C fn0aF+6Sf5XwPddxFnlFHJnUsBxDEqlgW0Go+jJIGKsdprpgps0ugo+6xepxF4QmBbzi YXhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GM8PQeU3; 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 om18-20020a17090b3a9200b002213d9c01cdsi3934890pjb.136.2023.01.15.04.05.27; Sun, 15 Jan 2023 04:05:38 -0800 (PST) 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=GM8PQeU3; 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 S230433AbjAOLiz (ORCPT + 52 others); Sun, 15 Jan 2023 06:38:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbjAOLiy (ORCPT ); Sun, 15 Jan 2023 06:38:54 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C0BAB760; Sun, 15 Jan 2023 03:38:53 -0800 (PST) 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 F0CD560C85; Sun, 15 Jan 2023 11:38:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AACDC433D2; Sun, 15 Jan 2023 11:38:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673782732; bh=Ig/08zW8bA7+m9pSq9nUzVfZvApqY/Uma484gnmFryg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GM8PQeU3jxLf0KcmiH7g1dqxujx2VxAdGDhvGmiFF5NBMAzqKuAtJ8IfUAROTuf7o 2AetJRLe4TlWgZ7C+O+R7UIWVrq4W/eh4wKPYMrfgQCk8CySJ5NtM7c7w1OEHNfqu+ ZFIcziwM6Lv2Imj+lpQWxkQ65Ff046olMaR1CvsY1er4bAAFNukf0bYVBo9OLeBQX/ ZUW22TpljIj5DJ3l8AwzEYFi15b2xyaZ7RLJCgJ0hZvaWUaGj276kZXZqtBRT0HFIF stN3jZgVqS8VHyDIIYyaw0WZOBvoTlgI+qIqSjF3YF7pbr7z6S+HX+kIrGf5tH8p+u mSaYAJz2d8Myw== Date: Sun, 15 Jan 2023 13:38:47 +0200 From: Leon Romanovsky To: Geetha sowjanya Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, edumazet@google.com, sbhatta@marvell.com, hkelam@marvell.com, sgoutham@marvell.com Subject: Re: [net PATCH v2] octeontx2-pf: Avoid use of GFP_KERNEL in atomic context Message-ID: References: <20230113061902.6061-1-gakula@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230113061902.6061-1-gakula@marvell.com> 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 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 On Fri, Jan 13, 2023 at 11:49:02AM +0530, Geetha sowjanya wrote: > Using GFP_KERNEL in preemption disable context, causing below warning > when CONFIG_DEBUG_ATOMIC_SLEEP is enabled. > > [ 32.542271] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:274 > [ 32.550883] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: swapper/0 > [ 32.558707] preempt_count: 1, expected: 0 > [ 32.562710] RCU nest depth: 0, expected: 0 > [ 32.566800] CPU: 3 PID: 1 Comm: swapper/0 Tainted: G W 6.2.0-rc2-00269-gae9dcb91c606 #7 > [ 32.576188] Hardware name: Marvell CN106XX board (DT) > [ 32.581232] Call trace: > [ 32.583670] dump_backtrace.part.0+0xe0/0xf0 > [ 32.587937] show_stack+0x18/0x30 > [ 32.591245] dump_stack_lvl+0x68/0x84 > [ 32.594900] dump_stack+0x18/0x34 > [ 32.598206] __might_resched+0x12c/0x160 > [ 32.602122] __might_sleep+0x48/0xa0 > [ 32.605689] __kmem_cache_alloc_node+0x2b8/0x2e0 > [ 32.610301] __kmalloc+0x58/0x190 > [ 32.613610] otx2_sq_aura_pool_init+0x1a8/0x314 > [ 32.618134] otx2_open+0x1d4/0x9d0 > > To avoid use of GFP_ATOMIC for memory allocation, disable preemption > after all memory allocation is done. > > Fixes: 4af1b64f80fb ("octeontx2-pf: Fix lmtst ID used in aura free") > Signed-off-by: Geetha sowjanya > Signed-off-by: Sunil Kovvuri Goutham > --- > v1-v2: > - Moved get_cpu to avolid use of GFP_ATOMIC. > - reworked commit message. > > drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Thanks, Reviewed-by: Leon Romanovsky