Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3260585rwb; Mon, 15 Aug 2022 22:35:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR7YYpOZbyfOlGLR9+m23JJH8cEA9O0OF5YLOkdLtOIIFcoglFfCCOx+zKXmuU7bDsihMW9e X-Received: by 2002:aa7:9813:0:b0:52d:395d:c98d with SMTP id e19-20020aa79813000000b0052d395dc98dmr19530558pfl.55.1660628107670; Mon, 15 Aug 2022 22:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628107; cv=none; d=google.com; s=arc-20160816; b=EdXKvmrN38nJEVAvQO9xi6C9QgRO5hqELr4mWEPavj03aJt/1eLWInZ/imZ7NnhNCS VqMSfIuKTUBbMnJgYCbi4Y6EO6yaUbnnOZ8W9up2VBJma8Krb2L92HTypdM+S7aAWwVN YVrT5q7KycFBXPqpg8E916CQRIrchqThrZfVOqurqN9VNIQ5A+0P793d/Q4JJiosVtdU AngOUl0PMkiClhdxcsQGn4ixhocGAgDRLWZDcSO6n4k3DVedX8QL2cuFDdYbXAZtoUZN MvplbWIaJXRt2CtCdCEUpJb4rB//1vLg+wQ6dZJ4WOKXtDVeSAw43AnXK0fc1KFQEVTA ObWg== 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=ike9kVdTkNCCBgrbs3nvsiwh/MXVpXI+VQcjC3LDnQg=; b=ezXvNAtarO4zCv25ulCVMcMXxo7tbjjs4/7uFOh9f63R6FJCT5UuYPH8SZW1Y3hlw3 foOkxSS4OR4FZMZUHX0N/ATKPfqPQRk/binB6L/M8dVkeAu/3Rf2DJsHwdnMHjx2kKW9 OlxDdtI43MyyrHtnw/KThQnczzHBDfRCoPMbTta+DR3l8QXq6V2msWktzOjq7MvNBLak 1sNMIVH2lTloh+N1DYqE0ju4e21DHjKikXzLT5MIXGT1KW30SjkgHRaHjX1bkPY6ZQMX apY3Ugh+HSFX8gBJT1E3oKv0ZCeWDKSunBLAeXkxy6uzvv4nAKwZwpHLpo8qJoiOzodS BY3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=shvLvS+E; 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 il16-20020a17090b165000b001f4c9f920f6si19547338pjb.157.2022.08.15.22.34.56; Mon, 15 Aug 2022 22:35:07 -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=shvLvS+E; 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 S229519AbiHPEa2 (ORCPT + 99 others); Tue, 16 Aug 2022 00:30:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229844AbiHPEaF (ORCPT ); Tue, 16 Aug 2022 00:30:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D624FC6965; Mon, 15 Aug 2022 13:17:45 -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 6590F60FBE; Mon, 15 Aug 2022 20:17:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6713BC433B5; Mon, 15 Aug 2022 20:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594663; bh=rU1y07mAIyrTMQHU+dQcmkqMDRY7dbELlamSQsWDnxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=shvLvS+Eg/Hj3XI1Qlw29uq9r6VPpIRv2316IdeFcYUpzpWlw4fJ2O3Uki0QkcF+g NeYSiyQigajbSb22mHh7as+tZlZhZ4Fq3oPiiGP88WB07u9azdvDwiVcueCl/o/+lS sY7nkqUaylX4Mw/hJ7lj41XTLEj3vaSNz0d7vLe8= 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.19 0476/1157] mt76: mt7615: do not update pm stats in case of error Date: Mon, 15 Aug 2022 19:57:12 +0200 Message-Id: <20220815180458.670636541@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 8fb6c9d735dc..d2dd1260382c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -350,10 +350,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