From patchwork Tue Jul 25 20:45:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 108705 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp29042qge; Tue, 25 Jul 2017 13:46:07 -0700 (PDT) X-Received: by 10.84.149.139 with SMTP id m11mr8579320pla.376.1501015567290; Tue, 25 Jul 2017 13:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501015567; cv=none; d=google.com; s=arc-20160816; b=o79fk+W8vUM44Ug0bo+lPmm2QfOlbq7mXuroxh5AyGjKbUIVVp3ZddKWMxIsEoujyo 4icekKwoJF5546OHi/zoDFxdkZ7UcNiGoe2MKrryyMij1u5UU3DJ+NUrR8chE0fIr644 RBm+t+k4e3UKv9PUYfg+HO7Lr8yE9oo3e1k7IbuDdEp6AVTFqb+kGfUSGlXrPJDhNfOL C+Y+dxn4HFJXakOMZIFUpk7jdSzAulMtz8FEP30wHzSV5Nq4fKMsoQTcvIZgZiAIGqUe vfdWilMVSzigumkmSX8UJRm6g+j6zUGizKJRJL4q9gn+8k41umIT6g9ENun1y6bZAyI3 tWNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=DkgYQRGrtIxZiL1xbsLjLwxt9o4BfXfeloer9937HvU=; b=q/O2r9qi0DGJcOceK156VNu9y4DCryw1BpnX3yAJdqO0wCgffi0QDsdhGP4vQHq033 FdN0tmyu4DoKlC6hNonNj/i2GSTChBOKznrPQWlJJHUJMwjIXfs1l/c02eEMGM4nLCho psRQwwfqVaXtJe/TKU9pa/4UzRNQRFsoxIak2Thx9GTU/kxkxQtMDuEOHNZzNA9TyPZQ RDHQfe6wjyzDnp2iaKRXt4nOBYgymOJfS/d7Rhk87Wg+x5Ql5nOQyEOWihmiAUckTyRo KzPlwK8S6yv4sLxrFJyraskNyvpjpae0L2ugu31AggXDpU3nZPfy2X4vALvP5hOmWHs3 MYkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Qa9Cbnmf; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3si387020pgk.256.2017.07.25.13.46.06; Tue, 25 Jul 2017 13:46:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=Qa9Cbnmf; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750938AbdGYUqE (ORCPT + 6 others); Tue, 25 Jul 2017 16:46:04 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:34195 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752469AbdGYUqB (ORCPT ); Tue, 25 Jul 2017 16:46:01 -0400 Received: by mail-pf0-f178.google.com with SMTP id q85so62648798pfq.1 for ; Tue, 25 Jul 2017 13:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DkgYQRGrtIxZiL1xbsLjLwxt9o4BfXfeloer9937HvU=; b=Qa9CbnmfFZJ5sYnBiLkSdmBygEWNvJnagyp29Xy7FBSvMLFQ0tVrQYqaAbF/CyuOBV I6Zm/jYehZIiMqM6mNc5E6Wzki73fbx4rxUGmHpYJ8b0eUmJXAIQt4IW/JjwPP8VB5Si Ee1Omri0Q1lg+uhmqy6PQQCSYKPP/jOdQOqjo= 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; bh=DkgYQRGrtIxZiL1xbsLjLwxt9o4BfXfeloer9937HvU=; b=rJ356lQORiNnPDnVqzj10vooTVgSrdv/rZw2UbDKHFp22ijcvZBNFGBYUoO6PzzOCO sEB+6+v1DjfijfpkS1XtlfAw377g+MNJu7MLZ3AuVtGB0XgPwb6U14K0ScNBSl4nTrJR +1WTrLu0LWmoxdabq/MivpKEXyGIazJ1moIUCca+caIikLNJwUou4TuBFbKcgY1BASC/ +G577C7YngpiscGpZus4e7Pb3VjeQbc1RdFdmhGklJ95js4oHDD3hP5/WTiQedSR9Orm R4MP8qlm+DPPq8RG2T67/QIYi/ruFq7MX1YGK7DxoAsWisT3XZPi0XtNUyozMiF6w+tQ 8xfg== X-Gm-Message-State: AIVw111nKFXn1Uz1HLr57C92xUoLCHFxyHefcRU9wjnu/9jWuNjEje+D yb1em0EbZulJ9i3pDoONmA== X-Received: by 10.98.97.66 with SMTP id v63mr20948078pfb.230.1501015561221; Tue, 25 Jul 2017 13:46:01 -0700 (PDT) Received: from localhost.localdomain ([106.51.135.235]) by smtp.gmail.com with ESMTPSA id d4sm532125pfj.59.2017.07.25.13.45.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Jul 2017 13:46:00 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Lior David , Maya Erez , Kalle Valo Subject: [PATCH for-3.18 10/15] wil6210: fix deadlock when using fw_no_recovery option Date: Wed, 26 Jul 2017 02:15:21 +0530 Message-Id: <1501015526-32178-11-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501015526-32178-1-git-send-email-amit.pundir@linaro.org> References: <1501015526-32178-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Lior David commit dfb5b098e0f40b68aa07f2ec55f4dd762efefbfa upstream. When FW crashes with no_fw_recovery option, driver waits for manual recovery with wil->mutex held, this can easily create deadlocks. Fix the problem by moving the wait outside the lock. Signed-off-by: Lior David Signed-off-by: Maya Erez Signed-off-by: Kalle Valo Signed-off-by: Amit Pundir --- drivers/net/wireless/ath/wil6210/main.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index 6500caf8d609..c5676841fd12 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c @@ -240,18 +240,19 @@ static void wil_fw_error_worker(struct work_struct *work) wil->last_fw_recovery = jiffies; + wil_info(wil, "fw error recovery requested (try %d)...\n", + wil->recovery_count); + if (!no_fw_recovery) + wil->recovery_state = fw_recovery_running; + if (wil_wait_for_recovery(wil) != 0) + return; + mutex_lock(&wil->mutex); switch (wdev->iftype) { case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_P2P_CLIENT: case NL80211_IFTYPE_MONITOR: - wil_info(wil, "fw error recovery requested (try %d)...\n", - wil->recovery_count); - if (!no_fw_recovery) - wil->recovery_state = fw_recovery_running; - if (0 != wil_wait_for_recovery(wil)) - break; - + /* silent recovery, upper layers will see disconnect */ __wil_down(wil); __wil_up(wil); break;