Merge 6.1.125 into android14-6.1-lts

Changes in 6.1.125
	ceph: give up on paths longer than PATH_MAX
	bpf, sockmap: Fix race between element replace and close()
	sched/task_stack: fix object_is_on_stack() for KASAN tagged pointers
	jbd2: increase IO priority for writing revoke records
	jbd2: flush filesystem device before updating tail sequence
	dm array: fix releasing a faulty array block twice in dm_array_cursor_end
	dm array: fix unreleased btree blocks on closing a faulty array cursor
	dm array: fix cursor index when skipping across block boundaries
	exfat: fix the infinite loop in exfat_readdir()
	exfat: fix the infinite loop in __exfat_free_cluster()
	scripts/sorttable: fix orc_sort_cmp() to maintain symmetry and transitivity
	ASoC: mediatek: disable buffer pre-allocation
	ieee802154: ca8210: Add missing check for kfifo_alloc() in ca8210_probe()
	net: 802: LLC+SNAP OID:PID lookup on start of skb data
	tcp/dccp: complete lockless accesses to sk->sk_max_ack_backlog
	tcp/dccp: allow a connection when sk_max_ack_backlog is zero
	net_sched: cls_flow: validate TCA_FLOW_RSHIFT attribute
	bnxt_en: Fix possible memory leak when hwrm_req_replace fails
	cxgb4: Avoid removal of uninserted tid
	ice: fix incorrect PHY settings for 100 GB/s
	tls: Fix tls_sw_sendmsg error handling
	Bluetooth: hci_sync: Fix not setting Random Address when required
	tcp: Annotate data-race around sk->sk_mark in tcp_v4_send_reset
	netfilter: nf_tables: imbalance in flowtable binding
	netfilter: conntrack: clamp maximum hashtable size to INT_MAX
	sched: sch_cake: add bounds checks to host bulk flow fairness counts
	net/mlx5: Fix variable not being completed when function returns
	drm/mediatek: stop selecting foreign drivers
	drm/mediatek: Fix YCbCr422 color format issue for DP
	drm/mediatek: Fix mode valid issue for dp
	drm/mediatek: Add return value check when reading DPCD
	ksmbd: fix a missing return value check bug
	afs: Fix the maximum cell name length
	ksmbd: fix unexpectedly changed path in ksmbd_vfs_kern_path_locked
	cpuidle: riscv-sbi: fix device node release in early exit of for_each_possible_cpu
	dm thin: make get_first_thin use rcu-safe list first function
	dm-ebs: don't set the flag DM_TARGET_PASSES_INTEGRITY
	sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy
	sctp: sysctl: rto_min/max: avoid using current->nsproxy
	sctp: sysctl: auth_enable: avoid using current->nsproxy
	sctp: sysctl: udp_port: avoid using current->nsproxy
	sctp: sysctl: plpmtud_probe_interval: avoid using current->nsproxy
	drm/amd/display: Add check for granularity in dml ceil/floor helpers
	thermal: of: fix OF node leak in of_thermal_zone_find()
	riscv: Fix sleeping in invalid context in die()
	ACPI: resource: Add TongFang GM5HG0A to irq1_edge_low_force_override[]
	ACPI: resource: Add Asus Vivobook X1504VAP to irq1_level_low_skip_override[]
	drm/amd/display: increase MAX_SURFACES to the value supported by hw
	dm-verity FEC: Fix RS FEC repair for roots unaligned to block size (take 2)
	bpf: Add MEM_WRITE attribute
	bpf: Fix overloading of MEM_UNINIT's meaning
	USB: serial: option: add MeiG Smart SRM815
	USB: serial: option: add Neoway N723-EA support
	staging: iio: ad9834: Correct phase range check
	staging: iio: ad9832: Correct phase range check
	usb-storage: Add max sectors quirk for Nokia 208
	USB: serial: cp210x: add Phoenix Contact UPS Device
	usb: dwc3: gadget: fix writing NYET threshold
	topology: Keep the cpumask unchanged when printing cpumap
	misc: microchip: pci1xxxx: Resolve kernel panic during GPIO IRQ handling
	misc: microchip: pci1xxxx: Resolve return code mismatch during GPIO set config
	usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null
	usb: dwc3-am62: Disable autosuspend during remove
	USB: usblp: return error when setting unsupported protocol
	USB: core: Disable LPM only for non-suspended ports
	usb: fix reference leak in usb_new_device()
	usb: gadget: f_uac2: Fix incorrect setting of bNumEndpoints
	usb: gadget: f_fs: Remove WARN_ON in functionfs_bind
	iio: pressure: zpa2326: fix information leak in triggered buffer
	iio: dummy: iio_simply_dummy_buffer: fix information leak in triggered buffer
	iio: light: vcnl4035: fix information leak in triggered buffer
	iio: imu: kmx61: fix information leak in triggered buffer
	iio: adc: ti-ads8688: fix information leak in triggered buffer
	iio: gyro: fxas21002c: Fix missing data update in trigger handler
	iio: adc: ti-ads124s08: Use gpiod_set_value_cansleep()
	iio: adc: at91: call input_free_device() on allocated iio_dev
	iio: inkern: call iio_device_put() only on mapped devices
	iio: adc: ad7124: Disable all channels at probe time
	io_uring/eventfd: ensure io_eventfd_signal() defers another RCU period
	ARM: dts: imxrt1050: Fix clocks for mmc
	block, bfq: fix waker_bfqq UAF after bfq_split_bfqq()
	arm64: dts: rockchip: add hevc power domain clock to rk3328
	of: unittest: Add bus address range parsing tests
	of/address: Add support for 3 address cell bus
	of: address: Fix address translation when address-size is greater than 2
	of: address: Remove duplicated functions
	of: address: Store number of bus flag cells rather than bool
	of: address: Preserve the flags portion on 1:1 dma-ranges mapping
	ocfs2: correct return value of ocfs2_local_free_info()
	ocfs2: fix slab-use-after-free due to dangling pointer dqi_priv
	drm: bridge: adv7511: use dev_err_probe in probe function
	drm: adv7511: Fix use-after-free in adv7533_attach_dsi()
	xhci: use pm_ptr() instead of #ifdef for CONFIG_PM conditionals
	Linux 6.1.125

