mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Orgad Shaneh <orgads@gmail.com>
To: tsbogend@alpha.franken.de
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	Orgad Shaneh <orgads@gmail.com>
Subject: [PATCH v2 1/2] MIPS: OCTEON: size PKO_REG_QUEUE_MODE from the fixed queue map
Date: Wed,  2 Dec 2026 13:15:14 +0000	[thread overview]
Message-ID: <20261202131515.3630964-2-orgads@gmail.com> (raw)
In-Reply-To: <20261202131515.3630964-1-orgads@gmail.com>

cvmx_pko_initialize_global() sets PKO_REG_QUEUE_MODE from the number of
queues in use, taken from the last port of the last interface. It runs
before the interfaces are probed, so every port count is still 0 and
the queues of the last interface are not counted.

The queue numbers come from a fixed map, so take the count from the
last PKO port instead.

CN38XX now counts its PCI ports too, and gets the 64-queue mode instead
of the 32-queue one. CN58XX, CN56XX and CN52XX keep their mode.

Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
v2:
- New patch, split out of v1 1/2. v1 kept the old count, from the last
  port of the last interface, which is read before the interfaces are
  probed.

CN38XX is by inspection only.

 arch/mips/cavium-octeon/executive/cvmx-pko.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/mips/cavium-octeon/executive/cvmx-pko.c b/arch/mips/cavium-octeon/executive/cvmx-pko.c
index b0199d5cb551..b1b0a8a985d9 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-pko.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-pko.c
@@ -209,9 +209,13 @@ void cvmx_pko_initialize_global(void)
 	if (OCTEON_IS_MODEL(OCTEON_CN38XX) || OCTEON_IS_MODEL(OCTEON_CN58XX)
 	    || OCTEON_IS_MODEL(OCTEON_CN56XX)
 	    || OCTEON_IS_MODEL(OCTEON_CN52XX)) {
-		int num_interfaces = cvmx_helper_get_number_of_interfaces();
-		int last_port =
-		    cvmx_helper_get_last_ipd_port(num_interfaces - 1);
+		/*
+		 * This runs before the interfaces are probed, so their
+		 * port counts are still zero here. The queue numbers come
+		 * from a fixed map, so size the mode from the last PKO
+		 * port: no queue in use lies beyond that port's queues.
+		 */
+		int last_port = CVMX_PKO_NUM_OUTPUT_PORTS - 1;
 		int max_queues =
 		    cvmx_pko_get_base_queue(last_port) +
 		    cvmx_pko_get_num_queues(last_port);
-- 
2.53.0


  reply	other threads:[~2026-12-02 13:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 13:15 [PATCH v2 0/2] MIPS: OCTEON: PKO_REG_QUEUE_MODE on CN63XX and CN66XX Orgad Shaneh
2026-12-02 13:15 ` Orgad Shaneh [this message]
2026-12-02 13:15 ` [PATCH v2 2/2] MIPS: OCTEON: set " Orgad Shaneh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261202131515.3630964-2-orgads@gmail.com \
    --to=orgads@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®