Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2929634rwb; Mon, 15 Aug 2022 14:15:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR7GkZ9Au8k7wJK75qfql634fm0BEBi0e7fNY3x9Hmq8m6bhxiad1FFJ7GhYhuRBEjXJeVE0 X-Received: by 2002:a63:564f:0:b0:425:f2cd:d0ce with SMTP id g15-20020a63564f000000b00425f2cdd0cemr10027451pgm.143.1660598122616; Mon, 15 Aug 2022 14:15:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598122; cv=none; d=google.com; s=arc-20160816; b=ZVDCB0F2r210PTYj5iepYP4DHs8Q0pstVnghMAyXlepH2/iDOrkQpF9qvEKKVgFORi jHhfsspSvfVLasP0HO/20Ft9gqf3R9sfXJraSwhn1G/OVG+4ON1EieB0AyNtWL0/RcqL yp6f5spDlJL2x8JFidNH9Gv00pQTwVbvW5QE3wiM2e/W7M72gvMN9sNkiU9LTwTUTQfU OKWl7jYvs9yptyfR+xzfdhXdl43EGuz7hWTb/KhkJT+O+f02bLcx2X87E3vohJPSSc4I RmVouEa3jI5j0N3/Y6U44Su1hyO43ifGwww8LtwEkVvnvOvZ0B4PzwMESx6v7+Ud2Nah 4xfw== 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=w0cDB86SQ84VxxkHUyKCpEEtzwCoCfnxMMl9c7ydShw=; b=yJUR97B6DNq3hx2ydQRwMkOte/6plocu/4VnmKJ+mDVEBUnMHSi7CaCaEwbCqu3vO2 pKOlSbQNVJ5SS0morakHL3tjKk93UWqrwrS60afUTXDj8A/gwSItXTTijimI4hMmrN5B HmpCcaH0BGoZDHmviaa/OiTZDkanmLd6fewZ7qZ4kLRWeHJeXOIch+FpIPsKTOJqPBmE ZmxbyHKR+OPT1W09QsC//oRBKo4LNe4RNrK5n28sqjuPeuDdA1/tdGt+Ny3LGyCE1SvR V90FdJ+NAKfM5C+q1hTF3tbFEmE6EsUFr+PXmcE3vq8qauBTXHZvAjYIO3DswOUBSffj 6Q+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hCRPLe+I; 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 u16-20020a056a00125000b00527e02658ffsi12202161pfi.379.2022.08.15.14.15.11; Mon, 15 Aug 2022 14:15:22 -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=hCRPLe+I; 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 S242058AbiHOVNx (ORCPT + 99 others); Mon, 15 Aug 2022 17:13:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347934AbiHOVHr (ORCPT ); Mon, 15 Aug 2022 17:07:47 -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 6E13E2DAA0; Mon, 15 Aug 2022 12:16:49 -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 0A8AA60F6A; Mon, 15 Aug 2022 19:16:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11867C433C1; Mon, 15 Aug 2022 19:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591008; bh=jYvjc2jx/tJWDFcenTX34W9Cgm5iRIk5XYyMQirFE00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hCRPLe+IQ7z6aN6wgC4IaaJkadm6EB5o7BsseTY6bw82tfg99pnhoMj/sbGHbknzi wMEu36pBoikg9yNuEOv+OkIteUuVgChM2yMn58FThxq8kVIMYFF2uouXuiT7dEujT8 QevN7CZpyoPHkd6aTd6NRfYBLNbO1nLxv9zpjv8w= 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.18 0443/1095] mt76: mt7615: do not update pm stats in case of error Date: Mon, 15 Aug 2022 19:57:22 +0200 Message-Id: <20220815180447.978286034@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 97e2a85cb728..6f3efec58afe 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