Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp403597lqp; Thu, 21 Mar 2024 05:09:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUykFKnx35/RlXr0H645tT6zzqhPpYemXyAD/G9uVD0Cr6JhBzXnZ1EWgXOdyPuW46QRYlAeqNCobghyrWD7BPnAzWSwQFCJIFqiNb84w== X-Google-Smtp-Source: AGHT+IEFYWR3XXtw0biqd7+sc6noyy30KJxopd3wL8RVevk7aPWMf+TQBKHg5Wz0CFRGQdNgbL7Z X-Received: by 2002:a17:902:ce91:b0:1e0:188a:5ade with SMTP id f17-20020a170902ce9100b001e0188a5ademr3608549plg.11.1711022952547; Thu, 21 Mar 2024 05:09:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711022952; cv=pass; d=google.com; s=arc-20160816; b=FroKg94dOkf8H10Maa9ROTo1TD4v+Su7vPI+1tppMvV1qEkU/oyHjMjLYEGw7G8TMO Ql1eFOm433/27r+2qSvplQQHsqirppBgK0TDTUTpRHlCkMtjFoMicQD2yW0QBwOEHx2M JkeRsPg1Ncsd8GF0uSnFuB13fL6p0NB6AKymapgtdrw5ojI3DXhkmFQejp0Za9ZSNXgI 1KjOe4Pvt1a6GlpmXR5E7rhGGv7frHNY5OadRmi7KcKdgvs4+NbIWT8dkb7cGjQYYncr 6ifwHSgDBksm7tS2UdZ5I/hjQHyiTDjZm79mtPPXmUYvYdXDDzcyZyOwPmIUJP+nf/eZ mWoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=F/iw2HK3vXiazQ4lzWTqpiZp+orS3tULLc+m28xjdX4=; fh=WhpPWcKMhj5gVjjWU0TD6vKgITiAStKOgEBb4biXV40=; b=HMHo07/XWrOQCSzL7DwEL1QVVviI1LrPW2ZTieH2N6koICSFs9rlvqdiG6fr4g2ZqK lL8VaXemb5f0MvinajPDz9T9XcKuoQL/58h6euk/EoLjfe0Ak+IeCTjY2AmAxAfALP0g E6hfQsGMuySIxla9AyUOIvPzmM6TklwyiJlHQ/R//fTIhxW+RdlqThXexX6B0qCImvQU +iAheI+m3WKj/lZLntioJXPN2qaRZaONctzhZbdyf1sLnchxiI0CWmA/R0lWJmGtyEu0 O4bp8Ygf5KryME9PlrswA+x3g0pHU8z21hoo44oOpSb5DTOAgaaS62xKva4hgDvyEAZ3 3bhA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=astralinux.ru); spf=pass (google.com: domain of linux-kernel+bounces-110006-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110006-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n3-20020a170903110300b001dc1df6489dsi15508430plh.26.2024.03.21.05.09.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 05:09:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110006-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=astralinux.ru); spf=pass (google.com: domain of linux-kernel+bounces-110006-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110006-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 76333B22B80 for ; Thu, 21 Mar 2024 12:07:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 883947603F; Thu, 21 Mar 2024 12:06:49 +0000 (UTC) Received: from new-mail.astralinux.ru (new-mail.astralinux.ru [51.250.53.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5C1576C67; Thu, 21 Mar 2024 12:06:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=51.250.53.244 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711022809; cv=none; b=Glq5K255PYnsTXaGebzi4ELCM20swlPB8PnlowOyjhZD1ocZBPWDOueUlP4eWTnt+PlMhtVFy26u+yU76F87CqNGDlAY+zW9JCzj2Lx/7q0GyePIpw8bfW3TzIiw43rHzC/R+hAjtbwkHVg0ZdM1Gwp56KGwSwoYgVpX0iYB9+4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711022809; c=relaxed/simple; bh=fMXrWdlgBnkT3rnzcxkUUwb/SvMNn9s7qewG8AcMhQU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=fcGBLCxMukM/yPlJaG/+pvhEyT6uB8hPubr+YkUlUsr6OY4Sy6v8vSRaF1kLBRJf54VgOKO7P6H7Sh8zA8zUcih3ZPn4lCTnGH7r2FdqpomvPomUSIw+eJIr/zDTfzvPQPnzMT+wkBFEl3yEprXgsaGMMfB9+5iKuIHgkGq6LUw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=astralinux.ru; spf=pass smtp.mailfrom=astralinux.ru; arc=none smtp.client-ip=51.250.53.244 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=astralinux.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=astralinux.ru Received: from [10.177.233.158] (unknown [10.177.233.158]) by new-mail.astralinux.ru (Postfix) with ESMTPA id 4V0khY4vL1zlVqp; Thu, 21 Mar 2024 15:06:37 +0300 (MSK) Message-ID: <5968a30f-bf5c-47b7-be2d-71d8dd18699b@astralinux.ru> Date: Thu, 21 Mar 2024 15:06:30 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: RuPost Desktop Subject: Re: [PATCH] net: dsa: add return value check of genphy_read_status() Content-Language: ru To: Florian Fainelli , Andrew Lunn Cc: Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sebastian Reichel , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org References: <20240314063008.11214-1-adiupina@astralinux.ru> <99631ba3-36f9-4eed-80d9-4a663ef46d80@lunn.ch> <05a042d5-95fa-4eff-b2ad-c26e865837b1@gmail.com> From: Alexandra Diupina In-Reply-To: <05a042d5-95fa-4eff-b2ad-c26e865837b1@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-DrWeb-SpamScore: -100 X-DrWeb-SpamState: legit X-DrWeb-SpamDetail: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehuddgtddvucetufdoteggodetrfcurfhrohhfihhlvgemucfftfghgfeunecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttderjeenucfhrhhomheptehlvgigrghnughrrgcuffhiuhhpihhnrgcuoegrughiuhhpihhnrgesrghsthhrrghlihhnuhigrdhruheqnecuggftrfgrthhtvghrnheptdekffduvefhgffhffejjefhuddthfffueeugfeuffevveeigedtudegudduueeunecukfhppedutddrudejjedrvdeffedrudehkeenucfrrghrrghmpehhvghloheplgdutddrudejjedrvdeffedrudehkegnpdhinhgvthepuddtrddujeejrddvfeefrdduheekmeehieduvddvpdhmrghilhhfrhhomheprgguihhuphhinhgrsegrshhtrhgrlhhinhhugidrrhhupdhnsggprhgtphhtthhopeduuddprhgtphhtthhopehfrdhfrghinhgvlhhlihesghhmrghilhdrtghomhdprhgtphhtthhopegrnhgurhgvfieslhhunhhnrdgthhdprhgtphhtthhopeholhhtvggrnhhvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggrvhgvmhesuggrvhgvmhhlohhfthdrnhgvthdprhgtphhtthhopegvughumhgriigvthesghhoohhglhgvrdgtohhmpdhrtghpthhtohepkhhusggrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehprggsvghnihesrh gvughhrghtrdgtohhmpdhrtghpthhtohepshhrvgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhvtgdqphhrohhjvggttheslhhinhhugihtvghsthhinhhgrdhorhhg X-DrWeb-SpamVersion: Vade Retro 01.423.251#02 AS+AV+AP Profile: DRWEB; Bailout: 300 X-AntiVirus: Checked by Dr.Web [MailD: 11.1.19.2307031128, SE: 11.1.12.2210241838, Core engine: 7.00.62.01180, Virus records: 12528158, Updated: 2024-Mar-21 10:27:40 UTC] 21/03/24 02:48, Florian Fainelli пишет: > > > On 15/03/2024 03:25, Александра Дюпина wrote: >> Hello, Andrew! > > (please do not top-post) > >> >> The dsa_register_switch() function is used in various DSA >> drivers (in probe function), so it is necessary to check all >> possible errors. If the return value (may be an error code) >> of genphy_read_status() is not checked in >> dsa_shared_port_fixed_link_register_of(), a possible error >> in dsa_register_switch() may be missed. > > This is not a path that will fail, because the fixed PHY emulation > layer is not a real piece of hardware, therefore no MDIO read could > really cause a problem here. I don't have a strong opinion however if > you want to propagate it properly. Hi, Florian! I would like to make sure that I have understood you correctly. Checking the return value of genphy_read_status() in dsa_shared_port_fixed_link_register_of() is not needed because dsa_shared_port_fixed_link_register_of() is called if of_phy_is_fixed_link()==true (this means that the PHY emulation layer is used, link is registered by of_phy_register_fixed_link() without errors and therefore there cannot be an error in genphy_read_status()). Right?