Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9933321ybi; Wed, 24 Jul 2019 12:35:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhNEgTTZe9ACB31R+4eMAjOiFhvg7cvJRl5zsX2uqb8ru0V5OVVasjPxgI8+UaI+053KcR X-Received: by 2002:a17:90a:d998:: with SMTP id d24mr61864613pjv.89.1563996903911; Wed, 24 Jul 2019 12:35:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996903; cv=none; d=google.com; s=arc-20160816; b=MmdbMcCRfHNcdpB8eRgMacj1999TapPP7RE4c0eOOjxw/hOp0vaS7ZjwhR1nAWg9r9 Zb9Z54tcgoqLzFgvQrci6JoEVtRbUm63wYEKSm6bqH9A33vHVBSLG8FOkbn0RLmmm3oL o3iKMMdYEz6Bd/gj4Z59k/+M30VgR0HnWi6e/xk6GtHGAr145MRV7GEMw6Y6StwaICEh GFZDUIHBOwidWqqAWM8G0ixGsidIwuK+WpdhNgbfhGi2XJH59cyhfD5/FImeByyDQLKc khzzBAPdY9aLmETpq9hxQYJ8mkyotJoHRACs4KrElfcab6s/Uz3dnu6UTOSTv6MndLux Uq9A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EZ4/vKXQSiWaUxCATSIzCpgnse3bDODzJ60U108Wb0M=; b=N3eCy18Ds1V+GuEzRjGykJE8bZtHNh8vjxmds9duecE09Gw11H0eMKb83jJyq03D2D 6TILMCmjjtMoTzGitVJbvjhcBjcFjYj1rAZnH8H8yFZyWW5sqaA3/jVOlUpzpRoZTm0v pQ6jNxeny1AlVAf2ogibLH7aiHoHDrAc10e8iRzlgCLeTZOnvOOTcBc53iB8O/VmU2gG 0qKZ/BzRoqVfU9EJf/LqEyKg0YUMsEuFDtYpYht4bR0uEnhJUMx0/OvmFKfNiLEmTknw iqCdx4leqhVZuQz4yVtWX9fVQsc8mWl1ZsI/XdeBMZANVqDkAtmMgYPkf/pxMeXrEq59 QAYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K+cf06Nb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k129si6228585pgk.42.2019.07.24.12.34.48; Wed, 24 Jul 2019 12:35:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=K+cf06Nb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388709AbfGXTcs (ORCPT + 99 others); Wed, 24 Jul 2019 15:32:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:54140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388683AbfGXTcm (ORCPT ); Wed, 24 Jul 2019 15:32:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3D29C2238C; Wed, 24 Jul 2019 19:32:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996761; bh=FoCoZFSiAQ9WJnxZh/qFienzAuBw+JLuL7uejSyjtpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K+cf06NbQOwVWIRKsrxbcs74VAmlzeHibhhHC5N3G/UslsP1W5gwmxMrYsXrSSqQP jOUTXY2DKUCauozPfk2ljmenIf/fc2o5Ftacaxwm/hNXbqH93XXoqXFhA7u5duVy0A SoW+4kLh/IjzNSSr802nZsBGzAgFIMe75zGJpWtc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shahar S Matityahu , Luca Coelho , Sasha Levin Subject: [PATCH 5.2 205/413] iwlwifi: dbg: fix debug monitor stop and restart delays Date: Wed, 24 Jul 2019 21:18:16 +0200 Message-Id: <20190724191749.177722386@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit fc838c775f35e272e5cc7ef43853f0b55babbe37 ] The driver should delay only in recording stop flow between writing to DBGC_IN_SAMPLE register and DBGC_OUT_CTRL register. Any other delay is not needed. Change the following: 1. Remove any unnecessary delays in the flow 2. Increase the delay in the stop recording flow since 100 micro is not enough 3. Use usleep_range instead of delay since the driver is allowed to sleep in this flow. Signed-off-by: Shahar S Matityahu Fixes: 5cfe79c8d92a ("iwlwifi: fw: stop and start debugging using host command") Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 2 -- drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c index 33d7bc5500db..c875e173771c 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c @@ -2303,8 +2303,6 @@ void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt) /* start recording again if the firmware is not crashed */ if (!test_bit(STATUS_FW_ERROR, &fwrt->trans->status) && fwrt->fw->dbg.dest_tlv) { - /* wait before we collect the data till the DBGC stop */ - udelay(500); iwl_fw_dbg_restart_recording(fwrt, ¶ms); } } diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.h b/drivers/net/wireless/intel/iwlwifi/fw/dbg.h index fd0ad220e961..c5c015a66106 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.h @@ -294,7 +294,10 @@ _iwl_fw_dbg_stop_recording(struct iwl_trans *trans, } iwl_write_umac_prph(trans, DBGC_IN_SAMPLE, 0); - udelay(100); + /* wait for the DBGC to finish writing the internal buffer to DRAM to + * avoid halting the HW while writing + */ + usleep_range(700, 1000); iwl_write_umac_prph(trans, DBGC_OUT_CTRL, 0); #ifdef CONFIG_IWLWIFI_DEBUGFS trans->dbg_rec_on = false; @@ -324,7 +327,6 @@ _iwl_fw_dbg_restart_recording(struct iwl_trans *trans, iwl_set_bits_prph(trans, MON_BUFF_SAMPLE_CTL, 0x1); } else { iwl_write_umac_prph(trans, DBGC_IN_SAMPLE, params->in_sample); - udelay(100); iwl_write_umac_prph(trans, DBGC_OUT_CTRL, params->out_ctrl); } } -- 2.20.1