Change-Id: I12a4b35f88b649da1be91de63661fdc15f1015ff
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2025-01-26 19:06:45 +00:00
41 changed files with 296 additions and 96 deletions

View File

@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 6
PATCHLEVEL = 1
SUBLEVEL = 124
SUBLEVEL = 125
EXTRAVERSION =
NAME = Curry Ramen

View File

@@ -87,7 +87,7 @@
reg = <0x402c0000 0x4000>;
interrupts = <110>;
clocks = <&clks IMXRT1050_CLK_IPG_PDOF>,
<&clks IMXRT1050_CLK_OSC>,
<&clks IMXRT1050_CLK_AHB_PODF>,
<&clks IMXRT1050_CLK_USDHC1>;
clock-names = "ipg", "ahb", "per";
bus-width = <4>;

View File

@@ -302,6 +302,7 @@
power-domain@RK3328_PD_HEVC {
reg = <RK3328_PD_HEVC>;
clocks = <&cru SCLK_VENC_CORE>;
#power-domain-cells = <0>;
};
power-domain@RK3328_PD_VIDEO {

View File

@@ -6733,16 +6733,24 @@ static struct bfq_queue *bfq_waker_bfqq(struct bfq_queue *bfqq)
if (new_bfqq == waker_bfqq) {
/*
* If waker_bfqq is in the merge chain, and current
* is the only procress.
* is the only process, waker_bfqq can be freed.
*/
if (bfqq_process_refs(waker_bfqq) == 1)
return NULL;
break;
return waker_bfqq;
}
new_bfqq = new_bfqq->new_bfqq;
}
/*
* If waker_bfqq is not in the merge chain, and it's procress reference
* is 0, waker_bfqq can be freed.
*/
if (bfqq_process_refs(waker_bfqq) == 0)
return NULL;
return waker_bfqq;
}

View File

