mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Update Opi Zero 2 legacy kernel (#4642)
* Update Opi Zero 2 Legacy kernel + enable images back as those works decently, mainline is too fragile. * Fix broken patch
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Automatically generated file; DO NOT EDIT.
|
# Automatically generated file; DO NOT EDIT.
|
||||||
# Linux/arm64 4.9.255 Kernel Configuration
|
# Linux/arm64 4.9.318 Kernel Configuration
|
||||||
#
|
#
|
||||||
CONFIG_ARM64=y
|
CONFIG_ARM64=y
|
||||||
CONFIG_64BIT=y
|
CONFIG_64BIT=y
|
||||||
@@ -200,6 +200,7 @@ CONFIG_BPF_SYSCALL=y
|
|||||||
CONFIG_SHMEM=y
|
CONFIG_SHMEM=y
|
||||||
CONFIG_AIO=y
|
CONFIG_AIO=y
|
||||||
CONFIG_ADVISE_SYSCALLS=y
|
CONFIG_ADVISE_SYSCALLS=y
|
||||||
|
# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set
|
||||||
CONFIG_USERFAULTFD=y
|
CONFIG_USERFAULTFD=y
|
||||||
CONFIG_MEMBARRIER=y
|
CONFIG_MEMBARRIER=y
|
||||||
CONFIG_EMBEDDED=y
|
CONFIG_EMBEDDED=y
|
||||||
@@ -618,6 +619,7 @@ CONFIG_NET_EGRESS=y
|
|||||||
CONFIG_PACKET=y
|
CONFIG_PACKET=y
|
||||||
# CONFIG_PACKET_DIAG is not set
|
# CONFIG_PACKET_DIAG is not set
|
||||||
CONFIG_UNIX=y
|
CONFIG_UNIX=y
|
||||||
|
CONFIG_UNIX_SCM=y
|
||||||
CONFIG_UNIX_DIAG=y
|
CONFIG_UNIX_DIAG=y
|
||||||
CONFIG_XFRM=y
|
CONFIG_XFRM=y
|
||||||
CONFIG_XFRM_ALGO=y
|
CONFIG_XFRM_ALGO=y
|
||||||
@@ -1595,7 +1597,6 @@ CONFIG_NET_VENDOR_MARVELL=y
|
|||||||
CONFIG_NET_VENDOR_MICREL=y
|
CONFIG_NET_VENDOR_MICREL=y
|
||||||
# CONFIG_KS8842 is not set
|
# CONFIG_KS8842 is not set
|
||||||
# CONFIG_KS8851 is not set
|
# CONFIG_KS8851 is not set
|
||||||
# CONFIG_KS8851_MLL is not set
|
|
||||||
CONFIG_NET_VENDOR_MICROCHIP=y
|
CONFIG_NET_VENDOR_MICROCHIP=y
|
||||||
# CONFIG_ENC28J60 is not set
|
# CONFIG_ENC28J60 is not set
|
||||||
# CONFIG_ENCX24J600 is not set
|
# CONFIG_ENCX24J600 is not set
|
||||||
@@ -1814,6 +1815,7 @@ CONFIG_SC23XX=y
|
|||||||
# CONFIG_RK_WIFI_DEVICE_UWE5622 is not set
|
# CONFIG_RK_WIFI_DEVICE_UWE5622 is not set
|
||||||
CONFIG_AW_WIFI_DEVICE_UWE5622=y
|
CONFIG_AW_WIFI_DEVICE_UWE5622=y
|
||||||
CONFIG_AW_BIND_VERIFY=y
|
CONFIG_AW_BIND_VERIFY=y
|
||||||
|
CONFIG_WLAN_UWE5621=m
|
||||||
CONFIG_WLAN_UWE5622=m
|
CONFIG_WLAN_UWE5622=m
|
||||||
CONFIG_SPRDWL_NG=m
|
CONFIG_SPRDWL_NG=m
|
||||||
CONFIG_UNISOC_WIFI_PS=y
|
CONFIG_UNISOC_WIFI_PS=y
|
||||||
@@ -1825,7 +1827,6 @@ CONFIG_RTL8821CS=m
|
|||||||
#
|
#
|
||||||
# CONFIG_WAN is not set
|
# CONFIG_WAN is not set
|
||||||
# CONFIG_ISDN is not set
|
# CONFIG_ISDN is not set
|
||||||
# CONFIG_NVM is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Input device support
|
# Input device support
|
||||||
@@ -2326,6 +2327,7 @@ CONFIG_POWER_SUPPLY=y
|
|||||||
# CONFIG_CHARGER_BQ25890 is not set
|
# CONFIG_CHARGER_BQ25890 is not set
|
||||||
# CONFIG_CHARGER_SMB347 is not set
|
# CONFIG_CHARGER_SMB347 is not set
|
||||||
# CONFIG_BATTERY_GAUGE_LTC2941 is not set
|
# CONFIG_BATTERY_GAUGE_LTC2941 is not set
|
||||||
|
CONFIG_BATTERY_RT5033=m
|
||||||
# CONFIG_CHARGER_RT9455 is not set
|
# CONFIG_CHARGER_RT9455 is not set
|
||||||
CONFIG_HWMON=y
|
CONFIG_HWMON=y
|
||||||
# CONFIG_HWMON_VID is not set
|
# CONFIG_HWMON_VID is not set
|
||||||
@@ -4345,6 +4347,10 @@ CONFIG_NLS_ISO8859_1=y
|
|||||||
CONFIG_NLS_UTF8=y
|
CONFIG_NLS_UTF8=y
|
||||||
CONFIG_DLM=y
|
CONFIG_DLM=y
|
||||||
# CONFIG_DLM_DEBUG is not set
|
# CONFIG_DLM_DEBUG is not set
|
||||||
|
CONFIG_EXFAT_FS=m
|
||||||
|
CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"
|
||||||
|
CONFIG_EXFAT_VIRTUAL_XATTR=y
|
||||||
|
CONFIG_EXFAT_VIRTUAL_XATTR_SELINUX_LABEL="u:object_r:exfat:s0"
|
||||||
# CONFIG_VIRTUALIZATION is not set
|
# CONFIG_VIRTUALIZATION is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -562,8 +562,10 @@ orangepizero current bullseye minimal s
|
|||||||
|
|
||||||
|
|
||||||
# orangepizero2
|
# orangepizero2
|
||||||
orangepizero2 edge jammy cli stable adv
|
orangepizero2 legacy jammy cli stable adv
|
||||||
orangepizero2 edge bullseye cli stable adv
|
orangepizero2 legacy bullseye cli stable adv
|
||||||
|
orangepizero2 edge jammy cli stable yes
|
||||||
|
orangepizero2 edge bullseye cli stable yes
|
||||||
orangepizero2 edge jammy minimal stable yes
|
orangepizero2 edge jammy minimal stable yes
|
||||||
orangepizero2 edge bullseye minimal stable yes
|
orangepizero2 edge bullseye minimal stable yes
|
||||||
|
|
||||||
|
|||||||
12
patch/kernel/archive/sun50iw9-4.9/patch-4.9.255-256.patch
Normal file
12
patch/kernel/archive/sun50iw9-4.9/patch-4.9.255-256.patch
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 4780b5f80b2a8..69af44d3dcd14 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 255
|
||||||
|
+SUBLEVEL = 256
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
1823
patch/kernel/archive/sun50iw9-4.9/patch-4.9.256-257.patch
Normal file
1823
patch/kernel/archive/sun50iw9-4.9/patch-4.9.256-257.patch
Normal file
File diff suppressed because it is too large
Load Diff
2316
patch/kernel/archive/sun50iw9-4.9/patch-4.9.257-258.patch
Normal file
2316
patch/kernel/archive/sun50iw9-4.9/patch-4.9.257-258.patch
Normal file
File diff suppressed because it is too large
Load Diff
3177
patch/kernel/archive/sun50iw9-4.9/patch-4.9.258-259.patch
Normal file
3177
patch/kernel/archive/sun50iw9-4.9/patch-4.9.258-259.patch
Normal file
File diff suppressed because it is too large
Load Diff
2408
patch/kernel/archive/sun50iw9-4.9/patch-4.9.259-260.patch
Normal file
2408
patch/kernel/archive/sun50iw9-4.9/patch-4.9.259-260.patch
Normal file
File diff suppressed because it is too large
Load Diff
509
patch/kernel/archive/sun50iw9-4.9/patch-4.9.260-261.patch
Normal file
509
patch/kernel/archive/sun50iw9-4.9/patch-4.9.260-261.patch
Normal file
@@ -0,0 +1,509 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 7a29676e2b2f9..7a233c641906c 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 260
|
||||||
|
+SUBLEVEL = 261
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c
|
||||||
|
index 6beafaa335c71..97b678c0ea136 100644
|
||||||
|
--- a/drivers/block/rsxx/core.c
|
||||||
|
+++ b/drivers/block/rsxx/core.c
|
||||||
|
@@ -180,15 +180,17 @@ static ssize_t rsxx_cram_read(struct file *fp, char __user *ubuf,
|
||||||
|
{
|
||||||
|
struct rsxx_cardinfo *card = file_inode(fp)->i_private;
|
||||||
|
char *buf;
|
||||||
|
- ssize_t st;
|
||||||
|
+ int st;
|
||||||
|
|
||||||
|
buf = kzalloc(cnt, GFP_KERNEL);
|
||||||
|
if (!buf)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
st = rsxx_creg_read(card, CREG_ADD_CRAM + (u32)*ppos, cnt, buf, 1);
|
||||||
|
- if (!st)
|
||||||
|
- st = copy_to_user(ubuf, buf, cnt);
|
||||||
|
+ if (!st) {
|
||||||
|
+ if (copy_to_user(ubuf, buf, cnt))
|
||||||
|
+ st = -EFAULT;
|
||||||
|
+ }
|
||||||
|
kfree(buf);
|
||||||
|
if (st)
|
||||||
|
return st;
|
||||||
|
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
|
||||||
|
index f4a15d9f2bbb2..8377bd388d673 100644
|
||||||
|
--- a/drivers/iommu/amd_iommu.c
|
||||||
|
+++ b/drivers/iommu/amd_iommu.c
|
||||||
|
@@ -1331,24 +1331,26 @@ static void increase_address_space(struct protection_domain *domain,
|
||||||
|
unsigned long flags;
|
||||||
|
u64 *pte;
|
||||||
|
|
||||||
|
+ pte = (void *)get_zeroed_page(gfp);
|
||||||
|
+ if (!pte)
|
||||||
|
+ goto out;
|
||||||
|
+
|
||||||
|
spin_lock_irqsave(&domain->lock, flags);
|
||||||
|
|
||||||
|
if (WARN_ON_ONCE(domain->mode == PAGE_MODE_6_LEVEL))
|
||||||
|
/* address space already 64 bit large */
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
- pte = (void *)get_zeroed_page(gfp);
|
||||||
|
- if (!pte)
|
||||||
|
- goto out;
|
||||||
|
-
|
||||||
|
*pte = PM_LEVEL_PDE(domain->mode,
|
||||||
|
virt_to_phys(domain->pt_root));
|
||||||
|
domain->pt_root = pte;
|
||||||
|
domain->mode += 1;
|
||||||
|
domain->updated = true;
|
||||||
|
+ pte = NULL;
|
||||||
|
|
||||||
|
out:
|
||||||
|
spin_unlock_irqrestore(&domain->lock, flags);
|
||||||
|
+ free_page((unsigned long)pte);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
|
||||||
|
index 5d120c3cee57d..4fc68c00c2315 100644
|
||||||
|
--- a/drivers/md/dm-table.c
|
||||||
|
+++ b/drivers/md/dm-table.c
|
||||||
|
@@ -848,12 +848,12 @@ void dm_table_set_type(struct dm_table *t, unsigned type)
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(dm_table_set_type);
|
||||||
|
|
||||||
|
-static int device_supports_dax(struct dm_target *ti, struct dm_dev *dev,
|
||||||
|
- sector_t start, sector_t len, void *data)
|
||||||
|
+static int device_not_dax_capable(struct dm_target *ti, struct dm_dev *dev,
|
||||||
|
+ sector_t start, sector_t len, void *data)
|
||||||
|
{
|
||||||
|
struct request_queue *q = bdev_get_queue(dev->bdev);
|
||||||
|
|
||||||
|
- return q && blk_queue_dax(q);
|
||||||
|
+ return q && !blk_queue_dax(q);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool dm_table_supports_dax(struct dm_table *t)
|
||||||
|
@@ -869,7 +869,7 @@ static bool dm_table_supports_dax(struct dm_table *t)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!ti->type->iterate_devices ||
|
||||||
|
- !ti->type->iterate_devices(ti, device_supports_dax, NULL))
|
||||||
|
+ ti->type->iterate_devices(ti, device_not_dax_capable, NULL))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1306,6 +1306,46 @@ struct dm_target *dm_table_find_target(struct dm_table *t, sector_t sector)
|
||||||
|
return &t->targets[(KEYS_PER_NODE * n) + k];
|
||||||
|
}
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+ * type->iterate_devices() should be called when the sanity check needs to
|
||||||
|
+ * iterate and check all underlying data devices. iterate_devices() will
|
||||||
|
+ * iterate all underlying data devices until it encounters a non-zero return
|
||||||
|
+ * code, returned by whether the input iterate_devices_callout_fn, or
|
||||||
|
+ * iterate_devices() itself internally.
|
||||||
|
+ *
|
||||||
|
+ * For some target type (e.g. dm-stripe), one call of iterate_devices() may
|
||||||
|
+ * iterate multiple underlying devices internally, in which case a non-zero
|
||||||
|
+ * return code returned by iterate_devices_callout_fn will stop the iteration
|
||||||
|
+ * in advance.
|
||||||
|
+ *
|
||||||
|
+ * Cases requiring _any_ underlying device supporting some kind of attribute,
|
||||||
|
+ * should use the iteration structure like dm_table_any_dev_attr(), or call
|
||||||
|
+ * it directly. @func should handle semantics of positive examples, e.g.
|
||||||
|
+ * capable of something.
|
||||||
|
+ *
|
||||||
|
+ * Cases requiring _all_ underlying devices supporting some kind of attribute,
|
||||||
|
+ * should use the iteration structure like dm_table_supports_nowait() or
|
||||||
|
+ * dm_table_supports_discards(). Or introduce dm_table_all_devs_attr() that
|
||||||
|
+ * uses an @anti_func that handle semantics of counter examples, e.g. not
|
||||||
|
+ * capable of something. So: return !dm_table_any_dev_attr(t, anti_func);
|
||||||
|
+ */
|
||||||
|
+static bool dm_table_any_dev_attr(struct dm_table *t,
|
||||||
|
+ iterate_devices_callout_fn func)
|
||||||
|
+{
|
||||||
|
+ struct dm_target *ti;
|
||||||
|
+ unsigned int i;
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < dm_table_get_num_targets(t); i++) {
|
||||||
|
+ ti = dm_table_get_target(t, i);
|
||||||
|
+
|
||||||
|
+ if (ti->type->iterate_devices &&
|
||||||
|
+ ti->type->iterate_devices(ti, func, NULL))
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return false;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int count_device(struct dm_target *ti, struct dm_dev *dev,
|
||||||
|
sector_t start, sector_t len, void *data)
|
||||||
|
{
|
||||||
|
@@ -1476,12 +1516,12 @@ static bool dm_table_discard_zeroes_data(struct dm_table *t)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int device_is_nonrot(struct dm_target *ti, struct dm_dev *dev,
|
||||||
|
- sector_t start, sector_t len, void *data)
|
||||||
|
+static int device_is_rotational(struct dm_target *ti, struct dm_dev *dev,
|
||||||
|
+ sector_t start, sector_t len, void *data)
|
||||||
|
{
|
||||||
|
struct request_queue *q = bdev_get_queue(dev->bdev);
|
||||||
|
|
||||||
|
- return q && blk_queue_nonrot(q);
|
||||||
|
+ return q && !blk_queue_nonrot(q);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev,
|
||||||
|
@@ -1492,29 +1532,12 @@ static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev,
|
||||||
|
return q && !blk_queue_add_random(q);
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int queue_supports_sg_merge(struct dm_target *ti, struct dm_dev *dev,
|
||||||
|
- sector_t start, sector_t len, void *data)
|
||||||
|
+static int queue_no_sg_merge(struct dm_target *ti, struct dm_dev *dev,
|
||||||
|
+ sector_t start, sector_t len, void *data)
|
||||||
|
{
|
||||||
|
struct request_queue *q = bdev_get_queue(dev->bdev);
|
||||||
|
|
||||||
|
- return q && !test_bit(QUEUE_FLAG_NO_SG_MERGE, &q->queue_flags);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static bool dm_table_all_devices_attribute(struct dm_table *t,
|
||||||
|
- iterate_devices_callout_fn func)
|
||||||
|
-{
|
||||||
|
- struct dm_target *ti;
|
||||||
|
- unsigned i = 0;
|
||||||
|
-
|
||||||
|
- while (i < dm_table_get_num_targets(t)) {
|
||||||
|
- ti = dm_table_get_target(t, i++);
|
||||||
|
-
|
||||||
|
- if (!ti->type->iterate_devices ||
|
||||||
|
- !ti->type->iterate_devices(ti, func, NULL))
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- return true;
|
||||||
|
+ return q && test_bit(QUEUE_FLAG_NO_SG_MERGE, &q->queue_flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int device_not_write_same_capable(struct dm_target *ti, struct dm_dev *dev,
|
||||||
|
@@ -1607,18 +1630,18 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
|
||||||
|
q->limits.discard_zeroes_data = 0;
|
||||||
|
|
||||||
|
/* Ensure that all underlying devices are non-rotational. */
|
||||||
|
- if (dm_table_all_devices_attribute(t, device_is_nonrot))
|
||||||
|
- queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q);
|
||||||
|
- else
|
||||||
|
+ if (dm_table_any_dev_attr(t, device_is_rotational))
|
||||||
|
queue_flag_clear_unlocked(QUEUE_FLAG_NONROT, q);
|
||||||
|
+ else
|
||||||
|
+ queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q);
|
||||||
|
|
||||||
|
if (!dm_table_supports_write_same(t))
|
||||||
|
q->limits.max_write_same_sectors = 0;
|
||||||
|
|
||||||
|
- if (dm_table_all_devices_attribute(t, queue_supports_sg_merge))
|
||||||
|
- queue_flag_clear_unlocked(QUEUE_FLAG_NO_SG_MERGE, q);
|
||||||
|
- else
|
||||||
|
+ if (dm_table_any_dev_attr(t, queue_no_sg_merge))
|
||||||
|
queue_flag_set_unlocked(QUEUE_FLAG_NO_SG_MERGE, q);
|
||||||
|
+ else
|
||||||
|
+ queue_flag_clear_unlocked(QUEUE_FLAG_NO_SG_MERGE, q);
|
||||||
|
|
||||||
|
dm_table_verify_integrity(t);
|
||||||
|
|
||||||
|
@@ -1628,7 +1651,7 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
|
||||||
|
* Clear QUEUE_FLAG_ADD_RANDOM if any underlying device does not
|
||||||
|
* have it set.
|
||||||
|
*/
|
||||||
|
- if (blk_queue_add_random(q) && dm_table_all_devices_attribute(t, device_is_not_random))
|
||||||
|
+ if (blk_queue_add_random(q) && dm_table_any_dev_attr(t, device_is_not_random))
|
||||||
|
queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, q);
|
||||||
|
|
||||||
|
/*
|
||||||
|
diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c
|
||||||
|
index d30deee1effda..30b490329f55e 100644
|
||||||
|
--- a/drivers/misc/eeprom/eeprom_93xx46.c
|
||||||
|
+++ b/drivers/misc/eeprom/eeprom_93xx46.c
|
||||||
|
@@ -38,6 +38,10 @@ static const struct eeprom_93xx46_devtype_data atmel_at93c46d_data = {
|
||||||
|
EEPROM_93XX46_QUIRK_INSTRUCTION_LENGTH,
|
||||||
|
};
|
||||||
|
|
||||||
|
+static const struct eeprom_93xx46_devtype_data microchip_93lc46b_data = {
|
||||||
|
+ .quirks = EEPROM_93XX46_QUIRK_EXTRA_READ_CYCLE,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
struct eeprom_93xx46_dev {
|
||||||
|
struct spi_device *spi;
|
||||||
|
struct eeprom_93xx46_platform_data *pdata;
|
||||||
|
@@ -58,6 +62,11 @@ static inline bool has_quirk_instruction_length(struct eeprom_93xx46_dev *edev)
|
||||||
|
return edev->pdata->quirks & EEPROM_93XX46_QUIRK_INSTRUCTION_LENGTH;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static inline bool has_quirk_extra_read_cycle(struct eeprom_93xx46_dev *edev)
|
||||||
|
+{
|
||||||
|
+ return edev->pdata->quirks & EEPROM_93XX46_QUIRK_EXTRA_READ_CYCLE;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int eeprom_93xx46_read(void *priv, unsigned int off,
|
||||||
|
void *val, size_t count)
|
||||||
|
{
|
||||||
|
@@ -99,6 +108,11 @@ static int eeprom_93xx46_read(void *priv, unsigned int off,
|
||||||
|
dev_dbg(&edev->spi->dev, "read cmd 0x%x, %d Hz\n",
|
||||||
|
cmd_addr, edev->spi->max_speed_hz);
|
||||||
|
|
||||||
|
+ if (has_quirk_extra_read_cycle(edev)) {
|
||||||
|
+ cmd_addr <<= 1;
|
||||||
|
+ bits += 1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
spi_message_init(&m);
|
||||||
|
|
||||||
|
t[0].tx_buf = (char *)&cmd_addr;
|
||||||
|
@@ -366,6 +380,7 @@ static void select_deassert(void *context)
|
||||||
|
static const struct of_device_id eeprom_93xx46_of_table[] = {
|
||||||
|
{ .compatible = "eeprom-93xx46", },
|
||||||
|
{ .compatible = "atmel,at93c46d", .data = &atmel_at93c46d_data, },
|
||||||
|
+ { .compatible = "microchip,93lc46b", .data = µchip_93lc46b_data, },
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(of, eeprom_93xx46_of_table);
|
||||||
|
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
|
||||||
|
index 1fdb1ef5eaaeb..0ebf7500e171e 100644
|
||||||
|
--- a/drivers/pci/quirks.c
|
||||||
|
+++ b/drivers/pci/quirks.c
|
||||||
|
@@ -3911,6 +3911,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9182,
|
||||||
|
/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c46 */
|
||||||
|
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x91a0,
|
||||||
|
quirk_dma_func1_alias);
|
||||||
|
+/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c135 */
|
||||||
|
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9215,
|
||||||
|
+ quirk_dma_func1_alias);
|
||||||
|
/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c127 */
|
||||||
|
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9220,
|
||||||
|
quirk_dma_func1_alias);
|
||||||
|
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
|
||||||
|
index 90015e2cce9bf..ec3cbb7844bce 100644
|
||||||
|
--- a/drivers/platform/x86/acer-wmi.c
|
||||||
|
+++ b/drivers/platform/x86/acer-wmi.c
|
||||||
|
@@ -229,6 +229,7 @@ static int mailled = -1;
|
||||||
|
static int brightness = -1;
|
||||||
|
static int threeg = -1;
|
||||||
|
static int force_series;
|
||||||
|
+static int force_caps = -1;
|
||||||
|
static bool ec_raw_mode;
|
||||||
|
static bool has_type_aa;
|
||||||
|
static u16 commun_func_bitmap;
|
||||||
|
@@ -238,11 +239,13 @@ module_param(mailled, int, 0444);
|
||||||
|
module_param(brightness, int, 0444);
|
||||||
|
module_param(threeg, int, 0444);
|
||||||
|
module_param(force_series, int, 0444);
|
||||||
|
+module_param(force_caps, int, 0444);
|
||||||
|
module_param(ec_raw_mode, bool, 0444);
|
||||||
|
MODULE_PARM_DESC(mailled, "Set initial state of Mail LED");
|
||||||
|
MODULE_PARM_DESC(brightness, "Set initial LCD backlight brightness");
|
||||||
|
MODULE_PARM_DESC(threeg, "Set initial state of 3G hardware");
|
||||||
|
MODULE_PARM_DESC(force_series, "Force a different laptop series");
|
||||||
|
+MODULE_PARM_DESC(force_caps, "Force the capability bitmask to this value");
|
||||||
|
MODULE_PARM_DESC(ec_raw_mode, "Enable EC raw mode");
|
||||||
|
|
||||||
|
struct acer_data {
|
||||||
|
@@ -2198,7 +2201,7 @@ static int __init acer_wmi_init(void)
|
||||||
|
}
|
||||||
|
/* WMID always provides brightness methods */
|
||||||
|
interface->capability |= ACER_CAP_BRIGHTNESS;
|
||||||
|
- } else if (!wmi_has_guid(WMID_GUID2) && interface && !has_type_aa) {
|
||||||
|
+ } else if (!wmi_has_guid(WMID_GUID2) && interface && !has_type_aa && force_caps == -1) {
|
||||||
|
pr_err("No WMID device detection method found\n");
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
@@ -2228,6 +2231,9 @@ static int __init acer_wmi_init(void)
|
||||||
|
if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
|
||||||
|
interface->capability &= ~ACER_CAP_BRIGHTNESS;
|
||||||
|
|
||||||
|
+ if (force_caps != -1)
|
||||||
|
+ interface->capability = force_caps;
|
||||||
|
+
|
||||||
|
if (wmi_has_guid(WMID_GUID3)) {
|
||||||
|
if (ec_raw_mode) {
|
||||||
|
if (ACPI_FAILURE(acer_wmi_enable_ec_raw())) {
|
||||||
|
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
|
||||||
|
index 5aa07de5750e8..4b5d806e8fc67 100644
|
||||||
|
--- a/fs/btrfs/raid56.c
|
||||||
|
+++ b/fs/btrfs/raid56.c
|
||||||
|
@@ -1179,22 +1179,19 @@ static noinline void finish_rmw(struct btrfs_raid_bio *rbio)
|
||||||
|
int nr_data = rbio->nr_data;
|
||||||
|
int stripe;
|
||||||
|
int pagenr;
|
||||||
|
- int p_stripe = -1;
|
||||||
|
- int q_stripe = -1;
|
||||||
|
+ bool has_qstripe;
|
||||||
|
struct bio_list bio_list;
|
||||||
|
struct bio *bio;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
bio_list_init(&bio_list);
|
||||||
|
|
||||||
|
- if (rbio->real_stripes - rbio->nr_data == 1) {
|
||||||
|
- p_stripe = rbio->real_stripes - 1;
|
||||||
|
- } else if (rbio->real_stripes - rbio->nr_data == 2) {
|
||||||
|
- p_stripe = rbio->real_stripes - 2;
|
||||||
|
- q_stripe = rbio->real_stripes - 1;
|
||||||
|
- } else {
|
||||||
|
+ if (rbio->real_stripes - rbio->nr_data == 1)
|
||||||
|
+ has_qstripe = false;
|
||||||
|
+ else if (rbio->real_stripes - rbio->nr_data == 2)
|
||||||
|
+ has_qstripe = true;
|
||||||
|
+ else
|
||||||
|
BUG();
|
||||||
|
- }
|
||||||
|
|
||||||
|
/* at this point we either have a full stripe,
|
||||||
|
* or we've read the full stripe from the drive.
|
||||||
|
@@ -1238,7 +1235,7 @@ static noinline void finish_rmw(struct btrfs_raid_bio *rbio)
|
||||||
|
SetPageUptodate(p);
|
||||||
|
pointers[stripe++] = kmap(p);
|
||||||
|
|
||||||
|
- if (q_stripe != -1) {
|
||||||
|
+ if (has_qstripe) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* raid6, add the qstripe and call the
|
||||||
|
@@ -2306,8 +2303,7 @@ static noinline void finish_parity_scrub(struct btrfs_raid_bio *rbio,
|
||||||
|
int nr_data = rbio->nr_data;
|
||||||
|
int stripe;
|
||||||
|
int pagenr;
|
||||||
|
- int p_stripe = -1;
|
||||||
|
- int q_stripe = -1;
|
||||||
|
+ bool has_qstripe;
|
||||||
|
struct page *p_page = NULL;
|
||||||
|
struct page *q_page = NULL;
|
||||||
|
struct bio_list bio_list;
|
||||||
|
@@ -2317,14 +2313,12 @@ static noinline void finish_parity_scrub(struct btrfs_raid_bio *rbio,
|
||||||
|
|
||||||
|
bio_list_init(&bio_list);
|
||||||
|
|
||||||
|
- if (rbio->real_stripes - rbio->nr_data == 1) {
|
||||||
|
- p_stripe = rbio->real_stripes - 1;
|
||||||
|
- } else if (rbio->real_stripes - rbio->nr_data == 2) {
|
||||||
|
- p_stripe = rbio->real_stripes - 2;
|
||||||
|
- q_stripe = rbio->real_stripes - 1;
|
||||||
|
- } else {
|
||||||
|
+ if (rbio->real_stripes - rbio->nr_data == 1)
|
||||||
|
+ has_qstripe = false;
|
||||||
|
+ else if (rbio->real_stripes - rbio->nr_data == 2)
|
||||||
|
+ has_qstripe = true;
|
||||||
|
+ else
|
||||||
|
BUG();
|
||||||
|
- }
|
||||||
|
|
||||||
|
if (bbio->num_tgtdevs && bbio->tgtdev_map[rbio->scrubp]) {
|
||||||
|
is_replace = 1;
|
||||||
|
@@ -2346,17 +2340,22 @@ static noinline void finish_parity_scrub(struct btrfs_raid_bio *rbio,
|
||||||
|
goto cleanup;
|
||||||
|
SetPageUptodate(p_page);
|
||||||
|
|
||||||
|
- if (q_stripe != -1) {
|
||||||
|
+ if (has_qstripe) {
|
||||||
|
+ /* RAID6, allocate and map temp space for the Q stripe */
|
||||||
|
q_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM);
|
||||||
|
if (!q_page) {
|
||||||
|
__free_page(p_page);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
SetPageUptodate(q_page);
|
||||||
|
+ pointers[rbio->real_stripes - 1] = kmap(q_page);
|
||||||
|
}
|
||||||
|
|
||||||
|
atomic_set(&rbio->error, 0);
|
||||||
|
|
||||||
|
+ /* Map the parity stripe just once */
|
||||||
|
+ pointers[nr_data] = kmap(p_page);
|
||||||
|
+
|
||||||
|
for_each_set_bit(pagenr, rbio->dbitmap, rbio->stripe_npages) {
|
||||||
|
struct page *p;
|
||||||
|
void *parity;
|
||||||
|
@@ -2366,17 +2365,8 @@ static noinline void finish_parity_scrub(struct btrfs_raid_bio *rbio,
|
||||||
|
pointers[stripe] = kmap(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
- /* then add the parity stripe */
|
||||||
|
- pointers[stripe++] = kmap(p_page);
|
||||||
|
-
|
||||||
|
- if (q_stripe != -1) {
|
||||||
|
-
|
||||||
|
- /*
|
||||||
|
- * raid6, add the qstripe and call the
|
||||||
|
- * library function to fill in our p/q
|
||||||
|
- */
|
||||||
|
- pointers[stripe++] = kmap(q_page);
|
||||||
|
-
|
||||||
|
+ if (has_qstripe) {
|
||||||
|
+ /* RAID6, call the library function to fill in our P/Q */
|
||||||
|
raid6_call.gen_syndrome(rbio->real_stripes, PAGE_SIZE,
|
||||||
|
pointers);
|
||||||
|
} else {
|
||||||
|
@@ -2397,12 +2387,14 @@ static noinline void finish_parity_scrub(struct btrfs_raid_bio *rbio,
|
||||||
|
|
||||||
|
for (stripe = 0; stripe < nr_data; stripe++)
|
||||||
|
kunmap(page_in_rbio(rbio, stripe, pagenr, 0));
|
||||||
|
- kunmap(p_page);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ kunmap(p_page);
|
||||||
|
__free_page(p_page);
|
||||||
|
- if (q_page)
|
||||||
|
+ if (q_page) {
|
||||||
|
+ kunmap(q_page);
|
||||||
|
__free_page(q_page);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
writeback:
|
||||||
|
/*
|
||||||
|
diff --git a/include/linux/eeprom_93xx46.h b/include/linux/eeprom_93xx46.h
|
||||||
|
index 885f587a35550..affe4d1d7d4a5 100644
|
||||||
|
--- a/include/linux/eeprom_93xx46.h
|
||||||
|
+++ b/include/linux/eeprom_93xx46.h
|
||||||
|
@@ -16,6 +16,8 @@ struct eeprom_93xx46_platform_data {
|
||||||
|
#define EEPROM_93XX46_QUIRK_SINGLE_WORD_READ (1 << 0)
|
||||||
|
/* Instructions such as EWEN are (addrlen + 2) in length. */
|
||||||
|
#define EEPROM_93XX46_QUIRK_INSTRUCTION_LENGTH (1 << 1)
|
||||||
|
+/* Add extra cycle after address during a read */
|
||||||
|
+#define EEPROM_93XX46_QUIRK_EXTRA_READ_CYCLE BIT(2)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* optional hooks to control additional logic
|
||||||
|
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
|
||||||
|
index 18ee7768b7c40..ae8aa10a4a5d0 100644
|
||||||
|
--- a/sound/pci/ctxfi/cthw20k2.c
|
||||||
|
+++ b/sound/pci/ctxfi/cthw20k2.c
|
||||||
|
@@ -995,7 +995,7 @@ static int daio_mgr_dao_init(void *blk, unsigned int idx, unsigned int conf)
|
||||||
|
|
||||||
|
if (idx < 4) {
|
||||||
|
/* S/PDIF output */
|
||||||
|
- switch ((conf & 0x7)) {
|
||||||
|
+ switch ((conf & 0xf)) {
|
||||||
|
case 1:
|
||||||
|
set_field(&ctl->txctl[idx], ATXCTL_NUC, 0);
|
||||||
|
break;
|
||||||
|
diff --git a/tools/usb/usbip/libsrc/usbip_host_common.c b/tools/usb/usbip/libsrc/usbip_host_common.c
|
||||||
|
index 4bb905925b0e4..99c26a175beb1 100644
|
||||||
|
--- a/tools/usb/usbip/libsrc/usbip_host_common.c
|
||||||
|
+++ b/tools/usb/usbip/libsrc/usbip_host_common.c
|
||||||
|
@@ -35,7 +35,7 @@
|
||||||
|
#include "list.h"
|
||||||
|
#include "sysfs_utils.h"
|
||||||
|
|
||||||
|
-struct udev *udev_context;
|
||||||
|
+extern struct udev *udev_context;
|
||||||
|
|
||||||
|
static int32_t read_attr_usbip_status(struct usbip_usb_device *udev)
|
||||||
|
{
|
||||||
2991
patch/kernel/archive/sun50iw9-4.9/patch-4.9.261-262.patch
Normal file
2991
patch/kernel/archive/sun50iw9-4.9/patch-4.9.261-262.patch
Normal file
File diff suppressed because it is too large
Load Diff
1110
patch/kernel/archive/sun50iw9-4.9/patch-4.9.262-263.patch
Normal file
1110
patch/kernel/archive/sun50iw9-4.9/patch-4.9.262-263.patch
Normal file
File diff suppressed because it is too large
Load Diff
1986
patch/kernel/archive/sun50iw9-4.9/patch-4.9.263-264.patch
Normal file
1986
patch/kernel/archive/sun50iw9-4.9/patch-4.9.263-264.patch
Normal file
File diff suppressed because it is too large
Load Diff
856
patch/kernel/archive/sun50iw9-4.9/patch-4.9.264-265.patch
Normal file
856
patch/kernel/archive/sun50iw9-4.9/patch-4.9.264-265.patch
Normal file
@@ -0,0 +1,856 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 2ae6f4b707dd9..f47e685de5f64 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 264
|
||||||
|
+SUBLEVEL = 265
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/powerpc/include/asm/cpu_has_feature.h b/arch/powerpc/include/asm/cpu_has_feature.h
|
||||||
|
index 6e834caa37206..7b10b3ef77394 100644
|
||||||
|
--- a/arch/powerpc/include/asm/cpu_has_feature.h
|
||||||
|
+++ b/arch/powerpc/include/asm/cpu_has_feature.h
|
||||||
|
@@ -6,7 +6,7 @@
|
||||||
|
#include <linux/bug.h>
|
||||||
|
#include <asm/cputable.h>
|
||||||
|
|
||||||
|
-static inline bool early_cpu_has_feature(unsigned long feature)
|
||||||
|
+static __always_inline bool early_cpu_has_feature(unsigned long feature)
|
||||||
|
{
|
||||||
|
return !!((CPU_FTRS_ALWAYS & feature) ||
|
||||||
|
(CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature));
|
||||||
|
@@ -45,7 +45,7 @@ static __always_inline bool cpu_has_feature(unsigned long feature)
|
||||||
|
return static_branch_likely(&cpu_feature_keys[i]);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
-static inline bool cpu_has_feature(unsigned long feature)
|
||||||
|
+static __always_inline bool cpu_has_feature(unsigned long feature)
|
||||||
|
{
|
||||||
|
return early_cpu_has_feature(feature);
|
||||||
|
}
|
||||||
|
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
|
||||||
|
index d0e367959c916..20e24d4b917ab 100644
|
||||||
|
--- a/drivers/extcon/extcon.c
|
||||||
|
+++ b/drivers/extcon/extcon.c
|
||||||
|
@@ -1200,6 +1200,7 @@ int extcon_dev_register(struct extcon_dev *edev)
|
||||||
|
sizeof(*edev->nh) * edev->max_supported, GFP_KERNEL);
|
||||||
|
if (!edev->nh) {
|
||||||
|
ret = -ENOMEM;
|
||||||
|
+ device_unregister(&edev->dev);
|
||||||
|
goto err_dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
|
||||||
|
index 180f0a96528ce..646dca0a8d73e 100644
|
||||||
|
--- a/drivers/firewire/nosy.c
|
||||||
|
+++ b/drivers/firewire/nosy.c
|
||||||
|
@@ -359,6 +359,7 @@ nosy_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
|
struct client *client = file->private_data;
|
||||||
|
spinlock_t *client_list_lock = &client->lynx->client_list_lock;
|
||||||
|
struct nosy_stats stats;
|
||||||
|
+ int ret;
|
||||||
|
|
||||||
|
switch (cmd) {
|
||||||
|
case NOSY_IOC_GET_STATS:
|
||||||
|
@@ -373,11 +374,15 @@ nosy_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
case NOSY_IOC_START:
|
||||||
|
+ ret = -EBUSY;
|
||||||
|
spin_lock_irq(client_list_lock);
|
||||||
|
- list_add_tail(&client->link, &client->lynx->client_list);
|
||||||
|
+ if (list_empty(&client->link)) {
|
||||||
|
+ list_add_tail(&client->link, &client->lynx->client_list);
|
||||||
|
+ ret = 0;
|
||||||
|
+ }
|
||||||
|
spin_unlock_irq(client_list_lock);
|
||||||
|
|
||||||
|
- return 0;
|
||||||
|
+ return ret;
|
||||||
|
|
||||||
|
case NOSY_IOC_STOP:
|
||||||
|
spin_lock_irq(client_list_lock);
|
||||||
|
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
|
||||||
|
index 04b60ed59ea06..4253ccb799756 100644
|
||||||
|
--- a/drivers/net/wan/lmc/lmc_main.c
|
||||||
|
+++ b/drivers/net/wan/lmc/lmc_main.c
|
||||||
|
@@ -923,6 +923,8 @@ static int lmc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
printk(KERN_WARNING "%s: LMC UNKNOWN CARD!\n", dev->name);
|
||||||
|
+ unregister_hdlc_device(dev);
|
||||||
|
+ return -EIO;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
|
||||||
|
index ee2dcea1e54b9..17827a88b85e1 100644
|
||||||
|
--- a/drivers/pinctrl/pinctrl-rockchip.c
|
||||||
|
+++ b/drivers/pinctrl/pinctrl-rockchip.c
|
||||||
|
@@ -2367,12 +2367,15 @@ static int __maybe_unused rockchip_pinctrl_suspend(struct device *dev)
|
||||||
|
static int __maybe_unused rockchip_pinctrl_resume(struct device *dev)
|
||||||
|
{
|
||||||
|
struct rockchip_pinctrl *info = dev_get_drvdata(dev);
|
||||||
|
- int ret = regmap_write(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX,
|
||||||
|
- rk3288_grf_gpio6c_iomux |
|
||||||
|
- GPIO6C6_SEL_WRITE_ENABLE);
|
||||||
|
+ int ret;
|
||||||
|
|
||||||
|
- if (ret)
|
||||||
|
- return ret;
|
||||||
|
+ if (info->ctrl->type == RK3288) {
|
||||||
|
+ ret = regmap_write(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX,
|
||||||
|
+ rk3288_grf_gpio6c_iomux |
|
||||||
|
+ GPIO6C6_SEL_WRITE_ENABLE);
|
||||||
|
+ if (ret)
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
return pinctrl_force_default(info->pctl_dev);
|
||||||
|
}
|
||||||
|
diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h
|
||||||
|
index 07ea4fcf4f88e..983ec09da6503 100644
|
||||||
|
--- a/drivers/scsi/qla2xxx/qla_target.h
|
||||||
|
+++ b/drivers/scsi/qla2xxx/qla_target.h
|
||||||
|
@@ -112,7 +112,6 @@
|
||||||
|
(min(1270, ((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD_24XX + \
|
||||||
|
QLA_TGT_DATASEGS_PER_CONT_24XX*((ql) - 1)) : 0))
|
||||||
|
#endif
|
||||||
|
-#endif
|
||||||
|
|
||||||
|
#define GET_TARGET_ID(ha, iocb) ((HAS_EXTENDED_IDS(ha)) \
|
||||||
|
? le16_to_cpu((iocb)->u.isp2x.target.extended) \
|
||||||
|
@@ -323,6 +322,7 @@ struct ctio_to_2xxx {
|
||||||
|
#ifndef CTIO_RET_TYPE
|
||||||
|
#define CTIO_RET_TYPE 0x17 /* CTIO return entry */
|
||||||
|
#define ATIO_TYPE7 0x06 /* Accept target I/O entry for 24xx */
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
struct fcp_hdr {
|
||||||
|
uint8_t r_ctl;
|
||||||
|
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
|
||||||
|
index 618422ea3a412..0d58227431e43 100644
|
||||||
|
--- a/drivers/scsi/st.c
|
||||||
|
+++ b/drivers/scsi/st.c
|
||||||
|
@@ -1267,8 +1267,8 @@ static int st_open(struct inode *inode, struct file *filp)
|
||||||
|
spin_lock(&st_use_lock);
|
||||||
|
if (STp->in_use) {
|
||||||
|
spin_unlock(&st_use_lock);
|
||||||
|
- scsi_tape_put(STp);
|
||||||
|
DEBC_printk(STp, "Device already in use.\n");
|
||||||
|
+ scsi_tape_put(STp);
|
||||||
|
return (-EBUSY);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c
|
||||||
|
index 3ea15bb0e56ef..15b9cc8531f02 100644
|
||||||
|
--- a/drivers/staging/comedi/drivers/cb_pcidas.c
|
||||||
|
+++ b/drivers/staging/comedi/drivers/cb_pcidas.c
|
||||||
|
@@ -1290,7 +1290,7 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev,
|
||||||
|
devpriv->amcc + AMCC_OP_REG_INTCSR);
|
||||||
|
|
||||||
|
ret = request_irq(pcidev->irq, cb_pcidas_interrupt, IRQF_SHARED,
|
||||||
|
- dev->board_name, dev);
|
||||||
|
+ "cb_pcidas", dev);
|
||||||
|
if (ret) {
|
||||||
|
dev_dbg(dev->class_dev, "unable to allocate irq %d\n",
|
||||||
|
pcidev->irq);
|
||||||
|
diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
|
||||||
|
index cb9c2699277e6..b202df1dcba05 100644
|
||||||
|
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
|
||||||
|
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
|
||||||
|
@@ -4034,7 +4034,7 @@ static int auto_attach(struct comedi_device *dev,
|
||||||
|
init_stc_registers(dev);
|
||||||
|
|
||||||
|
retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
|
||||||
|
- dev->board_name, dev);
|
||||||
|
+ "cb_pcidas64", dev);
|
||||||
|
if (retval) {
|
||||||
|
dev_dbg(dev->class_dev, "unable to allocate irq %u\n",
|
||||||
|
pcidev->irq);
|
||||||
|
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
|
||||||
|
index b895a537d3e4f..e46da4e128e09 100644
|
||||||
|
--- a/drivers/staging/rtl8192e/rtllib.h
|
||||||
|
+++ b/drivers/staging/rtl8192e/rtllib.h
|
||||||
|
@@ -1160,7 +1160,7 @@ struct rtllib_network {
|
||||||
|
bool bWithAironetIE;
|
||||||
|
bool bCkipSupported;
|
||||||
|
bool bCcxRmEnable;
|
||||||
|
- u16 CcxRmState[2];
|
||||||
|
+ u8 CcxRmState[2];
|
||||||
|
bool bMBssidValid;
|
||||||
|
u8 MBssidMask;
|
||||||
|
u8 MBssid[ETH_ALEN];
|
||||||
|
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
|
||||||
|
index c743182b933e6..247475aa522ee 100644
|
||||||
|
--- a/drivers/staging/rtl8192e/rtllib_rx.c
|
||||||
|
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
|
||||||
|
@@ -1986,7 +1986,7 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee,
|
||||||
|
info_element->data[2] == 0x96 &&
|
||||||
|
info_element->data[3] == 0x01) {
|
||||||
|
if (info_element->len == 6) {
|
||||||
|
- memcpy(network->CcxRmState, &info_element[4], 2);
|
||||||
|
+ memcpy(network->CcxRmState, &info_element->data[4], 2);
|
||||||
|
if (network->CcxRmState[0] != 0)
|
||||||
|
network->bCcxRmEnable = true;
|
||||||
|
else
|
||||||
|
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
|
||||||
|
index 9f1a1a318a3df..97b5b021a2200 100644
|
||||||
|
--- a/drivers/usb/class/cdc-acm.c
|
||||||
|
+++ b/drivers/usb/class/cdc-acm.c
|
||||||
|
@@ -335,8 +335,10 @@ static void acm_ctrl_irq(struct urb *urb)
|
||||||
|
acm->iocount.dsr++;
|
||||||
|
if (difference & ACM_CTRL_DCD)
|
||||||
|
acm->iocount.dcd++;
|
||||||
|
- if (newctrl & ACM_CTRL_BRK)
|
||||||
|
+ if (newctrl & ACM_CTRL_BRK) {
|
||||||
|
acm->iocount.brk++;
|
||||||
|
+ tty_insert_flip_char(&acm->port, 0, TTY_BREAK);
|
||||||
|
+ }
|
||||||
|
if (newctrl & ACM_CTRL_RI)
|
||||||
|
acm->iocount.rng++;
|
||||||
|
if (newctrl & ACM_CTRL_FRAMING)
|
||||||
|
@@ -541,7 +543,8 @@ static void acm_port_dtr_rts(struct tty_port *port, int raise)
|
||||||
|
|
||||||
|
res = acm_set_control(acm, val);
|
||||||
|
if (res && (acm->ctrl_caps & USB_CDC_CAP_LINE))
|
||||||
|
- dev_err(&acm->control->dev, "failed to set dtr/rts\n");
|
||||||
|
+ /* This is broken in too many devices to spam the logs */
|
||||||
|
+ dev_dbg(&acm->control->dev, "failed to set dtr/rts\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static int acm_port_activate(struct tty_port *port, struct tty_struct *tty)
|
||||||
|
@@ -1457,6 +1460,11 @@ skip_countries:
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
alloc_fail8:
|
||||||
|
+ if (!acm->combined_interfaces) {
|
||||||
|
+ /* Clear driver data so that disconnect() returns early. */
|
||||||
|
+ usb_set_intfdata(data_interface, NULL);
|
||||||
|
+ usb_driver_release_interface(&acm_driver, data_interface);
|
||||||
|
+ }
|
||||||
|
if (acm->country_codes) {
|
||||||
|
device_remove_file(&acm->control->dev,
|
||||||
|
&dev_attr_wCountryCodes);
|
||||||
|
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
|
||||||
|
index 2fc735efc3dc5..cd43e11d74f34 100644
|
||||||
|
--- a/drivers/usb/core/quirks.c
|
||||||
|
+++ b/drivers/usb/core/quirks.c
|
||||||
|
@@ -321,6 +321,10 @@ static const struct usb_device_id usb_quirk_list[] = {
|
||||||
|
/* DJI CineSSD */
|
||||||
|
{ USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM },
|
||||||
|
|
||||||
|
+ /* Fibocom L850-GL LTE Modem */
|
||||||
|
+ { USB_DEVICE(0x2cb7, 0x0007), .driver_info =
|
||||||
|
+ USB_QUIRK_IGNORE_REMOTE_WAKEUP },
|
||||||
|
+
|
||||||
|
/* INTEL VALUE SSD */
|
||||||
|
{ USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
|
||||||
|
|
||||||
|
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
|
||||||
|
index c10875834a5a0..0fe26152bae59 100644
|
||||||
|
--- a/drivers/usb/host/xhci-mtk.c
|
||||||
|
+++ b/drivers/usb/host/xhci-mtk.c
|
||||||
|
@@ -470,6 +470,13 @@ static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci)
|
||||||
|
xhci->quirks |= XHCI_SPURIOUS_SUCCESS;
|
||||||
|
if (mtk->lpm_support)
|
||||||
|
xhci->quirks |= XHCI_LPM_SUPPORT;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * MTK xHCI 0.96: PSA is 1 by default even if doesn't support stream,
|
||||||
|
+ * and it's 3 when support it.
|
||||||
|
+ */
|
||||||
|
+ if (xhci->hci_version < 0x100 && HCC_MAX_PSA(xhci->hcc_params) == 4)
|
||||||
|
+ xhci->quirks |= XHCI_BROKEN_STREAMS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* called during probe() after chip reset completes */
|
||||||
|
@@ -636,7 +643,8 @@ static int xhci_mtk_probe(struct platform_device *pdev)
|
||||||
|
if (ret)
|
||||||
|
goto put_usb3_hcd;
|
||||||
|
|
||||||
|
- if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
|
||||||
|
+ if (HCC_MAX_PSA(xhci->hcc_params) >= 4 &&
|
||||||
|
+ !(xhci->quirks & XHCI_BROKEN_STREAMS))
|
||||||
|
xhci->shared_hcd->can_do_streams = 1;
|
||||||
|
|
||||||
|
ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
|
||||||
|
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
|
||||||
|
index b14e62f110752..d2431afeda847 100644
|
||||||
|
--- a/drivers/vhost/vhost.c
|
||||||
|
+++ b/drivers/vhost/vhost.c
|
||||||
|
@@ -306,8 +306,8 @@ static void vhost_vq_reset(struct vhost_dev *dev,
|
||||||
|
vq->call_ctx = NULL;
|
||||||
|
vq->call = NULL;
|
||||||
|
vq->log_ctx = NULL;
|
||||||
|
- vhost_reset_is_le(vq);
|
||||||
|
vhost_disable_cross_endian(vq);
|
||||||
|
+ vhost_reset_is_le(vq);
|
||||||
|
vq->busyloop_timeout = 0;
|
||||||
|
vq->umem = NULL;
|
||||||
|
vq->iotlb = NULL;
|
||||||
|
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
|
||||||
|
index aa97a3ed3d8f7..79c067f74253e 100644
|
||||||
|
--- a/fs/ext4/inode.c
|
||||||
|
+++ b/fs/ext4/inode.c
|
||||||
|
@@ -1978,13 +1978,13 @@ static int __ext4_journalled_writepage(struct page *page,
|
||||||
|
if (!ret)
|
||||||
|
ret = err;
|
||||||
|
|
||||||
|
- if (!ext4_has_inline_data(inode))
|
||||||
|
- ext4_walk_page_buffers(NULL, page_bufs, 0, len,
|
||||||
|
- NULL, bput_one);
|
||||||
|
ext4_set_inode_state(inode, EXT4_STATE_JDATA);
|
||||||
|
out:
|
||||||
|
unlock_page(page);
|
||||||
|
out_no_pagelock:
|
||||||
|
+ if (!inline_data && page_bufs)
|
||||||
|
+ ext4_walk_page_buffers(NULL, page_bufs, 0, len,
|
||||||
|
+ NULL, bput_one);
|
||||||
|
brelse(inode_bh);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
|
||||||
|
index e6e3eb8dd4d6c..bbda3ea7039f3 100644
|
||||||
|
--- a/fs/ext4/namei.c
|
||||||
|
+++ b/fs/ext4/namei.c
|
||||||
|
@@ -3615,7 +3615,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||||
|
*/
|
||||||
|
retval = -ENOENT;
|
||||||
|
if (!old.bh || le32_to_cpu(old.de->inode) != old.inode->i_ino)
|
||||||
|
- goto end_rename;
|
||||||
|
+ goto release_bh;
|
||||||
|
|
||||||
|
if ((old.dir != new.dir) &&
|
||||||
|
ext4_encrypted_inode(new.dir) &&
|
||||||
|
@@ -3629,7 +3629,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||||
|
if (IS_ERR(new.bh)) {
|
||||||
|
retval = PTR_ERR(new.bh);
|
||||||
|
new.bh = NULL;
|
||||||
|
- goto end_rename;
|
||||||
|
+ goto release_bh;
|
||||||
|
}
|
||||||
|
if (new.bh) {
|
||||||
|
if (!new.inode) {
|
||||||
|
@@ -3646,15 +3646,13 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||||
|
handle = ext4_journal_start(old.dir, EXT4_HT_DIR, credits);
|
||||||
|
if (IS_ERR(handle)) {
|
||||||
|
retval = PTR_ERR(handle);
|
||||||
|
- handle = NULL;
|
||||||
|
- goto end_rename;
|
||||||
|
+ goto release_bh;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
whiteout = ext4_whiteout_for_rename(&old, credits, &handle);
|
||||||
|
if (IS_ERR(whiteout)) {
|
||||||
|
retval = PTR_ERR(whiteout);
|
||||||
|
- whiteout = NULL;
|
||||||
|
- goto end_rename;
|
||||||
|
+ goto release_bh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -3762,16 +3760,18 @@ end_rename:
|
||||||
|
ext4_resetent(handle, &old,
|
||||||
|
old.inode->i_ino, old_file_type);
|
||||||
|
drop_nlink(whiteout);
|
||||||
|
+ ext4_orphan_add(handle, whiteout);
|
||||||
|
}
|
||||||
|
unlock_new_inode(whiteout);
|
||||||
|
+ ext4_journal_stop(handle);
|
||||||
|
iput(whiteout);
|
||||||
|
-
|
||||||
|
+ } else {
|
||||||
|
+ ext4_journal_stop(handle);
|
||||||
|
}
|
||||||
|
+release_bh:
|
||||||
|
brelse(old.dir_bh);
|
||||||
|
brelse(old.bh);
|
||||||
|
brelse(new.bh);
|
||||||
|
- if (handle)
|
||||||
|
- ext4_journal_stop(handle);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/fs/reiserfs/xattr.h b/fs/reiserfs/xattr.h
|
||||||
|
index 613ff5aef94ea..19ca3745301fd 100644
|
||||||
|
--- a/fs/reiserfs/xattr.h
|
||||||
|
+++ b/fs/reiserfs/xattr.h
|
||||||
|
@@ -42,7 +42,7 @@ void reiserfs_security_free(struct reiserfs_security_handle *sec);
|
||||||
|
|
||||||
|
static inline int reiserfs_xattrs_initialized(struct super_block *sb)
|
||||||
|
{
|
||||||
|
- return REISERFS_SB(sb)->priv_root != NULL;
|
||||||
|
+ return REISERFS_SB(sb)->priv_root && REISERFS_SB(sb)->xattr_root;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define xattr_size(size) ((size) + sizeof(struct reiserfs_xattr_header))
|
||||||
|
diff --git a/kernel/audit.c b/kernel/audit.c
|
||||||
|
index af1e00f52bd01..7fa9020e728ea 100644
|
||||||
|
--- a/kernel/audit.c
|
||||||
|
+++ b/kernel/audit.c
|
||||||
|
@@ -535,7 +535,7 @@ static int kauditd_thread(void *dummy)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
-int audit_send_list(void *_dest)
|
||||||
|
+int audit_send_list_thread(void *_dest)
|
||||||
|
{
|
||||||
|
struct audit_netlink_list *dest = _dest;
|
||||||
|
struct sk_buff *skb;
|
||||||
|
@@ -580,6 +580,18 @@ out_kfree_skb:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void audit_free_reply(struct audit_reply *reply)
|
||||||
|
+{
|
||||||
|
+ if (!reply)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ if (reply->skb)
|
||||||
|
+ kfree_skb(reply->skb);
|
||||||
|
+ if (reply->net)
|
||||||
|
+ put_net(reply->net);
|
||||||
|
+ kfree(reply);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int audit_send_reply_thread(void *arg)
|
||||||
|
{
|
||||||
|
struct audit_reply *reply = (struct audit_reply *)arg;
|
||||||
|
@@ -592,8 +604,8 @@ static int audit_send_reply_thread(void *arg)
|
||||||
|
/* Ignore failure. It'll only happen if the sender goes away,
|
||||||
|
because our timeout is set to infinite. */
|
||||||
|
netlink_unicast(aunet->nlsk , reply->skb, reply->portid, 0);
|
||||||
|
- put_net(net);
|
||||||
|
- kfree(reply);
|
||||||
|
+ reply->skb = NULL;
|
||||||
|
+ audit_free_reply(reply);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
@@ -606,36 +618,34 @@ static int audit_send_reply_thread(void *arg)
|
||||||
|
* @payload: payload data
|
||||||
|
* @size: payload size
|
||||||
|
*
|
||||||
|
- * Allocates an skb, builds the netlink message, and sends it to the port id.
|
||||||
|
- * No failure notifications.
|
||||||
|
+ * Allocates a skb, builds the netlink message, and sends it to the port id.
|
||||||
|
*/
|
||||||
|
static void audit_send_reply(struct sk_buff *request_skb, int seq, int type, int done,
|
||||||
|
int multi, const void *payload, int size)
|
||||||
|
{
|
||||||
|
u32 portid = NETLINK_CB(request_skb).portid;
|
||||||
|
- struct net *net = sock_net(NETLINK_CB(request_skb).sk);
|
||||||
|
- struct sk_buff *skb;
|
||||||
|
struct task_struct *tsk;
|
||||||
|
- struct audit_reply *reply = kmalloc(sizeof(struct audit_reply),
|
||||||
|
- GFP_KERNEL);
|
||||||
|
+ struct audit_reply *reply;
|
||||||
|
|
||||||
|
+ reply = kzalloc(sizeof(*reply), GFP_KERNEL);
|
||||||
|
if (!reply)
|
||||||
|
return;
|
||||||
|
|
||||||
|
- skb = audit_make_reply(portid, seq, type, done, multi, payload, size);
|
||||||
|
- if (!skb)
|
||||||
|
- goto out;
|
||||||
|
+ reply->skb = audit_make_reply(portid, seq, type, done, multi, payload, size);
|
||||||
|
+ if (!reply->skb)
|
||||||
|
+ goto err;
|
||||||
|
|
||||||
|
- reply->net = get_net(net);
|
||||||
|
+ reply->net = get_net(sock_net(NETLINK_CB(request_skb).sk));
|
||||||
|
reply->portid = portid;
|
||||||
|
- reply->skb = skb;
|
||||||
|
|
||||||
|
tsk = kthread_run(audit_send_reply_thread, reply, "audit_send_reply");
|
||||||
|
- if (!IS_ERR(tsk))
|
||||||
|
- return;
|
||||||
|
- kfree_skb(skb);
|
||||||
|
-out:
|
||||||
|
- kfree(reply);
|
||||||
|
+ if (IS_ERR(tsk))
|
||||||
|
+ goto err;
|
||||||
|
+
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+err:
|
||||||
|
+ audit_free_reply(reply);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
diff --git a/kernel/audit.h b/kernel/audit.h
|
||||||
|
index 431444c3708bf..2eaf450188374 100644
|
||||||
|
--- a/kernel/audit.h
|
||||||
|
+++ b/kernel/audit.h
|
||||||
|
@@ -245,7 +245,7 @@ struct audit_netlink_list {
|
||||||
|
struct sk_buff_head q;
|
||||||
|
};
|
||||||
|
|
||||||
|
-int audit_send_list(void *);
|
||||||
|
+int audit_send_list_thread(void *);
|
||||||
|
|
||||||
|
struct audit_net {
|
||||||
|
struct sock *nlsk;
|
||||||
|
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
|
||||||
|
index a71ff9965cba6..cd12d79d1b176 100644
|
||||||
|
--- a/kernel/auditfilter.c
|
||||||
|
+++ b/kernel/auditfilter.c
|
||||||
|
@@ -1139,10 +1139,8 @@ int audit_rule_change(int type, __u32 portid, int seq, void *data,
|
||||||
|
int audit_list_rules_send(struct sk_buff *request_skb, int seq)
|
||||||
|
{
|
||||||
|
u32 portid = NETLINK_CB(request_skb).portid;
|
||||||
|
- struct net *net = sock_net(NETLINK_CB(request_skb).sk);
|
||||||
|
struct task_struct *tsk;
|
||||||
|
struct audit_netlink_list *dest;
|
||||||
|
- int err = 0;
|
||||||
|
|
||||||
|
/* We can't just spew out the rules here because we might fill
|
||||||
|
* the available socket buffer space and deadlock waiting for
|
||||||
|
@@ -1150,10 +1148,10 @@ int audit_list_rules_send(struct sk_buff *request_skb, int seq)
|
||||||
|
* happen if we're actually running in the context of auditctl
|
||||||
|
* trying to _send_ the stuff */
|
||||||
|
|
||||||
|
- dest = kmalloc(sizeof(struct audit_netlink_list), GFP_KERNEL);
|
||||||
|
+ dest = kmalloc(sizeof(*dest), GFP_KERNEL);
|
||||||
|
if (!dest)
|
||||||
|
return -ENOMEM;
|
||||||
|
- dest->net = get_net(net);
|
||||||
|
+ dest->net = get_net(sock_net(NETLINK_CB(request_skb).sk));
|
||||||
|
dest->portid = portid;
|
||||||
|
skb_queue_head_init(&dest->q);
|
||||||
|
|
||||||
|
@@ -1161,14 +1159,15 @@ int audit_list_rules_send(struct sk_buff *request_skb, int seq)
|
||||||
|
audit_list_rules(portid, seq, &dest->q);
|
||||||
|
mutex_unlock(&audit_filter_mutex);
|
||||||
|
|
||||||
|
- tsk = kthread_run(audit_send_list, dest, "audit_send_list");
|
||||||
|
+ tsk = kthread_run(audit_send_list_thread, dest, "audit_send_list");
|
||||||
|
if (IS_ERR(tsk)) {
|
||||||
|
skb_queue_purge(&dest->q);
|
||||||
|
+ put_net(dest->net);
|
||||||
|
kfree(dest);
|
||||||
|
- err = PTR_ERR(tsk);
|
||||||
|
+ return PTR_ERR(tsk);
|
||||||
|
}
|
||||||
|
|
||||||
|
- return err;
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int audit_comparator(u32 left, u32 op, u32 right)
|
||||||
|
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
|
||||||
|
index b87ab105fa22b..8c6b682b83b80 100644
|
||||||
|
--- a/kernel/trace/trace.c
|
||||||
|
+++ b/kernel/trace/trace.c
|
||||||
|
@@ -2225,7 +2225,8 @@ static void __ftrace_trace_stack(struct ring_buffer *buffer,
|
||||||
|
size *= sizeof(unsigned long);
|
||||||
|
|
||||||
|
event = trace_buffer_lock_reserve(buffer, TRACE_STACK,
|
||||||
|
- sizeof(*entry) + size, flags, pc);
|
||||||
|
+ (sizeof(*entry) - sizeof(entry->caller)) + size,
|
||||||
|
+ flags, pc);
|
||||||
|
if (!event)
|
||||||
|
goto out;
|
||||||
|
entry = ring_buffer_event_data(event);
|
||||||
|
diff --git a/mm/memory.c b/mm/memory.c
|
||||||
|
index d1cc9923320b4..be592d434ad89 100644
|
||||||
|
--- a/mm/memory.c
|
||||||
|
+++ b/mm/memory.c
|
||||||
|
@@ -132,7 +132,7 @@ static int __init init_zero_pfn(void)
|
||||||
|
zero_pfn = page_to_pfn(ZERO_PAGE(0));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
-core_initcall(init_zero_pfn);
|
||||||
|
+early_initcall(init_zero_pfn);
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(SPLIT_RSS_COUNTING)
|
||||||
|
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
|
||||||
|
index 93209c009df58..a66de21671ace 100644
|
||||||
|
--- a/net/appletalk/ddp.c
|
||||||
|
+++ b/net/appletalk/ddp.c
|
||||||
|
@@ -1575,8 +1575,8 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
|
||||||
|
struct sk_buff *skb;
|
||||||
|
struct net_device *dev;
|
||||||
|
struct ddpehdr *ddp;
|
||||||
|
- int size;
|
||||||
|
- struct atalk_route *rt;
|
||||||
|
+ int size, hard_header_len;
|
||||||
|
+ struct atalk_route *rt, *rt_lo = NULL;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
if (flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT))
|
||||||
|
@@ -1639,7 +1639,22 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
|
||||||
|
SOCK_DEBUG(sk, "SK %p: Size needed %d, device %s\n",
|
||||||
|
sk, size, dev->name);
|
||||||
|
|
||||||
|
- size += dev->hard_header_len;
|
||||||
|
+ hard_header_len = dev->hard_header_len;
|
||||||
|
+ /* Leave room for loopback hardware header if necessary */
|
||||||
|
+ if (usat->sat_addr.s_node == ATADDR_BCAST &&
|
||||||
|
+ (dev->flags & IFF_LOOPBACK || !(rt->flags & RTF_GATEWAY))) {
|
||||||
|
+ struct atalk_addr at_lo;
|
||||||
|
+
|
||||||
|
+ at_lo.s_node = 0;
|
||||||
|
+ at_lo.s_net = 0;
|
||||||
|
+
|
||||||
|
+ rt_lo = atrtr_find(&at_lo);
|
||||||
|
+
|
||||||
|
+ if (rt_lo && rt_lo->dev->hard_header_len > hard_header_len)
|
||||||
|
+ hard_header_len = rt_lo->dev->hard_header_len;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ size += hard_header_len;
|
||||||
|
release_sock(sk);
|
||||||
|
skb = sock_alloc_send_skb(sk, size, (flags & MSG_DONTWAIT), &err);
|
||||||
|
lock_sock(sk);
|
||||||
|
@@ -1647,7 +1662,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
skb_reserve(skb, ddp_dl->header_length);
|
||||||
|
- skb_reserve(skb, dev->hard_header_len);
|
||||||
|
+ skb_reserve(skb, hard_header_len);
|
||||||
|
skb->dev = dev;
|
||||||
|
|
||||||
|
SOCK_DEBUG(sk, "SK %p: Begin build.\n", sk);
|
||||||
|
@@ -1698,18 +1713,12 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
|
||||||
|
/* loop back */
|
||||||
|
skb_orphan(skb);
|
||||||
|
if (ddp->deh_dnode == ATADDR_BCAST) {
|
||||||
|
- struct atalk_addr at_lo;
|
||||||
|
-
|
||||||
|
- at_lo.s_node = 0;
|
||||||
|
- at_lo.s_net = 0;
|
||||||
|
-
|
||||||
|
- rt = atrtr_find(&at_lo);
|
||||||
|
- if (!rt) {
|
||||||
|
+ if (!rt_lo) {
|
||||||
|
kfree_skb(skb);
|
||||||
|
err = -ENETUNREACH;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
- dev = rt->dev;
|
||||||
|
+ dev = rt_lo->dev;
|
||||||
|
skb->dev = dev;
|
||||||
|
}
|
||||||
|
ddp_dl->request(ddp_dl, skb, dev->dev_addr);
|
||||||
|
diff --git a/net/core/filter.c b/net/core/filter.c
|
||||||
|
index e8c89d2d2bc04..94bf897485db0 100644
|
||||||
|
--- a/net/core/filter.c
|
||||||
|
+++ b/net/core/filter.c
|
||||||
|
@@ -2120,10 +2120,7 @@ static u32 __bpf_skb_min_len(const struct sk_buff *skb)
|
||||||
|
return min_len;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static u32 __bpf_skb_max_len(const struct sk_buff *skb)
|
||||||
|
-{
|
||||||
|
- return skb->dev->mtu + skb->dev->hard_header_len;
|
||||||
|
-}
|
||||||
|
+#define BPF_SKB_MAX_LEN SKB_MAX_ALLOC
|
||||||
|
|
||||||
|
static int bpf_skb_grow_rcsum(struct sk_buff *skb, unsigned int new_len)
|
||||||
|
{
|
||||||
|
@@ -2144,7 +2141,7 @@ static int bpf_skb_trim_rcsum(struct sk_buff *skb, unsigned int new_len)
|
||||||
|
BPF_CALL_3(bpf_skb_change_tail, struct sk_buff *, skb, u32, new_len,
|
||||||
|
u64, flags)
|
||||||
|
{
|
||||||
|
- u32 max_len = __bpf_skb_max_len(skb);
|
||||||
|
+ u32 max_len = BPF_SKB_MAX_LEN;
|
||||||
|
u32 min_len = __bpf_skb_min_len(skb);
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
|
||||||
|
index 9438873fc3c87..ae62c29472785 100644
|
||||||
|
--- a/net/dccp/ipv6.c
|
||||||
|
+++ b/net/dccp/ipv6.c
|
||||||
|
@@ -317,6 +317,11 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
|
||||||
|
if (!ipv6_unicast_destination(skb))
|
||||||
|
return 0; /* discard, don't send a reset here */
|
||||||
|
|
||||||
|
+ if (ipv6_addr_v4mapped(&ipv6_hdr(skb)->saddr)) {
|
||||||
|
+ __IP6_INC_STATS(sock_net(sk), NULL, IPSTATS_MIB_INHDRERRORS);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (dccp_bad_service_code(sk, service)) {
|
||||||
|
dcb->dccpd_reset_code = DCCP_RESET_CODE_BAD_SERVICE_CODE;
|
||||||
|
goto drop;
|
||||||
|
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
|
||||||
|
index e726a61ae6dc1..aacfb4bce1533 100644
|
||||||
|
--- a/net/ipv6/ip6_input.c
|
||||||
|
+++ b/net/ipv6/ip6_input.c
|
||||||
|
@@ -168,16 +168,6 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
|
||||||
|
if (ipv6_addr_is_multicast(&hdr->saddr))
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
- /* While RFC4291 is not explicit about v4mapped addresses
|
||||||
|
- * in IPv6 headers, it seems clear linux dual-stack
|
||||||
|
- * model can not deal properly with these.
|
||||||
|
- * Security models could be fooled by ::ffff:127.0.0.1 for example.
|
||||||
|
- *
|
||||||
|
- * https://tools.ietf.org/html/draft-itojun-v6ops-v4mapped-harmful-02
|
||||||
|
- */
|
||||||
|
- if (ipv6_addr_v4mapped(&hdr->saddr))
|
||||||
|
- goto err;
|
||||||
|
-
|
||||||
|
skb->transport_header = skb->network_header + sizeof(*hdr);
|
||||||
|
IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
|
||||||
|
|
||||||
|
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
|
||||||
|
index 7b336b7803ffa..dfddf2bfa7e1a 100644
|
||||||
|
--- a/net/ipv6/tcp_ipv6.c
|
||||||
|
+++ b/net/ipv6/tcp_ipv6.c
|
||||||
|
@@ -986,6 +986,11 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
|
||||||
|
if (!ipv6_unicast_destination(skb))
|
||||||
|
goto drop;
|
||||||
|
|
||||||
|
+ if (ipv6_addr_v4mapped(&ipv6_hdr(skb)->saddr)) {
|
||||||
|
+ __IP6_INC_STATS(sock_net(sk), NULL, IPSTATS_MIB_INHDRERRORS);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
return tcp_conn_request(&tcp6_request_sock_ops,
|
||||||
|
&tcp_request_sock_ipv6_ops, sk, skb);
|
||||||
|
|
||||||
|
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
|
||||||
|
index fd897d900d123..85ad23d9a8a9b 100644
|
||||||
|
--- a/net/sunrpc/auth_gss/svcauth_gss.c
|
||||||
|
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
|
||||||
|
@@ -1705,11 +1705,14 @@ static int
|
||||||
|
svcauth_gss_release(struct svc_rqst *rqstp)
|
||||||
|
{
|
||||||
|
struct gss_svc_data *gsd = (struct gss_svc_data *)rqstp->rq_auth_data;
|
||||||
|
- struct rpc_gss_wire_cred *gc = &gsd->clcred;
|
||||||
|
+ struct rpc_gss_wire_cred *gc;
|
||||||
|
struct xdr_buf *resbuf = &rqstp->rq_res;
|
||||||
|
int stat = -EINVAL;
|
||||||
|
struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id);
|
||||||
|
|
||||||
|
+ if (!gsd)
|
||||||
|
+ goto out;
|
||||||
|
+ gc = &gsd->clcred;
|
||||||
|
if (gc->gc_proc != RPC_GSS_PROC_DATA)
|
||||||
|
goto out;
|
||||||
|
/* Release can be called twice, but we only wrap once. */
|
||||||
|
@@ -1750,10 +1753,10 @@ out_err:
|
||||||
|
if (rqstp->rq_cred.cr_group_info)
|
||||||
|
put_group_info(rqstp->rq_cred.cr_group_info);
|
||||||
|
rqstp->rq_cred.cr_group_info = NULL;
|
||||||
|
- if (gsd->rsci)
|
||||||
|
+ if (gsd && gsd->rsci) {
|
||||||
|
cache_put(&gsd->rsci->h, sn->rsc_cache);
|
||||||
|
- gsd->rsci = NULL;
|
||||||
|
-
|
||||||
|
+ gsd->rsci = NULL;
|
||||||
|
+ }
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
|
||||||
|
index bd3a5ef8e59b9..2fecdfe49bae3 100644
|
||||||
|
--- a/net/vmw_vsock/af_vsock.c
|
||||||
|
+++ b/net/vmw_vsock/af_vsock.c
|
||||||
|
@@ -650,6 +650,7 @@ struct sock *__vsock_create(struct net *net,
|
||||||
|
vsk->trusted = psk->trusted;
|
||||||
|
vsk->owner = get_cred(psk->owner);
|
||||||
|
vsk->connect_timeout = psk->connect_timeout;
|
||||||
|
+ security_sk_clone(parent, sk);
|
||||||
|
} else {
|
||||||
|
vsk->trusted = ns_capable_noaudit(&init_user_ns, CAP_NET_ADMIN);
|
||||||
|
vsk->owner = get_current_cred();
|
||||||
|
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
|
||||||
|
index b003cb07254a8..79c45046edc61 100644
|
||||||
|
--- a/sound/pci/hda/patch_realtek.c
|
||||||
|
+++ b/sound/pci/hda/patch_realtek.c
|
||||||
|
@@ -4304,6 +4304,7 @@ static void alc_update_headset_jack_cb(struct hda_codec *codec,
|
||||||
|
struct alc_spec *spec = codec->spec;
|
||||||
|
spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
|
||||||
|
snd_hda_gen_hp_automute(codec, jack);
|
||||||
|
+ alc_update_headset_mode(codec);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void alc_probe_headset_mode(struct hda_codec *codec)
|
||||||
|
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
|
||||||
|
index 3cc1135fc2cd1..81fbbcaf8121c 100644
|
||||||
|
--- a/sound/soc/codecs/rt5640.c
|
||||||
|
+++ b/sound/soc/codecs/rt5640.c
|
||||||
|
@@ -341,9 +341,9 @@ static bool rt5640_readable_register(struct device *dev, unsigned int reg)
|
||||||
|
}
|
||||||
|
|
||||||
|
static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0);
|
||||||
|
-static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0);
|
||||||
|
+static const DECLARE_TLV_DB_MINMAX(dac_vol_tlv, -6562, 0);
|
||||||
|
static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);
|
||||||
|
-static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0);
|
||||||
|
+static const DECLARE_TLV_DB_MINMAX(adc_vol_tlv, -1762, 3000);
|
||||||
|
static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
|
||||||
|
|
||||||
|
/* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */
|
||||||
|
diff --git a/sound/soc/codecs/rt5651.c b/sound/soc/codecs/rt5651.c
|
||||||
|
index f0c9e25624748..acd5c30694e80 100644
|
||||||
|
--- a/sound/soc/codecs/rt5651.c
|
||||||
|
+++ b/sound/soc/codecs/rt5651.c
|
||||||
|
@@ -287,9 +287,9 @@ static bool rt5651_readable_register(struct device *dev, unsigned int reg)
|
||||||
|
}
|
||||||
|
|
||||||
|
static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0);
|
||||||
|
-static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0);
|
||||||
|
+static const DECLARE_TLV_DB_MINMAX(dac_vol_tlv, -6562, 0);
|
||||||
|
static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0);
|
||||||
|
-static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0);
|
||||||
|
+static const DECLARE_TLV_DB_MINMAX(adc_vol_tlv, -1762, 3000);
|
||||||
|
static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
|
||||||
|
|
||||||
|
/* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */
|
||||||
|
diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
|
||||||
|
index 635818fcda002..21a007c264071 100644
|
||||||
|
--- a/sound/soc/codecs/rt5659.c
|
||||||
|
+++ b/sound/soc/codecs/rt5659.c
|
||||||
|
@@ -3389,12 +3389,17 @@ static int rt5659_set_dai_sysclk(struct snd_soc_dai *dai,
|
||||||
|
struct snd_soc_codec *codec = dai->codec;
|
||||||
|
struct rt5659_priv *rt5659 = snd_soc_codec_get_drvdata(codec);
|
||||||
|
unsigned int reg_val = 0;
|
||||||
|
+ int ret;
|
||||||
|
|
||||||
|
if (freq == rt5659->sysclk && clk_id == rt5659->sysclk_src)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
switch (clk_id) {
|
||||||
|
case RT5659_SCLK_S_MCLK:
|
||||||
|
+ ret = clk_set_rate(rt5659->mclk, freq);
|
||||||
|
+ if (ret)
|
||||||
|
+ return ret;
|
||||||
|
+
|
||||||
|
reg_val |= RT5659_SCLK_SRC_MCLK;
|
||||||
|
break;
|
||||||
|
case RT5659_SCLK_S_PLL1:
|
||||||
|
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
|
||||||
|
index 0c2a1413a8f57..14e564e38f3c6 100644
|
||||||
|
--- a/sound/soc/codecs/sgtl5000.c
|
||||||
|
+++ b/sound/soc/codecs/sgtl5000.c
|
||||||
|
@@ -75,7 +75,7 @@ static const struct reg_default sgtl5000_reg_defaults[] = {
|
||||||
|
{ SGTL5000_DAP_EQ_BASS_BAND4, 0x002f },
|
||||||
|
{ SGTL5000_DAP_MAIN_CHAN, 0x8000 },
|
||||||
|
{ SGTL5000_DAP_MIX_CHAN, 0x0000 },
|
||||||
|
- { SGTL5000_DAP_AVC_CTRL, 0x0510 },
|
||||||
|
+ { SGTL5000_DAP_AVC_CTRL, 0x5100 },
|
||||||
|
{ SGTL5000_DAP_AVC_THRESHOLD, 0x1473 },
|
||||||
|
{ SGTL5000_DAP_AVC_ATTACK, 0x0028 },
|
||||||
|
{ SGTL5000_DAP_AVC_DECAY, 0x0050 },
|
||||||
|
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
|
||||||
|
index 664aff41f0718..6b9e6b57d58df 100644
|
||||||
|
--- a/sound/usb/quirks.c
|
||||||
|
+++ b/sound/usb/quirks.c
|
||||||
|
@@ -1154,6 +1154,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip)
|
||||||
|
case USB_ID(0x21B4, 0x0081): /* AudioQuest DragonFly */
|
||||||
|
case USB_ID(0x2912, 0x30c8): /* Audioengine D1 */
|
||||||
|
case USB_ID(0x413c, 0xa506): /* Dell AE515 sound bar */
|
||||||
|
+ case USB_ID(0x046d, 0x084c): /* Logitech ConferenceCam Connect */
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
218
patch/kernel/archive/sun50iw9-4.9/patch-4.9.265-266.patch
Normal file
218
patch/kernel/archive/sun50iw9-4.9/patch-4.9.265-266.patch
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index f47e685de5f64..9e055c32d77ac 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 265
|
||||||
|
+SUBLEVEL = 266
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
|
||||||
|
index 9509cc73b9c64..64ae9cde8bdbd 100644
|
||||||
|
--- a/arch/ia64/kernel/mca.c
|
||||||
|
+++ b/arch/ia64/kernel/mca.c
|
||||||
|
@@ -1858,7 +1858,7 @@ ia64_mca_cpu_init(void *cpu_data)
|
||||||
|
data = mca_bootmem();
|
||||||
|
first_time = 0;
|
||||||
|
} else
|
||||||
|
- data = (void *)__get_free_pages(GFP_KERNEL,
|
||||||
|
+ data = (void *)__get_free_pages(GFP_ATOMIC,
|
||||||
|
get_order(sz));
|
||||||
|
if (!data)
|
||||||
|
panic("Could not allocate MCA memory for cpu %d\n",
|
||||||
|
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
|
||||||
|
index 9f0099c46c881..9ebbd4892557e 100644
|
||||||
|
--- a/arch/x86/Makefile
|
||||||
|
+++ b/arch/x86/Makefile
|
||||||
|
@@ -34,7 +34,7 @@ REALMODE_CFLAGS := $(M16_CFLAGS) -g -Os -D__KERNEL__ \
|
||||||
|
-DDISABLE_BRANCH_PROFILING \
|
||||||
|
-Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
|
||||||
|
-fno-strict-aliasing -fomit-frame-pointer -fno-pic \
|
||||||
|
- -mno-mmx -mno-sse
|
||||||
|
+ -mno-mmx -mno-sse $(call cc-option,-fcf-protection=none)
|
||||||
|
|
||||||
|
REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -ffreestanding)
|
||||||
|
REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -fno-stack-protector)
|
||||||
|
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
|
||||||
|
index eb5734112cb49..1d1434f9c5a60 100644
|
||||||
|
--- a/arch/x86/net/bpf_jit_comp.c
|
||||||
|
+++ b/arch/x86/net/bpf_jit_comp.c
|
||||||
|
@@ -1082,7 +1082,16 @@ common_load:
|
||||||
|
}
|
||||||
|
|
||||||
|
if (image) {
|
||||||
|
- if (unlikely(proglen + ilen > oldproglen)) {
|
||||||
|
+ /*
|
||||||
|
+ * When populating the image, assert that:
|
||||||
|
+ *
|
||||||
|
+ * i) We do not write beyond the allocated space, and
|
||||||
|
+ * ii) addrs[i] did not change from the prior run, in order
|
||||||
|
+ * to validate assumptions made for computing branch
|
||||||
|
+ * displacements.
|
||||||
|
+ */
|
||||||
|
+ if (unlikely(proglen + ilen > oldproglen ||
|
||||||
|
+ proglen + ilen != addrs[i])) {
|
||||||
|
pr_err("bpf_jit_compile fatal error\n");
|
||||||
|
return -EFAULT;
|
||||||
|
}
|
||||||
|
diff --git a/drivers/gpu/drm/msm/msm_fence.c b/drivers/gpu/drm/msm/msm_fence.c
|
||||||
|
index a9b9b1c95a2eb..9dbd17be51f7c 100644
|
||||||
|
--- a/drivers/gpu/drm/msm/msm_fence.c
|
||||||
|
+++ b/drivers/gpu/drm/msm/msm_fence.c
|
||||||
|
@@ -56,7 +56,7 @@ int msm_wait_fence(struct msm_fence_context *fctx, uint32_t fence,
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (fence > fctx->last_fence) {
|
||||||
|
- DRM_ERROR("%s: waiting on invalid fence: %u (of %u)\n",
|
||||||
|
+ DRM_ERROR_RATELIMITED("%s: waiting on invalid fence: %u (of %u)\n",
|
||||||
|
fctx->name, fence, fctx->last_fence);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
diff --git a/drivers/isdn/hardware/mISDN/mISDNipac.c b/drivers/isdn/hardware/mISDN/mISDNipac.c
|
||||||
|
index 8d338ba366d0a..01a1afde5d3c5 100644
|
||||||
|
--- a/drivers/isdn/hardware/mISDN/mISDNipac.c
|
||||||
|
+++ b/drivers/isdn/hardware/mISDN/mISDNipac.c
|
||||||
|
@@ -711,7 +711,7 @@ isac_release(struct isac_hw *isac)
|
||||||
|
{
|
||||||
|
if (isac->type & IPAC_TYPE_ISACX)
|
||||||
|
WriteISAC(isac, ISACX_MASK, 0xff);
|
||||||
|
- else
|
||||||
|
+ else if (isac->type != 0)
|
||||||
|
WriteISAC(isac, ISAC_MASK, 0xff);
|
||||||
|
if (isac->dch.timer.function != NULL) {
|
||||||
|
del_timer(&isac->dch.timer);
|
||||||
|
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
|
||||||
|
index b18bb0334ded6..dcad5213eb348 100644
|
||||||
|
--- a/drivers/net/can/flexcan.c
|
||||||
|
+++ b/drivers/net/can/flexcan.c
|
||||||
|
@@ -379,9 +379,15 @@ static int flexcan_chip_disable(struct flexcan_priv *priv)
|
||||||
|
static int flexcan_chip_freeze(struct flexcan_priv *priv)
|
||||||
|
{
|
||||||
|
struct flexcan_regs __iomem *regs = priv->regs;
|
||||||
|
- unsigned int timeout = 1000 * 1000 * 10 / priv->can.bittiming.bitrate;
|
||||||
|
+ unsigned int timeout;
|
||||||
|
+ u32 bitrate = priv->can.bittiming.bitrate;
|
||||||
|
u32 reg;
|
||||||
|
|
||||||
|
+ if (bitrate)
|
||||||
|
+ timeout = 1000 * 1000 * 10 / bitrate;
|
||||||
|
+ else
|
||||||
|
+ timeout = FLEXCAN_TIMEOUT_US / 10;
|
||||||
|
+
|
||||||
|
reg = flexcan_read(®s->mcr);
|
||||||
|
reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT;
|
||||||
|
flexcan_write(reg, ®s->mcr);
|
||||||
|
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
|
||||||
|
index 5d5000c8edf1d..09cb0ac701e11 100644
|
||||||
|
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
|
||||||
|
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
|
||||||
|
@@ -1571,8 +1571,8 @@ static int pxa168_eth_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
|
mdiobus_unregister(pep->smi_bus);
|
||||||
|
mdiobus_free(pep->smi_bus);
|
||||||
|
- unregister_netdev(dev);
|
||||||
|
cancel_work_sync(&pep->tx_timeout_task);
|
||||||
|
+ unregister_netdev(dev);
|
||||||
|
free_netdev(dev);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
|
||||||
|
index ef1c8c158f66b..079db0bd39174 100644
|
||||||
|
--- a/drivers/target/target_core_pscsi.c
|
||||||
|
+++ b/drivers/target/target_core_pscsi.c
|
||||||
|
@@ -951,6 +951,14 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
fail:
|
||||||
|
+ if (bio)
|
||||||
|
+ bio_put(bio);
|
||||||
|
+ while (req->bio) {
|
||||||
|
+ bio = req->bio;
|
||||||
|
+ req->bio = bio->bi_next;
|
||||||
|
+ bio_put(bio);
|
||||||
|
+ }
|
||||||
|
+ req->biotail = NULL;
|
||||||
|
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
|
||||||
|
index 24508b69e78b7..e2ce90fc504ec 100644
|
||||||
|
--- a/fs/cifs/file.c
|
||||||
|
+++ b/fs/cifs/file.c
|
||||||
|
@@ -163,6 +163,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
|
||||||
|
goto posix_open_ret;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
+ cifs_revalidate_mapping(*pinode);
|
||||||
|
cifs_fattr_to_inode(*pinode, &fattr);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
|
||||||
|
index bddb2d7b39824..075b285bbd3ea 100644
|
||||||
|
--- a/fs/cifs/smb2misc.c
|
||||||
|
+++ b/fs/cifs/smb2misc.c
|
||||||
|
@@ -651,8 +651,8 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spin_unlock(&cifs_tcp_ses_lock);
|
||||||
|
- cifs_dbg(FYI, "Can not process oplock break for non-existent connection\n");
|
||||||
|
- return false;
|
||||||
|
+ cifs_dbg(FYI, "No file id matched, oplock break ignored\n");
|
||||||
|
+ return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
diff --git a/init/Kconfig b/init/Kconfig
|
||||||
|
index 0a615bdc203a4..07570008e2fd9 100644
|
||||||
|
--- a/init/Kconfig
|
||||||
|
+++ b/init/Kconfig
|
||||||
|
@@ -65,8 +65,7 @@ config CROSS_COMPILE
|
||||||
|
|
||||||
|
config COMPILE_TEST
|
||||||
|
bool "Compile also drivers which will not load"
|
||||||
|
- depends on !UML
|
||||||
|
- default n
|
||||||
|
+ depends on HAS_IOMEM
|
||||||
|
help
|
||||||
|
Some drivers can be compiled on a different platform than they are
|
||||||
|
intended to be run on. Despite they cannot be loaded there (or even
|
||||||
|
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
|
||||||
|
index e3bbfb20ae829..f31fd21d59ba9 100644
|
||||||
|
--- a/net/mac80211/main.c
|
||||||
|
+++ b/net/mac80211/main.c
|
||||||
|
@@ -906,8 +906,19 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!dflt_chandef.chan) {
|
||||||
|
+ /*
|
||||||
|
+ * Assign the first enabled channel to dflt_chandef
|
||||||
|
+ * from the list of channels
|
||||||
|
+ */
|
||||||
|
+ for (i = 0; i < sband->n_channels; i++)
|
||||||
|
+ if (!(sband->channels[i].flags &
|
||||||
|
+ IEEE80211_CHAN_DISABLED))
|
||||||
|
+ break;
|
||||||
|
+ /* if none found then use the first anyway */
|
||||||
|
+ if (i == sband->n_channels)
|
||||||
|
+ i = 0;
|
||||||
|
cfg80211_chandef_create(&dflt_chandef,
|
||||||
|
- &sband->channels[0],
|
||||||
|
+ &sband->channels[i],
|
||||||
|
NL80211_CHAN_NO_HT);
|
||||||
|
/* init channel we're on */
|
||||||
|
if (!local->use_chanctx && !local->_oper_chandef.chan) {
|
||||||
|
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
|
||||||
|
index 79c45046edc61..7b94170aa5ecb 100644
|
||||||
|
--- a/sound/pci/hda/patch_realtek.c
|
||||||
|
+++ b/sound/pci/hda/patch_realtek.c
|
||||||
|
@@ -6285,7 +6285,6 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
|
||||||
|
SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
|
||||||
|
ALC225_STANDARD_PINS,
|
||||||
|
{0x12, 0xb7a60130},
|
||||||
|
- {0x13, 0xb8a61140},
|
||||||
|
{0x17, 0x90170110}),
|
||||||
|
{}
|
||||||
|
};
|
||||||
1223
patch/kernel/archive/sun50iw9-4.9/patch-4.9.266-267.patch
Normal file
1223
patch/kernel/archive/sun50iw9-4.9/patch-4.9.266-267.patch
Normal file
File diff suppressed because it is too large
Load Diff
1031
patch/kernel/archive/sun50iw9-4.9/patch-4.9.267-268.patch
Normal file
1031
patch/kernel/archive/sun50iw9-4.9/patch-4.9.267-268.patch
Normal file
File diff suppressed because it is too large
Load Diff
5903
patch/kernel/archive/sun50iw9-4.9/patch-4.9.268-269.patch
Normal file
5903
patch/kernel/archive/sun50iw9-4.9/patch-4.9.268-269.patch
Normal file
File diff suppressed because it is too large
Load Diff
951
patch/kernel/archive/sun50iw9-4.9/patch-4.9.269-270.patch
Normal file
951
patch/kernel/archive/sun50iw9-4.9/patch-4.9.269-270.patch
Normal file
@@ -0,0 +1,951 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 94436a50dc9fb..e8313ffb8af98 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 269
|
||||||
|
+SUBLEVEL = 270
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c
|
||||||
|
index b4ed8b36e078d..e5f5b69a7b7bd 100644
|
||||||
|
--- a/arch/openrisc/kernel/setup.c
|
||||||
|
+++ b/arch/openrisc/kernel/setup.c
|
||||||
|
@@ -278,6 +278,8 @@ void calibrate_delay(void)
|
||||||
|
pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
|
||||||
|
loops_per_jiffy / (500000 / HZ),
|
||||||
|
(loops_per_jiffy / (5000 / HZ)) % 100, loops_per_jiffy);
|
||||||
|
+
|
||||||
|
+ of_node_put(cpu);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __init setup_arch(char **cmdline_p)
|
||||||
|
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
|
||||||
|
index 1852d19d0d7b0..86110a2abf0f0 100644
|
||||||
|
--- a/drivers/cdrom/gdrom.c
|
||||||
|
+++ b/drivers/cdrom/gdrom.c
|
||||||
|
@@ -773,6 +773,13 @@ static int probe_gdrom_setupqueue(void)
|
||||||
|
static int probe_gdrom(struct platform_device *devptr)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Ensure our "one" device is initialized properly in case of previous
|
||||||
|
+ * usages of it
|
||||||
|
+ */
|
||||||
|
+ memset(&gd, 0, sizeof(gd));
|
||||||
|
+
|
||||||
|
/* Start the device */
|
||||||
|
if (gdrom_execute_diagnostic() != 1) {
|
||||||
|
pr_warning("ATA Probe for GDROM failed\n");
|
||||||
|
@@ -850,6 +857,8 @@ static int remove_gdrom(struct platform_device *devptr)
|
||||||
|
if (gdrom_major)
|
||||||
|
unregister_blkdev(gdrom_major, GDROM_DEV_NAME);
|
||||||
|
unregister_cdrom(gd.cd_info);
|
||||||
|
+ kfree(gd.cd_info);
|
||||||
|
+ kfree(gd.toc);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@@ -865,7 +874,7 @@ static struct platform_driver gdrom_driver = {
|
||||||
|
static int __init init_gdrom(void)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
- gd.toc = NULL;
|
||||||
|
+
|
||||||
|
rc = platform_driver_register(&gdrom_driver);
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
@@ -881,8 +890,6 @@ static void __exit exit_gdrom(void)
|
||||||
|
{
|
||||||
|
platform_device_unregister(pd);
|
||||||
|
platform_driver_unregister(&gdrom_driver);
|
||||||
|
- kfree(gd.toc);
|
||||||
|
- kfree(gd.cd_info);
|
||||||
|
}
|
||||||
|
|
||||||
|
module_init(init_gdrom);
|
||||||
|
diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c
|
||||||
|
index be60bd5bab783..ee6d499edc1ba 100644
|
||||||
|
--- a/drivers/hwmon/lm80.c
|
||||||
|
+++ b/drivers/hwmon/lm80.c
|
||||||
|
@@ -630,7 +630,6 @@ static int lm80_probe(struct i2c_client *client,
|
||||||
|
struct device *dev = &client->dev;
|
||||||
|
struct device *hwmon_dev;
|
||||||
|
struct lm80_data *data;
|
||||||
|
- int rv;
|
||||||
|
|
||||||
|
data = devm_kzalloc(dev, sizeof(struct lm80_data), GFP_KERNEL);
|
||||||
|
if (!data)
|
||||||
|
@@ -643,14 +642,8 @@ static int lm80_probe(struct i2c_client *client,
|
||||||
|
lm80_init_client(client);
|
||||||
|
|
||||||
|
/* A few vars need to be filled upon startup */
|
||||||
|
- rv = lm80_read_value(client, LM80_REG_FAN_MIN(1));
|
||||||
|
- if (rv < 0)
|
||||||
|
- return rv;
|
||||||
|
- data->fan[f_min][0] = rv;
|
||||||
|
- rv = lm80_read_value(client, LM80_REG_FAN_MIN(2));
|
||||||
|
- if (rv < 0)
|
||||||
|
- return rv;
|
||||||
|
- data->fan[f_min][1] = rv;
|
||||||
|
+ data->fan[f_min][0] = lm80_read_value(client, LM80_REG_FAN_MIN(1));
|
||||||
|
+ data->fan[f_min][1] = lm80_read_value(client, LM80_REG_FAN_MIN(2));
|
||||||
|
|
||||||
|
hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
|
||||||
|
data, lm80_groups);
|
||||||
|
diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
|
||||||
|
index 186da467060cc..5fa1442fd4f11 100644
|
||||||
|
--- a/drivers/infiniband/sw/rxe/rxe_qp.c
|
||||||
|
+++ b/drivers/infiniband/sw/rxe/rxe_qp.c
|
||||||
|
@@ -258,6 +258,7 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
|
||||||
|
if (err) {
|
||||||
|
vfree(qp->sq.queue->buf);
|
||||||
|
kfree(qp->sq.queue);
|
||||||
|
+ qp->sq.queue = NULL;
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -315,6 +316,7 @@ static int rxe_qp_init_resp(struct rxe_dev *rxe, struct rxe_qp *qp,
|
||||||
|
if (err) {
|
||||||
|
vfree(qp->rq.queue->buf);
|
||||||
|
kfree(qp->rq.queue);
|
||||||
|
+ qp->rq.queue = NULL;
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -374,6 +376,11 @@ int rxe_qp_from_init(struct rxe_dev *rxe, struct rxe_qp *qp, struct rxe_pd *pd,
|
||||||
|
err2:
|
||||||
|
rxe_queue_cleanup(qp->sq.queue);
|
||||||
|
err1:
|
||||||
|
+ qp->pd = NULL;
|
||||||
|
+ qp->rcq = NULL;
|
||||||
|
+ qp->scq = NULL;
|
||||||
|
+ qp->srq = NULL;
|
||||||
|
+
|
||||||
|
if (srq)
|
||||||
|
rxe_drop_ref(srq);
|
||||||
|
rxe_drop_ref(scq);
|
||||||
|
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
|
||||||
|
index 44ceed7ac3c5b..7cebcd458943e 100644
|
||||||
|
--- a/drivers/leds/leds-lp5523.c
|
||||||
|
+++ b/drivers/leds/leds-lp5523.c
|
||||||
|
@@ -320,7 +320,7 @@ static int lp5523_init_program_engine(struct lp55xx_chip *chip)
|
||||||
|
usleep_range(3000, 6000);
|
||||||
|
ret = lp55xx_read(chip, LP5523_REG_STATUS, &status);
|
||||||
|
if (ret)
|
||||||
|
- return ret;
|
||||||
|
+ goto out;
|
||||||
|
status &= LP5523_ENG_STATUS_MASK;
|
||||||
|
|
||||||
|
if (status != LP5523_ENG_STATUS_MASK) {
|
||||||
|
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
|
||||||
|
index c04d9f22d1607..6acdbec05f702 100644
|
||||||
|
--- a/drivers/md/dm-snap.c
|
||||||
|
+++ b/drivers/md/dm-snap.c
|
||||||
|
@@ -1264,6 +1264,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
|
||||||
|
|
||||||
|
if (!s->store->chunk_size) {
|
||||||
|
ti->error = "Chunk size not set";
|
||||||
|
+ r = -EINVAL;
|
||||||
|
goto bad_read_metadata;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
|
||||||
|
index 63ebc491057b6..99fc0121da93d 100644
|
||||||
|
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
|
||||||
|
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
|
||||||
|
@@ -1039,7 +1039,7 @@ int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode)
|
||||||
|
for (i = 0; i < QLCNIC_NUM_ILB_PKT; i++) {
|
||||||
|
skb = netdev_alloc_skb(adapter->netdev, QLCNIC_ILB_PKT_SIZE);
|
||||||
|
if (!skb)
|
||||||
|
- break;
|
||||||
|
+ goto error;
|
||||||
|
qlcnic_create_loopback_buff(skb->data, adapter->mac_addr);
|
||||||
|
skb_put(skb, QLCNIC_ILB_PKT_SIZE);
|
||||||
|
adapter->ahw->diag_cnt = 0;
|
||||||
|
@@ -1063,6 +1063,7 @@ int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode)
|
||||||
|
cnt++;
|
||||||
|
}
|
||||||
|
if (cnt != i) {
|
||||||
|
+error:
|
||||||
|
dev_err(&adapter->pdev->dev,
|
||||||
|
"LB Test: failed, TX[%d], RX[%d]\n", i, cnt);
|
||||||
|
if (mode != QLCNIC_ILB_MODE)
|
||||||
|
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
|
||||||
|
index fc1fa0f9f3387..fe4128405bbb7 100644
|
||||||
|
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
|
||||||
|
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
|
||||||
|
@@ -39,7 +39,7 @@ struct sunxi_priv_data {
|
||||||
|
static int sun7i_gmac_init(struct platform_device *pdev, void *priv)
|
||||||
|
{
|
||||||
|
struct sunxi_priv_data *gmac = priv;
|
||||||
|
- int ret;
|
||||||
|
+ int ret = 0;
|
||||||
|
|
||||||
|
if (gmac->regulator) {
|
||||||
|
ret = regulator_enable(gmac->regulator);
|
||||||
|
@@ -60,11 +60,11 @@ static int sun7i_gmac_init(struct platform_device *pdev, void *priv)
|
||||||
|
} else {
|
||||||
|
clk_set_rate(gmac->tx_clk, SUN7I_GMAC_MII_RATE);
|
||||||
|
ret = clk_prepare(gmac->tx_clk);
|
||||||
|
- if (ret)
|
||||||
|
- return ret;
|
||||||
|
+ if (ret && gmac->regulator)
|
||||||
|
+ regulator_disable(gmac->regulator);
|
||||||
|
}
|
||||||
|
|
||||||
|
- return 0;
|
||||||
|
+ return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sun7i_gmac_exit(struct platform_device *pdev, void *priv)
|
||||||
|
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
|
||||||
|
index 5bf47279f9c1b..306d5d08141ee 100644
|
||||||
|
--- a/drivers/net/ethernet/sun/niu.c
|
||||||
|
+++ b/drivers/net/ethernet/sun/niu.c
|
||||||
|
@@ -8166,10 +8166,10 @@ static int niu_pci_vpd_scan_props(struct niu *np, u32 start, u32 end)
|
||||||
|
"VPD_SCAN: Reading in property [%s] len[%d]\n",
|
||||||
|
namebuf, prop_len);
|
||||||
|
for (i = 0; i < prop_len; i++) {
|
||||||
|
- err = niu_pci_eeprom_read(np, off + i);
|
||||||
|
- if (err >= 0)
|
||||||
|
- *prop_buf = err;
|
||||||
|
- ++prop_buf;
|
||||||
|
+ err = niu_pci_eeprom_read(np, off + i);
|
||||||
|
+ if (err < 0)
|
||||||
|
+ return err;
|
||||||
|
+ *prop_buf++ = err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -8180,14 +8180,14 @@ static int niu_pci_vpd_scan_props(struct niu *np, u32 start, u32 end)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ESPC_PIO_EN_ENABLE must be set */
|
||||||
|
-static void niu_pci_vpd_fetch(struct niu *np, u32 start)
|
||||||
|
+static int niu_pci_vpd_fetch(struct niu *np, u32 start)
|
||||||
|
{
|
||||||
|
u32 offset;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
err = niu_pci_eeprom_read16_swp(np, start + 1);
|
||||||
|
if (err < 0)
|
||||||
|
- return;
|
||||||
|
+ return err;
|
||||||
|
|
||||||
|
offset = err + 3;
|
||||||
|
|
||||||
|
@@ -8196,12 +8196,14 @@ static void niu_pci_vpd_fetch(struct niu *np, u32 start)
|
||||||
|
u32 end;
|
||||||
|
|
||||||
|
err = niu_pci_eeprom_read(np, here);
|
||||||
|
+ if (err < 0)
|
||||||
|
+ return err;
|
||||||
|
if (err != 0x90)
|
||||||
|
- return;
|
||||||
|
+ return -EINVAL;
|
||||||
|
|
||||||
|
err = niu_pci_eeprom_read16_swp(np, here + 1);
|
||||||
|
if (err < 0)
|
||||||
|
- return;
|
||||||
|
+ return err;
|
||||||
|
|
||||||
|
here = start + offset + 3;
|
||||||
|
end = start + offset + err;
|
||||||
|
@@ -8209,9 +8211,12 @@ static void niu_pci_vpd_fetch(struct niu *np, u32 start)
|
||||||
|
offset += err;
|
||||||
|
|
||||||
|
err = niu_pci_vpd_scan_props(np, here, end);
|
||||||
|
- if (err < 0 || err == 1)
|
||||||
|
- return;
|
||||||
|
+ if (err < 0)
|
||||||
|
+ return err;
|
||||||
|
+ if (err == 1)
|
||||||
|
+ return -EINVAL;
|
||||||
|
}
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ESPC_PIO_EN_ENABLE must be set */
|
||||||
|
@@ -9304,8 +9309,11 @@ static int niu_get_invariants(struct niu *np)
|
||||||
|
offset = niu_pci_vpd_offset(np);
|
||||||
|
netif_printk(np, probe, KERN_DEBUG, np->dev,
|
||||||
|
"%s() VPD offset [%08x]\n", __func__, offset);
|
||||||
|
- if (offset)
|
||||||
|
- niu_pci_vpd_fetch(np, offset);
|
||||||
|
+ if (offset) {
|
||||||
|
+ err = niu_pci_vpd_fetch(np, offset);
|
||||||
|
+ if (err < 0)
|
||||||
|
+ return err;
|
||||||
|
+ }
|
||||||
|
nw64(ESPC_PIO_EN, 0);
|
||||||
|
|
||||||
|
if (np->flags & NIU_FLAGS_VPD_VALID) {
|
||||||
|
diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
|
||||||
|
index 7de18ed10db8e..e1992de500b0d 100644
|
||||||
|
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
|
||||||
|
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
|
||||||
|
@@ -454,9 +454,14 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
|
||||||
|
+static int _rtl_init_deferred_work(struct ieee80211_hw *hw)
|
||||||
|
{
|
||||||
|
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||||
|
+ struct workqueue_struct *wq;
|
||||||
|
+
|
||||||
|
+ wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
|
||||||
|
+ if (!wq)
|
||||||
|
+ return -ENOMEM;
|
||||||
|
|
||||||
|
/* <1> timer */
|
||||||
|
setup_timer(&rtlpriv->works.watchdog_timer,
|
||||||
|
@@ -465,11 +470,7 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
|
||||||
|
rtl_easy_concurrent_retrytimer_callback, (unsigned long)hw);
|
||||||
|
/* <2> work queue */
|
||||||
|
rtlpriv->works.hw = hw;
|
||||||
|
- rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
|
||||||
|
- if (unlikely(!rtlpriv->works.rtl_wq)) {
|
||||||
|
- pr_err("Failed to allocate work queue\n");
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
+ rtlpriv->works.rtl_wq = wq;
|
||||||
|
|
||||||
|
INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq,
|
||||||
|
(void *)rtl_watchdog_wq_callback);
|
||||||
|
@@ -481,7 +482,7 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
|
||||||
|
(void *)rtl_swlps_rfon_wq_callback);
|
||||||
|
INIT_DELAYED_WORK(&rtlpriv->works.fwevt_wq,
|
||||||
|
(void *)rtl_fwevt_wq_callback);
|
||||||
|
-
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rtl_deinit_deferred_work(struct ieee80211_hw *hw)
|
||||||
|
@@ -573,9 +574,7 @@ int rtl_init_core(struct ieee80211_hw *hw)
|
||||||
|
rtlmac->link_state = MAC80211_NOLINK;
|
||||||
|
|
||||||
|
/* <6> init deferred work */
|
||||||
|
- _rtl_init_deferred_work(hw);
|
||||||
|
-
|
||||||
|
- return 0;
|
||||||
|
+ return _rtl_init_deferred_work(hw);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(rtl_init_core);
|
||||||
|
|
||||||
|
diff --git a/drivers/rapidio/rio_cm.c b/drivers/rapidio/rio_cm.c
|
||||||
|
index b29fc258eeba4..ab57a1eb519fc 100644
|
||||||
|
--- a/drivers/rapidio/rio_cm.c
|
||||||
|
+++ b/drivers/rapidio/rio_cm.c
|
||||||
|
@@ -2136,6 +2136,14 @@ static int riocm_add_mport(struct device *dev,
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ cm->rx_wq = create_workqueue(DRV_NAME "/rxq");
|
||||||
|
+ if (!cm->rx_wq) {
|
||||||
|
+ rio_release_inb_mbox(mport, cmbox);
|
||||||
|
+ rio_release_outb_mbox(mport, cmbox);
|
||||||
|
+ kfree(cm);
|
||||||
|
+ return -ENOMEM;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Allocate and register inbound messaging buffers to be ready
|
||||||
|
* to receive channel and system management requests
|
||||||
|
@@ -2146,15 +2154,6 @@ static int riocm_add_mport(struct device *dev,
|
||||||
|
cm->rx_slots = RIOCM_RX_RING_SIZE;
|
||||||
|
mutex_init(&cm->rx_lock);
|
||||||
|
riocm_rx_fill(cm, RIOCM_RX_RING_SIZE);
|
||||||
|
- cm->rx_wq = create_workqueue(DRV_NAME "/rxq");
|
||||||
|
- if (!cm->rx_wq) {
|
||||||
|
- riocm_error("failed to allocate IBMBOX_%d on %s",
|
||||||
|
- cmbox, mport->name);
|
||||||
|
- rio_release_outb_mbox(mport, cmbox);
|
||||||
|
- kfree(cm);
|
||||||
|
- return -ENOMEM;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
INIT_WORK(&cm->rx_work, rio_ibmsg_handler);
|
||||||
|
|
||||||
|
cm->tx_slot = 0;
|
||||||
|
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
|
||||||
|
index 104e13ae34288..9ec18463b4523 100644
|
||||||
|
--- a/drivers/scsi/qla2xxx/qla_nx.c
|
||||||
|
+++ b/drivers/scsi/qla2xxx/qla_nx.c
|
||||||
|
@@ -1102,7 +1102,8 @@ qla82xx_write_flash_dword(struct qla_hw_data *ha, uint32_t flashaddr,
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (qla82xx_flash_set_write_enable(ha))
|
||||||
|
+ ret = qla82xx_flash_set_write_enable(ha);
|
||||||
|
+ if (ret < 0)
|
||||||
|
goto done_write;
|
||||||
|
|
||||||
|
qla82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_WDATA, data);
|
||||||
|
diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
|
||||||
|
index 08f1583ee34e9..fb3ec56d45b61 100644
|
||||||
|
--- a/drivers/staging/iio/light/tsl2583.c
|
||||||
|
+++ b/drivers/staging/iio/light/tsl2583.c
|
||||||
|
@@ -382,6 +382,15 @@ static int taos_als_calibrate(struct iio_dev *indio_dev)
|
||||||
|
dev_err(&chip->client->dev, "taos_als_calibrate failed to get lux\n");
|
||||||
|
return lux_val;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /* Avoid division by zero of lux_value later on */
|
||||||
|
+ if (lux_val == 0) {
|
||||||
|
+ dev_err(&chip->client->dev,
|
||||||
|
+ "%s: lux_val of 0 will produce out of range trim_value\n",
|
||||||
|
+ __func__);
|
||||||
|
+ return -ENODATA;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
gain_trim_val = (unsigned int)(((chip->taos_settings.als_cal_target)
|
||||||
|
* chip->taos_settings.als_gain_trim) / lux_val);
|
||||||
|
|
||||||
|
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
|
||||||
|
index 2fa7527b1230e..8c74d9ebfc502 100644
|
||||||
|
--- a/drivers/tty/vt/vt.c
|
||||||
|
+++ b/drivers/tty/vt/vt.c
|
||||||
|
@@ -838,7 +838,7 @@ static inline int resize_screen(struct vc_data *vc, int width, int height,
|
||||||
|
/* Resizes the resolution of the display adapater */
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
|
- if (vc->vc_mode != KD_GRAPHICS && vc->vc_sw->con_resize)
|
||||||
|
+ if (vc->vc_sw->con_resize)
|
||||||
|
err = vc->vc_sw->con_resize(vc, width, height, user);
|
||||||
|
|
||||||
|
return err;
|
||||||
|
diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
|
||||||
|
index 275ec49b30b9f..9206fd2489353 100644
|
||||||
|
--- a/drivers/tty/vt/vt_ioctl.c
|
||||||
|
+++ b/drivers/tty/vt/vt_ioctl.c
|
||||||
|
@@ -898,17 +898,17 @@ int vt_ioctl(struct tty_struct *tty,
|
||||||
|
if (vcp) {
|
||||||
|
int ret;
|
||||||
|
int save_scan_lines = vcp->vc_scan_lines;
|
||||||
|
- int save_font_height = vcp->vc_font.height;
|
||||||
|
+ int save_cell_height = vcp->vc_cell_height;
|
||||||
|
|
||||||
|
if (v.v_vlin)
|
||||||
|
vcp->vc_scan_lines = v.v_vlin;
|
||||||
|
if (v.v_clin)
|
||||||
|
- vcp->vc_font.height = v.v_clin;
|
||||||
|
+ vcp->vc_cell_height = v.v_clin;
|
||||||
|
vcp->vc_resize_user = 1;
|
||||||
|
ret = vc_resize(vcp, v.v_cols, v.v_rows);
|
||||||
|
if (ret) {
|
||||||
|
vcp->vc_scan_lines = save_scan_lines;
|
||||||
|
- vcp->vc_font.height = save_font_height;
|
||||||
|
+ vcp->vc_cell_height = save_cell_height;
|
||||||
|
console_unlock();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
|
||||||
|
index 44df6f6fd0636..510bc3f51dccf 100644
|
||||||
|
--- a/drivers/video/console/fbcon.c
|
||||||
|
+++ b/drivers/video/console/fbcon.c
|
||||||
|
@@ -1986,7 +1986,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
DPRINTK("resize now %ix%i\n", var.xres, var.yres);
|
||||||
|
- if (con_is_visible(vc)) {
|
||||||
|
+ if (con_is_visible(vc) && vc->vc_mode == KD_TEXT) {
|
||||||
|
var.activate = FB_ACTIVATE_NOW |
|
||||||
|
FB_ACTIVATE_FORCE;
|
||||||
|
fb_set_var(info, &var);
|
||||||
|
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
|
||||||
|
index b38ee2354cbfa..cb9b879631293 100644
|
||||||
|
--- a/drivers/video/console/vgacon.c
|
||||||
|
+++ b/drivers/video/console/vgacon.c
|
||||||
|
@@ -434,7 +434,7 @@ static void vgacon_init(struct vc_data *c, int init)
|
||||||
|
vc_resize(c, vga_video_num_columns, vga_video_num_lines);
|
||||||
|
|
||||||
|
c->vc_scan_lines = vga_scan_lines;
|
||||||
|
- c->vc_font.height = vga_video_font_height;
|
||||||
|
+ c->vc_font.height = c->vc_cell_height = vga_video_font_height;
|
||||||
|
c->vc_complement_mask = 0x7700;
|
||||||
|
if (vga_512_chars)
|
||||||
|
c->vc_hi_font_mask = 0x0800;
|
||||||
|
@@ -572,32 +572,32 @@ static void vgacon_cursor(struct vc_data *c, int mode)
|
||||||
|
switch (c->vc_cursor_type & 0x0f) {
|
||||||
|
case CUR_UNDERLINE:
|
||||||
|
vgacon_set_cursor_size(c->vc_x,
|
||||||
|
- c->vc_font.height -
|
||||||
|
- (c->vc_font.height <
|
||||||
|
+ c->vc_cell_height -
|
||||||
|
+ (c->vc_cell_height <
|
||||||
|
10 ? 2 : 3),
|
||||||
|
- c->vc_font.height -
|
||||||
|
- (c->vc_font.height <
|
||||||
|
+ c->vc_cell_height -
|
||||||
|
+ (c->vc_cell_height <
|
||||||
|
10 ? 1 : 2));
|
||||||
|
break;
|
||||||
|
case CUR_TWO_THIRDS:
|
||||||
|
vgacon_set_cursor_size(c->vc_x,
|
||||||
|
- c->vc_font.height / 3,
|
||||||
|
- c->vc_font.height -
|
||||||
|
- (c->vc_font.height <
|
||||||
|
+ c->vc_cell_height / 3,
|
||||||
|
+ c->vc_cell_height -
|
||||||
|
+ (c->vc_cell_height <
|
||||||
|
10 ? 1 : 2));
|
||||||
|
break;
|
||||||
|
case CUR_LOWER_THIRD:
|
||||||
|
vgacon_set_cursor_size(c->vc_x,
|
||||||
|
- (c->vc_font.height * 2) / 3,
|
||||||
|
- c->vc_font.height -
|
||||||
|
- (c->vc_font.height <
|
||||||
|
+ (c->vc_cell_height * 2) / 3,
|
||||||
|
+ c->vc_cell_height -
|
||||||
|
+ (c->vc_cell_height <
|
||||||
|
10 ? 1 : 2));
|
||||||
|
break;
|
||||||
|
case CUR_LOWER_HALF:
|
||||||
|
vgacon_set_cursor_size(c->vc_x,
|
||||||
|
- c->vc_font.height / 2,
|
||||||
|
- c->vc_font.height -
|
||||||
|
- (c->vc_font.height <
|
||||||
|
+ c->vc_cell_height / 2,
|
||||||
|
+ c->vc_cell_height -
|
||||||
|
+ (c->vc_cell_height <
|
||||||
|
10 ? 1 : 2));
|
||||||
|
break;
|
||||||
|
case CUR_NONE:
|
||||||
|
@@ -608,7 +608,7 @@ static void vgacon_cursor(struct vc_data *c, int mode)
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
vgacon_set_cursor_size(c->vc_x, 1,
|
||||||
|
- c->vc_font.height);
|
||||||
|
+ c->vc_cell_height);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
@@ -619,13 +619,13 @@ static int vgacon_doresize(struct vc_data *c,
|
||||||
|
unsigned int width, unsigned int height)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
- unsigned int scanlines = height * c->vc_font.height;
|
||||||
|
+ unsigned int scanlines = height * c->vc_cell_height;
|
||||||
|
u8 scanlines_lo = 0, r7 = 0, vsync_end = 0, mode, max_scan;
|
||||||
|
|
||||||
|
raw_spin_lock_irqsave(&vga_lock, flags);
|
||||||
|
|
||||||
|
vgacon_xres = width * VGA_FONTWIDTH;
|
||||||
|
- vgacon_yres = height * c->vc_font.height;
|
||||||
|
+ vgacon_yres = height * c->vc_cell_height;
|
||||||
|
if (vga_video_type >= VIDEO_TYPE_VGAC) {
|
||||||
|
outb_p(VGA_CRTC_MAX_SCAN, vga_video_port_reg);
|
||||||
|
max_scan = inb_p(vga_video_port_val);
|
||||||
|
@@ -680,9 +680,9 @@ static int vgacon_doresize(struct vc_data *c,
|
||||||
|
static int vgacon_switch(struct vc_data *c)
|
||||||
|
{
|
||||||
|
int x = c->vc_cols * VGA_FONTWIDTH;
|
||||||
|
- int y = c->vc_rows * c->vc_font.height;
|
||||||
|
+ int y = c->vc_rows * c->vc_cell_height;
|
||||||
|
int rows = screen_info.orig_video_lines * vga_default_font_height/
|
||||||
|
- c->vc_font.height;
|
||||||
|
+ c->vc_cell_height;
|
||||||
|
/*
|
||||||
|
* We need to save screen size here as it's the only way
|
||||||
|
* we can spot the screen has been resized and we need to
|
||||||
|
@@ -1120,7 +1120,7 @@ static int vgacon_adjust_height(struct vc_data *vc, unsigned fontheight)
|
||||||
|
cursor_size_lastto = 0;
|
||||||
|
c->vc_sw->con_cursor(c, CM_DRAW);
|
||||||
|
}
|
||||||
|
- c->vc_font.height = fontheight;
|
||||||
|
+ c->vc_font.height = c->vc_cell_height = fontheight;
|
||||||
|
vc_resize(c, 0, rows); /* Adjust console size */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1174,12 +1174,20 @@ static int vgacon_resize(struct vc_data *c, unsigned int width,
|
||||||
|
if ((width << 1) * height > vga_vram_size)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
+ if (user) {
|
||||||
|
+ /*
|
||||||
|
+ * Ho ho! Someone (svgatextmode, eh?) may have reprogrammed
|
||||||
|
+ * the video mode! Set the new defaults then and go away.
|
||||||
|
+ */
|
||||||
|
+ screen_info.orig_video_cols = width;
|
||||||
|
+ screen_info.orig_video_lines = height;
|
||||||
|
+ vga_default_font_height = c->vc_cell_height;
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
if (width % 2 || width > screen_info.orig_video_cols ||
|
||||||
|
height > (screen_info.orig_video_lines * vga_default_font_height)/
|
||||||
|
- c->vc_font.height)
|
||||||
|
- /* let svgatextmode tinker with video timings and
|
||||||
|
- return success */
|
||||||
|
- return (user) ? 0 : -EINVAL;
|
||||||
|
+ c->vc_cell_height)
|
||||||
|
+ return -EINVAL;
|
||||||
|
|
||||||
|
if (con_is_visible(c) && !vga_is_gfx) /* who knows */
|
||||||
|
vgacon_doresize(c, width, height);
|
||||||
|
diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c
|
||||||
|
index 59e1cae579481..03c0b1b8747b9 100644
|
||||||
|
--- a/drivers/video/fbdev/hgafb.c
|
||||||
|
+++ b/drivers/video/fbdev/hgafb.c
|
||||||
|
@@ -286,7 +286,7 @@ static int hga_card_detect(void)
|
||||||
|
|
||||||
|
hga_vram = ioremap(0xb0000, hga_vram_len);
|
||||||
|
if (!hga_vram)
|
||||||
|
- goto error;
|
||||||
|
+ return -ENOMEM;
|
||||||
|
|
||||||
|
if (request_region(0x3b0, 12, "hgafb"))
|
||||||
|
release_io_ports = 1;
|
||||||
|
@@ -346,13 +346,18 @@ static int hga_card_detect(void)
|
||||||
|
hga_type_name = "Hercules";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
- return 1;
|
||||||
|
+ return 0;
|
||||||
|
error:
|
||||||
|
if (release_io_ports)
|
||||||
|
release_region(0x3b0, 12);
|
||||||
|
if (release_io_port)
|
||||||
|
release_region(0x3bf, 1);
|
||||||
|
- return 0;
|
||||||
|
+
|
||||||
|
+ iounmap(hga_vram);
|
||||||
|
+
|
||||||
|
+ pr_err("hgafb: HGA card not detected.\n");
|
||||||
|
+
|
||||||
|
+ return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -550,13 +555,11 @@ static struct fb_ops hgafb_ops = {
|
||||||
|
static int hgafb_probe(struct platform_device *pdev)
|
||||||
|
{
|
||||||
|
struct fb_info *info;
|
||||||
|
+ int ret;
|
||||||
|
|
||||||
|
- if (! hga_card_detect()) {
|
||||||
|
- printk(KERN_INFO "hgafb: HGA card not detected.\n");
|
||||||
|
- if (hga_vram)
|
||||||
|
- iounmap(hga_vram);
|
||||||
|
- return -EINVAL;
|
||||||
|
- }
|
||||||
|
+ ret = hga_card_detect();
|
||||||
|
+ if (ret)
|
||||||
|
+ return ret;
|
||||||
|
|
||||||
|
printk(KERN_INFO "hgafb: %s with %ldK of memory detected.\n",
|
||||||
|
hga_type_name, hga_vram_len/1024);
|
||||||
|
diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c
|
||||||
|
index 4ef9dc94e8138..4363c64d74e8c 100644
|
||||||
|
--- a/drivers/video/fbdev/imsttfb.c
|
||||||
|
+++ b/drivers/video/fbdev/imsttfb.c
|
||||||
|
@@ -1516,11 +1516,6 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
|
info->fix.smem_start = addr;
|
||||||
|
info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ?
|
||||||
|
0x400000 : 0x800000);
|
||||||
|
- if (!info->screen_base) {
|
||||||
|
- release_mem_region(addr, size);
|
||||||
|
- framebuffer_release(info);
|
||||||
|
- return -ENOMEM;
|
||||||
|
- }
|
||||||
|
info->fix.mmio_start = addr + 0x800000;
|
||||||
|
par->dc_regs = ioremap(addr + 0x800000, 0x1000);
|
||||||
|
par->cmap_regs_phys = addr + 0x840000;
|
||||||
|
diff --git a/drivers/xen/xen-pciback/xenbus.c b/drivers/xen/xen-pciback/xenbus.c
|
||||||
|
index 36ec99cff507b..2912905331020 100644
|
||||||
|
--- a/drivers/xen/xen-pciback/xenbus.c
|
||||||
|
+++ b/drivers/xen/xen-pciback/xenbus.c
|
||||||
|
@@ -357,7 +357,8 @@ out:
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int xen_pcibk_reconfigure(struct xen_pcibk_device *pdev)
|
||||||
|
+static int xen_pcibk_reconfigure(struct xen_pcibk_device *pdev,
|
||||||
|
+ enum xenbus_state state)
|
||||||
|
{
|
||||||
|
int err = 0;
|
||||||
|
int num_devs;
|
||||||
|
@@ -371,9 +372,7 @@ static int xen_pcibk_reconfigure(struct xen_pcibk_device *pdev)
|
||||||
|
dev_dbg(&pdev->xdev->dev, "Reconfiguring device ...\n");
|
||||||
|
|
||||||
|
mutex_lock(&pdev->dev_lock);
|
||||||
|
- /* Make sure we only reconfigure once */
|
||||||
|
- if (xenbus_read_driver_state(pdev->xdev->nodename) !=
|
||||||
|
- XenbusStateReconfiguring)
|
||||||
|
+ if (xenbus_read_driver_state(pdev->xdev->nodename) != state)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, "num_devs", "%d",
|
||||||
|
@@ -500,6 +499,10 @@ static int xen_pcibk_reconfigure(struct xen_pcibk_device *pdev)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (state != XenbusStateReconfiguring)
|
||||||
|
+ /* Make sure we only reconfigure once. */
|
||||||
|
+ goto out;
|
||||||
|
+
|
||||||
|
err = xenbus_switch_state(pdev->xdev, XenbusStateReconfigured);
|
||||||
|
if (err) {
|
||||||
|
xenbus_dev_fatal(pdev->xdev, err,
|
||||||
|
@@ -525,7 +528,7 @@ static void xen_pcibk_frontend_changed(struct xenbus_device *xdev,
|
||||||
|
break;
|
||||||
|
|
||||||
|
case XenbusStateReconfiguring:
|
||||||
|
- xen_pcibk_reconfigure(pdev);
|
||||||
|
+ xen_pcibk_reconfigure(pdev, XenbusStateReconfiguring);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case XenbusStateConnected:
|
||||||
|
@@ -664,6 +667,15 @@ static void xen_pcibk_be_watch(struct xenbus_watch *watch,
|
||||||
|
xen_pcibk_setup_backend(pdev);
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case XenbusStateInitialised:
|
||||||
|
+ /*
|
||||||
|
+ * We typically move to Initialised when the first device was
|
||||||
|
+ * added. Hence subsequent devices getting added may need
|
||||||
|
+ * reconfiguring.
|
||||||
|
+ */
|
||||||
|
+ xen_pcibk_reconfigure(pdev, XenbusStateInitialised);
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
|
||||||
|
index 67edd6e03f803..fffba1b1da2e4 100644
|
||||||
|
--- a/fs/cifs/smb2ops.c
|
||||||
|
+++ b/fs/cifs/smb2ops.c
|
||||||
|
@@ -629,6 +629,8 @@ smb2_clone_range(const unsigned int xid,
|
||||||
|
cpu_to_le32(min_t(u32, len, tcon->max_bytes_chunk));
|
||||||
|
|
||||||
|
/* Request server copy to target from src identified by key */
|
||||||
|
+ kfree(retbuf);
|
||||||
|
+ retbuf = NULL;
|
||||||
|
rc = SMB2_ioctl(xid, tcon, trgtfile->fid.persistent_fid,
|
||||||
|
trgtfile->fid.volatile_fid, FSCTL_SRV_COPYCHUNK_WRITE,
|
||||||
|
true /* is_fsctl */, (char *)pcchunk,
|
||||||
|
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
|
||||||
|
index ff6cf23be8a21..cb77e7ee2c9f0 100644
|
||||||
|
--- a/fs/ecryptfs/crypto.c
|
||||||
|
+++ b/fs/ecryptfs/crypto.c
|
||||||
|
@@ -339,10 +339,8 @@ static int crypt_scatterlist(struct ecryptfs_crypt_stat *crypt_stat,
|
||||||
|
struct extent_crypt_result ecr;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
- if (!crypt_stat || !crypt_stat->tfm
|
||||||
|
- || !(crypt_stat->flags & ECRYPTFS_STRUCT_INITIALIZED))
|
||||||
|
- return -EINVAL;
|
||||||
|
-
|
||||||
|
+ BUG_ON(!crypt_stat || !crypt_stat->tfm
|
||||||
|
+ || !(crypt_stat->flags & ECRYPTFS_STRUCT_INITIALIZED));
|
||||||
|
if (unlikely(ecryptfs_verbosity > 0)) {
|
||||||
|
ecryptfs_printk(KERN_DEBUG, "Key size [%zd]; key:\n",
|
||||||
|
crypt_stat->key_size);
|
||||||
|
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
|
||||||
|
index 6fd3c908a340d..a30112ba06e44 100644
|
||||||
|
--- a/include/linux/console_struct.h
|
||||||
|
+++ b/include/linux/console_struct.h
|
||||||
|
@@ -61,6 +61,7 @@ struct vc_data {
|
||||||
|
unsigned int vc_rows;
|
||||||
|
unsigned int vc_size_row; /* Bytes per row */
|
||||||
|
unsigned int vc_scan_lines; /* # of scan lines */
|
||||||
|
+ unsigned int vc_cell_height; /* CRTC character cell height */
|
||||||
|
unsigned long vc_origin; /* [!] Start of real screen */
|
||||||
|
unsigned long vc_scr_end; /* [!] End of real screen */
|
||||||
|
unsigned long vc_visible_origin; /* [!] Top of visible window */
|
||||||
|
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
|
||||||
|
index ea3370e205fb9..4f10223bc7b0f 100644
|
||||||
|
--- a/kernel/ptrace.c
|
||||||
|
+++ b/kernel/ptrace.c
|
||||||
|
@@ -159,6 +159,21 @@ void __ptrace_unlink(struct task_struct *child)
|
||||||
|
spin_unlock(&child->sighand->siglock);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static bool looks_like_a_spurious_pid(struct task_struct *task)
|
||||||
|
+{
|
||||||
|
+ if (task->exit_code != ((PTRACE_EVENT_EXEC << 8) | SIGTRAP))
|
||||||
|
+ return false;
|
||||||
|
+
|
||||||
|
+ if (task_pid_vnr(task) == task->ptrace_message)
|
||||||
|
+ return false;
|
||||||
|
+ /*
|
||||||
|
+ * The tracee changed its pid but the PTRACE_EVENT_EXEC event
|
||||||
|
+ * was not wait()'ed, most probably debugger targets the old
|
||||||
|
+ * leader which was destroyed in de_thread().
|
||||||
|
+ */
|
||||||
|
+ return true;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/* Ensure that nothing can wake it up, even SIGKILL */
|
||||||
|
static bool ptrace_freeze_traced(struct task_struct *task)
|
||||||
|
{
|
||||||
|
@@ -169,7 +184,8 @@ static bool ptrace_freeze_traced(struct task_struct *task)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
spin_lock_irq(&task->sighand->siglock);
|
||||||
|
- if (task_is_traced(task) && !__fatal_signal_pending(task)) {
|
||||||
|
+ if (task_is_traced(task) && !looks_like_a_spurious_pid(task) &&
|
||||||
|
+ !__fatal_signal_pending(task)) {
|
||||||
|
task->state = __TASK_TRACED;
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
|
||||||
|
index 6670b7ffc2005..cedfce6f397ed 100644
|
||||||
|
--- a/net/bluetooth/smp.c
|
||||||
|
+++ b/net/bluetooth/smp.c
|
||||||
|
@@ -2636,6 +2636,15 @@ static int smp_cmd_public_key(struct l2cap_conn *conn, struct sk_buff *skb)
|
||||||
|
if (skb->len < sizeof(*key))
|
||||||
|
return SMP_INVALID_PARAMS;
|
||||||
|
|
||||||
|
+ /* Check if remote and local public keys are the same and debug key is
|
||||||
|
+ * not in use.
|
||||||
|
+ */
|
||||||
|
+ if (!test_bit(SMP_FLAG_DEBUG_KEY, &smp->flags) &&
|
||||||
|
+ !crypto_memneq(key, smp->local_pk, 64)) {
|
||||||
|
+ bt_dev_err(hdev, "Remote and local public keys are identical");
|
||||||
|
+ return SMP_UNSPECIFIED;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
memcpy(smp->remote_pk, key, 64);
|
||||||
|
|
||||||
|
if (test_bit(SMP_FLAG_REMOTE_OOB, &smp->flags)) {
|
||||||
|
diff --git a/sound/firewire/Kconfig b/sound/firewire/Kconfig
|
||||||
|
index 8557e54d26598..f7b8dcb578157 100644
|
||||||
|
--- a/sound/firewire/Kconfig
|
||||||
|
+++ b/sound/firewire/Kconfig
|
||||||
|
@@ -36,7 +36,7 @@ config SND_OXFW
|
||||||
|
* Mackie(Loud) Onyx-i series (former models)
|
||||||
|
* Mackie(Loud) Onyx Satellite
|
||||||
|
* Mackie(Loud) Tapco Link.Firewire
|
||||||
|
- * Mackie(Loud) d.2 pro/d.4 pro
|
||||||
|
+ * Mackie(Loud) d.4 pro
|
||||||
|
* Mackie(Loud) U.420/U.420d
|
||||||
|
* TASCAM FireOne
|
||||||
|
* Stanton Controllers & Systems 1 Deck/Mixer
|
||||||
|
@@ -82,7 +82,7 @@ config SND_BEBOB
|
||||||
|
* PreSonus FIREBOX/FIREPOD/FP10/Inspire1394
|
||||||
|
* BridgeCo RDAudio1/Audio5
|
||||||
|
* Mackie Onyx 1220/1620/1640 (FireWire I/O Card)
|
||||||
|
- * Mackie d.2 (FireWire Option)
|
||||||
|
+ * Mackie d.2 (FireWire Option) and d.2 Pro
|
||||||
|
* Stanton FinalScratch 2 (ScratchAmp)
|
||||||
|
* Tascam IF-FW/DM
|
||||||
|
* Behringer XENIX UFX 1204/1604
|
||||||
|
diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c
|
||||||
|
index a205b93fd9ac8..9d620a7c283f4 100644
|
||||||
|
--- a/sound/firewire/bebob/bebob.c
|
||||||
|
+++ b/sound/firewire/bebob/bebob.c
|
||||||
|
@@ -414,7 +414,7 @@ static const struct ieee1394_device_id bebob_id_table[] = {
|
||||||
|
SND_BEBOB_DEV_ENTRY(VEN_BRIDGECO, 0x00010049, &spec_normal),
|
||||||
|
/* Mackie, Onyx 1220/1620/1640 (Firewire I/O Card) */
|
||||||
|
SND_BEBOB_DEV_ENTRY(VEN_MACKIE2, 0x00010065, &spec_normal),
|
||||||
|
- /* Mackie, d.2 (Firewire Option) */
|
||||||
|
+ // Mackie, d.2 (Firewire option card) and d.2 Pro (the card is built-in).
|
||||||
|
SND_BEBOB_DEV_ENTRY(VEN_MACKIE1, 0x00010067, &spec_normal),
|
||||||
|
/* Stanton, ScratchAmp */
|
||||||
|
SND_BEBOB_DEV_ENTRY(VEN_STANTON, 0x00000001, &spec_normal),
|
||||||
|
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c
|
||||||
|
index a7ab34d5e7b08..44ecf2f5f65fd 100644
|
||||||
|
--- a/sound/firewire/oxfw/oxfw.c
|
||||||
|
+++ b/sound/firewire/oxfw/oxfw.c
|
||||||
|
@@ -405,7 +405,6 @@ static const struct ieee1394_device_id oxfw_id_table[] = {
|
||||||
|
* Onyx-i series (former models): 0x081216
|
||||||
|
* Mackie Onyx Satellite: 0x00200f
|
||||||
|
* Tapco LINK.firewire 4x6: 0x000460
|
||||||
|
- * d.2 pro: Unknown
|
||||||
|
* d.4 pro: Unknown
|
||||||
|
* U.420: Unknown
|
||||||
|
* U.420d: Unknown
|
||||||
|
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
|
||||||
|
index e75bfc511e3e8..ad42d2364199f 100644
|
||||||
|
--- a/sound/isa/sb/sb8.c
|
||||||
|
+++ b/sound/isa/sb/sb8.c
|
||||||
|
@@ -111,10 +111,6 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
|
||||||
|
|
||||||
|
/* block the 0x388 port to avoid PnP conflicts */
|
||||||
|
acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
|
||||||
|
- if (!acard->fm_res) {
|
||||||
|
- err = -EBUSY;
|
||||||
|
- goto _err;
|
||||||
|
- }
|
||||||
|
|
||||||
|
if (port[dev] != SNDRV_AUTO_PORT) {
|
||||||
|
if ((err = snd_sbdsp_create(card, port[dev], irq[dev],
|
||||||
|
diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
|
||||||
|
index ea3a9bd05e687..0107bbfeb17d1 100644
|
||||||
|
--- a/sound/usb/line6/driver.c
|
||||||
|
+++ b/sound/usb/line6/driver.c
|
||||||
|
@@ -687,6 +687,10 @@ static int line6_init_cap_control(struct usb_line6 *line6)
|
||||||
|
line6->buffer_message = kmalloc(LINE6_MIDI_MESSAGE_MAXLEN, GFP_KERNEL);
|
||||||
|
if (!line6->buffer_message)
|
||||||
|
return -ENOMEM;
|
||||||
|
+
|
||||||
|
+ ret = line6_init_midi(line6);
|
||||||
|
+ if (ret < 0)
|
||||||
|
+ return ret;
|
||||||
|
} else {
|
||||||
|
ret = line6_hwdep_init(line6);
|
||||||
|
if (ret < 0)
|
||||||
|
diff --git a/sound/usb/line6/pod.c b/sound/usb/line6/pod.c
|
||||||
|
index 17aa616e61f53..aaa192aee883e 100644
|
||||||
|
--- a/sound/usb/line6/pod.c
|
||||||
|
+++ b/sound/usb/line6/pod.c
|
||||||
|
@@ -421,11 +421,6 @@ static int pod_init(struct usb_line6 *line6,
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
- /* initialize MIDI subsystem: */
|
||||||
|
- err = line6_init_midi(line6);
|
||||||
|
- if (err < 0)
|
||||||
|
- return err;
|
||||||
|
-
|
||||||
|
/* initialize PCM subsystem: */
|
||||||
|
err = line6_init_pcm(line6, &pod_pcm_properties);
|
||||||
|
if (err < 0)
|
||||||
|
diff --git a/sound/usb/line6/variax.c b/sound/usb/line6/variax.c
|
||||||
|
index 0c4512d0382ea..a911cff0cec86 100644
|
||||||
|
--- a/sound/usb/line6/variax.c
|
||||||
|
+++ b/sound/usb/line6/variax.c
|
||||||
|
@@ -217,7 +217,6 @@ static int variax_init(struct usb_line6 *line6,
|
||||||
|
const struct usb_device_id *id)
|
||||||
|
{
|
||||||
|
struct usb_line6_variax *variax = (struct usb_line6_variax *) line6;
|
||||||
|
- int err;
|
||||||
|
|
||||||
|
line6->process_message = line6_variax_process_message;
|
||||||
|
line6->disconnect = line6_variax_disconnect;
|
||||||
|
@@ -233,11 +232,6 @@ static int variax_init(struct usb_line6 *line6,
|
||||||
|
if (variax->buffer_activate == NULL)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
- /* initialize MIDI subsystem: */
|
||||||
|
- err = line6_init_midi(&variax->line6);
|
||||||
|
- if (err < 0)
|
||||||
|
- return err;
|
||||||
|
-
|
||||||
|
/* initiate startup procedure: */
|
||||||
|
variax_startup1(variax);
|
||||||
|
return 0;
|
||||||
|
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
|
||||||
|
index ea264727fdf7b..f0b41fee71304 100644
|
||||||
|
--- a/sound/usb/midi.c
|
||||||
|
+++ b/sound/usb/midi.c
|
||||||
|
@@ -1867,8 +1867,12 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi *umidi,
|
||||||
|
ms_ep = find_usb_ms_endpoint_descriptor(hostep);
|
||||||
|
if (!ms_ep)
|
||||||
|
continue;
|
||||||
|
+ if (ms_ep->bLength <= sizeof(*ms_ep))
|
||||||
|
+ continue;
|
||||||
|
if (ms_ep->bNumEmbMIDIJack > 0x10)
|
||||||
|
continue;
|
||||||
|
+ if (ms_ep->bLength < sizeof(*ms_ep) + ms_ep->bNumEmbMIDIJack)
|
||||||
|
+ continue;
|
||||||
|
if (usb_endpoint_dir_out(ep)) {
|
||||||
|
if (endpoints[epidx].out_ep) {
|
||||||
|
if (++epidx >= MIDI_MAX_ENDPOINTS) {
|
||||||
2522
patch/kernel/archive/sun50iw9-4.9/patch-4.9.270-271.patch
Normal file
2522
patch/kernel/archive/sun50iw9-4.9/patch-4.9.270-271.patch
Normal file
File diff suppressed because it is too large
Load Diff
925
patch/kernel/archive/sun50iw9-4.9/patch-4.9.271-272.patch
Normal file
925
patch/kernel/archive/sun50iw9-4.9/patch-4.9.271-272.patch
Normal file
@@ -0,0 +1,925 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 4964c2494edb5..39aa8b66fc6ff 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 271
|
||||||
|
+SUBLEVEL = 272
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
|
||||||
|
index 5962badb33462..b6fd2a21b015e 100644
|
||||||
|
--- a/arch/arm64/kernel/traps.c
|
||||||
|
+++ b/arch/arm64/kernel/traps.c
|
||||||
|
@@ -543,14 +543,6 @@ asmlinkage long do_ni_syscall(struct pt_regs *regs)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
- if (show_unhandled_signals_ratelimited()) {
|
||||||
|
- pr_info("%s[%d]: syscall %d\n", current->comm,
|
||||||
|
- task_pid_nr(current), (int)regs->syscallno);
|
||||||
|
- dump_instr("", regs);
|
||||||
|
- if (user_mode(regs))
|
||||||
|
- __show_regs(regs);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
return sys_ni_syscall();
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
|
||||||
|
index 29078eaf18c9b..cbc7f177bbd8e 100644
|
||||||
|
--- a/arch/x86/kvm/svm.c
|
||||||
|
+++ b/arch/x86/kvm/svm.c
|
||||||
|
@@ -3412,7 +3412,7 @@ static int cr_interception(struct vcpu_svm *svm)
|
||||||
|
err = 0;
|
||||||
|
if (cr >= 16) { /* mov to cr */
|
||||||
|
cr -= 16;
|
||||||
|
- val = kvm_register_read(&svm->vcpu, reg);
|
||||||
|
+ val = kvm_register_readl(&svm->vcpu, reg);
|
||||||
|
switch (cr) {
|
||||||
|
case 0:
|
||||||
|
if (!check_selective_cr0_intercepted(svm, val))
|
||||||
|
@@ -3457,7 +3457,7 @@ static int cr_interception(struct vcpu_svm *svm)
|
||||||
|
kvm_queue_exception(&svm->vcpu, UD_VECTOR);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
- kvm_register_write(&svm->vcpu, reg, val);
|
||||||
|
+ kvm_register_writel(&svm->vcpu, reg, val);
|
||||||
|
}
|
||||||
|
kvm_complete_insn_gp(&svm->vcpu, err);
|
||||||
|
|
||||||
|
@@ -3489,13 +3489,13 @@ static int dr_interception(struct vcpu_svm *svm)
|
||||||
|
if (dr >= 16) { /* mov to DRn */
|
||||||
|
if (!kvm_require_dr(&svm->vcpu, dr - 16))
|
||||||
|
return 1;
|
||||||
|
- val = kvm_register_read(&svm->vcpu, reg);
|
||||||
|
+ val = kvm_register_readl(&svm->vcpu, reg);
|
||||||
|
kvm_set_dr(&svm->vcpu, dr - 16, val);
|
||||||
|
} else {
|
||||||
|
if (!kvm_require_dr(&svm->vcpu, dr))
|
||||||
|
return 1;
|
||||||
|
kvm_get_dr(&svm->vcpu, dr, &val);
|
||||||
|
- kvm_register_write(&svm->vcpu, reg, val);
|
||||||
|
+ kvm_register_writel(&svm->vcpu, reg, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
skip_emulated_instruction(&svm->vcpu);
|
||||||
|
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
|
||||||
|
index c0e54396f2502..dc8d2603612ed 100644
|
||||||
|
--- a/drivers/firmware/efi/cper.c
|
||||||
|
+++ b/drivers/firmware/efi/cper.c
|
||||||
|
@@ -257,8 +257,7 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg)
|
||||||
|
if (!msg || !(mem->validation_bits & CPER_MEM_VALID_MODULE_HANDLE))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
- n = 0;
|
||||||
|
- len = CPER_REC_LEN - 1;
|
||||||
|
+ len = CPER_REC_LEN;
|
||||||
|
dmi_memdev_name(mem->mem_dev_handle, &bank, &device);
|
||||||
|
if (bank && device)
|
||||||
|
n = snprintf(msg, len, "DIMM location: %s %s ", bank, device);
|
||||||
|
@@ -267,7 +266,6 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg)
|
||||||
|
"DIMM location: not present. DMI handle: 0x%.4x ",
|
||||||
|
mem->mem_dev_handle);
|
||||||
|
|
||||||
|
- msg[n] = '\0';
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/firmware/efi/memattr.c b/drivers/firmware/efi/memattr.c
|
||||||
|
index 9faa09e7c31f1..c2b991b9fa9e6 100644
|
||||||
|
--- a/drivers/firmware/efi/memattr.c
|
||||||
|
+++ b/drivers/firmware/efi/memattr.c
|
||||||
|
@@ -68,11 +68,6 @@ static bool entry_is_valid(const efi_memory_desc_t *in, efi_memory_desc_t *out)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (!(in->attribute & (EFI_MEMORY_RO | EFI_MEMORY_XP))) {
|
||||||
|
- pr_warn("Entry attributes invalid: RO and XP bits both cleared\n");
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
if (PAGE_SIZE > EFI_PAGE_SIZE &&
|
||||||
|
(!PAGE_ALIGNED(in->phys_addr) ||
|
||||||
|
!PAGE_ALIGNED(in->num_pages << EFI_PAGE_SHIFT))) {
|
||||||
|
diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
|
||||||
|
index 606fd875740c0..800c477dd0761 100644
|
||||||
|
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
|
||||||
|
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
|
||||||
|
@@ -1157,8 +1157,8 @@ static int i2c_hid_probe(struct i2c_client *client,
|
||||||
|
hid->vendor = le16_to_cpu(ihid->hdesc.wVendorID);
|
||||||
|
hid->product = le16_to_cpu(ihid->hdesc.wProductID);
|
||||||
|
|
||||||
|
- snprintf(hid->name, sizeof(hid->name), "%s %04hX:%04hX",
|
||||||
|
- client->name, hid->vendor, hid->product);
|
||||||
|
+ snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X",
|
||||||
|
+ client->name, (u16)hid->vendor, (u16)hid->product);
|
||||||
|
strlcpy(hid->phys, dev_name(&client->dev), sizeof(hid->phys));
|
||||||
|
|
||||||
|
ihid->quirks = i2c_hid_lookup_quirk(hid->vendor, hid->product);
|
||||||
|
diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c
|
||||||
|
index 08174d341f4a1..bc75f1efa0f4c 100644
|
||||||
|
--- a/drivers/hid/usbhid/hid-pidff.c
|
||||||
|
+++ b/drivers/hid/usbhid/hid-pidff.c
|
||||||
|
@@ -1304,6 +1304,7 @@ int hid_pidff_init(struct hid_device *hid)
|
||||||
|
|
||||||
|
if (pidff->pool[PID_DEVICE_MANAGED_POOL].value &&
|
||||||
|
pidff->pool[PID_DEVICE_MANAGED_POOL].value[0] == 0) {
|
||||||
|
+ error = -EPERM;
|
||||||
|
hid_notice(hid,
|
||||||
|
"device does not support device managed pool\n");
|
||||||
|
goto fail;
|
||||||
|
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
|
||||||
|
index 148e1ff2e5e0e..77dadbe1a4464 100644
|
||||||
|
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
|
||||||
|
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
|
||||||
|
@@ -4262,7 +4262,6 @@ int bnxt_hwrm_func_qcaps(struct bnxt *bp)
|
||||||
|
|
||||||
|
pf->fw_fid = le16_to_cpu(resp->fid);
|
||||||
|
pf->port_id = le16_to_cpu(resp->port_id);
|
||||||
|
- bp->dev->dev_port = pf->port_id;
|
||||||
|
memcpy(pf->mac_addr, resp->mac_address, ETH_ALEN);
|
||||||
|
memcpy(bp->dev->dev_addr, pf->mac_addr, ETH_ALEN);
|
||||||
|
pf->max_rsscos_ctxs = le16_to_cpu(resp->max_rsscos_ctx);
|
||||||
|
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
|
||||||
|
index d418542924e16..297d3f599efda 100644
|
||||||
|
--- a/drivers/net/usb/cdc_ncm.c
|
||||||
|
+++ b/drivers/net/usb/cdc_ncm.c
|
||||||
|
@@ -1563,6 +1563,15 @@ cdc_ncm_speed_change(struct usbnet *dev,
|
||||||
|
uint32_t rx_speed = le32_to_cpu(data->DLBitRRate);
|
||||||
|
uint32_t tx_speed = le32_to_cpu(data->ULBitRate);
|
||||||
|
|
||||||
|
+ /* if the speed hasn't changed, don't report it.
|
||||||
|
+ * RTL8156 shipped before 2021 sends notification about every 32ms.
|
||||||
|
+ */
|
||||||
|
+ if (dev->rx_speed == rx_speed && dev->tx_speed == tx_speed)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ dev->rx_speed = rx_speed;
|
||||||
|
+ dev->tx_speed = tx_speed;
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Currently the USB-NET API does not support reporting the actual
|
||||||
|
* device speed. Do print it instead.
|
||||||
|
@@ -1606,7 +1615,8 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb)
|
||||||
|
* USB_CDC_NOTIFY_NETWORK_CONNECTION notification shall be
|
||||||
|
* sent by device after USB_CDC_NOTIFY_SPEED_CHANGE.
|
||||||
|
*/
|
||||||
|
- usbnet_link_change(dev, !!event->wValue, 0);
|
||||||
|
+ if (netif_carrier_ok(dev->net) != !!event->wValue)
|
||||||
|
+ usbnet_link_change(dev, !!event->wValue, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case USB_CDC_NOTIFY_SPEED_CHANGE:
|
||||||
|
diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig
|
||||||
|
index 24ee2605b9f04..0da884bfc7a80 100644
|
||||||
|
--- a/drivers/vfio/pci/Kconfig
|
||||||
|
+++ b/drivers/vfio/pci/Kconfig
|
||||||
|
@@ -1,6 +1,7 @@
|
||||||
|
config VFIO_PCI
|
||||||
|
tristate "VFIO support for PCI devices"
|
||||||
|
depends on VFIO && PCI && EVENTFD
|
||||||
|
+ depends on MMU
|
||||||
|
select VFIO_VIRQFD
|
||||||
|
select IRQ_BYPASS_MANAGER
|
||||||
|
help
|
||||||
|
diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
|
||||||
|
index f3c2de04b20d3..5b0f09b211bee 100644
|
||||||
|
--- a/drivers/vfio/pci/vfio_pci_config.c
|
||||||
|
+++ b/drivers/vfio/pci/vfio_pci_config.c
|
||||||
|
@@ -1576,7 +1576,7 @@ static int vfio_ecap_init(struct vfio_pci_device *vdev)
|
||||||
|
if (len == 0xFF) {
|
||||||
|
len = vfio_ext_cap_len(vdev, ecap, epos);
|
||||||
|
if (len < 0)
|
||||||
|
- return ret;
|
||||||
|
+ return len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
|
||||||
|
index d143d08c4f0fe..9b1b6c1e218dc 100644
|
||||||
|
--- a/drivers/vfio/platform/vfio_platform_common.c
|
||||||
|
+++ b/drivers/vfio/platform/vfio_platform_common.c
|
||||||
|
@@ -288,7 +288,7 @@ err_irq:
|
||||||
|
vfio_platform_regions_cleanup(vdev);
|
||||||
|
err_reg:
|
||||||
|
mutex_unlock(&driver_lock);
|
||||||
|
- module_put(THIS_MODULE);
|
||||||
|
+ module_put(vdev->parent_module);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/xen/xen-pciback/vpci.c b/drivers/xen/xen-pciback/vpci.c
|
||||||
|
index c99f8bb1c56c4..e6c7509a3d873 100644
|
||||||
|
--- a/drivers/xen/xen-pciback/vpci.c
|
||||||
|
+++ b/drivers/xen/xen-pciback/vpci.c
|
||||||
|
@@ -68,7 +68,7 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
|
||||||
|
struct pci_dev *dev, int devid,
|
||||||
|
publish_pci_dev_cb publish_cb)
|
||||||
|
{
|
||||||
|
- int err = 0, slot, func = -1;
|
||||||
|
+ int err = 0, slot, func = PCI_FUNC(dev->devfn);
|
||||||
|
struct pci_dev_entry *t, *dev_entry;
|
||||||
|
struct vpci_dev_data *vpci_dev = pdev->pci_dev_data;
|
||||||
|
|
||||||
|
@@ -93,23 +93,26 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keep multi-function devices together on the virtual PCI bus, except
|
||||||
|
- * virtual functions.
|
||||||
|
+ * that we want to keep virtual functions at func 0 on their own. They
|
||||||
|
+ * aren't multi-function devices and hence their presence at func 0
|
||||||
|
+ * may cause guests to not scan the other functions.
|
||||||
|
*/
|
||||||
|
- if (!dev->is_virtfn) {
|
||||||
|
+ if (!dev->is_virtfn || func) {
|
||||||
|
for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
|
||||||
|
if (list_empty(&vpci_dev->dev_list[slot]))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
t = list_entry(list_first(&vpci_dev->dev_list[slot]),
|
||||||
|
struct pci_dev_entry, list);
|
||||||
|
+ if (t->dev->is_virtfn && !PCI_FUNC(t->dev->devfn))
|
||||||
|
+ continue;
|
||||||
|
|
||||||
|
if (match_slot(dev, t->dev)) {
|
||||||
|
pr_info("vpci: %s: assign to virtual slot %d func %d\n",
|
||||||
|
pci_name(dev), slot,
|
||||||
|
- PCI_FUNC(dev->devfn));
|
||||||
|
+ func);
|
||||||
|
list_add_tail(&dev_entry->list,
|
||||||
|
&vpci_dev->dev_list[slot]);
|
||||||
|
- func = PCI_FUNC(dev->devfn);
|
||||||
|
goto unlock;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -122,7 +125,6 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
|
||||||
|
pci_name(dev), slot);
|
||||||
|
list_add_tail(&dev_entry->list,
|
||||||
|
&vpci_dev->dev_list[slot]);
|
||||||
|
- func = dev->is_virtfn ? 0 : PCI_FUNC(dev->devfn);
|
||||||
|
goto unlock;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
|
||||||
|
index 4f919628137cb..374d91830a900 100644
|
||||||
|
--- a/fs/btrfs/file-item.c
|
||||||
|
+++ b/fs/btrfs/file-item.c
|
||||||
|
@@ -608,7 +608,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
|
||||||
|
u64 end_byte = bytenr + len;
|
||||||
|
u64 csum_end;
|
||||||
|
struct extent_buffer *leaf;
|
||||||
|
- int ret;
|
||||||
|
+ int ret = 0;
|
||||||
|
u16 csum_size = btrfs_super_csum_size(root->fs_info->super_copy);
|
||||||
|
int blocksize_bits = root->fs_info->sb->s_blocksize_bits;
|
||||||
|
|
||||||
|
@@ -626,6 +626,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
|
||||||
|
path->leave_spinning = 1;
|
||||||
|
ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
|
||||||
|
if (ret > 0) {
|
||||||
|
+ ret = 0;
|
||||||
|
if (path->slots[0] == 0)
|
||||||
|
break;
|
||||||
|
path->slots[0]--;
|
||||||
|
@@ -656,7 +657,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
|
||||||
|
if (key.offset >= bytenr && csum_end <= end_byte) {
|
||||||
|
ret = btrfs_del_item(trans, root, path);
|
||||||
|
if (ret)
|
||||||
|
- goto out;
|
||||||
|
+ break;
|
||||||
|
if (key.offset == bytenr)
|
||||||
|
break;
|
||||||
|
} else if (key.offset < bytenr && csum_end > end_byte) {
|
||||||
|
@@ -700,8 +701,9 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
|
||||||
|
ret = btrfs_split_item(trans, root, path, &key, offset);
|
||||||
|
if (ret && ret != -EAGAIN) {
|
||||||
|
btrfs_abort_transaction(trans, ret);
|
||||||
|
- goto out;
|
||||||
|
+ break;
|
||||||
|
}
|
||||||
|
+ ret = 0;
|
||||||
|
|
||||||
|
key.offset = end_byte - 1;
|
||||||
|
} else {
|
||||||
|
@@ -711,8 +713,6 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
|
||||||
|
}
|
||||||
|
btrfs_release_path(path);
|
||||||
|
}
|
||||||
|
- ret = 0;
|
||||||
|
-out:
|
||||||
|
btrfs_free_path(path);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
|
||||||
|
index 5c86fecaf167e..11ecd798864c8 100644
|
||||||
|
--- a/fs/btrfs/tree-log.c
|
||||||
|
+++ b/fs/btrfs/tree-log.c
|
||||||
|
@@ -1529,6 +1529,7 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (ret == 1) {
|
||||||
|
+ ret = 0;
|
||||||
|
if (path->slots[0] == 0)
|
||||||
|
break;
|
||||||
|
path->slots[0]--;
|
||||||
|
@@ -1541,17 +1542,19 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
|
||||||
|
|
||||||
|
ret = btrfs_del_item(trans, root, path);
|
||||||
|
if (ret)
|
||||||
|
- goto out;
|
||||||
|
+ break;
|
||||||
|
|
||||||
|
btrfs_release_path(path);
|
||||||
|
inode = read_one_inode(root, key.offset);
|
||||||
|
- if (!inode)
|
||||||
|
- return -EIO;
|
||||||
|
+ if (!inode) {
|
||||||
|
+ ret = -EIO;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
ret = fixup_inode_link_count(trans, root, inode);
|
||||||
|
iput(inode);
|
||||||
|
if (ret)
|
||||||
|
- goto out;
|
||||||
|
+ break;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* fixup on a directory may create new entries,
|
||||||
|
@@ -1560,8 +1563,6 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
|
||||||
|
*/
|
||||||
|
key.offset = (u64)-1;
|
||||||
|
}
|
||||||
|
- ret = 0;
|
||||||
|
-out:
|
||||||
|
btrfs_release_path(path);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
|
||||||
|
index 7f291b7be7f3a..e2f31aee67c28 100644
|
||||||
|
--- a/fs/ext4/extents.c
|
||||||
|
+++ b/fs/ext4/extents.c
|
||||||
|
@@ -3274,7 +3274,10 @@ static int ext4_split_extent_at(handle_t *handle,
|
||||||
|
ext4_ext_mark_unwritten(ex2);
|
||||||
|
|
||||||
|
err = ext4_ext_insert_extent(handle, inode, ppath, &newex, flags);
|
||||||
|
- if (err == -ENOSPC && (EXT4_EXT_MAY_ZEROOUT & split_flag)) {
|
||||||
|
+ if (err != -ENOSPC && err != -EDQUOT)
|
||||||
|
+ goto out;
|
||||||
|
+
|
||||||
|
+ if (EXT4_EXT_MAY_ZEROOUT & split_flag) {
|
||||||
|
if (split_flag & (EXT4_EXT_DATA_VALID1|EXT4_EXT_DATA_VALID2)) {
|
||||||
|
if (split_flag & EXT4_EXT_DATA_VALID1) {
|
||||||
|
err = ext4_ext_zeroout(inode, ex2);
|
||||||
|
@@ -3300,30 +3303,30 @@ static int ext4_split_extent_at(handle_t *handle,
|
||||||
|
ext4_ext_pblock(&orig_ex));
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (err)
|
||||||
|
- goto fix_extent_len;
|
||||||
|
- /* update the extent length and mark as initialized */
|
||||||
|
- ex->ee_len = cpu_to_le16(ee_len);
|
||||||
|
- ext4_ext_try_to_merge(handle, inode, path, ex);
|
||||||
|
- err = ext4_ext_dirty(handle, inode, path + path->p_depth);
|
||||||
|
- if (err)
|
||||||
|
- goto fix_extent_len;
|
||||||
|
-
|
||||||
|
- /* update extent status tree */
|
||||||
|
- err = ext4_zeroout_es(inode, &zero_ex);
|
||||||
|
-
|
||||||
|
- goto out;
|
||||||
|
- } else if (err)
|
||||||
|
- goto fix_extent_len;
|
||||||
|
-
|
||||||
|
-out:
|
||||||
|
- ext4_ext_show_leaf(inode, path);
|
||||||
|
- return err;
|
||||||
|
+ if (!err) {
|
||||||
|
+ /* update the extent length and mark as initialized */
|
||||||
|
+ ex->ee_len = cpu_to_le16(ee_len);
|
||||||
|
+ ext4_ext_try_to_merge(handle, inode, path, ex);
|
||||||
|
+ err = ext4_ext_dirty(handle, inode, path + path->p_depth);
|
||||||
|
+ if (!err)
|
||||||
|
+ /* update extent status tree */
|
||||||
|
+ err = ext4_zeroout_es(inode, &zero_ex);
|
||||||
|
+ /* If we failed at this point, we don't know in which
|
||||||
|
+ * state the extent tree exactly is so don't try to fix
|
||||||
|
+ * length of the original extent as it may do even more
|
||||||
|
+ * damage.
|
||||||
|
+ */
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
|
||||||
|
fix_extent_len:
|
||||||
|
ex->ee_len = orig_ex.ee_len;
|
||||||
|
ext4_ext_dirty(handle, inode, path + path->p_depth);
|
||||||
|
return err;
|
||||||
|
+out:
|
||||||
|
+ ext4_ext_show_leaf(inode, path);
|
||||||
|
+ return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
|
||||||
|
index c17285df12be2..3aa4441f5ab50 100644
|
||||||
|
--- a/fs/ocfs2/file.c
|
||||||
|
+++ b/fs/ocfs2/file.c
|
||||||
|
@@ -1838,6 +1838,45 @@ out:
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+ * zero out partial blocks of one cluster.
|
||||||
|
+ *
|
||||||
|
+ * start: file offset where zero starts, will be made upper block aligned.
|
||||||
|
+ * len: it will be trimmed to the end of current cluster if "start + len"
|
||||||
|
+ * is bigger than it.
|
||||||
|
+ */
|
||||||
|
+static int ocfs2_zeroout_partial_cluster(struct inode *inode,
|
||||||
|
+ u64 start, u64 len)
|
||||||
|
+{
|
||||||
|
+ int ret;
|
||||||
|
+ u64 start_block, end_block, nr_blocks;
|
||||||
|
+ u64 p_block, offset;
|
||||||
|
+ u32 cluster, p_cluster, nr_clusters;
|
||||||
|
+ struct super_block *sb = inode->i_sb;
|
||||||
|
+ u64 end = ocfs2_align_bytes_to_clusters(sb, start);
|
||||||
|
+
|
||||||
|
+ if (start + len < end)
|
||||||
|
+ end = start + len;
|
||||||
|
+
|
||||||
|
+ start_block = ocfs2_blocks_for_bytes(sb, start);
|
||||||
|
+ end_block = ocfs2_blocks_for_bytes(sb, end);
|
||||||
|
+ nr_blocks = end_block - start_block;
|
||||||
|
+ if (!nr_blocks)
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+ cluster = ocfs2_bytes_to_clusters(sb, start);
|
||||||
|
+ ret = ocfs2_get_clusters(inode, cluster, &p_cluster,
|
||||||
|
+ &nr_clusters, NULL);
|
||||||
|
+ if (ret)
|
||||||
|
+ return ret;
|
||||||
|
+ if (!p_cluster)
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+ offset = start_block - ocfs2_clusters_to_blocks(sb, cluster);
|
||||||
|
+ p_block = ocfs2_clusters_to_blocks(sb, p_cluster) + offset;
|
||||||
|
+ return sb_issue_zeroout(sb, p_block, nr_blocks, GFP_NOFS);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Parts of this function taken from xfs_change_file_space()
|
||||||
|
*/
|
||||||
|
@@ -1848,7 +1887,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
s64 llen;
|
||||||
|
- loff_t size;
|
||||||
|
+ loff_t size, orig_isize;
|
||||||
|
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
|
||||||
|
struct buffer_head *di_bh = NULL;
|
||||||
|
handle_t *handle;
|
||||||
|
@@ -1879,6 +1918,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
|
||||||
|
goto out_inode_unlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ orig_isize = i_size_read(inode);
|
||||||
|
switch (sr->l_whence) {
|
||||||
|
case 0: /*SEEK_SET*/
|
||||||
|
break;
|
||||||
|
@@ -1886,7 +1926,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
|
||||||
|
sr->l_start += f_pos;
|
||||||
|
break;
|
||||||
|
case 2: /*SEEK_END*/
|
||||||
|
- sr->l_start += i_size_read(inode);
|
||||||
|
+ sr->l_start += orig_isize;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ret = -EINVAL;
|
||||||
|
@@ -1940,6 +1980,14 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
|
||||||
|
default:
|
||||||
|
ret = -EINVAL;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /* zeroout eof blocks in the cluster. */
|
||||||
|
+ if (!ret && change_size && orig_isize < size) {
|
||||||
|
+ ret = ocfs2_zeroout_partial_cluster(inode, orig_isize,
|
||||||
|
+ size - orig_isize);
|
||||||
|
+ if (!ret)
|
||||||
|
+ i_size_write(inode, size);
|
||||||
|
+ }
|
||||||
|
up_write(&OCFS2_I(inode)->ip_alloc_sem);
|
||||||
|
if (ret) {
|
||||||
|
mlog_errno(ret);
|
||||||
|
@@ -1956,9 +2004,6 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
|
||||||
|
goto out_inode_unlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (change_size && i_size_read(inode) < size)
|
||||||
|
- i_size_write(inode, size);
|
||||||
|
-
|
||||||
|
inode->i_ctime = inode->i_mtime = current_time(inode);
|
||||||
|
ret = ocfs2_mark_inode_dirty(handle, inode, di_bh);
|
||||||
|
if (ret < 0)
|
||||||
|
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
|
||||||
|
index fde7550754df6..52f47c2944f84 100644
|
||||||
|
--- a/include/linux/usb/usbnet.h
|
||||||
|
+++ b/include/linux/usb/usbnet.h
|
||||||
|
@@ -80,6 +80,8 @@ struct usbnet {
|
||||||
|
# define EVENT_LINK_CHANGE 11
|
||||||
|
# define EVENT_SET_RX_MODE 12
|
||||||
|
# define EVENT_NO_IP_ALIGN 13
|
||||||
|
+ u32 rx_speed; /* in bps - NOT Mbps */
|
||||||
|
+ u32 tx_speed; /* in bps - NOT Mbps */
|
||||||
|
};
|
||||||
|
|
||||||
|
static inline struct usb_driver *driver_of(struct usb_interface *intf)
|
||||||
|
diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h
|
||||||
|
index 028b754ae9b17..0baf2e21a533f 100644
|
||||||
|
--- a/include/net/caif/caif_dev.h
|
||||||
|
+++ b/include/net/caif/caif_dev.h
|
||||||
|
@@ -119,7 +119,7 @@ void caif_free_client(struct cflayer *adap_layer);
|
||||||
|
* The link_support layer is used to add any Link Layer specific
|
||||||
|
* framing.
|
||||||
|
*/
|
||||||
|
-void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||||
|
+int caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||||
|
struct cflayer *link_support, int head_room,
|
||||||
|
struct cflayer **layer, int (**rcv_func)(
|
||||||
|
struct sk_buff *, struct net_device *,
|
||||||
|
diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h
|
||||||
|
index 70bfd017581fb..219094ace893c 100644
|
||||||
|
--- a/include/net/caif/cfcnfg.h
|
||||||
|
+++ b/include/net/caif/cfcnfg.h
|
||||||
|
@@ -62,7 +62,7 @@ void cfcnfg_remove(struct cfcnfg *cfg);
|
||||||
|
* @fcs: Specify if checksum is used in CAIF Framing Layer.
|
||||||
|
* @head_room: Head space needed by link specific protocol.
|
||||||
|
*/
|
||||||
|
-void
|
||||||
|
+int
|
||||||
|
cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
|
||||||
|
struct net_device *dev, struct cflayer *phy_layer,
|
||||||
|
enum cfcnfg_phy_preference pref,
|
||||||
|
diff --git a/include/net/caif/cfserl.h b/include/net/caif/cfserl.h
|
||||||
|
index b5b020f3c72eb..bc3fae07a25f9 100644
|
||||||
|
--- a/include/net/caif/cfserl.h
|
||||||
|
+++ b/include/net/caif/cfserl.h
|
||||||
|
@@ -9,4 +9,5 @@
|
||||||
|
#include <net/caif/caif_layer.h>
|
||||||
|
|
||||||
|
struct cflayer *cfserl_create(int instance, bool use_stx);
|
||||||
|
+void cfserl_release(struct cflayer *layer);
|
||||||
|
#endif
|
||||||
|
diff --git a/init/main.c b/init/main.c
|
||||||
|
index 7ad08957dd180..9e057314a15f3 100644
|
||||||
|
--- a/init/main.c
|
||||||
|
+++ b/init/main.c
|
||||||
|
@@ -1005,7 +1005,7 @@ static noinline void __init kernel_init_freeable(void)
|
||||||
|
*/
|
||||||
|
set_cpus_allowed_ptr(current, cpu_all_mask);
|
||||||
|
|
||||||
|
- cad_pid = task_pid(current);
|
||||||
|
+ cad_pid = get_pid(task_pid(current));
|
||||||
|
|
||||||
|
smp_prepare_cpus(setup_max_cpus);
|
||||||
|
|
||||||
|
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
|
||||||
|
index 02f44a408edbd..839c534bdcdb9 100644
|
||||||
|
--- a/net/bluetooth/hci_core.c
|
||||||
|
+++ b/net/bluetooth/hci_core.c
|
||||||
|
@@ -1422,8 +1422,13 @@ static int hci_dev_do_open(struct hci_dev *hdev)
|
||||||
|
} else {
|
||||||
|
/* Init failed, cleanup */
|
||||||
|
flush_work(&hdev->tx_work);
|
||||||
|
- flush_work(&hdev->cmd_work);
|
||||||
|
+
|
||||||
|
+ /* Since hci_rx_work() is possible to awake new cmd_work
|
||||||
|
+ * it should be flushed first to avoid unexpected call of
|
||||||
|
+ * hci_cmd_work()
|
||||||
|
+ */
|
||||||
|
flush_work(&hdev->rx_work);
|
||||||
|
+ flush_work(&hdev->cmd_work);
|
||||||
|
|
||||||
|
skb_queue_purge(&hdev->cmd_q);
|
||||||
|
skb_queue_purge(&hdev->rx_q);
|
||||||
|
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
|
||||||
|
index 44b3146c61175..35f5585188de7 100644
|
||||||
|
--- a/net/bluetooth/hci_sock.c
|
||||||
|
+++ b/net/bluetooth/hci_sock.c
|
||||||
|
@@ -750,7 +750,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event)
|
||||||
|
/* Detach sockets from device */
|
||||||
|
read_lock(&hci_sk_list.lock);
|
||||||
|
sk_for_each(sk, &hci_sk_list.head) {
|
||||||
|
- bh_lock_sock_nested(sk);
|
||||||
|
+ lock_sock(sk);
|
||||||
|
if (hci_pi(sk)->hdev == hdev) {
|
||||||
|
hci_pi(sk)->hdev = NULL;
|
||||||
|
sk->sk_err = EPIPE;
|
||||||
|
@@ -759,7 +759,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event)
|
||||||
|
|
||||||
|
hci_dev_put(hdev);
|
||||||
|
}
|
||||||
|
- bh_unlock_sock(sk);
|
||||||
|
+ release_sock(sk);
|
||||||
|
}
|
||||||
|
read_unlock(&hci_sk_list.lock);
|
||||||
|
}
|
||||||
|
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
|
||||||
|
index a0443d40d677c..a28ffbbf7450c 100644
|
||||||
|
--- a/net/caif/caif_dev.c
|
||||||
|
+++ b/net/caif/caif_dev.c
|
||||||
|
@@ -303,7 +303,7 @@ static void dev_flowctrl(struct net_device *dev, int on)
|
||||||
|
caifd_put(caifd);
|
||||||
|
}
|
||||||
|
|
||||||
|
-void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||||
|
+int caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||||
|
struct cflayer *link_support, int head_room,
|
||||||
|
struct cflayer **layer,
|
||||||
|
int (**rcv_func)(struct sk_buff *, struct net_device *,
|
||||||
|
@@ -314,11 +314,12 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||||
|
enum cfcnfg_phy_preference pref;
|
||||||
|
struct cfcnfg *cfg = get_cfcnfg(dev_net(dev));
|
||||||
|
struct caif_device_entry_list *caifdevs;
|
||||||
|
+ int res;
|
||||||
|
|
||||||
|
caifdevs = caif_device_list(dev_net(dev));
|
||||||
|
caifd = caif_device_alloc(dev);
|
||||||
|
if (!caifd)
|
||||||
|
- return;
|
||||||
|
+ return -ENOMEM;
|
||||||
|
*layer = &caifd->layer;
|
||||||
|
spin_lock_init(&caifd->flow_lock);
|
||||||
|
|
||||||
|
@@ -340,7 +341,7 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||||
|
sizeof(caifd->layer.name) - 1);
|
||||||
|
caifd->layer.name[sizeof(caifd->layer.name) - 1] = 0;
|
||||||
|
caifd->layer.transmit = transmit;
|
||||||
|
- cfcnfg_add_phy_layer(cfg,
|
||||||
|
+ res = cfcnfg_add_phy_layer(cfg,
|
||||||
|
dev,
|
||||||
|
&caifd->layer,
|
||||||
|
pref,
|
||||||
|
@@ -350,6 +351,7 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
|
||||||
|
mutex_unlock(&caifdevs->lock);
|
||||||
|
if (rcv_func)
|
||||||
|
*rcv_func = receive;
|
||||||
|
+ return res;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(caif_enroll_dev);
|
||||||
|
|
||||||
|
@@ -364,6 +366,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
|
||||||
|
struct cflayer *layer, *link_support;
|
||||||
|
int head_room = 0;
|
||||||
|
struct caif_device_entry_list *caifdevs;
|
||||||
|
+ int res;
|
||||||
|
|
||||||
|
cfg = get_cfcnfg(dev_net(dev));
|
||||||
|
caifdevs = caif_device_list(dev_net(dev));
|
||||||
|
@@ -389,8 +392,10 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- caif_enroll_dev(dev, caifdev, link_support, head_room,
|
||||||
|
+ res = caif_enroll_dev(dev, caifdev, link_support, head_room,
|
||||||
|
&layer, NULL);
|
||||||
|
+ if (res)
|
||||||
|
+ cfserl_release(link_support);
|
||||||
|
caifdev->flowctrl = dev_flowctrl;
|
||||||
|
break;
|
||||||
|
|
||||||
|
diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c
|
||||||
|
index 5cd44f001f647..485dde566c1a9 100644
|
||||||
|
--- a/net/caif/caif_usb.c
|
||||||
|
+++ b/net/caif/caif_usb.c
|
||||||
|
@@ -116,6 +116,11 @@ static struct cflayer *cfusbl_create(int phyid, u8 ethaddr[ETH_ALEN],
|
||||||
|
return (struct cflayer *) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void cfusbl_release(struct cflayer *layer)
|
||||||
|
+{
|
||||||
|
+ kfree(layer);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static struct packet_type caif_usb_type __read_mostly = {
|
||||||
|
.type = cpu_to_be16(ETH_P_802_EX1),
|
||||||
|
};
|
||||||
|
@@ -128,6 +133,7 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
|
||||||
|
struct cflayer *layer, *link_support;
|
||||||
|
struct usbnet *usbnet;
|
||||||
|
struct usb_device *usbdev;
|
||||||
|
+ int res;
|
||||||
|
|
||||||
|
/* Check whether we have a NCM device, and find its VID/PID. */
|
||||||
|
if (!(dev->dev.parent && dev->dev.parent->driver &&
|
||||||
|
@@ -170,8 +176,11 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
|
||||||
|
if (dev->num_tx_queues > 1)
|
||||||
|
pr_warn("USB device uses more than one tx queue\n");
|
||||||
|
|
||||||
|
- caif_enroll_dev(dev, &common, link_support, CFUSB_MAX_HEADLEN,
|
||||||
|
+ res = caif_enroll_dev(dev, &common, link_support, CFUSB_MAX_HEADLEN,
|
||||||
|
&layer, &caif_usb_type.func);
|
||||||
|
+ if (res)
|
||||||
|
+ goto err;
|
||||||
|
+
|
||||||
|
if (!pack_added)
|
||||||
|
dev_add_pack(&caif_usb_type);
|
||||||
|
pack_added = true;
|
||||||
|
@@ -181,6 +190,9 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
|
||||||
|
layer->name[sizeof(layer->name) - 1] = 0;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
+err:
|
||||||
|
+ cfusbl_release(link_support);
|
||||||
|
+ return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct notifier_block caif_device_notifier = {
|
||||||
|
diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c
|
||||||
|
index fa39fc2987086..c45b531a6cd5c 100644
|
||||||
|
--- a/net/caif/cfcnfg.c
|
||||||
|
+++ b/net/caif/cfcnfg.c
|
||||||
|
@@ -455,7 +455,7 @@ unlock:
|
||||||
|
rcu_read_unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
-void
|
||||||
|
+int
|
||||||
|
cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
|
||||||
|
struct net_device *dev, struct cflayer *phy_layer,
|
||||||
|
enum cfcnfg_phy_preference pref,
|
||||||
|
@@ -464,7 +464,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
|
||||||
|
{
|
||||||
|
struct cflayer *frml;
|
||||||
|
struct cfcnfg_phyinfo *phyinfo = NULL;
|
||||||
|
- int i;
|
||||||
|
+ int i, res = 0;
|
||||||
|
u8 phyid;
|
||||||
|
|
||||||
|
mutex_lock(&cnfg->lock);
|
||||||
|
@@ -478,12 +478,15 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
|
||||||
|
goto got_phyid;
|
||||||
|
}
|
||||||
|
pr_warn("Too many CAIF Link Layers (max 6)\n");
|
||||||
|
+ res = -EEXIST;
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
got_phyid:
|
||||||
|
phyinfo = kzalloc(sizeof(struct cfcnfg_phyinfo), GFP_ATOMIC);
|
||||||
|
- if (!phyinfo)
|
||||||
|
+ if (!phyinfo) {
|
||||||
|
+ res = -ENOMEM;
|
||||||
|
goto out_err;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
phy_layer->id = phyid;
|
||||||
|
phyinfo->pref = pref;
|
||||||
|
@@ -497,8 +500,10 @@ got_phyid:
|
||||||
|
|
||||||
|
frml = cffrml_create(phyid, fcs);
|
||||||
|
|
||||||
|
- if (!frml)
|
||||||
|
+ if (!frml) {
|
||||||
|
+ res = -ENOMEM;
|
||||||
|
goto out_err;
|
||||||
|
+ }
|
||||||
|
phyinfo->frm_layer = frml;
|
||||||
|
layer_set_up(frml, cnfg->mux);
|
||||||
|
|
||||||
|
@@ -516,11 +521,12 @@ got_phyid:
|
||||||
|
list_add_rcu(&phyinfo->node, &cnfg->phys);
|
||||||
|
out:
|
||||||
|
mutex_unlock(&cnfg->lock);
|
||||||
|
- return;
|
||||||
|
+ return res;
|
||||||
|
|
||||||
|
out_err:
|
||||||
|
kfree(phyinfo);
|
||||||
|
mutex_unlock(&cnfg->lock);
|
||||||
|
+ return res;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(cfcnfg_add_phy_layer);
|
||||||
|
|
||||||
|
diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c
|
||||||
|
index ce60f06d76de3..af1e1e36dc90a 100644
|
||||||
|
--- a/net/caif/cfserl.c
|
||||||
|
+++ b/net/caif/cfserl.c
|
||||||
|
@@ -31,6 +31,11 @@ static int cfserl_transmit(struct cflayer *layr, struct cfpkt *pkt);
|
||||||
|
static void cfserl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl,
|
||||||
|
int phyid);
|
||||||
|
|
||||||
|
+void cfserl_release(struct cflayer *layer)
|
||||||
|
+{
|
||||||
|
+ kfree(layer);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
struct cflayer *cfserl_create(int instance, bool use_stx)
|
||||||
|
{
|
||||||
|
struct cfserl *this = kzalloc(sizeof(struct cfserl), GFP_ATOMIC);
|
||||||
|
diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c
|
||||||
|
index c0930b9fe848b..7531cb1665d2b 100644
|
||||||
|
--- a/net/ieee802154/nl-mac.c
|
||||||
|
+++ b/net/ieee802154/nl-mac.c
|
||||||
|
@@ -688,8 +688,10 @@ int ieee802154_llsec_getparams(struct sk_buff *skb, struct genl_info *info)
|
||||||
|
nla_put_u8(msg, IEEE802154_ATTR_LLSEC_SECLEVEL, params.out_level) ||
|
||||||
|
nla_put_u32(msg, IEEE802154_ATTR_LLSEC_FRAME_COUNTER,
|
||||||
|
be32_to_cpu(params.frame_counter)) ||
|
||||||
|
- ieee802154_llsec_fill_key_id(msg, ¶ms.out_key))
|
||||||
|
+ ieee802154_llsec_fill_key_id(msg, ¶ms.out_key)) {
|
||||||
|
+ rc = -ENOBUFS;
|
||||||
|
goto out_free;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
dev_put(dev);
|
||||||
|
|
||||||
|
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c
|
||||||
|
index 77d73014bde31..11f53dc0c1c09 100644
|
||||||
|
--- a/net/ieee802154/nl-phy.c
|
||||||
|
+++ b/net/ieee802154/nl-phy.c
|
||||||
|
@@ -249,8 +249,10 @@ int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nla_put_string(msg, IEEE802154_ATTR_PHY_NAME, wpan_phy_name(phy)) ||
|
||||||
|
- nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name))
|
||||||
|
+ nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name)) {
|
||||||
|
+ rc = -EMSGSIZE;
|
||||||
|
goto nla_put_failure;
|
||||||
|
+ }
|
||||||
|
dev_put(dev);
|
||||||
|
|
||||||
|
wpan_phy_put(phy);
|
||||||
|
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
|
||||||
|
index ba9e711f7e3d6..4e08305a55c48 100644
|
||||||
|
--- a/net/netfilter/ipvs/ip_vs_ctl.c
|
||||||
|
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
|
||||||
|
@@ -1256,7 +1256,7 @@ ip_vs_add_service(struct netns_ipvs *ipvs, struct ip_vs_service_user_kern *u,
|
||||||
|
ip_vs_addr_copy(svc->af, &svc->addr, &u->addr);
|
||||||
|
svc->port = u->port;
|
||||||
|
svc->fwmark = u->fwmark;
|
||||||
|
- svc->flags = u->flags;
|
||||||
|
+ svc->flags = u->flags & ~IP_VS_SVC_F_HASHED;
|
||||||
|
svc->timeout = u->timeout * HZ;
|
||||||
|
svc->netmask = u->netmask;
|
||||||
|
svc->ipvs = ipvs;
|
||||||
|
diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c
|
||||||
|
index 8396dc8ee2474..babe42ff3eecf 100644
|
||||||
|
--- a/net/netfilter/nfnetlink_cthelper.c
|
||||||
|
+++ b/net/netfilter/nfnetlink_cthelper.c
|
||||||
|
@@ -355,10 +355,14 @@ static int
|
||||||
|
nfnl_cthelper_update(const struct nlattr * const tb[],
|
||||||
|
struct nf_conntrack_helper *helper)
|
||||||
|
{
|
||||||
|
+ u32 size;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
- if (tb[NFCTH_PRIV_DATA_LEN])
|
||||||
|
- return -EBUSY;
|
||||||
|
+ if (tb[NFCTH_PRIV_DATA_LEN]) {
|
||||||
|
+ size = ntohl(nla_get_be32(tb[NFCTH_PRIV_DATA_LEN]));
|
||||||
|
+ if (size != helper->data_len)
|
||||||
|
+ return -EBUSY;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (tb[NFCTH_POLICY]) {
|
||||||
|
ret = nfnl_cthelper_update_policy(helper, tb[NFCTH_POLICY]);
|
||||||
|
diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c
|
||||||
|
index 22e340a9049c8..92c6fbfd51f79 100644
|
||||||
|
--- a/net/nfc/llcp_sock.c
|
||||||
|
+++ b/net/nfc/llcp_sock.c
|
||||||
|
@@ -121,6 +121,7 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
|
||||||
|
if (!llcp_sock->service_name) {
|
||||||
|
nfc_llcp_local_put(llcp_sock->local);
|
||||||
|
llcp_sock->local = NULL;
|
||||||
|
+ llcp_sock->dev = NULL;
|
||||||
|
ret = -ENOMEM;
|
||||||
|
goto put_dev;
|
||||||
|
}
|
||||||
|
@@ -130,6 +131,7 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
|
||||||
|
llcp_sock->local = NULL;
|
||||||
|
kfree(llcp_sock->service_name);
|
||||||
|
llcp_sock->service_name = NULL;
|
||||||
|
+ llcp_sock->dev = NULL;
|
||||||
|
ret = -EADDRINUSE;
|
||||||
|
goto put_dev;
|
||||||
|
}
|
||||||
|
diff --git a/sound/core/timer.c b/sound/core/timer.c
|
||||||
|
index f8a4b2a2f8f6b..6475b85599364 100644
|
||||||
|
--- a/sound/core/timer.c
|
||||||
|
+++ b/sound/core/timer.c
|
||||||
|
@@ -488,9 +488,10 @@ static void snd_timer_notify1(struct snd_timer_instance *ti, int event)
|
||||||
|
return;
|
||||||
|
if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE)
|
||||||
|
return;
|
||||||
|
+ event += 10; /* convert to SNDRV_TIMER_EVENT_MXXX */
|
||||||
|
list_for_each_entry(ts, &ti->slave_active_head, active_list)
|
||||||
|
if (ts->ccallback)
|
||||||
|
- ts->ccallback(ts, event + 100, &tstamp, resolution);
|
||||||
|
+ ts->ccallback(ts, event, &tstamp, resolution);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* start/continue a master timer */
|
||||||
1101
patch/kernel/archive/sun50iw9-4.9/patch-4.9.272-273.patch
Normal file
1101
patch/kernel/archive/sun50iw9-4.9/patch-4.9.272-273.patch
Normal file
File diff suppressed because it is too large
Load Diff
2065
patch/kernel/archive/sun50iw9-4.9/patch-4.9.273-274.patch
Normal file
2065
patch/kernel/archive/sun50iw9-4.9/patch-4.9.273-274.patch
Normal file
File diff suppressed because it is too large
Load Diff
423
patch/kernel/archive/sun50iw9-4.9/patch-4.9.274-275.patch
Normal file
423
patch/kernel/archive/sun50iw9-4.9/patch-4.9.274-275.patch
Normal file
@@ -0,0 +1,423 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 3002dfee32314..dfd253648758c 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 274
|
||||||
|
+SUBLEVEL = 275
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
|
||||||
|
index a2e6a81669e78..94b7798bdea4e 100644
|
||||||
|
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
|
||||||
|
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
|
||||||
|
@@ -447,7 +447,7 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)
|
||||||
|
struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
- if (!ttm_dma)
|
||||||
|
+ if (!ttm_dma || !ttm_dma->dma_address)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Don't waste time looping if the object is coherent */
|
||||||
|
@@ -467,7 +467,7 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo)
|
||||||
|
struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
- if (!ttm_dma)
|
||||||
|
+ if (!ttm_dma || !ttm_dma->dma_address)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Don't waste time looping if the object is coherent */
|
||||||
|
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
|
||||||
|
index 67a73ea0a615e..5e51a39a0c27e 100644
|
||||||
|
--- a/drivers/scsi/sr.c
|
||||||
|
+++ b/drivers/scsi/sr.c
|
||||||
|
@@ -216,6 +216,8 @@ static unsigned int sr_get_events(struct scsi_device *sdev)
|
||||||
|
return DISK_EVENT_EJECT_REQUEST;
|
||||||
|
else if (med->media_event_code == 2)
|
||||||
|
return DISK_EVENT_MEDIA_CHANGE;
|
||||||
|
+ else if (med->media_event_code == 3)
|
||||||
|
+ return DISK_EVENT_EJECT_REQUEST;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
|
||||||
|
index ea307f40cab19..c6e6b7470cbf6 100644
|
||||||
|
--- a/drivers/xen/events/events_base.c
|
||||||
|
+++ b/drivers/xen/events/events_base.c
|
||||||
|
@@ -533,6 +533,9 @@ static void xen_irq_lateeoi_locked(struct irq_info *info, bool spurious)
|
||||||
|
}
|
||||||
|
|
||||||
|
info->eoi_time = 0;
|
||||||
|
+
|
||||||
|
+ /* is_active hasn't been reset yet, do it now. */
|
||||||
|
+ smp_store_release(&info->is_active, 0);
|
||||||
|
do_unmask(info, EVT_MASK_REASON_EOI_PENDING);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1778,10 +1781,22 @@ static void lateeoi_ack_dynirq(struct irq_data *data)
|
||||||
|
struct irq_info *info = info_for_irq(data->irq);
|
||||||
|
evtchn_port_t evtchn = info ? info->evtchn : 0;
|
||||||
|
|
||||||
|
- if (VALID_EVTCHN(evtchn)) {
|
||||||
|
- do_mask(info, EVT_MASK_REASON_EOI_PENDING);
|
||||||
|
- ack_dynirq(data);
|
||||||
|
- }
|
||||||
|
+ if (!VALID_EVTCHN(evtchn))
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ do_mask(info, EVT_MASK_REASON_EOI_PENDING);
|
||||||
|
+
|
||||||
|
+ if (unlikely(irqd_is_setaffinity_pending(data)) &&
|
||||||
|
+ likely(!irqd_irq_disabled(data))) {
|
||||||
|
+ do_mask(info, EVT_MASK_REASON_TEMPORARY);
|
||||||
|
+
|
||||||
|
+ clear_evtchn(evtchn);
|
||||||
|
+
|
||||||
|
+ irq_move_masked_irq(data);
|
||||||
|
+
|
||||||
|
+ do_unmask(info, EVT_MASK_REASON_TEMPORARY);
|
||||||
|
+ } else
|
||||||
|
+ clear_evtchn(evtchn);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void lateeoi_mask_ack_dynirq(struct irq_data *data)
|
||||||
|
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
|
||||||
|
index 8dd365c654780..6417bc845db56 100644
|
||||||
|
--- a/include/linux/hugetlb.h
|
||||||
|
+++ b/include/linux/hugetlb.h
|
||||||
|
@@ -451,17 +451,6 @@ static inline int hstate_index(struct hstate *h)
|
||||||
|
return h - hstates;
|
||||||
|
}
|
||||||
|
|
||||||
|
-pgoff_t __basepage_index(struct page *page);
|
||||||
|
-
|
||||||
|
-/* Return page->index in PAGE_SIZE units */
|
||||||
|
-static inline pgoff_t basepage_index(struct page *page)
|
||||||
|
-{
|
||||||
|
- if (!PageCompound(page))
|
||||||
|
- return page->index;
|
||||||
|
-
|
||||||
|
- return __basepage_index(page);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
extern int dissolve_free_huge_pages(unsigned long start_pfn,
|
||||||
|
unsigned long end_pfn);
|
||||||
|
static inline bool hugepage_migration_supported(struct hstate *h)
|
||||||
|
@@ -529,10 +518,6 @@ static inline unsigned int pages_per_huge_page(struct hstate *h)
|
||||||
|
#define hstate_index_to_shift(index) 0
|
||||||
|
#define hstate_index(h) 0
|
||||||
|
|
||||||
|
-static inline pgoff_t basepage_index(struct page *page)
|
||||||
|
-{
|
||||||
|
- return page->index;
|
||||||
|
-}
|
||||||
|
#define dissolve_free_huge_pages(s, e) 0
|
||||||
|
#define hugepage_migration_supported(h) false
|
||||||
|
|
||||||
|
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
|
||||||
|
index 451a811f48f26..d1fb3bbff37ad 100644
|
||||||
|
--- a/include/linux/mmdebug.h
|
||||||
|
+++ b/include/linux/mmdebug.h
|
||||||
|
@@ -36,10 +36,22 @@ void dump_mm(const struct mm_struct *mm);
|
||||||
|
BUG(); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
-#define VM_WARN_ON(cond) WARN_ON(cond)
|
||||||
|
-#define VM_WARN_ON_ONCE(cond) WARN_ON_ONCE(cond)
|
||||||
|
-#define VM_WARN_ONCE(cond, format...) WARN_ONCE(cond, format)
|
||||||
|
-#define VM_WARN(cond, format...) WARN(cond, format)
|
||||||
|
+#define VM_WARN_ON_ONCE_PAGE(cond, page) ({ \
|
||||||
|
+ static bool __section(".data.once") __warned; \
|
||||||
|
+ int __ret_warn_once = !!(cond); \
|
||||||
|
+ \
|
||||||
|
+ if (unlikely(__ret_warn_once && !__warned)) { \
|
||||||
|
+ dump_page(page, "VM_WARN_ON_ONCE_PAGE(" __stringify(cond)")");\
|
||||||
|
+ __warned = true; \
|
||||||
|
+ WARN_ON(1); \
|
||||||
|
+ } \
|
||||||
|
+ unlikely(__ret_warn_once); \
|
||||||
|
+})
|
||||||
|
+
|
||||||
|
+#define VM_WARN_ON(cond) (void)WARN_ON(cond)
|
||||||
|
+#define VM_WARN_ON_ONCE(cond) (void)WARN_ON_ONCE(cond)
|
||||||
|
+#define VM_WARN_ONCE(cond, format...) (void)WARN_ONCE(cond, format)
|
||||||
|
+#define VM_WARN(cond, format...) (void)WARN(cond, format)
|
||||||
|
#else
|
||||||
|
#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
|
||||||
|
#define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond)
|
||||||
|
@@ -47,6 +59,7 @@ void dump_mm(const struct mm_struct *mm);
|
||||||
|
#define VM_BUG_ON_MM(cond, mm) VM_BUG_ON(cond)
|
||||||
|
#define VM_WARN_ON(cond) BUILD_BUG_ON_INVALID(cond)
|
||||||
|
#define VM_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond)
|
||||||
|
+#define VM_WARN_ON_ONCE_PAGE(cond, page) BUILD_BUG_ON_INVALID(cond)
|
||||||
|
#define VM_WARN_ONCE(cond, format...) BUILD_BUG_ON_INVALID(cond)
|
||||||
|
#define VM_WARN(cond, format...) BUILD_BUG_ON_INVALID(cond)
|
||||||
|
#endif
|
||||||
|
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
|
||||||
|
index 35f4c4d9c4054..8672291633ddf 100644
|
||||||
|
--- a/include/linux/pagemap.h
|
||||||
|
+++ b/include/linux/pagemap.h
|
||||||
|
@@ -374,7 +374,7 @@ static inline struct page *read_mapping_page(struct address_space *mapping,
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
- * Get index of the page with in radix-tree
|
||||||
|
+ * Get index of the page within radix-tree (but not for hugetlb pages).
|
||||||
|
* (TODO: remove once hugetlb pages will have ->index in PAGE_SIZE)
|
||||||
|
*/
|
||||||
|
static inline pgoff_t page_to_index(struct page *page)
|
||||||
|
@@ -393,15 +393,16 @@ static inline pgoff_t page_to_index(struct page *page)
|
||||||
|
return pgoff;
|
||||||
|
}
|
||||||
|
|
||||||
|
+extern pgoff_t hugetlb_basepage_index(struct page *page);
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
- * Get the offset in PAGE_SIZE.
|
||||||
|
- * (TODO: hugepage should have ->index in PAGE_SIZE)
|
||||||
|
+ * Get the offset in PAGE_SIZE (even for hugetlb pages).
|
||||||
|
+ * (TODO: hugetlb pages should have ->index in PAGE_SIZE)
|
||||||
|
*/
|
||||||
|
static inline pgoff_t page_to_pgoff(struct page *page)
|
||||||
|
{
|
||||||
|
- if (unlikely(PageHeadHuge(page)))
|
||||||
|
- return page->index << compound_order(page);
|
||||||
|
-
|
||||||
|
+ if (unlikely(PageHuge(page)))
|
||||||
|
+ return hugetlb_basepage_index(page);
|
||||||
|
return page_to_index(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/kernel/futex.c b/kernel/futex.c
|
||||||
|
index 324fb85c89049..b3823736af6f9 100644
|
||||||
|
--- a/kernel/futex.c
|
||||||
|
+++ b/kernel/futex.c
|
||||||
|
@@ -717,7 +717,7 @@ again:
|
||||||
|
|
||||||
|
key->both.offset |= FUT_OFF_INODE; /* inode-based key */
|
||||||
|
key->shared.i_seq = get_inode_sequence_number(inode);
|
||||||
|
- key->shared.pgoff = basepage_index(tail);
|
||||||
|
+ key->shared.pgoff = page_to_pgoff(tail);
|
||||||
|
rcu_read_unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/kernel/kthread.c b/kernel/kthread.c
|
||||||
|
index 60f54c5a07a46..52b89c582189b 100644
|
||||||
|
--- a/kernel/kthread.c
|
||||||
|
+++ b/kernel/kthread.c
|
||||||
|
@@ -952,8 +952,38 @@ void kthread_flush_work(struct kthread_work *work)
|
||||||
|
EXPORT_SYMBOL_GPL(kthread_flush_work);
|
||||||
|
|
||||||
|
/*
|
||||||
|
- * This function removes the work from the worker queue. Also it makes sure
|
||||||
|
- * that it won't get queued later via the delayed work's timer.
|
||||||
|
+ * Make sure that the timer is neither set nor running and could
|
||||||
|
+ * not manipulate the work list_head any longer.
|
||||||
|
+ *
|
||||||
|
+ * The function is called under worker->lock. The lock is temporary
|
||||||
|
+ * released but the timer can't be set again in the meantime.
|
||||||
|
+ */
|
||||||
|
+static void kthread_cancel_delayed_work_timer(struct kthread_work *work,
|
||||||
|
+ unsigned long *flags)
|
||||||
|
+{
|
||||||
|
+ struct kthread_delayed_work *dwork =
|
||||||
|
+ container_of(work, struct kthread_delayed_work, work);
|
||||||
|
+ struct kthread_worker *worker = work->worker;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * del_timer_sync() must be called to make sure that the timer
|
||||||
|
+ * callback is not running. The lock must be temporary released
|
||||||
|
+ * to avoid a deadlock with the callback. In the meantime,
|
||||||
|
+ * any queuing is blocked by setting the canceling counter.
|
||||||
|
+ */
|
||||||
|
+ work->canceling++;
|
||||||
|
+ spin_unlock_irqrestore(&worker->lock, *flags);
|
||||||
|
+ del_timer_sync(&dwork->timer);
|
||||||
|
+ spin_lock_irqsave(&worker->lock, *flags);
|
||||||
|
+ work->canceling--;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * This function removes the work from the worker queue.
|
||||||
|
+ *
|
||||||
|
+ * It is called under worker->lock. The caller must make sure that
|
||||||
|
+ * the timer used by delayed work is not running, e.g. by calling
|
||||||
|
+ * kthread_cancel_delayed_work_timer().
|
||||||
|
*
|
||||||
|
* The work might still be in use when this function finishes. See the
|
||||||
|
* current_work proceed by the worker.
|
||||||
|
@@ -961,28 +991,8 @@ EXPORT_SYMBOL_GPL(kthread_flush_work);
|
||||||
|
* Return: %true if @work was pending and successfully canceled,
|
||||||
|
* %false if @work was not pending
|
||||||
|
*/
|
||||||
|
-static bool __kthread_cancel_work(struct kthread_work *work, bool is_dwork,
|
||||||
|
- unsigned long *flags)
|
||||||
|
+static bool __kthread_cancel_work(struct kthread_work *work)
|
||||||
|
{
|
||||||
|
- /* Try to cancel the timer if exists. */
|
||||||
|
- if (is_dwork) {
|
||||||
|
- struct kthread_delayed_work *dwork =
|
||||||
|
- container_of(work, struct kthread_delayed_work, work);
|
||||||
|
- struct kthread_worker *worker = work->worker;
|
||||||
|
-
|
||||||
|
- /*
|
||||||
|
- * del_timer_sync() must be called to make sure that the timer
|
||||||
|
- * callback is not running. The lock must be temporary released
|
||||||
|
- * to avoid a deadlock with the callback. In the meantime,
|
||||||
|
- * any queuing is blocked by setting the canceling counter.
|
||||||
|
- */
|
||||||
|
- work->canceling++;
|
||||||
|
- spin_unlock_irqrestore(&worker->lock, *flags);
|
||||||
|
- del_timer_sync(&dwork->timer);
|
||||||
|
- spin_lock_irqsave(&worker->lock, *flags);
|
||||||
|
- work->canceling--;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
/*
|
||||||
|
* Try to remove the work from a worker list. It might either
|
||||||
|
* be from worker->work_list or from worker->delayed_work_list.
|
||||||
|
@@ -1035,11 +1045,23 @@ bool kthread_mod_delayed_work(struct kthread_worker *worker,
|
||||||
|
/* Work must not be used with >1 worker, see kthread_queue_work() */
|
||||||
|
WARN_ON_ONCE(work->worker != worker);
|
||||||
|
|
||||||
|
- /* Do not fight with another command that is canceling this work. */
|
||||||
|
+ /*
|
||||||
|
+ * Temporary cancel the work but do not fight with another command
|
||||||
|
+ * that is canceling the work as well.
|
||||||
|
+ *
|
||||||
|
+ * It is a bit tricky because of possible races with another
|
||||||
|
+ * mod_delayed_work() and cancel_delayed_work() callers.
|
||||||
|
+ *
|
||||||
|
+ * The timer must be canceled first because worker->lock is released
|
||||||
|
+ * when doing so. But the work can be removed from the queue (list)
|
||||||
|
+ * only when it can be queued again so that the return value can
|
||||||
|
+ * be used for reference counting.
|
||||||
|
+ */
|
||||||
|
+ kthread_cancel_delayed_work_timer(work, &flags);
|
||||||
|
if (work->canceling)
|
||||||
|
goto out;
|
||||||
|
+ ret = __kthread_cancel_work(work);
|
||||||
|
|
||||||
|
- ret = __kthread_cancel_work(work, true, &flags);
|
||||||
|
fast_queue:
|
||||||
|
__kthread_queue_delayed_work(worker, dwork, delay);
|
||||||
|
out:
|
||||||
|
@@ -1061,7 +1083,10 @@ static bool __kthread_cancel_work_sync(struct kthread_work *work, bool is_dwork)
|
||||||
|
/* Work must not be used with >1 worker, see kthread_queue_work(). */
|
||||||
|
WARN_ON_ONCE(work->worker != worker);
|
||||||
|
|
||||||
|
- ret = __kthread_cancel_work(work, is_dwork, &flags);
|
||||||
|
+ if (is_dwork)
|
||||||
|
+ kthread_cancel_delayed_work_timer(work, &flags);
|
||||||
|
+
|
||||||
|
+ ret = __kthread_cancel_work(work);
|
||||||
|
|
||||||
|
if (worker->current_work != work)
|
||||||
|
goto out_fast;
|
||||||
|
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
|
||||||
|
index 14cd0ef33b628..177ca028b9868 100644
|
||||||
|
--- a/mm/huge_memory.c
|
||||||
|
+++ b/mm/huge_memory.c
|
||||||
|
@@ -1891,7 +1891,7 @@ static void unmap_page(struct page *page)
|
||||||
|
{
|
||||||
|
enum ttu_flags ttu_flags = TTU_IGNORE_MLOCK | TTU_IGNORE_ACCESS |
|
||||||
|
TTU_RMAP_LOCKED;
|
||||||
|
- int i, ret;
|
||||||
|
+ int i;
|
||||||
|
|
||||||
|
VM_BUG_ON_PAGE(!PageHead(page), page);
|
||||||
|
|
||||||
|
@@ -1899,15 +1899,16 @@ static void unmap_page(struct page *page)
|
||||||
|
ttu_flags |= TTU_MIGRATION;
|
||||||
|
|
||||||
|
/* We only need TTU_SPLIT_HUGE_PMD once */
|
||||||
|
- ret = try_to_unmap(page, ttu_flags | TTU_SPLIT_HUGE_PMD);
|
||||||
|
- for (i = 1; !ret && i < HPAGE_PMD_NR; i++) {
|
||||||
|
+ try_to_unmap(page, ttu_flags | TTU_SPLIT_HUGE_PMD);
|
||||||
|
+ for (i = 1; i < HPAGE_PMD_NR; i++) {
|
||||||
|
/* Cut short if the page is unmapped */
|
||||||
|
if (page_count(page) == 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
- ret = try_to_unmap(page + i, ttu_flags);
|
||||||
|
+ try_to_unmap(page + i, ttu_flags);
|
||||||
|
}
|
||||||
|
- VM_BUG_ON_PAGE(ret, page + i - 1);
|
||||||
|
+
|
||||||
|
+ VM_WARN_ON_ONCE_PAGE(page_mapped(page), page);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void remap_page(struct page *page)
|
||||||
|
@@ -2137,7 +2138,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
|
||||||
|
struct pglist_data *pgdata = NODE_DATA(page_to_nid(head));
|
||||||
|
struct anon_vma *anon_vma = NULL;
|
||||||
|
struct address_space *mapping = NULL;
|
||||||
|
- int count, mapcount, extra_pins, ret;
|
||||||
|
+ int extra_pins, ret;
|
||||||
|
bool mlocked;
|
||||||
|
unsigned long flags;
|
||||||
|
pgoff_t end;
|
||||||
|
@@ -2200,7 +2201,6 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
|
||||||
|
|
||||||
|
mlocked = PageMlocked(page);
|
||||||
|
unmap_page(head);
|
||||||
|
- VM_BUG_ON_PAGE(compound_mapcount(head), head);
|
||||||
|
|
||||||
|
/* Make sure the page is not on per-CPU pagevec as it takes pin */
|
||||||
|
if (mlocked)
|
||||||
|
@@ -2226,9 +2226,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
|
||||||
|
|
||||||
|
/* Prevent deferred_split_scan() touching ->_refcount */
|
||||||
|
spin_lock(&pgdata->split_queue_lock);
|
||||||
|
- count = page_count(head);
|
||||||
|
- mapcount = total_mapcount(head);
|
||||||
|
- if (!mapcount && page_ref_freeze(head, 1 + extra_pins)) {
|
||||||
|
+ if (page_ref_freeze(head, 1 + extra_pins)) {
|
||||||
|
if (!list_empty(page_deferred_list(head))) {
|
||||||
|
pgdata->split_queue_len--;
|
||||||
|
list_del(page_deferred_list(head));
|
||||||
|
@@ -2239,16 +2237,9 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
|
||||||
|
__split_huge_page(page, list, end, flags);
|
||||||
|
ret = 0;
|
||||||
|
} else {
|
||||||
|
- if (IS_ENABLED(CONFIG_DEBUG_VM) && mapcount) {
|
||||||
|
- pr_alert("total_mapcount: %u, page_count(): %u\n",
|
||||||
|
- mapcount, count);
|
||||||
|
- if (PageTail(page))
|
||||||
|
- dump_page(head, NULL);
|
||||||
|
- dump_page(page, "total_mapcount(head) > 0");
|
||||||
|
- BUG();
|
||||||
|
- }
|
||||||
|
spin_unlock(&pgdata->split_queue_lock);
|
||||||
|
-fail: if (mapping)
|
||||||
|
+fail:
|
||||||
|
+ if (mapping)
|
||||||
|
spin_unlock(&mapping->tree_lock);
|
||||||
|
spin_unlock_irqrestore(zone_lru_lock(page_zone(head)), flags);
|
||||||
|
remap_page(head);
|
||||||
|
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
|
||||||
|
index b7215b0807ca6..de89e9295f6c5 100644
|
||||||
|
--- a/mm/hugetlb.c
|
||||||
|
+++ b/mm/hugetlb.c
|
||||||
|
@@ -1380,15 +1380,12 @@ int PageHeadHuge(struct page *page_head)
|
||||||
|
return get_compound_page_dtor(page_head) == free_huge_page;
|
||||||
|
}
|
||||||
|
|
||||||
|
-pgoff_t __basepage_index(struct page *page)
|
||||||
|
+pgoff_t hugetlb_basepage_index(struct page *page)
|
||||||
|
{
|
||||||
|
struct page *page_head = compound_head(page);
|
||||||
|
pgoff_t index = page_index(page_head);
|
||||||
|
unsigned long compound_idx;
|
||||||
|
|
||||||
|
- if (!PageHuge(page_head))
|
||||||
|
- return page_index(page);
|
||||||
|
-
|
||||||
|
if (compound_order(page_head) >= MAX_ORDER)
|
||||||
|
compound_idx = page_to_pfn(page) - page_to_pfn(page_head);
|
||||||
|
else
|
||||||
6105
patch/kernel/archive/sun50iw9-4.9/patch-4.9.275-276.patch
Normal file
6105
patch/kernel/archive/sun50iw9-4.9/patch-4.9.275-276.patch
Normal file
File diff suppressed because it is too large
Load Diff
1989
patch/kernel/archive/sun50iw9-4.9/patch-4.9.276-277.patch
Normal file
1989
patch/kernel/archive/sun50iw9-4.9/patch-4.9.276-277.patch
Normal file
File diff suppressed because it is too large
Load Diff
1683
patch/kernel/archive/sun50iw9-4.9/patch-4.9.277-278.patch
Normal file
1683
patch/kernel/archive/sun50iw9-4.9/patch-4.9.277-278.patch
Normal file
File diff suppressed because it is too large
Load Diff
204
patch/kernel/archive/sun50iw9-4.9/patch-4.9.278-279.patch
Normal file
204
patch/kernel/archive/sun50iw9-4.9/patch-4.9.278-279.patch
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 82fc1c7475926..b88bc8d14ca38 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 278
|
||||||
|
+SUBLEVEL = 279
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
|
||||||
|
index 64fdea3328861..96f6edcb00627 100644
|
||||||
|
--- a/drivers/net/usb/r8152.c
|
||||||
|
+++ b/drivers/net/usb/r8152.c
|
||||||
|
@@ -3347,9 +3347,10 @@ static int rtl8152_close(struct net_device *netdev)
|
||||||
|
tp->rtl_ops.down(tp);
|
||||||
|
|
||||||
|
mutex_unlock(&tp->control);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
+ if (!res)
|
||||||
|
usb_autopm_put_interface(tp->intf);
|
||||||
|
- }
|
||||||
|
|
||||||
|
free_all_mem(tp);
|
||||||
|
|
||||||
|
diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
|
||||||
|
index 419aecb942749..dd0bf25d45502 100644
|
||||||
|
--- a/drivers/spi/spi-mt65xx.c
|
||||||
|
+++ b/drivers/spi/spi-mt65xx.c
|
||||||
|
@@ -337,24 +337,15 @@ static int mtk_spi_fifo_transfer(struct spi_master *master,
|
||||||
|
mtk_spi_prepare_transfer(master, xfer);
|
||||||
|
mtk_spi_setup_packet(master);
|
||||||
|
|
||||||
|
- cnt = xfer->len / 4;
|
||||||
|
- if (xfer->tx_buf)
|
||||||
|
+ if (xfer->tx_buf) {
|
||||||
|
+ cnt = xfer->len / 4;
|
||||||
|
iowrite32_rep(mdata->base + SPI_TX_DATA_REG, xfer->tx_buf, cnt);
|
||||||
|
-
|
||||||
|
- if (xfer->rx_buf)
|
||||||
|
- ioread32_rep(mdata->base + SPI_RX_DATA_REG, xfer->rx_buf, cnt);
|
||||||
|
-
|
||||||
|
- remainder = xfer->len % 4;
|
||||||
|
- if (remainder > 0) {
|
||||||
|
- reg_val = 0;
|
||||||
|
- if (xfer->tx_buf) {
|
||||||
|
+ remainder = xfer->len % 4;
|
||||||
|
+ if (remainder > 0) {
|
||||||
|
+ reg_val = 0;
|
||||||
|
memcpy(®_val, xfer->tx_buf + (cnt * 4), remainder);
|
||||||
|
writel(reg_val, mdata->base + SPI_TX_DATA_REG);
|
||||||
|
}
|
||||||
|
- if (xfer->rx_buf) {
|
||||||
|
- reg_val = readl(mdata->base + SPI_RX_DATA_REG);
|
||||||
|
- memcpy(xfer->rx_buf + (cnt * 4), ®_val, remainder);
|
||||||
|
- }
|
||||||
|
}
|
||||||
|
|
||||||
|
mtk_spi_enable_transfer(master);
|
||||||
|
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
|
||||||
|
index d4d8b7e36b2ff..2534e44cfd40e 100644
|
||||||
|
--- a/fs/btrfs/compression.c
|
||||||
|
+++ b/fs/btrfs/compression.c
|
||||||
|
@@ -290,7 +290,7 @@ static void end_compressed_bio_write(struct bio *bio)
|
||||||
|
cb->start,
|
||||||
|
cb->start + cb->len - 1,
|
||||||
|
NULL,
|
||||||
|
- bio->bi_error ? 0 : 1);
|
||||||
|
+ !cb->errors);
|
||||||
|
cb->compressed_pages[0]->mapping = NULL;
|
||||||
|
|
||||||
|
end_compressed_writeback(inode, cb);
|
||||||
|
diff --git a/include/linux/mfd/rt5033-private.h b/include/linux/mfd/rt5033-private.h
|
||||||
|
index 1b63fc2f42d1c..52d53d134f72c 100644
|
||||||
|
--- a/include/linux/mfd/rt5033-private.h
|
||||||
|
+++ b/include/linux/mfd/rt5033-private.h
|
||||||
|
@@ -203,13 +203,13 @@ enum rt5033_reg {
|
||||||
|
#define RT5033_REGULATOR_BUCK_VOLTAGE_MIN 1000000U
|
||||||
|
#define RT5033_REGULATOR_BUCK_VOLTAGE_MAX 3000000U
|
||||||
|
#define RT5033_REGULATOR_BUCK_VOLTAGE_STEP 100000U
|
||||||
|
-#define RT5033_REGULATOR_BUCK_VOLTAGE_STEP_NUM 32
|
||||||
|
+#define RT5033_REGULATOR_BUCK_VOLTAGE_STEP_NUM 21
|
||||||
|
|
||||||
|
/* RT5033 regulator LDO output voltage uV */
|
||||||
|
#define RT5033_REGULATOR_LDO_VOLTAGE_MIN 1200000U
|
||||||
|
#define RT5033_REGULATOR_LDO_VOLTAGE_MAX 3000000U
|
||||||
|
#define RT5033_REGULATOR_LDO_VOLTAGE_STEP 100000U
|
||||||
|
-#define RT5033_REGULATOR_LDO_VOLTAGE_STEP_NUM 32
|
||||||
|
+#define RT5033_REGULATOR_LDO_VOLTAGE_STEP_NUM 19
|
||||||
|
|
||||||
|
/* RT5033 regulator SAFE LDO output voltage uV */
|
||||||
|
#define RT5033_REGULATOR_SAFE_LDO_VOLTAGE 4900000U
|
||||||
|
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
|
||||||
|
index 50b9a0bbe5dff..839c534bdcdb9 100644
|
||||||
|
--- a/net/bluetooth/hci_core.c
|
||||||
|
+++ b/net/bluetooth/hci_core.c
|
||||||
|
@@ -1533,6 +1533,14 @@ int hci_dev_do_close(struct hci_dev *hdev)
|
||||||
|
|
||||||
|
BT_DBG("%s %p", hdev->name, hdev);
|
||||||
|
|
||||||
|
+ if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) &&
|
||||||
|
+ !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
|
||||||
|
+ test_bit(HCI_UP, &hdev->flags)) {
|
||||||
|
+ /* Execute vendor specific shutdown routine */
|
||||||
|
+ if (hdev->shutdown)
|
||||||
|
+ hdev->shutdown(hdev);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
cancel_delayed_work(&hdev->power_off);
|
||||||
|
|
||||||
|
hci_request_cancel_all(hdev);
|
||||||
|
@@ -1600,14 +1608,6 @@ int hci_dev_do_close(struct hci_dev *hdev)
|
||||||
|
clear_bit(HCI_INIT, &hdev->flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) &&
|
||||||
|
- !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
|
||||||
|
- test_bit(HCI_UP, &hdev->flags)) {
|
||||||
|
- /* Execute vendor specific shutdown routine */
|
||||||
|
- if (hdev->shutdown)
|
||||||
|
- hdev->shutdown(hdev);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
/* flush cmd work */
|
||||||
|
flush_work(&hdev->cmd_work);
|
||||||
|
|
||||||
|
diff --git a/net/can/raw.c b/net/can/raw.c
|
||||||
|
index 2bb50b1535c2f..082965c8dcaf6 100644
|
||||||
|
--- a/net/can/raw.c
|
||||||
|
+++ b/net/can/raw.c
|
||||||
|
@@ -541,10 +541,18 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
|
||||||
|
return -EFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ rtnl_lock();
|
||||||
|
lock_sock(sk);
|
||||||
|
|
||||||
|
- if (ro->bound && ro->ifindex)
|
||||||
|
+ if (ro->bound && ro->ifindex) {
|
||||||
|
dev = dev_get_by_index(&init_net, ro->ifindex);
|
||||||
|
+ if (!dev) {
|
||||||
|
+ if (count > 1)
|
||||||
|
+ kfree(filter);
|
||||||
|
+ err = -ENODEV;
|
||||||
|
+ goto out_fil;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (ro->bound) {
|
||||||
|
/* (try to) register the new filters */
|
||||||
|
@@ -581,6 +589,7 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
|
||||||
|
dev_put(dev);
|
||||||
|
|
||||||
|
release_sock(sk);
|
||||||
|
+ rtnl_unlock();
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
@@ -593,10 +602,16 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
|
||||||
|
|
||||||
|
err_mask &= CAN_ERR_MASK;
|
||||||
|
|
||||||
|
+ rtnl_lock();
|
||||||
|
lock_sock(sk);
|
||||||
|
|
||||||
|
- if (ro->bound && ro->ifindex)
|
||||||
|
+ if (ro->bound && ro->ifindex) {
|
||||||
|
dev = dev_get_by_index(&init_net, ro->ifindex);
|
||||||
|
+ if (!dev) {
|
||||||
|
+ err = -ENODEV;
|
||||||
|
+ goto out_err;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
|
||||||
|
/* remove current error mask */
|
||||||
|
if (ro->bound) {
|
||||||
|
@@ -618,6 +633,7 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
|
||||||
|
dev_put(dev);
|
||||||
|
|
||||||
|
release_sock(sk);
|
||||||
|
+ rtnl_unlock();
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
|
||||||
|
index 076444dac96d1..0e34f5ad62162 100644
|
||||||
|
--- a/net/core/skbuff.c
|
||||||
|
+++ b/net/core/skbuff.c
|
||||||
|
@@ -2288,8 +2288,11 @@ skb_zerocopy_headlen(const struct sk_buff *from)
|
||||||
|
|
||||||
|
if (!from->head_frag ||
|
||||||
|
skb_headlen(from) < L1_CACHE_BYTES ||
|
||||||
|
- skb_shinfo(from)->nr_frags >= MAX_SKB_FRAGS)
|
||||||
|
+ skb_shinfo(from)->nr_frags >= MAX_SKB_FRAGS) {
|
||||||
|
hlen = skb_headlen(from);
|
||||||
|
+ if (!hlen)
|
||||||
|
+ hlen = from->len;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (skb_has_frag_list(from))
|
||||||
|
hlen = from->len;
|
||||||
998
patch/kernel/archive/sun50iw9-4.9/patch-4.9.279-280.patch
Normal file
998
patch/kernel/archive/sun50iw9-4.9/patch-4.9.279-280.patch
Normal file
@@ -0,0 +1,998 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index b88bc8d14ca38..7cd5634469b10 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 279
|
||||||
|
+SUBLEVEL = 280
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
|
||||||
|
index 46bf263c31531..d2477a502ce74 100644
|
||||||
|
--- a/arch/alpha/kernel/smp.c
|
||||||
|
+++ b/arch/alpha/kernel/smp.c
|
||||||
|
@@ -584,7 +584,7 @@ void
|
||||||
|
smp_send_stop(void)
|
||||||
|
{
|
||||||
|
cpumask_t to_whom;
|
||||||
|
- cpumask_copy(&to_whom, cpu_possible_mask);
|
||||||
|
+ cpumask_copy(&to_whom, cpu_online_mask);
|
||||||
|
cpumask_clear_cpu(smp_processor_id(), &to_whom);
|
||||||
|
#ifdef DEBUG_IPI_MSG
|
||||||
|
if (hard_smp_processor_id() != boot_cpu_id)
|
||||||
|
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
|
||||||
|
index 25f3bfef9b390..af4eff7d22ecc 100644
|
||||||
|
--- a/arch/mips/Makefile
|
||||||
|
+++ b/arch/mips/Makefile
|
||||||
|
@@ -286,7 +286,7 @@ LDFLAGS += -m $(ld-emul)
|
||||||
|
|
||||||
|
ifdef CONFIG_MIPS
|
||||||
|
CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
|
||||||
|
- egrep -vw '__GNUC_(|MINOR_|PATCHLEVEL_)_' | \
|
||||||
|
+ egrep -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
|
||||||
|
sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g')
|
||||||
|
ifdef CONFIG_64BIT
|
||||||
|
CHECKFLAGS += -m64
|
||||||
|
diff --git a/arch/mips/mti-malta/malta-platform.c b/arch/mips/mti-malta/malta-platform.c
|
||||||
|
index 516e1233d771c..0e51db7ac1725 100644
|
||||||
|
--- a/arch/mips/mti-malta/malta-platform.c
|
||||||
|
+++ b/arch/mips/mti-malta/malta-platform.c
|
||||||
|
@@ -48,7 +48,8 @@ static struct plat_serial8250_port uart8250_data[] = {
|
||||||
|
.mapbase = 0x1f000900, /* The CBUS UART */
|
||||||
|
.irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_MB2,
|
||||||
|
.uartclk = 3686400, /* Twice the usual clk! */
|
||||||
|
- .iotype = UPIO_MEM32,
|
||||||
|
+ .iotype = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) ?
|
||||||
|
+ UPIO_MEM32BE : UPIO_MEM32,
|
||||||
|
.flags = CBUS_UART_FLAGS,
|
||||||
|
.regshift = 3,
|
||||||
|
},
|
||||||
|
diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
|
||||||
|
index c42c9d50c8ee8..8095c7169e8a1 100644
|
||||||
|
--- a/arch/x86/events/perf_event.h
|
||||||
|
+++ b/arch/x86/events/perf_event.h
|
||||||
|
@@ -771,9 +771,10 @@ void x86_pmu_stop(struct perf_event *event, int flags);
|
||||||
|
|
||||||
|
static inline void x86_pmu_disable_event(struct perf_event *event)
|
||||||
|
{
|
||||||
|
+ u64 disable_mask = __this_cpu_read(cpu_hw_events.perf_ctr_virt_mask);
|
||||||
|
struct hw_perf_event *hwc = &event->hw;
|
||||||
|
|
||||||
|
- wrmsrl(hwc->config_base, hwc->config);
|
||||||
|
+ wrmsrl(hwc->config_base, hwc->config & ~disable_mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
void x86_pmu_enable_event(struct perf_event *event);
|
||||||
|
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
|
||||||
|
index c583c638e4681..328a447ce9723 100644
|
||||||
|
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
|
||||||
|
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
|
||||||
|
@@ -50,7 +50,16 @@ static int rtl28xxu_ctrl_msg(struct dvb_usb_device *d, struct rtl28xxu_req *req)
|
||||||
|
} else {
|
||||||
|
/* read */
|
||||||
|
requesttype = (USB_TYPE_VENDOR | USB_DIR_IN);
|
||||||
|
- pipe = usb_rcvctrlpipe(d->udev, 0);
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Zero-length transfers must use usb_sndctrlpipe() and
|
||||||
|
+ * rtl28xxu_identify_state() uses a zero-length i2c read
|
||||||
|
+ * command to determine the chip type.
|
||||||
|
+ */
|
||||||
|
+ if (req->size)
|
||||||
|
+ pipe = usb_rcvctrlpipe(d->udev, 0);
|
||||||
|
+ else
|
||||||
|
+ pipe = usb_sndctrlpipe(d->udev, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = usb_control_msg(d->udev, pipe, 0, requesttype, req->value,
|
||||||
|
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
|
||||||
|
index b1a4d4e2341ba..3ac9f7260e723 100644
|
||||||
|
--- a/drivers/media/v4l2-core/videobuf2-core.c
|
||||||
|
+++ b/drivers/media/v4l2-core/videobuf2-core.c
|
||||||
|
@@ -1370,6 +1370,7 @@ static int vb2_start_streaming(struct vb2_queue *q)
|
||||||
|
int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb)
|
||||||
|
{
|
||||||
|
struct vb2_buffer *vb;
|
||||||
|
+ enum vb2_buffer_state orig_state;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (q->error) {
|
||||||
|
@@ -1399,6 +1400,7 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb)
|
||||||
|
* Add to the queued buffers list, a buffer will stay on it until
|
||||||
|
* dequeued in dqbuf.
|
||||||
|
*/
|
||||||
|
+ orig_state = vb->state;
|
||||||
|
list_add_tail(&vb->queued_entry, &q->queued_list);
|
||||||
|
q->queued_count++;
|
||||||
|
q->waiting_for_buffers = false;
|
||||||
|
@@ -1429,8 +1431,17 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb)
|
||||||
|
if (q->streaming && !q->start_streaming_called &&
|
||||||
|
q->queued_count >= q->min_buffers_needed) {
|
||||||
|
ret = vb2_start_streaming(q);
|
||||||
|
- if (ret)
|
||||||
|
+ if (ret) {
|
||||||
|
+ /*
|
||||||
|
+ * Since vb2_core_qbuf will return with an error,
|
||||||
|
+ * we should return it to state DEQUEUED since
|
||||||
|
+ * the error indicates that the buffer wasn't queued.
|
||||||
|
+ */
|
||||||
|
+ list_del(&vb->queued_entry);
|
||||||
|
+ q->queued_count--;
|
||||||
|
+ vb->state = orig_state;
|
||||||
|
return ret;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
dprintk(1, "qbuf of buffer %d succeeded\n", vb->index);
|
||||||
|
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
|
||||||
|
index 46a7dcf2ff4a3..9d7f491931cef 100644
|
||||||
|
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
|
||||||
|
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
|
||||||
|
@@ -2672,7 +2672,8 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Allocated memory for FW statistics */
|
||||||
|
- if (bnx2x_alloc_fw_stats_mem(bp))
|
||||||
|
+ rc = bnx2x_alloc_fw_stats_mem(bp);
|
||||||
|
+ if (rc)
|
||||||
|
LOAD_ERROR_EXIT(bp, load_error0);
|
||||||
|
|
||||||
|
/* request pf to initialize status blocks */
|
||||||
|
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
|
||||||
|
index 9b3ea0406e0d5..5fc40f025d214 100644
|
||||||
|
--- a/drivers/net/ethernet/freescale/fec_main.c
|
||||||
|
+++ b/drivers/net/ethernet/freescale/fec_main.c
|
||||||
|
@@ -3546,13 +3546,13 @@ fec_drv_remove(struct platform_device *pdev)
|
||||||
|
if (of_phy_is_fixed_link(np))
|
||||||
|
of_phy_deregister_fixed_link(np);
|
||||||
|
of_node_put(fep->phy_node);
|
||||||
|
- free_netdev(ndev);
|
||||||
|
|
||||||
|
clk_disable_unprepare(fep->clk_ahb);
|
||||||
|
clk_disable_unprepare(fep->clk_ipg);
|
||||||
|
pm_runtime_put_noidle(&pdev->dev);
|
||||||
|
pm_runtime_disable(&pdev->dev);
|
||||||
|
|
||||||
|
+ free_netdev(ndev);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/net/ethernet/natsemi/natsemi.c b/drivers/net/ethernet/natsemi/natsemi.c
|
||||||
|
index ed89029ff75be..c0e128e17321f 100644
|
||||||
|
--- a/drivers/net/ethernet/natsemi/natsemi.c
|
||||||
|
+++ b/drivers/net/ethernet/natsemi/natsemi.c
|
||||||
|
@@ -817,7 +817,7 @@ static int natsemi_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
|
printk(version);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
- i = pci_enable_device(pdev);
|
||||||
|
+ i = pcim_enable_device(pdev);
|
||||||
|
if (i) return i;
|
||||||
|
|
||||||
|
/* natsemi has a non-standard PM control register
|
||||||
|
@@ -850,7 +850,7 @@ static int natsemi_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
|
ioaddr = ioremap(iostart, iosize);
|
||||||
|
if (!ioaddr) {
|
||||||
|
i = -ENOMEM;
|
||||||
|
- goto err_ioremap;
|
||||||
|
+ goto err_pci_request_regions;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Work around the dropped serial bit. */
|
||||||
|
@@ -968,9 +968,6 @@ static int natsemi_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
|
err_register_netdev:
|
||||||
|
iounmap(ioaddr);
|
||||||
|
|
||||||
|
- err_ioremap:
|
||||||
|
- pci_release_regions(pdev);
|
||||||
|
-
|
||||||
|
err_pci_request_regions:
|
||||||
|
free_netdev(dev);
|
||||||
|
return i;
|
||||||
|
@@ -3228,7 +3225,6 @@ static void natsemi_remove1(struct pci_dev *pdev)
|
||||||
|
|
||||||
|
NATSEMI_REMOVE_FILE(pdev, dspcfg_workaround);
|
||||||
|
unregister_netdev (dev);
|
||||||
|
- pci_release_regions (pdev);
|
||||||
|
iounmap(ioaddr);
|
||||||
|
free_netdev (dev);
|
||||||
|
}
|
||||||
|
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c
|
||||||
|
index e0993eba5df3f..c6950e5808836 100644
|
||||||
|
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
|
||||||
|
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
|
||||||
|
@@ -3539,13 +3539,13 @@ static void vxge_device_unregister(struct __vxge_hw_device *hldev)
|
||||||
|
|
||||||
|
kfree(vdev->vpaths);
|
||||||
|
|
||||||
|
- /* we are safe to free it now */
|
||||||
|
- free_netdev(dev);
|
||||||
|
-
|
||||||
|
vxge_debug_init(vdev->level_trace, "%s: ethernet device unregistered",
|
||||||
|
buf);
|
||||||
|
vxge_debug_entryexit(vdev->level_trace, "%s: %s:%d Exiting...", buf,
|
||||||
|
__func__, __LINE__);
|
||||||
|
+
|
||||||
|
+ /* we are safe to free it now */
|
||||||
|
+ free_netdev(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
|
||||||
|
index 192950a112c93..cb9d43c871c4c 100644
|
||||||
|
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
|
||||||
|
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
|
||||||
|
@@ -155,7 +155,7 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
|
||||||
|
"driver lock acquired\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
- ssleep(1);
|
||||||
|
+ mdelay(1000);
|
||||||
|
} while (++i < 10);
|
||||||
|
|
||||||
|
netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n");
|
||||||
|
@@ -3287,7 +3287,7 @@ static int ql_adapter_reset(struct ql3_adapter *qdev)
|
||||||
|
if ((value & ISP_CONTROL_SR) == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
- ssleep(1);
|
||||||
|
+ mdelay(1000);
|
||||||
|
} while ((--max_wait_time));
|
||||||
|
|
||||||
|
/*
|
||||||
|
@@ -3323,7 +3323,7 @@ static int ql_adapter_reset(struct ql3_adapter *qdev)
|
||||||
|
ispControlStatus);
|
||||||
|
if ((value & ISP_CONTROL_FSR) == 0)
|
||||||
|
break;
|
||||||
|
- ssleep(1);
|
||||||
|
+ mdelay(1000);
|
||||||
|
} while ((--max_wait_time));
|
||||||
|
}
|
||||||
|
if (max_wait_time == 0)
|
||||||
|
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
|
||||||
|
index 034b36442ee75..df3b3384984ce 100644
|
||||||
|
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
|
||||||
|
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
|
||||||
|
@@ -1179,9 +1179,8 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
|
||||||
|
}
|
||||||
|
|
||||||
|
dev_info(dev,
|
||||||
|
- "Xilinx EmacLite at 0x%08X mapped to 0x%08X, irq=%d\n",
|
||||||
|
- (unsigned int __force)ndev->mem_start,
|
||||||
|
- (unsigned int __force)lp->base_addr, ndev->irq);
|
||||||
|
+ "Xilinx EmacLite at 0x%08X mapped to 0x%p, irq=%d\n",
|
||||||
|
+ (unsigned int __force)ndev->mem_start, lp->base_addr, ndev->irq);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
error:
|
||||||
|
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
|
||||||
|
index 801bab5968d04..5ba472691546b 100644
|
||||||
|
--- a/drivers/net/ppp/ppp_generic.c
|
||||||
|
+++ b/drivers/net/ppp/ppp_generic.c
|
||||||
|
@@ -285,7 +285,7 @@ static struct channel *ppp_find_channel(struct ppp_net *pn, int unit);
|
||||||
|
static int ppp_connect_channel(struct channel *pch, int unit);
|
||||||
|
static int ppp_disconnect_channel(struct channel *pch);
|
||||||
|
static void ppp_destroy_channel(struct channel *pch);
|
||||||
|
-static int unit_get(struct idr *p, void *ptr);
|
||||||
|
+static int unit_get(struct idr *p, void *ptr, int min);
|
||||||
|
static int unit_set(struct idr *p, void *ptr, int n);
|
||||||
|
static void unit_put(struct idr *p, int n);
|
||||||
|
static void *unit_find(struct idr *p, int n);
|
||||||
|
@@ -976,9 +976,20 @@ static int ppp_unit_register(struct ppp *ppp, int unit, bool ifname_is_set)
|
||||||
|
mutex_lock(&pn->all_ppp_mutex);
|
||||||
|
|
||||||
|
if (unit < 0) {
|
||||||
|
- ret = unit_get(&pn->units_idr, ppp);
|
||||||
|
+ ret = unit_get(&pn->units_idr, ppp, 0);
|
||||||
|
if (ret < 0)
|
||||||
|
goto err;
|
||||||
|
+ if (!ifname_is_set) {
|
||||||
|
+ while (1) {
|
||||||
|
+ snprintf(ppp->dev->name, IFNAMSIZ, "ppp%i", ret);
|
||||||
|
+ if (!__dev_get_by_name(ppp->ppp_net, ppp->dev->name))
|
||||||
|
+ break;
|
||||||
|
+ unit_put(&pn->units_idr, ret);
|
||||||
|
+ ret = unit_get(&pn->units_idr, ppp, ret + 1);
|
||||||
|
+ if (ret < 0)
|
||||||
|
+ goto err;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
} else {
|
||||||
|
/* Caller asked for a specific unit number. Fail with -EEXIST
|
||||||
|
* if unavailable. For backward compatibility, return -EEXIST
|
||||||
|
@@ -3265,9 +3276,9 @@ static int unit_set(struct idr *p, void *ptr, int n)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* get new free unit number and associate pointer with it */
|
||||||
|
-static int unit_get(struct idr *p, void *ptr)
|
||||||
|
+static int unit_get(struct idr *p, void *ptr, int min)
|
||||||
|
{
|
||||||
|
- return idr_alloc(p, ptr, 0, 0, GFP_KERNEL);
|
||||||
|
+ return idr_alloc(p, ptr, min, 0, GFP_KERNEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* put unit number back to a pool */
|
||||||
|
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
|
||||||
|
index 5fe9f1273fe20..6cfc6faf97471 100644
|
||||||
|
--- a/drivers/net/usb/pegasus.c
|
||||||
|
+++ b/drivers/net/usb/pegasus.c
|
||||||
|
@@ -755,12 +755,16 @@ static inline void disable_net_traffic(pegasus_t *pegasus)
|
||||||
|
set_registers(pegasus, EthCtrl0, sizeof(tmp), &tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
-static inline void get_interrupt_interval(pegasus_t *pegasus)
|
||||||
|
+static inline int get_interrupt_interval(pegasus_t *pegasus)
|
||||||
|
{
|
||||||
|
u16 data;
|
||||||
|
u8 interval;
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
+ ret = read_eprom_word(pegasus, 4, &data);
|
||||||
|
+ if (ret < 0)
|
||||||
|
+ return ret;
|
||||||
|
|
||||||
|
- read_eprom_word(pegasus, 4, &data);
|
||||||
|
interval = data >> 8;
|
||||||
|
if (pegasus->usb->speed != USB_SPEED_HIGH) {
|
||||||
|
if (interval < 0x80) {
|
||||||
|
@@ -775,6 +779,8 @@ static inline void get_interrupt_interval(pegasus_t *pegasus)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pegasus->intr_interval = interval;
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void set_carrier(struct net_device *net)
|
||||||
|
@@ -1191,7 +1197,9 @@ static int pegasus_probe(struct usb_interface *intf,
|
||||||
|
| NETIF_MSG_PROBE | NETIF_MSG_LINK);
|
||||||
|
|
||||||
|
pegasus->features = usb_dev_id[dev_index].private;
|
||||||
|
- get_interrupt_interval(pegasus);
|
||||||
|
+ res = get_interrupt_interval(pegasus);
|
||||||
|
+ if (res)
|
||||||
|
+ goto out2;
|
||||||
|
if (reset_mac(pegasus)) {
|
||||||
|
dev_err(&intf->dev, "can't reset MAC\n");
|
||||||
|
res = -EIO;
|
||||||
|
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
|
||||||
|
index aae7e6df99cd3..ba13e3c3d6b87 100644
|
||||||
|
--- a/drivers/pcmcia/i82092.c
|
||||||
|
+++ b/drivers/pcmcia/i82092.c
|
||||||
|
@@ -105,6 +105,7 @@ static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *i
|
||||||
|
for (i = 0;i<socket_count;i++) {
|
||||||
|
sockets[i].card_state = 1; /* 1 = present but empty */
|
||||||
|
sockets[i].io_base = pci_resource_start(dev, 0);
|
||||||
|
+ sockets[i].dev = dev;
|
||||||
|
sockets[i].socket.features |= SS_CAP_PCCARD;
|
||||||
|
sockets[i].socket.map_size = 0x1000;
|
||||||
|
sockets[i].socket.irq_mask = 0;
|
||||||
|
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
|
||||||
|
index 5e51a39a0c27e..9b63e46edffcc 100644
|
||||||
|
--- a/drivers/scsi/sr.c
|
||||||
|
+++ b/drivers/scsi/sr.c
|
||||||
|
@@ -217,7 +217,7 @@ static unsigned int sr_get_events(struct scsi_device *sdev)
|
||||||
|
else if (med->media_event_code == 2)
|
||||||
|
return DISK_EVENT_MEDIA_CHANGE;
|
||||||
|
else if (med->media_event_code == 3)
|
||||||
|
- return DISK_EVENT_EJECT_REQUEST;
|
||||||
|
+ return DISK_EVENT_MEDIA_CHANGE;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
|
||||||
|
index 827a641ac336e..611bc05565719 100644
|
||||||
|
--- a/drivers/tty/serial/8250/8250_port.c
|
||||||
|
+++ b/drivers/tty/serial/8250/8250_port.c
|
||||||
|
@@ -277,7 +277,11 @@ static const struct serial8250_config uart_config[] = {
|
||||||
|
/* Uart divisor latch read */
|
||||||
|
static int default_serial_dl_read(struct uart_8250_port *up)
|
||||||
|
{
|
||||||
|
- return serial_in(up, UART_DLL) | serial_in(up, UART_DLM) << 8;
|
||||||
|
+ /* Assign these in pieces to truncate any bits above 7. */
|
||||||
|
+ unsigned char dll = serial_in(up, UART_DLL);
|
||||||
|
+ unsigned char dlm = serial_in(up, UART_DLM);
|
||||||
|
+
|
||||||
|
+ return dll | dlm << 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Uart divisor latch write */
|
||||||
|
@@ -1262,9 +1266,11 @@ static void autoconfig(struct uart_8250_port *up)
|
||||||
|
serial_out(up, UART_LCR, 0);
|
||||||
|
|
||||||
|
serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO);
|
||||||
|
- scratch = serial_in(up, UART_IIR) >> 6;
|
||||||
|
|
||||||
|
- switch (scratch) {
|
||||||
|
+ /* Assign this as it is to truncate any bits above 7. */
|
||||||
|
+ scratch = serial_in(up, UART_IIR);
|
||||||
|
+
|
||||||
|
+ switch (scratch >> 6) {
|
||||||
|
case 0:
|
||||||
|
autoconfig_8250(up);
|
||||||
|
break;
|
||||||
|
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
|
||||||
|
index a391b50fb32f1..c310c6d4d150a 100644
|
||||||
|
--- a/drivers/usb/class/usbtmc.c
|
||||||
|
+++ b/drivers/usb/class/usbtmc.c
|
||||||
|
@@ -1342,16 +1342,10 @@ static void usbtmc_interrupt(struct urb *urb)
|
||||||
|
case -EOVERFLOW:
|
||||||
|
dev_err(dev, "overflow with length %d, actual length is %d\n",
|
||||||
|
data->iin_wMaxPacketSize, urb->actual_length);
|
||||||
|
- case -ECONNRESET:
|
||||||
|
- case -ENOENT:
|
||||||
|
- case -ESHUTDOWN:
|
||||||
|
- case -EILSEQ:
|
||||||
|
- case -ETIME:
|
||||||
|
+ default:
|
||||||
|
/* urb terminated, clean up */
|
||||||
|
dev_dbg(dev, "urb terminated, status: %d\n", status);
|
||||||
|
return;
|
||||||
|
- default:
|
||||||
|
- dev_err(dev, "unknown status received: %d\n", status);
|
||||||
|
}
|
||||||
|
exit:
|
||||||
|
rv = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
|
diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c
|
||||||
|
index 2f537bbdda093..362cca983e6e4 100644
|
||||||
|
--- a/drivers/usb/common/usb-otg-fsm.c
|
||||||
|
+++ b/drivers/usb/common/usb-otg-fsm.c
|
||||||
|
@@ -199,7 +199,11 @@ static void otg_start_hnp_polling(struct otg_fsm *fsm)
|
||||||
|
if (!fsm->host_req_flag)
|
||||||
|
return;
|
||||||
|
|
||||||
|
- INIT_DELAYED_WORK(&fsm->hnp_polling_work, otg_hnp_polling_work);
|
||||||
|
+ if (!fsm->hnp_work_inited) {
|
||||||
|
+ INIT_DELAYED_WORK(&fsm->hnp_polling_work, otg_hnp_polling_work);
|
||||||
|
+ fsm->hnp_work_inited = true;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
schedule_delayed_work(&fsm->hnp_polling_work,
|
||||||
|
msecs_to_jiffies(T_HOST_REQ_POLL));
|
||||||
|
}
|
||||||
|
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
|
||||||
|
index 08b3f8c806016..a31015a95fd64 100644
|
||||||
|
--- a/drivers/usb/host/ehci-pci.c
|
||||||
|
+++ b/drivers/usb/host/ehci-pci.c
|
||||||
|
@@ -312,6 +312,9 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
|
||||||
|
if (pdev->vendor == PCI_VENDOR_ID_STMICRO
|
||||||
|
&& pdev->device == PCI_DEVICE_ID_STMICRO_USB_HOST)
|
||||||
|
; /* ConneXT has no sbrn register */
|
||||||
|
+ else if (pdev->vendor == PCI_VENDOR_ID_HUAWEI
|
||||||
|
+ && pdev->device == 0xa239)
|
||||||
|
+ ; /* HUAWEI Kunpeng920 USB EHCI has no sbrn register */
|
||||||
|
else
|
||||||
|
pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
|
||||||
|
|
||||||
|
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
|
||||||
|
index c6ff79360302f..2e92c6fef683f 100644
|
||||||
|
--- a/drivers/usb/serial/ch341.c
|
||||||
|
+++ b/drivers/usb/serial/ch341.c
|
||||||
|
@@ -585,6 +585,7 @@ static struct usb_serial_driver ch341_device = {
|
||||||
|
.owner = THIS_MODULE,
|
||||||
|
.name = "ch341-uart",
|
||||||
|
},
|
||||||
|
+ .bulk_in_size = 512,
|
||||||
|
.id_table = id_table,
|
||||||
|
.num_ports = 1,
|
||||||
|
.open = ch341_open,
|
||||||
|
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
|
||||||
|
index 8f4bd9fa82449..fe6b32c2ff1cb 100644
|
||||||
|
--- a/drivers/usb/serial/ftdi_sio.c
|
||||||
|
+++ b/drivers/usb/serial/ftdi_sio.c
|
||||||
|
@@ -214,6 +214,7 @@ static const struct usb_device_id id_table_combined[] = {
|
||||||
|
{ USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
|
||||||
|
{ USB_DEVICE(FTDI_VID, FTDI_R2000KU_TRUE_RNG) },
|
||||||
|
{ USB_DEVICE(FTDI_VID, FTDI_VARDAAN_PID) },
|
||||||
|
+ { USB_DEVICE(FTDI_VID, FTDI_AUTO_M3_OP_COM_V2_PID) },
|
||||||
|
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) },
|
||||||
|
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) },
|
||||||
|
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) },
|
||||||
|
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
|
||||||
|
index 54ded2bc9eb6c..3b7cea8df446c 100644
|
||||||
|
--- a/drivers/usb/serial/ftdi_sio_ids.h
|
||||||
|
+++ b/drivers/usb/serial/ftdi_sio_ids.h
|
||||||
|
@@ -158,6 +158,9 @@
|
||||||
|
/* Vardaan Enterprises Serial Interface VEUSB422R3 */
|
||||||
|
#define FTDI_VARDAAN_PID 0xF070
|
||||||
|
|
||||||
|
+/* Auto-M3 Ltd. - OP-COM USB V2 - OBD interface Adapter */
|
||||||
|
+#define FTDI_AUTO_M3_OP_COM_V2_PID 0x4f50
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Xsens Technologies BV products (http://www.xsens.com).
|
||||||
|
*/
|
||||||
|
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
|
||||||
|
index b9017e85cc1ab..b3336a7c09e0b 100644
|
||||||
|
--- a/drivers/usb/serial/option.c
|
||||||
|
+++ b/drivers/usb/serial/option.c
|
||||||
|
@@ -1185,6 +1185,8 @@ static const struct usb_device_id option_ids[] = {
|
||||||
|
.driver_info = NCTRL(2) | RSVD(3) },
|
||||||
|
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1055, 0xff), /* Telit FN980 (PCIe) */
|
||||||
|
.driver_info = NCTRL(0) | RSVD(1) },
|
||||||
|
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1056, 0xff), /* Telit FD980 */
|
||||||
|
+ .driver_info = NCTRL(2) | RSVD(3) },
|
||||||
|
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
|
||||||
|
.driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
|
||||||
|
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
|
||||||
|
diff --git a/fs/namespace.c b/fs/namespace.c
|
||||||
|
index 3b20c7ff8cc3c..9f2390c89b63b 100644
|
||||||
|
--- a/fs/namespace.c
|
||||||
|
+++ b/fs/namespace.c
|
||||||
|
@@ -1853,6 +1853,20 @@ void drop_collected_mounts(struct vfsmount *mnt)
|
||||||
|
namespace_unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
+static bool has_locked_children(struct mount *mnt, struct dentry *dentry)
|
||||||
|
+{
|
||||||
|
+ struct mount *child;
|
||||||
|
+
|
||||||
|
+ list_for_each_entry(child, &mnt->mnt_mounts, mnt_child) {
|
||||||
|
+ if (!is_subdir(child->mnt_mountpoint, dentry))
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ if (child->mnt.mnt_flags & MNT_LOCKED)
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+ return false;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* clone_private_mount - create a private clone of a path
|
||||||
|
*
|
||||||
|
@@ -1867,16 +1881,27 @@ struct vfsmount *clone_private_mount(struct path *path)
|
||||||
|
struct mount *old_mnt = real_mount(path->mnt);
|
||||||
|
struct mount *new_mnt;
|
||||||
|
|
||||||
|
+ down_read(&namespace_sem);
|
||||||
|
if (IS_MNT_UNBINDABLE(old_mnt))
|
||||||
|
- return ERR_PTR(-EINVAL);
|
||||||
|
+ goto invalid;
|
||||||
|
+
|
||||||
|
+ if (!check_mnt(old_mnt))
|
||||||
|
+ goto invalid;
|
||||||
|
+
|
||||||
|
+ if (has_locked_children(old_mnt, path->dentry))
|
||||||
|
+ goto invalid;
|
||||||
|
|
||||||
|
- down_read(&namespace_sem);
|
||||||
|
new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE);
|
||||||
|
up_read(&namespace_sem);
|
||||||
|
+
|
||||||
|
if (IS_ERR(new_mnt))
|
||||||
|
return ERR_CAST(new_mnt);
|
||||||
|
|
||||||
|
return &new_mnt->mnt;
|
||||||
|
+
|
||||||
|
+invalid:
|
||||||
|
+ up_read(&namespace_sem);
|
||||||
|
+ return ERR_PTR(-EINVAL);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(clone_private_mount);
|
||||||
|
|
||||||
|
@@ -2192,19 +2217,6 @@ static int do_change_type(struct path *path, int flag)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static bool has_locked_children(struct mount *mnt, struct dentry *dentry)
|
||||||
|
-{
|
||||||
|
- struct mount *child;
|
||||||
|
- list_for_each_entry(child, &mnt->mnt_mounts, mnt_child) {
|
||||||
|
- if (!is_subdir(child->mnt_mountpoint, dentry))
|
||||||
|
- continue;
|
||||||
|
-
|
||||||
|
- if (child->mnt.mnt_flags & MNT_LOCKED)
|
||||||
|
- return true;
|
||||||
|
- }
|
||||||
|
- return false;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
/*
|
||||||
|
* do loopback mount.
|
||||||
|
*/
|
||||||
|
diff --git a/fs/pipe.c b/fs/pipe.c
|
||||||
|
index 347c6dc888c8f..6375e625a2635 100644
|
||||||
|
--- a/fs/pipe.c
|
||||||
|
+++ b/fs/pipe.c
|
||||||
|
@@ -28,6 +28,21 @@
|
||||||
|
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+ * New pipe buffers will be restricted to this size while the user is exceeding
|
||||||
|
+ * their pipe buffer quota. The general pipe use case needs at least two
|
||||||
|
+ * buffers: one for data yet to be read, and one for new data. If this is less
|
||||||
|
+ * than two, then a write to a non-empty pipe may block even if the pipe is not
|
||||||
|
+ * full. This can occur with GNU make jobserver or similar uses of pipes as
|
||||||
|
+ * semaphores: multiple processes may be waiting to write tokens back to the
|
||||||
|
+ * pipe before reading tokens: https://lore.kernel.org/lkml/1628086770.5rn8p04n6j.none@localhost/.
|
||||||
|
+ *
|
||||||
|
+ * Users can reduce their pipe buffers with F_SETPIPE_SZ below this at their
|
||||||
|
+ * own risk, namely: pipe writes to non-full pipes may block until the pipe is
|
||||||
|
+ * emptied.
|
||||||
|
+ */
|
||||||
|
+#define PIPE_MIN_DEF_BUFFERS 2
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* The max size that a non-root user is allowed to grow the pipe. Can
|
||||||
|
* be set by root in /proc/sys/fs/pipe-max-size
|
||||||
|
@@ -653,8 +668,8 @@ struct pipe_inode_info *alloc_pipe_info(void)
|
||||||
|
user_bufs = account_pipe_buffers(user, 0, pipe_bufs);
|
||||||
|
|
||||||
|
if (too_many_pipe_buffers_soft(user_bufs) && is_unprivileged_user()) {
|
||||||
|
- user_bufs = account_pipe_buffers(user, pipe_bufs, 1);
|
||||||
|
- pipe_bufs = 1;
|
||||||
|
+ user_bufs = account_pipe_buffers(user, pipe_bufs, PIPE_MIN_DEF_BUFFERS);
|
||||||
|
+ pipe_bufs = PIPE_MIN_DEF_BUFFERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (too_many_pipe_buffers_hard(user_bufs) && is_unprivileged_user())
|
||||||
|
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
|
||||||
|
index 25b2aed9af0b3..f2f7055303ca5 100644
|
||||||
|
--- a/fs/reiserfs/stree.c
|
||||||
|
+++ b/fs/reiserfs/stree.c
|
||||||
|
@@ -386,6 +386,24 @@ void pathrelse(struct treepath *search_path)
|
||||||
|
search_path->path_length = ILLEGAL_PATH_ELEMENT_OFFSET;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int has_valid_deh_location(struct buffer_head *bh, struct item_head *ih)
|
||||||
|
+{
|
||||||
|
+ struct reiserfs_de_head *deh;
|
||||||
|
+ int i;
|
||||||
|
+
|
||||||
|
+ deh = B_I_DEH(bh, ih);
|
||||||
|
+ for (i = 0; i < ih_entry_count(ih); i++) {
|
||||||
|
+ if (deh_location(&deh[i]) > ih_item_len(ih)) {
|
||||||
|
+ reiserfs_warning(NULL, "reiserfs-5094",
|
||||||
|
+ "directory entry location seems wrong %h",
|
||||||
|
+ &deh[i]);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int is_leaf(char *buf, int blocksize, struct buffer_head *bh)
|
||||||
|
{
|
||||||
|
struct block_head *blkh;
|
||||||
|
@@ -453,11 +471,14 @@ static int is_leaf(char *buf, int blocksize, struct buffer_head *bh)
|
||||||
|
"(second one): %h", ih);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
- if (is_direntry_le_ih(ih) && (ih_item_len(ih) < (ih_entry_count(ih) * IH_SIZE))) {
|
||||||
|
- reiserfs_warning(NULL, "reiserfs-5093",
|
||||||
|
- "item entry count seems wrong %h",
|
||||||
|
- ih);
|
||||||
|
- return 0;
|
||||||
|
+ if (is_direntry_le_ih(ih)) {
|
||||||
|
+ if (ih_item_len(ih) < (ih_entry_count(ih) * IH_SIZE)) {
|
||||||
|
+ reiserfs_warning(NULL, "reiserfs-5093",
|
||||||
|
+ "item entry count seems wrong %h",
|
||||||
|
+ ih);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ return has_valid_deh_location(bh, ih);
|
||||||
|
}
|
||||||
|
prev_location = ih_location(ih);
|
||||||
|
}
|
||||||
|
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
|
||||||
|
index c533d8715a6ca..0d324c07762a3 100644
|
||||||
|
--- a/fs/reiserfs/super.c
|
||||||
|
+++ b/fs/reiserfs/super.c
|
||||||
|
@@ -2059,6 +2059,14 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
|
||||||
|
unlock_new_inode(root_inode);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (!S_ISDIR(root_inode->i_mode) || !inode_get_bytes(root_inode) ||
|
||||||
|
+ !root_inode->i_size) {
|
||||||
|
+ SWARN(silent, s, "", "corrupt root inode, run fsck");
|
||||||
|
+ iput(root_inode);
|
||||||
|
+ errval = -EUCLEAN;
|
||||||
|
+ goto error;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
s->s_root = d_make_root(root_inode);
|
||||||
|
if (!s->s_root)
|
||||||
|
goto error;
|
||||||
|
diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h
|
||||||
|
index 7a0350535cb10..603b298dc747d 100644
|
||||||
|
--- a/include/linux/usb/otg-fsm.h
|
||||||
|
+++ b/include/linux/usb/otg-fsm.h
|
||||||
|
@@ -210,6 +210,7 @@ struct otg_fsm {
|
||||||
|
struct mutex lock;
|
||||||
|
u8 *host_req_flag;
|
||||||
|
struct delayed_work hnp_polling_work;
|
||||||
|
+ bool hnp_work_inited;
|
||||||
|
bool state_changed;
|
||||||
|
};
|
||||||
|
|
||||||
|
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
|
||||||
|
index 33db6c6d3fba8..819796fb9d46f 100644
|
||||||
|
--- a/include/net/bluetooth/hci_core.h
|
||||||
|
+++ b/include/net/bluetooth/hci_core.h
|
||||||
|
@@ -1028,6 +1028,7 @@ struct hci_dev *hci_alloc_dev(void);
|
||||||
|
void hci_free_dev(struct hci_dev *hdev);
|
||||||
|
int hci_register_dev(struct hci_dev *hdev);
|
||||||
|
void hci_unregister_dev(struct hci_dev *hdev);
|
||||||
|
+void hci_cleanup_dev(struct hci_dev *hdev);
|
||||||
|
int hci_suspend_dev(struct hci_dev *hdev);
|
||||||
|
int hci_resume_dev(struct hci_dev *hdev);
|
||||||
|
int hci_reset_dev(struct hci_dev *hdev);
|
||||||
|
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
|
||||||
|
index 839c534bdcdb9..8517da7f282ed 100644
|
||||||
|
--- a/net/bluetooth/hci_core.c
|
||||||
|
+++ b/net/bluetooth/hci_core.c
|
||||||
|
@@ -3146,14 +3146,10 @@ EXPORT_SYMBOL(hci_register_dev);
|
||||||
|
/* Unregister HCI device */
|
||||||
|
void hci_unregister_dev(struct hci_dev *hdev)
|
||||||
|
{
|
||||||
|
- int id;
|
||||||
|
-
|
||||||
|
BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus);
|
||||||
|
|
||||||
|
hci_dev_set_flag(hdev, HCI_UNREGISTER);
|
||||||
|
|
||||||
|
- id = hdev->id;
|
||||||
|
-
|
||||||
|
write_lock(&hci_dev_list_lock);
|
||||||
|
list_del(&hdev->list);
|
||||||
|
write_unlock(&hci_dev_list_lock);
|
||||||
|
@@ -3182,7 +3178,14 @@ void hci_unregister_dev(struct hci_dev *hdev)
|
||||||
|
}
|
||||||
|
|
||||||
|
device_del(&hdev->dev);
|
||||||
|
+ /* Actual cleanup is deferred until hci_cleanup_dev(). */
|
||||||
|
+ hci_dev_put(hdev);
|
||||||
|
+}
|
||||||
|
+EXPORT_SYMBOL(hci_unregister_dev);
|
||||||
|
|
||||||
|
+/* Cleanup HCI device */
|
||||||
|
+void hci_cleanup_dev(struct hci_dev *hdev)
|
||||||
|
+{
|
||||||
|
debugfs_remove_recursive(hdev->debugfs);
|
||||||
|
kfree_const(hdev->hw_info);
|
||||||
|
kfree_const(hdev->fw_info);
|
||||||
|
@@ -3204,11 +3207,8 @@ void hci_unregister_dev(struct hci_dev *hdev)
|
||||||
|
hci_discovery_filter_clear(hdev);
|
||||||
|
hci_dev_unlock(hdev);
|
||||||
|
|
||||||
|
- hci_dev_put(hdev);
|
||||||
|
-
|
||||||
|
- ida_simple_remove(&hci_index_ida, id);
|
||||||
|
+ ida_simple_remove(&hci_index_ida, hdev->id);
|
||||||
|
}
|
||||||
|
-EXPORT_SYMBOL(hci_unregister_dev);
|
||||||
|
|
||||||
|
/* Suspend HCI device */
|
||||||
|
int hci_suspend_dev(struct hci_dev *hdev)
|
||||||
|
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
|
||||||
|
index 35f5585188de7..d30163eb1643c 100644
|
||||||
|
--- a/net/bluetooth/hci_sock.c
|
||||||
|
+++ b/net/bluetooth/hci_sock.c
|
||||||
|
@@ -59,6 +59,17 @@ struct hci_pinfo {
|
||||||
|
char comm[TASK_COMM_LEN];
|
||||||
|
};
|
||||||
|
|
||||||
|
+static struct hci_dev *hci_hdev_from_sock(struct sock *sk)
|
||||||
|
+{
|
||||||
|
+ struct hci_dev *hdev = hci_pi(sk)->hdev;
|
||||||
|
+
|
||||||
|
+ if (!hdev)
|
||||||
|
+ return ERR_PTR(-EBADFD);
|
||||||
|
+ if (hci_dev_test_flag(hdev, HCI_UNREGISTER))
|
||||||
|
+ return ERR_PTR(-EPIPE);
|
||||||
|
+ return hdev;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void hci_sock_set_flag(struct sock *sk, int nr)
|
||||||
|
{
|
||||||
|
set_bit(nr, &hci_pi(sk)->flags);
|
||||||
|
@@ -747,19 +758,13 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event)
|
||||||
|
if (event == HCI_DEV_UNREG) {
|
||||||
|
struct sock *sk;
|
||||||
|
|
||||||
|
- /* Detach sockets from device */
|
||||||
|
+ /* Wake up sockets using this dead device */
|
||||||
|
read_lock(&hci_sk_list.lock);
|
||||||
|
sk_for_each(sk, &hci_sk_list.head) {
|
||||||
|
- lock_sock(sk);
|
||||||
|
if (hci_pi(sk)->hdev == hdev) {
|
||||||
|
- hci_pi(sk)->hdev = NULL;
|
||||||
|
sk->sk_err = EPIPE;
|
||||||
|
- sk->sk_state = BT_OPEN;
|
||||||
|
sk->sk_state_change(sk);
|
||||||
|
-
|
||||||
|
- hci_dev_put(hdev);
|
||||||
|
}
|
||||||
|
- release_sock(sk);
|
||||||
|
}
|
||||||
|
read_unlock(&hci_sk_list.lock);
|
||||||
|
}
|
||||||
|
@@ -918,10 +923,10 @@ static int hci_sock_blacklist_del(struct hci_dev *hdev, void __user *arg)
|
||||||
|
static int hci_sock_bound_ioctl(struct sock *sk, unsigned int cmd,
|
||||||
|
unsigned long arg)
|
||||||
|
{
|
||||||
|
- struct hci_dev *hdev = hci_pi(sk)->hdev;
|
||||||
|
+ struct hci_dev *hdev = hci_hdev_from_sock(sk);
|
||||||
|
|
||||||
|
- if (!hdev)
|
||||||
|
- return -EBADFD;
|
||||||
|
+ if (IS_ERR(hdev))
|
||||||
|
+ return PTR_ERR(hdev);
|
||||||
|
|
||||||
|
if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL))
|
||||||
|
return -EBUSY;
|
||||||
|
@@ -1075,6 +1080,18 @@ static int hci_sock_bind(struct socket *sock, struct sockaddr *addr,
|
||||||
|
|
||||||
|
lock_sock(sk);
|
||||||
|
|
||||||
|
+ /* Allow detaching from dead device and attaching to alive device, if
|
||||||
|
+ * the caller wants to re-bind (instead of close) this socket in
|
||||||
|
+ * response to hci_sock_dev_event(HCI_DEV_UNREG) notification.
|
||||||
|
+ */
|
||||||
|
+ hdev = hci_pi(sk)->hdev;
|
||||||
|
+ if (hdev && hci_dev_test_flag(hdev, HCI_UNREGISTER)) {
|
||||||
|
+ hci_pi(sk)->hdev = NULL;
|
||||||
|
+ sk->sk_state = BT_OPEN;
|
||||||
|
+ hci_dev_put(hdev);
|
||||||
|
+ }
|
||||||
|
+ hdev = NULL;
|
||||||
|
+
|
||||||
|
if (sk->sk_state == BT_BOUND) {
|
||||||
|
err = -EALREADY;
|
||||||
|
goto done;
|
||||||
|
@@ -1351,9 +1368,9 @@ static int hci_sock_getname(struct socket *sock, struct sockaddr *addr,
|
||||||
|
|
||||||
|
lock_sock(sk);
|
||||||
|
|
||||||
|
- hdev = hci_pi(sk)->hdev;
|
||||||
|
- if (!hdev) {
|
||||||
|
- err = -EBADFD;
|
||||||
|
+ hdev = hci_hdev_from_sock(sk);
|
||||||
|
+ if (IS_ERR(hdev)) {
|
||||||
|
+ err = PTR_ERR(hdev);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1713,9 +1730,9 @@ static int hci_sock_sendmsg(struct socket *sock, struct msghdr *msg,
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
- hdev = hci_pi(sk)->hdev;
|
||||||
|
- if (!hdev) {
|
||||||
|
- err = -EBADFD;
|
||||||
|
+ hdev = hci_hdev_from_sock(sk);
|
||||||
|
+ if (IS_ERR(hdev)) {
|
||||||
|
+ err = PTR_ERR(hdev);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
|
||||||
|
index ca7a35ebaefb6..cb7d06bb0243c 100644
|
||||||
|
--- a/net/bluetooth/hci_sysfs.c
|
||||||
|
+++ b/net/bluetooth/hci_sysfs.c
|
||||||
|
@@ -82,6 +82,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn)
|
||||||
|
static void bt_host_release(struct device *dev)
|
||||||
|
{
|
||||||
|
struct hci_dev *hdev = to_hci_dev(dev);
|
||||||
|
+
|
||||||
|
+ if (hci_dev_test_flag(hdev, HCI_UNREGISTER))
|
||||||
|
+ hci_cleanup_dev(hdev);
|
||||||
|
kfree(hdev);
|
||||||
|
module_put(THIS_MODULE);
|
||||||
|
}
|
||||||
|
diff --git a/scripts/tracing/draw_functrace.py b/scripts/tracing/draw_functrace.py
|
||||||
|
index 30f117dfab438..68ecb455b4922 100755
|
||||||
|
--- a/scripts/tracing/draw_functrace.py
|
||||||
|
+++ b/scripts/tracing/draw_functrace.py
|
||||||
|
@@ -17,7 +17,7 @@ Usage:
|
||||||
|
$ cat /sys/kernel/debug/tracing/trace_pipe > ~/raw_trace_func
|
||||||
|
Wait some times but not too much, the script is a bit slow.
|
||||||
|
Break the pipe (Ctrl + Z)
|
||||||
|
- $ scripts/draw_functrace.py < raw_trace_func > draw_functrace
|
||||||
|
+ $ scripts/tracing/draw_functrace.py < ~/raw_trace_func > draw_functrace
|
||||||
|
Then you have your drawn trace in draw_functrace
|
||||||
|
"""
|
||||||
|
|
||||||
|
@@ -103,10 +103,10 @@ def parseLine(line):
|
||||||
|
line = line.strip()
|
||||||
|
if line.startswith("#"):
|
||||||
|
raise CommentLineException
|
||||||
|
- m = re.match("[^]]+?\\] +([0-9.]+): (\\w+) <-(\\w+)", line)
|
||||||
|
+ m = re.match("[^]]+?\\] +([a-z.]+) +([0-9.]+): (\\w+) <-(\\w+)", line)
|
||||||
|
if m is None:
|
||||||
|
raise BrokenLineException
|
||||||
|
- return (m.group(1), m.group(2), m.group(3))
|
||||||
|
+ return (m.group(2), m.group(3), m.group(4))
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
diff --git a/sound/core/seq/seq_ports.c b/sound/core/seq/seq_ports.c
|
||||||
|
index 9cfe4fcee9a58..27433f141cee6 100644
|
||||||
|
--- a/sound/core/seq/seq_ports.c
|
||||||
|
+++ b/sound/core/seq/seq_ports.c
|
||||||
|
@@ -532,10 +532,11 @@ static int check_and_subscribe_port(struct snd_seq_client *client,
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static void delete_and_unsubscribe_port(struct snd_seq_client *client,
|
||||||
|
- struct snd_seq_client_port *port,
|
||||||
|
- struct snd_seq_subscribers *subs,
|
||||||
|
- bool is_src, bool ack)
|
||||||
|
+/* called with grp->list_mutex held */
|
||||||
|
+static void __delete_and_unsubscribe_port(struct snd_seq_client *client,
|
||||||
|
+ struct snd_seq_client_port *port,
|
||||||
|
+ struct snd_seq_subscribers *subs,
|
||||||
|
+ bool is_src, bool ack)
|
||||||
|
{
|
||||||
|
struct snd_seq_port_subs_info *grp;
|
||||||
|
struct list_head *list;
|
||||||
|
@@ -543,7 +544,6 @@ static void delete_and_unsubscribe_port(struct snd_seq_client *client,
|
||||||
|
|
||||||
|
grp = is_src ? &port->c_src : &port->c_dest;
|
||||||
|
list = is_src ? &subs->src_list : &subs->dest_list;
|
||||||
|
- down_write(&grp->list_mutex);
|
||||||
|
write_lock_irq(&grp->list_lock);
|
||||||
|
empty = list_empty(list);
|
||||||
|
if (!empty)
|
||||||
|
@@ -553,6 +553,18 @@ static void delete_and_unsubscribe_port(struct snd_seq_client *client,
|
||||||
|
|
||||||
|
if (!empty)
|
||||||
|
unsubscribe_port(client, port, grp, &subs->info, ack);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void delete_and_unsubscribe_port(struct snd_seq_client *client,
|
||||||
|
+ struct snd_seq_client_port *port,
|
||||||
|
+ struct snd_seq_subscribers *subs,
|
||||||
|
+ bool is_src, bool ack)
|
||||||
|
+{
|
||||||
|
+ struct snd_seq_port_subs_info *grp;
|
||||||
|
+
|
||||||
|
+ grp = is_src ? &port->c_src : &port->c_dest;
|
||||||
|
+ down_write(&grp->list_mutex);
|
||||||
|
+ __delete_and_unsubscribe_port(client, port, subs, is_src, ack);
|
||||||
|
up_write(&grp->list_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -608,27 +620,30 @@ int snd_seq_port_disconnect(struct snd_seq_client *connector,
|
||||||
|
struct snd_seq_client_port *dest_port,
|
||||||
|
struct snd_seq_port_subscribe *info)
|
||||||
|
{
|
||||||
|
- struct snd_seq_port_subs_info *src = &src_port->c_src;
|
||||||
|
+ struct snd_seq_port_subs_info *dest = &dest_port->c_dest;
|
||||||
|
struct snd_seq_subscribers *subs;
|
||||||
|
int err = -ENOENT;
|
||||||
|
|
||||||
|
- down_write(&src->list_mutex);
|
||||||
|
+ /* always start from deleting the dest port for avoiding concurrent
|
||||||
|
+ * deletions
|
||||||
|
+ */
|
||||||
|
+ down_write(&dest->list_mutex);
|
||||||
|
/* look for the connection */
|
||||||
|
- list_for_each_entry(subs, &src->list_head, src_list) {
|
||||||
|
+ list_for_each_entry(subs, &dest->list_head, dest_list) {
|
||||||
|
if (match_subs_info(info, &subs->info)) {
|
||||||
|
- atomic_dec(&subs->ref_count); /* mark as not ready */
|
||||||
|
+ __delete_and_unsubscribe_port(dest_client, dest_port,
|
||||||
|
+ subs, false,
|
||||||
|
+ connector->number != dest_client->number);
|
||||||
|
err = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- up_write(&src->list_mutex);
|
||||||
|
+ up_write(&dest->list_mutex);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
delete_and_unsubscribe_port(src_client, src_port, subs, true,
|
||||||
|
connector->number != src_client->number);
|
||||||
|
- delete_and_unsubscribe_port(dest_client, dest_port, subs, false,
|
||||||
|
- connector->number != dest_client->number);
|
||||||
|
kfree(subs);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
1285
patch/kernel/archive/sun50iw9-4.9/patch-4.9.280-281.patch
Normal file
1285
patch/kernel/archive/sun50iw9-4.9/patch-4.9.280-281.patch
Normal file
File diff suppressed because it is too large
Load Diff
357
patch/kernel/archive/sun50iw9-4.9/patch-4.9.281-282.patch
Normal file
357
patch/kernel/archive/sun50iw9-4.9/patch-4.9.281-282.patch
Normal file
@@ -0,0 +1,357 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 08bbebb4acbf1..ca08ef26f416b 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 281
|
||||||
|
+SUBLEVEL = 282
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arc/kernel/vmlinux.lds.S b/arch/arc/kernel/vmlinux.lds.S
|
||||||
|
index f35ed578e007e..4d823d3f65bb3 100644
|
||||||
|
--- a/arch/arc/kernel/vmlinux.lds.S
|
||||||
|
+++ b/arch/arc/kernel/vmlinux.lds.S
|
||||||
|
@@ -92,6 +92,8 @@ SECTIONS
|
||||||
|
CPUIDLE_TEXT
|
||||||
|
LOCK_TEXT
|
||||||
|
KPROBES_TEXT
|
||||||
|
+ IRQENTRY_TEXT
|
||||||
|
+ SOFTIRQENTRY_TEXT
|
||||||
|
*(.fixup)
|
||||||
|
*(.gnu.warning)
|
||||||
|
}
|
||||||
|
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
|
||||||
|
index 5cbc6591fa1d3..c16d24ad83560 100644
|
||||||
|
--- a/arch/x86/kvm/mmu.c
|
||||||
|
+++ b/arch/x86/kvm/mmu.c
|
||||||
|
@@ -3927,7 +3927,16 @@ static void reset_rsvds_bits_mask_ept(struct kvm_vcpu *vcpu,
|
||||||
|
void
|
||||||
|
reset_shadow_zero_bits_mask(struct kvm_vcpu *vcpu, struct kvm_mmu *context)
|
||||||
|
{
|
||||||
|
- bool uses_nx = context->nx || context->base_role.smep_andnot_wp;
|
||||||
|
+ /*
|
||||||
|
+ * KVM uses NX when TDP is disabled to handle a variety of scenarios,
|
||||||
|
+ * notably for huge SPTEs if iTLB multi-hit mitigation is enabled and
|
||||||
|
+ * to generate correct permissions for CR0.WP=0/CR4.SMEP=1/EFER.NX=0.
|
||||||
|
+ * The iTLB multi-hit workaround can be toggled at any time, so assume
|
||||||
|
+ * NX can be used by any non-nested shadow MMU to avoid having to reset
|
||||||
|
+ * MMU contexts. Note, KVM forces EFER.NX=1 when TDP is disabled.
|
||||||
|
+ */
|
||||||
|
+ bool uses_nx = context->nx || !tdp_enabled ||
|
||||||
|
+ context->base_role.smep_andnot_wp;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Passing "true" to the last argument is okay; it adds a check
|
||||||
|
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
|
||||||
|
index 64a3dae5381ef..4496e7a492352 100644
|
||||||
|
--- a/drivers/block/floppy.c
|
||||||
|
+++ b/drivers/block/floppy.c
|
||||||
|
@@ -4067,22 +4067,21 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
|
||||||
|
if (UFDCS->rawcmd == 1)
|
||||||
|
UFDCS->rawcmd = 2;
|
||||||
|
|
||||||
|
- if (mode & (FMODE_READ|FMODE_WRITE)) {
|
||||||
|
- UDRS->last_checked = 0;
|
||||||
|
- clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
|
||||||
|
- check_disk_change(bdev);
|
||||||
|
- if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags))
|
||||||
|
- goto out;
|
||||||
|
- if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags))
|
||||||
|
+ if (!(mode & FMODE_NDELAY)) {
|
||||||
|
+ if (mode & (FMODE_READ|FMODE_WRITE)) {
|
||||||
|
+ UDRS->last_checked = 0;
|
||||||
|
+ clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
|
||||||
|
+ check_disk_change(bdev);
|
||||||
|
+ if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags))
|
||||||
|
+ goto out;
|
||||||
|
+ if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags))
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
+ res = -EROFS;
|
||||||
|
+ if ((mode & FMODE_WRITE) &&
|
||||||
|
+ !test_bit(FD_DISK_WRITABLE_BIT, &UDRS->flags))
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- res = -EROFS;
|
||||||
|
-
|
||||||
|
- if ((mode & FMODE_WRITE) &&
|
||||||
|
- !test_bit(FD_DISK_WRITABLE_BIT, &UDRS->flags))
|
||||||
|
- goto out;
|
||||||
|
-
|
||||||
|
mutex_unlock(&open_lock);
|
||||||
|
mutex_unlock(&floppy_mutex);
|
||||||
|
return 0;
|
||||||
|
diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c
|
||||||
|
index 76e63c88a87a8..e9313e6f4b0e3 100644
|
||||||
|
--- a/drivers/infiniband/hw/hfi1/sdma.c
|
||||||
|
+++ b/drivers/infiniband/hw/hfi1/sdma.c
|
||||||
|
@@ -3028,6 +3028,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
|
||||||
|
static int _extend_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
+ struct sdma_desc *descp;
|
||||||
|
|
||||||
|
/* Handle last descriptor */
|
||||||
|
if (unlikely((tx->num_desc == (MAX_DESC - 1)))) {
|
||||||
|
@@ -3048,12 +3049,10 @@ static int _extend_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx)
|
||||||
|
if (unlikely(tx->num_desc == MAX_DESC))
|
||||||
|
goto enomem;
|
||||||
|
|
||||||
|
- tx->descp = kmalloc_array(
|
||||||
|
- MAX_DESC,
|
||||||
|
- sizeof(struct sdma_desc),
|
||||||
|
- GFP_ATOMIC);
|
||||||
|
- if (!tx->descp)
|
||||||
|
+ descp = kmalloc_array(MAX_DESC, sizeof(struct sdma_desc), GFP_ATOMIC);
|
||||||
|
+ if (!descp)
|
||||||
|
goto enomem;
|
||||||
|
+ tx->descp = descp;
|
||||||
|
|
||||||
|
/* reserve last descriptor for coalescing */
|
||||||
|
tx->desc_limit = MAX_DESC - 1;
|
||||||
|
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
|
||||||
|
index 592c6e7f3dca4..fbe1173b2651f 100644
|
||||||
|
--- a/drivers/net/can/usb/esd_usb2.c
|
||||||
|
+++ b/drivers/net/can/usb/esd_usb2.c
|
||||||
|
@@ -236,8 +236,8 @@ static void esd_usb2_rx_event(struct esd_usb2_net_priv *priv,
|
||||||
|
if (id == ESD_EV_CAN_ERROR_EXT) {
|
||||||
|
u8 state = msg->msg.rx.data[0];
|
||||||
|
u8 ecc = msg->msg.rx.data[1];
|
||||||
|
- u8 txerr = msg->msg.rx.data[2];
|
||||||
|
- u8 rxerr = msg->msg.rx.data[3];
|
||||||
|
+ u8 rxerr = msg->msg.rx.data[2];
|
||||||
|
+ u8 txerr = msg->msg.rx.data[3];
|
||||||
|
|
||||||
|
skb = alloc_can_err_skb(priv->netdev, &cf);
|
||||||
|
if (skb == NULL) {
|
||||||
|
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
|
||||||
|
index 625008e8cb0df..500016209ae0c 100644
|
||||||
|
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
|
||||||
|
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
|
||||||
|
@@ -1010,6 +1010,8 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
|
||||||
|
{
|
||||||
|
u32 reg = link << (E1000_LTRV_REQ_SHIFT + E1000_LTRV_NOSNOOP_SHIFT) |
|
||||||
|
link << E1000_LTRV_REQ_SHIFT | E1000_LTRV_SEND;
|
||||||
|
+ u16 max_ltr_enc_d = 0; /* maximum LTR decoded by platform */
|
||||||
|
+ u16 lat_enc_d = 0; /* latency decoded */
|
||||||
|
u16 lat_enc = 0; /* latency encoded */
|
||||||
|
|
||||||
|
if (link) {
|
||||||
|
@@ -1063,7 +1065,17 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
|
||||||
|
E1000_PCI_LTR_CAP_LPT + 2, &max_nosnoop);
|
||||||
|
max_ltr_enc = max_t(u16, max_snoop, max_nosnoop);
|
||||||
|
|
||||||
|
- if (lat_enc > max_ltr_enc)
|
||||||
|
+ lat_enc_d = (lat_enc & E1000_LTRV_VALUE_MASK) *
|
||||||
|
+ (1U << (E1000_LTRV_SCALE_FACTOR *
|
||||||
|
+ ((lat_enc & E1000_LTRV_SCALE_MASK)
|
||||||
|
+ >> E1000_LTRV_SCALE_SHIFT)));
|
||||||
|
+
|
||||||
|
+ max_ltr_enc_d = (max_ltr_enc & E1000_LTRV_VALUE_MASK) *
|
||||||
|
+ (1U << (E1000_LTRV_SCALE_FACTOR *
|
||||||
|
+ ((max_ltr_enc & E1000_LTRV_SCALE_MASK)
|
||||||
|
+ >> E1000_LTRV_SCALE_SHIFT)));
|
||||||
|
+
|
||||||
|
+ if (lat_enc_d > max_ltr_enc_d)
|
||||||
|
lat_enc = max_ltr_enc;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.h b/drivers/net/ethernet/intel/e1000e/ich8lan.h
|
||||||
|
index 6374c8fc76a8d..9957a4ffdc6dc 100644
|
||||||
|
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.h
|
||||||
|
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.h
|
||||||
|
@@ -291,8 +291,11 @@
|
||||||
|
|
||||||
|
/* Latency Tolerance Reporting */
|
||||||
|
#define E1000_LTRV 0x000F8
|
||||||
|
+#define E1000_LTRV_VALUE_MASK 0x000003FF
|
||||||
|
#define E1000_LTRV_SCALE_MAX 5
|
||||||
|
#define E1000_LTRV_SCALE_FACTOR 5
|
||||||
|
+#define E1000_LTRV_SCALE_SHIFT 10
|
||||||
|
+#define E1000_LTRV_SCALE_MASK 0x00001C00
|
||||||
|
#define E1000_LTRV_REQ_SHIFT 15
|
||||||
|
#define E1000_LTRV_NOSNOOP_SHIFT 16
|
||||||
|
#define E1000_LTRV_SEND (1 << 30)
|
||||||
|
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
|
||||||
|
index bb6bc84995a2f..ccacdcfb59321 100644
|
||||||
|
--- a/drivers/net/ethernet/marvell/mvneta.c
|
||||||
|
+++ b/drivers/net/ethernet/marvell/mvneta.c
|
||||||
|
@@ -100,7 +100,7 @@
|
||||||
|
#define MVNETA_DESC_SWAP BIT(6)
|
||||||
|
#define MVNETA_TX_BRST_SZ_MASK(burst) ((burst) << 22)
|
||||||
|
#define MVNETA_PORT_STATUS 0x2444
|
||||||
|
-#define MVNETA_TX_IN_PRGRS BIT(1)
|
||||||
|
+#define MVNETA_TX_IN_PRGRS BIT(0)
|
||||||
|
#define MVNETA_TX_FIFO_EMPTY BIT(8)
|
||||||
|
#define MVNETA_RX_MIN_FRAME_SIZE 0x247c
|
||||||
|
#define MVNETA_SERDES_CFG 0x24A0
|
||||||
|
diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
|
||||||
|
index 9206fd2489353..e1c1627a3356b 100644
|
||||||
|
--- a/drivers/tty/vt/vt_ioctl.c
|
||||||
|
+++ b/drivers/tty/vt/vt_ioctl.c
|
||||||
|
@@ -487,16 +487,19 @@ int vt_ioctl(struct tty_struct *tty,
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
- /* FIXME: this needs the console lock extending */
|
||||||
|
- if (vc->vc_mode == (unsigned char) arg)
|
||||||
|
+ console_lock();
|
||||||
|
+ if (vc->vc_mode == (unsigned char) arg) {
|
||||||
|
+ console_unlock();
|
||||||
|
break;
|
||||||
|
+ }
|
||||||
|
vc->vc_mode = (unsigned char) arg;
|
||||||
|
- if (console != fg_console)
|
||||||
|
+ if (console != fg_console) {
|
||||||
|
+ console_unlock();
|
||||||
|
break;
|
||||||
|
+ }
|
||||||
|
/*
|
||||||
|
* explicitly blank/unblank the screen if switching modes
|
||||||
|
*/
|
||||||
|
- console_lock();
|
||||||
|
if (arg == KD_TEXT)
|
||||||
|
do_unblank_screen(1);
|
||||||
|
else
|
||||||
|
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
|
||||||
|
index cca51553e0fb0..e340ef67321e5 100644
|
||||||
|
--- a/drivers/usb/dwc3/gadget.c
|
||||||
|
+++ b/drivers/usb/dwc3/gadget.c
|
||||||
|
@@ -928,19 +928,19 @@ static struct dwc3_trb *dwc3_ep_prev_trb(struct dwc3_ep *dep, u8 index)
|
||||||
|
|
||||||
|
static u32 dwc3_calc_trbs_left(struct dwc3_ep *dep)
|
||||||
|
{
|
||||||
|
- struct dwc3_trb *tmp;
|
||||||
|
u8 trbs_left;
|
||||||
|
|
||||||
|
/*
|
||||||
|
- * If enqueue & dequeue are equal than it is either full or empty.
|
||||||
|
- *
|
||||||
|
- * One way to know for sure is if the TRB right before us has HWO bit
|
||||||
|
- * set or not. If it has, then we're definitely full and can't fit any
|
||||||
|
- * more transfers in our ring.
|
||||||
|
+ * If the enqueue & dequeue are equal then the TRB ring is either full
|
||||||
|
+ * or empty. It's considered full when there are DWC3_TRB_NUM-1 of TRBs
|
||||||
|
+ * pending to be processed by the driver.
|
||||||
|
*/
|
||||||
|
if (dep->trb_enqueue == dep->trb_dequeue) {
|
||||||
|
- tmp = dwc3_ep_prev_trb(dep, dep->trb_enqueue);
|
||||||
|
- if (tmp->ctrl & DWC3_TRB_CTRL_HWO)
|
||||||
|
+ /*
|
||||||
|
+ * If there is any request remained in the started_list at
|
||||||
|
+ * this point, that means there is no TRB available.
|
||||||
|
+ */
|
||||||
|
+ if (!list_empty(&dep->started_list))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return DWC3_TRB_NUM - 1;
|
||||||
|
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
|
||||||
|
index 2e92c6fef683f..c6ff79360302f 100644
|
||||||
|
--- a/drivers/usb/serial/ch341.c
|
||||||
|
+++ b/drivers/usb/serial/ch341.c
|
||||||
|
@@ -585,7 +585,6 @@ static struct usb_serial_driver ch341_device = {
|
||||||
|
.owner = THIS_MODULE,
|
||||||
|
.name = "ch341-uart",
|
||||||
|
},
|
||||||
|
- .bulk_in_size = 512,
|
||||||
|
.id_table = id_table,
|
||||||
|
.num_ports = 1,
|
||||||
|
.open = ch341_open,
|
||||||
|
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
|
||||||
|
index b3336a7c09e0b..02ded56bcbc6b 100644
|
||||||
|
--- a/drivers/usb/serial/option.c
|
||||||
|
+++ b/drivers/usb/serial/option.c
|
||||||
|
@@ -2058,6 +2058,8 @@ static const struct usb_device_id option_ids[] = {
|
||||||
|
.driver_info = RSVD(4) | RSVD(5) },
|
||||||
|
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */
|
||||||
|
.driver_info = RSVD(6) },
|
||||||
|
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */
|
||||||
|
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */
|
||||||
|
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
|
||||||
|
{ USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */
|
||||||
|
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */
|
||||||
|
diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
|
||||||
|
index d56736655dec4..da47542496cc3 100644
|
||||||
|
--- a/drivers/vhost/vringh.c
|
||||||
|
+++ b/drivers/vhost/vringh.c
|
||||||
|
@@ -329,7 +329,7 @@ __vringh_iov(struct vringh *vrh, u16 i,
|
||||||
|
iov = wiov;
|
||||||
|
else {
|
||||||
|
iov = riov;
|
||||||
|
- if (unlikely(wiov && wiov->i)) {
|
||||||
|
+ if (unlikely(wiov && wiov->used)) {
|
||||||
|
vringh_bad("Readable desc %p after writable",
|
||||||
|
&descs[i]);
|
||||||
|
err = -EINVAL;
|
||||||
|
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
|
||||||
|
index ae623cd04d6ca..16f5f56332433 100644
|
||||||
|
--- a/drivers/video/fbdev/core/fbmem.c
|
||||||
|
+++ b/drivers/video/fbdev/core/fbmem.c
|
||||||
|
@@ -1001,6 +1001,10 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* bitfill_aligned() assumes that it's at least 8x8 */
|
||||||
|
+ if (var->xres < 8 || var->yres < 8)
|
||||||
|
+ return -EINVAL;
|
||||||
|
+
|
||||||
|
ret = info->fbops->fb_check_var(var, info);
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
|
||||||
|
index 5cad9f41c238b..cf7eccfe3469b 100644
|
||||||
|
--- a/drivers/virtio/virtio_ring.c
|
||||||
|
+++ b/drivers/virtio/virtio_ring.c
|
||||||
|
@@ -1150,7 +1150,7 @@ bool virtqueue_is_broken(struct virtqueue *_vq)
|
||||||
|
{
|
||||||
|
struct vring_virtqueue *vq = to_vvq(_vq);
|
||||||
|
|
||||||
|
- return vq->broken;
|
||||||
|
+ return READ_ONCE(vq->broken);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(virtqueue_is_broken);
|
||||||
|
|
||||||
|
@@ -1164,7 +1164,9 @@ void virtio_break_device(struct virtio_device *dev)
|
||||||
|
|
||||||
|
list_for_each_entry(_vq, &dev->vqs, list) {
|
||||||
|
struct vring_virtqueue *vq = to_vvq(_vq);
|
||||||
|
- vq->broken = true;
|
||||||
|
+
|
||||||
|
+ /* Pairs with READ_ONCE() in virtqueue_is_broken(). */
|
||||||
|
+ WRITE_ONCE(vq->broken, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(virtio_break_device);
|
||||||
|
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
|
||||||
|
index 9609ad71dd260..fe1801d9f0598 100644
|
||||||
|
--- a/net/ipv4/ip_gre.c
|
||||||
|
+++ b/net/ipv4/ip_gre.c
|
||||||
|
@@ -353,6 +353,8 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev,
|
||||||
|
|
||||||
|
static int gre_handle_offloads(struct sk_buff *skb, bool csum)
|
||||||
|
{
|
||||||
|
+ if (csum && skb_checksum_start(skb) < skb->data)
|
||||||
|
+ return -EINVAL;
|
||||||
|
return iptunnel_handle_offloads(skb, csum ? SKB_GSO_GRE_CSUM : SKB_GSO_GRE);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/net/rds/ib_frmr.c b/net/rds/ib_frmr.c
|
||||||
|
index 3d9c4c6397c3d..20d045faf07c6 100644
|
||||||
|
--- a/net/rds/ib_frmr.c
|
||||||
|
+++ b/net/rds/ib_frmr.c
|
||||||
|
@@ -112,9 +112,9 @@ static int rds_ib_post_reg_frmr(struct rds_ib_mr *ibmr)
|
||||||
|
cpu_relax();
|
||||||
|
}
|
||||||
|
|
||||||
|
- ret = ib_map_mr_sg_zbva(frmr->mr, ibmr->sg, ibmr->sg_len,
|
||||||
|
+ ret = ib_map_mr_sg_zbva(frmr->mr, ibmr->sg, ibmr->sg_dma_len,
|
||||||
|
&off, PAGE_SIZE);
|
||||||
|
- if (unlikely(ret != ibmr->sg_len))
|
||||||
|
+ if (unlikely(ret != ibmr->sg_dma_len))
|
||||||
|
return ret < 0 ? ret : -EINVAL;
|
||||||
|
|
||||||
|
/* Perform a WR for the fast_reg_mr. Each individual page
|
||||||
4551
patch/kernel/archive/sun50iw9-4.9/patch-4.9.282-283.patch
Normal file
4551
patch/kernel/archive/sun50iw9-4.9/patch-4.9.282-283.patch
Normal file
File diff suppressed because it is too large
Load Diff
734
patch/kernel/archive/sun50iw9-4.9/patch-4.9.283-284.patch
Normal file
734
patch/kernel/archive/sun50iw9-4.9/patch-4.9.283-284.patch
Normal file
@@ -0,0 +1,734 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index ef029a28bb53c..9605f840f94b8 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 283
|
||||||
|
+SUBLEVEL = 284
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
|
||||||
|
index 53bb9700cf411..3d88c56d30f91 100644
|
||||||
|
--- a/arch/s390/net/bpf_jit_comp.c
|
||||||
|
+++ b/arch/s390/net/bpf_jit_comp.c
|
||||||
|
@@ -591,10 +591,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
|
||||||
|
EMIT4(0xb9080000, dst_reg, src_reg);
|
||||||
|
break;
|
||||||
|
case BPF_ALU | BPF_ADD | BPF_K: /* dst = (u32) dst + (u32) imm */
|
||||||
|
- if (!imm)
|
||||||
|
- break;
|
||||||
|
- /* alfi %dst,imm */
|
||||||
|
- EMIT6_IMM(0xc20b0000, dst_reg, imm);
|
||||||
|
+ if (imm != 0) {
|
||||||
|
+ /* alfi %dst,imm */
|
||||||
|
+ EMIT6_IMM(0xc20b0000, dst_reg, imm);
|
||||||
|
+ }
|
||||||
|
EMIT_ZERO(dst_reg);
|
||||||
|
break;
|
||||||
|
case BPF_ALU64 | BPF_ADD | BPF_K: /* dst = dst + imm */
|
||||||
|
@@ -616,10 +616,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
|
||||||
|
EMIT4(0xb9090000, dst_reg, src_reg);
|
||||||
|
break;
|
||||||
|
case BPF_ALU | BPF_SUB | BPF_K: /* dst = (u32) dst - (u32) imm */
|
||||||
|
- if (!imm)
|
||||||
|
- break;
|
||||||
|
- /* alfi %dst,-imm */
|
||||||
|
- EMIT6_IMM(0xc20b0000, dst_reg, -imm);
|
||||||
|
+ if (imm != 0) {
|
||||||
|
+ /* alfi %dst,-imm */
|
||||||
|
+ EMIT6_IMM(0xc20b0000, dst_reg, -imm);
|
||||||
|
+ }
|
||||||
|
EMIT_ZERO(dst_reg);
|
||||||
|
break;
|
||||||
|
case BPF_ALU64 | BPF_SUB | BPF_K: /* dst = dst - imm */
|
||||||
|
@@ -646,10 +646,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
|
||||||
|
EMIT4(0xb90c0000, dst_reg, src_reg);
|
||||||
|
break;
|
||||||
|
case BPF_ALU | BPF_MUL | BPF_K: /* dst = (u32) dst * (u32) imm */
|
||||||
|
- if (imm == 1)
|
||||||
|
- break;
|
||||||
|
- /* msfi %r5,imm */
|
||||||
|
- EMIT6_IMM(0xc2010000, dst_reg, imm);
|
||||||
|
+ if (imm != 1) {
|
||||||
|
+ /* msfi %r5,imm */
|
||||||
|
+ EMIT6_IMM(0xc2010000, dst_reg, imm);
|
||||||
|
+ }
|
||||||
|
EMIT_ZERO(dst_reg);
|
||||||
|
break;
|
||||||
|
case BPF_ALU64 | BPF_MUL | BPF_K: /* dst = dst * imm */
|
||||||
|
@@ -710,6 +710,8 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
|
||||||
|
if (BPF_OP(insn->code) == BPF_MOD)
|
||||||
|
/* lhgi %dst,0 */
|
||||||
|
EMIT4_IMM(0xa7090000, dst_reg, 0);
|
||||||
|
+ else
|
||||||
|
+ EMIT_ZERO(dst_reg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* lhi %w0,0 */
|
||||||
|
@@ -802,10 +804,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
|
||||||
|
EMIT4(0xb9820000, dst_reg, src_reg);
|
||||||
|
break;
|
||||||
|
case BPF_ALU | BPF_XOR | BPF_K: /* dst = (u32) dst ^ (u32) imm */
|
||||||
|
- if (!imm)
|
||||||
|
- break;
|
||||||
|
- /* xilf %dst,imm */
|
||||||
|
- EMIT6_IMM(0xc0070000, dst_reg, imm);
|
||||||
|
+ if (imm != 0) {
|
||||||
|
+ /* xilf %dst,imm */
|
||||||
|
+ EMIT6_IMM(0xc0070000, dst_reg, imm);
|
||||||
|
+ }
|
||||||
|
EMIT_ZERO(dst_reg);
|
||||||
|
break;
|
||||||
|
case BPF_ALU64 | BPF_XOR | BPF_K: /* dst = dst ^ imm */
|
||||||
|
@@ -826,10 +828,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
|
||||||
|
EMIT6_DISP_LH(0xeb000000, 0x000d, dst_reg, dst_reg, src_reg, 0);
|
||||||
|
break;
|
||||||
|
case BPF_ALU | BPF_LSH | BPF_K: /* dst = (u32) dst << (u32) imm */
|
||||||
|
- if (imm == 0)
|
||||||
|
- break;
|
||||||
|
- /* sll %dst,imm(%r0) */
|
||||||
|
- EMIT4_DISP(0x89000000, dst_reg, REG_0, imm);
|
||||||
|
+ if (imm != 0) {
|
||||||
|
+ /* sll %dst,imm(%r0) */
|
||||||
|
+ EMIT4_DISP(0x89000000, dst_reg, REG_0, imm);
|
||||||
|
+ }
|
||||||
|
EMIT_ZERO(dst_reg);
|
||||||
|
break;
|
||||||
|
case BPF_ALU64 | BPF_LSH | BPF_K: /* dst = dst << imm */
|
||||||
|
@@ -851,10 +853,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
|
||||||
|
EMIT6_DISP_LH(0xeb000000, 0x000c, dst_reg, dst_reg, src_reg, 0);
|
||||||
|
break;
|
||||||
|
case BPF_ALU | BPF_RSH | BPF_K: /* dst = (u32) dst >> (u32) imm */
|
||||||
|
- if (imm == 0)
|
||||||
|
- break;
|
||||||
|
- /* srl %dst,imm(%r0) */
|
||||||
|
- EMIT4_DISP(0x88000000, dst_reg, REG_0, imm);
|
||||||
|
+ if (imm != 0) {
|
||||||
|
+ /* srl %dst,imm(%r0) */
|
||||||
|
+ EMIT4_DISP(0x88000000, dst_reg, REG_0, imm);
|
||||||
|
+ }
|
||||||
|
EMIT_ZERO(dst_reg);
|
||||||
|
break;
|
||||||
|
case BPF_ALU64 | BPF_RSH | BPF_K: /* dst = dst >> imm */
|
||||||
|
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
|
||||||
|
index 3a4c9a3c1427f..6435dc25be0aa 100644
|
||||||
|
--- a/block/blk-throttle.c
|
||||||
|
+++ b/block/blk-throttle.c
|
||||||
|
@@ -1584,6 +1584,7 @@ int blk_throtl_init(struct request_queue *q)
|
||||||
|
void blk_throtl_exit(struct request_queue *q)
|
||||||
|
{
|
||||||
|
BUG_ON(!q->td);
|
||||||
|
+ del_timer_sync(&q->td->service_queue.pending_timer);
|
||||||
|
throtl_shutdown_wq(q);
|
||||||
|
blkcg_deactivate_policy(q, &blkcg_policy_throtl);
|
||||||
|
kfree(q->td);
|
||||||
|
diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
|
||||||
|
index ee63ccaea8d57..8c05e7a5e777b 100644
|
||||||
|
--- a/drivers/base/power/wakeirq.c
|
||||||
|
+++ b/drivers/base/power/wakeirq.c
|
||||||
|
@@ -320,7 +320,8 @@ void dev_pm_arm_wake_irq(struct wake_irq *wirq)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (device_may_wakeup(wirq->dev)) {
|
||||||
|
- if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED)
|
||||||
|
+ if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED &&
|
||||||
|
+ !pm_runtime_status_suspended(wirq->dev))
|
||||||
|
enable_irq(wirq->irq);
|
||||||
|
|
||||||
|
enable_irq_wake(wirq->irq);
|
||||||
|
@@ -342,7 +343,8 @@ void dev_pm_disarm_wake_irq(struct wake_irq *wirq)
|
||||||
|
if (device_may_wakeup(wirq->dev)) {
|
||||||
|
disable_irq_wake(wirq->irq);
|
||||||
|
|
||||||
|
- if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED)
|
||||||
|
+ if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED &&
|
||||||
|
+ !pm_runtime_status_suspended(wirq->dev))
|
||||||
|
disable_irq_nosync(wirq->irq);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
|
||||||
|
index 15eb1501915ca..ef9515e9f213f 100644
|
||||||
|
--- a/drivers/crypto/talitos.c
|
||||||
|
+++ b/drivers/crypto/talitos.c
|
||||||
|
@@ -816,7 +816,7 @@ static void talitos_unregister_rng(struct device *dev)
|
||||||
|
* HMAC_SNOOP_NO_AFEA (HSNA) instead of type IPSEC_ESP
|
||||||
|
*/
|
||||||
|
#define TALITOS_CRA_PRIORITY_AEAD_HSNA (TALITOS_CRA_PRIORITY - 1)
|
||||||
|
-#ifdef CONFIG_CRYPTO_DEV_TALITOS_SEC2
|
||||||
|
+#ifdef CONFIG_CRYPTO_DEV_TALITOS2
|
||||||
|
#define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA512_BLOCK_SIZE)
|
||||||
|
#else
|
||||||
|
#define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA256_BLOCK_SIZE)
|
||||||
|
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
|
||||||
|
index b0f798244a897..9a6da9b2dad35 100644
|
||||||
|
--- a/drivers/dma/Kconfig
|
||||||
|
+++ b/drivers/dma/Kconfig
|
||||||
|
@@ -238,7 +238,7 @@ config INTEL_IDMA64
|
||||||
|
|
||||||
|
config INTEL_IOATDMA
|
||||||
|
tristate "Intel I/OAT DMA support"
|
||||||
|
- depends on PCI && X86_64
|
||||||
|
+ depends on PCI && X86_64 && !UML
|
||||||
|
select DMA_ENGINE
|
||||||
|
select DMA_ENGINE_RAID
|
||||||
|
select DCA
|
||||||
|
diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c
|
||||||
|
index 4a748c3435d7d..02149742b334c 100644
|
||||||
|
--- a/drivers/dma/acpi-dma.c
|
||||||
|
+++ b/drivers/dma/acpi-dma.c
|
||||||
|
@@ -72,10 +72,14 @@ static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp,
|
||||||
|
|
||||||
|
si = (const struct acpi_csrt_shared_info *)&grp[1];
|
||||||
|
|
||||||
|
- /* Match device by MMIO and IRQ */
|
||||||
|
+ /* Match device by MMIO */
|
||||||
|
if (si->mmio_base_low != lower_32_bits(mem) ||
|
||||||
|
- si->mmio_base_high != upper_32_bits(mem) ||
|
||||||
|
- si->gsi_interrupt != irq)
|
||||||
|
+ si->mmio_base_high != upper_32_bits(mem))
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+ /* Match device by Linux vIRQ */
|
||||||
|
+ ret = acpi_register_gsi(NULL, si->gsi_interrupt, si->interrupt_mode, si->interrupt_polarity);
|
||||||
|
+ if (ret != irq)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
dev_dbg(&adev->dev, "matches with %.4s%04X (rev %u)\n",
|
||||||
|
diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
|
||||||
|
index f00652585ee31..d88c53ff7bb69 100644
|
||||||
|
--- a/drivers/dma/xilinx/xilinx_dma.c
|
||||||
|
+++ b/drivers/dma/xilinx/xilinx_dma.c
|
||||||
|
@@ -2578,7 +2578,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)
|
||||||
|
xdev->ext_addr = false;
|
||||||
|
|
||||||
|
/* Set the dma mask bits */
|
||||||
|
- dma_set_mask(xdev->dev, DMA_BIT_MASK(addr_width));
|
||||||
|
+ dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width));
|
||||||
|
|
||||||
|
/* Initialize the DMA engine */
|
||||||
|
xdev->common.dev = &pdev->dev;
|
||||||
|
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c
|
||||||
|
index b0ece71aefdee..ce774579c89d1 100644
|
||||||
|
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c
|
||||||
|
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c
|
||||||
|
@@ -57,7 +57,7 @@ nvkm_control_mthd_pstate_info(struct nvkm_control *ctrl, void *data, u32 size)
|
||||||
|
args->v0.count = 0;
|
||||||
|
args->v0.ustate_ac = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
|
||||||
|
args->v0.ustate_dc = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
|
||||||
|
- args->v0.pwrsrc = -ENOSYS;
|
||||||
|
+ args->v0.pwrsrc = -ENODEV;
|
||||||
|
args->v0.pstate = NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
|
||||||
|
index d842ae5310f71..bbcff6ae61d66 100644
|
||||||
|
--- a/drivers/parisc/dino.c
|
||||||
|
+++ b/drivers/parisc/dino.c
|
||||||
|
@@ -160,15 +160,6 @@ struct dino_device
|
||||||
|
(struct dino_device *)__pdata; })
|
||||||
|
|
||||||
|
|
||||||
|
-/* Check if PCI device is behind a Card-mode Dino. */
|
||||||
|
-static int pci_dev_is_behind_card_dino(struct pci_dev *dev)
|
||||||
|
-{
|
||||||
|
- struct dino_device *dino_dev;
|
||||||
|
-
|
||||||
|
- dino_dev = DINO_DEV(parisc_walk_tree(dev->bus->bridge));
|
||||||
|
- return is_card_dino(&dino_dev->hba.dev->id);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
/*
|
||||||
|
* Dino Configuration Space Accessor Functions
|
||||||
|
*/
|
||||||
|
@@ -452,6 +443,15 @@ static void quirk_cirrus_cardbus(struct pci_dev *dev)
|
||||||
|
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_6832, quirk_cirrus_cardbus );
|
||||||
|
|
||||||
|
#ifdef CONFIG_TULIP
|
||||||
|
+/* Check if PCI device is behind a Card-mode Dino. */
|
||||||
|
+static int pci_dev_is_behind_card_dino(struct pci_dev *dev)
|
||||||
|
+{
|
||||||
|
+ struct dino_device *dino_dev;
|
||||||
|
+
|
||||||
|
+ dino_dev = DINO_DEV(parisc_walk_tree(dev->bus->bridge));
|
||||||
|
+ return is_card_dino(&dino_dev->hba.dev->id);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void pci_fixup_tulip(struct pci_dev *dev)
|
||||||
|
{
|
||||||
|
if (!pci_dev_is_behind_card_dino(dev))
|
||||||
|
diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/pwm-lpc32xx.c
|
||||||
|
index a9b3cff96aaca..ed8e9406b4af2 100644
|
||||||
|
--- a/drivers/pwm/pwm-lpc32xx.c
|
||||||
|
+++ b/drivers/pwm/pwm-lpc32xx.c
|
||||||
|
@@ -124,17 +124,17 @@ static int lpc32xx_pwm_probe(struct platform_device *pdev)
|
||||||
|
lpc32xx->chip.npwm = 1;
|
||||||
|
lpc32xx->chip.base = -1;
|
||||||
|
|
||||||
|
+ /* If PWM is disabled, configure the output to the default value */
|
||||||
|
+ val = readl(lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
|
||||||
|
+ val &= ~PWM_PIN_LEVEL;
|
||||||
|
+ writel(val, lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
|
||||||
|
+
|
||||||
|
ret = pwmchip_add(&lpc32xx->chip);
|
||||||
|
if (ret < 0) {
|
||||||
|
dev_err(&pdev->dev, "failed to add PWM chip, error %d\n", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
- /* When PWM is disable, configure the output to the default value */
|
||||||
|
- val = readl(lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
|
||||||
|
- val &= ~PWM_PIN_LEVEL;
|
||||||
|
- writel(val, lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
|
||||||
|
-
|
||||||
|
platform_set_drvdata(pdev, lpc32xx);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
|
||||||
|
index 22c481f2ae4f1..2a35b99cf628e 100644
|
||||||
|
--- a/drivers/staging/android/ion/ion_system_heap.c
|
||||||
|
+++ b/drivers/staging/android/ion/ion_system_heap.c
|
||||||
|
@@ -75,7 +75,7 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap,
|
||||||
|
|
||||||
|
page = ion_page_pool_alloc(pool);
|
||||||
|
|
||||||
|
- if (cached)
|
||||||
|
+ if (page && cached)
|
||||||
|
ion_pages_sync_for_device(NULL, page, PAGE_SIZE << order,
|
||||||
|
DMA_BIDIRECTIONAL);
|
||||||
|
return page;
|
||||||
|
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
|
||||||
|
index c974cb5fb9580..02510c191c7db 100644
|
||||||
|
--- a/drivers/thermal/samsung/exynos_tmu.c
|
||||||
|
+++ b/drivers/thermal/samsung/exynos_tmu.c
|
||||||
|
@@ -1372,6 +1372,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
|
||||||
|
data->sclk = devm_clk_get(&pdev->dev, "tmu_sclk");
|
||||||
|
if (IS_ERR(data->sclk)) {
|
||||||
|
dev_err(&pdev->dev, "Failed to get sclk\n");
|
||||||
|
+ ret = PTR_ERR(data->sclk);
|
||||||
|
goto err_clk;
|
||||||
|
} else {
|
||||||
|
ret = clk_prepare_enable(data->sclk);
|
||||||
|
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
|
||||||
|
index 0eb2ada032c74..839bccbcc9d65 100644
|
||||||
|
--- a/fs/ceph/caps.c
|
||||||
|
+++ b/fs/ceph/caps.c
|
||||||
|
@@ -1572,6 +1572,8 @@ static int __mark_caps_flushing(struct inode *inode,
|
||||||
|
* try to invalidate mapping pages without blocking.
|
||||||
|
*/
|
||||||
|
static int try_nonblocking_invalidate(struct inode *inode)
|
||||||
|
+ __releases(ci->i_ceph_lock)
|
||||||
|
+ __acquires(ci->i_ceph_lock)
|
||||||
|
{
|
||||||
|
struct ceph_inode_info *ci = ceph_inode(inode);
|
||||||
|
u32 invalidating_gen = ci->i_rdcache_gen;
|
||||||
|
diff --git a/fs/nilfs2/sysfs.c b/fs/nilfs2/sysfs.c
|
||||||
|
index e9903bceb2bf1..33fba75aa9f38 100644
|
||||||
|
--- a/fs/nilfs2/sysfs.c
|
||||||
|
+++ b/fs/nilfs2/sysfs.c
|
||||||
|
@@ -73,11 +73,9 @@ static const struct sysfs_ops nilfs_##name##_attr_ops = { \
|
||||||
|
#define NILFS_DEV_INT_GROUP_TYPE(name, parent_name) \
|
||||||
|
static void nilfs_##name##_attr_release(struct kobject *kobj) \
|
||||||
|
{ \
|
||||||
|
- struct nilfs_sysfs_##parent_name##_subgroups *subgroups; \
|
||||||
|
- struct the_nilfs *nilfs = container_of(kobj->parent, \
|
||||||
|
- struct the_nilfs, \
|
||||||
|
- ns_##parent_name##_kobj); \
|
||||||
|
- subgroups = nilfs->ns_##parent_name##_subgroups; \
|
||||||
|
+ struct nilfs_sysfs_##parent_name##_subgroups *subgroups = container_of(kobj, \
|
||||||
|
+ struct nilfs_sysfs_##parent_name##_subgroups, \
|
||||||
|
+ sg_##name##_kobj); \
|
||||||
|
complete(&subgroups->sg_##name##_kobj_unregister); \
|
||||||
|
} \
|
||||||
|
static struct kobj_type nilfs_##name##_ktype = { \
|
||||||
|
@@ -103,12 +101,12 @@ static int nilfs_sysfs_create_##name##_group(struct the_nilfs *nilfs) \
|
||||||
|
err = kobject_init_and_add(kobj, &nilfs_##name##_ktype, parent, \
|
||||||
|
#name); \
|
||||||
|
if (err) \
|
||||||
|
- return err; \
|
||||||
|
- return 0; \
|
||||||
|
+ kobject_put(kobj); \
|
||||||
|
+ return err; \
|
||||||
|
} \
|
||||||
|
static void nilfs_sysfs_delete_##name##_group(struct the_nilfs *nilfs) \
|
||||||
|
{ \
|
||||||
|
- kobject_del(&nilfs->ns_##parent_name##_subgroups->sg_##name##_kobj); \
|
||||||
|
+ kobject_put(&nilfs->ns_##parent_name##_subgroups->sg_##name##_kobj); \
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************
|
||||||
|
@@ -219,14 +217,14 @@ int nilfs_sysfs_create_snapshot_group(struct nilfs_root *root)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (err)
|
||||||
|
- return err;
|
||||||
|
+ kobject_put(&root->snapshot_kobj);
|
||||||
|
|
||||||
|
- return 0;
|
||||||
|
+ return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
void nilfs_sysfs_delete_snapshot_group(struct nilfs_root *root)
|
||||||
|
{
|
||||||
|
- kobject_del(&root->snapshot_kobj);
|
||||||
|
+ kobject_put(&root->snapshot_kobj);
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************
|
||||||
|
@@ -1010,7 +1008,7 @@ int nilfs_sysfs_create_device_group(struct super_block *sb)
|
||||||
|
err = kobject_init_and_add(&nilfs->ns_dev_kobj, &nilfs_dev_ktype, NULL,
|
||||||
|
"%s", sb->s_id);
|
||||||
|
if (err)
|
||||||
|
- goto free_dev_subgroups;
|
||||||
|
+ goto cleanup_dev_kobject;
|
||||||
|
|
||||||
|
err = nilfs_sysfs_create_mounted_snapshots_group(nilfs);
|
||||||
|
if (err)
|
||||||
|
@@ -1047,9 +1045,7 @@ delete_mounted_snapshots_group:
|
||||||
|
nilfs_sysfs_delete_mounted_snapshots_group(nilfs);
|
||||||
|
|
||||||
|
cleanup_dev_kobject:
|
||||||
|
- kobject_del(&nilfs->ns_dev_kobj);
|
||||||
|
-
|
||||||
|
-free_dev_subgroups:
|
||||||
|
+ kobject_put(&nilfs->ns_dev_kobj);
|
||||||
|
kfree(nilfs->ns_dev_subgroups);
|
||||||
|
|
||||||
|
failed_create_device_group:
|
||||||
|
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
|
||||||
|
index b46133a41f55e..c0707e9bd9186 100644
|
||||||
|
--- a/include/net/sctp/structs.h
|
||||||
|
+++ b/include/net/sctp/structs.h
|
||||||
|
@@ -470,7 +470,7 @@ struct sctp_af {
|
||||||
|
int saddr);
|
||||||
|
void (*from_sk) (union sctp_addr *,
|
||||||
|
struct sock *sk);
|
||||||
|
- void (*from_addr_param) (union sctp_addr *,
|
||||||
|
+ bool (*from_addr_param) (union sctp_addr *,
|
||||||
|
union sctp_addr_param *,
|
||||||
|
__be16 port, int iif);
|
||||||
|
int (*to_addr_param) (const union sctp_addr *,
|
||||||
|
diff --git a/kernel/profile.c b/kernel/profile.c
|
||||||
|
index 2dbccf2d806c6..9c78e3ab4b420 100644
|
||||||
|
--- a/kernel/profile.c
|
||||||
|
+++ b/kernel/profile.c
|
||||||
|
@@ -38,7 +38,8 @@ struct profile_hit {
|
||||||
|
#define NR_PROFILE_GRP (NR_PROFILE_HIT/PROFILE_GRPSZ)
|
||||||
|
|
||||||
|
static atomic_t *prof_buffer;
|
||||||
|
-static unsigned long prof_len, prof_shift;
|
||||||
|
+static unsigned long prof_len;
|
||||||
|
+static unsigned short int prof_shift;
|
||||||
|
|
||||||
|
int prof_on __read_mostly;
|
||||||
|
EXPORT_SYMBOL_GPL(prof_on);
|
||||||
|
@@ -64,8 +65,8 @@ int profile_setup(char *str)
|
||||||
|
if (str[strlen(sleepstr)] == ',')
|
||||||
|
str += strlen(sleepstr) + 1;
|
||||||
|
if (get_option(&str, &par))
|
||||||
|
- prof_shift = par;
|
||||||
|
- pr_info("kernel sleep profiling enabled (shift: %ld)\n",
|
||||||
|
+ prof_shift = clamp(par, 0, BITS_PER_LONG - 1);
|
||||||
|
+ pr_info("kernel sleep profiling enabled (shift: %u)\n",
|
||||||
|
prof_shift);
|
||||||
|
#else
|
||||||
|
pr_warn("kernel sleep profiling requires CONFIG_SCHEDSTATS\n");
|
||||||
|
@@ -75,21 +76,21 @@ int profile_setup(char *str)
|
||||||
|
if (str[strlen(schedstr)] == ',')
|
||||||
|
str += strlen(schedstr) + 1;
|
||||||
|
if (get_option(&str, &par))
|
||||||
|
- prof_shift = par;
|
||||||
|
- pr_info("kernel schedule profiling enabled (shift: %ld)\n",
|
||||||
|
+ prof_shift = clamp(par, 0, BITS_PER_LONG - 1);
|
||||||
|
+ pr_info("kernel schedule profiling enabled (shift: %u)\n",
|
||||||
|
prof_shift);
|
||||||
|
} else if (!strncmp(str, kvmstr, strlen(kvmstr))) {
|
||||||
|
prof_on = KVM_PROFILING;
|
||||||
|
if (str[strlen(kvmstr)] == ',')
|
||||||
|
str += strlen(kvmstr) + 1;
|
||||||
|
if (get_option(&str, &par))
|
||||||
|
- prof_shift = par;
|
||||||
|
- pr_info("kernel KVM profiling enabled (shift: %ld)\n",
|
||||||
|
+ prof_shift = clamp(par, 0, BITS_PER_LONG - 1);
|
||||||
|
+ pr_info("kernel KVM profiling enabled (shift: %u)\n",
|
||||||
|
prof_shift);
|
||||||
|
} else if (get_option(&str, &par)) {
|
||||||
|
- prof_shift = par;
|
||||||
|
+ prof_shift = clamp(par, 0, BITS_PER_LONG - 1);
|
||||||
|
prof_on = CPU_PROFILING;
|
||||||
|
- pr_info("kernel profiling enabled (shift: %ld)\n",
|
||||||
|
+ pr_info("kernel profiling enabled (shift: %u)\n",
|
||||||
|
prof_shift);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
@@ -465,7 +466,7 @@ read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
||||||
|
unsigned long p = *ppos;
|
||||||
|
ssize_t read;
|
||||||
|
char *pnt;
|
||||||
|
- unsigned int sample_step = 1 << prof_shift;
|
||||||
|
+ unsigned long sample_step = 1UL << prof_shift;
|
||||||
|
|
||||||
|
profile_flip_buffers();
|
||||||
|
if (p >= (prof_len+1)*sizeof(unsigned int))
|
||||||
|
diff --git a/kernel/sys.c b/kernel/sys.c
|
||||||
|
index 546cdc911dad4..2e1def48ed73b 100644
|
||||||
|
--- a/kernel/sys.c
|
||||||
|
+++ b/kernel/sys.c
|
||||||
|
@@ -1774,13 +1774,6 @@ static int validate_prctl_map(struct prctl_mm_map *prctl_map)
|
||||||
|
|
||||||
|
error = -EINVAL;
|
||||||
|
|
||||||
|
- /*
|
||||||
|
- * @brk should be after @end_data in traditional maps.
|
||||||
|
- */
|
||||||
|
- if (prctl_map->start_brk <= prctl_map->end_data ||
|
||||||
|
- prctl_map->brk <= prctl_map->end_data)
|
||||||
|
- goto out;
|
||||||
|
-
|
||||||
|
/*
|
||||||
|
* Neither we should allow to override limits if they set.
|
||||||
|
*/
|
||||||
|
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
|
||||||
|
index f88911cffa1ad..c6a46e8e9eda5 100644
|
||||||
|
--- a/net/9p/trans_virtio.c
|
||||||
|
+++ b/net/9p/trans_virtio.c
|
||||||
|
@@ -602,7 +602,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
|
||||||
|
chan->vc_wq = kmalloc(sizeof(wait_queue_head_t), GFP_KERNEL);
|
||||||
|
if (!chan->vc_wq) {
|
||||||
|
err = -ENOMEM;
|
||||||
|
- goto out_free_tag;
|
||||||
|
+ goto out_remove_file;
|
||||||
|
}
|
||||||
|
init_waitqueue_head(chan->vc_wq);
|
||||||
|
chan->ring_bufs_avail = 1;
|
||||||
|
@@ -620,6 +620,8 @@ static int p9_virtio_probe(struct virtio_device *vdev)
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
+out_remove_file:
|
||||||
|
+ sysfs_remove_file(&vdev->dev.kobj, &dev_attr_mount_tag.attr);
|
||||||
|
out_free_tag:
|
||||||
|
kfree(tag);
|
||||||
|
out_free_vq:
|
||||||
|
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
|
||||||
|
index dc4335d817d80..dd9532c5c19dd 100644
|
||||||
|
--- a/net/sctp/bind_addr.c
|
||||||
|
+++ b/net/sctp/bind_addr.c
|
||||||
|
@@ -285,20 +285,16 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list,
|
||||||
|
rawaddr = (union sctp_addr_param *)raw_addr_list;
|
||||||
|
|
||||||
|
af = sctp_get_af_specific(param_type2af(param->type));
|
||||||
|
- if (unlikely(!af)) {
|
||||||
|
+ if (unlikely(!af) ||
|
||||||
|
+ !af->from_addr_param(&addr, rawaddr, htons(port), 0)) {
|
||||||
|
retval = -EINVAL;
|
||||||
|
- sctp_bind_addr_clean(bp);
|
||||||
|
- break;
|
||||||
|
+ goto out_err;
|
||||||
|
}
|
||||||
|
|
||||||
|
- af->from_addr_param(&addr, rawaddr, htons(port), 0);
|
||||||
|
retval = sctp_add_bind_addr(bp, &addr, sizeof(addr),
|
||||||
|
SCTP_ADDR_SRC, gfp);
|
||||||
|
- if (retval) {
|
||||||
|
- /* Can't finish building the list, clean up. */
|
||||||
|
- sctp_bind_addr_clean(bp);
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
+ if (retval)
|
||||||
|
+ goto out_err;
|
||||||
|
|
||||||
|
len = ntohs(param->length);
|
||||||
|
addrs_len -= len;
|
||||||
|
@@ -306,6 +302,12 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list,
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
+
|
||||||
|
+out_err:
|
||||||
|
+ if (retval)
|
||||||
|
+ sctp_bind_addr_clean(bp);
|
||||||
|
+
|
||||||
|
+ return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
/********************************************************************
|
||||||
|
diff --git a/net/sctp/input.c b/net/sctp/input.c
|
||||||
|
index 8f4574c4aa6ca..9c1670b4a687d 100644
|
||||||
|
--- a/net/sctp/input.c
|
||||||
|
+++ b/net/sctp/input.c
|
||||||
|
@@ -1051,7 +1051,8 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct net *net,
|
||||||
|
if (!af)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
- af->from_addr_param(paddr, params.addr, sh->source, 0);
|
||||||
|
+ if (!af->from_addr_param(paddr, params.addr, sh->source, 0))
|
||||||
|
+ continue;
|
||||||
|
|
||||||
|
asoc = __sctp_lookup_association(net, laddr, paddr, transportp);
|
||||||
|
if (asoc)
|
||||||
|
@@ -1087,6 +1088,9 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
|
||||||
|
union sctp_addr_param *param;
|
||||||
|
union sctp_addr paddr;
|
||||||
|
|
||||||
|
+ if (ntohs(ch->length) < sizeof(*asconf) + sizeof(struct sctp_paramhdr))
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
/* Skip over the ADDIP header and find the Address parameter */
|
||||||
|
param = (union sctp_addr_param *)(asconf + 1);
|
||||||
|
|
||||||
|
@@ -1094,7 +1098,8 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
|
||||||
|
if (unlikely(!af))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
- af->from_addr_param(&paddr, param, peer_port, 0);
|
||||||
|
+ if (af->from_addr_param(&paddr, param, peer_port, 0))
|
||||||
|
+ return NULL;
|
||||||
|
|
||||||
|
return __sctp_lookup_association(net, laddr, &paddr, transportp);
|
||||||
|
}
|
||||||
|
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
|
||||||
|
index 50bc8c4ca9068..01337204d2b6f 100644
|
||||||
|
--- a/net/sctp/ipv6.c
|
||||||
|
+++ b/net/sctp/ipv6.c
|
||||||
|
@@ -490,15 +490,20 @@ static void sctp_v6_to_sk_daddr(union sctp_addr *addr, struct sock *sk)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize a sctp_addr from an address parameter. */
|
||||||
|
-static void sctp_v6_from_addr_param(union sctp_addr *addr,
|
||||||
|
+static bool sctp_v6_from_addr_param(union sctp_addr *addr,
|
||||||
|
union sctp_addr_param *param,
|
||||||
|
__be16 port, int iif)
|
||||||
|
{
|
||||||
|
+ if (ntohs(param->v6.param_hdr.length) < sizeof(struct sctp_ipv6addr_param))
|
||||||
|
+ return false;
|
||||||
|
+
|
||||||
|
addr->v6.sin6_family = AF_INET6;
|
||||||
|
addr->v6.sin6_port = port;
|
||||||
|
addr->v6.sin6_flowinfo = 0; /* BUG */
|
||||||
|
addr->v6.sin6_addr = param->v6.addr;
|
||||||
|
addr->v6.sin6_scope_id = iif;
|
||||||
|
+
|
||||||
|
+ return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize an address parameter from a sctp_addr and return the length
|
||||||
|
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
|
||||||
|
index b1932fd125dad..02afbe5710083 100644
|
||||||
|
--- a/net/sctp/protocol.c
|
||||||
|
+++ b/net/sctp/protocol.c
|
||||||
|
@@ -274,14 +274,19 @@ static void sctp_v4_to_sk_daddr(union sctp_addr *addr, struct sock *sk)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize a sctp_addr from an address parameter. */
|
||||||
|
-static void sctp_v4_from_addr_param(union sctp_addr *addr,
|
||||||
|
+static bool sctp_v4_from_addr_param(union sctp_addr *addr,
|
||||||
|
union sctp_addr_param *param,
|
||||||
|
__be16 port, int iif)
|
||||||
|
{
|
||||||
|
+ if (ntohs(param->v4.param_hdr.length) < sizeof(struct sctp_ipv4addr_param))
|
||||||
|
+ return false;
|
||||||
|
+
|
||||||
|
addr->v4.sin_family = AF_INET;
|
||||||
|
addr->v4.sin_port = port;
|
||||||
|
addr->v4.sin_addr.s_addr = param->v4.addr.s_addr;
|
||||||
|
memset(addr->v4.sin_zero, 0, sizeof(addr->v4.sin_zero));
|
||||||
|
+
|
||||||
|
+ return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize an address parameter from a sctp_addr and return the length
|
||||||
|
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
|
||||||
|
index 0c5aff3bb5391..2e2802f047005 100644
|
||||||
|
--- a/net/sctp/sm_make_chunk.c
|
||||||
|
+++ b/net/sctp/sm_make_chunk.c
|
||||||
|
@@ -2155,9 +2155,16 @@ static sctp_ierror_t sctp_verify_param(struct net *net,
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCTP_PARAM_SET_PRIMARY:
|
||||||
|
- if (net->sctp.addip_enable)
|
||||||
|
- break;
|
||||||
|
- goto fallthrough;
|
||||||
|
+ if (!net->sctp.addip_enable)
|
||||||
|
+ goto fallthrough;
|
||||||
|
+
|
||||||
|
+ if (ntohs(param.p->length) < sizeof(struct sctp_addip_param) +
|
||||||
|
+ sizeof(struct sctp_paramhdr)) {
|
||||||
|
+ sctp_process_inv_paramlength(asoc, param.p,
|
||||||
|
+ chunk, err_chunk);
|
||||||
|
+ retval = SCTP_IERROR_ABORT;
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
|
||||||
|
case SCTP_PARAM_HOST_NAME_ADDRESS:
|
||||||
|
/* Tell the peer, we won't support this param. */
|
||||||
|
@@ -2335,11 +2342,13 @@ int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk,
|
||||||
|
|
||||||
|
/* Process the initialization parameters. */
|
||||||
|
sctp_walk_params(param, peer_init, init_hdr.params) {
|
||||||
|
- if (!src_match && (param.p->type == SCTP_PARAM_IPV4_ADDRESS ||
|
||||||
|
- param.p->type == SCTP_PARAM_IPV6_ADDRESS)) {
|
||||||
|
+ if (!src_match &&
|
||||||
|
+ (param.p->type == SCTP_PARAM_IPV4_ADDRESS ||
|
||||||
|
+ param.p->type == SCTP_PARAM_IPV6_ADDRESS)) {
|
||||||
|
af = sctp_get_af_specific(param_type2af(param.p->type));
|
||||||
|
- af->from_addr_param(&addr, param.addr,
|
||||||
|
- chunk->sctp_hdr->source, 0);
|
||||||
|
+ if (!af->from_addr_param(&addr, param.addr,
|
||||||
|
+ chunk->sctp_hdr->source, 0))
|
||||||
|
+ continue;
|
||||||
|
if (sctp_cmp_addr_exact(sctp_source(chunk), &addr))
|
||||||
|
src_match = 1;
|
||||||
|
}
|
||||||
|
@@ -2533,7 +2542,8 @@ static int sctp_process_param(struct sctp_association *asoc,
|
||||||
|
break;
|
||||||
|
do_addr_param:
|
||||||
|
af = sctp_get_af_specific(param_type2af(param.p->type));
|
||||||
|
- af->from_addr_param(&addr, param.addr, htons(asoc->peer.port), 0);
|
||||||
|
+ if (!af->from_addr_param(&addr, param.addr, htons(asoc->peer.port), 0))
|
||||||
|
+ break;
|
||||||
|
scope = sctp_scope(peer_addr);
|
||||||
|
if (sctp_in_scope(net, &addr, scope))
|
||||||
|
if (!sctp_assoc_add_peer(asoc, &addr, gfp, SCTP_UNCONFIRMED))
|
||||||
|
@@ -2626,15 +2636,13 @@ do_addr_param:
|
||||||
|
addr_param = param.v + sizeof(sctp_addip_param_t);
|
||||||
|
|
||||||
|
af = sctp_get_af_specific(param_type2af(addr_param->p.type));
|
||||||
|
- if (af == NULL)
|
||||||
|
+ if (!af)
|
||||||
|
break;
|
||||||
|
|
||||||
|
- af->from_addr_param(&addr, addr_param,
|
||||||
|
- htons(asoc->peer.port), 0);
|
||||||
|
+ if (!af->from_addr_param(&addr, addr_param,
|
||||||
|
+ htons(asoc->peer.port), 0))
|
||||||
|
+ break;
|
||||||
|
|
||||||
|
- /* if the address is invalid, we can't process it.
|
||||||
|
- * XXX: see spec for what to do.
|
||||||
|
- */
|
||||||
|
if (!af->addr_valid(&addr, NULL, NULL))
|
||||||
|
break;
|
||||||
|
|
||||||
|
@@ -3046,7 +3054,8 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
|
||||||
|
if (unlikely(!af))
|
||||||
|
return SCTP_ERROR_DNS_FAILED;
|
||||||
|
|
||||||
|
- af->from_addr_param(&addr, addr_param, htons(asoc->peer.port), 0);
|
||||||
|
+ if (!af->from_addr_param(&addr, addr_param, htons(asoc->peer.port), 0))
|
||||||
|
+ return SCTP_ERROR_DNS_FAILED;
|
||||||
|
|
||||||
|
/* ADDIP 4.2.1 This parameter MUST NOT contain a broadcast
|
||||||
|
* or multicast address.
|
||||||
|
@@ -3311,7 +3320,8 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
|
||||||
|
|
||||||
|
/* We have checked the packet before, so we do not check again. */
|
||||||
|
af = sctp_get_af_specific(param_type2af(addr_param->p.type));
|
||||||
|
- af->from_addr_param(&addr, addr_param, htons(bp->port), 0);
|
||||||
|
+ if (!af->from_addr_param(&addr, addr_param, htons(bp->port), 0))
|
||||||
|
+ return;
|
||||||
|
|
||||||
|
switch (asconf_param->param_hdr.type) {
|
||||||
|
case SCTP_PARAM_ADD_IP:
|
||||||
1809
patch/kernel/archive/sun50iw9-4.9/patch-4.9.284-285.patch
Normal file
1809
patch/kernel/archive/sun50iw9-4.9/patch-4.9.284-285.patch
Normal file
File diff suppressed because it is too large
Load Diff
366
patch/kernel/archive/sun50iw9-4.9/patch-4.9.285-286.patch
Normal file
366
patch/kernel/archive/sun50iw9-4.9/patch-4.9.285-286.patch
Normal file
@@ -0,0 +1,366 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 2ed953d8e0f2a..68f2c6f3869e2 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 285
|
||||||
|
+SUBLEVEL = 286
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/sparc/lib/iomap.c b/arch/sparc/lib/iomap.c
|
||||||
|
index c4d42a50ebc06..fa4abbaf27de3 100644
|
||||||
|
--- a/arch/sparc/lib/iomap.c
|
||||||
|
+++ b/arch/sparc/lib/iomap.c
|
||||||
|
@@ -18,8 +18,10 @@ void ioport_unmap(void __iomem *addr)
|
||||||
|
EXPORT_SYMBOL(ioport_map);
|
||||||
|
EXPORT_SYMBOL(ioport_unmap);
|
||||||
|
|
||||||
|
+#ifdef CONFIG_PCI
|
||||||
|
void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
|
||||||
|
{
|
||||||
|
/* nothing to do */
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(pci_iounmap);
|
||||||
|
+#endif
|
||||||
|
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
|
||||||
|
index adbf0486422b8..d3804b215ffa6 100644
|
||||||
|
--- a/drivers/ata/libata-core.c
|
||||||
|
+++ b/drivers/ata/libata-core.c
|
||||||
|
@@ -2157,6 +2157,25 @@ static void ata_dev_config_ncq_non_data(struct ata_device *dev)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+static bool ata_dev_check_adapter(struct ata_device *dev,
|
||||||
|
+ unsigned short vendor_id)
|
||||||
|
+{
|
||||||
|
+ struct pci_dev *pcidev = NULL;
|
||||||
|
+ struct device *parent_dev = NULL;
|
||||||
|
+
|
||||||
|
+ for (parent_dev = dev->tdev.parent; parent_dev != NULL;
|
||||||
|
+ parent_dev = parent_dev->parent) {
|
||||||
|
+ if (dev_is_pci(parent_dev)) {
|
||||||
|
+ pcidev = to_pci_dev(parent_dev);
|
||||||
|
+ if (pcidev->vendor == vendor_id)
|
||||||
|
+ return true;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return false;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int ata_dev_config_ncq(struct ata_device *dev,
|
||||||
|
char *desc, size_t desc_sz)
|
||||||
|
{
|
||||||
|
@@ -2173,6 +2192,13 @@ static int ata_dev_config_ncq(struct ata_device *dev,
|
||||||
|
snprintf(desc, desc_sz, "NCQ (not used)");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (dev->horkage & ATA_HORKAGE_NO_NCQ_ON_ATI &&
|
||||||
|
+ ata_dev_check_adapter(dev, PCI_VENDOR_ID_ATI)) {
|
||||||
|
+ snprintf(desc, desc_sz, "NCQ (not used)");
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (ap->flags & ATA_FLAG_NCQ) {
|
||||||
|
hdepth = min(ap->scsi_host->can_queue, ATA_MAX_QUEUE - 1);
|
||||||
|
dev->flags |= ATA_DFLAG_NCQ;
|
||||||
|
@@ -4448,9 +4474,11 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
|
||||||
|
{ "Samsung SSD 850*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
|
||||||
|
ATA_HORKAGE_ZERO_AFTER_TRIM, },
|
||||||
|
{ "Samsung SSD 860*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
|
||||||
|
- ATA_HORKAGE_ZERO_AFTER_TRIM, },
|
||||||
|
+ ATA_HORKAGE_ZERO_AFTER_TRIM |
|
||||||
|
+ ATA_HORKAGE_NO_NCQ_ON_ATI, },
|
||||||
|
{ "Samsung SSD 870*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
|
||||||
|
- ATA_HORKAGE_ZERO_AFTER_TRIM, },
|
||||||
|
+ ATA_HORKAGE_ZERO_AFTER_TRIM |
|
||||||
|
+ ATA_HORKAGE_NO_NCQ_ON_ATI, },
|
||||||
|
{ "FCCT*M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
|
||||||
|
ATA_HORKAGE_ZERO_AFTER_TRIM, },
|
||||||
|
|
||||||
|
@@ -6734,6 +6762,8 @@ static int __init ata_parse_force_one(char **cur,
|
||||||
|
{ "ncq", .horkage_off = ATA_HORKAGE_NONCQ },
|
||||||
|
{ "noncqtrim", .horkage_on = ATA_HORKAGE_NO_NCQ_TRIM },
|
||||||
|
{ "ncqtrim", .horkage_off = ATA_HORKAGE_NO_NCQ_TRIM },
|
||||||
|
+ { "noncqati", .horkage_on = ATA_HORKAGE_NO_NCQ_ON_ATI },
|
||||||
|
+ { "ncqati", .horkage_off = ATA_HORKAGE_NO_NCQ_ON_ATI },
|
||||||
|
{ "dump_id", .horkage_on = ATA_HORKAGE_DUMP_ID },
|
||||||
|
{ "pio0", .xfer_mask = 1 << (ATA_SHIFT_PIO + 0) },
|
||||||
|
{ "pio1", .xfer_mask = 1 << (ATA_SHIFT_PIO + 1) },
|
||||||
|
diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c
|
||||||
|
index 9c88e6749b9a4..34600b0061bb7 100644
|
||||||
|
--- a/drivers/net/phy/mdio_device.c
|
||||||
|
+++ b/drivers/net/phy/mdio_device.c
|
||||||
|
@@ -135,6 +135,16 @@ static int mdio_remove(struct device *dev)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void mdio_shutdown(struct device *dev)
|
||||||
|
+{
|
||||||
|
+ struct mdio_device *mdiodev = to_mdio_device(dev);
|
||||||
|
+ struct device_driver *drv = mdiodev->dev.driver;
|
||||||
|
+ struct mdio_driver *mdiodrv = to_mdio_driver(drv);
|
||||||
|
+
|
||||||
|
+ if (mdiodrv->shutdown)
|
||||||
|
+ mdiodrv->shutdown(mdiodev);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* mdio_driver_register - register an mdio_driver with the MDIO layer
|
||||||
|
* @new_driver: new mdio_driver to register
|
||||||
|
@@ -149,6 +159,7 @@ int mdio_driver_register(struct mdio_driver *drv)
|
||||||
|
mdiodrv->driver.bus = &mdio_bus_type;
|
||||||
|
mdiodrv->driver.probe = mdio_probe;
|
||||||
|
mdiodrv->driver.remove = mdio_remove;
|
||||||
|
+ mdiodrv->driver.shutdown = mdio_shutdown;
|
||||||
|
|
||||||
|
retval = driver_register(&mdiodrv->driver);
|
||||||
|
if (retval) {
|
||||||
|
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
|
||||||
|
index f7fd8b5a6a8cf..3016869b4afdc 100644
|
||||||
|
--- a/drivers/net/xen-netback/netback.c
|
||||||
|
+++ b/drivers/net/xen-netback/netback.c
|
||||||
|
@@ -492,7 +492,7 @@ check_frags:
|
||||||
|
* the header's copy failed, and they are
|
||||||
|
* sharing a slot, send an error
|
||||||
|
*/
|
||||||
|
- if (i == 0 && sharedslot)
|
||||||
|
+ if (i == 0 && !first_shinfo && sharedslot)
|
||||||
|
xenvif_idx_release(queue, pending_idx,
|
||||||
|
XEN_NETIF_RSP_ERROR);
|
||||||
|
else
|
||||||
|
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
|
||||||
|
index 671bf1e03ee1f..426f1b3aa15e2 100644
|
||||||
|
--- a/drivers/scsi/sd.c
|
||||||
|
+++ b/drivers/scsi/sd.c
|
||||||
|
@@ -3179,15 +3179,16 @@ static int sd_probe(struct device *dev)
|
||||||
|
}
|
||||||
|
|
||||||
|
device_initialize(&sdkp->dev);
|
||||||
|
- sdkp->dev.parent = dev;
|
||||||
|
+ sdkp->dev.parent = get_device(dev);
|
||||||
|
sdkp->dev.class = &sd_disk_class;
|
||||||
|
dev_set_name(&sdkp->dev, "%s", dev_name(dev));
|
||||||
|
|
||||||
|
error = device_add(&sdkp->dev);
|
||||||
|
- if (error)
|
||||||
|
- goto out_free_index;
|
||||||
|
+ if (error) {
|
||||||
|
+ put_device(&sdkp->dev);
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- get_device(dev);
|
||||||
|
dev_set_drvdata(dev, sdkp);
|
||||||
|
|
||||||
|
get_device(&sdkp->dev); /* prevent release before async_schedule */
|
||||||
|
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
|
||||||
|
index 4c40c0786e168..bd32140bdfee5 100644
|
||||||
|
--- a/fs/ext2/balloc.c
|
||||||
|
+++ b/fs/ext2/balloc.c
|
||||||
|
@@ -46,10 +46,9 @@ struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
|
||||||
|
struct ext2_sb_info *sbi = EXT2_SB(sb);
|
||||||
|
|
||||||
|
if (block_group >= sbi->s_groups_count) {
|
||||||
|
- ext2_error (sb, "ext2_get_group_desc",
|
||||||
|
- "block_group >= groups_count - "
|
||||||
|
- "block_group = %d, groups_count = %lu",
|
||||||
|
- block_group, sbi->s_groups_count);
|
||||||
|
+ WARN(1, "block_group >= groups_count - "
|
||||||
|
+ "block_group = %d, groups_count = %lu",
|
||||||
|
+ block_group, sbi->s_groups_count);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
@@ -57,10 +56,9 @@ struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
|
||||||
|
group_desc = block_group >> EXT2_DESC_PER_BLOCK_BITS(sb);
|
||||||
|
offset = block_group & (EXT2_DESC_PER_BLOCK(sb) - 1);
|
||||||
|
if (!sbi->s_group_desc[group_desc]) {
|
||||||
|
- ext2_error (sb, "ext2_get_group_desc",
|
||||||
|
- "Group descriptor not loaded - "
|
||||||
|
- "block_group = %d, group_desc = %lu, desc = %lu",
|
||||||
|
- block_group, group_desc, offset);
|
||||||
|
+ WARN(1, "Group descriptor not loaded - "
|
||||||
|
+ "block_group = %d, group_desc = %lu, desc = %lu",
|
||||||
|
+ block_group, group_desc, offset);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/include/linux/libata.h b/include/linux/libata.h
|
||||||
|
index 3fabf57fd6e0d..de770d11a5c18 100644
|
||||||
|
--- a/include/linux/libata.h
|
||||||
|
+++ b/include/linux/libata.h
|
||||||
|
@@ -436,6 +436,7 @@ enum {
|
||||||
|
ATA_HORKAGE_NOTRIM = (1 << 24), /* don't use TRIM */
|
||||||
|
ATA_HORKAGE_MAX_SEC_1024 = (1 << 25), /* Limit max sects to 1024 */
|
||||||
|
ATA_HORKAGE_MAX_TRIM_128M = (1 << 26), /* Limit max trim size to 128M */
|
||||||
|
+ ATA_HORKAGE_NO_NCQ_ON_ATI = (1 << 27), /* Disable NCQ on ATI chipset */
|
||||||
|
|
||||||
|
/* DMA mask for user DMA control: User visible values; DO NOT
|
||||||
|
renumber */
|
||||||
|
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
|
||||||
|
index bf9d1d7506935..78b3cf50566f5 100644
|
||||||
|
--- a/include/linux/mdio.h
|
||||||
|
+++ b/include/linux/mdio.h
|
||||||
|
@@ -61,6 +61,9 @@ struct mdio_driver {
|
||||||
|
|
||||||
|
/* Clears up any memory if needed */
|
||||||
|
void (*remove)(struct mdio_device *mdiodev);
|
||||||
|
+
|
||||||
|
+ /* Quiesces the device on system shutdown, turns off interrupts etc */
|
||||||
|
+ void (*shutdown)(struct mdio_device *mdiodev);
|
||||||
|
};
|
||||||
|
#define to_mdio_driver(d) \
|
||||||
|
container_of(to_mdio_common_driver(d), struct mdio_driver, mdiodrv)
|
||||||
|
diff --git a/include/net/sock.h b/include/net/sock.h
|
||||||
|
index cf27f3688c39c..78c292f15ffc1 100644
|
||||||
|
--- a/include/net/sock.h
|
||||||
|
+++ b/include/net/sock.h
|
||||||
|
@@ -420,9 +420,11 @@ struct sock {
|
||||||
|
u32 sk_max_ack_backlog;
|
||||||
|
__u32 sk_priority;
|
||||||
|
__u32 sk_mark;
|
||||||
|
+ spinlock_t sk_peer_lock;
|
||||||
|
kuid_t sk_uid;
|
||||||
|
struct pid *sk_peer_pid;
|
||||||
|
const struct cred *sk_peer_cred;
|
||||||
|
+
|
||||||
|
long sk_rcvtimeo;
|
||||||
|
long sk_sndtimeo;
|
||||||
|
struct timer_list sk_timer;
|
||||||
|
diff --git a/net/core/sock.c b/net/core/sock.c
|
||||||
|
index d468ffb5a31c6..1845a37d9f7e1 100644
|
||||||
|
--- a/net/core/sock.c
|
||||||
|
+++ b/net/core/sock.c
|
||||||
|
@@ -1011,7 +1011,6 @@ set_rcvbuf:
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(sock_setsockopt);
|
||||||
|
|
||||||
|
-
|
||||||
|
static void cred_to_ucred(struct pid *pid, const struct cred *cred,
|
||||||
|
struct ucred *ucred)
|
||||||
|
{
|
||||||
|
@@ -1171,7 +1170,11 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
|
||||||
|
struct ucred peercred;
|
||||||
|
if (len > sizeof(peercred))
|
||||||
|
len = sizeof(peercred);
|
||||||
|
+
|
||||||
|
+ spin_lock(&sk->sk_peer_lock);
|
||||||
|
cred_to_ucred(sk->sk_peer_pid, sk->sk_peer_cred, &peercred);
|
||||||
|
+ spin_unlock(&sk->sk_peer_lock);
|
||||||
|
+
|
||||||
|
if (copy_to_user(optval, &peercred, len))
|
||||||
|
return -EFAULT;
|
||||||
|
goto lenout;
|
||||||
|
@@ -1439,9 +1442,10 @@ static void __sk_destruct(struct rcu_head *head)
|
||||||
|
sk->sk_frag.page = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (sk->sk_peer_cred)
|
||||||
|
- put_cred(sk->sk_peer_cred);
|
||||||
|
+ /* We do not need to acquire sk->sk_peer_lock, we are the last user. */
|
||||||
|
+ put_cred(sk->sk_peer_cred);
|
||||||
|
put_pid(sk->sk_peer_pid);
|
||||||
|
+
|
||||||
|
if (likely(sk->sk_net_refcnt))
|
||||||
|
put_net(sock_net(sk));
|
||||||
|
sk_prot_free(sk->sk_prot_creator, sk);
|
||||||
|
@@ -2490,6 +2494,8 @@ void sock_init_data(struct socket *sock, struct sock *sk)
|
||||||
|
|
||||||
|
sk->sk_peer_pid = NULL;
|
||||||
|
sk->sk_peer_cred = NULL;
|
||||||
|
+ spin_lock_init(&sk->sk_peer_lock);
|
||||||
|
+
|
||||||
|
sk->sk_write_pending = 0;
|
||||||
|
sk->sk_rcvlowat = 1;
|
||||||
|
sk->sk_rcvtimeo = MAX_SCHEDULE_TIMEOUT;
|
||||||
|
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
|
||||||
|
index 2c643e1919aab..e7e012933714f 100644
|
||||||
|
--- a/net/unix/af_unix.c
|
||||||
|
+++ b/net/unix/af_unix.c
|
||||||
|
@@ -594,20 +594,42 @@ static void unix_release_sock(struct sock *sk, int embrion)
|
||||||
|
|
||||||
|
static void init_peercred(struct sock *sk)
|
||||||
|
{
|
||||||
|
- put_pid(sk->sk_peer_pid);
|
||||||
|
- if (sk->sk_peer_cred)
|
||||||
|
- put_cred(sk->sk_peer_cred);
|
||||||
|
+ const struct cred *old_cred;
|
||||||
|
+ struct pid *old_pid;
|
||||||
|
+
|
||||||
|
+ spin_lock(&sk->sk_peer_lock);
|
||||||
|
+ old_pid = sk->sk_peer_pid;
|
||||||
|
+ old_cred = sk->sk_peer_cred;
|
||||||
|
sk->sk_peer_pid = get_pid(task_tgid(current));
|
||||||
|
sk->sk_peer_cred = get_current_cred();
|
||||||
|
+ spin_unlock(&sk->sk_peer_lock);
|
||||||
|
+
|
||||||
|
+ put_pid(old_pid);
|
||||||
|
+ put_cred(old_cred);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void copy_peercred(struct sock *sk, struct sock *peersk)
|
||||||
|
{
|
||||||
|
- put_pid(sk->sk_peer_pid);
|
||||||
|
- if (sk->sk_peer_cred)
|
||||||
|
- put_cred(sk->sk_peer_cred);
|
||||||
|
+ const struct cred *old_cred;
|
||||||
|
+ struct pid *old_pid;
|
||||||
|
+
|
||||||
|
+ if (sk < peersk) {
|
||||||
|
+ spin_lock(&sk->sk_peer_lock);
|
||||||
|
+ spin_lock_nested(&peersk->sk_peer_lock, SINGLE_DEPTH_NESTING);
|
||||||
|
+ } else {
|
||||||
|
+ spin_lock(&peersk->sk_peer_lock);
|
||||||
|
+ spin_lock_nested(&sk->sk_peer_lock, SINGLE_DEPTH_NESTING);
|
||||||
|
+ }
|
||||||
|
+ old_pid = sk->sk_peer_pid;
|
||||||
|
+ old_cred = sk->sk_peer_cred;
|
||||||
|
sk->sk_peer_pid = get_pid(peersk->sk_peer_pid);
|
||||||
|
sk->sk_peer_cred = get_cred(peersk->sk_peer_cred);
|
||||||
|
+
|
||||||
|
+ spin_unlock(&sk->sk_peer_lock);
|
||||||
|
+ spin_unlock(&peersk->sk_peer_lock);
|
||||||
|
+
|
||||||
|
+ put_pid(old_pid);
|
||||||
|
+ put_cred(old_cred);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int unix_listen(struct socket *sock, int backlog)
|
||||||
|
diff --git a/tools/usb/testusb.c b/tools/usb/testusb.c
|
||||||
|
index 0692d99b6d8f3..18c895654e767 100644
|
||||||
|
--- a/tools/usb/testusb.c
|
||||||
|
+++ b/tools/usb/testusb.c
|
||||||
|
@@ -278,12 +278,6 @@ nomem:
|
||||||
|
}
|
||||||
|
|
||||||
|
entry->ifnum = ifnum;
|
||||||
|
-
|
||||||
|
- /* FIXME update USBDEVFS_CONNECTINFO so it tells about high speed etc */
|
||||||
|
-
|
||||||
|
- fprintf(stderr, "%s speed\t%s\t%u\n",
|
||||||
|
- speed(entry->speed), entry->name, entry->ifnum);
|
||||||
|
-
|
||||||
|
entry->next = testdevs;
|
||||||
|
testdevs = entry;
|
||||||
|
return 0;
|
||||||
|
@@ -312,6 +306,14 @@ static void *handle_testdev (void *arg)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ status = ioctl(fd, USBDEVFS_GET_SPEED, NULL);
|
||||||
|
+ if (status < 0)
|
||||||
|
+ fprintf(stderr, "USBDEVFS_GET_SPEED failed %d\n", status);
|
||||||
|
+ else
|
||||||
|
+ dev->speed = status;
|
||||||
|
+ fprintf(stderr, "%s speed\t%s\t%u\n",
|
||||||
|
+ speed(dev->speed), dev->name, dev->ifnum);
|
||||||
|
+
|
||||||
|
restart:
|
||||||
|
for (i = 0; i < TEST_CASES; i++) {
|
||||||
|
if (dev->test != -1 && dev->test != i)
|
||||||
543
patch/kernel/archive/sun50iw9-4.9/patch-4.9.286-287.patch
Normal file
543
patch/kernel/archive/sun50iw9-4.9/patch-4.9.286-287.patch
Normal file
@@ -0,0 +1,543 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 68f2c6f3869e2..76eff0f592346 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 286
|
||||||
|
+SUBLEVEL = 287
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arm/boot/dts/omap3430-sdp.dts b/arch/arm/boot/dts/omap3430-sdp.dts
|
||||||
|
index abd6921143beb..e0ba97bd41b79 100644
|
||||||
|
--- a/arch/arm/boot/dts/omap3430-sdp.dts
|
||||||
|
+++ b/arch/arm/boot/dts/omap3430-sdp.dts
|
||||||
|
@@ -104,7 +104,7 @@
|
||||||
|
|
||||||
|
nand@1,0 {
|
||||||
|
compatible = "ti,omap2-nand";
|
||||||
|
- reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
|
||||||
|
+ reg = <1 0 4>; /* CS1, offset 0, IO size 4 */
|
||||||
|
interrupt-parent = <&gpmc>;
|
||||||
|
interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
|
||||||
|
<1 IRQ_TYPE_NONE>; /* termcount */
|
||||||
|
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
|
||||||
|
index 6da26692f2fde..950c9f2ffe005 100644
|
||||||
|
--- a/arch/arm/mach-imx/pm-imx6.c
|
||||||
|
+++ b/arch/arm/mach-imx/pm-imx6.c
|
||||||
|
@@ -15,6 +15,7 @@
|
||||||
|
#include <linux/io.h>
|
||||||
|
#include <linux/irq.h>
|
||||||
|
#include <linux/genalloc.h>
|
||||||
|
+#include <linux/irqchip/arm-gic.h>
|
||||||
|
#include <linux/mfd/syscon.h>
|
||||||
|
#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
|
||||||
|
#include <linux/of.h>
|
||||||
|
@@ -606,6 +607,7 @@ static void __init imx6_pm_common_init(const struct imx6_pm_socdata
|
||||||
|
|
||||||
|
static void imx6_pm_stby_poweroff(void)
|
||||||
|
{
|
||||||
|
+ gic_cpu_if_down(0);
|
||||||
|
imx6_set_lpm(STOP_POWER_OFF);
|
||||||
|
imx6q_suspend_finish(0);
|
||||||
|
|
||||||
|
diff --git a/arch/powerpc/boot/dts/fsl/t1023rdb.dts b/arch/powerpc/boot/dts/fsl/t1023rdb.dts
|
||||||
|
index 29757623e5baf..f5f8f969dd586 100644
|
||||||
|
--- a/arch/powerpc/boot/dts/fsl/t1023rdb.dts
|
||||||
|
+++ b/arch/powerpc/boot/dts/fsl/t1023rdb.dts
|
||||||
|
@@ -125,7 +125,7 @@
|
||||||
|
|
||||||
|
fm1mac3: ethernet@e4000 {
|
||||||
|
phy-handle = <&sgmii_aqr_phy3>;
|
||||||
|
- phy-connection-type = "sgmii-2500";
|
||||||
|
+ phy-connection-type = "2500base-x";
|
||||||
|
sleep = <&rcpm 0x20000000>;
|
||||||
|
};
|
||||||
|
|
||||||
|
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
|
||||||
|
index c26cca506f646..c20df6a3540c2 100644
|
||||||
|
--- a/arch/x86/events/core.c
|
||||||
|
+++ b/arch/x86/events/core.c
|
||||||
|
@@ -2075,6 +2075,7 @@ static int x86_pmu_event_init(struct perf_event *event)
|
||||||
|
if (err) {
|
||||||
|
if (event->destroy)
|
||||||
|
event->destroy(event);
|
||||||
|
+ event->destroy = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ACCESS_ONCE(x86_pmu.attr_rdpmc))
|
||||||
|
diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c
|
||||||
|
index 441694464b1e4..fbbc24b914e30 100644
|
||||||
|
--- a/arch/xtensa/kernel/irq.c
|
||||||
|
+++ b/arch/xtensa/kernel/irq.c
|
||||||
|
@@ -144,7 +144,7 @@ unsigned xtensa_get_ext_irq_no(unsigned irq)
|
||||||
|
|
||||||
|
void __init init_IRQ(void)
|
||||||
|
{
|
||||||
|
-#ifdef CONFIG_OF
|
||||||
|
+#ifdef CONFIG_USE_OF
|
||||||
|
irqchip_init();
|
||||||
|
#else
|
||||||
|
#ifdef CONFIG_HAVE_SMP
|
||||||
|
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
|
||||||
|
index 411c12cdb2499..bb516eb124213 100644
|
||||||
|
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
|
||||||
|
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
|
||||||
|
@@ -178,6 +178,7 @@ static const struct file_operations nouveau_pstate_fops = {
|
||||||
|
.open = nouveau_debugfs_pstate_open,
|
||||||
|
.read = seq_read,
|
||||||
|
.write = nouveau_debugfs_pstate_set,
|
||||||
|
+ .release = single_release,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct drm_info_list nouveau_debugfs_list[] = {
|
||||||
|
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
|
||||||
|
index 959a9e38b4f54..149902619cbc8 100644
|
||||||
|
--- a/drivers/hid/hid-apple.c
|
||||||
|
+++ b/drivers/hid/hid-apple.c
|
||||||
|
@@ -302,12 +302,19 @@ static int apple_event(struct hid_device *hdev, struct hid_field *field,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MacBook JIS keyboard has wrong logical maximum
|
||||||
|
+ * Magic Keyboard JIS has wrong logical maximum
|
||||||
|
*/
|
||||||
|
static __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||||
|
unsigned int *rsize)
|
||||||
|
{
|
||||||
|
struct apple_sc *asc = hid_get_drvdata(hdev);
|
||||||
|
|
||||||
|
+ if(*rsize >=71 && rdesc[70] == 0x65 && rdesc[64] == 0x65) {
|
||||||
|
+ hid_info(hdev,
|
||||||
|
+ "fixing up Magic Keyboard JIS report descriptor\n");
|
||||||
|
+ rdesc[64] = rdesc[70] = 0xe7;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if ((asc->quirks & APPLE_RDESC_JIS) && *rsize >= 60 &&
|
||||||
|
rdesc[53] == 0x65 && rdesc[59] == 0x65) {
|
||||||
|
hid_info(hdev,
|
||||||
|
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
|
||||||
|
index 832fffed4a1fa..e7585f6c4665b 100644
|
||||||
|
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
|
||||||
|
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
|
||||||
|
@@ -6646,7 +6646,7 @@ static int i40e_get_capabilities(struct i40e_pf *pf)
|
||||||
|
if (pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOMEM) {
|
||||||
|
/* retry with a larger buffer */
|
||||||
|
buf_len = data_size;
|
||||||
|
- } else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK) {
|
||||||
|
+ } else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK || err) {
|
||||||
|
dev_info(&pf->pdev->dev,
|
||||||
|
"capability discovery failed, err %s aq_err %s\n",
|
||||||
|
i40e_stat_str(&pf->hw, err),
|
||||||
|
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
|
||||||
|
index 8cc7563ab103b..92fb664b56fbb 100644
|
||||||
|
--- a/drivers/net/phy/mdio_bus.c
|
||||||
|
+++ b/drivers/net/phy/mdio_bus.c
|
||||||
|
@@ -316,6 +316,13 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
|
||||||
|
bus->dev.groups = NULL;
|
||||||
|
dev_set_name(&bus->dev, "%s", bus->id);
|
||||||
|
|
||||||
|
+ /* We need to set state to MDIOBUS_UNREGISTERED to correctly release
|
||||||
|
+ * the device in mdiobus_free()
|
||||||
|
+ *
|
||||||
|
+ * State will be updated later in this function in case of success
|
||||||
|
+ */
|
||||||
|
+ bus->state = MDIOBUS_UNREGISTERED;
|
||||||
|
+
|
||||||
|
err = device_register(&bus->dev);
|
||||||
|
if (err) {
|
||||||
|
pr_err("mii_bus %s failed to register\n", bus->id);
|
||||||
|
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
|
||||||
|
index 3aa22ae4d94c0..a911325fc0b4f 100644
|
||||||
|
--- a/drivers/ptp/ptp_pch.c
|
||||||
|
+++ b/drivers/ptp/ptp_pch.c
|
||||||
|
@@ -698,6 +698,7 @@ static const struct pci_device_id pch_ieee1588_pcidev_id[] = {
|
||||||
|
},
|
||||||
|
{0}
|
||||||
|
};
|
||||||
|
+MODULE_DEVICE_TABLE(pci, pch_ieee1588_pcidev_id);
|
||||||
|
|
||||||
|
static struct pci_driver pch_driver = {
|
||||||
|
.name = KBUILD_MODNAME,
|
||||||
|
diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
|
||||||
|
index 69046d342bc5d..39396548f9b55 100644
|
||||||
|
--- a/drivers/scsi/ses.c
|
||||||
|
+++ b/drivers/scsi/ses.c
|
||||||
|
@@ -120,7 +120,7 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code,
|
||||||
|
static int ses_send_diag(struct scsi_device *sdev, int page_code,
|
||||||
|
void *buf, int bufflen)
|
||||||
|
{
|
||||||
|
- u32 result;
|
||||||
|
+ int result;
|
||||||
|
|
||||||
|
unsigned char cmd[] = {
|
||||||
|
SEND_DIAGNOSTIC,
|
||||||
|
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
|
||||||
|
index 7ba0031d3a738..d5575869a25c7 100644
|
||||||
|
--- a/drivers/scsi/virtio_scsi.c
|
||||||
|
+++ b/drivers/scsi/virtio_scsi.c
|
||||||
|
@@ -343,7 +343,7 @@ static void virtscsi_handle_transport_reset(struct virtio_scsi *vscsi,
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
- pr_info("Unsupport virtio scsi event reason %x\n", event->reason);
|
||||||
|
+ pr_info("Unsupported virtio scsi event reason %x\n", event->reason);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -396,7 +396,7 @@ static void virtscsi_handle_event(struct work_struct *work)
|
||||||
|
virtscsi_handle_param_change(vscsi, event);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
- pr_err("Unsupport virtio scsi event %x\n", event->event);
|
||||||
|
+ pr_err("Unsupported virtio scsi event %x\n", event->event);
|
||||||
|
}
|
||||||
|
virtscsi_kick_event(vscsi, event_node);
|
||||||
|
}
|
||||||
|
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
|
||||||
|
index 0103f777b97ad..bff5a15e59c00 100644
|
||||||
|
--- a/drivers/usb/Kconfig
|
||||||
|
+++ b/drivers/usb/Kconfig
|
||||||
|
@@ -160,8 +160,7 @@ source "drivers/usb/gadget/Kconfig"
|
||||||
|
|
||||||
|
config USB_LED_TRIG
|
||||||
|
bool "USB LED Triggers"
|
||||||
|
- depends on LEDS_CLASS && LEDS_TRIGGERS
|
||||||
|
- select USB_COMMON
|
||||||
|
+ depends on LEDS_CLASS && USB_COMMON && LEDS_TRIGGERS
|
||||||
|
help
|
||||||
|
This option adds LED triggers for USB host and/or gadget activity.
|
||||||
|
|
||||||
|
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
|
||||||
|
index 23df1549eb0d8..b7b83ca83ba0d 100644
|
||||||
|
--- a/drivers/usb/class/cdc-acm.c
|
||||||
|
+++ b/drivers/usb/class/cdc-acm.c
|
||||||
|
@@ -349,6 +349,9 @@ static void acm_ctrl_irq(struct urb *urb)
|
||||||
|
acm->iocount.overrun++;
|
||||||
|
spin_unlock(&acm->read_lock);
|
||||||
|
|
||||||
|
+ if (newctrl & ACM_CTRL_BRK)
|
||||||
|
+ tty_flip_buffer_push(&acm->port);
|
||||||
|
+
|
||||||
|
if (difference)
|
||||||
|
wake_up_all(&acm->wioctl);
|
||||||
|
|
||||||
|
@@ -408,11 +411,16 @@ static int acm_submit_read_urbs(struct acm *acm, gfp_t mem_flags)
|
||||||
|
|
||||||
|
static void acm_process_read_urb(struct acm *acm, struct urb *urb)
|
||||||
|
{
|
||||||
|
+ unsigned long flags;
|
||||||
|
+
|
||||||
|
if (!urb->actual_length)
|
||||||
|
return;
|
||||||
|
|
||||||
|
+ spin_lock_irqsave(&acm->read_lock, flags);
|
||||||
|
tty_insert_flip_string(&acm->port, urb->transfer_buffer,
|
||||||
|
urb->actual_length);
|
||||||
|
+ spin_unlock_irqrestore(&acm->read_lock, flags);
|
||||||
|
+
|
||||||
|
tty_flip_buffer_push(&acm->port);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
|
||||||
|
index b16a6c0363527..dc51011d670df 100644
|
||||||
|
--- a/fs/nfsd/nfs4xdr.c
|
||||||
|
+++ b/fs/nfsd/nfs4xdr.c
|
||||||
|
@@ -3028,15 +3028,18 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
|
||||||
|
goto fail;
|
||||||
|
cd->rd_maxcount -= entry_bytes;
|
||||||
|
/*
|
||||||
|
- * RFC 3530 14.2.24 describes rd_dircount as only a "hint", so
|
||||||
|
- * let's always let through the first entry, at least:
|
||||||
|
+ * RFC 3530 14.2.24 describes rd_dircount as only a "hint", and
|
||||||
|
+ * notes that it could be zero. If it is zero, then the server
|
||||||
|
+ * should enforce only the rd_maxcount value.
|
||||||
|
*/
|
||||||
|
- if (!cd->rd_dircount)
|
||||||
|
- goto fail;
|
||||||
|
- name_and_cookie = 4 + 4 * XDR_QUADLEN(namlen) + 8;
|
||||||
|
- if (name_and_cookie > cd->rd_dircount && cd->cookie_offset)
|
||||||
|
- goto fail;
|
||||||
|
- cd->rd_dircount -= min(cd->rd_dircount, name_and_cookie);
|
||||||
|
+ if (cd->rd_dircount) {
|
||||||
|
+ name_and_cookie = 4 + 4 * XDR_QUADLEN(namlen) + 8;
|
||||||
|
+ if (name_and_cookie > cd->rd_dircount && cd->cookie_offset)
|
||||||
|
+ goto fail;
|
||||||
|
+ cd->rd_dircount -= min(cd->rd_dircount, name_and_cookie);
|
||||||
|
+ if (!cd->rd_dircount)
|
||||||
|
+ cd->rd_maxcount = 0;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
cd->cookie_offset = cookie_offset;
|
||||||
|
skip_entry:
|
||||||
|
diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
|
||||||
|
index 8546384a5fdfd..edd5979aca4f6 100644
|
||||||
|
--- a/fs/overlayfs/dir.c
|
||||||
|
+++ b/fs/overlayfs/dir.c
|
||||||
|
@@ -926,9 +926,13 @@ static int ovl_rename2(struct inode *olddir, struct dentry *old,
|
||||||
|
goto out_dput;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
- if (!d_is_negative(newdentry) &&
|
||||||
|
- (!new_opaque || !ovl_is_whiteout(newdentry)))
|
||||||
|
- goto out_dput;
|
||||||
|
+ if (!d_is_negative(newdentry)) {
|
||||||
|
+ if (!new_opaque || !ovl_is_whiteout(newdentry))
|
||||||
|
+ goto out_dput;
|
||||||
|
+ } else {
|
||||||
|
+ if (flags & RENAME_EXCHANGE)
|
||||||
|
+ goto out_dput;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (olddentry == trap)
|
||||||
|
diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
|
||||||
|
index 2fdf6f96f9762..6f09728cd1dd3 100644
|
||||||
|
--- a/kernel/bpf/stackmap.c
|
||||||
|
+++ b/kernel/bpf/stackmap.c
|
||||||
|
@@ -28,7 +28,8 @@ struct bpf_stack_map {
|
||||||
|
|
||||||
|
static int prealloc_elems_and_freelist(struct bpf_stack_map *smap)
|
||||||
|
{
|
||||||
|
- u32 elem_size = sizeof(struct stack_map_bucket) + smap->map.value_size;
|
||||||
|
+ u64 elem_size = sizeof(struct stack_map_bucket) +
|
||||||
|
+ (u64)smap->map.value_size;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
smap->elems = bpf_map_area_alloc(elem_size * smap->map.max_entries);
|
||||||
|
diff --git a/mm/gup.c b/mm/gup.c
|
||||||
|
index 6bb7a8eb7f820..301dd96ef176c 100644
|
||||||
|
--- a/mm/gup.c
|
||||||
|
+++ b/mm/gup.c
|
||||||
|
@@ -61,13 +61,22 @@ static int follow_pfn_pte(struct vm_area_struct *vma, unsigned long address,
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
- * FOLL_FORCE can write to even unwritable pte's, but only
|
||||||
|
- * after we've gone through a COW cycle and they are dirty.
|
||||||
|
+ * FOLL_FORCE or a forced COW break can write even to unwritable pte's,
|
||||||
|
+ * but only after we've gone through a COW cycle and they are dirty.
|
||||||
|
*/
|
||||||
|
static inline bool can_follow_write_pte(pte_t pte, unsigned int flags)
|
||||||
|
{
|
||||||
|
- return pte_write(pte) ||
|
||||||
|
- ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte));
|
||||||
|
+ return pte_write(pte) || ((flags & FOLL_COW) && pte_dirty(pte));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * A (separate) COW fault might break the page the other way and
|
||||||
|
+ * get_user_pages() would return the page from what is now the wrong
|
||||||
|
+ * VM. So we need to force a COW break at GUP time even for reads.
|
||||||
|
+ */
|
||||||
|
+static inline bool should_force_cow_break(struct vm_area_struct *vma, unsigned int flags)
|
||||||
|
+{
|
||||||
|
+ return is_cow_mapping(vma->vm_flags) && (flags & FOLL_GET);
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct page *follow_page_pte(struct vm_area_struct *vma,
|
||||||
|
@@ -577,12 +586,18 @@ static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
|
||||||
|
if (!vma || check_vma_flags(vma, gup_flags))
|
||||||
|
return i ? : -EFAULT;
|
||||||
|
if (is_vm_hugetlb_page(vma)) {
|
||||||
|
+ if (should_force_cow_break(vma, foll_flags))
|
||||||
|
+ foll_flags |= FOLL_WRITE;
|
||||||
|
i = follow_hugetlb_page(mm, vma, pages, vmas,
|
||||||
|
&start, &nr_pages, i,
|
||||||
|
- gup_flags);
|
||||||
|
+ foll_flags);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (should_force_cow_break(vma, foll_flags))
|
||||||
|
+ foll_flags |= FOLL_WRITE;
|
||||||
|
+
|
||||||
|
retry:
|
||||||
|
/*
|
||||||
|
* If we have a pending SIGKILL, don't keep faulting pages and
|
||||||
|
@@ -1503,6 +1518,10 @@ static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end,
|
||||||
|
/*
|
||||||
|
* Like get_user_pages_fast() except it's IRQ-safe in that it won't fall back to
|
||||||
|
* the regular GUP. It will only return non-negative values.
|
||||||
|
+ *
|
||||||
|
+ * Careful, careful! COW breaking can go either way, so a non-write
|
||||||
|
+ * access can get ambiguous page results. If you call this function without
|
||||||
|
+ * 'write' set, you'd better be sure that you're ok with that ambiguity.
|
||||||
|
*/
|
||||||
|
int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
|
||||||
|
struct page **pages)
|
||||||
|
@@ -1532,6 +1551,12 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
|
||||||
|
*
|
||||||
|
* We do not adopt an rcu_read_lock(.) here as we also want to
|
||||||
|
* block IPIs that come from THPs splitting.
|
||||||
|
+ *
|
||||||
|
+ * NOTE! We allow read-only gup_fast() here, but you'd better be
|
||||||
|
+ * careful about possible COW pages. You'll get _a_ COW page, but
|
||||||
|
+ * not necessarily the one you intended to get depending on what
|
||||||
|
+ * COW event happens after this. COW may break the page copy in a
|
||||||
|
+ * random direction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
local_irq_save(flags);
|
||||||
|
@@ -1542,15 +1567,22 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
|
||||||
|
next = pgd_addr_end(addr, end);
|
||||||
|
if (pgd_none(pgd))
|
||||||
|
break;
|
||||||
|
+ /*
|
||||||
|
+ * The FAST_GUP case requires FOLL_WRITE even for pure reads,
|
||||||
|
+ * because get_user_pages() may need to cause an early COW in
|
||||||
|
+ * order to avoid confusing the normal COW routines. So only
|
||||||
|
+ * targets that are already writable are safe to do by just
|
||||||
|
+ * looking at the page tables.
|
||||||
|
+ */
|
||||||
|
if (unlikely(pgd_huge(pgd))) {
|
||||||
|
- if (!gup_huge_pgd(pgd, pgdp, addr, next, write,
|
||||||
|
+ if (!gup_huge_pgd(pgd, pgdp, addr, next, 1,
|
||||||
|
pages, &nr))
|
||||||
|
break;
|
||||||
|
} else if (unlikely(is_hugepd(__hugepd(pgd_val(pgd))))) {
|
||||||
|
if (!gup_huge_pd(__hugepd(pgd_val(pgd)), addr,
|
||||||
|
- PGDIR_SHIFT, next, write, pages, &nr))
|
||||||
|
+ PGDIR_SHIFT, next, 1, pages, &nr))
|
||||||
|
break;
|
||||||
|
- } else if (!gup_pud_range(pgd, addr, next, write, pages, &nr))
|
||||||
|
+ } else if (!gup_pud_range(pgd, addr, next, 1, pages, &nr))
|
||||||
|
break;
|
||||||
|
} while (pgdp++, addr = next, addr != end);
|
||||||
|
local_irq_restore(flags);
|
||||||
|
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
|
||||||
|
index 91f33bb43f178..3f3a86cc62b68 100644
|
||||||
|
--- a/mm/huge_memory.c
|
||||||
|
+++ b/mm/huge_memory.c
|
||||||
|
@@ -1135,13 +1135,12 @@ out_unlock:
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
- * FOLL_FORCE can write to even unwritable pmd's, but only
|
||||||
|
- * after we've gone through a COW cycle and they are dirty.
|
||||||
|
+ * FOLL_FORCE or a forced COW break can write even to unwritable pmd's,
|
||||||
|
+ * but only after we've gone through a COW cycle and they are dirty.
|
||||||
|
*/
|
||||||
|
static inline bool can_follow_write_pmd(pmd_t pmd, unsigned int flags)
|
||||||
|
{
|
||||||
|
- return pmd_write(pmd) ||
|
||||||
|
- ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pmd_dirty(pmd));
|
||||||
|
+ return pmd_write(pmd) || ((flags & FOLL_COW) && pmd_dirty(pmd));
|
||||||
|
}
|
||||||
|
|
||||||
|
struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
|
||||||
|
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
|
||||||
|
index 4f831225d34f4..ca8757090ae35 100644
|
||||||
|
--- a/net/bridge/br_netlink.c
|
||||||
|
+++ b/net/bridge/br_netlink.c
|
||||||
|
@@ -1298,7 +1298,7 @@ static size_t br_get_linkxstats_size(const struct net_device *dev, int attr)
|
||||||
|
}
|
||||||
|
|
||||||
|
return numvls * nla_total_size(sizeof(struct bridge_vlan_xstats)) +
|
||||||
|
- nla_total_size(sizeof(struct br_mcast_stats)) +
|
||||||
|
+ nla_total_size_64bit(sizeof(struct br_mcast_stats)) +
|
||||||
|
nla_total_size(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
|
||||||
|
index 911752e8a3e64..012143f313a87 100644
|
||||||
|
--- a/net/core/rtnetlink.c
|
||||||
|
+++ b/net/core/rtnetlink.c
|
||||||
|
@@ -3900,7 +3900,7 @@ nla_put_failure:
|
||||||
|
static size_t if_nlmsg_stats_size(const struct net_device *dev,
|
||||||
|
u32 filter_mask)
|
||||||
|
{
|
||||||
|
- size_t size = 0;
|
||||||
|
+ size_t size = NLMSG_ALIGN(sizeof(struct if_stats_msg));
|
||||||
|
|
||||||
|
if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_64, 0))
|
||||||
|
size += nla_total_size_64bit(sizeof(struct rtnl_link_stats64));
|
||||||
|
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
|
||||||
|
index 579fda1bc45df..ce54e66b47a03 100644
|
||||||
|
--- a/net/ipv6/netfilter/ip6_tables.c
|
||||||
|
+++ b/net/ipv6/netfilter/ip6_tables.c
|
||||||
|
@@ -290,6 +290,7 @@ ip6t_do_table(struct sk_buff *skb,
|
||||||
|
* things we don't know, ie. tcp syn flag or ports). If the
|
||||||
|
* rule is also a fragment-specific rule, non-fragments won't
|
||||||
|
* match it. */
|
||||||
|
+ acpar.fragoff = 0;
|
||||||
|
acpar.hotdrop = false;
|
||||||
|
acpar.net = state->net;
|
||||||
|
acpar.in = state->in;
|
||||||
|
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
|
||||||
|
index b40e71a5d7957..3dc370ad23bf6 100644
|
||||||
|
--- a/net/mac80211/rx.c
|
||||||
|
+++ b/net/mac80211/rx.c
|
||||||
|
@@ -3692,7 +3692,8 @@ static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx)
|
||||||
|
if (!bssid)
|
||||||
|
return false;
|
||||||
|
if (ether_addr_equal(sdata->vif.addr, hdr->addr2) ||
|
||||||
|
- ether_addr_equal(sdata->u.ibss.bssid, hdr->addr2))
|
||||||
|
+ ether_addr_equal(sdata->u.ibss.bssid, hdr->addr2) ||
|
||||||
|
+ !is_valid_ether_addr(hdr->addr2))
|
||||||
|
return false;
|
||||||
|
if (ieee80211_is_beacon(hdr->frame_control))
|
||||||
|
return true;
|
||||||
|
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
|
||||||
|
index 453b0efdc0d71..1b70de5898c42 100644
|
||||||
|
--- a/net/netlink/af_netlink.c
|
||||||
|
+++ b/net/netlink/af_netlink.c
|
||||||
|
@@ -574,7 +574,10 @@ static int netlink_insert(struct sock *sk, u32 portid)
|
||||||
|
|
||||||
|
/* We need to ensure that the socket is hashed and visible. */
|
||||||
|
smp_wmb();
|
||||||
|
- nlk_sk(sk)->bound = portid;
|
||||||
|
+ /* Paired with lockless reads from netlink_bind(),
|
||||||
|
+ * netlink_connect() and netlink_sendmsg().
|
||||||
|
+ */
|
||||||
|
+ WRITE_ONCE(nlk_sk(sk)->bound, portid);
|
||||||
|
|
||||||
|
err:
|
||||||
|
release_sock(sk);
|
||||||
|
@@ -993,7 +996,8 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr,
|
||||||
|
else if (nlk->ngroups < 8*sizeof(groups))
|
||||||
|
groups &= (1UL << nlk->ngroups) - 1;
|
||||||
|
|
||||||
|
- bound = nlk->bound;
|
||||||
|
+ /* Paired with WRITE_ONCE() in netlink_insert() */
|
||||||
|
+ bound = READ_ONCE(nlk->bound);
|
||||||
|
if (bound) {
|
||||||
|
/* Ensure nlk->portid is up-to-date. */
|
||||||
|
smp_rmb();
|
||||||
|
@@ -1073,8 +1077,9 @@ static int netlink_connect(struct socket *sock, struct sockaddr *addr,
|
||||||
|
|
||||||
|
/* No need for barriers here as we return to user-space without
|
||||||
|
* using any of the bound attributes.
|
||||||
|
+ * Paired with WRITE_ONCE() in netlink_insert().
|
||||||
|
*/
|
||||||
|
- if (!nlk->bound)
|
||||||
|
+ if (!READ_ONCE(nlk->bound))
|
||||||
|
err = netlink_autobind(sock);
|
||||||
|
|
||||||
|
if (err == 0) {
|
||||||
|
@@ -1821,7 +1826,8 @@ static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
|
||||||
|
dst_group = nlk->dst_group;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (!nlk->bound) {
|
||||||
|
+ /* Paired with WRITE_ONCE() in netlink_insert() */
|
||||||
|
+ if (!READ_ONCE(nlk->bound)) {
|
||||||
|
err = netlink_autobind(sock);
|
||||||
|
if (err)
|
||||||
|
goto out;
|
||||||
|
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c
|
||||||
|
index 1e37247656f80..8b7110cbcce4c 100644
|
||||||
|
--- a/net/sched/sch_fifo.c
|
||||||
|
+++ b/net/sched/sch_fifo.c
|
||||||
|
@@ -151,6 +151,9 @@ int fifo_set_limit(struct Qdisc *q, unsigned int limit)
|
||||||
|
if (strncmp(q->ops->id + 1, "fifo", 4) != 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
+ if (!q->ops->change)
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
nla = kmalloc(nla_attr_size(sizeof(struct tc_fifo_qopt)), GFP_KERNEL);
|
||||||
|
if (nla) {
|
||||||
|
nla->nla_type = RTM_NEWQDISC;
|
||||||
1283
patch/kernel/archive/sun50iw9-4.9/patch-4.9.287-288.patch
Normal file
1283
patch/kernel/archive/sun50iw9-4.9/patch-4.9.287-288.patch
Normal file
File diff suppressed because it is too large
Load Diff
545
patch/kernel/archive/sun50iw9-4.9/patch-4.9.288-289.patch
Normal file
545
patch/kernel/archive/sun50iw9-4.9/patch-4.9.288-289.patch
Normal file
@@ -0,0 +1,545 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 49568e384a924..76e6507e4145f 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 288
|
||||||
|
+SUBLEVEL = 289
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
|
||||||
|
index 975b110e7d87a..d9a2fcd33bc60 100644
|
||||||
|
--- a/arch/arm/Makefile
|
||||||
|
+++ b/arch/arm/Makefile
|
||||||
|
@@ -13,7 +13,7 @@
|
||||||
|
# Ensure linker flags are correct
|
||||||
|
LDFLAGS :=
|
||||||
|
|
||||||
|
-LDFLAGS_vmlinux :=-p --no-undefined -X --pic-veneer
|
||||||
|
+LDFLAGS_vmlinux := --no-undefined -X --pic-veneer
|
||||||
|
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
|
||||||
|
LDFLAGS_vmlinux += --be8
|
||||||
|
LDFLAGS_MODULE += --be8
|
||||||
|
diff --git a/arch/arm/boot/bootp/Makefile b/arch/arm/boot/bootp/Makefile
|
||||||
|
index 5e4acd253b300..8d1e31b4ba941 100644
|
||||||
|
--- a/arch/arm/boot/bootp/Makefile
|
||||||
|
+++ b/arch/arm/boot/bootp/Makefile
|
||||||
|
@@ -7,7 +7,7 @@
|
||||||
|
|
||||||
|
GCOV_PROFILE := n
|
||||||
|
|
||||||
|
-LDFLAGS_bootp :=-p --no-undefined -X \
|
||||||
|
+LDFLAGS_bootp := --no-undefined -X \
|
||||||
|
--defsym initrd_phys=$(INITRD_PHYS) \
|
||||||
|
--defsym params_phys=$(PARAMS_PHYS) -T
|
||||||
|
AFLAGS_initrd.o :=-DINITRD=\"$(INITRD)\"
|
||||||
|
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
|
||||||
|
index 2f3ba4d9683c3..561dbc0ee2ba0 100644
|
||||||
|
--- a/arch/arm/boot/compressed/Makefile
|
||||||
|
+++ b/arch/arm/boot/compressed/Makefile
|
||||||
|
@@ -128,8 +128,6 @@ endif
|
||||||
|
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
|
||||||
|
LDFLAGS_vmlinux += --be8
|
||||||
|
endif
|
||||||
|
-# ?
|
||||||
|
-LDFLAGS_vmlinux += -p
|
||||||
|
# Report unresolved symbol references
|
||||||
|
LDFLAGS_vmlinux += --no-undefined
|
||||||
|
# Delete all temporary local symbols
|
||||||
|
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
|
||||||
|
index a0765e7ed6c7d..b0255cbf3b766 100644
|
||||||
|
--- a/arch/arm/boot/compressed/decompress.c
|
||||||
|
+++ b/arch/arm/boot/compressed/decompress.c
|
||||||
|
@@ -46,7 +46,10 @@ extern char * strstr(const char * s1, const char *s2);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_KERNEL_XZ
|
||||||
|
+/* Prevent KASAN override of string helpers in decompressor */
|
||||||
|
+#undef memmove
|
||||||
|
#define memmove memmove
|
||||||
|
+#undef memcpy
|
||||||
|
#define memcpy memcpy
|
||||||
|
#include "../../../../lib/decompress_unxz.c"
|
||||||
|
#endif
|
||||||
|
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
|
||||||
|
index 796e8f675a936..422162f1b9802 100644
|
||||||
|
--- a/arch/arm/mm/proc-macros.S
|
||||||
|
+++ b/arch/arm/mm/proc-macros.S
|
||||||
|
@@ -343,6 +343,7 @@ ENTRY(\name\()_cache_fns)
|
||||||
|
|
||||||
|
.macro define_tlb_functions name:req, flags_up:req, flags_smp
|
||||||
|
.type \name\()_tlb_fns, #object
|
||||||
|
+ .align 2
|
||||||
|
ENTRY(\name\()_tlb_fns)
|
||||||
|
.long \name\()_flush_user_tlb_range
|
||||||
|
.long \name\()_flush_kern_tlb_range
|
||||||
|
diff --git a/arch/arm/probes/kprobes/core.c b/arch/arm/probes/kprobes/core.c
|
||||||
|
index c3362ddd6c4cb..bc7a5dbaf423f 100644
|
||||||
|
--- a/arch/arm/probes/kprobes/core.c
|
||||||
|
+++ b/arch/arm/probes/kprobes/core.c
|
||||||
|
@@ -666,7 +666,7 @@ static struct undef_hook kprobes_arm_break_hook = {
|
||||||
|
|
||||||
|
#endif /* !CONFIG_THUMB2_KERNEL */
|
||||||
|
|
||||||
|
-int __init arch_init_kprobes()
|
||||||
|
+int __init arch_init_kprobes(void)
|
||||||
|
{
|
||||||
|
arm_probes_decode_init();
|
||||||
|
#ifdef CONFIG_THUMB2_KERNEL
|
||||||
|
diff --git a/arch/nios2/platform/Kconfig.platform b/arch/nios2/platform/Kconfig.platform
|
||||||
|
index d3e5df9fb36bd..78ffc0bf4ebed 100644
|
||||||
|
--- a/arch/nios2/platform/Kconfig.platform
|
||||||
|
+++ b/arch/nios2/platform/Kconfig.platform
|
||||||
|
@@ -37,6 +37,7 @@ config NIOS2_DTB_PHYS_ADDR
|
||||||
|
|
||||||
|
config NIOS2_DTB_SOURCE_BOOL
|
||||||
|
bool "Compile and link device tree into kernel image"
|
||||||
|
+ depends on !COMPILE_TEST
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
This allows you to specify a dts (device tree source) file
|
||||||
|
diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
|
||||||
|
index 888ee95340da2..e08e55cd98e6f 100644
|
||||||
|
--- a/arch/powerpc/net/bpf_jit_comp64.c
|
||||||
|
+++ b/arch/powerpc/net/bpf_jit_comp64.c
|
||||||
|
@@ -430,8 +430,14 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
|
||||||
|
case BPF_ALU64 | BPF_DIV | BPF_K: /* dst /= imm */
|
||||||
|
if (imm == 0)
|
||||||
|
return -EINVAL;
|
||||||
|
- else if (imm == 1)
|
||||||
|
- goto bpf_alu32_trunc;
|
||||||
|
+ if (imm == 1) {
|
||||||
|
+ if (BPF_OP(code) == BPF_DIV) {
|
||||||
|
+ goto bpf_alu32_trunc;
|
||||||
|
+ } else {
|
||||||
|
+ PPC_LI(dst_reg, 0);
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
|
||||||
|
PPC_LI32(b2p[TMP_REG_1], imm);
|
||||||
|
switch (BPF_CLASS(code)) {
|
||||||
|
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
|
||||||
|
index ded3a66049d2c..6007ebb80f886 100644
|
||||||
|
--- a/drivers/ata/sata_mv.c
|
||||||
|
+++ b/drivers/ata/sata_mv.c
|
||||||
|
@@ -3907,8 +3907,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
- dev_err(host->dev, "BUG: invalid board index %u\n", board_idx);
|
||||||
|
- return 1;
|
||||||
|
+ dev_alert(host->dev, "BUG: invalid board index %u\n", board_idx);
|
||||||
|
+ return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
hpriv->hp_flags = hp_flags;
|
||||||
|
diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
|
||||||
|
index b11af3f2c1dbf..c0fdbb3927586 100644
|
||||||
|
--- a/drivers/base/regmap/regcache-rbtree.c
|
||||||
|
+++ b/drivers/base/regmap/regcache-rbtree.c
|
||||||
|
@@ -296,14 +296,14 @@ static int regcache_rbtree_insert_to_block(struct regmap *map,
|
||||||
|
if (!blk)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
+ rbnode->block = blk;
|
||||||
|
+
|
||||||
|
if (BITS_TO_LONGS(blklen) > BITS_TO_LONGS(rbnode->blklen)) {
|
||||||
|
present = krealloc(rbnode->cache_present,
|
||||||
|
BITS_TO_LONGS(blklen) * sizeof(*present),
|
||||||
|
GFP_KERNEL);
|
||||||
|
- if (!present) {
|
||||||
|
- kfree(blk);
|
||||||
|
+ if (!present)
|
||||||
|
return -ENOMEM;
|
||||||
|
- }
|
||||||
|
|
||||||
|
memset(present + BITS_TO_LONGS(rbnode->blklen), 0,
|
||||||
|
(BITS_TO_LONGS(blklen) - BITS_TO_LONGS(rbnode->blklen))
|
||||||
|
@@ -320,7 +320,6 @@ static int regcache_rbtree_insert_to_block(struct regmap *map,
|
||||||
|
}
|
||||||
|
|
||||||
|
/* update the rbnode block, its size and the base register */
|
||||||
|
- rbnode->block = blk;
|
||||||
|
rbnode->blklen = blklen;
|
||||||
|
rbnode->base_reg = base_reg;
|
||||||
|
rbnode->cache_present = present;
|
||||||
|
diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c
|
||||||
|
index 7ab3d749b5aee..48aed0dc84a58 100644
|
||||||
|
--- a/drivers/mmc/host/dw_mmc-exynos.c
|
||||||
|
+++ b/drivers/mmc/host/dw_mmc-exynos.c
|
||||||
|
@@ -440,6 +440,18 @@ static s8 dw_mci_exynos_get_best_clksmpl(u8 candiates)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * If there is no cadiates value, then it needs to return -EIO.
|
||||||
|
+ * If there are candiates values and don't find bset clk sample value,
|
||||||
|
+ * then use a first candiates clock sample value.
|
||||||
|
+ */
|
||||||
|
+ for (i = 0; i < iter; i++) {
|
||||||
|
+ __c = ror8(candiates, i);
|
||||||
|
+ if ((__c & 0x1) == 0x1) {
|
||||||
|
+ loc = i;
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
out:
|
||||||
|
return loc;
|
||||||
|
}
|
||||||
|
@@ -470,6 +482,8 @@ static int dw_mci_exynos_execute_tuning(struct dw_mci_slot *slot, u32 opcode)
|
||||||
|
priv->tuned_sample = found;
|
||||||
|
} else {
|
||||||
|
ret = -EIO;
|
||||||
|
+ dev_warn(&mmc->class_dev,
|
||||||
|
+ "There is no candiates value about clksmpl!\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
|
||||||
|
index 0325083b10493..560b2996911ac 100644
|
||||||
|
--- a/drivers/mmc/host/sdhci.c
|
||||||
|
+++ b/drivers/mmc/host/sdhci.c
|
||||||
|
@@ -1421,6 +1421,12 @@ void sdhci_set_power_noreg(struct sdhci_host *host, unsigned char mode,
|
||||||
|
break;
|
||||||
|
case MMC_VDD_32_33:
|
||||||
|
case MMC_VDD_33_34:
|
||||||
|
+ /*
|
||||||
|
+ * 3.4 ~ 3.6V are valid only for those platforms where it's
|
||||||
|
+ * known that the voltage range is supported by hardware.
|
||||||
|
+ */
|
||||||
|
+ case MMC_VDD_34_35:
|
||||||
|
+ case MMC_VDD_35_36:
|
||||||
|
pwr = SDHCI_POWER_330;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
|
||||||
|
index a3e4288e5391b..875e438ab9738 100644
|
||||||
|
--- a/drivers/mmc/host/vub300.c
|
||||||
|
+++ b/drivers/mmc/host/vub300.c
|
||||||
|
@@ -579,7 +579,7 @@ static void check_vub300_port_status(struct vub300_mmc_host *vub300)
|
||||||
|
GET_SYSTEM_PORT_STATUS,
|
||||||
|
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||||
|
0x0000, 0x0000, &vub300->system_port_status,
|
||||||
|
- sizeof(vub300->system_port_status), HZ);
|
||||||
|
+ sizeof(vub300->system_port_status), 1000);
|
||||||
|
if (sizeof(vub300->system_port_status) == retval)
|
||||||
|
new_system_port_status(vub300);
|
||||||
|
}
|
||||||
|
@@ -1245,7 +1245,7 @@ static void __download_offload_pseudocode(struct vub300_mmc_host *vub300,
|
||||||
|
SET_INTERRUPT_PSEUDOCODE,
|
||||||
|
USB_DIR_OUT | USB_TYPE_VENDOR |
|
||||||
|
USB_RECIP_DEVICE, 0x0000, 0x0000,
|
||||||
|
- xfer_buffer, xfer_length, HZ);
|
||||||
|
+ xfer_buffer, xfer_length, 1000);
|
||||||
|
kfree(xfer_buffer);
|
||||||
|
if (retval < 0) {
|
||||||
|
strncpy(vub300->vub_name,
|
||||||
|
@@ -1292,7 +1292,7 @@ static void __download_offload_pseudocode(struct vub300_mmc_host *vub300,
|
||||||
|
SET_TRANSFER_PSEUDOCODE,
|
||||||
|
USB_DIR_OUT | USB_TYPE_VENDOR |
|
||||||
|
USB_RECIP_DEVICE, 0x0000, 0x0000,
|
||||||
|
- xfer_buffer, xfer_length, HZ);
|
||||||
|
+ xfer_buffer, xfer_length, 1000);
|
||||||
|
kfree(xfer_buffer);
|
||||||
|
if (retval < 0) {
|
||||||
|
strncpy(vub300->vub_name,
|
||||||
|
@@ -1998,7 +1998,7 @@ static void __set_clock_speed(struct vub300_mmc_host *vub300, u8 buf[8],
|
||||||
|
usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
|
||||||
|
SET_CLOCK_SPEED,
|
||||||
|
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||||
|
- 0x00, 0x00, buf, buf_array_size, HZ);
|
||||||
|
+ 0x00, 0x00, buf, buf_array_size, 1000);
|
||||||
|
if (retval != 8) {
|
||||||
|
dev_err(&vub300->udev->dev, "SET_CLOCK_SPEED"
|
||||||
|
" %dkHz failed with retval=%d\n", kHzClock, retval);
|
||||||
|
@@ -2020,14 +2020,14 @@ static void vub300_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
|
||||||
|
usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
|
||||||
|
SET_SD_POWER,
|
||||||
|
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||||
|
- 0x0000, 0x0000, NULL, 0, HZ);
|
||||||
|
+ 0x0000, 0x0000, NULL, 0, 1000);
|
||||||
|
/* must wait for the VUB300 u-proc to boot up */
|
||||||
|
msleep(600);
|
||||||
|
} else if ((ios->power_mode == MMC_POWER_UP) && !vub300->card_powered) {
|
||||||
|
usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
|
||||||
|
SET_SD_POWER,
|
||||||
|
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||||
|
- 0x0001, 0x0000, NULL, 0, HZ);
|
||||||
|
+ 0x0001, 0x0000, NULL, 0, 1000);
|
||||||
|
msleep(600);
|
||||||
|
vub300->card_powered = 1;
|
||||||
|
} else if (ios->power_mode == MMC_POWER_ON) {
|
||||||
|
@@ -2288,14 +2288,14 @@ static int vub300_probe(struct usb_interface *interface,
|
||||||
|
GET_HC_INF0,
|
||||||
|
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||||
|
0x0000, 0x0000, &vub300->hc_info,
|
||||||
|
- sizeof(vub300->hc_info), HZ);
|
||||||
|
+ sizeof(vub300->hc_info), 1000);
|
||||||
|
if (retval < 0)
|
||||||
|
goto error5;
|
||||||
|
retval =
|
||||||
|
usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
|
||||||
|
SET_ROM_WAIT_STATES,
|
||||||
|
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||||
|
- firmware_rom_wait_states, 0x0000, NULL, 0, HZ);
|
||||||
|
+ firmware_rom_wait_states, 0x0000, NULL, 0, 1000);
|
||||||
|
if (retval < 0)
|
||||||
|
goto error5;
|
||||||
|
dev_info(&vub300->udev->dev,
|
||||||
|
@@ -2310,7 +2310,7 @@ static int vub300_probe(struct usb_interface *interface,
|
||||||
|
GET_SYSTEM_PORT_STATUS,
|
||||||
|
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||||
|
0x0000, 0x0000, &vub300->system_port_status,
|
||||||
|
- sizeof(vub300->system_port_status), HZ);
|
||||||
|
+ sizeof(vub300->system_port_status), 1000);
|
||||||
|
if (retval < 0) {
|
||||||
|
goto error4;
|
||||||
|
} else if (sizeof(vub300->system_port_status) == retval) {
|
||||||
|
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
|
||||||
|
index 9b98ec3dcb82e..ad7b9772a4b27 100644
|
||||||
|
--- a/drivers/net/ethernet/nxp/lpc_eth.c
|
||||||
|
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
|
||||||
|
@@ -1039,9 +1039,6 @@ static int lpc_eth_close(struct net_device *ndev)
|
||||||
|
napi_disable(&pldat->napi);
|
||||||
|
netif_stop_queue(ndev);
|
||||||
|
|
||||||
|
- if (ndev->phydev)
|
||||||
|
- phy_stop(ndev->phydev);
|
||||||
|
-
|
||||||
|
spin_lock_irqsave(&pldat->lock, flags);
|
||||||
|
__lpc_eth_reset(pldat);
|
||||||
|
netif_carrier_off(ndev);
|
||||||
|
@@ -1049,6 +1046,8 @@ static int lpc_eth_close(struct net_device *ndev)
|
||||||
|
writel(0, LPC_ENET_MAC2(pldat->net_base));
|
||||||
|
spin_unlock_irqrestore(&pldat->lock, flags);
|
||||||
|
|
||||||
|
+ if (ndev->phydev)
|
||||||
|
+ phy_stop(ndev->phydev);
|
||||||
|
clk_disable_unprepare(pldat->clk);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
|
||||||
|
index 73f97d00ede79..92fb664b56fbb 100644
|
||||||
|
--- a/drivers/net/phy/mdio_bus.c
|
||||||
|
+++ b/drivers/net/phy/mdio_bus.c
|
||||||
|
@@ -326,7 +326,6 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
|
||||||
|
err = device_register(&bus->dev);
|
||||||
|
if (err) {
|
||||||
|
pr_err("mii_bus %s failed to register\n", bus->id);
|
||||||
|
- put_device(&bus->dev);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
|
||||||
|
index bca6237597233..bce898ad6e96f 100644
|
||||||
|
--- a/drivers/net/usb/lan78xx.c
|
||||||
|
+++ b/drivers/net/usb/lan78xx.c
|
||||||
|
@@ -3370,6 +3370,12 @@ static int lan78xx_probe(struct usb_interface *intf,
|
||||||
|
|
||||||
|
dev->maxpacket = usb_maxpacket(dev->udev, dev->pipe_out, 1);
|
||||||
|
|
||||||
|
+ /* Reject broken descriptors. */
|
||||||
|
+ if (dev->maxpacket == 0) {
|
||||||
|
+ ret = -ENODEV;
|
||||||
|
+ goto out3;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/* driver requires remote-wakeup capability during autosuspend. */
|
||||||
|
intf->needs_remote_wakeup = 1;
|
||||||
|
|
||||||
|
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
|
||||||
|
index 0b5fd1499ac06..6a004742ec71a 100644
|
||||||
|
--- a/drivers/net/usb/usbnet.c
|
||||||
|
+++ b/drivers/net/usb/usbnet.c
|
||||||
|
@@ -1740,6 +1740,11 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
|
||||||
|
if (!dev->rx_urb_size)
|
||||||
|
dev->rx_urb_size = dev->hard_mtu;
|
||||||
|
dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
|
||||||
|
+ if (dev->maxpacket == 0) {
|
||||||
|
+ /* that is a broken device */
|
||||||
|
+ status = -ENODEV;
|
||||||
|
+ goto out4;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
/* let userspace know we have a random address */
|
||||||
|
if (ether_addr_equal(net->dev_addr, node_id))
|
||||||
|
diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c
|
||||||
|
index 151b220381f95..ed65993aae96a 100644
|
||||||
|
--- a/drivers/nfc/port100.c
|
||||||
|
+++ b/drivers/nfc/port100.c
|
||||||
|
@@ -1011,11 +1011,11 @@ static u64 port100_get_command_type_mask(struct port100 *dev)
|
||||||
|
|
||||||
|
skb = port100_alloc_skb(dev, 0);
|
||||||
|
if (!skb)
|
||||||
|
- return -ENOMEM;
|
||||||
|
+ return 0;
|
||||||
|
|
||||||
|
resp = port100_send_cmd_sync(dev, PORT100_CMD_GET_COMMAND_TYPE, skb);
|
||||||
|
if (IS_ERR(resp))
|
||||||
|
- return PTR_ERR(resp);
|
||||||
|
+ return 0;
|
||||||
|
|
||||||
|
if (resp->len < 8)
|
||||||
|
mask = 0;
|
||||||
|
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
|
||||||
|
index 516c45771d59b..dc635bd935846 100644
|
||||||
|
--- a/net/batman-adv/bridge_loop_avoidance.c
|
||||||
|
+++ b/net/batman-adv/bridge_loop_avoidance.c
|
||||||
|
@@ -1569,10 +1569,14 @@ int batadv_bla_init(struct batadv_priv *bat_priv)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
bat_priv->bla.claim_hash = batadv_hash_new(128);
|
||||||
|
- bat_priv->bla.backbone_hash = batadv_hash_new(32);
|
||||||
|
+ if (!bat_priv->bla.claim_hash)
|
||||||
|
+ return -ENOMEM;
|
||||||
|
|
||||||
|
- if (!bat_priv->bla.claim_hash || !bat_priv->bla.backbone_hash)
|
||||||
|
+ bat_priv->bla.backbone_hash = batadv_hash_new(32);
|
||||||
|
+ if (!bat_priv->bla.backbone_hash) {
|
||||||
|
+ batadv_hash_destroy(bat_priv->bla.claim_hash);
|
||||||
|
return -ENOMEM;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
batadv_hash_set_lock_class(bat_priv->bla.claim_hash,
|
||||||
|
&batadv_claim_hash_lock_class_key);
|
||||||
|
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
|
||||||
|
index 2c017ab47557b..96b6ab9681cd9 100644
|
||||||
|
--- a/net/batman-adv/main.c
|
||||||
|
+++ b/net/batman-adv/main.c
|
||||||
|
@@ -177,29 +177,41 @@ int batadv_mesh_init(struct net_device *soft_iface)
|
||||||
|
INIT_HLIST_HEAD(&bat_priv->softif_vlan_list);
|
||||||
|
INIT_HLIST_HEAD(&bat_priv->tp_list);
|
||||||
|
|
||||||
|
- ret = batadv_v_mesh_init(bat_priv);
|
||||||
|
- if (ret < 0)
|
||||||
|
- goto err;
|
||||||
|
-
|
||||||
|
ret = batadv_originator_init(bat_priv);
|
||||||
|
- if (ret < 0)
|
||||||
|
- goto err;
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
|
||||||
|
+ goto err_orig;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
ret = batadv_tt_init(bat_priv);
|
||||||
|
- if (ret < 0)
|
||||||
|
- goto err;
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
|
||||||
|
+ goto err_tt;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ ret = batadv_v_mesh_init(bat_priv);
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
|
||||||
|
+ goto err_v;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
ret = batadv_bla_init(bat_priv);
|
||||||
|
- if (ret < 0)
|
||||||
|
- goto err;
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
|
||||||
|
+ goto err_bla;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
ret = batadv_dat_init(bat_priv);
|
||||||
|
- if (ret < 0)
|
||||||
|
- goto err;
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
|
||||||
|
+ goto err_dat;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
ret = batadv_nc_mesh_init(bat_priv);
|
||||||
|
- if (ret < 0)
|
||||||
|
- goto err;
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
|
||||||
|
+ goto err_nc;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
batadv_gw_init(bat_priv);
|
||||||
|
batadv_mcast_init(bat_priv);
|
||||||
|
@@ -209,8 +221,20 @@ int batadv_mesh_init(struct net_device *soft_iface)
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
-err:
|
||||||
|
- batadv_mesh_free(soft_iface);
|
||||||
|
+err_nc:
|
||||||
|
+ batadv_dat_free(bat_priv);
|
||||||
|
+err_dat:
|
||||||
|
+ batadv_bla_free(bat_priv);
|
||||||
|
+err_bla:
|
||||||
|
+ batadv_v_mesh_free(bat_priv);
|
||||||
|
+err_v:
|
||||||
|
+ batadv_tt_free(bat_priv);
|
||||||
|
+err_tt:
|
||||||
|
+ batadv_originator_free(bat_priv);
|
||||||
|
+err_orig:
|
||||||
|
+ batadv_purge_outstanding_packets(bat_priv, NULL);
|
||||||
|
+ atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE);
|
||||||
|
+
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c
|
||||||
|
index 09549885cd147..b0a85bd72afca 100644
|
||||||
|
--- a/net/batman-adv/network-coding.c
|
||||||
|
+++ b/net/batman-adv/network-coding.c
|
||||||
|
@@ -166,8 +166,10 @@ int batadv_nc_mesh_init(struct batadv_priv *bat_priv)
|
||||||
|
&batadv_nc_coding_hash_lock_class_key);
|
||||||
|
|
||||||
|
bat_priv->nc.decoding_hash = batadv_hash_new(128);
|
||||||
|
- if (!bat_priv->nc.decoding_hash)
|
||||||
|
+ if (!bat_priv->nc.decoding_hash) {
|
||||||
|
+ batadv_hash_destroy(bat_priv->nc.coding_hash);
|
||||||
|
goto err;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
batadv_hash_set_lock_class(bat_priv->nc.decoding_hash,
|
||||||
|
&batadv_nc_decoding_hash_lock_class_key);
|
||||||
|
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
|
||||||
|
index 607d8bac83760..6e9844e73bac3 100644
|
||||||
|
--- a/net/batman-adv/translation-table.c
|
||||||
|
+++ b/net/batman-adv/translation-table.c
|
||||||
|
@@ -4373,8 +4373,10 @@ int batadv_tt_init(struct batadv_priv *bat_priv)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ret = batadv_tt_global_init(bat_priv);
|
||||||
|
- if (ret < 0)
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ batadv_tt_local_table_free(bat_priv);
|
||||||
|
return ret;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
batadv_tvlv_handler_register(bat_priv, batadv_tt_tvlv_ogm_handler_v1,
|
||||||
|
batadv_tt_tvlv_unicast_handler_v1,
|
||||||
|
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
|
||||||
|
index 9045f6bcb34c4..f71991520ad69 100644
|
||||||
|
--- a/net/sctp/sm_statefuns.c
|
||||||
|
+++ b/net/sctp/sm_statefuns.c
|
||||||
|
@@ -4333,6 +4333,9 @@ sctp_disposition_t sctp_sf_violation(struct net *net,
|
||||||
|
{
|
||||||
|
struct sctp_chunk *chunk = arg;
|
||||||
|
|
||||||
|
+ if (!sctp_vtag_verify(chunk, asoc))
|
||||||
|
+ return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
|
||||||
|
+
|
||||||
|
/* Make sure that the chunk has a valid length. */
|
||||||
|
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t)))
|
||||||
|
return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
|
||||||
|
@@ -6018,6 +6021,7 @@ static struct sctp_packet *sctp_ootb_pkt_new(struct net *net,
|
||||||
|
* yet.
|
||||||
|
*/
|
||||||
|
switch (chunk->chunk_hdr->type) {
|
||||||
|
+ case SCTP_CID_INIT:
|
||||||
|
case SCTP_CID_INIT_ACK:
|
||||||
|
{
|
||||||
|
sctp_initack_chunk_t *initack;
|
||||||
936
patch/kernel/archive/sun50iw9-4.9/patch-4.9.289-290.patch
Normal file
936
patch/kernel/archive/sun50iw9-4.9/patch-4.9.289-290.patch
Normal file
@@ -0,0 +1,936 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 76e6507e4145f..9f1647076926d 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 289
|
||||||
|
+SUBLEVEL = 290
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h
|
||||||
|
index c10f5cb203e61..81198a6773c60 100644
|
||||||
|
--- a/arch/arc/include/asm/pgtable.h
|
||||||
|
+++ b/arch/arc/include/asm/pgtable.h
|
||||||
|
@@ -137,8 +137,10 @@
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARC_HAS_PAE40
|
||||||
|
#define PTE_BITS_NON_RWX_IN_PD1 (0xff00000000 | PAGE_MASK | _PAGE_CACHEABLE)
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS 40
|
||||||
|
#else
|
||||||
|
#define PTE_BITS_NON_RWX_IN_PD1 (PAGE_MASK | _PAGE_CACHEABLE)
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS 32
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h
|
||||||
|
index 92fd2c8a9af06..6154902bed83d 100644
|
||||||
|
--- a/arch/arm/include/asm/pgtable-2level.h
|
||||||
|
+++ b/arch/arm/include/asm/pgtable-2level.h
|
||||||
|
@@ -78,6 +78,8 @@
|
||||||
|
#define PTE_HWTABLE_OFF (PTE_HWTABLE_PTRS * sizeof(pte_t))
|
||||||
|
#define PTE_HWTABLE_SIZE (PTRS_PER_PTE * sizeof(u32))
|
||||||
|
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS 32
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* PMD_SHIFT determines the size of the area a second-level page table can map
|
||||||
|
* PGDIR_SHIFT determines what a third-level page table entry can map
|
||||||
|
diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
|
||||||
|
index 2a029bceaf2f8..35807e611b6e0 100644
|
||||||
|
--- a/arch/arm/include/asm/pgtable-3level.h
|
||||||
|
+++ b/arch/arm/include/asm/pgtable-3level.h
|
||||||
|
@@ -37,6 +37,8 @@
|
||||||
|
#define PTE_HWTABLE_OFF (0)
|
||||||
|
#define PTE_HWTABLE_SIZE (PTRS_PER_PTE * sizeof(u64))
|
||||||
|
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS 40
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* PGDIR_SHIFT determines the size a top-level page table entry can map.
|
||||||
|
*/
|
||||||
|
diff --git a/arch/mips/include/asm/pgtable-32.h b/arch/mips/include/asm/pgtable-32.h
|
||||||
|
index c0be540e83cb3..2c6df5a92e1e4 100644
|
||||||
|
--- a/arch/mips/include/asm/pgtable-32.h
|
||||||
|
+++ b/arch/mips/include/asm/pgtable-32.h
|
||||||
|
@@ -110,6 +110,7 @@ static inline void pmd_clear(pmd_t *pmdp)
|
||||||
|
|
||||||
|
#if defined(CONFIG_XPA)
|
||||||
|
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS 40
|
||||||
|
#define pte_pfn(x) (((unsigned long)((x).pte_high >> _PFN_SHIFT)) | (unsigned long)((x).pte_low << _PAGE_PRESENT_SHIFT))
|
||||||
|
static inline pte_t
|
||||||
|
pfn_pte(unsigned long pfn, pgprot_t prot)
|
||||||
|
@@ -125,6 +126,7 @@ pfn_pte(unsigned long pfn, pgprot_t prot)
|
||||||
|
|
||||||
|
#elif defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
|
||||||
|
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS 36
|
||||||
|
#define pte_pfn(x) ((unsigned long)((x).pte_high >> 6))
|
||||||
|
|
||||||
|
static inline pte_t pfn_pte(unsigned long pfn, pgprot_t prot)
|
||||||
|
@@ -139,6 +141,7 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t prot)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS 32
|
||||||
|
#ifdef CONFIG_CPU_VR41XX
|
||||||
|
#define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2)))
|
||||||
|
#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
|
||||||
|
diff --git a/arch/powerpc/include/asm/pte-common.h b/arch/powerpc/include/asm/pte-common.h
|
||||||
|
index 4ba26dd259fd8..0d81cd9dd60e9 100644
|
||||||
|
--- a/arch/powerpc/include/asm/pte-common.h
|
||||||
|
+++ b/arch/powerpc/include/asm/pte-common.h
|
||||||
|
@@ -101,8 +101,10 @@ static inline bool pte_user(pte_t pte)
|
||||||
|
*/
|
||||||
|
#if defined(CONFIG_PPC32) && defined(CONFIG_PTE_64BIT)
|
||||||
|
#define PTE_RPN_MASK (~((1ULL<<PTE_RPN_SHIFT)-1))
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS 36
|
||||||
|
#else
|
||||||
|
#define PTE_RPN_MASK (~((1UL<<PTE_RPN_SHIFT)-1))
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS 32
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* _PAGE_CHG_MASK masks of bits that are to be preserved across
|
||||||
|
diff --git a/arch/x86/include/asm/pgtable-3level_types.h b/arch/x86/include/asm/pgtable-3level_types.h
|
||||||
|
index bcc89625ebe53..f3f719d59e61b 100644
|
||||||
|
--- a/arch/x86/include/asm/pgtable-3level_types.h
|
||||||
|
+++ b/arch/x86/include/asm/pgtable-3level_types.h
|
||||||
|
@@ -42,5 +42,6 @@ typedef union {
|
||||||
|
*/
|
||||||
|
#define PTRS_PER_PTE 512
|
||||||
|
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS 36
|
||||||
|
|
||||||
|
#endif /* _ASM_X86_PGTABLE_3LEVEL_DEFS_H */
|
||||||
|
diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
|
||||||
|
index a069d0dd3ded4..aa34b16e62c24 100644
|
||||||
|
--- a/arch/x86/kvm/ioapic.c
|
||||||
|
+++ b/arch/x86/kvm/ioapic.c
|
||||||
|
@@ -96,7 +96,7 @@ static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic,
|
||||||
|
static void rtc_irq_eoi_tracking_reset(struct kvm_ioapic *ioapic)
|
||||||
|
{
|
||||||
|
ioapic->rtc_status.pending_eoi = 0;
|
||||||
|
- bitmap_zero(ioapic->rtc_status.dest_map.map, KVM_MAX_VCPU_ID + 1);
|
||||||
|
+ bitmap_zero(ioapic->rtc_status.dest_map.map, KVM_MAX_VCPU_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void kvm_rtc_eoi_tracking_restore_all(struct kvm_ioapic *ioapic);
|
||||||
|
diff --git a/arch/x86/kvm/ioapic.h b/arch/x86/kvm/ioapic.h
|
||||||
|
index 2f3df43489f22..1cc6e54436dba 100644
|
||||||
|
--- a/arch/x86/kvm/ioapic.h
|
||||||
|
+++ b/arch/x86/kvm/ioapic.h
|
||||||
|
@@ -42,13 +42,13 @@ struct kvm_vcpu;
|
||||||
|
|
||||||
|
struct dest_map {
|
||||||
|
/* vcpu bitmap where IRQ has been sent */
|
||||||
|
- DECLARE_BITMAP(map, KVM_MAX_VCPU_ID + 1);
|
||||||
|
+ DECLARE_BITMAP(map, KVM_MAX_VCPU_ID);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Vector sent to a given vcpu, only valid when
|
||||||
|
* the vcpu's bit in map is set
|
||||||
|
*/
|
||||||
|
- u8 vectors[KVM_MAX_VCPU_ID + 1];
|
||||||
|
+ u8 vectors[KVM_MAX_VCPU_ID];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
|
||||||
|
index 5bc8d588d1460..22bf8133fd2af 100644
|
||||||
|
--- a/drivers/amba/bus.c
|
||||||
|
+++ b/drivers/amba/bus.c
|
||||||
|
@@ -356,9 +356,6 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent)
|
||||||
|
void __iomem *tmp;
|
||||||
|
int i, ret;
|
||||||
|
|
||||||
|
- WARN_ON(dev->irq[0] == (unsigned int)-1);
|
||||||
|
- WARN_ON(dev->irq[1] == (unsigned int)-1);
|
||||||
|
-
|
||||||
|
ret = request_resource(parent, &dev->res);
|
||||||
|
if (ret)
|
||||||
|
goto err_out;
|
||||||
|
diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c b/drivers/infiniband/hw/qib/qib_user_sdma.c
|
||||||
|
index 3e0677c512768..0dc15f95e7626 100644
|
||||||
|
--- a/drivers/infiniband/hw/qib/qib_user_sdma.c
|
||||||
|
+++ b/drivers/infiniband/hw/qib/qib_user_sdma.c
|
||||||
|
@@ -41,6 +41,7 @@
|
||||||
|
#include <linux/rbtree.h>
|
||||||
|
#include <linux/spinlock.h>
|
||||||
|
#include <linux/delay.h>
|
||||||
|
+#include <linux/overflow.h>
|
||||||
|
|
||||||
|
#include "qib.h"
|
||||||
|
#include "qib_user_sdma.h"
|
||||||
|
@@ -606,7 +607,7 @@ done:
|
||||||
|
/*
|
||||||
|
* How many pages in this iovec element?
|
||||||
|
*/
|
||||||
|
-static int qib_user_sdma_num_pages(const struct iovec *iov)
|
||||||
|
+static size_t qib_user_sdma_num_pages(const struct iovec *iov)
|
||||||
|
{
|
||||||
|
const unsigned long addr = (unsigned long) iov->iov_base;
|
||||||
|
const unsigned long len = iov->iov_len;
|
||||||
|
@@ -662,7 +663,7 @@ static void qib_user_sdma_free_pkt_frag(struct device *dev,
|
||||||
|
static int qib_user_sdma_pin_pages(const struct qib_devdata *dd,
|
||||||
|
struct qib_user_sdma_queue *pq,
|
||||||
|
struct qib_user_sdma_pkt *pkt,
|
||||||
|
- unsigned long addr, int tlen, int npages)
|
||||||
|
+ unsigned long addr, int tlen, size_t npages)
|
||||||
|
{
|
||||||
|
struct page *pages[8];
|
||||||
|
int i, j;
|
||||||
|
@@ -726,7 +727,7 @@ static int qib_user_sdma_pin_pkt(const struct qib_devdata *dd,
|
||||||
|
unsigned long idx;
|
||||||
|
|
||||||
|
for (idx = 0; idx < niov; idx++) {
|
||||||
|
- const int npages = qib_user_sdma_num_pages(iov + idx);
|
||||||
|
+ const size_t npages = qib_user_sdma_num_pages(iov + idx);
|
||||||
|
const unsigned long addr = (unsigned long) iov[idx].iov_base;
|
||||||
|
|
||||||
|
ret = qib_user_sdma_pin_pages(dd, pq, pkt, addr,
|
||||||
|
@@ -828,8 +829,8 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd,
|
||||||
|
unsigned pktnw;
|
||||||
|
unsigned pktnwc;
|
||||||
|
int nfrags = 0;
|
||||||
|
- int npages = 0;
|
||||||
|
- int bytes_togo = 0;
|
||||||
|
+ size_t npages = 0;
|
||||||
|
+ size_t bytes_togo = 0;
|
||||||
|
int tiddma = 0;
|
||||||
|
int cfur;
|
||||||
|
|
||||||
|
@@ -889,7 +890,11 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd,
|
||||||
|
|
||||||
|
npages += qib_user_sdma_num_pages(&iov[idx]);
|
||||||
|
|
||||||
|
- bytes_togo += slen;
|
||||||
|
+ if (check_add_overflow(bytes_togo, slen, &bytes_togo) ||
|
||||||
|
+ bytes_togo > type_max(typeof(pkt->bytes_togo))) {
|
||||||
|
+ ret = -EINVAL;
|
||||||
|
+ goto free_pbc;
|
||||||
|
+ }
|
||||||
|
pktnwc += slen >> 2;
|
||||||
|
idx++;
|
||||||
|
nfrags++;
|
||||||
|
@@ -908,10 +913,10 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd,
|
||||||
|
}
|
||||||
|
|
||||||
|
if (frag_size) {
|
||||||
|
- int pktsize, tidsmsize, n;
|
||||||
|
+ size_t tidsmsize, n, pktsize, sz, addrlimit;
|
||||||
|
|
||||||
|
n = npages*((2*PAGE_SIZE/frag_size)+1);
|
||||||
|
- pktsize = sizeof(*pkt) + sizeof(pkt->addr[0])*n;
|
||||||
|
+ pktsize = struct_size(pkt, addr, n);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Determine if this is tid-sdma or just sdma.
|
||||||
|
@@ -926,14 +931,24 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd,
|
||||||
|
else
|
||||||
|
tidsmsize = 0;
|
||||||
|
|
||||||
|
- pkt = kmalloc(pktsize+tidsmsize, GFP_KERNEL);
|
||||||
|
+ if (check_add_overflow(pktsize, tidsmsize, &sz)) {
|
||||||
|
+ ret = -EINVAL;
|
||||||
|
+ goto free_pbc;
|
||||||
|
+ }
|
||||||
|
+ pkt = kmalloc(sz, GFP_KERNEL);
|
||||||
|
if (!pkt) {
|
||||||
|
ret = -ENOMEM;
|
||||||
|
goto free_pbc;
|
||||||
|
}
|
||||||
|
pkt->largepkt = 1;
|
||||||
|
pkt->frag_size = frag_size;
|
||||||
|
- pkt->addrlimit = n + ARRAY_SIZE(pkt->addr);
|
||||||
|
+ if (check_add_overflow(n, ARRAY_SIZE(pkt->addr),
|
||||||
|
+ &addrlimit) ||
|
||||||
|
+ addrlimit > type_max(typeof(pkt->addrlimit))) {
|
||||||
|
+ ret = -EINVAL;
|
||||||
|
+ goto free_pbc;
|
||||||
|
+ }
|
||||||
|
+ pkt->addrlimit = addrlimit;
|
||||||
|
|
||||||
|
if (tiddma) {
|
||||||
|
char *tidsm = (char *)pkt + pktsize;
|
||||||
|
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
|
||||||
|
index bde19425e9c10..a3a3d4b40a7cc 100644
|
||||||
|
--- a/drivers/net/usb/hso.c
|
||||||
|
+++ b/drivers/net/usb/hso.c
|
||||||
|
@@ -2512,7 +2512,7 @@ static struct hso_device *hso_create_net_device(struct usb_interface *interface,
|
||||||
|
hso_net_init);
|
||||||
|
if (!net) {
|
||||||
|
dev_err(&interface->dev, "Unable to create ethernet device\n");
|
||||||
|
- goto exit;
|
||||||
|
+ goto err_hso_dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
hso_net = netdev_priv(net);
|
||||||
|
@@ -2525,50 +2525,63 @@ static struct hso_device *hso_create_net_device(struct usb_interface *interface,
|
||||||
|
USB_DIR_IN);
|
||||||
|
if (!hso_net->in_endp) {
|
||||||
|
dev_err(&interface->dev, "Can't find BULK IN endpoint\n");
|
||||||
|
- goto exit;
|
||||||
|
+ goto err_net;
|
||||||
|
}
|
||||||
|
hso_net->out_endp = hso_get_ep(interface, USB_ENDPOINT_XFER_BULK,
|
||||||
|
USB_DIR_OUT);
|
||||||
|
if (!hso_net->out_endp) {
|
||||||
|
dev_err(&interface->dev, "Can't find BULK OUT endpoint\n");
|
||||||
|
- goto exit;
|
||||||
|
+ goto err_net;
|
||||||
|
}
|
||||||
|
SET_NETDEV_DEV(net, &interface->dev);
|
||||||
|
SET_NETDEV_DEVTYPE(net, &hso_type);
|
||||||
|
|
||||||
|
- /* registering our net device */
|
||||||
|
- result = register_netdev(net);
|
||||||
|
- if (result) {
|
||||||
|
- dev_err(&interface->dev, "Failed to register device\n");
|
||||||
|
- goto exit;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
/* start allocating */
|
||||||
|
for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) {
|
||||||
|
hso_net->mux_bulk_rx_urb_pool[i] = usb_alloc_urb(0, GFP_KERNEL);
|
||||||
|
if (!hso_net->mux_bulk_rx_urb_pool[i])
|
||||||
|
- goto exit;
|
||||||
|
+ goto err_mux_bulk_rx;
|
||||||
|
hso_net->mux_bulk_rx_buf_pool[i] = kzalloc(MUX_BULK_RX_BUF_SIZE,
|
||||||
|
GFP_KERNEL);
|
||||||
|
if (!hso_net->mux_bulk_rx_buf_pool[i])
|
||||||
|
- goto exit;
|
||||||
|
+ goto err_mux_bulk_rx;
|
||||||
|
}
|
||||||
|
hso_net->mux_bulk_tx_urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||||
|
if (!hso_net->mux_bulk_tx_urb)
|
||||||
|
- goto exit;
|
||||||
|
+ goto err_mux_bulk_rx;
|
||||||
|
hso_net->mux_bulk_tx_buf = kzalloc(MUX_BULK_TX_BUF_SIZE, GFP_KERNEL);
|
||||||
|
if (!hso_net->mux_bulk_tx_buf)
|
||||||
|
- goto exit;
|
||||||
|
+ goto err_free_tx_urb;
|
||||||
|
|
||||||
|
add_net_device(hso_dev);
|
||||||
|
|
||||||
|
+ /* registering our net device */
|
||||||
|
+ result = register_netdev(net);
|
||||||
|
+ if (result) {
|
||||||
|
+ dev_err(&interface->dev, "Failed to register device\n");
|
||||||
|
+ goto err_free_tx_buf;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
hso_log_port(hso_dev);
|
||||||
|
|
||||||
|
hso_create_rfkill(hso_dev, interface);
|
||||||
|
|
||||||
|
return hso_dev;
|
||||||
|
-exit:
|
||||||
|
- hso_free_net_device(hso_dev);
|
||||||
|
+
|
||||||
|
+err_free_tx_buf:
|
||||||
|
+ remove_net_device(hso_dev);
|
||||||
|
+ kfree(hso_net->mux_bulk_tx_buf);
|
||||||
|
+err_free_tx_urb:
|
||||||
|
+ usb_free_urb(hso_net->mux_bulk_tx_urb);
|
||||||
|
+err_mux_bulk_rx:
|
||||||
|
+ for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) {
|
||||||
|
+ usb_free_urb(hso_net->mux_bulk_rx_urb_pool[i]);
|
||||||
|
+ kfree(hso_net->mux_bulk_rx_buf_pool[i]);
|
||||||
|
+ }
|
||||||
|
+err_net:
|
||||||
|
+ free_netdev(net);
|
||||||
|
+err_hso_dev:
|
||||||
|
+ kfree(hso_dev);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
|
||||||
|
index 974387ad1e8c5..83cbaac877ea3 100644
|
||||||
|
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
|
||||||
|
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
|
||||||
|
@@ -42,7 +42,7 @@ static int rsi_usb_card_write(struct rsi_hw *adapter,
|
||||||
|
buf,
|
||||||
|
len,
|
||||||
|
&transfer,
|
||||||
|
- HZ * 5);
|
||||||
|
+ USB_CTRL_SET_TIMEOUT);
|
||||||
|
|
||||||
|
if (status < 0) {
|
||||||
|
rsi_dbg(ERR_ZONE,
|
||||||
|
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
|
||||||
|
index 1deb6adc411f7..4c9c1a8db8c30 100644
|
||||||
|
--- a/drivers/scsi/scsi.c
|
||||||
|
+++ b/drivers/scsi/scsi.c
|
||||||
|
@@ -951,8 +951,10 @@ EXPORT_SYMBOL(scsi_device_get);
|
||||||
|
*/
|
||||||
|
void scsi_device_put(struct scsi_device *sdev)
|
||||||
|
{
|
||||||
|
- module_put(sdev->host->hostt->module);
|
||||||
|
+ struct module *mod = sdev->host->hostt->module;
|
||||||
|
+
|
||||||
|
put_device(&sdev->sdev_gendev);
|
||||||
|
+ module_put(mod);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(scsi_device_put);
|
||||||
|
|
||||||
|
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
|
||||||
|
index 38830818bfb6f..eae43a85e9b0e 100644
|
||||||
|
--- a/drivers/scsi/scsi_sysfs.c
|
||||||
|
+++ b/drivers/scsi/scsi_sysfs.c
|
||||||
|
@@ -427,9 +427,12 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
|
||||||
|
struct device *parent;
|
||||||
|
struct list_head *this, *tmp;
|
||||||
|
unsigned long flags;
|
||||||
|
+ struct module *mod;
|
||||||
|
|
||||||
|
sdev = container_of(work, struct scsi_device, ew.work);
|
||||||
|
|
||||||
|
+ mod = sdev->host->hostt->module;
|
||||||
|
+
|
||||||
|
scsi_dh_release_device(sdev);
|
||||||
|
|
||||||
|
parent = sdev->sdev_gendev.parent;
|
||||||
|
@@ -461,11 +464,17 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
|
||||||
|
|
||||||
|
if (parent)
|
||||||
|
put_device(parent);
|
||||||
|
+ module_put(mod);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void scsi_device_dev_release(struct device *dev)
|
||||||
|
{
|
||||||
|
struct scsi_device *sdp = to_scsi_device(dev);
|
||||||
|
+
|
||||||
|
+ /* Set module pointer as NULL in case of module unloading */
|
||||||
|
+ if (!try_module_get(sdp->host->hostt->module))
|
||||||
|
+ sdp->host->hostt->module = NULL;
|
||||||
|
+
|
||||||
|
execute_in_process_context(scsi_device_dev_release_usercontext,
|
||||||
|
&sdp->ew);
|
||||||
|
}
|
||||||
|
diff --git a/drivers/staging/comedi/drivers/dt9812.c b/drivers/staging/comedi/drivers/dt9812.c
|
||||||
|
index 7ebca862ecaa3..e758eb3d2d19f 100644
|
||||||
|
--- a/drivers/staging/comedi/drivers/dt9812.c
|
||||||
|
+++ b/drivers/staging/comedi/drivers/dt9812.c
|
||||||
|
@@ -41,6 +41,7 @@
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/errno.h>
|
||||||
|
+#include <linux/slab.h>
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
|
||||||
|
#include "../comedi_usb.h"
|
||||||
|
@@ -246,22 +247,42 @@ static int dt9812_read_info(struct comedi_device *dev,
|
||||||
|
{
|
||||||
|
struct usb_device *usb = comedi_to_usb_dev(dev);
|
||||||
|
struct dt9812_private *devpriv = dev->private;
|
||||||
|
- struct dt9812_usb_cmd cmd;
|
||||||
|
+ struct dt9812_usb_cmd *cmd;
|
||||||
|
+ size_t tbuf_size;
|
||||||
|
int count, ret;
|
||||||
|
+ void *tbuf;
|
||||||
|
|
||||||
|
- cmd.cmd = cpu_to_le32(DT9812_R_FLASH_DATA);
|
||||||
|
- cmd.u.flash_data_info.address =
|
||||||
|
+ tbuf_size = max(sizeof(*cmd), buf_size);
|
||||||
|
+
|
||||||
|
+ tbuf = kzalloc(tbuf_size, GFP_KERNEL);
|
||||||
|
+ if (!tbuf)
|
||||||
|
+ return -ENOMEM;
|
||||||
|
+
|
||||||
|
+ cmd = tbuf;
|
||||||
|
+
|
||||||
|
+ cmd->cmd = cpu_to_le32(DT9812_R_FLASH_DATA);
|
||||||
|
+ cmd->u.flash_data_info.address =
|
||||||
|
cpu_to_le16(DT9812_DIAGS_BOARD_INFO_ADDR + offset);
|
||||||
|
- cmd.u.flash_data_info.numbytes = cpu_to_le16(buf_size);
|
||||||
|
+ cmd->u.flash_data_info.numbytes = cpu_to_le16(buf_size);
|
||||||
|
|
||||||
|
/* DT9812 only responds to 32 byte writes!! */
|
||||||
|
ret = usb_bulk_msg(usb, usb_sndbulkpipe(usb, devpriv->cmd_wr.addr),
|
||||||
|
- &cmd, 32, &count, DT9812_USB_TIMEOUT);
|
||||||
|
+ cmd, sizeof(*cmd), &count, DT9812_USB_TIMEOUT);
|
||||||
|
if (ret)
|
||||||
|
- return ret;
|
||||||
|
+ goto out;
|
||||||
|
+
|
||||||
|
+ ret = usb_bulk_msg(usb, usb_rcvbulkpipe(usb, devpriv->cmd_rd.addr),
|
||||||
|
+ tbuf, buf_size, &count, DT9812_USB_TIMEOUT);
|
||||||
|
+ if (!ret) {
|
||||||
|
+ if (count == buf_size)
|
||||||
|
+ memcpy(buf, tbuf, buf_size);
|
||||||
|
+ else
|
||||||
|
+ ret = -EREMOTEIO;
|
||||||
|
+ }
|
||||||
|
+out:
|
||||||
|
+ kfree(tbuf);
|
||||||
|
|
||||||
|
- return usb_bulk_msg(usb, usb_rcvbulkpipe(usb, devpriv->cmd_rd.addr),
|
||||||
|
- buf, buf_size, &count, DT9812_USB_TIMEOUT);
|
||||||
|
+ return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int dt9812_read_multiple_registers(struct comedi_device *dev,
|
||||||
|
@@ -270,22 +291,42 @@ static int dt9812_read_multiple_registers(struct comedi_device *dev,
|
||||||
|
{
|
||||||
|
struct usb_device *usb = comedi_to_usb_dev(dev);
|
||||||
|
struct dt9812_private *devpriv = dev->private;
|
||||||
|
- struct dt9812_usb_cmd cmd;
|
||||||
|
+ struct dt9812_usb_cmd *cmd;
|
||||||
|
int i, count, ret;
|
||||||
|
+ size_t buf_size;
|
||||||
|
+ void *buf;
|
||||||
|
|
||||||
|
- cmd.cmd = cpu_to_le32(DT9812_R_MULTI_BYTE_REG);
|
||||||
|
- cmd.u.read_multi_info.count = reg_count;
|
||||||
|
+ buf_size = max_t(size_t, sizeof(*cmd), reg_count);
|
||||||
|
+
|
||||||
|
+ buf = kzalloc(buf_size, GFP_KERNEL);
|
||||||
|
+ if (!buf)
|
||||||
|
+ return -ENOMEM;
|
||||||
|
+
|
||||||
|
+ cmd = buf;
|
||||||
|
+
|
||||||
|
+ cmd->cmd = cpu_to_le32(DT9812_R_MULTI_BYTE_REG);
|
||||||
|
+ cmd->u.read_multi_info.count = reg_count;
|
||||||
|
for (i = 0; i < reg_count; i++)
|
||||||
|
- cmd.u.read_multi_info.address[i] = address[i];
|
||||||
|
+ cmd->u.read_multi_info.address[i] = address[i];
|
||||||
|
|
||||||
|
/* DT9812 only responds to 32 byte writes!! */
|
||||||
|
ret = usb_bulk_msg(usb, usb_sndbulkpipe(usb, devpriv->cmd_wr.addr),
|
||||||
|
- &cmd, 32, &count, DT9812_USB_TIMEOUT);
|
||||||
|
+ cmd, sizeof(*cmd), &count, DT9812_USB_TIMEOUT);
|
||||||
|
if (ret)
|
||||||
|
- return ret;
|
||||||
|
+ goto out;
|
||||||
|
+
|
||||||
|
+ ret = usb_bulk_msg(usb, usb_rcvbulkpipe(usb, devpriv->cmd_rd.addr),
|
||||||
|
+ buf, reg_count, &count, DT9812_USB_TIMEOUT);
|
||||||
|
+ if (!ret) {
|
||||||
|
+ if (count == reg_count)
|
||||||
|
+ memcpy(value, buf, reg_count);
|
||||||
|
+ else
|
||||||
|
+ ret = -EREMOTEIO;
|
||||||
|
+ }
|
||||||
|
+out:
|
||||||
|
+ kfree(buf);
|
||||||
|
|
||||||
|
- return usb_bulk_msg(usb, usb_rcvbulkpipe(usb, devpriv->cmd_rd.addr),
|
||||||
|
- value, reg_count, &count, DT9812_USB_TIMEOUT);
|
||||||
|
+ return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int dt9812_write_multiple_registers(struct comedi_device *dev,
|
||||||
|
@@ -294,19 +335,27 @@ static int dt9812_write_multiple_registers(struct comedi_device *dev,
|
||||||
|
{
|
||||||
|
struct usb_device *usb = comedi_to_usb_dev(dev);
|
||||||
|
struct dt9812_private *devpriv = dev->private;
|
||||||
|
- struct dt9812_usb_cmd cmd;
|
||||||
|
+ struct dt9812_usb_cmd *cmd;
|
||||||
|
int i, count;
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
+ cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
|
||||||
|
+ if (!cmd)
|
||||||
|
+ return -ENOMEM;
|
||||||
|
|
||||||
|
- cmd.cmd = cpu_to_le32(DT9812_W_MULTI_BYTE_REG);
|
||||||
|
- cmd.u.read_multi_info.count = reg_count;
|
||||||
|
+ cmd->cmd = cpu_to_le32(DT9812_W_MULTI_BYTE_REG);
|
||||||
|
+ cmd->u.read_multi_info.count = reg_count;
|
||||||
|
for (i = 0; i < reg_count; i++) {
|
||||||
|
- cmd.u.write_multi_info.write[i].address = address[i];
|
||||||
|
- cmd.u.write_multi_info.write[i].value = value[i];
|
||||||
|
+ cmd->u.write_multi_info.write[i].address = address[i];
|
||||||
|
+ cmd->u.write_multi_info.write[i].value = value[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DT9812 only responds to 32 byte writes!! */
|
||||||
|
- return usb_bulk_msg(usb, usb_sndbulkpipe(usb, devpriv->cmd_wr.addr),
|
||||||
|
- &cmd, 32, &count, DT9812_USB_TIMEOUT);
|
||||||
|
+ ret = usb_bulk_msg(usb, usb_sndbulkpipe(usb, devpriv->cmd_wr.addr),
|
||||||
|
+ cmd, sizeof(*cmd), &count, DT9812_USB_TIMEOUT);
|
||||||
|
+ kfree(cmd);
|
||||||
|
+
|
||||||
|
+ return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int dt9812_rmw_multiple_registers(struct comedi_device *dev,
|
||||||
|
@@ -315,17 +364,25 @@ static int dt9812_rmw_multiple_registers(struct comedi_device *dev,
|
||||||
|
{
|
||||||
|
struct usb_device *usb = comedi_to_usb_dev(dev);
|
||||||
|
struct dt9812_private *devpriv = dev->private;
|
||||||
|
- struct dt9812_usb_cmd cmd;
|
||||||
|
+ struct dt9812_usb_cmd *cmd;
|
||||||
|
int i, count;
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
+ cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
|
||||||
|
+ if (!cmd)
|
||||||
|
+ return -ENOMEM;
|
||||||
|
|
||||||
|
- cmd.cmd = cpu_to_le32(DT9812_RMW_MULTI_BYTE_REG);
|
||||||
|
- cmd.u.rmw_multi_info.count = reg_count;
|
||||||
|
+ cmd->cmd = cpu_to_le32(DT9812_RMW_MULTI_BYTE_REG);
|
||||||
|
+ cmd->u.rmw_multi_info.count = reg_count;
|
||||||
|
for (i = 0; i < reg_count; i++)
|
||||||
|
- cmd.u.rmw_multi_info.rmw[i] = rmw[i];
|
||||||
|
+ cmd->u.rmw_multi_info.rmw[i] = rmw[i];
|
||||||
|
|
||||||
|
/* DT9812 only responds to 32 byte writes!! */
|
||||||
|
- return usb_bulk_msg(usb, usb_sndbulkpipe(usb, devpriv->cmd_wr.addr),
|
||||||
|
- &cmd, 32, &count, DT9812_USB_TIMEOUT);
|
||||||
|
+ ret = usb_bulk_msg(usb, usb_sndbulkpipe(usb, devpriv->cmd_wr.addr),
|
||||||
|
+ cmd, sizeof(*cmd), &count, DT9812_USB_TIMEOUT);
|
||||||
|
+ kfree(cmd);
|
||||||
|
+
|
||||||
|
+ return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int dt9812_digital_in(struct comedi_device *dev, u8 *bits)
|
||||||
|
diff --git a/drivers/staging/comedi/drivers/ni_usb6501.c b/drivers/staging/comedi/drivers/ni_usb6501.c
|
||||||
|
index 2f174a34d9e9b..7f647d80ec050 100644
|
||||||
|
--- a/drivers/staging/comedi/drivers/ni_usb6501.c
|
||||||
|
+++ b/drivers/staging/comedi/drivers/ni_usb6501.c
|
||||||
|
@@ -153,6 +153,10 @@ static const u8 READ_COUNTER_RESPONSE[] = {0x00, 0x01, 0x00, 0x10,
|
||||||
|
0x00, 0x00, 0x00, 0x02,
|
||||||
|
0x00, 0x00, 0x00, 0x00};
|
||||||
|
|
||||||
|
+/* Largest supported packets */
|
||||||
|
+static const size_t TX_MAX_SIZE = sizeof(SET_PORT_DIR_REQUEST);
|
||||||
|
+static const size_t RX_MAX_SIZE = sizeof(READ_PORT_RESPONSE);
|
||||||
|
+
|
||||||
|
enum commands {
|
||||||
|
READ_PORT,
|
||||||
|
WRITE_PORT,
|
||||||
|
@@ -510,6 +514,12 @@ static int ni6501_find_endpoints(struct comedi_device *dev)
|
||||||
|
if (!devpriv->ep_rx || !devpriv->ep_tx)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
+ if (usb_endpoint_maxp(devpriv->ep_rx) < RX_MAX_SIZE)
|
||||||
|
+ return -ENODEV;
|
||||||
|
+
|
||||||
|
+ if (usb_endpoint_maxp(devpriv->ep_tx) < TX_MAX_SIZE)
|
||||||
|
+ return -ENODEV;
|
||||||
|
+
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b/drivers/staging/comedi/drivers/vmk80xx.c
|
||||||
|
index cdf86284dd047..36470ee065967 100644
|
||||||
|
--- a/drivers/staging/comedi/drivers/vmk80xx.c
|
||||||
|
+++ b/drivers/staging/comedi/drivers/vmk80xx.c
|
||||||
|
@@ -99,6 +99,9 @@ enum {
|
||||||
|
#define IC3_VERSION BIT(0)
|
||||||
|
#define IC6_VERSION BIT(1)
|
||||||
|
|
||||||
|
+#define MIN_BUF_SIZE 64
|
||||||
|
+#define PACKET_TIMEOUT 10000 /* ms */
|
||||||
|
+
|
||||||
|
enum vmk80xx_model {
|
||||||
|
VMK8055_MODEL,
|
||||||
|
VMK8061_MODEL
|
||||||
|
@@ -166,22 +169,21 @@ static void vmk80xx_do_bulk_msg(struct comedi_device *dev)
|
||||||
|
__u8 rx_addr;
|
||||||
|
unsigned int tx_pipe;
|
||||||
|
unsigned int rx_pipe;
|
||||||
|
- size_t size;
|
||||||
|
+ size_t tx_size;
|
||||||
|
+ size_t rx_size;
|
||||||
|
|
||||||
|
tx_addr = devpriv->ep_tx->bEndpointAddress;
|
||||||
|
rx_addr = devpriv->ep_rx->bEndpointAddress;
|
||||||
|
tx_pipe = usb_sndbulkpipe(usb, tx_addr);
|
||||||
|
rx_pipe = usb_rcvbulkpipe(usb, rx_addr);
|
||||||
|
+ tx_size = usb_endpoint_maxp(devpriv->ep_tx);
|
||||||
|
+ rx_size = usb_endpoint_maxp(devpriv->ep_rx);
|
||||||
|
|
||||||
|
- /*
|
||||||
|
- * The max packet size attributes of the K8061
|
||||||
|
- * input/output endpoints are identical
|
||||||
|
- */
|
||||||
|
- size = usb_endpoint_maxp(devpriv->ep_tx);
|
||||||
|
+ usb_bulk_msg(usb, tx_pipe, devpriv->usb_tx_buf, tx_size, NULL,
|
||||||
|
+ PACKET_TIMEOUT);
|
||||||
|
|
||||||
|
- usb_bulk_msg(usb, tx_pipe, devpriv->usb_tx_buf,
|
||||||
|
- size, NULL, devpriv->ep_tx->bInterval);
|
||||||
|
- usb_bulk_msg(usb, rx_pipe, devpriv->usb_rx_buf, size, NULL, HZ * 10);
|
||||||
|
+ usb_bulk_msg(usb, rx_pipe, devpriv->usb_rx_buf, rx_size, NULL,
|
||||||
|
+ PACKET_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int vmk80xx_read_packet(struct comedi_device *dev)
|
||||||
|
@@ -200,7 +202,7 @@ static int vmk80xx_read_packet(struct comedi_device *dev)
|
||||||
|
pipe = usb_rcvintpipe(usb, ep->bEndpointAddress);
|
||||||
|
return usb_interrupt_msg(usb, pipe, devpriv->usb_rx_buf,
|
||||||
|
usb_endpoint_maxp(ep), NULL,
|
||||||
|
- HZ * 10);
|
||||||
|
+ PACKET_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int vmk80xx_write_packet(struct comedi_device *dev, int cmd)
|
||||||
|
@@ -221,7 +223,7 @@ static int vmk80xx_write_packet(struct comedi_device *dev, int cmd)
|
||||||
|
pipe = usb_sndintpipe(usb, ep->bEndpointAddress);
|
||||||
|
return usb_interrupt_msg(usb, pipe, devpriv->usb_tx_buf,
|
||||||
|
usb_endpoint_maxp(ep), NULL,
|
||||||
|
- HZ * 10);
|
||||||
|
+ PACKET_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int vmk80xx_reset_device(struct comedi_device *dev)
|
||||||
|
@@ -687,12 +689,12 @@ static int vmk80xx_alloc_usb_buffers(struct comedi_device *dev)
|
||||||
|
struct vmk80xx_private *devpriv = dev->private;
|
||||||
|
size_t size;
|
||||||
|
|
||||||
|
- size = usb_endpoint_maxp(devpriv->ep_rx);
|
||||||
|
+ size = max(usb_endpoint_maxp(devpriv->ep_rx), MIN_BUF_SIZE);
|
||||||
|
devpriv->usb_rx_buf = kzalloc(size, GFP_KERNEL);
|
||||||
|
if (!devpriv->usb_rx_buf)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
- size = usb_endpoint_maxp(devpriv->ep_tx);
|
||||||
|
+ size = max(usb_endpoint_maxp(devpriv->ep_rx), MIN_BUF_SIZE);
|
||||||
|
devpriv->usb_tx_buf = kzalloc(size, GFP_KERNEL);
|
||||||
|
if (!devpriv->usb_tx_buf)
|
||||||
|
return -ENOMEM;
|
||||||
|
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
|
||||||
|
index 53b77c8ae328a..95cbf7cf55e61 100644
|
||||||
|
--- a/drivers/staging/rtl8192u/r8192U_core.c
|
||||||
|
+++ b/drivers/staging/rtl8192u/r8192U_core.c
|
||||||
|
@@ -266,7 +266,7 @@ int write_nic_byte_E(struct net_device *dev, int indx, u8 data)
|
||||||
|
|
||||||
|
status = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
|
||||||
|
RTL8187_REQ_SET_REGS, RTL8187_REQT_WRITE,
|
||||||
|
- indx | 0xfe00, 0, usbdata, 1, HZ / 2);
|
||||||
|
+ indx | 0xfe00, 0, usbdata, 1, 500);
|
||||||
|
kfree(usbdata);
|
||||||
|
|
||||||
|
if (status < 0){
|
||||||
|
@@ -289,7 +289,7 @@ int read_nic_byte_E(struct net_device *dev, int indx, u8 *data)
|
||||||
|
|
||||||
|
status = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
|
||||||
|
RTL8187_REQ_GET_REGS, RTL8187_REQT_READ,
|
||||||
|
- indx | 0xfe00, 0, usbdata, 1, HZ / 2);
|
||||||
|
+ indx | 0xfe00, 0, usbdata, 1, 500);
|
||||||
|
*data = *usbdata;
|
||||||
|
kfree(usbdata);
|
||||||
|
|
||||||
|
@@ -317,7 +317,7 @@ int write_nic_byte(struct net_device *dev, int indx, u8 data)
|
||||||
|
status = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
|
||||||
|
RTL8187_REQ_SET_REGS, RTL8187_REQT_WRITE,
|
||||||
|
(indx & 0xff) | 0xff00, (indx >> 8) & 0x0f,
|
||||||
|
- usbdata, 1, HZ / 2);
|
||||||
|
+ usbdata, 1, 500);
|
||||||
|
kfree(usbdata);
|
||||||
|
|
||||||
|
if (status < 0) {
|
||||||
|
@@ -344,7 +344,7 @@ int write_nic_word(struct net_device *dev, int indx, u16 data)
|
||||||
|
status = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
|
||||||
|
RTL8187_REQ_SET_REGS, RTL8187_REQT_WRITE,
|
||||||
|
(indx & 0xff) | 0xff00, (indx >> 8) & 0x0f,
|
||||||
|
- usbdata, 2, HZ / 2);
|
||||||
|
+ usbdata, 2, 500);
|
||||||
|
kfree(usbdata);
|
||||||
|
|
||||||
|
if (status < 0) {
|
||||||
|
@@ -371,7 +371,7 @@ int write_nic_dword(struct net_device *dev, int indx, u32 data)
|
||||||
|
status = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
|
||||||
|
RTL8187_REQ_SET_REGS, RTL8187_REQT_WRITE,
|
||||||
|
(indx & 0xff) | 0xff00, (indx >> 8) & 0x0f,
|
||||||
|
- usbdata, 4, HZ / 2);
|
||||||
|
+ usbdata, 4, 500);
|
||||||
|
kfree(usbdata);
|
||||||
|
|
||||||
|
|
||||||
|
@@ -399,7 +399,7 @@ int read_nic_byte(struct net_device *dev, int indx, u8 *data)
|
||||||
|
status = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
|
||||||
|
RTL8187_REQ_GET_REGS, RTL8187_REQT_READ,
|
||||||
|
(indx & 0xff) | 0xff00, (indx >> 8) & 0x0f,
|
||||||
|
- usbdata, 1, HZ / 2);
|
||||||
|
+ usbdata, 1, 500);
|
||||||
|
*data = *usbdata;
|
||||||
|
kfree(usbdata);
|
||||||
|
|
||||||
|
@@ -426,7 +426,7 @@ int read_nic_word(struct net_device *dev, int indx, u16 *data)
|
||||||
|
status = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
|
||||||
|
RTL8187_REQ_GET_REGS, RTL8187_REQT_READ,
|
||||||
|
(indx & 0xff) | 0xff00, (indx >> 8) & 0x0f,
|
||||||
|
- usbdata, 2, HZ / 2);
|
||||||
|
+ usbdata, 2, 500);
|
||||||
|
*data = *usbdata;
|
||||||
|
kfree(usbdata);
|
||||||
|
|
||||||
|
@@ -450,7 +450,7 @@ static int read_nic_word_E(struct net_device *dev, int indx, u16 *data)
|
||||||
|
|
||||||
|
status = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
|
||||||
|
RTL8187_REQ_GET_REGS, RTL8187_REQT_READ,
|
||||||
|
- indx | 0xfe00, 0, usbdata, 2, HZ / 2);
|
||||||
|
+ indx | 0xfe00, 0, usbdata, 2, 500);
|
||||||
|
*data = *usbdata;
|
||||||
|
kfree(usbdata);
|
||||||
|
|
||||||
|
@@ -476,7 +476,7 @@ int read_nic_dword(struct net_device *dev, int indx, u32 *data)
|
||||||
|
status = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
|
||||||
|
RTL8187_REQ_GET_REGS, RTL8187_REQT_READ,
|
||||||
|
(indx & 0xff) | 0xff00, (indx >> 8) & 0x0f,
|
||||||
|
- usbdata, 4, HZ / 2);
|
||||||
|
+ usbdata, 4, 500);
|
||||||
|
*data = *usbdata;
|
||||||
|
kfree(usbdata);
|
||||||
|
|
||||||
|
diff --git a/drivers/staging/rtl8712/usb_ops_linux.c b/drivers/staging/rtl8712/usb_ops_linux.c
|
||||||
|
index fc6bb0be2a28c..2919498fd8089 100644
|
||||||
|
--- a/drivers/staging/rtl8712/usb_ops_linux.c
|
||||||
|
+++ b/drivers/staging/rtl8712/usb_ops_linux.c
|
||||||
|
@@ -504,7 +504,7 @@ int r8712_usbctrl_vendorreq(struct intf_priv *pintfpriv, u8 request, u16 value,
|
||||||
|
memcpy(pIo_buf, pdata, len);
|
||||||
|
}
|
||||||
|
status = usb_control_msg(udev, pipe, request, reqtype, value, index,
|
||||||
|
- pIo_buf, len, HZ / 2);
|
||||||
|
+ pIo_buf, len, 500);
|
||||||
|
if (status > 0) { /* Success this control transfer. */
|
||||||
|
if (requesttype == 0x01) {
|
||||||
|
/* For Control read transfer, we have to copy the read
|
||||||
|
diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig
|
||||||
|
index 658b8da609152..cff7dae51aabb 100644
|
||||||
|
--- a/drivers/usb/gadget/udc/Kconfig
|
||||||
|
+++ b/drivers/usb/gadget/udc/Kconfig
|
||||||
|
@@ -278,6 +278,7 @@ config USB_AMD5536UDC
|
||||||
|
config USB_FSL_QE
|
||||||
|
tristate "Freescale QE/CPM USB Device Controller"
|
||||||
|
depends on FSL_SOC && (QUICC_ENGINE || CPM)
|
||||||
|
+ depends on !64BIT || BROKEN
|
||||||
|
help
|
||||||
|
Some of Freescale PowerPC processors have a Full Speed
|
||||||
|
QE/CPM2 USB controller, which support device mode with 4
|
||||||
|
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
|
||||||
|
index 60540a8ac431d..8eb3a291ca9d8 100644
|
||||||
|
--- a/drivers/usb/musb/musb_gadget.c
|
||||||
|
+++ b/drivers/usb/musb/musb_gadget.c
|
||||||
|
@@ -1284,9 +1284,11 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
|
||||||
|
status = musb_queue_resume_work(musb,
|
||||||
|
musb_ep_restart_resume_work,
|
||||||
|
request);
|
||||||
|
- if (status < 0)
|
||||||
|
+ if (status < 0) {
|
||||||
|
dev_err(musb->controller, "%s resume work: %i\n",
|
||||||
|
__func__, status);
|
||||||
|
+ list_del(&request->list);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
unlock:
|
||||||
|
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
|
||||||
|
index ed94496cdc5b3..ec2b7f5c900c2 100644
|
||||||
|
--- a/drivers/usb/storage/unusual_devs.h
|
||||||
|
+++ b/drivers/usb/storage/unusual_devs.h
|
||||||
|
@@ -425,6 +425,16 @@ UNUSUAL_DEV( 0x04b8, 0x0602, 0x0110, 0x0110,
|
||||||
|
"785EPX Storage",
|
||||||
|
USB_SC_SCSI, USB_PR_BULK, NULL, US_FL_SINGLE_LUN),
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+ * Reported by James Buren <braewoods+lkml@braewoods.net>
|
||||||
|
+ * Virtual ISOs cannot be remounted if ejected while the device is locked
|
||||||
|
+ * Disable locking to mimic Windows behavior that bypasses the issue
|
||||||
|
+ */
|
||||||
|
+UNUSUAL_DEV( 0x04c5, 0x2028, 0x0001, 0x0001,
|
||||||
|
+ "iODD",
|
||||||
|
+ "2531/2541",
|
||||||
|
+ USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE),
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Not sure who reported this originally but
|
||||||
|
* Pavel Machek <pavel@ucw.cz> reported that the extra US_FL_SINGLE_LUN
|
||||||
|
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
|
||||||
|
index 871c8b3920991..2d1d41c94e376 100644
|
||||||
|
--- a/fs/isofs/inode.c
|
||||||
|
+++ b/fs/isofs/inode.c
|
||||||
|
@@ -1265,6 +1265,8 @@ static int isofs_read_inode(struct inode *inode, int relocated)
|
||||||
|
|
||||||
|
de = (struct iso_directory_record *) (bh->b_data + offset);
|
||||||
|
de_len = *(unsigned char *) de;
|
||||||
|
+ if (de_len < sizeof(struct iso_directory_record))
|
||||||
|
+ goto fail;
|
||||||
|
|
||||||
|
if (offset + de_len > bufsize) {
|
||||||
|
int frag1 = bufsize - offset;
|
||||||
|
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
|
||||||
|
index 0a4c2d4d9f8d5..b43fa9d95a7a6 100644
|
||||||
|
--- a/include/asm-generic/pgtable.h
|
||||||
|
+++ b/include/asm-generic/pgtable.h
|
||||||
|
@@ -847,6 +847,19 @@ static inline bool arch_has_pfn_modify_check(void)
|
||||||
|
#define io_remap_pfn_range remap_pfn_range
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if !defined(MAX_POSSIBLE_PHYSMEM_BITS) && !defined(CONFIG_64BIT)
|
||||||
|
+#ifdef CONFIG_PHYS_ADDR_T_64BIT
|
||||||
|
+/*
|
||||||
|
+ * ZSMALLOC needs to know the highest PFN on 32-bit architectures
|
||||||
|
+ * with physical address space extension, but falls back to
|
||||||
|
+ * BITS_PER_LONG otherwise.
|
||||||
|
+ */
|
||||||
|
+#error Missing MAX_POSSIBLE_PHYSMEM_BITS definition
|
||||||
|
+#else
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS 32
|
||||||
|
+#endif
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#ifndef has_transparent_hugepage
|
||||||
|
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||||
|
#define has_transparent_hugepage() 1
|
||||||
|
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
|
||||||
|
index 7acae2f2478d9..9c17a26555512 100644
|
||||||
|
--- a/kernel/printk/printk.c
|
||||||
|
+++ b/kernel/printk/printk.c
|
||||||
|
@@ -2035,8 +2035,15 @@ static int __init console_setup(char *str)
|
||||||
|
char *s, *options, *brl_options = NULL;
|
||||||
|
int idx;
|
||||||
|
|
||||||
|
- if (str[0] == 0)
|
||||||
|
+ /*
|
||||||
|
+ * console="" or console=null have been suggested as a way to
|
||||||
|
+ * disable console output. Use ttynull that has been created
|
||||||
|
+ * for exacly this purpose.
|
||||||
|
+ */
|
||||||
|
+ if (str[0] == 0 || strcmp(str, "null") == 0) {
|
||||||
|
+ __add_preferred_console("ttynull", 0, NULL, NULL);
|
||||||
|
return 1;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (_braille_console_setup(&str, &brl_options))
|
||||||
|
return 1;
|
||||||
|
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
|
||||||
|
index 8db3c2b27a175..2b7bfd97587a0 100644
|
||||||
|
--- a/mm/zsmalloc.c
|
||||||
|
+++ b/mm/zsmalloc.c
|
||||||
|
@@ -83,18 +83,19 @@
|
||||||
|
* This is made more complicated by various memory models and PAE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
-#ifndef MAX_PHYSMEM_BITS
|
||||||
|
-#ifdef CONFIG_HIGHMEM64G
|
||||||
|
-#define MAX_PHYSMEM_BITS 36
|
||||||
|
-#else /* !CONFIG_HIGHMEM64G */
|
||||||
|
+#ifndef MAX_POSSIBLE_PHYSMEM_BITS
|
||||||
|
+#ifdef MAX_PHYSMEM_BITS
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS MAX_PHYSMEM_BITS
|
||||||
|
+#else
|
||||||
|
/*
|
||||||
|
* If this definition of MAX_PHYSMEM_BITS is used, OBJ_INDEX_BITS will just
|
||||||
|
* be PAGE_SHIFT
|
||||||
|
*/
|
||||||
|
-#define MAX_PHYSMEM_BITS BITS_PER_LONG
|
||||||
|
+#define MAX_POSSIBLE_PHYSMEM_BITS BITS_PER_LONG
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
-#define _PFN_BITS (MAX_PHYSMEM_BITS - PAGE_SHIFT)
|
||||||
|
+
|
||||||
|
+#define _PFN_BITS (MAX_POSSIBLE_PHYSMEM_BITS - PAGE_SHIFT)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Memory for allocating for handle keeps object position by
|
||||||
6223
patch/kernel/archive/sun50iw9-4.9/patch-4.9.290-291.patch
Normal file
6223
patch/kernel/archive/sun50iw9-4.9/patch-4.9.290-291.patch
Normal file
File diff suppressed because it is too large
Load Diff
3339
patch/kernel/archive/sun50iw9-4.9/patch-4.9.291-292.patch
Normal file
3339
patch/kernel/archive/sun50iw9-4.9/patch-4.9.291-292.patch
Normal file
File diff suppressed because it is too large
Load Diff
1401
patch/kernel/archive/sun50iw9-4.9/patch-4.9.292-293.patch
Normal file
1401
patch/kernel/archive/sun50iw9-4.9/patch-4.9.292-293.patch
Normal file
File diff suppressed because it is too large
Load Diff
1638
patch/kernel/archive/sun50iw9-4.9/patch-4.9.293-294.patch
Normal file
1638
patch/kernel/archive/sun50iw9-4.9/patch-4.9.293-294.patch
Normal file
File diff suppressed because it is too large
Load Diff
465
patch/kernel/archive/sun50iw9-4.9/patch-4.9.294-295.patch
Normal file
465
patch/kernel/archive/sun50iw9-4.9/patch-4.9.294-295.patch
Normal file
@@ -0,0 +1,465 @@
|
|||||||
|
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
|
||||||
|
index 57f52cdce32e4..07b53b2b13df8 100644
|
||||||
|
--- a/Documentation/networking/bonding.txt
|
||||||
|
+++ b/Documentation/networking/bonding.txt
|
||||||
|
@@ -191,11 +191,12 @@ ad_actor_sys_prio
|
||||||
|
ad_actor_system
|
||||||
|
|
||||||
|
In an AD system, this specifies the mac-address for the actor in
|
||||||
|
- protocol packet exchanges (LACPDUs). The value cannot be NULL or
|
||||||
|
- multicast. It is preferred to have the local-admin bit set for this
|
||||||
|
- mac but driver does not enforce it. If the value is not given then
|
||||||
|
- system defaults to using the masters' mac address as actors' system
|
||||||
|
- address.
|
||||||
|
+ protocol packet exchanges (LACPDUs). The value cannot be a multicast
|
||||||
|
+ address. If the all-zeroes MAC is specified, bonding will internally
|
||||||
|
+ use the MAC of the bond itself. It is preferred to have the
|
||||||
|
+ local-admin bit set for this mac but driver does not enforce it. If
|
||||||
|
+ the value is not given then system defaults to using the masters'
|
||||||
|
+ mac address as actors' system address.
|
||||||
|
|
||||||
|
This parameter has effect only in 802.3ad mode and is available through
|
||||||
|
SysFs interface.
|
||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 6f3b4e1e9a144..b5afdb8a75219 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 294
|
||||||
|
+SUBLEVEL = 295
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
|
||||||
|
index 9f157e7c51e75..2cac25a69a85d 100644
|
||||||
|
--- a/arch/arm/kernel/entry-armv.S
|
||||||
|
+++ b/arch/arm/kernel/entry-armv.S
|
||||||
|
@@ -631,11 +631,9 @@ call_fpe:
|
||||||
|
tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2
|
||||||
|
reteq lr
|
||||||
|
and r8, r0, #0x00000f00 @ mask out CP number
|
||||||
|
- THUMB( lsr r8, r8, #8 )
|
||||||
|
mov r7, #1
|
||||||
|
- add r6, r10, #TI_USED_CP
|
||||||
|
- ARM( strb r7, [r6, r8, lsr #8] ) @ set appropriate used_cp[]
|
||||||
|
- THUMB( strb r7, [r6, r8] ) @ set appropriate used_cp[]
|
||||||
|
+ add r6, r10, r8, lsr #8 @ add used_cp[] array offset first
|
||||||
|
+ strb r7, [r6, #TI_USED_CP] @ set appropriate used_cp[]
|
||||||
|
#ifdef CONFIG_IWMMXT
|
||||||
|
@ Test if we need to give access to iWMMXt coprocessors
|
||||||
|
ldr r5, [r10, #TI_FLAGS]
|
||||||
|
@@ -644,7 +642,7 @@ call_fpe:
|
||||||
|
bcs iwmmxt_task_enable
|
||||||
|
#endif
|
||||||
|
ARM( add pc, pc, r8, lsr #6 )
|
||||||
|
- THUMB( lsl r8, r8, #2 )
|
||||||
|
+ THUMB( lsr r8, r8, #6 )
|
||||||
|
THUMB( add pc, r8 )
|
||||||
|
nop
|
||||||
|
|
||||||
|
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
|
||||||
|
index e638e3bc3cb8a..6c40afcfe5b16 100644
|
||||||
|
--- a/arch/x86/include/asm/pgtable.h
|
||||||
|
+++ b/arch/x86/include/asm/pgtable.h
|
||||||
|
@@ -1028,8 +1028,8 @@ static inline pte_t pte_swp_clear_soft_dirty(pte_t pte)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#define PKRU_AD_BIT 0x1
|
||||||
|
-#define PKRU_WD_BIT 0x2
|
||||||
|
+#define PKRU_AD_BIT 0x1u
|
||||||
|
+#define PKRU_WD_BIT 0x2u
|
||||||
|
#define PKRU_BITS_PER_PKEY 2
|
||||||
|
|
||||||
|
static inline bool __pkru_allows_read(u32 pkru, u16 pkey)
|
||||||
|
diff --git a/drivers/hid/hid-holtek-mouse.c b/drivers/hid/hid-holtek-mouse.c
|
||||||
|
index 27c08ddab0e1a..96db7e96fcea9 100644
|
||||||
|
--- a/drivers/hid/hid-holtek-mouse.c
|
||||||
|
+++ b/drivers/hid/hid-holtek-mouse.c
|
||||||
|
@@ -68,8 +68,23 @@ static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||||
|
static int holtek_mouse_probe(struct hid_device *hdev,
|
||||||
|
const struct hid_device_id *id)
|
||||||
|
{
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
if (!hid_is_usb(hdev))
|
||||||
|
return -EINVAL;
|
||||||
|
+
|
||||||
|
+ ret = hid_parse(hdev);
|
||||||
|
+ if (ret) {
|
||||||
|
+ hid_err(hdev, "hid parse failed: %d\n", ret);
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
|
||||||
|
+ if (ret) {
|
||||||
|
+ hid_err(hdev, "hw start failed: %d\n", ret);
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
|
||||||
|
index 293d1184976b3..1e9f029a328a6 100644
|
||||||
|
--- a/drivers/hwmon/lm90.c
|
||||||
|
+++ b/drivers/hwmon/lm90.c
|
||||||
|
@@ -196,6 +196,7 @@ enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680,
|
||||||
|
#define LM90_STATUS_RHIGH (1 << 4) /* remote high temp limit tripped */
|
||||||
|
#define LM90_STATUS_LLOW (1 << 5) /* local low temp limit tripped */
|
||||||
|
#define LM90_STATUS_LHIGH (1 << 6) /* local high temp limit tripped */
|
||||||
|
+#define LM90_STATUS_BUSY (1 << 7) /* conversion is ongoing */
|
||||||
|
|
||||||
|
#define MAX6696_STATUS2_R2THRM (1 << 1) /* remote2 THERM limit tripped */
|
||||||
|
#define MAX6696_STATUS2_R2OPEN (1 << 2) /* remote2 is an open circuit */
|
||||||
|
@@ -692,7 +693,7 @@ static int lm90_update_device(struct device *dev)
|
||||||
|
val = lm90_read_reg(client, LM90_REG_R_STATUS);
|
||||||
|
if (val < 0)
|
||||||
|
return val;
|
||||||
|
- data->alarms = val; /* lower 8 bit of alarms */
|
||||||
|
+ data->alarms = val & ~LM90_STATUS_BUSY;
|
||||||
|
|
||||||
|
if (data->kind == max6696) {
|
||||||
|
val = lm90_select_remote_channel(client, data, 1);
|
||||||
|
@@ -1345,12 +1346,11 @@ static int lm90_detect(struct i2c_client *client,
|
||||||
|
if (man_id < 0 || chip_id < 0 || config1 < 0 || convrate < 0)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
- if (man_id == 0x01 || man_id == 0x5C || man_id == 0x41) {
|
||||||
|
+ if (man_id == 0x01 || man_id == 0x5C || man_id == 0xA1) {
|
||||||
|
config2 = i2c_smbus_read_byte_data(client, LM90_REG_R_CONFIG2);
|
||||||
|
if (config2 < 0)
|
||||||
|
return -ENODEV;
|
||||||
|
- } else
|
||||||
|
- config2 = 0; /* Make compiler happy */
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if ((address == 0x4C || address == 0x4D)
|
||||||
|
&& man_id == 0x01) { /* National Semiconductor */
|
||||||
|
diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c b/drivers/infiniband/hw/qib/qib_user_sdma.c
|
||||||
|
index 0dc15f95e7626..2d0b992579d6f 100644
|
||||||
|
--- a/drivers/infiniband/hw/qib/qib_user_sdma.c
|
||||||
|
+++ b/drivers/infiniband/hw/qib/qib_user_sdma.c
|
||||||
|
@@ -946,7 +946,7 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd,
|
||||||
|
&addrlimit) ||
|
||||||
|
addrlimit > type_max(typeof(pkt->addrlimit))) {
|
||||||
|
ret = -EINVAL;
|
||||||
|
- goto free_pbc;
|
||||||
|
+ goto free_pkt;
|
||||||
|
}
|
||||||
|
pkt->addrlimit = addrlimit;
|
||||||
|
|
||||||
|
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
|
||||||
|
index 258cb3999b0e3..5c6a962363096 100644
|
||||||
|
--- a/drivers/net/bonding/bond_options.c
|
||||||
|
+++ b/drivers/net/bonding/bond_options.c
|
||||||
|
@@ -1408,7 +1408,7 @@ static int bond_option_ad_actor_system_set(struct bonding *bond,
|
||||||
|
mac = (u8 *)&newval->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (!is_valid_ether_addr(mac))
|
||||||
|
+ if (is_multicast_ether_addr(mac))
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
netdev_info(bond->dev, "Setting ad_actor_system to %pM\n", mac);
|
||||||
|
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c
|
||||||
|
index 792a1afabf5d1..5ab088d02fbad 100644
|
||||||
|
--- a/drivers/net/can/usb/kvaser_usb.c
|
||||||
|
+++ b/drivers/net/can/usb/kvaser_usb.c
|
||||||
|
@@ -31,7 +31,10 @@
|
||||||
|
#define USB_SEND_TIMEOUT 1000 /* msecs */
|
||||||
|
#define USB_RECV_TIMEOUT 1000 /* msecs */
|
||||||
|
#define RX_BUFFER_SIZE 3072
|
||||||
|
-#define CAN_USB_CLOCK 8000000
|
||||||
|
+#define KVASER_USB_CAN_CLOCK_8MHZ 8000000
|
||||||
|
+#define KVASER_USB_CAN_CLOCK_16MHZ 16000000
|
||||||
|
+#define KVASER_USB_CAN_CLOCK_24MHZ 24000000
|
||||||
|
+#define KVASER_USB_CAN_CLOCK_32MHZ 32000000
|
||||||
|
#define MAX_NET_DEVICES 3
|
||||||
|
#define MAX_USBCAN_NET_DEVICES 2
|
||||||
|
|
||||||
|
@@ -142,6 +145,12 @@ static inline bool kvaser_is_usbcan(const struct usb_device_id *id)
|
||||||
|
#define CMD_LEAF_USB_THROTTLE 77
|
||||||
|
#define CMD_LEAF_LOG_MESSAGE 106
|
||||||
|
|
||||||
|
+/* Leaf frequency options */
|
||||||
|
+#define KVASER_USB_LEAF_SWOPTION_FREQ_MASK 0x60
|
||||||
|
+#define KVASER_USB_LEAF_SWOPTION_FREQ_16_MHZ_CLK 0
|
||||||
|
+#define KVASER_USB_LEAF_SWOPTION_FREQ_32_MHZ_CLK BIT(5)
|
||||||
|
+#define KVASER_USB_LEAF_SWOPTION_FREQ_24_MHZ_CLK BIT(6)
|
||||||
|
+
|
||||||
|
/* error factors */
|
||||||
|
#define M16C_EF_ACKE BIT(0)
|
||||||
|
#define M16C_EF_CRCE BIT(1)
|
||||||
|
@@ -472,6 +481,8 @@ struct kvaser_usb {
|
||||||
|
bool rxinitdone;
|
||||||
|
void *rxbuf[MAX_RX_URBS];
|
||||||
|
dma_addr_t rxbuf_dma[MAX_RX_URBS];
|
||||||
|
+
|
||||||
|
+ struct can_clock clock;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct kvaser_usb_net_priv {
|
||||||
|
@@ -652,6 +663,27 @@ static int kvaser_usb_send_simple_msg(const struct kvaser_usb *dev,
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void kvaser_usb_get_software_info_leaf(struct kvaser_usb *dev,
|
||||||
|
+ const struct leaf_msg_softinfo *softinfo)
|
||||||
|
+{
|
||||||
|
+ u32 sw_options = le32_to_cpu(softinfo->sw_options);
|
||||||
|
+
|
||||||
|
+ dev->fw_version = le32_to_cpu(softinfo->fw_version);
|
||||||
|
+ dev->max_tx_urbs = le16_to_cpu(softinfo->max_outstanding_tx);
|
||||||
|
+
|
||||||
|
+ switch (sw_options & KVASER_USB_LEAF_SWOPTION_FREQ_MASK) {
|
||||||
|
+ case KVASER_USB_LEAF_SWOPTION_FREQ_16_MHZ_CLK:
|
||||||
|
+ dev->clock.freq = KVASER_USB_CAN_CLOCK_16MHZ;
|
||||||
|
+ break;
|
||||||
|
+ case KVASER_USB_LEAF_SWOPTION_FREQ_24_MHZ_CLK:
|
||||||
|
+ dev->clock.freq = KVASER_USB_CAN_CLOCK_24MHZ;
|
||||||
|
+ break;
|
||||||
|
+ case KVASER_USB_LEAF_SWOPTION_FREQ_32_MHZ_CLK:
|
||||||
|
+ dev->clock.freq = KVASER_USB_CAN_CLOCK_32MHZ;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int kvaser_usb_get_software_info(struct kvaser_usb *dev)
|
||||||
|
{
|
||||||
|
struct kvaser_msg msg;
|
||||||
|
@@ -667,14 +699,13 @@ static int kvaser_usb_get_software_info(struct kvaser_usb *dev)
|
||||||
|
|
||||||
|
switch (dev->family) {
|
||||||
|
case KVASER_LEAF:
|
||||||
|
- dev->fw_version = le32_to_cpu(msg.u.leaf.softinfo.fw_version);
|
||||||
|
- dev->max_tx_urbs =
|
||||||
|
- le16_to_cpu(msg.u.leaf.softinfo.max_outstanding_tx);
|
||||||
|
+ kvaser_usb_get_software_info_leaf(dev, &msg.u.leaf.softinfo);
|
||||||
|
break;
|
||||||
|
case KVASER_USBCAN:
|
||||||
|
dev->fw_version = le32_to_cpu(msg.u.usbcan.softinfo.fw_version);
|
||||||
|
dev->max_tx_urbs =
|
||||||
|
le16_to_cpu(msg.u.usbcan.softinfo.max_outstanding_tx);
|
||||||
|
+ dev->clock.freq = KVASER_USB_CAN_CLOCK_8MHZ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1926,7 +1957,7 @@ static int kvaser_usb_init_one(struct usb_interface *intf,
|
||||||
|
kvaser_usb_reset_tx_urb_contexts(priv);
|
||||||
|
|
||||||
|
priv->can.state = CAN_STATE_STOPPED;
|
||||||
|
- priv->can.clock.freq = CAN_USB_CLOCK;
|
||||||
|
+ priv->can.clock.freq = dev->clock.freq;
|
||||||
|
priv->can.bittiming_const = &kvaser_usb_bittiming_const;
|
||||||
|
priv->can.do_set_bittiming = kvaser_usb_set_bittiming;
|
||||||
|
priv->can.do_set_mode = kvaser_usb_set_mode;
|
||||||
|
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
|
||||||
|
index 5f327659efa7a..85b688f60b876 100644
|
||||||
|
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
|
||||||
|
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
|
||||||
|
@@ -202,7 +202,7 @@ int qlcnic_sriov_get_vf_vport_info(struct qlcnic_adapter *,
|
||||||
|
struct qlcnic_info *, u16);
|
||||||
|
int qlcnic_sriov_cfg_vf_guest_vlan(struct qlcnic_adapter *, u16, u8);
|
||||||
|
void qlcnic_sriov_free_vlans(struct qlcnic_adapter *);
|
||||||
|
-void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *);
|
||||||
|
+int qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *);
|
||||||
|
bool qlcnic_sriov_check_any_vlan(struct qlcnic_vf_info *);
|
||||||
|
void qlcnic_sriov_del_vlan_id(struct qlcnic_sriov *,
|
||||||
|
struct qlcnic_vf_info *, u16);
|
||||||
|
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
|
||||||
|
index c58180f408448..44caa7c2077ec 100644
|
||||||
|
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
|
||||||
|
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
|
||||||
|
@@ -433,7 +433,7 @@ static int qlcnic_sriov_set_guest_vlan_mode(struct qlcnic_adapter *adapter,
|
||||||
|
struct qlcnic_cmd_args *cmd)
|
||||||
|
{
|
||||||
|
struct qlcnic_sriov *sriov = adapter->ahw->sriov;
|
||||||
|
- int i, num_vlans;
|
||||||
|
+ int i, num_vlans, ret;
|
||||||
|
u16 *vlans;
|
||||||
|
|
||||||
|
if (sriov->allowed_vlans)
|
||||||
|
@@ -444,7 +444,9 @@ static int qlcnic_sriov_set_guest_vlan_mode(struct qlcnic_adapter *adapter,
|
||||||
|
dev_info(&adapter->pdev->dev, "Number of allowed Guest VLANs = %d\n",
|
||||||
|
sriov->num_allowed_vlans);
|
||||||
|
|
||||||
|
- qlcnic_sriov_alloc_vlans(adapter);
|
||||||
|
+ ret = qlcnic_sriov_alloc_vlans(adapter);
|
||||||
|
+ if (ret)
|
||||||
|
+ return ret;
|
||||||
|
|
||||||
|
if (!sriov->any_vlan)
|
||||||
|
return 0;
|
||||||
|
@@ -2164,7 +2166,7 @@ static int qlcnic_sriov_vf_resume(struct qlcnic_adapter *adapter)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
-void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter)
|
||||||
|
+int qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter)
|
||||||
|
{
|
||||||
|
struct qlcnic_sriov *sriov = adapter->ahw->sriov;
|
||||||
|
struct qlcnic_vf_info *vf;
|
||||||
|
@@ -2174,7 +2176,11 @@ void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter)
|
||||||
|
vf = &sriov->vf_info[i];
|
||||||
|
vf->sriov_vlans = kcalloc(sriov->num_allowed_vlans,
|
||||||
|
sizeof(*vf->sriov_vlans), GFP_KERNEL);
|
||||||
|
+ if (!vf->sriov_vlans)
|
||||||
|
+ return -ENOMEM;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void qlcnic_sriov_free_vlans(struct qlcnic_adapter *adapter)
|
||||||
|
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
|
||||||
|
index 50eaafa3eaba3..c9f2cd2462230 100644
|
||||||
|
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
|
||||||
|
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
|
||||||
|
@@ -598,7 +598,9 @@ static int __qlcnic_pci_sriov_enable(struct qlcnic_adapter *adapter,
|
||||||
|
if (err)
|
||||||
|
goto del_flr_queue;
|
||||||
|
|
||||||
|
- qlcnic_sriov_alloc_vlans(adapter);
|
||||||
|
+ err = qlcnic_sriov_alloc_vlans(adapter);
|
||||||
|
+ if (err)
|
||||||
|
+ goto del_flr_queue;
|
||||||
|
|
||||||
|
return err;
|
||||||
|
|
||||||
|
diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
|
||||||
|
index d0cf971aa4ebe..4237bd311e0e6 100644
|
||||||
|
--- a/drivers/net/ethernet/smsc/smc911x.c
|
||||||
|
+++ b/drivers/net/ethernet/smsc/smc911x.c
|
||||||
|
@@ -2088,6 +2088,11 @@ static int smc911x_drv_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
|
ndev->dma = (unsigned char)-1;
|
||||||
|
ndev->irq = platform_get_irq(pdev, 0);
|
||||||
|
+ if (ndev->irq < 0) {
|
||||||
|
+ ret = ndev->irq;
|
||||||
|
+ goto release_both;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
lp = netdev_priv(ndev);
|
||||||
|
lp->netdev = ndev;
|
||||||
|
#ifdef SMC_DYNAMIC_BUS_CONFIG
|
||||||
|
diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
|
||||||
|
index 440047a239f57..26bb43a675131 100644
|
||||||
|
--- a/drivers/net/fjes/fjes_main.c
|
||||||
|
+++ b/drivers/net/fjes/fjes_main.c
|
||||||
|
@@ -1219,6 +1219,11 @@ static int fjes_probe(struct platform_device *plat_dev)
|
||||||
|
hw->hw_res.start = res->start;
|
||||||
|
hw->hw_res.size = resource_size(res);
|
||||||
|
hw->hw_res.irq = platform_get_irq(plat_dev, 0);
|
||||||
|
+ if (hw->hw_res.irq < 0) {
|
||||||
|
+ err = hw->hw_res.irq;
|
||||||
|
+ goto err_free_control_wq;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
err = fjes_hw_init(&adapter->hw);
|
||||||
|
if (err)
|
||||||
|
goto err_free_control_wq;
|
||||||
|
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
|
||||||
|
index 76340bc3cf445..8d85cedb4bf5b 100644
|
||||||
|
--- a/drivers/net/hamradio/mkiss.c
|
||||||
|
+++ b/drivers/net/hamradio/mkiss.c
|
||||||
|
@@ -803,13 +803,14 @@ static void mkiss_close(struct tty_struct *tty)
|
||||||
|
*/
|
||||||
|
netif_stop_queue(ax->dev);
|
||||||
|
|
||||||
|
- /* Free all AX25 frame buffers. */
|
||||||
|
+ unregister_netdev(ax->dev);
|
||||||
|
+
|
||||||
|
+ /* Free all AX25 frame buffers after unreg. */
|
||||||
|
kfree(ax->rbuff);
|
||||||
|
kfree(ax->xbuff);
|
||||||
|
|
||||||
|
ax->tty = NULL;
|
||||||
|
|
||||||
|
- unregister_netdev(ax->dev);
|
||||||
|
free_netdev(ax->dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
|
||||||
|
index 7752cc09a1da5..580c1e7666a45 100644
|
||||||
|
--- a/drivers/net/usb/lan78xx.c
|
||||||
|
+++ b/drivers/net/usb/lan78xx.c
|
||||||
|
@@ -67,6 +67,8 @@
|
||||||
|
#define LAN7850_USB_PRODUCT_ID (0x7850)
|
||||||
|
#define LAN78XX_EEPROM_MAGIC (0x78A5)
|
||||||
|
#define LAN78XX_OTP_MAGIC (0x78F3)
|
||||||
|
+#define AT29M2AF_USB_VENDOR_ID (0x07C9)
|
||||||
|
+#define AT29M2AF_USB_PRODUCT_ID (0x0012)
|
||||||
|
|
||||||
|
#define MII_READ 1
|
||||||
|
#define MII_WRITE 0
|
||||||
|
@@ -3756,6 +3758,10 @@ static const struct usb_device_id products[] = {
|
||||||
|
/* LAN7850 USB Gigabit Ethernet Device */
|
||||||
|
USB_DEVICE(LAN78XX_USB_VENDOR_ID, LAN7850_USB_PRODUCT_ID),
|
||||||
|
},
|
||||||
|
+ {
|
||||||
|
+ /* ATM2-AF USB Gigabit Ethernet Device */
|
||||||
|
+ USB_DEVICE(AT29M2AF_USB_VENDOR_ID, AT29M2AF_USB_PRODUCT_ID),
|
||||||
|
+ },
|
||||||
|
{},
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(usb, products);
|
||||||
|
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
|
||||||
|
index 64fede18aa33f..f4c8567e91b38 100644
|
||||||
|
--- a/net/ax25/af_ax25.c
|
||||||
|
+++ b/net/ax25/af_ax25.c
|
||||||
|
@@ -88,8 +88,10 @@ static void ax25_kill_by_device(struct net_device *dev)
|
||||||
|
again:
|
||||||
|
ax25_for_each(s, &ax25_list) {
|
||||||
|
if (s->ax25_dev == ax25_dev) {
|
||||||
|
- s->ax25_dev = NULL;
|
||||||
|
spin_unlock_bh(&ax25_list_lock);
|
||||||
|
+ lock_sock(s->sk);
|
||||||
|
+ s->ax25_dev = NULL;
|
||||||
|
+ release_sock(s->sk);
|
||||||
|
ax25_disconnect(s, ENETUNREACH);
|
||||||
|
spin_lock_bh(&ax25_list_lock);
|
||||||
|
|
||||||
|
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
|
||||||
|
index f6aa532bcbf64..1e7945df39928 100644
|
||||||
|
--- a/net/phonet/pep.c
|
||||||
|
+++ b/net/phonet/pep.c
|
||||||
|
@@ -956,6 +956,8 @@ static int pep_ioctl(struct sock *sk, int cmd, unsigned long arg)
|
||||||
|
ret = -EBUSY;
|
||||||
|
else if (sk->sk_state == TCP_ESTABLISHED)
|
||||||
|
ret = -EISCONN;
|
||||||
|
+ else if (!pn->pn_sk.sobject)
|
||||||
|
+ ret = -EADDRNOTAVAIL;
|
||||||
|
else
|
||||||
|
ret = pep_sock_enable(sk, NULL, 0);
|
||||||
|
release_sock(sk);
|
||||||
|
diff --git a/sound/core/jack.c b/sound/core/jack.c
|
||||||
|
index f652e90efd7e7..5ddf81f091fa9 100644
|
||||||
|
--- a/sound/core/jack.c
|
||||||
|
+++ b/sound/core/jack.c
|
||||||
|
@@ -234,6 +234,10 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
jack->id = kstrdup(id, GFP_KERNEL);
|
||||||
|
+ if (jack->id == NULL) {
|
||||||
|
+ kfree(jack);
|
||||||
|
+ return -ENOMEM;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
/* don't creat input device for phantom jack */
|
||||||
|
if (!phantom_jack) {
|
||||||
|
diff --git a/sound/drivers/opl3/opl3_midi.c b/sound/drivers/opl3/opl3_midi.c
|
||||||
|
index 7821b07415a78..ff67c4b67e264 100644
|
||||||
|
--- a/sound/drivers/opl3/opl3_midi.c
|
||||||
|
+++ b/sound/drivers/opl3/opl3_midi.c
|
||||||
|
@@ -415,7 +415,7 @@ void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
|
||||||
|
}
|
||||||
|
if (instr_4op) {
|
||||||
|
vp2 = &opl3->voices[voice + 3];
|
||||||
|
- if (vp->state > 0) {
|
||||||
|
+ if (vp2->state > 0) {
|
||||||
|
opl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK +
|
||||||
|
voice_offset + 3);
|
||||||
|
reg_val = vp->keyon_reg & ~OPL3_KEYON_BIT;
|
||||||
303
patch/kernel/archive/sun50iw9-4.9/patch-4.9.295-296.patch
Normal file
303
patch/kernel/archive/sun50iw9-4.9/patch-4.9.295-296.patch
Normal file
@@ -0,0 +1,303 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index b5afdb8a75219..1ec880bcdb2d6 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 295
|
||||||
|
+SUBLEVEL = 296
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
|
||||||
|
index 2d2422705ccf7..da9813f09d7d7 100644
|
||||||
|
--- a/drivers/hid/Kconfig
|
||||||
|
+++ b/drivers/hid/Kconfig
|
||||||
|
@@ -136,6 +136,7 @@ config HID_APPLEIR
|
||||||
|
|
||||||
|
config HID_ASUS
|
||||||
|
tristate "Asus"
|
||||||
|
+ depends on USB_HID
|
||||||
|
depends on I2C_HID
|
||||||
|
---help---
|
||||||
|
Support for Asus notebook built-in keyboard via i2c.
|
||||||
|
diff --git a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c
|
||||||
|
index f4445a4e8d6a5..cfa1be4ad8689 100644
|
||||||
|
--- a/drivers/input/joystick/spaceball.c
|
||||||
|
+++ b/drivers/input/joystick/spaceball.c
|
||||||
|
@@ -35,6 +35,7 @@
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/input.h>
|
||||||
|
#include <linux/serio.h>
|
||||||
|
+#include <asm/unaligned.h>
|
||||||
|
|
||||||
|
#define DRIVER_DESC "SpaceTec SpaceBall 2003/3003/4000 FLX driver"
|
||||||
|
|
||||||
|
@@ -91,9 +92,15 @@ static void spaceball_process_packet(struct spaceball* spaceball)
|
||||||
|
|
||||||
|
case 'D': /* Ball data */
|
||||||
|
if (spaceball->idx != 15) return;
|
||||||
|
- for (i = 0; i < 6; i++)
|
||||||
|
+ /*
|
||||||
|
+ * Skip first three bytes; read six axes worth of data.
|
||||||
|
+ * Axis values are signed 16-bit big-endian.
|
||||||
|
+ */
|
||||||
|
+ data += 3;
|
||||||
|
+ for (i = 0; i < ARRAY_SIZE(spaceball_axes); i++) {
|
||||||
|
input_report_abs(dev, spaceball_axes[i],
|
||||||
|
- (__s16)((data[2 * i + 3] << 8) | data[2 * i + 2]));
|
||||||
|
+ (__s16)get_unaligned_be16(&data[i * 2]));
|
||||||
|
+ }
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'K': /* Button data */
|
||||||
|
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
|
||||||
|
index ef234c9b2f2f5..11773838a34d4 100644
|
||||||
|
--- a/drivers/input/mouse/appletouch.c
|
||||||
|
+++ b/drivers/input/mouse/appletouch.c
|
||||||
|
@@ -929,6 +929,8 @@ static int atp_probe(struct usb_interface *iface,
|
||||||
|
set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
|
||||||
|
set_bit(BTN_LEFT, input_dev->keybit);
|
||||||
|
|
||||||
|
+ INIT_WORK(&dev->work, atp_reinit);
|
||||||
|
+
|
||||||
|
error = input_register_device(dev->input);
|
||||||
|
if (error)
|
||||||
|
goto err_free_buffer;
|
||||||
|
@@ -936,8 +938,6 @@ static int atp_probe(struct usb_interface *iface,
|
||||||
|
/* save our data pointer in this interface device */
|
||||||
|
usb_set_intfdata(iface, dev);
|
||||||
|
|
||||||
|
- INIT_WORK(&dev->work, atp_reinit);
|
||||||
|
-
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
err_free_buffer:
|
||||||
|
diff --git a/drivers/net/ethernet/freescale/fman/fman_port.c b/drivers/net/ethernet/freescale/fman/fman_port.c
|
||||||
|
index 4986f6ba278a3..45ac5cf717ea8 100644
|
||||||
|
--- a/drivers/net/ethernet/freescale/fman/fman_port.c
|
||||||
|
+++ b/drivers/net/ethernet/freescale/fman/fman_port.c
|
||||||
|
@@ -1658,7 +1658,7 @@ static int fman_port_probe(struct platform_device *of_dev)
|
||||||
|
fman = dev_get_drvdata(&fm_pdev->dev);
|
||||||
|
if (!fman) {
|
||||||
|
err = -EINVAL;
|
||||||
|
- goto return_err;
|
||||||
|
+ goto put_device;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = of_property_read_u32(port_node, "cell-index", &val);
|
||||||
|
@@ -1666,7 +1666,7 @@ static int fman_port_probe(struct platform_device *of_dev)
|
||||||
|
dev_err(port->dev, "%s: reading cell-index for %s failed\n",
|
||||||
|
__func__, port_node->full_name);
|
||||||
|
err = -EINVAL;
|
||||||
|
- goto return_err;
|
||||||
|
+ goto put_device;
|
||||||
|
}
|
||||||
|
port_id = (u8)val;
|
||||||
|
port->dts_params.id = port_id;
|
||||||
|
@@ -1700,7 +1700,7 @@ static int fman_port_probe(struct platform_device *of_dev)
|
||||||
|
} else {
|
||||||
|
dev_err(port->dev, "%s: Illegal port type\n", __func__);
|
||||||
|
err = -EINVAL;
|
||||||
|
- goto return_err;
|
||||||
|
+ goto put_device;
|
||||||
|
}
|
||||||
|
|
||||||
|
port->dts_params.type = port_type;
|
||||||
|
@@ -1714,7 +1714,7 @@ static int fman_port_probe(struct platform_device *of_dev)
|
||||||
|
dev_err(port->dev, "%s: incorrect qman-channel-id\n",
|
||||||
|
__func__);
|
||||||
|
err = -EINVAL;
|
||||||
|
- goto return_err;
|
||||||
|
+ goto put_device;
|
||||||
|
}
|
||||||
|
port->dts_params.qman_channel_id = qman_channel_id;
|
||||||
|
}
|
||||||
|
@@ -1724,7 +1724,7 @@ static int fman_port_probe(struct platform_device *of_dev)
|
||||||
|
dev_err(port->dev, "%s: of_address_to_resource() failed\n",
|
||||||
|
__func__);
|
||||||
|
err = -ENOMEM;
|
||||||
|
- goto return_err;
|
||||||
|
+ goto put_device;
|
||||||
|
}
|
||||||
|
|
||||||
|
port->dts_params.fman = fman;
|
||||||
|
@@ -1749,6 +1749,8 @@ static int fman_port_probe(struct platform_device *of_dev)
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
+put_device:
|
||||||
|
+ put_device(&fm_pdev->dev);
|
||||||
|
return_err:
|
||||||
|
of_node_put(port_node);
|
||||||
|
free_port:
|
||||||
|
diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c
|
||||||
|
index a66be137324c0..76f5703bc4f65 100644
|
||||||
|
--- a/drivers/platform/x86/apple-gmux.c
|
||||||
|
+++ b/drivers/platform/x86/apple-gmux.c
|
||||||
|
@@ -628,7 +628,7 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
|
||||||
|
}
|
||||||
|
|
||||||
|
gmux_data->iostart = res->start;
|
||||||
|
- gmux_data->iolen = res->end - res->start;
|
||||||
|
+ gmux_data->iolen = resource_size(res);
|
||||||
|
|
||||||
|
if (gmux_data->iolen < GMUX_MIN_IO_LEN) {
|
||||||
|
pr_err("gmux I/O region too small (%lu < %u)\n",
|
||||||
|
diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
|
||||||
|
index 4d2172c115c6e..90057c31d01c6 100644
|
||||||
|
--- a/drivers/scsi/vmw_pvscsi.c
|
||||||
|
+++ b/drivers/scsi/vmw_pvscsi.c
|
||||||
|
@@ -581,9 +581,12 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter,
|
||||||
|
* Commands like INQUIRY may transfer less data than
|
||||||
|
* requested by the initiator via bufflen. Set residual
|
||||||
|
* count to make upper layer aware of the actual amount
|
||||||
|
- * of data returned.
|
||||||
|
+ * of data returned. There are cases when controller
|
||||||
|
+ * returns zero dataLen with non zero data - do not set
|
||||||
|
+ * residual count in that case.
|
||||||
|
*/
|
||||||
|
- scsi_set_resid(cmd, scsi_bufflen(cmd) - e->dataLen);
|
||||||
|
+ if (e->dataLen && (e->dataLen < scsi_bufflen(cmd)))
|
||||||
|
+ scsi_set_resid(cmd, scsi_bufflen(cmd) - e->dataLen);
|
||||||
|
cmd->result = (DID_OK << 16);
|
||||||
|
break;
|
||||||
|
|
||||||
|
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
|
||||||
|
index bcb2daf81b05d..0336392686935 100644
|
||||||
|
--- a/drivers/usb/gadget/function/f_fs.c
|
||||||
|
+++ b/drivers/usb/gadget/function/f_fs.c
|
||||||
|
@@ -1667,11 +1667,15 @@ static void ffs_data_clear(struct ffs_data *ffs)
|
||||||
|
|
||||||
|
BUG_ON(ffs->gadget);
|
||||||
|
|
||||||
|
- if (ffs->epfiles)
|
||||||
|
+ if (ffs->epfiles) {
|
||||||
|
ffs_epfiles_destroy(ffs->epfiles, ffs->eps_count);
|
||||||
|
+ ffs->epfiles = NULL;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- if (ffs->ffs_eventfd)
|
||||||
|
+ if (ffs->ffs_eventfd) {
|
||||||
|
eventfd_ctx_put(ffs->ffs_eventfd);
|
||||||
|
+ ffs->ffs_eventfd = NULL;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
kfree(ffs->raw_descs_data);
|
||||||
|
kfree(ffs->raw_strings);
|
||||||
|
@@ -1684,7 +1688,6 @@ static void ffs_data_reset(struct ffs_data *ffs)
|
||||||
|
|
||||||
|
ffs_data_clear(ffs);
|
||||||
|
|
||||||
|
- ffs->epfiles = NULL;
|
||||||
|
ffs->raw_descs_data = NULL;
|
||||||
|
ffs->raw_descs = NULL;
|
||||||
|
ffs->raw_strings = NULL;
|
||||||
|
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
|
||||||
|
index ae67f6383ca32..30c8eeed95074 100644
|
||||||
|
--- a/drivers/usb/host/xhci-pci.c
|
||||||
|
+++ b/drivers/usb/host/xhci-pci.c
|
||||||
|
@@ -92,7 +92,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
||||||
|
/* Look for vendor-specific quirks */
|
||||||
|
if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
|
||||||
|
(pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK ||
|
||||||
|
- pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 ||
|
||||||
|
pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1400)) {
|
||||||
|
if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
|
||||||
|
pdev->revision == 0x0) {
|
||||||
|
@@ -127,6 +126,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
||||||
|
pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1009)
|
||||||
|
xhci->quirks |= XHCI_BROKEN_STREAMS;
|
||||||
|
|
||||||
|
+ if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
|
||||||
|
+ pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1100)
|
||||||
|
+ xhci->quirks |= XHCI_TRUST_TX_LENGTH;
|
||||||
|
+
|
||||||
|
if (pdev->vendor == PCI_VENDOR_ID_NEC)
|
||||||
|
xhci->quirks |= XHCI_NEC_HOST;
|
||||||
|
|
||||||
|
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
|
||||||
|
index 399f39ff8048d..1b6d54a328bad 100644
|
||||||
|
--- a/include/uapi/linux/nfc.h
|
||||||
|
+++ b/include/uapi/linux/nfc.h
|
||||||
|
@@ -261,7 +261,7 @@ enum nfc_sdp_attr {
|
||||||
|
#define NFC_SE_ENABLED 0x1
|
||||||
|
|
||||||
|
struct sockaddr_nfc {
|
||||||
|
- sa_family_t sa_family;
|
||||||
|
+ __kernel_sa_family_t sa_family;
|
||||||
|
__u32 dev_idx;
|
||||||
|
__u32 target_idx;
|
||||||
|
__u32 nfc_protocol;
|
||||||
|
@@ -269,14 +269,14 @@ struct sockaddr_nfc {
|
||||||
|
|
||||||
|
#define NFC_LLCP_MAX_SERVICE_NAME 63
|
||||||
|
struct sockaddr_nfc_llcp {
|
||||||
|
- sa_family_t sa_family;
|
||||||
|
+ __kernel_sa_family_t sa_family;
|
||||||
|
__u32 dev_idx;
|
||||||
|
__u32 target_idx;
|
||||||
|
__u32 nfc_protocol;
|
||||||
|
__u8 dsap; /* Destination SAP, if known */
|
||||||
|
__u8 ssap; /* Source SAP to be bound to */
|
||||||
|
char service_name[NFC_LLCP_MAX_SERVICE_NAME]; /* Service name URI */;
|
||||||
|
- size_t service_name_len;
|
||||||
|
+ __kernel_size_t service_name_len;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* NFC socket protocols */
|
||||||
|
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
|
||||||
|
index 689246d079ad4..a8563745980b4 100644
|
||||||
|
--- a/net/ipv4/af_inet.c
|
||||||
|
+++ b/net/ipv4/af_inet.c
|
||||||
|
@@ -1833,6 +1833,10 @@ static int __init inet_init(void)
|
||||||
|
|
||||||
|
tcp_v4_init();
|
||||||
|
|
||||||
|
+ /* Initialise per-cpu ipv4 mibs */
|
||||||
|
+ if (init_ipv4_mibs())
|
||||||
|
+ panic("%s: Cannot init ipv4 mibs\n", __func__);
|
||||||
|
+
|
||||||
|
/* Setup TCP slab cache for open requests. */
|
||||||
|
tcp_init();
|
||||||
|
|
||||||
|
@@ -1861,12 +1865,6 @@ static int __init inet_init(void)
|
||||||
|
|
||||||
|
if (init_inet_pernet_ops())
|
||||||
|
pr_crit("%s: Cannot init ipv4 inet pernet ops\n", __func__);
|
||||||
|
- /*
|
||||||
|
- * Initialise per-cpu ipv4 mibs
|
||||||
|
- */
|
||||||
|
-
|
||||||
|
- if (init_ipv4_mibs())
|
||||||
|
- pr_crit("%s: Cannot init ipv4 mibs\n", __func__);
|
||||||
|
|
||||||
|
ipv4_proc_init();
|
||||||
|
|
||||||
|
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
|
||||||
|
index 21da2831e05b4..796174fd90322 100755
|
||||||
|
--- a/scripts/recordmcount.pl
|
||||||
|
+++ b/scripts/recordmcount.pl
|
||||||
|
@@ -250,7 +250,7 @@ if ($arch eq "x86_64") {
|
||||||
|
|
||||||
|
} elsif ($arch eq "s390" && $bits == 64) {
|
||||||
|
if ($cc =~ /-DCC_USING_HOTPATCH/) {
|
||||||
|
- $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(bcrl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
|
||||||
|
+ $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(brcl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
|
||||||
|
$mcount_adjust = 0;
|
||||||
|
} else {
|
||||||
|
$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
|
||||||
|
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
|
||||||
|
index 607c7fc4f24d3..eb9e2b4e81d92 100644
|
||||||
|
--- a/security/selinux/hooks.c
|
||||||
|
+++ b/security/selinux/hooks.c
|
||||||
|
@@ -5194,7 +5194,7 @@ static unsigned int selinux_ip_postroute_compat(struct sk_buff *skb,
|
||||||
|
struct common_audit_data ad;
|
||||||
|
struct lsm_network_audit net = {0,};
|
||||||
|
char *addrp;
|
||||||
|
- u8 proto;
|
||||||
|
+ u8 proto = 0;
|
||||||
|
|
||||||
|
if (sk == NULL)
|
||||||
|
return NF_ACCEPT;
|
||||||
868
patch/kernel/archive/sun50iw9-4.9/patch-4.9.296-297.patch
Normal file
868
patch/kernel/archive/sun50iw9-4.9/patch-4.9.296-297.patch
Normal file
@@ -0,0 +1,868 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 1ec880bcdb2d6..70a11157b2404 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 296
|
||||||
|
+SUBLEVEL = 297
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
|
||||||
|
index 88bbe364b6ae0..ae1b31d02784c 100644
|
||||||
|
--- a/arch/arm64/include/asm/sysreg.h
|
||||||
|
+++ b/arch/arm64/include/asm/sysreg.h
|
||||||
|
@@ -20,6 +20,7 @@
|
||||||
|
#ifndef __ASM_SYSREG_H
|
||||||
|
#define __ASM_SYSREG_H
|
||||||
|
|
||||||
|
+#include <asm/compiler.h>
|
||||||
|
#include <linux/stringify.h>
|
||||||
|
|
||||||
|
#include <asm/opcodes.h>
|
||||||
|
@@ -88,25 +89,81 @@
|
||||||
|
|
||||||
|
/* Common SCTLR_ELx flags. */
|
||||||
|
#define SCTLR_ELx_EE (1 << 25)
|
||||||
|
+#define SCTLR_ELx_WXN (1 << 19)
|
||||||
|
#define SCTLR_ELx_I (1 << 12)
|
||||||
|
#define SCTLR_ELx_SA (1 << 3)
|
||||||
|
#define SCTLR_ELx_C (1 << 2)
|
||||||
|
#define SCTLR_ELx_A (1 << 1)
|
||||||
|
#define SCTLR_ELx_M 1
|
||||||
|
|
||||||
|
-#define SCTLR_EL2_RES1 ((1 << 4) | (1 << 5) | (1 << 11) | (1 << 16) | \
|
||||||
|
- (1 << 16) | (1 << 18) | (1 << 22) | (1 << 23) | \
|
||||||
|
- (1 << 28) | (1 << 29))
|
||||||
|
-
|
||||||
|
#define SCTLR_ELx_FLAGS (SCTLR_ELx_M | SCTLR_ELx_A | SCTLR_ELx_C | \
|
||||||
|
SCTLR_ELx_SA | SCTLR_ELx_I)
|
||||||
|
|
||||||
|
+/* SCTLR_EL2 specific flags. */
|
||||||
|
+#define SCTLR_EL2_RES1 ((1 << 4) | (1 << 5) | (1 << 11) | (1 << 16) | \
|
||||||
|
+ (1 << 18) | (1 << 22) | (1 << 23) | (1 << 28) | \
|
||||||
|
+ (1 << 29))
|
||||||
|
+#define SCTLR_EL2_RES0 ((1 << 6) | (1 << 7) | (1 << 8) | (1 << 9) | \
|
||||||
|
+ (1 << 10) | (1 << 13) | (1 << 14) | (1 << 15) | \
|
||||||
|
+ (1 << 17) | (1 << 20) | (1 << 21) | (1 << 24) | \
|
||||||
|
+ (1 << 26) | (1 << 27) | (1 << 30) | (1 << 31))
|
||||||
|
+
|
||||||
|
+#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||||
|
+#define ENDIAN_SET_EL2 SCTLR_ELx_EE
|
||||||
|
+#define ENDIAN_CLEAR_EL2 0
|
||||||
|
+#else
|
||||||
|
+#define ENDIAN_SET_EL2 0
|
||||||
|
+#define ENDIAN_CLEAR_EL2 SCTLR_ELx_EE
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+/* SCTLR_EL2 value used for the hyp-stub */
|
||||||
|
+#define SCTLR_EL2_SET (ENDIAN_SET_EL2 | SCTLR_EL2_RES1)
|
||||||
|
+#define SCTLR_EL2_CLEAR (SCTLR_ELx_M | SCTLR_ELx_A | SCTLR_ELx_C | \
|
||||||
|
+ SCTLR_ELx_SA | SCTLR_ELx_I | SCTLR_ELx_WXN | \
|
||||||
|
+ ENDIAN_CLEAR_EL2 | SCTLR_EL2_RES0)
|
||||||
|
+
|
||||||
|
+/* Check all the bits are accounted for */
|
||||||
|
+#define SCTLR_EL2_BUILD_BUG_ON_MISSING_BITS BUILD_BUG_ON((SCTLR_EL2_SET ^ SCTLR_EL2_CLEAR) != ~0)
|
||||||
|
+
|
||||||
|
+
|
||||||
|
/* SCTLR_EL1 specific flags. */
|
||||||
|
#define SCTLR_EL1_UCI (1 << 26)
|
||||||
|
+#define SCTLR_EL1_E0E (1 << 24)
|
||||||
|
#define SCTLR_EL1_SPAN (1 << 23)
|
||||||
|
+#define SCTLR_EL1_NTWE (1 << 18)
|
||||||
|
+#define SCTLR_EL1_NTWI (1 << 16)
|
||||||
|
#define SCTLR_EL1_UCT (1 << 15)
|
||||||
|
+#define SCTLR_EL1_DZE (1 << 14)
|
||||||
|
+#define SCTLR_EL1_UMA (1 << 9)
|
||||||
|
#define SCTLR_EL1_SED (1 << 8)
|
||||||
|
+#define SCTLR_EL1_ITD (1 << 7)
|
||||||
|
#define SCTLR_EL1_CP15BEN (1 << 5)
|
||||||
|
+#define SCTLR_EL1_SA0 (1 << 4)
|
||||||
|
+
|
||||||
|
+#define SCTLR_EL1_RES1 ((1 << 11) | (1 << 20) | (1 << 22) | (1 << 28) | \
|
||||||
|
+ (1 << 29))
|
||||||
|
+#define SCTLR_EL1_RES0 ((1 << 6) | (1 << 10) | (1 << 13) | (1 << 17) | \
|
||||||
|
+ (1 << 21) | (1 << 27) | (1 << 30) | (1 << 31))
|
||||||
|
+
|
||||||
|
+#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||||
|
+#define ENDIAN_SET_EL1 (SCTLR_EL1_E0E | SCTLR_ELx_EE)
|
||||||
|
+#define ENDIAN_CLEAR_EL1 0
|
||||||
|
+#else
|
||||||
|
+#define ENDIAN_SET_EL1 0
|
||||||
|
+#define ENDIAN_CLEAR_EL1 (SCTLR_EL1_E0E | SCTLR_ELx_EE)
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#define SCTLR_EL1_SET (SCTLR_ELx_M | SCTLR_ELx_C | SCTLR_ELx_SA |\
|
||||||
|
+ SCTLR_EL1_SA0 | SCTLR_EL1_SED | SCTLR_ELx_I |\
|
||||||
|
+ SCTLR_EL1_DZE | SCTLR_EL1_UCT | SCTLR_EL1_NTWI |\
|
||||||
|
+ SCTLR_EL1_NTWE | SCTLR_EL1_SPAN | ENDIAN_SET_EL1 |\
|
||||||
|
+ SCTLR_EL1_UCI | SCTLR_EL1_RES1)
|
||||||
|
+#define SCTLR_EL1_CLEAR (SCTLR_ELx_A | SCTLR_EL1_CP15BEN | SCTLR_EL1_ITD |\
|
||||||
|
+ SCTLR_EL1_UMA | SCTLR_ELx_WXN | ENDIAN_CLEAR_EL1 |\
|
||||||
|
+ SCTLR_EL1_RES0)
|
||||||
|
+
|
||||||
|
+/* Check all the bits are accounted for */
|
||||||
|
+#define SCTLR_EL1_BUILD_BUG_ON_MISSING_BITS BUILD_BUG_ON((SCTLR_EL1_SET ^ SCTLR_EL1_CLEAR) != ~0)
|
||||||
|
|
||||||
|
/* id_aa64isar0 */
|
||||||
|
#define ID_AA64ISAR0_RDM_SHIFT 28
|
||||||
|
@@ -244,6 +301,7 @@
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
+#include <linux/build_bug.h>
|
||||||
|
#include <linux/types.h>
|
||||||
|
|
||||||
|
asm(
|
||||||
|
@@ -300,6 +358,9 @@ static inline void config_sctlr_el1(u32 clear, u32 set)
|
||||||
|
{
|
||||||
|
u32 val;
|
||||||
|
|
||||||
|
+ SCTLR_EL2_BUILD_BUG_ON_MISSING_BITS;
|
||||||
|
+ SCTLR_EL1_BUILD_BUG_ON_MISSING_BITS;
|
||||||
|
+
|
||||||
|
val = read_sysreg(sctlr_el1);
|
||||||
|
val &= ~clear;
|
||||||
|
val |= set;
|
||||||
|
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
|
||||||
|
index 3875423836622..04f81675b6b3a 100644
|
||||||
|
--- a/arch/arm64/kernel/head.S
|
||||||
|
+++ b/arch/arm64/kernel/head.S
|
||||||
|
@@ -489,21 +489,16 @@ ENTRY(el2_setup)
|
||||||
|
msr SPsel, #1 // We want to use SP_EL{1,2}
|
||||||
|
mrs x0, CurrentEL
|
||||||
|
cmp x0, #CurrentEL_EL2
|
||||||
|
- b.ne 1f
|
||||||
|
- mrs x0, sctlr_el2
|
||||||
|
-CPU_BE( orr x0, x0, #(1 << 25) ) // Set the EE bit for EL2
|
||||||
|
-CPU_LE( bic x0, x0, #(1 << 25) ) // Clear the EE bit for EL2
|
||||||
|
- msr sctlr_el2, x0
|
||||||
|
- b 2f
|
||||||
|
-1: mrs x0, sctlr_el1
|
||||||
|
-CPU_BE( orr x0, x0, #(3 << 24) ) // Set the EE and E0E bits for EL1
|
||||||
|
-CPU_LE( bic x0, x0, #(3 << 24) ) // Clear the EE and E0E bits for EL1
|
||||||
|
+ b.eq 1f
|
||||||
|
+ mov_q x0, (SCTLR_EL1_RES1 | ENDIAN_SET_EL1)
|
||||||
|
msr sctlr_el1, x0
|
||||||
|
mov w0, #BOOT_CPU_MODE_EL1 // This cpu booted in EL1
|
||||||
|
isb
|
||||||
|
ret
|
||||||
|
|
||||||
|
-2:
|
||||||
|
+1: mov_q x0, (SCTLR_EL2_RES1 | ENDIAN_SET_EL2)
|
||||||
|
+ msr sctlr_el2, x0
|
||||||
|
+
|
||||||
|
#ifdef CONFIG_ARM64_VHE
|
||||||
|
/*
|
||||||
|
* Check for VHE being present. For the rest of the EL2 setup,
|
||||||
|
@@ -554,26 +549,6 @@ set_hcr:
|
||||||
|
msr vpidr_el2, x0
|
||||||
|
msr vmpidr_el2, x1
|
||||||
|
|
||||||
|
- /*
|
||||||
|
- * When VHE is not in use, early init of EL2 and EL1 needs to be
|
||||||
|
- * done here.
|
||||||
|
- * When VHE _is_ in use, EL1 will not be used in the host and
|
||||||
|
- * requires no configuration, and all non-hyp-specific EL2 setup
|
||||||
|
- * will be done via the _EL1 system register aliases in __cpu_setup.
|
||||||
|
- */
|
||||||
|
- cbnz x2, 1f
|
||||||
|
-
|
||||||
|
- /* sctlr_el1 */
|
||||||
|
- mov x0, #0x0800 // Set/clear RES{1,0} bits
|
||||||
|
-CPU_BE( movk x0, #0x33d0, lsl #16 ) // Set EE and E0E on BE systems
|
||||||
|
-CPU_LE( movk x0, #0x30d0, lsl #16 ) // Clear EE and E0E on LE systems
|
||||||
|
- msr sctlr_el1, x0
|
||||||
|
-
|
||||||
|
- /* Coprocessor traps. */
|
||||||
|
- mov x0, #0x33ff
|
||||||
|
- msr cptr_el2, x0 // Disable copro. traps to EL2
|
||||||
|
-1:
|
||||||
|
-
|
||||||
|
#ifdef CONFIG_COMPAT
|
||||||
|
msr hstr_el2, xzr // Disable CP15 traps to EL2
|
||||||
|
#endif
|
||||||
|
@@ -599,6 +574,20 @@ CPU_LE( movk x0, #0x30d0, lsl #16 ) // Clear EE and E0E on LE systems
|
||||||
|
ret
|
||||||
|
|
||||||
|
install_el2_stub:
|
||||||
|
+ /*
|
||||||
|
+ * When VHE is not in use, early init of EL2 and EL1 needs to be
|
||||||
|
+ * done here.
|
||||||
|
+ * When VHE _is_ in use, EL1 will not be used in the host and
|
||||||
|
+ * requires no configuration, and all non-hyp-specific EL2 setup
|
||||||
|
+ * will be done via the _EL1 system register aliases in __cpu_setup.
|
||||||
|
+ */
|
||||||
|
+ mov_q x0, (SCTLR_EL1_RES1 | ENDIAN_SET_EL1)
|
||||||
|
+ msr sctlr_el1, x0
|
||||||
|
+
|
||||||
|
+ /* Coprocessor traps. */
|
||||||
|
+ mov x0, #0x33ff
|
||||||
|
+ msr cptr_el2, x0 // Disable copro. traps to EL2
|
||||||
|
+
|
||||||
|
/* Hypervisor stub */
|
||||||
|
adrp x0, __hyp_stub_vectors
|
||||||
|
add x0, x0, #:lo12:__hyp_stub_vectors
|
||||||
|
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
|
||||||
|
index 1b91b8c8999bc..266211a0ecd6d 100644
|
||||||
|
--- a/arch/arm64/mm/proc.S
|
||||||
|
+++ b/arch/arm64/mm/proc.S
|
||||||
|
@@ -413,11 +413,7 @@ ENTRY(__cpu_setup)
|
||||||
|
/*
|
||||||
|
* Prepare SCTLR
|
||||||
|
*/
|
||||||
|
- adr x5, crval
|
||||||
|
- ldp w5, w6, [x5]
|
||||||
|
- mrs x0, sctlr_el1
|
||||||
|
- bic x0, x0, x5 // clear bits
|
||||||
|
- orr x0, x0, x6 // set bits
|
||||||
|
+ mov_q x0, SCTLR_EL1_SET
|
||||||
|
/*
|
||||||
|
* Set/prepare TCR and TTBR. We use 512GB (39-bit) address range for
|
||||||
|
* both user and kernel.
|
||||||
|
@@ -453,21 +449,3 @@ ENTRY(__cpu_setup)
|
||||||
|
msr tcr_el1, x10
|
||||||
|
ret // return to head.S
|
||||||
|
ENDPROC(__cpu_setup)
|
||||||
|
-
|
||||||
|
- /*
|
||||||
|
- * We set the desired value explicitly, including those of the
|
||||||
|
- * reserved bits. The values of bits EE & E0E were set early in
|
||||||
|
- * el2_setup, which are left untouched below.
|
||||||
|
- *
|
||||||
|
- * n n T
|
||||||
|
- * U E WT T UD US IHBS
|
||||||
|
- * CE0 XWHW CZ ME TEEA S
|
||||||
|
- * .... .IEE .... NEAI TE.I ..AD DEN0 ACAM
|
||||||
|
- * 0011 0... 1101 ..0. ..0. 10.. .0.. .... < hardware reserved
|
||||||
|
- * .... .1.. .... 01.1 11.1 ..01 0.01 1101 < software settings
|
||||||
|
- */
|
||||||
|
- .type crval, #object
|
||||||
|
-crval:
|
||||||
|
- .word 0xfcffffff // clear
|
||||||
|
- .word 0x34d5d91d // set
|
||||||
|
- .popsection
|
||||||
|
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
|
||||||
|
index 30c09b9ddbf0d..2069080191eeb 100644
|
||||||
|
--- a/drivers/bluetooth/btusb.c
|
||||||
|
+++ b/drivers/bluetooth/btusb.c
|
||||||
|
@@ -2442,11 +2442,9 @@ static const struct qca_device_info qca_devices_table[] = {
|
||||||
|
{ 0x00000302, 28, 4, 18 }, /* Rome 3.2 */
|
||||||
|
};
|
||||||
|
|
||||||
|
-static int btusb_qca_send_vendor_req(struct hci_dev *hdev, u8 request,
|
||||||
|
+static int btusb_qca_send_vendor_req(struct usb_device *udev, u8 request,
|
||||||
|
void *data, u16 size)
|
||||||
|
{
|
||||||
|
- struct btusb_data *btdata = hci_get_drvdata(hdev);
|
||||||
|
- struct usb_device *udev = btdata->udev;
|
||||||
|
int pipe, err;
|
||||||
|
u8 *buf;
|
||||||
|
|
||||||
|
@@ -2461,7 +2459,7 @@ static int btusb_qca_send_vendor_req(struct hci_dev *hdev, u8 request,
|
||||||
|
err = usb_control_msg(udev, pipe, request, USB_TYPE_VENDOR | USB_DIR_IN,
|
||||||
|
0, 0, buf, size, USB_CTRL_SET_TIMEOUT);
|
||||||
|
if (err < 0) {
|
||||||
|
- BT_ERR("%s: Failed to access otp area (%d)", hdev->name, err);
|
||||||
|
+ dev_err(&udev->dev, "Failed to access otp area (%d)", err);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2617,20 +2615,38 @@ static int btusb_setup_qca_load_nvm(struct hci_dev *hdev,
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
+/* identify the ROM version and check whether patches are needed */
|
||||||
|
+static bool btusb_qca_need_patch(struct usb_device *udev)
|
||||||
|
+{
|
||||||
|
+ struct qca_version ver;
|
||||||
|
+
|
||||||
|
+ if (btusb_qca_send_vendor_req(udev, QCA_GET_TARGET_VERSION, &ver,
|
||||||
|
+ sizeof(ver)) < 0)
|
||||||
|
+ return false;
|
||||||
|
+ /* only low ROM versions need patches */
|
||||||
|
+ return !(le32_to_cpu(ver.rom_version) & ~0xffffU);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int btusb_setup_qca(struct hci_dev *hdev)
|
||||||
|
{
|
||||||
|
+ struct btusb_data *btdata = hci_get_drvdata(hdev);
|
||||||
|
+ struct usb_device *udev = btdata->udev;
|
||||||
|
const struct qca_device_info *info = NULL;
|
||||||
|
struct qca_version ver;
|
||||||
|
u32 ver_rom;
|
||||||
|
u8 status;
|
||||||
|
int i, err;
|
||||||
|
|
||||||
|
- err = btusb_qca_send_vendor_req(hdev, QCA_GET_TARGET_VERSION, &ver,
|
||||||
|
+ err = btusb_qca_send_vendor_req(udev, QCA_GET_TARGET_VERSION, &ver,
|
||||||
|
sizeof(ver));
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
ver_rom = le32_to_cpu(ver.rom_version);
|
||||||
|
+ /* Don't care about high ROM versions */
|
||||||
|
+ if (ver_rom & ~0xffffU)
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
for (i = 0; i < ARRAY_SIZE(qca_devices_table); i++) {
|
||||||
|
if (ver_rom == qca_devices_table[i].rom_version)
|
||||||
|
info = &qca_devices_table[i];
|
||||||
|
@@ -2641,7 +2657,7 @@ static int btusb_setup_qca(struct hci_dev *hdev)
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
- err = btusb_qca_send_vendor_req(hdev, QCA_CHECK_STATUS, &status,
|
||||||
|
+ err = btusb_qca_send_vendor_req(udev, QCA_CHECK_STATUS, &status,
|
||||||
|
sizeof(status));
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
@@ -2787,7 +2803,8 @@ static int btusb_probe(struct usb_interface *intf,
|
||||||
|
|
||||||
|
/* Old firmware would otherwise let ath3k driver load
|
||||||
|
* patch and sysconfig files */
|
||||||
|
- if (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x0001)
|
||||||
|
+ if (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x0001 &&
|
||||||
|
+ !btusb_qca_need_patch(udev))
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2937,6 +2954,7 @@ static int btusb_probe(struct usb_interface *intf,
|
||||||
|
}
|
||||||
|
|
||||||
|
if (id->driver_info & BTUSB_ATH3012) {
|
||||||
|
+ data->setup_on_usb = btusb_setup_qca;
|
||||||
|
hdev->set_bdaddr = btusb_set_bdaddr_ath3012;
|
||||||
|
set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
|
||||||
|
set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
|
||||||
|
diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c
|
||||||
|
index faf505462a4f5..f5a06a6fb297f 100644
|
||||||
|
--- a/drivers/isdn/mISDN/core.c
|
||||||
|
+++ b/drivers/isdn/mISDN/core.c
|
||||||
|
@@ -390,7 +390,7 @@ mISDNInit(void)
|
||||||
|
err = mISDN_inittimer(&debug);
|
||||||
|
if (err)
|
||||||
|
goto error2;
|
||||||
|
- err = l1_init(&debug);
|
||||||
|
+ err = Isdnl1_Init(&debug);
|
||||||
|
if (err)
|
||||||
|
goto error3;
|
||||||
|
err = Isdnl2_Init(&debug);
|
||||||
|
@@ -404,7 +404,7 @@ mISDNInit(void)
|
||||||
|
error5:
|
||||||
|
Isdnl2_cleanup();
|
||||||
|
error4:
|
||||||
|
- l1_cleanup();
|
||||||
|
+ Isdnl1_cleanup();
|
||||||
|
error3:
|
||||||
|
mISDN_timer_cleanup();
|
||||||
|
error2:
|
||||||
|
@@ -417,7 +417,7 @@ static void mISDN_cleanup(void)
|
||||||
|
{
|
||||||
|
misdn_sock_cleanup();
|
||||||
|
Isdnl2_cleanup();
|
||||||
|
- l1_cleanup();
|
||||||
|
+ Isdnl1_cleanup();
|
||||||
|
mISDN_timer_cleanup();
|
||||||
|
class_unregister(&mISDN_class);
|
||||||
|
|
||||||
|
diff --git a/drivers/isdn/mISDN/core.h b/drivers/isdn/mISDN/core.h
|
||||||
|
index 52695bb81ee7a..3c039b6ade2e1 100644
|
||||||
|
--- a/drivers/isdn/mISDN/core.h
|
||||||
|
+++ b/drivers/isdn/mISDN/core.h
|
||||||
|
@@ -69,8 +69,8 @@ struct Bprotocol *get_Bprotocol4id(u_int);
|
||||||
|
extern int mISDN_inittimer(u_int *);
|
||||||
|
extern void mISDN_timer_cleanup(void);
|
||||||
|
|
||||||
|
-extern int l1_init(u_int *);
|
||||||
|
-extern void l1_cleanup(void);
|
||||||
|
+extern int Isdnl1_Init(u_int *);
|
||||||
|
+extern void Isdnl1_cleanup(void);
|
||||||
|
extern int Isdnl2_Init(u_int *);
|
||||||
|
extern void Isdnl2_cleanup(void);
|
||||||
|
|
||||||
|
diff --git a/drivers/isdn/mISDN/layer1.c b/drivers/isdn/mISDN/layer1.c
|
||||||
|
index bebc57b72138e..94d7cc58da648 100644
|
||||||
|
--- a/drivers/isdn/mISDN/layer1.c
|
||||||
|
+++ b/drivers/isdn/mISDN/layer1.c
|
||||||
|
@@ -407,7 +407,7 @@ create_l1(struct dchannel *dch, dchannel_l1callback *dcb) {
|
||||||
|
EXPORT_SYMBOL(create_l1);
|
||||||
|
|
||||||
|
int
|
||||||
|
-l1_init(u_int *deb)
|
||||||
|
+Isdnl1_Init(u_int *deb)
|
||||||
|
{
|
||||||
|
debug = deb;
|
||||||
|
l1fsm_s.state_count = L1S_STATE_COUNT;
|
||||||
|
@@ -419,7 +419,7 @@ l1_init(u_int *deb)
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
-l1_cleanup(void)
|
||||||
|
+Isdnl1_cleanup(void)
|
||||||
|
{
|
||||||
|
mISDN_FsmFree(&l1fsm_s);
|
||||||
|
}
|
||||||
|
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
|
||||||
|
index e7585f6c4665b..104f8eb828a04 100644
|
||||||
|
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
|
||||||
|
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
|
||||||
|
@@ -5429,6 +5429,27 @@ int i40e_open(struct net_device *netdev)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+/**
|
||||||
|
+ * i40e_netif_set_realnum_tx_rx_queues - Update number of tx/rx queues
|
||||||
|
+ * @vsi: vsi structure
|
||||||
|
+ *
|
||||||
|
+ * This updates netdev's number of tx/rx queues
|
||||||
|
+ *
|
||||||
|
+ * Returns status of setting tx/rx queues
|
||||||
|
+ **/
|
||||||
|
+static int i40e_netif_set_realnum_tx_rx_queues(struct i40e_vsi *vsi)
|
||||||
|
+{
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
+ ret = netif_set_real_num_rx_queues(vsi->netdev,
|
||||||
|
+ vsi->num_queue_pairs);
|
||||||
|
+ if (ret)
|
||||||
|
+ return ret;
|
||||||
|
+
|
||||||
|
+ return netif_set_real_num_tx_queues(vsi->netdev,
|
||||||
|
+ vsi->num_queue_pairs);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* i40e_vsi_open -
|
||||||
|
* @vsi: the VSI to open
|
||||||
|
@@ -5463,13 +5484,7 @@ int i40e_vsi_open(struct i40e_vsi *vsi)
|
||||||
|
goto err_setup_rx;
|
||||||
|
|
||||||
|
/* Notify the stack of the actual queue counts. */
|
||||||
|
- err = netif_set_real_num_tx_queues(vsi->netdev,
|
||||||
|
- vsi->num_queue_pairs);
|
||||||
|
- if (err)
|
||||||
|
- goto err_set_queues;
|
||||||
|
-
|
||||||
|
- err = netif_set_real_num_rx_queues(vsi->netdev,
|
||||||
|
- vsi->num_queue_pairs);
|
||||||
|
+ err = i40e_netif_set_realnum_tx_rx_queues(vsi);
|
||||||
|
if (err)
|
||||||
|
goto err_set_queues;
|
||||||
|
|
||||||
|
@@ -9908,6 +9923,9 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
|
||||||
|
case I40E_VSI_VMDQ2:
|
||||||
|
case I40E_VSI_FCOE:
|
||||||
|
ret = i40e_config_netdev(vsi);
|
||||||
|
+ if (ret)
|
||||||
|
+ goto err_netdev;
|
||||||
|
+ ret = i40e_netif_set_realnum_tx_rx_queues(vsi);
|
||||||
|
if (ret)
|
||||||
|
goto err_netdev;
|
||||||
|
ret = register_netdev(vsi->netdev);
|
||||||
|
diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
|
||||||
|
index 0ee54fba0a237..92df7c2d5850e 100644
|
||||||
|
--- a/drivers/net/ieee802154/atusb.c
|
||||||
|
+++ b/drivers/net/ieee802154/atusb.c
|
||||||
|
@@ -79,7 +79,9 @@ static int atusb_control_msg(struct atusb *atusb, unsigned int pipe,
|
||||||
|
|
||||||
|
ret = usb_control_msg(usb_dev, pipe, request, requesttype,
|
||||||
|
value, index, data, size, timeout);
|
||||||
|
- if (ret < 0) {
|
||||||
|
+ if (ret < size) {
|
||||||
|
+ ret = ret < 0 ? ret : -ENODATA;
|
||||||
|
+
|
||||||
|
atusb->err = ret;
|
||||||
|
dev_err(&usb_dev->dev,
|
||||||
|
"atusb_control_msg: req 0x%02x val 0x%x idx 0x%x, error %d\n",
|
||||||
|
@@ -637,9 +639,9 @@ static int atusb_get_and_show_build(struct atusb *atusb)
|
||||||
|
if (!build)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
- ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
|
||||||
|
- ATUSB_BUILD, ATUSB_REQ_FROM_DEV, 0, 0,
|
||||||
|
- build, ATUSB_BUILD_SIZE, 1000);
|
||||||
|
+ /* We cannot call atusb_control_msg() here, since this request may read various length data */
|
||||||
|
+ ret = usb_control_msg(atusb->usb_dev, usb_rcvctrlpipe(usb_dev, 0), ATUSB_BUILD,
|
||||||
|
+ ATUSB_REQ_FROM_DEV, 0, 0, build, ATUSB_BUILD_SIZE, 1000);
|
||||||
|
if (ret >= 0) {
|
||||||
|
build[ret] = 0;
|
||||||
|
dev_info(&usb_dev->dev, "Firmware: build %s\n", build);
|
||||||
|
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
|
||||||
|
index dc5b8e69f8e86..9567bd00a8144 100644
|
||||||
|
--- a/drivers/net/usb/rndis_host.c
|
||||||
|
+++ b/drivers/net/usb/rndis_host.c
|
||||||
|
@@ -619,6 +619,11 @@ static const struct usb_device_id products [] = {
|
||||||
|
USB_DEVICE_AND_INTERFACE_INFO(0x1630, 0x0042,
|
||||||
|
USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
|
||||||
|
.driver_info = (unsigned long) &rndis_poll_status_info,
|
||||||
|
+}, {
|
||||||
|
+ /* Hytera Communications DMR radios' "Radio to PC Network" */
|
||||||
|
+ USB_VENDOR_AND_INTERFACE_INFO(0x238b,
|
||||||
|
+ USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
|
||||||
|
+ .driver_info = (unsigned long)&rndis_info,
|
||||||
|
}, {
|
||||||
|
/* RNDIS is MSFT's un-official variant of CDC ACM */
|
||||||
|
USB_INTERFACE_INFO(USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
|
||||||
|
diff --git a/drivers/power/reset/ltc2952-poweroff.c b/drivers/power/reset/ltc2952-poweroff.c
|
||||||
|
index 15fed9d8f871a..ec54cff108b3c 100644
|
||||||
|
--- a/drivers/power/reset/ltc2952-poweroff.c
|
||||||
|
+++ b/drivers/power/reset/ltc2952-poweroff.c
|
||||||
|
@@ -169,8 +169,8 @@ static void ltc2952_poweroff_kill(void)
|
||||||
|
|
||||||
|
static void ltc2952_poweroff_default(struct ltc2952_poweroff *data)
|
||||||
|
{
|
||||||
|
- data->wde_interval = ktime_set(0, 300L*1E6L);
|
||||||
|
- data->trigger_delay = ktime_set(2, 500L*1E6L);
|
||||||
|
+ data->wde_interval = ktime_set(0, 300L * NSEC_PER_MSEC);
|
||||||
|
+ data->trigger_delay = ktime_set(2, 500L * NSEC_PER_MSEC);
|
||||||
|
|
||||||
|
hrtimer_init(&data->timer_trigger, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
|
||||||
|
data->timer_trigger.function = ltc2952_poweroff_timer_trigger;
|
||||||
|
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
|
||||||
|
index 30e954bb6c81e..8d1a05d5eb4dd 100644
|
||||||
|
--- a/drivers/scsi/libiscsi.c
|
||||||
|
+++ b/drivers/scsi/libiscsi.c
|
||||||
|
@@ -2991,6 +2991,8 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
|
||||||
|
{
|
||||||
|
struct iscsi_conn *conn = cls_conn->dd_data;
|
||||||
|
struct iscsi_session *session = conn->session;
|
||||||
|
+ char *tmp_persistent_address = conn->persistent_address;
|
||||||
|
+ char *tmp_local_ipaddr = conn->local_ipaddr;
|
||||||
|
|
||||||
|
del_timer_sync(&conn->transport_timer);
|
||||||
|
|
||||||
|
@@ -3012,8 +3014,6 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
|
||||||
|
spin_lock_bh(&session->frwd_lock);
|
||||||
|
free_pages((unsigned long) conn->data,
|
||||||
|
get_order(ISCSI_DEF_MAX_RECV_SEG_LEN));
|
||||||
|
- kfree(conn->persistent_address);
|
||||||
|
- kfree(conn->local_ipaddr);
|
||||||
|
/* regular RX path uses back_lock */
|
||||||
|
spin_lock_bh(&session->back_lock);
|
||||||
|
kfifo_in(&session->cmdpool.queue, (void*)&conn->login_task,
|
||||||
|
@@ -3025,6 +3025,8 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
|
||||||
|
mutex_unlock(&session->eh_mutex);
|
||||||
|
|
||||||
|
iscsi_destroy_conn(cls_conn);
|
||||||
|
+ kfree(tmp_persistent_address);
|
||||||
|
+ kfree(tmp_local_ipaddr);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(iscsi_conn_teardown);
|
||||||
|
|
||||||
|
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
|
||||||
|
index d9a9058279671..37e3ba5dadf60 100644
|
||||||
|
--- a/drivers/virtio/virtio_pci_common.c
|
||||||
|
+++ b/drivers/virtio/virtio_pci_common.c
|
||||||
|
@@ -547,6 +547,13 @@ static void virtio_pci_remove(struct pci_dev *pci_dev)
|
||||||
|
struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
|
||||||
|
struct device *dev = get_device(&vp_dev->vdev.dev);
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * Device is marked broken on surprise removal so that virtio upper
|
||||||
|
+ * layers can abort any ongoing operation.
|
||||||
|
+ */
|
||||||
|
+ if (!pci_device_is_present(pci_dev))
|
||||||
|
+ virtio_break_device(&vp_dev->vdev);
|
||||||
|
+
|
||||||
|
unregister_virtio_device(&vp_dev->vdev);
|
||||||
|
|
||||||
|
if (vp_dev->ioaddr)
|
||||||
|
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
|
||||||
|
index 6c95812120ebd..5e28a5225e3fb 100644
|
||||||
|
--- a/fs/xfs/xfs_ioctl.c
|
||||||
|
+++ b/fs/xfs/xfs_ioctl.c
|
||||||
|
@@ -712,7 +712,8 @@ xfs_ioc_space(
|
||||||
|
flags |= XFS_PREALLOC_CLEAR;
|
||||||
|
if (bf->l_start > XFS_ISIZE(ip)) {
|
||||||
|
error = xfs_alloc_file_space(ip, XFS_ISIZE(ip),
|
||||||
|
- bf->l_start - XFS_ISIZE(ip), 0);
|
||||||
|
+ bf->l_start - XFS_ISIZE(ip),
|
||||||
|
+ XFS_BMAPI_PREALLOC);
|
||||||
|
if (error)
|
||||||
|
goto out_unlock;
|
||||||
|
}
|
||||||
|
diff --git a/include/linux/bug.h b/include/linux/bug.h
|
||||||
|
index 0faae96302bda..eafb6213e582a 100644
|
||||||
|
--- a/include/linux/bug.h
|
||||||
|
+++ b/include/linux/bug.h
|
||||||
|
@@ -3,6 +3,7 @@
|
||||||
|
|
||||||
|
#include <asm/bug.h>
|
||||||
|
#include <linux/compiler.h>
|
||||||
|
+#include <linux/build_bug.h>
|
||||||
|
|
||||||
|
enum bug_trap_type {
|
||||||
|
BUG_TRAP_TYPE_NONE = 0,
|
||||||
|
@@ -13,80 +14,9 @@ enum bug_trap_type {
|
||||||
|
struct pt_regs;
|
||||||
|
|
||||||
|
#ifdef __CHECKER__
|
||||||
|
-#define __BUILD_BUG_ON_NOT_POWER_OF_2(n) (0)
|
||||||
|
-#define BUILD_BUG_ON_NOT_POWER_OF_2(n) (0)
|
||||||
|
-#define BUILD_BUG_ON_ZERO(e) (0)
|
||||||
|
-#define BUILD_BUG_ON_NULL(e) ((void*)0)
|
||||||
|
-#define BUILD_BUG_ON_INVALID(e) (0)
|
||||||
|
-#define BUILD_BUG_ON_MSG(cond, msg) (0)
|
||||||
|
-#define BUILD_BUG_ON(condition) (0)
|
||||||
|
-#define BUILD_BUG() (0)
|
||||||
|
#define MAYBE_BUILD_BUG_ON(cond) (0)
|
||||||
|
#else /* __CHECKER__ */
|
||||||
|
|
||||||
|
-/* Force a compilation error if a constant expression is not a power of 2 */
|
||||||
|
-#define __BUILD_BUG_ON_NOT_POWER_OF_2(n) \
|
||||||
|
- BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
|
||||||
|
-#define BUILD_BUG_ON_NOT_POWER_OF_2(n) \
|
||||||
|
- BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
|
||||||
|
-
|
||||||
|
-/* Force a compilation error if condition is true, but also produce a
|
||||||
|
- result (of value 0 and type size_t), so the expression can be used
|
||||||
|
- e.g. in a structure initializer (or where-ever else comma expressions
|
||||||
|
- aren't permitted). */
|
||||||
|
-#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
|
||||||
|
-#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
|
||||||
|
-
|
||||||
|
-/*
|
||||||
|
- * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the
|
||||||
|
- * expression but avoids the generation of any code, even if that expression
|
||||||
|
- * has side-effects.
|
||||||
|
- */
|
||||||
|
-#define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
|
||||||
|
-
|
||||||
|
-/**
|
||||||
|
- * BUILD_BUG_ON_MSG - break compile if a condition is true & emit supplied
|
||||||
|
- * error message.
|
||||||
|
- * @condition: the condition which the compiler should know is false.
|
||||||
|
- *
|
||||||
|
- * See BUILD_BUG_ON for description.
|
||||||
|
- */
|
||||||
|
-#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
|
||||||
|
-
|
||||||
|
-/**
|
||||||
|
- * BUILD_BUG_ON - break compile if a condition is true.
|
||||||
|
- * @condition: the condition which the compiler should know is false.
|
||||||
|
- *
|
||||||
|
- * If you have some code which relies on certain constants being equal, or
|
||||||
|
- * some other compile-time-evaluated condition, you should use BUILD_BUG_ON to
|
||||||
|
- * detect if someone changes it.
|
||||||
|
- *
|
||||||
|
- * The implementation uses gcc's reluctance to create a negative array, but gcc
|
||||||
|
- * (as of 4.4) only emits that error for obvious cases (e.g. not arguments to
|
||||||
|
- * inline functions). Luckily, in 4.3 they added the "error" function
|
||||||
|
- * attribute just for this type of case. Thus, we use a negative sized array
|
||||||
|
- * (should always create an error on gcc versions older than 4.4) and then call
|
||||||
|
- * an undefined function with the error attribute (should always create an
|
||||||
|
- * error on gcc 4.3 and later). If for some reason, neither creates a
|
||||||
|
- * compile-time error, we'll still have a link-time error, which is harder to
|
||||||
|
- * track down.
|
||||||
|
- */
|
||||||
|
-#ifndef __OPTIMIZE__
|
||||||
|
-#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
|
||||||
|
-#else
|
||||||
|
-#define BUILD_BUG_ON(condition) \
|
||||||
|
- BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
-/**
|
||||||
|
- * BUILD_BUG - break compile if used.
|
||||||
|
- *
|
||||||
|
- * If you have some code that you expect the compiler to eliminate at
|
||||||
|
- * build time, you should use BUILD_BUG to detect if it is
|
||||||
|
- * unexpectedly used.
|
||||||
|
- */
|
||||||
|
-#define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
|
||||||
|
-
|
||||||
|
#define MAYBE_BUILD_BUG_ON(cond) \
|
||||||
|
do { \
|
||||||
|
if (__builtin_constant_p((cond))) \
|
||||||
|
diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000..b7d22d60008a9
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/include/linux/build_bug.h
|
||||||
|
@@ -0,0 +1,84 @@
|
||||||
|
+#ifndef _LINUX_BUILD_BUG_H
|
||||||
|
+#define _LINUX_BUILD_BUG_H
|
||||||
|
+
|
||||||
|
+#include <linux/compiler.h>
|
||||||
|
+
|
||||||
|
+#ifdef __CHECKER__
|
||||||
|
+#define __BUILD_BUG_ON_NOT_POWER_OF_2(n) (0)
|
||||||
|
+#define BUILD_BUG_ON_NOT_POWER_OF_2(n) (0)
|
||||||
|
+#define BUILD_BUG_ON_ZERO(e) (0)
|
||||||
|
+#define BUILD_BUG_ON_NULL(e) ((void *)0)
|
||||||
|
+#define BUILD_BUG_ON_INVALID(e) (0)
|
||||||
|
+#define BUILD_BUG_ON_MSG(cond, msg) (0)
|
||||||
|
+#define BUILD_BUG_ON(condition) (0)
|
||||||
|
+#define BUILD_BUG() (0)
|
||||||
|
+#else /* __CHECKER__ */
|
||||||
|
+
|
||||||
|
+/* Force a compilation error if a constant expression is not a power of 2 */
|
||||||
|
+#define __BUILD_BUG_ON_NOT_POWER_OF_2(n) \
|
||||||
|
+ BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
|
||||||
|
+#define BUILD_BUG_ON_NOT_POWER_OF_2(n) \
|
||||||
|
+ BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Force a compilation error if condition is true, but also produce a
|
||||||
|
+ * result (of value 0 and type size_t), so the expression can be used
|
||||||
|
+ * e.g. in a structure initializer (or where-ever else comma expressions
|
||||||
|
+ * aren't permitted).
|
||||||
|
+ */
|
||||||
|
+#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); }))
|
||||||
|
+#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:(-!!(e)); }))
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the
|
||||||
|
+ * expression but avoids the generation of any code, even if that expression
|
||||||
|
+ * has side-effects.
|
||||||
|
+ */
|
||||||
|
+#define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
|
||||||
|
+
|
||||||
|
+/**
|
||||||
|
+ * BUILD_BUG_ON_MSG - break compile if a condition is true & emit supplied
|
||||||
|
+ * error message.
|
||||||
|
+ * @condition: the condition which the compiler should know is false.
|
||||||
|
+ *
|
||||||
|
+ * See BUILD_BUG_ON for description.
|
||||||
|
+ */
|
||||||
|
+#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
|
||||||
|
+
|
||||||
|
+/**
|
||||||
|
+ * BUILD_BUG_ON - break compile if a condition is true.
|
||||||
|
+ * @condition: the condition which the compiler should know is false.
|
||||||
|
+ *
|
||||||
|
+ * If you have some code which relies on certain constants being equal, or
|
||||||
|
+ * some other compile-time-evaluated condition, you should use BUILD_BUG_ON to
|
||||||
|
+ * detect if someone changes it.
|
||||||
|
+ *
|
||||||
|
+ * The implementation uses gcc's reluctance to create a negative array, but gcc
|
||||||
|
+ * (as of 4.4) only emits that error for obvious cases (e.g. not arguments to
|
||||||
|
+ * inline functions). Luckily, in 4.3 they added the "error" function
|
||||||
|
+ * attribute just for this type of case. Thus, we use a negative sized array
|
||||||
|
+ * (should always create an error on gcc versions older than 4.4) and then call
|
||||||
|
+ * an undefined function with the error attribute (should always create an
|
||||||
|
+ * error on gcc 4.3 and later). If for some reason, neither creates a
|
||||||
|
+ * compile-time error, we'll still have a link-time error, which is harder to
|
||||||
|
+ * track down.
|
||||||
|
+ */
|
||||||
|
+#ifndef __OPTIMIZE__
|
||||||
|
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
|
||||||
|
+#else
|
||||||
|
+#define BUILD_BUG_ON(condition) \
|
||||||
|
+ BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+/**
|
||||||
|
+ * BUILD_BUG - break compile if used.
|
||||||
|
+ *
|
||||||
|
+ * If you have some code that you expect the compiler to eliminate at
|
||||||
|
+ * build time, you should use BUILD_BUG to detect if it is
|
||||||
|
+ * unexpectedly used.
|
||||||
|
+ */
|
||||||
|
+#define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
|
||||||
|
+
|
||||||
|
+#endif /* __CHECKER__ */
|
||||||
|
+
|
||||||
|
+#endif /* _LINUX_BUILD_BUG_H */
|
||||||
|
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
|
||||||
|
index e8bd8de856de9..01c646a1d9e76 100644
|
||||||
|
--- a/kernel/trace/trace.c
|
||||||
|
+++ b/kernel/trace/trace.c
|
||||||
|
@@ -2354,7 +2354,7 @@ struct trace_buffer_struct {
|
||||||
|
char buffer[4][TRACE_BUF_SIZE];
|
||||||
|
};
|
||||||
|
|
||||||
|
-static struct trace_buffer_struct *trace_percpu_buffer;
|
||||||
|
+static struct trace_buffer_struct __percpu *trace_percpu_buffer;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Thise allows for lockless recording. If we're nested too deeply, then
|
||||||
|
@@ -2364,7 +2364,7 @@ static char *get_trace_buf(void)
|
||||||
|
{
|
||||||
|
struct trace_buffer_struct *buffer = this_cpu_ptr(trace_percpu_buffer);
|
||||||
|
|
||||||
|
- if (!buffer || buffer->nesting >= 4)
|
||||||
|
+ if (!trace_percpu_buffer || buffer->nesting >= 4)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
buffer->nesting++;
|
||||||
|
@@ -2383,7 +2383,7 @@ static void put_trace_buf(void)
|
||||||
|
|
||||||
|
static int alloc_percpu_trace_buffer(void)
|
||||||
|
{
|
||||||
|
- struct trace_buffer_struct *buffers;
|
||||||
|
+ struct trace_buffer_struct __percpu *buffers;
|
||||||
|
|
||||||
|
buffers = alloc_percpu(struct trace_buffer_struct);
|
||||||
|
if (WARN(!buffers, "Could not allocate percpu trace_printk buffer"))
|
||||||
|
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
|
||||||
|
index 860ab2e6544cc..8770966a564b5 100644
|
||||||
|
--- a/net/ipv4/udp.c
|
||||||
|
+++ b/net/ipv4/udp.c
|
||||||
|
@@ -2435,7 +2435,7 @@ int udp4_seq_show(struct seq_file *seq, void *v)
|
||||||
|
{
|
||||||
|
seq_setwidth(seq, 127);
|
||||||
|
if (v == SEQ_START_TOKEN)
|
||||||
|
- seq_puts(seq, " sl local_address rem_address st tx_queue "
|
||||||
|
+ seq_puts(seq, " sl local_address rem_address st tx_queue "
|
||||||
|
"rx_queue tr tm->when retrnsmt uid timeout "
|
||||||
|
"inode ref pointer drops");
|
||||||
|
else {
|
||||||
|
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
|
||||||
|
index f58d69216b616..ce5b55491942d 100644
|
||||||
|
--- a/net/ipv6/ip6_vti.c
|
||||||
|
+++ b/net/ipv6/ip6_vti.c
|
||||||
|
@@ -773,6 +773,8 @@ vti6_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
||||||
|
struct net *net = dev_net(dev);
|
||||||
|
struct vti6_net *ip6n = net_generic(net, vti6_net_id);
|
||||||
|
|
||||||
|
+ memset(&p1, 0, sizeof(p1));
|
||||||
|
+
|
||||||
|
switch (cmd) {
|
||||||
|
case SIOCGETTUNNEL:
|
||||||
|
if (dev == ip6n->fb_tnl_dev) {
|
||||||
|
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
|
||||||
|
index 3217c98f2b5a2..56c58ff8ef748 100644
|
||||||
|
--- a/net/mac80211/mlme.c
|
||||||
|
+++ b/net/mac80211/mlme.c
|
||||||
|
@@ -4450,7 +4450,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
|
||||||
|
|
||||||
|
if (new_sta) {
|
||||||
|
u32 rates = 0, basic_rates = 0;
|
||||||
|
- bool have_higher_than_11mbit;
|
||||||
|
+ bool have_higher_than_11mbit = false;
|
||||||
|
int min_rate = INT_MAX, min_rate_index = -1;
|
||||||
|
struct ieee80211_chanctx_conf *chanctx_conf;
|
||||||
|
const struct cfg80211_bss_ies *ies;
|
||||||
|
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
|
||||||
|
index 1e7945df39928..a734d47c5eb19 100644
|
||||||
|
--- a/net/phonet/pep.c
|
||||||
|
+++ b/net/phonet/pep.c
|
||||||
|
@@ -878,6 +878,7 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp)
|
||||||
|
|
||||||
|
err = pep_accept_conn(newsk, skb);
|
||||||
|
if (err) {
|
||||||
|
+ __sock_put(sk);
|
||||||
|
sock_put(newsk);
|
||||||
|
newsk = NULL;
|
||||||
|
goto drop;
|
||||||
|
diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c
|
||||||
|
index ca0516e6f7435..fd48a1e327d6a 100644
|
||||||
|
--- a/net/sched/sch_qfq.c
|
||||||
|
+++ b/net/sched/sch_qfq.c
|
||||||
|
@@ -1439,10 +1439,8 @@ static int qfq_init_qdisc(struct Qdisc *sch, struct nlattr *opt)
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
- if (qdisc_dev(sch)->tx_queue_len + 1 > QFQ_MAX_AGG_CLASSES)
|
||||||
|
- max_classes = QFQ_MAX_AGG_CLASSES;
|
||||||
|
- else
|
||||||
|
- max_classes = qdisc_dev(sch)->tx_queue_len + 1;
|
||||||
|
+ max_classes = min_t(u64, (u64)qdisc_dev(sch)->tx_queue_len + 1,
|
||||||
|
+ QFQ_MAX_AGG_CLASSES);
|
||||||
|
/* max_cl_shift = floor(log_2(max_classes)) */
|
||||||
|
max_cl_shift = __fls(max_classes);
|
||||||
|
q->max_agg_classes = 1<<max_cl_shift;
|
||||||
4800
patch/kernel/archive/sun50iw9-4.9/patch-4.9.297-298.patch
Normal file
4800
patch/kernel/archive/sun50iw9-4.9/patch-4.9.297-298.patch
Normal file
File diff suppressed because it is too large
Load Diff
669
patch/kernel/archive/sun50iw9-4.9/patch-4.9.298-299.patch
Normal file
669
patch/kernel/archive/sun50iw9-4.9/patch-4.9.298-299.patch
Normal file
@@ -0,0 +1,669 @@
|
|||||||
|
diff --git a/Documentation/virtual/kvm/mmu.txt b/Documentation/virtual/kvm/mmu.txt
|
||||||
|
index 481b6a9c25d5a..16ddfd6bd6a1a 100644
|
||||||
|
--- a/Documentation/virtual/kvm/mmu.txt
|
||||||
|
+++ b/Documentation/virtual/kvm/mmu.txt
|
||||||
|
@@ -152,8 +152,8 @@ Shadow pages contain the following information:
|
||||||
|
shadow pages) so role.quadrant takes values in the range 0..3. Each
|
||||||
|
quadrant maps 1GB virtual address space.
|
||||||
|
role.access:
|
||||||
|
- Inherited guest access permissions in the form uwx. Note execute
|
||||||
|
- permission is positive, not negative.
|
||||||
|
+ Inherited guest access permissions from the parent ptes in the form uwx.
|
||||||
|
+ Note execute permission is positive, not negative.
|
||||||
|
role.invalid:
|
||||||
|
The page is invalid and should not be used. It is a root page that is
|
||||||
|
currently pinned (by a cpu hardware register pointing to it); once it is
|
||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index b0f683f18df71..99d37c23495ef 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 298
|
||||||
|
+SUBLEVEL = 299
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
|
||||||
|
index bb8f39fe3a225..8df8cdd093e98 100644
|
||||||
|
--- a/arch/arm/Kconfig.debug
|
||||||
|
+++ b/arch/arm/Kconfig.debug
|
||||||
|
@@ -15,30 +15,42 @@ config ARM_PTDUMP
|
||||||
|
kernel.
|
||||||
|
If in doubt, say "N"
|
||||||
|
|
||||||
|
-# RMK wants arm kernels compiled with frame pointers or stack unwinding.
|
||||||
|
-# If you know what you are doing and are willing to live without stack
|
||||||
|
-# traces, you can get a slightly smaller kernel by setting this option to
|
||||||
|
-# n, but then RMK will have to kill you ;).
|
||||||
|
-config FRAME_POINTER
|
||||||
|
- bool
|
||||||
|
- depends on !THUMB2_KERNEL
|
||||||
|
- default y if !ARM_UNWIND || FUNCTION_GRAPH_TRACER
|
||||||
|
+choice
|
||||||
|
+ prompt "Choose kernel unwinder"
|
||||||
|
+ default UNWINDER_ARM if AEABI && !FUNCTION_GRAPH_TRACER
|
||||||
|
+ default UNWINDER_FRAME_POINTER if !AEABI || FUNCTION_GRAPH_TRACER
|
||||||
|
+ help
|
||||||
|
+ This determines which method will be used for unwinding kernel stack
|
||||||
|
+ traces for panics, oopses, bugs, warnings, perf, /proc/<pid>/stack,
|
||||||
|
+ livepatch, lockdep, and more.
|
||||||
|
+
|
||||||
|
+config UNWINDER_FRAME_POINTER
|
||||||
|
+ bool "Frame pointer unwinder"
|
||||||
|
+ depends on !THUMB2_KERNEL && !CC_IS_CLANG
|
||||||
|
+ select ARCH_WANT_FRAME_POINTERS
|
||||||
|
+ select FRAME_POINTER
|
||||||
|
help
|
||||||
|
- If you say N here, the resulting kernel will be slightly smaller and
|
||||||
|
- faster. However, if neither FRAME_POINTER nor ARM_UNWIND are enabled,
|
||||||
|
- when a problem occurs with the kernel, the information that is
|
||||||
|
- reported is severely limited.
|
||||||
|
+ This option enables the frame pointer unwinder for unwinding
|
||||||
|
+ kernel stack traces.
|
||||||
|
|
||||||
|
-config ARM_UNWIND
|
||||||
|
- bool "Enable stack unwinding support (EXPERIMENTAL)"
|
||||||
|
+config UNWINDER_ARM
|
||||||
|
+ bool "ARM EABI stack unwinder"
|
||||||
|
depends on AEABI
|
||||||
|
- default y
|
||||||
|
+ select ARM_UNWIND
|
||||||
|
help
|
||||||
|
This option enables stack unwinding support in the kernel
|
||||||
|
using the information automatically generated by the
|
||||||
|
compiler. The resulting kernel image is slightly bigger but
|
||||||
|
the performance is not affected. Currently, this feature
|
||||||
|
- only works with EABI compilers. If unsure say Y.
|
||||||
|
+ only works with EABI compilers.
|
||||||
|
+
|
||||||
|
+endchoice
|
||||||
|
+
|
||||||
|
+config ARM_UNWIND
|
||||||
|
+ bool
|
||||||
|
+
|
||||||
|
+config FRAME_POINTER
|
||||||
|
+ bool
|
||||||
|
|
||||||
|
config OLD_MCOUNT
|
||||||
|
bool
|
||||||
|
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
|
||||||
|
index c4f155663ca9a..14cd0a742e794 100644
|
||||||
|
--- a/drivers/gpu/drm/i915/i915_drv.h
|
||||||
|
+++ b/drivers/gpu/drm/i915/i915_drv.h
|
||||||
|
@@ -1763,6 +1763,8 @@ struct drm_i915_private {
|
||||||
|
|
||||||
|
struct intel_uncore uncore;
|
||||||
|
|
||||||
|
+ struct mutex tlb_invalidate_lock;
|
||||||
|
+
|
||||||
|
struct i915_virtual_gpu vgpu;
|
||||||
|
|
||||||
|
struct intel_gvt gvt;
|
||||||
|
@@ -2211,7 +2213,8 @@ struct drm_i915_gem_object {
|
||||||
|
* rendering and so a non-zero seqno), and is not set if it i s on
|
||||||
|
* inactive (ready to be unbound) list.
|
||||||
|
*/
|
||||||
|
-#define I915_BO_ACTIVE_SHIFT 0
|
||||||
|
+#define I915_BO_WAS_BOUND_BIT 0
|
||||||
|
+#define I915_BO_ACTIVE_SHIFT 1
|
||||||
|
#define I915_BO_ACTIVE_MASK ((1 << I915_NUM_ENGINES) - 1)
|
||||||
|
#define __I915_BO_ACTIVE(bo) \
|
||||||
|
((READ_ONCE((bo)->flags) >> I915_BO_ACTIVE_SHIFT) & I915_BO_ACTIVE_MASK)
|
||||||
|
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
|
||||||
|
index 3fb4f9acacba0..9265ac5774c25 100644
|
||||||
|
--- a/drivers/gpu/drm/i915/i915_gem.c
|
||||||
|
+++ b/drivers/gpu/drm/i915/i915_gem.c
|
||||||
|
@@ -2185,6 +2185,67 @@ i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj)
|
||||||
|
kfree(obj->pages);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int
|
||||||
|
+__intel_wait_for_register_fw(struct drm_i915_private *dev_priv,
|
||||||
|
+ i915_reg_t reg,
|
||||||
|
+ const u32 mask,
|
||||||
|
+ const u32 value,
|
||||||
|
+ const unsigned int timeout_us,
|
||||||
|
+ const unsigned int timeout_ms)
|
||||||
|
+{
|
||||||
|
+#define done ((I915_READ_FW(reg) & mask) == value)
|
||||||
|
+ int ret = wait_for_us(done, timeout_us);
|
||||||
|
+ if (ret)
|
||||||
|
+ ret = wait_for(done, timeout_ms);
|
||||||
|
+ return ret;
|
||||||
|
+#undef done
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void invalidate_tlbs(struct drm_i915_private *dev_priv)
|
||||||
|
+{
|
||||||
|
+ static const i915_reg_t gen8_regs[] = {
|
||||||
|
+ [RCS] = GEN8_RTCR,
|
||||||
|
+ [VCS] = GEN8_M1TCR,
|
||||||
|
+ [VCS2] = GEN8_M2TCR,
|
||||||
|
+ [VECS] = GEN8_VTCR,
|
||||||
|
+ [BCS] = GEN8_BTCR,
|
||||||
|
+ };
|
||||||
|
+ struct intel_engine_cs *engine;
|
||||||
|
+
|
||||||
|
+ if (INTEL_GEN(dev_priv) < 8)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ assert_rpm_wakelock_held(dev_priv);
|
||||||
|
+
|
||||||
|
+ mutex_lock(&dev_priv->tlb_invalidate_lock);
|
||||||
|
+ intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
|
||||||
|
+
|
||||||
|
+ for_each_engine(engine, dev_priv) {
|
||||||
|
+ /*
|
||||||
|
+ * HW architecture suggest typical invalidation time at 40us,
|
||||||
|
+ * with pessimistic cases up to 100us and a recommendation to
|
||||||
|
+ * cap at 1ms. We go a bit higher just in case.
|
||||||
|
+ */
|
||||||
|
+ const unsigned int timeout_us = 100;
|
||||||
|
+ const unsigned int timeout_ms = 4;
|
||||||
|
+ const enum intel_engine_id id = engine->id;
|
||||||
|
+
|
||||||
|
+ if (WARN_ON_ONCE(id >= ARRAY_SIZE(gen8_regs) ||
|
||||||
|
+ !i915_mmio_reg_offset(gen8_regs[id])))
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ I915_WRITE_FW(gen8_regs[id], 1);
|
||||||
|
+ if (__intel_wait_for_register_fw(dev_priv,
|
||||||
|
+ gen8_regs[id], 1, 0,
|
||||||
|
+ timeout_us, timeout_ms))
|
||||||
|
+ DRM_ERROR_RATELIMITED("%s TLB invalidation did not complete in %ums!\n",
|
||||||
|
+ engine->name, timeout_ms);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
|
||||||
|
+ mutex_unlock(&dev_priv->tlb_invalidate_lock);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
int
|
||||||
|
i915_gem_object_put_pages(struct drm_i915_gem_object *obj)
|
||||||
|
{
|
||||||
|
@@ -2215,6 +2276,15 @@ i915_gem_object_put_pages(struct drm_i915_gem_object *obj)
|
||||||
|
obj->mapping = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (test_and_clear_bit(I915_BO_WAS_BOUND_BIT, &obj->flags)) {
|
||||||
|
+ struct drm_i915_private *i915 = to_i915(obj->base.dev);
|
||||||
|
+
|
||||||
|
+ if (intel_runtime_pm_get_if_in_use(i915)) {
|
||||||
|
+ invalidate_tlbs(i915);
|
||||||
|
+ intel_runtime_pm_put(i915);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
ops->put_pages(obj);
|
||||||
|
obj->pages = NULL;
|
||||||
|
|
||||||
|
@@ -4627,6 +4697,8 @@ i915_gem_load_init(struct drm_device *dev)
|
||||||
|
|
||||||
|
atomic_set(&dev_priv->mm.bsd_engine_dispatch_index, 0);
|
||||||
|
|
||||||
|
+ mutex_init(&dev_priv->tlb_invalidate_lock);
|
||||||
|
+
|
||||||
|
spin_lock_init(&dev_priv->fb_tracking.lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
|
||||||
|
index 16f56f14f4d06..edaff73b7aa9d 100644
|
||||||
|
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
|
||||||
|
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
|
||||||
|
@@ -3685,6 +3685,10 @@ int i915_vma_bind(struct i915_vma *vma, enum i915_cache_level cache_level,
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
vma->flags |= bind_flags;
|
||||||
|
+
|
||||||
|
+ if (vma->obj)
|
||||||
|
+ set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags);
|
||||||
|
+
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
|
||||||
|
index 5468e69bf520a..1ff1e33df2c71 100644
|
||||||
|
--- a/drivers/gpu/drm/i915/i915_reg.h
|
||||||
|
+++ b/drivers/gpu/drm/i915/i915_reg.h
|
||||||
|
@@ -1698,6 +1698,12 @@ enum skl_disp_power_wells {
|
||||||
|
#define GAMT_CHKN_BIT_REG _MMIO(0x4ab8)
|
||||||
|
#define GAMT_CHKN_DISABLE_DYNAMIC_CREDIT_SHARING (1<<28)
|
||||||
|
|
||||||
|
+#define GEN8_RTCR _MMIO(0x4260)
|
||||||
|
+#define GEN8_M1TCR _MMIO(0x4264)
|
||||||
|
+#define GEN8_M2TCR _MMIO(0x4268)
|
||||||
|
+#define GEN8_BTCR _MMIO(0x426c)
|
||||||
|
+#define GEN8_VTCR _MMIO(0x4270)
|
||||||
|
+
|
||||||
|
#if 0
|
||||||
|
#define PRB0_TAIL _MMIO(0x2030)
|
||||||
|
#define PRB0_HEAD _MMIO(0x2034)
|
||||||
|
diff --git a/drivers/media/firewire/firedtv-avc.c b/drivers/media/firewire/firedtv-avc.c
|
||||||
|
index 280b5ffea5922..3a373711f5ad9 100644
|
||||||
|
--- a/drivers/media/firewire/firedtv-avc.c
|
||||||
|
+++ b/drivers/media/firewire/firedtv-avc.c
|
||||||
|
@@ -1169,7 +1169,11 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length)
|
||||||
|
read_pos += program_info_length;
|
||||||
|
write_pos += program_info_length;
|
||||||
|
}
|
||||||
|
- while (read_pos < length) {
|
||||||
|
+ while (read_pos + 4 < length) {
|
||||||
|
+ if (write_pos + 4 >= sizeof(c->operand) - 4) {
|
||||||
|
+ ret = -EINVAL;
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
c->operand[write_pos++] = msg[read_pos++];
|
||||||
|
c->operand[write_pos++] = msg[read_pos++];
|
||||||
|
c->operand[write_pos++] = msg[read_pos++];
|
||||||
|
@@ -1181,13 +1185,17 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length)
|
||||||
|
c->operand[write_pos++] = es_info_length >> 8;
|
||||||
|
c->operand[write_pos++] = es_info_length & 0xff;
|
||||||
|
if (es_info_length > 0) {
|
||||||
|
+ if (read_pos >= length) {
|
||||||
|
+ ret = -EINVAL;
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
pmt_cmd_id = msg[read_pos++];
|
||||||
|
if (pmt_cmd_id != 1 && pmt_cmd_id != 4)
|
||||||
|
dev_err(fdtv->device, "invalid pmt_cmd_id %d "
|
||||||
|
"at stream level\n", pmt_cmd_id);
|
||||||
|
|
||||||
|
- if (es_info_length > sizeof(c->operand) - 4 -
|
||||||
|
- write_pos) {
|
||||||
|
+ if (es_info_length > sizeof(c->operand) - 4 - write_pos ||
|
||||||
|
+ es_info_length > length - read_pos) {
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
diff --git a/drivers/media/firewire/firedtv-ci.c b/drivers/media/firewire/firedtv-ci.c
|
||||||
|
index edbb30fdd9d95..93fb4b7312afc 100644
|
||||||
|
--- a/drivers/media/firewire/firedtv-ci.c
|
||||||
|
+++ b/drivers/media/firewire/firedtv-ci.c
|
||||||
|
@@ -138,6 +138,8 @@ static int fdtv_ca_pmt(struct firedtv *fdtv, void *arg)
|
||||||
|
} else {
|
||||||
|
data_length = msg->msg[3];
|
||||||
|
}
|
||||||
|
+ if (data_length > sizeof(msg->msg) - data_pos)
|
||||||
|
+ return -EINVAL;
|
||||||
|
|
||||||
|
return avc_ca_pmt(fdtv, &msg->msg[data_pos], data_length);
|
||||||
|
}
|
||||||
|
diff --git a/drivers/staging/android/ion/ion-ioctl.c b/drivers/staging/android/ion/ion-ioctl.c
|
||||||
|
index e3596855a7031..a27865b94416b 100644
|
||||||
|
--- a/drivers/staging/android/ion/ion-ioctl.c
|
||||||
|
+++ b/drivers/staging/android/ion/ion-ioctl.c
|
||||||
|
@@ -30,6 +30,69 @@ union ion_ioctl_arg {
|
||||||
|
struct ion_heap_query query;
|
||||||
|
};
|
||||||
|
|
||||||
|
+/* Must hold the client lock */
|
||||||
|
+static void user_ion_handle_get(struct ion_handle *handle)
|
||||||
|
+{
|
||||||
|
+ if (handle->user_ref_count++ == 0)
|
||||||
|
+ kref_get(&handle->ref);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* Must hold the client lock */
|
||||||
|
+static struct ion_handle *user_ion_handle_get_check_overflow(
|
||||||
|
+ struct ion_handle *handle)
|
||||||
|
+{
|
||||||
|
+ if (handle->user_ref_count + 1 == 0)
|
||||||
|
+ return ERR_PTR(-EOVERFLOW);
|
||||||
|
+ user_ion_handle_get(handle);
|
||||||
|
+ return handle;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* passes a kref to the user ref count.
|
||||||
|
+ * We know we're holding a kref to the object before and
|
||||||
|
+ * after this call, so no need to reverify handle.
|
||||||
|
+ */
|
||||||
|
+static struct ion_handle *pass_to_user(struct ion_handle *handle)
|
||||||
|
+{
|
||||||
|
+ struct ion_client *client = handle->client;
|
||||||
|
+ struct ion_handle *ret;
|
||||||
|
+
|
||||||
|
+ mutex_lock(&client->lock);
|
||||||
|
+ ret = user_ion_handle_get_check_overflow(handle);
|
||||||
|
+ ion_handle_put_nolock(handle);
|
||||||
|
+ mutex_unlock(&client->lock);
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* Must hold the client lock */
|
||||||
|
+static int user_ion_handle_put_nolock(struct ion_handle *handle)
|
||||||
|
+{
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
+ if (--handle->user_ref_count == 0)
|
||||||
|
+ ret = ion_handle_put_nolock(handle);
|
||||||
|
+
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void user_ion_free_nolock(struct ion_client *client,
|
||||||
|
+ struct ion_handle *handle)
|
||||||
|
+{
|
||||||
|
+ bool valid_handle;
|
||||||
|
+
|
||||||
|
+ WARN_ON(client != handle->client);
|
||||||
|
+
|
||||||
|
+ valid_handle = ion_handle_validate(client, handle);
|
||||||
|
+ if (!valid_handle) {
|
||||||
|
+ WARN(1, "%s: invalid handle passed to free.\n", __func__);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ if (handle->user_ref_count == 0) {
|
||||||
|
+ WARN(1, "%s: User does not have access!\n", __func__);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ user_ion_handle_put_nolock(handle);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int validate_ioctl_arg(unsigned int cmd, union ion_ioctl_arg *arg)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
@@ -96,16 +159,15 @@ long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||||
|
{
|
||||||
|
struct ion_handle *handle;
|
||||||
|
|
||||||
|
- handle = ion_alloc(client, data.allocation.len,
|
||||||
|
- data.allocation.align,
|
||||||
|
- data.allocation.heap_id_mask,
|
||||||
|
- data.allocation.flags);
|
||||||
|
+ handle = __ion_alloc(client, data.allocation.len,
|
||||||
|
+ data.allocation.align,
|
||||||
|
+ data.allocation.heap_id_mask,
|
||||||
|
+ data.allocation.flags, true);
|
||||||
|
if (IS_ERR(handle))
|
||||||
|
return PTR_ERR(handle);
|
||||||
|
-
|
||||||
|
data.allocation.handle = handle->id;
|
||||||
|
-
|
||||||
|
cleanup_handle = handle;
|
||||||
|
+ pass_to_user(handle);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ION_IOC_FREE:
|
||||||
|
@@ -118,7 +180,7 @@ long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||||
|
mutex_unlock(&client->lock);
|
||||||
|
return PTR_ERR(handle);
|
||||||
|
}
|
||||||
|
- ion_free_nolock(client, handle);
|
||||||
|
+ user_ion_free_nolock(client, handle);
|
||||||
|
ion_handle_put_nolock(handle);
|
||||||
|
mutex_unlock(&client->lock);
|
||||||
|
break;
|
||||||
|
@@ -146,10 +208,16 @@ long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||||
|
struct ion_handle *handle;
|
||||||
|
|
||||||
|
handle = ion_import_dma_buf_fd(client, data.fd.fd);
|
||||||
|
- if (IS_ERR(handle))
|
||||||
|
+ if (IS_ERR(handle)) {
|
||||||
|
ret = PTR_ERR(handle);
|
||||||
|
- else
|
||||||
|
+ } else {
|
||||||
|
data.handle.handle = handle->id;
|
||||||
|
+ handle = pass_to_user(handle);
|
||||||
|
+ if (IS_ERR(handle)) {
|
||||||
|
+ ret = PTR_ERR(handle);
|
||||||
|
+ data.handle.handle = 0;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ION_IOC_SYNC:
|
||||||
|
@@ -174,10 +242,16 @@ long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||||
|
|
||||||
|
if (dir & _IOC_READ) {
|
||||||
|
if (copy_to_user((void __user *)arg, &data, _IOC_SIZE(cmd))) {
|
||||||
|
- if (cleanup_handle)
|
||||||
|
- ion_free(client, cleanup_handle);
|
||||||
|
+ if (cleanup_handle) {
|
||||||
|
+ mutex_lock(&client->lock);
|
||||||
|
+ user_ion_free_nolock(client, cleanup_handle);
|
||||||
|
+ ion_handle_put_nolock(cleanup_handle);
|
||||||
|
+ mutex_unlock(&client->lock);
|
||||||
|
+ }
|
||||||
|
return -EFAULT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ if (cleanup_handle)
|
||||||
|
+ ion_handle_put(cleanup_handle);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
|
||||||
|
index aac9b38b8c25c..b272f2ab87e8f 100644
|
||||||
|
--- a/drivers/staging/android/ion/ion.c
|
||||||
|
+++ b/drivers/staging/android/ion/ion.c
|
||||||
|
@@ -363,8 +363,8 @@ struct ion_handle *ion_handle_get_by_id_nolock(struct ion_client *client,
|
||||||
|
return ERR_PTR(-EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
-static bool ion_handle_validate(struct ion_client *client,
|
||||||
|
- struct ion_handle *handle)
|
||||||
|
+bool ion_handle_validate(struct ion_client *client,
|
||||||
|
+ struct ion_handle *handle)
|
||||||
|
{
|
||||||
|
WARN_ON(!mutex_is_locked(&client->lock));
|
||||||
|
return idr_find(&client->idr, handle->id) == handle;
|
||||||
|
@@ -401,9 +401,9 @@ static int ion_handle_add(struct ion_client *client, struct ion_handle *handle)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
-struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
|
||||||
|
- size_t align, unsigned int heap_id_mask,
|
||||||
|
- unsigned int flags)
|
||||||
|
+struct ion_handle *__ion_alloc(struct ion_client *client, size_t len,
|
||||||
|
+ size_t align, unsigned int heap_id_mask,
|
||||||
|
+ unsigned int flags, bool grab_handle)
|
||||||
|
{
|
||||||
|
struct ion_handle *handle;
|
||||||
|
struct ion_device *dev = client->dev;
|
||||||
|
@@ -453,6 +453,8 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
|
||||||
|
return handle;
|
||||||
|
|
||||||
|
mutex_lock(&client->lock);
|
||||||
|
+ if (grab_handle)
|
||||||
|
+ ion_handle_get(handle);
|
||||||
|
ret = ion_handle_add(client, handle);
|
||||||
|
mutex_unlock(&client->lock);
|
||||||
|
if (ret) {
|
||||||
|
@@ -462,6 +464,13 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
|
||||||
|
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
|
||||||
|
+ size_t align, unsigned int heap_id_mask,
|
||||||
|
+ unsigned int flags)
|
||||||
|
+{
|
||||||
|
+ return __ion_alloc(client, len, align, heap_id_mask, flags, false);
|
||||||
|
+}
|
||||||
|
EXPORT_SYMBOL(ion_alloc);
|
||||||
|
|
||||||
|
void ion_free_nolock(struct ion_client *client,
|
||||||
|
diff --git a/drivers/staging/android/ion/ion.h b/drivers/staging/android/ion/ion.h
|
||||||
|
index 93dafb4586e43..cfa50dfb46edc 100644
|
||||||
|
--- a/drivers/staging/android/ion/ion.h
|
||||||
|
+++ b/drivers/staging/android/ion/ion.h
|
||||||
|
@@ -109,6 +109,10 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
|
||||||
|
size_t align, unsigned int heap_id_mask,
|
||||||
|
unsigned int flags);
|
||||||
|
|
||||||
|
+struct ion_handle *__ion_alloc(struct ion_client *client, size_t len,
|
||||||
|
+ size_t align, unsigned int heap_id_mask,
|
||||||
|
+ unsigned int flags, bool grab_handle);
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* ion_free - free a handle
|
||||||
|
* @client: the client
|
||||||
|
diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h
|
||||||
|
index 760e41885448a..e1dd25eab1dbd 100644
|
||||||
|
--- a/drivers/staging/android/ion/ion_priv.h
|
||||||
|
+++ b/drivers/staging/android/ion/ion_priv.h
|
||||||
|
@@ -149,6 +149,7 @@ struct ion_client {
|
||||||
|
*/
|
||||||
|
struct ion_handle {
|
||||||
|
struct kref ref;
|
||||||
|
+ unsigned int user_ref_count;
|
||||||
|
struct ion_client *client;
|
||||||
|
struct ion_buffer *buffer;
|
||||||
|
struct rb_node node;
|
||||||
|
@@ -459,6 +460,9 @@ int ion_sync_for_device(struct ion_client *client, int fd);
|
||||||
|
struct ion_handle *ion_handle_get_by_id_nolock(struct ion_client *client,
|
||||||
|
int id);
|
||||||
|
|
||||||
|
+bool ion_handle_validate(struct ion_client *client,
|
||||||
|
+ struct ion_handle *handle);
|
||||||
|
+
|
||||||
|
void ion_free_nolock(struct ion_client *client, struct ion_handle *handle);
|
||||||
|
|
||||||
|
int ion_handle_put_nolock(struct ion_handle *handle);
|
||||||
|
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
|
||||||
|
index 3ee60c5332179..2fb4633897084 100644
|
||||||
|
--- a/fs/nfs/nfs4client.c
|
||||||
|
+++ b/fs/nfs/nfs4client.c
|
||||||
|
@@ -177,8 +177,11 @@ void nfs40_shutdown_client(struct nfs_client *clp)
|
||||||
|
|
||||||
|
struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init)
|
||||||
|
{
|
||||||
|
- int err;
|
||||||
|
+ char buf[INET6_ADDRSTRLEN + 1];
|
||||||
|
+ const char *ip_addr = cl_init->ip_addr;
|
||||||
|
struct nfs_client *clp = nfs_alloc_client(cl_init);
|
||||||
|
+ int err;
|
||||||
|
+
|
||||||
|
if (IS_ERR(clp))
|
||||||
|
return clp;
|
||||||
|
|
||||||
|
@@ -202,6 +205,44 @@ struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init)
|
||||||
|
#if IS_ENABLED(CONFIG_NFS_V4_1)
|
||||||
|
init_waitqueue_head(&clp->cl_lock_waitq);
|
||||||
|
#endif
|
||||||
|
+
|
||||||
|
+ if (cl_init->minorversion != 0)
|
||||||
|
+ __set_bit(NFS_CS_INFINITE_SLOTS, &clp->cl_flags);
|
||||||
|
+ __set_bit(NFS_CS_DISCRTRY, &clp->cl_flags);
|
||||||
|
+ __set_bit(NFS_CS_NO_RETRANS_TIMEOUT, &clp->cl_flags);
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Set up the connection to the server before we add add to the
|
||||||
|
+ * global list.
|
||||||
|
+ */
|
||||||
|
+ err = nfs_create_rpc_client(clp, cl_init, RPC_AUTH_GSS_KRB5I);
|
||||||
|
+ if (err == -EINVAL)
|
||||||
|
+ err = nfs_create_rpc_client(clp, cl_init, RPC_AUTH_UNIX);
|
||||||
|
+ if (err < 0)
|
||||||
|
+ goto error;
|
||||||
|
+
|
||||||
|
+ /* If no clientaddr= option was specified, find a usable cb address */
|
||||||
|
+ if (ip_addr == NULL) {
|
||||||
|
+ struct sockaddr_storage cb_addr;
|
||||||
|
+ struct sockaddr *sap = (struct sockaddr *)&cb_addr;
|
||||||
|
+
|
||||||
|
+ err = rpc_localaddr(clp->cl_rpcclient, sap, sizeof(cb_addr));
|
||||||
|
+ if (err < 0)
|
||||||
|
+ goto error;
|
||||||
|
+ err = rpc_ntop(sap, buf, sizeof(buf));
|
||||||
|
+ if (err < 0)
|
||||||
|
+ goto error;
|
||||||
|
+ ip_addr = (const char *)buf;
|
||||||
|
+ }
|
||||||
|
+ strlcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));
|
||||||
|
+
|
||||||
|
+ err = nfs_idmap_new(clp);
|
||||||
|
+ if (err < 0) {
|
||||||
|
+ dprintk("%s: failed to create idmapper. Error = %d\n",
|
||||||
|
+ __func__, err);
|
||||||
|
+ goto error;
|
||||||
|
+ }
|
||||||
|
+ __set_bit(NFS_CS_IDMAP, &clp->cl_res_state);
|
||||||
|
return clp;
|
||||||
|
|
||||||
|
error:
|
||||||
|
@@ -354,8 +395,6 @@ static int nfs4_init_client_minor_version(struct nfs_client *clp)
|
||||||
|
struct nfs_client *nfs4_init_client(struct nfs_client *clp,
|
||||||
|
const struct nfs_client_initdata *cl_init)
|
||||||
|
{
|
||||||
|
- char buf[INET6_ADDRSTRLEN + 1];
|
||||||
|
- const char *ip_addr = cl_init->ip_addr;
|
||||||
|
struct nfs_client *old;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
@@ -365,43 +404,6 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp,
|
||||||
|
return clp;
|
||||||
|
}
|
||||||
|
|
||||||
|
- /* Check NFS protocol revision and initialize RPC op vector */
|
||||||
|
- clp->rpc_ops = &nfs_v4_clientops;
|
||||||
|
-
|
||||||
|
- if (clp->cl_minorversion != 0)
|
||||||
|
- __set_bit(NFS_CS_INFINITE_SLOTS, &clp->cl_flags);
|
||||||
|
- __set_bit(NFS_CS_DISCRTRY, &clp->cl_flags);
|
||||||
|
- __set_bit(NFS_CS_NO_RETRANS_TIMEOUT, &clp->cl_flags);
|
||||||
|
-
|
||||||
|
- error = nfs_create_rpc_client(clp, cl_init, RPC_AUTH_GSS_KRB5I);
|
||||||
|
- if (error == -EINVAL)
|
||||||
|
- error = nfs_create_rpc_client(clp, cl_init, RPC_AUTH_UNIX);
|
||||||
|
- if (error < 0)
|
||||||
|
- goto error;
|
||||||
|
-
|
||||||
|
- /* If no clientaddr= option was specified, find a usable cb address */
|
||||||
|
- if (ip_addr == NULL) {
|
||||||
|
- struct sockaddr_storage cb_addr;
|
||||||
|
- struct sockaddr *sap = (struct sockaddr *)&cb_addr;
|
||||||
|
-
|
||||||
|
- error = rpc_localaddr(clp->cl_rpcclient, sap, sizeof(cb_addr));
|
||||||
|
- if (error < 0)
|
||||||
|
- goto error;
|
||||||
|
- error = rpc_ntop(sap, buf, sizeof(buf));
|
||||||
|
- if (error < 0)
|
||||||
|
- goto error;
|
||||||
|
- ip_addr = (const char *)buf;
|
||||||
|
- }
|
||||||
|
- strlcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));
|
||||||
|
-
|
||||||
|
- error = nfs_idmap_new(clp);
|
||||||
|
- if (error < 0) {
|
||||||
|
- dprintk("%s: failed to create idmapper. Error = %d\n",
|
||||||
|
- __func__, error);
|
||||||
|
- goto error;
|
||||||
|
- }
|
||||||
|
- __set_bit(NFS_CS_IDMAP, &clp->cl_res_state);
|
||||||
|
-
|
||||||
|
error = nfs4_init_client_minor_version(clp);
|
||||||
|
if (error < 0)
|
||||||
|
goto error;
|
||||||
|
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
|
||||||
|
index bc5ff3a53d4a6..e7addfcd302f4 100644
|
||||||
|
--- a/lib/Kconfig.debug
|
||||||
|
+++ b/lib/Kconfig.debug
|
||||||
|
@@ -1091,7 +1091,7 @@ config LOCKDEP
|
||||||
|
bool
|
||||||
|
depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
|
||||||
|
select STACKTRACE
|
||||||
|
- select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC && !SCORE
|
||||||
|
+ select FRAME_POINTER if !MIPS && !PPC && !ARM && !S390 && !MICROBLAZE && !ARC && !SCORE
|
||||||
|
select KALLSYMS
|
||||||
|
select KALLSYMS_ALL
|
||||||
|
|
||||||
|
@@ -1670,7 +1670,7 @@ config FAULT_INJECTION_STACKTRACE_FILTER
|
||||||
|
depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
|
||||||
|
depends on !X86_64
|
||||||
|
select STACKTRACE
|
||||||
|
- select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !SCORE
|
||||||
|
+ select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !SCORE
|
||||||
|
help
|
||||||
|
Provide stacktrace filter for fault-injection capabilities
|
||||||
|
|
||||||
|
@@ -1679,7 +1679,7 @@ config LATENCYTOP
|
||||||
|
depends on DEBUG_KERNEL
|
||||||
|
depends on STACKTRACE_SUPPORT
|
||||||
|
depends on PROC_FS
|
||||||
|
- select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC
|
||||||
|
+ select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC
|
||||||
|
select KALLSYMS
|
||||||
|
select KALLSYMS_ALL
|
||||||
|
select STACKTRACE
|
||||||
1470
patch/kernel/archive/sun50iw9-4.9/patch-4.9.299-300.patch
Normal file
1470
patch/kernel/archive/sun50iw9-4.9/patch-4.9.299-300.patch
Normal file
File diff suppressed because it is too large
Load Diff
122
patch/kernel/archive/sun50iw9-4.9/patch-4.9.300-301.patch
Normal file
122
patch/kernel/archive/sun50iw9-4.9/patch-4.9.300-301.patch
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 52e73f525a442..776408b6c56e7 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 300
|
||||||
|
+SUBLEVEL = 301
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/drivers/mmc/host/moxart-mmc.c b/drivers/mmc/host/moxart-mmc.c
|
||||||
|
index 41a5493cb68d8..a5b03fb7656d1 100644
|
||||||
|
--- a/drivers/mmc/host/moxart-mmc.c
|
||||||
|
+++ b/drivers/mmc/host/moxart-mmc.c
|
||||||
|
@@ -698,12 +698,12 @@ static int moxart_remove(struct platform_device *pdev)
|
||||||
|
if (!IS_ERR(host->dma_chan_rx))
|
||||||
|
dma_release_channel(host->dma_chan_rx);
|
||||||
|
mmc_remove_host(mmc);
|
||||||
|
- mmc_free_host(mmc);
|
||||||
|
|
||||||
|
writel(0, host->base + REG_INTERRUPT_MASK);
|
||||||
|
writel(0, host->base + REG_POWER_CONTROL);
|
||||||
|
writel(readl(host->base + REG_CLOCK_CONTROL) | CLK_OFF,
|
||||||
|
host->base + REG_CLOCK_CONTROL);
|
||||||
|
+ mmc_free_host(mmc);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
|
||||||
|
index 248b0bf5d6795..5702419c9f300 100644
|
||||||
|
--- a/kernel/cgroup.c
|
||||||
|
+++ b/kernel/cgroup.c
|
||||||
|
@@ -1854,6 +1854,7 @@ static int cgroup_remount(struct kernfs_root *kf_root, int *flags, char *data)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
struct cgroup_root *root = cgroup_root_from_kf(kf_root);
|
||||||
|
+ struct cgroup_namespace *ns = current->nsproxy->cgroup_ns;
|
||||||
|
struct cgroup_sb_opts opts;
|
||||||
|
u16 added_mask, removed_mask;
|
||||||
|
|
||||||
|
@@ -1873,6 +1874,13 @@ static int cgroup_remount(struct kernfs_root *kf_root, int *flags, char *data)
|
||||||
|
pr_warn("option changes via remount are deprecated (pid=%d comm=%s)\n",
|
||||||
|
task_tgid_nr(current), current->comm);
|
||||||
|
|
||||||
|
+ /* See cgroup_mount release_agent handling */
|
||||||
|
+ if (opts.release_agent &&
|
||||||
|
+ ((ns->user_ns != &init_user_ns) || !capable(CAP_SYS_ADMIN))) {
|
||||||
|
+ ret = -EINVAL;
|
||||||
|
+ goto out_unlock;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
added_mask = opts.subsys_mask & ~root->subsys_mask;
|
||||||
|
removed_mask = root->subsys_mask & ~opts.subsys_mask;
|
||||||
|
|
||||||
|
@@ -2248,6 +2256,16 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type,
|
||||||
|
goto out_unlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * Release agent gets called with all capabilities,
|
||||||
|
+ * require capabilities to set release agent.
|
||||||
|
+ */
|
||||||
|
+ if (opts.release_agent &&
|
||||||
|
+ ((ns->user_ns != &init_user_ns) || !capable(CAP_SYS_ADMIN))) {
|
||||||
|
+ ret = -EINVAL;
|
||||||
|
+ goto out_unlock;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
root = kzalloc(sizeof(*root), GFP_KERNEL);
|
||||||
|
if (!root) {
|
||||||
|
ret = -ENOMEM;
|
||||||
|
@@ -3026,6 +3044,14 @@ static ssize_t cgroup_release_agent_write(struct kernfs_open_file *of,
|
||||||
|
|
||||||
|
BUILD_BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX);
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * Release agent gets called with all capabilities,
|
||||||
|
+ * require capabilities to set release agent.
|
||||||
|
+ */
|
||||||
|
+ if ((of->file->f_cred->user_ns != &init_user_ns) ||
|
||||||
|
+ !capable(CAP_SYS_ADMIN))
|
||||||
|
+ return -EPERM;
|
||||||
|
+
|
||||||
|
cgrp = cgroup_kn_lock_live(of->kn, false);
|
||||||
|
if (!cgrp)
|
||||||
|
return -ENODEV;
|
||||||
|
diff --git a/net/tipc/link.c b/net/tipc/link.c
|
||||||
|
index 6fc2fa75503d2..2c1350e811e2e 100644
|
||||||
|
--- a/net/tipc/link.c
|
||||||
|
+++ b/net/tipc/link.c
|
||||||
|
@@ -1441,12 +1441,15 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
|
||||||
|
u16 peers_tol = msg_link_tolerance(hdr);
|
||||||
|
u16 peers_prio = msg_linkprio(hdr);
|
||||||
|
u16 rcv_nxt = l->rcv_nxt;
|
||||||
|
- u16 dlen = msg_data_sz(hdr);
|
||||||
|
+ u32 dlen = msg_data_sz(hdr);
|
||||||
|
int mtyp = msg_type(hdr);
|
||||||
|
void *data;
|
||||||
|
char *if_name;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
+ if (dlen > U16_MAX)
|
||||||
|
+ goto exit;
|
||||||
|
+
|
||||||
|
if (tipc_link_is_blocked(l) || !xmitq)
|
||||||
|
goto exit;
|
||||||
|
|
||||||
|
diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
|
||||||
|
index 0fcfb3916dcf2..e1f4538b16532 100644
|
||||||
|
--- a/net/tipc/monitor.c
|
||||||
|
+++ b/net/tipc/monitor.c
|
||||||
|
@@ -457,6 +457,8 @@ void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr,
|
||||||
|
state->probing = false;
|
||||||
|
|
||||||
|
/* Sanity check received domain record */
|
||||||
|
+ if (new_member_cnt > MAX_MON_DOMAIN)
|
||||||
|
+ return;
|
||||||
|
if (dlen < dom_rec_len(arrv_dom, 0))
|
||||||
|
return;
|
||||||
|
if (dlen != dom_rec_len(arrv_dom, new_member_cnt))
|
||||||
798
patch/kernel/archive/sun50iw9-4.9/patch-4.9.301-302.patch
Normal file
798
patch/kernel/archive/sun50iw9-4.9/patch-4.9.301-302.patch
Normal file
@@ -0,0 +1,798 @@
|
|||||||
|
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
|
||||||
|
index ffab8b5caa603..30ba179392d81 100644
|
||||||
|
--- a/Documentation/sysctl/kernel.txt
|
||||||
|
+++ b/Documentation/sysctl/kernel.txt
|
||||||
|
@@ -90,6 +90,7 @@ show up in /proc/sys/kernel:
|
||||||
|
- sysctl_writes_strict
|
||||||
|
- tainted
|
||||||
|
- threads-max
|
||||||
|
+- unprivileged_bpf_disabled
|
||||||
|
- unknown_nmi_panic
|
||||||
|
- watchdog
|
||||||
|
- watchdog_thresh
|
||||||
|
@@ -995,6 +996,26 @@ available RAM pages threads-max is reduced accordingly.
|
||||||
|
|
||||||
|
==============================================================
|
||||||
|
|
||||||
|
+unprivileged_bpf_disabled:
|
||||||
|
+
|
||||||
|
+Writing 1 to this entry will disable unprivileged calls to bpf();
|
||||||
|
+once disabled, calling bpf() without CAP_SYS_ADMIN will return
|
||||||
|
+-EPERM. Once set to 1, this can't be cleared from the running kernel
|
||||||
|
+anymore.
|
||||||
|
+
|
||||||
|
+Writing 2 to this entry will also disable unprivileged calls to bpf(),
|
||||||
|
+however, an admin can still change this setting later on, if needed, by
|
||||||
|
+writing 0 or 1 to this entry.
|
||||||
|
+
|
||||||
|
+If BPF_UNPRIV_DEFAULT_OFF is enabled in the kernel config, then this
|
||||||
|
+entry will default to 2 instead of 0.
|
||||||
|
+
|
||||||
|
+ 0 - Unprivileged calls to bpf() are enabled
|
||||||
|
+ 1 - Unprivileged calls to bpf() are disabled without recovery
|
||||||
|
+ 2 - Unprivileged calls to bpf() are disabled
|
||||||
|
+
|
||||||
|
+==============================================================
|
||||||
|
+
|
||||||
|
unknown_nmi_panic:
|
||||||
|
|
||||||
|
The value in this file affects behavior of handling NMI. When the
|
||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 776408b6c56e7..d2a09d4a37082 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 301
|
||||||
|
+SUBLEVEL = 302
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arm/boot/dts/imx23-evk.dts b/arch/arm/boot/dts/imx23-evk.dts
|
||||||
|
index 57e29977ba06c..acaa3a7c2fc65 100644
|
||||||
|
--- a/arch/arm/boot/dts/imx23-evk.dts
|
||||||
|
+++ b/arch/arm/boot/dts/imx23-evk.dts
|
||||||
|
@@ -48,7 +48,6 @@
|
||||||
|
MX23_PAD_LCD_RESET__GPIO_1_18
|
||||||
|
MX23_PAD_PWM3__GPIO_1_29
|
||||||
|
MX23_PAD_PWM4__GPIO_1_30
|
||||||
|
- MX23_PAD_SSP1_DETECT__SSP1_DETECT
|
||||||
|
>;
|
||||||
|
fsl,drive-strength = <MXS_DRIVE_4mA>;
|
||||||
|
fsl,voltage = <MXS_VOLTAGE_HIGH>;
|
||||||
|
diff --git a/arch/arm/boot/dts/imx6qdl-udoo.dtsi b/arch/arm/boot/dts/imx6qdl-udoo.dtsi
|
||||||
|
index fc4ae2e423bd7..b0fdcae66ead3 100644
|
||||||
|
--- a/arch/arm/boot/dts/imx6qdl-udoo.dtsi
|
||||||
|
+++ b/arch/arm/boot/dts/imx6qdl-udoo.dtsi
|
||||||
|
@@ -9,6 +9,8 @@
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
+#include <dt-bindings/gpio/gpio.h>
|
||||||
|
+
|
||||||
|
/ {
|
||||||
|
aliases {
|
||||||
|
backlight = &backlight;
|
||||||
|
@@ -201,6 +203,7 @@
|
||||||
|
MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
|
||||||
|
MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
|
||||||
|
MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
|
||||||
|
+ MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x1b0b0
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
|
||||||
|
@@ -267,7 +270,7 @@
|
||||||
|
&usdhc3 {
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&pinctrl_usdhc3>;
|
||||||
|
- non-removable;
|
||||||
|
+ cd-gpios = <&gpio7 0 GPIO_ACTIVE_LOW>;
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
|
||||||
|
index da9813f09d7d7..2b5ae00f8df25 100644
|
||||||
|
--- a/drivers/hid/Kconfig
|
||||||
|
+++ b/drivers/hid/Kconfig
|
||||||
|
@@ -865,7 +865,7 @@ config THRUSTMASTER_FF
|
||||||
|
|
||||||
|
config HID_WACOM
|
||||||
|
tristate "Wacom Intuos/Graphire tablet support (USB)"
|
||||||
|
- depends on HID
|
||||||
|
+ depends on USB_HID
|
||||||
|
select POWER_SUPPLY
|
||||||
|
select NEW_LEDS
|
||||||
|
select LEDS_CLASS
|
||||||
|
diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
|
||||||
|
index d19ad92eede95..b7d7f40885689 100644
|
||||||
|
--- a/drivers/hwmon/dell-smm-hwmon.c
|
||||||
|
+++ b/drivers/hwmon/dell-smm-hwmon.c
|
||||||
|
@@ -294,7 +294,7 @@ static int i8k_get_fan_nominal_speed(int fan, int speed)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
- * Set the fan speed (off, low, high). Returns the new fan status.
|
||||||
|
+ * Set the fan speed (off, low, high, ...).
|
||||||
|
*/
|
||||||
|
static int i8k_set_fan(int fan, int speed)
|
||||||
|
{
|
||||||
|
@@ -303,7 +303,7 @@ static int i8k_set_fan(int fan, int speed)
|
||||||
|
speed = (speed < 0) ? 0 : ((speed > i8k_fan_max) ? i8k_fan_max : speed);
|
||||||
|
regs.ebx = (fan & 0xff) | (speed << 8);
|
||||||
|
|
||||||
|
- return i8k_smm(®s) ? : i8k_get_fan_status(fan);
|
||||||
|
+ return i8k_smm(®s);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int i8k_get_temp_type(int sensor)
|
||||||
|
@@ -417,7 +417,7 @@ static int
|
||||||
|
i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg)
|
||||||
|
{
|
||||||
|
int val = 0;
|
||||||
|
- int speed;
|
||||||
|
+ int speed, err;
|
||||||
|
unsigned char buff[16];
|
||||||
|
int __user *argp = (int __user *)arg;
|
||||||
|
|
||||||
|
@@ -478,7 +478,11 @@ i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg)
|
||||||
|
if (copy_from_user(&speed, argp + 1, sizeof(int)))
|
||||||
|
return -EFAULT;
|
||||||
|
|
||||||
|
- val = i8k_set_fan(val, speed);
|
||||||
|
+ err = i8k_set_fan(val, speed);
|
||||||
|
+ if (err < 0)
|
||||||
|
+ return err;
|
||||||
|
+
|
||||||
|
+ val = i8k_get_fan_status(val);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
|
||||||
|
index 323b86b38b3a3..6cd2ae95e21ed 100644
|
||||||
|
--- a/drivers/input/serio/i8042-x86ia64io.h
|
||||||
|
+++ b/drivers/input/serio/i8042-x86ia64io.h
|
||||||
|
@@ -586,11 +586,6 @@ static const struct dmi_system_id i8042_dmi_forcemux_table[] __initconst = {
|
||||||
|
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
|
||||||
|
},
|
||||||
|
- }, {
|
||||||
|
- .matches = {
|
||||||
|
- DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||||
|
- DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
|
||||||
|
- },
|
||||||
|
},
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
@@ -677,6 +672,12 @@ static const struct dmi_system_id i8042_dmi_noselftest_table[] = {
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "Z450LA"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
+ {
|
||||||
|
+ .matches = {
|
||||||
|
+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||||
|
+ DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
|
||||||
|
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
|
||||||
|
index 1e2ee97b92406..578d8e12e2d21 100644
|
||||||
|
--- a/drivers/net/bonding/bond_3ad.c
|
||||||
|
+++ b/drivers/net/bonding/bond_3ad.c
|
||||||
|
@@ -971,8 +971,8 @@ static void ad_mux_machine(struct port *port, bool *update_slave_arr)
|
||||||
|
if (port->aggregator &&
|
||||||
|
port->aggregator->is_active &&
|
||||||
|
!__port_is_enabled(port)) {
|
||||||
|
-
|
||||||
|
__enable_port(port);
|
||||||
|
+ *update_slave_arr = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
@@ -1724,6 +1724,7 @@ static void ad_agg_selection_logic(struct aggregator *agg,
|
||||||
|
port = port->next_port_in_aggregator) {
|
||||||
|
__enable_port(port);
|
||||||
|
}
|
||||||
|
+ *update_slave_arr = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
|
||||||
|
index 46998a58e3d96..467dc0c60759f 100644
|
||||||
|
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
|
||||||
|
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
|
||||||
|
@@ -278,16 +278,6 @@ static int axienet_dma_bd_init(struct net_device *ndev)
|
||||||
|
axienet_dma_out32(lp, XAXIDMA_TX_CR_OFFSET,
|
||||||
|
cr | XAXIDMA_CR_RUNSTOP_MASK);
|
||||||
|
|
||||||
|
- /* Wait for PhyRstCmplt bit to be set, indicating the PHY reset has finished */
|
||||||
|
- ret = read_poll_timeout(axienet_ior, value,
|
||||||
|
- value & XAE_INT_PHYRSTCMPLT_MASK,
|
||||||
|
- DELAY_OF_ONE_MILLISEC, 50000, false, lp,
|
||||||
|
- XAE_IS_OFFSET);
|
||||||
|
- if (ret) {
|
||||||
|
- dev_err(lp->dev, "%s: timeout waiting for PhyRstCmplt\n", __func__);
|
||||||
|
- return ret;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
return 0;
|
||||||
|
out:
|
||||||
|
axienet_dma_bd_release(ndev);
|
||||||
|
diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
|
||||||
|
index 0275319906748..a76723a4219a6 100644
|
||||||
|
--- a/drivers/staging/fbtft/fbtft.h
|
||||||
|
+++ b/drivers/staging/fbtft/fbtft.h
|
||||||
|
@@ -343,7 +343,10 @@ static int __init fbtft_driver_module_init(void) \
|
||||||
|
ret = spi_register_driver(&fbtft_driver_spi_driver); \
|
||||||
|
if (ret < 0) \
|
||||||
|
return ret; \
|
||||||
|
- return platform_driver_register(&fbtft_driver_platform_driver); \
|
||||||
|
+ ret = platform_driver_register(&fbtft_driver_platform_driver); \
|
||||||
|
+ if (ret < 0) \
|
||||||
|
+ spi_unregister_driver(&fbtft_driver_spi_driver); \
|
||||||
|
+ return ret; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
static void __exit fbtft_driver_module_exit(void) \
|
||||||
|
diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c
|
||||||
|
index 761b065a40bb3..b2a76ecb5789c 100644
|
||||||
|
--- a/drivers/target/iscsi/iscsi_target_tpg.c
|
||||||
|
+++ b/drivers/target/iscsi/iscsi_target_tpg.c
|
||||||
|
@@ -452,6 +452,9 @@ static bool iscsit_tpg_check_network_portal(
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
spin_unlock(&tpg->tpg_np_lock);
|
||||||
|
+
|
||||||
|
+ if (match)
|
||||||
|
+ break;
|
||||||
|
}
|
||||||
|
spin_unlock(&tiqn->tiqn_tpg_lock);
|
||||||
|
|
||||||
|
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
|
||||||
|
index 8214b0326b3a1..690cb5a63f9a0 100644
|
||||||
|
--- a/drivers/tty/n_tty.c
|
||||||
|
+++ b/drivers/tty/n_tty.c
|
||||||
|
@@ -1377,7 +1377,7 @@ handle_newline:
|
||||||
|
put_tty_queue(c, ldata);
|
||||||
|
smp_store_release(&ldata->canon_head, ldata->read_head);
|
||||||
|
kill_fasync(&tty->fasync, SIGIO, POLL_IN);
|
||||||
|
- wake_up_interruptible_poll(&tty->read_wait, POLLIN);
|
||||||
|
+ wake_up_interruptible_poll(&tty->read_wait, POLLIN | POLLRDNORM);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1658,7 +1658,7 @@ static void __receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
||||||
|
|
||||||
|
if (read_cnt(ldata)) {
|
||||||
|
kill_fasync(&tty->fasync, SIGIO, POLL_IN);
|
||||||
|
- wake_up_interruptible_poll(&tty->read_wait, POLLIN);
|
||||||
|
+ wake_up_interruptible_poll(&tty->read_wait, POLLIN | POLLRDNORM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
|
||||||
|
index b4f528d26bf1a..5c6243a31166a 100644
|
||||||
|
--- a/drivers/tty/serial/sh-sci.c
|
||||||
|
+++ b/drivers/tty/serial/sh-sci.c
|
||||||
|
@@ -2377,6 +2377,10 @@ done:
|
||||||
|
|
||||||
|
serial_port_out(port, SCFCR, ctrl);
|
||||||
|
}
|
||||||
|
+ if (port->flags & UPF_HARD_FLOW) {
|
||||||
|
+ /* Refresh (Auto) RTS */
|
||||||
|
+ sci_set_mctrl(port, port->mctrl);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
scr_val |= s->cfg->scscr & ~(SCSCR_CKE1 | SCSCR_CKE0);
|
||||||
|
dev_dbg(port->dev, "SCSCR 0x%x\n", scr_val);
|
||||||
|
@@ -2391,10 +2395,6 @@ done:
|
||||||
|
*/
|
||||||
|
udelay(DIV_ROUND_UP(10 * 1000000, baud));
|
||||||
|
}
|
||||||
|
- if (port->flags & UPF_HARD_FLOW) {
|
||||||
|
- /* Refresh (Auto) RTS */
|
||||||
|
- sci_set_mctrl(port, port->mctrl);
|
||||||
|
- }
|
||||||
|
|
||||||
|
#ifdef CONFIG_SERIAL_SH_SCI_DMA
|
||||||
|
/*
|
||||||
|
diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
|
||||||
|
index e1c1627a3356b..e785a8a7f1c22 100644
|
||||||
|
--- a/drivers/tty/vt/vt_ioctl.c
|
||||||
|
+++ b/drivers/tty/vt/vt_ioctl.c
|
||||||
|
@@ -694,6 +694,7 @@ int vt_ioctl(struct tty_struct *tty,
|
||||||
|
ret = -ENXIO;
|
||||||
|
else {
|
||||||
|
arg--;
|
||||||
|
+ arg = array_index_nospec(arg, MAX_NR_CONSOLES);
|
||||||
|
console_lock();
|
||||||
|
ret = vc_allocate(arg);
|
||||||
|
console_unlock();
|
||||||
|
@@ -718,9 +719,9 @@ int vt_ioctl(struct tty_struct *tty,
|
||||||
|
if (vsa.console == 0 || vsa.console > MAX_NR_CONSOLES)
|
||||||
|
ret = -ENXIO;
|
||||||
|
else {
|
||||||
|
- vsa.console = array_index_nospec(vsa.console,
|
||||||
|
- MAX_NR_CONSOLES + 1);
|
||||||
|
vsa.console--;
|
||||||
|
+ vsa.console = array_index_nospec(vsa.console,
|
||||||
|
+ MAX_NR_CONSOLES);
|
||||||
|
console_lock();
|
||||||
|
ret = vc_allocate(vsa.console);
|
||||||
|
if (ret == 0) {
|
||||||
|
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
|
||||||
|
index e7ad3ae4ea6bd..65bcbbad6d545 100644
|
||||||
|
--- a/drivers/usb/dwc2/gadget.c
|
||||||
|
+++ b/drivers/usb/dwc2/gadget.c
|
||||||
|
@@ -3979,7 +3979,7 @@ int dwc2_hsotg_suspend(struct dwc2_hsotg *hsotg)
|
||||||
|
hsotg->gadget.speed = USB_SPEED_UNKNOWN;
|
||||||
|
spin_unlock_irqrestore(&hsotg->lock, flags);
|
||||||
|
|
||||||
|
- for (ep = 0; ep < hsotg->num_of_eps; ep++) {
|
||||||
|
+ for (ep = 1; ep < hsotg->num_of_eps; ep++) {
|
||||||
|
if (hsotg->eps_in[ep])
|
||||||
|
dwc2_hsotg_ep_disable(&hsotg->eps_in[ep]->ep);
|
||||||
|
if (hsotg->eps_out[ep])
|
||||||
|
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
|
||||||
|
index e340ef67321e5..58c4b745eae13 100644
|
||||||
|
--- a/drivers/usb/dwc3/gadget.c
|
||||||
|
+++ b/drivers/usb/dwc3/gadget.c
|
||||||
|
@@ -902,6 +902,19 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
|
||||||
|
if (usb_endpoint_xfer_bulk(dep->endpoint.desc) && dep->stream_capable)
|
||||||
|
trb->ctrl |= DWC3_TRB_CTRL_SID_SOFN(req->request.stream_id);
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * As per data book 4.2.3.2TRB Control Bit Rules section
|
||||||
|
+ *
|
||||||
|
+ * The controller autonomously checks the HWO field of a TRB to determine if the
|
||||||
|
+ * entire TRB is valid. Therefore, software must ensure that the rest of the TRB
|
||||||
|
+ * is valid before setting the HWO field to '1'. In most systems, this means that
|
||||||
|
+ * software must update the fourth DWORD of a TRB last.
|
||||||
|
+ *
|
||||||
|
+ * However there is a possibility of CPU re-ordering here which can cause
|
||||||
|
+ * controller to observe the HWO bit set prematurely.
|
||||||
|
+ * Add a write memory barrier to prevent CPU re-ordering.
|
||||||
|
+ */
|
||||||
|
+ wmb();
|
||||||
|
trb->ctrl |= DWC3_TRB_CTRL_HWO;
|
||||||
|
|
||||||
|
trace_dwc3_prepare_trb(dep, trb);
|
||||||
|
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
|
||||||
|
index a7c44a3cb2d25..3b8a8e2d34848 100644
|
||||||
|
--- a/drivers/usb/gadget/composite.c
|
||||||
|
+++ b/drivers/usb/gadget/composite.c
|
||||||
|
@@ -1932,6 +1932,9 @@ unknown:
|
||||||
|
if (w_index != 0x5 || (w_value >> 8))
|
||||||
|
break;
|
||||||
|
interface = w_value & 0xFF;
|
||||||
|
+ if (interface >= MAX_CONFIG_INTERFACES ||
|
||||||
|
+ !os_desc_cfg->interface[interface])
|
||||||
|
+ break;
|
||||||
|
buf[6] = w_index;
|
||||||
|
if (w_length == 0x0A) {
|
||||||
|
count = count_ext_prop(os_desc_cfg,
|
||||||
|
diff --git a/drivers/usb/gadget/function/rndis.c b/drivers/usb/gadget/function/rndis.c
|
||||||
|
index ab6ac1b74ac0f..a912b6b9153fd 100644
|
||||||
|
--- a/drivers/usb/gadget/function/rndis.c
|
||||||
|
+++ b/drivers/usb/gadget/function/rndis.c
|
||||||
|
@@ -642,14 +642,17 @@ static int rndis_set_response(struct rndis_params *params,
|
||||||
|
rndis_set_cmplt_type *resp;
|
||||||
|
rndis_resp_t *r;
|
||||||
|
|
||||||
|
+ BufLength = le32_to_cpu(buf->InformationBufferLength);
|
||||||
|
+ BufOffset = le32_to_cpu(buf->InformationBufferOffset);
|
||||||
|
+ if ((BufLength > RNDIS_MAX_TOTAL_SIZE) ||
|
||||||
|
+ (BufOffset + 8 >= RNDIS_MAX_TOTAL_SIZE))
|
||||||
|
+ return -EINVAL;
|
||||||
|
+
|
||||||
|
r = rndis_add_response(params, sizeof(rndis_set_cmplt_type));
|
||||||
|
if (!r)
|
||||||
|
return -ENOMEM;
|
||||||
|
resp = (rndis_set_cmplt_type *)r->buf;
|
||||||
|
|
||||||
|
- BufLength = le32_to_cpu(buf->InformationBufferLength);
|
||||||
|
- BufOffset = le32_to_cpu(buf->InformationBufferOffset);
|
||||||
|
-
|
||||||
|
#ifdef VERBOSE_DEBUG
|
||||||
|
pr_debug("%s: Length: %d\n", __func__, BufLength);
|
||||||
|
pr_debug("%s: Offset: %d\n", __func__, BufOffset);
|
||||||
|
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
|
||||||
|
index c6ff79360302f..a8573da2717a1 100644
|
||||||
|
--- a/drivers/usb/serial/ch341.c
|
||||||
|
+++ b/drivers/usb/serial/ch341.c
|
||||||
|
@@ -74,6 +74,7 @@ static const struct usb_device_id id_table[] = {
|
||||||
|
{ USB_DEVICE(0x1a86, 0x5523) },
|
||||||
|
{ USB_DEVICE(0x1a86, 0x7522) },
|
||||||
|
{ USB_DEVICE(0x1a86, 0x7523) },
|
||||||
|
+ { USB_DEVICE(0x2184, 0x0057) },
|
||||||
|
{ USB_DEVICE(0x4348, 0x5523) },
|
||||||
|
{ USB_DEVICE(0x9986, 0x7523) },
|
||||||
|
{ },
|
||||||
|
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
|
||||||
|
index dde28ede396bf..ddee42e44a33b 100644
|
||||||
|
--- a/drivers/usb/serial/cp210x.c
|
||||||
|
+++ b/drivers/usb/serial/cp210x.c
|
||||||
|
@@ -49,6 +49,7 @@ static int cp210x_port_remove(struct usb_serial_port *);
|
||||||
|
static void cp210x_dtr_rts(struct usb_serial_port *p, int on);
|
||||||
|
|
||||||
|
static const struct usb_device_id id_table[] = {
|
||||||
|
+ { USB_DEVICE(0x0404, 0x034C) }, /* NCR Retail IO Box */
|
||||||
|
{ USB_DEVICE(0x045B, 0x0053) }, /* Renesas RX610 RX-Stick */
|
||||||
|
{ USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */
|
||||||
|
{ USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
|
||||||
|
@@ -66,6 +67,7 @@ static const struct usb_device_id id_table[] = {
|
||||||
|
{ USB_DEVICE(0x0FCF, 0x1004) }, /* Dynastream ANT2USB */
|
||||||
|
{ USB_DEVICE(0x0FCF, 0x1006) }, /* Dynastream ANT development board */
|
||||||
|
{ USB_DEVICE(0x0FDE, 0xCA05) }, /* OWL Wireless Electricity Monitor CM-160 */
|
||||||
|
+ { USB_DEVICE(0x106F, 0x0003) }, /* CPI / Money Controls Bulk Coin Recycler */
|
||||||
|
{ USB_DEVICE(0x10A6, 0xAA26) }, /* Knock-off DCU-11 cable */
|
||||||
|
{ USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */
|
||||||
|
{ USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */
|
||||||
|
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
|
||||||
|
index fe6b32c2ff1cb..5c4fa4fcb1e88 100644
|
||||||
|
--- a/drivers/usb/serial/ftdi_sio.c
|
||||||
|
+++ b/drivers/usb/serial/ftdi_sio.c
|
||||||
|
@@ -964,6 +964,7 @@ static const struct usb_device_id id_table_combined[] = {
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_023_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_VX_034_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_101_PID) },
|
||||||
|
+ { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_159_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_1_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_2_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_3_PID) },
|
||||||
|
@@ -972,12 +973,14 @@ static const struct usb_device_id id_table_combined[] = {
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_6_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_7_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_160_8_PID) },
|
||||||
|
+ { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_235_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_257_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_1_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_2_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_3_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_279_4_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_313_PID) },
|
||||||
|
+ { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_320_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_324_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_346_1_PID) },
|
||||||
|
{ USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_346_2_PID) },
|
||||||
|
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
|
||||||
|
index 3b7cea8df446c..006e92d26baba 100644
|
||||||
|
--- a/drivers/usb/serial/ftdi_sio_ids.h
|
||||||
|
+++ b/drivers/usb/serial/ftdi_sio_ids.h
|
||||||
|
@@ -1505,6 +1505,9 @@
|
||||||
|
#define BRAINBOXES_VX_023_PID 0x1003 /* VX-023 ExpressCard 1 Port RS422/485 */
|
||||||
|
#define BRAINBOXES_VX_034_PID 0x1004 /* VX-034 ExpressCard 2 Port RS422/485 */
|
||||||
|
#define BRAINBOXES_US_101_PID 0x1011 /* US-101 1xRS232 */
|
||||||
|
+#define BRAINBOXES_US_159_PID 0x1021 /* US-159 1xRS232 */
|
||||||
|
+#define BRAINBOXES_US_235_PID 0x1017 /* US-235 1xRS232 */
|
||||||
|
+#define BRAINBOXES_US_320_PID 0x1019 /* US-320 1xRS422/485 */
|
||||||
|
#define BRAINBOXES_US_324_PID 0x1013 /* US-324 1xRS422/485 1Mbaud */
|
||||||
|
#define BRAINBOXES_US_606_1_PID 0x2001 /* US-606 6 Port RS232 Serial Port 1 and 2 */
|
||||||
|
#define BRAINBOXES_US_606_2_PID 0x2002 /* US-606 6 Port RS232 Serial Port 3 and 4 */
|
||||||
|
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
|
||||||
|
index 9479abb9eaaaf..4c3ff0706554f 100644
|
||||||
|
--- a/drivers/usb/serial/option.c
|
||||||
|
+++ b/drivers/usb/serial/option.c
|
||||||
|
@@ -1625,6 +1625,8 @@ static const struct usb_device_id option_ids[] = {
|
||||||
|
.driver_info = RSVD(2) },
|
||||||
|
{ USB_DEVICE_INTERFACE_CLASS(ZTE_VENDOR_ID, 0x1476, 0xff) }, /* GosunCn ZTE WeLink ME3630 (ECM/NCM mode) */
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1481, 0xff, 0x00, 0x00) }, /* ZTE MF871A */
|
||||||
|
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1485, 0xff, 0xff, 0xff), /* ZTE MF286D */
|
||||||
|
+ .driver_info = RSVD(5) },
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1533, 0xff, 0xff, 0xff) },
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1534, 0xff, 0xff, 0xff) },
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1535, 0xff, 0xff, 0xff) },
|
||||||
|
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
|
||||||
|
index d322ed5cbc1ca..6386875d0a33a 100644
|
||||||
|
--- a/fs/nfs/client.c
|
||||||
|
+++ b/fs/nfs/client.c
|
||||||
|
@@ -179,6 +179,7 @@ struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init)
|
||||||
|
INIT_LIST_HEAD(&clp->cl_superblocks);
|
||||||
|
clp->cl_rpcclient = ERR_PTR(-EINVAL);
|
||||||
|
|
||||||
|
+ clp->cl_flags = cl_init->init_flags;
|
||||||
|
clp->cl_proto = cl_init->proto;
|
||||||
|
clp->cl_net = get_net(cl_init->net);
|
||||||
|
|
||||||
|
@@ -400,7 +401,6 @@ nfs_get_client(const struct nfs_client_initdata *cl_init,
|
||||||
|
list_add_tail(&new->cl_share_link,
|
||||||
|
&nn->nfs_client_list);
|
||||||
|
spin_unlock(&nn->nfs_client_lock);
|
||||||
|
- new->cl_flags = cl_init->init_flags;
|
||||||
|
return rpc_ops->init_client(new, cl_init);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
|
||||||
|
index 2fb4633897084..48baa92846e5f 100644
|
||||||
|
--- a/fs/nfs/nfs4client.c
|
||||||
|
+++ b/fs/nfs/nfs4client.c
|
||||||
|
@@ -1329,8 +1329,11 @@ int nfs4_update_server(struct nfs_server *server, const char *hostname,
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (server->nfs_client->cl_hostname == NULL)
|
||||||
|
+ if (server->nfs_client->cl_hostname == NULL) {
|
||||||
|
server->nfs_client->cl_hostname = kstrdup(hostname, GFP_KERNEL);
|
||||||
|
+ if (server->nfs_client->cl_hostname == NULL)
|
||||||
|
+ return -ENOMEM;
|
||||||
|
+ }
|
||||||
|
nfs_server_insert_lists(server);
|
||||||
|
|
||||||
|
error = nfs_probe_destination(server);
|
||||||
|
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
|
||||||
|
index 4e63daeef6339..466c07bd06295 100644
|
||||||
|
--- a/fs/nfs/nfs4state.c
|
||||||
|
+++ b/fs/nfs/nfs4state.c
|
||||||
|
@@ -1985,6 +1985,9 @@ static int nfs4_try_migration(struct nfs_server *server, struct rpc_cred *cred)
|
||||||
|
}
|
||||||
|
|
||||||
|
result = -NFS4ERR_NXIO;
|
||||||
|
+ if (!locations->nlocations)
|
||||||
|
+ goto out;
|
||||||
|
+
|
||||||
|
if (!(locations->fattr.valid & NFS_ATTR_FATTR_V4_LOCATIONS)) {
|
||||||
|
dprintk("<-- %s: No fs_locations data, migration skipped\n",
|
||||||
|
__func__);
|
||||||
|
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
|
||||||
|
index 0a7c4e30a385e..b50c97c6aecb3 100644
|
||||||
|
--- a/fs/nfs/nfs4xdr.c
|
||||||
|
+++ b/fs/nfs/nfs4xdr.c
|
||||||
|
@@ -3633,8 +3633,6 @@ static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, st
|
||||||
|
if (unlikely(!p))
|
||||||
|
goto out_overflow;
|
||||||
|
n = be32_to_cpup(p);
|
||||||
|
- if (n <= 0)
|
||||||
|
- goto out_eio;
|
||||||
|
for (res->nlocations = 0; res->nlocations < n; res->nlocations++) {
|
||||||
|
u32 m;
|
||||||
|
struct nfs4_fs_location *loc;
|
||||||
|
@@ -4177,10 +4175,11 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,
|
||||||
|
} else
|
||||||
|
printk(KERN_WARNING "%s: label too long (%u)!\n",
|
||||||
|
__func__, len);
|
||||||
|
+ if (label && label->label)
|
||||||
|
+ dprintk("%s: label=%.*s, len=%d, PI=%d, LFS=%d\n",
|
||||||
|
+ __func__, label->len, (char *)label->label,
|
||||||
|
+ label->len, label->pi, label->lfs);
|
||||||
|
}
|
||||||
|
- if (label && label->label)
|
||||||
|
- dprintk("%s: label=%s, len=%d, PI=%d, LFS=%d\n", __func__,
|
||||||
|
- (char *)label->label, label->len, label->pi, label->lfs);
|
||||||
|
return status;
|
||||||
|
|
||||||
|
out_overflow:
|
||||||
|
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
|
||||||
|
index 00b472fe77c19..1bf2e1c47cbfd 100644
|
||||||
|
--- a/fs/nfsd/nfs3proc.c
|
||||||
|
+++ b/fs/nfsd/nfs3proc.c
|
||||||
|
@@ -191,6 +191,11 @@ nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
|
||||||
|
(unsigned long long) argp->offset,
|
||||||
|
argp->stable? " stable" : "");
|
||||||
|
|
||||||
|
+ resp->status = nfserr_fbig;
|
||||||
|
+ if (argp->offset > (u64)OFFSET_MAX ||
|
||||||
|
+ argp->offset + argp->len > (u64)OFFSET_MAX)
|
||||||
|
+ return rpc_success;
|
||||||
|
+
|
||||||
|
fh_copy(&resp->fh, &argp->fh);
|
||||||
|
resp->committed = argp->stable;
|
||||||
|
nfserr = nfsd_write(rqstp, &resp->fh, NULL,
|
||||||
|
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
|
||||||
|
index 66985a6a7047b..d029decd87e3d 100644
|
||||||
|
--- a/fs/nfsd/nfs4proc.c
|
||||||
|
+++ b/fs/nfsd/nfs4proc.c
|
||||||
|
@@ -982,8 +982,9 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
|
||||||
|
unsigned long cnt;
|
||||||
|
int nvecs;
|
||||||
|
|
||||||
|
- if (write->wr_offset >= OFFSET_MAX)
|
||||||
|
- return nfserr_inval;
|
||||||
|
+ if (write->wr_offset > (u64)OFFSET_MAX ||
|
||||||
|
+ write->wr_offset + write->wr_buflen > (u64)OFFSET_MAX)
|
||||||
|
+ return nfserr_fbig;
|
||||||
|
|
||||||
|
status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh,
|
||||||
|
stateid, WR_STATE, &filp, NULL);
|
||||||
|
diff --git a/include/net/dst_metadata.h b/include/net/dst_metadata.h
|
||||||
|
index 5a23535a5018d..6a6f1d3bf8538 100644
|
||||||
|
--- a/include/net/dst_metadata.h
|
||||||
|
+++ b/include/net/dst_metadata.h
|
||||||
|
@@ -97,8 +97,20 @@ static inline struct metadata_dst *tun_dst_unclone(struct sk_buff *skb)
|
||||||
|
|
||||||
|
memcpy(&new_md->u.tun_info, &md_dst->u.tun_info,
|
||||||
|
sizeof(struct ip_tunnel_info) + md_size);
|
||||||
|
+#ifdef CONFIG_DST_CACHE
|
||||||
|
+ /* Unclone the dst cache if there is one */
|
||||||
|
+ if (new_md->u.tun_info.dst_cache.cache) {
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
+ ret = dst_cache_init(&new_md->u.tun_info.dst_cache, GFP_ATOMIC);
|
||||||
|
+ if (ret) {
|
||||||
|
+ metadata_dst_free(new_md);
|
||||||
|
+ return ERR_PTR(ret);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
skb_dst_drop(skb);
|
||||||
|
- dst_hold(&new_md->dst);
|
||||||
|
skb_dst_set(skb, &new_md->dst);
|
||||||
|
return new_md;
|
||||||
|
}
|
||||||
|
diff --git a/init/Kconfig b/init/Kconfig
|
||||||
|
index 07570008e2fd9..7e09227b976fa 100644
|
||||||
|
--- a/init/Kconfig
|
||||||
|
+++ b/init/Kconfig
|
||||||
|
@@ -1645,6 +1645,16 @@ config ADVISE_SYSCALLS
|
||||||
|
applications use these syscalls, you can disable this option to save
|
||||||
|
space.
|
||||||
|
|
||||||
|
+config BPF_UNPRIV_DEFAULT_OFF
|
||||||
|
+ bool "Disable unprivileged BPF by default"
|
||||||
|
+ depends on BPF_SYSCALL
|
||||||
|
+ help
|
||||||
|
+ Disables unprivileged BPF by default by setting the corresponding
|
||||||
|
+ /proc/sys/kernel/unprivileged_bpf_disabled knob to 2. An admin can
|
||||||
|
+ still reenable it by setting it to 0 later on, or permanently
|
||||||
|
+ disable it by setting it to 1 (from which no other transition to
|
||||||
|
+ 0 is possible anymore).
|
||||||
|
+
|
||||||
|
config USERFAULTFD
|
||||||
|
bool "Enable userfaultfd() system call"
|
||||||
|
select ANON_INODES
|
||||||
|
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
|
||||||
|
index e10314223cbfe..e30ad1be68412 100644
|
||||||
|
--- a/kernel/bpf/syscall.c
|
||||||
|
+++ b/kernel/bpf/syscall.c
|
||||||
|
@@ -22,7 +22,8 @@
|
||||||
|
|
||||||
|
DEFINE_PER_CPU(int, bpf_prog_active);
|
||||||
|
|
||||||
|
-int sysctl_unprivileged_bpf_disabled __read_mostly;
|
||||||
|
+int sysctl_unprivileged_bpf_disabled __read_mostly =
|
||||||
|
+ IS_BUILTIN(CONFIG_BPF_UNPRIV_DEFAULT_OFF) ? 2 : 0;
|
||||||
|
|
||||||
|
static LIST_HEAD(bpf_map_types);
|
||||||
|
|
||||||
|
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
|
||||||
|
index 513e6da318c47..78b445562b81e 100644
|
||||||
|
--- a/kernel/sysctl.c
|
||||||
|
+++ b/kernel/sysctl.c
|
||||||
|
@@ -221,6 +221,28 @@ static int sysrq_sysctl_handler(struct ctl_table *table, int write,
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#ifdef CONFIG_BPF_SYSCALL
|
||||||
|
+static int bpf_unpriv_handler(struct ctl_table *table, int write,
|
||||||
|
+ void *buffer, size_t *lenp, loff_t *ppos)
|
||||||
|
+{
|
||||||
|
+ int ret, unpriv_enable = *(int *)table->data;
|
||||||
|
+ bool locked_state = unpriv_enable == 1;
|
||||||
|
+ struct ctl_table tmp = *table;
|
||||||
|
+
|
||||||
|
+ if (write && !capable(CAP_SYS_ADMIN))
|
||||||
|
+ return -EPERM;
|
||||||
|
+
|
||||||
|
+ tmp.data = &unpriv_enable;
|
||||||
|
+ ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos);
|
||||||
|
+ if (write && !ret) {
|
||||||
|
+ if (locked_state && unpriv_enable != 1)
|
||||||
|
+ return -EPERM;
|
||||||
|
+ *(int *)table->data = unpriv_enable;
|
||||||
|
+ }
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
static struct ctl_table kern_table[];
|
||||||
|
static struct ctl_table vm_table[];
|
||||||
|
static struct ctl_table fs_table[];
|
||||||
|
@@ -1202,10 +1224,9 @@ static struct ctl_table kern_table[] = {
|
||||||
|
.data = &sysctl_unprivileged_bpf_disabled,
|
||||||
|
.maxlen = sizeof(sysctl_unprivileged_bpf_disabled),
|
||||||
|
.mode = 0644,
|
||||||
|
- /* only handle a transition from default "0" to "1" */
|
||||||
|
- .proc_handler = proc_dointvec_minmax,
|
||||||
|
- .extra1 = &one,
|
||||||
|
- .extra2 = &one,
|
||||||
|
+ .proc_handler = bpf_unpriv_handler,
|
||||||
|
+ .extra1 = &zero,
|
||||||
|
+ .extra2 = &two,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
|
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
|
||||||
|
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
|
||||||
|
index 354926e61f067..58c0ab8894c70 100644
|
||||||
|
--- a/net/ipv4/ipmr.c
|
||||||
|
+++ b/net/ipv4/ipmr.c
|
||||||
|
@@ -242,7 +242,9 @@ static int __net_init ipmr_rules_init(struct net *net)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
err2:
|
||||||
|
+ rtnl_lock();
|
||||||
|
ipmr_free_table(mrt);
|
||||||
|
+ rtnl_unlock();
|
||||||
|
err1:
|
||||||
|
fib_rules_unregister(ops);
|
||||||
|
return err;
|
||||||
|
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
|
||||||
|
index f38b22f54c093..3dce62ec37ed4 100644
|
||||||
|
--- a/net/ipv6/ip6mr.c
|
||||||
|
+++ b/net/ipv6/ip6mr.c
|
||||||
|
@@ -251,7 +251,9 @@ static int __net_init ip6mr_rules_init(struct net *net)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
err2:
|
||||||
|
+ rtnl_lock();
|
||||||
|
ip6mr_free_table(mrt);
|
||||||
|
+ rtnl_unlock();
|
||||||
|
err1:
|
||||||
|
fib_rules_unregister(ops);
|
||||||
|
return err;
|
||||||
|
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
|
||||||
|
index 7ebcaff8c1c4f..963f607b34999 100644
|
||||||
|
--- a/net/tipc/name_distr.c
|
||||||
|
+++ b/net/tipc/name_distr.c
|
||||||
|
@@ -288,7 +288,7 @@ static bool tipc_update_nametbl(struct net *net, struct distr_item *i,
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
- pr_warn("Unrecognized name table message received\n");
|
||||||
|
+ pr_warn_ratelimited("Unknown name table message received\n");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c
|
||||||
|
index 853a7d2333b3e..51d2fef7cd677 100644
|
||||||
|
--- a/security/integrity/ima/ima_fs.c
|
||||||
|
+++ b/security/integrity/ima/ima_fs.c
|
||||||
|
@@ -477,11 +477,11 @@ int __init ima_fs_init(void)
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
out:
|
||||||
|
+ securityfs_remove(ima_policy);
|
||||||
|
securityfs_remove(violations);
|
||||||
|
securityfs_remove(runtime_measurements_count);
|
||||||
|
securityfs_remove(ascii_runtime_measurements);
|
||||||
|
securityfs_remove(binary_runtime_measurements);
|
||||||
|
securityfs_remove(ima_dir);
|
||||||
|
- securityfs_remove(ima_policy);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
diff --git a/security/integrity/integrity_audit.c b/security/integrity/integrity_audit.c
|
||||||
|
index 90987d15b6fe6..6c415667ba67f 100644
|
||||||
|
--- a/security/integrity/integrity_audit.c
|
||||||
|
+++ b/security/integrity/integrity_audit.c
|
||||||
|
@@ -39,6 +39,8 @@ void integrity_audit_msg(int audit_msgno, struct inode *inode,
|
||||||
|
return;
|
||||||
|
|
||||||
|
ab = audit_log_start(current->audit_context, GFP_KERNEL, audit_msgno);
|
||||||
|
+ if (!ab)
|
||||||
|
+ return;
|
||||||
|
audit_log_format(ab, "pid=%d uid=%u auid=%u ses=%u",
|
||||||
|
task_pid_nr(current),
|
||||||
|
from_kuid(&init_user_ns, current_cred()->uid),
|
||||||
|
diff --git a/sound/usb/line6/podhd.c b/sound/usb/line6/podhd.c
|
||||||
|
index 7133c36f99b6c..b3abc4cf7eb0a 100644
|
||||||
|
--- a/sound/usb/line6/podhd.c
|
||||||
|
+++ b/sound/usb/line6/podhd.c
|
||||||
|
@@ -385,7 +385,7 @@ static const struct line6_properties podhd_properties_table[] = {
|
||||||
|
.name = "POD HD500",
|
||||||
|
.capabilities = LINE6_CAP_PCM
|
||||||
|
| LINE6_CAP_HWMON,
|
||||||
|
- .altsetting = 0,
|
||||||
|
+ .altsetting = 1,
|
||||||
|
.ep_ctrl_r = 0x81,
|
||||||
|
.ep_ctrl_w = 0x01,
|
||||||
|
.ep_audio_r = 0x86,
|
||||||
|
@@ -396,7 +396,7 @@ static const struct line6_properties podhd_properties_table[] = {
|
||||||
|
.name = "POD HD500",
|
||||||
|
.capabilities = LINE6_CAP_PCM
|
||||||
|
| LINE6_CAP_HWMON,
|
||||||
|
- .altsetting = 1,
|
||||||
|
+ .altsetting = 0,
|
||||||
|
.ep_ctrl_r = 0x81,
|
||||||
|
.ep_ctrl_w = 0x01,
|
||||||
|
.ep_audio_r = 0x86,
|
||||||
1157
patch/kernel/archive/sun50iw9-4.9/patch-4.9.302-303.patch
Normal file
1157
patch/kernel/archive/sun50iw9-4.9/patch-4.9.302-303.patch
Normal file
File diff suppressed because it is too large
Load Diff
943
patch/kernel/archive/sun50iw9-4.9/patch-4.9.303-304.patch
Normal file
943
patch/kernel/archive/sun50iw9-4.9/patch-4.9.303-304.patch
Normal file
@@ -0,0 +1,943 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 27d5e129444e3..bd2f7d437b439 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 303
|
||||||
|
+SUBLEVEL = 304
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c
|
||||||
|
index 2b65c01777789..957bdeb7a5c79 100644
|
||||||
|
--- a/arch/parisc/kernel/unaligned.c
|
||||||
|
+++ b/arch/parisc/kernel/unaligned.c
|
||||||
|
@@ -353,7 +353,7 @@ static int emulate_stw(struct pt_regs *regs, int frreg, int flop)
|
||||||
|
: "r" (val), "r" (regs->ior), "r" (regs->isr)
|
||||||
|
: "r19", "r20", "r21", "r22", "r1", FIXUP_BRANCH_CLOBBER );
|
||||||
|
|
||||||
|
- return 0;
|
||||||
|
+ return ret;
|
||||||
|
}
|
||||||
|
static int emulate_std(struct pt_regs *regs, int frreg, int flop)
|
||||||
|
{
|
||||||
|
@@ -410,7 +410,7 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop)
|
||||||
|
__asm__ __volatile__ (
|
||||||
|
" mtsp %4, %%sr1\n"
|
||||||
|
" zdep %2, 29, 2, %%r19\n"
|
||||||
|
-" dep %%r0, 31, 2, %2\n"
|
||||||
|
+" dep %%r0, 31, 2, %3\n"
|
||||||
|
" mtsar %%r19\n"
|
||||||
|
" zvdepi -2, 32, %%r19\n"
|
||||||
|
"1: ldw 0(%%sr1,%3),%%r20\n"
|
||||||
|
@@ -422,7 +422,7 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop)
|
||||||
|
" andcm %%r21, %%r19, %%r21\n"
|
||||||
|
" or %1, %%r20, %1\n"
|
||||||
|
" or %2, %%r21, %2\n"
|
||||||
|
-"3: stw %1,0(%%sr1,%1)\n"
|
||||||
|
+"3: stw %1,0(%%sr1,%3)\n"
|
||||||
|
"4: stw %%r1,4(%%sr1,%3)\n"
|
||||||
|
"5: stw %2,8(%%sr1,%3)\n"
|
||||||
|
" copy %%r0, %0\n"
|
||||||
|
@@ -610,7 +610,6 @@ void handle_unaligned(struct pt_regs *regs)
|
||||||
|
ret = ERR_NOTHANDLED; /* "undefined", but lets kill them. */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
-#ifdef CONFIG_PA20
|
||||||
|
switch (regs->iir & OPCODE2_MASK)
|
||||||
|
{
|
||||||
|
case OPCODE_FLDD_L:
|
||||||
|
@@ -621,22 +620,23 @@ void handle_unaligned(struct pt_regs *regs)
|
||||||
|
flop=1;
|
||||||
|
ret = emulate_std(regs, R2(regs->iir),1);
|
||||||
|
break;
|
||||||
|
+#ifdef CONFIG_PA20
|
||||||
|
case OPCODE_LDD_L:
|
||||||
|
ret = emulate_ldd(regs, R2(regs->iir),0);
|
||||||
|
break;
|
||||||
|
case OPCODE_STD_L:
|
||||||
|
ret = emulate_std(regs, R2(regs->iir),0);
|
||||||
|
break;
|
||||||
|
- }
|
||||||
|
#endif
|
||||||
|
+ }
|
||||||
|
switch (regs->iir & OPCODE3_MASK)
|
||||||
|
{
|
||||||
|
case OPCODE_FLDW_L:
|
||||||
|
flop=1;
|
||||||
|
- ret = emulate_ldw(regs, R2(regs->iir),0);
|
||||||
|
+ ret = emulate_ldw(regs, R2(regs->iir), 1);
|
||||||
|
break;
|
||||||
|
case OPCODE_LDW_M:
|
||||||
|
- ret = emulate_ldw(regs, R2(regs->iir),1);
|
||||||
|
+ ret = emulate_ldw(regs, R2(regs->iir), 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OPCODE_FSTW_L:
|
||||||
|
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
|
||||||
|
index 3ba843f5cdc0f..821fc1f2324c8 100644
|
||||||
|
--- a/drivers/ata/pata_hpt37x.c
|
||||||
|
+++ b/drivers/ata/pata_hpt37x.c
|
||||||
|
@@ -919,6 +919,20 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
||||||
|
irqmask &= ~0x10;
|
||||||
|
pci_write_config_byte(dev, 0x5a, irqmask);
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * HPT371 chips physically have only one channel, the secondary one,
|
||||||
|
+ * but the primary channel registers do exist! Go figure...
|
||||||
|
+ * So, we manually disable the non-existing channel here
|
||||||
|
+ * (if the BIOS hasn't done this already).
|
||||||
|
+ */
|
||||||
|
+ if (dev->device == PCI_DEVICE_ID_TTI_HPT371) {
|
||||||
|
+ u8 mcr1;
|
||||||
|
+
|
||||||
|
+ pci_read_config_byte(dev, 0x50, &mcr1);
|
||||||
|
+ mcr1 &= ~0x04;
|
||||||
|
+ pci_write_config_byte(dev, 0x50, mcr1);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* default to pci clock. make sure MA15/16 are set to output
|
||||||
|
* to prevent drives having problems with 40-pin cables. Needed
|
||||||
|
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
|
||||||
|
index 5b5970f0e91d3..b07b32eb0c4bb 100644
|
||||||
|
--- a/drivers/gpu/drm/drm_edid.c
|
||||||
|
+++ b/drivers/gpu/drm/drm_edid.c
|
||||||
|
@@ -3886,6 +3886,7 @@ static void drm_add_display_info(struct drm_connector *connector,
|
||||||
|
if (!(edid->input & DRM_EDID_INPUT_DIGITAL))
|
||||||
|
return;
|
||||||
|
|
||||||
|
+ info->color_formats |= DRM_COLOR_FORMAT_RGB444;
|
||||||
|
drm_parse_cea_ext(connector, edid);
|
||||||
|
|
||||||
|
/*
|
||||||
|
@@ -3934,7 +3935,6 @@ static void drm_add_display_info(struct drm_connector *connector,
|
||||||
|
DRM_DEBUG("%s: Assigning EDID-1.4 digital sink color depth as %d bpc.\n",
|
||||||
|
connector->name, info->bpc);
|
||||||
|
|
||||||
|
- info->color_formats |= DRM_COLOR_FORMAT_RGB444;
|
||||||
|
if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444)
|
||||||
|
info->color_formats |= DRM_COLOR_FORMAT_YCRCB444;
|
||||||
|
if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422)
|
||||||
|
diff --git a/drivers/iio/adc/men_z188_adc.c b/drivers/iio/adc/men_z188_adc.c
|
||||||
|
index 8f3606de4eafb..47be2cd2c60db 100644
|
||||||
|
--- a/drivers/iio/adc/men_z188_adc.c
|
||||||
|
+++ b/drivers/iio/adc/men_z188_adc.c
|
||||||
|
@@ -107,6 +107,7 @@ static int men_z188_probe(struct mcb_device *dev,
|
||||||
|
struct z188_adc *adc;
|
||||||
|
struct iio_dev *indio_dev;
|
||||||
|
struct resource *mem;
|
||||||
|
+ int ret;
|
||||||
|
|
||||||
|
indio_dev = devm_iio_device_alloc(&dev->dev, sizeof(struct z188_adc));
|
||||||
|
if (!indio_dev)
|
||||||
|
@@ -133,8 +134,14 @@ static int men_z188_probe(struct mcb_device *dev,
|
||||||
|
adc->mem = mem;
|
||||||
|
mcb_set_drvdata(dev, indio_dev);
|
||||||
|
|
||||||
|
- return iio_device_register(indio_dev);
|
||||||
|
+ ret = iio_device_register(indio_dev);
|
||||||
|
+ if (ret)
|
||||||
|
+ goto err_unmap;
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
|
||||||
|
+err_unmap:
|
||||||
|
+ iounmap(adc->base);
|
||||||
|
err:
|
||||||
|
mcb_release_mem(mem);
|
||||||
|
return -ENXIO;
|
||||||
|
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
|
||||||
|
index af68be201c299..67b993f4ec91a 100644
|
||||||
|
--- a/drivers/infiniband/ulp/srp/ib_srp.c
|
||||||
|
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
|
||||||
|
@@ -3646,9 +3646,11 @@ static void srp_remove_one(struct ib_device *device, void *client_data)
|
||||||
|
spin_unlock(&host->target_lock);
|
||||||
|
|
||||||
|
/*
|
||||||
|
- * Wait for tl_err and target port removal tasks.
|
||||||
|
+ * srp_queue_remove_work() queues a call to
|
||||||
|
+ * srp_remove_target(). The latter function cancels
|
||||||
|
+ * target->tl_err_work so waiting for the remove works to
|
||||||
|
+ * finish is sufficient.
|
||||||
|
*/
|
||||||
|
- flush_workqueue(system_long_wq);
|
||||||
|
flush_workqueue(srp_remove_wq);
|
||||||
|
|
||||||
|
kfree(host);
|
||||||
|
diff --git a/drivers/mtd/nand/brcmnand/brcmnand.c b/drivers/mtd/nand/brcmnand/brcmnand.c
|
||||||
|
index 40fdc9d267b96..1c8e95cf29d24 100644
|
||||||
|
--- a/drivers/mtd/nand/brcmnand/brcmnand.c
|
||||||
|
+++ b/drivers/mtd/nand/brcmnand/brcmnand.c
|
||||||
|
@@ -1637,7 +1637,7 @@ static int brcmnand_read_by_pio(struct mtd_info *mtd, struct nand_chip *chip,
|
||||||
|
mtd->oobsize / trans,
|
||||||
|
host->hwcfg.sector_size_1k);
|
||||||
|
|
||||||
|
- if (!ret) {
|
||||||
|
+ if (ret != -EBADMSG) {
|
||||||
|
*err_addr = brcmnand_read_reg(ctrl,
|
||||||
|
BRCMNAND_UNCORR_ADDR) |
|
||||||
|
((u64)(brcmnand_read_reg(ctrl,
|
||||||
|
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
|
||||||
|
index e13a6cd5163f4..5f23e26b0415e 100644
|
||||||
|
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
|
||||||
|
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
|
||||||
|
@@ -1405,7 +1405,7 @@ static int mlx5e_get_module_eeprom(struct net_device *netdev,
|
||||||
|
if (size_read < 0) {
|
||||||
|
netdev_err(priv->netdev, "%s: mlx5_query_eeprom failed:0x%x\n",
|
||||||
|
__func__, size_read);
|
||||||
|
- return 0;
|
||||||
|
+ return size_read;
|
||||||
|
}
|
||||||
|
|
||||||
|
i += size_read;
|
||||||
|
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
|
||||||
|
index 8f03cc52ddda2..1819b104418c4 100644
|
||||||
|
--- a/drivers/net/usb/cdc_ether.c
|
||||||
|
+++ b/drivers/net/usb/cdc_ether.c
|
||||||
|
@@ -555,6 +555,11 @@ static const struct usb_device_id products[] = {
|
||||||
|
.bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \
|
||||||
|
.bInterfaceProtocol = USB_CDC_PROTO_NONE
|
||||||
|
|
||||||
|
+#define ZAURUS_FAKE_INTERFACE \
|
||||||
|
+ .bInterfaceClass = USB_CLASS_COMM, \
|
||||||
|
+ .bInterfaceSubClass = USB_CDC_SUBCLASS_MDLM, \
|
||||||
|
+ .bInterfaceProtocol = USB_CDC_PROTO_NONE
|
||||||
|
+
|
||||||
|
/* SA-1100 based Sharp Zaurus ("collie"), or compatible;
|
||||||
|
* wire-incompatible with true CDC Ethernet implementations.
|
||||||
|
* (And, it seems, needlessly so...)
|
||||||
|
@@ -608,6 +613,13 @@ static const struct usb_device_id products[] = {
|
||||||
|
.idProduct = 0x9032, /* SL-6000 */
|
||||||
|
ZAURUS_MASTER_INTERFACE,
|
||||||
|
.driver_info = 0,
|
||||||
|
+}, {
|
||||||
|
+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
|
||||||
|
+ | USB_DEVICE_ID_MATCH_DEVICE,
|
||||||
|
+ .idVendor = 0x04DD,
|
||||||
|
+ .idProduct = 0x9032, /* SL-6000 */
|
||||||
|
+ ZAURUS_FAKE_INTERFACE,
|
||||||
|
+ .driver_info = 0,
|
||||||
|
}, {
|
||||||
|
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO
|
||||||
|
| USB_DEVICE_ID_MATCH_DEVICE,
|
||||||
|
diff --git a/drivers/net/usb/sr9700.c b/drivers/net/usb/sr9700.c
|
||||||
|
index aadfe1d1c37ee..f4c4df01874c3 100644
|
||||||
|
--- a/drivers/net/usb/sr9700.c
|
||||||
|
+++ b/drivers/net/usb/sr9700.c
|
||||||
|
@@ -409,7 +409,7 @@ static int sr9700_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
|
||||||
|
/* ignore the CRC length */
|
||||||
|
len = (skb->data[1] | (skb->data[2] << 8)) - 4;
|
||||||
|
|
||||||
|
- if (len > ETH_FRAME_LEN)
|
||||||
|
+ if (len > ETH_FRAME_LEN || len > skb->len)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/* the last packet of current skb */
|
||||||
|
diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c
|
||||||
|
index 6aaa6eb9df72a..3d126761044f5 100644
|
||||||
|
--- a/drivers/net/usb/zaurus.c
|
||||||
|
+++ b/drivers/net/usb/zaurus.c
|
||||||
|
@@ -268,6 +268,11 @@ static const struct usb_device_id products [] = {
|
||||||
|
.bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \
|
||||||
|
.bInterfaceProtocol = USB_CDC_PROTO_NONE
|
||||||
|
|
||||||
|
+#define ZAURUS_FAKE_INTERFACE \
|
||||||
|
+ .bInterfaceClass = USB_CLASS_COMM, \
|
||||||
|
+ .bInterfaceSubClass = USB_CDC_SUBCLASS_MDLM, \
|
||||||
|
+ .bInterfaceProtocol = USB_CDC_PROTO_NONE
|
||||||
|
+
|
||||||
|
/* SA-1100 based Sharp Zaurus ("collie"), or compatible. */
|
||||||
|
{
|
||||||
|
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO
|
||||||
|
@@ -325,6 +330,13 @@ static const struct usb_device_id products [] = {
|
||||||
|
.idProduct = 0x9032, /* SL-6000 */
|
||||||
|
ZAURUS_MASTER_INTERFACE,
|
||||||
|
.driver_info = ZAURUS_PXA_INFO,
|
||||||
|
+}, {
|
||||||
|
+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
|
||||||
|
+ | USB_DEVICE_ID_MATCH_DEVICE,
|
||||||
|
+ .idVendor = 0x04DD,
|
||||||
|
+ .idProduct = 0x9032, /* SL-6000 */
|
||||||
|
+ ZAURUS_FAKE_INTERFACE,
|
||||||
|
+ .driver_info = (unsigned long)&bogus_mdlm_info,
|
||||||
|
}, {
|
||||||
|
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO
|
||||||
|
| USB_DEVICE_ID_MATCH_DEVICE,
|
||||||
|
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
|
||||||
|
index 67e5b587a1062..2311f8a635a6f 100644
|
||||||
|
--- a/drivers/tty/n_gsm.c
|
||||||
|
+++ b/drivers/tty/n_gsm.c
|
||||||
|
@@ -444,7 +444,7 @@ static u8 gsm_encode_modem(const struct gsm_dlci *dlci)
|
||||||
|
modembits |= MDM_RTR;
|
||||||
|
if (dlci->modem_tx & TIOCM_RI)
|
||||||
|
modembits |= MDM_IC;
|
||||||
|
- if (dlci->modem_tx & TIOCM_CD)
|
||||||
|
+ if (dlci->modem_tx & TIOCM_CD || dlci->gsm->initiator)
|
||||||
|
modembits |= MDM_DV;
|
||||||
|
return modembits;
|
||||||
|
}
|
||||||
|
@@ -1506,7 +1506,7 @@ static void gsm_dlci_t1(unsigned long data)
|
||||||
|
dlci->mode = DLCI_MODE_ADM;
|
||||||
|
gsm_dlci_open(dlci);
|
||||||
|
} else {
|
||||||
|
- gsm_dlci_close(dlci);
|
||||||
|
+ gsm_dlci_begin_close(dlci); /* prevent half open link */
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
|
||||||
|
index f89dfde934a32..54ed7675e4470 100644
|
||||||
|
--- a/drivers/tty/serial/8250/8250_of.c
|
||||||
|
+++ b/drivers/tty/serial/8250/8250_of.c
|
||||||
|
@@ -86,7 +86,7 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
|
||||||
|
ret = of_address_to_resource(np, 0, &resource);
|
||||||
|
if (ret) {
|
||||||
|
dev_warn(&ofdev->dev, "invalid address\n");
|
||||||
|
- goto out;
|
||||||
|
+ goto err_unprepare;
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_lock_init(&port->lock);
|
||||||
|
@@ -94,8 +94,17 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
|
||||||
|
port->mapsize = resource_size(&resource);
|
||||||
|
|
||||||
|
/* Check for shifted address mapping */
|
||||||
|
- if (of_property_read_u32(np, "reg-offset", &prop) == 0)
|
||||||
|
+ if (of_property_read_u32(np, "reg-offset", &prop) == 0) {
|
||||||
|
+ if (prop >= port->mapsize) {
|
||||||
|
+ dev_warn(&ofdev->dev, "reg-offset %u exceeds region size %pa\n",
|
||||||
|
+ prop, &port->mapsize);
|
||||||
|
+ ret = -EINVAL;
|
||||||
|
+ goto err_unprepare;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
port->mapbase += prop;
|
||||||
|
+ port->mapsize -= prop;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
/* Compatibility with the deprecated pxa driver and 8250_pxa drivers. */
|
||||||
|
if (of_device_is_compatible(np, "mrvl,mmp-uart"))
|
||||||
|
@@ -132,7 +141,7 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
|
||||||
|
dev_warn(&ofdev->dev, "unsupported reg-io-width (%d)\n",
|
||||||
|
prop);
|
||||||
|
ret = -EINVAL;
|
||||||
|
- goto out;
|
||||||
|
+ goto err_dispose;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -162,7 +171,9 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
|
||||||
|
port->handle_irq = fsl8250_handle_irq;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
-out:
|
||||||
|
+err_dispose:
|
||||||
|
+ irq_dispose_mapping(port->irq);
|
||||||
|
+err_unprepare:
|
||||||
|
if (info->clk)
|
||||||
|
clk_disable_unprepare(info->clk);
|
||||||
|
return ret;
|
||||||
|
@@ -194,7 +205,7 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
|
||||||
|
port_type = (unsigned long)match->data;
|
||||||
|
ret = of_platform_serial_setup(ofdev, port_type, &port, info);
|
||||||
|
if (ret)
|
||||||
|
- goto out;
|
||||||
|
+ goto err_free;
|
||||||
|
|
||||||
|
switch (port_type) {
|
||||||
|
case PORT_8250 ... PORT_MAX_8250:
|
||||||
|
@@ -228,15 +239,18 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (ret < 0)
|
||||||
|
- goto out;
|
||||||
|
+ goto err_dispose;
|
||||||
|
|
||||||
|
info->type = port_type;
|
||||||
|
info->line = ret;
|
||||||
|
platform_set_drvdata(ofdev, info);
|
||||||
|
return 0;
|
||||||
|
-out:
|
||||||
|
- kfree(info);
|
||||||
|
+err_dispose:
|
||||||
|
irq_dispose_mapping(port.irq);
|
||||||
|
+ if (info->clk)
|
||||||
|
+ clk_disable_unprepare(info->clk);
|
||||||
|
+err_free:
|
||||||
|
+ kfree(info);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
|
||||||
|
index 58c4b745eae13..ccc47594064f2 100644
|
||||||
|
--- a/drivers/usb/dwc3/gadget.c
|
||||||
|
+++ b/drivers/usb/dwc3/gadget.c
|
||||||
|
@@ -2904,9 +2904,11 @@ static irqreturn_t dwc3_thread_interrupt(int irq, void *_evt)
|
||||||
|
unsigned long flags;
|
||||||
|
irqreturn_t ret = IRQ_NONE;
|
||||||
|
|
||||||
|
+ local_bh_disable();
|
||||||
|
spin_lock_irqsave(&dwc->lock, flags);
|
||||||
|
ret = dwc3_process_event_buf(evt);
|
||||||
|
spin_unlock_irqrestore(&dwc->lock, flags);
|
||||||
|
+ local_bh_enable();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
diff --git a/drivers/usb/gadget/function/rndis.c b/drivers/usb/gadget/function/rndis.c
|
||||||
|
index a912b6b9153fd..1e5c2cbe99947 100644
|
||||||
|
--- a/drivers/usb/gadget/function/rndis.c
|
||||||
|
+++ b/drivers/usb/gadget/function/rndis.c
|
||||||
|
@@ -924,6 +924,7 @@ struct rndis_params *rndis_register(void (*resp_avail)(void *v), void *v)
|
||||||
|
params->resp_avail = resp_avail;
|
||||||
|
params->v = v;
|
||||||
|
INIT_LIST_HEAD(¶ms->resp_queue);
|
||||||
|
+ spin_lock_init(¶ms->resp_lock);
|
||||||
|
pr_debug("%s: configNr = %d\n", __func__, i);
|
||||||
|
|
||||||
|
return params;
|
||||||
|
@@ -1017,12 +1018,14 @@ void rndis_free_response(struct rndis_params *params, u8 *buf)
|
||||||
|
{
|
||||||
|
rndis_resp_t *r, *n;
|
||||||
|
|
||||||
|
+ spin_lock(¶ms->resp_lock);
|
||||||
|
list_for_each_entry_safe(r, n, ¶ms->resp_queue, list) {
|
||||||
|
if (r->buf == buf) {
|
||||||
|
list_del(&r->list);
|
||||||
|
kfree(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ spin_unlock(¶ms->resp_lock);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(rndis_free_response);
|
||||||
|
|
||||||
|
@@ -1032,14 +1035,17 @@ u8 *rndis_get_next_response(struct rndis_params *params, u32 *length)
|
||||||
|
|
||||||
|
if (!length) return NULL;
|
||||||
|
|
||||||
|
+ spin_lock(¶ms->resp_lock);
|
||||||
|
list_for_each_entry_safe(r, n, ¶ms->resp_queue, list) {
|
||||||
|
if (!r->send) {
|
||||||
|
r->send = 1;
|
||||||
|
*length = r->length;
|
||||||
|
+ spin_unlock(¶ms->resp_lock);
|
||||||
|
return r->buf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ spin_unlock(¶ms->resp_lock);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(rndis_get_next_response);
|
||||||
|
@@ -1056,7 +1062,9 @@ static rndis_resp_t *rndis_add_response(struct rndis_params *params, u32 length)
|
||||||
|
r->length = length;
|
||||||
|
r->send = 0;
|
||||||
|
|
||||||
|
+ spin_lock(¶ms->resp_lock);
|
||||||
|
list_add_tail(&r->list, ¶ms->resp_queue);
|
||||||
|
+ spin_unlock(¶ms->resp_lock);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/usb/gadget/function/rndis.h b/drivers/usb/gadget/function/rndis.h
|
||||||
|
index ef92eb66d8adf..a389df725a29e 100644
|
||||||
|
--- a/drivers/usb/gadget/function/rndis.h
|
||||||
|
+++ b/drivers/usb/gadget/function/rndis.h
|
||||||
|
@@ -194,6 +194,7 @@ typedef struct rndis_params
|
||||||
|
void (*resp_avail)(void *v);
|
||||||
|
void *v;
|
||||||
|
struct list_head resp_queue;
|
||||||
|
+ spinlock_t resp_lock;
|
||||||
|
} rndis_params;
|
||||||
|
|
||||||
|
/* RNDIS Message parser and other useless functions */
|
||||||
|
diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
|
||||||
|
index 588e2531b8b81..b4cc04b6ae036 100644
|
||||||
|
--- a/drivers/usb/gadget/udc/udc-xilinx.c
|
||||||
|
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
|
||||||
|
@@ -1620,6 +1620,8 @@ static void xudc_getstatus(struct xusb_udc *udc)
|
||||||
|
break;
|
||||||
|
case USB_RECIP_ENDPOINT:
|
||||||
|
epnum = udc->setup.wIndex & USB_ENDPOINT_NUMBER_MASK;
|
||||||
|
+ if (epnum >= XUSB_MAX_ENDPOINTS)
|
||||||
|
+ goto stall;
|
||||||
|
target_ep = &udc->ep[epnum];
|
||||||
|
epcfgreg = udc->read_fn(udc->addr + target_ep->offset);
|
||||||
|
halt = epcfgreg & XUSB_EP_CFG_STALL_MASK;
|
||||||
|
@@ -1687,6 +1689,10 @@ static void xudc_set_clear_feature(struct xusb_udc *udc)
|
||||||
|
case USB_RECIP_ENDPOINT:
|
||||||
|
if (!udc->setup.wValue) {
|
||||||
|
endpoint = udc->setup.wIndex & USB_ENDPOINT_NUMBER_MASK;
|
||||||
|
+ if (endpoint >= XUSB_MAX_ENDPOINTS) {
|
||||||
|
+ xudc_ep0_stall(udc);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
target_ep = &udc->ep[endpoint];
|
||||||
|
outinbit = udc->setup.wIndex & USB_ENDPOINT_DIR_MASK;
|
||||||
|
outinbit = outinbit >> 7;
|
||||||
|
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
|
||||||
|
index 2df61fff8ae32..a08369cb3462f 100644
|
||||||
|
--- a/drivers/usb/host/xhci.c
|
||||||
|
+++ b/drivers/usb/host/xhci.c
|
||||||
|
@@ -1397,9 +1397,12 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
|
||||||
|
struct urb_priv *urb_priv;
|
||||||
|
int size, i;
|
||||||
|
|
||||||
|
- if (!urb || xhci_check_args(hcd, urb->dev, urb->ep,
|
||||||
|
- true, true, __func__) <= 0)
|
||||||
|
+ if (!urb)
|
||||||
|
return -EINVAL;
|
||||||
|
+ ret = xhci_check_args(hcd, urb->dev, urb->ep,
|
||||||
|
+ true, true, __func__);
|
||||||
|
+ if (ret <= 0)
|
||||||
|
+ return ret ? ret : -EINVAL;
|
||||||
|
|
||||||
|
slot_id = urb->dev->slot_id;
|
||||||
|
ep_index = xhci_get_endpoint_index(&urb->ep->desc);
|
||||||
|
@@ -3031,7 +3034,7 @@ static int xhci_check_streams_endpoint(struct xhci_hcd *xhci,
|
||||||
|
return -EINVAL;
|
||||||
|
ret = xhci_check_args(xhci_to_hcd(xhci), udev, ep, 1, true, __func__);
|
||||||
|
if (ret <= 0)
|
||||||
|
- return -EINVAL;
|
||||||
|
+ return ret ? ret : -EINVAL;
|
||||||
|
if (usb_ss_max_streams(&ep->ss_ep_comp) == 0) {
|
||||||
|
xhci_warn(xhci, "WARN: SuperSpeed Endpoint Companion"
|
||||||
|
" descriptor for ep 0x%x does not support streams\n",
|
||||||
|
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
|
||||||
|
index a8573da2717a1..a2337d15233fc 100644
|
||||||
|
--- a/drivers/usb/serial/ch341.c
|
||||||
|
+++ b/drivers/usb/serial/ch341.c
|
||||||
|
@@ -70,7 +70,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
static const struct usb_device_id id_table[] = {
|
||||||
|
- { USB_DEVICE(0x1a86, 0x5512) },
|
||||||
|
{ USB_DEVICE(0x1a86, 0x5523) },
|
||||||
|
{ USB_DEVICE(0x1a86, 0x7522) },
|
||||||
|
{ USB_DEVICE(0x1a86, 0x7523) },
|
||||||
|
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
|
||||||
|
index 4c3ff0706554f..c5d0d9e2bff2d 100644
|
||||||
|
--- a/drivers/usb/serial/option.c
|
||||||
|
+++ b/drivers/usb/serial/option.c
|
||||||
|
@@ -201,6 +201,8 @@ static void option_instat_callback(struct urb *urb);
|
||||||
|
|
||||||
|
#define DELL_PRODUCT_5821E 0x81d7
|
||||||
|
#define DELL_PRODUCT_5821E_ESIM 0x81e0
|
||||||
|
+#define DELL_PRODUCT_5829E_ESIM 0x81e4
|
||||||
|
+#define DELL_PRODUCT_5829E 0x81e6
|
||||||
|
|
||||||
|
#define KYOCERA_VENDOR_ID 0x0c88
|
||||||
|
#define KYOCERA_PRODUCT_KPC650 0x17da
|
||||||
|
@@ -1058,6 +1060,10 @@ static const struct usb_device_id option_ids[] = {
|
||||||
|
.driver_info = RSVD(0) | RSVD(1) | RSVD(6) },
|
||||||
|
{ USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5821E_ESIM),
|
||||||
|
.driver_info = RSVD(0) | RSVD(1) | RSVD(6) },
|
||||||
|
+ { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5829E),
|
||||||
|
+ .driver_info = RSVD(0) | RSVD(6) },
|
||||||
|
+ { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5829E_ESIM),
|
||||||
|
+ .driver_info = RSVD(0) | RSVD(6) },
|
||||||
|
{ USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */
|
||||||
|
{ USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
|
||||||
|
{ USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
|
||||||
|
@@ -1249,10 +1255,16 @@ static const struct usb_device_id option_ids[] = {
|
||||||
|
.driver_info = NCTRL(2) },
|
||||||
|
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x7011, 0xff), /* Telit LE910-S1 (ECM) */
|
||||||
|
.driver_info = NCTRL(2) },
|
||||||
|
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x701a, 0xff), /* Telit LE910R1 (RNDIS) */
|
||||||
|
+ .driver_info = NCTRL(2) },
|
||||||
|
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x701b, 0xff), /* Telit LE910R1 (ECM) */
|
||||||
|
+ .driver_info = NCTRL(2) },
|
||||||
|
{ USB_DEVICE(TELIT_VENDOR_ID, 0x9010), /* Telit SBL FN980 flashing device */
|
||||||
|
.driver_info = NCTRL(0) | ZLP },
|
||||||
|
{ USB_DEVICE(TELIT_VENDOR_ID, 0x9200), /* Telit LE910S1 flashing device */
|
||||||
|
.driver_info = NCTRL(0) | ZLP },
|
||||||
|
+ { USB_DEVICE(TELIT_VENDOR_ID, 0x9201), /* Telit LE910R1 flashing device */
|
||||||
|
+ .driver_info = NCTRL(0) | ZLP },
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff),
|
||||||
|
.driver_info = RSVD(1) },
|
||||||
|
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
|
||||||
|
index e282e8174a5d9..d054702c8fbe3 100644
|
||||||
|
--- a/drivers/vhost/vsock.c
|
||||||
|
+++ b/drivers/vhost/vsock.c
|
||||||
|
@@ -484,16 +484,18 @@ err:
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int vhost_vsock_stop(struct vhost_vsock *vsock)
|
||||||
|
+static int vhost_vsock_stop(struct vhost_vsock *vsock, bool check_owner)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
- int ret;
|
||||||
|
+ int ret = 0;
|
||||||
|
|
||||||
|
mutex_lock(&vsock->dev.mutex);
|
||||||
|
|
||||||
|
- ret = vhost_dev_check_owner(&vsock->dev);
|
||||||
|
- if (ret)
|
||||||
|
- goto err;
|
||||||
|
+ if (check_owner) {
|
||||||
|
+ ret = vhost_dev_check_owner(&vsock->dev);
|
||||||
|
+ if (ret)
|
||||||
|
+ goto err;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(vsock->vqs); i++) {
|
||||||
|
struct vhost_virtqueue *vq = &vsock->vqs[i];
|
||||||
|
@@ -611,7 +613,12 @@ static int vhost_vsock_dev_release(struct inode *inode, struct file *file)
|
||||||
|
* inefficient. Room for improvement here. */
|
||||||
|
vsock_for_each_connected_socket(vhost_vsock_reset_orphans);
|
||||||
|
|
||||||
|
- vhost_vsock_stop(vsock);
|
||||||
|
+ /* Don't check the owner, because we are in the release path, so we
|
||||||
|
+ * need to stop the vsock device in any case.
|
||||||
|
+ * vhost_vsock_stop() can not fail in this case, so we don't need to
|
||||||
|
+ * check the return code.
|
||||||
|
+ */
|
||||||
|
+ vhost_vsock_stop(vsock, false);
|
||||||
|
vhost_vsock_flush(vsock);
|
||||||
|
vhost_dev_stop(&vsock->dev);
|
||||||
|
|
||||||
|
@@ -709,7 +716,7 @@ static long vhost_vsock_dev_ioctl(struct file *f, unsigned int ioctl,
|
||||||
|
if (start)
|
||||||
|
return vhost_vsock_start(vsock);
|
||||||
|
else
|
||||||
|
- return vhost_vsock_stop(vsock);
|
||||||
|
+ return vhost_vsock_stop(vsock, true);
|
||||||
|
case VHOST_GET_FEATURES:
|
||||||
|
features = VHOST_VSOCK_FEATURES;
|
||||||
|
if (copy_to_user(argp, &features, sizeof(features)))
|
||||||
|
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
|
||||||
|
index c875f246cb0e9..ccb49caed502c 100644
|
||||||
|
--- a/fs/configfs/dir.c
|
||||||
|
+++ b/fs/configfs/dir.c
|
||||||
|
@@ -50,6 +50,14 @@ DECLARE_RWSEM(configfs_rename_sem);
|
||||||
|
*/
|
||||||
|
DEFINE_SPINLOCK(configfs_dirent_lock);
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+ * All of link_obj/unlink_obj/link_group/unlink_group require that
|
||||||
|
+ * subsys->su_mutex is held.
|
||||||
|
+ * But parent configfs_subsystem is NULL when config_item is root.
|
||||||
|
+ * Use this mutex when config_item is root.
|
||||||
|
+ */
|
||||||
|
+static DEFINE_MUTEX(configfs_subsystem_mutex);
|
||||||
|
+
|
||||||
|
static void configfs_d_iput(struct dentry * dentry,
|
||||||
|
struct inode * inode)
|
||||||
|
{
|
||||||
|
@@ -1937,7 +1945,9 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys)
|
||||||
|
group->cg_item.ci_name = group->cg_item.ci_namebuf;
|
||||||
|
|
||||||
|
sd = root->d_fsdata;
|
||||||
|
+ mutex_lock(&configfs_subsystem_mutex);
|
||||||
|
link_group(to_config_group(sd->s_element), group);
|
||||||
|
+ mutex_unlock(&configfs_subsystem_mutex);
|
||||||
|
|
||||||
|
inode_lock_nested(d_inode(root), I_MUTEX_PARENT);
|
||||||
|
|
||||||
|
@@ -1962,7 +1972,9 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys)
|
||||||
|
inode_unlock(d_inode(root));
|
||||||
|
|
||||||
|
if (err) {
|
||||||
|
+ mutex_lock(&configfs_subsystem_mutex);
|
||||||
|
unlink_group(group);
|
||||||
|
+ mutex_unlock(&configfs_subsystem_mutex);
|
||||||
|
configfs_release_fs();
|
||||||
|
}
|
||||||
|
put_fragment(frag);
|
||||||
|
@@ -2008,7 +2020,9 @@ void configfs_unregister_subsystem(struct configfs_subsystem *subsys)
|
||||||
|
|
||||||
|
dput(dentry);
|
||||||
|
|
||||||
|
+ mutex_lock(&configfs_subsystem_mutex);
|
||||||
|
unlink_group(group);
|
||||||
|
+ mutex_unlock(&configfs_subsystem_mutex);
|
||||||
|
configfs_release_fs();
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/fs/file.c b/fs/file.c
|
||||||
|
index 0e31a66207e86..be0792c0a2313 100644
|
||||||
|
--- a/fs/file.c
|
||||||
|
+++ b/fs/file.c
|
||||||
|
@@ -692,28 +692,69 @@ void do_close_on_exec(struct files_struct *files)
|
||||||
|
spin_unlock(&files->file_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
-static struct file *__fget(unsigned int fd, fmode_t mask, unsigned int refs)
|
||||||
|
+static inline struct file *__fget_files_rcu(struct files_struct *files,
|
||||||
|
+ unsigned int fd, fmode_t mask, unsigned int refs)
|
||||||
|
{
|
||||||
|
- struct files_struct *files = current->files;
|
||||||
|
- struct file *file;
|
||||||
|
+ for (;;) {
|
||||||
|
+ struct file *file;
|
||||||
|
+ struct fdtable *fdt = rcu_dereference_raw(files->fdt);
|
||||||
|
+ struct file __rcu **fdentry;
|
||||||
|
|
||||||
|
- rcu_read_lock();
|
||||||
|
-loop:
|
||||||
|
- file = fcheck_files(files, fd);
|
||||||
|
- if (file) {
|
||||||
|
- /* File object ref couldn't be taken.
|
||||||
|
- * dup2() atomicity guarantee is the reason
|
||||||
|
- * we loop to catch the new file (or NULL pointer)
|
||||||
|
+ if (unlikely(fd >= fdt->max_fds))
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ fdentry = fdt->fd + array_index_nospec(fd, fdt->max_fds);
|
||||||
|
+ file = rcu_dereference_raw(*fdentry);
|
||||||
|
+ if (unlikely(!file))
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ if (unlikely(file->f_mode & mask))
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Ok, we have a file pointer. However, because we do
|
||||||
|
+ * this all locklessly under RCU, we may be racing with
|
||||||
|
+ * that file being closed.
|
||||||
|
+ *
|
||||||
|
+ * Such a race can take two forms:
|
||||||
|
+ *
|
||||||
|
+ * (a) the file ref already went down to zero,
|
||||||
|
+ * and get_file_rcu_many() fails. Just try
|
||||||
|
+ * again:
|
||||||
|
+ */
|
||||||
|
+ if (unlikely(!get_file_rcu_many(file, refs)))
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * (b) the file table entry has changed under us.
|
||||||
|
+ * Note that we don't need to re-check the 'fdt->fd'
|
||||||
|
+ * pointer having changed, because it always goes
|
||||||
|
+ * hand-in-hand with 'fdt'.
|
||||||
|
+ *
|
||||||
|
+ * If so, we need to put our refs and try again.
|
||||||
|
*/
|
||||||
|
- if (file->f_mode & mask)
|
||||||
|
- file = NULL;
|
||||||
|
- else if (!get_file_rcu_many(file, refs))
|
||||||
|
- goto loop;
|
||||||
|
- else if (__fcheck_files(files, fd) != file) {
|
||||||
|
+ if (unlikely(rcu_dereference_raw(files->fdt) != fdt) ||
|
||||||
|
+ unlikely(rcu_dereference_raw(*fdentry) != file)) {
|
||||||
|
fput_many(file, refs);
|
||||||
|
- goto loop;
|
||||||
|
+ continue;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Ok, we have a ref to the file, and checked that it
|
||||||
|
+ * still exists.
|
||||||
|
+ */
|
||||||
|
+ return file;
|
||||||
|
}
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+static struct file *__fget(unsigned int fd, fmode_t mask, unsigned int refs)
|
||||||
|
+{
|
||||||
|
+ struct files_struct *files = current->files;
|
||||||
|
+ struct file *file;
|
||||||
|
+
|
||||||
|
+ rcu_read_lock();
|
||||||
|
+ file = __fget_files_rcu(files, fd, mask, refs);
|
||||||
|
rcu_read_unlock();
|
||||||
|
|
||||||
|
return file;
|
||||||
|
diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c
|
||||||
|
index e00594ad99724..b56d1cfe429e9 100644
|
||||||
|
--- a/fs/tracefs/inode.c
|
||||||
|
+++ b/fs/tracefs/inode.c
|
||||||
|
@@ -265,7 +265,6 @@ static int tracefs_parse_options(char *data, struct tracefs_mount_opts *opts)
|
||||||
|
if (!gid_valid(gid))
|
||||||
|
return -EINVAL;
|
||||||
|
opts->gid = gid;
|
||||||
|
- set_gid(tracefs_mount->mnt_root, gid);
|
||||||
|
break;
|
||||||
|
case Opt_mode:
|
||||||
|
if (match_octal(&args[0], &option))
|
||||||
|
@@ -292,7 +291,9 @@ static int tracefs_apply_options(struct super_block *sb)
|
||||||
|
inode->i_mode |= opts->mode;
|
||||||
|
|
||||||
|
inode->i_uid = opts->uid;
|
||||||
|
- inode->i_gid = opts->gid;
|
||||||
|
+
|
||||||
|
+ /* Set all the group ids to the mount option */
|
||||||
|
+ set_gid(sb->s_root, opts->gid);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
diff --git a/include/net/checksum.h b/include/net/checksum.h
|
||||||
|
index 5c30891e84e51..5c59b6386dff2 100644
|
||||||
|
--- a/include/net/checksum.h
|
||||||
|
+++ b/include/net/checksum.h
|
||||||
|
@@ -143,6 +143,11 @@ static inline void csum_replace2(__sum16 *sum, __be16 old, __be16 new)
|
||||||
|
*sum = ~csum16_add(csum16_sub(~(*sum), old), new);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static inline void csum_replace(__wsum *csum, __wsum old, __wsum new)
|
||||||
|
+{
|
||||||
|
+ *csum = csum_add(csum_sub(*csum, old), new);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
struct sk_buff;
|
||||||
|
void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb,
|
||||||
|
__be32 from, __be32 to, bool pseudohdr);
|
||||||
|
diff --git a/mm/memblock.c b/mm/memblock.c
|
||||||
|
index e43065b13c08c..9f4e78dd2aa1b 100644
|
||||||
|
--- a/mm/memblock.c
|
||||||
|
+++ b/mm/memblock.c
|
||||||
|
@@ -272,14 +272,20 @@ void __init memblock_discard(void)
|
||||||
|
addr = __pa(memblock.reserved.regions);
|
||||||
|
size = PAGE_ALIGN(sizeof(struct memblock_region) *
|
||||||
|
memblock.reserved.max);
|
||||||
|
- __memblock_free_late(addr, size);
|
||||||
|
+ if (memblock_reserved_in_slab)
|
||||||
|
+ kfree(memblock.reserved.regions);
|
||||||
|
+ else
|
||||||
|
+ __memblock_free_late(addr, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (memblock.memory.regions != memblock_memory_init_regions) {
|
||||||
|
addr = __pa(memblock.memory.regions);
|
||||||
|
size = PAGE_ALIGN(sizeof(struct memblock_region) *
|
||||||
|
memblock.memory.max);
|
||||||
|
- __memblock_free_late(addr, size);
|
||||||
|
+ if (memblock_memory_in_slab)
|
||||||
|
+ kfree(memblock.memory.regions);
|
||||||
|
+ else
|
||||||
|
+ __memblock_free_late(addr, size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
|
||||||
|
index 0e34f5ad62162..41d328a93790f 100644
|
||||||
|
--- a/net/core/skbuff.c
|
||||||
|
+++ b/net/core/skbuff.c
|
||||||
|
@@ -1716,7 +1716,7 @@ unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta)
|
||||||
|
/* Free pulled out fragments. */
|
||||||
|
while ((list = skb_shinfo(skb)->frag_list) != insp) {
|
||||||
|
skb_shinfo(skb)->frag_list = list->next;
|
||||||
|
- kfree_skb(list);
|
||||||
|
+ consume_skb(list);
|
||||||
|
}
|
||||||
|
/* And insert new clone at head. */
|
||||||
|
if (clone) {
|
||||||
|
@@ -4951,7 +4951,7 @@ static int pskb_carve_frag_list(struct sk_buff *skb,
|
||||||
|
/* Free pulled out fragments. */
|
||||||
|
while ((list = shinfo->frag_list) != insp) {
|
||||||
|
shinfo->frag_list = list->next;
|
||||||
|
- kfree_skb(list);
|
||||||
|
+ consume_skb(list);
|
||||||
|
}
|
||||||
|
/* And insert new clone at head. */
|
||||||
|
if (clone) {
|
||||||
|
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
|
||||||
|
index a8563745980b4..8f2fb14fd4f71 100644
|
||||||
|
--- a/net/ipv4/af_inet.c
|
||||||
|
+++ b/net/ipv4/af_inet.c
|
||||||
|
@@ -1238,8 +1238,11 @@ struct sk_buff *inet_gso_segment(struct sk_buff *skb,
|
||||||
|
}
|
||||||
|
|
||||||
|
ops = rcu_dereference(inet_offloads[proto]);
|
||||||
|
- if (likely(ops && ops->callbacks.gso_segment))
|
||||||
|
+ if (likely(ops && ops->callbacks.gso_segment)) {
|
||||||
|
segs = ops->callbacks.gso_segment(skb, features);
|
||||||
|
+ if (!segs)
|
||||||
|
+ skb->network_header = skb_mac_header(skb) + nhoff - skb->head;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (IS_ERR_OR_NULL(segs))
|
||||||
|
goto out;
|
||||||
|
diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c
|
||||||
|
index a36ae90bf6132..87763302bce2c 100644
|
||||||
|
--- a/net/ipv6/ip6_offload.c
|
||||||
|
+++ b/net/ipv6/ip6_offload.c
|
||||||
|
@@ -96,6 +96,8 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb,
|
||||||
|
if (likely(ops && ops->callbacks.gso_segment)) {
|
||||||
|
skb_reset_transport_header(skb);
|
||||||
|
segs = ops->callbacks.gso_segment(skb, features);
|
||||||
|
+ if (!segs)
|
||||||
|
+ skb->network_header = skb_mac_header(skb) + nhoff - skb->head;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IS_ERR_OR_NULL(segs))
|
||||||
|
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
|
||||||
|
index 5fa7b2569a3ab..4d9b9d959fafb 100644
|
||||||
|
--- a/net/openvswitch/actions.c
|
||||||
|
+++ b/net/openvswitch/actions.c
|
||||||
|
@@ -391,12 +391,43 @@ static void set_ipv6_addr(struct sk_buff *skb, u8 l4_proto,
|
||||||
|
memcpy(addr, new_addr, sizeof(__be32[4]));
|
||||||
|
}
|
||||||
|
|
||||||
|
-static void set_ipv6_fl(struct ipv6hdr *nh, u32 fl, u32 mask)
|
||||||
|
+static void set_ipv6_dsfield(struct sk_buff *skb, struct ipv6hdr *nh, u8 ipv6_tclass, u8 mask)
|
||||||
|
{
|
||||||
|
+ u8 old_ipv6_tclass = ipv6_get_dsfield(nh);
|
||||||
|
+
|
||||||
|
+ ipv6_tclass = OVS_MASKED(old_ipv6_tclass, ipv6_tclass, mask);
|
||||||
|
+
|
||||||
|
+ if (skb->ip_summed == CHECKSUM_COMPLETE)
|
||||||
|
+ csum_replace(&skb->csum, (__force __wsum)(old_ipv6_tclass << 12),
|
||||||
|
+ (__force __wsum)(ipv6_tclass << 12));
|
||||||
|
+
|
||||||
|
+ ipv6_change_dsfield(nh, ~mask, ipv6_tclass);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void set_ipv6_fl(struct sk_buff *skb, struct ipv6hdr *nh, u32 fl, u32 mask)
|
||||||
|
+{
|
||||||
|
+ u32 ofl;
|
||||||
|
+
|
||||||
|
+ ofl = nh->flow_lbl[0] << 16 | nh->flow_lbl[1] << 8 | nh->flow_lbl[2];
|
||||||
|
+ fl = OVS_MASKED(ofl, fl, mask);
|
||||||
|
+
|
||||||
|
/* Bits 21-24 are always unmasked, so this retains their values. */
|
||||||
|
- OVS_SET_MASKED(nh->flow_lbl[0], (u8)(fl >> 16), (u8)(mask >> 16));
|
||||||
|
- OVS_SET_MASKED(nh->flow_lbl[1], (u8)(fl >> 8), (u8)(mask >> 8));
|
||||||
|
- OVS_SET_MASKED(nh->flow_lbl[2], (u8)fl, (u8)mask);
|
||||||
|
+ nh->flow_lbl[0] = (u8)(fl >> 16);
|
||||||
|
+ nh->flow_lbl[1] = (u8)(fl >> 8);
|
||||||
|
+ nh->flow_lbl[2] = (u8)fl;
|
||||||
|
+
|
||||||
|
+ if (skb->ip_summed == CHECKSUM_COMPLETE)
|
||||||
|
+ csum_replace(&skb->csum, (__force __wsum)htonl(ofl), (__force __wsum)htonl(fl));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void set_ipv6_ttl(struct sk_buff *skb, struct ipv6hdr *nh, u8 new_ttl, u8 mask)
|
||||||
|
+{
|
||||||
|
+ new_ttl = OVS_MASKED(nh->hop_limit, new_ttl, mask);
|
||||||
|
+
|
||||||
|
+ if (skb->ip_summed == CHECKSUM_COMPLETE)
|
||||||
|
+ csum_replace(&skb->csum, (__force __wsum)(nh->hop_limit << 8),
|
||||||
|
+ (__force __wsum)(new_ttl << 8));
|
||||||
|
+ nh->hop_limit = new_ttl;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void set_ip_ttl(struct sk_buff *skb, struct iphdr *nh, u8 new_ttl,
|
||||||
|
@@ -514,18 +545,17 @@ static int set_ipv6(struct sk_buff *skb, struct sw_flow_key *flow_key,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mask->ipv6_tclass) {
|
||||||
|
- ipv6_change_dsfield(nh, ~mask->ipv6_tclass, key->ipv6_tclass);
|
||||||
|
+ set_ipv6_dsfield(skb, nh, key->ipv6_tclass, mask->ipv6_tclass);
|
||||||
|
flow_key->ip.tos = ipv6_get_dsfield(nh);
|
||||||
|
}
|
||||||
|
if (mask->ipv6_label) {
|
||||||
|
- set_ipv6_fl(nh, ntohl(key->ipv6_label),
|
||||||
|
+ set_ipv6_fl(skb, nh, ntohl(key->ipv6_label),
|
||||||
|
ntohl(mask->ipv6_label));
|
||||||
|
flow_key->ipv6.label =
|
||||||
|
*(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL);
|
||||||
|
}
|
||||||
|
if (mask->ipv6_hlimit) {
|
||||||
|
- OVS_SET_MASKED(nh->hop_limit, key->ipv6_hlimit,
|
||||||
|
- mask->ipv6_hlimit);
|
||||||
|
+ set_ipv6_ttl(skb, nh, key->ipv6_hlimit, mask->ipv6_hlimit);
|
||||||
|
flow_key->ip.ttl = nh->hop_limit;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
853
patch/kernel/archive/sun50iw9-4.9/patch-4.9.304-305.patch
Normal file
853
patch/kernel/archive/sun50iw9-4.9/patch-4.9.304-305.patch
Normal file
@@ -0,0 +1,853 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index bd2f7d437b439..308c848b01dc2 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 304
|
||||||
|
+SUBLEVEL = 305
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
|
||||||
|
index 7edc6c3f4bd91..a99e7ebcd004d 100644
|
||||||
|
--- a/arch/arm/mm/mmu.c
|
||||||
|
+++ b/arch/arm/mm/mmu.c
|
||||||
|
@@ -228,12 +228,14 @@ early_param("ecc", early_ecc);
|
||||||
|
static int __init early_cachepolicy(char *p)
|
||||||
|
{
|
||||||
|
pr_warn("cachepolicy kernel parameter not supported without cp15\n");
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
early_param("cachepolicy", early_cachepolicy);
|
||||||
|
|
||||||
|
static int __init noalign_setup(char *__unused)
|
||||||
|
{
|
||||||
|
pr_warn("noalign kernel parameter not supported without cp15\n");
|
||||||
|
+ return 1;
|
||||||
|
}
|
||||||
|
__setup("noalign", noalign_setup);
|
||||||
|
|
||||||
|
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
|
||||||
|
index 821fc1f2324c8..44cc02afaa8bd 100644
|
||||||
|
--- a/drivers/ata/pata_hpt37x.c
|
||||||
|
+++ b/drivers/ata/pata_hpt37x.c
|
||||||
|
@@ -964,14 +964,14 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
||||||
|
|
||||||
|
if ((freq >> 12) != 0xABCDE) {
|
||||||
|
int i;
|
||||||
|
- u8 sr;
|
||||||
|
+ u16 sr;
|
||||||
|
u32 total = 0;
|
||||||
|
|
||||||
|
pr_warn("BIOS has not set timing clocks\n");
|
||||||
|
|
||||||
|
/* This is the process the HPT371 BIOS is reported to use */
|
||||||
|
for (i = 0; i < 128; i++) {
|
||||||
|
- pci_read_config_byte(dev, 0x78, &sr);
|
||||||
|
+ pci_read_config_word(dev, 0x78, &sr);
|
||||||
|
total += sr & 0x1FF;
|
||||||
|
udelay(15);
|
||||||
|
}
|
||||||
|
diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
|
||||||
|
index 12fa48e380cf5..4f8dfe77da3c5 100644
|
||||||
|
--- a/drivers/dma/sh/shdma-base.c
|
||||||
|
+++ b/drivers/dma/sh/shdma-base.c
|
||||||
|
@@ -118,8 +118,10 @@ static dma_cookie_t shdma_tx_submit(struct dma_async_tx_descriptor *tx)
|
||||||
|
ret = pm_runtime_get(schan->dev);
|
||||||
|
|
||||||
|
spin_unlock_irq(&schan->chan_lock);
|
||||||
|
- if (ret < 0)
|
||||||
|
+ if (ret < 0) {
|
||||||
|
dev_err(schan->dev, "%s(): GET = %d\n", __func__, ret);
|
||||||
|
+ pm_runtime_put(schan->dev);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
pm_runtime_barrier(schan->dev);
|
||||||
|
|
||||||
|
diff --git a/drivers/firmware/efi/vars.c b/drivers/firmware/efi/vars.c
|
||||||
|
index fceaafd67ec61..e619ced030d52 100644
|
||||||
|
--- a/drivers/firmware/efi/vars.c
|
||||||
|
+++ b/drivers/firmware/efi/vars.c
|
||||||
|
@@ -763,6 +763,7 @@ int efivar_entry_set_safe(efi_char16_t *name, efi_guid_t vendor, u32 attributes,
|
||||||
|
{
|
||||||
|
const struct efivar_operations *ops;
|
||||||
|
efi_status_t status;
|
||||||
|
+ unsigned long varsize;
|
||||||
|
|
||||||
|
if (!__efivars)
|
||||||
|
return -EINVAL;
|
||||||
|
@@ -785,15 +786,17 @@ int efivar_entry_set_safe(efi_char16_t *name, efi_guid_t vendor, u32 attributes,
|
||||||
|
return efivar_entry_set_nonblocking(name, vendor, attributes,
|
||||||
|
size, data);
|
||||||
|
|
||||||
|
+ varsize = size + ucs2_strsize(name, 1024);
|
||||||
|
if (!block) {
|
||||||
|
if (down_trylock(&efivars_lock))
|
||||||
|
return -EBUSY;
|
||||||
|
+ status = check_var_size_nonblocking(attributes, varsize);
|
||||||
|
} else {
|
||||||
|
if (down_interruptible(&efivars_lock))
|
||||||
|
return -EINTR;
|
||||||
|
+ status = check_var_size(attributes, varsize);
|
||||||
|
}
|
||||||
|
|
||||||
|
- status = check_var_size(attributes, size + ucs2_strsize(name, 1024));
|
||||||
|
if (status != EFI_SUCCESS) {
|
||||||
|
up(&efivars_lock);
|
||||||
|
return -ENOSPC;
|
||||||
|
diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
|
||||||
|
index 595bf12e76538..062d0eb50799b 100644
|
||||||
|
--- a/drivers/firmware/qemu_fw_cfg.c
|
||||||
|
+++ b/drivers/firmware/qemu_fw_cfg.c
|
||||||
|
@@ -462,12 +462,12 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f)
|
||||||
|
err = kobject_init_and_add(&entry->kobj, &fw_cfg_sysfs_entry_ktype,
|
||||||
|
fw_cfg_sel_ko, "%d", entry->f.select);
|
||||||
|
if (err)
|
||||||
|
- goto err_register;
|
||||||
|
+ goto err_put_entry;
|
||||||
|
|
||||||
|
/* add raw binary content access */
|
||||||
|
err = sysfs_create_bin_file(&entry->kobj, &fw_cfg_sysfs_attr_raw);
|
||||||
|
if (err)
|
||||||
|
- goto err_add_raw;
|
||||||
|
+ goto err_del_entry;
|
||||||
|
|
||||||
|
/* try adding "/sys/firmware/qemu_fw_cfg/by_name/" symlink */
|
||||||
|
fw_cfg_build_symlink(fw_cfg_fname_kset, &entry->kobj, entry->f.name);
|
||||||
|
@@ -476,10 +476,10 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f)
|
||||||
|
fw_cfg_sysfs_cache_enlist(entry);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
-err_add_raw:
|
||||||
|
+err_del_entry:
|
||||||
|
kobject_del(&entry->kobj);
|
||||||
|
-err_register:
|
||||||
|
- kfree(entry);
|
||||||
|
+err_put_entry:
|
||||||
|
+ kobject_put(&entry->kobj);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
|
||||||
|
index 3cafa1d28fedd..07dea71d41fc5 100644
|
||||||
|
--- a/drivers/hid/hid-debug.c
|
||||||
|
+++ b/drivers/hid/hid-debug.c
|
||||||
|
@@ -833,7 +833,9 @@ static const char *keys[KEY_MAX + 1] = {
|
||||||
|
[KEY_F22] = "F22", [KEY_F23] = "F23",
|
||||||
|
[KEY_F24] = "F24", [KEY_PLAYCD] = "PlayCD",
|
||||||
|
[KEY_PAUSECD] = "PauseCD", [KEY_PROG3] = "Prog3",
|
||||||
|
- [KEY_PROG4] = "Prog4", [KEY_SUSPEND] = "Suspend",
|
||||||
|
+ [KEY_PROG4] = "Prog4",
|
||||||
|
+ [KEY_ALL_APPLICATIONS] = "AllApplications",
|
||||||
|
+ [KEY_SUSPEND] = "Suspend",
|
||||||
|
[KEY_CLOSE] = "Close", [KEY_PLAY] = "Play",
|
||||||
|
[KEY_FASTFORWARD] = "FastForward", [KEY_BASSBOOST] = "BassBoost",
|
||||||
|
[KEY_PRINT] = "Print", [KEY_HP] = "HP",
|
||||||
|
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
|
||||||
|
index 5e1a51ba6500f..1dccc072da4af 100644
|
||||||
|
--- a/drivers/hid/hid-input.c
|
||||||
|
+++ b/drivers/hid/hid-input.c
|
||||||
|
@@ -937,6 +937,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
|
||||||
|
case 0x28b: map_key_clear(KEY_FORWARDMAIL); break;
|
||||||
|
case 0x28c: map_key_clear(KEY_SEND); break;
|
||||||
|
|
||||||
|
+ case 0x2a2: map_key_clear(KEY_ALL_APPLICATIONS); break;
|
||||||
|
+
|
||||||
|
case 0x2c7: map_key_clear(KEY_KBDINPUTASSIST_PREV); break;
|
||||||
|
case 0x2c8: map_key_clear(KEY_KBDINPUTASSIST_NEXT); break;
|
||||||
|
case 0x2c9: map_key_clear(KEY_KBDINPUTASSIST_PREVGROUP); break;
|
||||||
|
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||||
|
index 759c621a860a9..be4b7b1ad39b6 100644
|
||||||
|
--- a/drivers/i2c/busses/Kconfig
|
||||||
|
+++ b/drivers/i2c/busses/Kconfig
|
||||||
|
@@ -783,7 +783,7 @@ config I2C_PXA_SLAVE
|
||||||
|
|
||||||
|
config I2C_QUP
|
||||||
|
tristate "Qualcomm QUP based I2C controller"
|
||||||
|
- depends on ARCH_QCOM
|
||||||
|
+ depends on ARCH_QCOM || COMPILE_TEST
|
||||||
|
help
|
||||||
|
If you say yes to this option, support will be included for the
|
||||||
|
built-in I2C interface on the Qualcomm SoCs.
|
||||||
|
diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
|
||||||
|
index 7ed09865cb4b9..4729c14b75017 100644
|
||||||
|
--- a/drivers/i2c/busses/i2c-bcm2835.c
|
||||||
|
+++ b/drivers/i2c/busses/i2c-bcm2835.c
|
||||||
|
@@ -28,6 +28,11 @@
|
||||||
|
#define BCM2835_I2C_FIFO 0x10
|
||||||
|
#define BCM2835_I2C_DIV 0x14
|
||||||
|
#define BCM2835_I2C_DEL 0x18
|
||||||
|
+/*
|
||||||
|
+ * 16-bit field for the number of SCL cycles to wait after rising SCL
|
||||||
|
+ * before deciding the slave is not responding. 0 disables the
|
||||||
|
+ * timeout detection.
|
||||||
|
+ */
|
||||||
|
#define BCM2835_I2C_CLKT 0x1c
|
||||||
|
|
||||||
|
#define BCM2835_I2C_C_READ BIT(0)
|
||||||
|
@@ -313,6 +318,12 @@ static int bcm2835_i2c_probe(struct platform_device *pdev)
|
||||||
|
adap->dev.of_node = pdev->dev.of_node;
|
||||||
|
adap->quirks = &bcm2835_i2c_quirks;
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * Disable the hardware clock stretching timeout. SMBUS
|
||||||
|
+ * specifies a limit for how long the device can stretch the
|
||||||
|
+ * clock, but core I2C doesn't.
|
||||||
|
+ */
|
||||||
|
+ bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_CLKT, 0);
|
||||||
|
bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, 0);
|
||||||
|
|
||||||
|
ret = i2c_add_adapter(adap);
|
||||||
|
diff --git a/drivers/input/input.c b/drivers/input/input.c
|
||||||
|
index 5d94fc3fce0bb..cb31236425a11 100644
|
||||||
|
--- a/drivers/input/input.c
|
||||||
|
+++ b/drivers/input/input.c
|
||||||
|
@@ -2112,6 +2112,12 @@ int input_register_device(struct input_dev *dev)
|
||||||
|
/* KEY_RESERVED is not supposed to be transmitted to userspace. */
|
||||||
|
__clear_bit(KEY_RESERVED, dev->keybit);
|
||||||
|
|
||||||
|
+ /* Buttonpads should not map BTN_RIGHT and/or BTN_MIDDLE. */
|
||||||
|
+ if (test_bit(INPUT_PROP_BUTTONPAD, dev->propbit)) {
|
||||||
|
+ __clear_bit(BTN_RIGHT, dev->keybit);
|
||||||
|
+ __clear_bit(BTN_MIDDLE, dev->keybit);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/* Make sure that bitmasks not mentioned in dev->evbit are clean. */
|
||||||
|
input_cleanse_bitmasks(dev);
|
||||||
|
|
||||||
|
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
|
||||||
|
index 16f5d56600530..44015e6bd6a05 100644
|
||||||
|
--- a/drivers/input/mouse/elan_i2c_core.c
|
||||||
|
+++ b/drivers/input/mouse/elan_i2c_core.c
|
||||||
|
@@ -132,55 +132,21 @@ static int elan_get_fwinfo(u8 iap_version, u16 *validpage_count,
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int elan_enable_power(struct elan_tp_data *data)
|
||||||
|
+static int elan_set_power(struct elan_tp_data *data, bool on)
|
||||||
|
{
|
||||||
|
int repeat = ETP_RETRY_COUNT;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
- error = regulator_enable(data->vcc);
|
||||||
|
- if (error) {
|
||||||
|
- dev_err(&data->client->dev,
|
||||||
|
- "failed to enable regulator: %d\n", error);
|
||||||
|
- return error;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
do {
|
||||||
|
- error = data->ops->power_control(data->client, true);
|
||||||
|
+ error = data->ops->power_control(data->client, on);
|
||||||
|
if (error >= 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
msleep(30);
|
||||||
|
} while (--repeat > 0);
|
||||||
|
|
||||||
|
- dev_err(&data->client->dev, "failed to enable power: %d\n", error);
|
||||||
|
- return error;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static int elan_disable_power(struct elan_tp_data *data)
|
||||||
|
-{
|
||||||
|
- int repeat = ETP_RETRY_COUNT;
|
||||||
|
- int error;
|
||||||
|
-
|
||||||
|
- do {
|
||||||
|
- error = data->ops->power_control(data->client, false);
|
||||||
|
- if (!error) {
|
||||||
|
- error = regulator_disable(data->vcc);
|
||||||
|
- if (error) {
|
||||||
|
- dev_err(&data->client->dev,
|
||||||
|
- "failed to disable regulator: %d\n",
|
||||||
|
- error);
|
||||||
|
- /* Attempt to power the chip back up */
|
||||||
|
- data->ops->power_control(data->client, true);
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- return 0;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- msleep(30);
|
||||||
|
- } while (--repeat > 0);
|
||||||
|
-
|
||||||
|
- dev_err(&data->client->dev, "failed to disable power: %d\n", error);
|
||||||
|
+ dev_err(&data->client->dev, "failed to set power %s: %d\n",
|
||||||
|
+ on ? "on" : "off", error);
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1195,9 +1161,19 @@ static int __maybe_unused elan_suspend(struct device *dev)
|
||||||
|
/* Enable wake from IRQ */
|
||||||
|
data->irq_wake = (enable_irq_wake(client->irq) == 0);
|
||||||
|
} else {
|
||||||
|
- ret = elan_disable_power(data);
|
||||||
|
+ ret = elan_set_power(data, false);
|
||||||
|
+ if (ret)
|
||||||
|
+ goto err;
|
||||||
|
+
|
||||||
|
+ ret = regulator_disable(data->vcc);
|
||||||
|
+ if (ret) {
|
||||||
|
+ dev_err(dev, "error %d disabling regulator\n", ret);
|
||||||
|
+ /* Attempt to power the chip back up */
|
||||||
|
+ elan_set_power(data, true);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
+err:
|
||||||
|
mutex_unlock(&data->sysfs_mutex);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
@@ -1208,12 +1184,18 @@ static int __maybe_unused elan_resume(struct device *dev)
|
||||||
|
struct elan_tp_data *data = i2c_get_clientdata(client);
|
||||||
|
int error;
|
||||||
|
|
||||||
|
- if (device_may_wakeup(dev) && data->irq_wake) {
|
||||||
|
+ if (!device_may_wakeup(dev)) {
|
||||||
|
+ error = regulator_enable(data->vcc);
|
||||||
|
+ if (error) {
|
||||||
|
+ dev_err(dev, "error %d enabling regulator\n", error);
|
||||||
|
+ goto err;
|
||||||
|
+ }
|
||||||
|
+ } else if (data->irq_wake) {
|
||||||
|
disable_irq_wake(client->irq);
|
||||||
|
data->irq_wake = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
- error = elan_enable_power(data);
|
||||||
|
+ error = elan_set_power(data, true);
|
||||||
|
if (error) {
|
||||||
|
dev_err(dev, "power up when resuming failed: %d\n", error);
|
||||||
|
goto err;
|
||||||
|
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
|
||||||
|
index 239de38fbd6a5..1c9fff038569d 100644
|
||||||
|
--- a/drivers/net/arcnet/com20020-pci.c
|
||||||
|
+++ b/drivers/net/arcnet/com20020-pci.c
|
||||||
|
@@ -115,6 +115,9 @@ static int com20020pci_probe(struct pci_dev *pdev,
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
ci = (struct com20020_pci_card_info *)id->driver_data;
|
||||||
|
+ if (!ci)
|
||||||
|
+ return -EINVAL;
|
||||||
|
+
|
||||||
|
priv->ci = ci;
|
||||||
|
mm = &ci->misc_map;
|
||||||
|
|
||||||
|
diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
|
||||||
|
index 75399aa1ba951..6771c51f72c37 100644
|
||||||
|
--- a/drivers/net/can/usb/gs_usb.c
|
||||||
|
+++ b/drivers/net/can/usb/gs_usb.c
|
||||||
|
@@ -198,8 +198,8 @@ struct gs_can {
|
||||||
|
struct gs_usb {
|
||||||
|
struct gs_can *canch[GS_MAX_INTF];
|
||||||
|
struct usb_anchor rx_submitted;
|
||||||
|
- atomic_t active_channels;
|
||||||
|
struct usb_device *udev;
|
||||||
|
+ u8 active_channels;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 'allocate' a tx context.
|
||||||
|
@@ -597,7 +597,7 @@ static int gs_can_open(struct net_device *netdev)
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
- if (atomic_add_return(1, &parent->active_channels) == 1) {
|
||||||
|
+ if (!parent->active_channels) {
|
||||||
|
for (i = 0; i < GS_MAX_RX_URBS; i++) {
|
||||||
|
struct urb *urb;
|
||||||
|
u8 *buf;
|
||||||
|
@@ -698,6 +698,7 @@ static int gs_can_open(struct net_device *netdev)
|
||||||
|
|
||||||
|
dev->can.state = CAN_STATE_ERROR_ACTIVE;
|
||||||
|
|
||||||
|
+ parent->active_channels++;
|
||||||
|
if (!(dev->can.ctrlmode & CAN_CTRLMODE_LISTENONLY))
|
||||||
|
netif_start_queue(netdev);
|
||||||
|
|
||||||
|
@@ -713,7 +714,8 @@ static int gs_can_close(struct net_device *netdev)
|
||||||
|
netif_stop_queue(netdev);
|
||||||
|
|
||||||
|
/* Stop polling */
|
||||||
|
- if (atomic_dec_and_test(&parent->active_channels))
|
||||||
|
+ parent->active_channels--;
|
||||||
|
+ if (!parent->active_channels)
|
||||||
|
usb_kill_anchored_urbs(&parent->rx_submitted);
|
||||||
|
|
||||||
|
/* Stop sending URBs */
|
||||||
|
@@ -992,8 +994,6 @@ static int gs_usb_probe(struct usb_interface *intf,
|
||||||
|
|
||||||
|
init_usb_anchor(&dev->rx_submitted);
|
||||||
|
|
||||||
|
- atomic_set(&dev->active_channels, 0);
|
||||||
|
-
|
||||||
|
usb_set_intfdata(intf, dev);
|
||||||
|
dev->udev = interface_to_usbdev(intf);
|
||||||
|
|
||||||
|
diff --git a/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c b/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
|
||||||
|
index a89721fad633e..29220141e4e46 100644
|
||||||
|
--- a/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
|
||||||
|
+++ b/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
|
||||||
|
@@ -3677,6 +3677,8 @@ int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai,
|
||||||
|
MAC_STATS_ACCUM_SECS : (MAC_STATS_ACCUM_SECS * 10);
|
||||||
|
adapter->params.pci.vpd_cap_addr =
|
||||||
|
pci_find_capability(adapter->pdev, PCI_CAP_ID_VPD);
|
||||||
|
+ if (!adapter->params.pci.vpd_cap_addr)
|
||||||
|
+ return -ENODEV;
|
||||||
|
ret = get_vpd_params(adapter, &adapter->params.vpd);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
|
||||||
|
index 11dd7c8d576d6..ab1d01dd2eb3a 100644
|
||||||
|
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
|
||||||
|
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
|
||||||
|
@@ -2311,18 +2311,18 @@ static int __init sxgbe_cmdline_opt(char *str)
|
||||||
|
char *opt;
|
||||||
|
|
||||||
|
if (!str || !*str)
|
||||||
|
- return -EINVAL;
|
||||||
|
+ return 1;
|
||||||
|
while ((opt = strsep(&str, ",")) != NULL) {
|
||||||
|
if (!strncmp(opt, "eee_timer:", 10)) {
|
||||||
|
if (kstrtoint(opt + 10, 0, &eee_timer))
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- return 0;
|
||||||
|
+ return 1;
|
||||||
|
|
||||||
|
err:
|
||||||
|
pr_err("%s: ERROR broken module parameter conversion\n", __func__);
|
||||||
|
- return -EINVAL;
|
||||||
|
+ return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
__setup("sxgbeeth=", sxgbe_cmdline_opt);
|
||||||
|
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
|
index 0a7ff854d1c34..bb44f8161ea94 100644
|
||||||
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
|
@@ -3608,7 +3608,7 @@ static int __init stmmac_cmdline_opt(char *str)
|
||||||
|
char *opt;
|
||||||
|
|
||||||
|
if (!str || !*str)
|
||||||
|
- return -EINVAL;
|
||||||
|
+ return 1;
|
||||||
|
while ((opt = strsep(&str, ",")) != NULL) {
|
||||||
|
if (!strncmp(opt, "debug:", 6)) {
|
||||||
|
if (kstrtoint(opt + 6, 0, &debug))
|
||||||
|
@@ -3639,11 +3639,11 @@ static int __init stmmac_cmdline_opt(char *str)
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- return 0;
|
||||||
|
+ return 1;
|
||||||
|
|
||||||
|
err:
|
||||||
|
pr_err("%s: ERROR broken module parameter conversion", __func__);
|
||||||
|
- return -EINVAL;
|
||||||
|
+ return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
__setup("stmmaceth=", stmmac_cmdline_opt);
|
||||||
|
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
|
||||||
|
index 8d85cedb4bf5b..cbf959e7bbff7 100644
|
||||||
|
--- a/drivers/net/hamradio/mkiss.c
|
||||||
|
+++ b/drivers/net/hamradio/mkiss.c
|
||||||
|
@@ -41,6 +41,8 @@
|
||||||
|
|
||||||
|
#define AX_MTU 236
|
||||||
|
|
||||||
|
+/* some arch define END as assembly function ending, just undef it */
|
||||||
|
+#undef END
|
||||||
|
/* SLIP/KISS protocol characters. */
|
||||||
|
#define END 0300 /* indicates end of frame */
|
||||||
|
#define ESC 0333 /* indicates byte stuffing */
|
||||||
|
diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c
|
||||||
|
index d86132d41416d..95256765b3887 100644
|
||||||
|
--- a/drivers/net/usb/cdc_mbim.c
|
||||||
|
+++ b/drivers/net/usb/cdc_mbim.c
|
||||||
|
@@ -652,6 +652,11 @@ static const struct usb_device_id mbim_devs[] = {
|
||||||
|
.driver_info = (unsigned long)&cdc_mbim_info_avoid_altsetting_toggle,
|
||||||
|
},
|
||||||
|
|
||||||
|
+ /* Telit FN990 */
|
||||||
|
+ { USB_DEVICE_AND_INTERFACE_INFO(0x1bc7, 0x1071, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),
|
||||||
|
+ .driver_info = (unsigned long)&cdc_mbim_info_avoid_altsetting_toggle,
|
||||||
|
+ },
|
||||||
|
+
|
||||||
|
/* default entry */
|
||||||
|
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),
|
||||||
|
.driver_info = (unsigned long)&cdc_mbim_info_zlp,
|
||||||
|
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
|
||||||
|
index dd6924d21b8a1..a34647efb5ea5 100644
|
||||||
|
--- a/drivers/net/wireless/mac80211_hwsim.c
|
||||||
|
+++ b/drivers/net/wireless/mac80211_hwsim.c
|
||||||
|
@@ -1987,6 +1987,15 @@ static void hw_scan_work(struct work_struct *work)
|
||||||
|
memcpy(skb_put(probe, req->ie_len), req->ie,
|
||||||
|
req->ie_len);
|
||||||
|
|
||||||
|
+ if (!ieee80211_tx_prepare_skb(hwsim->hw,
|
||||||
|
+ hwsim->hw_scan_vif,
|
||||||
|
+ probe,
|
||||||
|
+ hwsim->tmp_chan->band,
|
||||||
|
+ NULL)) {
|
||||||
|
+ kfree_skb(probe);
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
local_bh_disable();
|
||||||
|
mac80211_hwsim_tx_frame(hwsim->hw, probe,
|
||||||
|
hwsim->tmp_chan);
|
||||||
|
@@ -2919,6 +2928,10 @@ static int hwsim_tx_info_frame_received_nl(struct sk_buff *skb_2,
|
||||||
|
}
|
||||||
|
txi->flags |= IEEE80211_TX_STAT_ACK;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (hwsim_flags & HWSIM_TX_CTL_NO_ACK)
|
||||||
|
+ txi->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED;
|
||||||
|
+
|
||||||
|
ieee80211_tx_status_irqsafe(data2->hw, skb);
|
||||||
|
return 0;
|
||||||
|
out:
|
||||||
|
diff --git a/drivers/soc/fsl/qe/qe_io.c b/drivers/soc/fsl/qe/qe_io.c
|
||||||
|
index 7ae59abc78637..127a4a836e675 100644
|
||||||
|
--- a/drivers/soc/fsl/qe/qe_io.c
|
||||||
|
+++ b/drivers/soc/fsl/qe/qe_io.c
|
||||||
|
@@ -41,6 +41,8 @@ int par_io_init(struct device_node *np)
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
par_io = ioremap(res.start, resource_size(&res));
|
||||||
|
+ if (!par_io)
|
||||||
|
+ return -ENOMEM;
|
||||||
|
|
||||||
|
num_ports = of_get_property(np, "num-ports", NULL);
|
||||||
|
if (num_ports)
|
||||||
|
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
|
||||||
|
index 19eb954a7afa3..2b30b5a1b577e 100644
|
||||||
|
--- a/drivers/usb/gadget/legacy/inode.c
|
||||||
|
+++ b/drivers/usb/gadget/legacy/inode.c
|
||||||
|
@@ -1833,8 +1833,9 @@ dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
|
||||||
|
spin_lock_irq (&dev->lock);
|
||||||
|
value = -EINVAL;
|
||||||
|
if (dev->buf) {
|
||||||
|
+ spin_unlock_irq(&dev->lock);
|
||||||
|
kfree(kbuf);
|
||||||
|
- goto fail;
|
||||||
|
+ return value;
|
||||||
|
}
|
||||||
|
dev->buf = kbuf;
|
||||||
|
|
||||||
|
@@ -1882,8 +1883,8 @@ dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
|
||||||
|
|
||||||
|
value = usb_gadget_probe_driver(&gadgetfs_driver);
|
||||||
|
if (value != 0) {
|
||||||
|
- kfree (dev->buf);
|
||||||
|
- dev->buf = NULL;
|
||||||
|
+ spin_lock_irq(&dev->lock);
|
||||||
|
+ goto fail;
|
||||||
|
} else {
|
||||||
|
/* at this point "good" hardware has for the first time
|
||||||
|
* let the USB the host see us. alternatively, if users
|
||||||
|
@@ -1900,6 +1901,9 @@ dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
|
||||||
|
return value;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
+ dev->config = NULL;
|
||||||
|
+ dev->hs_config = NULL;
|
||||||
|
+ dev->dev = NULL;
|
||||||
|
spin_unlock_irq (&dev->lock);
|
||||||
|
pr_debug ("%s: %s fail %Zd, %p\n", shortname, __func__, value, dev);
|
||||||
|
kfree (dev->buf);
|
||||||
|
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
|
||||||
|
index 375ccd209206a..95e4f074b7665 100644
|
||||||
|
--- a/fs/cifs/cifsfs.c
|
||||||
|
+++ b/fs/cifs/cifsfs.c
|
||||||
|
@@ -746,6 +746,7 @@ cifs_do_mount(struct file_system_type *fs_type,
|
||||||
|
|
||||||
|
out_super:
|
||||||
|
deactivate_locked_super(sb);
|
||||||
|
+ return root;
|
||||||
|
out:
|
||||||
|
cifs_cleanup_volume_info(volume_info);
|
||||||
|
return root;
|
||||||
|
diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h
|
||||||
|
index 2280cfe86c561..faa535defddd0 100644
|
||||||
|
--- a/include/net/netfilter/nf_queue.h
|
||||||
|
+++ b/include/net/netfilter/nf_queue.h
|
||||||
|
@@ -31,7 +31,7 @@ void nf_register_queue_handler(struct net *net, const struct nf_queue_handler *q
|
||||||
|
void nf_unregister_queue_handler(struct net *net);
|
||||||
|
void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
|
||||||
|
|
||||||
|
-void nf_queue_entry_get_refs(struct nf_queue_entry *entry);
|
||||||
|
+bool nf_queue_entry_get_refs(struct nf_queue_entry *entry);
|
||||||
|
void nf_queue_entry_release_refs(struct nf_queue_entry *entry);
|
||||||
|
|
||||||
|
static inline void init_hashrandom(u32 *jhash_initval)
|
||||||
|
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
|
||||||
|
index b584868e1b26b..fd7cacbfc8c2c 100644
|
||||||
|
--- a/include/uapi/linux/input-event-codes.h
|
||||||
|
+++ b/include/uapi/linux/input-event-codes.h
|
||||||
|
@@ -277,7 +277,8 @@
|
||||||
|
#define KEY_PAUSECD 201
|
||||||
|
#define KEY_PROG3 202
|
||||||
|
#define KEY_PROG4 203
|
||||||
|
-#define KEY_DASHBOARD 204 /* AL Dashboard */
|
||||||
|
+#define KEY_ALL_APPLICATIONS 204 /* AC Desktop Show All Applications */
|
||||||
|
+#define KEY_DASHBOARD KEY_ALL_APPLICATIONS
|
||||||
|
#define KEY_SUSPEND 205
|
||||||
|
#define KEY_CLOSE 206 /* AC Close */
|
||||||
|
#define KEY_PLAY 207
|
||||||
|
diff --git a/mm/shmem.c b/mm/shmem.c
|
||||||
|
index 51aa13f596220..dffa36e6d1c45 100644
|
||||||
|
--- a/mm/shmem.c
|
||||||
|
+++ b/mm/shmem.c
|
||||||
|
@@ -2478,7 +2478,8 @@ static void shmem_tag_pins(struct address_space *mapping)
|
||||||
|
slot = radix_tree_iter_retry(&iter);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
- } else if (page_count(page) - page_mapcount(page) > 1) {
|
||||||
|
+ } else if (!PageTail(page) && page_count(page) !=
|
||||||
|
+ hpage_nr_pages(page) + total_mapcount(page)) {
|
||||||
|
radix_tree_tag_set(&mapping->page_tree, iter.index,
|
||||||
|
SHMEM_TAG_PINNED);
|
||||||
|
}
|
||||||
|
@@ -2538,8 +2539,8 @@ static int shmem_wait_for_pins(struct address_space *mapping)
|
||||||
|
page = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (page &&
|
||||||
|
- page_count(page) - page_mapcount(page) != 1) {
|
||||||
|
+ if (page && page_count(page) !=
|
||||||
|
+ hpage_nr_pages(page) + total_mapcount(page)) {
|
||||||
|
if (scan < LAST_SCAN)
|
||||||
|
goto continue_resched;
|
||||||
|
|
||||||
|
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
|
||||||
|
index 2dbf5a0faad32..e32a520c3702b 100644
|
||||||
|
--- a/net/dcb/dcbnl.c
|
||||||
|
+++ b/net/dcb/dcbnl.c
|
||||||
|
@@ -1938,10 +1938,54 @@ int dcb_ieee_delapp(struct net_device *dev, struct dcb_app *del)
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(dcb_ieee_delapp);
|
||||||
|
|
||||||
|
+static void dcbnl_flush_dev(struct net_device *dev)
|
||||||
|
+{
|
||||||
|
+ struct dcb_app_type *itr, *tmp;
|
||||||
|
+
|
||||||
|
+ spin_lock_bh(&dcb_lock);
|
||||||
|
+
|
||||||
|
+ list_for_each_entry_safe(itr, tmp, &dcb_app_list, list) {
|
||||||
|
+ if (itr->ifindex == dev->ifindex) {
|
||||||
|
+ list_del(&itr->list);
|
||||||
|
+ kfree(itr);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ spin_unlock_bh(&dcb_lock);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int dcbnl_netdevice_event(struct notifier_block *nb,
|
||||||
|
+ unsigned long event, void *ptr)
|
||||||
|
+{
|
||||||
|
+ struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
+
|
||||||
|
+ switch (event) {
|
||||||
|
+ case NETDEV_UNREGISTER:
|
||||||
|
+ if (!dev->dcbnl_ops)
|
||||||
|
+ return NOTIFY_DONE;
|
||||||
|
+
|
||||||
|
+ dcbnl_flush_dev(dev);
|
||||||
|
+
|
||||||
|
+ return NOTIFY_OK;
|
||||||
|
+ default:
|
||||||
|
+ return NOTIFY_DONE;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static struct notifier_block dcbnl_nb __read_mostly = {
|
||||||
|
+ .notifier_call = dcbnl_netdevice_event,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
static int __init dcbnl_init(void)
|
||||||
|
{
|
||||||
|
+ int err;
|
||||||
|
+
|
||||||
|
INIT_LIST_HEAD(&dcb_app_list);
|
||||||
|
|
||||||
|
+ err = register_netdevice_notifier(&dcbnl_nb);
|
||||||
|
+ if (err)
|
||||||
|
+ return err;
|
||||||
|
+
|
||||||
|
rtnl_register(PF_UNSPEC, RTM_GETDCB, dcb_doit, NULL, NULL);
|
||||||
|
rtnl_register(PF_UNSPEC, RTM_SETDCB, dcb_doit, NULL, NULL);
|
||||||
|
|
||||||
|
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
|
||||||
|
index d93a98dfe52df..55be18cae35ba 100644
|
||||||
|
--- a/net/ipv6/ip6_output.c
|
||||||
|
+++ b/net/ipv6/ip6_output.c
|
||||||
|
@@ -1274,8 +1274,6 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork,
|
||||||
|
if (np->frag_size)
|
||||||
|
mtu = np->frag_size;
|
||||||
|
}
|
||||||
|
- if (mtu < IPV6_MIN_MTU)
|
||||||
|
- return -EINVAL;
|
||||||
|
cork->base.fragsize = mtu;
|
||||||
|
if (dst_allfrag(rt->dst.path))
|
||||||
|
cork->base.flags |= IPCORK_ALLFRAG;
|
||||||
|
@@ -1324,8 +1322,6 @@ static int __ip6_append_data(struct sock *sk,
|
||||||
|
|
||||||
|
fragheaderlen = sizeof(struct ipv6hdr) + rt->rt6i_nfheader_len +
|
||||||
|
(opt ? opt->opt_nflen : 0);
|
||||||
|
- maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen -
|
||||||
|
- sizeof(struct frag_hdr);
|
||||||
|
|
||||||
|
headersize = sizeof(struct ipv6hdr) +
|
||||||
|
(opt ? opt->opt_flen + opt->opt_nflen : 0) +
|
||||||
|
@@ -1333,6 +1329,13 @@ static int __ip6_append_data(struct sock *sk,
|
||||||
|
sizeof(struct frag_hdr) : 0) +
|
||||||
|
rt->rt6i_nfheader_len;
|
||||||
|
|
||||||
|
+ if (mtu < fragheaderlen ||
|
||||||
|
+ ((mtu - fragheaderlen) & ~7) + fragheaderlen < sizeof(struct frag_hdr))
|
||||||
|
+ goto emsgsize;
|
||||||
|
+
|
||||||
|
+ maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen -
|
||||||
|
+ sizeof(struct frag_hdr);
|
||||||
|
+
|
||||||
|
/* as per RFC 7112 section 5, the entire IPv6 Header Chain must fit
|
||||||
|
* the first fragment
|
||||||
|
*/
|
||||||
|
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
|
||||||
|
index 3dc370ad23bf6..41af02a70742e 100644
|
||||||
|
--- a/net/mac80211/rx.c
|
||||||
|
+++ b/net/mac80211/rx.c
|
||||||
|
@@ -2607,13 +2607,13 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
|
||||||
|
ether_addr_equal(sdata->vif.addr, hdr->addr3))
|
||||||
|
return RX_CONTINUE;
|
||||||
|
|
||||||
|
- ac = ieee80211_select_queue_80211(sdata, skb, hdr);
|
||||||
|
+ ac = ieee802_1d_to_ac[skb->priority];
|
||||||
|
q = sdata->vif.hw_queue[ac];
|
||||||
|
if (ieee80211_queue_stopped(&local->hw, q)) {
|
||||||
|
IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion);
|
||||||
|
return RX_DROP_MONITOR;
|
||||||
|
}
|
||||||
|
- skb_set_queue_mapping(skb, q);
|
||||||
|
+ skb_set_queue_mapping(skb, ac);
|
||||||
|
|
||||||
|
if (!--mesh_hdr->ttl) {
|
||||||
|
if (!is_multicast_ether_addr(hdr->addr1))
|
||||||
|
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
|
||||||
|
index 8f08d759844a9..333ea23681017 100644
|
||||||
|
--- a/net/netfilter/nf_queue.c
|
||||||
|
+++ b/net/netfilter/nf_queue.c
|
||||||
|
@@ -44,6 +44,15 @@ void nf_unregister_queue_handler(struct net *net)
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(nf_unregister_queue_handler);
|
||||||
|
|
||||||
|
+static void nf_queue_sock_put(struct sock *sk)
|
||||||
|
+{
|
||||||
|
+#ifdef CONFIG_INET
|
||||||
|
+ sock_gen_put(sk);
|
||||||
|
+#else
|
||||||
|
+ sock_put(sk);
|
||||||
|
+#endif
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void nf_queue_entry_release_refs(struct nf_queue_entry *entry)
|
||||||
|
{
|
||||||
|
struct nf_hook_state *state = &entry->state;
|
||||||
|
@@ -54,7 +63,7 @@ void nf_queue_entry_release_refs(struct nf_queue_entry *entry)
|
||||||
|
if (state->out)
|
||||||
|
dev_put(state->out);
|
||||||
|
if (state->sk)
|
||||||
|
- sock_put(state->sk);
|
||||||
|
+ nf_queue_sock_put(state->sk);
|
||||||
|
#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
|
||||||
|
if (entry->skb->nf_bridge) {
|
||||||
|
struct net_device *physdev;
|
||||||
|
@@ -71,10 +80,13 @@ void nf_queue_entry_release_refs(struct nf_queue_entry *entry)
|
||||||
|
EXPORT_SYMBOL_GPL(nf_queue_entry_release_refs);
|
||||||
|
|
||||||
|
/* Bump dev refs so they don't vanish while packet is out */
|
||||||
|
-void nf_queue_entry_get_refs(struct nf_queue_entry *entry)
|
||||||
|
+bool nf_queue_entry_get_refs(struct nf_queue_entry *entry)
|
||||||
|
{
|
||||||
|
struct nf_hook_state *state = &entry->state;
|
||||||
|
|
||||||
|
+ if (state->sk && !atomic_inc_not_zero(&state->sk->sk_refcnt))
|
||||||
|
+ return false;
|
||||||
|
+
|
||||||
|
if (state->in)
|
||||||
|
dev_hold(state->in);
|
||||||
|
if (state->out)
|
||||||
|
@@ -93,6 +105,7 @@ void nf_queue_entry_get_refs(struct nf_queue_entry *entry)
|
||||||
|
dev_hold(physdev);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
+ return true;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(nf_queue_entry_get_refs);
|
||||||
|
|
||||||
|
@@ -139,7 +152,11 @@ static int __nf_queue(struct sk_buff *skb, const struct nf_hook_state *state,
|
||||||
|
.size = sizeof(*entry) + afinfo->route_key_size,
|
||||||
|
};
|
||||||
|
|
||||||
|
- nf_queue_entry_get_refs(entry);
|
||||||
|
+ if (!nf_queue_entry_get_refs(entry)) {
|
||||||
|
+ kfree(entry);
|
||||||
|
+ return -ENOTCONN;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
skb_dst_force(skb);
|
||||||
|
afinfo->saveroute(skb, entry);
|
||||||
|
status = qh->outfn(entry, queuenum);
|
||||||
|
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
|
||||||
|
index a35510565d4d1..66814a9d030cc 100644
|
||||||
|
--- a/net/netfilter/nfnetlink_queue.c
|
||||||
|
+++ b/net/netfilter/nfnetlink_queue.c
|
||||||
|
@@ -673,9 +673,15 @@ static struct nf_queue_entry *
|
||||||
|
nf_queue_entry_dup(struct nf_queue_entry *e)
|
||||||
|
{
|
||||||
|
struct nf_queue_entry *entry = kmemdup(e, e->size, GFP_ATOMIC);
|
||||||
|
- if (entry)
|
||||||
|
- nf_queue_entry_get_refs(entry);
|
||||||
|
- return entry;
|
||||||
|
+
|
||||||
|
+ if (!entry)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ if (nf_queue_entry_get_refs(entry))
|
||||||
|
+ return entry;
|
||||||
|
+
|
||||||
|
+ kfree(entry);
|
||||||
|
+ return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
|
||||||
|
diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
|
||||||
|
index e2c200c3c1353..74968ddee49fa 100644
|
||||||
|
--- a/sound/soc/soc-ops.c
|
||||||
|
+++ b/sound/soc/soc-ops.c
|
||||||
|
@@ -328,7 +328,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
|
||||||
|
mask = BIT(sign_bit + 1) - 1;
|
||||||
|
|
||||||
|
val = ucontrol->value.integer.value[0];
|
||||||
|
- if (mc->platform_max && val > mc->platform_max)
|
||||||
|
+ if (mc->platform_max && ((int)val + min) > mc->platform_max)
|
||||||
|
return -EINVAL;
|
||||||
|
if (val > max - min)
|
||||||
|
return -EINVAL;
|
||||||
|
@@ -341,7 +341,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
|
||||||
|
val = val << shift;
|
||||||
|
if (snd_soc_volsw_is_stereo(mc)) {
|
||||||
|
val2 = ucontrol->value.integer.value[1];
|
||||||
|
- if (mc->platform_max && val2 > mc->platform_max)
|
||||||
|
+ if (mc->platform_max && ((int)val2 + min) > mc->platform_max)
|
||||||
|
return -EINVAL;
|
||||||
|
if (val2 > max - min)
|
||||||
|
return -EINVAL;
|
||||||
1693
patch/kernel/archive/sun50iw9-4.9/patch-4.9.305-306.patch
Normal file
1693
patch/kernel/archive/sun50iw9-4.9/patch-4.9.305-306.patch
Normal file
File diff suppressed because it is too large
Load Diff
442
patch/kernel/archive/sun50iw9-4.9/patch-4.9.306-307.patch
Normal file
442
patch/kernel/archive/sun50iw9-4.9/patch-4.9.306-307.patch
Normal file
@@ -0,0 +1,442 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 482b841188572..19363e65ef226 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 306
|
||||||
|
+SUBLEVEL = 307
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arm/include/asm/spectre.h b/arch/arm/include/asm/spectre.h
|
||||||
|
index d1fa5607d3aa3..85f9e538fb325 100644
|
||||||
|
--- a/arch/arm/include/asm/spectre.h
|
||||||
|
+++ b/arch/arm/include/asm/spectre.h
|
||||||
|
@@ -25,7 +25,13 @@ enum {
|
||||||
|
SPECTRE_V2_METHOD_LOOP8 = BIT(__SPECTRE_V2_METHOD_LOOP8),
|
||||||
|
};
|
||||||
|
|
||||||
|
+#ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
|
||||||
|
void spectre_v2_update_state(unsigned int state, unsigned int methods);
|
||||||
|
+#else
|
||||||
|
+static inline void spectre_v2_update_state(unsigned int state,
|
||||||
|
+ unsigned int methods)
|
||||||
|
+{}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
int spectre_bhb_update_vectors(unsigned int method);
|
||||||
|
|
||||||
|
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
|
||||||
|
index 1040efcb98db6..77ec669fd5ee1 100644
|
||||||
|
--- a/arch/arm/kernel/entry-armv.S
|
||||||
|
+++ b/arch/arm/kernel/entry-armv.S
|
||||||
|
@@ -1074,9 +1074,9 @@ vector_bhb_loop8_\name:
|
||||||
|
|
||||||
|
@ bhb workaround
|
||||||
|
mov r0, #8
|
||||||
|
-1: b . + 4
|
||||||
|
+3: b . + 4
|
||||||
|
subs r0, r0, #1
|
||||||
|
- bne 1b
|
||||||
|
+ bne 3b
|
||||||
|
dsb
|
||||||
|
isb
|
||||||
|
b 2b
|
||||||
|
diff --git a/drivers/gpio/gpio-ts4900.c b/drivers/gpio/gpio-ts4900.c
|
||||||
|
index 5bd21725e6043..930a6098b7589 100644
|
||||||
|
--- a/drivers/gpio/gpio-ts4900.c
|
||||||
|
+++ b/drivers/gpio/gpio-ts4900.c
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
/*
|
||||||
|
* Digital I/O driver for Technologic Systems I2C FPGA Core
|
||||||
|
*
|
||||||
|
- * Copyright (C) 2015 Technologic Systems
|
||||||
|
+ * Copyright (C) 2015, 2018 Technologic Systems
|
||||||
|
* Copyright (C) 2016 Savoir-Faire Linux
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@@ -52,19 +52,33 @@ static int ts4900_gpio_direction_input(struct gpio_chip *chip,
|
||||||
|
{
|
||||||
|
struct ts4900_gpio_priv *priv = gpiochip_get_data(chip);
|
||||||
|
|
||||||
|
- /*
|
||||||
|
- * This will clear the output enable bit, the other bits are
|
||||||
|
- * dontcare when this is cleared
|
||||||
|
+ /* Only clear the OE bit here, requires a RMW. Prevents potential issue
|
||||||
|
+ * with OE and data getting to the physical pin at different times.
|
||||||
|
*/
|
||||||
|
- return regmap_write(priv->regmap, offset, 0);
|
||||||
|
+ return regmap_update_bits(priv->regmap, offset, TS4900_GPIO_OE, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ts4900_gpio_direction_output(struct gpio_chip *chip,
|
||||||
|
unsigned int offset, int value)
|
||||||
|
{
|
||||||
|
struct ts4900_gpio_priv *priv = gpiochip_get_data(chip);
|
||||||
|
+ unsigned int reg;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
+ /* If changing from an input to an output, we need to first set the
|
||||||
|
+ * proper data bit to what is requested and then set OE bit. This
|
||||||
|
+ * prevents a glitch that can occur on the IO line
|
||||||
|
+ */
|
||||||
|
+ regmap_read(priv->regmap, offset, ®);
|
||||||
|
+ if (!(reg & TS4900_GPIO_OE)) {
|
||||||
|
+ if (value)
|
||||||
|
+ reg = TS4900_GPIO_OUT;
|
||||||
|
+ else
|
||||||
|
+ reg &= ~TS4900_GPIO_OUT;
|
||||||
|
+
|
||||||
|
+ regmap_write(priv->regmap, offset, reg);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (value)
|
||||||
|
ret = regmap_write(priv->regmap, offset, TS4900_GPIO_OE |
|
||||||
|
TS4900_GPIO_OUT);
|
||||||
|
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
|
||||||
|
index ad7b9772a4b27..78f34e87212ac 100644
|
||||||
|
--- a/drivers/net/ethernet/nxp/lpc_eth.c
|
||||||
|
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
|
||||||
|
@@ -1515,6 +1515,7 @@ static int lpc_eth_drv_resume(struct platform_device *pdev)
|
||||||
|
{
|
||||||
|
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||||
|
struct netdata_local *pldat;
|
||||||
|
+ int ret;
|
||||||
|
|
||||||
|
if (device_may_wakeup(&pdev->dev))
|
||||||
|
disable_irq_wake(ndev->irq);
|
||||||
|
@@ -1524,7 +1525,9 @@ static int lpc_eth_drv_resume(struct platform_device *pdev)
|
||||||
|
pldat = netdev_priv(ndev);
|
||||||
|
|
||||||
|
/* Enable interface clock */
|
||||||
|
- clk_enable(pldat->clk);
|
||||||
|
+ ret = clk_enable(pldat->clk);
|
||||||
|
+ if (ret)
|
||||||
|
+ return ret;
|
||||||
|
|
||||||
|
/* Reset and initialize */
|
||||||
|
__lpc_eth_reset(pldat);
|
||||||
|
diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
|
||||||
|
index 6379bfedc9f00..9a7ba55b46933 100644
|
||||||
|
--- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c
|
||||||
|
+++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
|
||||||
|
@@ -2899,11 +2899,11 @@ int qed_iov_mark_vf_flr(struct qed_hwfn *p_hwfn, u32 *p_disabled_vfs)
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static void qed_iov_get_link(struct qed_hwfn *p_hwfn,
|
||||||
|
- u16 vfid,
|
||||||
|
- struct qed_mcp_link_params *p_params,
|
||||||
|
- struct qed_mcp_link_state *p_link,
|
||||||
|
- struct qed_mcp_link_capabilities *p_caps)
|
||||||
|
+static int qed_iov_get_link(struct qed_hwfn *p_hwfn,
|
||||||
|
+ u16 vfid,
|
||||||
|
+ struct qed_mcp_link_params *p_params,
|
||||||
|
+ struct qed_mcp_link_state *p_link,
|
||||||
|
+ struct qed_mcp_link_capabilities *p_caps)
|
||||||
|
{
|
||||||
|
struct qed_vf_info *p_vf = qed_iov_get_vf_info(p_hwfn,
|
||||||
|
vfid,
|
||||||
|
@@ -2911,7 +2911,7 @@ static void qed_iov_get_link(struct qed_hwfn *p_hwfn,
|
||||||
|
struct qed_bulletin_content *p_bulletin;
|
||||||
|
|
||||||
|
if (!p_vf)
|
||||||
|
- return;
|
||||||
|
+ return -EINVAL;
|
||||||
|
|
||||||
|
p_bulletin = p_vf->bulletin.p_virt;
|
||||||
|
|
||||||
|
@@ -2921,6 +2921,7 @@ static void qed_iov_get_link(struct qed_hwfn *p_hwfn,
|
||||||
|
__qed_vf_get_link_state(p_hwfn, p_link, p_bulletin);
|
||||||
|
if (p_caps)
|
||||||
|
__qed_vf_get_link_caps(p_hwfn, p_caps, p_bulletin);
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void qed_iov_process_mbx_req(struct qed_hwfn *p_hwfn,
|
||||||
|
@@ -3538,6 +3539,7 @@ static int qed_get_vf_config(struct qed_dev *cdev,
|
||||||
|
struct qed_public_vf_info *vf_info;
|
||||||
|
struct qed_mcp_link_state link;
|
||||||
|
u32 tx_rate;
|
||||||
|
+ int ret;
|
||||||
|
|
||||||
|
/* Sanitize request */
|
||||||
|
if (IS_VF(cdev))
|
||||||
|
@@ -3551,7 +3553,9 @@ static int qed_get_vf_config(struct qed_dev *cdev,
|
||||||
|
|
||||||
|
vf_info = qed_iov_get_public_vf_info(hwfn, vf_id, true);
|
||||||
|
|
||||||
|
- qed_iov_get_link(hwfn, vf_id, NULL, &link, NULL);
|
||||||
|
+ ret = qed_iov_get_link(hwfn, vf_id, NULL, &link, NULL);
|
||||||
|
+ if (ret)
|
||||||
|
+ return ret;
|
||||||
|
|
||||||
|
/* Fill information about VF */
|
||||||
|
ivi->vf = vf_id;
|
||||||
|
diff --git a/drivers/net/ethernet/qlogic/qed/qed_vf.c b/drivers/net/ethernet/qlogic/qed/qed_vf.c
|
||||||
|
index 170243d3276b9..d0449d5418f7e 100644
|
||||||
|
--- a/drivers/net/ethernet/qlogic/qed/qed_vf.c
|
||||||
|
+++ b/drivers/net/ethernet/qlogic/qed/qed_vf.c
|
||||||
|
@@ -384,6 +384,9 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn)
|
||||||
|
p_iov->bulletin.size,
|
||||||
|
&p_iov->bulletin.phys,
|
||||||
|
GFP_KERNEL);
|
||||||
|
+ if (!p_iov->bulletin.p_virt)
|
||||||
|
+ goto free_pf2vf_reply;
|
||||||
|
+
|
||||||
|
DP_VERBOSE(p_hwfn, QED_MSG_IOV,
|
||||||
|
"VF's bulletin Board [%p virt 0x%llx phys 0x%08x bytes]\n",
|
||||||
|
p_iov->bulletin.p_virt,
|
||||||
|
@@ -397,6 +400,10 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn)
|
||||||
|
|
||||||
|
return qed_vf_pf_acquire(p_hwfn);
|
||||||
|
|
||||||
|
+free_pf2vf_reply:
|
||||||
|
+ dma_free_coherent(&p_hwfn->cdev->pdev->dev,
|
||||||
|
+ sizeof(union pfvf_tlvs),
|
||||||
|
+ p_iov->pf2vf_reply, p_iov->pf2vf_reply_phys);
|
||||||
|
free_vf2pf_request:
|
||||||
|
dma_free_coherent(&p_hwfn->cdev->pdev->dev,
|
||||||
|
sizeof(union vfpf_tlvs),
|
||||||
|
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
|
||||||
|
index df3b3384984ce..1f9a6ea356b02 100644
|
||||||
|
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
|
||||||
|
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
|
||||||
|
@@ -1175,7 +1175,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
|
||||||
|
if (rc) {
|
||||||
|
dev_err(dev,
|
||||||
|
"Cannot register network device, aborting\n");
|
||||||
|
- goto error;
|
||||||
|
+ goto put_node;
|
||||||
|
}
|
||||||
|
|
||||||
|
dev_info(dev,
|
||||||
|
@@ -1183,6 +1183,8 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
|
||||||
|
(unsigned int __force)ndev->mem_start, lp->base_addr, ndev->irq);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
+put_node:
|
||||||
|
+ of_node_put(lp->phy_node);
|
||||||
|
error:
|
||||||
|
xemaclite_remove_ndev(ndev);
|
||||||
|
return rc;
|
||||||
|
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
|
||||||
|
index e6646c8a7bdbb..78788402edd8b 100644
|
||||||
|
--- a/drivers/net/xen-netback/xenbus.c
|
||||||
|
+++ b/drivers/net/xen-netback/xenbus.c
|
||||||
|
@@ -1040,15 +1040,11 @@ static void connect(struct backend_info *be)
|
||||||
|
xenvif_carrier_on(be->vif);
|
||||||
|
|
||||||
|
unregister_hotplug_status_watch(be);
|
||||||
|
- if (xenbus_exists(XBT_NIL, dev->nodename, "hotplug-status")) {
|
||||||
|
- err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
|
||||||
|
- NULL, hotplug_status_changed,
|
||||||
|
- "%s/%s", dev->nodename,
|
||||||
|
- "hotplug-status");
|
||||||
|
- if (err)
|
||||||
|
- goto err;
|
||||||
|
+ err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, NULL,
|
||||||
|
+ hotplug_status_changed,
|
||||||
|
+ "%s/%s", dev->nodename, "hotplug-status");
|
||||||
|
+ if (!err)
|
||||||
|
be->have_hotplug_status_watch = 1;
|
||||||
|
- }
|
||||||
|
|
||||||
|
netif_tx_wake_all_queues(be->vif->dev);
|
||||||
|
|
||||||
|
diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c
|
||||||
|
index ed65993aae96a..838ec17073fd1 100644
|
||||||
|
--- a/drivers/nfc/port100.c
|
||||||
|
+++ b/drivers/nfc/port100.c
|
||||||
|
@@ -1617,7 +1617,9 @@ free_nfc_dev:
|
||||||
|
nfc_digital_free_device(dev->nfc_digital_dev);
|
||||||
|
|
||||||
|
error:
|
||||||
|
+ usb_kill_urb(dev->in_urb);
|
||||||
|
usb_free_urb(dev->in_urb);
|
||||||
|
+ usb_kill_urb(dev->out_urb);
|
||||||
|
usb_free_urb(dev->out_urb);
|
||||||
|
usb_put_dev(dev->udev);
|
||||||
|
|
||||||
|
diff --git a/drivers/staging/gdm724x/gdm_lte.c b/drivers/staging/gdm724x/gdm_lte.c
|
||||||
|
index 454e47424adea..463f920d37825 100644
|
||||||
|
--- a/drivers/staging/gdm724x/gdm_lte.c
|
||||||
|
+++ b/drivers/staging/gdm724x/gdm_lte.c
|
||||||
|
@@ -85,14 +85,15 @@ static void tx_complete(void *arg)
|
||||||
|
|
||||||
|
static int gdm_lte_rx(struct sk_buff *skb, struct nic *nic, int nic_type)
|
||||||
|
{
|
||||||
|
- int ret;
|
||||||
|
+ int ret, len;
|
||||||
|
|
||||||
|
+ len = skb->len + ETH_HLEN;
|
||||||
|
ret = netif_rx_ni(skb);
|
||||||
|
if (ret == NET_RX_DROP) {
|
||||||
|
nic->stats.rx_dropped++;
|
||||||
|
} else {
|
||||||
|
nic->stats.rx_packets++;
|
||||||
|
- nic->stats.rx_bytes += skb->len + ETH_HLEN;
|
||||||
|
+ nic->stats.rx_bytes += len;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
|
||||||
|
index b5bff1e760a34..8ded1d8941008 100644
|
||||||
|
--- a/fs/btrfs/extent-tree.c
|
||||||
|
+++ b/fs/btrfs/extent-tree.c
|
||||||
|
@@ -8457,6 +8457,7 @@ struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans,
|
||||||
|
out_free_delayed:
|
||||||
|
btrfs_free_delayed_extent_op(extent_op);
|
||||||
|
out_free_buf:
|
||||||
|
+ btrfs_tree_unlock(buf);
|
||||||
|
free_extent_buffer(buf);
|
||||||
|
out_free_reserved:
|
||||||
|
btrfs_free_reserved_extent(root, ins.objectid, ins.offset, 0);
|
||||||
|
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
|
||||||
|
index 6dd276227217e..5747174e03266 100644
|
||||||
|
--- a/include/linux/mlx5/mlx5_ifc.h
|
||||||
|
+++ b/include/linux/mlx5/mlx5_ifc.h
|
||||||
|
@@ -7327,8 +7327,8 @@ struct mlx5_ifc_bufferx_reg_bits {
|
||||||
|
u8 reserved_at_0[0x6];
|
||||||
|
u8 lossy[0x1];
|
||||||
|
u8 epsb[0x1];
|
||||||
|
- u8 reserved_at_8[0xc];
|
||||||
|
- u8 size[0xc];
|
||||||
|
+ u8 reserved_at_8[0x8];
|
||||||
|
+ u8 size[0x10];
|
||||||
|
|
||||||
|
u8 xoff_threshold[0x10];
|
||||||
|
u8 xon_threshold[0x10];
|
||||||
|
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
|
||||||
|
index 12bee7043be6f..90e0fd5621da9 100644
|
||||||
|
--- a/kernel/trace/trace.c
|
||||||
|
+++ b/kernel/trace/trace.c
|
||||||
|
@@ -1077,10 +1077,12 @@ static int __init set_buf_size(char *str)
|
||||||
|
if (!str)
|
||||||
|
return 0;
|
||||||
|
buf_size = memparse(str, &str);
|
||||||
|
- /* nr_entries can not be zero */
|
||||||
|
- if (buf_size == 0)
|
||||||
|
- return 0;
|
||||||
|
- trace_buf_size = buf_size;
|
||||||
|
+ /*
|
||||||
|
+ * nr_entries can not be zero and the startup
|
||||||
|
+ * tests require some buffer space. Therefore
|
||||||
|
+ * ensure we have at least 4096 bytes of buffer.
|
||||||
|
+ */
|
||||||
|
+ trace_buf_size = max(4096UL, buf_size);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
__setup("trace_buf_size=", set_buf_size);
|
||||||
|
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
|
||||||
|
index c4ef1be59cb19..839c4237d1313 100644
|
||||||
|
--- a/net/ax25/af_ax25.c
|
||||||
|
+++ b/net/ax25/af_ax25.c
|
||||||
|
@@ -90,6 +90,13 @@ again:
|
||||||
|
ax25_for_each(s, &ax25_list) {
|
||||||
|
if (s->ax25_dev == ax25_dev) {
|
||||||
|
sk = s->sk;
|
||||||
|
+ if (!sk) {
|
||||||
|
+ spin_unlock_bh(&ax25_list_lock);
|
||||||
|
+ s->ax25_dev = NULL;
|
||||||
|
+ ax25_disconnect(s, ENETUNREACH);
|
||||||
|
+ spin_lock_bh(&ax25_list_lock);
|
||||||
|
+ goto again;
|
||||||
|
+ }
|
||||||
|
sock_hold(sk);
|
||||||
|
spin_unlock_bh(&ax25_list_lock);
|
||||||
|
lock_sock(sk);
|
||||||
|
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
|
||||||
|
index 4f384abb4cedd..eaf0a483211ac 100644
|
||||||
|
--- a/net/batman-adv/hard-interface.c
|
||||||
|
+++ b/net/batman-adv/hard-interface.c
|
||||||
|
@@ -155,22 +155,25 @@ static bool batadv_is_on_batman_iface(const struct net_device *net_dev)
|
||||||
|
struct net *net = dev_net(net_dev);
|
||||||
|
struct net_device *parent_dev;
|
||||||
|
const struct net *parent_net;
|
||||||
|
+ int iflink;
|
||||||
|
bool ret;
|
||||||
|
|
||||||
|
/* check if this is a batman-adv mesh interface */
|
||||||
|
if (batadv_softif_is_valid(net_dev))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
- /* no more parents..stop recursion */
|
||||||
|
- if (dev_get_iflink(net_dev) == 0 ||
|
||||||
|
- dev_get_iflink(net_dev) == net_dev->ifindex)
|
||||||
|
+ iflink = dev_get_iflink(net_dev);
|
||||||
|
+ if (iflink == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
parent_net = batadv_getlink_net(net_dev, net);
|
||||||
|
|
||||||
|
+ /* iflink to itself, most likely physical device */
|
||||||
|
+ if (net == parent_net && iflink == net_dev->ifindex)
|
||||||
|
+ return false;
|
||||||
|
+
|
||||||
|
/* recurse over the parent device */
|
||||||
|
- parent_dev = __dev_get_by_index((struct net *)parent_net,
|
||||||
|
- dev_get_iflink(net_dev));
|
||||||
|
+ parent_dev = __dev_get_by_index((struct net *)parent_net, iflink);
|
||||||
|
/* if we got a NULL parent_dev there is something broken.. */
|
||||||
|
if (!parent_dev) {
|
||||||
|
pr_err("Cannot find parent device\n");
|
||||||
|
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
|
||||||
|
index 3fb5d8ecc8499..e42df58b88766 100644
|
||||||
|
--- a/net/core/net-sysfs.c
|
||||||
|
+++ b/net/core/net-sysfs.c
|
||||||
|
@@ -198,7 +198,7 @@ static ssize_t speed_show(struct device *dev,
|
||||||
|
if (!rtnl_trylock())
|
||||||
|
return restart_syscall();
|
||||||
|
|
||||||
|
- if (netif_running(netdev)) {
|
||||||
|
+ if (netif_running(netdev) && netif_device_present(netdev)) {
|
||||||
|
struct ethtool_link_ksettings cmd;
|
||||||
|
|
||||||
|
if (!__ethtool_get_link_ksettings(netdev, &cmd))
|
||||||
|
diff --git a/net/sctp/sctp_diag.c b/net/sctp/sctp_diag.c
|
||||||
|
index e8f56b7c5afb1..a044964fa8023 100644
|
||||||
|
--- a/net/sctp/sctp_diag.c
|
||||||
|
+++ b/net/sctp/sctp_diag.c
|
||||||
|
@@ -45,10 +45,6 @@ static void inet_diag_msg_sctpasoc_fill(struct inet_diag_msg *r,
|
||||||
|
r->idiag_timer = SCTP_EVENT_TIMEOUT_T3_RTX;
|
||||||
|
r->idiag_retrans = asoc->rtx_data_chunks;
|
||||||
|
r->idiag_expires = jiffies_to_msecs(t3_rtx->expires - jiffies);
|
||||||
|
- } else {
|
||||||
|
- r->idiag_timer = 0;
|
||||||
|
- r->idiag_retrans = 0;
|
||||||
|
- r->idiag_expires = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -128,13 +124,14 @@ static int inet_sctp_diag_fill(struct sock *sk, struct sctp_association *asoc,
|
||||||
|
r = nlmsg_data(nlh);
|
||||||
|
BUG_ON(!sk_fullsock(sk));
|
||||||
|
|
||||||
|
+ r->idiag_timer = 0;
|
||||||
|
+ r->idiag_retrans = 0;
|
||||||
|
+ r->idiag_expires = 0;
|
||||||
|
if (asoc) {
|
||||||
|
inet_diag_msg_sctpasoc_fill(r, sk, asoc);
|
||||||
|
} else {
|
||||||
|
inet_diag_msg_common_fill(r, sk);
|
||||||
|
r->idiag_state = sk->sk_state;
|
||||||
|
- r->idiag_timer = 0;
|
||||||
|
- r->idiag_retrans = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inet_diag_msg_attrs_fill(sk, skb, r, ext, user_ns, net_admin))
|
||||||
|
diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c
|
||||||
|
index 26546892cd545..faab09215c88b 100644
|
||||||
|
--- a/tools/testing/selftests/memfd/memfd_test.c
|
||||||
|
+++ b/tools/testing/selftests/memfd/memfd_test.c
|
||||||
|
@@ -373,6 +373,7 @@ static void mfd_fail_write(int fd)
|
||||||
|
printf("mmap()+mprotect() didn't fail as expected\n");
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
+ munmap(p, mfd_def_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* verify PUNCH_HOLE fails */
|
||||||
314
patch/kernel/archive/sun50iw9-4.9/patch-4.9.307-308.patch
Normal file
314
patch/kernel/archive/sun50iw9-4.9/patch-4.9.307-308.patch
Normal file
@@ -0,0 +1,314 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 19363e65ef226..ecf06e17c3c88 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 307
|
||||||
|
+SUBLEVEL = 308
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
|
||||||
|
index 7b727d738b69d..4702aa980ef8d 100644
|
||||||
|
--- a/arch/arm/boot/dts/rk3288.dtsi
|
||||||
|
+++ b/arch/arm/boot/dts/rk3288.dtsi
|
||||||
|
@@ -918,7 +918,7 @@
|
||||||
|
status = "disabled";
|
||||||
|
};
|
||||||
|
|
||||||
|
- crypto: cypto-controller@ff8a0000 {
|
||||||
|
+ crypto: crypto@ff8a0000 {
|
||||||
|
compatible = "rockchip,rk3288-crypto";
|
||||||
|
reg = <0xff8a0000 0x4000>;
|
||||||
|
interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
|
||||||
|
index 95ba4271af6a8..01aa8d6da4b95 100644
|
||||||
|
--- a/arch/mips/kernel/smp.c
|
||||||
|
+++ b/arch/mips/kernel/smp.c
|
||||||
|
@@ -369,6 +369,9 @@ asmlinkage void start_secondary(void)
|
||||||
|
cpu = smp_processor_id();
|
||||||
|
cpu_data[cpu].udelay_val = loops_per_jiffy;
|
||||||
|
|
||||||
|
+ set_cpu_sibling_map(cpu);
|
||||||
|
+ set_cpu_core_map(cpu);
|
||||||
|
+
|
||||||
|
cpumask_set_cpu(cpu, &cpu_coherent_mask);
|
||||||
|
notify_cpu_starting(cpu);
|
||||||
|
|
||||||
|
@@ -380,9 +383,6 @@ asmlinkage void start_secondary(void)
|
||||||
|
/* The CPU is running and counters synchronised, now mark it online */
|
||||||
|
set_cpu_online(cpu, true);
|
||||||
|
|
||||||
|
- set_cpu_sibling_map(cpu);
|
||||||
|
- set_cpu_core_map(cpu);
|
||||||
|
-
|
||||||
|
calculate_cpu_foreign_map();
|
||||||
|
|
||||||
|
/*
|
||||||
|
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
|
||||||
|
index 2b7786cd548f8..0ec52fb2b7fcf 100644
|
||||||
|
--- a/drivers/atm/eni.c
|
||||||
|
+++ b/drivers/atm/eni.c
|
||||||
|
@@ -1114,6 +1114,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags);
|
||||||
|
}
|
||||||
|
paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len,
|
||||||
|
DMA_TO_DEVICE);
|
||||||
|
+ if (dma_mapping_error(&eni_dev->pci_dev->dev, paddr))
|
||||||
|
+ return enq_next;
|
||||||
|
ENI_PRV_PADDR(skb) = paddr;
|
||||||
|
/* prepare DMA queue entries */
|
||||||
|
j = 0;
|
||||||
|
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
|
||||||
|
index 7cb2b863e653e..7d74b7e1a8370 100644
|
||||||
|
--- a/drivers/atm/firestream.c
|
||||||
|
+++ b/drivers/atm/firestream.c
|
||||||
|
@@ -1692,6 +1692,8 @@ static int fs_init(struct fs_dev *dev)
|
||||||
|
dev->hw_base = pci_resource_start(pci_dev, 0);
|
||||||
|
|
||||||
|
dev->base = ioremap(dev->hw_base, 0x1000);
|
||||||
|
+ if (!dev->base)
|
||||||
|
+ return 1;
|
||||||
|
|
||||||
|
reset_chip (dev);
|
||||||
|
|
||||||
|
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
|
||||||
|
index 5a7e5e073e526..58c0705470be6 100644
|
||||||
|
--- a/drivers/input/tablet/aiptek.c
|
||||||
|
+++ b/drivers/input/tablet/aiptek.c
|
||||||
|
@@ -1821,15 +1821,13 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||||
|
input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0);
|
||||||
|
input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0);
|
||||||
|
|
||||||
|
- /* Verify that a device really has an endpoint */
|
||||||
|
- if (intf->cur_altsetting->desc.bNumEndpoints < 1) {
|
||||||
|
+ err = usb_find_common_endpoints(intf->cur_altsetting,
|
||||||
|
+ NULL, NULL, &endpoint, NULL);
|
||||||
|
+ if (err) {
|
||||||
|
dev_err(&intf->dev,
|
||||||
|
- "interface has %d endpoints, but must have minimum 1\n",
|
||||||
|
- intf->cur_altsetting->desc.bNumEndpoints);
|
||||||
|
- err = -EINVAL;
|
||||||
|
+ "interface has no int in endpoints, but must have minimum 1\n");
|
||||||
|
goto fail3;
|
||||||
|
}
|
||||||
|
- endpoint = &intf->cur_altsetting->endpoint[0].desc;
|
||||||
|
|
||||||
|
/* Go set up our URB, which is called when the tablet receives
|
||||||
|
* input.
|
||||||
|
diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
|
||||||
|
index 43cdd5544b0c4..a127c853a4e90 100644
|
||||||
|
--- a/drivers/net/can/rcar/rcar_canfd.c
|
||||||
|
+++ b/drivers/net/can/rcar/rcar_canfd.c
|
||||||
|
@@ -1601,15 +1601,15 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
|
||||||
|
|
||||||
|
netif_napi_add(ndev, &priv->napi, rcar_canfd_rx_poll,
|
||||||
|
RCANFD_NAPI_WEIGHT);
|
||||||
|
+ spin_lock_init(&priv->tx_lock);
|
||||||
|
+ devm_can_led_init(ndev);
|
||||||
|
+ gpriv->ch[priv->channel] = priv;
|
||||||
|
err = register_candev(ndev);
|
||||||
|
if (err) {
|
||||||
|
dev_err(&pdev->dev,
|
||||||
|
"register_candev() failed, error %d\n", err);
|
||||||
|
goto fail_candev;
|
||||||
|
}
|
||||||
|
- spin_lock_init(&priv->tx_lock);
|
||||||
|
- devm_can_led_init(ndev);
|
||||||
|
- gpriv->ch[priv->channel] = priv;
|
||||||
|
dev_info(&pdev->dev, "device registered (channel %u)\n", priv->channel);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
|
||||||
|
index 241520943adae..221798499e24b 100644
|
||||||
|
--- a/drivers/net/ethernet/sfc/mcdi.c
|
||||||
|
+++ b/drivers/net/ethernet/sfc/mcdi.c
|
||||||
|
@@ -162,9 +162,9 @@ static void efx_mcdi_send_request(struct efx_nic *efx, unsigned cmd,
|
||||||
|
/* Serialise with efx_mcdi_ev_cpl() and efx_mcdi_ev_death() */
|
||||||
|
spin_lock_bh(&mcdi->iface_lock);
|
||||||
|
++mcdi->seqno;
|
||||||
|
+ seqno = mcdi->seqno & SEQ_MASK;
|
||||||
|
spin_unlock_bh(&mcdi->iface_lock);
|
||||||
|
|
||||||
|
- seqno = mcdi->seqno & SEQ_MASK;
|
||||||
|
xflags = 0;
|
||||||
|
if (mcdi->mode == MCDI_MODE_EVENTS)
|
||||||
|
xflags |= MCDI_HEADER_XFLAGS_EVREQ;
|
||||||
|
diff --git a/drivers/usb/gadget/function/rndis.c b/drivers/usb/gadget/function/rndis.c
|
||||||
|
index 1e5c2cbe99947..30eeaf9bc8eca 100644
|
||||||
|
--- a/drivers/usb/gadget/function/rndis.c
|
||||||
|
+++ b/drivers/usb/gadget/function/rndis.c
|
||||||
|
@@ -645,6 +645,7 @@ static int rndis_set_response(struct rndis_params *params,
|
||||||
|
BufLength = le32_to_cpu(buf->InformationBufferLength);
|
||||||
|
BufOffset = le32_to_cpu(buf->InformationBufferOffset);
|
||||||
|
if ((BufLength > RNDIS_MAX_TOTAL_SIZE) ||
|
||||||
|
+ (BufOffset > RNDIS_MAX_TOTAL_SIZE) ||
|
||||||
|
(BufOffset + 8 >= RNDIS_MAX_TOTAL_SIZE))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
|
||||||
|
index 34ad964d54d11..5d8c3fd2acc89 100644
|
||||||
|
--- a/drivers/usb/gadget/udc/core.c
|
||||||
|
+++ b/drivers/usb/gadget/udc/core.c
|
||||||
|
@@ -1253,7 +1253,6 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
|
||||||
|
usb_gadget_udc_stop(udc);
|
||||||
|
|
||||||
|
udc->driver = NULL;
|
||||||
|
- udc->dev.driver = NULL;
|
||||||
|
udc->gadget->dev.driver = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1301,7 +1300,6 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri
|
||||||
|
driver->function);
|
||||||
|
|
||||||
|
udc->driver = driver;
|
||||||
|
- udc->dev.driver = &driver->driver;
|
||||||
|
udc->gadget->dev.driver = &driver->driver;
|
||||||
|
|
||||||
|
ret = driver->bind(udc->gadget, driver);
|
||||||
|
@@ -1321,7 +1319,6 @@ err1:
|
||||||
|
dev_err(&udc->dev, "failed to start %s: %d\n",
|
||||||
|
udc->driver->function, ret);
|
||||||
|
udc->driver = NULL;
|
||||||
|
- udc->dev.driver = NULL;
|
||||||
|
udc->gadget->dev.driver = NULL;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
|
||||||
|
index 300cdbdc8494e..c41e7f51150fc 100644
|
||||||
|
--- a/fs/sysfs/file.c
|
||||||
|
+++ b/fs/sysfs/file.c
|
||||||
|
@@ -565,8 +565,7 @@ int sysfs_emit(char *buf, const char *fmt, ...)
|
||||||
|
va_list args;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
- if (WARN(!buf || offset_in_page(buf),
|
||||||
|
- "invalid sysfs_emit: buf:%p\n", buf))
|
||||||
|
+ if (WARN(!buf, "invalid sysfs_emit: buf:%p\n", buf))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
va_start(args, fmt);
|
||||||
|
diff --git a/lib/Kconfig b/lib/Kconfig
|
||||||
|
index 260a80e313b90..600759707ffe1 100644
|
||||||
|
--- a/lib/Kconfig
|
||||||
|
+++ b/lib/Kconfig
|
||||||
|
@@ -16,7 +16,6 @@ config BITREVERSE
|
||||||
|
config HAVE_ARCH_BITREVERSE
|
||||||
|
bool
|
||||||
|
default n
|
||||||
|
- depends on BITREVERSE
|
||||||
|
help
|
||||||
|
This option enables the use of hardware bit-reversal instructions on
|
||||||
|
architectures which support such operations.
|
||||||
|
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
|
||||||
|
index aeda018e4c49e..6dfb964e1ad8f 100644
|
||||||
|
--- a/net/ipv4/tcp.c
|
||||||
|
+++ b/net/ipv4/tcp.c
|
||||||
|
@@ -1561,11 +1561,13 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
|
||||||
|
if (!copied)
|
||||||
|
copied = used;
|
||||||
|
break;
|
||||||
|
- } else if (used <= len) {
|
||||||
|
- seq += used;
|
||||||
|
- copied += used;
|
||||||
|
- offset += used;
|
||||||
|
}
|
||||||
|
+ if (WARN_ON_ONCE(used > len))
|
||||||
|
+ used = len;
|
||||||
|
+ seq += used;
|
||||||
|
+ copied += used;
|
||||||
|
+ offset += used;
|
||||||
|
+
|
||||||
|
/* If recv_actor drops the lock (e.g. TCP splice
|
||||||
|
* receive) the skb pointer might be invalid when
|
||||||
|
* getting here: tcp_collapse might have deleted it
|
||||||
|
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
|
||||||
|
index 8e62b05efe297..e79d6881a97eb 100644
|
||||||
|
--- a/net/packet/af_packet.c
|
||||||
|
+++ b/net/packet/af_packet.c
|
||||||
|
@@ -2244,8 +2244,11 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||||
|
copy_skb = skb_get(skb);
|
||||||
|
skb_head = skb->data;
|
||||||
|
}
|
||||||
|
- if (copy_skb)
|
||||||
|
+ if (copy_skb) {
|
||||||
|
+ memset(&PACKET_SKB_CB(copy_skb)->sa.ll, 0,
|
||||||
|
+ sizeof(PACKET_SKB_CB(copy_skb)->sa.ll));
|
||||||
|
skb_set_owner_r(copy_skb, sk);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
snaplen = po->rx_ring.frame_size - macoff;
|
||||||
|
if ((int)snaplen < 0) {
|
||||||
|
@@ -3422,6 +3425,8 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
|
||||||
|
sock_recv_ts_and_drops(msg, sk, skb);
|
||||||
|
|
||||||
|
if (msg->msg_name) {
|
||||||
|
+ const size_t max_len = min(sizeof(skb->cb),
|
||||||
|
+ sizeof(struct sockaddr_storage));
|
||||||
|
int copy_len;
|
||||||
|
|
||||||
|
/* If the address length field is there to be filled
|
||||||
|
@@ -3444,6 +3449,10 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
|
||||||
|
msg->msg_namelen = sizeof(struct sockaddr_ll);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ if (WARN_ON_ONCE(copy_len > max_len)) {
|
||||||
|
+ copy_len = max_len;
|
||||||
|
+ msg->msg_namelen = copy_len;
|
||||||
|
+ }
|
||||||
|
memcpy(msg->msg_name, &PACKET_SKB_CB(skb)->sa, copy_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
|
||||||
|
index ab8bca39afa3f..562e138deba28 100644
|
||||||
|
--- a/net/wireless/nl80211.c
|
||||||
|
+++ b/net/wireless/nl80211.c
|
||||||
|
@@ -14068,7 +14068,8 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
|
||||||
|
wdev->chandef = *chandef;
|
||||||
|
wdev->preset_chandef = *chandef;
|
||||||
|
|
||||||
|
- if (wdev->iftype == NL80211_IFTYPE_STATION &&
|
||||||
|
+ if ((wdev->iftype == NL80211_IFTYPE_STATION ||
|
||||||
|
+ wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) &&
|
||||||
|
!WARN_ON(!wdev->current_bss))
|
||||||
|
wdev->current_bss->pub.channel = chandef->chan;
|
||||||
|
|
||||||
|
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
|
||||||
|
index 4d19f2ff6e052..73b4e7c0d3368 100644
|
||||||
|
--- a/net/xfrm/xfrm_state.c
|
||||||
|
+++ b/net/xfrm/xfrm_state.c
|
||||||
|
@@ -1238,9 +1238,6 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig)
|
||||||
|
|
||||||
|
memcpy(&x->mark, &orig->mark, sizeof(x->mark));
|
||||||
|
|
||||||
|
- if (xfrm_init_state(x) < 0)
|
||||||
|
- goto error;
|
||||||
|
-
|
||||||
|
x->props.flags = orig->props.flags;
|
||||||
|
x->props.extra_flags = orig->props.extra_flags;
|
||||||
|
|
||||||
|
@@ -1317,6 +1314,11 @@ struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x,
|
||||||
|
if (!xc)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
+ xc->props.family = m->new_family;
|
||||||
|
+
|
||||||
|
+ if (xfrm_init_state(xc) < 0)
|
||||||
|
+ goto error;
|
||||||
|
+
|
||||||
|
memcpy(&xc->id.daddr, &m->new_daddr, sizeof(xc->id.daddr));
|
||||||
|
memcpy(&xc->props.saddr, &m->new_saddr, sizeof(xc->props.saddr));
|
||||||
|
|
||||||
|
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
|
||||||
|
index d77ed41b20941..1f89d3dd82953 100644
|
||||||
|
--- a/tools/testing/selftests/vm/userfaultfd.c
|
||||||
|
+++ b/tools/testing/selftests/vm/userfaultfd.c
|
||||||
|
@@ -60,6 +60,7 @@
|
||||||
|
#include <signal.h>
|
||||||
|
#include <poll.h>
|
||||||
|
#include <string.h>
|
||||||
|
+#include <linux/mman.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <sys/syscall.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
487
patch/kernel/archive/sun50iw9-4.9/patch-4.9.308-309.patch
Normal file
487
patch/kernel/archive/sun50iw9-4.9/patch-4.9.308-309.patch
Normal file
@@ -0,0 +1,487 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index ecf06e17c3c88..c1d4ddadbcb51 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 308
|
||||||
|
+SUBLEVEL = 309
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
|
||||||
|
index c3fba8b527530..28e241e635675 100644
|
||||||
|
--- a/arch/x86/kernel/acpi/boot.c
|
||||||
|
+++ b/arch/x86/kernel/acpi/boot.c
|
||||||
|
@@ -1324,6 +1324,17 @@ static int __init disable_acpi_pci(const struct dmi_system_id *d)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int __init disable_acpi_xsdt(const struct dmi_system_id *d)
|
||||||
|
+{
|
||||||
|
+ if (!acpi_force) {
|
||||||
|
+ pr_notice("%s detected: force use of acpi=rsdt\n", d->ident);
|
||||||
|
+ acpi_gbl_do_not_use_xsdt = TRUE;
|
||||||
|
+ } else {
|
||||||
|
+ pr_notice("Warning: DMI blacklist says broken, but acpi XSDT forced\n");
|
||||||
|
+ }
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int __init dmi_disable_acpi(const struct dmi_system_id *d)
|
||||||
|
{
|
||||||
|
if (!acpi_force) {
|
||||||
|
@@ -1444,6 +1455,19 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
+ /*
|
||||||
|
+ * Boxes that need ACPI XSDT use disabled due to corrupted tables
|
||||||
|
+ */
|
||||||
|
+ {
|
||||||
|
+ .callback = disable_acpi_xsdt,
|
||||||
|
+ .ident = "Advantech DAC-BJ01",
|
||||||
|
+ .matches = {
|
||||||
|
+ DMI_MATCH(DMI_SYS_VENDOR, "NEC"),
|
||||||
|
+ DMI_MATCH(DMI_PRODUCT_NAME, "Bearlake CRB Board"),
|
||||||
|
+ DMI_MATCH(DMI_BIOS_VERSION, "V1.12"),
|
||||||
|
+ DMI_MATCH(DMI_BIOS_DATE, "02/01/2011"),
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
|
||||||
|
index 69c6f02f16b5b..ee300bbe88310 100644
|
||||||
|
--- a/drivers/acpi/battery.c
|
||||||
|
+++ b/drivers/acpi/battery.c
|
||||||
|
@@ -88,6 +88,10 @@ enum acpi_battery_files {
|
||||||
|
|
||||||
|
static const struct acpi_device_id battery_device_ids[] = {
|
||||||
|
{"PNP0C0A", 0},
|
||||||
|
+
|
||||||
|
+ /* Microsoft Surface Go 3 */
|
||||||
|
+ {"MSHW0146", 0},
|
||||||
|
+
|
||||||
|
{"", 0},
|
||||||
|
};
|
||||||
|
|
||||||
|
@@ -1153,6 +1157,14 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-573G"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
+ {
|
||||||
|
+ /* Microsoft Surface Go 3 */
|
||||||
|
+ .callback = battery_notification_delay_quirk,
|
||||||
|
+ .matches = {
|
||||||
|
+ DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
|
||||||
|
+ DMI_MATCH(DMI_PRODUCT_NAME, "Surface Go 3"),
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
{},
|
||||||
|
};
|
||||||
|
|
||||||
|
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
|
||||||
|
index ec2f77a471501..2837b2f982135 100644
|
||||||
|
--- a/drivers/acpi/video_detect.c
|
||||||
|
+++ b/drivers/acpi/video_detect.c
|
||||||
|
@@ -135,6 +135,81 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
+ /*
|
||||||
|
+ * Clevo NL5xRU and NL5xNU/TUXEDO Aura 15 Gen1 and Gen2 have both a
|
||||||
|
+ * working native and video interface. However the default detection
|
||||||
|
+ * mechanism first registers the video interface before unregistering
|
||||||
|
+ * it again and switching to the native interface during boot. This
|
||||||
|
+ * results in a dangling SBIOS request for backlight change for some
|
||||||
|
+ * reason, causing the backlight to switch to ~2% once per boot on the
|
||||||
|
+ * first power cord connect or disconnect event. Setting the native
|
||||||
|
+ * interface explicitly circumvents this buggy behaviour, by avoiding
|
||||||
|
+ * the unregistering process.
|
||||||
|
+ */
|
||||||
|
+ {
|
||||||
|
+ .callback = video_detect_force_native,
|
||||||
|
+ .ident = "Clevo NL5xRU",
|
||||||
|
+ .matches = {
|
||||||
|
+ DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
|
||||||
|
+ DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
+ .callback = video_detect_force_native,
|
||||||
|
+ .ident = "Clevo NL5xRU",
|
||||||
|
+ .matches = {
|
||||||
|
+ DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"),
|
||||||
|
+ DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
+ .callback = video_detect_force_native,
|
||||||
|
+ .ident = "Clevo NL5xRU",
|
||||||
|
+ .matches = {
|
||||||
|
+ DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
|
||||||
|
+ DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
+ .callback = video_detect_force_native,
|
||||||
|
+ .ident = "Clevo NL5xRU",
|
||||||
|
+ .matches = {
|
||||||
|
+ DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
|
||||||
|
+ DMI_MATCH(DMI_BOARD_NAME, "AURA1501"),
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
+ .callback = video_detect_force_native,
|
||||||
|
+ .ident = "Clevo NL5xRU",
|
||||||
|
+ .matches = {
|
||||||
|
+ DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
|
||||||
|
+ DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"),
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
+ .callback = video_detect_force_native,
|
||||||
|
+ .ident = "Clevo NL5xNU",
|
||||||
|
+ .matches = {
|
||||||
|
+ DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
|
||||||
|
+ DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"),
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
+ .callback = video_detect_force_native,
|
||||||
|
+ .ident = "Clevo NL5xNU",
|
||||||
|
+ .matches = {
|
||||||
|
+ DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"),
|
||||||
|
+ DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"),
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
+ {
|
||||||
|
+ .callback = video_detect_force_native,
|
||||||
|
+ .ident = "Clevo NL5xNU",
|
||||||
|
+ .matches = {
|
||||||
|
+ DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
|
||||||
|
+ DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"),
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These models have a working acpi_video backlight control, and using
|
||||||
|
diff --git a/drivers/crypto/qat/qat_common/qat_crypto.c b/drivers/crypto/qat/qat_common/qat_crypto.c
|
||||||
|
index 3852d31ce0a4b..37a9f969c59cd 100644
|
||||||
|
--- a/drivers/crypto/qat/qat_common/qat_crypto.c
|
||||||
|
+++ b/drivers/crypto/qat/qat_common/qat_crypto.c
|
||||||
|
@@ -170,6 +170,14 @@ int qat_crypto_dev_config(struct adf_accel_dev *accel_dev)
|
||||||
|
goto err;
|
||||||
|
if (adf_cfg_section_add(accel_dev, "Accelerator0"))
|
||||||
|
goto err;
|
||||||
|
+
|
||||||
|
+ /* Temporarily set the number of crypto instances to zero to avoid
|
||||||
|
+ * registering the crypto algorithms.
|
||||||
|
+ * This will be removed when the algorithms will support the
|
||||||
|
+ * CRYPTO_TFM_REQ_MAY_BACKLOG flag
|
||||||
|
+ */
|
||||||
|
+ instances = 0;
|
||||||
|
+
|
||||||
|
for (i = 0; i < instances; i++) {
|
||||||
|
val = i;
|
||||||
|
snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_BANK_NUM, i);
|
||||||
|
diff --git a/drivers/nfc/st21nfca/se.c b/drivers/nfc/st21nfca/se.c
|
||||||
|
index eac608a457f03..475f8a67856d0 100644
|
||||||
|
--- a/drivers/nfc/st21nfca/se.c
|
||||||
|
+++ b/drivers/nfc/st21nfca/se.c
|
||||||
|
@@ -330,6 +330,11 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host,
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
transaction->aid_len = skb->data[1];
|
||||||
|
+
|
||||||
|
+ /* Checking if the length of the AID is valid */
|
||||||
|
+ if (transaction->aid_len > sizeof(transaction->aid))
|
||||||
|
+ return -EINVAL;
|
||||||
|
+
|
||||||
|
memcpy(transaction->aid, &skb->data[2],
|
||||||
|
transaction->aid_len);
|
||||||
|
|
||||||
|
@@ -339,6 +344,11 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host,
|
||||||
|
return -EPROTO;
|
||||||
|
|
||||||
|
transaction->params_len = skb->data[transaction->aid_len + 3];
|
||||||
|
+
|
||||||
|
+ /* Total size is allocated (skb->len - 2) minus fixed array members */
|
||||||
|
+ if (transaction->params_len > ((skb->len - 2) - sizeof(struct nfc_evt_transaction)))
|
||||||
|
+ return -EINVAL;
|
||||||
|
+
|
||||||
|
memcpy(transaction->params, skb->data +
|
||||||
|
transaction->aid_len + 4, transaction->params_len);
|
||||||
|
|
||||||
|
diff --git a/drivers/staging/fbtft/fb_st7789v.c b/drivers/staging/fbtft/fb_st7789v.c
|
||||||
|
index 085e9872c46d4..93bfde68f5452 100644
|
||||||
|
--- a/drivers/staging/fbtft/fb_st7789v.c
|
||||||
|
+++ b/drivers/staging/fbtft/fb_st7789v.c
|
||||||
|
@@ -85,6 +85,8 @@ enum st7789v_command {
|
||||||
|
*/
|
||||||
|
static int init_display(struct fbtft_par *par)
|
||||||
|
{
|
||||||
|
+ par->fbtftops.reset(par);
|
||||||
|
+
|
||||||
|
/* turn off sleep mode */
|
||||||
|
write_reg(par, MIPI_DCS_EXIT_SLEEP_MODE);
|
||||||
|
mdelay(120);
|
||||||
|
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
|
||||||
|
index 55be18cae35ba..775901abe678f 100644
|
||||||
|
--- a/net/ipv6/ip6_output.c
|
||||||
|
+++ b/net/ipv6/ip6_output.c
|
||||||
|
@@ -1329,8 +1329,8 @@ static int __ip6_append_data(struct sock *sk,
|
||||||
|
sizeof(struct frag_hdr) : 0) +
|
||||||
|
rt->rt6i_nfheader_len;
|
||||||
|
|
||||||
|
- if (mtu < fragheaderlen ||
|
||||||
|
- ((mtu - fragheaderlen) & ~7) + fragheaderlen < sizeof(struct frag_hdr))
|
||||||
|
+ if (mtu <= fragheaderlen ||
|
||||||
|
+ ((mtu - fragheaderlen) & ~7) + fragheaderlen <= sizeof(struct frag_hdr))
|
||||||
|
goto emsgsize;
|
||||||
|
|
||||||
|
maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen -
|
||||||
|
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
|
||||||
|
index a8866455e8b2a..b6dbec793ebbd 100644
|
||||||
|
--- a/net/llc/af_llc.c
|
||||||
|
+++ b/net/llc/af_llc.c
|
||||||
|
@@ -274,6 +274,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr)
|
||||||
|
{
|
||||||
|
struct sock *sk = sock->sk;
|
||||||
|
struct llc_sock *llc = llc_sk(sk);
|
||||||
|
+ struct net_device *dev = NULL;
|
||||||
|
struct llc_sap *sap;
|
||||||
|
int rc = -EINVAL;
|
||||||
|
|
||||||
|
@@ -285,14 +286,14 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr)
|
||||||
|
goto out;
|
||||||
|
rc = -ENODEV;
|
||||||
|
if (sk->sk_bound_dev_if) {
|
||||||
|
- llc->dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if);
|
||||||
|
- if (llc->dev && addr->sllc_arphrd != llc->dev->type) {
|
||||||
|
- dev_put(llc->dev);
|
||||||
|
- llc->dev = NULL;
|
||||||
|
+ dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if);
|
||||||
|
+ if (dev && addr->sllc_arphrd != dev->type) {
|
||||||
|
+ dev_put(dev);
|
||||||
|
+ dev = NULL;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
- llc->dev = dev_getfirstbyhwtype(&init_net, addr->sllc_arphrd);
|
||||||
|
- if (!llc->dev)
|
||||||
|
+ dev = dev_getfirstbyhwtype(&init_net, addr->sllc_arphrd);
|
||||||
|
+ if (!dev)
|
||||||
|
goto out;
|
||||||
|
rc = -EUSERS;
|
||||||
|
llc->laddr.lsap = llc_ui_autoport();
|
||||||
|
@@ -302,6 +303,11 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr)
|
||||||
|
sap = llc_sap_open(llc->laddr.lsap, NULL);
|
||||||
|
if (!sap)
|
||||||
|
goto out;
|
||||||
|
+
|
||||||
|
+ /* Note: We do not expect errors from this point. */
|
||||||
|
+ llc->dev = dev;
|
||||||
|
+ dev = NULL;
|
||||||
|
+
|
||||||
|
memcpy(llc->laddr.mac, llc->dev->dev_addr, IFHWADDRLEN);
|
||||||
|
memcpy(&llc->addr, addr, sizeof(llc->addr));
|
||||||
|
/* assign new connection to its SAP */
|
||||||
|
@@ -309,6 +315,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr)
|
||||||
|
sock_reset_flag(sk, SOCK_ZAPPED);
|
||||||
|
rc = 0;
|
||||||
|
out:
|
||||||
|
+ dev_put(dev);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -331,6 +338,7 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen)
|
||||||
|
struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr;
|
||||||
|
struct sock *sk = sock->sk;
|
||||||
|
struct llc_sock *llc = llc_sk(sk);
|
||||||
|
+ struct net_device *dev = NULL;
|
||||||
|
struct llc_sap *sap;
|
||||||
|
int rc = -EINVAL;
|
||||||
|
|
||||||
|
@@ -347,25 +355,26 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen)
|
||||||
|
rc = -ENODEV;
|
||||||
|
rcu_read_lock();
|
||||||
|
if (sk->sk_bound_dev_if) {
|
||||||
|
- llc->dev = dev_get_by_index_rcu(&init_net, sk->sk_bound_dev_if);
|
||||||
|
- if (llc->dev) {
|
||||||
|
+ dev = dev_get_by_index_rcu(&init_net, sk->sk_bound_dev_if);
|
||||||
|
+ if (dev) {
|
||||||
|
if (is_zero_ether_addr(addr->sllc_mac))
|
||||||
|
- memcpy(addr->sllc_mac, llc->dev->dev_addr,
|
||||||
|
+ memcpy(addr->sllc_mac, dev->dev_addr,
|
||||||
|
IFHWADDRLEN);
|
||||||
|
- if (addr->sllc_arphrd != llc->dev->type ||
|
||||||
|
+ if (addr->sllc_arphrd != dev->type ||
|
||||||
|
!ether_addr_equal(addr->sllc_mac,
|
||||||
|
- llc->dev->dev_addr)) {
|
||||||
|
+ dev->dev_addr)) {
|
||||||
|
rc = -EINVAL;
|
||||||
|
- llc->dev = NULL;
|
||||||
|
+ dev = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- } else
|
||||||
|
- llc->dev = dev_getbyhwaddr_rcu(&init_net, addr->sllc_arphrd,
|
||||||
|
+ } else {
|
||||||
|
+ dev = dev_getbyhwaddr_rcu(&init_net, addr->sllc_arphrd,
|
||||||
|
addr->sllc_mac);
|
||||||
|
- if (llc->dev)
|
||||||
|
- dev_hold(llc->dev);
|
||||||
|
+ }
|
||||||
|
+ if (dev)
|
||||||
|
+ dev_hold(dev);
|
||||||
|
rcu_read_unlock();
|
||||||
|
- if (!llc->dev)
|
||||||
|
+ if (!dev)
|
||||||
|
goto out;
|
||||||
|
if (!addr->sllc_sap) {
|
||||||
|
rc = -EUSERS;
|
||||||
|
@@ -398,6 +407,11 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen)
|
||||||
|
goto out_put;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /* Note: We do not expect errors from this point. */
|
||||||
|
+ llc->dev = dev;
|
||||||
|
+ dev = NULL;
|
||||||
|
+
|
||||||
|
llc->laddr.lsap = addr->sllc_sap;
|
||||||
|
memcpy(llc->laddr.mac, addr->sllc_mac, IFHWADDRLEN);
|
||||||
|
memcpy(&llc->addr, addr, sizeof(llc->addr));
|
||||||
|
@@ -408,6 +422,7 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen)
|
||||||
|
out_put:
|
||||||
|
llc_sap_put(sap);
|
||||||
|
out:
|
||||||
|
+ dev_put(dev);
|
||||||
|
release_sock(sk);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
|
||||||
|
index f37fbc71fc1db..091ac3a7b186f 100644
|
||||||
|
--- a/net/mac80211/cfg.c
|
||||||
|
+++ b/net/mac80211/cfg.c
|
||||||
|
@@ -1776,13 +1776,11 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh,
|
||||||
|
const struct mesh_setup *setup)
|
||||||
|
{
|
||||||
|
u8 *new_ie;
|
||||||
|
- const u8 *old_ie;
|
||||||
|
struct ieee80211_sub_if_data *sdata = container_of(ifmsh,
|
||||||
|
struct ieee80211_sub_if_data, u.mesh);
|
||||||
|
|
||||||
|
/* allocate information elements */
|
||||||
|
new_ie = NULL;
|
||||||
|
- old_ie = ifmsh->ie;
|
||||||
|
|
||||||
|
if (setup->ie_len) {
|
||||||
|
new_ie = kmemdup(setup->ie, setup->ie_len,
|
||||||
|
@@ -1792,7 +1790,6 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh,
|
||||||
|
}
|
||||||
|
ifmsh->ie_len = setup->ie_len;
|
||||||
|
ifmsh->ie = new_ie;
|
||||||
|
- kfree(old_ie);
|
||||||
|
|
||||||
|
/* now copy the rest of the setup parameters */
|
||||||
|
ifmsh->mesh_id_len = setup->mesh_id_len;
|
||||||
|
diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c
|
||||||
|
index 9d593ecd8e870..fb14082151ce8 100644
|
||||||
|
--- a/net/netfilter/nf_tables_core.c
|
||||||
|
+++ b/net/netfilter/nf_tables_core.c
|
||||||
|
@@ -127,7 +127,7 @@ nft_do_chain(struct nft_pktinfo *pkt, void *priv)
|
||||||
|
const struct net *net = pkt->net;
|
||||||
|
const struct nft_rule *rule;
|
||||||
|
const struct nft_expr *expr, *last;
|
||||||
|
- struct nft_regs regs;
|
||||||
|
+ struct nft_regs regs = {};
|
||||||
|
unsigned int stackptr = 0;
|
||||||
|
struct nft_jumpstack jumpstack[NFT_JUMP_STACK_SIZE];
|
||||||
|
struct nft_stats *stats;
|
||||||
|
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
|
||||||
|
index 5c07c5be31423..a70026f42a316 100644
|
||||||
|
--- a/sound/core/pcm_native.c
|
||||||
|
+++ b/sound/core/pcm_native.c
|
||||||
|
@@ -1489,21 +1489,25 @@ static int snd_pcm_do_reset(struct snd_pcm_substream *substream, int state)
|
||||||
|
int err = substream->ops->ioctl(substream, SNDRV_PCM_IOCTL1_RESET, NULL);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
+ snd_pcm_stream_lock_irq(substream);
|
||||||
|
runtime->hw_ptr_base = 0;
|
||||||
|
runtime->hw_ptr_interrupt = runtime->status->hw_ptr -
|
||||||
|
runtime->status->hw_ptr % runtime->period_size;
|
||||||
|
runtime->silence_start = runtime->status->hw_ptr;
|
||||||
|
runtime->silence_filled = 0;
|
||||||
|
+ snd_pcm_stream_unlock_irq(substream);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void snd_pcm_post_reset(struct snd_pcm_substream *substream, int state)
|
||||||
|
{
|
||||||
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||||
|
+ snd_pcm_stream_lock_irq(substream);
|
||||||
|
runtime->control->appl_ptr = runtime->status->hw_ptr;
|
||||||
|
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
|
||||||
|
runtime->silence_size > 0)
|
||||||
|
snd_pcm_playback_silence(substream, ULONG_MAX);
|
||||||
|
+ snd_pcm_stream_unlock_irq(substream);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct action_ops snd_pcm_action_reset = {
|
||||||
|
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
|
||||||
|
index c4840fda44b40..a7f1e4ef3f887 100644
|
||||||
|
--- a/sound/pci/ac97/ac97_codec.c
|
||||||
|
+++ b/sound/pci/ac97/ac97_codec.c
|
||||||
|
@@ -958,8 +958,8 @@ static int snd_ac97_ad18xx_pcm_get_volume(struct snd_kcontrol *kcontrol, struct
|
||||||
|
int codec = kcontrol->private_value & 3;
|
||||||
|
|
||||||
|
mutex_lock(&ac97->page_mutex);
|
||||||
|
- ucontrol->value.integer.value[0] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 0) & 31);
|
||||||
|
- ucontrol->value.integer.value[1] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 8) & 31);
|
||||||
|
+ ucontrol->value.integer.value[0] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 8) & 31);
|
||||||
|
+ ucontrol->value.integer.value[1] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 0) & 31);
|
||||||
|
mutex_unlock(&ac97->page_mutex);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
|
||||||
|
index 73f593526b2d7..0024145a7b5be 100644
|
||||||
|
--- a/sound/pci/cmipci.c
|
||||||
|
+++ b/sound/pci/cmipci.c
|
||||||
|
@@ -315,7 +315,6 @@ MODULE_PARM_DESC(joystick_port, "Joystick port address.");
|
||||||
|
#define CM_MICGAINZ 0x01 /* mic boost */
|
||||||
|
#define CM_MICGAINZ_SHIFT 0
|
||||||
|
|
||||||
|
-#define CM_REG_MIXER3 0x24
|
||||||
|
#define CM_REG_AUX_VOL 0x26
|
||||||
|
#define CM_VAUXL_MASK 0xf0
|
||||||
|
#define CM_VAUXR_MASK 0x0f
|
||||||
|
@@ -3323,7 +3322,7 @@ static void snd_cmipci_remove(struct pci_dev *pci)
|
||||||
|
*/
|
||||||
|
static unsigned char saved_regs[] = {
|
||||||
|
CM_REG_FUNCTRL1, CM_REG_CHFORMAT, CM_REG_LEGACY_CTRL, CM_REG_MISC_CTRL,
|
||||||
|
- CM_REG_MIXER0, CM_REG_MIXER1, CM_REG_MIXER2, CM_REG_MIXER3, CM_REG_PLL,
|
||||||
|
+ CM_REG_MIXER0, CM_REG_MIXER1, CM_REG_MIXER2, CM_REG_AUX_VOL, CM_REG_PLL,
|
||||||
|
CM_REG_CH0_FRAME1, CM_REG_CH0_FRAME2,
|
||||||
|
CM_REG_CH1_FRAME1, CM_REG_CH1_FRAME2, CM_REG_EXT_MISC,
|
||||||
|
CM_REG_INT_STATUS, CM_REG_INT_HLDCLR, CM_REG_FUNCTRL0,
|
||||||
|
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
|
||||||
|
index 1f2c69e599d9c..c94068874ea84 100644
|
||||||
|
--- a/sound/usb/mixer_quirks.c
|
||||||
|
+++ b/sound/usb/mixer_quirks.c
|
||||||
|
@@ -1879,9 +1879,10 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer,
|
||||||
|
if (unitid == 7 && cval->control == UAC_FU_VOLUME)
|
||||||
|
snd_dragonfly_quirk_db_scale(mixer, cval, kctl);
|
||||||
|
break;
|
||||||
|
- /* lowest playback value is muted on C-Media devices */
|
||||||
|
- case USB_ID(0x0d8c, 0x000c):
|
||||||
|
- case USB_ID(0x0d8c, 0x0014):
|
||||||
|
+ /* lowest playback value is muted on some devices */
|
||||||
|
+ case USB_ID(0x0d8c, 0x000c): /* C-Media */
|
||||||
|
+ case USB_ID(0x0d8c, 0x0014): /* C-Media */
|
||||||
|
+ case USB_ID(0x19f7, 0x0003): /* RODE NT-USB */
|
||||||
|
if (strstr(kctl->id.name, "Playback"))
|
||||||
|
cval->min_mute = 1;
|
||||||
|
break;
|
||||||
12
patch/kernel/archive/sun50iw9-4.9/patch-4.9.309-310.patch
Normal file
12
patch/kernel/archive/sun50iw9-4.9/patch-4.9.309-310.patch
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
e/asm/cpufeatures.h for the valid bit
|
||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index c1d4ddadbcb51..72a8c786cb777 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 309
|
||||||
|
+SUBLEVEL = 310
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
5894
patch/kernel/archive/sun50iw9-4.9/patch-4.9.310-311.patch
Normal file
5894
patch/kernel/archive/sun50iw9-4.9/patch-4.9.310-311.patch
Normal file
File diff suppressed because it is too large
Load Diff
450
patch/kernel/archive/sun50iw9-4.9/patch-4.9.311-312.patch
Normal file
450
patch/kernel/archive/sun50iw9-4.9/patch-4.9.311-312.patch
Normal file
@@ -0,0 +1,450 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index c1a20e4a2d136..a9f16c9c9614f 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 311
|
||||||
|
+SUBLEVEL = 312
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S
|
||||||
|
index 37ad245cf9899..fb458623f3860 100644
|
||||||
|
--- a/arch/arc/kernel/entry.S
|
||||||
|
+++ b/arch/arc/kernel/entry.S
|
||||||
|
@@ -191,6 +191,7 @@ tracesys_exit:
|
||||||
|
st r0, [sp, PT_r0] ; sys call return value in pt_regs
|
||||||
|
|
||||||
|
;POST Sys Call Ptrace Hook
|
||||||
|
+ mov r0, sp ; pt_regs needed
|
||||||
|
bl @syscall_trace_exit
|
||||||
|
b ret_from_exception ; NOT ret_from_system_call at is saves r0 which
|
||||||
|
; we'd done before calling post hook above
|
||||||
|
diff --git a/arch/arm/mach-vexpress/spc.c b/arch/arm/mach-vexpress/spc.c
|
||||||
|
index 635b0d5494874..c16f396140032 100644
|
||||||
|
--- a/arch/arm/mach-vexpress/spc.c
|
||||||
|
+++ b/arch/arm/mach-vexpress/spc.c
|
||||||
|
@@ -584,7 +584,7 @@ static int __init ve_spc_clk_init(void)
|
||||||
|
}
|
||||||
|
|
||||||
|
cluster = topology_physical_package_id(cpu_dev->id);
|
||||||
|
- if (init_opp_table[cluster])
|
||||||
|
+ if (cluster < 0 || init_opp_table[cluster])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (ve_init_opp_table(cpu_dev))
|
||||||
|
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
|
||||||
|
index b6e5447d563ee..f538bac4ac66a 100644
|
||||||
|
--- a/block/compat_ioctl.c
|
||||||
|
+++ b/block/compat_ioctl.c
|
||||||
|
@@ -394,7 +394,7 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
|
||||||
|
return 0;
|
||||||
|
case BLKGETSIZE:
|
||||||
|
size = i_size_read(bdev->bd_inode);
|
||||||
|
- if ((size >> 9) > ~0UL)
|
||||||
|
+ if ((size >> 9) > ~(compat_ulong_t)0)
|
||||||
|
return -EFBIG;
|
||||||
|
return compat_put_ulong(arg, size >> 9);
|
||||||
|
|
||||||
|
diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c
|
||||||
|
index ff468a6fd8ddc..677f582cf3d6c 100644
|
||||||
|
--- a/drivers/ata/pata_marvell.c
|
||||||
|
+++ b/drivers/ata/pata_marvell.c
|
||||||
|
@@ -82,6 +82,8 @@ static int marvell_cable_detect(struct ata_port *ap)
|
||||||
|
switch(ap->port_no)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
+ if (!ap->ioaddr.bmdma_addr)
|
||||||
|
+ return ATA_CBL_PATA_UNK;
|
||||||
|
if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1)
|
||||||
|
return ATA_CBL_PATA40;
|
||||||
|
return ATA_CBL_PATA80;
|
||||||
|
diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
|
||||||
|
index c15ca560fe60d..ca266fcca186c 100644
|
||||||
|
--- a/drivers/dma/at_xdmac.c
|
||||||
|
+++ b/drivers/dma/at_xdmac.c
|
||||||
|
@@ -1392,7 +1392,7 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
|
||||||
|
{
|
||||||
|
struct at_xdmac_chan *atchan = to_at_xdmac_chan(chan);
|
||||||
|
struct at_xdmac *atxdmac = to_at_xdmac(atchan->chan.device);
|
||||||
|
- struct at_xdmac_desc *desc, *_desc;
|
||||||
|
+ struct at_xdmac_desc *desc, *_desc, *iter;
|
||||||
|
struct list_head *descs_list;
|
||||||
|
enum dma_status ret;
|
||||||
|
int residue, retry;
|
||||||
|
@@ -1507,11 +1507,13 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
|
||||||
|
* microblock.
|
||||||
|
*/
|
||||||
|
descs_list = &desc->descs_list;
|
||||||
|
- list_for_each_entry_safe(desc, _desc, descs_list, desc_node) {
|
||||||
|
- dwidth = at_xdmac_get_dwidth(desc->lld.mbr_cfg);
|
||||||
|
- residue -= (desc->lld.mbr_ubc & 0xffffff) << dwidth;
|
||||||
|
- if ((desc->lld.mbr_nda & 0xfffffffc) == cur_nda)
|
||||||
|
+ list_for_each_entry_safe(iter, _desc, descs_list, desc_node) {
|
||||||
|
+ dwidth = at_xdmac_get_dwidth(iter->lld.mbr_cfg);
|
||||||
|
+ residue -= (iter->lld.mbr_ubc & 0xffffff) << dwidth;
|
||||||
|
+ if ((iter->lld.mbr_nda & 0xfffffffc) == cur_nda) {
|
||||||
|
+ desc = iter;
|
||||||
|
break;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
residue += cur_ubc << dwidth;
|
||||||
|
|
||||||
|
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
|
||||||
|
index 558d509b7d855..4337cf9defc24 100644
|
||||||
|
--- a/drivers/dma/imx-sdma.c
|
||||||
|
+++ b/drivers/dma/imx-sdma.c
|
||||||
|
@@ -1528,7 +1528,7 @@ static int sdma_event_remap(struct sdma_engine *sdma)
|
||||||
|
u32 reg, val, shift, num_map, i;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
- if (IS_ERR(np) || IS_ERR(gpr_np))
|
||||||
|
+ if (IS_ERR(np) || !gpr_np)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
event_remap = of_find_property(np, propname, NULL);
|
||||||
|
@@ -1576,7 +1576,7 @@ static int sdma_event_remap(struct sdma_engine *sdma)
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
- if (!IS_ERR(gpr_np))
|
||||||
|
+ if (gpr_np)
|
||||||
|
of_node_put(gpr_np);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
|
||||||
|
index 83bf997dda03c..e14bfbdbaf2bf 100644
|
||||||
|
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
|
||||||
|
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
|
||||||
|
@@ -192,7 +192,10 @@ static void mdp5_plane_reset(struct drm_plane *plane)
|
||||||
|
drm_framebuffer_unreference(plane->state->fb);
|
||||||
|
|
||||||
|
kfree(to_mdp5_plane_state(plane->state));
|
||||||
|
+ plane->state = NULL;
|
||||||
|
mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL);
|
||||||
|
+ if (!mdp5_state)
|
||||||
|
+ return;
|
||||||
|
|
||||||
|
/* assign default blend parameters */
|
||||||
|
mdp5_state->alpha = 255;
|
||||||
|
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
|
||||||
|
index 500016209ae0c..3ed40bde796b7 100644
|
||||||
|
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
|
||||||
|
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
|
||||||
|
@@ -1010,8 +1010,8 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
|
||||||
|
{
|
||||||
|
u32 reg = link << (E1000_LTRV_REQ_SHIFT + E1000_LTRV_NOSNOOP_SHIFT) |
|
||||||
|
link << E1000_LTRV_REQ_SHIFT | E1000_LTRV_SEND;
|
||||||
|
- u16 max_ltr_enc_d = 0; /* maximum LTR decoded by platform */
|
||||||
|
- u16 lat_enc_d = 0; /* latency decoded */
|
||||||
|
+ u32 max_ltr_enc_d = 0; /* maximum LTR decoded by platform */
|
||||||
|
+ u32 lat_enc_d = 0; /* latency decoded */
|
||||||
|
u16 lat_enc = 0; /* latency encoded */
|
||||||
|
|
||||||
|
if (link) {
|
||||||
|
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
|
||||||
|
index 0bfadec8b79c9..d59cb381e80b1 100644
|
||||||
|
--- a/drivers/net/vxlan.c
|
||||||
|
+++ b/drivers/net/vxlan.c
|
||||||
|
@@ -490,11 +490,11 @@ static int vxlan_fdb_append(struct vxlan_fdb *f,
|
||||||
|
|
||||||
|
rd = kmalloc(sizeof(*rd), GFP_ATOMIC);
|
||||||
|
if (rd == NULL)
|
||||||
|
- return -ENOBUFS;
|
||||||
|
+ return -ENOMEM;
|
||||||
|
|
||||||
|
if (dst_cache_init(&rd->dst_cache, GFP_ATOMIC)) {
|
||||||
|
kfree(rd);
|
||||||
|
- return -ENOBUFS;
|
||||||
|
+ return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
rd->remote_ip = *ip;
|
||||||
|
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||||
|
index 998a4bd6db78a..d8f34883c0960 100644
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||||
|
@@ -547,7 +547,7 @@ enum brcmf_sdio_frmtype {
|
||||||
|
BRCMF_SDIO_FT_SUB,
|
||||||
|
};
|
||||||
|
|
||||||
|
-#define SDIOD_DRVSTR_KEY(chip, pmu) (((chip) << 16) | (pmu))
|
||||||
|
+#define SDIOD_DRVSTR_KEY(chip, pmu) (((unsigned int)(chip) << 16) | (pmu))
|
||||||
|
|
||||||
|
/* SDIO Pad drive strength to select value mappings */
|
||||||
|
struct sdiod_drive_str {
|
||||||
|
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
|
||||||
|
index 8c146e2b6727a..4664d3e191c81 100644
|
||||||
|
--- a/drivers/platform/x86/samsung-laptop.c
|
||||||
|
+++ b/drivers/platform/x86/samsung-laptop.c
|
||||||
|
@@ -1125,8 +1125,6 @@ static void kbd_led_set(struct led_classdev *led_cdev,
|
||||||
|
|
||||||
|
if (value > samsung->kbd_led.max_brightness)
|
||||||
|
value = samsung->kbd_led.max_brightness;
|
||||||
|
- else if (value < 0)
|
||||||
|
- value = 0;
|
||||||
|
|
||||||
|
samsung->kbd_led_wk = value;
|
||||||
|
queue_work(samsung->led_workqueue, &samsung->kbd_led_work);
|
||||||
|
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
|
||||||
|
index 95e4f074b7665..b85c283ad08b3 100644
|
||||||
|
--- a/fs/cifs/cifsfs.c
|
||||||
|
+++ b/fs/cifs/cifsfs.c
|
||||||
|
@@ -766,7 +766,7 @@ cifs_loose_read_iter(struct kiocb *iocb, struct iov_iter *iter)
|
||||||
|
ssize_t rc;
|
||||||
|
struct inode *inode = file_inode(iocb->ki_filp);
|
||||||
|
|
||||||
|
- if (iocb->ki_filp->f_flags & O_DIRECT)
|
||||||
|
+ if (iocb->ki_flags & IOCB_DIRECT)
|
||||||
|
return cifs_user_readv(iocb, iter);
|
||||||
|
|
||||||
|
rc = cifs_revalidate_mapping(inode);
|
||||||
|
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
|
||||||
|
index e66aa8918dee2..754b33828853d 100644
|
||||||
|
--- a/fs/ext4/inode.c
|
||||||
|
+++ b/fs/ext4/inode.c
|
||||||
|
@@ -3980,7 +3980,8 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
|
||||||
|
struct super_block *sb = inode->i_sb;
|
||||||
|
ext4_lblk_t first_block, stop_block;
|
||||||
|
struct address_space *mapping = inode->i_mapping;
|
||||||
|
- loff_t first_block_offset, last_block_offset;
|
||||||
|
+ loff_t first_block_offset, last_block_offset, max_length;
|
||||||
|
+ struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
|
||||||
|
handle_t *handle;
|
||||||
|
unsigned int credits;
|
||||||
|
int ret = 0;
|
||||||
|
@@ -4026,6 +4027,14 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
|
||||||
|
offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * For punch hole the length + offset needs to be within one block
|
||||||
|
+ * before last range. Adjust the length if it goes beyond that limit.
|
||||||
|
+ */
|
||||||
|
+ max_length = sbi->s_bitmap_maxbytes - inode->i_sb->s_blocksize;
|
||||||
|
+ if (offset + length > max_length)
|
||||||
|
+ length = max_length - offset;
|
||||||
|
+
|
||||||
|
if (offset & (sb->s_blocksize - 1) ||
|
||||||
|
(offset + length) & (sb->s_blocksize - 1)) {
|
||||||
|
/*
|
||||||
|
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
|
||||||
|
index e17a6396bde6c..c50ba683a570a 100644
|
||||||
|
--- a/fs/ext4/super.c
|
||||||
|
+++ b/fs/ext4/super.c
|
||||||
|
@@ -3241,9 +3241,11 @@ static int count_overhead(struct super_block *sb, ext4_group_t grp,
|
||||||
|
ext4_fsblk_t first_block, last_block, b;
|
||||||
|
ext4_group_t i, ngroups = ext4_get_groups_count(sb);
|
||||||
|
int s, j, count = 0;
|
||||||
|
+ int has_super = ext4_bg_has_super(sb, grp);
|
||||||
|
|
||||||
|
if (!ext4_has_feature_bigalloc(sb))
|
||||||
|
- return (ext4_bg_has_super(sb, grp) + ext4_bg_num_gdb(sb, grp) +
|
||||||
|
+ return (has_super + ext4_bg_num_gdb(sb, grp) +
|
||||||
|
+ (has_super ? le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks) : 0) +
|
||||||
|
sbi->s_itb_per_group + 2);
|
||||||
|
|
||||||
|
first_block = le32_to_cpu(sbi->s_es->s_first_data_block) +
|
||||||
|
@@ -4162,9 +4164,18 @@ no_journal:
|
||||||
|
* Get the # of file system overhead blocks from the
|
||||||
|
* superblock if present.
|
||||||
|
*/
|
||||||
|
- if (es->s_overhead_clusters)
|
||||||
|
- sbi->s_overhead = le32_to_cpu(es->s_overhead_clusters);
|
||||||
|
- else {
|
||||||
|
+ sbi->s_overhead = le32_to_cpu(es->s_overhead_clusters);
|
||||||
|
+ /* ignore the precalculated value if it is ridiculous */
|
||||||
|
+ if (sbi->s_overhead > ext4_blocks_count(es))
|
||||||
|
+ sbi->s_overhead = 0;
|
||||||
|
+ /*
|
||||||
|
+ * If the bigalloc feature is not enabled recalculating the
|
||||||
|
+ * overhead doesn't take long, so we might as well just redo
|
||||||
|
+ * it to make sure we are using the correct value.
|
||||||
|
+ */
|
||||||
|
+ if (!ext4_has_feature_bigalloc(sb))
|
||||||
|
+ sbi->s_overhead = 0;
|
||||||
|
+ if (sbi->s_overhead == 0) {
|
||||||
|
err = ext4_calculate_overhead(sb);
|
||||||
|
if (err)
|
||||||
|
goto failed_mount_wq;
|
||||||
|
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
|
||||||
|
index a4182b150bb07..9f83a4c602f99 100644
|
||||||
|
--- a/fs/gfs2/rgrp.c
|
||||||
|
+++ b/fs/gfs2/rgrp.c
|
||||||
|
@@ -917,15 +917,15 @@ static int read_rindex_entry(struct gfs2_inode *ip)
|
||||||
|
rgd->rd_bitbytes = be32_to_cpu(buf.ri_bitbytes);
|
||||||
|
spin_lock_init(&rgd->rd_rsspin);
|
||||||
|
|
||||||
|
- error = compute_bitstructs(rgd);
|
||||||
|
- if (error)
|
||||||
|
- goto fail;
|
||||||
|
-
|
||||||
|
error = gfs2_glock_get(sdp, rgd->rd_addr,
|
||||||
|
&gfs2_rgrp_glops, CREATE, &rgd->rd_gl);
|
||||||
|
if (error)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
+ error = compute_bitstructs(rgd);
|
||||||
|
+ if (error)
|
||||||
|
+ goto fail_glock;
|
||||||
|
+
|
||||||
|
rgd->rd_rgl = (struct gfs2_rgrp_lvb *)rgd->rd_gl->gl_lksb.sb_lvbptr;
|
||||||
|
rgd->rd_flags &= ~(GFS2_RDF_UPTODATE | GFS2_RDF_PREFERRED);
|
||||||
|
if (rgd->rd_data > sdp->sd_max_rg_data)
|
||||||
|
@@ -942,6 +942,7 @@ static int read_rindex_entry(struct gfs2_inode *ip)
|
||||||
|
}
|
||||||
|
|
||||||
|
error = 0; /* someone else read in the rgrp; free it and ignore it */
|
||||||
|
+fail_glock:
|
||||||
|
gfs2_glock_put(rgd->rd_gl);
|
||||||
|
|
||||||
|
fail:
|
||||||
|
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
|
||||||
|
index 6fec9e81bd70d..1979298fdca9e 100644
|
||||||
|
--- a/include/linux/etherdevice.h
|
||||||
|
+++ b/include/linux/etherdevice.h
|
||||||
|
@@ -125,7 +125,7 @@ static inline bool is_multicast_ether_addr(const u8 *addr)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
-static inline bool is_multicast_ether_addr_64bits(const u8 addr[6+2])
|
||||||
|
+static inline bool is_multicast_ether_addr_64bits(const u8 *addr)
|
||||||
|
{
|
||||||
|
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
|
||||||
|
#ifdef __BIG_ENDIAN
|
||||||
|
@@ -339,8 +339,7 @@ static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
|
||||||
|
* Please note that alignment of addr1 & addr2 are only guaranteed to be 16 bits.
|
||||||
|
*/
|
||||||
|
|
||||||
|
-static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
|
||||||
|
- const u8 addr2[6+2])
|
||||||
|
+static inline bool ether_addr_equal_64bits(const u8 *addr1, const u8 *addr2)
|
||||||
|
{
|
||||||
|
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
|
||||||
|
u64 fold = (*(const u64 *)addr1) ^ (*(const u64 *)addr2);
|
||||||
|
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
|
||||||
|
index 25c21aa398f8c..a6e682569e5b9 100644
|
||||||
|
--- a/mm/page_alloc.c
|
||||||
|
+++ b/mm/page_alloc.c
|
||||||
|
@@ -6504,7 +6504,7 @@ void __init mem_init_print_info(const char *str)
|
||||||
|
*/
|
||||||
|
#define adj_init_size(start, end, size, pos, adj) \
|
||||||
|
do { \
|
||||||
|
- if (start <= pos && pos < end && size > adj) \
|
||||||
|
+ if (&start[0] <= &pos[0] && &pos[0] < &end[0] && size > adj) \
|
||||||
|
size -= adj; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
|
||||||
|
index 8aef475fef310..a8674e9ff37b7 100644
|
||||||
|
--- a/net/netlink/af_netlink.c
|
||||||
|
+++ b/net/netlink/af_netlink.c
|
||||||
|
@@ -2194,6 +2194,13 @@ static int netlink_dump(struct sock *sk)
|
||||||
|
* single netdev. The outcome is MSG_TRUNC error.
|
||||||
|
*/
|
||||||
|
skb_reserve(skb, skb_tailroom(skb) - alloc_size);
|
||||||
|
+
|
||||||
|
+ /* Make sure malicious BPF programs can not read unitialized memory
|
||||||
|
+ * from skb->head -> skb->data
|
||||||
|
+ */
|
||||||
|
+ skb_reset_network_header(skb);
|
||||||
|
+ skb_reset_mac_header(skb);
|
||||||
|
+
|
||||||
|
netlink_skb_set_owner_r(skb, sk);
|
||||||
|
|
||||||
|
if (nlk->dump_done_errno > 0)
|
||||||
|
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
|
||||||
|
index 28471cfad9225..26921f755f3a9 100644
|
||||||
|
--- a/net/openvswitch/flow_netlink.c
|
||||||
|
+++ b/net/openvswitch/flow_netlink.c
|
||||||
|
@@ -1863,7 +1863,7 @@ static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa,
|
||||||
|
new_acts_size = max(next_offset + req_size, ksize(*sfa) * 2);
|
||||||
|
|
||||||
|
if (new_acts_size > MAX_ACTIONS_BUFSIZE) {
|
||||||
|
- if ((MAX_ACTIONS_BUFSIZE - next_offset) < req_size) {
|
||||||
|
+ if ((next_offset + req_size) > MAX_ACTIONS_BUFSIZE) {
|
||||||
|
OVS_NLERR(log, "Flow action size exceeds max %u",
|
||||||
|
MAX_ACTIONS_BUFSIZE);
|
||||||
|
return ERR_PTR(-EMSGSIZE);
|
||||||
|
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
|
||||||
|
index e79d6881a97eb..2ae2801dd7bee 100644
|
||||||
|
--- a/net/packet/af_packet.c
|
||||||
|
+++ b/net/packet/af_packet.c
|
||||||
|
@@ -2808,8 +2808,9 @@ tpacket_error:
|
||||||
|
|
||||||
|
status = TP_STATUS_SEND_REQUEST;
|
||||||
|
err = po->xmit(skb);
|
||||||
|
- if (unlikely(err > 0)) {
|
||||||
|
- err = net_xmit_errno(err);
|
||||||
|
+ if (unlikely(err != 0)) {
|
||||||
|
+ if (err > 0)
|
||||||
|
+ err = net_xmit_errno(err);
|
||||||
|
if (err && __packet_get_status(po, ph) ==
|
||||||
|
TP_STATUS_AVAILABLE) {
|
||||||
|
/* skb was destructed already */
|
||||||
|
@@ -3009,8 +3010,12 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
|
||||||
|
skb->no_fcs = 1;
|
||||||
|
|
||||||
|
err = po->xmit(skb);
|
||||||
|
- if (err > 0 && (err = net_xmit_errno(err)) != 0)
|
||||||
|
- goto out_unlock;
|
||||||
|
+ if (unlikely(err != 0)) {
|
||||||
|
+ if (err > 0)
|
||||||
|
+ err = net_xmit_errno(err);
|
||||||
|
+ if (err)
|
||||||
|
+ goto out_unlock;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
dev_put(dev);
|
||||||
|
|
||||||
|
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
|
||||||
|
index 21b0368c2a3bc..878a4fc97f042 100644
|
||||||
|
--- a/sound/soc/soc-dapm.c
|
||||||
|
+++ b/sound/soc/soc-dapm.c
|
||||||
|
@@ -1569,8 +1569,7 @@ static void dapm_seq_run(struct snd_soc_card *card,
|
||||||
|
switch (w->id) {
|
||||||
|
case snd_soc_dapm_pre:
|
||||||
|
if (!w->event)
|
||||||
|
- list_for_each_entry_safe_continue(w, n, list,
|
||||||
|
- power_list);
|
||||||
|
+ continue;
|
||||||
|
|
||||||
|
if (event == SND_SOC_DAPM_STREAM_START)
|
||||||
|
ret = w->event(w,
|
||||||
|
@@ -1582,8 +1581,7 @@ static void dapm_seq_run(struct snd_soc_card *card,
|
||||||
|
|
||||||
|
case snd_soc_dapm_post:
|
||||||
|
if (!w->event)
|
||||||
|
- list_for_each_entry_safe_continue(w, n, list,
|
||||||
|
- power_list);
|
||||||
|
+ continue;
|
||||||
|
|
||||||
|
if (event == SND_SOC_DAPM_STREAM_START)
|
||||||
|
ret = w->event(w,
|
||||||
|
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
|
||||||
|
index f0b41fee71304..83da676519a8d 100644
|
||||||
|
--- a/sound/usb/midi.c
|
||||||
|
+++ b/sound/usb/midi.c
|
||||||
|
@@ -1210,6 +1210,7 @@ static void snd_usbmidi_output_drain(struct snd_rawmidi_substream *substream)
|
||||||
|
} while (drain_urbs && timeout);
|
||||||
|
finish_wait(&ep->drain_wait, &wait);
|
||||||
|
}
|
||||||
|
+ port->active = 0;
|
||||||
|
spin_unlock_irq(&ep->buffer_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
|
||||||
|
index 62456a806bb4d..4b8f1c46420d4 100644
|
||||||
|
--- a/sound/usb/usbaudio.h
|
||||||
|
+++ b/sound/usb/usbaudio.h
|
||||||
|
@@ -22,7 +22,7 @@
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* handling of USB vendor/product ID pairs as 32-bit numbers */
|
||||||
|
-#define USB_ID(vendor, product) (((vendor) << 16) | (product))
|
||||||
|
+#define USB_ID(vendor, product) (((unsigned int)(vendor) << 16) | (product))
|
||||||
|
#define USB_ID_VENDOR(id) ((id) >> 16)
|
||||||
|
#define USB_ID_PRODUCT(id) ((u16)(id))
|
||||||
|
|
||||||
1985
patch/kernel/archive/sun50iw9-4.9/patch-4.9.312-313.patch
Normal file
1985
patch/kernel/archive/sun50iw9-4.9/patch-4.9.312-313.patch
Normal file
File diff suppressed because it is too large
Load Diff
345
patch/kernel/archive/sun50iw9-4.9/patch-4.9.313-314.patch
Normal file
345
patch/kernel/archive/sun50iw9-4.9/patch-4.9.313-314.patch
Normal file
@@ -0,0 +1,345 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 0c13bf09d17dc..734a4cc6ac464 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 313
|
||||||
|
+SUBLEVEL = 314
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c
|
||||||
|
index 3b6f687f177cd..32f8c501f6cb1 100644
|
||||||
|
--- a/arch/mips/bmips/setup.c
|
||||||
|
+++ b/arch/mips/bmips/setup.c
|
||||||
|
@@ -174,7 +174,7 @@ void __init plat_mem_setup(void)
|
||||||
|
dtb = phys_to_virt(fw_arg2);
|
||||||
|
else if (fw_passed_dtb) /* UHI interface */
|
||||||
|
dtb = (void *)fw_passed_dtb;
|
||||||
|
- else if (__dtb_start != __dtb_end)
|
||||||
|
+ else if (&__dtb_start != &__dtb_end)
|
||||||
|
dtb = (void *)__dtb_start;
|
||||||
|
else
|
||||||
|
panic("no dtb found");
|
||||||
|
diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c
|
||||||
|
index 4cbb000e778e3..9b30e46e91a75 100644
|
||||||
|
--- a/arch/mips/lantiq/prom.c
|
||||||
|
+++ b/arch/mips/lantiq/prom.c
|
||||||
|
@@ -76,7 +76,7 @@ void __init plat_mem_setup(void)
|
||||||
|
|
||||||
|
if (fw_passed_dtb) /* UHI interface */
|
||||||
|
dtb = (void *)fw_passed_dtb;
|
||||||
|
- else if (__dtb_start != __dtb_end)
|
||||||
|
+ else if (&__dtb_start != &__dtb_end)
|
||||||
|
dtb = (void *)__dtb_start;
|
||||||
|
else
|
||||||
|
panic("no dtb found");
|
||||||
|
diff --git a/arch/mips/pic32/pic32mzda/init.c b/arch/mips/pic32/pic32mzda/init.c
|
||||||
|
index 51599710472bc..406c6c5cec29b 100644
|
||||||
|
--- a/arch/mips/pic32/pic32mzda/init.c
|
||||||
|
+++ b/arch/mips/pic32/pic32mzda/init.c
|
||||||
|
@@ -36,7 +36,7 @@ static ulong get_fdtaddr(void)
|
||||||
|
if (fw_passed_dtb && !fw_arg2 && !fw_arg3)
|
||||||
|
return (ulong)fw_passed_dtb;
|
||||||
|
|
||||||
|
- if (__dtb_start < __dtb_end)
|
||||||
|
+ if (&__dtb_start < &__dtb_end)
|
||||||
|
ftaddr = (ulong)__dtb_start;
|
||||||
|
|
||||||
|
return ftaddr;
|
||||||
|
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
|
||||||
|
index 3c9cee9520ed5..ef51f811d4d9c 100644
|
||||||
|
--- a/drivers/block/drbd/drbd_nl.c
|
||||||
|
+++ b/drivers/block/drbd/drbd_nl.c
|
||||||
|
@@ -774,9 +774,11 @@ int drbd_adm_set_role(struct sk_buff *skb, struct genl_info *info)
|
||||||
|
mutex_lock(&adm_ctx.resource->adm_mutex);
|
||||||
|
|
||||||
|
if (info->genlhdr->cmd == DRBD_ADM_PRIMARY)
|
||||||
|
- retcode = drbd_set_role(adm_ctx.device, R_PRIMARY, parms.assume_uptodate);
|
||||||
|
+ retcode = (enum drbd_ret_code)drbd_set_role(adm_ctx.device,
|
||||||
|
+ R_PRIMARY, parms.assume_uptodate);
|
||||||
|
else
|
||||||
|
- retcode = drbd_set_role(adm_ctx.device, R_SECONDARY, 0);
|
||||||
|
+ retcode = (enum drbd_ret_code)drbd_set_role(adm_ctx.device,
|
||||||
|
+ R_SECONDARY, 0);
|
||||||
|
|
||||||
|
mutex_unlock(&adm_ctx.resource->adm_mutex);
|
||||||
|
genl_lock();
|
||||||
|
@@ -1933,7 +1935,7 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info)
|
||||||
|
drbd_flush_workqueue(&connection->sender_work);
|
||||||
|
|
||||||
|
rv = _drbd_request_state(device, NS(disk, D_ATTACHING), CS_VERBOSE);
|
||||||
|
- retcode = rv; /* FIXME: Type mismatch. */
|
||||||
|
+ retcode = (enum drbd_ret_code)rv;
|
||||||
|
drbd_resume_io(device);
|
||||||
|
if (rv < SS_SUCCESS)
|
||||||
|
goto fail;
|
||||||
|
@@ -2684,7 +2686,8 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info)
|
||||||
|
}
|
||||||
|
rcu_read_unlock();
|
||||||
|
|
||||||
|
- retcode = conn_request_state(connection, NS(conn, C_UNCONNECTED), CS_VERBOSE);
|
||||||
|
+ retcode = (enum drbd_ret_code)conn_request_state(connection,
|
||||||
|
+ NS(conn, C_UNCONNECTED), CS_VERBOSE);
|
||||||
|
|
||||||
|
conn_reconfig_done(connection);
|
||||||
|
mutex_unlock(&adm_ctx.resource->adm_mutex);
|
||||||
|
@@ -2790,7 +2793,7 @@ int drbd_adm_disconnect(struct sk_buff *skb, struct genl_info *info)
|
||||||
|
mutex_lock(&adm_ctx.resource->adm_mutex);
|
||||||
|
rv = conn_try_disconnect(connection, parms.force_disconnect);
|
||||||
|
if (rv < SS_SUCCESS)
|
||||||
|
- retcode = rv; /* FIXME: Type mismatch. */
|
||||||
|
+ retcode = (enum drbd_ret_code)rv;
|
||||||
|
else
|
||||||
|
retcode = NO_ERROR;
|
||||||
|
mutex_unlock(&adm_ctx.resource->adm_mutex);
|
||||||
|
diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
|
||||||
|
index efd995e3cb0b9..2c56f094b4974 100644
|
||||||
|
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
|
||||||
|
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
|
||||||
|
@@ -49,10 +49,7 @@ struct realtek_pci_sdmmc {
|
||||||
|
bool double_clk;
|
||||||
|
bool eject;
|
||||||
|
bool initial_mode;
|
||||||
|
- int power_state;
|
||||||
|
-#define SDMMC_POWER_ON 1
|
||||||
|
-#define SDMMC_POWER_OFF 0
|
||||||
|
-
|
||||||
|
+ int prev_power_state;
|
||||||
|
int sg_count;
|
||||||
|
s32 cookie;
|
||||||
|
int cookie_sg_count;
|
||||||
|
@@ -914,14 +911,21 @@ static int sd_set_bus_width(struct realtek_pci_sdmmc *host,
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int sd_power_on(struct realtek_pci_sdmmc *host)
|
||||||
|
+static int sd_power_on(struct realtek_pci_sdmmc *host, unsigned char power_mode)
|
||||||
|
{
|
||||||
|
struct rtsx_pcr *pcr = host->pcr;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
- if (host->power_state == SDMMC_POWER_ON)
|
||||||
|
+ if (host->prev_power_state == MMC_POWER_ON)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
+ if (host->prev_power_state == MMC_POWER_UP) {
|
||||||
|
+ rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, 0);
|
||||||
|
+ goto finish;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ msleep(100);
|
||||||
|
+
|
||||||
|
rtsx_pci_init_cmd(pcr);
|
||||||
|
rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SELECT, 0x07, SD_MOD_SEL);
|
||||||
|
rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SHARE_MODE,
|
||||||
|
@@ -940,11 +944,17 @@ static int sd_power_on(struct realtek_pci_sdmmc *host)
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
+ mdelay(1);
|
||||||
|
+
|
||||||
|
err = rtsx_pci_write_register(pcr, CARD_OE, SD_OUTPUT_EN, SD_OUTPUT_EN);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
- host->power_state = SDMMC_POWER_ON;
|
||||||
|
+ /* send at least 74 clocks */
|
||||||
|
+ rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, SD_CLK_TOGGLE_EN);
|
||||||
|
+
|
||||||
|
+finish:
|
||||||
|
+ host->prev_power_state = power_mode;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -953,7 +963,7 @@ static int sd_power_off(struct realtek_pci_sdmmc *host)
|
||||||
|
struct rtsx_pcr *pcr = host->pcr;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
- host->power_state = SDMMC_POWER_OFF;
|
||||||
|
+ host->prev_power_state = MMC_POWER_OFF;
|
||||||
|
|
||||||
|
rtsx_pci_init_cmd(pcr);
|
||||||
|
|
||||||
|
@@ -979,7 +989,7 @@ static int sd_set_power_mode(struct realtek_pci_sdmmc *host,
|
||||||
|
if (power_mode == MMC_POWER_OFF)
|
||||||
|
err = sd_power_off(host);
|
||||||
|
else
|
||||||
|
- err = sd_power_on(host);
|
||||||
|
+ err = sd_power_on(host, power_mode);
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
@@ -1417,7 +1427,7 @@ static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev)
|
||||||
|
host->mmc = mmc;
|
||||||
|
host->pdev = pdev;
|
||||||
|
host->cookie = -1;
|
||||||
|
- host->power_state = SDMMC_POWER_OFF;
|
||||||
|
+ host->prev_power_state = MMC_POWER_OFF;
|
||||||
|
INIT_WORK(&host->work, sd_request);
|
||||||
|
platform_set_drvdata(pdev, host);
|
||||||
|
pcr->slots[RTSX_SD_CARD].p_dev = pdev;
|
||||||
|
diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c
|
||||||
|
index a2dbd7ae9db24..c6a176d8681c0 100644
|
||||||
|
--- a/drivers/net/can/grcan.c
|
||||||
|
+++ b/drivers/net/can/grcan.c
|
||||||
|
@@ -245,7 +245,7 @@ struct grcan_device_config {
|
||||||
|
.rxsize = GRCAN_DEFAULT_BUFFER_SIZE, \
|
||||||
|
}
|
||||||
|
|
||||||
|
-#define GRCAN_TXBUG_SAFE_GRLIB_VERSION 0x4100
|
||||||
|
+#define GRCAN_TXBUG_SAFE_GRLIB_VERSION 4100
|
||||||
|
#define GRLIB_VERSION_MASK 0xffff
|
||||||
|
|
||||||
|
/* GRCAN private data structure */
|
||||||
|
@@ -1141,7 +1141,7 @@ static int grcan_close(struct net_device *dev)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int grcan_transmit_catch_up(struct net_device *dev, int budget)
|
||||||
|
+static void grcan_transmit_catch_up(struct net_device *dev)
|
||||||
|
{
|
||||||
|
struct grcan_priv *priv = netdev_priv(dev);
|
||||||
|
unsigned long flags;
|
||||||
|
@@ -1149,7 +1149,7 @@ static int grcan_transmit_catch_up(struct net_device *dev, int budget)
|
||||||
|
|
||||||
|
spin_lock_irqsave(&priv->lock, flags);
|
||||||
|
|
||||||
|
- work_done = catch_up_echo_skb(dev, budget, true);
|
||||||
|
+ work_done = catch_up_echo_skb(dev, -1, true);
|
||||||
|
if (work_done) {
|
||||||
|
if (!priv->resetting && !priv->closing &&
|
||||||
|
!(priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY))
|
||||||
|
@@ -1163,8 +1163,6 @@ static int grcan_transmit_catch_up(struct net_device *dev, int budget)
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
-
|
||||||
|
- return work_done;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int grcan_receive(struct net_device *dev, int budget)
|
||||||
|
@@ -1246,19 +1244,13 @@ static int grcan_poll(struct napi_struct *napi, int budget)
|
||||||
|
struct net_device *dev = priv->dev;
|
||||||
|
struct grcan_registers __iomem *regs = priv->regs;
|
||||||
|
unsigned long flags;
|
||||||
|
- int tx_work_done, rx_work_done;
|
||||||
|
- int rx_budget = budget / 2;
|
||||||
|
- int tx_budget = budget - rx_budget;
|
||||||
|
+ int work_done;
|
||||||
|
|
||||||
|
- /* Half of the budget for receiveing messages */
|
||||||
|
- rx_work_done = grcan_receive(dev, rx_budget);
|
||||||
|
+ work_done = grcan_receive(dev, budget);
|
||||||
|
|
||||||
|
- /* Half of the budget for transmitting messages as that can trigger echo
|
||||||
|
- * frames being received
|
||||||
|
- */
|
||||||
|
- tx_work_done = grcan_transmit_catch_up(dev, tx_budget);
|
||||||
|
+ grcan_transmit_catch_up(dev);
|
||||||
|
|
||||||
|
- if (rx_work_done < rx_budget && tx_work_done < tx_budget) {
|
||||||
|
+ if (work_done < budget) {
|
||||||
|
napi_complete(napi);
|
||||||
|
|
||||||
|
/* Guarantee no interference with a running reset that otherwise
|
||||||
|
@@ -1275,7 +1267,7 @@ static int grcan_poll(struct napi_struct *napi, int budget)
|
||||||
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
- return rx_work_done + tx_work_done;
|
||||||
|
+ return work_done;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Work tx bug by waiting while for the risky situation to clear. If that fails,
|
||||||
|
@@ -1665,6 +1657,7 @@ exit_free_candev:
|
||||||
|
static int grcan_probe(struct platform_device *ofdev)
|
||||||
|
{
|
||||||
|
struct device_node *np = ofdev->dev.of_node;
|
||||||
|
+ struct device_node *sysid_parent;
|
||||||
|
struct resource *res;
|
||||||
|
u32 sysid, ambafreq;
|
||||||
|
int irq, err;
|
||||||
|
@@ -1674,10 +1667,15 @@ static int grcan_probe(struct platform_device *ofdev)
|
||||||
|
/* Compare GRLIB version number with the first that does not
|
||||||
|
* have the tx bug (see start_xmit)
|
||||||
|
*/
|
||||||
|
- err = of_property_read_u32(np, "systemid", &sysid);
|
||||||
|
- if (!err && ((sysid & GRLIB_VERSION_MASK)
|
||||||
|
- >= GRCAN_TXBUG_SAFE_GRLIB_VERSION))
|
||||||
|
- txbug = false;
|
||||||
|
+ sysid_parent = of_find_node_by_path("/ambapp0");
|
||||||
|
+ if (sysid_parent) {
|
||||||
|
+ of_node_get(sysid_parent);
|
||||||
|
+ err = of_property_read_u32(sysid_parent, "systemid", &sysid);
|
||||||
|
+ if (!err && ((sysid & GRLIB_VERSION_MASK) >=
|
||||||
|
+ GRCAN_TXBUG_SAFE_GRLIB_VERSION))
|
||||||
|
+ txbug = false;
|
||||||
|
+ of_node_put(sysid_parent);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
err = of_property_read_u32(np, "freq", &ambafreq);
|
||||||
|
if (err) {
|
||||||
|
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
|
||||||
|
index 819796fb9d46f..0f231e96ae25f 100644
|
||||||
|
--- a/include/net/bluetooth/hci_core.h
|
||||||
|
+++ b/include/net/bluetooth/hci_core.h
|
||||||
|
@@ -32,6 +32,9 @@
|
||||||
|
/* HCI priority */
|
||||||
|
#define HCI_PRIO_MAX 7
|
||||||
|
|
||||||
|
+/* HCI maximum id value */
|
||||||
|
+#define HCI_MAX_ID 10000
|
||||||
|
+
|
||||||
|
/* HCI Core structures */
|
||||||
|
struct inquiry_data {
|
||||||
|
bdaddr_t bdaddr;
|
||||||
|
diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
|
||||||
|
index af817e5060fbf..bb6cb42656b16 100644
|
||||||
|
--- a/mm/userfaultfd.c
|
||||||
|
+++ b/mm/userfaultfd.c
|
||||||
|
@@ -50,6 +50,8 @@ static int mcopy_atomic_pte(struct mm_struct *dst_mm,
|
||||||
|
/* don't free the page */
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ flush_dcache_page(page);
|
||||||
|
} else {
|
||||||
|
page = *pagep;
|
||||||
|
*pagep = NULL;
|
||||||
|
@@ -267,6 +269,7 @@ retry:
|
||||||
|
err = -EFAULT;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
+ flush_dcache_page(page);
|
||||||
|
goto retry;
|
||||||
|
} else
|
||||||
|
BUG_ON(page);
|
||||||
|
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
|
||||||
|
index 40e6e5feb1e06..6f99da11d2073 100644
|
||||||
|
--- a/net/bluetooth/hci_core.c
|
||||||
|
+++ b/net/bluetooth/hci_core.c
|
||||||
|
@@ -3064,10 +3064,10 @@ int hci_register_dev(struct hci_dev *hdev)
|
||||||
|
*/
|
||||||
|
switch (hdev->dev_type) {
|
||||||
|
case HCI_PRIMARY:
|
||||||
|
- id = ida_simple_get(&hci_index_ida, 0, 0, GFP_KERNEL);
|
||||||
|
+ id = ida_simple_get(&hci_index_ida, 0, HCI_MAX_ID, GFP_KERNEL);
|
||||||
|
break;
|
||||||
|
case HCI_AMP:
|
||||||
|
- id = ida_simple_get(&hci_index_ida, 1, 0, GFP_KERNEL);
|
||||||
|
+ id = ida_simple_get(&hci_index_ida, 1, HCI_MAX_ID, GFP_KERNEL);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return -EINVAL;
|
||||||
|
@@ -3076,7 +3076,7 @@ int hci_register_dev(struct hci_dev *hdev)
|
||||||
|
if (id < 0)
|
||||||
|
return id;
|
||||||
|
|
||||||
|
- sprintf(hdev->name, "hci%d", id);
|
||||||
|
+ snprintf(hdev->name, sizeof(hdev->name), "hci%d", id);
|
||||||
|
hdev->id = id;
|
||||||
|
|
||||||
|
BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus);
|
||||||
375
patch/kernel/archive/sun50iw9-4.9/patch-4.9.314-315.patch
Normal file
375
patch/kernel/archive/sun50iw9-4.9/patch-4.9.314-315.patch
Normal file
@@ -0,0 +1,375 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 734a4cc6ac464..b849f2683ae68 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 314
|
||||||
|
+SUBLEVEL = 315
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c
|
||||||
|
index cb28e4b4fb108..b87ca56fb774e 100644
|
||||||
|
--- a/drivers/hwmon/f71882fg.c
|
||||||
|
+++ b/drivers/hwmon/f71882fg.c
|
||||||
|
@@ -1590,8 +1590,9 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
|
||||||
|
temp *= 125;
|
||||||
|
if (sign)
|
||||||
|
temp -= 128000;
|
||||||
|
- } else
|
||||||
|
- temp = data->temp[nr] * 1000;
|
||||||
|
+ } else {
|
||||||
|
+ temp = ((s8)data->temp[nr]) * 1000;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
return sprintf(buf, "%d\n", temp);
|
||||||
|
}
|
||||||
|
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
|
||||||
|
index 22bc3dc44298c..aa2cef8675f4e 100644
|
||||||
|
--- a/drivers/net/ethernet/sfc/ef10.c
|
||||||
|
+++ b/drivers/net/ethernet/sfc/ef10.c
|
||||||
|
@@ -5197,6 +5197,11 @@ static int efx_ef10_mtd_probe(struct efx_nic *efx)
|
||||||
|
n_parts++;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (!n_parts) {
|
||||||
|
+ kfree(parts);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
rc = efx_mtd_add(efx, &parts[0].common, n_parts, sizeof(*parts));
|
||||||
|
fail:
|
||||||
|
if (rc)
|
||||||
|
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
|
||||||
|
index a34647efb5ea5..2cd1b3cfcc09a 100644
|
||||||
|
--- a/drivers/net/wireless/mac80211_hwsim.c
|
||||||
|
+++ b/drivers/net/wireless/mac80211_hwsim.c
|
||||||
|
@@ -1987,11 +1987,13 @@ static void hw_scan_work(struct work_struct *work)
|
||||||
|
memcpy(skb_put(probe, req->ie_len), req->ie,
|
||||||
|
req->ie_len);
|
||||||
|
|
||||||
|
+ rcu_read_lock();
|
||||||
|
if (!ieee80211_tx_prepare_skb(hwsim->hw,
|
||||||
|
hwsim->hw_scan_vif,
|
||||||
|
probe,
|
||||||
|
hwsim->tmp_chan->band,
|
||||||
|
NULL)) {
|
||||||
|
+ rcu_read_unlock();
|
||||||
|
kfree_skb(probe);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
@@ -1999,6 +2001,7 @@ static void hw_scan_work(struct work_struct *work)
|
||||||
|
local_bh_disable();
|
||||||
|
mac80211_hwsim_tx_frame(hwsim->hw, probe,
|
||||||
|
hwsim->tmp_chan);
|
||||||
|
+ rcu_read_unlock();
|
||||||
|
local_bh_enable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/drivers/s390/net/ctcm_mpc.c b/drivers/s390/net/ctcm_mpc.c
|
||||||
|
index c103fc7efe9fd..f2559e20df705 100644
|
||||||
|
--- a/drivers/s390/net/ctcm_mpc.c
|
||||||
|
+++ b/drivers/s390/net/ctcm_mpc.c
|
||||||
|
@@ -624,8 +624,6 @@ static void mpc_rcvd_sweep_resp(struct mpcg_info *mpcginfo)
|
||||||
|
ctcm_clear_busy_do(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
- kfree(mpcginfo);
|
||||||
|
-
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
@@ -1205,10 +1203,10 @@ static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
|
||||||
|
CTCM_FUNTAIL, dev->name);
|
||||||
|
priv->stats.rx_dropped++;
|
||||||
|
/* mpcginfo only used for non-data transfers */
|
||||||
|
- kfree(mpcginfo);
|
||||||
|
if (do_debug_data)
|
||||||
|
ctcmpc_dump_skb(pskb, -8);
|
||||||
|
}
|
||||||
|
+ kfree(mpcginfo);
|
||||||
|
}
|
||||||
|
done:
|
||||||
|
|
||||||
|
@@ -1998,7 +1996,6 @@ static void mpc_action_rcvd_xid0(fsm_instance *fsm, int event, void *arg)
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
- kfree(mpcginfo);
|
||||||
|
|
||||||
|
CTCM_PR_DEBUG("ctcmpc:%s() %s xid2:%i xid7:%i xidt_p2:%i \n",
|
||||||
|
__func__, ch->id, grp->outstanding_xid2,
|
||||||
|
@@ -2059,7 +2056,6 @@ static void mpc_action_rcvd_xid7(fsm_instance *fsm, int event, void *arg)
|
||||||
|
mpc_validate_xid(mpcginfo);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
- kfree(mpcginfo);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/s390/net/ctcm_sysfs.c b/drivers/s390/net/ctcm_sysfs.c
|
||||||
|
index ddb0aa321339f..07b7177abf260 100644
|
||||||
|
--- a/drivers/s390/net/ctcm_sysfs.c
|
||||||
|
+++ b/drivers/s390/net/ctcm_sysfs.c
|
||||||
|
@@ -38,11 +38,12 @@ static ssize_t ctcm_buffer_write(struct device *dev,
|
||||||
|
struct ctcm_priv *priv = dev_get_drvdata(dev);
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
- ndev = priv->channel[CTCM_READ]->netdev;
|
||||||
|
- if (!(priv && priv->channel[CTCM_READ] && ndev)) {
|
||||||
|
+ if (!(priv && priv->channel[CTCM_READ] &&
|
||||||
|
+ priv->channel[CTCM_READ]->netdev)) {
|
||||||
|
CTCM_DBF_TEXT(SETUP, CTC_DBF_ERROR, "bfnondev");
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
+ ndev = priv->channel[CTCM_READ]->netdev;
|
||||||
|
|
||||||
|
rc = kstrtouint(buf, 0, &bs1);
|
||||||
|
if (rc)
|
||||||
|
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
|
||||||
|
index 251db0a02e73c..4d3caad7e9814 100644
|
||||||
|
--- a/drivers/s390/net/lcs.c
|
||||||
|
+++ b/drivers/s390/net/lcs.c
|
||||||
|
@@ -1761,10 +1761,11 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd)
|
||||||
|
lcs_schedule_recovery(card);
|
||||||
|
break;
|
||||||
|
case LCS_CMD_STOPLAN:
|
||||||
|
- pr_warn("Stoplan for %s initiated by LGW\n",
|
||||||
|
- card->dev->name);
|
||||||
|
- if (card->dev)
|
||||||
|
+ if (card->dev) {
|
||||||
|
+ pr_warn("Stoplan for %s initiated by LGW\n",
|
||||||
|
+ card->dev->name);
|
||||||
|
netif_carrier_off(card->dev);
|
||||||
|
+ }
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LCS_DBF_TEXT(5, trace, "noLGWcmd");
|
||||||
|
diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/digicolor-usart.c
|
||||||
|
index 50ec5f1ac77f4..794864fac6250 100644
|
||||||
|
--- a/drivers/tty/serial/digicolor-usart.c
|
||||||
|
+++ b/drivers/tty/serial/digicolor-usart.c
|
||||||
|
@@ -476,10 +476,10 @@ static int digicolor_uart_probe(struct platform_device *pdev)
|
||||||
|
return PTR_ERR(uart_clk);
|
||||||
|
|
||||||
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
|
- dp->port.mapbase = res->start;
|
||||||
|
dp->port.membase = devm_ioremap_resource(&pdev->dev, res);
|
||||||
|
if (IS_ERR(dp->port.membase))
|
||||||
|
return PTR_ERR(dp->port.membase);
|
||||||
|
+ dp->port.mapbase = res->start;
|
||||||
|
|
||||||
|
irq = platform_get_irq(pdev, 0);
|
||||||
|
if (irq < 0)
|
||||||
|
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
|
||||||
|
index f9d39c993f2f3..fb41efd6b8927 100644
|
||||||
|
--- a/drivers/usb/class/cdc-wdm.c
|
||||||
|
+++ b/drivers/usb/class/cdc-wdm.c
|
||||||
|
@@ -744,6 +744,7 @@ static int wdm_release(struct inode *inode, struct file *file)
|
||||||
|
kill_urbs(desc);
|
||||||
|
spin_lock_irq(&desc->iuspin);
|
||||||
|
desc->resp_count = 0;
|
||||||
|
+ clear_bit(WDM_RESPONDING, &desc->flags);
|
||||||
|
spin_unlock_irq(&desc->iuspin);
|
||||||
|
desc->manage_power(desc->intf, 0);
|
||||||
|
} else {
|
||||||
|
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
|
||||||
|
index 3fcf53e85adbb..5b198d881a40a 100644
|
||||||
|
--- a/drivers/usb/serial/option.c
|
||||||
|
+++ b/drivers/usb/serial/option.c
|
||||||
|
@@ -2101,10 +2101,14 @@ static const struct usb_device_id option_ids[] = {
|
||||||
|
.driver_info = RSVD(3) },
|
||||||
|
{ USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 (IOT version) */
|
||||||
|
.driver_info = RSVD(4) | RSVD(5) | RSVD(6) },
|
||||||
|
+ { USB_DEVICE(0x1782, 0x4d10) }, /* Fibocom L610 (AT mode) */
|
||||||
|
+ { USB_DEVICE_INTERFACE_CLASS(0x1782, 0x4d11, 0xff) }, /* Fibocom L610 (ECM/RNDIS mode) */
|
||||||
|
{ USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */
|
||||||
|
.driver_info = RSVD(4) | RSVD(5) },
|
||||||
|
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */
|
||||||
|
.driver_info = RSVD(6) },
|
||||||
|
+ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0106, 0xff) }, /* Fibocom MA510 (ECM mode w/ diag intf.) */
|
||||||
|
+ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x010a, 0xff) }, /* Fibocom MA510 (ECM mode) */
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */
|
||||||
|
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
|
||||||
|
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
|
||||||
|
index c5fa5b704ec57..008bf34978d5c 100644
|
||||||
|
--- a/drivers/usb/serial/pl2303.c
|
||||||
|
+++ b/drivers/usb/serial/pl2303.c
|
||||||
|
@@ -95,6 +95,7 @@ static const struct usb_device_id id_table[] = {
|
||||||
|
{ USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) },
|
||||||
|
{ USB_DEVICE(HP_VENDOR_ID, HP_LCM960_PRODUCT_ID) },
|
||||||
|
{ USB_DEVICE(HP_VENDOR_ID, HP_LM920_PRODUCT_ID) },
|
||||||
|
+ { USB_DEVICE(HP_VENDOR_ID, HP_LM930_PRODUCT_ID) },
|
||||||
|
{ USB_DEVICE(HP_VENDOR_ID, HP_LM940_PRODUCT_ID) },
|
||||||
|
{ USB_DEVICE(HP_VENDOR_ID, HP_TD620_PRODUCT_ID) },
|
||||||
|
{ USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) },
|
||||||
|
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
|
||||||
|
index 908865495b489..849f45a694309 100644
|
||||||
|
--- a/drivers/usb/serial/pl2303.h
|
||||||
|
+++ b/drivers/usb/serial/pl2303.h
|
||||||
|
@@ -133,6 +133,7 @@
|
||||||
|
#define HP_TD620_PRODUCT_ID 0x0956
|
||||||
|
#define HP_LD960_PRODUCT_ID 0x0b39
|
||||||
|
#define HP_LD381_PRODUCT_ID 0x0f7f
|
||||||
|
+#define HP_LM930_PRODUCT_ID 0x0f9b
|
||||||
|
#define HP_LCM220_PRODUCT_ID 0x3139
|
||||||
|
#define HP_LCM960_PRODUCT_ID 0x3239
|
||||||
|
#define HP_LD220_PRODUCT_ID 0x3524
|
||||||
|
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
|
||||||
|
index f0bd6a66f551e..d14e0bc93c61b 100644
|
||||||
|
--- a/drivers/usb/serial/qcserial.c
|
||||||
|
+++ b/drivers/usb/serial/qcserial.c
|
||||||
|
@@ -170,6 +170,8 @@ static const struct usb_device_id id_table[] = {
|
||||||
|
{DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */
|
||||||
|
{DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */
|
||||||
|
{DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9191 QDL */
|
||||||
|
+ {DEVICE_SWI(0x1199, 0xc080)}, /* Sierra Wireless EM7590 QDL */
|
||||||
|
+ {DEVICE_SWI(0x1199, 0xc081)}, /* Sierra Wireless EM7590 */
|
||||||
|
{DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */
|
||||||
|
{DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */
|
||||||
|
{DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */
|
||||||
|
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
|
||||||
|
index b692edeb0b90e..27abbd7fbb2b8 100644
|
||||||
|
--- a/include/linux/netdev_features.h
|
||||||
|
+++ b/include/linux/netdev_features.h
|
||||||
|
@@ -139,7 +139,7 @@ enum {
|
||||||
|
#define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL)
|
||||||
|
#define NETIF_F_HW_TC __NETIF_F(HW_TC)
|
||||||
|
|
||||||
|
-/* Finds the next feature with the highest number of the range of start till 0.
|
||||||
|
+/* Finds the next feature with the highest number of the range of start-1 till 0.
|
||||||
|
*/
|
||||||
|
static inline int find_next_netdev_feature(u64 feature, unsigned long start)
|
||||||
|
{
|
||||||
|
@@ -158,7 +158,7 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start)
|
||||||
|
for ((bit) = find_next_netdev_feature((mask_addr), \
|
||||||
|
NETDEV_FEATURE_COUNT); \
|
||||||
|
(bit) >= 0; \
|
||||||
|
- (bit) = find_next_netdev_feature((mask_addr), (bit) - 1))
|
||||||
|
+ (bit) = find_next_netdev_feature((mask_addr), (bit)))
|
||||||
|
|
||||||
|
/* Features valid for ethtool to change */
|
||||||
|
/* = all defined minus driver/device-class-related */
|
||||||
|
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
|
||||||
|
index dd4e46af1e531..23646a08ed7bd 100644
|
||||||
|
--- a/net/ipv4/ping.c
|
||||||
|
+++ b/net/ipv4/ping.c
|
||||||
|
@@ -302,6 +302,7 @@ static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
|
||||||
|
struct net *net = sock_net(sk);
|
||||||
|
if (sk->sk_family == AF_INET) {
|
||||||
|
struct sockaddr_in *addr = (struct sockaddr_in *) uaddr;
|
||||||
|
+ u32 tb_id = RT_TABLE_LOCAL;
|
||||||
|
int chk_addr_ret;
|
||||||
|
|
||||||
|
if (addr_len < sizeof(*addr))
|
||||||
|
@@ -315,7 +316,8 @@ static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
|
||||||
|
pr_debug("ping_check_bind_addr(sk=%p,addr=%pI4,port=%d)\n",
|
||||||
|
sk, &addr->sin_addr.s_addr, ntohs(addr->sin_port));
|
||||||
|
|
||||||
|
- chk_addr_ret = inet_addr_type(net, addr->sin_addr.s_addr);
|
||||||
|
+ tb_id = l3mdev_fib_table_by_index(net, sk->sk_bound_dev_if) ? : tb_id;
|
||||||
|
+ chk_addr_ret = inet_addr_type_table(net, addr->sin_addr.s_addr, tb_id);
|
||||||
|
|
||||||
|
if (addr->sin_addr.s_addr == htonl(INADDR_ANY))
|
||||||
|
chk_addr_ret = RTN_LOCAL;
|
||||||
|
@@ -357,6 +359,14 @@ static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (!dev && sk->sk_bound_dev_if) {
|
||||||
|
+ dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if);
|
||||||
|
+ if (!dev) {
|
||||||
|
+ rcu_read_unlock();
|
||||||
|
+ return -ENODEV;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
has_addr = pingv6_ops.ipv6_chk_addr(net, &addr->sin6_addr, dev,
|
||||||
|
scoped);
|
||||||
|
rcu_read_unlock();
|
||||||
|
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
|
||||||
|
index f05b8d63dba38..624bdd74583b6 100644
|
||||||
|
--- a/net/ipv4/route.c
|
||||||
|
+++ b/net/ipv4/route.c
|
||||||
|
@@ -1606,6 +1606,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
|
||||||
|
#endif
|
||||||
|
RT_CACHE_STAT_INC(in_slow_mc);
|
||||||
|
|
||||||
|
+ skb_dst_drop(skb);
|
||||||
|
skb_dst_set(skb, &rth->dst);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
|
||||||
|
index a8674e9ff37b7..47b1631bf14cb 100644
|
||||||
|
--- a/net/netlink/af_netlink.c
|
||||||
|
+++ b/net/netlink/af_netlink.c
|
||||||
|
@@ -1929,7 +1929,6 @@ static int netlink_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
|
||||||
|
copied = len;
|
||||||
|
}
|
||||||
|
|
||||||
|
- skb_reset_transport_header(data_skb);
|
||||||
|
err = skb_copy_datagram_msg(data_skb, 0, msg, copied);
|
||||||
|
|
||||||
|
if (msg->msg_name) {
|
||||||
|
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
|
||||||
|
index e7aef841f87d2..1a55f6aecdfe4 100644
|
||||||
|
--- a/sound/soc/codecs/max98090.c
|
||||||
|
+++ b/sound/soc/codecs/max98090.c
|
||||||
|
@@ -419,6 +419,9 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol,
|
||||||
|
|
||||||
|
val = (val >> mc->shift) & mask;
|
||||||
|
|
||||||
|
+ if (sel < 0 || sel > mc->max)
|
||||||
|
+ return -EINVAL;
|
||||||
|
+
|
||||||
|
*select = sel;
|
||||||
|
|
||||||
|
/* Setting a volume is only valid if it is already On */
|
||||||
|
@@ -433,7 +436,7 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol,
|
||||||
|
mask << mc->shift,
|
||||||
|
sel << mc->shift);
|
||||||
|
|
||||||
|
- return 0;
|
||||||
|
+ return *select != val;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char *max98090_perf_pwr_text[] =
|
||||||
|
diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
|
||||||
|
index 74968ddee49fa..90ba5521c189d 100644
|
||||||
|
--- a/sound/soc/soc-ops.c
|
||||||
|
+++ b/sound/soc/soc-ops.c
|
||||||
|
@@ -528,7 +528,15 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
|
||||||
|
unsigned int mask = (1 << fls(max)) - 1;
|
||||||
|
unsigned int invert = mc->invert;
|
||||||
|
unsigned int val, val_mask;
|
||||||
|
- int err, ret;
|
||||||
|
+ int err, ret, tmp;
|
||||||
|
+
|
||||||
|
+ tmp = ucontrol->value.integer.value[0];
|
||||||
|
+ if (tmp < 0)
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ if (mc->platform_max && tmp > mc->platform_max)
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ if (tmp > mc->max - mc->min + 1)
|
||||||
|
+ return -EINVAL;
|
||||||
|
|
||||||
|
if (invert)
|
||||||
|
val = (max - ucontrol->value.integer.value[0]) & mask;
|
||||||
|
@@ -543,6 +551,14 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
|
||||||
|
ret = err;
|
||||||
|
|
||||||
|
if (snd_soc_volsw_is_stereo(mc)) {
|
||||||
|
+ tmp = ucontrol->value.integer.value[1];
|
||||||
|
+ if (tmp < 0)
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ if (mc->platform_max && tmp > mc->platform_max)
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ if (tmp > mc->max - mc->min + 1)
|
||||||
|
+ return -EINVAL;
|
||||||
|
+
|
||||||
|
if (invert)
|
||||||
|
val = (max - ucontrol->value.integer.value[1]) & mask;
|
||||||
|
else
|
||||||
652
patch/kernel/archive/sun50iw9-4.9/patch-4.9.315-316.patch
Normal file
652
patch/kernel/archive/sun50iw9-4.9/patch-4.9.315-316.patch
Normal file
@@ -0,0 +1,652 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index b849f2683ae68..24a0bb5416ff5 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 315
|
||||||
|
+SUBLEVEL = 316
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
|
||||||
|
index 77ec669fd5ee1..247229e69322d 100644
|
||||||
|
--- a/arch/arm/kernel/entry-armv.S
|
||||||
|
+++ b/arch/arm/kernel/entry-armv.S
|
||||||
|
@@ -1074,7 +1074,7 @@ vector_bhb_loop8_\name:
|
||||||
|
|
||||||
|
@ bhb workaround
|
||||||
|
mov r0, #8
|
||||||
|
-3: b . + 4
|
||||||
|
+3: W(b) . + 4
|
||||||
|
subs r0, r0, #1
|
||||||
|
bne 3b
|
||||||
|
dsb
|
||||||
|
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
|
||||||
|
index c10c1de244eba..83d0aa217bb25 100644
|
||||||
|
--- a/arch/arm/kernel/stacktrace.c
|
||||||
|
+++ b/arch/arm/kernel/stacktrace.c
|
||||||
|
@@ -50,17 +50,17 @@ int notrace unwind_frame(struct stackframe *frame)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
frame->sp = frame->fp;
|
||||||
|
- frame->fp = *(unsigned long *)(fp);
|
||||||
|
- frame->pc = *(unsigned long *)(fp + 4);
|
||||||
|
+ frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp));
|
||||||
|
+ frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 4));
|
||||||
|
#else
|
||||||
|
/* check current frame pointer is within bounds */
|
||||||
|
if (fp < low + 12 || fp > high - 4)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
/* restore the registers from the stack frame */
|
||||||
|
- frame->fp = *(unsigned long *)(fp - 12);
|
||||||
|
- frame->sp = *(unsigned long *)(fp - 8);
|
||||||
|
- frame->pc = *(unsigned long *)(fp - 4);
|
||||||
|
+ frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp - 12));
|
||||||
|
+ frame->sp = READ_ONCE_NOCHECK(*(unsigned long *)(fp - 8));
|
||||||
|
+ frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp - 4));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
diff --git a/arch/arm/mm/proc-v7-bugs.c b/arch/arm/mm/proc-v7-bugs.c
|
||||||
|
index 1b6e770bc1cd3..8b78694d56b88 100644
|
||||||
|
--- a/arch/arm/mm/proc-v7-bugs.c
|
||||||
|
+++ b/arch/arm/mm/proc-v7-bugs.c
|
||||||
|
@@ -297,6 +297,7 @@ void cpu_v7_ca15_ibe(void)
|
||||||
|
{
|
||||||
|
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(0)))
|
||||||
|
cpu_v7_spectre_v2_init();
|
||||||
|
+ cpu_v7_spectre_bhb_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void cpu_v7_bugs_init(void)
|
||||||
|
diff --git a/arch/mips/lantiq/falcon/sysctrl.c b/arch/mips/lantiq/falcon/sysctrl.c
|
||||||
|
index 82bbd0e2e298f..714d926594897 100644
|
||||||
|
--- a/arch/mips/lantiq/falcon/sysctrl.c
|
||||||
|
+++ b/arch/mips/lantiq/falcon/sysctrl.c
|
||||||
|
@@ -169,6 +169,8 @@ static inline void clkdev_add_sys(const char *dev, unsigned int module,
|
||||||
|
{
|
||||||
|
struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||||
|
|
||||||
|
+ if (!clk)
|
||||||
|
+ return;
|
||||||
|
clk->cl.dev_id = dev;
|
||||||
|
clk->cl.con_id = NULL;
|
||||||
|
clk->cl.clk = clk;
|
||||||
|
diff --git a/arch/mips/lantiq/xway/gptu.c b/arch/mips/lantiq/xway/gptu.c
|
||||||
|
index 0f1bbea1a8166..955d0d5cfbdb0 100644
|
||||||
|
--- a/arch/mips/lantiq/xway/gptu.c
|
||||||
|
+++ b/arch/mips/lantiq/xway/gptu.c
|
||||||
|
@@ -124,6 +124,8 @@ static inline void clkdev_add_gptu(struct device *dev, const char *con,
|
||||||
|
{
|
||||||
|
struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||||
|
|
||||||
|
+ if (!clk)
|
||||||
|
+ return;
|
||||||
|
clk->cl.dev_id = dev_name(dev);
|
||||||
|
clk->cl.con_id = con;
|
||||||
|
clk->cl.clk = clk;
|
||||||
|
diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c
|
||||||
|
index 95bec460b651f..dd7c36a193e30 100644
|
||||||
|
--- a/arch/mips/lantiq/xway/sysctrl.c
|
||||||
|
+++ b/arch/mips/lantiq/xway/sysctrl.c
|
||||||
|
@@ -331,6 +331,8 @@ static void clkdev_add_pmu(const char *dev, const char *con, bool deactivate,
|
||||||
|
{
|
||||||
|
struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||||
|
|
||||||
|
+ if (!clk)
|
||||||
|
+ return;
|
||||||
|
clk->cl.dev_id = dev;
|
||||||
|
clk->cl.con_id = con;
|
||||||
|
clk->cl.clk = clk;
|
||||||
|
@@ -354,6 +356,8 @@ static void clkdev_add_cgu(const char *dev, const char *con,
|
||||||
|
{
|
||||||
|
struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||||
|
|
||||||
|
+ if (!clk)
|
||||||
|
+ return;
|
||||||
|
clk->cl.dev_id = dev;
|
||||||
|
clk->cl.con_id = con;
|
||||||
|
clk->cl.clk = clk;
|
||||||
|
@@ -372,24 +376,28 @@ static void clkdev_add_pci(void)
|
||||||
|
struct clk *clk_ext = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||||
|
|
||||||
|
/* main pci clock */
|
||||||
|
- clk->cl.dev_id = "17000000.pci";
|
||||||
|
- clk->cl.con_id = NULL;
|
||||||
|
- clk->cl.clk = clk;
|
||||||
|
- clk->rate = CLOCK_33M;
|
||||||
|
- clk->rates = valid_pci_rates;
|
||||||
|
- clk->enable = pci_enable;
|
||||||
|
- clk->disable = pmu_disable;
|
||||||
|
- clk->module = 0;
|
||||||
|
- clk->bits = PMU_PCI;
|
||||||
|
- clkdev_add(&clk->cl);
|
||||||
|
+ if (clk) {
|
||||||
|
+ clk->cl.dev_id = "17000000.pci";
|
||||||
|
+ clk->cl.con_id = NULL;
|
||||||
|
+ clk->cl.clk = clk;
|
||||||
|
+ clk->rate = CLOCK_33M;
|
||||||
|
+ clk->rates = valid_pci_rates;
|
||||||
|
+ clk->enable = pci_enable;
|
||||||
|
+ clk->disable = pmu_disable;
|
||||||
|
+ clk->module = 0;
|
||||||
|
+ clk->bits = PMU_PCI;
|
||||||
|
+ clkdev_add(&clk->cl);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
/* use internal/external bus clock */
|
||||||
|
- clk_ext->cl.dev_id = "17000000.pci";
|
||||||
|
- clk_ext->cl.con_id = "external";
|
||||||
|
- clk_ext->cl.clk = clk_ext;
|
||||||
|
- clk_ext->enable = pci_ext_enable;
|
||||||
|
- clk_ext->disable = pci_ext_disable;
|
||||||
|
- clkdev_add(&clk_ext->cl);
|
||||||
|
+ if (clk_ext) {
|
||||||
|
+ clk_ext->cl.dev_id = "17000000.pci";
|
||||||
|
+ clk_ext->cl.con_id = "external";
|
||||||
|
+ clk_ext->cl.clk = clk_ext;
|
||||||
|
+ clk_ext->enable = pci_ext_enable;
|
||||||
|
+ clk_ext->disable = pci_ext_disable;
|
||||||
|
+ clkdev_add(&clk_ext->cl);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* xway socs can generate clocks on gpio pins */
|
||||||
|
@@ -409,9 +417,15 @@ static void clkdev_add_clkout(void)
|
||||||
|
char *name;
|
||||||
|
|
||||||
|
name = kzalloc(sizeof("clkout0"), GFP_KERNEL);
|
||||||
|
+ if (!name)
|
||||||
|
+ continue;
|
||||||
|
sprintf(name, "clkout%d", i);
|
||||||
|
|
||||||
|
clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||||
|
+ if (!clk) {
|
||||||
|
+ kfree(name);
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
clk->cl.dev_id = "1f103000.cgu";
|
||||||
|
clk->cl.con_id = name;
|
||||||
|
clk->cl.clk = clk;
|
||||||
|
diff --git a/arch/x86/um/shared/sysdep/syscalls_64.h b/arch/x86/um/shared/sysdep/syscalls_64.h
|
||||||
|
index 8a7d5e1da98e5..1e6875b4ffd83 100644
|
||||||
|
--- a/arch/x86/um/shared/sysdep/syscalls_64.h
|
||||||
|
+++ b/arch/x86/um/shared/sysdep/syscalls_64.h
|
||||||
|
@@ -10,13 +10,12 @@
|
||||||
|
#include <linux/msg.h>
|
||||||
|
#include <linux/shm.h>
|
||||||
|
|
||||||
|
-typedef long syscall_handler_t(void);
|
||||||
|
+typedef long syscall_handler_t(long, long, long, long, long, long);
|
||||||
|
|
||||||
|
extern syscall_handler_t *sys_call_table[];
|
||||||
|
|
||||||
|
#define EXECUTE_SYSCALL(syscall, regs) \
|
||||||
|
- (((long (*)(long, long, long, long, long, long)) \
|
||||||
|
- (*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(®s->regs), \
|
||||||
|
+ (((*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(®s->regs), \
|
||||||
|
UPT_SYSCALL_ARG2(®s->regs), \
|
||||||
|
UPT_SYSCALL_ARG3(®s->regs), \
|
||||||
|
UPT_SYSCALL_ARG4(®s->regs), \
|
||||||
|
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
|
||||||
|
index daa9cef96ec66..f4537a5eef024 100644
|
||||||
|
--- a/drivers/block/drbd/drbd_main.c
|
||||||
|
+++ b/drivers/block/drbd/drbd_main.c
|
||||||
|
@@ -193,7 +193,7 @@ void tl_release(struct drbd_connection *connection, unsigned int barrier_nr,
|
||||||
|
unsigned int set_size)
|
||||||
|
{
|
||||||
|
struct drbd_request *r;
|
||||||
|
- struct drbd_request *req = NULL;
|
||||||
|
+ struct drbd_request *req = NULL, *tmp = NULL;
|
||||||
|
int expect_epoch = 0;
|
||||||
|
int expect_size = 0;
|
||||||
|
|
||||||
|
@@ -247,8 +247,11 @@ void tl_release(struct drbd_connection *connection, unsigned int barrier_nr,
|
||||||
|
* to catch requests being barrier-acked "unexpectedly".
|
||||||
|
* It usually should find the same req again, or some READ preceding it. */
|
||||||
|
list_for_each_entry(req, &connection->transfer_log, tl_requests)
|
||||||
|
- if (req->epoch == expect_epoch)
|
||||||
|
+ if (req->epoch == expect_epoch) {
|
||||||
|
+ tmp = req;
|
||||||
|
break;
|
||||||
|
+ }
|
||||||
|
+ req = list_prepare_entry(tmp, &connection->transfer_log, tl_requests);
|
||||||
|
list_for_each_entry_safe_from(req, r, &connection->transfer_log, tl_requests) {
|
||||||
|
if (req->epoch != expect_epoch)
|
||||||
|
break;
|
||||||
|
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
|
||||||
|
index cfe1bfb3c20e9..216ee1057b12e 100644
|
||||||
|
--- a/drivers/block/floppy.c
|
||||||
|
+++ b/drivers/block/floppy.c
|
||||||
|
@@ -516,8 +516,8 @@ static unsigned long fdc_busy;
|
||||||
|
static DECLARE_WAIT_QUEUE_HEAD(fdc_wait);
|
||||||
|
static DECLARE_WAIT_QUEUE_HEAD(command_done);
|
||||||
|
|
||||||
|
-/* Errors during formatting are counted here. */
|
||||||
|
-static int format_errors;
|
||||||
|
+/* errors encountered on the current (or last) request */
|
||||||
|
+static int floppy_errors;
|
||||||
|
|
||||||
|
/* Format request descriptor. */
|
||||||
|
static struct format_descr format_req;
|
||||||
|
@@ -537,7 +537,6 @@ static struct format_descr format_req;
|
||||||
|
static char *floppy_track_buffer;
|
||||||
|
static int max_buffer_sectors;
|
||||||
|
|
||||||
|
-static int *errors;
|
||||||
|
typedef void (*done_f)(int);
|
||||||
|
static const struct cont_t {
|
||||||
|
void (*interrupt)(void);
|
||||||
|
@@ -1426,7 +1425,7 @@ static int interpret_errors(void)
|
||||||
|
if (DP->flags & FTD_MSG)
|
||||||
|
DPRINT("Over/Underrun - retrying\n");
|
||||||
|
bad = 0;
|
||||||
|
- } else if (*errors >= DP->max_errors.reporting) {
|
||||||
|
+ } else if (floppy_errors >= DP->max_errors.reporting) {
|
||||||
|
print_errors();
|
||||||
|
}
|
||||||
|
if (ST2 & ST2_WC || ST2 & ST2_BC)
|
||||||
|
@@ -2049,7 +2048,7 @@ static void bad_flp_intr(void)
|
||||||
|
if (!next_valid_format())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
- err_count = ++(*errors);
|
||||||
|
+ err_count = ++floppy_errors;
|
||||||
|
INFBOUND(DRWE->badness, err_count);
|
||||||
|
if (err_count > DP->max_errors.abort)
|
||||||
|
cont->done(0);
|
||||||
|
@@ -2194,9 +2193,8 @@ static int do_format(int drive, struct format_descr *tmp_format_req)
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
format_req = *tmp_format_req;
|
||||||
|
- format_errors = 0;
|
||||||
|
cont = &format_cont;
|
||||||
|
- errors = &format_errors;
|
||||||
|
+ floppy_errors = 0;
|
||||||
|
ret = wait_til_done(redo_format, true);
|
||||||
|
if (ret == -EINTR)
|
||||||
|
return -EINTR;
|
||||||
|
@@ -2679,7 +2677,7 @@ static int make_raw_rw_request(void)
|
||||||
|
*/
|
||||||
|
if (!direct ||
|
||||||
|
(indirect * 2 > direct * 3 &&
|
||||||
|
- *errors < DP->max_errors.read_track &&
|
||||||
|
+ floppy_errors < DP->max_errors.read_track &&
|
||||||
|
((!probing ||
|
||||||
|
(DP->read_track & (1 << DRS->probed_format)))))) {
|
||||||
|
max_size = blk_rq_sectors(current_req);
|
||||||
|
@@ -2812,8 +2810,10 @@ static int set_next_request(void)
|
||||||
|
fdc_queue = 0;
|
||||||
|
if (q) {
|
||||||
|
current_req = blk_fetch_request(q);
|
||||||
|
- if (current_req)
|
||||||
|
+ if (current_req) {
|
||||||
|
+ floppy_errors = 0;
|
||||||
|
break;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
} while (fdc_queue != old_pos);
|
||||||
|
|
||||||
|
@@ -2873,7 +2873,6 @@ do_request:
|
||||||
|
_floppy = floppy_type + DP->autodetect[DRS->probed_format];
|
||||||
|
} else
|
||||||
|
probing = 0;
|
||||||
|
- errors = &(current_req->errors);
|
||||||
|
tmp = make_raw_rw_request();
|
||||||
|
if (tmp < 2) {
|
||||||
|
request_done(tmp);
|
||||||
|
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
|
||||||
|
index bb70c5272fe8e..efd3ac2acea5a 100644
|
||||||
|
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
|
||||||
|
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
|
||||||
|
@@ -2830,6 +2830,7 @@ static void fetch_monitor_name(struct drm_dp_mst_topology_mgr *mgr,
|
||||||
|
|
||||||
|
mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port);
|
||||||
|
drm_edid_get_monitor_name(mst_edid, name, namelen);
|
||||||
|
+ kfree(mst_edid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
diff --git a/drivers/input/input.c b/drivers/input/input.c
|
||||||
|
index 5d94fc3fce0bb..378717d1b3b47 100644
|
||||||
|
--- a/drivers/input/input.c
|
||||||
|
+++ b/drivers/input/input.c
|
||||||
|
@@ -50,6 +50,17 @@ static DEFINE_MUTEX(input_mutex);
|
||||||
|
|
||||||
|
static const struct input_value input_value_sync = { EV_SYN, SYN_REPORT, 1 };
|
||||||
|
|
||||||
|
+static const unsigned int input_max_code[EV_CNT] = {
|
||||||
|
+ [EV_KEY] = KEY_MAX,
|
||||||
|
+ [EV_REL] = REL_MAX,
|
||||||
|
+ [EV_ABS] = ABS_MAX,
|
||||||
|
+ [EV_MSC] = MSC_MAX,
|
||||||
|
+ [EV_SW] = SW_MAX,
|
||||||
|
+ [EV_LED] = LED_MAX,
|
||||||
|
+ [EV_SND] = SND_MAX,
|
||||||
|
+ [EV_FF] = FF_MAX,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
static inline int is_event_supported(unsigned int code,
|
||||||
|
unsigned long *bm, unsigned int max)
|
||||||
|
{
|
||||||
|
@@ -1913,6 +1924,14 @@ EXPORT_SYMBOL(input_free_device);
|
||||||
|
*/
|
||||||
|
void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code)
|
||||||
|
{
|
||||||
|
+ if (type < EV_CNT && input_max_code[type] &&
|
||||||
|
+ code > input_max_code[type]) {
|
||||||
|
+ pr_err("%s: invalid code %u for type %u\n", __func__, code,
|
||||||
|
+ type);
|
||||||
|
+ dump_stack();
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
switch (type) {
|
||||||
|
case EV_KEY:
|
||||||
|
__set_bit(code, dev->keybit);
|
||||||
|
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
|
||||||
|
index 709a872ed484a..7b8c72a07900a 100644
|
||||||
|
--- a/drivers/mmc/card/block.c
|
||||||
|
+++ b/drivers/mmc/card/block.c
|
||||||
|
@@ -1192,7 +1192,7 @@ retry:
|
||||||
|
arg == MMC_TRIM_ARG ?
|
||||||
|
INAND_CMD38_ARG_TRIM :
|
||||||
|
INAND_CMD38_ARG_ERASE,
|
||||||
|
- 0);
|
||||||
|
+ card->ext_csd.generic_cmd6_time);
|
||||||
|
if (err)
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
@@ -1235,7 +1235,7 @@ retry:
|
||||||
|
arg == MMC_SECURE_TRIM1_ARG ?
|
||||||
|
INAND_CMD38_ARG_SECTRIM1 :
|
||||||
|
INAND_CMD38_ARG_SECERASE,
|
||||||
|
- 0);
|
||||||
|
+ card->ext_csd.generic_cmd6_time);
|
||||||
|
if (err)
|
||||||
|
goto out_retry;
|
||||||
|
}
|
||||||
|
@@ -1251,7 +1251,7 @@ retry:
|
||||||
|
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
|
||||||
|
INAND_CMD38_ARG_EXT_CSD,
|
||||||
|
INAND_CMD38_ARG_SECTRIM2,
|
||||||
|
- 0);
|
||||||
|
+ card->ext_csd.generic_cmd6_time);
|
||||||
|
if (err)
|
||||||
|
goto out_retry;
|
||||||
|
}
|
||||||
|
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
|
||||||
|
index f0fa6a799f7ce..dfe55e9d729f8 100644
|
||||||
|
--- a/drivers/mmc/core/core.c
|
||||||
|
+++ b/drivers/mmc/core/core.c
|
||||||
|
@@ -61,6 +61,8 @@
|
||||||
|
/* The max erase timeout, used when host->max_busy_timeout isn't specified */
|
||||||
|
#define MMC_ERASE_TIMEOUT_MS (60 * 1000) /* 60 s */
|
||||||
|
|
||||||
|
+#define MMC_CACHE_FLUSH_TIMEOUT_MS (30 * 1000) /* 30s */
|
||||||
|
+
|
||||||
|
static const unsigned freqs[] = { 400000, 300000, 200000, 100000 };
|
||||||
|
|
||||||
|
/*
|
||||||
|
@@ -2936,7 +2938,8 @@ int mmc_flush_cache(struct mmc_card *card)
|
||||||
|
(card->ext_csd.cache_size > 0) &&
|
||||||
|
(card->ext_csd.cache_ctrl & 1)) {
|
||||||
|
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
|
||||||
|
- EXT_CSD_FLUSH_CACHE, 1, 0);
|
||||||
|
+ EXT_CSD_FLUSH_CACHE, 1,
|
||||||
|
+ MMC_CACHE_FLUSH_TIMEOUT_MS);
|
||||||
|
if (err)
|
||||||
|
pr_err("%s: cache flush error %d\n",
|
||||||
|
mmc_hostname(card->host), err);
|
||||||
|
diff --git a/drivers/net/ethernet/dec/tulip/tulip_core.c b/drivers/net/ethernet/dec/tulip/tulip_core.c
|
||||||
|
index bbde90bc74fe2..6224f9d222981 100644
|
||||||
|
--- a/drivers/net/ethernet/dec/tulip/tulip_core.c
|
||||||
|
+++ b/drivers/net/ethernet/dec/tulip/tulip_core.c
|
||||||
|
@@ -1412,8 +1412,10 @@ static int tulip_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
|
|
||||||
|
/* alloc_etherdev ensures aligned and zeroed private structures */
|
||||||
|
dev = alloc_etherdev (sizeof (*tp));
|
||||||
|
- if (!dev)
|
||||||
|
+ if (!dev) {
|
||||||
|
+ pci_disable_device(pdev);
|
||||||
|
return -ENOMEM;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||||
|
if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) {
|
||||||
|
@@ -1792,6 +1794,7 @@ err_out_free_res:
|
||||||
|
|
||||||
|
err_out_free_netdev:
|
||||||
|
free_netdev (dev);
|
||||||
|
+ pci_disable_device(pdev);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
|
||||||
|
index 6bede67744864..d825e527ec1ac 100644
|
||||||
|
--- a/drivers/net/ethernet/intel/igb/igb_main.c
|
||||||
|
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
|
||||||
|
@@ -4546,7 +4546,8 @@ static void igb_watchdog_task(struct work_struct *work)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (adapter->link_speed != SPEED_1000)
|
||||||
|
+ if (adapter->link_speed != SPEED_1000 ||
|
||||||
|
+ !hw->phy.ops.read_reg)
|
||||||
|
goto no_wait;
|
||||||
|
|
||||||
|
/* wait for Remote receiver status OK */
|
||||||
|
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
|
||||||
|
index 147effc16316f..e62e3a9d52490 100644
|
||||||
|
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
|
||||||
|
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
|
||||||
|
@@ -3625,7 +3625,8 @@ static void ql_reset_work(struct work_struct *work)
|
||||||
|
qdev->mem_map_registers;
|
||||||
|
unsigned long hw_flags;
|
||||||
|
|
||||||
|
- if (test_bit((QL_RESET_PER_SCSI | QL_RESET_START), &qdev->flags)) {
|
||||||
|
+ if (test_bit(QL_RESET_PER_SCSI, &qdev->flags) ||
|
||||||
|
+ test_bit(QL_RESET_START, &qdev->flags)) {
|
||||||
|
clear_bit(QL_LINK_MASTER, &qdev->flags);
|
||||||
|
|
||||||
|
/*
|
||||||
|
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
|
||||||
|
index 49eaede34eea6..9beb93479e282 100644
|
||||||
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
|
||||||
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
|
||||||
|
@@ -183,7 +183,7 @@ static int stmmac_pci_probe(struct pci_dev *pdev,
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
/* Enable pci device */
|
||||||
|
- ret = pci_enable_device(pdev);
|
||||||
|
+ ret = pcim_enable_device(pdev);
|
||||||
|
if (ret) {
|
||||||
|
dev_err(&pdev->dev, "%s: ERROR: failed to enable device\n",
|
||||||
|
__func__);
|
||||||
|
@@ -241,8 +241,6 @@ static void stmmac_pci_remove(struct pci_dev *pdev)
|
||||||
|
pcim_iounmap_regions(pdev, BIT(i));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- pci_disable_device(pdev);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int stmmac_pci_suspend(struct device *dev)
|
||||||
|
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
|
||||||
|
index 56a8031b56b37..cce959f281b72 100644
|
||||||
|
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
|
||||||
|
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
|
||||||
|
@@ -595,6 +595,7 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx,
|
||||||
|
if (dma_mapping_error(&adapter->pdev->dev,
|
||||||
|
rbi->dma_addr)) {
|
||||||
|
dev_kfree_skb_any(rbi->skb);
|
||||||
|
+ rbi->skb = NULL;
|
||||||
|
rq->stats.rx_buf_alloc_failure++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
@@ -619,6 +620,7 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx,
|
||||||
|
if (dma_mapping_error(&adapter->pdev->dev,
|
||||||
|
rbi->dma_addr)) {
|
||||||
|
put_page(rbi->page);
|
||||||
|
+ rbi->page = NULL;
|
||||||
|
rq->stats.rx_buf_alloc_failure++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
@@ -1571,6 +1573,10 @@ vmxnet3_rq_cleanup(struct vmxnet3_rx_queue *rq,
|
||||||
|
u32 i, ring_idx;
|
||||||
|
struct Vmxnet3_RxDesc *rxd;
|
||||||
|
|
||||||
|
+ /* ring has already been cleaned up */
|
||||||
|
+ if (!rq->rx_ring[0].base)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
for (ring_idx = 0; ring_idx < 2; ring_idx++) {
|
||||||
|
for (i = 0; i < rq->rx_ring[ring_idx].size; i++) {
|
||||||
|
#ifdef __BIG_ENDIAN_BITFIELD
|
||||||
|
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
|
||||||
|
index 6ef7a094ee515..b4a21adb3e738 100644
|
||||||
|
--- a/drivers/scsi/qla2xxx/qla_target.c
|
||||||
|
+++ b/drivers/scsi/qla2xxx/qla_target.c
|
||||||
|
@@ -3286,6 +3286,9 @@ int qlt_abort_cmd(struct qla_tgt_cmd *cmd)
|
||||||
|
|
||||||
|
spin_lock_irqsave(&cmd->cmd_lock, flags);
|
||||||
|
if (cmd->aborted) {
|
||||||
|
+ if (cmd->sg_mapped)
|
||||||
|
+ qlt_unmap_sg(vha, cmd);
|
||||||
|
+
|
||||||
|
spin_unlock_irqrestore(&cmd->cmd_lock, flags);
|
||||||
|
/*
|
||||||
|
* It's normal to see 2 calls in this path:
|
||||||
|
diff --git a/kernel/events/core.c b/kernel/events/core.c
|
||||||
|
index 396abd52962b8..2466e2ae54dc1 100644
|
||||||
|
--- a/kernel/events/core.c
|
||||||
|
+++ b/kernel/events/core.c
|
||||||
|
@@ -9903,6 +9903,9 @@ SYSCALL_DEFINE5(perf_event_open,
|
||||||
|
* Do not allow to attach to a group in a different task
|
||||||
|
* or CPU context. If we're moving SW events, we'll fix
|
||||||
|
* this up later, so allow that.
|
||||||
|
+ *
|
||||||
|
+ * Racy, not holding group_leader->ctx->mutex, see comment with
|
||||||
|
+ * perf_event_ctx_lock().
|
||||||
|
*/
|
||||||
|
if (!move_group && group_leader->ctx != ctx)
|
||||||
|
goto err_context;
|
||||||
|
@@ -9952,11 +9955,22 @@ SYSCALL_DEFINE5(perf_event_open,
|
||||||
|
} else {
|
||||||
|
perf_event_ctx_unlock(group_leader, gctx);
|
||||||
|
move_group = 0;
|
||||||
|
+ goto not_move_group;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mutex_lock(&ctx->mutex);
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Now that we hold ctx->lock, (re)validate group_leader->ctx == ctx,
|
||||||
|
+ * see the group_leader && !move_group test earlier.
|
||||||
|
+ */
|
||||||
|
+ if (group_leader && group_leader->ctx != ctx) {
|
||||||
|
+ err = -EINVAL;
|
||||||
|
+ goto err_locked;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
+not_move_group:
|
||||||
|
|
||||||
|
if (ctx->task == TASK_TOMBSTONE) {
|
||||||
|
err = -ESRCH;
|
||||||
|
diff --git a/net/key/af_key.c b/net/key/af_key.c
|
||||||
|
index c9cc9f75b0999..776f94ecbfe6d 100644
|
||||||
|
--- a/net/key/af_key.c
|
||||||
|
+++ b/net/key/af_key.c
|
||||||
|
@@ -2861,8 +2861,10 @@ static int pfkey_process(struct sock *sk, struct sk_buff *skb, const struct sadb
|
||||||
|
void *ext_hdrs[SADB_EXT_MAX];
|
||||||
|
int err;
|
||||||
|
|
||||||
|
- pfkey_broadcast(skb_clone(skb, GFP_KERNEL), GFP_KERNEL,
|
||||||
|
- BROADCAST_PROMISC_ONLY, NULL, sock_net(sk));
|
||||||
|
+ err = pfkey_broadcast(skb_clone(skb, GFP_KERNEL), GFP_KERNEL,
|
||||||
|
+ BROADCAST_PROMISC_ONLY, NULL, sock_net(sk));
|
||||||
|
+ if (err)
|
||||||
|
+ return err;
|
||||||
|
|
||||||
|
memset(ext_hdrs, 0, sizeof(ext_hdrs));
|
||||||
|
err = parse_exthdrs(skb, hdr, ext_hdrs);
|
||||||
|
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
|
||||||
|
index 41af02a70742e..02845bed07d74 100644
|
||||||
|
--- a/net/mac80211/rx.c
|
||||||
|
+++ b/net/mac80211/rx.c
|
||||||
|
@@ -1179,8 +1179,7 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx,
|
||||||
|
goto dont_reorder;
|
||||||
|
|
||||||
|
/* not part of a BA session */
|
||||||
|
- if (ack_policy != IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK &&
|
||||||
|
- ack_policy != IEEE80211_QOS_CTL_ACK_POLICY_NORMAL)
|
||||||
|
+ if (ack_policy == IEEE80211_QOS_CTL_ACK_POLICY_NOACK)
|
||||||
|
goto dont_reorder;
|
||||||
|
|
||||||
|
/* new, potentially un-ordered, ampdu frame - process it */
|
||||||
|
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c
|
||||||
|
index d203837797102..b8a295dd15d85 100644
|
||||||
|
--- a/net/nfc/nci/data.c
|
||||||
|
+++ b/net/nfc/nci/data.c
|
||||||
|
@@ -130,7 +130,7 @@ static int nci_queue_tx_data_frags(struct nci_dev *ndev,
|
||||||
|
|
||||||
|
skb_frag = nci_skb_alloc(ndev,
|
||||||
|
(NCI_DATA_HDR_SIZE + frag_len),
|
||||||
|
- GFP_KERNEL);
|
||||||
|
+ GFP_ATOMIC);
|
||||||
|
if (skb_frag == NULL) {
|
||||||
|
rc = -ENOMEM;
|
||||||
|
goto free_exit;
|
||||||
|
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
|
||||||
|
index 5fae3f064ad0a..9c37618f36c62 100644
|
||||||
|
--- a/net/nfc/nci/hci.c
|
||||||
|
+++ b/net/nfc/nci/hci.c
|
||||||
|
@@ -165,7 +165,7 @@ static int nci_hci_send_data(struct nci_dev *ndev, u8 pipe,
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
skb = nci_skb_alloc(ndev, conn_info->max_pkt_payload_len +
|
||||||
|
- NCI_DATA_HDR_SIZE, GFP_KERNEL);
|
||||||
|
+ NCI_DATA_HDR_SIZE, GFP_ATOMIC);
|
||||||
|
if (!skb)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@@ -198,7 +198,7 @@ static int nci_hci_send_data(struct nci_dev *ndev, u8 pipe,
|
||||||
|
if (i < data_len) {
|
||||||
|
skb = nci_skb_alloc(ndev,
|
||||||
|
conn_info->max_pkt_payload_len +
|
||||||
|
- NCI_DATA_HDR_SIZE, GFP_KERNEL);
|
||||||
|
+ NCI_DATA_HDR_SIZE, GFP_ATOMIC);
|
||||||
|
if (!skb)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
|
||||||
|
index 6c06d06457796..b205c12c60092 100644
|
||||||
|
--- a/sound/isa/wavefront/wavefront_synth.c
|
||||||
|
+++ b/sound/isa/wavefront/wavefront_synth.c
|
||||||
|
@@ -1091,7 +1091,8 @@ wavefront_send_sample (snd_wavefront_t *dev,
|
||||||
|
|
||||||
|
if (dataptr < data_end) {
|
||||||
|
|
||||||
|
- __get_user (sample_short, dataptr);
|
||||||
|
+ if (get_user(sample_short, dataptr))
|
||||||
|
+ return -EFAULT;
|
||||||
|
dataptr += skip;
|
||||||
|
|
||||||
|
if (data_is_unsigned) { /* GUS ? */
|
||||||
|
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
|
||||||
|
index 7b364f2926d4f..901e9d6efcece 100644
|
||||||
|
--- a/tools/perf/bench/numa.c
|
||||||
|
+++ b/tools/perf/bench/numa.c
|
||||||
|
@@ -1626,7 +1626,7 @@ static int __bench_numa(const char *name)
|
||||||
|
"GB/sec,", "total-speed", "GB/sec total speed");
|
||||||
|
|
||||||
|
if (g->p.show_details >= 2) {
|
||||||
|
- char tname[14 + 2 * 10 + 1];
|
||||||
|
+ char tname[14 + 2 * 11 + 1];
|
||||||
|
struct thread_data *td;
|
||||||
|
for (p = 0; p < g->p.nr_proc; p++) {
|
||||||
|
for (t = 0; t < g->p.nr_threads; t++) {
|
||||||
324
patch/kernel/archive/sun50iw9-4.9/patch-4.9.316-317.patch
Normal file
324
patch/kernel/archive/sun50iw9-4.9/patch-4.9.316-317.patch
Normal file
@@ -0,0 +1,324 @@
|
|||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index 24a0bb5416ff5..cc1a47220975b 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
VERSION = 4
|
||||||
|
PATCHLEVEL = 9
|
||||||
|
-SUBLEVEL = 316
|
||||||
|
+SUBLEVEL = 317
|
||||||
|
EXTRAVERSION =
|
||||||
|
NAME = Roaring Lionus
|
||||||
|
|
||||||
|
diff --git a/block/bio.c b/block/bio.c
|
||||||
|
index 4c18a68913deb..db3723675f5a0 100644
|
||||||
|
--- a/block/bio.c
|
||||||
|
+++ b/block/bio.c
|
||||||
|
@@ -1538,7 +1538,7 @@ struct bio *bio_copy_kern(struct request_queue *q, void *data, unsigned int len,
|
||||||
|
if (bytes > len)
|
||||||
|
bytes = len;
|
||||||
|
|
||||||
|
- page = alloc_page(q->bounce_gfp | gfp_mask);
|
||||||
|
+ page = alloc_page(q->bounce_gfp | __GFP_ZERO | gfp_mask);
|
||||||
|
if (!page)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c
|
||||||
|
index 0fad6cf37bab4..b0f546f4b15ca 100644
|
||||||
|
--- a/drivers/char/tpm/tpm_ibmvtpm.c
|
||||||
|
+++ b/drivers/char/tpm/tpm_ibmvtpm.c
|
||||||
|
@@ -653,6 +653,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
|
||||||
|
if (!wait_event_timeout(ibmvtpm->crq_queue.wq,
|
||||||
|
ibmvtpm->rtce_buf != NULL,
|
||||||
|
HZ)) {
|
||||||
|
+ rc = -ENODEV;
|
||||||
|
dev_err(dev, "CRQ response timed out\n");
|
||||||
|
goto init_irq_cleanup;
|
||||||
|
}
|
||||||
|
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
|
||||||
|
index 202c00b17df2d..dcae0ec973a91 100644
|
||||||
|
--- a/drivers/gpu/drm/i915/intel_pm.c
|
||||||
|
+++ b/drivers/gpu/drm/i915/intel_pm.c
|
||||||
|
@@ -2083,7 +2083,7 @@ hsw_compute_linetime_wm(const struct intel_crtc_state *cstate)
|
||||||
|
PIPE_WM_LINETIME_TIME(linetime);
|
||||||
|
}
|
||||||
|
|
||||||
|
-static void intel_read_wm_latency(struct drm_device *dev, uint16_t wm[8])
|
||||||
|
+static void intel_read_wm_latency(struct drm_device *dev, uint16_t wm[])
|
||||||
|
{
|
||||||
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||||
|
|
||||||
|
diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
|
||||||
|
index bba5b429f69c9..3298483bb9b41 100644
|
||||||
|
--- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c
|
||||||
|
+++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
|
||||||
|
@@ -208,6 +208,7 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev,
|
||||||
|
i2c->adap.bus_recovery_info = &octeon_i2c_recovery_info;
|
||||||
|
i2c->adap.dev.parent = dev;
|
||||||
|
i2c->adap.dev.of_node = pdev->dev.of_node;
|
||||||
|
+ i2c->adap.dev.fwnode = dev->fwnode;
|
||||||
|
snprintf(i2c->adap.name, sizeof(i2c->adap.name),
|
||||||
|
"Cavium ThunderX i2c adapter at %s", dev_name(dev));
|
||||||
|
i2c_set_adapdata(&i2c->adap, i2c);
|
||||||
|
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
|
||||||
|
index 0aedd0ebccec1..13a5fcca28330 100644
|
||||||
|
--- a/drivers/md/dm-crypt.c
|
||||||
|
+++ b/drivers/md/dm-crypt.c
|
||||||
|
@@ -1943,6 +1943,11 @@ static int crypt_map(struct dm_target *ti, struct bio *bio)
|
||||||
|
return DM_MAPIO_SUBMITTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static char hex2asc(unsigned char c)
|
||||||
|
+{
|
||||||
|
+ return c + '0' + ((unsigned)(9 - c) >> 4 & 0x27);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void crypt_status(struct dm_target *ti, status_type_t type,
|
||||||
|
unsigned status_flags, char *result, unsigned maxlen)
|
||||||
|
{
|
||||||
|
@@ -1958,10 +1963,12 @@ static void crypt_status(struct dm_target *ti, status_type_t type,
|
||||||
|
case STATUSTYPE_TABLE:
|
||||||
|
DMEMIT("%s ", cc->cipher_string);
|
||||||
|
|
||||||
|
- if (cc->key_size > 0)
|
||||||
|
- for (i = 0; i < cc->key_size; i++)
|
||||||
|
- DMEMIT("%02x", cc->key[i]);
|
||||||
|
- else
|
||||||
|
+ if (cc->key_size > 0) {
|
||||||
|
+ for (i = 0; i < cc->key_size; i++) {
|
||||||
|
+ DMEMIT("%c%c", hex2asc(cc->key[i] >> 4),
|
||||||
|
+ hex2asc(cc->key[i] & 0xf));
|
||||||
|
+ }
|
||||||
|
+ } else
|
||||||
|
DMEMIT("-");
|
||||||
|
|
||||||
|
DMEMIT(" %llu %s %llu", (unsigned long long)cc->iv_offset,
|
||||||
|
diff --git a/drivers/md/dm-stats.c b/drivers/md/dm-stats.c
|
||||||
|
index 0250e7e521abc..fdd4a840b30fa 100644
|
||||||
|
--- a/drivers/md/dm-stats.c
|
||||||
|
+++ b/drivers/md/dm-stats.c
|
||||||
|
@@ -228,6 +228,7 @@ void dm_stats_cleanup(struct dm_stats *stats)
|
||||||
|
atomic_read(&shared->in_flight[READ]),
|
||||||
|
atomic_read(&shared->in_flight[WRITE]));
|
||||||
|
}
|
||||||
|
+ cond_resched();
|
||||||
|
}
|
||||||
|
dm_stat_free(&s->rcu_head);
|
||||||
|
}
|
||||||
|
@@ -316,6 +317,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,
|
||||||
|
for (ni = 0; ni < n_entries; ni++) {
|
||||||
|
atomic_set(&s->stat_shared[ni].in_flight[READ], 0);
|
||||||
|
atomic_set(&s->stat_shared[ni].in_flight[WRITE], 0);
|
||||||
|
+ cond_resched();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s->n_histogram_entries) {
|
||||||
|
@@ -328,6 +330,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,
|
||||||
|
for (ni = 0; ni < n_entries; ni++) {
|
||||||
|
s->stat_shared[ni].tmp.histogram = hi;
|
||||||
|
hi += s->n_histogram_entries + 1;
|
||||||
|
+ cond_resched();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -348,6 +351,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end,
|
||||||
|
for (ni = 0; ni < n_entries; ni++) {
|
||||||
|
p[ni].histogram = hi;
|
||||||
|
hi += s->n_histogram_entries + 1;
|
||||||
|
+ cond_resched();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -477,6 +481,7 @@ static int dm_stats_list(struct dm_stats *stats, const char *program,
|
||||||
|
}
|
||||||
|
DMEMIT("\n");
|
||||||
|
}
|
||||||
|
+ cond_resched();
|
||||||
|
}
|
||||||
|
mutex_unlock(&stats->mutex);
|
||||||
|
|
||||||
|
@@ -753,6 +758,7 @@ static void __dm_stat_clear(struct dm_stat *s, size_t idx_start, size_t idx_end,
|
||||||
|
local_irq_enable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ cond_resched();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -868,6 +874,8 @@ static int dm_stats_print(struct dm_stats *stats, int id,
|
||||||
|
|
||||||
|
if (unlikely(sz + 1 >= maxlen))
|
||||||
|
goto buffer_overflow;
|
||||||
|
+
|
||||||
|
+ cond_resched();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (clear)
|
||||||
|
diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c
|
||||||
|
index 727f9e5719555..bd9d9f183e4b9 100644
|
||||||
|
--- a/drivers/md/dm-verity-target.c
|
||||||
|
+++ b/drivers/md/dm-verity-target.c
|
||||||
|
@@ -1140,6 +1140,7 @@ EXPORT_SYMBOL_GPL(verity_ctr);
|
||||||
|
static struct target_type verity_target = {
|
||||||
|
.name = "verity",
|
||||||
|
.version = {1, 4, 0},
|
||||||
|
+ .features = DM_TARGET_IMMUTABLE,
|
||||||
|
.module = THIS_MODULE,
|
||||||
|
.ctr = verity_ctr,
|
||||||
|
.dtr = verity_dtr,
|
||||||
|
diff --git a/fs/exec.c b/fs/exec.c
|
||||||
|
index 482a8b4f41a5b..19f8b075d3b6b 100644
|
||||||
|
--- a/fs/exec.c
|
||||||
|
+++ b/fs/exec.c
|
||||||
|
@@ -1758,6 +1758,9 @@ static int do_execveat_common(int fd, struct filename *filename,
|
||||||
|
goto out_unmark;
|
||||||
|
|
||||||
|
bprm->argc = count(argv, MAX_ARG_STRINGS);
|
||||||
|
+ if (bprm->argc == 0)
|
||||||
|
+ pr_warn_once("process '%s' launched '%s' with NULL argv: empty string added\n",
|
||||||
|
+ current->comm, bprm->filename);
|
||||||
|
if ((retval = bprm->argc) < 0)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
@@ -1782,6 +1785,20 @@ static int do_execveat_common(int fd, struct filename *filename,
|
||||||
|
if (retval < 0)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * When argv is empty, add an empty string ("") as argv[0] to
|
||||||
|
+ * ensure confused userspace programs that start processing
|
||||||
|
+ * from argv[1] won't end up walking envp. See also
|
||||||
|
+ * bprm_stack_limits().
|
||||||
|
+ */
|
||||||
|
+ if (bprm->argc == 0) {
|
||||||
|
+ const char *argv[] = { "", NULL };
|
||||||
|
+ retval = copy_strings_kernel(1, argv, bprm);
|
||||||
|
+ if (retval < 0)
|
||||||
|
+ goto out;
|
||||||
|
+ bprm->argc = 1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
retval = exec_binprm(bprm);
|
||||||
|
if (retval < 0)
|
||||||
|
goto out;
|
||||||
|
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
|
||||||
|
index d9381ca0ac479..b13649c63653f 100644
|
||||||
|
--- a/fs/nfsd/nfs4state.c
|
||||||
|
+++ b/fs/nfsd/nfs4state.c
|
||||||
|
@@ -6342,16 +6342,12 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp,
|
||||||
|
if (sop->so_is_open_owner || !same_owner_str(sop, owner))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
- /* see if there are still any locks associated with it */
|
||||||
|
- lo = lockowner(sop);
|
||||||
|
- list_for_each_entry(stp, &sop->so_stateids, st_perstateowner) {
|
||||||
|
- if (check_for_locks(stp->st_stid.sc_file, lo)) {
|
||||||
|
- status = nfserr_locks_held;
|
||||||
|
- spin_unlock(&clp->cl_lock);
|
||||||
|
- return status;
|
||||||
|
- }
|
||||||
|
+ if (atomic_read(&sop->so_count) != 1) {
|
||||||
|
+ spin_unlock(&clp->cl_lock);
|
||||||
|
+ return nfserr_locks_held;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ lo = lockowner(sop);
|
||||||
|
nfs4_get_stateowner(sop);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
diff --git a/lib/assoc_array.c b/lib/assoc_array.c
|
||||||
|
index 3b46c5433b7ac..70ef5fdd11c79 100644
|
||||||
|
--- a/lib/assoc_array.c
|
||||||
|
+++ b/lib/assoc_array.c
|
||||||
|
@@ -1478,6 +1478,7 @@ int assoc_array_gc(struct assoc_array *array,
|
||||||
|
struct assoc_array_ptr *cursor, *ptr;
|
||||||
|
struct assoc_array_ptr *new_root, *new_parent, **new_ptr_pp;
|
||||||
|
unsigned long nr_leaves_on_tree;
|
||||||
|
+ bool retained;
|
||||||
|
int keylen, slot, nr_free, next_slot, i;
|
||||||
|
|
||||||
|
pr_devel("-->%s()\n", __func__);
|
||||||
|
@@ -1554,6 +1555,7 @@ continue_node:
|
||||||
|
goto descend;
|
||||||
|
}
|
||||||
|
|
||||||
|
+retry_compress:
|
||||||
|
pr_devel("-- compress node %p --\n", new_n);
|
||||||
|
|
||||||
|
/* Count up the number of empty slots in this node and work out the
|
||||||
|
@@ -1571,6 +1573,7 @@ continue_node:
|
||||||
|
pr_devel("free=%d, leaves=%lu\n", nr_free, new_n->nr_leaves_on_branch);
|
||||||
|
|
||||||
|
/* See what we can fold in */
|
||||||
|
+ retained = false;
|
||||||
|
next_slot = 0;
|
||||||
|
for (slot = 0; slot < ASSOC_ARRAY_FAN_OUT; slot++) {
|
||||||
|
struct assoc_array_shortcut *s;
|
||||||
|
@@ -1620,9 +1623,14 @@ continue_node:
|
||||||
|
pr_devel("[%d] retain node %lu/%d [nx %d]\n",
|
||||||
|
slot, child->nr_leaves_on_branch, nr_free + 1,
|
||||||
|
next_slot);
|
||||||
|
+ retained = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (retained && new_n->nr_leaves_on_branch <= ASSOC_ARRAY_FAN_OUT) {
|
||||||
|
+ pr_devel("internal nodes remain despite enough space, retrying\n");
|
||||||
|
+ goto retry_compress;
|
||||||
|
+ }
|
||||||
|
pr_devel("after: %lu\n", new_n->nr_leaves_on_branch);
|
||||||
|
|
||||||
|
nr_leaves_on_tree = new_n->nr_leaves_on_branch;
|
||||||
|
diff --git a/net/core/filter.c b/net/core/filter.c
|
||||||
|
index 94bf897485db0..799ac1fb46f2d 100644
|
||||||
|
--- a/net/core/filter.c
|
||||||
|
+++ b/net/core/filter.c
|
||||||
|
@@ -1388,7 +1388,7 @@ BPF_CALL_5(bpf_skb_store_bytes, struct sk_buff *, skb, u32, offset,
|
||||||
|
|
||||||
|
if (unlikely(flags & ~(BPF_F_RECOMPUTE_CSUM | BPF_F_INVALIDATE_HASH)))
|
||||||
|
return -EINVAL;
|
||||||
|
- if (unlikely(offset > 0xffff))
|
||||||
|
+ if (unlikely(offset > INT_MAX))
|
||||||
|
return -EFAULT;
|
||||||
|
if (unlikely(bpf_try_make_writable(skb, offset + len)))
|
||||||
|
return -EFAULT;
|
||||||
|
@@ -1423,7 +1423,7 @@ BPF_CALL_4(bpf_skb_load_bytes, const struct sk_buff *, skb, u32, offset,
|
||||||
|
{
|
||||||
|
void *ptr;
|
||||||
|
|
||||||
|
- if (unlikely(offset > 0xffff))
|
||||||
|
+ if (unlikely(offset > INT_MAX))
|
||||||
|
goto err_clear;
|
||||||
|
|
||||||
|
ptr = skb_header_pointer(skb, offset, len, to);
|
||||||
|
diff --git a/net/key/af_key.c b/net/key/af_key.c
|
||||||
|
index 776f94ecbfe6d..d5dc614af2f91 100644
|
||||||
|
--- a/net/key/af_key.c
|
||||||
|
+++ b/net/key/af_key.c
|
||||||
|
@@ -2935,7 +2935,7 @@ static int count_ah_combs(const struct xfrm_tmpl *t)
|
||||||
|
break;
|
||||||
|
if (!aalg->pfkey_supported)
|
||||||
|
continue;
|
||||||
|
- if (aalg_tmpl_set(t, aalg))
|
||||||
|
+ if (aalg_tmpl_set(t, aalg) && aalg->available)
|
||||||
|
sz += sizeof(struct sadb_comb);
|
||||||
|
}
|
||||||
|
return sz + sizeof(struct sadb_prop);
|
||||||
|
@@ -2953,7 +2953,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t)
|
||||||
|
if (!ealg->pfkey_supported)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
- if (!(ealg_tmpl_set(t, ealg)))
|
||||||
|
+ if (!(ealg_tmpl_set(t, ealg) && ealg->available))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (k = 1; ; k++) {
|
||||||
|
@@ -2964,7 +2964,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t)
|
||||||
|
if (!aalg->pfkey_supported)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
- if (aalg_tmpl_set(t, aalg))
|
||||||
|
+ if (aalg_tmpl_set(t, aalg) && aalg->available)
|
||||||
|
sz += sizeof(struct sadb_comb);
|
||||||
|
}
|
||||||
|
}
|
||||||
4294
patch/kernel/archive/sun50iw9-4.9/patch-4.9.317-318.patch
Normal file
4294
patch/kernel/archive/sun50iw9-4.9/patch-4.9.317-318.patch
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user