Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2913201rwb; Mon, 15 Aug 2022 13:57:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR45OUAmqnnhe4OZX28zN/eZMBKUh4TL+Lb2ixisAYmmA6cq7pwmzHWL0G6QPvqbge+9Fo+D X-Received: by 2002:a17:902:e94c:b0:171:3df0:c886 with SMTP id b12-20020a170902e94c00b001713df0c886mr19028196pll.39.1660597023285; Mon, 15 Aug 2022 13:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597023; cv=none; d=google.com; s=arc-20160816; b=kGWiVq4UTQxvSC5unRyHafEKfWbRh8fOtGkSL2p+XCwM9CoricbQdCB2JwpmGqUwg2 /QGTDli698arTkuHz8NU278841RXhWVfxayzf6XjnHKAIjV2Puqvr8/5qS+44hJvYZrl zWq7CMA8Mkp8TRVerNHAYiWAaZ5taesJkUEnzI3OQMkWMbmQn6JTLhyLF3phk48+x38i kAm/atigvlO9dMGAosGxqGlSB03VMLRxgMORk1kPumS0tN1EeMoZKzGAZ9J5A+l4scTp 8Ek9iUnlVftIixJ1h5613RgDNlrE0xrV7ga29WdSj5Ewl1YKaqirLW6hcQcvhUj0ZgIj p8uQ== 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=uZDFd//MRv9wAhAVqP2tjgcY1HZMpzkSfgyFnXv316Q=; b=LNDd1Yvc1q/eW4QFkrN8XQ8xB2c1kBbndwU1rkq2FSDqbPPDBqBkaLzoOQQRmeDGjL 2R9rIk68Y7u172lBypAVtORlup8hAPgMEECGaE+Rljumesg3LaNajoF0N7cC8ClHtS66 dq33nJJ+GcFor4js+l5nzTmyWpIrytOeP9Sf+jMfLiy9HE+rM4mDc2pN6AzCKPLJv+fV 9K50cZ9OnF+cqTm6p6QySBxQgiVkWcfoqTyO6tPxDbkh1CQ4OU0ydfVVr9nP2N0623M+ xv98PZ2rM71ezoY5I3C+RsTfTgo8WZuAlqezjnuKvACjbE4oMBXvnPy6y9omOVt8mzBM HFmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BMW2jTvb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a630106000000b0041bb3b5dc75si11433937pgb.716.2022.08.15.13.56.52; Mon, 15 Aug 2022 13:57:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BMW2jTvb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S244817AbiHOTAn (ORCPT + 99 others); Mon, 15 Aug 2022 15:00:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245094AbiHOS4k (ORCPT ); Mon, 15 Aug 2022 14:56:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 829EE326F0; Mon, 15 Aug 2022 11:31:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1F4FD61050; Mon, 15 Aug 2022 18:31:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AA82C433D6; Mon, 15 Aug 2022 18:31:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588296; bh=XRB3SSSa6lVv1vpESnbZZPaeZevVKXbJ/c1B4ApnyA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BMW2jTvb2NJ3SJHD0+MeHlMphkWZAskmjEcEERcFlrOYAmHMteWytTBLB3tiTIPpi 860LmMX9uk0VFgbgxHDFtkDZ0ndHKbPstfCxhlctwtEzcEVjSdAEodjl8noQ9dTIC5 hvln6AUOlWAw9sO8Xc7NTFik9PwZ07iUzxXltNH4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lorenzo Bianconi , Felix Fietkau , Sasha Levin Subject: [PATCH 5.15 327/779] mt76: mt7615: do not update pm stats in case of error Date: Mon, 15 Aug 2022 19:59:31 +0200 Message-Id: <20220815180351.267315169@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lorenzo Bianconi [ Upstream commit 79717c4eeeae9dec894794fbe8af72f08f03ebdd ] Do not update pm stats if mt7615_mcu_fw_pmctrl returns an error. Fixes: abe912ae3cd42 ("mt76: mt7663: add awake and doze time accounting") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 4fed3afad67c..bde65af72fed 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -385,10 +385,11 @@ static int mt7615_mcu_fw_pmctrl(struct mt7615_dev *dev) } mt7622_trigger_hif_int(dev, false); - - pm->stats.last_doze_event = jiffies; - pm->stats.awake_time += pm->stats.last_doze_event - - pm->stats.last_wake_event; + if (!err) { + pm->stats.last_doze_event = jiffies; + pm->stats.awake_time += pm->stats.last_doze_event - + pm->stats.last_wake_event; + } out: mutex_unlock(&pm->mutex); -- 2.35.1