@@ -27,9 +27,17 @@ static ssize_t name##_read(struct file *file, struct kobject *kobj, \
loff_t off, size_t count) \
{ \
struct device *dev = kobj_to_dev(kobj); \
cpumask_var_t mask; \
ssize_t n; \
\
return cpumap_print_bitmask_to_buf(buf, topology_##mask(dev->id), \
off, count); \
if (!alloc_cpumask_var(&mask, GFP_KERNEL)) \
return -ENOMEM; \
\
cpumask_copy(mask, topology_##mask(dev->id)); \
n = cpumap_print_bitmask_to_buf(buf, mask, off, count); \
free_cpumask_var(mask); \
\
return n; \
} \
\
static ssize_t name##_list_read(struct file *file, struct kobject *kobj, \
@@ -37,9 +45,17 @@ static ssize_t name##_list_read(struct file *file, struct kobject *kobj, \
loff_t off, size_t count) \
{ \
struct device *dev = kobj_to_dev(kobj); \
cpumask_var_t mask; \
ssize_t n; \
\
return cpumap_print_list_to_buf(buf, topology_##mask(dev->id), \
off, count); \
if (!alloc_cpumask_var(&mask, GFP_KERNEL)) \
return -ENOMEM; \
\
cpumask_copy(mask, topology_##mask(dev->id)); \
n = cpumap_print_list_to_buf(buf, mask, off, count); \
free_cpumask_var(mask); \
\
return n; \
}
define_id_show_func(physical_package_id, "%d");

View File

@@ -1225,8 +1225,8 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
ret = adv7511_init_regulators(adv7511);
if (ret) {
dev_err(dev, "failed to init regulators\n");
return ret;
dev_err_probe(dev, ret, "failed to init regulators\n");
goto err_of_node_put;
}
/*
@@ -1347,6 +1347,8 @@ err_i2c_unregister_edid:
i2c_unregister_device(adv7511->i2c_edid);
uninit_regulators:
adv7511_uninit_regulators(adv7511);
err_of_node_put:
of_node_put(adv7511->host_node);
return ret;
}
@@ -1355,6 +1357,8 @@ static void adv7511_remove(struct i2c_client *i2c)
{
struct adv7511 *adv7511 = i2c_get_clientdata(i2c);
of_node_put(adv7511->host_node);
adv7511_uninit_regulators(adv7511);
drm_bridge_remove(&adv7511->bridge);

View File

@@ -146,16 +146,14 @@ int adv7533_attach_dsi(struct adv7511 *adv)
};
host = of_find_mipi_dsi_host_by_node(adv->host_node);
if (!host) {
dev_err(dev, "failed to find dsi host\n");
return -EPROBE_DEFER;
}
if (!host)
return dev_err_probe(dev, -EPROBE_DEFER,
"failed to find dsi host\n");
dsi = devm_mipi_dsi_device_register_full(dev, host, &info);
if (IS_ERR(dsi)) {
dev_err(dev, "failed to create dsi device\n");
return PTR_ERR(dsi);
}
if (IS_ERR(dsi))
return dev_err_probe(dev, PTR_ERR(dsi),
"failed to create dsi device\n");
adv->dsi = dsi;
@@ -165,10 +163,8 @@ int adv7533_attach_dsi(struct adv7511 *adv)
MIPI_DSI_MODE_NO_EOT_PACKET | MIPI_DSI_MODE_VIDEO_HSE;
ret = devm_mipi_dsi_attach(dev, dsi);
if (ret < 0) {
dev_err(dev, "failed to attach dsi to host\n");
return ret;
}
if (ret < 0)
return dev_err_probe(dev, ret, "failed to attach dsi to host\n");
return 0;
}
@@ -188,8 +184,6 @@ int adv7533_parse_dt(struct device_node *np, struct adv7511 *adv)
if (!adv->host_node)
return -ENODEV;
of_node_put(adv->host_node);
adv->use_timing_gen = !of_property_read_bool(np,
"adi,disable-timing-generator");

View File

@@ -931,6 +931,9 @@ static int ad7124_setup(struct ad7124_state *st)
* set all channels to this default value.
*/
ad7124_set_channel_odr(st, i, 10);
/* Disable all channels to prevent unintended conversions. */
ad_sd_write_reg(&st->sd, AD7124_CHANNEL(i), 2, 0);
}
return ret;

View File

@@ -985,7 +985,7 @@ static int at91_ts_register(struct iio_dev *idev,
return ret;
err:
input_free_device(st->ts_input);
input_free_device(input);
return ret;
}

View File

@@ -183,9 +183,9 @@ static int ads124s_reset(struct iio_dev *indio_dev)
struct ads124s_private *priv = iio_priv(indio_dev);
if (priv->reset_gpio) {
gpiod_set_value(priv->reset_gpio, 0);
gpiod_set_value_cansleep(priv->reset_gpio, 0);
udelay(200);
gpiod_set_value(priv->reset_gpio, 1);
gpiod_set_value_cansleep(priv->reset_gpio, 1);
} else {
return ads124s_write_cmd(indio_dev, ADS124S08_CMD_RESET);
}

View File

@@ -382,7 +382,7 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p)
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
/* Ensure naturally aligned timestamp */
u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)] __aligned(8);
u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)] __aligned(8) = { };
int i, j = 0;
for (i = 0; i < indio_dev->masklength; i++) {

View File

@@ -48,7 +48,7 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p)
int i = 0, j;
u16 *data;
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
data = kzalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (!data)
goto done;

View File

@@ -730,14 +730,21 @@ static irqreturn_t fxas21002c_trigger_handler(int irq, void *p)
int ret;
mutex_lock(&data->lock);
ret = regmap_bulk_read(data->regmap, FXAS21002C_REG_OUT_X_MSB,
data->buffer, CHANNEL_SCAN_MAX * sizeof(s16));
ret = fxas21002c_pm_get(data);
if (ret < 0)
goto out_unlock;
ret = regmap_bulk_read(data->regmap, FXAS21002C_REG_OUT_X_MSB,
data->buffer, CHANNEL_SCAN_MAX * sizeof(s16));
if (ret < 0)
goto out_pm_put;
iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
data->timestamp);
out_pm_put:
fxas21002c_pm_put(data);
out_unlock:
mutex_unlock(&data->lock);

View File

@@ -1192,7 +1192,7 @@ static irqreturn_t kmx61_trigger_handler(int irq, void *p)
struct kmx61_data *data = kmx61_get_data(indio_dev);
int bit, ret, i = 0;
u8 base;
s16 buffer[8];
s16 buffer[8] = { };
if (indio_dev == data->acc_indio_dev)
base = KMX61_ACC_XOUT_L;

View File

@@ -513,7 +513,7 @@ struct iio_channel *iio_channel_get_all(struct device *dev)
return chans;
error_free_chans:
for (i = 0; i < nummaps; i++)
for (i = 0; i < mapind; i++)
iio_device_put(chans[i].indio_dev);
kfree(chans);
error_ret:

