From patchwork Mon Jan 12 14:29:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5610701 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 41D4DC058D for ; Mon, 12 Jan 2015 14:30:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E21E205B6 for ; Mon, 12 Jan 2015 14:30:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E3CA20558 for ; Mon, 12 Jan 2015 14:30:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752783AbbALOaE (ORCPT ); Mon, 12 Jan 2015 09:30:04 -0500 Received: from mail-wg0-f42.google.com ([74.125.82.42]:63139 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752715AbbALOaA (ORCPT ); Mon, 12 Jan 2015 09:30:00 -0500 Received: by mail-wg0-f42.google.com with SMTP id k14so19600647wgh.1 for ; Mon, 12 Jan 2015 06:29:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=QzZ6xFbxU6hGyaSG9NrUsKJkxUP/pxzaebnHMHj9veY=; b=ZEzHnEFdQzjxOSlabCER3FK+S1BTk7codFXMZCh3jLl0F/nDRdb5XACIbDphr12MhW mtqJsA30zhQJogh7QjZP+SX0NRsvzTNiXmojJ/JD7D5DWnHB4YVi7k/M1Q5Qgg0ZVIru HzvT43IUike84oJ689lOaNf5KK5pLXvj9LcQ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QzZ6xFbxU6hGyaSG9NrUsKJkxUP/pxzaebnHMHj9veY=; b=R3vKPGZ26YhOM0uk4BN1TRFXvnu8aFfT3WDjqVdnC/IJXukRCA2U2PJGikd7IZBYWb sTzmEnmZIQNQdvfFbX/jI+s3XfxpiB/usys4lf+X0Cef/Svc9CVdPym5HlrRlaB4bmq3 BD7yEhcXuoOlJtn9nBmyZGdQRUL3qcNyLeu1ggZkDVM9pZnEKUVN54d4kD14EcHnGcZS AKxe9e1L6BVVvTNbjogmG6ahbTYSRm2TRg9f6d4cYCRupgYwFFgQPfd3usI/EXoWqhvf R8D8/2d5Hh6xF3/xpL/eavLrjf8BdYHHmlcbqUMI8Ujkt4sAdjoSEF92njL5+p6VQuVQ RJ4A== X-Gm-Message-State: ALoCoQlu+ass+zXDFtzXETbDkR1IlOwywJM/trXt5obQWPsfiBJNo8gYoNHHyWLnEjY+kvokqeQKfQQ9IKSpQfwIRKuMvqFwvlZoVYioKauxGyW+1m19nnPtWTCQeGo9CaUxUzJTW81c X-Received: by 10.194.205.138 with SMTP id lg10mr60346273wjc.130.1421072999737; Mon, 12 Jan 2015 06:29:59 -0800 (PST) Received: from bob.homerouter.cpe (apn-46-76-65-212.dynamic.gprs.plus.pl. [46.76.65.212]) by mx.google.com with ESMTPSA id i3sm21857290wjw.2.2015.01.12.06.29.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jan 2015 06:29:58 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH] ath10k: prevent fw reg dump spam Date: Mon, 12 Jan 2015 15:29:37 +0100 Message-Id: <1421072977-22688-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Originally the explicit fw register dump was added to wait_for_target_init because interrupts are masked early during power_up. Due to some changes in power_up/reset sequences sometimes when fw crashed ath10k would print the dump more than once via hif_stop -> warm_reset -> wait_for_target_init, possibly with different values each. Prevent this by doing the explicit fw register dump only during power_up instead of wait_for_target_init. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/pci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 5e50214..3b40a86 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -1910,6 +1910,12 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar) */ ret = ath10k_pci_chip_reset(ar); if (ret) { + if (ath10k_pci_has_fw_crashed(ar)) { + ath10k_warn(ar, "firmware crashed during chip reset\n"); + ath10k_pci_fw_crashed_clear(ar); + ath10k_pci_fw_crashed_dump(ar); + } + ath10k_err(ar, "failed to reset chip: %d\n", ret); goto err_sleep; } @@ -2352,8 +2358,6 @@ static int ath10k_pci_wait_for_target_init(struct ath10k *ar) if (val & FW_IND_EVENT_PENDING) { ath10k_warn(ar, "device has crashed during init\n"); - ath10k_pci_fw_crashed_clear(ar); - ath10k_pci_fw_crashed_dump(ar); return -ECOMM; }