linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	Mark Chen <Mark-YW.Chen@mediatek.com>,
	Arnd Bergmann <arnd@arndb.de>, Kiran K <kiran.k@intel.com>,
	Alain Michaud <alainm@chromium.org>,
	Chethan T N <chethan.tumkur.narayan@intel.com>,
	Abhishek Pandit-Subedi <abhishekpandit@chromium.org>,
	Sathish Narasimman <nsathish41@gmail.com>,
	Rocky Liao <rjliao@codeaurora.org>,
	Ismael Ferreras Morezuelas <swyterzone@gmail.com>,
	Hilda Wu <hildawu@realtek.com>, Trent Piepho <tpiepho@gmail.com>,
	Bluetooth Kernel Mailing List  <linux-bluetooth@vger.kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: btusb: fix excessive stack usage
Date: Thu, 4 Feb 2021 18:13:19 +0100	[thread overview]
Message-ID: <24876961-6740-4C52-9F10-3E8056237DD0@holtmann.org> (raw)
In-Reply-To: <20210204154716.1823454-1-arnd@kernel.org>

Hi Arnd,

> Enlarging the size of 'struct btmtk_hci_wmt_cmd' makes it no longer
> fit on the kernel stack, as seen from this compiler warning:
> 
> drivers/bluetooth/btusb.c:3365:12: error: stack frame size of 1036 bytes in function 'btusb_mtk_hci_wmt_sync' [-Werror,-Wframe-larger-than=]
> 
> Change the function to dynamically allocate the buffer instead.
> As there are other sleeping functions called from the same location,
> using GFP_KERNEL should be fine here, and the runtime overhead should
> not matter as this is rarely called.
> 
> Unfortunately, I could not figure out why the message size is
> increased in the previous patch. Using dynamic allocation means
> any size is possible now, but there is still a range check that
> limits the total size (including the five-byte header) to 255
> bytes, so whatever was intended there is now undone.
> 
> Fixes: 48c13301e6ba ("Bluetooth: btusb: Fine-tune mt7663 mechanism.")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/bluetooth/btusb.c | 24 +++++++++++++++---------
> 1 file changed, 15 insertions(+), 9 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


  reply	other threads:[~2021-02-04 17:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 15:47 [PATCH] Bluetooth: btusb: fix excessive stack usage Arnd Bergmann
2021-02-04 17:13 ` Marcel Holtmann [this message]
2021-02-04 21:02 ` Trent Piepho

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=24876961-6740-4C52-9F10-3E8056237DD0@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=Mark-YW.Chen@mediatek.com \
    --cc=abhishekpandit@chromium.org \
    --cc=alainm@chromium.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=chethan.tumkur.narayan@intel.com \
    --cc=hildawu@realtek.com \
    --cc=johan.hedberg@gmail.com \
    --cc=kiran.k@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=nsathish41@gmail.com \
    --cc=rjliao@codeaurora.org \
    --cc=swyterzone@gmail.com \
    --cc=tpiepho@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).