Skip to content

Commit

Permalink
Merge pull request #89 from Flamefire/asb-23-03-los20
Browse files Browse the repository at this point in the history
ASB 2023-03 & CIP st-38 update
  • Loading branch information
derfelot authored Apr 30, 2023
2 parents 7e33e39 + ad5b667 commit 0b73b23
Show file tree
Hide file tree
Showing 128 changed files with 765 additions and 328 deletions.
3 changes: 3 additions & 0 deletions KNOWN-BUGS
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ c00fcec32 | selinux: fix error initialization in inode_doinit_with_dentry(
cec1c921f | btrfs: reject log replay if there is unsupported RO compat flag
d1f0467fd | btrfs: check if root is readonly while setting security xattr

4.14.y:

35529d6b8 | nfc: pn533: Wait for out_urb's completion in pn533_usb_send_frame()
2 changes: 1 addition & 1 deletion arch/ia64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ config ARCH_PROC_KCORE_TEXT
depends on PROC_KCORE

config IA64_MCA_RECOVERY
tristate "MCA recovery from errors other than TLB."
bool "MCA recovery from errors other than TLB."

config PERFMON
bool "Performance monitor support"
Expand Down
5 changes: 3 additions & 2 deletions arch/parisc/kernel/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ static char __attribute__((aligned(64))) iodc_dbuf[4096];
*/
int pdc_iodc_print(const unsigned char *str, unsigned count)
{
unsigned int i;
unsigned int i, found = 0;
unsigned long flags;

for (i = 0; i < count;) {
Expand All @@ -1133,6 +1133,7 @@ int pdc_iodc_print(const unsigned char *str, unsigned count)
iodc_dbuf[i+0] = '\r';
iodc_dbuf[i+1] = '\n';
i += 2;
found = 1;
goto print;
default:
iodc_dbuf[i] = str[i];
Expand All @@ -1149,7 +1150,7 @@ int pdc_iodc_print(const unsigned char *str, unsigned count)
__pa(iodc_retbuf), 0, __pa(iodc_dbuf), i, 0);
spin_unlock_irqrestore(&pdc_lock, flags);

return i;
return i - found;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/asm/percpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
pcp_op_T__ *ptr__; \
preempt_disable_notrace(); \
ptr__ = raw_cpu_ptr(&(pcp)); \
prev__ = *ptr__; \
prev__ = READ_ONCE(*ptr__); \
do { \
old__ = prev__; \
new__ = old__ op (val); \
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/boot/bioscall.S
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ intcall:
movw %dx, %si
movw %sp, %di
movw $11, %cx
rep; movsd
rep; movsl

/* Pop full state from the stack */
popal
Expand Down Expand Up @@ -70,7 +70,7 @@ intcall:
jz 4f
movw %sp, %si
movw $11, %cx
rep; movsd
rep; movsl
4: addw $44, %sp

/* Restore state and return */
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/entry/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -1672,5 +1672,5 @@ END(nmi)

ENTRY(ignore_sysret)
mov $-ENOSYS, %eax
sysret
sysretl
END(ignore_sysret)
2 changes: 2 additions & 0 deletions arch/x86/kernel/cpu/bugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,8 @@ static int ib_prctl_set(struct task_struct *task, unsigned long ctrl)
if (ctrl == PR_SPEC_FORCE_DISABLE)
task_set_spec_ib_force_disable(task);
task_update_spec_tif(task);
if (task == current)
indirect_branch_prediction_barrier();
break;
default:
return -ERANGE;
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/i8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ static void make_8259A_irq(unsigned int irq)
disable_irq_nosync(irq);
io_apic_irqs &= ~(1<<irq);
irq_set_chip_and_handler(irq, &i8259A_chip, handle_level_irq);
irq_set_status_flags(irq, IRQ_LEVEL);
enable_irq(irq);
}

Expand Down
4 changes: 3 additions & 1 deletion arch/x86/kernel/irqinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ void __init init_ISA_irqs(void)
#endif
legacy_pic->init(0);

for (i = 0; i < nr_legacy_irqs(); i++)
for (i = 0; i < nr_legacy_irqs(); i++) {
irq_set_chip_and_handler(i, chip, handle_level_irq);
irq_set_status_flags(i, IRQ_LEVEL);
}
}

void __init init_IRQ(void)
Expand Down
3 changes: 1 addition & 2 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -3120,12 +3120,11 @@ static void kvm_vcpu_ioctl_x86_get_debugregs(struct kvm_vcpu *vcpu,
{
unsigned long val;

memset(dbgregs, 0, sizeof(*dbgregs));
memcpy(dbgregs->db, vcpu->arch.db, sizeof(vcpu->arch.db));
kvm_get_dr(vcpu, 6, &val);
dbgregs->dr6 = val;
dbgregs->dr7 = vcpu->arch.dr7;
dbgregs->flags = 0;
memset(&dbgregs->reserved, 0, sizeof(dbgregs->reserved));
}

static int kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu,
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/lib/iomap_copy_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
*/
ENTRY(__iowrite32_copy)
movl %edx,%ecx
rep movsd
rep movsl
ret
ENDPROC(__iowrite32_copy)
5 changes: 5 additions & 0 deletions drivers/base/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ int __class_register(struct class *cls, struct lock_class_key *key)
}
error = add_class_attrs(class_get(cls));
class_put(cls);
if (error) {
kobject_del(&cp->subsys.kobj);
kfree_const(cp->subsys.kobj.name);
kfree(cp);
}
return error;
}
EXPORT_SYMBOL_GPL(__class_register);
Expand Down
8 changes: 7 additions & 1 deletion drivers/bus/sunxi-rsb.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,13 @@ static int __init sunxi_rsb_init(void)
return ret;
}