View File

@@ -105,7 +105,7 @@ static irqreturn_t vcnl4035_trigger_consumer_handler(int irq, void *p)
struct iio_dev *indio_dev = pf->indio_dev;
struct vcnl4035_data *data = iio_priv(indio_dev);
/* Ensure naturally aligned timestamp */
u8 buffer[ALIGN(sizeof(u16), sizeof(s64)) + sizeof(s64)] __aligned(8);
u8 buffer[ALIGN(sizeof(u16), sizeof(s64)) + sizeof(s64)] __aligned(8) = { };
int ret;
ret = regmap_read(data->regmap, VCNL4035_ALS_DATA, (int *)buffer);

View File

@@ -586,6 +586,8 @@ static int zpa2326_fill_sample_buffer(struct iio_dev *indio_dev,
} sample;
int err;
memset(&sample, 0, sizeof(sample));
if (test_bit(0, indio_dev->active_scan_mask)) {
/* Get current pressure from hardware FIFO. */
err = zpa2326_dequeue_pressure(indio_dev, &sample.pressure);

View File

@@ -148,7 +148,7 @@ static int pci1xxxx_gpio_set_config(struct gpio_chip *gpio, unsigned int offset,
pci1xxx_assign_bit(priv->reg_base, OPENDRAIN_OFFSET(offset), (offset % 32), true);
break;
default:
ret = -EOPNOTSUPP;
ret = -ENOTSUPP;
break;
}
spin_unlock_irqrestore(&priv->lock, flags);
@@ -273,7 +273,7 @@ static irqreturn_t pci1xxxx_gpio_irq_handler(int irq, void *dev_id)
writel(BIT(bit), priv->reg_base + INTR_STATUS_OFFSET(gpiobank));
spin_unlock_irqrestore(&priv->lock, flags);
irq = irq_find_mapping(gc->irq.domain, (bit + (gpiobank * 32)));
generic_handle_irq(irq);
handle_nested_irq(irq);
}
}
spin_lock_irqsave(&priv->lock, flags);

View File

@@ -50,7 +50,7 @@ struct of_bus {
u64 (*map)(__be32 *addr, const __be32 *range,
int na, int ns, int pna);
int (*translate)(__be32 *addr, u64 offset, int na);
bool has_flags;
int flag_cells;
unsigned int (*get_flags)(const __be32 *addr);
};
@@ -95,11 +95,43 @@ static int of_bus_default_translate(__be32 *addr, u64 offset, int na)
return 0;
}
static unsigned int of_bus_default_flags_get_flags(const __be32 *addr)
{
return of_read_number(addr, 1);
}
static unsigned int of_bus_default_get_flags(const __be32 *addr)
{
return IORESOURCE_MEM;
}
static u64 of_bus_default_flags_map(__be32 *addr, const __be32 *range, int na,
int ns, int pna)
{
u64 cp, s, da;
/* Check that flags match */
if (*addr != *range)
return OF_BAD_ADDR;
/* Read address values, skipping high cell */
cp = of_read_number(range + 1, na - 1);
s = of_read_number(range + na + pna, ns);
da = of_read_number(addr + 1, na - 1);
pr_debug("default flags map, cp=%llx, s=%llx, da=%llx\n", cp, s, da);
if (da < cp || da >= (cp + s))
return OF_BAD_ADDR;
return da - cp;
}
static int of_bus_default_flags_translate(__be32 *addr, u64 offset, int na)
{
/* Keep "flags" part (high cell) in translated address */
return of_bus_default_translate(addr + 1, offset, na - 1);
}
#ifdef CONFIG_PCI
static unsigned int of_bus_pci_get_flags(const __be32 *addr)
{
@@ -189,10 +221,6 @@ static u64 of_bus_pci_map(__be32 *addr, const __be32 *range, int na, int ns,
return da - cp;
}
static int of_bus_pci_translate(__be32 *addr, u64 offset, int na)
{
return of_bus_default_translate(addr + 1, offset, na - 1);
}
#endif /* CONFIG_PCI */
int of_pci_address_to_resource(struct device_node *dev, int bar,
@@ -302,11 +330,6 @@ static u64 of_bus_isa_map(__be32 *addr, const __be32 *range, int na, int ns,
return da - cp;
}
static int of_bus_isa_translate(__be32 *addr, u64 offset, int na)
{
return of_bus_default_translate(addr + 1, offset, na - 1);
}
static unsigned int of_bus_isa_get_flags(const __be32 *addr)
{
unsigned int flags = 0;
@@ -319,6 +342,11 @@ static unsigned int of_bus_isa_get_flags(const __be32 *addr)
return flags;
}
static int of_bus_default_flags_match(struct device_node *np)
{
return of_bus_n_addr_cells(np) == 3;
}
/*
* Array of bus specific translators
*/
@@ -332,8 +360,8 @@ static struct of_bus of_busses[] = {
.match = of_bus_pci_match,
.count_cells = of_bus_pci_count_cells,
.map = of_bus_pci_map,
.translate = of_bus_pci_translate,
.has_flags = true,
.translate = of_bus_default_flags_translate,
.flag_cells = 1,
.get_flags = of_bus_pci_get_flags,
},
#endif /* CONFIG_PCI */
@@ -344,10 +372,21 @@ static struct of_bus of_busses[] = {
.match = of_bus_isa_match,
.count_cells = of_bus_isa_count_cells,
.map = of_bus_isa_map,
.translate = of_bus_isa_translate,
.has_flags = true,
.translate = of_bus_default_flags_translate,
.flag_cells = 1,
.get_flags = of_bus_isa_get_flags,
},
/* Default with flags cell */
{
.name = "default-flags",
.addresses = "reg",
.match = of_bus_default_flags_match,
.count_cells = of_bus_default_count_cells,
.map = of_bus_default_flags_map,
.translate = of_bus_default_flags_translate,
.flag_cells = 1,
.get_flags = of_bus_default_flags_get_flags,
},
/* Default */
{
.name = "default",
@@ -427,7 +466,8 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
}
if (ranges == NULL || rlen == 0) {
offset = of_read_number(addr, na);
memset(addr, 0, pna * 4);
/* set address to zero, pass flags through */
memset(addr + pbus->flag_cells, 0, (pna - pbus->flag_cells) * 4);
pr_debug("empty ranges; 1:1 translation\n");
goto finish;
}
@@ -755,7 +795,7 @@ struct of_pci_range *of_pci_range_parser_one(struct of_pci_range_parser *parser,
int na = parser->na;
int ns = parser->ns;
int np = parser->pna + na + ns;
int busflag_na = 0;
int busflag_na = parser->bus->flag_cells;
if (!range)
return NULL;
@@ -765,10 +805,6 @@ struct of_pci_range *of_pci_range_parser_one(struct of_pci_range_parser *parser,
range->flags = parser->bus->get_flags(parser->range);
/* A extra cell for resource flags */
if (parser->bus->has_flags)
busflag_na = 1;
range->bus_addr = of_read_number(parser->range + busflag_na, na - busflag_na);
if (parser->dma)

View File

@@ -14,7 +14,7 @@
#size-cells = <1>;
/* ranges here is to make sure we don't use it for
* dma-ranges translation */
ranges = <0x70000000 0x70000000 0x40000000>,
ranges = <0x70000000 0x70000000 0x50000000>,
<0x00000000 0xd0000000 0x20000000>;
dma-ranges = <0x0 0x20000000 0x40000000>;
@@ -43,6 +43,13 @@
<0x42000000 0x0 0xc0000000 0x20000000 0x0 0x10000000>;
};
bus@a0000000 {
#address-cells = <3>;
#size-cells = <2>;
ranges = <0xf00baa 0x0 0x0 0xa0000000 0x0 0x100000>,
<0xf00bee 0x1 0x0 0xb0000000 0x0 0x200000>;
};
};
};
};

View File

