From patchwork Wed Jul 5 13:29:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1803686 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=kmi3EFAm; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qx0qt4mbtz20ZQ for ; Wed, 5 Jul 2023 23:29:14 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qH2ZB-0004sr-NB; Wed, 05 Jul 2023 13:29:09 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qH2Z9-0004sk-Nv for kernel-team@lists.ubuntu.com; Wed, 05 Jul 2023 13:29:07 +0000 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 5D30A3F10B for ; Wed, 5 Jul 2023 13:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1688563747; bh=1gPliFC53onPOR3Milabk/oTaoUljxxiJDIsuVl9QR4=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=kmi3EFAmlBVHq3OdqXl3eZNiIL16+UzQ31Ycp+KZyCybKWnmP/GQIJ/RvK5YJBokX hFWtOJ58zp0pFKsJYqjF4UJY1BS0Dk7HLPrOa9Ndgn15WMXDtk8wvm4TKcs2diuuAP HcahCr9Dyonp/b6c5Au2BgUbZ/w/nyAgRNDQkYegY0XudM9lz+V+row4z3pHwJKxYo 5n2MSvoveDBMoxRxcLb3LuCaNw3LPc1Xm/a4L0SjNGr/5c25NzVP6aZ3tHsH0gOT8k ZXLEclckxibsIlyhnk13EwpR1zzecpqH2EUaoUHulaskU+B5zBYKMipzRDAJYK58ui zUKG7wxFH8yKA== Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-94a355c9028so460990266b.3 for ; Wed, 05 Jul 2023 06:29:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688563747; x=1691155747; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1gPliFC53onPOR3Milabk/oTaoUljxxiJDIsuVl9QR4=; b=XG5Gg6Dmva+H0d0lPCw0y6QR0qm8omHT3WT5itycIDhtz3uqSJTUzXqvNk1GcJjHdO 9ELd3/cjKy3hRPPRK74FsdKdcDT1G4zdsIPKkbiiOlpbWX/sWUSYNskuC+v9PEk1sgEp MvrWIqzNVBgpyFA8hK+/hceJXNdm/9pqFZVkYRFyPT6Sj94fJzhdXiGGFKsj5oLCnsdD 6Uu/5TjcKUnziZnK6+pI3Findeh9DuToFXTlnFnH8sW/8mTDLBCXnOTvKQ2FC1vWYRax XmQrpOIn+IBdH+HSwRUwpJ+2NnI2Az9ZDDzGkntsIGRxvGX/2g0p64Vh3zUPEqWCdbwk UNDg== X-Gm-Message-State: ABy/qLYXOJNdL5NCNQvqKYMeRHFQ8Egr5TOZq4d1xyG/0xuN7jBW0be6 YibCYVZkSjdDeAAPguo1coykwCI78ciQt/sQsp3Zt8FeChccgpJU0/9/c+WbaV3S3l0L5FbG8m1 It63qB2yCe1fyNCfxrJpgSJ7RO0uA3/nwaXx0w4/ovbUqfoCPHA== X-Received: by 2002:a17:906:393:b0:98e:26ae:9b01 with SMTP id b19-20020a170906039300b0098e26ae9b01mr11023186eja.65.1688563746366; Wed, 05 Jul 2023 06:29:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlH6KmAqtemQ4PJHQ1XBHMab2VXk6V9hXw+eVNUCAPvQF5vLAcQF80ubVp5dSXAKyL2l2hEUwA== X-Received: by 2002:a17:906:393:b0:98e:26ae:9b01 with SMTP id b19-20020a170906039300b0098e26ae9b01mr11023173eja.65.1688563746045; Wed, 05 Jul 2023 06:29:06 -0700 (PDT) Received: from localhost ([194.191.244.86]) by smtp.gmail.com with ESMTPSA id p20-20020a170906605400b0098ec690e6d7sm12983408ejj.73.2023.07.05.06.29.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jul 2023 06:29:05 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][J][PATCH] Bluetooth: btrtl: Ask ic_info to drop firmware Date: Wed, 5 Jul 2023 15:29:04 +0200 Message-Id: <20230705132904.22661-1-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Hilda Wu BugLink: https://bugs.launchpad.net/bugs/2026028 Some un-support wakeup platforms keep USB power and suspend signal is coming late, this makes Realtek some chip keep its firmware, and make it never load new firmware. So use vendor specific HCI command to ask them drop its firmware after system shutdown or resume. Signed-off-by: Hilda Wu Signed-off-by: Marcel Holtmann (cherry picked from commit cd36742a957c37f6cd17124dac6dd1d61aeba4ab) Signed-off-by: Juerg Haefliger Acked-by: Tim Gardner Acked-by: Andrei Gherzan Acked-by: Roxana Nicolescu --- drivers/bluetooth/btrtl.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c index 1f8afa0244d8..60ddba8962ff 100644 --- a/drivers/bluetooth/btrtl.c +++ b/drivers/bluetooth/btrtl.c @@ -594,8 +594,10 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, hci_rev = le16_to_cpu(resp->hci_rev); lmp_subver = le16_to_cpu(resp->lmp_subver); - if (resp->hci_ver == 0x8 && le16_to_cpu(resp->hci_rev) == 0x826c && - resp->lmp_ver == 0x8 && le16_to_cpu(resp->lmp_subver) == 0xa99e) + btrtl_dev->ic_info = btrtl_match_ic(lmp_subver, hci_rev, hci_ver, + hdev->bus); + + if (!btrtl_dev->ic_info) btrtl_dev->drop_fw = true; if (btrtl_dev->drop_fw) { @@ -634,13 +636,13 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, hci_ver = resp->hci_ver; hci_rev = le16_to_cpu(resp->hci_rev); lmp_subver = le16_to_cpu(resp->lmp_subver); + + btrtl_dev->ic_info = btrtl_match_ic(lmp_subver, hci_rev, hci_ver, + hdev->bus); } out_free: kfree_skb(skb); - btrtl_dev->ic_info = btrtl_match_ic(lmp_subver, hci_rev, hci_ver, - hdev->bus); - if (!btrtl_dev->ic_info) { rtl_dev_info(hdev, "unknown IC info, lmp subver %04x, hci rev %04x, hci ver %04x", lmp_subver, hci_rev, hci_ver);