Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5147820pxb; Sun, 7 Nov 2021 06:11:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2hwego8xmBPZYfWsM3U66plZkv17mJwW1f1IeMJfpSbJuF64AWl2RCOV5e4dribuP2NEl X-Received: by 2002:a05:6602:2ccc:: with SMTP id j12mr8590148iow.138.1636294301740; Sun, 07 Nov 2021 06:11:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636294301; cv=none; d=google.com; s=arc-20160816; b=xNqnxu3jvn3SXvmOdivWa/siYHZnpwr49P3RQYkzwyCCQ5QUORGFRzhjgWz/h8oywk IKF0Gk/cou910wlSpHT2gxmea++5ayc95WPs3sDjCgsEt+0P2Z/Clwy+CPmhC98p4ah1 YGFE12AVTSz95atyRhj59T5Vx+WTVb3f3JSgBS2LyyGD/Yf3HmdOlEYu6e4ut8d1Wk0m UT2C410i6YziGijiAiTxytFyREa7kH7O7J640+EvaSTV833PuW0CzLVsIwdWHyw4j11y uaWzEPv5iZ1FNnqFHZso9l16Q/bT04wiy/BDkHLTGO1fhorTGPQNSVd2DRzS2kzEm9wJ Qt1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=L/j4faggOCaUSS+dguQPjivP6TQjj639YqR+h2amJuI=; b=Izv4LWBUCefDOKy2v1lPd5WtA8cBk5CAN++5vRjzcKE0H91cB8BN+wA9hf66ijNlPh x/18Xf7Njbz8EMV+20dodMZ/8A4QISfzNgWPMo0f3t4lZLOlytHm0VSLpZhZk4mPzVLF WlxsCsiPKWhyLSKNr37ekxhfvyvtNJAP/TPcFVUZSHLniJ/vtOD0pkaSkIStE58V+1uQ 44I+M8hHb92zL7ME4UdR1N/7m/e5a89Kezm/Hj/41ZoGoxmYhwr/7Gcaqygir8z7IeB2 +X0HKbVo98Z+09IzFI2svljaP5OgtgJMZ8iqbZEbf7AOoqRZDO56TW4GTsjS8xT7qwJW LOtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=f1fajxlz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si27540922ilu.49.2021.11.07.06.11.29; Sun, 07 Nov 2021 06:11:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=f1fajxlz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234323AbhKGD2W (ORCPT + 99 others); Sat, 6 Nov 2021 23:28:22 -0400 Received: from mail-4319.protonmail.ch ([185.70.43.19]:16161 "EHLO mail-4319.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230487AbhKGD2U (ORCPT ); Sat, 6 Nov 2021 23:28:20 -0400 Date: Sun, 07 Nov 2021 03:25:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1636255536; bh=L/j4faggOCaUSS+dguQPjivP6TQjj639YqR+h2amJuI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=f1fajxlzzB2UrvNW4zVFwyItm4qJq2A36sLrmOXh6Qc8xPHwFTC0A2AMwmVnKiwk5 bU8hl2uyy/y2m4ljWRZyX6vukr4wQSGqLY9FgGxVsWU95XlPpaG1Rt/fDNI9SlChtv mwJTvf/lAktpmQ/KHV87lzVlLYsduWyA2CUnCw+k= To: Luiz Augusto von Dentz From: Orlando Chamberlain Cc: Daniel Winkler , Johan Hedberg , "linux-bluetooth@vger.kernel.org" , Linux Kernel Mailing List , Marcel Holtmann , regressions@lists.linux.dev, Sonny Sasaka Reply-To: Orlando Chamberlain Subject: Re: [PATCHv2] Bluetooth: quirk disabling LE Read Transmit Power Message-ID: <20211107032525.76a5f347@localhost> In-Reply-To: References: <4970a940-211b-25d6-edab-21a815313954@protonmail.com> <20210930063106.19881-1-redecorating@protonmail.com> <20210930141256.19943-1-redecorating@protonmail.com> <275acce4-9eab-9cba-7145-5a75a69ca530@protonmail.com> <20211001083412.3078-1-redecorating@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 06 Nov 2021 08:47:39 +1100 "Luiz Augusto von Dentz" wrote: > Nowadays it is possible to treat errors such like this on a per > command basis (assuming it is not essential for the init sequence): >=20 > diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h > index 979da5179ff4..f244f42cc609 100644 > --- a/include/net/bluetooth/hci.h > +++ b/include/net/bluetooth/hci.h > @@ -551,6 +551,7 @@ enum { > #define HCI_LK_AUTH_COMBINATION_P256 0x08 >=20 > /* ---- HCI Error Codes ---- */ > +#define HCI_ERROR_UNKNOWN_CMD 0x01 > #define HCI_ERROR_UNKNOWN_CONN_ID 0x02 > #define HCI_ERROR_AUTH_FAILURE 0x05 > #define HCI_ERROR_PIN_OR_KEY_MISSING 0x06 > diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c > index bb88d31d2212..9c697e058974 100644 > --- a/net/bluetooth/hci_sync.c > +++ b/net/bluetooth/hci_sync.c > @@ -3325,11 +3325,18 @@ static int > hci_le_read_adv_tx_power_sync(struct hci_dev *hdev) > /* Read LE Min/Max Tx Power*/ > static int hci_le_read_tx_power_sync(struct hci_dev *hdev) > { > + int status; > + > if (!(hdev->commands[38] & 0x80)) > return 0; >=20 > - return __hci_cmd_sync_status(hdev, > HCI_OP_LE_READ_TRANSMIT_POWER, > - 0, NULL, HCI_CMD_TIMEOUT); > + status =3D __hci_cmd_sync_status(hdev, > HCI_OP_LE_READ_TRANSMIT_POWER, > + 0, NULL, HCI_CMD_TIMEOUT); > + /* Ignore if command is not really supported */ > + if (status =3D=3D HCI_ERROR_UNKNOWN_CMD) > + return 0; > + > + return status; > } >=20 > /* Read LE Accept List Size */ I've tried this patch, and status seems to be -56, not 0x01, but if I change +=09if (status =3D=3D HCI_ERROR_UNKNOWN_CMD) to +=09if (status =3D=3D -56) It ignores the error and continues. I seem to have an unrelated problem where although I can connect to my Logitech MX Anywhere 2S mouse (I haven't tried any other devices yet), it doesn't move the cursor or register clicks. I've also noticed that bluetoothctl pair isn't asking for a "yes" when I pair a device, which it was doing on 5.15 (with the patch I sent to get bluetooth working at all). I've put dmesg and btsnoop for both 5.15 and bluetooth-next into a gist here: https://gist.github.com/Redecorating/5620b758d8191418cf19879d09672cf4 but I think this is a separate issue. >=20 > Anyway, it would probably be worth pointing out to the vendor they > have a broken firmware if they do mark the command as supported but > return such error. Do you know if it'd be better to contact Broadcom or Apple for this? > -- > Luiz Augusto von Dentz --=20