public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Ying Hsu <yinghsu@chromium.org>
Cc: linux-bluetooth@vger.kernel.org, luiz.dentz@gmail.com,
	chromeos-bluetooth-upstreaming@chromium.org,
	Marcel Holtmann <marcel@holtmann.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] Bluetooth: btusb: add sysfs attribute to control USB alt setting
Date: Wed, 8 Jan 2025 13:35:01 +0100	[thread overview]
Message-ID: <2025010805-frostlike-engorge-fe1a@gregkh> (raw)
In-Reply-To: <20241213120420.v2.1.Ifc708cc471a8834b344c26fce1ce2fe3e5992cad@changeid>

On Fri, Dec 13, 2024 at 12:04:22PM +0800, Ying Hsu wrote:
> When a Bluetooth raw socket is open, the HCI event related to SCO
> connection changes are not dispatched to the hci_event module, and
> the underlying Bluetooth controller's USB Interface 1 will not be
> updated accordingly.
> 
> This patch adds `isoc_alt` sysfs attribute, allowing user space
> to update the alternate setting of the USB interface alternate
> setting as needed.
> 
> Signed-off-by: Ying Hsu <yinghsu@chromium.org>
> ---
> This commit has been tested on a chromebook with AX211.
> 
> Changes in v2:
> - Add check for the existence of a valid USB interface 1.

You forgot a Documentation/ABI/ entry.

Also, the code isn't quite right:

> @@ -4008,6 +4034,10 @@ static int btusb_probe(struct usb_interface *intf,
>  						 data->isoc, data);
>  		if (err < 0)
>  			goto out_free_dev;
> +
> +		err = device_create_file(&intf->dev, &dev_attr_isoc_alt);
> +		if (err)
> +			goto out_free_dev;

You just raced with userspace and lost.  Please properly use a device
group instead.  That makes for smaller code, and it works properly.

thanks,

greg k-h

      parent reply	other threads:[~2025-01-08 12:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13  4:04 [PATCH v2] Bluetooth: btusb: add sysfs attribute to control USB alt setting Ying Hsu
2024-12-13  4:35 ` [v2] " bluez.test.bot
2024-12-18  1:30   ` Ying Hsu
2024-12-27  4:40     ` Ying Hsu
2025-01-06 18:10 ` [PATCH v2] " patchwork-bot+bluetooth
2025-01-08 12:35 ` Greg KH [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=2025010805-frostlike-engorge-fe1a@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=chromeos-bluetooth-upstreaming@chromium.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=yinghsu@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox