From: Tony Lindgren <tony@atomide.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: kernel-janitors@vger.kernel.org
Subject: Re: [bug report] tty: n_gsm: Fix packet data hex dump output
Date: Mon, 23 May 2022 10:34:53 +0300 [thread overview]
Message-ID: <Yos5HacdiYhni9v+@atomide.com> (raw)
In-Reply-To: <YosxSDXeL9jTCENN@kili>
Hi,
* Dan Carpenter <dan.carpenter@oracle.com> [220523 06:57]:
> Hello Tony Lindgren,
>
> The patch 925ea0fa5277: "tty: n_gsm: Fix packet data hex dump output"
> from May 12, 2022, leads to the following Smatch static checker
> warning:
>
> drivers/tty/n_gsm.c:720 gsm_data_kick()
> warn: sleeping in atomic context
>
> drivers/tty/n_gsm.c
> 698 static void gsm_data_kick(struct gsm_mux *gsm, struct gsm_dlci *dlci)
> 699 {
> 700 struct gsm_msg *msg, *nmsg;
> 701 int len;
> 702
> 703 list_for_each_entry_safe(msg, nmsg, &gsm->tx_list, list) {
> 704 if (gsm->constipated && msg->addr)
> 705 continue;
> 706 if (gsm->encoding != 0) {
> 707 gsm->txframe[0] = GSM1_SOF;
> 708 len = gsm_stuff_frame(msg->data,
> 709 gsm->txframe + 1, msg->len);
> 710 gsm->txframe[len + 1] = GSM1_SOF;
> 711 len += 2;
> 712 } else {
> 713 gsm->txframe[0] = GSM0_SOF;
> 714 memcpy(gsm->txframe + 1 , msg->data, msg->len);
> 715 gsm->txframe[msg->len + 1] = GSM0_SOF;
> 716 len = msg->len + 2;
> 717 }
> 718
> 719 if (debug & 4)
> --> 720 gsm_hex_dump_bytes(__func__, gsm->txframe, len);
>
> gsm_control_message() is holding a spin lock so gsm_hex_dump_bytes()
> might need to use GFP_ATOMIC instead of GFP_KERNEL.
OK thanks for the report. I'll send a patch for GFP_ATOMIC later on today.
Regards,
Tony
prev parent reply other threads:[~2022-05-23 7:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-23 7:01 [bug report] tty: n_gsm: Fix packet data hex dump output Dan Carpenter
2022-05-23 7:34 ` Tony Lindgren [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yos5HacdiYhni9v+@atomide.com \
--to=tony@atomide.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.