Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3083227rwb; Mon, 15 Aug 2022 17:43:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR6U9rz6GZw4f4MEJPQT9C5d0CKE/x7KAv8xdDH6U96Iq78KRal1P2/n5ucZjVTcXyqYN0Jp X-Received: by 2002:a05:6402:4282:b0:43e:612c:fcf7 with SMTP id g2-20020a056402428200b0043e612cfcf7mr16149930edc.242.1660610583484; Mon, 15 Aug 2022 17:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610583; cv=none; d=google.com; s=arc-20160816; b=sMeVpWzkB691i3k1Hly0K7IwZqpFYGWIamrx8FuEFRFa0j0vHFhZbrVtVsV/FzvrXK zvos/T/jbcnYFhEKgUkIod7E57T2WjZ9Oqz4wGdpDodw38OwoEAkFmum0T0l/+w9Ij/d Tp1GiIQBVTVTnKz/Fv1lEs3PtYlNNvlb7f/aN1Pc/Nt457VSlbFvJ5/jH/kn2eMMJRVH c6M6lMEh2dJfuuDJ1V2rBYOy4TD3Hs53io1AUBUEwdTvoTs77sZJvsVf7G8LBS1gCHbr gt89iZdf9SpOrj/ZDyqq4tm/KZ8ZPP59jiMUFgkDhdPSf5H3n0M5lSpid562gaMT8kme Cmcw== 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=TKdd6beFDOiAYEBpdkZd1k0Vt7jQundxC3afnoO76cz/vZCIIxA+MCh4OXLbOlyYoQ xRCvI7zV35GqlGmUaRIycE/JI24DQ6ZdG8axz1BQVAQDFmbrvb/PBwgxhl99af0LZyrp +E0oz/xKW4BhotSHqczbQnQihGJ2rAhuXRfT+np/Qx79DO9S+nC9WZ0wQBcub9HEucGz qWMrVSWEqfxeTcdRp4qKVTe/nD+9RzIoYEJSae99vzvk9zqYpy9QB1U/zQdLCwk7xXpE TmUZYaB6ZmbDv/xWCFyBzoH3JeIT6AtiCUj/LKZvNQ1tTjuItxK+FSELpXBZD9l6BXVn nPuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0POnYk1x; 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 qb40-20020a1709077ea800b00731745a7f19si8286405ejc.271.2022.08.15.17.42.38; Mon, 15 Aug 2022 17:43: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=0POnYk1x; 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 S1355372AbiHOXz7 (ORCPT + 99 others); Mon, 15 Aug 2022 19:55:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354773AbiHOXuZ (ORCPT ); Mon, 15 Aug 2022 19:50:25 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7D0015858B; Mon, 15 Aug 2022 13:15:57 -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 sin.source.kernel.org (Postfix) with ESMTPS id 2BC95CE130B; Mon, 15 Aug 2022 20:15:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E48F5C433C1; Mon, 15 Aug 2022 20:15:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594554; bh=tM4SDSdgsL1BoKw3VU2X2UxP5u4uYpyQPMV0hmBuJvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0POnYk1xFtVQ/IfU2aeTMogB2dhiZewBqnH7SrZ2GsNkS21x2s60Et0F6XrAXrxdA 5CE62JTJNoglLP3xsDOYcO8LhDCBPniW57TDUuW55eWwsmV9UayekhZfwW5J0ypQ3F wQ1jKWd8W7484pa1HjvR27PWdM1swA3FOVCkW53c= 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 0477/1157] mt76: mt7921: do not update pm states in case of error Date: Mon, 15 Aug 2022 19:57:13 +0200 Message-Id: <20220815180458.705456051@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 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