Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp143198ybk; Fri, 8 May 2020 21:47:49 -0700 (PDT) X-Google-Smtp-Source: APiQypJ7lzctE62PfU7saCj+iRMBq72D5C8YPfuDqlKMoAg2uMrgp41dzFNEFTg8LiqKa/LorBtC X-Received: by 2002:a05:6402:1f3:: with SMTP id i19mr5180974edy.246.1588999669067; Fri, 08 May 2020 21:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588999669; cv=none; d=google.com; s=arc-20160816; b=cf8JsF8ROMwOBMDlRXxzJG317gVjj3qgOqehJ4SFehtiunaMEjXMZDcYXQdKc1wET8 HY1cCiqcwcwIhGv2lzNWxTI6QQ6QkzxLOVal0UYIZ1yN5yugIS3ZxTg4F0N2wFDehMy5 BXiFD2gGCC0GuBGMkvyaucMZfi6NU34tdoT4xayk0uXlQnjM8VLfto8YEtfF9ECLCE1e 8nhU9BF6mvLL7X2pbvutr9Z57jVQ01WPFYjShFML5RqPhc5GwDS6ehLHrtEfPNpKeqje oLlWrgONc0Fp083PvKVZKvwqq+FlzRVY+KH/3YP1LL7gwKzN5nd50KGXLHk7wR8XlzgP Th7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=npAHADQxLDEpywMh/GQmSV8cKhjaz9uo2pCJ37X1d7Q=; b=bU2VHWUMdJ6OgNxVHgVOhmRMUgGMJ9h4cFmGmPVv3VOlTiBaKMKzovHVxQhwE+3QS+ cb+bj7TGo+1MtZXHnPWDkJxnITyvqod4m4rmo83bA4zz7pw8RmpMWXqItR8TupquUd59 uIPWcTjbC76obJs8PDu+haFAmyp34KjZ7gZ+K/HHagTRFBDZAxWPzm8LN+E6VetGnRPo n5jizuG8v8vRTayooURTAiVfKpf92VGUWWOd82nEuC+DfzXhR1rMnMDZN/VLezcBGZEP V6QanLLb7M5W3NGRkw5bzuWXrdGBwVbuJz7Rvi+DebJnfiQ61GtLP40yx6OUz6CVxOkb qKjw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i18si2333050ejx.488.2020.05.08.21.47.25; Fri, 08 May 2020 21:47:49 -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; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726874AbgEIEpp (ORCPT + 99 others); Sat, 9 May 2020 00:45:45 -0400 Received: from mail-pj1-f68.google.com ([209.85.216.68]:52441 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725795AbgEIEpp (ORCPT ); Sat, 9 May 2020 00:45:45 -0400 Received: by mail-pj1-f68.google.com with SMTP id a5so5227716pjh.2; Fri, 08 May 2020 21:45:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=npAHADQxLDEpywMh/GQmSV8cKhjaz9uo2pCJ37X1d7Q=; b=kYhjC2EBjfqXoUxy/zTQ4+eiC42XU2VTyClMoza3b5B+lwSLp/pHM7DMgZ1a1KiBIa WoK2xvFhVw2P+QNluVDvFW9Ht35ULTfrM7U9xn2QM+htptM3Wh94p0hO99VdZQ3sjLvI p++9H47Rq0EhVMgiZhbQmDRxfIxnVHH9xYP9ML/S1pItRwX7KG0Obs2xRIUeQwzUzE5f 3gGj+m3KvZ5cDQhiYUi5f0GhfMRamsIlvh43A3TBki6sMkAry6BOyixXXv79zx59dAcv iRczBExRBCPiseIjKSm/c0vXMIDUhkT3hVYjEwUxBbUX9HdADoOcOBDk/RKnbs41ZnmR zR/w== X-Gm-Message-State: AGi0Pub57GCEKRc6UK0BEzENjDcSZ8p65ZiUhNUJpzXJfYK7snH3Tskd k/Z3rxJ2biXi2joFlE2fD9E= X-Received: by 2002:a17:902:ff09:: with SMTP id f9mr5748286plj.236.1588999542861; Fri, 08 May 2020 21:45:42 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id h13sm2547498pgm.69.2020.05.08.21.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2020 21:45:41 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 54DB142337; Sat, 9 May 2020 04:36:01 +0000 (UTC) From: Luis Chamberlain To: jeyu@kernel.org Cc: akpm@linux-foundation.org, arnd@arndb.de, rostedt@goodmis.org, mingo@redhat.com, aquini@redhat.com, cai@lca.pw, dyoung@redhat.com, bhe@redhat.com, peterz@infradead.org, tglx@linutronix.de, gpiccoli@canonical.com, pmladek@suse.com, tiwai@suse.de, schlad@suse.de, andriy.shevchenko@linux.intel.com, keescook@chromium.org, daniel.vetter@ffwll.ch, will@kernel.org, mchehab+samsung@kernel.org, kvalo@codeaurora.org, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain , linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [PATCH 12/15] ath10k: use new module_firmware_crashed() Date: Sat, 9 May 2020 04:35:49 +0000 Message-Id: <20200509043552.8745-13-mcgrof@kernel.org> X-Mailer: git-send-email 2.23.0.rc1 In-Reply-To: <20200509043552.8745-1-mcgrof@kernel.org> References: <20200509043552.8745-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This makes use of the new module_firmware_crashed() to help annotate when firmware for device drivers crash. When firmware crashes devices can sometimes become unresponsive, and recovery sometimes requires a driver unload / reload and in the worst cases a reboot. Using a taint flag allows us to annotate when this happens clearly. Cc: linux-wireless@vger.kernel.org Cc: ath10k@lists.infradead.org Cc: Kalle Valo Signed-off-by: Luis Chamberlain --- drivers/net/wireless/ath/ath10k/pci.c | 2 ++ drivers/net/wireless/ath/ath10k/sdio.c | 2 ++ drivers/net/wireless/ath/ath10k/snoc.c | 1 + 3 files changed, 5 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 1d941d53fdc9..6bd0f3b518b9 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -1767,6 +1767,7 @@ static void ath10k_pci_fw_dump_work(struct work_struct *work) scnprintf(guid, sizeof(guid), "n/a"); ath10k_err(ar, "firmware crashed! (guid %s)\n", guid); + module_firmware_crashed(); ath10k_print_driver_info(ar); ath10k_pci_dump_registers(ar, crash_data); ath10k_ce_dump_registers(ar, crash_data); @@ -2837,6 +2838,7 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar, if (ret) { if (ath10k_pci_has_fw_crashed(ar)) { ath10k_warn(ar, "firmware crashed during chip reset\n"); + module_firmware_crashed(); ath10k_pci_fw_crashed_clear(ar); ath10k_pci_fw_crashed_dump(ar); } diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index e2aff2254a40..d34ad289380f 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -794,6 +794,7 @@ static int ath10k_sdio_mbox_proc_dbg_intr(struct ath10k *ar) /* TODO: Add firmware crash handling */ ath10k_warn(ar, "firmware crashed\n"); + module_firmware_crashed(); /* read counter to clear the interrupt, the debug error interrupt is * counter 0. @@ -915,6 +916,7 @@ static int ath10k_sdio_mbox_proc_cpu_intr(struct ath10k *ar) if (cpu_int_status & MBOX_CPU_STATUS_ENABLE_ASSERT_MASK) { ath10k_err(ar, "firmware crashed!\n"); queue_work(ar->workqueue, &ar->restart_work); + module_firmware_crashed(); } return ret; } diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index 354d49b1cd45..7cfc123c345c 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -1451,6 +1451,7 @@ void ath10k_snoc_fw_crashed_dump(struct ath10k *ar) scnprintf(guid, sizeof(guid), "n/a"); ath10k_err(ar, "firmware crashed! (guid %s)\n", guid); + module_firmware_crashed(); ath10k_print_driver_info(ar); ath10k_msa_dump_memory(ar, crash_data); mutex_unlock(&ar->dump_mutex); -- 2.25.1