@@ -1019,6 +1019,113 @@ static void __init of_unittest_pci_dma_ranges(void)
of_node_put(np);
}
static void __init of_unittest_bus_ranges(void)
{
struct device_node *np;
struct of_range range;
struct of_range_parser parser;
int i = 0;
np = of_find_node_by_path("/testcase-data/address-tests");
if (!np) {
pr_err("missing testcase data\n");
return;
}
if (of_range_parser_init(&parser, np)) {
pr_err("missing ranges property\n");
return;
}
/*
* Get the "ranges" from the device tree
*/
for_each_of_range(&parser, &range) {
unittest(range.flags == IORESOURCE_MEM,
"for_each_of_range wrong flags on node %pOF flags=%x (expected %x)\n",
np, range.flags, IORESOURCE_MEM);
if (!i) {
unittest(range.size == 0x50000000,
"for_each_of_range wrong size on node %pOF size=%llx\n",
np, range.size);
unittest(range.cpu_addr == 0x70000000,
"for_each_of_range wrong CPU addr (%llx) on node %pOF",
range.cpu_addr, np);
unittest(range.bus_addr == 0x70000000,
"for_each_of_range wrong bus addr (%llx) on node %pOF",
range.pci_addr, np);
} else {
unittest(range.size == 0x20000000,
"for_each_of_range wrong size on node %pOF size=%llx\n",
np, range.size);
unittest(range.cpu_addr == 0xd0000000,
"for_each_of_range wrong CPU addr (%llx) on node %pOF",
range.cpu_addr, np);
unittest(range.bus_addr == 0x00000000,
"for_each_of_range wrong bus addr (%llx) on node %pOF",
range.pci_addr, np);
}
i++;
}
of_node_put(np);
}
static void __init of_unittest_bus_3cell_ranges(void)
{
struct device_node *np;
struct of_range range;
struct of_range_parser parser;
int i = 0;
np = of_find_node_by_path("/testcase-data/address-tests/bus@a0000000");
if (!np) {
pr_err("missing testcase data\n");
return;
}
if (of_range_parser_init(&parser, np)) {
pr_err("missing ranges property\n");
return;
}
/*
* Get the "ranges" from the device tree
*/
for_each_of_range(&parser, &range) {
if (!i) {
unittest(range.flags == 0xf00baa,
"for_each_of_range wrong flags on node %pOF flags=%x\n",
np, range.flags);
unittest(range.size == 0x100000,
"for_each_of_range wrong size on node %pOF size=%llx\n",
np, range.size);
unittest(range.cpu_addr == 0xa0000000,
"for_each_of_range wrong CPU addr (%llx) on node %pOF",
range.cpu_addr, np);
unittest(range.bus_addr == 0x0,
"for_each_of_range wrong bus addr (%llx) on node %pOF",
range.pci_addr, np);
} else {
unittest(range.flags == 0xf00bee,
"for_each_of_range wrong flags on node %pOF flags=%x\n",
np, range.flags);
unittest(range.size == 0x200000,
"for_each_of_range wrong size on node %pOF size=%llx\n",
np, range.size);
unittest(range.cpu_addr == 0xb0000000,
"for_each_of_range wrong CPU addr (%llx) on node %pOF",
range.cpu_addr, np);
unittest(range.bus_addr == 0x100000000,
"for_each_of_range wrong bus addr (%llx) on node %pOF",
range.pci_addr, np);
}
i++;
}
of_node_put(np);
}
static void __init of_unittest_parse_interrupts(void)
{
struct device_node *np;
@@ -3521,6 +3628,8 @@ static int __init of_unittest(void)
of_unittest_dma_get_max_cpu_address();
of_unittest_parse_dma_ranges();
of_unittest_pci_dma_ranges();
of_unittest_bus_ranges();
of_unittest_bus_3cell_ranges();
of_unittest_match_node();
of_unittest_platform_populate();
of_unittest_overlay();

View File

@@ -158,7 +158,7 @@ static int ad9832_write_frequency(struct ad9832_state *st,
static int ad9832_write_phase(struct ad9832_state *st,
unsigned long addr, unsigned long phase)
{
if (phase > BIT(AD9832_PHASE_BITS))
if (phase >= BIT(AD9832_PHASE_BITS))
return -EINVAL;
st->phase_data[0] = cpu_to_be16((AD9832_CMD_PHA8BITSW << CMD_SHIFT) |

View File

@@ -131,7 +131,7 @@ static int ad9834_write_frequency(struct ad9834_state *st,
static int ad9834_write_phase(struct ad9834_state *st,
unsigned long addr, unsigned long phase)
{
if (phase > BIT(AD9834_PHASE_BITS))
if (phase >= BIT(AD9834_PHASE_BITS))
return -EINVAL;
st->data = cpu_to_be16(addr | phase);

View File

@@ -1337,11 +1337,12 @@ static int usblp_set_protocol(struct usblp *usblp, int protocol)
if (protocol < USBLP_FIRST_PROTOCOL || protocol > USBLP_LAST_PROTOCOL)
return -EINVAL;
alts = usblp->protocol[protocol].alt_setting;
if (alts < 0)
return -EINVAL;
/* Don't unnecessarily set the interface if there's a single alt. */
if (usblp->intf->num_altsetting > 1) {
alts = usblp->protocol[protocol].alt_setting;
if (alts < 0)
return -EINVAL;
r = usb_set_interface(usblp->dev, usblp->ifnum, alts);
if (r < 0) {
printk(KERN_ERR "usblp: can't set desired altsetting %d on interface %d\n",

View File

@@ -2657,13 +2657,13 @@ int usb_new_device(struct usb_device *udev)
err = sysfs_create_link(&udev->dev.kobj,
&port_dev->dev.kobj, "port");
if (err)
goto fail;
goto out_del_dev;
err = sysfs_create_link(&port_dev->dev.kobj,
&udev->dev.kobj, "device");
if (err) {
sysfs_remove_link(&udev->dev.kobj, "port");
goto fail;
goto out_del_dev;
}
if (!test_and_set_bit(port1, hub->child_usage_bits))
@@ -2675,6 +2675,8 @@ int usb_new_device(struct usb_device *udev)
pm_runtime_put_sync_autosuspend(&udev->dev);
return err;
out_del_dev:
device_del(&udev->dev);
fail:
usb_set_device_state(udev, USB_STATE_NOTATTACHED);
pm_runtime_disable(&udev->dev);

View File

@@ -450,10 +450,11 @@ static int usb_port_runtime_suspend(struct device *dev)
static void usb_port_shutdown(struct device *dev)
{
struct usb_port *port_dev = to_usb_port(dev);
struct usb_device *udev = port_dev->child;
if (port_dev->child) {
usb_disable_usb2_hardware_lpm(port_dev->child);
usb_unlocked_disable_lpm(port_dev->child);
if (udev && !udev->port_is_suspended) {
usb_disable_usb2_hardware_lpm(udev);
usb_unlocked_disable_lpm(udev);
}
}

View File

@@ -448,6 +448,7 @@
#define DWC3_DCTL_TRGTULST_SS_INACT (DWC3_DCTL_TRGTULST(6))
/* These apply for core versions 1.94a and later */
#define DWC3_DCTL_NYET_THRES_MASK (0xf << 20)
#define DWC3_DCTL_NYET_THRES(n) (((n) & 0xf) << 20)
#define DWC3_DCTL_KEEP_CONNECT BIT(19)

View File

@@ -263,6 +263,7 @@ static int dwc3_ti_remove(struct platform_device *pdev)
pm_runtime_put_sync(dev);
pm_runtime_disable(dev);
pm_runtime_dont_use_autosuspend(dev);
pm_runtime_set_suspended(dev);
platform_set_drvdata(pdev, NULL);

View File

@@ -4070,8 +4070,10 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
WARN_ONCE(DWC3_VER_IS_PRIOR(DWC3, 240A) && dwc->has_lpm_erratum,
"LPM Erratum not available on dwc3 revisions < 2.40a\n");
if (dwc->has_lpm_erratum && !DWC3_VER_IS_PRIOR(DWC3, 240A))
if (dwc->has_lpm_erratum && !DWC3_VER_IS_PRIOR(DWC3, 240A)) {
reg &= ~DWC3_DCTL_NYET_THRES_MASK;
reg |= DWC3_DCTL_NYET_THRES(dwc->lpm_nyet_threshold);
}
dwc3_gadget_dctl_write_safe(dwc, reg);
} else {

View File

@@ -1868,7 +1868,7 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
ENTER();
if (WARN_ON(ffs->state != FFS_ACTIVE
if ((ffs->state != FFS_ACTIVE
|| test_and_set_bit(FFS_FL_BOUND, &ffs->flags)))
return -EBADFD;

View File

@@ -1176,6 +1176,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
uac2->as_in_alt = 0;
}
std_ac_if_desc.bNumEndpoints = 0;
if (FUOUT_EN(uac2_opts) || FUIN_EN(uac2_opts)) {
uac2->int_ep = usb_ep_autoconfig(gadget, &fs_ep_int_desc);
if (!uac2->int_ep) {

View File

@@ -1403,6 +1403,10 @@ void gserial_disconnect(struct gserial *gser)
/* REVISIT as above: how best to track this? */
port->port_line_coding = gser->port_line_coding;
/* disable endpoints, aborting down any active I/O */
usb_ep_disable(gser->out);
usb_ep_disable(gser->in);
port->port_usb = NULL;
gser->ioport = NULL;
if (port->port.count > 0) {
@@ -1414,10 +1418,6 @@ void gserial_disconnect(struct gserial *gser)
spin_unlock(&port->port_lock);
spin_unlock_irqrestore(&serial_port_lock, flags);
/* disable endpoints, aborting down any active I/O */
usb_ep_disable(gser->out);
usb_ep_disable(gser->in);
/* finally, free any unused/unusable I/O buffers */
spin_lock_irqsave(&port->port_lock, flags);
if (port->port.count == 0)

View File

@@ -564,7 +564,6 @@ static void xhci_pci_remove(struct pci_dev *dev)
pci_set_power_state(dev, PCI_D3hot);
}
#ifdef CONFIG_PM
/*
* In some Intel xHCI controllers, in order to get D3 working,
* through a vendor specific SSIC CONFIG register at offset 0x883c,
@@ -714,7 +713,6 @@ static void xhci_pci_shutdown(struct usb_hcd *hcd)
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
pci_set_power_state(pdev, PCI_D3hot);
}
#endif /* CONFIG_PM */
/*-------------------------------------------------------------------------*/
@@ -756,21 +754,17 @@ static struct pci_driver xhci_pci_driver = {
/* suspend and resume implemented later */
.shutdown = usb_hcd_pci_shutdown,
#ifdef CONFIG_PM
.driver = {
.pm = &usb_hcd_pci_pm_ops
.pm = pm_ptr(&usb_hcd_pci_pm_ops),
},
#endif
};
static int __init xhci_pci_init(void)
{
xhci_init_driver(&xhci_pci_hc_driver, &xhci_pci_overrides);
#ifdef CONFIG_PM
xhci_pci_hc_driver.pci_suspend = xhci_pci_suspend;
xhci_pci_hc_driver.pci_resume = xhci_pci_resume;
xhci_pci_hc_driver.shutdown = xhci_pci_shutdown;
#endif
return pci_register_driver(&xhci_pci_driver);
}
module_init(xhci_pci_init);

View File

@@ -223,6 +223,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */
{ USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */
{ USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */
{ USB_DEVICE(0x1B93, 0x1013) }, /* Phoenix Contact UPS Device */
{ USB_DEVICE(0x1BA4, 0x0002) }, /* Silicon Labs 358x factory default */
{ USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
{ USB_DEVICE(0x1D6F, 0x0010) }, /* Seluxit ApS RF Dongle */

View File

@@ -621,7 +621,7 @@ static void option_instat_callback(struct urb *urb);
/* MeiG Smart Technology products */
#define MEIGSMART_VENDOR_ID 0x2dee
/* MeiG Smart SRM825L based on Qualcomm 315 */
/* MeiG Smart SRM815/SRM825L based on Qualcomm 315 */
#define MEIGSMART_PRODUCT_SRM825L 0x4d22
/* MeiG Smart SLM320 based on UNISOC UIS8910 */
#define MEIGSMART_PRODUCT_SLM320 0x4d41
@@ -2405,6 +2405,7 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) },
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SLM320, 0xff, 0, 0) },
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SLM770A, 0xff, 0, 0) },
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0, 0) },
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x30) },
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x40) },
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x60) },
@@ -2412,6 +2413,7 @@ static const struct usb_device_id option_ids[] = {
.driver_info = NCTRL(1) },
{ USB_DEVICE_INTERFACE_CLASS(0x1bbb, 0x0640, 0xff), /* TCL IK512 ECM */
.driver_info = NCTRL(3) },
{ USB_DEVICE_INTERFACE_CLASS(0x2949, 0x8700, 0xff) }, /* Neoway N723-EA */
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, option_ids);

View File

@@ -255,6 +255,13 @@ UNUSUAL_DEV( 0x0421, 0x06aa, 0x1110, 0x1110,
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_MAX_SECTORS_64 ),
/* Added by Lubomir Rintel <lkundrak@v3.sk>, a very fine chap */
UNUSUAL_DEV( 0x0421, 0x06c2, 0x0000, 0x0406,
"Nokia",
"Nokia 208",
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_MAX_SECTORS_64 ),
#ifdef NO_SDDR09
UNUSUAL_DEV( 0x0436, 0x0005, 0x0100, 0x0100,
"Microtech",

View File

@@ -881,7 +881,7 @@ static int ocfs2_get_next_id(struct super_block *sb, struct kqid *qid)
int status = 0;
trace_ocfs2_get_next_id(from_kqid(&init_user_ns, *qid), type);
if (!sb_has_quota_loaded(sb, type)) {
if (!sb_has_quota_active(sb, type)) {
status = -ESRCH;
goto out;
}

View File

@@ -815,7 +815,7 @@ static int ocfs2_local_free_info(struct super_block *sb, int type)
struct ocfs2_quota_chunk *chunk;
struct ocfs2_local_disk_chunk *dchunk;
int mark_clean = 1, len;
int status;
int status = 0;
iput(oinfo->dqi_gqinode);
ocfs2_simple_drop_lockres(OCFS2_SB(sb), &oinfo->dqi_gqlock);
@@ -857,17 +857,15 @@ static int ocfs2_local_free_info(struct super_block *sb, int type)
oinfo->dqi_libh,
olq_update_info,
info);
if (status < 0) {
if (status < 0)
mlog_errno(status);
goto out;
}
out:
ocfs2_inode_unlock(sb_dqopt(sb)->files[type], 1);
brelse(oinfo->dqi_libh);
brelse(oinfo->dqi_lqi_bh);
kfree(oinfo);
return 0;
info->dqi_priv = NULL;
return status;
}
static void olq_set_dquot(struct buffer_head *bh, void *private)

View File

@@ -713,13 +713,12 @@ struct usb_device {
unsigned long active_duration;
#ifdef CONFIG_PM
unsigned long connect_time;
unsigned do_remote_wakeup:1;
unsigned reset_resume:1;
unsigned port_is_suspended:1;
#endif
struct wusb_dev *wusb_dev;
int slot_id;
struct usb2_lpm_parameters l1_params;

View File

@@ -496,9 +496,7 @@ extern void usb_hcd_pci_shutdown(struct pci_dev *dev);
extern int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *dev);
#ifdef CONFIG_PM
extern const struct dev_pm_ops usb_hcd_pci_pm_ops;
#endif
#endif /* CONFIG_USB_PCI */
/* pci-ish (pdev null is ok) buffer alloc/mapping support */

View File

@@ -479,6 +479,13 @@ static __cold void io_queue_deferred(struct io_ring_ctx *ctx)
}
}
static void io_eventfd_free(struct rcu_head *rcu)
{
struct io_ev_fd *ev_fd = container_of(rcu, struct io_ev_fd, rcu);
eventfd_ctx_put(ev_fd->cq_ev_fd);
kfree(ev_fd);
}
static void io_eventfd_ops(struct rcu_head *rcu)
{
@@ -492,10 +499,8 @@ static void io_eventfd_ops(struct rcu_head *rcu)
* ordering in a race but if references are 0 we know we have to free
* it regardless.
*/
if (atomic_dec_and_test(&ev_fd->refs)) {
eventfd_ctx_put(ev_fd->cq_ev_fd);
kfree(ev_fd);
}
if (atomic_dec_and_test(&ev_fd->refs))
call_rcu(&ev_fd->rcu, io_eventfd_free);
}
static void io_eventfd_signal(struct io_ring_ctx *ctx)