Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2262481pxp; Mon, 21 Mar 2022 15:16:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKRAKhZCVt/Px/Qw3nRNrIhKI4kwn850Xag9gHijxMN4Mk+htmdKDQpQHH5rnJnCPQzXxG X-Received: by 2002:a17:902:bcc6:b0:153:53c2:7e2c with SMTP id o6-20020a170902bcc600b0015353c27e2cmr15328997pls.14.1647900962859; Mon, 21 Mar 2022 15:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647900962; cv=none; d=google.com; s=arc-20160816; b=DeIxSvw7BNWjuCsRbgg951/RbfafS/zP+OpyQcWENN1yLEW0P/+TJhIsQR+Y31P0Qg MNRryNvW2e7xp//Qeb6VGD1dRk8Ja62i/y8gTXQF6QI93ijfdquGjildQUujZhIaHAC5 PCePGCrERQDjz3cMD9AJf/23OcTMCyYg2ZKwir0hAwV7PH3mQTvNEV/yA/xu0EngdLR5 Dd4PY3+uR3lUc02lxNdGivqkMJFttWN1ODDhEqA77Lu7uPIRT344+fUwrViIQPJ1iGeC VZYs91gE0YIE1aQRG9VFsm/6iqpmOV4BP3tDjm3EJnMBhxZWKnFNOj0opfK1AtQQRgAS sDfg== 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=m60ocZHtQ9UzijDgEw6xQHqHvrPbCIMJ0e/Z1JneAMI=; b=u2155mnlUErj1ctTIWStzAZ5Lx9aXa8McnWhxKpaBcT+567lLnoJaqCUU8aEXVz/my Y9vI+Q0ps9MOyFg2hn8xy1Il2MaNUi2/1/dYfql87Cl919NqvK0Ivqf8CWK/PabldYTU RDS0XS4FOd4Ng9RXmu6ybHa1G5mWNUaRitgpdLALnQEWOyHaYhWP400Gsqn79s5kEOz+ yiYYAcN+JJxp/KFyt4PxcyiyeWW+b0xwCAOYGaAyCxUdE4AQMBvaQTMdLgTFZQQ61Q/x WN8fe9sq7ww8mzAyrkre21gcpQeKdWjQoVUcj35Hq7IbmRbP3hAkSWjsKfnDriLHRp+O Lqmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DJeWaVRU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f2-20020a056a00238200b004fa3a8dff53si6661620pfc.10.2022.03.21.15.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:16:02 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DJeWaVRU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C2E9A37B8F3; Mon, 21 Mar 2022 14:35:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348527AbiCUOFs (ORCPT + 99 others); Mon, 21 Mar 2022 10:05:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349185AbiCUN7k (ORCPT ); Mon, 21 Mar 2022 09:59:40 -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 CFE2C2529B; Mon, 21 Mar 2022 06:58:13 -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 7EF79B816CE; Mon, 21 Mar 2022 13:58:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8625C340E8; Mon, 21 Mar 2022 13:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647871091; bh=cBni2buC7H1TRb79ApwE1RHigOmlD6zjLemNukfcyac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DJeWaVRU1rqR4aqZ1kBiYY2a79Acz1mz/suNRFPK5N6FjxEFv0q9XoALWICvoDSR5 KKBlGQMFnQqA/vWjveU4r8+R16Fy6bWA00NzymGGEfdqLNfOfaEr+587geD+qsqAV2 TTWFms5+/gp5S8gecxsd13aYdsO1BCdzv7oj8cVg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kurt Cancemi , Andrew Lunn , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 04/17] net: phy: marvell: Fix invalid comparison in the resume and suspend functions Date: Mon, 21 Mar 2022 14:52:40 +0100 Message-Id: <20220321133217.282060904@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220321133217.148831184@linuxfoundation.org> References: <20220321133217.148831184@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Kurt Cancemi [ Upstream commit 837d9e49402eaf030db55a49f96fc51d73b4b441 ] This bug resulted in only the current mode being resumed and suspended when the PHY supported both fiber and copper modes and when the PHY only supported copper mode the fiber mode would incorrectly be attempted to be resumed and suspended. Fixes: 3758be3dc162 ("Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.") Signed-off-by: Kurt Cancemi Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220312201512.326047-1-kurt@x64architecture.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/phy/marvell.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 53420c531266..49801c2eb627 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -1408,8 +1408,8 @@ static int marvell_suspend(struct phy_device *phydev) int err; /* Suspend the fiber mode first */ - if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, - phydev->supported)) { + if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, + phydev->supported)) { err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); if (err < 0) goto error; @@ -1443,8 +1443,8 @@ static int marvell_resume(struct phy_device *phydev) int err; /* Resume the fiber mode first */ - if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, - phydev->supported)) { + if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, + phydev->supported)) { err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); if (err < 0) goto error; -- 2.34.1