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: 5610711 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E17D79F357 for ; Mon, 12 Jan 2015 14:31:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 08728205B6 for ; Mon, 12 Jan 2015 14:31:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 32BD620558 for ; Mon, 12 Jan 2015 14:30:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YAg15-0003VJ-8M; Mon, 12 Jan 2015 14:30:51 +0000 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YAg0g-000252-9q for ath10k@lists.infradead.org; Mon, 12 Jan 2015 14:30:27 +0000 Received: by mail-wi0-f169.google.com with SMTP id r20so14213212wiv.0 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=j6ymoqeCKTcVJFGTGoSeWsI3n8joVgcNozqr8tEw+TjSOf78puJe1VK8tyw9DNOZbV /gBRj4SOqj1+Lcin8K+Cv+vfvstNP7Bpgef4zj86YzTWUx4ehQmuoglMN/INv0YcJu1K h1E4XEMivoz+NU9JeraRA3zeb1fN2VoMmQ9DB87RaIQ6g5tcMu3KPT7veiFqA6grQs3W UtxMdCscANZiq3W+e31apG8fYXUe2Lc828mB6tNVZNMwN3g/50GfJ6wWANfYTLSuUSRX yH/jPCEK2Qw/EzoVE0A7/2Y2msBEar64y9lFy0csrQaboWycYPI5P2/PlDm0VVQhVi4W 8ROg== X-Gm-Message-State: ALoCoQnYbJplt7ns1DzepPO/g+EVCZmvOF5yuQKz0g6ho0B/a9puj6BvmmhRNRh9hzAZPGjXX5R2V88vPn9hSB/oijkrdL4ud1kiN8sVN1h5jN+q3iBSuXRPZYznq+fDv6Rqw//miIZ7WdeDVurljD5ZxK767Xwa0ipoaAUozfdk/PS9t+s7hak= 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150112_063026_563075_9D788DCC X-CRM114-Status: UNSURE ( 8.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, 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; }