Merge 9c839c682f ("serial: sh-sci: Increment the runtime usage counter for the earlycon device") into android12-5.10-lts
Steps on the way to 5.10.239 Change-Id: I432ea34b24df27fdd91998cd2ec0c8c2c51245a1 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -145,6 +145,8 @@
|
||||
/* MDIO */
|
||||
AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLUP | SLEWCTRL_FAST, MUX_MODE0)
|
||||
AM33XX_PADCONF(AM335X_PIN_MDC, PIN_OUTPUT_PULLUP, MUX_MODE0)
|
||||
/* Added to support GPIO controlled PHY reset */
|
||||
AM33XX_PADCONF(AM335X_PIN_UART0_CTSN, PIN_OUTPUT_PULLUP, MUX_MODE7)
|
||||
>;
|
||||
};
|
||||
|
||||
@@ -153,6 +155,8 @@
|
||||
/* MDIO reset value */
|
||||
AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLDOWN, MUX_MODE7)
|
||||
AM33XX_PADCONF(AM335X_PIN_MDC, PIN_INPUT_PULLDOWN, MUX_MODE7)
|
||||
/* Added to support GPIO controlled PHY reset */
|
||||
AM33XX_PADCONF(AM335X_PIN_UART0_CTSN, PIN_INPUT_PULLDOWN, MUX_MODE7)
|
||||
>;
|
||||
};
|
||||
|
||||
@@ -374,6 +378,10 @@
|
||||
|
||||
ethphy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
/* Support GPIO reset on revision C3 boards */
|
||||
reset-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
|
||||
reset-assert-us = <300>;
|
||||
reset-deassert-us = <50000>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -288,7 +288,9 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
|
||||
struct sk_buff *new_skb;
|
||||
int result = 0;
|
||||
|
||||
if (!skb->len) return 0;
|
||||
if (skb->len < sizeof(struct atmtcp_hdr))
|
||||
goto done;
|
||||
|
||||
dev = vcc->dev_data;
|
||||
hdr = (struct atmtcp_hdr *) skb->data;
|
||||
if (hdr->length == ATMTCP_HDR_MAGIC) {
|
||||
|
||||
@@ -198,6 +198,7 @@ aoedev_downdev(struct aoedev *d)
|
||||
{
|
||||
struct aoetgt *t, **tt, **te;
|
||||
struct list_head *head, *pos, *nx;
|
||||
struct request *rq, *rqnext;
|
||||
int i;
|
||||
|
||||
d->flags &= ~DEVFL_UP;
|
||||
@@ -223,6 +224,13 @@ aoedev_downdev(struct aoedev *d)
|
||||
/* clean out the in-process request (if any) */
|
||||
aoe_failip(d);
|
||||
|
||||
/* clean out any queued block requests */
|
||||
list_for_each_entry_safe(rq, rqnext, &d->rq_list, queuelist) {
|
||||
list_del_init(&rq->queuelist);
|
||||
blk_mq_start_request(rq);
|
||||
blk_mq_end_request(rq, BLK_STS_IOERR);
|
||||
}
|
||||
|
||||
/* fast fail all pending I/O */
|
||||
if (d->blkq) {
|
||||
/* UP is cleared, freeze+quiesce to insure all are errored */
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "nouveau_connector.h"
|
||||
|
||||
static struct ida bl_ida;
|
||||
#define BL_NAME_SIZE 15 // 12 for name + 2 for digits + 1 for '\0'
|
||||
#define BL_NAME_SIZE 24 // 12 for name + 11 for digits + 1 for '\0'
|
||||
|
||||
struct nouveau_backlight {
|
||||
struct backlight_device *dev;
|
||||
|
||||
@@ -41,6 +41,14 @@ struct temp_sensor_2 {
|
||||
u8 value;
|
||||
} __packed;
|
||||
|
||||
struct temp_sensor_10 {
|
||||
u32 sensor_id;
|
||||
u8 fru_type;
|
||||
u8 value;
|
||||
u8 throttle;
|
||||
u8 reserved;
|
||||
} __packed;
|
||||
|
||||
struct freq_sensor_1 {
|
||||
u16 sensor_id;
|
||||
u16 value;
|
||||
@@ -307,6 +315,60 @@ static ssize_t occ_show_temp_2(struct device *dev,
|
||||
return snprintf(buf, PAGE_SIZE - 1, "%u\n", val);
|
||||
}
|
||||
|
||||
static ssize_t occ_show_temp_10(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
int rc;
|
||||
u32 val = 0;
|
||||
struct temp_sensor_10 *temp;
|
||||
struct occ *occ = dev_get_drvdata(dev);
|
||||
struct occ_sensors *sensors = &occ->sensors;
|
||||
struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
|
||||
|
||||
rc = occ_update_response(occ);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
temp = ((struct temp_sensor_10 *)sensors->temp.data) + sattr->index;
|
||||
|
||||
switch (sattr->nr) {
|
||||
case 0:
|
||||
val = get_unaligned_be32(&temp->sensor_id);
|
||||
break;
|
||||
case 1:
|
||||
val = temp->value;
|
||||
if (val == OCC_TEMP_SENSOR_FAULT)
|
||||
return -EREMOTEIO;
|
||||
|
||||
/*
|
||||
* VRM doesn't return temperature, only alarm bit. This
|
||||
* attribute maps to tempX_alarm instead of tempX_input for
|
||||
* VRM
|
||||
*/
|
||||
if (temp->fru_type != OCC_FRU_TYPE_VRM) {
|
||||
/* sensor not ready */
|
||||
if (val == 0)
|
||||
return -EAGAIN;
|
||||
|
||||
val *= 1000;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
val = temp->fru_type;
|
||||
break;
|
||||
case 3:
|
||||
val = temp->value == OCC_TEMP_SENSOR_FAULT;
|
||||
break;
|
||||
case 4:
|
||||
val = temp->throttle * 1000;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return snprintf(buf, PAGE_SIZE - 1, "%u\n", val);
|
||||
}
|
||||
|
||||
static ssize_t occ_show_freq_1(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
@@ -406,12 +468,10 @@ static ssize_t occ_show_power_1(struct device *dev,
|
||||
return snprintf(buf, PAGE_SIZE - 1, "%llu\n", val);
|
||||
}
|
||||
|
||||
static u64 occ_get_powr_avg(u64 *accum, u32 *samples)
|
||||
static u64 occ_get_powr_avg(u64 accum, u32 samples)
|
||||
{
|
||||
u64 divisor = get_unaligned_be32(samples);
|
||||
|
||||
return (divisor == 0) ? 0 :
|
||||
div64_u64(get_unaligned_be64(accum) * 1000000ULL, divisor);
|
||||
return (samples == 0) ? 0 :
|
||||
mul_u64_u32_div(accum, 1000000UL, samples);
|
||||
}
|
||||
|
||||
static ssize_t occ_show_power_2(struct device *dev,
|
||||
@@ -436,8 +496,8 @@ static ssize_t occ_show_power_2(struct device *dev,
|
||||
get_unaligned_be32(&power->sensor_id),
|
||||
power->function_id, power->apss_channel);
|
||||
case 1:
|
||||
val = occ_get_powr_avg(&power->accumulator,
|
||||
&power->update_tag);
|
||||
val = occ_get_powr_avg(get_unaligned_be64(&power->accumulator),
|
||||
get_unaligned_be32(&power->update_tag));
|
||||
break;
|
||||
case 2:
|
||||
val = (u64)get_unaligned_be32(&power->update_tag) *
|
||||
@@ -474,8 +534,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
|
||||
return snprintf(buf, PAGE_SIZE - 1, "%u_system\n",
|
||||
get_unaligned_be32(&power->sensor_id));
|
||||
case 1:
|
||||
val = occ_get_powr_avg(&power->system.accumulator,
|
||||
&power->system.update_tag);
|
||||
val = occ_get_powr_avg(get_unaligned_be64(&power->system.accumulator),
|
||||
get_unaligned_be32(&power->system.update_tag));
|
||||
break;
|
||||
case 2:
|
||||
val = (u64)get_unaligned_be32(&power->system.update_tag) *
|
||||
@@ -488,8 +548,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
|
||||
return snprintf(buf, PAGE_SIZE - 1, "%u_proc\n",
|
||||
get_unaligned_be32(&power->sensor_id));
|
||||
case 5:
|
||||
val = occ_get_powr_avg(&power->proc.accumulator,
|
||||
&power->proc.update_tag);
|
||||
val = occ_get_powr_avg(get_unaligned_be64(&power->proc.accumulator),
|
||||
get_unaligned_be32(&power->proc.update_tag));
|
||||
break;
|
||||
case 6:
|
||||
val = (u64)get_unaligned_be32(&power->proc.update_tag) *
|
||||
@@ -502,8 +562,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
|
||||
return snprintf(buf, PAGE_SIZE - 1, "%u_vdd\n",
|
||||
get_unaligned_be32(&power->sensor_id));
|
||||
case 9:
|
||||
val = occ_get_powr_avg(&power->vdd.accumulator,
|
||||
&power->vdd.update_tag);
|
||||
val = occ_get_powr_avg(get_unaligned_be64(&power->vdd.accumulator),
|
||||
get_unaligned_be32(&power->vdd.update_tag));
|
||||
break;
|
||||
case 10:
|
||||
val = (u64)get_unaligned_be32(&power->vdd.update_tag) *
|
||||
@@ -516,8 +576,8 @@ static ssize_t occ_show_power_a0(struct device *dev,
|
||||
return snprintf(buf, PAGE_SIZE - 1, "%u_vdn\n",
|
||||
get_unaligned_be32(&power->sensor_id));
|
||||
case 13:
|
||||
val = occ_get_powr_avg(&power->vdn.accumulator,
|
||||
&power->vdn.update_tag);
|
||||
val = occ_get_powr_avg(get_unaligned_be64(&power->vdn.accumulator),
|
||||
get_unaligned_be32(&power->vdn.update_tag));
|
||||
break;
|
||||
case 14:
|
||||
val = (u64)get_unaligned_be32(&power->vdn.update_tag) *
|
||||
@@ -623,6 +683,9 @@ static ssize_t occ_show_caps_3(struct device *dev,
|
||||
case 7:
|
||||
val = caps->user_source;
|
||||
break;
|
||||
case 8:
|
||||
val = get_unaligned_be16(&caps->soft_min) * 1000000ULL;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -694,28 +757,29 @@ static ssize_t occ_show_extended(struct device *dev,
|
||||
}
|
||||
|
||||
/*
|
||||
* Some helper macros to make it easier to define an occ_attribute. Since these
|
||||
* are dynamically allocated, we shouldn't use the existing kernel macros which
|
||||
* A helper to make it easier to define an occ_attribute. Since these
|
||||
* are dynamically allocated, we cannot use the existing kernel macros which
|
||||
* stringify the name argument.
|
||||
*/
|
||||
#define ATTR_OCC(_name, _mode, _show, _store) { \
|
||||
.attr = { \
|
||||
.name = _name, \
|
||||
.mode = VERIFY_OCTAL_PERMISSIONS(_mode), \
|
||||
}, \
|
||||
.show = _show, \
|
||||
.store = _store, \
|
||||
}
|
||||
static void occ_init_attribute(struct occ_attribute *attr, int mode,
|
||||
ssize_t (*show)(struct device *dev, struct device_attribute *attr, char *buf),
|
||||
ssize_t (*store)(struct device *dev, struct device_attribute *attr,
|
||||
const char *buf, size_t count),
|
||||
int nr, int index, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
#define SENSOR_ATTR_OCC(_name, _mode, _show, _store, _nr, _index) { \
|
||||
.dev_attr = ATTR_OCC(_name, _mode, _show, _store), \
|
||||
.index = _index, \
|
||||
.nr = _nr, \
|
||||
}
|
||||
va_start(args, fmt);
|
||||
vsnprintf(attr->name, sizeof(attr->name), fmt, args);
|
||||
va_end(args);
|
||||
|
||||
#define OCC_INIT_ATTR(_name, _mode, _show, _store, _nr, _index) \
|
||||
((struct sensor_device_attribute_2) \
|
||||
SENSOR_ATTR_OCC(_name, _mode, _show, _store, _nr, _index))
|
||||
attr->sensor.dev_attr.attr.name = attr->name;
|
||||
attr->sensor.dev_attr.attr.mode = mode;
|
||||
attr->sensor.dev_attr.show = show;
|
||||
attr->sensor.dev_attr.store = store;
|
||||
attr->sensor.index = index;
|
||||
attr->sensor.nr = nr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate and instatiate sensor_device_attribute_2s. It's most efficient to
|
||||
@@ -745,6 +809,10 @@ static int occ_setup_sensor_attrs(struct occ *occ)
|
||||
num_attrs += (sensors->temp.num_sensors * 4);
|
||||
show_temp = occ_show_temp_2;
|
||||
break;
|
||||
case 0x10:
|
||||
num_attrs += (sensors->temp.num_sensors * 5);
|
||||
show_temp = occ_show_temp_10;
|
||||
break;
|
||||
default:
|
||||
sensors->temp.num_sensors = 0;
|
||||
}
|
||||
@@ -779,12 +847,13 @@ static int occ_setup_sensor_attrs(struct occ *occ)
|
||||
case 1:
|
||||
num_attrs += (sensors->caps.num_sensors * 7);
|
||||
break;
|
||||
case 3:
|
||||
show_caps = occ_show_caps_3;
|
||||
fallthrough;
|
||||
case 2:
|
||||
num_attrs += (sensors->caps.num_sensors * 8);
|
||||
break;
|
||||
case 3:
|
||||
show_caps = occ_show_caps_3;
|
||||
num_attrs += (sensors->caps.num_sensors * 9);
|
||||
break;
|
||||
default:
|
||||
sensors->caps.num_sensors = 0;
|
||||
}
|
||||
@@ -797,14 +866,15 @@ static int occ_setup_sensor_attrs(struct occ *occ)
|
||||
sensors->extended.num_sensors = 0;
|
||||
}
|
||||
|
||||
occ->attrs = devm_kzalloc(dev, sizeof(*occ->attrs) * num_attrs,
|
||||
occ->attrs = devm_kcalloc(dev, num_attrs, sizeof(*occ->attrs),
|
||||
GFP_KERNEL);
|
||||
if (!occ->attrs)
|
||||
return -ENOMEM;
|
||||
|
||||
/* null-terminated list */
|
||||
occ->group.attrs = devm_kzalloc(dev, sizeof(*occ->group.attrs) *
|
||||
num_attrs + 1, GFP_KERNEL);
|
||||
occ->group.attrs = devm_kcalloc(dev, num_attrs + 1,
|
||||
sizeof(*occ->group.attrs),
|
||||
GFP_KERNEL);
|
||||
if (!occ->group.attrs)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -814,50 +884,47 @@ static int occ_setup_sensor_attrs(struct occ *occ)
|
||||
s = i + 1;
|
||||
temp = ((struct temp_sensor_2 *)sensors->temp.data) + i;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name), "temp%d_label", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444, show_temp, NULL,
|
||||
0, i);
|
||||
occ_init_attribute(attr, 0444, show_temp, NULL,
|
||||
0, i, "temp%d_label", s);
|
||||
attr++;
|
||||
|
||||
if (sensors->temp.version > 1 &&
|
||||
temp->fru_type == OCC_FRU_TYPE_VRM) {
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"temp%d_alarm", s);
|
||||
occ_init_attribute(attr, 0444, show_temp, NULL,
|
||||
1, i, "temp%d_alarm", s);
|
||||
} else {
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"temp%d_input", s);
|
||||
occ_init_attribute(attr, 0444, show_temp, NULL,
|
||||
1, i, "temp%d_input", s);
|
||||
}
|
||||
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444, show_temp, NULL,
|
||||
1, i);
|
||||
attr++;
|
||||
|
||||
if (sensors->temp.version > 1) {
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"temp%d_fru_type", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
show_temp, NULL, 2, i);
|
||||
occ_init_attribute(attr, 0444, show_temp, NULL,
|
||||
2, i, "temp%d_fru_type", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"temp%d_fault", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
show_temp, NULL, 3, i);
|
||||
occ_init_attribute(attr, 0444, show_temp, NULL,
|
||||
3, i, "temp%d_fault", s);
|
||||
attr++;
|
||||
|
||||
if (sensors->temp.version == 0x10) {
|
||||
occ_init_attribute(attr, 0444, show_temp, NULL,
|
||||
4, i, "temp%d_max", s);
|
||||
attr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < sensors->freq.num_sensors; ++i) {
|
||||
s = i + 1;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name), "freq%d_label", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444, show_freq, NULL,
|
||||
0, i);
|
||||
occ_init_attribute(attr, 0444, show_freq, NULL,
|
||||
0, i, "freq%d_label", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name), "freq%d_input", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444, show_freq, NULL,
|
||||
1, i);
|
||||
occ_init_attribute(attr, 0444, show_freq, NULL,
|
||||
1, i, "freq%d_input", s);
|
||||
attr++;
|
||||
}
|
||||
|
||||
@@ -873,32 +940,24 @@ static int occ_setup_sensor_attrs(struct occ *occ)
|
||||
s = (i * 4) + 1;
|
||||
|
||||
for (j = 0; j < 4; ++j) {
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"power%d_label", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
show_power, NULL,
|
||||
nr++, i);
|
||||
occ_init_attribute(attr, 0444, show_power,
|
||||
NULL, nr++, i,
|
||||
"power%d_label", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"power%d_average", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
show_power, NULL,
|
||||
nr++, i);
|
||||
occ_init_attribute(attr, 0444, show_power,
|
||||
NULL, nr++, i,
|
||||
"power%d_average", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"power%d_average_interval", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
show_power, NULL,
|
||||
nr++, i);
|
||||
occ_init_attribute(attr, 0444, show_power,
|
||||
NULL, nr++, i,
|
||||
"power%d_average_interval", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"power%d_input", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
show_power, NULL,
|
||||
nr++, i);
|
||||
occ_init_attribute(attr, 0444, show_power,
|
||||
NULL, nr++, i,
|
||||
"power%d_input", s);
|
||||
attr++;
|
||||
|
||||
s++;
|
||||
@@ -910,28 +969,20 @@ static int occ_setup_sensor_attrs(struct occ *occ)
|
||||
for (i = 0; i < sensors->power.num_sensors; ++i) {
|
||||
s = i + 1;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"power%d_label", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
show_power, NULL, 0, i);
|
||||
occ_init_attribute(attr, 0444, show_power, NULL,
|
||||
0, i, "power%d_label", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"power%d_average", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
show_power, NULL, 1, i);
|
||||
occ_init_attribute(attr, 0444, show_power, NULL,
|
||||
1, i, "power%d_average", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"power%d_average_interval", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
show_power, NULL, 2, i);
|
||||
occ_init_attribute(attr, 0444, show_power, NULL,
|
||||
2, i, "power%d_average_interval", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"power%d_input", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
show_power, NULL, 3, i);
|
||||
occ_init_attribute(attr, 0444, show_power, NULL,
|
||||
3, i, "power%d_input", s);
|
||||
attr++;
|
||||
}
|
||||
|
||||
@@ -939,68 +990,61 @@ static int occ_setup_sensor_attrs(struct occ *occ)
|
||||
}
|
||||
|
||||
if (sensors->caps.num_sensors >= 1) {
|
||||
snprintf(attr->name, sizeof(attr->name), "power%d_label", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444, show_caps, NULL,
|
||||
0, 0);
|
||||
occ_init_attribute(attr, 0444, show_caps, NULL,
|
||||
0, 0, "power%d_label", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name), "power%d_cap", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444, show_caps, NULL,
|
||||
1, 0);
|
||||
occ_init_attribute(attr, 0444, show_caps, NULL,
|
||||
1, 0, "power%d_cap", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name), "power%d_input", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444, show_caps, NULL,
|
||||
2, 0);
|
||||
occ_init_attribute(attr, 0444, show_caps, NULL,
|
||||
2, 0, "power%d_input", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"power%d_cap_not_redundant", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444, show_caps, NULL,
|
||||
3, 0);
|
||||
occ_init_attribute(attr, 0444, show_caps, NULL,
|
||||
3, 0, "power%d_cap_not_redundant", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name), "power%d_cap_max", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444, show_caps, NULL,
|
||||
4, 0);
|
||||
occ_init_attribute(attr, 0444, show_caps, NULL,
|
||||
4, 0, "power%d_cap_max", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name), "power%d_cap_min", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444, show_caps, NULL,
|
||||
5, 0);
|
||||
occ_init_attribute(attr, 0444, show_caps, NULL,
|
||||
5, 0, "power%d_cap_min", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name), "power%d_cap_user",
|
||||
s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0644, show_caps,
|
||||
occ_store_caps_user, 6, 0);
|
||||
occ_init_attribute(attr, 0644, show_caps, occ_store_caps_user,
|
||||
6, 0, "power%d_cap_user", s);
|
||||
attr++;
|
||||
|
||||
if (sensors->caps.version > 1) {
|
||||
snprintf(attr->name, sizeof(attr->name),
|
||||
"power%d_cap_user_source", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
show_caps, NULL, 7, 0);
|
||||
occ_init_attribute(attr, 0444, show_caps, NULL,
|
||||
7, 0, "power%d_cap_user_source", s);
|
||||
attr++;
|
||||
|
||||
if (sensors->caps.version > 2) {
|
||||
occ_init_attribute(attr, 0444, show_caps, NULL,
|
||||
8, 0,
|
||||
"power%d_cap_min_soft", s);
|
||||
attr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < sensors->extended.num_sensors; ++i) {
|
||||
s = i + 1;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name), "extn%d_label", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
occ_show_extended, NULL, 0, i);
|
||||
occ_init_attribute(attr, 0444, occ_show_extended, NULL,
|
||||
0, i, "extn%d_label", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name), "extn%d_flags", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
occ_show_extended, NULL, 1, i);
|
||||
occ_init_attribute(attr, 0444, occ_show_extended, NULL,
|
||||
1, i, "extn%d_flags", s);
|
||||
attr++;
|
||||
|
||||
snprintf(attr->name, sizeof(attr->name), "extn%d_input", s);
|
||||
attr->sensor = OCC_INIT_ATTR(attr->name, 0444,
|
||||
occ_show_extended, NULL, 2, i);
|
||||
occ_init_attribute(attr, 0444, occ_show_extended, NULL,
|
||||
2, i, "extn%d_input", s);
|
||||
attr++;
|
||||
}
|
||||
|
||||
|
||||
@@ -376,6 +376,50 @@ ice_arfs_is_perfect_flow_set(struct ice_hw *hw, __be16 l3_proto, u8 l4_proto)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_arfs_cmp - Check if aRFS filter matches this flow.
|
||||
* @fltr_info: filter info of the saved ARFS entry.
|
||||
* @fk: flow dissector keys.
|
||||
* @n_proto: One of htons(ETH_P_IP) or htons(ETH_P_IPV6).
|
||||
* @ip_proto: One of IPPROTO_TCP or IPPROTO_UDP.
|
||||
*
|
||||
* Since this function assumes limited values for n_proto and ip_proto, it
|
||||
* is meant to be called only from ice_rx_flow_steer().
|
||||
*
|
||||
* Return:
|
||||
* * true - fltr_info refers to the same flow as fk.
|
||||
* * false - fltr_info and fk refer to different flows.
|
||||
*/
|
||||
static bool
|
||||
ice_arfs_cmp(const struct ice_fdir_fltr *fltr_info, const struct flow_keys *fk,
|
||||
__be16 n_proto, u8 ip_proto)
|
||||
{
|
||||
/* Determine if the filter is for IPv4 or IPv6 based on flow_type,
|
||||
* which is one of ICE_FLTR_PTYPE_NONF_IPV{4,6}_{TCP,UDP}.
|
||||
*/
|
||||
bool is_v4 = fltr_info->flow_type == ICE_FLTR_PTYPE_NONF_IPV4_TCP ||
|
||||
fltr_info->flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP;
|
||||
|
||||
/* Following checks are arranged in the quickest and most discriminative
|
||||
* fields first for early failure.
|
||||
*/
|
||||
if (is_v4)
|
||||
return n_proto == htons(ETH_P_IP) &&
|
||||
fltr_info->ip.v4.src_port == fk->ports.src &&
|
||||
fltr_info->ip.v4.dst_port == fk->ports.dst &&
|
||||
fltr_info->ip.v4.src_ip == fk->addrs.v4addrs.src &&
|
||||
fltr_info->ip.v4.dst_ip == fk->addrs.v4addrs.dst &&
|
||||
fltr_info->ip.v4.proto == ip_proto;
|
||||
|
||||
return fltr_info->ip.v6.src_port == fk->ports.src &&
|
||||
fltr_info->ip.v6.dst_port == fk->ports.dst &&
|
||||
fltr_info->ip.v6.proto == ip_proto &&
|
||||
!memcmp(&fltr_info->ip.v6.src_ip, &fk->addrs.v6addrs.src,
|
||||
sizeof(struct in6_addr)) &&
|
||||
!memcmp(&fltr_info->ip.v6.dst_ip, &fk->addrs.v6addrs.dst,
|
||||
sizeof(struct in6_addr));
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_rx_flow_steer - steer the Rx flow to where application is being run
|
||||
* @netdev: ptr to the netdev being adjusted
|
||||
@@ -447,6 +491,10 @@ ice_rx_flow_steer(struct net_device *netdev, const struct sk_buff *skb,
|
||||
continue;
|
||||
|
||||
fltr_info = &arfs_entry->fltr_info;
|
||||
|
||||
if (!ice_arfs_cmp(fltr_info, &fk, n_proto, ip_proto))
|
||||
continue;
|
||||
|
||||
ret = fltr_info->fltr_id;
|
||||
|
||||
if (fltr_info->q_index == rxq_idx ||
|
||||
|
||||
@@ -438,14 +438,21 @@ static void carl9170_usb_rx_complete(struct urb *urb)
|
||||
|
||||
if (atomic_read(&ar->rx_anch_urbs) == 0) {
|
||||
/*
|
||||
* The system is too slow to cope with
|
||||
* the enormous workload. We have simply
|
||||
* run out of active rx urbs and this
|
||||
* unfortunately leads to an unpredictable
|
||||
* device.
|
||||
* At this point, either the system is too slow to
|
||||
* cope with the enormous workload (so we have simply
|
||||
* run out of active rx urbs and this unfortunately
|
||||
* leads to an unpredictable device), or the device
|
||||
* is not fully functional after an unsuccessful
|
||||
* firmware loading attempts (so it doesn't pass
|
||||
* ieee80211_register_hw() and there is no internal
|
||||
* workqueue at all).
|
||||
*/
|
||||
|
||||
ieee80211_queue_work(ar->hw, &ar->ping_work);
|
||||
if (ar->registered)
|
||||
ieee80211_queue_work(ar->hw, &ar->ping_work);
|
||||
else
|
||||
pr_warn_once("device %s is not registered\n",
|
||||
dev_name(&ar->udev->dev));
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
|
||||
@@ -3358,6 +3358,22 @@ static int sci_probe_single(struct platform_device *dev,
|
||||
}
|
||||
|
||||
if (sci_uart_earlycon && sci_ports[0].port.mapbase == sci_res->start) {
|
||||
/*
|
||||
* In case:
|
||||
* - this is the earlycon port (mapped on index 0 in sci_ports[]) and
|
||||
* - it now maps to an alias other than zero and
|
||||
* - the earlycon is still alive (e.g., "earlycon keep_bootcon" is
|
||||
* available in bootargs)
|
||||
*
|
||||
* we need to avoid disabling clocks and PM domains through the runtime
|
||||
* PM APIs called in __device_attach(). For this, increment the runtime
|
||||
* PM reference counter (the clocks and PM domains were already enabled
|
||||
* by the bootloader). Otherwise the earlycon may access the HW when it
|
||||
* has no clocks enabled leading to failures (infinite loop in
|
||||
* sci_poll_put_char()).
|
||||
*/
|
||||
pm_runtime_get_noresume(&dev->dev);
|
||||
|
||||
/*
|
||||
* Skip cleanup the sci_port[0] in early_console_exit(), this
|
||||
* port is the same as the earlycon one.
|
||||
|
||||
@@ -235,24 +235,6 @@ DEFINE_EVENT(erofs__map_blocks_exit, z_erofs_map_blocks_iter_exit,
|
||||
TP_ARGS(inode, map, flags, ret)
|
||||
);
|
||||
|
||||
TRACE_EVENT(erofs_destroy_inode,
|
||||
TP_PROTO(struct inode *inode),
|
||||
|
||||
TP_ARGS(inode),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field( dev_t, dev )
|
||||
__field( erofs_nid_t, nid )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->dev = inode->i_sb->s_dev;
|
||||
__entry->nid = EROFS_I(inode)->nid;
|
||||
),
|
||||
|
||||
TP_printk("dev = (%d,%d), nid = %llu", show_dev_nid(__entry))
|
||||
);
|
||||
|
||||
#endif /* _TRACE_EROFS_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
|
||||
@@ -701,4 +701,5 @@ config GENERIC_LIB_UCMPDI2
|
||||
|
||||
config PLDMFW
|
||||
bool
|
||||
select CRC32
|
||||
default n
|
||||
|
||||
@@ -124,6 +124,7 @@ static unsigned char bus_mac[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
|
||||
/* Device structures */
|
||||
static struct net_device *dev_lec[MAX_LEC_ITF];
|
||||
static DEFINE_MUTEX(lec_mutex);
|
||||
|
||||
#if IS_ENABLED(CONFIG_BRIDGE)
|
||||
static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev)
|
||||
@@ -687,6 +688,7 @@ static int lec_vcc_attach(struct atm_vcc *vcc, void __user *arg)
|
||||
int bytes_left;
|
||||
struct atmlec_ioc ioc_data;
|
||||
|
||||
lockdep_assert_held(&lec_mutex);
|
||||
/* Lecd must be up in this case */
|
||||
bytes_left = copy_from_user(&ioc_data, arg, sizeof(struct atmlec_ioc));
|
||||
if (bytes_left != 0)
|
||||
@@ -712,6 +714,7 @@ static int lec_vcc_attach(struct atm_vcc *vcc, void __user *arg)
|
||||
|
||||
static int lec_mcast_attach(struct atm_vcc *vcc, int arg)
|
||||
{
|
||||
lockdep_assert_held(&lec_mutex);
|
||||
if (arg < 0 || arg >= MAX_LEC_ITF)
|
||||
return -EINVAL;
|
||||
arg = array_index_nospec(arg, MAX_LEC_ITF);
|
||||
@@ -727,6 +730,7 @@ static int lecd_attach(struct atm_vcc *vcc, int arg)
|
||||
int i;
|
||||
struct lec_priv *priv;
|
||||
|
||||
lockdep_assert_held(&lec_mutex);
|
||||
if (arg < 0)
|
||||
arg = 0;
|
||||
if (arg >= MAX_LEC_ITF)
|
||||
@@ -744,6 +748,7 @@ static int lecd_attach(struct atm_vcc *vcc, int arg)
|
||||
snprintf(dev_lec[i]->name, IFNAMSIZ, "lec%d", i);
|
||||
if (register_netdev(dev_lec[i])) {
|
||||
free_netdev(dev_lec[i]);
|
||||
dev_lec[i] = NULL;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -906,7 +911,6 @@ static void *lec_itf_walk(struct lec_state *state, loff_t *l)
|
||||
v = (dev && netdev_priv(dev)) ?
|
||||
lec_priv_walk(state, l, netdev_priv(dev)) : NULL;
|
||||
if (!v && dev) {
|
||||
dev_put(dev);
|
||||
/* Partial state reset for the next time we get called */
|
||||
dev = NULL;
|
||||
}
|
||||
@@ -930,6 +934,7 @@ static void *lec_seq_start(struct seq_file *seq, loff_t *pos)
|
||||
{
|
||||
struct lec_state *state = seq->private;
|
||||
|
||||
mutex_lock(&lec_mutex);
|
||||
state->itf = 0;
|
||||
state->dev = NULL;
|
||||
state->locked = NULL;
|
||||
@@ -947,8 +952,9 @@ static void lec_seq_stop(struct seq_file *seq, void *v)
|
||||
if (state->dev) {
|
||||
spin_unlock_irqrestore(&state->locked->lec_arp_lock,
|
||||
state->flags);
|
||||
dev_put(state->dev);
|
||||
state->dev = NULL;
|
||||
}
|
||||
mutex_unlock(&lec_mutex);
|
||||
}
|
||||
|
||||
static void *lec_seq_next(struct seq_file *seq, void *v, loff_t *pos)
|
||||
@@ -1005,6 +1011,7 @@ static int lane_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||
return -ENOIOCTLCMD;
|
||||
}
|
||||
|
||||
mutex_lock(&lec_mutex);
|
||||
switch (cmd) {
|
||||
case ATMLEC_CTRL:
|
||||
err = lecd_attach(vcc, (int)arg);
|
||||
@@ -1019,6 +1026,7 @@ static int lane_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||
break;
|
||||
}
|
||||
|
||||
mutex_unlock(&lec_mutex);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -2425,20 +2425,33 @@ static inline bool tcp_packet_delayed(const struct tcp_sock *tp)
|
||||
{
|
||||
const struct sock *sk = (const struct sock *)tp;
|
||||
|
||||
if (tp->retrans_stamp &&
|
||||
tcp_tsopt_ecr_before(tp, tp->retrans_stamp))
|
||||
return true; /* got echoed TS before first retransmission */
|
||||
/* Received an echoed timestamp before the first retransmission? */
|
||||
if (tp->retrans_stamp)
|
||||
return tcp_tsopt_ecr_before(tp, tp->retrans_stamp);
|
||||
|
||||
/* Check if nothing was retransmitted (retrans_stamp==0), which may
|
||||
* happen in fast recovery due to TSQ. But we ignore zero retrans_stamp
|
||||
* in TCP_SYN_SENT, since when we set FLAG_SYN_ACKED we also clear
|
||||
* retrans_stamp even if we had retransmitted the SYN.
|
||||
/* We set tp->retrans_stamp upon the first retransmission of a loss
|
||||
* recovery episode, so normally if tp->retrans_stamp is 0 then no
|
||||
* retransmission has happened yet (likely due to TSQ, which can cause
|
||||
* fast retransmits to be delayed). So if snd_una advanced while
|
||||
* (tp->retrans_stamp is 0 then apparently a packet was merely delayed,
|
||||
* not lost. But there are exceptions where we retransmit but then
|
||||
* clear tp->retrans_stamp, so we check for those exceptions.
|
||||
*/
|
||||
if (!tp->retrans_stamp && /* no record of a retransmit/SYN? */
|
||||
sk->sk_state != TCP_SYN_SENT) /* not the FLAG_SYN_ACKED case? */
|
||||
return true; /* nothing was retransmitted */
|
||||
|
||||
return false;
|
||||
/* (1) For non-SACK connections, tcp_is_non_sack_preventing_reopen()
|
||||
* clears tp->retrans_stamp when snd_una == high_seq.
|
||||
*/
|
||||
if (!tcp_is_sack(tp) && !before(tp->snd_una, tp->high_seq))
|
||||
return false;
|
||||
|
||||
/* (2) In TCP_SYN_SENT tcp_clean_rtx_queue() clears tp->retrans_stamp
|
||||
* when setting FLAG_SYN_ACKED is set, even if the SYN was
|
||||
* retransmitted.
|
||||
*/
|
||||
if (sk->sk_state == TCP_SYN_SENT)
|
||||
return false;
|
||||
|
||||
return true; /* tp->retrans_stamp is zero; no retransmit yet */
|
||||
}
|
||||
|
||||
/* Undo procedures. */
|
||||
|
||||
@@ -1210,6 +1210,10 @@ static int calipso_req_setattr(struct request_sock *req,
|
||||
struct ipv6_opt_hdr *old, *new;
|
||||
struct sock *sk = sk_to_full_sk(req_to_sk(req));
|
||||
|
||||
/* sk is NULL for SYN+ACK w/ SYN Cookie */
|
||||
if (!sk)
|
||||
return -ENOMEM;
|
||||
|
||||
if (req_inet->ipv6_opt && req_inet->ipv6_opt->hopopt)
|
||||
old = req_inet->ipv6_opt->hopopt;
|
||||
else
|
||||
@@ -1250,6 +1254,10 @@ static void calipso_req_delattr(struct request_sock *req)
|
||||
struct ipv6_txoptions *txopts;
|
||||
struct sock *sk = sk_to_full_sk(req_to_sk(req));
|
||||
|
||||
/* sk is NULL for SYN+ACK w/ SYN Cookie */
|
||||
if (!sk)
|
||||
return;
|
||||
|
||||
if (!req_inet->ipv6_opt || !req_inet->ipv6_opt->hopopt)
|
||||
return;
|
||||
|
||||
|
||||
@@ -80,8 +80,8 @@ static struct mpls_route *mpls_route_input_rcu(struct net *net, unsigned index)
|
||||
|
||||
if (index < net->mpls.platform_labels) {
|
||||
struct mpls_route __rcu **platform_label =
|
||||
rcu_dereference(net->mpls.platform_label);
|
||||
rt = rcu_dereference(platform_label[index]);
|
||||
rcu_dereference_rtnl(net->mpls.platform_label);
|
||||
rt = rcu_dereference_rtnl(platform_label[index]);
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
|
||||
@@ -481,7 +481,7 @@ int tipc_udp_nl_dump_remoteip(struct sk_buff *skb, struct netlink_callback *cb)
|
||||
|
||||
rtnl_lock();
|
||||
b = tipc_bearer_find(net, bname);
|
||||
if (!b) {
|
||||
if (!b || b->bcast_addr.media_id != TIPC_MEDIA_TYPE_UDP) {
|
||||
rtnl_unlock();
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -492,7 +492,7 @@ int tipc_udp_nl_dump_remoteip(struct sk_buff *skb, struct netlink_callback *cb)
|
||||
|
||||
rtnl_lock();
|
||||
b = rtnl_dereference(tn->bearer_list[bid]);
|
||||
if (!b) {
|
||||
if (!b || b->bcast_addr.media_id != TIPC_MEDIA_TYPE_UDP) {
|
||||
rtnl_unlock();
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user