From patchwork Tue Sep 1 15:08:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 264730 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B939C433E6 for ; Tue, 1 Sep 2020 15:38:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BA0721582 for ; Tue, 1 Sep 2020 15:38:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974737; bh=AOQDhAs5sbYZs2BMhmI2uixw2SfSCbf3ZGUMKVmE1Xg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bcnG5cXnT+0fccchiFi4DLaVmNSl3iB17LcTFzjPEJXtMGcB3S3tZV5NpfU3Q41k+ Dbz/snG+V7EoDtFK/HxK1z6gpprMDxcZLx/omXz987vjYBveLgAiupjR+zGkUdP2Dc beLa2aiHJ1IPzO05y0w5wYPhqN7nC7dfwAGcdSXw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728129AbgIAPi4 (ORCPT ); Tue, 1 Sep 2020 11:38:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:48254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728241AbgIAPiy (ORCPT ); Tue, 1 Sep 2020 11:38:54 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 5FB0C20866; Tue, 1 Sep 2020 15:38:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974734; bh=AOQDhAs5sbYZs2BMhmI2uixw2SfSCbf3ZGUMKVmE1Xg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iHz31zlvnTqu6NxItKMPxgIA6I5yvuGNLjvbLF6/edWkX65I5vF6Me3Eo+sUFghLE Uv42XAQxX4db1VjGYz6Zs48ksEW70EU46gg4vvzyA0Je15WrzAF3weBdQgmdrI7uMA NnX/0Q/E6vhr6zUK0cCCnuYpg6qCHZYNlM7y0AS0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolas Saenz Julienne , Kalle Valo , Sasha Levin Subject: [PATCH 5.8 073/255] brcmfmac: Set timeout value when configuring power save Date: Tue, 1 Sep 2020 17:08:49 +0200 Message-Id: <20200901151004.230421914@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901151000.800754757@linuxfoundation.org> References: <20200901151000.800754757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nicolas Saenz Julienne [ Upstream commit 3dc05ffb04436020f63138186dbc4f37bd938552 ] Set the timeout value as per cfg80211's set_power_mgmt() request. If the requested value value is left undefined we set it to 2 seconds, the maximum supported value. Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200721112302.22718-1-nsaenzjulienne@suse.de Signed-off-by: Sasha Levin --- .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index a757abd7a5999..f4db818cccae7 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -84,6 +84,8 @@ #define BRCMF_ND_INFO_TIMEOUT msecs_to_jiffies(2000) +#define BRCMF_PS_MAX_TIMEOUT_MS 2000 + #define BRCMF_ASSOC_PARAMS_FIXED_SIZE \ (sizeof(struct brcmf_assoc_params_le) - sizeof(u16)) @@ -2941,6 +2943,12 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev, else bphy_err(drvr, "error (%d)\n", err); } + + err = brcmf_fil_iovar_int_set(ifp, "pm2_sleep_ret", + min_t(u32, timeout, BRCMF_PS_MAX_TIMEOUT_MS)); + if (err) + bphy_err(drvr, "Unable to set pm timeout, (%d)\n", err); + done: brcmf_dbg(TRACE, "Exit\n"); return err;