Skip to content

Commit

Permalink
Merge tag 'v4.19.322' into 4.19-main
Browse files Browse the repository at this point in the history
This is the 4.19.322 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmbirkUACgkQONu9yGCS
# aT736A/+LcXYSUiRx7vgnw3cyPEAkGaxTlFD9rwlKtHuK62SLxd/rTwECLwDVnsn
# 1fRLTT01+GZ3h2RPMOpXhK9la3G09hDwuNUJNLBBM7iPHSrRTMC1UO9ixA/L8/Vh
# 9N7Sc4589vpmnchcAK7ojoueNDrfiJLaVtteYGG9xQXnGLUjn5nxvZLCrYyYKhGK
# HnFOAKYbwWkx2/6+r9eG2bcJKnwrhTHs6szHHPdCKJgoOwa8v0qEVuIJeITetOxj
# ucKbzCWoJVSrCQEYjpL4nR30Iz7V4ZsOZcCfST13YkimleTbOL26yqfePVnBgRqI
# xk+8Wd0vJIj8QgJMQJCKm/URCwoc/27H5b8gY2UaCDT9xtnZgb3HUbUQZzkqw4ji
# +o/Gnu01oQqLeTCVvL8EUYJ+o1B3rL58pLb0hfDMfp790YQ95/lFzD9M0LGoy7V0
# JfcvZBqmRsWIYCJtWlN+gSoqVUVJMA1oMw3O2thttoyjnb5ukR75a88abv7J/nzn
# LmqHwwt3YQjltzBpsUtTI8gqekI2jeepu7PpTo2+HUR+eSqiA7JY3OeNnL8wN0Fz
# uK7iOnJlbfabUfSt63MVPkWPjs47WLwIZn+F2O4kf1b/5ZcX0uYqLt/v/OIK+ZOw
# coqRNQJ17wnLrpwPF+DNopCNLsD5Mj/J6eWLT6OXABTphQZiIvc=
# =B8T0
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu Sep 12 11:03:01 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 bd73234 + de2cffe commit e4da42f
Show file tree
Hide file tree
Showing 101 changed files with 768 additions and 345 deletions.
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 = 4
PATCHLEVEL = 19
SUBLEVEL = 321
SUBLEVEL = 322
EXTRAVERSION =
NAME = "People's Front"

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 @@ -524,7 +524,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)

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

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

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

Expand Down
2 changes: 2 additions & 0 deletions arch/um/drivers/line.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ int setup_one_line(struct line *lines, int n, char *init,
parse_chan_pair(NULL, line, n, opts, error_out);
err = 0;
}
*error_out = "configured as 'none'";
} else {
char *new = kstrdup(init, GFP_KERNEL);
if (!new) {
Expand All @@ -414,6 +415,7 @@ int setup_one_line(struct line *lines, int n, char *init,
}
}
if (err) {
*error_out = "failed to parse channel pair";
line->init_str = NULL;
line->valid = 0;
kfree(new);
Expand Down
11 changes: 10 additions & 1 deletion block/bio-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ bool bio_integrity_prep(struct bio *bio)
unsigned int bytes, offset, i;
unsigned int intervals;
blk_status_t status;
gfp_t gfp = GFP_NOIO;

if (!bi)
return true;
Expand All @@ -249,12 +250,20 @@ bool bio_integrity_prep(struct bio *bio)
if (!bi->profile->generate_fn ||
!(bi->flags & BLK_INTEGRITY_GENERATE))
return true;

/*
* Zero the memory allocated to not leak uninitialized kernel
* memory to disk. For PI this only affects the app tag, but
* for non-integrity metadata it affects the entire metadata
* buffer.
*/
gfp |= __GFP_ZERO;
}
intervals = bio_integrity_intervals(bi, bio_sectors(bio));

/* Allocate kernel buffer for protection data */
len = intervals * bi->tuple_size;
buf = kmalloc(len, GFP_NOIO | q->bounce_gfp);
buf = kmalloc(len, gfp | q->bounce_gfp);
status = BLK_STS_RESOURCE;
if (unlikely(buf == NULL)) {
printk(KERN_ERR "could not allocate integrity buffer\n");
Expand Down
15 changes: 8 additions & 7 deletions drivers/acpi/acpi_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ static int acpi_processor_add(struct acpi_device *device,

result = acpi_processor_get_info(device);
if (result) /* Processor is not physically present or unavailable */
return 0;
goto err_clear_driver_data;

BUG_ON(pr->id >= nr_cpu_ids);

Expand All @@ -406,7 +406,7 @@ static int acpi_processor_add(struct acpi_device *device,
"BIOS reported wrong ACPI id %d for the processor\n",
pr->id);
/* Give up, but do not abort the namespace scan. */
goto err;
goto err_clear_driver_data;
}
/*
* processor_device_array is not cleared on errors to allow buggy BIOS
Expand All @@ -418,12 +418,12 @@ static int acpi_processor_add(struct acpi_device *device,
dev = get_cpu_device(pr->id);
if (!dev) {
result = -ENODEV;
goto err;
goto err_clear_per_cpu;
}

result = acpi_bind_one(dev, device);
if (result)
goto err;
goto err_clear_per_cpu;

pr->dev = dev;

Expand All @@ -434,10 +434,11 @@ static int acpi_processor_add(struct acpi_device *device,
dev_err(dev, "Processor driver could not be attached\n");
acpi_unbind_one(dev);

err:
free_cpumask_var(pr->throttling.shared_cpu_map);
device->driver_data = NULL;
err_clear_per_cpu:
per_cpu(processors, pr->id) = NULL;
err_clear_driver_data:
device->driver_data = NULL;
free_cpumask_var(pr->throttling.shared_cpu_map);
err_free_pr:
kfree(pr);
return result;
Expand Down
4 changes: 3 additions & 1 deletion drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -6221,8 +6221,10 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports)
}

dr = devres_alloc(ata_devres_release, 0, GFP_KERNEL);
if (!dr)
if (!dr) {
kfree(host);
goto err_out;
}

devres_add(dev, dr);
dev_set_drvdata(dev, host);
Expand Down
7 changes: 5 additions & 2 deletions drivers/ata/pata_macio.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@ static enum ata_completion_errors pata_macio_qc_prep(struct ata_queued_cmd *qc)

while (sg_len) {
/* table overflow should never happen */
BUG_ON (pi++ >= MAX_DCMDS);
if (WARN_ON_ONCE(pi >= MAX_DCMDS))
return AC_ERR_SYSTEM;

len = (sg_len < MAX_DBDMA_SEG) ? sg_len : MAX_DBDMA_SEG;
table->command = cpu_to_le16(write ? OUTPUT_MORE: INPUT_MORE);
Expand All @@ -549,11 +550,13 @@ static enum ata_completion_errors pata_macio_qc_prep(struct ata_queued_cmd *qc)
addr += len;
sg_len -= len;
++table;
++pi;
}
}

/* Should never happen according to Tejun */
BUG_ON(!pi);
if (WARN_ON_ONCE(!pi))
return AC_ERR_SYSTEM;

/* Convert the last command to an input/output */
table--;
Expand Down
1 change: 1 addition & 0 deletions drivers/base/devres.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ void * devres_open_group(struct device *dev, void *id, gfp_t gfp)
grp->id = grp;
if (id)
grp->id = id;
grp->color = 0;

spin_lock_irqsave(&dev->devres_lock, flags);
add_dr(dev, &grp->node[0]);
Expand Down
2 changes: 1 addition & 1 deletion drivers/clk/qcom/clk-alpha-pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#define PLL_USER_CTL(p) ((p)->offset + (p)->regs[PLL_OFF_USER_CTL])
# define PLL_POST_DIV_SHIFT 8
# define PLL_POST_DIV_MASK(p) GENMASK((p)->width, 0)
# define PLL_POST_DIV_MASK(p) GENMASK((p)->width - 1, 0)
# define PLL_ALPHA_EN BIT(24)
# define PLL_ALPHA_MODE BIT(25)
# define PLL_VCO_SHIFT 20
Expand Down
16 changes: 12 additions & 4 deletions drivers/clocksource/timer-imx-tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,28 @@ static int __init tpm_clocksource_init(unsigned long rate)
static int tpm_set_next_event(unsigned long delta,
struct clock_event_device *evt)
{
unsigned long next, now;
unsigned long next, prev, now;

next = tpm_read_counter();
next += delta;
prev = tpm_read_counter();
next = prev + delta;
writel(next, timer_base + TPM_C0V);
now = tpm_read_counter();

/*
* Need to wait CNT increase at least 1 cycle to make sure
* the C0V has been updated into HW.
*/
if ((next & 0xffffffff) != readl(timer_base + TPM_C0V))
while (now == tpm_read_counter())
;

/*
* NOTE: We observed in a very small probability, the bus fabric
* contention between GPU and A7 may results a few cycles delay
* of writing CNT registers which may cause the min_delta event got
* missed, so we need add a ETIME check here in case it happened.
*/
return (int)(next - now) <= 0 ? -ETIME : 0;
return (now - prev) >= delta ? -ETIME : 0;
}

