Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13724023pxu; Mon, 4 Jan 2021 02:41:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQ+h62BKmSZeFY8IYpOK9UhUNLt18VnrHY8dQX5V4R1l4OmBpv0zSrIlZtenYlr0TVlndH X-Received: by 2002:a50:9ee6:: with SMTP id a93mr70961350edf.174.1609756861185; Mon, 04 Jan 2021 02:41:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609756861; cv=none; d=google.com; s=arc-20160816; b=IRcLK7vVeRhdK0ujBkHKF2gMDQPuW4JpsRKm4D7H2GWFY4jqisZoxd433REnXANiD2 4bNTY9XFWWT0XJfEjG6mbD4VmdpHsjQu5uNMs3Zs3D9qn5nOSVGF723FjoKMwwYupJOG LWKrd6SrCobSSBX4Dmy0fQPq0LVPYp/i89ie72vkevzCINyIpHCpqvYkJjujrpI6K4HR E2DQ2S7gVwGhnCbK8NIZZ7yNRs9dHNyal1ZR8yVhwz+0+RUwbtAgNFTr5wHEJYrK0gA+ fEh2R30cpvgfY54SwmOkL1FpflevS23vQTT+uAzn2mzAgwYei2CdTPiv4kDv6/Cly+5k CBTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=Uk9lYMm9ey65BqE/Wih2VZhcmr4l+5ucfmFMpGEBb/E=; b=pMFQJDcNB24JnJXSk+4+gGMyXYH5hSaoXlf0Mp2T8YH2OrOaIaFo16FOZ+TJiW1D0J HSeZch50xqYGxSE7lJiIwgtjbdVoToXn/vpDDUQbEPdqaHJN72+Ap618fa3veaar6FGF f7OmwwASHzQAaHfovahE4UFTlrrHLX1nyl10E0EY++1feO7OpycC1r9ziwcPy5WphmIs wcTxTXB5JhG7LHNxE8at9VR4wxg+BETJJkj2AYEatRrCMnVU6DPnl2abhq/m1VlONkEe KcgtLqvnj8mzRRMfWjYud+bWiXoI2mbM5vJDASXBAsj8mE6xK9+LGQEot8jXlSdDD5AR Eohg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=QPeQZqx6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca4si31564668edb.559.2021.01.04.02.40.38; Mon, 04 Jan 2021 02:41:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=QPeQZqx6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726794AbhADKiy (ORCPT + 99 others); Mon, 4 Jan 2021 05:38:54 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:35962 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726308AbhADKiy (ORCPT ); Mon, 4 Jan 2021 05:38:54 -0500 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 104AWLln003664; Mon, 4 Jan 2021 04:38:05 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=PODMain02222019; bh=Uk9lYMm9ey65BqE/Wih2VZhcmr4l+5ucfmFMpGEBb/E=; b=QPeQZqx6qc9a4sZwoeSI2nQaLuCT6WnUD7nqd8dNjuhZJtDxrefFqWFpmB0Ye7cb+nWQ IUPYeUBSh2Wtg4UMdJ9xYiOKGQ9DyjBwr9Bgj7O6/DvYTcEifmxLueJnkp89vxdUla57 sNROnd0T0O0qBZu7OjhQQk+zLkFmyEtZg6U2OVqoKLgjsZLlqcx6yqp2DPoCbDA2JKGa uST3kvHilv44wLY63yHzt3CCVHG5XAMQjUAK/vAfztAKGyYoY4KOw01eeLdLQunZTdST 9qhBURCZAN+zYIx8eW7X8XHA+XHAFJbsSeFgUhZ/yZev0wfDM4UJlI2gnOrdQTo13vgD pA== Received: from ediex01.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 35tq479aq7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 04 Jan 2021 04:38:05 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Mon, 4 Jan 2021 10:38:03 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Mon, 4 Jan 2021 10:38:03 +0000 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 06F052AB; Mon, 4 Jan 2021 10:38:03 +0000 (UTC) From: Charles Keepax To: , , , CC: , , Subject: [PATCH net v3] net: macb: Correct usage of MACB_CAPS_CLK_HW_CHG flag Date: Mon, 4 Jan 2021 10:38:02 +0000 Message-ID: <20210104103802.13091-1-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 mlxscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101040069 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A new flag MACB_CAPS_CLK_HW_CHG was added and all callers of macb_set_tx_clk were gated on the presence of this flag. - if (!clk) + if (!bp->tx_clk || !(bp->caps & MACB_CAPS_CLK_HW_CHG)) However the flag was not added to anything other than the new sama7g5_gem, turning that function call into a no op for all other systems. This breaks the networking on Zynq. The commit message adding this states: a new capability so that macb_set_tx_clock() to not be called for IPs having this capability This strongly implies that present of the flag was intended to skip the function not absence of the flag. Update the if statement to this effect, which repairs the existing users. Fixes: daafa1d33cc9 ("net: macb: add capability to not set the clock rate") Suggested-by: Andrew Lunn Signed-off-by: Charles Keepax --- Changes since v1: - Updated flag semantics to skip function, as appears to have been intended by the initial commit. Changes since v2: - Adding "net" to the subject line Thanks, Charles drivers/net/ethernet/cadence/macb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index d5d910916c2e8..814a5b10141d1 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -467,7 +467,7 @@ static void macb_set_tx_clk(struct macb *bp, int speed) { long ferr, rate, rate_rounded; - if (!bp->tx_clk || !(bp->caps & MACB_CAPS_CLK_HW_CHG)) + if (!bp->tx_clk || (bp->caps & MACB_CAPS_CLK_HW_CHG)) return; switch (speed) { -- 2.11.0