Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1913021ioo; Fri, 27 May 2022 22:49:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvdajXPfqPaWN4sfpA1F+PRjHG4i/QzzDBJrhVx9FVNk9T5Dn51SoeI7tqoYcATPMG7RXE X-Received: by 2002:a17:902:cecd:b0:163:794c:fa9 with SMTP id d13-20020a170902cecd00b00163794c0fa9mr11399038plg.136.1653716941777; Fri, 27 May 2022 22:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653716941; cv=none; d=google.com; s=arc-20160816; b=QropSoVXXtMNV3Ada1M6TMer3+38zqTo7P9W6ZIeOebp8VmymgmwqX3/mVfBiCOLuk nFRjwMz5Hd1PmGQjwPDp+XNFrd24E3di/mmMRWf2X6B1Tay5INmh6mjvxsv0vTIyNRNq DR4Dvj8LWsu+wrFlzzp3d1rjP9BnhlfZvE94pcy5ZUcAGGnNhUFo8eNaCF8eiiGvQ/L9 l25b6v8NIeV2Rmvd/LXpRXIk+jy8N8IehbOWq8G3eKkWtZ7/pUVco/THUUg8kPvp2DDK 1XoJhz+E2qthRg+PWe0nH18naEZBaXQ0Gu0NWn5x3YLwey4Lfr1TgiM4/iIuSv7hlDM+ fMPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=K2LLmMdA4vHYK7N2vJ1T6WRKIiii8VMOFALIJtd4D6w=; b=fCdkSK0e4Ogbf5Ew4XbWEdIq03zNh1zn80z2RoYy99IH6sc+Ctz3mu0xm8WI3pBcMo rybKn+Btkkp9nIntMhSb22s3aHgOF45fBvy/TFWUn/kLQWLP9NOn7pjD5sk+n+qOPf51 GeO3mkK78v0Qw2oDkXhrhbzAbRUCYKihFwv3Pk3h/4EDfpgZarRELyGxE+k5MaDkQmlO /B4sCz1eWy6Ss6V7/KXcEpvAOTv4Pzbn9ZV2hEPa04fQrmi9N3sWgXe7LnQP/6X94SUn fbW3HHOoE/ZwcSqhW5ZEMa7kVd52A3aO7LWWc7vZUGxlsfcZWLjOcNyZutuKkH1JajlV 64UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WLizWyxe; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a170902e94500b00163655cc8e9si7396614pll.203.2022.05.27.22.48.50; Fri, 27 May 2022 22:49:01 -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=@bootlin.com header.s=gm1 header.b=WLizWyxe; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244398AbiEYNcz (ORCPT + 99 others); Wed, 25 May 2022 09:32:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241480AbiEYNcw (ORCPT ); Wed, 25 May 2022 09:32:52 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59C383632A; Wed, 25 May 2022 06:32:49 -0700 (PDT) Received: (Authenticated sender: gregory.clement@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 98BBB24000B; Wed, 25 May 2022 13:32:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1653485567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=K2LLmMdA4vHYK7N2vJ1T6WRKIiii8VMOFALIJtd4D6w=; b=WLizWyxeP8bSi00jmOplHPRDBzG6UMRAOcv+dJ6Gxr4Z8ybrBSyOf/pnL1ON4vwvw3fdti hTwIqRcWcMTTjOrzDOOiRbeEj/1dxPACkT5XfxFZTX3/kRJ/6yZ9hKRJfRA81CF+7+oQ9F N5bwEZNQMxXm/HzdjcRZnAwxC7qDtBoMXa5zImRXdshOAzpPeMJCUAYE2D2lly6xkidzxL SRLTfH/77Lgi+b1J7nBH8Np1KznlniCOV1s0voi4+y5zwS7W9RSRuUTMiVKs26jo3fbRb4 E+66YLaKF53MT+zSK2XLB7k1EPQ5TGXdVJnOKcgVEN762+9mAxGhMLtXd/iABg== From: Gregory CLEMENT To: Tony Lindgren , Greg Kroah-Hartman Cc: Daniel Starke , Jiri Slaby , Johan Hovold , Zhenguo Zhao , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Carpenter Subject: Re: [PATCH] tty: n_gsm: Debug output allocation must use GFP_ATOMIC In-Reply-To: <20220523155052.57129-1-tony@atomide.com> References: <20220523155052.57129-1-tony@atomide.com> Date: Wed, 25 May 2022 15:32:46 +0200 Message-ID: <87sfoxyby9.fsf@BL-laptop> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Tony Lindgren writes: > Dan Carpenter reported the following Smatch > warning: > > drivers/tty/n_gsm.c:720 gsm_data_kick() > warn: sleeping in atomic context > > This is because gsm_control_message() is holding a spin lock so > gsm_hex_dump_bytes() needs to use GFP_ATOMIC instead of GFP_KERNEL. > > Fixes: 925ea0fa5277 ("tty: n_gsm: Fix packet data hex dump output") > Reported-by: Dan Carpenter > Signed-off-by: Tony Lindgren Reviewed-by: Gregory CLEMENT > --- > drivers/tty/n_gsm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c > --- a/drivers/tty/n_gsm.c > +++ b/drivers/tty/n_gsm.c > @@ -459,7 +459,7 @@ static void gsm_hex_dump_bytes(const char *fname, const u8 *data, > return; > } > > - prefix = kasprintf(GFP_KERNEL, "%s: ", fname); > + prefix = kasprintf(GFP_ATOMIC, "%s: ", fname); > if (!prefix) > return; > print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_OFFSET, 16, 1, data, len, > -- > 2.36.1 -- Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com