Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp484823pxb; Wed, 20 Jan 2021 11:52:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEugCXiwORsJFJjCJAun4tj6zDsxsHVHa3vFI16Pw+OaiWZ9sPb0PD7sgmp9z4mkFzz1pI X-Received: by 2002:a17:906:b1c8:: with SMTP id bv8mr7266232ejb.208.1611172322702; Wed, 20 Jan 2021 11:52:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611172322; cv=none; d=google.com; s=arc-20160816; b=yueziNj6BCGrPturCw8HqxV+F+cGKWw7Yw5KpQ2hknS/kt7D2/22yZBYuBicz9ALMA Nq6AXLbh7q6sJ9zQTAJMToOl4qxXJ/BCxx30BT8QrtEj33eCAco2JdjvSkGUfoooMi6w cwdoj9K+YuMLwc8X/Yxsuh8kin3xiGrV3BvkZMJ7c4zH9yaVGUAH1twPlk9UYitaHD5N ocFOURgNAe+m0ZAcyEjqwxmm3LUiunUs5P2OL2oix2cjsfjRidkARzgVp5wLUI1qpKyx xlTLN/IQpdoPWIpuueo3uspSrDdlj67Jgbs39wFqfLEYWJuZpiR6HjrfGYkkD+6XoGDp F4VA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=wECjIsfiv6b1vpeE3rC46GdUz/M0EaI99XImGOrJhB8=; b=AAK5EPM2+oOi4QuAUsFjGYeO309ojVbu97dGeGSPU8peikQca6Kt/NL9hPa+Oo6WKc 1LI+MycEnVgCrWkhwCq8Sil4ZKHtd9dxjWbXPTl5pcZdKU96jOdPIS+7o9aG8YNYKsum C7yhPrptcwft+cbcK3Zc2AD0W0lhlybAc3PZDfn3YMGYiClCRJpoTj8R2uIiUg5lHbOg BxQkg8HjBdo2dgwunegCNCB3sQU3Aro3t26Vf/z0BysFkQjtXv4qC3yWZQaUxUijjU8d PBC0GAgYGAy08rb+g46LOBQYMvZUiaBdNCn9HBY5ehqqxtWn9cU8fTH6SGa1JH9sHdF2 fvfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=p0vxJUwj; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si954704eja.115.2021.01.20.11.51.35; Wed, 20 Jan 2021 11:52:02 -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=@walle.cc header.s=mail2016061301 header.b=p0vxJUwj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392662AbhATTsb (ORCPT + 99 others); Wed, 20 Jan 2021 14:48:31 -0500 Received: from ssl.serverraum.org ([176.9.125.105]:33439 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388379AbhATTn4 (ORCPT ); Wed, 20 Jan 2021 14:43:56 -0500 Received: from mwalle01.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:fa59:71ff:fe9b:b851]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 654E522727; Wed, 20 Jan 2021 20:43:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1611171794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=wECjIsfiv6b1vpeE3rC46GdUz/M0EaI99XImGOrJhB8=; b=p0vxJUwjuuGDnpiAaCkylxe/ifGBH5IUDfHHuDB4WXRGLKmH26+SGO9sPHK6b3aIzyY1qV gbko9UzORdaieMFvuwy220g9dvnaPe8WHH8PLuORhinlgm59nCpWHNdzWnDoKk979q4qzW 3huCfM1jgKWOmToRTsq4HkpM0FHaeh0= From: Michael Walle To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nicolas Ferre , Claudiu Beznea , "David S . Miller" , Michael Walle Subject: [PATCH] net: macb: ignore tx_clk if MII is used Date: Wed, 20 Jan 2021 20:43:03 +0100 Message-Id: <20210120194303.28268-1-michael@walle.cc> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the MII interface is used, the PHY is the clock master, thus don't set the clock rate. On Zynq-7000, this will prevent the following warning: macb e000b000.ethernet eth0: unable to generate target frequency: 25000000 Hz Signed-off-by: Michael Walle --- drivers/net/ethernet/cadence/macb_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 814a5b10141d..472bf8f220bc 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -470,6 +470,10 @@ static void macb_set_tx_clk(struct macb *bp, int speed) if (!bp->tx_clk || (bp->caps & MACB_CAPS_CLK_HW_CHG)) return; + /* In case of MII the PHY is the clock master */ + if (bp->phy_interface == PHY_INTERFACE_MODE_MII) + return; + switch (speed) { case SPEED_10: rate = 2500000; -- 2.20.1