return platform_driver_register(&sunxi_rsb_driver);
ret = platform_driver_register(&sunxi_rsb_driver);
if (ret) {
bus_unregister(&sunxi_rsb_bus);
return ret;
}

return 0;
}
module_init(sunxi_rsb_init);

Expand Down
7 changes: 4 additions & 3 deletions drivers/dma/dmaengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ static int dma_chan_get(struct dma_chan *chan)
/* The channel is already in use, update client count */
if (chan->client_count) {
__module_get(owner);
goto out;
chan->client_count++;
return 0;
}

if (!try_module_get(owner))
Expand All @@ -237,11 +238,11 @@ static int dma_chan_get(struct dma_chan *chan)
goto err_out;
}

chan->client_count++;

if (!dma_has_cap(DMA_PRIVATE, chan->device->cap_mask))
balance_ref_count(chan);

out:
chan->client_count++;
return 0;

err_out:
Expand Down
13 changes: 6 additions & 7 deletions drivers/edac/edac_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
static DEFINE_MUTEX(device_ctls_mutex);
static LIST_HEAD(edac_device_list);

/* Default workqueue processing interval on this instance, in msecs */
#define DEFAULT_POLL_INTERVAL 1000

#ifdef CONFIG_EDAC_DEBUG
static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
{
Expand Down Expand Up @@ -389,7 +392,7 @@ static void edac_device_workq_function(struct work_struct *work_req)
* whole one second to save timers firing all over the period
* between integral seconds
*/
if (edac_dev->poll_msec == 1000)
if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL)
queue_delayed_work(edac_workqueue, &edac_dev->work,
round_jiffies_relative(edac_dev->delay));
else
Expand Down Expand Up @@ -427,7 +430,7 @@ void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
* timers firing on sub-second basis, while they are happy
* to fire together on the 1 second exactly
*/
if (edac_dev->poll_msec == 1000)
if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL)
queue_delayed_work(edac_workqueue, &edac_dev->work,
round_jiffies_relative(edac_dev->delay));
else
Expand Down Expand Up @@ -525,11 +528,7 @@ int edac_device_add_device(struct edac_device_ctl_info *edac_dev)
/* This instance is NOW RUNNING */
edac_dev->op_state = OP_RUNNING_POLL;

/*
* enable workq processing on this instance,
* default = 1000 msec
*/
edac_device_workq_setup(edac_dev, edac_dev->poll_msec);
edac_device_workq_setup(edac_dev, edac_dev->poll_msec ?: DEFAULT_POLL_INTERVAL);
} else {
edac_dev->op_state = OP_RUNNING_INTERRUPT;
}
Expand Down
7 changes: 5 additions & 2 deletions drivers/edac/highbank_mc_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ static int highbank_mc_probe(struct platform_device *pdev)
drvdata = mci->pvt_info;
platform_set_drvdata(pdev, mci);

if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL))
return -ENOMEM;
if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL)) {
res = -ENOMEM;
goto free;
}

r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r) {
Expand Down Expand Up @@ -256,6 +258,7 @@ static int highbank_mc_probe(struct platform_device *pdev)
edac_mc_del_mc(&pdev->dev);
err:
devres_release_group(&pdev->dev, NULL);
free:
edac_mc_free(mci);
return res;
}
Expand Down
4 changes: 3 additions & 1 deletion drivers/firewire/core-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,10 @@ static int ioctl_send_response(struct client *client, union ioctl_arg *arg)

r = container_of(resource, struct inbound_transaction_resource,
resource);
if (is_fcp_request(r->request))
if (is_fcp_request(r->request)) {
kfree(r->data);
goto out;
}

