Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2953460rdb; Tue, 6 Feb 2024 02:51:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHbCVxi3Kwi7STP28k+1Om7RzMEl66AUjl6ficcN6hiUEuhBHTx0/B8NnIWMr6Op2lyUFkg X-Received: by 2002:a05:6a00:17a8:b0:6e0:4a99:d780 with SMTP id s40-20020a056a0017a800b006e04a99d780mr2689879pfg.34.1707216674386; Tue, 06 Feb 2024 02:51:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707216674; cv=pass; d=google.com; s=arc-20160816; b=b2U81wl3Tpe7Va4bIT+HG+TENieI3MtcLnMu3xCQwwGbZjtXWqCt0h8KfHSfQBrFgY Zi3j2r8WCCYOiuGzBDCsw+HyT8IR0z4yzbY/YzyMkB4BFdFF8dX0nK3EE6QTsgWH9sJA T0OrQu82ykHSIW/wm6POVT4uBBYnSEzUz21e6ym7IK9HJgS7bzRpaiI+wOLeAt7N9m1q flfQSaVprf1LJSUCo5wUCZ0COMAEiaH49NjVjDVY5S3fSBTXLrosZ4Z4ThWByFQTQqL4 T/zh6BheifUes6stg+w9KgbKfdIVJ/Z+pzuVbsAqrhZh+jzFwpqZfvTX7VAEL20CDzs8 gtbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Qnr+GJSNInkqH8X1ju6adNgWnWatfsE0zlg3RODTQs0=; fh=LZoGuvlI6NGWr/rvm4PzFMrrpAVsXcBitUj3rfsZPKU=; b=TLDGwf/gEPlE2XN6+tXX2N4dkwVXaqYbXucFxyYXyRpQITlSh14s0iEflfgyleRSa7 2lcPYfet9SsxjiK24cIUDmIZwmGk5ulHhF9iuZeTYxETVNh0FTOkP2seGWWA4E/He0gh 5KP7aUDxsJpeGA0rHfSEis9qJSFICzDen1hY7PRydEK/omFXsifQQ4ISEUpiZuOIIFEx D2WiKTHWqxGbfgOxGqVz3tPCAzW4FF5h2iIvb9jgrN3jPxB2pFrgJM2kzqRbj/9ujHy6 nVzuWFF78SxEN1NH4HF2dpvHDD9TMRH0MdPn57vgnbG+tVPWmKGhgNcc7gqdFbXV3zSz c/VQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OjSkPEda; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-54711-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54711-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCW2VIsSVetjbTSGZ3PxvdY2XFC17slgoIw8LzHd/EmMlF0zNQrwD5Qgczultq8UFrSfh1j5gsUR2lUb32ArB7AMgTAABNOjIh7LWU+c5g== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x15-20020aa79a4f000000b006e02469fa2dsi1421310pfj.6.2024.02.06.02.51.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 02:51:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54711-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OjSkPEda; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-54711-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54711-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0663828ABF7 for ; Tue, 6 Feb 2024 10:51:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E0A312B144; Tue, 6 Feb 2024 10:50:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OjSkPEda" Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03E2B1EB31; Tue, 6 Feb 2024 10:50:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707216655; cv=none; b=Aa+8F01anDnmmDQn4W+/WqJyWwZrNttLBQCOz8B1RNpNAvKPU5C9ktqPK+/YUoa+uIDTcRQjBm+ONqq+HX48ZiLDCZmGX3aVCdG/LwZgVuHo3hCCM1slDkhXDp/fOGj3As7Bp7BxADqLpiKKdBHJD0Lzc4g10zChuLm/+7U/Y3g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707216655; c=relaxed/simple; bh=GCu0VtJyZuEu7ZGNVEdEbLLuK7Sy1w6+vFnzALv1IlE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bJs0WPF9o4SHvs+6t3zm9A6WYQySKDLnlfvXTGX/oxVNjZIrqZ3DEtR10VejdZ0TGV0OGtTZjcGDKIm88Q+mCZkcQg1EadYvQcacf+Br3hzvice+E6H8fLxAY8PMFcPF2fKvkI45/GvNx3rd4CZGR2PvkyBuUgZxs0jOFBlAIuA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OjSkPEda; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a28a6cef709so751206866b.1; Tue, 06 Feb 2024 02:50:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707216652; x=1707821452; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=Qnr+GJSNInkqH8X1ju6adNgWnWatfsE0zlg3RODTQs0=; b=OjSkPEda+DVp9HAxCaLfByNC5ZjSfvaGRZb0grHLBOZ4S8Q30VvXdHuU2fthZmncsF u8VLFsjbaSfxPIxAJnATnUkiGJNFMUIDLu781ttK8U36cDKh0kkYEE9t1DxuMb2OeUmV v9ylWTCxbczlbUvw/FRQI0VNEryg205vc0Y5mpRX8+RXavcI9WTS2dd6FUn52wPjgp1b rw9gHAOz+UZDgOSwyEtq0rEcQ3nWtfQA6njffMIEqP622XejyvewhE6TAmUjX6D4RHHk 4sofs4GhQ0mh7lTD/tTst/1Jx3xJjzjWq7g9TgkkgLfMriTvb0M+O1y9Oaq+d7Tv6OX/ WYgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707216652; x=1707821452; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Qnr+GJSNInkqH8X1ju6adNgWnWatfsE0zlg3RODTQs0=; b=JnKi+rwKlQpJ+85DFHWs0Os8Ru7EdOByDYXhaAnCxZAyWwfKr3CT8y7jJauY7QBcTE giCGetEkqQfY1A/gJ2EDMa9XpXNhLGKR2lpUOmaEv5hzVkCfhf1YI9Q08fTyNr72BP2q SLTfV2sXKiXDdLOSUqN649Nld6aXcpM+ByuYBhRfMr2pE8zVyItCSriAL+3bwoTnWAHo /Rx3lrQvDSj+1d/s+MmV1hbfLtYJsLWeRMWo0k7PPwTwrHbCdKPU+pVpYtTVp2exxWRV +UxPlqRUtyCVs6LvAAgb5tSgbA7zaqvHN7q9s3ZvceKY3QSvnah0s0cvwjzFzE4ytGJC ue7g== X-Gm-Message-State: AOJu0YyyLT4oQ74gYOLKW/ojaE+YwuNKvHXwSFh1mbRQw7ojIKkbn9iG vzcOsQjJ9IgqoFFJMYPgRheJ1wQzYT5uo81g96DojZylIa02oTX3 X-Received: by 2002:a17:906:31d2:b0:a38:187a:3281 with SMTP id f18-20020a17090631d200b00a38187a3281mr1130431ejf.70.1707216652035; Tue, 06 Feb 2024 02:50:52 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXg8riI/jLImZaU3s8trcrVtGeKUgOV3x8PYnmnuZhpOy+Hd0AOAwpieFrmC3OGwADCRqmEr7ERCoi+kXlaf2qldIFMJXukxFtSnOddFGeRjjmEdGRl+IgcCCq53JgCGQprcnVA3eZNtBIU42Q36O7PL/6OrwtcFZHVDcQIgw+8RupJec1zc9dr+SRB89pbGHqd3b1eh4EUCgJ36EAE2zbf9NpTxdrF0XF9AHnqzes+EbjTZKUMJDzfgkHZEhOASukiPHv8iqZBtLnVMlVexcvcK7XtIvmxJ1thctiBez3WP9Lv+EiruQaPFm5DUZhB83wi1h5+NYAYY//QpBjo7zfhDVQfJsjJexW7aUbLEfQLrW2rmoYA2xWFLwMUE6p3pa7Ewk4Oi0jJG5Sbozolp4e9/+ZOq60aIBpOX5OqVinAEyTQYjPymMlD2a7LZYKcMpqH/EJKAyqM1fbqdmGi01f1SRAN6ZXi2aWqSTHtHgrXEgq4ytZDVLXGe3sW1d/2uyHAXPqfhsajaoBOEDPh08XVXPjptuPhsmPi1g86VO7lX4eMbHGcWDsXQ0t/3LW+x6XjMU7Btp2jX7KPnE8NAIyQ2WOVfn8JDOSYO9DJYO55Yu++/FtfXY3CSySBshOnKw2yflJmuBeNJE3P4o950tm2rNo6IkH3XaXa1dXF5kSeTqdHEkOGLhC4D78RCI7lne1/VA== Received: from skbuf ([188.25.173.195]) by smtp.gmail.com with ESMTPSA id tj10-20020a170907c24a00b00a354a5d2c39sm1005649ejc.31.2024.02.06.02.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 02:50:51 -0800 (PST) Date: Tue, 6 Feb 2024 12:50:49 +0200 From: Vladimir Oltean To: arinc.unal@arinc9.com Cc: Daniel Golle , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, Bartel Eerdekens , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, "Russell King (Oracle)" Subject: Re: [PATCH net-next v5 3/7] net: dsa: mt7530: simplify mt7530_pad_clk_setup() Message-ID: <20240206105049.rldesxnyjs4dungi@skbuf> References: <20240206-for-netnext-mt7530-improvements-2-v5-0-d7d92a185cb1@arinc9.com> <20240206-for-netnext-mt7530-improvements-2-v5-3-d7d92a185cb1@arinc9.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240206-for-netnext-mt7530-improvements-2-v5-3-d7d92a185cb1@arinc9.com> On Tue, Feb 06, 2024 at 01:08:04AM +0300, Arınç ÜNAL via B4 Relay wrote: > From: Arınç ÜNAL > > This code is from before this driver was converted to phylink API. Phylink > deals with the unsupported interface cases before mt7530_pad_clk_setup() is > run. Therefore, the default case would never run. However, it must be > defined nonetheless to handle all the remaining enumeration values, the > phy-modes. > > Switch to if statement for RGMII and return which simplifies the code and > saves an indent. > > Set P6_INTF_MODE, which is the three least significant bits of the > MT7530_P6ECR register, to 0 for RGMII even though it will already be 0 > after reset. This is to keep supporting dynamic reconfiguration of the port > in the case the interface changes from TRGMII to RGMII. > > Disable the TRGMII clocks for all cases. They will be enabled if TRGMII is > being used. > > Read XTAL after checking for RGMII as it's only needed for the TRGMII > interface mode. > > Reviewed-by: Daniel Golle > Reviewed-by: Russell King (Oracle) > Signed-off-by: Arınç ÜNAL > --- Reviewed-by: Vladimir Oltean