linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Menzel <pmenzel@molgen.mpg.de>
To: Calvin Owens <calvin@wbinvd.org>
Cc: linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org,
	Luiz Augusto von Dentz <luiz.von.dentz@intel.com>,
	oe-kbuild-all@lists.linux.dev,
	Marcel Holtmann <marcel@holtmann.org>,
	Sean Wang <sean.wang@mediatek.com>,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] Bluetooth: btmtksdio: Fix build after header cleanup
Date: Sat, 30 Aug 2025 07:11:10 +0200	[thread overview]
Message-ID: <84fd4012-966b-4983-b015-ffce06509b5e@molgen.mpg.de> (raw)
In-Reply-To: <b78a4255d17adbb74140aa23f89cb7653af96c75.1756513671.git.calvin@wbinvd.org>

Dear Calvin,


Thank you for your patch, and addressing the regression right away.

Am 30.08.25 um 02:50 schrieb Calvin Owens:
> Syzbot found a randconfig which fails after my recent patch:
> 
>      drivers/bluetooth/btmtksdio.c:442:33: error: array type has incomplete element type ‘struct h4_recv_pkt’
>        442 | static const struct h4_recv_pkt mtk_recv_pkts[] = {
>            |                                 ^~~~~~~~~~~~~
>      drivers/bluetooth/btmtksdio.c:443:11: error: ‘H4_RECV_ACL’ undeclared here (not in a function)
>        443 |         { H4_RECV_ACL,      .recv = btmtksdio_recv_acl },
>            |           ^~~~~~~~~~~
>      drivers/bluetooth/btmtksdio.c:444:11: error: ‘H4_RECV_SCO’ undeclared here (not in a function)
>        444 |         { H4_RECV_SCO,      .recv = hci_recv_frame },
>            |           ^~~~~~~~~~~
>      drivers/bluetooth/btmtksdio.c:445:11: error: ‘H4_RECV_EVENT’ undeclared here (not in a function)
>        445 |         { H4_RECV_EVENT,    .recv = btmtksdio_recv_event },
> 
> ...because we can have BT_MTKSDIO=y with BT_HCIUART_H4=n, and the
> definitions used here are gated on BT_HCIUART_H4 in hci_uart.h.

The drivers below seem to be affected:

     drivers/bluetooth/bpa10x.c:     { H4_RECV_EVENT,   .recv = 
hci_recv_frame },
     drivers/bluetooth/btmtksdio.c:  { H4_RECV_EVENT,    .recv = 
btmtksdio_recv_event },
     drivers/bluetooth/btmtkuart.c:  { H4_RECV_EVENT,    .recv = 
btmtkuart_recv_event },
     drivers/bluetooth/btnxpuart.c:  { H4_RECV_EVENT,        .recv = 
hci_recv_frame },

> I think the simplest way to fix this is to remove the gate on the
> definitions in hci_uart.h. Since the constants are macros, there's no
> runtime cost to doing so, and nothing seems to rely on their absence in
> the BT_HCIUART_H4=n case.

Looking at the implementation, it looks like they only work with the H4 
protocol? So maybe, that should be denoted in the Kconfig files?

> I let randconfig builds run for awhile in drivers/bluetooth/ and didn't
> hit anything else, so hopefully this was the only fallout.
> 
> Fixes: 74bcec450eea ("Bluetooth: remove duplicate h4_recv_buf() in header")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202508300413.OnIedvRh-lkp@intel.com/
> Signed-off-by: Calvin Owens <calvin@wbinvd.org>
> ---
>   drivers/bluetooth/hci_uart.h | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h
> index 5ea5dd80e297..fd0624988aba 100644
> --- a/drivers/bluetooth/hci_uart.h
> +++ b/drivers/bluetooth/hci_uart.h
> @@ -121,7 +121,6 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable);
>   void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed,
>   			 unsigned int oper_speed);
>   
> -#ifdef CONFIG_BT_HCIUART_H4
>   int h4_init(void);
>   int h4_deinit(void);
>   
> @@ -165,7 +164,6 @@ struct h4_recv_pkt {
>   struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
>   			    const unsigned char *buffer, int count,
>   			    const struct h4_recv_pkt *pkts, int pkts_count);
> -#endif
>   
>   #ifdef CONFIG_BT_HCIUART_BCSP
>   int bcsp_init(void);

It’s a valid fix.

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul

  reply	other threads:[~2025-08-30  5:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <202508300413.OnIedvRh-lkp@intel.com>
2025-08-30  0:50 ` [PATCH] Bluetooth: btmtksdio: Fix build after header cleanup Calvin Owens
2025-08-30  5:11   ` Paul Menzel [this message]
2025-08-30 19:32     ` Calvin Owens
2025-09-02 15:29       ` Luiz Augusto von Dentz
2025-09-02 15:43         ` [PATCH v2] Bluetooth: " Calvin Owens
2025-09-02 16:20           ` patchwork-bot+bluetooth
2025-09-03 14:04           ` Calvin Owens
2025-09-03 14:06             ` [PATCH v3] " Calvin Owens
2025-09-03 15:29               ` Paul Menzel

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=84fd4012-966b-4983-b015-ffce06509b5e@molgen.mpg.de \
    --to=pmenzel@molgen.mpg.de \
    --cc=calvin@wbinvd.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=luiz.von.dentz@intel.com \
    --cc=marcel@holtmann.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=sean.wang@mediatek.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).