From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC492C433DF for ; Sun, 5 Jul 2020 19:53:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B815820739 for ; Sun, 5 Jul 2020 19:53:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RLWQnv0S"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rDPbtc8v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B815820739 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gKoQJkhU/9IYOLAEt5hPujlVQJumL4QV9RH9go7t+74=; b=RLWQnv0S1Fftzsq/Q1OBEJFRA OgV4vC4A7adSp6HRLWczLdOjzV9rEzs0DOxnf4EXUf8gjMXpTwtgd+Z31s0M2He0Z0ItglRDMsqXt SGzOP+Nm6KXFcQpNb75ZhUT5sIQU8lxOUWs9HJNRyTkxomgISr0FTjZa6iiUYjzogYChIOTFfskTz D5fW69T3ZKwp2lVS/nYuu2OpwrQGOR8o2+K4Y59Lr3CYYu8QeEgEweHj8aBzJJ74K0v++hOK3/c05 PLUJcheyzZSWAT24MHRtwhrXSwAPk6BK2u8G/fnUjzNYA9HmxOwzitEYVVYu/fyDrXTjUtciCJuB9 fjPcgDx9w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jsAfs-0007ni-FT; Sun, 05 Jul 2020 19:51:40 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jsAfm-0007ln-JX for linux-arm-kernel@lists.infradead.org; Sun, 05 Jul 2020 19:51:35 +0000 Received: by mail-pg1-x541.google.com with SMTP id t6so17428462pgq.1 for ; Sun, 05 Jul 2020 12:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7RJ6rE3+V5FkJZxVb3v+pVHBk2ZYQcboCzbdh+i0x+E=; b=rDPbtc8vdEMGwEPSHOV5kjTzILxUmRSxurBdo2x2VNrnCmNg2CA4bK0En8Ox5voIVu jflBYMA4ESDAWl5Z5xfAI1Z0QOsgQFDF+9EILJPiVkk7sbSYqF+PGpppNvj28yCpvV1e J3uX+qBHX8q98F9wSaUQxa1WzQBoq7FP2jsovR3BMmfkY+GRu6HXMA0LRHtTJuZ1/KPr ROQRuXbp4XcX2Cuj7m5cpn9QaxXC/kdiSpQdHsNsHVDwtHf009y0ToxFBFQ+AGfulJJ/ QWwblLBZYGdcv/RLUYKFXpvuuTg0YzYH0IAVca3Wb435JlEfrsATbmwoSu+6K0pgbVVU jATg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7RJ6rE3+V5FkJZxVb3v+pVHBk2ZYQcboCzbdh+i0x+E=; b=p9R44oANonZGxvJvqnGbxtr1UzJ8aLknKC5UE4w0FZ+sfjMFDsd3J29WvN1B3SDirb j4yelIJxoV90HZeZMDBFDEN1eIoa6bi3WTeR2OrhpcLXwASH0Re0ls4T4KLJM5uU1GsM uYjWDijTSAGnsxcc/z9Ll/5cSi4aHJbm0ZmovHMoR0+DcWi6AefWNEQR9gNtUEbdSdwJ uBL4NN22znLg3s978zgeiaq17zBGZJmMAkXrPqGOJ7Tes11B6nj+dsmVr1FV+OU/gVvt hF781UNGUwAdLCHZWaM/CXUjA1h1rhAoqujQ974E1N1jpEBeskIDh8eg+0Ozcqnn7sSs hatA== X-Gm-Message-State: AOAM531d1I/yc3nDkym/ia34ibXvkDp0wJz7M7+9YCXijAvmmye+fv17 XP0OrermMIVMxdjqxrJz6KY= X-Google-Smtp-Source: ABdhPJyx/0NFcW6FSUxmSN3DKYwTjkoKbr6mmBjMln0ATSOvaHAugjHxaxi03vs9u8Jiv8C8NEH4gQ== X-Received: by 2002:a63:4b04:: with SMTP id y4mr37299434pga.158.1593978690666; Sun, 05 Jul 2020 12:51:30 -0700 (PDT) Received: from anarsoul-thinkpad.lan (216-71-213-236.dyn.novuscom.net. [216.71.213.236]) by smtp.gmail.com with ESMTPSA id g9sm16072879pfm.151.2020.07.05.12.51.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 12:51:30 -0700 (PDT) From: Vasily Khoruzhick To: Rob Herring , Maxime Ripard , Chen-Yu Tsai , Marcel Holtmann , Johan Hedberg , "David S. Miller" , Jakub Kicinski , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, Ondrej Jirman Subject: [PATCH 1/3] Bluetooth: Add new quirk for broken local ext features max_page Date: Sun, 5 Jul 2020 12:51:08 -0700 Message-Id: <20200705195110.405139-2-anarsoul@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200705195110.405139-1-anarsoul@gmail.com> References: <20200705195110.405139-1-anarsoul@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200705_155134_716191_474EB398 X-CRM114-Status: GOOD ( 14.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasily Khoruzhick Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some adapters (e.g. RTL8723CS) advertise that they have more than 2 pages for local ext features, but they don't support any features declared in these pages. RTL8723CS reports max_page = 2 and declares support for sync train and secure connection, but it responds with either garbage or with error in status on corresponding commands. Signed-off-by: Vasily Khoruzhick --- include/net/bluetooth/hci.h | 7 +++++++ net/bluetooth/hci_event.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 16ab6ce87883..8e4c16210d18 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -227,6 +227,13 @@ enum { * supported. */ HCI_QUIRK_VALID_LE_STATES, + + /* When this quirk is set, max_page for local extended features + * is set to 1, even if controller reports higher number. Some + * controllers (e.g. RTL8723CS) report more pages, but they + * don't actually support features declared there. + */ + HCI_QUIRK_BROKEN_LOCAL_EXT_FTR_MAX_PAGE, }; /* HCI device flags */ diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index cfeaee347db3..df3232828978 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -700,7 +700,9 @@ static void hci_cc_read_local_ext_features(struct hci_dev *hdev, if (rp->status) return; - if (hdev->max_page < rp->max_page) + if (!test_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FTR_MAX_PAGE, + &hdev->quirks) && + hdev->max_page < rp->max_page) hdev->max_page = rp->max_page; if (rp->page < HCI_MAX_PAGES) -- 2.27.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel