Skip to content

Commit

Permalink
Merge tag 'v5.4.283' into 5.4-main
Browse files Browse the repository at this point in the history
This is the 5.4.283 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmbYQYIACgkQONu9yGCS
# aT5Yvg//a5nvSr37zxUnJ8Km+d2X4RysNh+853C/ydDj3Vr/zy/RrLPq2XQ9Cvfl
# 0zW6VLkrC+g8tQFBdJKYZH/EFRTriKNhMnjudgoanLCm8KaA7UbR/Zp9h9L9Czzi
# G1aUvS/+ZBe83BLCQQul8sonlVE8AtfjwVjEkj6rXJZMn3URh278i84CuosZRg5R
# Ao45mn8Gv+gxCrUtLU6Qy5gHKFJ2zGXyYP4Mn1UyUkLkgnUm7E1ZFelyrOxryILP
# mEcs700qT5BIlbodKdNQDP/ezbrLbljKliVS/z1YLZLfVI5v6OTGzMc81GPILHXj
# 1pK+DwQIZnFB/1E+AyER+i7n1i7id2lIRxmaJ4+TSxoNUKBP0+KuuZSFsAsDSXbS
# NXnGpPC5wJQcyf+DD7l9+XbdViCoDfTXMlIBMpmAdBhvsPfhAhtsgJV/DPiir6V7
# JszP1AZlhwvvb4FOyr8AJ6jmFxDBfM3HniWDEn/zN/1GBMebwghchLP4CFflV6aN
# 1BqTONiWHvtqRm6nvBJVBV2frWzm4TmKr/RdlMGPTBr60GJqV/qwO5m7a7c+OBnF
# WscJ2wht2P2RgWOhnaS4NQF+IIbRaQm9AisvQCYoZlQIplS9RH61pnutfpYWNUZJ
# Zd7lIDLbifojX9mGTg1fUcrffHFnewSAag0oEeuMFuZOR6WaQs0=
# =2It1
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Sep  4 13:16:18 2024 CEST
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Can't check signature: No public key
  • Loading branch information
frank-w committed Sep 14, 2024
2 parents a4377dd + 4826c62 commit 7cb33ad
Show file tree
Hide file tree
Showing 137 changed files with 1,699 additions and 621 deletions.
20 changes: 17 additions & 3 deletions Documentation/process/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Instead, the 2-factor form of the allocator should be used::

foo = kmalloc_array(count, size, GFP_KERNEL);

Specifically, kmalloc() can be replaced with kmalloc_array(), and
kzalloc() can be replaced with kcalloc().

If no 2-factor form is available, the saturate-on-overflow helpers should
be used::

Expand All @@ -63,9 +66,20 @@ Instead, use the helper::

header = kzalloc(struct_size(header, item, count), GFP_KERNEL);

See :c:func:`array_size`, :c:func:`array3_size`, and :c:func:`struct_size`,
for more details as well as the related :c:func:`check_add_overflow` and
:c:func:`check_mul_overflow` family of functions.
For other calculations, please compose the use of the size_mul(),
size_add(), and size_sub() helpers. For example, in the case of::

foo = krealloc(current_size + chunk_size * (count - 3), GFP_KERNEL);

Instead, use the helpers::

foo = krealloc(size_add(current_size,
size_mul(chunk_size,
size_sub(count, 3))), GFP_KERNEL);

For more details, also see array3_size() and flex_array_size(),
as well as the related check_mul_overflow(), check_add_overflow(),
check_sub_overflow(), and check_shl_overflow() family of functions.

simple_strtol(), simple_strtoll(), simple_strtoul(), simple_strtoull()
----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 4
SUBLEVEL = 282
SUBLEVEL = 283
EXTRAVERSION =
NAME = Kleptomaniac Octopus

Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/kernel/acpi_numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include <asm/numa.h>

static int acpi_early_node_map[NR_CPUS] __initdata = { NUMA_NO_NODE };
static int acpi_early_node_map[NR_CPUS] __initdata = { [0 ... NR_CPUS - 1] = NUMA_NO_NODE };

int __init acpi_numa_get_nid(unsigned int cpu)
{
Expand Down
6 changes: 3 additions & 3 deletions arch/openrisc/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ void calibrate_delay(void)

void __init setup_arch(char **cmdline_p)
{
/* setup memblock allocator */
setup_memory();

unflatten_and_copy_device_tree();

setup_cpuinfo();
Expand All @@ -304,9 +307,6 @@ void __init setup_arch(char **cmdline_p)
initrd_below_start_ok = 1;
#endif

/* setup memblock allocator */
setup_memory();

/* paging_init() sets up the MMU and marks all pages as reserved */
paging_init();

Expand Down
4 changes: 2 additions & 2 deletions arch/parisc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)

old_regs = set_irq_regs(regs);
local_irq_disable();
irq_enter();
irq_enter_rcu();

eirr_val = mfctl(23) & cpu_eiem & per_cpu(local_ack_eiem, cpu);
if (!eirr_val)
Expand Down Expand Up @@ -555,7 +555,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
#endif /* CONFIG_IRQSTACKS */

out:
irq_exit();
irq_exit_rcu();
set_irq_regs(old_regs);
return;

Expand Down
7 changes: 5 additions & 2 deletions arch/powerpc/boot/simple_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ static void *simple_realloc(void *ptr, unsigned long size)
return ptr;

new = simple_malloc(size);
memcpy(new, ptr, p->size);
simple_free(ptr);
if (new) {
memcpy(new, ptr, p->size);
simple_free(ptr);
}

return new;
}

Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/sysdev/xics/icp-native.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ static int __init icp_native_map_one_cpu(int hw_id, unsigned long addr,
rname = kasprintf(GFP_KERNEL, "CPU %d [0x%x] Interrupt Presentation",
cpu, hw_id);

if (!rname)
return -ENOMEM;
if (!request_mem_region(addr, size, rname)) {
pr_warn("icp_native: Could not reserve ICP MMIO for CPU %d, interrupt server #0x%x\n",
cpu, hw_id);
Expand Down
5 changes: 4 additions & 1 deletion arch/s390/include/asm/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ static inline int share(unsigned long addr, u16 cmd)

if (!uv_call(0, (u64)&uvcb))
return 0;
return -EINVAL;
pr_err("%s UVC failed (rc: 0x%x, rrc: 0x%x), possible hypervisor bug.\n",
uvcb.header.cmd == UVC_CMD_SET_SHARED_ACCESS ? "Share" : "Unshare",
uvcb.header.rc, uvcb.header.rrc);
panic("System security cannot be guaranteed unless the system panics now.\n");
}

/*
Expand Down
5 changes: 4 additions & 1 deletion arch/x86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,10 @@ unsigned long arch_align_stack(unsigned long sp)

unsigned long arch_randomize_brk(struct mm_struct *mm)
{
return randomize_page(mm->brk, 0x02000000);
if (mmap_is_ia32())
return randomize_page(mm->brk, SZ_32M);

return randomize_page(mm->brk, SZ_1G);
}

/*
Expand Down
3 changes: 3 additions & 0 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -6141,6 +6141,9 @@ static void ata_host_release(struct kref *kref)
for (i = 0; i < host->n_ports; i++) {
struct ata_port *ap = host->ports[i];

if (!ap)
continue;

kfree(ap->pmp_link);
kfree(ap->slave_link);
kfree(ap);
Expand Down
9 changes: 5 additions & 4 deletions drivers/atm/idt77252.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,8 +1117,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
rpp->len += skb->len;

if (stat & SAR_RSQE_EPDU) {
unsigned int len, truesize;
unsigned char *l1l2;
unsigned int len;

l1l2 = (unsigned char *) ((unsigned long) skb->data + skb->len - 6);

Expand Down Expand Up @@ -1188,14 +1188,15 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
ATM_SKB(skb)->vcc = vcc;
__net_timestamp(skb);

truesize = skb->truesize;
vcc->push(vcc, skb);
atomic_inc(&vcc->stats->rx);

if (skb->truesize > SAR_FB_SIZE_3)
if (truesize > SAR_FB_SIZE_3)
add_rx_skb(card, 3, SAR_FB_SIZE_3, 1);
else if (skb->truesize > SAR_FB_SIZE_2)
else if (truesize > SAR_FB_SIZE_2)
add_rx_skb(card, 2, SAR_FB_SIZE_2, 1);
else if (skb->truesize > SAR_FB_SIZE_1)
else if (truesize > SAR_FB_SIZE_1)
add_rx_skb(card, 1, SAR_FB_SIZE_1, 1);
else
add_rx_skb(card, 0, SAR_FB_SIZE_0, 1);
Expand Down
3 changes: 2 additions & 1 deletion drivers/bluetooth/hci_ldisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,8 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file *file,
break;

case HCIUARTGETPROTO:
if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
if (test_bit(HCI_UART_PROTO_SET, &hu->flags) &&
test_bit(HCI_UART_PROTO_READY, &hu->flags))
err = hu->proto->id;
else
err = -EUNATCH;
Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,16 +401,24 @@ int amdgpu_ctx_ioctl(struct drm_device *dev, void *data,

switch (args->in.op) {
case AMDGPU_CTX_OP_ALLOC_CTX:
if (args->in.flags)
return -EINVAL;
r = amdgpu_ctx_alloc(adev, fpriv, filp, priority, &id);
args->out.alloc.ctx_id = id;
break;
case AMDGPU_CTX_OP_FREE_CTX:
if (args->in.flags)
return -EINVAL;
r = amdgpu_ctx_free(fpriv, id);
break;
case AMDGPU_CTX_OP_QUERY_STATE:
if (args->in.flags)
return -EINVAL;
r = amdgpu_ctx_query(adev, fpriv, id, &args->out);
break;
case AMDGPU_CTX_OP_QUERY_STATE2:
if (args->in.flags)
return -EINVAL;
r = amdgpu_ctx_query2(adev, fpriv, id, &args->out);
break;
default:
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,8 @@ int amdgpu_vce_ring_parse_cs(struct amdgpu_cs_parser *p, uint32_t ib_idx)
uint32_t created = 0;
uint32_t allocated = 0;
uint32_t tmp, handle = 0;
uint32_t *size = &tmp;
uint32_t dummy = 0xffffffff;
uint32_t *size = &dummy;
unsigned idx;
int i, r = 0;

Expand Down
5 changes: 4 additions & 1 deletion drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ static int kfd_ioctl_alloc_memory_of_gpu(struct file *filep,
if (args->size != PAGE_SIZE)
return -EINVAL;
offset = amdgpu_amdkfd_get_mmio_remap_phys_addr(dev->kgd);
if (!offset)
if (!offset || (PAGE_SIZE > 4096))
return -ENOMEM;
}

Expand Down Expand Up @@ -1872,6 +1872,9 @@ static int kfd_mmio_mmap(struct kfd_dev *dev, struct kfd_process *process,
if (vma->vm_end - vma->vm_start != PAGE_SIZE)
return -EINVAL;

if (PAGE_SIZE > 4096)
return -EINVAL;

address = amdgpu_amdkfd_get_mmio_remap_phys_addr(dev->kgd);

vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_NORESERVE |
Expand Down
12 changes: 12 additions & 0 deletions drivers/gpu/drm/lima/lima_gp.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ static void lima_gp_task_run(struct lima_sched_pipe *pipe,
gp_write(LIMA_GP_CMD, cmd);
}

static int lima_gp_bus_stop_poll(struct lima_ip *ip)
{
return !!(gp_read(LIMA_GP_STATUS) & LIMA_GP_STATUS_BUS_STOPPED);
}

static int lima_gp_hard_reset_poll(struct lima_ip *ip)
{
gp_write(LIMA_GP_PERF_CNT_0_LIMIT, 0xC01A0000);
Expand All @@ -151,6 +156,13 @@ static int lima_gp_hard_reset(struct lima_ip *ip)

gp_write(LIMA_GP_PERF_CNT_0_LIMIT, 0xC0FFE000);
gp_write(LIMA_GP_INT_MASK, 0);

gp_write(LIMA_GP_CMD, LIMA_GP_CMD_STOP_BUS);
ret = lima_poll_timeout(ip, lima_gp_bus_stop_poll, 10, 100);
if (ret) {
dev_err(dev->dev, "%s bus stop timeout\n", lima_ip_name(ip));
return ret;
}
gp_write(LIMA_GP_CMD, LIMA_GP_CMD_RESET);
ret = lima_poll_timeout(ip, lima_gp_hard_reset_poll, 10, 100);
if (ret) {
Expand Down
14 changes: 2 additions & 12 deletions drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,14 @@
* @fmt: Pointer to format string
*/
#define DPU_DEBUG(fmt, ...) \
do { \
if (unlikely(drm_debug & DRM_UT_KMS)) \
DRM_DEBUG(fmt, ##__VA_ARGS__); \
else \
pr_debug(fmt, ##__VA_ARGS__); \
} while (0)
DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__)

/**
* DPU_DEBUG_DRIVER - macro for hardware driver logging
* @fmt: Pointer to format string
*/
#define DPU_DEBUG_DRIVER(fmt, ...) \
do { \
if (unlikely(drm_debug & DRM_UT_DRIVER)) \
DRM_ERROR(fmt, ##__VA_ARGS__); \
else \
pr_debug(fmt, ##__VA_ARGS__); \
} while (0)
DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__)

#define DPU_ERROR(fmt, ...) pr_err("[dpu error]" fmt, ##__VA_ARGS__)
#define DPU_ERROR_RATELIMITED(fmt, ...) pr_err_ratelimited("[dpu error]" fmt, ##__VA_ARGS__)
Expand Down
10 changes: 9 additions & 1 deletion drivers/hid/hid-ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,15 @@
#define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9
#define USB_DEVICE_ID_MS_POWER_COVER 0x07da
#define USB_DEVICE_ID_MS_SURFACE3_COVER 0x07de
#define USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER 0x02fd
/*
* For a description of the Xbox controller models, refer to:
* https://en.wikipedia.org/wiki/Xbox_Wireless_Controller#Summary
*/
#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708 0x02fd
#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708_BLE 0x0b20
#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1914 0x0b13
#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797 0x0b05
#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797_BLE 0x0b22
#define USB_DEVICE_ID_MS_PIXART_MOUSE 0x00cb
#define USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS 0x02e0
#define USB_DEVICE_ID_MS_MOUSE_0783 0x0783
Expand Down
11 changes: 10 additions & 1 deletion drivers/hid/hid-microsoft.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,16 @@ static const struct hid_device_id ms_devices[] = {
.driver_data = MS_PRESENTER },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x091B),
.driver_data = MS_SURFACE_DIAL },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER),

