Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2057914lqz; Tue, 2 Apr 2024 06:15:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWu7+AxDpG9WqJgJB1zvj/YZKk5cLdGiUV3DYQl/TE86K9obIzygPEN6vksJtGOlcV7jmFDCVBdBYbnzLSzhqugLtmTpNyjp8rGoaAdQ== X-Google-Smtp-Source: AGHT+IFjuhs7tPby90/vnebljotwqCRr5L0HkwWZ6l94bLINdXFL90ifFkeAXeBFmxp0rCUKuHT1 X-Received: by 2002:a05:6122:45a7:b0:4bd:32c9:acb with SMTP id de39-20020a05612245a700b004bd32c90acbmr8871516vkb.7.1712063734615; Tue, 02 Apr 2024 06:15:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712063734; cv=pass; d=google.com; s=arc-20160816; b=VFMI0W6EQcc7vqMAxdh5zPfEkA96gnwyRqaDW1j1hj21zGdKPSjjr7oVSOj3/kcrAN waKBO1kZo+MtVUiLkYlBT8LLXAe4Tx0kf9tTd5/XfXzLEq7tzxXzd2j6sNTGaQU20W/W sxhXZQFKoPIwYzLBArBWWbnbS/Cr5KYrexk210En1AU6bJTbrwSDiFuXBxBkNwSe/hOE hRjhWWm4BWurNFOYQqqt0F6ECwPDL1rom+Pz5Wj7Ox6zLn/FCr7PV1rbGKpl4u5ofpXE ApI0pQehqkPuU6y6MXU0evJrY8yYHvZmxWIj0jV0Zq4KueurWlatdDutau3DYvA9ZeFi HgQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=hqZ5wIrSXIK26A5EeGJnWSAK9wbmk9KcAnB0HosD9N8=; fh=+wuPl0jVtcYGOKyQ4dCrYwpLO51Md4SLm1XlQV1l1VE=; b=cbjrBUbQ8ZoO915kp5v5rWFWWkz4y5If89DHKR8dN9i7jJKEN05bmqLob/3uP00MTu XOj+BRLyvgPy1VTnWRUQUeEkysdlHj7ZUMY450fYQtftCCfwG7Zo3Qo4Db3+hRVRu+EG 9LfqhPR9XcfjWhzdG4ph3sCyxMRlbwJQU6IFzhuCEc+Et2k8doPLoq3vZrfc5lvd2aO+ 0Xx8d0BQloab2T0BLv1xxMf4m4RsZlGPcJ4Iwj9pMKUjNGUeMyVq4JWbPqJPNjg1WcK7 nXgjT0YnmkZYGV3ONmztp197njBmrvdgAk0AmCeOS/B78/Jb9FSwuiFuTOz+6iOFtOgg X5hg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-128014-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128014-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k3-20020a05612202c300b004c0728c022csi1428657vki.310.2024.04.02.06.15.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 06:15:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128014-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-128014-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128014-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 65F531C22CB5 for ; Tue, 2 Apr 2024 13:15:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E6CC84A58; Tue, 2 Apr 2024 13:13:54 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 5B11381721 for ; Tue, 2 Apr 2024 13:13:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712063633; cv=none; b=hRrWNm6zZgi0S02eG1Ce/THzB6rOEFzSLnLuO7JkrkZ2ng0p6ynteuprag3cxeEmK7t5lGXp7+K5HAwxzQlsuMxMe3JpUSLMtKQZZafnt18SM+7UJZ1Lga799l/lbtQZ71QyVa8rhKC5KwvT+o4ebuMQoTIOKYKVn8Y2LJ6SLlo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712063633; c=relaxed/simple; bh=i1PFc7lD0popc40JSZRnhqej4YBxofX5vZ/4vsj7PXc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OeV5JLtV9MxeFw/ZR/KLOKwtaZb0guPxwiGlciMVHj7yR+N7z0PyfdKGXi/KgFK1zzGYEyeTResVN5zeARqiNYemLDi2UWInbWlcX6uSy2cbM+ENA5+6DWW8rupIzY6TuTbRnfCcUX+JgOrtn7s5W0tYnUvC0nJvc0DmpGYHFVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rrdxN-0007Nm-MW; Tue, 02 Apr 2024 15:13:41 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rrdxM-009zW9-Ie; Tue, 02 Apr 2024 15:13:40 +0200 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rrdxM-006Opi-1V; Tue, 02 Apr 2024 15:13:40 +0200 From: Oleksij Rempel To: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Woojung Huh , Arun Ramadoss Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, =?UTF-8?q?S=C3=B8ren=20Andersen?= Subject: [PATCH net-next v1 6/8] net: dsa: microchip: ksz8_r_dyn_mac_table(): ksz: do not return EAGAIN on timeout Date: Tue, 2 Apr 2024 15:13:37 +0200 Message-Id: <20240402131339.1525330-7-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240402131339.1525330-1-o.rempel@pengutronix.de> References: <20240402131339.1525330-1-o.rempel@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org EAGAIN was not used by previous code and not used by current code. So, remove it and use proper error value. Signed-off-by: Oleksij Rempel --- drivers/net/dsa/microchip/ksz8795.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index d5ec4b9772752..401f77055cc27 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -396,7 +396,7 @@ static int ksz8_valid_dyn_entry(struct ksz_device *dev, u8 *data) /* Entry is not ready for accessing. */ if (*data & masks[DYNAMIC_MAC_TABLE_NOT_READY]) { - return -EAGAIN; + return -ETIMEDOUT; /* Entry is ready for accessing. */ } else { ksz_read8(dev, regs[REG_IND_DATA_8], data); @@ -431,15 +431,14 @@ static int ksz8_r_dyn_mac_table(struct ksz_device *dev, u16 addr, u8 *mac_addr, ksz_write16(dev, regs[REG_IND_CTRL_0], ctrl_addr); ret = ksz8_valid_dyn_entry(dev, &data); - if (ret == -EAGAIN) { - if (addr == 0) - *entries = 0; - goto unlock_alu; - } else if (ret == -ENXIO) { + if (ret == -ENXIO) { *entries = 0; goto unlock_alu; } + if (ret) + goto unlock_alu; + ksz_read64(dev, regs[REG_IND_DATA_HI], &buf); data_hi = (u32)(buf >> 32); data_lo = (u32)buf; -- 2.39.2