From patchwork Wed Jan 22 05:19:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-chen Chuang X-Patchwork-Id: 859264 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 223A010E0 for ; Wed, 22 Jan 2025 05:20:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737523257; cv=none; b=WKDOgyR7NFKNAE0nsaupT4kM7jb88Xi5hkensT2fIRPHZFU7FVIMKBHR2NuTuXZcwckv3L0OSzkDW8LywcZ+yE6yDNg32aKVTN+YOsl/4nuD0MPwXiT0xjKp/5l2rFTkXoMwERcC7M4Ama2Ief+ObcXMQCp2OV8lcYR4G1hfWa8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737523257; c=relaxed/simple; bh=YhUqF6C+/xOQj2Y/ypEUT9skanylg7/3QRjlJh14Puo=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=H9LDqERDAnrVC/TV2hPRCVyNrTE1mwgt79N+riaKsu5dEATBljHjQB3cCf5gw2p6kNsRDQaEWCOdAUkMkQ/7NMEnF9hZxBl4eMSYUe4UV84xaCMyPmnkblpiIaZrNED3Dx4/YmEEVsuMmqniwOyss7cPSfz/PYBlrAmSxJvGH0E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--chharry.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ezljAe9Z; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--chharry.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ezljAe9Z" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-21648ddd461so133589795ad.0 for ; Tue, 21 Jan 2025 21:20:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737523255; x=1738128055; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=zpKj/vRFh/GcMVyUYHVbJYejAl25i2NKFWrMBBi6KOk=; b=ezljAe9ZO/qdVhHyYbkcnOe0I+XVkiReXZYP97+MUZXycrwXooyOGiv27M50zpDmmp 03pydlyV4ETfuioUeRKuqgjLSfTF1m5cmaIxbaYDEInJ3JrJlC10ZbHn92NUn56+RH+X F623HddXBYrKJcKKKMRnhANcljBfbD467VRCH3m8hKzqdMlKl8VN7QC2PbBekS+/Mi7e HjTTa0gEwGUzjxPksSwgrbkU2eyv8OH6nOnh+G/PdPICdRVWvfrozHhysBFARaBMniTi k1cdmv75wpTWW1OknXyVcFtHnQqyxl/5UsqOmCv70w+iohkGBYZibNrXJWOoTlqiWBpD YFPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737523255; x=1738128055; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=zpKj/vRFh/GcMVyUYHVbJYejAl25i2NKFWrMBBi6KOk=; b=fx4KOZLpEkzqojxs3KzqH6sTNnzAYQpnQzorKwn1YgcL9AM/cUk2X1/XBBbx4OVnGG vh36jjYq3qBg7c2ITsx7jVYAzaYoas8ceimypSPXXStyUHPyxISGdKv4va0k2fZVbaVI KrNHcIT56aiOLxWP1ZiXJDC3bqeBn4U1NTzQFVrfmDj9IyPmNXrtjQNLAMXYspMyzn/4 IuLAvdR3j8HD03ajqooZM6TUAtf4jscm/2qdH+N895VbPgHLBxD3/2M52kfQHV1f/s50 2eWyIDFCA+JoIiuVr+DV6sSN4+7+gusGwfq58Eg1Haf6vSwJOXZg4qPDiWY9UW1MhkV7 TgiA== X-Gm-Message-State: AOJu0YwTA6fZcmcq+3x/2BbXZcfh7fJf49wz21eVfyH+dOAI/5NIf4hW xQBHfnBIZkt1tncXP/vo8dscV27z18ZOErzO77y5btMT3/nfm19I5UUcoY6p3rPtaaJIRZiL8zF I41oAyWOpiif+8LDIUtMYFqIn1NHbs1A8Ug0Wqeimqz9qOFU1dvwp/XaPzTdaCROtDiWq0WE49R ICrMGwBlS8es9PEeyvZ77uIJ6Uag55UJ/0+D27IqNZ0U6iTsPjvA== X-Google-Smtp-Source: AGHT+IH4xhaj9nNDf+i1lGfmdriydIO8H2hCafDs9TDl1139kXi+me1rarwesfsxsbaZvZMJbhDgOHfzv/FX X-Received: from pgbbe2.prod.google.com ([2002:a65:6e42:0:b0:9a1:7139:ff84]) (user=chharry job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:e615:b0:1eb:3623:59fd with SMTP id adf61e73a8af0-1eb36235ae1mr22932415637.4.1737523255341; Tue, 21 Jan 2025 21:20:55 -0800 (PST) Date: Wed, 22 Jan 2025 13:19:25 +0800 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.48.1.262.g85cc9f2d1e-goog Message-ID: <20250122131925.v2.1.If6f14aa2512336173a53fc3552756cd8a332b0a3@changeid> Subject: [PATCH v2 1/3] Bluetooth: Fix possible race with userspace of sysfs isoc_alt From: Hsin-chen Chuang To: linux-bluetooth@vger.kernel.org, luiz.dentz@gmail.com Cc: chromeos-bluetooth-upstreaming@chromium.org, Hsin-chen Chuang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Johan Hedberg , Marcel Holtmann , Paolo Abeni , Simon Horman , Ying Hsu , linux-kernel@vger.kernel.org, netdev@vger.kernel.org From: Hsin-chen Chuang Use device group to avoid the racing. To reuse the group defined in hci_sysfs.c, defined 2 callbacks switch_usb_alt_setting and read_usb_alt_setting which are only registered in btusb. Fixes: b16b327edb4d ("Bluetooth: btusb: add sysfs attribute to control USB alt setting") Signed-off-by: Hsin-chen Chuang --- (no changes since v1) drivers/bluetooth/btusb.c | 42 ++++++++------------------------ include/net/bluetooth/hci_core.h | 2 ++ net/bluetooth/hci_sysfs.c | 33 +++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 32 deletions(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 75a0f15819c4..bf210275e5b7 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2221,6 +2221,13 @@ static int btusb_switch_alt_setting(struct hci_dev *hdev, int new_alts) return 0; } +static int btusb_read_alt_setting(struct hci_dev *hdev) +{ + struct btusb_data *data = hci_get_drvdata(hdev); + + return data->isoc_altsetting; +} + static struct usb_host_interface *btusb_find_altsetting(struct btusb_data *data, int alt) { @@ -3650,32 +3657,6 @@ static const struct file_operations force_poll_sync_fops = { .llseek = default_llseek, }; -static ssize_t isoc_alt_show(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - struct btusb_data *data = dev_get_drvdata(dev); - - return sysfs_emit(buf, "%d\n", data->isoc_altsetting); -} - -static ssize_t isoc_alt_store(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct btusb_data *data = dev_get_drvdata(dev); - int alt; - int ret; - - if (kstrtoint(buf, 10, &alt)) - return -EINVAL; - - ret = btusb_switch_alt_setting(data->hdev, alt); - return ret < 0 ? ret : count; -} - -static DEVICE_ATTR_RW(isoc_alt); - static int btusb_probe(struct usb_interface *intf, const struct usb_device_id *id) { @@ -4040,9 +4021,8 @@ static int btusb_probe(struct usb_interface *intf, if (err < 0) goto out_free_dev; - err = device_create_file(&intf->dev, &dev_attr_isoc_alt); - if (err) - goto out_free_dev; + hdev->switch_usb_alt_setting = btusb_switch_alt_setting; + hdev->read_usb_alt_setting = btusb_read_alt_setting; } if (IS_ENABLED(CONFIG_BT_HCIBTUSB_BCM) && data->diag) { @@ -4089,10 +4069,8 @@ static void btusb_disconnect(struct usb_interface *intf) hdev = data->hdev; usb_set_intfdata(data->intf, NULL); - if (data->isoc) { - device_remove_file(&intf->dev, &dev_attr_isoc_alt); + if (data->isoc) usb_set_intfdata(data->isoc, NULL); - } if (data->diag) usb_set_intfdata(data->diag, NULL); diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index f756fac95488..5d3ec5ff5adb 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -641,6 +641,8 @@ struct hci_dev { struct bt_codec *codec, __u8 *vnd_len, __u8 **vnd_data); u8 (*classify_pkt_type)(struct hci_dev *hdev, struct sk_buff *skb); + int (*switch_usb_alt_setting)(struct hci_dev *hdev, int new_alts); + int (*read_usb_alt_setting)(struct hci_dev *hdev); }; #define HCI_PHY_HANDLE(handle) (handle & 0xff) diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index 041ce9adc378..887aa1935b1e 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c @@ -102,8 +102,41 @@ static ssize_t reset_store(struct device *dev, struct device_attribute *attr, } static DEVICE_ATTR_WO(reset); +static ssize_t isoc_alt_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct hci_dev *hdev = to_hci_dev(dev); + + if (hdev->read_usb_alt_setting) + return sysfs_emit(buf, "%d\n", hdev->read_usb_alt_setting(hdev)); + + return -ENODEV; +} + +static ssize_t isoc_alt_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct hci_dev *hdev = to_hci_dev(dev); + int alt; + int ret; + + if (kstrtoint(buf, 10, &alt)) + return -EINVAL; + + if (hdev->switch_usb_alt_setting) { + ret = hdev->switch_usb_alt_setting(hdev, alt); + return ret < 0 ? ret : count; + } + + return -ENODEV; +} +static DEVICE_ATTR_RW(isoc_alt); + static struct attribute *bt_host_attrs[] = { &dev_attr_reset.attr, + &dev_attr_isoc_alt.attr, NULL, }; ATTRIBUTE_GROUPS(bt_host); From patchwork Wed Jan 22 05:19:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-chen Chuang X-Patchwork-Id: 859861 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22C0A1A8419 for ; Wed, 22 Jan 2025 05:21:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737523262; cv=none; b=Vtftfov6JG+7zUJGn8roBkHUyk4vBeSoPkc0CC7fA9Bj9gb4DlMV6xdqJmXCjj0fzZMc2GJmFL2H6Dq4AKSJKC7iTTxG/hoMdeiOM/cxNcwmDZGxm3jsblMF5s2/VDOW5WPiBDv0RetQmIFXzjSljk/bki+O3HU4v8/nWUnsaf4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737523262; c=relaxed/simple; bh=Qhkh799K+yyPiAQ9JNfkcwuelIGY90tmfTWVIa5Pi18=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=MT3Es2wb65WE2C7g7evhnHUNTt8Bo3lqp4A1winovbOdFFYTvtYmWWsSGtBpq/rVtO+b2rlOH8eHgGKrQs458eCsc33lxnNW5VTcv4sE+97Bjy1JBpUHm45iOchQhhNaLL46Q5if5byOD1+URB7gqI6mhU0K3icIY2jqnBJkoe0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--chharry.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=TxojXV6O; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--chharry.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="TxojXV6O" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2163a2a1ec2so199922955ad.1 for ; Tue, 21 Jan 2025 21:21:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737523260; x=1738128060; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=bSPBwvKYvguZInPoYBw9TBpllTosgpEh9yMZr7TxVOE=; b=TxojXV6O5sfolRWqC3ZkbhPZBYElA/ai5FSw/EdFCoG3RwT1KLmTurJ3LBvHzvQg84 bCxfcQ4QVSQUDjYS4If5GRSh+qleV4rrqf7OtVIxsgOYvF+wYZUAjfWe3/yB3xW07nxT hCDl/nktz0khXuxF9BFPmyoOlRP7M3YL71bm163lwvOAkyQDeGEaU9aIL/mIrxOUg97c WElyvpmHxF8l/xNYVOg3EIqd1N1X4/9lbUdNrdWUwy9emk62xhPKKYpmyQrZ82DFl6ya e6QBjtzd8chMNNzE984i8bZrE7XiM8upuUlSbqe9/QMQa8GIL7pi0DNQ7coLU1Fiyd2i 1nDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737523260; x=1738128060; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bSPBwvKYvguZInPoYBw9TBpllTosgpEh9yMZr7TxVOE=; b=R9vydC2WFnemNdKYXHGoT4NA0hTtz7nVwI+VyBX6RB9CkiYJ4r1eHSseyaADRmrpRb vT+x+2L9/xPNGmBLxLSEU4mnP9MMuQICHJ9yAWyubDchB20IVDxwR4j+mrwpiCwBfi3v y5KRwTUeNUWoFv7X+e39IJMTmyPOCNS+m6GOYjyZjRpVkTZkeV4/vhz+V2lOa5+4R2sN RHUu+YzqmMwxqQCv0hKBZxVh6VNpP3aaOayKNPK7yOA28g1Lr7KJYkIGWfRc8+AR5Tkd yUobMsKn5jprocu7kmXSwg98ljL9Th45+ikFj8T9K/WFVcXQlGNSjmAco3kZJw/LNqIJ Jx4g== X-Gm-Message-State: AOJu0YxYWoMpUXNb2JqzKDv/ixZS+DH7rTy3PcBX5QDED/rPHYg2mZ6C gQtYELHZVpOmLaO8E9Bv4d9PHbXYMJeH2gswBBJ9pQWxL6mDhLac6ZYy6mL7uo8iyZkct8gzAm8 BuslxtDQuYtkNWxWnCoeEKUyRNWGTf1aiV/rxIfzxuv1XlE21qmKRP7OaBrzuSi8qpQo52MH/ft RTrXhJSjU+WVW+Kd9YDZVs0OtoXyJD+yJTnv76P9edJHGAMtgQ7w== X-Google-Smtp-Source: AGHT+IFlrBSmWao3+0MyCPymXOJR9zgksXH6ZKuoFGvYzaisnesEfS4OM+Ixw8sSvrN9lWtrRUoQSV7Klz0o X-Received: from pgwg11.prod.google.com ([2002:a65:6ccb:0:b0:7fd:5126:2bab]) (user=chharry job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:72a3:b0:1e1:dbfd:1fde with SMTP id adf61e73a8af0-1eb2157fba4mr30670475637.27.1737523259477; Tue, 21 Jan 2025 21:20:59 -0800 (PST) Date: Wed, 22 Jan 2025 13:19:26 +0800 In-Reply-To: <20250122131925.v2.1.If6f14aa2512336173a53fc3552756cd8a332b0a3@changeid> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250122131925.v2.1.If6f14aa2512336173a53fc3552756cd8a332b0a3@changeid> X-Mailer: git-send-email 2.48.1.262.g85cc9f2d1e-goog Message-ID: <20250122131925.v2.2.I6e9e94dcded65e4a9ed42ad23ca8a5d81f680382@changeid> Subject: [PATCH v2 2/3] Bluetooth: Always allow SCO packets for user channel From: Hsin-chen Chuang To: linux-bluetooth@vger.kernel.org, luiz.dentz@gmail.com Cc: chromeos-bluetooth-upstreaming@chromium.org, Hsin-chen Chuang , Marcel Holtmann , Ying Hsu , linux-kernel@vger.kernel.org From: Hsin-chen Chuang The SCO packets from Bluetooth raw socket are now rejected because hci_conn_num is left 0. This patch allows such the usecase to enable the userspace SCO support. Fixes: b16b327edb4d ("Bluetooth: btusb: add sysfs attribute to control USB alt setting") Signed-off-by: Hsin-chen Chuang --- Changes in v2: - Check HCI_USER_CHANNEL rather than just remove the hci_conn_num check drivers/bluetooth/btusb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index bf210275e5b7..acfa83228b25 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2104,7 +2104,8 @@ static int btusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb) return submit_or_queue_tx_urb(hdev, urb); case HCI_SCODATA_PKT: - if (hci_conn_num(hdev, SCO_LINK) < 1) + if (!hci_dev_test_flag(hdev, HCI_USER_CHANNEL) && + hci_conn_num(hdev, SCO_LINK) < 1) return -ENODEV; urb = alloc_isoc_urb(hdev, skb); @@ -2585,7 +2586,8 @@ static int btusb_send_frame_intel(struct hci_dev *hdev, struct sk_buff *skb) return submit_or_queue_tx_urb(hdev, urb); case HCI_SCODATA_PKT: - if (hci_conn_num(hdev, SCO_LINK) < 1) + if (!hci_dev_test_flag(hdev, HCI_USER_CHANNEL) && + hci_conn_num(hdev, SCO_LINK) < 1) return -ENODEV; urb = alloc_isoc_urb(hdev, skb); From patchwork Wed Jan 22 05:19:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-chen Chuang X-Patchwork-Id: 859263 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB0FE1B21B9 for ; Wed, 22 Jan 2025 05:21:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737523265; cv=none; b=LIn1+DyIU85jJe1Wavf2dBaMS5imu72qNJ2zHqEVi7rwRic0OJBaDC3qxvQyZfXT+2dZNX4Dqez/c5UYg8P9s8W10JL+8gL4qX/Cmvjl5Jna/7YbX77bqwRcyZiUTziKVG2TTLhtXObWfBPQCQ1vwoIhEuFzyrpBdDiWDP3NECg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737523265; c=relaxed/simple; bh=poaqfkUzMZteBhA3p2wev2L5Jd8N4zmJsyXFhj09v/E=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=RoYFVn0C3jEY6InXa+OMDz/8WMO1rKtsol2Ktof+K4CxzmclpnLrYgogHtkbma6/B3a0JpMTepBRY7z3ZuHotzoY32rZqnhu7v/me7ACNeDznb0su30MxY1062VSLDu9/nNPRBERwXAjKjXUdizHf6x4rbHCG6j6lSQADg3PH9M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--chharry.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ikbJ5Mth; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--chharry.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ikbJ5Mth" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2ef9e38b0cfso12017548a91.0 for ; Tue, 21 Jan 2025 21:21:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737523263; x=1738128063; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=PX9yvCtr2TcNqeiJ4lqz63HCE5uIjiI2N7GzbWV/vdk=; b=ikbJ5MthB7uUNBZo1jWNfNYrHoJUzMS6xDgpg74pPbn4o7JTlqo10CE9OspW1Q/LgC /hTzDCfojLXfbDymNWxLlrz2VIK/p3Sf/6L8DVD9tf05fYFleJW5HhlQBOs6XXTylSyv BN9OdEBUm5q3YKz+g/FJGs9IOfbeSKQMvV9KWeGAxi80Q2nWm9gEzuCV2chqQd8xjAYA HgwWhzS3RG/523vMPO7P63/96VhW8MlXVY+xo3HvmcLCV0Gyb7nG5FE9TwzATl4mJs8W sgFGYpWnUIRvm+029UXb6n5rxuRb/hQEm1e4JjPkHZ/fpYVq4jlyaV12jkliBKBemGzf VFJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737523263; x=1738128063; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PX9yvCtr2TcNqeiJ4lqz63HCE5uIjiI2N7GzbWV/vdk=; b=V4YTVfQLiv9LE9/wMU6iwZ1B2rIN9FbHIDffPFHxby7MN7kyhvhgd5poKP2kdUojO9 1UoZDlY5O+FIdwe3sf6/H0hDgCDyBEZBwyBH/fiEZtDT+1GBm+9UH87Mdnl6rvw2pvQr fwWU3AKOIq7FzUF4HcL5lJV94EsoG2OimvcaCqQM9189eQVp3Au/Fr6yZzxntAVe/8fb 0awPZjrytAO55VoYXLaaiSB47tq0s3GLSN4KQkHzJQKi9wYzPe0ILZaCi6ffZe/Eg9fz GY+OxgsOAOgLAN5DxjYhFkVV0C+xiZzEtPM9S2NfFI3vAi52Hx/46c70tZLdRKnEGMW1 DQqw== X-Gm-Message-State: AOJu0YyJQLuGDFptB+oOs0YU6WxCqVnGjLUOCPQfi6+T//X6yw1XA/gy UO5GURxcwc2hSAGnMnjPralOXntwjGkWoCvOo90nS0mAibrfJjxB82Ig1F647GY4ipvHt94PyN9 I1a4/ivnpDRmx6RyGo6nTT4Mi773Yexh1XmNbOr/2RjPYwWWFyKSS+Mtc4RAfsQAbC1bWfY2y+4 RGm21KFdR7jZ8T3bR9P3KI9Yxa6MjzcphBEM3zMzxw3yfFytYF3w== X-Google-Smtp-Source: AGHT+IFfG4tEL3lbiYTMu0wVU1MvXopkr4Ek6RwDkFbI4cp+BVUOKM//0hEp9J9P/dM1bseC9zknIqgpCq0b X-Received: from pfbcq19.prod.google.com ([2002:a05:6a00:3313:b0:728:c6d8:5683]) (user=chharry job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:3487:b0:725:456e:76e with SMTP id d2e1a72fcca58-72daf94f68dmr27246422b3a.6.1737523263257; Tue, 21 Jan 2025 21:21:03 -0800 (PST) Date: Wed, 22 Jan 2025 13:19:27 +0800 In-Reply-To: <20250122131925.v2.1.If6f14aa2512336173a53fc3552756cd8a332b0a3@changeid> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250122131925.v2.1.If6f14aa2512336173a53fc3552756cd8a332b0a3@changeid> X-Mailer: git-send-email 2.48.1.262.g85cc9f2d1e-goog Message-ID: <20250122052100.2410368-1-chharry@google.com> Subject: [PATCH v2 3/3] Bluetooth: Add ABI doc for sysfs isoc_alt From: Hsin-chen Chuang To: linux-bluetooth@vger.kernel.org, luiz.dentz@gmail.com Cc: chromeos-bluetooth-upstreaming@chromium.org, Hsin-chen Chuang , Johan Hedberg , Marcel Holtmann , linux-kernel@vger.kernel.org From: Hsin-chen Chuang The functionality was completed in commit 5e5c3898ef49 ("Bluetooth: Fix possible race with userspace of sysfs isoc_alt") Fixes: 5e5c3898ef49 ("Bluetooth: Fix possible race with userspace of sysfs isoc_alt") Signed-off-by: Hsin-chen Chuang --- (no changes since v1) Documentation/ABI/stable/sysfs-class-bluetooth | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-class-bluetooth b/Documentation/ABI/stable/sysfs-class-bluetooth index 36be02471174..8cc5f3cfe133 100644 --- a/Documentation/ABI/stable/sysfs-class-bluetooth +++ b/Documentation/ABI/stable/sysfs-class-bluetooth @@ -7,3 +7,17 @@ Description: This write-only attribute allows users to trigger the vendor reset The reset may or may not be done through the device transport (e.g., UART/USB), and can also be done through an out-of-band approach such as GPIO. + +What: /sys/class/bluetooth/hci/isoc_alt +Date: 22-Jan-2025 +KernelVersion: 6.13 +Contact: linux-bluetooth@vger.kernel.org +Description: This attribute allows users to configure the USB Alternate setting + for the specific HCI device. Reading this attribute returns the + current setting, and writing any supported numbers would change + the setting. See the USB Alternate setting definition in Bluetooth + core spec 5, vol 4, part B, table 2.1. + If the HCI device doesn't support USB Alternate setting + configuration, the read/write fails with -ENODEV. + If the data is not a valid number, the write fails with -EINVAL. + The other failures are vendor specific.