{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708),
.driver_data = MS_QUIRK_FF },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708_BLE),
.driver_data = MS_QUIRK_FF },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1914),
.driver_data = MS_QUIRK_FF },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797),
.driver_data = MS_QUIRK_FF },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797_BLE),
.driver_data = MS_QUIRK_FF },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS),
.driver_data = MS_QUIRK_FF },
Expand Down
4 changes: 3 additions & 1 deletion drivers/hid/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1920,12 +1920,14 @@ static void wacom_map_usage(struct input_dev *input, struct hid_usage *usage,
int fmax = field->logical_maximum;
unsigned int equivalent_usage = wacom_equivalent_usage(usage->hid);
int resolution_code = code;
int resolution = hidinput_calc_abs_res(field, resolution_code);
int resolution;

if (equivalent_usage == HID_DG_TWIST) {
resolution_code = ABS_RZ;
}

resolution = hidinput_calc_abs_res(field, resolution_code);

if (equivalent_usage == HID_GD_X) {
fmin += features->offset_left;
fmax -= features->offset_right;
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-riic.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static int riic_init_hw(struct riic_dev *riic, struct i2c_timings *t)
* frequency with only 62 clock ticks max (31 high, 31 low).
* Aim for a duty of 60% LOW, 40% HIGH.
*/
total_ticks = DIV_ROUND_UP(rate, t->bus_freq_hz);
total_ticks = DIV_ROUND_UP(rate, t->bus_freq_hz ?: 1);

for (cks = 0; cks < 7; cks++) {
/*
Expand Down
5 changes: 3 additions & 2 deletions drivers/infiniband/hw/hfi1/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -13067,15 +13067,16 @@ static void read_mod_write(struct hfi1_devdata *dd, u16 src, u64 bits,
{
u64 reg;
u16 idx = src / BITS_PER_REGISTER;
unsigned long flags;

spin_lock(&dd->irq_src_lock);
spin_lock_irqsave(&dd->irq_src_lock, flags);
reg = read_csr(dd, CCE_INT_MASK + (8 * idx));
if (set)
reg |= bits;
else
reg &= ~bits;
write_csr(dd, CCE_INT_MASK + (8 * idx), reg);
spin_unlock(&dd->irq_src_lock);
spin_unlock_irqrestore(&dd->irq_src_lock, flags);
}

/**
Expand Down
3 changes: 3 additions & 0 deletions drivers/input/input-mt.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots,
return 0;
if (mt)
return mt->num_slots != num_slots ? -EINVAL : 0;
/* Arbitrary limit for avoiding too large memory allocation. */
if (num_slots > 1024)
return -EINVAL;

mt = kzalloc(struct_size(mt, slots, num_slots), GFP_KERNEL);
if (!mt)
Expand Down
2 changes: 0 additions & 2 deletions drivers/irqchip/irq-gic-v3-its.c
Original file line number Diff line number Diff line change
Expand Up @@ -3085,8 +3085,6 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
struct page *vprop_page;
int base, nr_ids, i, err = 0;

BUG_ON(!vm);

bitmap = its_lpi_alloc(roundup_pow_of_two(nr_irqs), &base, &nr_ids);
if (!bitmap)
return -ENOMEM;
Expand Down
Loading

0 comments on commit 7cb33ad

Please sign in to comment.