Skip to content

Commit af7a056

Browse files
committed
Merge tag 'mips-fixes_6.1_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
Pull MIPS fixes from Thomas Bogendoerfer: - fix jump label branch range check - check kmalloc failures in Loongson64 kexec - fix builds with clang-14 - fix char/int handling in pic32 * tag 'mips-fixes_6.1_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: pic32: treat port as signed integer MIPS: jump_label: Fix compat branch range check mips: alchemy: gpio: Include the right header MIPS: Loongson64: Add WARN_ON on kexec related kmalloc failed MIPS: fix duplicate definitions for exported symbols mips: boot/compressed: use __NO_FORTIFY
2 parents ab57bc6 + 6480609 commit af7a056

File tree

8 files changed

+26
-21
lines changed

8 files changed

+26
-21
lines changed

arch/mips/alchemy/common/gpiolib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <linux/init.h>
3232
#include <linux/kernel.h>
3333
#include <linux/types.h>
34-
#include <linux/gpio.h>
34+
#include <linux/gpio/driver.h>
3535
#include <asm/mach-au1x00/gpio-au1000.h>
3636
#include <asm/mach-au1x00/gpio-au1300.h>
3737

arch/mips/boot/compressed/decompress.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#define DISABLE_BRANCH_PROFILING
1111

12+
#define __NO_FORTIFY
1213
#include <linux/types.h>
1314
#include <linux/kernel.h>
1415
#include <linux/string.h>

arch/mips/include/asm/fw/fw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ extern char *fw_getcmdline(void);
2626
extern void fw_meminit(void);
2727
extern char *fw_getenv(char *name);
2828
extern unsigned long fw_getenvl(char *name);
29-
extern void fw_init_early_console(char port);
29+
extern void fw_init_early_console(void);
3030

3131
#endif /* __ASM_FW_H_ */

arch/mips/kernel/jump_label.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void arch_jump_label_transform(struct jump_entry *e,
5656
* The branch offset must fit in the instruction's 26
5757
* bit field.
5858
*/
59-
WARN_ON((offset >= BIT(25)) ||
59+
WARN_ON((offset >= (long)BIT(25)) ||
6060
(offset < -(long)BIT(25)));
6161

6262
insn.j_format.opcode = bc6_op;

arch/mips/kernel/relocate_kernel.S

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ LEAF(kexec_smp_wait)
145145
* kexec_args[0..3] are used to prepare register values.
146146
*/
147147

148-
kexec_args:
149-
EXPORT(kexec_args)
148+
EXPORT(kexec_args)
150149
arg0: PTR_WD 0x0
151150
arg1: PTR_WD 0x0
152151
arg2: PTR_WD 0x0
@@ -159,8 +158,7 @@ arg3: PTR_WD 0x0
159158
* their registers a0-a3. secondary_kexec_args[0..3] are used
160159
* to prepare register values.
161160
*/
162-
secondary_kexec_args:
163-
EXPORT(secondary_kexec_args)
161+
EXPORT(secondary_kexec_args)
164162
s_arg0: PTR_WD 0x0
165163
s_arg1: PTR_WD 0x0
166164
s_arg2: PTR_WD 0x0
@@ -171,19 +169,16 @@ kexec_flag:
171169

172170
#endif
173171

174-
kexec_start_address:
175-
EXPORT(kexec_start_address)
172+
EXPORT(kexec_start_address)
176173
PTR_WD 0x0
177174
.size kexec_start_address, PTRSIZE
178175

179-
kexec_indirection_page:
180-
EXPORT(kexec_indirection_page)
176+
EXPORT(kexec_indirection_page)
181177
PTR_WD 0
182178
.size kexec_indirection_page, PTRSIZE
183179

184180
relocate_new_kernel_end:
185181

186-
relocate_new_kernel_size:
187-
EXPORT(relocate_new_kernel_size)
182+
EXPORT(relocate_new_kernel_size)
188183
PTR_WD relocate_new_kernel_end - relocate_new_kernel
189184
.size relocate_new_kernel_size, PTRSIZE

arch/mips/loongson64/reset.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <asm/bootinfo.h>
1717
#include <asm/idle.h>
1818
#include <asm/reboot.h>
19+
#include <asm/bug.h>
1920

2021
#include <loongson.h>
2122
#include <boot_param.h>
@@ -159,8 +160,17 @@ static int __init mips_reboot_setup(void)
159160

160161
#ifdef CONFIG_KEXEC
161162
kexec_argv = kmalloc(KEXEC_ARGV_SIZE, GFP_KERNEL);
163+
if (WARN_ON(!kexec_argv))
164+
return -ENOMEM;
165+
162166
kdump_argv = kmalloc(KEXEC_ARGV_SIZE, GFP_KERNEL);
167+
if (WARN_ON(!kdump_argv))
168+
return -ENOMEM;
169+
163170
kexec_envp = kmalloc(KEXEC_ENVP_SIZE, GFP_KERNEL);
171+
if (WARN_ON(!kexec_envp))
172+
return -ENOMEM;
173+
164174
fw_arg1 = KEXEC_ARGV_ADDR;
165175
memcpy(kexec_envp, (void *)fw_arg2, KEXEC_ENVP_SIZE);
166176

arch/mips/pic32/pic32mzda/early_console.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define U_BRG(x) (UART_BASE(x) + 0x40)
2828

2929
static void __iomem *uart_base;
30-
static char console_port = -1;
30+
static int console_port = -1;
3131

3232
static int __init configure_uart_pins(int port)
3333
{
@@ -47,7 +47,7 @@ static int __init configure_uart_pins(int port)
4747
return 0;
4848
}
4949

50-
static void __init configure_uart(char port, int baud)
50+
static void __init configure_uart(int port, int baud)
5151
{
5252
u32 pbclk;
5353

@@ -60,7 +60,7 @@ static void __init configure_uart(char port, int baud)
6060
uart_base + PIC32_SET(U_STA(port)));
6161
}
6262

63-
static void __init setup_early_console(char port, int baud)
63+
static void __init setup_early_console(int port, int baud)
6464
{
6565
if (configure_uart_pins(port))
6666
return;
@@ -130,16 +130,15 @@ static int __init get_baud_from_cmdline(char *arch_cmdline)
130130
return baud;
131131
}
132132

133-
void __init fw_init_early_console(char port)
133+
void __init fw_init_early_console(void)
134134
{
135135
char *arch_cmdline = pic32_getcmdline();
136-
int baud = -1;
136+
int baud, port;
137137

138138
uart_base = ioremap(PIC32_BASE_UART, 0xc00);
139139

140140
baud = get_baud_from_cmdline(arch_cmdline);
141-
if (port == -1)
142-
port = get_port_from_cmdline(arch_cmdline);
141+
port = get_port_from_cmdline(arch_cmdline);
143142

144143
if (port == -1)
145144
port = EARLY_CONSOLE_PORT;

arch/mips/pic32/pic32mzda/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void __init plat_mem_setup(void)
4747
strscpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
4848

4949
#ifdef CONFIG_EARLY_PRINTK
50-
fw_init_early_console(-1);
50+
fw_init_early_console();
5151
#endif
5252
pic32_config_init();
5353
}

0 commit comments

Comments
 (0)