From patchwork Tue May 29 12:00:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10435107 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2E2B1602CC for ; Tue, 29 May 2018 12:00:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E63F28724 for ; Tue, 29 May 2018 12:00:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1305728733; Tue, 29 May 2018 12:00:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D17E28724 for ; Tue, 29 May 2018 12:00:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933562AbeE2MAo (ORCPT ); Tue, 29 May 2018 08:00:44 -0400 Received: from mail-by2nam03on0088.outbound.protection.outlook.com ([104.47.42.88]:23410 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933410AbeE2MAe (ORCPT ); Tue, 29 May 2018 08:00:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0UJHxIxtH2VEsZ85oyVwrfMry24lalBz4x/4E87BtO8=; b=M6vqz/YDml9hDKhn8UKfteGXNCQz0iwZeuHLNfldMASQE5OFjbYTw/y4RijPdaEWLCqE5p74reAQ+FUuKPcslFFGYcwKJfKsTBVOv+rgC33GZrMnegu0wyVlhBa4Kq0Xv11MuVsKBIFlC+LS19QQBnoIsJjL08lmdIN9qSa9SQc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BLUPR05MB1923.namprd05.prod.outlook.com (2a01:111:e400:52ad::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.5; Tue, 29 May 2018 12:00:27 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Andrey Shevchenko , Sergei Maksimenko , Dmitry Lebed Subject: [PATCH 5/9] qtnfmac: improve control path timeout handling Date: Tue, 29 May 2018 15:00:01 +0300 Message-Id: <20180529120005.21498-6-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180529120005.21498-1-sergey.matyukevich.os@quantenna.com> References: <20180529120005.21498-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM6PR03CA0031.eurprd03.prod.outlook.com (2603:10a6:20b::44) To BLUPR05MB1923.namprd05.prod.outlook.com (2a01:111:e400:52ad::13) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BLUPR05MB1923; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB1923; 3:+ae7JXffTG//b+AOa/NjyGX4ggSnp6VAvqGmtwx8Gpe5jUl7C8mhbZ655NvsiDwXQodsWA7ZcmWkgTXO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xWZ/D/eVqG9OaTPpXcVTsngCAnQKcWUmlvsx36jTmUNDE40KkLiPPi+7VAZTD3C09YNQ3U8WZD4m8lMbJG5Cy41ClVN+u4pbCpClfwY+gzUH9nMDArlnFZpq7VTAVfq4mpIbBVTvRaPlupfUDf7twVYcUvTayAOVdrCAvztUmfkfbbDFbRoOZrJqxCbm/zyEw+2d0UtbYmb9EgcSSIISGVHLPiG1YXoUKr9vJPJYv/Gz2PFrIFGctx8fplx1J0cV; 4:Omwp5DFPVArwHoYMj7wY6UUT3gWOVASUbYeiI2b8FS7GP9hOnIMexmUt5oalo4LU5fpJDi/v+MKECYP3ulzbOpMSMfiFruVm0VXEM3KrGJ2qBxbYT6FC8ah8GqsTjeRvjgqUDaxJw4zRoGx4wOtMf5+g/RCtE9+/oqXUD7v1sB6RkSDfb+cFI6cYLOZAgoF4EtXnIu6BvykfXQtG8525FTNaUqRFxesNrIBpTCgLcKlcsvtQSIctO9vnrD6tiQG84g95QUD0jPf4RvQilUrFWg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:BLUPR05MB1923; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB1923; X-Forefront-PRVS: 0687389FB0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(39840400004)(396003)(366004)(39380400002)(376002)(346002)(199004)(189003)(2361001)(2616005)(11346002)(51416003)(956004)(50466002)(107886003)(50226002)(48376002)(97736004)(446003)(478600001)(2906002)(476003)(86362001)(106356001)(81166006)(76176011)(66066001)(105586002)(3846002)(47776003)(6116002)(7696005)(486006)(81156014)(316002)(186003)(1076002)(53416004)(36756003)(25786009)(26005)(16526019)(103116003)(68736007)(54906003)(52116002)(6916009)(5660300001)(7736002)(69596002)(6666003)(305945005)(8676002)(16586007)(59450400001)(4326008)(386003)(2351001)(53936002)(8936002)(6486002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB1923; H:bars.quantenna.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB1923; 23:mj9OKkcluwAh61EsLTjEjYXjh2u1meVvV4jT5RXvj?= =?us-ascii?Q?3vS4YDSAi/2qhol1qfVHXAU/Mo9i+6zi3flK/ZzGOZG784t5I0MVEF21B1eO?= =?us-ascii?Q?Lpu6BfHw+pK68Wj5CNk+T4AxTODCenYbWBbgQhY1dDS/g5v3OwIPNQ0vU03o?= =?us-ascii?Q?vd9nEATSlsUyMSuoTc7VVBY2JX1X3kHJpSKljZx1ScyzVlm2OQ/iHOPbB6Sn?= =?us-ascii?Q?R7vpy5ZK+LS75qv1ptU3PfATqkDQe2efEtNRKoXl4xB8Mjn95mj5hxdv/cuK?= =?us-ascii?Q?QmcEetpOIFAbMBkdKosEDOXaYZmdOuAz4RrHxNaViaq/MNxqJm/hIYnGYdjP?= =?us-ascii?Q?5lBKttsj6A/EE7qQEQlonWkdgtmquiKnNovlMTxHE/zuglSONh/TkrEzYaA9?= =?us-ascii?Q?OklroZrHmOthaxO28WkLiPgbkMOOXpkHXo1qQX2L27dlv+Cr28wUbWZQDgm0?= =?us-ascii?Q?m+O174NBMZ9sjqFzGbe1T90zjp56TfDRzZhrsQrNMKAqfLP66vJToGRgfO+2?= =?us-ascii?Q?Z8FRsPF8ki1BbpQ8PYiUCt/rz23ta0pqusmHGvDMXXIQZeMH3du9MAYeJlV6?= =?us-ascii?Q?xcXZggtV6iMdpD0H/6hNfBmSacU7MXbl3PlPJK1/46Nlbc4U7k6L+HE2cX36?= =?us-ascii?Q?+JxvCffpOLNWztP26WnOz46qQlaQodC7xdjHzN2rbZXeoBwBblkHukS9GBHw?= =?us-ascii?Q?AOeIata0MC78raZGkv5Ck+pxhHvvXPjPJQ6hznyZSYxWpTu5kIJWPQPYjglx?= =?us-ascii?Q?+ao9dGiZyS1aUARTNJXCR3CU70lUiB8gfK8bkwg+dEWhBtq/ABV53rb9K8rd?= =?us-ascii?Q?93Yfvjp/5QlxYebeX4hpTQrFbzG1/uR3BZRMxwxutltGHh13Pqs6dQdnDVai?= =?us-ascii?Q?hifInDNTi8r1r3HuqC/JafVHvm2Lx1wGeaPRseWeXyTpqhOCYWnAq0qC5yEG?= =?us-ascii?Q?dl680p7zTyzEEHgpv6URD5sreYKcA2qtOh/Anf+je51c9d5nxvpU4hxnlqso?= =?us-ascii?Q?lSusuw9BfrIX9M7D6anEmyXikvlfaKyQ4zhUyXsWXHb42+bmna+90CzxXrTM?= =?us-ascii?Q?47Pjvwx6RtgScngxHQ1MFhBImlCJg9Ws9BVJ3xUJRbexUKbRpwSNXxMPL4Jy?= =?us-ascii?Q?eIvgrNxLhrFZlxSgOmtCNz9M3U/VygAs0LPmcYNv6PBoGEwVC4E2gaLhJkzC?= =?us-ascii?Q?9rC0QluviLWhCDavrlufv9LpYMokDOzb5u/RQLGZdk/4Wq4iQ/F0KvFEenpQ?= =?us-ascii?Q?TxeZg6FJfwNm2/7n5DttMPXUpw0XfrLMQ2MAv9M1BBjR3Vq+3wns6bcLrO3j?= =?us-ascii?Q?y00gTPzCg7oCExlx/TShcOzV9K3xHAxTG0x4+DVDn3E2YrzG3zgIWepWVafg?= =?us-ascii?Q?OsZOe7bVEN/M6GHecNWYEjp/CbbOAhZq5oEjdntkZP03IQn02pViheCWq3JG?= =?us-ascii?Q?l9u+bGHNk31MG5JhH1NFmuEWU6jtsA=3D?= X-Microsoft-Antispam-Message-Info: F4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7:WhdT8VJyYNK5wanus6RqBsDhiGbcKVQxymEwA0tCPpZqboP5ZCPsb3z0uWGDdYCyRImbWfIm/+Uma8NnQipVAEWBmIgb878LPpQY8avEFTIdxR6tfuBVssSt5upRyhmUHGdDIBNGgeuw5otl69Ucbq2gp4ZsNdoysv3Yn3tjmvZeCM69qqo0GglbSvpQYdRr1JjE1qWQFRD1M+jTjAgFUVSe46focpNI5dQrQrLGNjylxYzeeHTJEZss1RFjHlAB X-MS-Office365-Filtering-Correlation-Id: 7226b7c6-dc1e-4cbf-d3d5-08d5c55bc538 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2018 12:00:27.4605 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7226b7c6-dc1e-4cbf-d3d5-08d5c55bc538 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB1923 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dmitry Lebed Control path will not be operational after firmware failure. Change bus state to QTNF_FW_STATE_EP_DEAD after the control path timeout. Don't wait for timeout if control path is already dead. Signed-off-by: Dmitry Lebed --- drivers/net/wireless/quantenna/qtnfmac/bus.h | 3 ++- drivers/net/wireless/quantenna/qtnfmac/core.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/bus.h b/drivers/net/wireless/quantenna/qtnfmac/bus.h index 0a1604683bab..323e47cea1e2 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/bus.h +++ b/drivers/net/wireless/quantenna/qtnfmac/bus.h @@ -27,7 +27,8 @@ enum qtnf_fw_state { QTNF_FW_STATE_FW_DNLD_DONE, QTNF_FW_STATE_BOOT_DONE, QTNF_FW_STATE_ACTIVE, - QTNF_FW_STATE_DEAD, + QTNF_FW_STATE_DETACHED, + QTNF_FW_STATE_EP_DEAD, }; struct qtnf_bus; diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 3ccbc427cf56..a6a450984f9a 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -628,7 +628,7 @@ void qtnf_core_detach(struct qtnf_bus *bus) if (bus->fw_state == QTNF_FW_STATE_ACTIVE) qtnf_cmd_send_deinit_fw(bus); - bus->fw_state = QTNF_FW_STATE_DEAD; + bus->fw_state = QTNF_FW_STATE_DETACHED; if (bus->workqueue) { flush_workqueue(bus->workqueue); diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c index 6c1e139bb8f7..3120d49df565 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c @@ -751,8 +751,16 @@ static int qtnf_pcie_data_tx(struct qtnf_bus *bus, struct sk_buff *skb) static int qtnf_pcie_control_tx(struct qtnf_bus *bus, struct sk_buff *skb) { struct qtnf_pcie_bus_priv *priv = (void *)get_bus_priv(bus); + int ret; + + ret = qtnf_shm_ipc_send(&priv->shm_ipc_ep_in, skb->data, skb->len); - return qtnf_shm_ipc_send(&priv->shm_ipc_ep_in, skb->data, skb->len); + if (ret == -ETIMEDOUT) { + pr_err("EP firmware is dead\n"); + bus->fw_state = QTNF_FW_STATE_EP_DEAD; + } + + return ret; } static irqreturn_t qtnf_interrupt(int irq, void *data) @@ -1238,7 +1246,7 @@ static void qtnf_fw_work_handler(struct work_struct *work) goto fw_load_exit; fw_load_fail: - bus->fw_state = QTNF_FW_STATE_DEAD; + bus->fw_state = QTNF_FW_STATE_DETACHED; fw_load_exit: complete(&bus->firmware_init_complete); @@ -1408,7 +1416,8 @@ static void qtnf_pcie_remove(struct pci_dev *pdev) wait_for_completion(&bus->firmware_init_complete); - if (bus->fw_state == QTNF_FW_STATE_ACTIVE) + if (bus->fw_state == QTNF_FW_STATE_ACTIVE || + bus->fw_state == QTNF_FW_STATE_EP_DEAD) qtnf_core_detach(bus); priv = get_bus_priv(bus);