Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp34406pxb; Sun, 15 Aug 2021 22:24:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPtoI7YMDOb/oV5858Aenk8RDgWtdIYaad2vYtO14ka2GayChC8Fb0qgBCEc06B8aqGy4C X-Received: by 2002:a05:6e02:5c8:: with SMTP id l8mr10720054ils.282.1629091450253; Sun, 15 Aug 2021 22:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629091450; cv=none; d=google.com; s=arc-20160816; b=hEyNB4fYZmeqSBMPECiXTPlkW2n7WV/1IKeewzH0Z4hHSMrxJAWX6BfLxH9v1j4ZCO 5vNXXhv6z8ce/qz0fY+7YuzEBc9O98SchwO0X+YEPZgg8dehjpyKOYTEMLSaIIJal82l EahT7J1nZrnAlYMr5OErHUdBwFq7qd1WcYS4XO270MJ/wnKFi0kjI4fDf/FrsMFxqdG1 R+awlm+ubamLlIECDEBAs4VvDQfRo7Hwifo1YVBrBESChyw23yYzCEAVO3XsR8w9MMFC CQaMECD7qsRNhZhouOYvQH6y/ULt8WgglmMeB2U78SW7Bl9/XUyfFRqPe75ud9Ss0syA N04Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:dmarc-filter :sender:dkim-signature; bh=B4Kwshb6u/Zp9MjX8i6MMjsGcCKj7AX0jXcmoUSpJSk=; b=a4qDVmavkXukHk4GSYa+qvGaT2VJcdS29bjuTg9Qr9Nv0ahWPG9j7PmkGFPRzwLI4Y VyCsFBm5BFlspbdn1hS33mcCKm+pErn812229IwYJpPh8yMaHXI+lYZgwkCgKLZPpVuP 8E8CzsLe5lZY/QDP4zp8OAq9Sxf1wu61yHywbXW3wYlsPm32xWOn2hLS6UrQsAIzMxdf aRlomlOfd/rg0uTdJIFT0E+yOujmhb8jSyW7nIVup2tTTJb4FCrqc1J6VY3/qr2+kOv1 nMaM/RmwHkuMAP5RyLwPayz3YZE4whKSq9PW1SOIsYY1dKnL5Jlg11AaR1QhRuSwfNbi QHvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=D1sDpFrj; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si10490152ily.49.2021.08.15.22.23.58; Sun, 15 Aug 2021 22:24:10 -0700 (PDT) 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=@mg.codeaurora.org header.s=smtp header.b=D1sDpFrj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229523AbhHPFW2 (ORCPT + 99 others); Mon, 16 Aug 2021 01:22:28 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:23543 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbhHPFW2 (ORCPT ); Mon, 16 Aug 2021 01:22:28 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1629091317; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=B4Kwshb6u/Zp9MjX8i6MMjsGcCKj7AX0jXcmoUSpJSk=; b=D1sDpFrjeHgCP4aD4iLXAGM+pI79LL9bPJ+eIL8s4ztgnOKi3RxQwsR8C2acUHxaK5cJJDA9 BrwPnnwCMQf1FfQI7plsLr0og5j/Aa9q6Fsh2BEpj2H6l8vFN4MEkIWjPae7NLEjKZpIEQPm C+SQxPuRvxtlm0My8lDbts7/ou0= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 6119f5f4b14e7e2ecbb5a6e3 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 16 Aug 2021 05:21:56 GMT Sender: bgodavar=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 74651C4360C; Mon, 16 Aug 2021 05:21:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from bgodavar-linux.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: bgodavar) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3EC5AC4338F; Mon, 16 Aug 2021 05:21:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 3EC5AC4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Balakrishna Godavarthi To: marcel@holtmann.org, johan.hedberg@gmail.com Cc: mka@chromium.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, hemantg@codeaurora.org, linux-arm-msm@vger.kernel.org, pharish@codeaurora.org, rjliao@codeaurora.org, hbandi@codeaurora.org, abhishekpandit@chromium.org, mcchou@chromium.org, Balakrishna Godavarthi Subject: [PATCH] Bluetooth: hci_qca: Set SSR triggered flags when SSR command is sent out Date: Mon, 16 Aug 2021 10:51:42 +0530 Message-Id: <1629091302-7893-1-git-send-email-bgodavar@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); + } + spin_lock_irqsave(&qca->hci_ibs_lock, flags); /* Don't go to sleep in middle of patch download or -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project