static int tpm_set_state_oneshot(struct clock_event_device *evt)
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_afmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ struct amdgpu_afmt_acr amdgpu_afmt_acr(uint32_t clock)
amdgpu_afmt_calc_cts(clock, &res.cts_32khz, &res.n_32khz, 32000);
amdgpu_afmt_calc_cts(clock, &res.cts_44_1khz, &res.n_44_1khz, 44100);
amdgpu_afmt_calc_cts(clock, &res.cts_48khz, &res.n_48khz, 48000);
res.clock = clock;

return res;
}
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,8 @@ int amdgpu_atombios_init_mc_reg_table(struct amdgpu_device *adev,
(u32)le32_to_cpu(*((u32 *)reg_data + j));
j++;
} else if ((reg_table->mc_reg_address[i].pre_reg_data & LOW_NIBBLE_MASK) == DATA_EQU_PREV) {
if (i == 0)
continue;
reg_table->mc_reg_table_entry[num_ranges].mc_data[i] =
reg_table->mc_reg_table_entry[num_ranges].mc_data[i - 1];
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
struct amdgpu_firmware_info *ucode;

id = fw_type_convert(cgs_device, type);
if (id >= AMDGPU_UCODE_ID_MAXIMUM)
return -EINVAL;

ucode = &adev->firmware.ucode[id];
if (ucode->fw == NULL)
return -EINVAL;
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,9 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf,
size_t size, loff_t *pos)
{
struct amdgpu_ring *ring = file_inode(f)->i_private;
int r, i;
uint32_t value, result, early[3];
loff_t i;
int r;

if (*pos & 3 || size & 3)
return -EINVAL;
Expand Down
2 changes: 0 additions & 2 deletions drivers/gpu/drm/amd/amdkfd/kfd_crat.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
#define CRAT_OEMTABLEID_LENGTH 8
#define CRAT_RESERVED_LENGTH 6

#define CRAT_OEMID_64BIT_MASK ((1ULL << (CRAT_OEMID_LENGTH * 8)) - 1)

/* Compute Unit flags */
#define COMPUTE_UNIT_CPU (1 << 0) /* Create Virtual CRAT for CPU */
#define COMPUTE_UNIT_GPU (1 << 1) /* Create Virtual CRAT for GPU */
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/amd/amdkfd/kfd_topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,7 @@ static void kfd_update_system_properties(void)
dev = list_last_entry(&topology_device_list,
struct kfd_topology_device, list);
if (dev) {
sys_props.platform_id =
(*((uint64_t *)dev->oem_id)) & CRAT_OEMID_64BIT_MASK;
sys_props.platform_id = dev->oem_id64;
sys_props.platform_oem = *((uint64_t *)dev->oem_table_id);
sys_props.platform_rev = dev->oem_revision;
}
Expand Down
5 changes: 4 additions & 1 deletion drivers/gpu/drm/amd/amdkfd/kfd_topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ struct kfd_topology_device {
struct attribute attr_gpuid;
struct attribute attr_name;
struct attribute attr_props;
uint8_t oem_id[CRAT_OEMID_LENGTH];
union {
uint8_t oem_id[CRAT_OEMID_LENGTH];
uint64_t oem_id64;
};
uint8_t oem_table_id[CRAT_OEMTABLEID_LENGTH];
uint32_t oem_revision;
};
Expand Down
8 changes: 4 additions & 4 deletions drivers/gpu/drm/i915/i915_sw_fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static inline void debug_fence_init(struct i915_sw_fence *fence)
debug_object_init(fence, &i915_sw_fence_debug_descr);
}

static inline void debug_fence_init_onstack(struct i915_sw_fence *fence)
static inline __maybe_unused void debug_fence_init_onstack(struct i915_sw_fence *fence)
{
debug_object_init_on_stack(fence, &i915_sw_fence_debug_descr);
}
Expand All @@ -67,7 +67,7 @@ static inline void debug_fence_destroy(struct i915_sw_fence *fence)
debug_object_destroy(fence, &i915_sw_fence_debug_descr);
}

