From patchwork Sun Sep 15 20:08:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Frieder Vogt X-Patchwork-Id: 13804908 X-Patchwork-Delegate: kuba@kernel.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (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 A9C691CA697 for ; Sun, 15 Sep 2024 20:08:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726430919; cv=none; b=JPcQhW9A2wzuM+N0eeeW0kcBD9GsXlkzhN3zyD1ldDnYxwoJWmieFZ9NwiKHTMRxhUj1KXNO5t0dpcwhExUY35/es1xD755Kg7NESWfHL8bXKfV35kovVDcsd5iJTxKZdDihMzNTVwKinR6AVRynDzq0mT0iSOug+hcUkeTgNtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726430919; c=relaxed/simple; bh=mpW/6tMDmZpnWnf50q8A2HwvDh1aqlU5Fcovbs/vPUo=; h=MIME-Version:Message-ID:From:To:Cc:Subject:Content-Type:Date; b=Qilz6M2DIHA5ftZOcv+W4+tLYDyS6p/Q+veFRPjsutvKy7lGuzl4ROQvW2aG018Q8yeVsZMoZhZVHnIl++aMByQ5kvR4phttYx9bBteQG4uE07OhEqx1wrPQ22VzXWF6UDSdnTtG/7i6VBRfr7CAjeaMNzN0NbMze8GlEdi3V90= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=hfdevel@gmx.net header.b=LdIQMgjv; arc=none smtp.client-ip=212.227.17.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=hfdevel@gmx.net header.b="LdIQMgjv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1726430902; x=1727035702; i=hfdevel@gmx.net; bh=orv1bF9UPAiJnriKS0oEUP4jaz511AJ6Ahe52qmNWec=; h=X-UI-Sender-Class:MIME-Version:Message-ID:From:To:Cc:Subject: Content-Type:Date:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=LdIQMgjv4N6OmZz8jiZxdKS7QD7SQjNsZs9/l8TbyNkGfDbnojW+G/RCBwuhpTew ggFMLnpvzi0RRHwfkkRNwVgtQMN7l8RfgjKUoY8WXmOpXgeL+5FwjrWgfJeHJ4RAV P/Q67x2u0wHpkrdoa8DpTchwGTT996Q7LIQOI7tcZ5sWuPPuCTd8HdOPAs3/TUyXF s2V6fQtXCsH9/TeDGNoMVgd+y8Y13kb+G3Oi7VKY2t7fjl/WtdQrckwTeYBxafSa+ sZ8nc9+MX5YrQh8LgRCTCCo8CYyCPTqhRYc7PHKH/eq2CQ6r/xjVZy4GhBsL10mYq CjVLqEALyo5fBfScXQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [77.33.175.99] ([77.33.175.99]) by web-mail.gmx.net (3c-app-gmx-bap07.server.lan [172.19.172.77]) (via HTTP); Sun, 15 Sep 2024 22:08:22 +0200 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: From: Hans-Frieder Vogt To: netdev@vger.kernel.org Cc: Andrew Lunn , Heiner Kallweit , Russell King , FUJITA Tomonori , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: [PATCH net-next v2 6/7] net: tn40xx: optimize mdio speed settings Date: Sun, 15 Sep 2024 22:08:22 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:JaK3B2tQhrsC4vAS3gzzLidboRt4EJ4JoMjQo+toDB1blfXj0whzSBeRigFZDzrdIB63P HAjbHhlqfAWGuoBFuJRzx+2v9oJI/5xv7nYnf4iCNQSdmIHuPZA3Vg1Q26mpZY1Bd4fy+jHxhHKJ RAqRREWPdCOUoNMJ7ejQOc7aPMUjaEc6bGnrsDMomv3FQFNTJOIHHljpuypZ45jZrkq6L77O4lpE fcD7bmfcn8wWvCe3w93bNZXJMoX2cM3C1q3MPVyvShy7+e4Wa+OcSjJKsFwCY0udxnnC7Qbo10BQ t0= X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:HwKrpz2aOt4=;Gcvs60UVUKNXSFUcKn0tFE8eOpT PdfFbuuyGDbuw9FYvl3kHK/Y1JLgzjq5QMebuxV84mRUDaIt25Vg8VtVb55ULyKhKYbAxup0z o/dsRuBvfj0Y1VluNDVMcuqya8aQ/+Kgihy/ZN4pANAnaBq40maKt/brQNULC3vkXO97lEaRJ ypTXzk5KHs+cVxtT8z8PG/bLm+BU805hnXgjfO/3rer4iCcjvwSqwYGCrOcZa4wubSBBbCcjt V6AGP6PctBzbyDBuQunmIhqp6c0iwMV729KAdb2/o0RCFqd3uksa8/AxmX0MO5O8bCoUBIfIi lEH7q6KE5wOvgrGw0lkPeoCsGYL5jOgL2mKF1TxwJdZun5GqIOaPXoRBfX1Li9nntk1ILwffs 6+fq1DX5TVLKsOztzPILy03hIliQ5kerD+5WO1V1OYYwoswEgDcARdJ8rwBn9s6OZpwQuTEws 1w6f/1hf7exdZbsZjo2e9EbbGdBjSSX+0JgXQ58KgnYdJR63TxxgDnw89JHs3sox/MZOEogNr AxN9G0UxktgHkUKc/FOakzHpWQRusW6ybCHstlPNy9iF02mKgtRAJSGZ/VvU3YG0pXby+XupK i36FF1QJiWljxOJ6luIdNzfyuvPWiTiXZPnE5sVwzdE30L76SUrdy636MxSIAhPKZAIcFePvZ cVJ608sID1F58+zo2m4I8xhEDGAyicS9eydg4k4rww== X-Patchwork-Delegate: kuba@kernel.org Optimize MDIO speed settings. The PHYs of all currently supported TN4010 cards support 6 MHz operation. Therefore select 6 MHz already before devm_mdiobus_register, which also saves another call to tn40_mdio_set_speed afterwards. As a nice side effect, the loading of the firmware for the AQR105 PHY is then reduced from 30 s to 5 s. Remove the write to TN40_REG_MDIO_CMD_STAT in tn40_priv_init, which is equivalent to tn40_mdio_set_speed to 1 Mhz and therefore would revert the 6 MHz speedup of the MDIO communication. Signed-off-by: Hans-Frieder Vogt --- drivers/net/ethernet/tehuti/tn40.c | 1 - drivers/net/ethernet/tehuti/tn40_mdio.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) -- 2.45.2 diff --git a/drivers/net/ethernet/tehuti/tn40.c b/drivers/net/ethernet/tehuti/tn40.c index 5f73eb1f7d9f..9ccf5cd89663 100644 --- a/drivers/net/ethernet/tehuti/tn40.c +++ b/drivers/net/ethernet/tehuti/tn40.c @@ -1642,7 +1642,6 @@ static int tn40_priv_init(struct tn40_priv *priv) /* Set GPIO[9:0] to output 0 */ tn40_write_reg(priv, 0x51E0, 0x30010006); /* GPIO_OE_ WR CMD */ tn40_write_reg(priv, 0x51F0, 0x0); /* GPIO_OE_ DATA */ - tn40_write_reg(priv, TN40_REG_MDIO_CMD_STAT, 0x3ec8); /* we use tx descriptors to load a firmware. */ ret = tn40_create_tx_ring(priv); diff --git a/drivers/net/ethernet/tehuti/tn40_mdio.c b/drivers/net/ethernet/tehuti/tn40_mdio.c index 80eb68384389..993458cc4932 100644 --- a/drivers/net/ethernet/tehuti/tn40_mdio.c +++ b/drivers/net/ethernet/tehuti/tn40_mdio.c @@ -185,14 +185,13 @@ int tn40_mdiobus_init(struct tn40_priv *priv) ret); } - tn40_mdio_set_speed(priv, TN40_MDIO_SPEED_1MHZ); + tn40_mdio_set_speed(priv, TN40_MDIO_SPEED_6MHZ); ret = devm_mdiobus_register(&pdev->dev, bus); if (ret) { dev_err(&pdev->dev, "failed to register mdiobus %d %u %u\n", ret, bus->state, MDIOBUS_UNREGISTERED); goto err_swnodes_unregister; } - tn40_mdio_set_speed(priv, TN40_MDIO_SPEED_6MHZ); priv->mdio = bus; return 0; From patchwork Sun Sep 15 20:12:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Frieder Vogt X-Patchwork-Id: 13804909 X-Patchwork-Delegate: kuba@kernel.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (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 C907D1CD31 for ; Sun, 15 Sep 2024 20:12:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726431145; cv=none; b=OpO5YzmKPPVk6r5PgpLtDGsleVmChMCbCZzGWZttS3r4LLJ3+RhCfASjvgXZLLOmEn39l6ytVmVfFgW/4JPkmiq3ZRcp7e3jE38XDgF0QAwYuIe2JaTQqIEU7YX89Ik3+LMvCqB/7AYhh1GxJR11ZxngaTgenFFZwqREmBrc2HE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726431145; c=relaxed/simple; bh=2L9l60ZJN5DDpI3I+X5pUpR6vyJ1OSF1B4yWImD2qIs=; h=MIME-Version:Message-ID:From:To:Cc:Subject:Content-Type:Date; b=pKbVPgUY0X9lOjYcgZOs9NpPtODGOMQrjXj01LH0RkKlvIDrQQOQoU/fS3rxpLI7e/Wro/wgltjENuxELl5yA6ILCx+bj7QqYLAIhR37LHXVeRZ4Q+n3rfAe+7/c/z6ufvKmMMtkvPGGAzzD2MaEM7NtH4zI1OD/q3khkJbn794= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=hfdevel@gmx.net header.b=q2fOYgcm; arc=none smtp.client-ip=212.227.17.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=hfdevel@gmx.net header.b="q2fOYgcm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1726431127; x=1727035927; i=hfdevel@gmx.net; bh=fP2Gwd74iMjsLVnqkUBp8cu+BsoySHENyn14k873Za4=; h=X-UI-Sender-Class:MIME-Version:Message-ID:From:To:Cc:Subject: Content-Type:Date:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=q2fOYgcmIIU5dbjkhv5htC1RQrlVS9fD0AZBzXRtUlG0qSlZnS9W1q/C4/dyNEiV pYuHEBlMnpOyXmimsAmuPFnH+WvXyXNqFraSSZAKEBV4L6Pwb5FKMsnGYVyi8vo6M mxcuRr/rfXU9h5iBvNZX70XK/hmiB8iM9vO58W08cnV96nwOQ3SbwjdGatXO5AwWD gfSWNhUag8U+AsNyhqes6PLD1wWrHeSTYdpqZN74zKMa0KlgYMmxkLvtwEjOR4+49 MBTQEgYTwiQ7tP9vA6i1Ds0F4v1uzkTfYmUp7J3oiD2a7TRxwFgsG+AnUtof+/OhO N+x9YuDYSncZGGmbKQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [77.33.175.99] ([77.33.175.99]) by web-mail.gmx.net (3c-app-gmx-bap07.server.lan [172.19.172.77]) (via HTTP); Sun, 15 Sep 2024 22:12:07 +0200 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: From: Hans-Frieder Vogt To: netdev@vger.kernel.org Cc: Andrew Lunn , Heiner Kallweit , Russell King , FUJITA Tomonori , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: [PATCH net-next v2 7/7] net: tn40xx: add pci-id of the aqr105-based tehuti tn4010 cards Date: Sun, 15 Sep 2024 22:12:07 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:lXDm5HiudnHHMrPOnSjLHMi8BjJZKAx1IILsjYzdSWc2I8ydgsv9fLUOfWiLIOC+3Hgga WkVZshG4DJ7xTtkDMC823DXqrIv1xUjpPLz802kiOlj55lCEwVhhZ7QUrnBhg8xja0tNJtPAY+5t 1j0cWE4fc7J9pAHR7e+67E3pycIa9b624I2VZWMeCA1GCh1qUMvEaxYxMmcC9zfCgMJIPm++gy8i uB40wHuIqwCYdVJooJW98DfQwBLHViCNvAW3r21zq1cbJ6faLL6bnvvz+9nsew21uguA9NJdxeyU oM= X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:potrQmyEHqA=;5Fh1T5i8tmoWPhwIUtAlF5fxSrg ksTXKZuEjbRu2Wyzchw/+LED2NdgczVaN+Yvd4hDjGAiHxnrjzxXj4n9TXqTSqkx4uTktePq+ qUQa+1VVaZm1fD3tzck94MWMoojE92Y8hcMKrndKVOzTZjpC5SCwq3hF3WFMEfHRGxhP8uDt0 InlD//w98q+dSd0sIW6o/0PKK6H9mq1FSHFeptqTVQSWoc6I6VSOFa6rJlxWqVHlH3TEz5hEv 1nbAPBUB8mQjeGBU1HNX/qqzUrKbr8IIAVFvEv4UBBqa/quMIw07mnfcJKmx+dtNioEB9PP4Y PDF4nQQ2TLswimcE/8DgMirKp+sz0ssUkUsCqH93p/ik3xUxU04gIDEcUq19FLgyqplQvVAc8 v6i/8lcdnk13WWDgz7okB4N2HnDG8CZ1b6vYXl+1HumWTJOYIG4K9ILE7fg9kpa9x7/fCrT9O ZmsdNcKe3KHGvDlqdF8K2b6Ozi4xFnpE2kfQMKaTWDJ7cz2OFrVAE93+j4tI4MYxNXhn2qxlS 4iSOFARixvuD5etgyz7WdzCiz641YqDmDd2O4t9QAqTUPtn4JWNdn/1g4KAc5mipxRHXVMz+7 GzPG+nAoRI0Vd6SFlrLERfAn7FrpkK1OCRnPRt3e5sSsGVGA6wshh3Zl3w+q0qG2qeOlyhF7S JFeNEtbNuGqSS7lYxIqE6fNIN7C/tnf9jiHLjLlOiA== X-Patchwork-Delegate: kuba@kernel.org Add the PCI-ID of the AQR105-based Tehuti TN4010 cards to allow loading of the tn40xx driver on these cards. Here, I chose the detailed definition with the subvendor ID similar to the QT2025 cards with the PCI-ID TEHUTI:0x4022, because there is a card with an AQ2104 hiding amongst the AQR105 cards, and they all come with the same PCI-ID (TEHUTI:0x4025). And the AQ2104 is not yet supported. Signed-off-by: Hans-Frieder Vogt --- drivers/net/ethernet/tehuti/tn40.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.45.2 diff --git a/drivers/net/ethernet/tehuti/tn40.c b/drivers/net/ethernet/tehuti/tn40.c index 9ccf5cd89663..59d979d82aad 100644 --- a/drivers/net/ethernet/tehuti/tn40.c +++ b/drivers/net/ethernet/tehuti/tn40.c @@ -1839,6 +1839,10 @@ static const struct pci_device_id tn40_id_table[] = { PCI_VENDOR_ID_ASUSTEK, 0x8709) }, { PCI_DEVICE_SUB(PCI_VENDOR_ID_TEHUTI, 0x4022, PCI_VENDOR_ID_EDIMAX, 0x8103) }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_TEHUTI, 0x4025, + PCI_VENDOR_ID_TEHUTI, 0x3015) }, + { PCI_DEVICE_SUB(PCI_VENDOR_ID_TEHUTI, 0x4025, + PCI_VENDOR_ID_EDIMAX, 0x8102) }, { } };