Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2245361pxb; Thu, 11 Feb 2021 07:50:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxrGHahv7K7SsrdichaM4z2LJzc3S9Nay5lk7AZvhwXhc9jTfbmo7qAr9ytQ3x4zwXTZrY X-Received: by 2002:a05:6402:b76:: with SMTP id cb22mr9309016edb.25.1613058616205; Thu, 11 Feb 2021 07:50:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613058616; cv=none; d=google.com; s=arc-20160816; b=As88kQCfbDeTh7P3ujXr5wI+xQWBRRn38e7BM5hcyImZUWzevNTK9S7DrSRHVUEerA v2bK14WgEhsdDjWWmMbwJ1Ktlvxg9LKm7LV9gvSFK73fUj4oVaWbaXp2eWW3Re3g6J5T gAb03cxJWrEYDqdsJ/SL4/P8iBrUOqsnioRz+QGjWHDH6pcDv5jmMJNb/7lOTDxqaCDp VFJhwRSAVSg3TNcPtVmWmNMIGzE7g1qXkrqHJvlbwXkAEbTRUYPPsQmd55G0JtjjHUDU Z+NjdUjuQOCoAZ3ACozfRk2hwsj9A08d3Clm3wGMbYZEJwixkUvSxKXD7rhigYGg0+ke 1tiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qyA1s9seoC+yqR+le15kNt0kKA4YwClR2jcj8ieCGqk=; b=cHB7Fm/YGmrcXlps6o6ymV5WSpm8TwgnLIgW9vAkWZIqezjOI8fyH0YSnTYgZnNJNc O7MZSv2WMTatYzA6oRQiTCkYMtZPv+BBJQkcB/2OFU9EREzbG+oCmxxyddnbKL1RDc7H jKQn4Q0jKVxsZEkpD24XLrB9cT0LiWO4urapu7+q5D2KEJqEvLx5AAanjUjEizupcps6 k7mnDmLAOjtZwtPPRED/7/EgUiVgnMWqlHUXbjcRnOppIPA7qYt12/vesUc6YCToWdRq PG5ccZTwG+7INOcpXWeI6pG378WkcsDbN0uwrswpbeCkAfby6kSU2ISSM8AfUIchJHc9 ltmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rU92iAN0; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id br5si3908929ejb.608.2021.02.11.07.49.34; Thu, 11 Feb 2021 07:50:16 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rU92iAN0; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbhBKPqU (ORCPT + 99 others); Thu, 11 Feb 2021 10:46:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:51650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230108AbhBKPNT (ORCPT ); Thu, 11 Feb 2021 10:13:19 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B395264EF7; Thu, 11 Feb 2021 15:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613055895; bh=X8nsuQJTgoe6gbLnW8ip3eaIYtCcVSr3zvpNLTjzxfo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rU92iAN0bLdioMNDcNRWX2Ba6VDlolvWR9VyXeKfgEWWI3r8ae1vBakPRJeWQGIqx CsziiQo+tll7BTuLk1dcBXqwdoZO0+ciNMxj/xHquRqJ1Se/avFuFdF0CqsIMEbz7Z y8O1M1AJSstyhV7nCBSqxl7eYP1waZBM4ZLMcJ+w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Luca Coelho , Kalle Valo , Sasha Levin Subject: [PATCH 5.10 32/54] iwlwifi: mvm: take mutex for calling iwl_mvm_get_sync_time() Date: Thu, 11 Feb 2021 16:02:16 +0100 Message-Id: <20210211150154.286663113@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210211150152.885701259@linuxfoundation.org> References: <20210211150152.885701259@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg [ Upstream commit 5c56d862c749669d45c256f581eac4244be00d4d ] We need to take the mutex to call iwl_mvm_get_sync_time(), do it. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20210115130252.4bb5ccf881a6.I62973cbb081e80aa5b0447a5c3b9c3251a65cf6b@changeid Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c index f043eefabb4ec..7b1d2dac6ceb8 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c @@ -514,7 +514,10 @@ static ssize_t iwl_dbgfs_os_device_timediff_read(struct file *file, const size_t bufsz = sizeof(buf); int pos = 0; + mutex_lock(&mvm->mutex); iwl_mvm_get_sync_time(mvm, &curr_gp2, &curr_os); + mutex_unlock(&mvm->mutex); + do_div(curr_os, NSEC_PER_USEC); diff = curr_os - curr_gp2; pos += scnprintf(buf + pos, bufsz - pos, "diff=%lld\n", diff); -- 2.27.0