Skip to content

Commit a6ff0d8

Browse files
committed
Merge tag 'riscv-for-linus-6.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Paul Walmsley: - Correct the MIPS RISC-V/JEDEC vendor ID - Fix the system shutdown behavior in the legacy case where CONFIG_RISCV_SBI_V01 is set, but the firmware implementation doesn't support the older v0.1 system shutdown method - Align some tools/ macro definitions with the corresponding kernel headers * tag 'riscv-for-linus-6.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: tools: riscv: Fixed misalignment of CSR related definitions riscv: sbi: Prefer SRST shutdown over legacy riscv: Update MIPS vendor id to 0x127
2 parents 5703357 + e2cb692 commit a6ff0d8

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

arch/riscv/include/asm/vendorid_list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#define ANDES_VENDOR_ID 0x31e
99
#define MICROCHIP_VENDOR_ID 0x029
10+
#define MIPS_VENDOR_ID 0x127
1011
#define SIFIVE_VENDOR_ID 0x489
1112
#define THEAD_VENDOR_ID 0x5b7
12-
#define MIPS_VENDOR_ID 0x722
1313

1414
#endif

arch/riscv/kernel/sbi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,9 @@ int sbi_debug_console_read(char *bytes, unsigned int num_bytes)
648648

649649
void __init sbi_init(void)
650650
{
651+
bool srst_power_off = false;
651652
int ret;
652653

653-
sbi_set_power_off();
654654
ret = sbi_get_spec_version();
655655
if (ret > 0)
656656
sbi_spec_version = ret;
@@ -683,6 +683,7 @@ void __init sbi_init(void)
683683
sbi_probe_extension(SBI_EXT_SRST)) {
684684
pr_info("SBI SRST extension detected\n");
685685
register_platform_power_off(sbi_srst_power_off);
686+
srst_power_off = true;
686687
sbi_srst_reboot_nb.notifier_call = sbi_srst_reboot;
687688
sbi_srst_reboot_nb.priority = 192;
688689
register_restart_handler(&sbi_srst_reboot_nb);
@@ -702,4 +703,7 @@ void __init sbi_init(void)
702703
__sbi_send_ipi = __sbi_send_ipi_v01;
703704
__sbi_rfence = __sbi_rfence_v01;
704705
}
706+
707+
if (!srst_power_off)
708+
sbi_set_power_off();
705709
}

drivers/perf/riscv_pmu_sbi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ static irqreturn_t pmu_sbi_ovf_handler(int irq, void *dev)
11091109
/* compute hardware counter index */
11101110
hidx = info->csr - CSR_CYCLE;
11111111

1112-
/* check if the corresponding bit is set in sscountovf or overflow mask in shmem */
1112+
/* check if the corresponding bit is set in scountovf or overflow mask in shmem */
11131113
if (!(overflow & BIT(hidx)))
11141114
continue;
11151115

tools/arch/riscv/include/asm/csr.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@
167167
#define VSIP_TO_HVIP_SHIFT (IRQ_VS_SOFT - IRQ_S_SOFT)
168168
#define VSIP_VALID_MASK ((_AC(1, UL) << IRQ_S_SOFT) | \
169169
(_AC(1, UL) << IRQ_S_TIMER) | \
170-
(_AC(1, UL) << IRQ_S_EXT))
170+
(_AC(1, UL) << IRQ_S_EXT) | \
171+
(_AC(1, UL) << IRQ_PMU_OVF))
171172

172173
/* AIA CSR bits */
173174
#define TOPI_IID_SHIFT 16
@@ -280,7 +281,7 @@
280281
#define CSR_HPMCOUNTER30H 0xc9e
281282
#define CSR_HPMCOUNTER31H 0xc9f
282283

283-
#define CSR_SSCOUNTOVF 0xda0
284+
#define CSR_SCOUNTOVF 0xda0
284285

285286
#define CSR_SSTATUS 0x100
286287
#define CSR_SIE 0x104

0 commit comments

Comments
 (0)