From patchwork Mon Aug 17 15:15:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266145 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, 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 D8AE7C433E3 for ; Mon, 17 Aug 2020 18:49:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2CFE204EC for ; Mon, 17 Aug 2020 18:49:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597690171; bh=mHp6ZsqzH9SBdhzTJtoNllssucJjMrlq2tRy/eT2H7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SYJyGasU9+z12X0OuA5BZtKqkLf/jT3ZvTyqGEYB79BoZs96BBzcWKH4JbZEccMsh k3TAFfSyHhIj+D7gGc3/WkBYdC2H/FGdAkFufsCtGT+XjuJejsm+vmbJE4ArhfCHAh oq5tP4D2u+eIvUYeiwKvqL7IvJOoiTvhp6daAP8Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387989AbgHQStb (ORCPT ); Mon, 17 Aug 2020 14:49:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:41914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387984AbgHQPyX (ORCPT ); Mon, 17 Aug 2020 11:54:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 871272063A; Mon, 17 Aug 2020 15:54:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679663; bh=mHp6ZsqzH9SBdhzTJtoNllssucJjMrlq2tRy/eT2H7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wXquvG7VIFDTPb1FXASjbbZafN+YkW7xDlaCtWpiiogpeZyd+0aHUvGTiVu8Hw0yY L6NKgiiboQba+A6ZaQ1b2WBmEHQ4sdA9Xb0OVjfA1n2nqBt4xkxdfB6HQ1UCm63DkJ jnryGHLqZxSAvSteNBwd1fU4QbiCiztUahyWxypA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Venkata Lakshmi Narayana Gubba , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.7 260/393] Bluetooth: hci_qca: Stop collecting memdump again for command timeout during SSR Date: Mon, 17 Aug 2020 17:15:10 +0200 Message-Id: <20200817143832.222977492@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Venkata Lakshmi Narayana Gubba [ Upstream commit 58789a1990c1a849a461ac912e72a698a771951a ] Setting memdump state to idle prior to setting of callback function pointer for command timeout to NULL,causing the issue.Now moved the initialisation of memdump state to qca_setup(). Fixes: d841502c79e3 ("Bluetooth: hci_qca: Collect controller memory dump during SSR") Signed-off-by: Venkata Lakshmi Narayana Gubba Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/hci_qca.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 9869ae0f7b71e..6a3c80e1b19cd 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -1633,6 +1633,8 @@ static int qca_setup(struct hci_uart *hu) bt_dev_info(hdev, "setting up %s", qca_is_wcn399x(soc_type) ? "wcn399x" : "ROME"); + qca->memdump_state = QCA_MEMDUMP_IDLE; + retry: ret = qca_power_on(hdev); if (ret) @@ -1776,9 +1778,6 @@ static void qca_power_shutdown(struct hci_uart *hu) qca_flush(hu); spin_unlock_irqrestore(&qca->hci_ibs_lock, flags); - hu->hdev->hw_error = NULL; - hu->hdev->cmd_timeout = NULL; - /* Non-serdev device usually is powered by external power * and don't need additional action in driver for power down */ @@ -1800,6 +1799,9 @@ static int qca_power_off(struct hci_dev *hdev) struct qca_data *qca = hu->priv; enum qca_btsoc_type soc_type = qca_soc_type(hu); + hu->hdev->hw_error = NULL; + hu->hdev->cmd_timeout = NULL; + /* Stop sending shutdown command if soc crashes. */ if (qca_is_wcn399x(soc_type) && qca->memdump_state == QCA_MEMDUMP_IDLE) { @@ -1807,7 +1809,6 @@ static int qca_power_off(struct hci_dev *hdev) usleep_range(8000, 10000); } - qca->memdump_state = QCA_MEMDUMP_IDLE; qca_power_shutdown(hu); return 0; }