Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3026649rwb; Mon, 15 Aug 2022 16:24:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR57Ircih9hP6+wqYROm9fyd1mJiJWh+RMWGHLiu6i5X4hkGfX8PlRB//fcplD2HZ+a5xsE2 X-Received: by 2002:a17:906:845c:b0:730:bbf1:196a with SMTP id e28-20020a170906845c00b00730bbf1196amr12049186ejy.13.1660605887701; Mon, 15 Aug 2022 16:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605887; cv=none; d=google.com; s=arc-20160816; b=rD4PvxlLmoVKnM9llSybUtFkShKhaeJP7x3FWai6k7iVHiyypug7BaTN/E2ze4m7e+ rAKI09QH51s3r6gBE7fPCt6+nbntrX7wd2PX0CE9wEgxvDKEl6XSdjkpAfuGJyhUP8Cr TBLgmYtMmUqmVMLsRALFqdzsw9Gk49kstpiY89tSoZpBx0Q60Ji3zQk81h3x6HwTFi+X grcAHqgGdt6c9q0HKn4jqOlPMHGDH4mmNcyF0rdYWD7QL8tCL/amz2fwugCt0Y9Vp98w IDABDF3DAfUuOWC8QDOMkDfBOZDl6gIL9fcoU4uLg/yxlrr6FpqHAWipbS9rPhqjXZkE QJbA== 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=SEQymUjjfU3U4dZW53e6IkMylGnno6oEuBINbWh0XYQ=; b=kHAcSnqBNJjSKJYGMx7QsNzwADAgkZDPYMDQvFGFM/vbu4Y0mbkIYRCZCAPjog6Ry5 TG0wUb/q+2ewq9XpyKflM8uoXFFXa9m6yIJk+p9G645Sp7VTDBILKl7VSw1sBhNYsSh4 AvuY8XAoM/bo2vgKInymWiuf6EnCiHI+taAhvBXL+911W5TgGia5nz75SNbwc02rcOUI DpKsO4UArw4dMENZG9hYVUBnCGFYhpbLyuE576Inbh6Fch5AZw+b7HznrQ1f/SBKf07W pgM1SkbsBojB8UBBECSAKR6X0LyCB/MMKp+bWRU9qh/gOzGkh5eqJ3JrbewwsYWAHMYa M/Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FReGgXUZ; 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 qa9-20020a170907868900b0072b0303a11asi8785287ejc.955.2022.08.15.16.24.21; Mon, 15 Aug 2022 16:24:47 -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=FReGgXUZ; 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 S241119AbiHOVNl (ORCPT + 99 others); Mon, 15 Aug 2022 17:13:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347940AbiHOVHr (ORCPT ); Mon, 15 Aug 2022 17:07:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 095B22D1F0; Mon, 15 Aug 2022 12:16:54 -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 ams.source.kernel.org (Postfix) with ESMTPS id B934FB81106; Mon, 15 Aug 2022 19:16:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05348C433C1; Mon, 15 Aug 2022 19:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591011; bh=tM4SDSdgsL1BoKw3VU2X2UxP5u4uYpyQPMV0hmBuJvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FReGgXUZu2H0cRIMvzX6om+oIyiRk5/oWZC3m78BQK4UalR4ck87r4tx3Khi7lDKN SbXkDRejjqXWS4nsUPMGW/U0ekb44CrU7IEkNxnVOOjOD5E216Sd39J7L4dGuV7Avy cs/tLcx0IgnOq4XUIujcDzkJHqNI+pHYlxf2GBiw= 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 0444/1095] mt76: mt7921: do not update pm states in case of error Date: Mon, 15 Aug 2022 19:57:23 +0200 Message-Id: <20220815180448.008789243@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 f4a92547fb9818ff272e1e2f0c79cd6b0bc99ce8 ] Do not update pm stats if mt7921e_mcu_fw_pmctrl routine returns an error. Fixes: 36873246f78a2 ("mt76: mt7921: 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/mt7921/pci_mcu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c index 36669e5aeef3..a1ab5f878f81 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c @@ -102,7 +102,7 @@ int mt7921e_mcu_fw_pmctrl(struct mt7921_dev *dev) { struct mt76_phy *mphy = &dev->mt76.phy; struct mt76_connac_pm *pm = &dev->pm; - int i, err = 0; + int i; for (i = 0; i < MT7921_DRV_OWN_RETRY_COUNT; i++) { mt76_wr(dev, MT_CONN_ON_LPCTL, PCIE_LPCR_HOST_SET_OWN); @@ -114,12 +114,12 @@ int mt7921e_mcu_fw_pmctrl(struct mt7921_dev *dev) if (i == MT7921_DRV_OWN_RETRY_COUNT) { dev_err(dev->mt76.dev, "firmware own failed\n"); clear_bit(MT76_STATE_PM, &mphy->state); - err = -EIO; + return -EIO; } pm->stats.last_doze_event = jiffies; pm->stats.awake_time += pm->stats.last_doze_event - pm->stats.last_wake_event; - return err; + return 0; } -- 2.35.1