All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review
@ 2023-04-26 14:13 Andrew Jones
  2023-04-26 14:13 ` [PATCH 1/2] RISC-V: hwprobe: There can only be one first Andrew Jones
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Andrew Jones @ 2023-04-26 14:13 UTC (permalink / raw)
  To: linux-riscv; +Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Evan Green

I didn't get a chance to take a close look at "[PATCH v6 0/6] RISC-V
Hardware Probing User Interface" until now. I spotted a couple issues
while looking and this series collects the fixes.

Andrew Jones (2):
  RISC-V: hwprobe: There can only be one first
  RISC-V: hwprobe: Explicity check for -1 in vdso init

 arch/riscv/kernel/sys_riscv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
2.39.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] RISC-V: hwprobe: There can only be one first
  2023-04-26 14:13 [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review Andrew Jones
@ 2023-04-26 14:13 ` Andrew Jones
  2023-04-26 14:13 ` [PATCH 2/2] RISC-V: hwprobe: Explicity check for -1 in vdso init Andrew Jones
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Andrew Jones @ 2023-04-26 14:13 UTC (permalink / raw)
  To: linux-riscv; +Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Evan Green

Only capture the first cpu_id in order for the comparison
below to be of any use.

Fixes: ea3de9ce8aa2 ("RISC-V: Add a syscall for HW probing")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
---
 arch/riscv/kernel/sys_riscv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c
index 849b4170629d..c569dac7452e 100644
--- a/arch/riscv/kernel/sys_riscv.c
+++ b/arch/riscv/kernel/sys_riscv.c
@@ -103,8 +103,10 @@ static void hwprobe_arch_id(struct riscv_hwprobe *pair,
 			break;
 		}
 
-		if (first)
+		if (first) {
 			id = cpu_id;
+			first = false;
+		}
 
 		/*
 		 * If there's a mismatch for the given set, return -1 in the
-- 
2.39.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] RISC-V: hwprobe: Explicity check for -1 in vdso init
  2023-04-26 14:13 [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review Andrew Jones
  2023-04-26 14:13 ` [PATCH 1/2] RISC-V: hwprobe: There can only be one first Andrew Jones
@ 2023-04-26 14:13 ` Andrew Jones
  2023-04-26 15:04 ` [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review Conor Dooley
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Andrew Jones @ 2023-04-26 14:13 UTC (permalink / raw)
  To: linux-riscv; +Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Evan Green

id_bitsmash is unsigned. We need to explicitly check for -1, rather
than use > 0.

Fixes: aa5af0aa90ba ("RISC-V: Add hwprobe vDSO function and data")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
---
 arch/riscv/kernel/sys_riscv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c
index c569dac7452e..5db29683ebee 100644
--- a/arch/riscv/kernel/sys_riscv.c
+++ b/arch/riscv/kernel/sys_riscv.c
@@ -282,7 +282,7 @@ static int __init init_hwprobe_vdso_data(void)
 	 * populated) or any value returns -1 (varies across CPUs), then the
 	 * vDSO should defer to the kernel for exotic cpu masks.
 	 */
-	avd->homogeneous_cpus = (id_bitsmash > 0);
+	avd->homogeneous_cpus = id_bitsmash != 0 && id_bitsmash != -1;
 	return 0;
 }
 
-- 
2.39.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review
  2023-04-26 14:13 [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review Andrew Jones
  2023-04-26 14:13 ` [PATCH 1/2] RISC-V: hwprobe: There can only be one first Andrew Jones
  2023-04-26 14:13 ` [PATCH 2/2] RISC-V: hwprobe: Explicity check for -1 in vdso init Andrew Jones
@ 2023-04-26 15:04 ` Conor Dooley
  2023-04-26 15:43 ` Evan Green
  2023-04-26 16:45 ` Palmer Dabbelt
  4 siblings, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2023-04-26 15:04 UTC (permalink / raw)
  To: Andrew Jones
  Cc: linux-riscv, Paul Walmsley, Palmer Dabbelt, Albert Ou, Evan Green


[-- Attachment #1.1: Type: text/plain, Size: 346 bytes --]

On Wed, Apr 26, 2023 at 04:13:31PM +0200, Andrew Jones wrote:
> I didn't get a chance to take a close look at "[PATCH v6 0/6] RISC-V
> Hardware Probing User Interface" until now. I spotted a couple issues
> while looking and this series collects the fixes.

Both seem fair..
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review
  2023-04-26 14:13 [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review Andrew Jones
                   ` (2 preceding siblings ...)
  2023-04-26 15:04 ` [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review Conor Dooley
@ 2023-04-26 15:43 ` Evan Green
  2023-04-26 16:45 ` Palmer Dabbelt
  4 siblings, 0 replies; 6+ messages in thread
From: Evan Green @ 2023-04-26 15:43 UTC (permalink / raw)
  To: Andrew Jones; +Cc: linux-riscv, Paul Walmsley, Palmer Dabbelt, Albert Ou

On Wed, Apr 26, 2023 at 7:13 AM Andrew Jones <ajones@ventanamicro.com> wrote:
>
> I didn't get a chance to take a close look at "[PATCH v6 0/6] RISC-V
> Hardware Probing User Interface" until now. I spotted a couple issues
> while looking and this series collects the fixes.
>
> Andrew Jones (2):
>   RISC-V: hwprobe: There can only be one first
>   RISC-V: hwprobe: Explicity check for -1 in vdso init
>
>  arch/riscv/kernel/sys_riscv.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> --
> 2.39.2

Sigh, wish I had spotted these. Thanks!

Reviewed-by: Evan Green <evan@rivosinc.com>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review
  2023-04-26 14:13 [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review Andrew Jones
                   ` (3 preceding siblings ...)
  2023-04-26 15:43 ` Evan Green
@ 2023-04-26 16:45 ` Palmer Dabbelt
  4 siblings, 0 replies; 6+ messages in thread
From: Palmer Dabbelt @ 2023-04-26 16:45 UTC (permalink / raw)
  To: linux-riscv, Andrew Jones
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Evan Green


On Wed, 26 Apr 2023 16:13:31 +0200, Andrew Jones wrote:
> I didn't get a chance to take a close look at "[PATCH v6 0/6] RISC-V
> Hardware Probing User Interface" until now. I spotted a couple issues
> while looking and this series collects the fixes.
> 
> Andrew Jones (2):
>   RISC-V: hwprobe: There can only be one first
>   RISC-V: hwprobe: Explicity check for -1 in vdso init
> 
> [...]

Applied, thanks!

[1/2] RISC-V: hwprobe: There can only be one first
      https://git.kernel.org/palmer/c/08dc10759468
[2/2] RISC-V: hwprobe: Explicity check for -1 in vdso init
      https://git.kernel.org/palmer/c/b09313dd2e72

Best regards,
-- 
Palmer Dabbelt <palmer@rivosinc.com>


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-04-26 16:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-26 14:13 [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review Andrew Jones
2023-04-26 14:13 ` [PATCH 1/2] RISC-V: hwprobe: There can only be one first Andrew Jones
2023-04-26 14:13 ` [PATCH 2/2] RISC-V: hwprobe: Explicity check for -1 in vdso init Andrew Jones
2023-04-26 15:04 ` [PATCH 0/2] RISC-V: hwprobe: Couple fixes found on late review Conor Dooley
2023-04-26 15:43 ` Evan Green
2023-04-26 16:45 ` Palmer Dabbelt

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.