Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp457150pxb; Mon, 16 Aug 2021 09:12:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjxKZkropyITUtsXGO0ti4gCxUl1Q3QcGEZGMSGffPu3pxe38HUkrnCPKaz6XUF4MRhKSK X-Received: by 2002:a17:906:ae51:: with SMTP id lf17mr14635771ejb.161.1629130334039; Mon, 16 Aug 2021 09:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629130334; cv=none; d=google.com; s=arc-20160816; b=M2pfSFi2eJn0wctAZsRvW+1cP3YADyOpTa3hMAMlo14F0ARqSQJMB0hAv7h7+lbgKa JGXSnX4GaWliC1nyaCsjIwFI1R8tycsLkNdXkKziY5eiYTKJ2wjVMIZiELeVB4/HGzO0 mDWgWUAoREBRw2OoZEdv2bOCqkqFYkZLd58hra7F3xjXrKeEDKdXr7/m1U3YnmIk70S2 UUHlxDKVuVN1iZkBmPI13yWpw85yY55VdT1H8KdA/nF8euEEUNT0p/nb80HCIumsl2vc AlinuIDo7b7DPfuy07TQTkrKFv90Cvcn/raxw4CtDKTunNqm4Crna9MDeMJt/5VTpc80 NQKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=yX6giCxlauSdTjxobL6IEfLAd059KKsQLp+mf8fcPqY=; b=UvkJysnWZPo/sxmVaEufpE8wgNOGtDYXPxsTYZuIgLPToFmtyFe2k/AUsb2RfSMFHu 6wpgrtHguKsMXh/5GJARx0K2d5SsDklLXKVdmUZfudAKJB1o/fk/DjAHO+TyNaNg0gig 5J2GIjggJXho/JaFDo/DQW3mfHW3Jsdkq+kxTTscT5/sCite7rMLZwu7KlHkQ4HaXs8T /7yCLnF1o/0M3VWOiDoO4bkOedGqbhQgP6bRMo0ImvRyFXx04bYfHJDKOcnnWa/GpEQd MavgUwRPb1h+ka9kCHCB+KuzKqc9TsoRbmrzD5xaZyxS2ldKnZ5mtVxENjy4L9Ai5vvL HRIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e17si7561254edz.297.2021.08.16.09.11.48; Mon, 16 Aug 2021 09:12:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230286AbhHPQIR convert rfc822-to-8bit (ORCPT + 99 others); Mon, 16 Aug 2021 12:08:17 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:55024 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230265AbhHPQIR (ORCPT ); Mon, 16 Aug 2021 12:08:17 -0400 Received: from smtpclient.apple (p5b3d23f8.dip0.t-ipconnect.de [91.61.35.248]) by mail.holtmann.org (Postfix) with ESMTPSA id 1EE19CECC8; Mon, 16 Aug 2021 18:07:44 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [PATCH] Bluetooth: hci_qca: Set SSR triggered flags when SSR command is sent out From: Marcel Holtmann In-Reply-To: <1629091302-7893-1-git-send-email-bgodavar@codeaurora.org> Date: Mon, 16 Aug 2021 18:07:43 +0200 Cc: Johan Hedberg , Matthias Kaehlcke , open list , "open list:BLUETOOTH SUBSYSTEM" , Hemantg , MSM , pharish@codeaurora.org, Rocky Liao , hbandi@codeaurora.org, abhishekpandit@chromium.org, mcchou@chromium.org Content-Transfer-Encoding: 8BIT Message-Id: <1CE27E9C-EABD-4B25-B255-8925297D11BD@holtmann.org> References: <1629091302-7893-1-git-send-email-bgodavar@codeaurora.org> To: Balakrishna Godavarthi X-Mailer: Apple Mail (2.3654.120.0.1.13) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Balakrishna, > This change sets SSR triggered flags when QCA SSR command is sent to > SoC. After the SSR command sent, driver discards the incoming data from > the upper layers. This way will ensure to read full dumps from the > BT SoC without any flow control issues due to excess of data receiving > from the HOST in audio usecases. > > Signed-off-by: Balakrishna Godavarthi > --- > drivers/bluetooth/hci_qca.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c > index 53deea2..5cbed6a 100644 > --- a/drivers/bluetooth/hci_qca.c > +++ b/drivers/bluetooth/hci_qca.c > @@ -69,6 +69,8 @@ > #define QCA_LAST_SEQUENCE_NUM 0xFFFF > #define QCA_CRASHBYTE_PACKET_LEN 1096 > #define QCA_MEMDUMP_BYTE 0xFB > +#define QCA_SSR_OPCODE 0xFC0C > +#define QCA_SSR_PKT_LEN 5 > > enum qca_flags { > QCA_IBS_DISABLED, > @@ -871,6 +873,14 @@ static int qca_enqueue(struct hci_uart *hu, struct sk_buff *skb) > /* Prepend skb with frame type */ > memcpy(skb_push(skb, 1), &hci_skb_pkt_type(skb), 1); > > + if (hci_skb_pkt_type(skb) == HCI_COMMAND_PKT && > + skb->len == QCA_SSR_PKT_LEN && > + hci_skb_opcode(skb) == QCA_SSR_OPCODE) { > + bt_dev_info(hu->hdev, "Triggering ssr"); > + set_bit(QCA_SSR_TRIGGERED, &qca->flags); > + set_bit(QCA_MEMDUMP_COLLECTION, &qca->flags); > + } > + can we please stop hacking around by parsing opcodes in an enqueue function. Sounds like someone is injecting raw HCI vendor commands and then having a driver react to it. Regards Marcel