static inline void debug_fence_free(struct i915_sw_fence *fence)
static inline __maybe_unused void debug_fence_free(struct i915_sw_fence *fence)
{
debug_object_free(fence, &i915_sw_fence_debug_descr);
smp_wmb(); /* flush the change in state before reallocation */
Expand All @@ -84,7 +84,7 @@ static inline void debug_fence_init(struct i915_sw_fence *fence)
{
}

static inline void debug_fence_init_onstack(struct i915_sw_fence *fence)
static inline __maybe_unused void debug_fence_init_onstack(struct i915_sw_fence *fence)
{
}

Expand All @@ -105,7 +105,7 @@ static inline void debug_fence_destroy(struct i915_sw_fence *fence)
{
}

static inline void debug_fence_free(struct i915_sw_fence *fence)
static inline __maybe_unused void debug_fence_free(struct i915_sw_fence *fence)
{
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/hid/hid-cougar.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static void cougar_fix_g6_mapping(struct hid_device *hdev)
static __u8 *cougar_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
if (rdesc[2] == 0x09 && rdesc[3] == 0x02 &&
if (*rsize >= 117 && rdesc[2] == 0x09 && rdesc[3] == 0x02 &&
(rdesc[115] | rdesc[116] << 8) >= HID_MAX_USAGES) {
hid_info(hdev,
"usage count exceeds max: fixing up report descriptor\n");
Expand Down
1 change: 1 addition & 0 deletions drivers/hv/vmbus_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1973,6 +1973,7 @@ static int vmbus_acpi_add(struct acpi_device *device)
vmbus_acpi_remove(device);
return ret_val;
}
EXPORT_SYMBOL_GPL(vmbus_device_unregister);

static const struct acpi_device_id vmbus_acpi_device_ids[] = {
{"VMBUS", 0},
Expand Down
4 changes: 2 additions & 2 deletions drivers/hwmon/adc128d818.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static ssize_t adc128_set_in(struct device *dev, struct device_attribute *attr,

mutex_lock(&data->update_lock);
/* 10 mV LSB on limit registers */
regval = clamp_val(DIV_ROUND_CLOSEST(val, 10), 0, 255);
regval = DIV_ROUND_CLOSEST(clamp_val(val, 0, 2550), 10);
data->in[index][nr] = regval << 4;
reg = index == 1 ? ADC128_REG_IN_MIN(nr) : ADC128_REG_IN_MAX(nr);
i2c_smbus_write_byte_data(data->client, reg, regval);
Expand Down Expand Up @@ -222,7 +222,7 @@ static ssize_t adc128_set_temp(struct device *dev,
return err;

mutex_lock(&data->update_lock);
regval = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127);
regval = DIV_ROUND_CLOSEST(clamp_val(val, -128000, 127000), 1000);
data->temp[index] = regval << 1;
i2c_smbus_write_byte_data(data->client,
index == 1 ? ADC128_REG_TEMP_MAX
Expand Down
9 changes: 5 additions & 4 deletions drivers/hwmon/lm95234.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ static ssize_t set_tcrit2(struct device *dev, struct device_attribute *attr,
if (ret < 0)
return ret;

val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, index ? 255 : 127);
val = DIV_ROUND_CLOSEST(clamp_val(val, 0, (index ? 255 : 127) * 1000),
1000);

mutex_lock(&data->update_lock);
data->tcrit2[index] = val;
Expand Down Expand Up @@ -359,7 +360,7 @@ static ssize_t set_tcrit1(struct device *dev, struct device_attribute *attr,
if (ret < 0)
return ret;

val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, 255);
val = DIV_ROUND_CLOSEST(clamp_val(val, 0, 255000), 1000);

mutex_lock(&data->update_lock);
data->tcrit1[index] = val;
Expand Down Expand Up @@ -400,7 +401,7 @@ static ssize_t set_tcrit1_hyst(struct device *dev,
if (ret < 0)
return ret;

val = DIV_ROUND_CLOSEST(val, 1000);
val = DIV_ROUND_CLOSEST(clamp_val(val, -255000, 255000), 1000);
val = clamp_val((int)data->tcrit1[index] - val, 0, 31);

mutex_lock(&data->update_lock);
Expand Down Expand Up @@ -440,7 +441,7 @@ static ssize_t set_offset(struct device *dev, struct device_attribute *attr,
return ret;

/* Accuracy is 1/2 degrees C */
val = clamp_val(DIV_ROUND_CLOSEST(val, 500), -128, 127);
val = DIV_ROUND_CLOSEST(clamp_val(val, -64000, 63500), 500);

mutex_lock(&data->update_lock);
data->toffset[index] = val;
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/nct6775.c
Original file line number Diff line number Diff line change
Expand Up @@ -2264,7 +2264,7 @@ store_temp_offset(struct device *dev, struct device_attribute *attr,
if (err < 0)
return err;

val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127);
val = DIV_ROUND_CLOSEST(clamp_val(val, -128000, 127000), 1000);

mutex_lock(&data->update_lock);
data->temp_offset[nr] = val;
Expand Down
Loading

0 comments on commit e4da42f

Please sign in to comment.