if (a->length != fw_get_response_length(r->request)) {
ret = -EINVAL;
Expand Down
7 changes: 4 additions & 3 deletions drivers/firmware/google/gsmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,10 @@ static efi_status_t gsmi_get_variable(efi_char16_t *name,
memcpy(data, gsmi_dev.data_buf->start, *data_size);

/* All variables are have the following attributes */
*attr = EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS;
if (attr)
*attr = EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS;
}

spin_unlock_irqrestore(&gsmi_dev.lock, flags);
Expand Down
8 changes: 4 additions & 4 deletions drivers/gpu/drm/radeon/atombios_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ static int convert_bpc_to_bpp(int bpc)

/***** radeon specific DP functions *****/

int radeon_dp_get_dp_link_config(struct drm_connector *connector,
const u8 dpcd[DP_DPCD_SIZE],
unsigned pix_clock,
unsigned *dp_lanes, unsigned *dp_rate)
static int radeon_dp_get_dp_link_config(struct drm_connector *connector,
const u8 dpcd[DP_DPCD_SIZE],
unsigned pix_clock,
unsigned *dp_lanes, unsigned *dp_rate)
{
int bpp = convert_bpc_to_bpp(radeon_get_monitor_bpc(connector));
static const unsigned link_rates[3] = { 162000, 270000, 540000 };
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/radeon_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -758,10 +758,6 @@ extern u8 radeon_dp_getsinktype(struct radeon_connector *radeon_connector);
extern bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector);
extern int radeon_dp_get_panel_mode(struct drm_encoder *encoder,
struct drm_connector *connector);
extern int radeon_dp_get_dp_link_config(struct drm_connector *connector,
const u8 *dpcd,
unsigned pix_clock,
unsigned *dp_lanes, unsigned *dp_rate);
extern void radeon_dp_set_rx_power_state(struct drm_connector *connector,
u8 power_state);
extern void radeon_dp_aux_init(struct radeon_connector *radeon_connector);
Expand Down
17 changes: 9 additions & 8 deletions drivers/hid/hid-betopff.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ static int betopff_init(struct hid_device *hid)
struct list_head *report_list =
&hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct input_dev *dev;
int field_count = 0;
int error;
int i, j;

Expand All @@ -89,19 +88,21 @@ static int betopff_init(struct hid_device *hid)
* -----------------------------------------
* Do init them with default value.
*/
if (report->maxfield < 4) {
hid_err(hid, "not enough fields in the report: %d\n",
report->maxfield);
return -ENODEV;
}
for (i = 0; i < report->maxfield; i++) {
if (report->field[i]->report_count < 1) {
hid_err(hid, "no values in the field\n");
return -ENODEV;
}
for (j = 0; j < report->field[i]->report_count; j++) {
report->field[i]->value[j] = 0x00;
field_count++;
}
}

if (field_count < 4) {
hid_err(hid, "not enough fields in the report: %d\n",
field_count);
return -ENODEV;
}

betopff = kzalloc(sizeof(*betopff), GFP_KERNEL);
if (!betopff)
return -ENOMEM;
Expand Down
4 changes: 2 additions & 2 deletions drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,8 @@ struct hid_report *hid_validate_values(struct hid_device *hid,
* Validating on id 0 means we should examine the first
* report in the list.
*/
report = list_entry(
hid->report_enum[type].report_list.next,
report = list_first_entry_or_null(
&hid->report_enum[type].report_list,
struct hid_report, list);
} else {
report = hid->report_enum[type].report_id_hash[id];
Expand Down
4 changes: 3 additions & 1 deletion drivers/iio/adc/berlin2-adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,10 @@ static int berlin2_adc_probe(struct platform_device *pdev)
int ret;

indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*priv));
if (!indio_dev)
if (!indio_dev) {
of_node_put(parent_np);
return -ENOMEM;
}

priv = iio_priv(indio_dev);
platform_set_drvdata(pdev, indio_dev);
Expand Down
32 changes: 32 additions & 0 deletions drivers/iio/adc/twl6030-gpadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@
#define TWL6030_GPADCS BIT(1)
#define TWL6030_GPADCR BIT(0)

#define USB_VBUS_CTRL_SET 0x04
#define USB_ID_CTRL_SET 0x06

#define TWL6030_MISC1 0xE4
#define VBUS_MEAS 0x01
#define ID_MEAS 0x01

#define VAC_MEAS 0x04
#define VBAT_MEAS 0x02
#define BB_MEAS 0x01


/**
* struct twl6030_chnl_calib - channel calibration
* @gain: slope coefficient for ideal curve
Expand Down Expand Up @@ -943,6 +955,26 @@ static int twl6030_gpadc_probe(struct platform_device *pdev)
return ret;
}

ret = twl_i2c_write_u8(TWL_MODULE_USB, VBUS_MEAS, USB_VBUS_CTRL_SET);
if (ret < 0) {
dev_err(dev, "failed to wire up inputs\n");
return ret;
}

ret = twl_i2c_write_u8(TWL_MODULE_USB, ID_MEAS, USB_ID_CTRL_SET);
if (ret < 0) {
dev_err(dev, "failed to wire up inputs\n");
return ret;
}

ret = twl_i2c_write_u8(TWL6030_MODULE_ID0,
VBAT_MEAS | BB_MEAS | BB_MEAS,
TWL6030_MISC1);
if (ret < 0) {
dev_err(dev, "failed to wire up inputs\n");
return ret;
}

indio_dev->name = DRIVER_NAME;
indio_dev->dev.parent = dev;
indio_dev->info = &twl6030_gpadc_iio_info;
Expand Down
Loading

0 comments on commit 0b73b23

Please sign in to comment.