All of lore.kernel.org
 help / color / mirror / Atom feed
From: Deepak Gupta <debug@rivosinc.com>
To: opensbi@lists.infradead.org
Subject: [RFC PATCH v2 2/4] lib: sbi: add support for Supervisor Software Events extension
Date: Tue, 9 Jan 2024 12:16:50 -0800	[thread overview]
Message-ID: <ZZ2pss83FEOU4oR1@debug.ba.rivosinc.com> (raw)
In-Reply-To: <20240109104500.2080121-3-cleger@rivosinc.com>

On Tue, Jan 09, 2024 at 11:44:54AM +0100, Cl?ment L?ger wrote:
>+static int sse_global_init()
>+{
>+	struct sbi_sse_event *e;
>+	unsigned int i, ev = 0;
>+
>+	for (i = 0; i < EVENT_COUNT; i++) {
>+		if (EVENT_IS_GLOBAL(supported_events[i]))
>+			global_event_count++;
>+		else
>+			local_event_count++;
>+	}

nit: through out patch series `global` is used for global events.
Here local event count and global event count both are setup.
Although only global events are initialized.
Perhaps its better to take out event counting from here and put in
sbi_sse_init or function/macro of it's own.


>+
>+	global_events = sbi_zalloc(sizeof(*global_events) * global_event_count);
>+	if (!global_events)
>+		return SBI_ENOMEM;
>+
>+	for (i = 0; i < EVENT_COUNT; i++) {
>+		if (!EVENT_IS_GLOBAL(supported_events[i]))
>+			continue;
>+
>+		e = &global_events[ev];
>+		sse_event_init(e, supported_events[i]);
>+		SPIN_LOCK_INIT(e->lock);
>+
>+		ev++;
>+	}
>+
>+	return 0;
>+}
>+


>-- 
>2.43.0
>


  reply	other threads:[~2024-01-09 20:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 10:44 [RFC PATCH v2 0/4] Add support for Supervisor Software Events extension Clément Léger
2024-01-09 10:44 ` [RFC PATCH v2 1/4] lib: sbi: provides regs to sbi_ipi_process() Clément Léger
2024-01-11 11:08   ` Anup Patel
2024-01-09 10:44 ` [RFC PATCH v2 2/4] lib: sbi: add support for Supervisor Software Events extension Clément Léger
2024-01-09 20:16   ` Deepak Gupta [this message]
2024-01-11 10:52     ` Clément Léger
2024-01-11 11:09   ` Anup Patel
2024-01-13  0:38   ` Deepak Gupta
2024-01-13  3:59   ` Himanshu Chauhan
2024-01-13  5:52     ` Himanshu Chauhan
2024-01-17 13:29     ` Clément Léger
2024-01-17 13:39       ` Himanshu Chauhan
2024-01-09 10:44 ` [RFC PATCH v2 3/4] lib: sbi: trigger SSE PMU event on PMU overflow IRQ Clément Léger
2024-01-09 10:44 ` [RFC PATCH v2 4/4] lib: sbi: add SBI_EXT_PMU_IRQ_CLEAR Clément Léger
2024-01-11 11:12   ` Anup Patel
2024-01-12  8:09     ` Clément Léger

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=ZZ2pss83FEOU4oR1@debug.ba.rivosinc.com \
    --to=debug@rivosinc.com \
    --cc=opensbi@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.