From patchwork Thu Nov 14 11:14:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Lai X-Patchwork-Id: 13874986 X-Patchwork-Delegate: kuba@kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 E4E851F9430; Thu, 14 Nov 2024 11:15:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731582931; cv=none; b=byqyJwYAktSOq4Pk/i/xnyiKN+imzJ2CRW5Dj/ddeJFlxVcwLgzU/rkezz7rtUHiPHfNo1Z9FSgeCuYKoRFhGFz4Uo9r5I/i4s8xZNX53kBkEmxEKufERx6q1Hhbz9+efFHkCGEfQz9YxyyBq2kzD5ozlHT1ndV86gA3abBbmLM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731582931; c=relaxed/simple; bh=59ogwsUR/nMWX9lDNlOM0W/OBKVEjU293ZcZdF6p6lw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UBYt6elpvRhiEBW9lUXjHyNKKclRswoIxtfpW4yIMFsRpqlPzJ+dmHQk07Wsvu9p4IDhoZO9gSFLRte1D4pP6c9obBHLpOCKVL3vrV6Usn8PdctxeBCB4OyeDTMu30dycD487WqVmglaPbxidIHgL1nQyHIRJ9ufzKWWb687jrk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=XwvhQ5HC; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="XwvhQ5HC" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4AEBF9fL42903552, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1731582909; bh=59ogwsUR/nMWX9lDNlOM0W/OBKVEjU293ZcZdF6p6lw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=XwvhQ5HCLlA1CW2C8W/Qvzf7rW4agSAuCd5OGnO7dTKSfrHvELbI4C851l6OCFxd/ 65cYmFa5HcyyRTxLh27EZwfsqzqT/Kk8y7I5LnM8E/zx4/D9hePAK8UnNr1409QJgB jXsjIRJJcSzymvTu73YntsXfSojrFFIlquB1D7OXv7Odj2+koMvvFHseoDd9d1XvZU P5Yd9UTP3kxAXjqVYb2zH7XqSBXgnFMwimi/LcY9YeTceoTtzhslbjLmfbkQpC4ZWJ oWnyxxrOwsuVwtAx2RhJ61Xqjy5DepfwO/V5iXF3oZc0jdLwnsY7icv2HE/1SNf2Wn w/68AAWNgfssQ== Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4AEBF9fL42903552 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Nov 2024 19:15:09 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 14 Nov 2024 19:15:09 +0800 Received: from RTDOMAIN (172.21.210.74) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 14 Nov 2024 19:15:09 +0800 From: Justin Lai To: CC: , , , , , , , , , Justin Lai Subject: [PATCH net 1/4] rtase: Refactor the rtase_check_mac_version_valid() function Date: Thu, 14 Nov 2024 19:14:40 +0800 Message-ID: <20241114111443.375649-2-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241114111443.375649-1-justinlai0215@realtek.com> References: <20241114111443.375649-1-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXH36506.realtek.com.tw (172.21.6.27) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-Patchwork-Delegate: kuba@kernel.org 1. Sets tp->hw_ver. 2. Changes the return type from bool to int. Signed-off-by: Justin Lai --- drivers/net/ethernet/realtek/rtase/rtase.h | 2 ++ .../net/ethernet/realtek/rtase/rtase_main.c | 21 +++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/realtek/rtase/rtase.h b/drivers/net/ethernet/realtek/rtase/rtase.h index 583c33930f88..547c71937b01 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase.h +++ b/drivers/net/ethernet/realtek/rtase/rtase.h @@ -327,6 +327,8 @@ struct rtase_private { u16 int_nums; u16 tx_int_mit; u16 rx_int_mit; + + u32 hw_ver; }; #define RTASE_LSO_64K 64000 diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index f8777b7663d3..33808afd588d 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -1972,20 +1972,21 @@ static void rtase_init_software_variable(struct pci_dev *pdev, tp->dev->max_mtu = RTASE_MAX_JUMBO_SIZE; } -static bool rtase_check_mac_version_valid(struct rtase_private *tp) +static int rtase_check_mac_version_valid(struct rtase_private *tp) { - u32 hw_ver = rtase_r32(tp, RTASE_TX_CONFIG_0) & RTASE_HW_VER_MASK; - bool known_ver = false; + int ret = -ENODEV; - switch (hw_ver) { + tp->hw_ver = rtase_r32(tp, RTASE_TX_CONFIG_0) & RTASE_HW_VER_MASK; + + switch (tp->hw_ver) { case 0x00800000: case 0x04000000: case 0x04800000: - known_ver = true; + ret = 0; break; } - return known_ver; + return ret; } static int rtase_init_board(struct pci_dev *pdev, struct net_device **dev_out, @@ -2105,9 +2106,11 @@ static int rtase_init_one(struct pci_dev *pdev, tp->pdev = pdev; /* identify chip attached to board */ - if (!rtase_check_mac_version_valid(tp)) - return dev_err_probe(&pdev->dev, -ENODEV, - "unknown chip version, contact rtase maintainers (see MAINTAINERS file)\n"); + ret = rtase_check_mac_version_valid(tp); + if (ret != 0) { + dev_err(&pdev->dev, + "unknown chip version, contact rtase maintainers (see MAINTAINERS file)\n"); + } rtase_init_software_variable(pdev, tp); rtase_init_hardware(tp); From patchwork Thu Nov 14 11:14:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Lai X-Patchwork-Id: 13874987 X-Patchwork-Delegate: kuba@kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 CAFA31F8F03; Thu, 14 Nov 2024 11:15:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731582941; cv=none; b=iHptqjJqk5VAO6gbyAobAG3X10H8OfAu38NBVUETOodtx2e2uVaPxOAIR+ePXcnD1FBZqijG83/RxWZNC8fNCSGfzkhcDt+fmrZu2NWEoOmgAj3/lA/+MdoeXBPPlOvPeF3X1juHFgWu2sh3sNeUUJo60wV2Gh7GA6qE0l97T/4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731582941; c=relaxed/simple; bh=fyku/vJ50FoqSKdBGedLID31SZxrS+6VAFPp/5YrgOo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SWN6jSLn8AgSfaPrLOeZnxFYmaW2RWFiKKT0zlI20LXMt6Tvud3EDDbccf8+/iitoMF/C5cMAmqfcGnVRpkpgCq0vzR5Ew62nvUFv3vx8uI0ep38KG6czFRohvY1adgYpgo9c1PAelZK7acxN0aXZ9frCFN9akt/QqfkmlDbYNU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=XQCBkYDO; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="XQCBkYDO" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4AEBFOBQ02903561, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1731582924; bh=fyku/vJ50FoqSKdBGedLID31SZxrS+6VAFPp/5YrgOo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=XQCBkYDOhDUFmGaGHBZpmPyGtST0Ki5p4Gltk9xd2NAhpHUlprvZE7RB0fK+iYcfa qVslflrKcbFyESisf12N65zWxFv+FZ/kDtNUgfikpHf0Y5AgK9MSW16GGaw+VCUkgp FBCWo65tOFV3nmW8hItJvDNZfMjTuTpAib+Fe7y8BWfV3eLQ7du62cBN0XTGfk7ROV s7rN8DW8yoq7npmOOxYpo/Yx4+AcHLUfGjLTbLP4SVqJeJmzR0c2zSkt0xLZUCNz4a V+B8bY+oYFfm5jnIV7CcNFbro2QmCsXdcKS/B/NAkC3Dkfjaehu9HUzG0yAIO4tHpm SKuSS+rXQirqw== Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4AEBFOBQ02903561 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Nov 2024 19:15:24 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 14 Nov 2024 19:15:24 +0800 Received: from RTDOMAIN (172.21.210.74) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 14 Nov 2024 19:15:24 +0800 From: Justin Lai To: CC: , , , , , , , , , Justin Lai Subject: [PATCH net 2/4] rtase: Correct the speed for RTL907XD-V1 Date: Thu, 14 Nov 2024 19:14:41 +0800 Message-ID: <20241114111443.375649-3-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241114111443.375649-1-justinlai0215@realtek.com> References: <20241114111443.375649-1-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXH36506.realtek.com.tw (172.21.6.27) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-Patchwork-Delegate: kuba@kernel.org Correct the speed for RTL907XD-V1. Signed-off-by: Justin Lai --- drivers/net/ethernet/realtek/rtase/rtase_main.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index 33808afd588d..10697e4055b6 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -1714,10 +1714,21 @@ static int rtase_get_settings(struct net_device *dev, struct ethtool_link_ksettings *cmd) { u32 supported = SUPPORTED_MII | SUPPORTED_Pause | SUPPORTED_Asym_Pause; + const struct rtase_private *tp = netdev_priv(dev); ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, supported); - cmd->base.speed = SPEED_5000; + + switch (tp->hw_ver) { + case 0x00800000: + case 0x04000000: + cmd->base.speed = SPEED_5000; + break; + case 0x04800000: + cmd->base.speed = SPEED_10000; + break; + } + cmd->base.duplex = DUPLEX_FULL; cmd->base.port = PORT_MII; cmd->base.autoneg = AUTONEG_DISABLE; From patchwork Thu Nov 14 11:14:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Lai X-Patchwork-Id: 13874988 X-Patchwork-Delegate: kuba@kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 723991F940C; Thu, 14 Nov 2024 11:16:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731582964; cv=none; b=VSdtaUFbB6iRdfLGqi/fK4CvNCUI20jDrafislp1VapIuk3hILY6Wiov9eucBpZlDGX5jRCPXVikC7Iez41YilTxUTermB28+uPAXfI+j4kiOrUWb32i0WDQx3BUbm2buKvvsblOciWodlloOZ/Vs1fMxpf+0DphS3x5xrDL2IA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731582964; c=relaxed/simple; bh=uaXCn79Xv9MvtqcMUh1KWP+EVzihdOmmu9ErD65pb44=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ECbOKkAjd+mmqRQvwtqr0q/E+5uuEneS6jmST6FD7hE3RpywT8idq1NoAL1JdZOO2skv+nNHvRcuWIGWE/z+NXSg1vkZGZTZX/IsvC8Y8kEzrBlfcxLAJZjg4r+8zycl/PE0oGGD9+kcFH1tzhNVTqGnG6fzznBOCeAIQSSZXqY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=fHgLxhNU; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="fHgLxhNU" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4AEBFluU62903597, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1731582947; bh=uaXCn79Xv9MvtqcMUh1KWP+EVzihdOmmu9ErD65pb44=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=fHgLxhNUqV6i3evqgulAcV8PRtsPKLEdIw48NNDPi+8XQ9fslpqVjqI7WlNaQ2Gzy lz/Ksu8S3926K8cwOAd3bRuBJg93L0j4l6AblbLNukFzEMjpfZdRThMd1F2Bme7tCB XWfdjpx6Gmw2GUC8/Tj20xeVrDaRg07BTCuC3TrFT/o6Ng6LaJFej5roQqCZ0BRXXA 8OkBG5tljr9O2rIvB1jM53h0gCdm54QwPsJOIv89qrB4uBqfa33K+AQij7wK8+ZS0X DdWHwx0D3ZXxGxX6qfUqFa0LrqMLh3p2Dg07i5xZ2Hox8BAOu1jB7NWJaMmF+b3ila RHbsn56UIs/bg== Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4AEBFluU62903597 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Nov 2024 19:15:47 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 14 Nov 2024 19:15:47 +0800 Received: from RTDOMAIN (172.21.210.74) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 14 Nov 2024 19:15:46 +0800 From: Justin Lai To: CC: , , , , , , , , , Justin Lai Subject: [PATCH net 3/4] rtase: Add support for RTL907XD-VA PCIe port Date: Thu, 14 Nov 2024 19:14:42 +0800 Message-ID: <20241114111443.375649-4-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241114111443.375649-1-justinlai0215@realtek.com> References: <20241114111443.375649-1-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXH36505.realtek.com.tw (172.21.6.25) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-Patchwork-Delegate: kuba@kernel.org 1. Add RTL907XD-VA hardware version id. 2. Add the reported speed for RTL907XD-VA. Signed-off-by: Justin Lai --- drivers/net/ethernet/realtek/rtase/rtase_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index 10697e4055b6..958b1543c4af 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -1725,6 +1725,7 @@ static int rtase_get_settings(struct net_device *dev, cmd->base.speed = SPEED_5000; break; case 0x04800000: + case 0x08000000: cmd->base.speed = SPEED_10000; break; } @@ -1993,6 +1994,7 @@ static int rtase_check_mac_version_valid(struct rtase_private *tp) case 0x00800000: case 0x04000000: case 0x04800000: + case 0x08000000: ret = 0; break; } From patchwork Thu Nov 14 11:14:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Lai X-Patchwork-Id: 13874989 X-Patchwork-Delegate: kuba@kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 4358B1F8EE1; Thu, 14 Nov 2024 11:16:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731582977; cv=none; b=mhM4Ay4i74SZWig72bZfu/Y/GSWvwEb/bMmHZ0LURXJhIFZiJx24K5ZXpDIVOx/nOLLD8/GaauAWVouI4EtNUCKmkWpy0O5NmrDcURt16F9DyW1FM5anJYFlQRSjmDeb5DYSfuQeTkpo/cdmccmBLKdN8UK+HPiZ7s7UmkmVKGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731582977; c=relaxed/simple; bh=oO+lZI88A+uACM5J4ckiMLLfEfG09VCXVFJIdYlvEGY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MwQJDso1Dfb12bsFLJeAA9MmQKBwvopuvTvCoEarKK2r6lpYsiyeIKo9Nc1JyXBTdtvnIoXXn1o14fOBlPF/IIkHbYAyONyJkh1+nVSTlVtW3HkqVmlfoZvdnprP4m/z4hHOPfyC83dK7lSRBtdNQ5wzE0lOHc+9db6jKO2eZRc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b=t01cljVs; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=realtek.com header.i=@realtek.com header.b="t01cljVs" X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4AEBG05G02903788, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1731582960; bh=oO+lZI88A+uACM5J4ckiMLLfEfG09VCXVFJIdYlvEGY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=t01cljVsqayQbayCQ7Ltvp4oJ9Q6bDR/vBg+b0Bb79aE/KmRhGn/O7xzD59Dqbb71 OibMPNDLw9gDGez/xPKAMlNv194PCr/0w/OmuvSDi54eb6NFRHRWyN4D7VZo3a1ZcR VLEiQm4weWwq1J4eA6veL1hipmZGVjTg+dbRjreu0W5mWkWuU+2pmPQpoY1z08jj6G V1PQEad3poO+R4PDkHSR5Pbu+0/4zli7wvrugE1rJb1aTZCFUT9U9dteC8X5wToTcW Y8oIqIP4eSfJS6DbNtQ9fH8RvL45Rd4jAzs1B0SdvsPZ90BL94dmue6i7zYZGJl8h/ Oqby4X45drTEA== Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4AEBG05G02903788 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Nov 2024 19:16:00 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 14 Nov 2024 19:16:00 +0800 Received: from RTDOMAIN (172.21.210.74) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 14 Nov 2024 19:16:00 +0800 From: Justin Lai To: CC: , , , , , , , , , Justin Lai Subject: [PATCH net 4/4] rtase: Corrects error handling of the rtase_check_mac_version_valid() Date: Thu, 14 Nov 2024 19:14:43 +0800 Message-ID: <20241114111443.375649-5-justinlai0215@realtek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241114111443.375649-1-justinlai0215@realtek.com> References: <20241114111443.375649-1-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXH36506.realtek.com.tw (172.21.6.27) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-Patchwork-Delegate: kuba@kernel.org Corrects error handling of the rtase_check_mac_version_valid(). Signed-off-by: Justin Lai --- drivers/net/ethernet/realtek/rtase/rtase_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index 958b1543c4af..f503de91c713 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -2123,6 +2123,7 @@ static int rtase_init_one(struct pci_dev *pdev, if (ret != 0) { dev_err(&pdev->dev, "unknown chip version, contact rtase maintainers (see MAINTAINERS file)\n"); + goto err_out_release_board; } rtase_init_software_variable(pdev, tp); @@ -2197,6 +2198,7 @@ static int rtase_init_one(struct pci_dev *pdev, netif_napi_del(&ivec->napi); } +err_out_release_board: rtase_release_board(pdev, dev, ioaddr); return ret;