From patchwork Thu Aug 29 21:48:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13783944 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) (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 7517F14B949; Thu, 29 Aug 2024 21:48:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724968123; cv=none; b=QlazMBo9A5pjmrC7WGv8hdOflGNyCnKYYPWWlVELoK5AgFNz5cEMXNX7k8oJMBbYlfA/nyk1WfHIpNgHkTEDpJSZJOOb57uapXa1kv3CPd0/ZVu+2w9PoZ58i5WTBjc/t4CYcjKhqv5nohxJG3gZcj90ZTuKlo7aJWXaQ8XRgRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724968123; c=relaxed/simple; bh=2Z/PqP4sbWzkhpb9e3kg/1CiXGRJONT2WYqdf5/n7eg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T8BlhBuIuQE/mTqzcyjvfodRdCl0LGGDTgCZdBRjix1vc+Fu/jXKDRNlyXciBnJPrhRIIepUC+2SJWpz72aVA3g47aphMXD45stiCac44GC3lqy48AdUV7hjACVxRaYmO6BffozuBlSFd6xtyjA1+Av7JTGsvAjVg6Dl5deoQzg= 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=NbyLuGiy; arc=none smtp.client-ip=209.85.161.50 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NbyLuGiy" Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-5dca9cc71b2so658171eaf.2; Thu, 29 Aug 2024 14:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724968121; x=1725572921; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c3eESsElB7GvWhyi8B4HAOuCsvVymEaPvXQjfpmPGj8=; b=NbyLuGiy2XebV1RW6nZ0qSgAo2AbiM/8fYyuSntT34aO9pkF3X2+gUHVz7yVv7PUyt jmLYSB9HVXjvPZibJnLD5pKXv7SsLxmKspV54re8wShDo0qJBCyZvu3GqnYki1bxJK/s z5eVBe+SfM2VrW5rl4UBIHK+FXZIYPudAhfnWoCQ0rE0YnYr97pXYhv/x0T6qo0EHHOa SFbEAm422I+B7KEGgQL9TFGDLa1m65fpwu+0P6ns45By95Jgs/T2arSFlMXEQEXmF/Ol EJ7KKpI4/pBs7L/z/0LfY+WqjB0yejCF3ivLsrmrahcvr7XVuE5HjzPQlmMbk/5pd9ww hSpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724968121; x=1725572921; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c3eESsElB7GvWhyi8B4HAOuCsvVymEaPvXQjfpmPGj8=; b=SJMLtaEklteG4oWJfy21yvQ0+cA+Hn930KwW5XZLLJHJ0s1ZeM/l9qO6DflUcavA5d BOhA7SJIySMTxEp3NLJyEXOMVl0Xs5CuIHijyw3OXSaWsLhAMzal2wg0GOxaQDkbkSm3 I8n3TE9lXB+I9hDg81s8O4qGYvDfZxAPwJ1hcm9L64tx8Wa0/6YbIzGafh0lOTGopFoF BcXdaRyJ+JgcLOlIKOZJnOaP2/euOTFkWHmyTB2y9Z32CtguJKRmZTSP/w7GVCMrGnx9 bR777FOH+uaz27dP0cZi23yy41mIplcJZCjeZYW+4WpE2qI71O+XC+8eVMbmMWuFIWu7 NPYQ== X-Forwarded-Encrypted: i=1; AJvYcCXPJG8ft8AVfNQszxTBEA/0TiNVE1kpU6n0Deej+j/v2KogAxnYOpuYwNeho5xAVQqxqz7h9SLGI+1TyIU=@vger.kernel.org X-Gm-Message-State: AOJu0YxqJGjTDbFRsTxliS0ChW+g7W5YvtnXP1A+ee/3zx4F8UyKAytJ 71fprrqNEXN4aokdmBnljD56YUqCuPP47qg4fVoSjbU/3MX3zSp7zOOKqwR8 X-Google-Smtp-Source: AGHT+IHaNrCZk/pnHHwfjof7JObkw2sbhj2DbwLzhh24MXvS6NmUtg+C93m/DAGMw5mI5TrtbvLjnw== X-Received: by 2002:a05:6358:78a:b0:1ac:671a:f39f with SMTP id e5c5f4694b2df-1b603c14850mr489979255d.11.1724968121351; Thu, 29 Aug 2024 14:48:41 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7d22e77a7besm1708029a12.37.2024.08.29.14.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 14:48:41 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, o.rempel@pengutronix.de, p.zabel@pengutronix.de Subject: [PATCH net-next 1/6] net: ag71xx: add COMPILE_TEST to test compilation Date: Thu, 29 Aug 2024 14:48:20 -0700 Message-ID: <20240829214838.2235031-2-rosenp@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829214838.2235031-1-rosenp@gmail.com> References: <20240829214838.2235031-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org While this driver is meant for MIPS only, it can be compiled on x86 just fine. Remove pointless parentheses while at it. Enables CI building of this driver. Signed-off-by: Rosen Penev Reviewed-by: Simon Horman --- drivers/net/ethernet/atheros/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/atheros/Kconfig b/drivers/net/ethernet/atheros/Kconfig index 482c58c4c584..03b31bedc9a5 100644 --- a/drivers/net/ethernet/atheros/Kconfig +++ b/drivers/net/ethernet/atheros/Kconfig @@ -6,7 +6,7 @@ config NET_VENDOR_ATHEROS bool "Atheros devices" default y - depends on (PCI || ATH79) + depends on PCI || ATH79 || COMPILE_TEST help If you have a network (Ethernet) card belonging to this class, say Y. @@ -19,7 +19,7 @@ if NET_VENDOR_ATHEROS config AG71XX tristate "Atheros AR7XXX/AR9XXX built-in ethernet mac support" - depends on ATH79 + depends on ATH79 || COMPILE_TEST select PHYLINK imply NET_SELFTESTS help From patchwork Thu Aug 29 21:48:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13783945 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (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 DD90E1BAECD; Thu, 29 Aug 2024 21:48:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724968125; cv=none; b=uKDL3VX1BDSIFLMJYEI4MnBf3tiMmbue2r9FHcm0x8Un6C9a4FHZ6lL/bLxHDWM/YtYvG6d3a8hfvLFQilyiiP/4SmJH9Tc5ZFm8ZxTv6qzThVX2cMxa59kWSgXwLOf0HNkW/2qtYcJmXhgIckmqaz+9qY/GprRaoH8HVxuT2Uc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724968125; c=relaxed/simple; bh=/Ib3RLq1lbiCNk/gwnJKNDQ9hhJgWipT3hhpkjr0OGk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AxxUPDsgaeb2iodvUv00bKLcYMmwiQ8v2L7jYIGPAvMsyibTV+ix2bbXJ6uYrmDQmH4O4Zj14RccKeP8/7YI2xRkcGsS5ifX+drlMlO3ynF+C2EEJyUYuNo0QqTUjVx2mrJmkTPr/rdNDZsu7JNHP1GsEq+n11lrRO8pJZfg4Xg= 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=LbUbFgsI; arc=none smtp.client-ip=209.85.166.181 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LbUbFgsI" Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-39d47a9ffb9so4229235ab.1; Thu, 29 Aug 2024 14:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724968123; x=1725572923; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=y2cYzMIEtOcnTHpiB72IdBy7qlV47qa+YowYhB7YIvA=; b=LbUbFgsIJ+m92sa688vjZgkpBQiko0qEorVmLAT/9VloMFrI9HqFs1bNpXlNbV6R8R ImKs4zyTJ2ZyhSXEaEgwV1npADwLfH+ilh2bEevFGdvGpuk1j64PnmYh6M3kKK1pdwKI uzBPYJSbdIRyp4o6CACdeoTKlQxR8mkxT+qqswHHScRLfST3xY48UqwdI3JopZ9VccVA 6ceV5KnXFeneOeeSVO3LtpjOVURPPTH7b8RxYzkLLhKfJYI3NjPfQ9hIgGgDJmOB5eAP /+yavllwdPFCxsXDA4l8rvLKoxsZ/iHMKzJZDpdhkbS9Tcut0JRwZufkcPhPdoqHl2Wb 56Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724968123; x=1725572923; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y2cYzMIEtOcnTHpiB72IdBy7qlV47qa+YowYhB7YIvA=; b=XL1hAern20Dj5aeUnoWYljhpR19uTS9AGZPhExeF03PbaY7n5MYTSFFqmO9qgos3i+ qsHDLMT0hIEcPAPHk0XdOYNweqCwGrYjERHPxjW0kqm4f8DNwwhkS6N2Mn8pt4Su4ZnH uol7aRX5vGTXVaxImCy8Vhao1wsaE9GQ9EmDpexTeV8P62aR6bbGvtCPTUO7dint1cwL O2cj5LArSwmLocDPuHBlcDAJy45yJYTj6cZMg7xqtuGgi52rgzRyrtWVaklypLq8jsge xluluhamZ7kzqn2MddKtn0bAhlpz9KDQ9j5EWA/CSZmhGbkvc+bpZlC7zkluyyLXPPAo +rxg== X-Forwarded-Encrypted: i=1; AJvYcCX3p0U/zV2TLDH9Nx6cqUEqi2Y/QQmdG1gzQYYKR9C3TkkNKRagPmK7l4GIBGMq+qgNwmXhvIjXuHMEOhY=@vger.kernel.org X-Gm-Message-State: AOJu0YyQ6mUxVDzyAKJDkFaoHKd2/ZHkH4QikvdU5Kn1DHLYiPu2+E43 3SMaR6owztveu1uYEtYnrppkphLixhV65w4MNz1DSFyL7NThN7iZ0kmki9N/ X-Google-Smtp-Source: AGHT+IGAI0zPMj8TO3F1/Jfsd0hd4CenesfKqQ2Y6k7rb00bKaDbGGEBU0M2pNVii8kIzbF4vLAz3Q== X-Received: by 2002:a05:6e02:1e04:b0:39d:351a:d0a2 with SMTP id e9e14a558f8ab-39f379ae918mr51543625ab.25.1724968122609; Thu, 29 Aug 2024 14:48:42 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7d22e77a7besm1708029a12.37.2024.08.29.14.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 14:48:42 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, o.rempel@pengutronix.de, p.zabel@pengutronix.de Subject: [PATCH net-next 2/6] net: ag71xx: update FIFO bits and descriptions Date: Thu, 29 Aug 2024 14:48:21 -0700 Message-ID: <20240829214838.2235031-3-rosenp@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829214838.2235031-1-rosenp@gmail.com> References: <20240829214838.2235031-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Taken from QCA SDK. No functional difference as same bits get applied. Signed-off-by: Rosen Penev Reviewed-by: Oleksij Rempel --- drivers/net/ethernet/atheros/ag71xx.c | 48 +++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c index db2a8ade6205..89c966b43427 100644 --- a/drivers/net/ethernet/atheros/ag71xx.c +++ b/drivers/net/ethernet/atheros/ag71xx.c @@ -149,11 +149,11 @@ #define FIFO_CFG4_MC BIT(8) /* Multicast Packet */ #define FIFO_CFG4_BC BIT(9) /* Broadcast Packet */ #define FIFO_CFG4_DR BIT(10) /* Dribble */ -#define FIFO_CFG4_LE BIT(11) /* Long Event */ -#define FIFO_CFG4_CF BIT(12) /* Control Frame */ -#define FIFO_CFG4_PF BIT(13) /* Pause Frame */ -#define FIFO_CFG4_UO BIT(14) /* Unsupported Opcode */ -#define FIFO_CFG4_VT BIT(15) /* VLAN tag detected */ +#define FIFO_CFG4_CF BIT(11) /* Control Frame */ +#define FIFO_CFG4_PF BIT(12) /* Pause Frame */ +#define FIFO_CFG4_UO BIT(13) /* Unsupported Opcode */ +#define FIFO_CFG4_VT BIT(14) /* VLAN tag detected */ +#define FIFO_CFG4_LE BIT(15) /* Long Event */ #define FIFO_CFG4_FT BIT(16) /* Frame Truncated */ #define FIFO_CFG4_UC BIT(17) /* Unicast Packet */ #define FIFO_CFG4_INIT (FIFO_CFG4_DE | FIFO_CFG4_DV | FIFO_CFG4_FC | \ @@ -168,28 +168,28 @@ #define FIFO_CFG5_DV BIT(1) /* RX_DV Event */ #define FIFO_CFG5_FC BIT(2) /* False Carrier */ #define FIFO_CFG5_CE BIT(3) /* Code Error */ -#define FIFO_CFG5_LM BIT(4) /* Length Mismatch */ -#define FIFO_CFG5_LO BIT(5) /* Length Out of Range */ -#define FIFO_CFG5_OK BIT(6) /* Packet is OK */ -#define FIFO_CFG5_MC BIT(7) /* Multicast Packet */ -#define FIFO_CFG5_BC BIT(8) /* Broadcast Packet */ -#define FIFO_CFG5_DR BIT(9) /* Dribble */ -#define FIFO_CFG5_CF BIT(10) /* Control Frame */ -#define FIFO_CFG5_PF BIT(11) /* Pause Frame */ -#define FIFO_CFG5_UO BIT(12) /* Unsupported Opcode */ -#define FIFO_CFG5_VT BIT(13) /* VLAN tag detected */ -#define FIFO_CFG5_LE BIT(14) /* Long Event */ -#define FIFO_CFG5_FT BIT(15) /* Frame Truncated */ -#define FIFO_CFG5_16 BIT(16) /* unknown */ -#define FIFO_CFG5_17 BIT(17) /* unknown */ +#define FIFO_CFG5_CR BIT(4) /* CRC error */ +#define FIFO_CFG5_LM BIT(5) /* Length Mismatch */ +#define FIFO_CFG5_LO BIT(6) /* Length Out of Range */ +#define FIFO_CFG5_OK BIT(7) /* Packet is OK */ +#define FIFO_CFG5_MC BIT(8) /* Multicast Packet */ +#define FIFO_CFG5_BC BIT(9) /* Broadcast Packet */ +#define FIFO_CFG5_DR BIT(10) /* Dribble */ +#define FIFO_CFG5_CF BIT(11) /* Control Frame */ +#define FIFO_CFG5_PF BIT(12) /* Pause Frame */ +#define FIFO_CFG5_UO BIT(13) /* Unsupported Opcode */ +#define FIFO_CFG5_VT BIT(14) /* VLAN tag detected */ +#define FIFO_CFG5_LE BIT(15) /* Long Event */ +#define FIFO_CFG5_FT BIT(16) /* Frame Truncated */ +#define FIFO_CFG5_UC BIT(17) /* Unicast Packet */ #define FIFO_CFG5_SF BIT(18) /* Short Frame */ #define FIFO_CFG5_BM BIT(19) /* Byte Mode */ #define FIFO_CFG5_INIT (FIFO_CFG5_DE | FIFO_CFG5_DV | FIFO_CFG5_FC | \ - FIFO_CFG5_CE | FIFO_CFG5_LO | FIFO_CFG5_OK | \ - FIFO_CFG5_MC | FIFO_CFG5_BC | FIFO_CFG5_DR | \ - FIFO_CFG5_CF | FIFO_CFG5_PF | FIFO_CFG5_VT | \ - FIFO_CFG5_LE | FIFO_CFG5_FT | FIFO_CFG5_16 | \ - FIFO_CFG5_17 | FIFO_CFG5_SF) + FIFO_CFG5_CE | FIFO_CFG5_LM | FIFO_CFG5_LO | \ + FIFO_CFG5_OK | FIFO_CFG5_MC | FIFO_CFG5_BC | \ + FIFO_CFG5_DR | FIFO_CFG5_CF | FIFO_CFG5_UO | \ + FIFO_CFG5_VT | FIFO_CFG5_LE | FIFO_CFG5_FT | \ + FIFO_CFG5_UC | FIFO_CFG5_SF) #define AG71XX_REG_TX_CTRL 0x0180 #define TX_CTRL_TXE BIT(0) /* Tx Enable */ From patchwork Thu Aug 29 21:48:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13783946 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (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 F015A1BB696; Thu, 29 Aug 2024 21:48:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724968126; cv=none; b=BFcK9IGE7qAi3X/FRdGb5x8hiVJN5lWvDpu4UA01VA50ve7A5FzJfnsr1gknnaSgnHX+t6WyhfbOaEPqEaRzdEi3ilCTVjv67Njq2kvTOFV1yXVNQIWpVvIlE+K/0Sdd22fDPFa/M5Txj7wN5aUhVyvQ45JR0NTkULEcpVML/XI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724968126; c=relaxed/simple; bh=DpvWD4Hx+ubjtWZr0SjKbPjMf5o7Xsp9yXZxbet1eYM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kPFm7aZX7pBn606Se24DTk/rEVlz81G9gVUy/Lvx76W2TTRl0L3IP2FTStLEdklmTSVSRTPFInkpveNUb6IpNPpo3FyPg4Ug3qG0PSuJkJIQzbDRIY82N1vuDqAWZCvJ3NIAclG+u0oxAkF+S8WLyrj1yj/Mn+C4++U6uWW5p0o= 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=BiAAqjrH; arc=none smtp.client-ip=209.85.166.173 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BiAAqjrH" Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-39d3b31e577so4961255ab.1; Thu, 29 Aug 2024 14:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724968124; x=1725572924; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KIWx7O7Yfjr0NlWYq8rnxK+R+TlNba0mB+FqBvJfLL4=; b=BiAAqjrHiMPgRPL9Yf9PznWYWkyWIGlnFdOmdcTjyVekSRoldSLQdpMoP9O8a5mxwT VRBhApGhlTO38jgNQdNR2MtlcEdp3ADVEIJCf4lDlgogeLnVn/liwrbYR6thVqAiELJQ uIE0RAwjhxP9GMSBnGTrKSqJQd6pLLiuCbkvVdZJG6lNdlTDeL7L2PKL6gseT8NCzE0m vOLx0E2QLg/nPAdryu2sDhJREF+ZxhSqJWqitctJpboV4bTrYGPn3MwPBl/RhWJP5wo7 7lFAe454U7bev+oCWOK6gFwxPNmvaVB9Ua64JlJWIugwIUrtlna9tDuUw7/Gj8Euzl0R kmEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724968124; x=1725572924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KIWx7O7Yfjr0NlWYq8rnxK+R+TlNba0mB+FqBvJfLL4=; b=DbQdLUIj2As3MoZsU/6Op7hlgjngGWGEYZXYRly/RSl0+nFNlJzebZhfYtDehLg7sH xITfZAvCpf9rsbMNykectdUhRIvOgDWeVoTrg/sZVcw7OC4EGw35Shb7mLAHJTYmgMKY rpAwVNp6uu25yYWNFqxwINxlGYAgQwbCG+w5ylnhqdKt0z+UhF9ApsONHqBFgn6epB/m Aj3bq2mMLEjelms3gKXcnWEuwCSnHmXjeD1F6SPNPhVFPeglejj+YpiRYl7wIWqfeNoi lTHx4Aq37CRxBTTOjhSGgXcDQsVT/Tg1TO942QEMxi1qDn9ruj96VjpmFnRvT6CVLAxl RBQQ== X-Forwarded-Encrypted: i=1; AJvYcCW1L4MyUegXwHZ/+kW3SCrykzoO3+siU+fRyFXD0OOP99QlWfliFZiMmcBxJrhv5jFmht1D587aA1oWI/k=@vger.kernel.org X-Gm-Message-State: AOJu0YxrkykkgO1kOyWmO9aZM/qnH4cmhlPDpSYN4FvPmb7qeRnlsxtJ sMfyDseuTCuxWcIusqZ1HDh5SSU/BAXqaaQ2nFrkm/DlLM0O1k5vjNFmuIHw X-Google-Smtp-Source: AGHT+IHDPHIXaZ2YuwMnYDje41Rsstbt8vQ9tCYyOQmflj2gYiTOWkRUagGHXFVtl5wUPzl+oe+ZhA== X-Received: by 2002:a05:6e02:1446:b0:39d:22ab:9b26 with SMTP id e9e14a558f8ab-39f377ce44dmr51989165ab.4.1724968123800; Thu, 29 Aug 2024 14:48:43 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7d22e77a7besm1708029a12.37.2024.08.29.14.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 14:48:43 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, o.rempel@pengutronix.de, p.zabel@pengutronix.de Subject: [PATCH net-next 3/6] net: ag71xx: use ethtool_puts Date: Thu, 29 Aug 2024 14:48:22 -0700 Message-ID: <20240829214838.2235031-4-rosenp@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829214838.2235031-1-rosenp@gmail.com> References: <20240829214838.2235031-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Allows simplifying get_strings and avoids manual pointer manipulation. Signed-off-by: Rosen Penev Reviewed-by: Oleksij Rempel --- drivers/net/ethernet/atheros/ag71xx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c index 89c966b43427..b2e68e6eae12 100644 --- a/drivers/net/ethernet/atheros/ag71xx.c +++ b/drivers/net/ethernet/atheros/ag71xx.c @@ -509,8 +509,7 @@ static void ag71xx_ethtool_get_strings(struct net_device *netdev, u32 sset, switch (sset) { case ETH_SS_STATS: for (i = 0; i < ARRAY_SIZE(ag71xx_statistics); i++) - memcpy(data + i * ETH_GSTRING_LEN, - ag71xx_statistics[i].name, ETH_GSTRING_LEN); + ethtool_puts(&data, ag71xx_statistics[i].name); break; case ETH_SS_TEST: net_selftest_get_strings(data); From patchwork Thu Aug 29 21:48:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13783947 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (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 9F7B91BC07D; Thu, 29 Aug 2024 21:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724968129; cv=none; b=jrYCpymoUMUSixIyabRxZiJmRVWKFsxHvw6/2NEPWSk/nXoBB53edEYpE3xoz7Z8QoqzKLZEWYWLy7mt+8Kh7ZVn65mz9e+0BluQigRolAsgIs9FlQ1szKXPNRfxicGuw9O8q9Qxv+i00E2Sc1Ef97pOCMShLisOnJG4dJRsD+Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724968129; c=relaxed/simple; bh=itybp7DyH1Cjv9Ex8+Xw9r3k4ffsNQLKDTZ09I1GNmA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gr6DV6dejBHoryHupp6yjzD58uZfCUQY4KEICoikzKGpUt5GcApysWt0Kk/rDioT0ITsiae3XAUs8QAhOac3VMo0zS3XTA7nLzF1KpmdYLLprJtQEeTRvbhT/PqNTkxtvASEYZfsDCXlOf1182lu860+03Joosj82g2gRuwv1ok= 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=jYd+OAZl; arc=none smtp.client-ip=209.85.161.44 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jYd+OAZl" Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-5dd43ab0458so668501eaf.0; Thu, 29 Aug 2024 14:48:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724968126; x=1725572926; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iZLpENSjaZtJ9PRB+Lbx2VcX+eLUuNb31MGeOnkf5DY=; b=jYd+OAZlIbkshrJNGO3rGjMXWTmcMgzNbPW9slML8ArDnwQWMT1+C9mLPOWOA+txMj vAS7BPizVZUMUREmwUutuA9jn52sDMGAZz5L30pQPlFpc2Y2wHaAVPU2ydsBYU5m5PAs hEb3Oek9KkAfFqQDemjLLv2czB1iEcxPF7rdTBnWOrJQv5xB6ohNmHcoM4SzBq3Y6AoH EEN1hGxxQMcA0yBcJViIv0oaZvpd5nMIfZNRWZarqcQbllHp5eG1SEgwccxpIOmd60kK h7aRCbuHz+AcTANcej/S+irs6I6jeszLx8D/qGQPH11/rFkGsCzbvF3rD3mUlQVC77+o 3NKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724968126; x=1725572926; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iZLpENSjaZtJ9PRB+Lbx2VcX+eLUuNb31MGeOnkf5DY=; b=Q4PZYrgIAGVE5J2pMhKRRBzLlgb6nMaasizgwmPxINfYjTLBl0RIHj2vaipXZJZH+v 7AqdiSCAQPncQhUBZOtzoOEIOY8M3FOBApFXOOnqyy4BuVTknK9uAFyVcLmA1M9B4fYF hELMd6q0iqKKk19pc1GQ8O3DSCL6xqrirnuwWtF0kMPKbZTSuQZJdxe/lOqoSDUu4Znj MFLOtZpEAGrh/2/KROoqSGe15ta8OhgDrtYUXchovLZtVo5X8At3NBeLJKtqeh+t0HV2 6t7eGHoBbomVoPCRwt52sGIES78n04ypzomnerCA7WCyUVidOI2UXZdDXLIrNG/UyMFR Bgvg== X-Forwarded-Encrypted: i=1; AJvYcCVCjsyYVrexBD2sBUa+ltrjIfJ4n90dLHi9uB9WgbVDxXOUpMFlXGELpAWKcrtO2SzAJ+PRkhN2muTLq6o=@vger.kernel.org X-Gm-Message-State: AOJu0Yxi2CyA5xIwo8nLs39yMXC2CV/c/fybIvdLlZMu25u2l6WtWsYE jfWwOun5xtukuxL5RZkKFLp2N/q5kGPQROEiLSsQtsEzO73nX8mqn8UUI3DG X-Google-Smtp-Source: AGHT+IGi6/JnFAKDmHJiix8wTxTSRF9e9TWfXZ6G7JU7GHAKv50aJy2Pu0jw6/5/FwJxUbkzAtISDw== X-Received: by 2002:a05:6358:9385:b0:1ad:282:ab1f with SMTP id e5c5f4694b2df-1b603c35c8cmr552422655d.7.1724968125663; Thu, 29 Aug 2024 14:48:45 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7d22e77a7besm1708029a12.37.2024.08.29.14.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 14:48:45 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, o.rempel@pengutronix.de, p.zabel@pengutronix.de Subject: [PATCH net-next 4/6] net: ag71xx: get reset control using devm api Date: Thu, 29 Aug 2024 14:48:23 -0700 Message-ID: <20240829214838.2235031-5-rosenp@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829214838.2235031-1-rosenp@gmail.com> References: <20240829214838.2235031-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Currently, the of variant is missing reset_control_put in error paths. The devm variant does not require it. Allows removing mdio_reset from the struct as it is not used outside the function. Signed-off-by: Rosen Penev Reviewed-by: Oleksij Rempel --- drivers/net/ethernet/atheros/ag71xx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c index b2e68e6eae12..d7d1735acab7 100644 --- a/drivers/net/ethernet/atheros/ag71xx.c +++ b/drivers/net/ethernet/atheros/ag71xx.c @@ -379,7 +379,6 @@ struct ag71xx { u32 fifodata[3]; int mac_idx; - struct reset_control *mdio_reset; struct clk *clk_mdio; }; @@ -690,6 +689,7 @@ static int ag71xx_mdio_probe(struct ag71xx *ag) struct device *dev = &ag->pdev->dev; struct net_device *ndev = ag->ndev; static struct mii_bus *mii_bus; + struct reset_control *mdio_reset; struct device_node *np, *mnp; int err; @@ -705,10 +705,10 @@ static int ag71xx_mdio_probe(struct ag71xx *ag) if (!mii_bus) return -ENOMEM; - ag->mdio_reset = of_reset_control_get_exclusive(np, "mdio"); - if (IS_ERR(ag->mdio_reset)) { + mdio_reset = devm_reset_control_get_exclusive(dev, "mdio"); + if (IS_ERR(mdio_reset)) { netif_err(ag, probe, ndev, "Failed to get reset mdio.\n"); - return PTR_ERR(ag->mdio_reset); + return PTR_ERR(mdio_reset); } mii_bus->name = "ag71xx_mdio"; @@ -719,10 +719,10 @@ static int ag71xx_mdio_probe(struct ag71xx *ag) mii_bus->parent = dev; snprintf(mii_bus->id, MII_BUS_ID_SIZE, "%s.%d", np->name, ag->mac_idx); - if (!IS_ERR(ag->mdio_reset)) { - reset_control_assert(ag->mdio_reset); + if (!IS_ERR(mdio_reset)) { + reset_control_assert(mdio_reset); msleep(100); - reset_control_deassert(ag->mdio_reset); + reset_control_deassert(mdio_reset); msleep(200); } From patchwork Thu Aug 29 21:48:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13783948 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (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 110A81BC095; Thu, 29 Aug 2024 21:48:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724968129; cv=none; b=qBvJfJfsAO+3YUiktpNXCSKTbyoaB1NlHWcXeV+6qnVtCkIfoqS/OXWXiGddas/UckiyL9bi3brv9OIfL3vrkm3V9LW/RqO9V4dnJCMlZArmXn8jkL7R8lyppVOCsL/HRIG1xuncguz8u2vaBU37Rqpxqq9sithODLqGcZjBsVo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724968129; c=relaxed/simple; bh=COEFNtJE/tDMpWivQxG4U9BTAApJM5OcBlsBuAQtpmA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CalNx4B40apilrwauMncetiEfDobovwEIQ4lL6g2t/ZCyAp5j0P9jGrC22ZqFhDUI8a0pyb0RJ2119yzKyv2zHUZHQwGlOQ4TG38b+8pZee9BShpvhgcF62bEyvaZYTXjjbtdCyP9CyDetEuixQMCQKlCrcLZftuHU86XbtukS0= 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=UtMknyxj; arc=none smtp.client-ip=209.85.210.43 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UtMknyxj" Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-70f63afb792so419289a34.1; Thu, 29 Aug 2024 14:48:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724968127; x=1725572927; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e8PzWOAEwy1jK6JNv1X2qJ9ewUQcE19rtAp/aQITesc=; b=UtMknyxjuW29E1mXyLHepIuCgowPiOnLDNhErl5dxtqA00mE3xa4tsNMovVLCJNlYd +M1+/+9TZW6gzyxccMvmA6Kbm8td1v7EUYL4kJMJ9/Fog5hyqQxcBgTtsPijFkukK4kl JuPm5gHySzlSWHRjQSizq5HtBtWxc2l1ZePd3zVAvpcKmELIB2VNFxnQW+O0CGfy6pLz eFvcVDTMEMdTnYf52XNHJx6VR5VkoTtTYiPRfYG/TGL4lPGuchiQWsSyb8RnEA50WcT0 YWiLEv6s6VLwDpeVujy+9BvaOBa9Bx0eEAyhiM8QtLv0ktzWSbOP2Rm6RL+6FAMntTyL HmaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724968127; x=1725572927; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e8PzWOAEwy1jK6JNv1X2qJ9ewUQcE19rtAp/aQITesc=; b=OnTZTuAZ/ZRsp4vaIZ/+wqM3XCXl4zKD49M1YE+xFImSB/PgWJkSjP7M3WKoOSR1VO XJgGU+8ptUtsmpCcDJYRPDGxB/1u3KRTzx//4HBolc6bEdUThiffjmRw6+fg107uPLqr +iUdvgR8+3glOUZ0edbwjgLUaFeHhwXKYAfM93rWcnb6bR3oxwBZpDN5Aslyu2F3BPzq W/a4lYGQXNSl+Ia2qD7BFN/4Q3wITuWWQGVT98vbpL9SOPggJnaqp5R03w9GKaBp4mCe EBGY4J4vco9D1fewhAj9kko5StVs1JukXShreyyCiHS46x5+JwzdEwQ6QemcKZ1iBIpl 4+3g== X-Forwarded-Encrypted: i=1; AJvYcCWfyi6eg9+ss+MaNB2UmsqCxa7VXiAxn6E4OBv9koSHLPjzYEMpHzM+tC0wfbcyylkMD+8oGa0058SUYoU=@vger.kernel.org X-Gm-Message-State: AOJu0YyfrMuD1DV0RoIQW5c2+d7PCrLB1z2fWSXWqKQ1Sgw1nG8J/AMD YEUs3Xc06NgoPkNFZ6ZjqBRfAvFbkyxVFE4YpHiuHcRSwkM9xtNCtPG0Ix20 X-Google-Smtp-Source: AGHT+IGV3ew2KHhGaK/ToTWhsph3sZnIVdRe7GDGkGdgUF+z3xmS3+Mp4IaH2euf3r+iDOxs1EfcpA== X-Received: by 2002:a05:6358:6f01:b0:1b5:fb5e:f2d9 with SMTP id e5c5f4694b2df-1b7e37f1299mr17005255d.16.1724968126975; Thu, 29 Aug 2024 14:48:46 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7d22e77a7besm1708029a12.37.2024.08.29.14.48.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 14:48:46 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, o.rempel@pengutronix.de, p.zabel@pengutronix.de Subject: [PATCH net-next 5/6] net: ag71xx: remove always true branch Date: Thu, 29 Aug 2024 14:48:24 -0700 Message-ID: <20240829214838.2235031-6-rosenp@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829214838.2235031-1-rosenp@gmail.com> References: <20240829214838.2235031-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The opposite of this condition is checked above and if true, function returns. Which means this can never be false. Signed-off-by: Rosen Penev Reviewed-by: Oleksij Rempel --- drivers/net/ethernet/atheros/ag71xx.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c index d7d1735acab7..25e9de9aedbc 100644 --- a/drivers/net/ethernet/atheros/ag71xx.c +++ b/drivers/net/ethernet/atheros/ag71xx.c @@ -719,12 +719,10 @@ static int ag71xx_mdio_probe(struct ag71xx *ag) mii_bus->parent = dev; snprintf(mii_bus->id, MII_BUS_ID_SIZE, "%s.%d", np->name, ag->mac_idx); - if (!IS_ERR(mdio_reset)) { - reset_control_assert(mdio_reset); - msleep(100); - reset_control_deassert(mdio_reset); - msleep(200); - } + reset_control_assert(mdio_reset); + msleep(100); + reset_control_deassert(mdio_reset); + msleep(200); mnp = of_get_child_by_name(np, "mdio"); err = devm_of_mdiobus_register(dev, mii_bus, mnp); From patchwork Thu Aug 29 21:48:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13783949 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (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 BF6D41BCA1C; Thu, 29 Aug 2024 21:48:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724968131; cv=none; b=Z4tD8m9xkOR4411mgYAc2KPHHQBEP2DDnhHOxAdkWPT4+4Mi/5X+u40/acgw5EPtZp1rXpMS5SI7+hfoWzwIMRtzOLT7bBqDB1NCzmuQqNyBvyptuOrMOw355BtJPJTiRIgYCMu19c0Ffx2bk69v5/yM5IJ9sm7qVx5KbLG6nDM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724968131; c=relaxed/simple; bh=ucTcsAY+kqN9GzD+02gq+D/PB42c0LiyiuaTnWEmv5w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ErBAxJt1aj0r6+e0U32lKtypf3cRf2iV1Vvl4c0vV6vVhcFimr5flYjA1BteAAfJdM2FCavEe1NYMK9Hi7BxHlvy4pkpZkPqc10x7wa+tRcVuRhNIAbQ4yJhHLy2vsOdKQn/uylp6YgK2mIqW1mFHFGiADGbUC44GIbm1qxxE18= 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=k1qLp3sX; arc=none smtp.client-ip=209.85.161.53 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k1qLp3sX" Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-5dca997d29eso713646eaf.0; Thu, 29 Aug 2024 14:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724968128; x=1725572928; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7gxwfyCvWJYGaspIUiHH0ZRh6kN2LUZgRd1LYhB+9q8=; b=k1qLp3sXjnEcillV6S5QHAZjr0VcBfzS9QvJHltiyKDORKg+AAGG2M7c/Xo41Mmdcr VChSBT7VJBi8i8qbJtAVGF597yAZYIg35diEZXuDOEMFC3gdYsrOJCg6zk7iISaq64/L 3xJY7KUUJQlOhMtm3gUqXDS2Kj8bQKuxEwSgajwiCmqojI+svd9z96/EYYoH3cnVFkfi acNPflbZuvyH0nqKbf0qpmSSVyylvTLa1Dm8ff6LvXXvXKJdI238qRKByu6wuTDEMNmx Vh15bJWKMl26+Y84Key1yisO6m2OX4o77CqZC6SAxp49wuXbfQyt0I/4N8MGAqFd3FBZ HLVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724968128; x=1725572928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7gxwfyCvWJYGaspIUiHH0ZRh6kN2LUZgRd1LYhB+9q8=; b=WHq6nkCfJWzvM9r66OLoh2H6EYZaShSiD+P0ZtE6B3f7mwkWzseqIhaRjGBcIOk1NL WdGT7Orw2qLiHEUrkuquV73qm3KCPxuD6ZJf25haM42OWbPgMkr+h8wIz1x75FHh9QOG krBfT1JXYBMGsDTdXTbOFcvo8J4eExpk0pogWlDWYk/NKBVWuhc+mt59VZgXpCPAYaRV 8Pf5idxzZZkw03SM/vRxc2LNYAWOsj4G18J04Enli2AH+o0IgKmsRWBkwSYz4navS1w7 vb0SXyeRCr4t+gC+fR7gDC2d4/xmddxRNjkS42V9wVPZ7FSNlNHh1mI2ne1/k1Demwjz 50wQ== X-Forwarded-Encrypted: i=1; AJvYcCUTjSSg/eS68lfGdIcmvODD4+m1D5xkLmD+gJWmCmvp4EoletZncovRD/G4/3KiGJE83QcFvybXZCi1u2g=@vger.kernel.org X-Gm-Message-State: AOJu0YzblLnw32B63BfPc2HznNyM7YPAsR/hWoVAlEvffrJM+GDMnBAc C2w5OKe2jCaEVzS+gYLWhAMdpqlKKhDFsLO69XrCAa2F1aFYvlRg4+eyAD8v X-Google-Smtp-Source: AGHT+IHLKgMKoACCj+QUc4FceJpLB40WftvMxz3Koeq+UmBJcRt3Os0ofDailBmKn6qcWzklQ9cfpQ== X-Received: by 2002:a05:6359:4c9f:b0:1b5:c561:a29e with SMTP id e5c5f4694b2df-1b603c01f2dmr522723855d.1.1724968128533; Thu, 29 Aug 2024 14:48:48 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7d22e77a7besm1708029a12.37.2024.08.29.14.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 14:48:47 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, o.rempel@pengutronix.de, p.zabel@pengutronix.de Subject: [PATCH net-next 6/6] net: ag71xx: disable napi interrupts during probe Date: Thu, 29 Aug 2024 14:48:25 -0700 Message-ID: <20240829214838.2235031-7-rosenp@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240829214838.2235031-1-rosenp@gmail.com> References: <20240829214838.2235031-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Sven Eckelmann ag71xx_probe is registering ag71xx_interrupt as handler for gmac0/gmac1 interrupts. The handler is trying to use napi_schedule to handle the processing of packets. But the netif_napi_add for this device is called a lot later in ag71xx_probe. It can therefore happen that a still running gmac0/gmac1 is triggering the interrupt handler with a bit from AG71XX_INT_POLL set in AG71XX_REG_INT_STATUS. The handler will then call napi_schedule and the napi code will crash the system because the ag->napi is not yet initialized. The gmcc0/gmac1 must be brought in a state in which it doesn't signal a AG71XX_INT_POLL related status bits as interrupt before registering the interrupt handler. ag71xx_hw_start will take care of re-initializing the AG71XX_REG_INT_ENABLE. This will become relevant when dual GMAC devices get added here. Signed-off-by: Sven Eckelmann Signed-off-by: Rosen Penev --- drivers/net/ethernet/atheros/ag71xx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c index 25e9de9aedbc..ed47914a0e0c 100644 --- a/drivers/net/ethernet/atheros/ag71xx.c +++ b/drivers/net/ethernet/atheros/ag71xx.c @@ -1850,6 +1850,12 @@ static int ag71xx_probe(struct platform_device *pdev) if (!ag->mac_base) return -ENOMEM; + /* ensure that HW is in manual polling mode before interrupts are + * activated. Otherwise ag71xx_interrupt might call napi_schedule + * before it is initialized by netif_napi_add. + */ + ag71xx_int_disable(ag, AG71XX_INT_POLL); + ndev->irq = platform_get_irq(pdev, 0); err = devm_request_irq(&pdev->dev, ndev->irq, ag71xx_interrupt, 0x0, dev_name(&pdev->dev), ndev);