diff --git a/patch/kernel/meson64-legacy/patch-4.9.247-248.patch b/patch/kernel/meson64-legacy/patch-4.9.247-248.patch index 02e2343119..47aa33274d 100644 --- a/patch/kernel/meson64-legacy/patch-4.9.247-248.patch +++ b/patch/kernel/meson64-legacy/patch-4.9.247-248.patch @@ -604,19 +604,6 @@ index dcd56ac687482..585225fbe2933 100644 } /* Zero out rmon counters */ -diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c -index 2b16a5fed9ded..0cf5324d493e8 100644 ---- a/drivers/net/usb/ipheth.c -+++ b/drivers/net/usb/ipheth.c -@@ -70,7 +70,7 @@ - #define IPHETH_USBINTF_SUBCLASS 253 - #define IPHETH_USBINTF_PROTO 1 - --#define IPHETH_BUF_SIZE 1516 -+#define IPHETH_BUF_SIZE 1514 - #define IPHETH_IP_ALIGN 2 /* padding at front of URB */ - #define IPHETH_TX_TIMEOUT (5 * HZ) - diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index 1e945aa77734b..fc51922839f82 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c diff --git a/patch/kernel/odroidxu4-current/patch-5.4.87-88.patch b/patch/kernel/odroidxu4-current/patch-5.4.87-88.patch deleted file mode 100644 index ea2553fb0f..0000000000 --- a/patch/kernel/odroidxu4-current/patch-5.4.87-88.patch +++ /dev/null @@ -1,995 +0,0 @@ -diff --git a/Makefile b/Makefile -index 71968b4bb313d..450ebe1528062 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - VERSION = 5 - PATCHLEVEL = 4 --SUBLEVEL = 87 -+SUBLEVEL = 88 - EXTRAVERSION = - NAME = Kleptomaniac Octopus - -diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c -index ff366c2f58c18..303bc3e601a1c 100644 ---- a/drivers/dma/at_hdmac.c -+++ b/drivers/dma/at_hdmac.c -@@ -1673,9 +1673,11 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec, - dma_cap_zero(mask); - dma_cap_set(DMA_SLAVE, mask); - -- atslave = kzalloc(sizeof(*atslave), GFP_KERNEL); -- if (!atslave) -+ atslave = kmalloc(sizeof(*atslave), GFP_KERNEL); -+ if (!atslave) { -+ put_device(&dmac_pdev->dev); - return NULL; -+ } - - atslave->cfg = ATC_DST_H2SEL_HW | ATC_SRC_H2SEL_HW; - /* -@@ -1704,8 +1706,11 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec, - atslave->dma_dev = &dmac_pdev->dev; - - chan = dma_request_channel(mask, at_dma_filter, atslave); -- if (!chan) -+ if (!chan) { -+ put_device(&dmac_pdev->dev); -+ kfree(atslave); - return NULL; -+ } - - atchan = to_at_dma_chan(chan); - atchan->per_if = dma_spec->args[0] & 0xff; -diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -index 09410971615c4..d2dd387c95d86 100644 ---- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -@@ -1434,8 +1434,7 @@ amdgpu_dm_update_connector_after_detect(struct amdgpu_dm_connector *aconnector) - - drm_connector_update_edid_property(connector, - aconnector->edid); -- aconnector->num_modes = drm_add_edid_modes(connector, aconnector->edid); -- drm_connector_list_update(connector); -+ drm_add_edid_modes(connector, aconnector->edid); - - if (aconnector->dc_link->aux_mode) - drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux, -diff --git a/drivers/iio/imu/bmi160/bmi160.h b/drivers/iio/imu/bmi160/bmi160.h -index 621f5309d735a..431f10c2b951d 100644 ---- a/drivers/iio/imu/bmi160/bmi160.h -+++ b/drivers/iio/imu/bmi160/bmi160.h -@@ -7,6 +7,13 @@ - struct bmi160_data { - struct regmap *regmap; - struct iio_trigger *trig; -+ /* -+ * Ensure natural alignment for timestamp if present. -+ * Max length needed: 2 * 3 channels + 4 bytes padding + 8 byte ts. -+ * If fewer channels are enabled, less space may be needed, as -+ * long as the timestamp is still aligned to 8 bytes. -+ */ -+ __le16 buf[12] __aligned(8); - }; - - extern const struct regmap_config bmi160_regmap_config; -diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c -index a5994899e3965..088694c82327a 100644 ---- a/drivers/iio/imu/bmi160/bmi160_core.c -+++ b/drivers/iio/imu/bmi160/bmi160_core.c -@@ -411,8 +411,6 @@ static irqreturn_t bmi160_trigger_handler(int irq, void *p) - struct iio_poll_func *pf = p; - struct iio_dev *indio_dev = pf->indio_dev; - struct bmi160_data *data = iio_priv(indio_dev); -- __le16 buf[12]; -- /* 2 sens x 3 axis x __le16 + 2 x __le16 pad + 4 x __le16 tstamp */ - int i, ret, j = 0, base = BMI160_REG_DATA_MAGN_XOUT_L; - __le16 sample; - -@@ -422,10 +420,10 @@ static irqreturn_t bmi160_trigger_handler(int irq, void *p) - &sample, sizeof(sample)); - if (ret) - goto done; -- buf[j++] = sample; -+ data->buf[j++] = sample; - } - -- iio_push_to_buffers_with_timestamp(indio_dev, buf, pf->timestamp); -+ iio_push_to_buffers_with_timestamp(indio_dev, data->buf, pf->timestamp); - done: - iio_trigger_notify_done(indio_dev->trig); - return IRQ_HANDLED; -diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c -index 671700af91804..0d21c68bfe245 100644 ---- a/drivers/mtd/nand/spi/core.c -+++ b/drivers/mtd/nand/spi/core.c -@@ -317,10 +317,6 @@ static int spinand_write_to_cache_op(struct spinand_device *spinand, - buf += ret; - } - -- if (req->ooblen) -- memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs, -- req->ooblen); -- - return 0; - } - -diff --git a/drivers/net/wireless/marvell/mwifiex/join.c b/drivers/net/wireless/marvell/mwifiex/join.c -index d87aeff70cefb..c2cb1e711c06e 100644 ---- a/drivers/net/wireless/marvell/mwifiex/join.c -+++ b/drivers/net/wireless/marvell/mwifiex/join.c -@@ -877,6 +877,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, - - memset(adhoc_start->ssid, 0, IEEE80211_MAX_SSID_LEN); - -+ if (req_ssid->ssid_len > IEEE80211_MAX_SSID_LEN) -+ req_ssid->ssid_len = IEEE80211_MAX_SSID_LEN; - memcpy(adhoc_start->ssid, req_ssid->ssid, req_ssid->ssid_len); - - mwifiex_dbg(adapter, INFO, "info: ADHOC_S_CMD: SSID = %s\n", -diff --git a/fs/exec.c b/fs/exec.c -index 2441eb1a1e2d0..1b4d2206d53a1 100644 ---- a/fs/exec.c -+++ b/fs/exec.c -@@ -1009,8 +1009,8 @@ EXPORT_SYMBOL(read_code); - - /* - * Maps the mm_struct mm into the current task struct. -- * On success, this function returns with the mutex -- * exec_update_mutex locked. -+ * On success, this function returns with exec_update_lock -+ * held for writing. - */ - static int exec_mmap(struct mm_struct *mm) - { -@@ -1023,7 +1023,7 @@ static int exec_mmap(struct mm_struct *mm) - old_mm = current->mm; - exec_mm_release(tsk, old_mm); - -- ret = mutex_lock_killable(&tsk->signal->exec_update_mutex); -+ ret = down_write_killable(&tsk->signal->exec_update_lock); - if (ret) - return ret; - -@@ -1038,7 +1038,7 @@ static int exec_mmap(struct mm_struct *mm) - down_read(&old_mm->mmap_sem); - if (unlikely(old_mm->core_state)) { - up_read(&old_mm->mmap_sem); -- mutex_unlock(&tsk->signal->exec_update_mutex); -+ up_write(&tsk->signal->exec_update_lock); - return -EINTR; - } - } -@@ -1450,7 +1450,7 @@ static void free_bprm(struct linux_binprm *bprm) - free_arg_pages(bprm); - if (bprm->cred) { - if (bprm->called_exec_mmap) -- mutex_unlock(¤t->signal->exec_update_mutex); -+ up_write(¤t->signal->exec_update_lock); - mutex_unlock(¤t->signal->cred_guard_mutex); - abort_creds(bprm->cred); - } -@@ -1500,7 +1500,7 @@ void install_exec_creds(struct linux_binprm *bprm) - * credentials; any time after this it may be unlocked. - */ - security_bprm_committed_creds(bprm); -- mutex_unlock(¤t->signal->exec_update_mutex); -+ up_write(¤t->signal->exec_update_lock); - mutex_unlock(¤t->signal->cred_guard_mutex); - } - EXPORT_SYMBOL(install_exec_creds); -diff --git a/fs/fuse/acl.c b/fs/fuse/acl.c -index 5a48cee6d7d33..f529075a2ce87 100644 ---- a/fs/fuse/acl.c -+++ b/fs/fuse/acl.c -@@ -19,6 +19,9 @@ struct posix_acl *fuse_get_acl(struct inode *inode, int type) - void *value = NULL; - struct posix_acl *acl; - -+ if (fuse_is_bad(inode)) -+ return ERR_PTR(-EIO); -+ - if (!fc->posix_acl || fc->no_getxattr) - return NULL; - -@@ -53,6 +56,9 @@ int fuse_set_acl(struct inode *inode, struct posix_acl *acl, int type) - const char *name; - int ret; - -+ if (fuse_is_bad(inode)) -+ return -EIO; -+ - if (!fc->posix_acl || fc->no_setxattr) - return -EOPNOTSUPP; - -diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c -index ee190119f45cc..60378f3baaae1 100644 ---- a/fs/fuse/dir.c -+++ b/fs/fuse/dir.c -@@ -201,7 +201,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) - int ret; - - inode = d_inode_rcu(entry); -- if (inode && is_bad_inode(inode)) -+ if (inode && fuse_is_bad(inode)) - goto invalid; - else if (time_before64(fuse_dentry_time(entry), get_jiffies_64()) || - (flags & LOOKUP_REVAL)) { -@@ -386,6 +386,9 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry, - bool outarg_valid = true; - bool locked; - -+ if (fuse_is_bad(dir)) -+ return ERR_PTR(-EIO); -+ - locked = fuse_lock_inode(dir); - err = fuse_lookup_name(dir->i_sb, get_node_id(dir), &entry->d_name, - &outarg, &inode); -@@ -529,6 +532,9 @@ static int fuse_atomic_open(struct inode *dir, struct dentry *entry, - struct fuse_conn *fc = get_fuse_conn(dir); - struct dentry *res = NULL; - -+ if (fuse_is_bad(dir)) -+ return -EIO; -+ - if (d_in_lookup(entry)) { - res = fuse_lookup(dir, entry, 0); - if (IS_ERR(res)) -@@ -577,6 +583,9 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_args *args, - int err; - struct fuse_forget_link *forget; - -+ if (fuse_is_bad(dir)) -+ return -EIO; -+ - forget = fuse_alloc_forget(); - if (!forget) - return -ENOMEM; -@@ -704,6 +713,9 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry) - struct fuse_conn *fc = get_fuse_conn(dir); - FUSE_ARGS(args); - -+ if (fuse_is_bad(dir)) -+ return -EIO; -+ - args.opcode = FUSE_UNLINK; - args.nodeid = get_node_id(dir); - args.in_numargs = 1; -@@ -740,6 +752,9 @@ static int fuse_rmdir(struct inode *dir, struct dentry *entry) - struct fuse_conn *fc = get_fuse_conn(dir); - FUSE_ARGS(args); - -+ if (fuse_is_bad(dir)) -+ return -EIO; -+ - args.opcode = FUSE_RMDIR; - args.nodeid = get_node_id(dir); - args.in_numargs = 1; -@@ -818,6 +833,9 @@ static int fuse_rename2(struct inode *olddir, struct dentry *oldent, - struct fuse_conn *fc = get_fuse_conn(olddir); - int err; - -+ if (fuse_is_bad(olddir)) -+ return -EIO; -+ - if (flags & ~(RENAME_NOREPLACE | RENAME_EXCHANGE)) - return -EINVAL; - -@@ -953,7 +971,7 @@ static int fuse_do_getattr(struct inode *inode, struct kstat *stat, - if (!err) { - if (fuse_invalid_attr(&outarg.attr) || - (inode->i_mode ^ outarg.attr.mode) & S_IFMT) { -- make_bad_inode(inode); -+ fuse_make_bad(inode); - err = -EIO; - } else { - fuse_change_attributes(inode, &outarg.attr, -@@ -1155,6 +1173,9 @@ static int fuse_permission(struct inode *inode, int mask) - bool refreshed = false; - int err = 0; - -+ if (fuse_is_bad(inode)) -+ return -EIO; -+ - if (!fuse_allow_current_process(fc)) - return -EACCES; - -@@ -1250,7 +1271,7 @@ static const char *fuse_get_link(struct dentry *dentry, struct inode *inode, - int err; - - err = -EIO; -- if (is_bad_inode(inode)) -+ if (fuse_is_bad(inode)) - goto out_err; - - if (fc->cache_symlinks) -@@ -1298,7 +1319,7 @@ static int fuse_dir_fsync(struct file *file, loff_t start, loff_t end, - struct fuse_conn *fc = get_fuse_conn(inode); - int err; - -- if (is_bad_inode(inode)) -+ if (fuse_is_bad(inode)) - return -EIO; - - if (fc->no_fsyncdir) -@@ -1575,7 +1596,7 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr, - - if (fuse_invalid_attr(&outarg.attr) || - (inode->i_mode ^ outarg.attr.mode) & S_IFMT) { -- make_bad_inode(inode); -+ fuse_make_bad(inode); - err = -EIO; - goto error; - } -@@ -1631,6 +1652,9 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr) - struct file *file = (attr->ia_valid & ATTR_FILE) ? attr->ia_file : NULL; - int ret; - -+ if (fuse_is_bad(inode)) -+ return -EIO; -+ - if (!fuse_allow_current_process(get_fuse_conn(inode))) - return -EACCES; - -@@ -1689,6 +1713,9 @@ static int fuse_getattr(const struct path *path, struct kstat *stat, - struct inode *inode = d_inode(path->dentry); - struct fuse_conn *fc = get_fuse_conn(inode); - -+ if (fuse_is_bad(inode)) -+ return -EIO; -+ - if (!fuse_allow_current_process(fc)) - return -EACCES; - -diff --git a/fs/fuse/file.c b/fs/fuse/file.c -index ab4fc1255aca8..1e1aef1bc20b3 100644 ---- a/fs/fuse/file.c -+++ b/fs/fuse/file.c -@@ -222,6 +222,9 @@ int fuse_open_common(struct inode *inode, struct file *file, bool isdir) - fc->atomic_o_trunc && - fc->writeback_cache; - -+ if (fuse_is_bad(inode)) -+ return -EIO; -+ - err = generic_file_open(inode, file); - if (err) - return err; -@@ -443,7 +446,7 @@ static int fuse_flush(struct file *file, fl_owner_t id) - FUSE_ARGS(args); - int err; - -- if (is_bad_inode(inode)) -+ if (fuse_is_bad(inode)) - return -EIO; - - if (fc->no_flush) -@@ -506,7 +509,7 @@ static int fuse_fsync(struct file *file, loff_t start, loff_t end, - struct fuse_conn *fc = get_fuse_conn(inode); - int err; - -- if (is_bad_inode(inode)) -+ if (fuse_is_bad(inode)) - return -EIO; - - inode_lock(inode); -@@ -830,7 +833,7 @@ static int fuse_readpage(struct file *file, struct page *page) - int err; - - err = -EIO; -- if (is_bad_inode(inode)) -+ if (fuse_is_bad(inode)) - goto out; - - err = fuse_do_readpage(file, page); -@@ -973,7 +976,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping, - int err; - - err = -EIO; -- if (is_bad_inode(inode)) -+ if (fuse_is_bad(inode)) - goto out; - - data.file = file; -@@ -1569,7 +1572,7 @@ static ssize_t fuse_file_read_iter(struct kiocb *iocb, struct iov_iter *to) - struct file *file = iocb->ki_filp; - struct fuse_file *ff = file->private_data; - -- if (is_bad_inode(file_inode(file))) -+ if (fuse_is_bad(file_inode(file))) - return -EIO; - - if (!(ff->open_flags & FOPEN_DIRECT_IO)) -@@ -1583,7 +1586,7 @@ static ssize_t fuse_file_write_iter(struct kiocb *iocb, struct iov_iter *from) - struct file *file = iocb->ki_filp; - struct fuse_file *ff = file->private_data; - -- if (is_bad_inode(file_inode(file))) -+ if (fuse_is_bad(file_inode(file))) - return -EIO; - - if (!(ff->open_flags & FOPEN_DIRECT_IO)) -@@ -2133,7 +2136,7 @@ static int fuse_writepages(struct address_space *mapping, - int err; - - err = -EIO; -- if (is_bad_inode(inode)) -+ if (fuse_is_bad(inode)) - goto out; - - data.inode = inode; -@@ -2911,7 +2914,7 @@ long fuse_ioctl_common(struct file *file, unsigned int cmd, - if (!fuse_allow_current_process(fc)) - return -EACCES; - -- if (is_bad_inode(inode)) -+ if (fuse_is_bad(inode)) - return -EIO; - - return fuse_do_ioctl(file, cmd, arg, flags); -diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h -index d7cde216fc871..e3688312e9f1b 100644 ---- a/fs/fuse/fuse_i.h -+++ b/fs/fuse/fuse_i.h -@@ -158,6 +158,8 @@ enum { - FUSE_I_INIT_RDPLUS, - /** An operation changing file size is in progress */ - FUSE_I_SIZE_UNSTABLE, -+ /* Bad inode */ -+ FUSE_I_BAD, - }; - - struct fuse_conn; -@@ -787,6 +789,16 @@ static inline u64 fuse_get_attr_version(struct fuse_conn *fc) - return atomic64_read(&fc->attr_version); - } - -+static inline void fuse_make_bad(struct inode *inode) -+{ -+ set_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state); -+} -+ -+static inline bool fuse_is_bad(struct inode *inode) -+{ -+ return unlikely(test_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state)); -+} -+ - /** Device operations */ - extern const struct file_operations fuse_dev_operations; - -diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c -index f58ab84b09fb3..aa1d5cf1bc3a4 100644 ---- a/fs/fuse/inode.c -+++ b/fs/fuse/inode.c -@@ -115,7 +115,7 @@ static void fuse_evict_inode(struct inode *inode) - fuse_queue_forget(fc, fi->forget, fi->nodeid, fi->nlookup); - fi->forget = NULL; - } -- if (S_ISREG(inode->i_mode) && !is_bad_inode(inode)) { -+ if (S_ISREG(inode->i_mode) && !fuse_is_bad(inode)) { - WARN_ON(!list_empty(&fi->write_files)); - WARN_ON(!list_empty(&fi->queued_writes)); - } -@@ -306,7 +306,7 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid, - unlock_new_inode(inode); - } else if ((inode->i_mode ^ attr->mode) & S_IFMT) { - /* Inode has changed type, any I/O on the old should fail */ -- make_bad_inode(inode); -+ fuse_make_bad(inode); - iput(inode); - goto retry; - } -diff --git a/fs/fuse/readdir.c b/fs/fuse/readdir.c -index 6a40f75a0d25e..70f685b61e3a5 100644 ---- a/fs/fuse/readdir.c -+++ b/fs/fuse/readdir.c -@@ -207,7 +207,7 @@ retry: - dput(dentry); - goto retry; - } -- if (is_bad_inode(inode)) { -+ if (fuse_is_bad(inode)) { - dput(dentry); - return -EIO; - } -@@ -568,7 +568,7 @@ int fuse_readdir(struct file *file, struct dir_context *ctx) - struct inode *inode = file_inode(file); - int err; - -- if (is_bad_inode(inode)) -+ if (fuse_is_bad(inode)) - return -EIO; - - mutex_lock(&ff->readdir.lock); -diff --git a/fs/fuse/xattr.c b/fs/fuse/xattr.c -index 20d052e08b3be..28fed52957707 100644 ---- a/fs/fuse/xattr.c -+++ b/fs/fuse/xattr.c -@@ -113,6 +113,9 @@ ssize_t fuse_listxattr(struct dentry *entry, char *list, size_t size) - struct fuse_getxattr_out outarg; - ssize_t ret; - -+ if (fuse_is_bad(inode)) -+ return -EIO; -+ - if (!fuse_allow_current_process(fc)) - return -EACCES; - -@@ -178,6 +181,9 @@ static int fuse_xattr_get(const struct xattr_handler *handler, - struct dentry *dentry, struct inode *inode, - const char *name, void *value, size_t size) - { -+ if (fuse_is_bad(inode)) -+ return -EIO; -+ - return fuse_getxattr(inode, name, value, size); - } - -@@ -186,6 +192,9 @@ static int fuse_xattr_set(const struct xattr_handler *handler, - const char *name, const void *value, size_t size, - int flags) - { -+ if (fuse_is_bad(inode)) -+ return -EIO; -+ - if (!value) - return fuse_removexattr(inode, name); - -diff --git a/fs/proc/base.c b/fs/proc/base.c -index b690074e65ffa..653c2d8aa1cd7 100644 ---- a/fs/proc/base.c -+++ b/fs/proc/base.c -@@ -403,11 +403,11 @@ print0: - - static int lock_trace(struct task_struct *task) - { -- int err = mutex_lock_killable(&task->signal->exec_update_mutex); -+ int err = down_read_killable(&task->signal->exec_update_lock); - if (err) - return err; - if (!ptrace_may_access(task, PTRACE_MODE_ATTACH_FSCREDS)) { -- mutex_unlock(&task->signal->exec_update_mutex); -+ up_read(&task->signal->exec_update_lock); - return -EPERM; - } - return 0; -@@ -415,7 +415,7 @@ static int lock_trace(struct task_struct *task) - - static void unlock_trace(struct task_struct *task) - { -- mutex_unlock(&task->signal->exec_update_mutex); -+ up_read(&task->signal->exec_update_lock); - } - - #ifdef CONFIG_STACKTRACE -@@ -2769,7 +2769,7 @@ static int do_io_accounting(struct task_struct *task, struct seq_file *m, int wh - unsigned long flags; - int result; - -- result = mutex_lock_killable(&task->signal->exec_update_mutex); -+ result = down_read_killable(&task->signal->exec_update_lock); - if (result) - return result; - -@@ -2805,7 +2805,7 @@ static int do_io_accounting(struct task_struct *task, struct seq_file *m, int wh - result = 0; - - out_unlock: -- mutex_unlock(&task->signal->exec_update_mutex); -+ up_read(&task->signal->exec_update_lock); - return result; - } - -diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h -index 85b5151911cfd..4856706fbfeb4 100644 ---- a/include/linux/kdev_t.h -+++ b/include/linux/kdev_t.h -@@ -21,61 +21,61 @@ - }) - - /* acceptable for old filesystems */ --static inline bool old_valid_dev(dev_t dev) -+static __always_inline bool old_valid_dev(dev_t dev) - { - return MAJOR(dev) < 256 && MINOR(dev) < 256; - } - --static inline u16 old_encode_dev(dev_t dev) -+static __always_inline u16 old_encode_dev(dev_t dev) - { - return (MAJOR(dev) << 8) | MINOR(dev); - } - --static inline dev_t old_decode_dev(u16 val) -+static __always_inline dev_t old_decode_dev(u16 val) - { - return MKDEV((val >> 8) & 255, val & 255); - } - --static inline u32 new_encode_dev(dev_t dev) -+static __always_inline u32 new_encode_dev(dev_t dev) - { - unsigned major = MAJOR(dev); - unsigned minor = MINOR(dev); - return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12); - } - --static inline dev_t new_decode_dev(u32 dev) -+static __always_inline dev_t new_decode_dev(u32 dev) - { - unsigned major = (dev & 0xfff00) >> 8; - unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00); - return MKDEV(major, minor); - } - --static inline u64 huge_encode_dev(dev_t dev) -+static __always_inline u64 huge_encode_dev(dev_t dev) - { - return new_encode_dev(dev); - } - --static inline dev_t huge_decode_dev(u64 dev) -+static __always_inline dev_t huge_decode_dev(u64 dev) - { - return new_decode_dev(dev); - } - --static inline int sysv_valid_dev(dev_t dev) -+static __always_inline int sysv_valid_dev(dev_t dev) - { - return MAJOR(dev) < (1<<14) && MINOR(dev) < (1<<18); - } - --static inline u32 sysv_encode_dev(dev_t dev) -+static __always_inline u32 sysv_encode_dev(dev_t dev) - { - return MINOR(dev) | (MAJOR(dev) << 18); - } - --static inline unsigned sysv_major(u32 dev) -+static __always_inline unsigned sysv_major(u32 dev) - { - return (dev >> 18) & 0x3fff; - } - --static inline unsigned sysv_minor(u32 dev) -+static __always_inline unsigned sysv_minor(u32 dev) - { - return dev & 0x3ffff; - } -diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h -index 00d6054687dd2..8a3606372abc8 100644 ---- a/include/linux/rwsem.h -+++ b/include/linux/rwsem.h -@@ -125,6 +125,7 @@ static inline int rwsem_is_contended(struct rw_semaphore *sem) - * lock for reading - */ - extern void down_read(struct rw_semaphore *sem); -+extern int __must_check down_read_interruptible(struct rw_semaphore *sem); - extern int __must_check down_read_killable(struct rw_semaphore *sem); - - /* -@@ -173,6 +174,7 @@ extern void downgrade_write(struct rw_semaphore *sem); - * See Documentation/locking/lockdep-design.rst for more details.) - */ - extern void down_read_nested(struct rw_semaphore *sem, int subclass); -+extern int __must_check down_read_killable_nested(struct rw_semaphore *sem, int subclass); - extern void down_write_nested(struct rw_semaphore *sem, int subclass); - extern int down_write_killable_nested(struct rw_semaphore *sem, int subclass); - extern void _down_write_nest_lock(struct rw_semaphore *sem, struct lockdep_map *nest_lock); -@@ -193,6 +195,7 @@ extern void down_read_non_owner(struct rw_semaphore *sem); - extern void up_read_non_owner(struct rw_semaphore *sem); - #else - # define down_read_nested(sem, subclass) down_read(sem) -+# define down_read_killable_nested(sem, subclass) down_read_killable(sem) - # define down_write_nest_lock(sem, nest_lock) down_write(sem) - # define down_write_nested(sem, subclass) down_write(sem) - # define down_write_killable_nested(sem, subclass) down_write_killable(sem) -diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h -index a29df79540ce6..baf58f4cb0578 100644 ---- a/include/linux/sched/signal.h -+++ b/include/linux/sched/signal.h -@@ -226,12 +226,13 @@ struct signal_struct { - * credential calculations - * (notably. ptrace) - * Deprecated do not use in new code. -- * Use exec_update_mutex instead. -- */ -- struct mutex exec_update_mutex; /* Held while task_struct is being -- * updated during exec, and may have -- * inconsistent permissions. -+ * Use exec_update_lock instead. - */ -+ struct rw_semaphore exec_update_lock; /* Held while task_struct is -+ * being updated during exec, -+ * and may have inconsistent -+ * permissions. -+ */ - } __randomize_layout; - - /* -diff --git a/init/init_task.c b/init/init_task.c -index bd403ed3e4184..df7041be96fca 100644 ---- a/init/init_task.c -+++ b/init/init_task.c -@@ -26,7 +26,7 @@ static struct signal_struct init_signals = { - .multiprocess = HLIST_HEAD_INIT, - .rlim = INIT_RLIMITS, - .cred_guard_mutex = __MUTEX_INITIALIZER(init_signals.cred_guard_mutex), -- .exec_update_mutex = __MUTEX_INITIALIZER(init_signals.exec_update_mutex), -+ .exec_update_lock = __RWSEM_INITIALIZER(init_signals.exec_update_lock), - #ifdef CONFIG_POSIX_TIMERS - .posix_timers = LIST_HEAD_INIT(init_signals.posix_timers), - .cputimer = { -diff --git a/kernel/events/core.c b/kernel/events/core.c -index 9f7c2da992991..2ef33e9a75910 100644 ---- a/kernel/events/core.c -+++ b/kernel/events/core.c -@@ -1254,7 +1254,7 @@ static void put_ctx(struct perf_event_context *ctx) - * function. - * - * Lock order: -- * exec_update_mutex -+ * exec_update_lock - * task_struct::perf_event_mutex - * perf_event_context::mutex - * perf_event::child_mutex; -@@ -11001,24 +11001,6 @@ SYSCALL_DEFINE5(perf_event_open, - goto err_task; - } - -- if (task) { -- err = mutex_lock_interruptible(&task->signal->exec_update_mutex); -- if (err) -- goto err_task; -- -- /* -- * Reuse ptrace permission checks for now. -- * -- * We must hold exec_update_mutex across this and any potential -- * perf_install_in_context() call for this new event to -- * serialize against exec() altering our credentials (and the -- * perf_event_exit_task() that could imply). -- */ -- err = -EACCES; -- if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) -- goto err_cred; -- } -- - if (flags & PERF_FLAG_PID_CGROUP) - cgroup_fd = pid; - -@@ -11026,7 +11008,7 @@ SYSCALL_DEFINE5(perf_event_open, - NULL, NULL, cgroup_fd); - if (IS_ERR(event)) { - err = PTR_ERR(event); -- goto err_cred; -+ goto err_task; - } - - if (is_sampling_event(event)) { -@@ -11145,6 +11127,24 @@ SYSCALL_DEFINE5(perf_event_open, - goto err_context; - } - -+ if (task) { -+ err = down_read_interruptible(&task->signal->exec_update_lock); -+ if (err) -+ goto err_file; -+ -+ /* -+ * Preserve ptrace permission check for backwards compatibility. -+ * -+ * We must hold exec_update_lock across this and any potential -+ * perf_install_in_context() call for this new event to -+ * serialize against exec() altering our credentials (and the -+ * perf_event_exit_task() that could imply). -+ */ -+ err = -EACCES; -+ if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) -+ goto err_cred; -+ } -+ - if (move_group) { - gctx = __perf_event_ctx_lock_double(group_leader, ctx); - -@@ -11298,7 +11298,7 @@ SYSCALL_DEFINE5(perf_event_open, - mutex_unlock(&ctx->mutex); - - if (task) { -- mutex_unlock(&task->signal->exec_update_mutex); -+ up_read(&task->signal->exec_update_lock); - put_task_struct(task); - } - -@@ -11320,7 +11320,10 @@ err_locked: - if (move_group) - perf_event_ctx_unlock(group_leader, gctx); - mutex_unlock(&ctx->mutex); --/* err_file: */ -+err_cred: -+ if (task) -+ up_read(&task->signal->exec_update_lock); -+err_file: - fput(event_file); - err_context: - perf_unpin_context(ctx); -@@ -11332,9 +11335,6 @@ err_alloc: - */ - if (!event_file) - free_event(event); --err_cred: -- if (task) -- mutex_unlock(&task->signal->exec_update_mutex); - err_task: - if (task) - put_task_struct(task); -@@ -11639,7 +11639,7 @@ static void perf_event_exit_task_context(struct task_struct *child, int ctxn) - /* - * When a child task exits, feed back event values to parent events. - * -- * Can be called with exec_update_mutex held when called from -+ * Can be called with exec_update_lock held when called from - * install_exec_creds(). - */ - void perf_event_exit_task(struct task_struct *child) -diff --git a/kernel/fork.c b/kernel/fork.c -index 419fff8eb9e55..50f37d5afb32b 100644 ---- a/kernel/fork.c -+++ b/kernel/fork.c -@@ -1221,7 +1221,7 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode) - struct mm_struct *mm; - int err; - -- err = mutex_lock_killable(&task->signal->exec_update_mutex); -+ err = down_read_killable(&task->signal->exec_update_lock); - if (err) - return ERR_PTR(err); - -@@ -1231,7 +1231,7 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode) - mmput(mm); - mm = ERR_PTR(-EACCES); - } -- mutex_unlock(&task->signal->exec_update_mutex); -+ up_read(&task->signal->exec_update_lock); - - return mm; - } -@@ -1586,7 +1586,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) - sig->oom_score_adj_min = current->signal->oom_score_adj_min; - - mutex_init(&sig->cred_guard_mutex); -- mutex_init(&sig->exec_update_mutex); -+ init_rwsem(&sig->exec_update_lock); - - return 0; - } -diff --git a/kernel/kcmp.c b/kernel/kcmp.c -index b3ff9288c6cc9..c0d2ad9b4705d 100644 ---- a/kernel/kcmp.c -+++ b/kernel/kcmp.c -@@ -75,25 +75,25 @@ get_file_raw_ptr(struct task_struct *task, unsigned int idx) - return file; - } - --static void kcmp_unlock(struct mutex *m1, struct mutex *m2) -+static void kcmp_unlock(struct rw_semaphore *l1, struct rw_semaphore *l2) - { -- if (likely(m2 != m1)) -- mutex_unlock(m2); -- mutex_unlock(m1); -+ if (likely(l2 != l1)) -+ up_read(l2); -+ up_read(l1); - } - --static int kcmp_lock(struct mutex *m1, struct mutex *m2) -+static int kcmp_lock(struct rw_semaphore *l1, struct rw_semaphore *l2) - { - int err; - -- if (m2 > m1) -- swap(m1, m2); -+ if (l2 > l1) -+ swap(l1, l2); - -- err = mutex_lock_killable(m1); -- if (!err && likely(m1 != m2)) { -- err = mutex_lock_killable_nested(m2, SINGLE_DEPTH_NESTING); -+ err = down_read_killable(l1); -+ if (!err && likely(l1 != l2)) { -+ err = down_read_killable_nested(l2, SINGLE_DEPTH_NESTING); - if (err) -- mutex_unlock(m1); -+ up_read(l1); - } - - return err; -@@ -173,8 +173,8 @@ SYSCALL_DEFINE5(kcmp, pid_t, pid1, pid_t, pid2, int, type, - /* - * One should have enough rights to inspect task details. - */ -- ret = kcmp_lock(&task1->signal->exec_update_mutex, -- &task2->signal->exec_update_mutex); -+ ret = kcmp_lock(&task1->signal->exec_update_lock, -+ &task2->signal->exec_update_lock); - if (ret) - goto err; - if (!ptrace_may_access(task1, PTRACE_MODE_READ_REALCREDS) || -@@ -229,8 +229,8 @@ SYSCALL_DEFINE5(kcmp, pid_t, pid1, pid_t, pid2, int, type, - } - - err_unlock: -- kcmp_unlock(&task1->signal->exec_update_mutex, -- &task2->signal->exec_update_mutex); -+ kcmp_unlock(&task1->signal->exec_update_lock, -+ &task2->signal->exec_update_lock); - err: - put_task_struct(task1); - put_task_struct(task2); -diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c -index baafa1dd9fcc4..5d54ff3179b80 100644 ---- a/kernel/locking/rwsem.c -+++ b/kernel/locking/rwsem.c -@@ -1348,6 +1348,18 @@ inline void __down_read(struct rw_semaphore *sem) - } - } - -+static inline int __down_read_interruptible(struct rw_semaphore *sem) -+{ -+ if (!rwsem_read_trylock(sem)) { -+ if (IS_ERR(rwsem_down_read_slowpath(sem, TASK_INTERRUPTIBLE))) -+ return -EINTR; -+ DEBUG_RWSEMS_WARN_ON(!is_rwsem_reader_owned(sem), sem); -+ } else { -+ rwsem_set_reader_owned(sem); -+ } -+ return 0; -+} -+ - static inline int __down_read_killable(struct rw_semaphore *sem) - { - if (!rwsem_read_trylock(sem)) { -@@ -1498,6 +1510,20 @@ void __sched down_read(struct rw_semaphore *sem) - } - EXPORT_SYMBOL(down_read); - -+int __sched down_read_interruptible(struct rw_semaphore *sem) -+{ -+ might_sleep(); -+ rwsem_acquire_read(&sem->dep_map, 0, 0, _RET_IP_); -+ -+ if (LOCK_CONTENDED_RETURN(sem, __down_read_trylock, __down_read_interruptible)) { -+ rwsem_release(&sem->dep_map, 1, _RET_IP_); -+ return -EINTR; -+ } -+ -+ return 0; -+} -+EXPORT_SYMBOL(down_read_interruptible); -+ - int __sched down_read_killable(struct rw_semaphore *sem) - { - might_sleep(); -@@ -1608,6 +1634,20 @@ void down_read_nested(struct rw_semaphore *sem, int subclass) - } - EXPORT_SYMBOL(down_read_nested); - -+int down_read_killable_nested(struct rw_semaphore *sem, int subclass) -+{ -+ might_sleep(); -+ rwsem_acquire_read(&sem->dep_map, subclass, 0, _RET_IP_); -+ -+ if (LOCK_CONTENDED_RETURN(sem, __down_read_trylock, __down_read_killable)) { -+ rwsem_release(&sem->dep_map, 1, _RET_IP_); -+ return -EINTR; -+ } -+ -+ return 0; -+} -+EXPORT_SYMBOL(down_read_killable_nested); -+ - void _down_write_nest_lock(struct rw_semaphore *sem, struct lockdep_map *nest) - { - might_sleep(); diff --git a/patch/kernel/odroidxu4-current/patch-5.4.88-89.patch b/patch/kernel/odroidxu4-current/patch-5.4.88-89.patch deleted file mode 100644 index bcf2d61f38..0000000000 --- a/patch/kernel/odroidxu4-current/patch-5.4.88-89.patch +++ /dev/null @@ -1,2852 +0,0 @@ -diff --git a/Makefile b/Makefile -index 450ebe1528062..95848875110ef 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - VERSION = 5 - PATCHLEVEL = 4 --SUBLEVEL = 88 -+SUBLEVEL = 89 - EXTRAVERSION = - NAME = Kleptomaniac Octopus - -@@ -436,7 +436,7 @@ LEX = flex - YACC = bison - AWK = awk - INSTALLKERNEL := installkernel --DEPMOD = /sbin/depmod -+DEPMOD = depmod - PERL = perl - PYTHON = python - PYTHON3 = python3 -diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S -index 5229eeac8946d..4def51c12e1bf 100644 ---- a/arch/powerpc/kernel/vmlinux.lds.S -+++ b/arch/powerpc/kernel/vmlinux.lds.S -@@ -98,7 +98,7 @@ SECTIONS - ALIGN_FUNCTION(); - #endif - /* careful! __ftr_alt_* sections need to be close to .text */ -- *(.text.hot TEXT_MAIN .text.fixup .text.unlikely .fixup __ftr_alt_* .ref.text); -+ *(.text.hot .text.hot.* TEXT_MAIN .text.fixup .text.unlikely .text.unlikely.* .fixup __ftr_alt_* .ref.text); - #ifdef CONFIG_PPC64 - *(.tramp.ftrace.text); - #endif -diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c -index aa5c064a6a227..4ea906fe1c351 100644 ---- a/arch/x86/kernel/cpu/mtrr/generic.c -+++ b/arch/x86/kernel/cpu/mtrr/generic.c -@@ -167,9 +167,6 @@ static u8 mtrr_type_lookup_variable(u64 start, u64 end, u64 *partial_end, - *repeat = 0; - *uniform = 1; - -- /* Make end inclusive instead of exclusive */ -- end--; -- - prev_match = MTRR_TYPE_INVALID; - for (i = 0; i < num_var_ranges; ++i) { - unsigned short start_state, end_state, inclusive; -@@ -261,6 +258,9 @@ u8 mtrr_type_lookup(u64 start, u64 end, u8 *uniform) - int repeat; - u64 partial_end; - -+ /* Make end inclusive instead of exclusive */ -+ end--; -+ - if (!mtrr_state_set) - return MTRR_TYPE_INVALID; - -diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h -index 6f2208cf30df3..ea9945a05b831 100644 ---- a/arch/x86/kvm/mmu.h -+++ b/arch/x86/kvm/mmu.h -@@ -48,7 +48,7 @@ static inline u64 rsvd_bits(int s, int e) - if (e < s) - return 0; - -- return ((1ULL << (e - s + 1)) - 1) << s; -+ return ((2ULL << (e - s)) - 1) << s; - } - - void kvm_mmu_set_mmio_spte_mask(u64 mmio_mask, u64 mmio_value, u64 access_mask); -diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c -index 7bd2c3a52297f..7982f13807aa0 100644 ---- a/arch/x86/mm/pgtable.c -+++ b/arch/x86/mm/pgtable.c -@@ -826,6 +826,8 @@ int pud_free_pmd_page(pud_t *pud, unsigned long addr) - } - - free_page((unsigned long)pmd_sv); -+ -+ pgtable_pmd_page_dtor(virt_to_page(pmd)); - free_page((unsigned long)pmd); - - return 1; -diff --git a/crypto/asymmetric_keys/asym_tpm.c b/crypto/asymmetric_keys/asym_tpm.c -index 5154e280ada22..08baa10a254bf 100644 ---- a/crypto/asymmetric_keys/asym_tpm.c -+++ b/crypto/asymmetric_keys/asym_tpm.c -@@ -370,7 +370,7 @@ static uint32_t derive_pub_key(const void *pub_key, uint32_t len, uint8_t *buf) - memcpy(cur, e, sizeof(e)); - cur += sizeof(e); - /* Zero parameters to satisfy set_pub_key ABI. */ -- memset(cur, 0, SETKEY_PARAMS_SIZE); -+ memzero_explicit(cur, SETKEY_PARAMS_SIZE); - - return cur - buf; - } -diff --git a/crypto/ecdh.c b/crypto/ecdh.c -index efa4ee72301f8..46570b517175a 100644 ---- a/crypto/ecdh.c -+++ b/crypto/ecdh.c -@@ -39,7 +39,8 @@ static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf, - struct ecdh params; - unsigned int ndigits; - -- if (crypto_ecdh_decode_key(buf, len, ¶ms) < 0) -+ if (crypto_ecdh_decode_key(buf, len, ¶ms) < 0 || -+ params.key_size > sizeof(ctx->private_key)) - return -EINVAL; - - ndigits = ecdh_supported_curve(params.curve_id); -diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c -index df51680e89319..363073e7b6538 100644 ---- a/drivers/atm/idt77252.c -+++ b/drivers/atm/idt77252.c -@@ -3606,7 +3606,7 @@ static int idt77252_init_one(struct pci_dev *pcidev, - - if ((err = dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(32)))) { - printk("idt77252: can't enable DMA for PCI device at %s\n", pci_name(pcidev)); -- return err; -+ goto err_out_disable_pdev; - } - - card = kzalloc(sizeof(struct idt77252_dev), GFP_KERNEL); -diff --git a/drivers/base/core.c b/drivers/base/core.c -index ddfbd62d8bfc2..c5edb00938f69 100644 ---- a/drivers/base/core.c -+++ b/drivers/base/core.c -@@ -3414,7 +3414,7 @@ void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode) - if (fwnode_is_primary(fn)) { - dev->fwnode = fn->secondary; - if (!(parent && fn == parent->fwnode)) -- fn->secondary = ERR_PTR(-ENODEV); -+ fn->secondary = NULL; - } else { - dev->fwnode = NULL; - } -diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c -index 17b0f1b793ec8..e11af747395dd 100644 ---- a/drivers/bluetooth/hci_h5.c -+++ b/drivers/bluetooth/hci_h5.c -@@ -250,12 +250,8 @@ static int h5_close(struct hci_uart *hu) - if (h5->vnd && h5->vnd->close) - h5->vnd->close(h5); - -- if (hu->serdev) -- serdev_device_close(hu->serdev); -- -- kfree_skb(h5->rx_skb); -- kfree(h5); -- h5 = NULL; -+ if (!hu->serdev) -+ kfree(h5); - - return 0; - } -diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c -index f6df6ef1b0fbe..758de0e9b2ddc 100644 ---- a/drivers/dma-buf/dma-buf.c -+++ b/drivers/dma-buf/dma-buf.c -@@ -76,10 +76,6 @@ static void dma_buf_release(struct dentry *dentry) - - dmabuf->ops->release(dmabuf); - -- mutex_lock(&db_list.lock); -- list_del(&dmabuf->list_node); -- mutex_unlock(&db_list.lock); -- - if (dmabuf->resv == (struct dma_resv *)&dmabuf[1]) - dma_resv_fini(dmabuf->resv); - -@@ -88,6 +84,22 @@ static void dma_buf_release(struct dentry *dentry) - kfree(dmabuf); - } - -+static int dma_buf_file_release(struct inode *inode, struct file *file) -+{ -+ struct dma_buf *dmabuf; -+ -+ if (!is_dma_buf_file(file)) -+ return -EINVAL; -+ -+ dmabuf = file->private_data; -+ -+ mutex_lock(&db_list.lock); -+ list_del(&dmabuf->list_node); -+ mutex_unlock(&db_list.lock); -+ -+ return 0; -+} -+ - static const struct dentry_operations dma_buf_dentry_ops = { - .d_dname = dmabuffs_dname, - .d_release = dma_buf_release, -@@ -413,6 +425,7 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file) - } - - static const struct file_operations dma_buf_fops = { -+ .release = dma_buf_file_release, - .mmap = dma_buf_mmap_internal, - .llseek = dma_buf_llseek, - .poll = dma_buf_poll, -diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c -index 7f7d59445faed..198a91c765314 100644 ---- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c -+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c -@@ -936,7 +936,7 @@ static void reloc_gpu_flush(struct reloc_cache *cache) - GEM_BUG_ON(cache->rq_size >= obj->base.size / sizeof(u32)); - cache->rq_cmd[cache->rq_size] = MI_BATCH_BUFFER_END; - -- __i915_gem_object_flush_map(obj, 0, sizeof(u32) * (cache->rq_size + 1)); -+ i915_gem_object_flush_map(obj); - i915_gem_object_unpin_map(obj); - - intel_gt_chipset_flush(cache->rq->engine->gt); -@@ -1163,6 +1163,8 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb, - goto out_pool; - } - -+ memset32(cmd, 0, pool->obj->base.size / sizeof(u32)); -+ - batch = i915_vma_instance(pool->obj, vma->vm, NULL); - if (IS_ERR(batch)) { - err = PTR_ERR(batch); -diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c -index 80bc3bf82f4d7..775fd34132abb 100644 ---- a/drivers/ide/ide-atapi.c -+++ b/drivers/ide/ide-atapi.c -@@ -223,7 +223,6 @@ void ide_prep_sense(ide_drive_t *drive, struct request *rq) - sense_rq->rq_disk = rq->rq_disk; - sense_rq->cmd_flags = REQ_OP_DRV_IN; - ide_req(sense_rq)->type = ATA_PRIV_SENSE; -- sense_rq->rq_flags |= RQF_PREEMPT; - - req->cmd[0] = GPCMD_REQUEST_SENSE; - req->cmd[4] = cmd_len; -diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c -index b137f27a34d58..b32a013d827a0 100644 ---- a/drivers/ide/ide-io.c -+++ b/drivers/ide/ide-io.c -@@ -512,11 +512,6 @@ repeat: - * above to return us whatever is in the queue. Since we call - * ide_do_request() ourselves, we end up taking requests while - * the queue is blocked... -- * -- * We let requests forced at head of queue with ide-preempt -- * though. I hope that doesn't happen too much, hopefully not -- * unless the subdriver triggers such a thing in its own PM -- * state machine. - */ - if ((drive->dev_flags & IDE_DFLAG_BLOCKED) && - ata_pm_request(rq) == 0 && -diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c -index ef5d5cc529693..0d9b3fa7bd94e 100644 ---- a/drivers/net/dsa/lantiq_gswip.c -+++ b/drivers/net/dsa/lantiq_gswip.c -@@ -92,9 +92,7 @@ - GSWIP_MDIO_PHY_FDUP_MASK) - - /* GSWIP MII Registers */ --#define GSWIP_MII_CFG0 0x00 --#define GSWIP_MII_CFG1 0x02 --#define GSWIP_MII_CFG5 0x04 -+#define GSWIP_MII_CFGp(p) (0x2 * (p)) - #define GSWIP_MII_CFG_EN BIT(14) - #define GSWIP_MII_CFG_LDCLKDIS BIT(12) - #define GSWIP_MII_CFG_MODE_MIIP 0x0 -@@ -392,17 +390,9 @@ static void gswip_mii_mask(struct gswip_priv *priv, u32 clear, u32 set, - static void gswip_mii_mask_cfg(struct gswip_priv *priv, u32 clear, u32 set, - int port) - { -- switch (port) { -- case 0: -- gswip_mii_mask(priv, clear, set, GSWIP_MII_CFG0); -- break; -- case 1: -- gswip_mii_mask(priv, clear, set, GSWIP_MII_CFG1); -- break; -- case 5: -- gswip_mii_mask(priv, clear, set, GSWIP_MII_CFG5); -- break; -- } -+ /* There's no MII_CFG register for the CPU port */ -+ if (!dsa_is_cpu_port(priv->ds, port)) -+ gswip_mii_mask(priv, clear, set, GSWIP_MII_CFGp(port)); - } - - static void gswip_mii_mask_pcdu(struct gswip_priv *priv, u32 clear, u32 set, -@@ -806,9 +796,8 @@ static int gswip_setup(struct dsa_switch *ds) - gswip_mdio_mask(priv, 0xff, 0x09, GSWIP_MDIO_MDC_CFG1); - - /* Disable the xMII link */ -- gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, 0); -- gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, 1); -- gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, 5); -+ for (i = 0; i < priv->hw_info->max_ports; i++) -+ gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, i); - - /* enable special tag insertion on cpu port */ - gswip_switch_mask(priv, 0, GSWIP_FDMA_PCTRL_STEN, -@@ -1522,9 +1511,7 @@ static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port, - { - struct gswip_priv *priv = ds->priv; - -- /* Enable the xMII interface only for the external PHY */ -- if (interface != PHY_INTERFACE_MODE_INTERNAL) -- gswip_mii_mask_cfg(priv, 0, GSWIP_MII_CFG_EN, port); -+ gswip_mii_mask_cfg(priv, 0, GSWIP_MII_CFG_EN, port); - } - - static void gswip_get_strings(struct dsa_switch *ds, int port, u32 stringset, -diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c -index 71eb8914e620b..470d12e308814 100644 ---- a/drivers/net/ethernet/broadcom/bcmsysport.c -+++ b/drivers/net/ethernet/broadcom/bcmsysport.c -@@ -2520,6 +2520,7 @@ static int bcm_sysport_probe(struct platform_device *pdev) - NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; - dev->hw_features |= dev->features; - dev->vlan_features |= dev->features; -+ dev->max_mtu = UMAC_MAX_MTU_SIZE; - - /* Request the WOL interrupt and advertise suspend if available */ - priv->wol_irq_disabled = 1; -diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c -index ea4f17f5cce77..590d20ca891cb 100644 ---- a/drivers/net/ethernet/ethoc.c -+++ b/drivers/net/ethernet/ethoc.c -@@ -1207,7 +1207,7 @@ static int ethoc_probe(struct platform_device *pdev) - ret = mdiobus_register(priv->mdio); - if (ret) { - dev_err(&netdev->dev, "failed to register MDIO bus\n"); -- goto free2; -+ goto free3; - } - - ret = ethoc_mdio_probe(netdev); -@@ -1239,6 +1239,7 @@ error2: - netif_napi_del(&priv->napi); - error: - mdiobus_unregister(priv->mdio); -+free3: - mdiobus_free(priv->mdio); - free2: - clk_disable_unprepare(priv->clk); -diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c -index d3b8ce734c1b9..beaf35c585d28 100644 ---- a/drivers/net/ethernet/freescale/ucc_geth.c -+++ b/drivers/net/ethernet/freescale/ucc_geth.c -@@ -3890,6 +3890,7 @@ static int ucc_geth_probe(struct platform_device* ofdev) - INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work); - netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, 64); - dev->mtu = 1500; -+ dev->max_mtu = 1518; - - ugeth->msg_enable = netif_msg_init(debug.msg_enable, UGETH_MSG_DEFAULT); - ugeth->phy_interface = phy_interface; -@@ -3935,12 +3936,12 @@ static int ucc_geth_remove(struct platform_device* ofdev) - struct device_node *np = ofdev->dev.of_node; - - unregister_netdev(dev); -- free_netdev(dev); - ucc_geth_memclean(ugeth); - if (of_phy_is_fixed_link(np)) - of_phy_deregister_fixed_link(np); - of_node_put(ugeth->ug_info->tbi_node); - of_node_put(ugeth->ug_info->phy_node); -+ free_netdev(dev); - - return 0; - } -diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c -index 717fccc2efba9..78b2f4e01bd8e 100644 ---- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c -+++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c -@@ -415,6 +415,10 @@ static void __lb_other_process(struct hns_nic_ring_data *ring_data, - /* for mutl buffer*/ - new_skb = skb_copy(skb, GFP_ATOMIC); - dev_kfree_skb_any(skb); -+ if (!new_skb) { -+ netdev_err(ndev, "skb alloc failed\n"); -+ return; -+ } - skb = new_skb; - - check_ok = 0; -diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c -index 47b8ce7822c09..9040340fad198 100644 ---- a/drivers/net/ethernet/ibm/ibmvnic.c -+++ b/drivers/net/ethernet/ibm/ibmvnic.c -@@ -2152,8 +2152,7 @@ static void __ibmvnic_reset(struct work_struct *work) - rc = do_hard_reset(adapter, rwi, reset_state); - rtnl_unlock(); - } -- } else if (!(rwi->reset_reason == VNIC_RESET_FATAL && -- adapter->from_passive_init)) { -+ } else { - rc = do_reset(adapter, rwi, reset_state); - } - kfree(rwi); -diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h -index cfe99bae8e362..678e4190b8a8c 100644 ---- a/drivers/net/ethernet/intel/i40e/i40e.h -+++ b/drivers/net/ethernet/intel/i40e/i40e.h -@@ -129,6 +129,7 @@ enum i40e_state_t { - __I40E_RESET_INTR_RECEIVED, - __I40E_REINIT_REQUESTED, - __I40E_PF_RESET_REQUESTED, -+ __I40E_PF_RESET_AND_REBUILD_REQUESTED, - __I40E_CORE_RESET_REQUESTED, - __I40E_GLOBAL_RESET_REQUESTED, - __I40E_EMP_RESET_INTR_RECEIVED, -@@ -156,6 +157,8 @@ enum i40e_state_t { - }; - - #define I40E_PF_RESET_FLAG BIT_ULL(__I40E_PF_RESET_REQUESTED) -+#define I40E_PF_RESET_AND_REBUILD_FLAG \ -+ BIT_ULL(__I40E_PF_RESET_AND_REBUILD_REQUESTED) - - /* VSI state flags */ - enum i40e_vsi_state_t { -diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c -index 2b4327416457d..c19b45a90fcd2 100644 ---- a/drivers/net/ethernet/intel/i40e/i40e_main.c -+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c -@@ -44,6 +44,8 @@ static int i40e_setup_misc_vector(struct i40e_pf *pf); - static void i40e_determine_queue_usage(struct i40e_pf *pf); - static int i40e_setup_pf_filter_control(struct i40e_pf *pf); - static void i40e_prep_for_reset(struct i40e_pf *pf, bool lock_acquired); -+static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit, -+ bool lock_acquired); - static int i40e_reset(struct i40e_pf *pf); - static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired); - static int i40e_setup_misc_vector_for_recovery_mode(struct i40e_pf *pf); -@@ -8484,6 +8486,14 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired) - "FW LLDP is disabled\n" : - "FW LLDP is enabled\n"); - -+ } else if (reset_flags & I40E_PF_RESET_AND_REBUILD_FLAG) { -+ /* Request a PF Reset -+ * -+ * Resets PF and reinitializes PFs VSI. -+ */ -+ i40e_prep_for_reset(pf, lock_acquired); -+ i40e_reset_and_rebuild(pf, true, lock_acquired); -+ - } else if (reset_flags & BIT_ULL(__I40E_REINIT_REQUESTED)) { - int v; - -diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c -index 09ff3f335ffa6..c952212900fcf 100644 ---- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c -+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c -@@ -1704,7 +1704,7 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs) - if (num_vfs) { - if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) { - pf->flags |= I40E_FLAG_VEB_MODE_ENABLED; -- i40e_do_reset_safe(pf, I40E_PF_RESET_FLAG); -+ i40e_do_reset_safe(pf, I40E_PF_RESET_AND_REBUILD_FLAG); - } - ret = i40e_pci_sriov_enable(pdev, num_vfs); - goto sriov_configure_out; -@@ -1713,7 +1713,7 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs) - if (!pci_vfs_assigned(pf->pdev)) { - i40e_free_vfs(pf); - pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED; -- i40e_do_reset_safe(pf, I40E_PF_RESET_FLAG); -+ i40e_do_reset_safe(pf, I40E_PF_RESET_AND_REBUILD_FLAG); - } else { - dev_warn(&pdev->dev, "Unable to free VFs because some are assigned to VMs.\n"); - ret = -EINVAL; -diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c -index cd95d6af8fc1b..56e6bec9af797 100644 ---- a/drivers/net/ethernet/intel/iavf/iavf_main.c -+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c -@@ -1844,11 +1844,9 @@ static int iavf_init_get_resources(struct iavf_adapter *adapter) - netif_tx_stop_all_queues(netdev); - if (CLIENT_ALLOWED(adapter)) { - err = iavf_lan_add_device(adapter); -- if (err) { -- rtnl_unlock(); -+ if (err) - dev_info(&pdev->dev, "Failed to add VF to client API service list: %d\n", - err); -- } - } - dev_info(&pdev->dev, "MAC address: %pM\n", adapter->hw.mac.addr); - if (netdev->features & NETIF_F_GRO) -diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c -index ccb2abd18d6c7..94e3f8b869be4 100644 ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -4694,7 +4694,7 @@ static int mvneta_probe(struct platform_device *pdev) - err = mvneta_port_power_up(pp, pp->phy_interface); - if (err < 0) { - dev_err(&pdev->dev, "can't power up port\n"); -- return err; -+ goto err_netdev; - } - - /* Armada3700 network controller does not support per-cpu -diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c -index 931d1a56b79ca..8827ab4b4932e 100644 ---- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c -+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c -@@ -1129,7 +1129,7 @@ static void mvpp22_gop_init_rgmii(struct mvpp2_port *port) - - regmap_read(priv->sysctrl_base, GENCONF_CTRL0, &val); - if (port->gop_id == 2) -- val |= GENCONF_CTRL0_PORT0_RGMII | GENCONF_CTRL0_PORT1_RGMII; -+ val |= GENCONF_CTRL0_PORT0_RGMII; - else if (port->gop_id == 3) - val |= GENCONF_CTRL0_PORT1_RGMII_MII; - regmap_write(priv->sysctrl_base, GENCONF_CTRL0, val); -@@ -2161,17 +2161,18 @@ static void mvpp2_rx_pkts_coal_set(struct mvpp2_port *port, - static void mvpp2_tx_pkts_coal_set(struct mvpp2_port *port, - struct mvpp2_tx_queue *txq) - { -- unsigned int thread = mvpp2_cpu_to_thread(port->priv, get_cpu()); -+ unsigned int thread; - u32 val; - - if (txq->done_pkts_coal > MVPP2_TXQ_THRESH_MASK) - txq->done_pkts_coal = MVPP2_TXQ_THRESH_MASK; - - val = (txq->done_pkts_coal << MVPP2_TXQ_THRESH_OFFSET); -- mvpp2_thread_write(port->priv, thread, MVPP2_TXQ_NUM_REG, txq->id); -- mvpp2_thread_write(port->priv, thread, MVPP2_TXQ_THRESH_REG, val); -- -- put_cpu(); -+ /* PKT-coalescing registers are per-queue + per-thread */ -+ for (thread = 0; thread < MVPP2_MAX_THREADS; thread++) { -+ mvpp2_thread_write(port->priv, thread, MVPP2_TXQ_NUM_REG, txq->id); -+ mvpp2_thread_write(port->priv, thread, MVPP2_TXQ_THRESH_REG, val); -+ } - } - - static u32 mvpp2_usec_to_cycles(u32 usec, unsigned long clk_hz) -diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c -index 5692c6087bbb0..a30eb90ba3d28 100644 ---- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c -+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c -@@ -405,6 +405,38 @@ static int mvpp2_prs_tcam_first_free(struct mvpp2 *priv, unsigned char start, - return -EINVAL; - } - -+/* Drop flow control pause frames */ -+static void mvpp2_prs_drop_fc(struct mvpp2 *priv) -+{ -+ unsigned char da[ETH_ALEN] = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x01 }; -+ struct mvpp2_prs_entry pe; -+ unsigned int len; -+ -+ memset(&pe, 0, sizeof(pe)); -+ -+ /* For all ports - drop flow control frames */ -+ pe.index = MVPP2_PE_FC_DROP; -+ mvpp2_prs_tcam_lu_set(&pe, MVPP2_PRS_LU_MAC); -+ -+ /* Set match on DA */ -+ len = ETH_ALEN; -+ while (len--) -+ mvpp2_prs_tcam_data_byte_set(&pe, len, da[len], 0xff); -+ -+ mvpp2_prs_sram_ri_update(&pe, MVPP2_PRS_RI_DROP_MASK, -+ MVPP2_PRS_RI_DROP_MASK); -+ -+ mvpp2_prs_sram_bits_set(&pe, MVPP2_PRS_SRAM_LU_GEN_BIT, 1); -+ mvpp2_prs_sram_next_lu_set(&pe, MVPP2_PRS_LU_FLOWS); -+ -+ /* Mask all ports */ -+ mvpp2_prs_tcam_port_map_set(&pe, MVPP2_PRS_PORT_MASK); -+ -+ /* Update shadow table and hw entry */ -+ mvpp2_prs_shadow_set(priv, pe.index, MVPP2_PRS_LU_MAC); -+ mvpp2_prs_hw_write(priv, &pe); -+} -+ - /* Enable/disable dropping all mac da's */ - static void mvpp2_prs_mac_drop_all_set(struct mvpp2 *priv, int port, bool add) - { -@@ -1162,6 +1194,7 @@ static void mvpp2_prs_mac_init(struct mvpp2 *priv) - mvpp2_prs_hw_write(priv, &pe); - - /* Create dummy entries for drop all and promiscuous modes */ -+ mvpp2_prs_drop_fc(priv); - mvpp2_prs_mac_drop_all_set(priv, 0, false); - mvpp2_prs_mac_promisc_set(priv, 0, MVPP2_PRS_L2_UNI_CAST, false); - mvpp2_prs_mac_promisc_set(priv, 0, MVPP2_PRS_L2_MULTI_CAST, false); -@@ -1647,8 +1680,9 @@ static int mvpp2_prs_pppoe_init(struct mvpp2 *priv) - mvpp2_prs_sram_next_lu_set(&pe, MVPP2_PRS_LU_IP6); - mvpp2_prs_sram_ri_update(&pe, MVPP2_PRS_RI_L3_IP6, - MVPP2_PRS_RI_L3_PROTO_MASK); -- /* Skip eth_type + 4 bytes of IPv6 header */ -- mvpp2_prs_sram_shift_set(&pe, MVPP2_ETH_TYPE_LEN + 4, -+ /* Jump to DIP of IPV6 header */ -+ mvpp2_prs_sram_shift_set(&pe, MVPP2_ETH_TYPE_LEN + 8 + -+ MVPP2_MAX_L3_ADDR_SIZE, - MVPP2_PRS_SRAM_OP_SEL_SHIFT_ADD); - /* Set L3 offset */ - mvpp2_prs_sram_offset_set(&pe, MVPP2_PRS_SRAM_UDF_TYPE_L3, -diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.h -index e22f6c85d3803..4b68dd3747338 100644 ---- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.h -+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.h -@@ -129,7 +129,7 @@ - #define MVPP2_PE_VID_EDSA_FLTR_DEFAULT (MVPP2_PRS_TCAM_SRAM_SIZE - 7) - #define MVPP2_PE_VLAN_DBL (MVPP2_PRS_TCAM_SRAM_SIZE - 6) - #define MVPP2_PE_VLAN_NONE (MVPP2_PRS_TCAM_SRAM_SIZE - 5) --/* reserved */ -+#define MVPP2_PE_FC_DROP (MVPP2_PRS_TCAM_SRAM_SIZE - 4) - #define MVPP2_PE_MAC_MC_PROMISCUOUS (MVPP2_PRS_TCAM_SRAM_SIZE - 3) - #define MVPP2_PE_MAC_UC_PROMISCUOUS (MVPP2_PRS_TCAM_SRAM_SIZE - 2) - #define MVPP2_PE_MAC_NON_PROMISCUOUS (MVPP2_PRS_TCAM_SRAM_SIZE - 1) -diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c -index ab6663d94f424..c818d24a8b24f 100644 ---- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c -+++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c -@@ -257,7 +257,7 @@ void ionic_rx_fill(struct ionic_queue *q) - unsigned int len; - unsigned int i; - -- len = netdev->mtu + ETH_HLEN; -+ len = netdev->mtu + ETH_HLEN + VLAN_HLEN; - - for (i = ionic_q_space_avail(q); i; i--) { - skb = ionic_rx_skb_alloc(q, len, &dma_addr); -diff --git a/drivers/net/ethernet/qlogic/qede/qede_fp.c b/drivers/net/ethernet/qlogic/qede/qede_fp.c -index 004c0bfec41d7..f310a94e04898 100644 ---- a/drivers/net/ethernet/qlogic/qede/qede_fp.c -+++ b/drivers/net/ethernet/qlogic/qede/qede_fp.c -@@ -1737,6 +1737,11 @@ netdev_features_t qede_features_check(struct sk_buff *skb, - ntohs(udp_hdr(skb)->dest) != gnv_port)) - return features & ~(NETIF_F_CSUM_MASK | - NETIF_F_GSO_MASK); -+ } else if (l4_proto == IPPROTO_IPIP) { -+ /* IPIP tunnels are unknown to the device or at least unsupported natively, -+ * offloads for them can't be done trivially, so disable them for such skb. -+ */ -+ return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK); - } - } - -diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c -index fd5adb0c54d29..366ca1b5da5cc 100644 ---- a/drivers/net/ethernet/realtek/r8169_main.c -+++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -3958,7 +3958,8 @@ static void rtl_pll_power_down(struct rtl8169_private *tp) - } - - switch (tp->mac_version) { -- case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_33: -+ case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: -+ case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_33: - case RTL_GIGA_MAC_VER_37: - case RTL_GIGA_MAC_VER_39: - case RTL_GIGA_MAC_VER_43: -@@ -3987,7 +3988,8 @@ static void rtl_pll_power_down(struct rtl8169_private *tp) - static void rtl_pll_power_up(struct rtl8169_private *tp) - { - switch (tp->mac_version) { -- case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_33: -+ case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: -+ case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_33: - case RTL_GIGA_MAC_VER_37: - case RTL_GIGA_MAC_VER_39: - case RTL_GIGA_MAC_VER_43: -diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c -index 61136428e2c0e..26cfe3f7ed8df 100644 ---- a/drivers/net/ethernet/ti/cpts.c -+++ b/drivers/net/ethernet/ti/cpts.c -@@ -485,6 +485,7 @@ void cpts_unregister(struct cpts *cpts) - - ptp_clock_unregister(cpts->clock); - cpts->clock = NULL; -+ cpts->phc_index = -1; - - cpts_write32(cpts, 0, int_enable); - cpts_write32(cpts, 0, control); -@@ -667,6 +668,7 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs, - cpts->cc.read = cpts_systim_read; - cpts->cc.mask = CLOCKSOURCE_MASK(32); - cpts->info = cpts_info; -+ cpts->phc_index = -1; - - cpts_calc_mult_shift(cpts); - /* save cc.mult original value as it can be modified -diff --git a/drivers/net/tun.c b/drivers/net/tun.c -index e72d273999834..84e779f93f0a4 100644 ---- a/drivers/net/tun.c -+++ b/drivers/net/tun.c -@@ -1469,7 +1469,7 @@ static struct sk_buff *tun_napi_alloc_frags(struct tun_file *tfile, - int i; - - if (it->nr_segs > MAX_SKB_FRAGS + 1) -- return ERR_PTR(-ENOMEM); -+ return ERR_PTR(-EMSGSIZE); - - local_bh_disable(); - skb = napi_get_frags(&tfile->napi); -diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c -index c2c82e6391b4f..d407489cec904 100644 ---- a/drivers/net/usb/cdc_ncm.c -+++ b/drivers/net/usb/cdc_ncm.c -@@ -1625,9 +1625,6 @@ 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. - */ -- netif_info(dev, link, dev->net, -- "network connection: %sconnected\n", -- !!event->wValue ? "" : "dis"); - usbnet_link_change(dev, !!event->wValue, 0); - break; - -diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c -index 74de621fa3504..b0d748a614a9e 100644 ---- a/drivers/net/usb/qmi_wwan.c -+++ b/drivers/net/usb/qmi_wwan.c -@@ -1058,6 +1058,7 @@ static const struct usb_device_id products[] = { - {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ - {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */ - {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ -+ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */ - {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */ - - /* 3. Combined interface devices matching on interface number */ -diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c -index 7cc8f405be1ad..0ef85819665c8 100644 ---- a/drivers/net/virtio_net.c -+++ b/drivers/net/virtio_net.c -@@ -2072,14 +2072,16 @@ static int virtnet_set_channels(struct net_device *dev, - - get_online_cpus(); - err = _virtnet_set_queues(vi, queue_pairs); -- if (!err) { -- netif_set_real_num_tx_queues(dev, queue_pairs); -- netif_set_real_num_rx_queues(dev, queue_pairs); -- -- virtnet_set_affinity(vi); -+ if (err) { -+ put_online_cpus(); -+ goto err; - } -+ virtnet_set_affinity(vi); - put_online_cpus(); - -+ netif_set_real_num_tx_queues(dev, queue_pairs); -+ netif_set_real_num_rx_queues(dev, queue_pairs); -+ err: - return err; - } - -diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c -index 64f8556513369..261b53fc8e04c 100644 ---- a/drivers/net/wan/hdlc_ppp.c -+++ b/drivers/net/wan/hdlc_ppp.c -@@ -569,6 +569,13 @@ static void ppp_timer(struct timer_list *t) - unsigned long flags; - - spin_lock_irqsave(&ppp->lock, flags); -+ /* mod_timer could be called after we entered this function but -+ * before we got the lock. -+ */ -+ if (timer_pending(&proto->timer)) { -+ spin_unlock_irqrestore(&ppp->lock, flags); -+ return; -+ } - switch (proto->state) { - case STOPPING: - case REQ_SENT: -diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c -index f3d5b1bbd5aa7..c37dd15d16d24 100644 ---- a/drivers/scsi/scsi_transport_spi.c -+++ b/drivers/scsi/scsi_transport_spi.c -@@ -117,12 +117,16 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd, - sshdr = &sshdr_tmp; - - for(i = 0; i < DV_RETRIES; i++) { -+ /* -+ * The purpose of the RQF_PM flag below is to bypass the -+ * SDEV_QUIESCE state. -+ */ - result = scsi_execute(sdev, cmd, dir, buffer, bufflen, sense, - sshdr, DV_TIMEOUT, /* retries */ 1, - REQ_FAILFAST_DEV | - REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER, -- 0, NULL); -+ RQF_PM, NULL); - if (driver_byte(result) != DRIVER_SENSE || - sshdr->sense_key != UNIT_ATTENTION) - break; -@@ -1005,23 +1009,26 @@ spi_dv_device(struct scsi_device *sdev) - */ - lock_system_sleep(); - -+ if (scsi_autopm_get_device(sdev)) -+ goto unlock_system_sleep; -+ - if (unlikely(spi_dv_in_progress(starget))) -- goto unlock; -+ goto put_autopm; - - if (unlikely(scsi_device_get(sdev))) -- goto unlock; -+ goto put_autopm; - - spi_dv_in_progress(starget) = 1; - - buffer = kzalloc(len, GFP_KERNEL); - - if (unlikely(!buffer)) -- goto out_put; -+ goto put_sdev; - - /* We need to verify that the actual device will quiesce; the - * later target quiesce is just a nice to have */ - if (unlikely(scsi_device_quiesce(sdev))) -- goto out_free; -+ goto free_buffer; - - scsi_target_quiesce(starget); - -@@ -1041,12 +1048,16 @@ spi_dv_device(struct scsi_device *sdev) - - spi_initial_dv(starget) = 1; - -- out_free: -+free_buffer: - kfree(buffer); -- out_put: -+ -+put_sdev: - spi_dv_in_progress(starget) = 0; - scsi_device_put(sdev); --unlock: -+put_autopm: -+ scsi_autopm_put_device(sdev); -+ -+unlock_system_sleep: - unlock_system_sleep(); - } - EXPORT_SYMBOL(spi_dv_device); -diff --git a/drivers/scsi/ufs/ufshcd-pci.c b/drivers/scsi/ufs/ufshcd-pci.c -index 3b19de3ae9a30..e4ba2445ff56f 100644 ---- a/drivers/scsi/ufs/ufshcd-pci.c -+++ b/drivers/scsi/ufs/ufshcd-pci.c -@@ -96,6 +96,30 @@ static int ufshcd_pci_resume(struct device *dev) - { - return ufshcd_system_resume(dev_get_drvdata(dev)); - } -+ -+/** -+ * ufshcd_pci_poweroff - suspend-to-disk poweroff function -+ * @dev: pointer to PCI device handle -+ * -+ * Returns 0 if successful -+ * Returns non-zero otherwise -+ */ -+static int ufshcd_pci_poweroff(struct device *dev) -+{ -+ struct ufs_hba *hba = dev_get_drvdata(dev); -+ int spm_lvl = hba->spm_lvl; -+ int ret; -+ -+ /* -+ * For poweroff we need to set the UFS device to PowerDown mode. -+ * Force spm_lvl to ensure that. -+ */ -+ hba->spm_lvl = 5; -+ ret = ufshcd_system_suspend(hba); -+ hba->spm_lvl = spm_lvl; -+ return ret; -+} -+ - #endif /* !CONFIG_PM_SLEEP */ - - #ifdef CONFIG_PM -@@ -190,8 +214,14 @@ ufshcd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) - } - - static const struct dev_pm_ops ufshcd_pci_pm_ops = { -- SET_SYSTEM_SLEEP_PM_OPS(ufshcd_pci_suspend, -- ufshcd_pci_resume) -+#ifdef CONFIG_PM_SLEEP -+ .suspend = ufshcd_pci_suspend, -+ .resume = ufshcd_pci_resume, -+ .freeze = ufshcd_pci_suspend, -+ .thaw = ufshcd_pci_resume, -+ .poweroff = ufshcd_pci_poweroff, -+ .restore = ufshcd_pci_resume, -+#endif - SET_RUNTIME_PM_OPS(ufshcd_pci_runtime_suspend, - ufshcd_pci_runtime_resume, - ufshcd_pci_runtime_idle) -diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c -index 675e16e61ebdd..b888117f4ecd3 100644 ---- a/drivers/scsi/ufs/ufshcd.c -+++ b/drivers/scsi/ufs/ufshcd.c -@@ -3593,7 +3593,7 @@ static int ufshcd_dme_enable(struct ufs_hba *hba) - ret = ufshcd_send_uic_cmd(hba, &uic_cmd); - if (ret) - dev_err(hba->dev, -- "dme-reset: error code %d\n", ret); -+ "dme-enable: error code %d\n", ret); - - return ret; - } -diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c b/drivers/staging/mt7621-dma/mtk-hsdma.c -index d964642d95a3c..bf2772af1045f 100644 ---- a/drivers/staging/mt7621-dma/mtk-hsdma.c -+++ b/drivers/staging/mt7621-dma/mtk-hsdma.c -@@ -714,7 +714,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev) - ret = dma_async_device_register(dd); - if (ret) { - dev_err(&pdev->dev, "failed to register dma device\n"); -- return ret; -+ goto err_uninit_hsdma; - } - - ret = of_dma_controller_register(pdev->dev.of_node, -@@ -730,6 +730,8 @@ static int mtk_hsdma_probe(struct platform_device *pdev) - - err_unregister: - dma_async_device_unregister(dd); -+err_uninit_hsdma: -+ mtk_hsdma_uninit(hsdma); - return ret; - } - -diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c -index 9d24e85b08631..596ad3edec9c0 100644 ---- a/drivers/target/target_core_xcopy.c -+++ b/drivers/target/target_core_xcopy.c -@@ -46,60 +46,83 @@ static int target_xcopy_gen_naa_ieee(struct se_device *dev, unsigned char *buf) - return 0; - } - --struct xcopy_dev_search_info { -- const unsigned char *dev_wwn; -- struct se_device *found_dev; --}; -- -+/** -+ * target_xcopy_locate_se_dev_e4_iter - compare XCOPY NAA device identifiers -+ * -+ * @se_dev: device being considered for match -+ * @dev_wwn: XCOPY requested NAA dev_wwn -+ * @return: 1 on match, 0 on no-match -+ */ - static int target_xcopy_locate_se_dev_e4_iter(struct se_device *se_dev, -- void *data) -+ const unsigned char *dev_wwn) - { -- struct xcopy_dev_search_info *info = data; - unsigned char tmp_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN]; - int rc; - -- if (!se_dev->dev_attrib.emulate_3pc) -+ if (!se_dev->dev_attrib.emulate_3pc) { -+ pr_debug("XCOPY: emulate_3pc disabled on se_dev %p\n", se_dev); - return 0; -+ } - - memset(&tmp_dev_wwn[0], 0, XCOPY_NAA_IEEE_REGEX_LEN); - target_xcopy_gen_naa_ieee(se_dev, &tmp_dev_wwn[0]); - -- rc = memcmp(&tmp_dev_wwn[0], info->dev_wwn, XCOPY_NAA_IEEE_REGEX_LEN); -- if (rc != 0) -- return 0; -- -- info->found_dev = se_dev; -- pr_debug("XCOPY 0xe4: located se_dev: %p\n", se_dev); -- -- rc = target_depend_item(&se_dev->dev_group.cg_item); -+ rc = memcmp(&tmp_dev_wwn[0], dev_wwn, XCOPY_NAA_IEEE_REGEX_LEN); - if (rc != 0) { -- pr_err("configfs_depend_item attempt failed: %d for se_dev: %p\n", -- rc, se_dev); -- return rc; -+ pr_debug("XCOPY: skip non-matching: %*ph\n", -+ XCOPY_NAA_IEEE_REGEX_LEN, tmp_dev_wwn); -+ return 0; - } -+ pr_debug("XCOPY 0xe4: located se_dev: %p\n", se_dev); - -- pr_debug("Called configfs_depend_item for se_dev: %p se_dev->se_dev_group: %p\n", -- se_dev, &se_dev->dev_group); - return 1; - } - --static int target_xcopy_locate_se_dev_e4(const unsigned char *dev_wwn, -- struct se_device **found_dev) -+static int target_xcopy_locate_se_dev_e4(struct se_session *sess, -+ const unsigned char *dev_wwn, -+ struct se_device **_found_dev, -+ struct percpu_ref **_found_lun_ref) - { -- struct xcopy_dev_search_info info; -- int ret; -- -- memset(&info, 0, sizeof(info)); -- info.dev_wwn = dev_wwn; -- -- ret = target_for_each_device(target_xcopy_locate_se_dev_e4_iter, &info); -- if (ret == 1) { -- *found_dev = info.found_dev; -- return 0; -- } else { -- pr_debug_ratelimited("Unable to locate 0xe4 descriptor for EXTENDED_COPY\n"); -- return -EINVAL; -+ struct se_dev_entry *deve; -+ struct se_node_acl *nacl; -+ struct se_lun *this_lun = NULL; -+ struct se_device *found_dev = NULL; -+ -+ /* cmd with NULL sess indicates no associated $FABRIC_MOD */ -+ if (!sess) -+ goto err_out; -+ -+ pr_debug("XCOPY 0xe4: searching for: %*ph\n", -+ XCOPY_NAA_IEEE_REGEX_LEN, dev_wwn); -+ -+ nacl = sess->se_node_acl; -+ rcu_read_lock(); -+ hlist_for_each_entry_rcu(deve, &nacl->lun_entry_hlist, link) { -+ struct se_device *this_dev; -+ int rc; -+ -+ this_lun = rcu_dereference(deve->se_lun); -+ this_dev = rcu_dereference_raw(this_lun->lun_se_dev); -+ -+ rc = target_xcopy_locate_se_dev_e4_iter(this_dev, dev_wwn); -+ if (rc) { -+ if (percpu_ref_tryget_live(&this_lun->lun_ref)) -+ found_dev = this_dev; -+ break; -+ } - } -+ rcu_read_unlock(); -+ if (found_dev == NULL) -+ goto err_out; -+ -+ pr_debug("lun_ref held for se_dev: %p se_dev->se_dev_group: %p\n", -+ found_dev, &found_dev->dev_group); -+ *_found_dev = found_dev; -+ *_found_lun_ref = &this_lun->lun_ref; -+ return 0; -+err_out: -+ pr_debug_ratelimited("Unable to locate 0xe4 descriptor for EXTENDED_COPY\n"); -+ return -EINVAL; - } - - static int target_xcopy_parse_tiddesc_e4(struct se_cmd *se_cmd, struct xcopy_op *xop, -@@ -246,12 +269,16 @@ static int target_xcopy_parse_target_descriptors(struct se_cmd *se_cmd, - - switch (xop->op_origin) { - case XCOL_SOURCE_RECV_OP: -- rc = target_xcopy_locate_se_dev_e4(xop->dst_tid_wwn, -- &xop->dst_dev); -+ rc = target_xcopy_locate_se_dev_e4(se_cmd->se_sess, -+ xop->dst_tid_wwn, -+ &xop->dst_dev, -+ &xop->remote_lun_ref); - break; - case XCOL_DEST_RECV_OP: -- rc = target_xcopy_locate_se_dev_e4(xop->src_tid_wwn, -- &xop->src_dev); -+ rc = target_xcopy_locate_se_dev_e4(se_cmd->se_sess, -+ xop->src_tid_wwn, -+ &xop->src_dev, -+ &xop->remote_lun_ref); - break; - default: - pr_err("XCOPY CSCD descriptor IDs not found in CSCD list - " -@@ -396,18 +423,12 @@ static int xcopy_pt_get_cmd_state(struct se_cmd *se_cmd) - - static void xcopy_pt_undepend_remotedev(struct xcopy_op *xop) - { -- struct se_device *remote_dev; -- - if (xop->op_origin == XCOL_SOURCE_RECV_OP) -- remote_dev = xop->dst_dev; -+ pr_debug("putting dst lun_ref for %p\n", xop->dst_dev); - else -- remote_dev = xop->src_dev; -- -- pr_debug("Calling configfs_undepend_item for" -- " remote_dev: %p remote_dev->dev_group: %p\n", -- remote_dev, &remote_dev->dev_group.cg_item); -+ pr_debug("putting src lun_ref for %p\n", xop->src_dev); - -- target_undepend_item(&remote_dev->dev_group.cg_item); -+ percpu_ref_put(xop->remote_lun_ref); - } - - static void xcopy_pt_release_cmd(struct se_cmd *se_cmd) -diff --git a/drivers/target/target_core_xcopy.h b/drivers/target/target_core_xcopy.h -index 26ba4c3c9cffd..974bc1e19ff2b 100644 ---- a/drivers/target/target_core_xcopy.h -+++ b/drivers/target/target_core_xcopy.h -@@ -29,6 +29,7 @@ struct xcopy_op { - struct se_device *dst_dev; - unsigned char dst_tid_wwn[XCOPY_NAA_IEEE_REGEX_LEN]; - unsigned char local_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN]; -+ struct percpu_ref *remote_lun_ref; - - sector_t src_lba; - sector_t dst_lba; -diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c -index c08bcce04276e..85561b3194a16 100644 ---- a/drivers/usb/chipidea/ci_hdrc_imx.c -+++ b/drivers/usb/chipidea/ci_hdrc_imx.c -@@ -139,9 +139,13 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev) - misc_pdev = of_find_device_by_node(args.np); - of_node_put(args.np); - -- if (!misc_pdev || !platform_get_drvdata(misc_pdev)) -+ if (!misc_pdev) - return ERR_PTR(-EPROBE_DEFER); - -+ if (!platform_get_drvdata(misc_pdev)) { -+ put_device(&misc_pdev->dev); -+ return ERR_PTR(-EPROBE_DEFER); -+ } - data->dev = &misc_pdev->dev; - - /* -diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c -index 16c98e718001b..681374a3b3684 100644 ---- a/drivers/usb/class/cdc-acm.c -+++ b/drivers/usb/class/cdc-acm.c -@@ -1907,6 +1907,10 @@ static const struct usb_device_id acm_ids[] = { - { USB_DEVICE(0x04d8, 0x0083), /* Bootloader mode */ - .driver_info = IGNORE_DEVICE, - }, -+ -+ { USB_DEVICE(0x04d8, 0xf58b), -+ .driver_info = IGNORE_DEVICE, -+ }, - #endif - - /*Samsung phone in firmware update mode */ -diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c -index 9875e2fe33db2..fc1a219ad0a76 100644 ---- a/drivers/usb/class/cdc-wdm.c -+++ b/drivers/usb/class/cdc-wdm.c -@@ -465,13 +465,23 @@ static int service_outstanding_interrupt(struct wdm_device *desc) - if (!desc->resp_count || !--desc->resp_count) - goto out; - -+ if (test_bit(WDM_DISCONNECTING, &desc->flags)) { -+ rv = -ENODEV; -+ goto out; -+ } -+ if (test_bit(WDM_RESETTING, &desc->flags)) { -+ rv = -EIO; -+ goto out; -+ } -+ - set_bit(WDM_RESPONDING, &desc->flags); - spin_unlock_irq(&desc->iuspin); - rv = usb_submit_urb(desc->response, GFP_KERNEL); - spin_lock_irq(&desc->iuspin); - if (rv) { -- dev_err(&desc->intf->dev, -- "usb_submit_urb failed with result %d\n", rv); -+ if (!test_bit(WDM_DISCONNECTING, &desc->flags)) -+ dev_err(&desc->intf->dev, -+ "usb_submit_urb failed with result %d\n", rv); - - /* make sure the next notification trigger a submit */ - clear_bit(WDM_RESPONDING, &desc->flags); -@@ -1026,9 +1036,9 @@ static void wdm_disconnect(struct usb_interface *intf) - wake_up_all(&desc->wait); - mutex_lock(&desc->rlock); - mutex_lock(&desc->wlock); -- kill_urbs(desc); - cancel_work_sync(&desc->rxwork); - cancel_work_sync(&desc->service_outs_intr); -+ kill_urbs(desc); - mutex_unlock(&desc->wlock); - mutex_unlock(&desc->rlock); - -diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c -index 67cbd42421bee..134dc2005ce97 100644 ---- a/drivers/usb/class/usblp.c -+++ b/drivers/usb/class/usblp.c -@@ -274,8 +274,25 @@ static int usblp_ctrl_msg(struct usblp *usblp, int request, int type, int dir, i - #define usblp_reset(usblp)\ - usblp_ctrl_msg(usblp, USBLP_REQ_RESET, USB_TYPE_CLASS, USB_DIR_OUT, USB_RECIP_OTHER, 0, NULL, 0) - --#define usblp_hp_channel_change_request(usblp, channel, buffer) \ -- usblp_ctrl_msg(usblp, USBLP_REQ_HP_CHANNEL_CHANGE_REQUEST, USB_TYPE_VENDOR, USB_DIR_IN, USB_RECIP_INTERFACE, channel, buffer, 1) -+static int usblp_hp_channel_change_request(struct usblp *usblp, int channel, u8 *new_channel) -+{ -+ u8 *buf; -+ int ret; -+ -+ buf = kzalloc(1, GFP_KERNEL); -+ if (!buf) -+ return -ENOMEM; -+ -+ ret = usblp_ctrl_msg(usblp, USBLP_REQ_HP_CHANNEL_CHANGE_REQUEST, -+ USB_TYPE_VENDOR, USB_DIR_IN, USB_RECIP_INTERFACE, -+ channel, buf, 1); -+ if (ret == 0) -+ *new_channel = buf[0]; -+ -+ kfree(buf); -+ -+ return ret; -+} - - /* - * See the description for usblp_select_alts() below for the usage -diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h -index c848f9164f929..da296f888f45d 100644 ---- a/drivers/usb/dwc3/core.h -+++ b/drivers/usb/dwc3/core.h -@@ -283,6 +283,7 @@ - - /* Global USB2 PHY Vendor Control Register */ - #define DWC3_GUSB2PHYACC_NEWREGREQ BIT(25) -+#define DWC3_GUSB2PHYACC_DONE BIT(24) - #define DWC3_GUSB2PHYACC_BUSY BIT(23) - #define DWC3_GUSB2PHYACC_WRITE BIT(22) - #define DWC3_GUSB2PHYACC_ADDR(n) (n << 16) -diff --git a/drivers/usb/dwc3/ulpi.c b/drivers/usb/dwc3/ulpi.c -index f62b5f3c2d67d..bb8271531da70 100644 ---- a/drivers/usb/dwc3/ulpi.c -+++ b/drivers/usb/dwc3/ulpi.c -@@ -24,7 +24,7 @@ static int dwc3_ulpi_busyloop(struct dwc3 *dwc) - - while (count--) { - reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYACC(0)); -- if (!(reg & DWC3_GUSB2PHYACC_BUSY)) -+ if (reg & DWC3_GUSB2PHYACC_DONE) - return 0; - cpu_relax(); - } -diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig -index 02ff850278b17..09ba3af1234ee 100644 ---- a/drivers/usb/gadget/Kconfig -+++ b/drivers/usb/gadget/Kconfig -@@ -265,6 +265,7 @@ config USB_CONFIGFS_NCM - depends on NET - select USB_U_ETHER - select USB_F_NCM -+ select CRC32 - help - NCM is an advanced protocol for Ethernet encapsulation, allows - grouping of several ethernet frames into one USB transfer and -@@ -314,6 +315,7 @@ config USB_CONFIGFS_EEM - depends on NET - select USB_U_ETHER - select USB_F_EEM -+ select CRC32 - help - CDC EEM is a newer USB standard that is somewhat simpler than CDC ECM - and therefore can be supported by more hardware. Technically ECM and -diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c -index f75ff1a75dc45..ed46fd74a292a 100644 ---- a/drivers/usb/gadget/composite.c -+++ b/drivers/usb/gadget/composite.c -@@ -392,8 +392,11 @@ int usb_function_deactivate(struct usb_function *function) - - spin_lock_irqsave(&cdev->lock, flags); - -- if (cdev->deactivations == 0) -+ if (cdev->deactivations == 0) { -+ spin_unlock_irqrestore(&cdev->lock, flags); - status = usb_gadget_deactivate(cdev->gadget); -+ spin_lock_irqsave(&cdev->lock, flags); -+ } - if (status == 0) - cdev->deactivations++; - -@@ -424,8 +427,11 @@ int usb_function_activate(struct usb_function *function) - status = -EINVAL; - else { - cdev->deactivations--; -- if (cdev->deactivations == 0) -+ if (cdev->deactivations == 0) { -+ spin_unlock_irqrestore(&cdev->lock, flags); - status = usb_gadget_activate(cdev->gadget); -+ spin_lock_irqsave(&cdev->lock, flags); -+ } - } - - spin_unlock_irqrestore(&cdev->lock, flags); -diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c -index a7709d126b29b..5b8b2ca4376cb 100644 ---- a/drivers/usb/gadget/configfs.c -+++ b/drivers/usb/gadget/configfs.c -@@ -233,9 +233,16 @@ static ssize_t gadget_dev_desc_bcdUSB_store(struct config_item *item, - - static ssize_t gadget_dev_desc_UDC_show(struct config_item *item, char *page) - { -- char *udc_name = to_gadget_info(item)->composite.gadget_driver.udc_name; -+ struct gadget_info *gi = to_gadget_info(item); -+ char *udc_name; -+ int ret; -+ -+ mutex_lock(&gi->lock); -+ udc_name = gi->composite.gadget_driver.udc_name; -+ ret = sprintf(page, "%s\n", udc_name ?: ""); -+ mutex_unlock(&gi->lock); - -- return sprintf(page, "%s\n", udc_name ?: ""); -+ return ret; - } - - static int unregister_gadget(struct gadget_info *gi) -@@ -1217,9 +1224,9 @@ static void purge_configs_funcs(struct gadget_info *gi) - - cfg = container_of(c, struct config_usb_cfg, c); - -- list_for_each_entry_safe(f, tmp, &c->functions, list) { -+ list_for_each_entry_safe_reverse(f, tmp, &c->functions, list) { - -- list_move_tail(&f->list, &cfg->func_list); -+ list_move(&f->list, &cfg->func_list); - if (f->unbind) { - dev_dbg(&gi->cdev.gadget->dev, - "unbind function '%s'/%p\n", -@@ -1505,7 +1512,7 @@ static const struct usb_gadget_driver configfs_driver_template = { - .suspend = configfs_composite_suspend, - .resume = configfs_composite_resume, - -- .max_speed = USB_SPEED_SUPER, -+ .max_speed = USB_SPEED_SUPER_PLUS, - .driver = { - .owner = THIS_MODULE, - .name = "configfs-gadget", -@@ -1545,7 +1552,7 @@ static struct config_group *gadgets_make( - gi->composite.unbind = configfs_do_nothing; - gi->composite.suspend = NULL; - gi->composite.resume = NULL; -- gi->composite.max_speed = USB_SPEED_SUPER; -+ gi->composite.max_speed = USB_SPEED_SUPER_PLUS; - - spin_lock_init(&gi->spinlock); - mutex_init(&gi->lock); -diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c -index 8ed1295d7e350..0f47cd398d60a 100644 ---- a/drivers/usb/gadget/function/f_printer.c -+++ b/drivers/usb/gadget/function/f_printer.c -@@ -1126,6 +1126,7 @@ fail_tx_reqs: - printer_req_free(dev->in_ep, req); - } - -+ usb_free_all_descriptors(f); - return ret; - - } -diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c -index 3633df6d7610f..5d960b6603b6f 100644 ---- a/drivers/usb/gadget/function/f_uac2.c -+++ b/drivers/usb/gadget/function/f_uac2.c -@@ -271,7 +271,7 @@ static struct usb_endpoint_descriptor fs_epout_desc = { - - .bEndpointAddress = USB_DIR_OUT, - .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC, -- .wMaxPacketSize = cpu_to_le16(1023), -+ /* .wMaxPacketSize = DYNAMIC */ - .bInterval = 1, - }; - -@@ -280,7 +280,7 @@ static struct usb_endpoint_descriptor hs_epout_desc = { - .bDescriptorType = USB_DT_ENDPOINT, - - .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC, -- .wMaxPacketSize = cpu_to_le16(1024), -+ /* .wMaxPacketSize = DYNAMIC */ - .bInterval = 4, - }; - -@@ -348,7 +348,7 @@ static struct usb_endpoint_descriptor fs_epin_desc = { - - .bEndpointAddress = USB_DIR_IN, - .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC, -- .wMaxPacketSize = cpu_to_le16(1023), -+ /* .wMaxPacketSize = DYNAMIC */ - .bInterval = 1, - }; - -@@ -357,7 +357,7 @@ static struct usb_endpoint_descriptor hs_epin_desc = { - .bDescriptorType = USB_DT_ENDPOINT, - - .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC, -- .wMaxPacketSize = cpu_to_le16(1024), -+ /* .wMaxPacketSize = DYNAMIC */ - .bInterval = 4, - }; - -@@ -444,12 +444,28 @@ struct cntrl_range_lay3 { - __le32 dRES; - } __packed; - --static void set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts, -+static int set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts, - struct usb_endpoint_descriptor *ep_desc, -- unsigned int factor, bool is_playback) -+ enum usb_device_speed speed, bool is_playback) - { - int chmask, srate, ssize; -- u16 max_packet_size; -+ u16 max_size_bw, max_size_ep; -+ unsigned int factor; -+ -+ switch (speed) { -+ case USB_SPEED_FULL: -+ max_size_ep = 1023; -+ factor = 1000; -+ break; -+ -+ case USB_SPEED_HIGH: -+ max_size_ep = 1024; -+ factor = 8000; -+ break; -+ -+ default: -+ return -EINVAL; -+ } - - if (is_playback) { - chmask = uac2_opts->p_chmask; -@@ -461,10 +477,12 @@ static void set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts, - ssize = uac2_opts->c_ssize; - } - -- max_packet_size = num_channels(chmask) * ssize * -+ max_size_bw = num_channels(chmask) * ssize * - DIV_ROUND_UP(srate, factor / (1 << (ep_desc->bInterval - 1))); -- ep_desc->wMaxPacketSize = cpu_to_le16(min_t(u16, max_packet_size, -- le16_to_cpu(ep_desc->wMaxPacketSize))); -+ ep_desc->wMaxPacketSize = cpu_to_le16(min_t(u16, max_size_bw, -+ max_size_ep)); -+ -+ return 0; - } - - /* Use macro to overcome line length limitation */ -@@ -670,10 +688,33 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) - } - - /* Calculate wMaxPacketSize according to audio bandwidth */ -- set_ep_max_packet_size(uac2_opts, &fs_epin_desc, 1000, true); -- set_ep_max_packet_size(uac2_opts, &fs_epout_desc, 1000, false); -- set_ep_max_packet_size(uac2_opts, &hs_epin_desc, 8000, true); -- set_ep_max_packet_size(uac2_opts, &hs_epout_desc, 8000, false); -+ ret = set_ep_max_packet_size(uac2_opts, &fs_epin_desc, USB_SPEED_FULL, -+ true); -+ if (ret < 0) { -+ dev_err(dev, "%s:%d Error!\n", __func__, __LINE__); -+ return ret; -+ } -+ -+ ret = set_ep_max_packet_size(uac2_opts, &fs_epout_desc, USB_SPEED_FULL, -+ false); -+ if (ret < 0) { -+ dev_err(dev, "%s:%d Error!\n", __func__, __LINE__); -+ return ret; -+ } -+ -+ ret = set_ep_max_packet_size(uac2_opts, &hs_epin_desc, USB_SPEED_HIGH, -+ true); -+ if (ret < 0) { -+ dev_err(dev, "%s:%d Error!\n", __func__, __LINE__); -+ return ret; -+ } -+ -+ ret = set_ep_max_packet_size(uac2_opts, &hs_epout_desc, USB_SPEED_HIGH, -+ false); -+ if (ret < 0) { -+ dev_err(dev, "%s:%d Error!\n", __func__, __LINE__); -+ return ret; -+ } - - if (EPOUT_EN(uac2_opts)) { - agdev->out_ep = usb_ep_autoconfig(gadget, &fs_epout_desc); -diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c -index 891e9f7f40d59..99b840daf3d94 100644 ---- a/drivers/usb/gadget/function/u_ether.c -+++ b/drivers/usb/gadget/function/u_ether.c -@@ -45,9 +45,10 @@ - #define UETH__VERSION "29-May-2008" - - /* Experiments show that both Linux and Windows hosts allow up to 16k -- * frame sizes. Set the max size to 15k+52 to prevent allocating 32k -+ * frame sizes. Set the max MTU size to 15k+52 to prevent allocating 32k - * blocks and still have efficient handling. */ --#define GETHER_MAX_ETH_FRAME_LEN 15412 -+#define GETHER_MAX_MTU_SIZE 15412 -+#define GETHER_MAX_ETH_FRAME_LEN (GETHER_MAX_MTU_SIZE + ETH_HLEN) - - struct eth_dev { - /* lock is held while accessing port_usb -@@ -786,7 +787,7 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g, - - /* MTU range: 14 - 15412 */ - net->min_mtu = ETH_HLEN; -- net->max_mtu = GETHER_MAX_ETH_FRAME_LEN; -+ net->max_mtu = GETHER_MAX_MTU_SIZE; - - dev->gadget = g; - SET_NETDEV_DEV(net, &g->dev); -@@ -848,7 +849,7 @@ struct net_device *gether_setup_name_default(const char *netname) - - /* MTU range: 14 - 15412 */ - net->min_mtu = ETH_HLEN; -- net->max_mtu = GETHER_MAX_ETH_FRAME_LEN; -+ net->max_mtu = GETHER_MAX_MTU_SIZE; - - return net; - } -diff --git a/drivers/usb/gadget/legacy/acm_ms.c b/drivers/usb/gadget/legacy/acm_ms.c -index af16672d51187..6680dcfe660ea 100644 ---- a/drivers/usb/gadget/legacy/acm_ms.c -+++ b/drivers/usb/gadget/legacy/acm_ms.c -@@ -203,8 +203,10 @@ static int acm_ms_bind(struct usb_composite_dev *cdev) - struct usb_descriptor_header *usb_desc; - - usb_desc = usb_otg_descriptor_alloc(gadget); -- if (!usb_desc) -+ if (!usb_desc) { -+ status = -ENOMEM; - goto fail_string_ids; -+ } - usb_otg_descriptor_init(gadget, usb_desc); - otg_desc[0] = usb_desc; - otg_desc[1] = NULL; -diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index 7123ab44671b2..70aa3055c41e7 100644 ---- a/drivers/usb/host/xhci.c -+++ b/drivers/usb/host/xhci.c -@@ -4642,19 +4642,19 @@ static u16 xhci_calculate_u1_timeout(struct xhci_hcd *xhci, - { - unsigned long long timeout_ns; - -+ if (xhci->quirks & XHCI_INTEL_HOST) -+ timeout_ns = xhci_calculate_intel_u1_timeout(udev, desc); -+ else -+ timeout_ns = udev->u1_params.sel; -+ - /* Prevent U1 if service interval is shorter than U1 exit latency */ - if (usb_endpoint_xfer_int(desc) || usb_endpoint_xfer_isoc(desc)) { -- if (xhci_service_interval_to_ns(desc) <= udev->u1_params.mel) { -+ if (xhci_service_interval_to_ns(desc) <= timeout_ns) { - dev_dbg(&udev->dev, "Disable U1, ESIT shorter than exit latency\n"); - return USB3_LPM_DISABLED; - } - } - -- if (xhci->quirks & XHCI_INTEL_HOST) -- timeout_ns = xhci_calculate_intel_u1_timeout(udev, desc); -- else -- timeout_ns = udev->u1_params.sel; -- - /* The U1 timeout is encoded in 1us intervals. - * Don't return a timeout of zero, because that's USB3_LPM_DISABLED. - */ -@@ -4706,19 +4706,19 @@ static u16 xhci_calculate_u2_timeout(struct xhci_hcd *xhci, - { - unsigned long long timeout_ns; - -+ if (xhci->quirks & XHCI_INTEL_HOST) -+ timeout_ns = xhci_calculate_intel_u2_timeout(udev, desc); -+ else -+ timeout_ns = udev->u2_params.sel; -+ - /* Prevent U2 if service interval is shorter than U2 exit latency */ - if (usb_endpoint_xfer_int(desc) || usb_endpoint_xfer_isoc(desc)) { -- if (xhci_service_interval_to_ns(desc) <= udev->u2_params.mel) { -+ if (xhci_service_interval_to_ns(desc) <= timeout_ns) { - dev_dbg(&udev->dev, "Disable U2, ESIT shorter than exit latency\n"); - return USB3_LPM_DISABLED; - } - } - -- if (xhci->quirks & XHCI_INTEL_HOST) -- timeout_ns = xhci_calculate_intel_u2_timeout(udev, desc); -- else -- timeout_ns = udev->u2_params.sel; -- - /* The U2 timeout is encoded in 256us intervals */ - timeout_ns = DIV_ROUND_UP_ULL(timeout_ns, 256 * 1000); - /* If the necessary timeout value is bigger than what we can set in the -diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c -index 785080f790738..08b72bb22b7ef 100644 ---- a/drivers/usb/misc/yurex.c -+++ b/drivers/usb/misc/yurex.c -@@ -497,6 +497,9 @@ static ssize_t yurex_write(struct file *file, const char __user *user_buffer, - timeout = schedule_timeout(YUREX_WRITE_TIMEOUT); - finish_wait(&dev->waitq, &wait); - -+ /* make sure URB is idle after timeout or (spurious) CMD_ACK */ -+ usb_kill_urb(dev->cntl_urb); -+ - mutex_unlock(&dev->io_mutex); - - if (retval < 0) { -diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c -index ffbb2a8901b2b..7e4ec0b8d01f8 100644 ---- a/drivers/usb/serial/iuu_phoenix.c -+++ b/drivers/usb/serial/iuu_phoenix.c -@@ -536,23 +536,29 @@ static int iuu_uart_flush(struct usb_serial_port *port) - struct device *dev = &port->dev; - int i; - int status; -- u8 rxcmd = IUU_UART_RX; -+ u8 *rxcmd; - struct iuu_private *priv = usb_get_serial_port_data(port); - - if (iuu_led(port, 0xF000, 0, 0, 0xFF) < 0) - return -EIO; - -+ rxcmd = kmalloc(1, GFP_KERNEL); -+ if (!rxcmd) -+ return -ENOMEM; -+ -+ rxcmd[0] = IUU_UART_RX; -+ - for (i = 0; i < 2; i++) { -- status = bulk_immediate(port, &rxcmd, 1); -+ status = bulk_immediate(port, rxcmd, 1); - if (status != IUU_OPERATION_OK) { - dev_dbg(dev, "%s - uart_flush_write error\n", __func__); -- return status; -+ goto out_free; - } - - status = read_immediate(port, &priv->len, 1); - if (status != IUU_OPERATION_OK) { - dev_dbg(dev, "%s - uart_flush_read error\n", __func__); -- return status; -+ goto out_free; - } - - if (priv->len > 0) { -@@ -560,12 +566,16 @@ static int iuu_uart_flush(struct usb_serial_port *port) - status = read_immediate(port, priv->buf, priv->len); - if (status != IUU_OPERATION_OK) { - dev_dbg(dev, "%s - uart_flush_read error\n", __func__); -- return status; -+ goto out_free; - } - } - } - dev_dbg(dev, "%s - uart_flush_read OK!\n", __func__); - iuu_led(port, 0, 0xF000, 0, 0xFF); -+ -+out_free: -+ kfree(rxcmd); -+ - return status; - } - -diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c -index fab6aa8a676aa..5dd228da5bdd5 100644 ---- a/drivers/usb/serial/keyspan_pda.c -+++ b/drivers/usb/serial/keyspan_pda.c -@@ -555,10 +555,8 @@ exit: - static void keyspan_pda_write_bulk_callback(struct urb *urb) - { - struct usb_serial_port *port = urb->context; -- struct keyspan_pda_private *priv; - - set_bit(0, &port->write_urbs_free); -- priv = usb_get_serial_port_data(port); - - /* queue up a wakeup at scheduler time */ - usb_serial_port_softint(port); -diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c -index 531744049e7f0..fd41b07b5aaf1 100644 ---- a/drivers/usb/serial/option.c -+++ b/drivers/usb/serial/option.c -@@ -1117,6 +1117,8 @@ static const struct usb_device_id option_ids[] = { - { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff), - .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, - { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) }, -+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0620, 0xff, 0xff, 0x30) }, /* EM160R-GL */ -+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0620, 0xff, 0, 0) }, - { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x30) }, - { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) }, - { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10), -@@ -2057,6 +2059,7 @@ static const struct usb_device_id option_ids[] = { - { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */ - .driver_info = RSVD(6) }, - { 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 */ - { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */ - { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */ -diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h -index 749c69be091cc..cb7b15ecb7aba 100644 ---- a/drivers/usb/storage/unusual_uas.h -+++ b/drivers/usb/storage/unusual_uas.h -@@ -90,6 +90,13 @@ UNUSUAL_DEV(0x152d, 0x0578, 0x0000, 0x9999, - USB_SC_DEVICE, USB_PR_DEVICE, NULL, - US_FL_BROKEN_FUA), - -+/* Reported-by: Thinh Nguyen */ -+UNUSUAL_DEV(0x154b, 0xf00b, 0x0000, 0x9999, -+ "PNY", -+ "Pro Elite SSD", -+ USB_SC_DEVICE, USB_PR_DEVICE, NULL, -+ US_FL_NO_ATA_1X), -+ - /* Reported-by: Thinh Nguyen */ - UNUSUAL_DEV(0x154b, 0xf00d, 0x0000, 0x9999, - "PNY", -diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c -index 65850e9c71905..fee511437abe3 100644 ---- a/drivers/usb/usbip/vhci_hcd.c -+++ b/drivers/usb/usbip/vhci_hcd.c -@@ -396,6 +396,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, - default: - usbip_dbg_vhci_rh(" ClearPortFeature: default %x\n", - wValue); -+ if (wValue >= 32) -+ goto error; - vhci_hcd->port_status[rhport] &= ~(1 << wValue); - break; - } -diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c -index b53b6528d6ce2..48e574ae60330 100644 ---- a/drivers/vhost/net.c -+++ b/drivers/vhost/net.c -@@ -860,6 +860,7 @@ static void handle_tx_zerocopy(struct vhost_net *net, struct socket *sock) - size_t len, total_len = 0; - int err; - struct vhost_net_ubuf_ref *uninitialized_var(ubufs); -+ struct ubuf_info *ubuf; - bool zcopy_used; - int sent_pkts = 0; - -@@ -892,9 +893,7 @@ static void handle_tx_zerocopy(struct vhost_net *net, struct socket *sock) - - /* use msg_control to pass vhost zerocopy ubuf info to skb */ - if (zcopy_used) { -- struct ubuf_info *ubuf; - ubuf = nvq->ubuf_info + nvq->upend_idx; -- - vq->heads[nvq->upend_idx].id = cpu_to_vhost32(vq, head); - vq->heads[nvq->upend_idx].len = VHOST_DMA_IN_PROGRESS; - ubuf->callback = vhost_zerocopy_callback; -@@ -924,7 +923,8 @@ static void handle_tx_zerocopy(struct vhost_net *net, struct socket *sock) - err = sock->ops->sendmsg(sock, &msg, len); - if (unlikely(err < 0)) { - if (zcopy_used) { -- vhost_net_ubuf_put(ubufs); -+ if (vq->heads[ubuf->desc].len == VHOST_DMA_IN_PROGRESS) -+ vhost_net_ubuf_put(ubufs); - nvq->upend_idx = ((unsigned)nvq->upend_idx - 1) - % UIO_MAXIOV; - } -diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c -index 81671272aa58f..1c6ae98710a01 100644 ---- a/drivers/video/fbdev/hyperv_fb.c -+++ b/drivers/video/fbdev/hyperv_fb.c -@@ -704,11 +704,9 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info) - } - - /* -- * Map the VRAM cacheable for performance. This is also required for -- * VM Connect to display properly for ARM64 Linux VM, as the host also -- * maps the VRAM cacheable. -+ * Map the VRAM cacheable for performance. - */ -- fb_virt = ioremap_cache(par->mem->start, screen_fb_size); -+ fb_virt = ioremap_wc(par->mem->start, screen_fb_size); - if (!fb_virt) - goto err2; - -diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c -index 88940f494428a..903136ceac34a 100644 ---- a/fs/btrfs/send.c -+++ b/fs/btrfs/send.c -@@ -238,6 +238,7 @@ struct waiting_dir_move { - * after this directory is moved, we can try to rmdir the ino rmdir_ino. - */ - u64 rmdir_ino; -+ u64 rmdir_gen; - bool orphanized; - }; - -@@ -323,7 +324,7 @@ static int is_waiting_for_move(struct send_ctx *sctx, u64 ino); - static struct waiting_dir_move * - get_waiting_dir_move(struct send_ctx *sctx, u64 ino); - --static int is_waiting_for_rm(struct send_ctx *sctx, u64 dir_ino); -+static int is_waiting_for_rm(struct send_ctx *sctx, u64 dir_ino, u64 gen); - - static int need_send_hole(struct send_ctx *sctx) - { -@@ -2306,7 +2307,7 @@ static int get_cur_path(struct send_ctx *sctx, u64 ino, u64 gen, - - fs_path_reset(name); - -- if (is_waiting_for_rm(sctx, ino)) { -+ if (is_waiting_for_rm(sctx, ino, gen)) { - ret = gen_unique_name(sctx, ino, gen, name); - if (ret < 0) - goto out; -@@ -2865,8 +2866,8 @@ out: - return ret; - } - --static struct orphan_dir_info * --add_orphan_dir_info(struct send_ctx *sctx, u64 dir_ino) -+static struct orphan_dir_info *add_orphan_dir_info(struct send_ctx *sctx, -+ u64 dir_ino, u64 dir_gen) - { - struct rb_node **p = &sctx->orphan_dirs.rb_node; - struct rb_node *parent = NULL; -@@ -2875,20 +2876,23 @@ add_orphan_dir_info(struct send_ctx *sctx, u64 dir_ino) - while (*p) { - parent = *p; - entry = rb_entry(parent, struct orphan_dir_info, node); -- if (dir_ino < entry->ino) { -+ if (dir_ino < entry->ino) - p = &(*p)->rb_left; -- } else if (dir_ino > entry->ino) { -+ else if (dir_ino > entry->ino) - p = &(*p)->rb_right; -- } else { -+ else if (dir_gen < entry->gen) -+ p = &(*p)->rb_left; -+ else if (dir_gen > entry->gen) -+ p = &(*p)->rb_right; -+ else - return entry; -- } - } - - odi = kmalloc(sizeof(*odi), GFP_KERNEL); - if (!odi) - return ERR_PTR(-ENOMEM); - odi->ino = dir_ino; -- odi->gen = 0; -+ odi->gen = dir_gen; - odi->last_dir_index_offset = 0; - - rb_link_node(&odi->node, parent, p); -@@ -2896,8 +2900,8 @@ add_orphan_dir_info(struct send_ctx *sctx, u64 dir_ino) - return odi; - } - --static struct orphan_dir_info * --get_orphan_dir_info(struct send_ctx *sctx, u64 dir_ino) -+static struct orphan_dir_info *get_orphan_dir_info(struct send_ctx *sctx, -+ u64 dir_ino, u64 gen) - { - struct rb_node *n = sctx->orphan_dirs.rb_node; - struct orphan_dir_info *entry; -@@ -2908,15 +2912,19 @@ get_orphan_dir_info(struct send_ctx *sctx, u64 dir_ino) - n = n->rb_left; - else if (dir_ino > entry->ino) - n = n->rb_right; -+ else if (gen < entry->gen) -+ n = n->rb_left; -+ else if (gen > entry->gen) -+ n = n->rb_right; - else - return entry; - } - return NULL; - } - --static int is_waiting_for_rm(struct send_ctx *sctx, u64 dir_ino) -+static int is_waiting_for_rm(struct send_ctx *sctx, u64 dir_ino, u64 gen) - { -- struct orphan_dir_info *odi = get_orphan_dir_info(sctx, dir_ino); -+ struct orphan_dir_info *odi = get_orphan_dir_info(sctx, dir_ino, gen); - - return odi != NULL; - } -@@ -2961,7 +2969,7 @@ static int can_rmdir(struct send_ctx *sctx, u64 dir, u64 dir_gen, - key.type = BTRFS_DIR_INDEX_KEY; - key.offset = 0; - -- odi = get_orphan_dir_info(sctx, dir); -+ odi = get_orphan_dir_info(sctx, dir, dir_gen); - if (odi) - key.offset = odi->last_dir_index_offset; - -@@ -2992,7 +3000,7 @@ static int can_rmdir(struct send_ctx *sctx, u64 dir, u64 dir_gen, - - dm = get_waiting_dir_move(sctx, loc.objectid); - if (dm) { -- odi = add_orphan_dir_info(sctx, dir); -+ odi = add_orphan_dir_info(sctx, dir, dir_gen); - if (IS_ERR(odi)) { - ret = PTR_ERR(odi); - goto out; -@@ -3000,12 +3008,13 @@ static int can_rmdir(struct send_ctx *sctx, u64 dir, u64 dir_gen, - odi->gen = dir_gen; - odi->last_dir_index_offset = found_key.offset; - dm->rmdir_ino = dir; -+ dm->rmdir_gen = dir_gen; - ret = 0; - goto out; - } - - if (loc.objectid > send_progress) { -- odi = add_orphan_dir_info(sctx, dir); -+ odi = add_orphan_dir_info(sctx, dir, dir_gen); - if (IS_ERR(odi)) { - ret = PTR_ERR(odi); - goto out; -@@ -3045,6 +3054,7 @@ static int add_waiting_dir_move(struct send_ctx *sctx, u64 ino, bool orphanized) - return -ENOMEM; - dm->ino = ino; - dm->rmdir_ino = 0; -+ dm->rmdir_gen = 0; - dm->orphanized = orphanized; - - while (*p) { -@@ -3190,7 +3200,7 @@ static int path_loop(struct send_ctx *sctx, struct fs_path *name, - while (ino != BTRFS_FIRST_FREE_OBJECTID) { - fs_path_reset(name); - -- if (is_waiting_for_rm(sctx, ino)) -+ if (is_waiting_for_rm(sctx, ino, gen)) - break; - if (is_waiting_for_move(sctx, ino)) { - if (*ancestor_ino == 0) -@@ -3230,6 +3240,7 @@ static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm) - u64 parent_ino, parent_gen; - struct waiting_dir_move *dm = NULL; - u64 rmdir_ino = 0; -+ u64 rmdir_gen; - u64 ancestor; - bool is_orphan; - int ret; -@@ -3244,6 +3255,7 @@ static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm) - dm = get_waiting_dir_move(sctx, pm->ino); - ASSERT(dm); - rmdir_ino = dm->rmdir_ino; -+ rmdir_gen = dm->rmdir_gen; - is_orphan = dm->orphanized; - free_waiting_dir_move(sctx, dm); - -@@ -3280,6 +3292,7 @@ static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm) - dm = get_waiting_dir_move(sctx, pm->ino); - ASSERT(dm); - dm->rmdir_ino = rmdir_ino; -+ dm->rmdir_gen = rmdir_gen; - } - goto out; - } -@@ -3298,7 +3311,7 @@ static int apply_dir_move(struct send_ctx *sctx, struct pending_dir_move *pm) - struct orphan_dir_info *odi; - u64 gen; - -- odi = get_orphan_dir_info(sctx, rmdir_ino); -+ odi = get_orphan_dir_info(sctx, rmdir_ino, rmdir_gen); - if (!odi) { - /* already deleted */ - goto finish; -diff --git a/fs/proc/generic.c b/fs/proc/generic.c -index 64e9ee1b129e2..8c3dbe13e647c 100644 ---- a/fs/proc/generic.c -+++ b/fs/proc/generic.c -@@ -138,8 +138,12 @@ static int proc_getattr(const struct path *path, struct kstat *stat, - { - struct inode *inode = d_inode(path->dentry); - struct proc_dir_entry *de = PDE(inode); -- if (de && de->nlink) -- set_nlink(inode, de->nlink); -+ if (de) { -+ nlink_t nlink = READ_ONCE(de->nlink); -+ if (nlink > 0) { -+ set_nlink(inode, nlink); -+ } -+ } - - generic_fillattr(inode, stat); - return 0; -@@ -338,6 +342,16 @@ static const struct file_operations proc_dir_operations = { - .iterate_shared = proc_readdir, - }; - -+static int proc_net_d_revalidate(struct dentry *dentry, unsigned int flags) -+{ -+ return 0; -+} -+ -+const struct dentry_operations proc_net_dentry_ops = { -+ .d_revalidate = proc_net_d_revalidate, -+ .d_delete = always_delete_dentry, -+}; -+ - /* - * proc directories can do almost nothing.. - */ -@@ -362,6 +376,7 @@ struct proc_dir_entry *proc_register(struct proc_dir_entry *dir, - write_unlock(&proc_subdir_lock); - goto out_free_inum; - } -+ dir->nlink++; - write_unlock(&proc_subdir_lock); - - return dp; -@@ -459,8 +474,8 @@ struct proc_dir_entry *proc_symlink(const char *name, - } - EXPORT_SYMBOL(proc_symlink); - --struct proc_dir_entry *proc_mkdir_data(const char *name, umode_t mode, -- struct proc_dir_entry *parent, void *data) -+struct proc_dir_entry *_proc_mkdir(const char *name, umode_t mode, -+ struct proc_dir_entry *parent, void *data, bool force_lookup) - { - struct proc_dir_entry *ent; - -@@ -472,13 +487,20 @@ struct proc_dir_entry *proc_mkdir_data(const char *name, umode_t mode, - ent->data = data; - ent->proc_fops = &proc_dir_operations; - ent->proc_iops = &proc_dir_inode_operations; -- parent->nlink++; -+ if (force_lookup) { -+ pde_force_lookup(ent); -+ } - ent = proc_register(parent, ent); -- if (!ent) -- parent->nlink--; - } - return ent; - } -+EXPORT_SYMBOL_GPL(_proc_mkdir); -+ -+struct proc_dir_entry *proc_mkdir_data(const char *name, umode_t mode, -+ struct proc_dir_entry *parent, void *data) -+{ -+ return _proc_mkdir(name, mode, parent, data, false); -+} - EXPORT_SYMBOL_GPL(proc_mkdir_data); - - struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode, -@@ -505,10 +527,7 @@ struct proc_dir_entry *proc_create_mount_point(const char *name) - ent->data = NULL; - ent->proc_fops = NULL; - ent->proc_iops = NULL; -- parent->nlink++; - ent = proc_register(parent, ent); -- if (!ent) -- parent->nlink--; - } - return ent; - } -@@ -666,8 +685,12 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent) - len = strlen(fn); - - de = pde_subdir_find(parent, fn, len); -- if (de) -+ if (de) { - rb_erase(&de->subdir_node, &parent->subdir); -+ if (S_ISDIR(de->mode)) { -+ parent->nlink--; -+ } -+ } - write_unlock(&proc_subdir_lock); - if (!de) { - WARN(1, "name '%s'\n", name); -@@ -676,9 +699,6 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent) - - proc_entry_rundown(de); - -- if (S_ISDIR(de->mode)) -- parent->nlink--; -- de->nlink = 0; - WARN(pde_subdir_first(de), - "%s: removing non-empty directory '%s/%s', leaking at least '%s'\n", - __func__, de->parent->name, de->name, pde_subdir_first(de)->name); -@@ -714,13 +734,12 @@ int remove_proc_subtree(const char *name, struct proc_dir_entry *parent) - de = next; - continue; - } -- write_unlock(&proc_subdir_lock); -- -- proc_entry_rundown(de); - next = de->parent; - if (S_ISDIR(de->mode)) - next->nlink--; -- de->nlink = 0; -+ write_unlock(&proc_subdir_lock); -+ -+ proc_entry_rundown(de); - if (de == root) - break; - pde_put(de); -diff --git a/fs/proc/internal.h b/fs/proc/internal.h -index cd0c8d5ce9a13..269acc165055d 100644 ---- a/fs/proc/internal.h -+++ b/fs/proc/internal.h -@@ -299,3 +299,10 @@ extern unsigned long task_statm(struct mm_struct *, - unsigned long *, unsigned long *, - unsigned long *, unsigned long *); - extern void task_mem(struct seq_file *, struct mm_struct *); -+ -+extern const struct dentry_operations proc_net_dentry_ops; -+static inline void pde_force_lookup(struct proc_dir_entry *pde) -+{ -+ /* /proc/net/ entries can be changed under us by setns(CLONE_NEWNET) */ -+ pde->proc_dops = &proc_net_dentry_ops; -+} -diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c -index 76ae278df1c47..313b7c751867f 100644 ---- a/fs/proc/proc_net.c -+++ b/fs/proc/proc_net.c -@@ -39,22 +39,6 @@ static struct net *get_proc_net(const struct inode *inode) - return maybe_get_net(PDE_NET(PDE(inode))); - } - --static int proc_net_d_revalidate(struct dentry *dentry, unsigned int flags) --{ -- return 0; --} -- --static const struct dentry_operations proc_net_dentry_ops = { -- .d_revalidate = proc_net_d_revalidate, -- .d_delete = always_delete_dentry, --}; -- --static void pde_force_lookup(struct proc_dir_entry *pde) --{ -- /* /proc/net/ entries can be changed under us by setns(CLONE_NEWNET) */ -- pde->proc_dops = &proc_net_dentry_ops; --} -- - static int seq_open_net(struct inode *inode, struct file *file) - { - unsigned int state_size = PDE(inode)->state_size; -diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h -index a705aa2d03f91..865d02c224ada 100644 ---- a/include/linux/proc_fs.h -+++ b/include/linux/proc_fs.h -@@ -21,6 +21,7 @@ extern void proc_flush_task(struct task_struct *); - - extern struct proc_dir_entry *proc_symlink(const char *, - struct proc_dir_entry *, const char *); -+struct proc_dir_entry *_proc_mkdir(const char *, umode_t, struct proc_dir_entry *, void *, bool); - extern struct proc_dir_entry *proc_mkdir(const char *, struct proc_dir_entry *); - extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t, - struct proc_dir_entry *, void *); -@@ -99,6 +100,11 @@ static inline struct proc_dir_entry *proc_symlink(const char *name, - static inline struct proc_dir_entry *proc_mkdir(const char *name, - struct proc_dir_entry *parent) {return NULL;} - static inline struct proc_dir_entry *proc_create_mount_point(const char *name) { return NULL; } -+static inline struct proc_dir_entry *_proc_mkdir(const char *name, umode_t mode, -+ struct proc_dir_entry *parent, void *data, bool force_lookup) -+{ -+ return NULL; -+} - static inline struct proc_dir_entry *proc_mkdir_data(const char *name, - umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; } - static inline struct proc_dir_entry *proc_mkdir_mode(const char *name, -@@ -136,7 +142,7 @@ struct net; - static inline struct proc_dir_entry *proc_net_mkdir( - struct net *net, const char *name, struct proc_dir_entry *parent) - { -- return proc_mkdir_data(name, 0, parent, net); -+ return _proc_mkdir(name, 0, parent, net, true); - } - - struct ns_common; -diff --git a/include/net/red.h b/include/net/red.h -index 9665582c4687e..e21e7fd4fe077 100644 ---- a/include/net/red.h -+++ b/include/net/red.h -@@ -168,12 +168,14 @@ static inline void red_set_vars(struct red_vars *v) - v->qcount = -1; - } - --static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog) -+static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog, u8 Scell_log) - { - if (fls(qth_min) + Wlog > 32) - return false; - if (fls(qth_max) + Wlog > 32) - return false; -+ if (Scell_log >= 32) -+ return false; - if (qth_max < qth_min) - return false; - return true; -diff --git a/kernel/workqueue.c b/kernel/workqueue.c -index 4aa268582a225..28e52657e0930 100644 ---- a/kernel/workqueue.c -+++ b/kernel/workqueue.c -@@ -3718,17 +3718,24 @@ static void pwq_adjust_max_active(struct pool_workqueue *pwq) - * is updated and visible. - */ - if (!freezable || !workqueue_freezing) { -+ bool kick = false; -+ - pwq->max_active = wq->saved_max_active; - - while (!list_empty(&pwq->delayed_works) && -- pwq->nr_active < pwq->max_active) -+ pwq->nr_active < pwq->max_active) { - pwq_activate_first_delayed(pwq); -+ kick = true; -+ } - - /* - * Need to kick a worker after thawed or an unbound wq's -- * max_active is bumped. It's a slow path. Do it always. -+ * max_active is bumped. In realtime scenarios, always kicking a -+ * worker will cause interference on the isolated cpu cores, so -+ * let's kick iff work items were activated. - */ -- wake_up_worker(pwq->pool); -+ if (kick) -+ wake_up_worker(pwq->pool); - } else { - pwq->max_active = 0; - } -diff --git a/lib/genalloc.c b/lib/genalloc.c -index 9fc31292cfa1d..80d10d02cf388 100644 ---- a/lib/genalloc.c -+++ b/lib/genalloc.c -@@ -81,14 +81,14 @@ static int clear_bits_ll(unsigned long *addr, unsigned long mask_to_clear) - * users set the same bit, one user will return remain bits, otherwise - * return 0. - */ --static int bitmap_set_ll(unsigned long *map, int start, int nr) -+static int bitmap_set_ll(unsigned long *map, unsigned long start, unsigned long nr) - { - unsigned long *p = map + BIT_WORD(start); -- const int size = start + nr; -+ const unsigned long size = start + nr; - int bits_to_set = BITS_PER_LONG - (start % BITS_PER_LONG); - unsigned long mask_to_set = BITMAP_FIRST_WORD_MASK(start); - -- while (nr - bits_to_set >= 0) { -+ while (nr >= bits_to_set) { - if (set_bits_ll(p, mask_to_set)) - return nr; - nr -= bits_to_set; -@@ -116,14 +116,15 @@ static int bitmap_set_ll(unsigned long *map, int start, int nr) - * users clear the same bit, one user will return remain bits, - * otherwise return 0. - */ --static int bitmap_clear_ll(unsigned long *map, int start, int nr) -+static unsigned long -+bitmap_clear_ll(unsigned long *map, unsigned long start, unsigned long nr) - { - unsigned long *p = map + BIT_WORD(start); -- const int size = start + nr; -+ const unsigned long size = start + nr; - int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG); - unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start); - -- while (nr - bits_to_clear >= 0) { -+ while (nr >= bits_to_clear) { - if (clear_bits_ll(p, mask_to_clear)) - return nr; - nr -= bits_to_clear; -@@ -183,8 +184,8 @@ int gen_pool_add_owner(struct gen_pool *pool, unsigned long virt, phys_addr_t ph - size_t size, int nid, void *owner) - { - struct gen_pool_chunk *chunk; -- int nbits = size >> pool->min_alloc_order; -- int nbytes = sizeof(struct gen_pool_chunk) + -+ unsigned long nbits = size >> pool->min_alloc_order; -+ unsigned long nbytes = sizeof(struct gen_pool_chunk) + - BITS_TO_LONGS(nbits) * sizeof(long); - - chunk = vzalloc_node(nbytes, nid); -@@ -242,7 +243,7 @@ void gen_pool_destroy(struct gen_pool *pool) - struct list_head *_chunk, *_next_chunk; - struct gen_pool_chunk *chunk; - int order = pool->min_alloc_order; -- int bit, end_bit; -+ unsigned long bit, end_bit; - - list_for_each_safe(_chunk, _next_chunk, &pool->chunks) { - chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk); -@@ -278,7 +279,7 @@ unsigned long gen_pool_alloc_algo_owner(struct gen_pool *pool, size_t size, - struct gen_pool_chunk *chunk; - unsigned long addr = 0; - int order = pool->min_alloc_order; -- int nbits, start_bit, end_bit, remain; -+ unsigned long nbits, start_bit, end_bit, remain; - - #ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG - BUG_ON(in_nmi()); -@@ -487,7 +488,7 @@ void gen_pool_free_owner(struct gen_pool *pool, unsigned long addr, size_t size, - { - struct gen_pool_chunk *chunk; - int order = pool->min_alloc_order; -- int start_bit, nbits, remain; -+ unsigned long start_bit, nbits, remain; - - #ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG - BUG_ON(in_nmi()); -@@ -754,7 +755,7 @@ unsigned long gen_pool_best_fit(unsigned long *map, unsigned long size, - index = bitmap_find_next_zero_area(map, size, start, nr, 0); - - while (index < size) { -- int next_bit = find_next_bit(map, size, index + nr); -+ unsigned long next_bit = find_next_bit(map, size, index + nr); - if ((next_bit - index) < len) { - len = next_bit - index; - start_bit = index; -diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c -index 2ebf9b252779d..98474d85fb51f 100644 ---- a/net/core/net-sysfs.c -+++ b/net/core/net-sysfs.c -@@ -1235,8 +1235,8 @@ static const struct attribute_group dql_group = { - static ssize_t xps_cpus_show(struct netdev_queue *queue, - char *buf) - { -+ int cpu, len, ret, num_tc = 1, tc = 0; - struct net_device *dev = queue->dev; -- int cpu, len, num_tc = 1, tc = 0; - struct xps_dev_maps *dev_maps; - cpumask_var_t mask; - unsigned long index; -@@ -1246,22 +1246,31 @@ static ssize_t xps_cpus_show(struct netdev_queue *queue, - - index = get_netdev_queue_index(queue); - -+ if (!rtnl_trylock()) -+ return restart_syscall(); -+ - if (dev->num_tc) { - /* Do not allow XPS on subordinate device directly */ - num_tc = dev->num_tc; -- if (num_tc < 0) -- return -EINVAL; -+ if (num_tc < 0) { -+ ret = -EINVAL; -+ goto err_rtnl_unlock; -+ } - - /* If queue belongs to subordinate dev use its map */ - dev = netdev_get_tx_queue(dev, index)->sb_dev ? : dev; - - tc = netdev_txq_to_tc(dev, index); -- if (tc < 0) -- return -EINVAL; -+ if (tc < 0) { -+ ret = -EINVAL; -+ goto err_rtnl_unlock; -+ } - } - -- if (!zalloc_cpumask_var(&mask, GFP_KERNEL)) -- return -ENOMEM; -+ if (!zalloc_cpumask_var(&mask, GFP_KERNEL)) { -+ ret = -ENOMEM; -+ goto err_rtnl_unlock; -+ } - - rcu_read_lock(); - dev_maps = rcu_dereference(dev->xps_cpus_map); -@@ -1284,9 +1293,15 @@ static ssize_t xps_cpus_show(struct netdev_queue *queue, - } - rcu_read_unlock(); - -+ rtnl_unlock(); -+ - len = snprintf(buf, PAGE_SIZE, "%*pb\n", cpumask_pr_args(mask)); - free_cpumask_var(mask); - return len < PAGE_SIZE ? len : -EINVAL; -+ -+err_rtnl_unlock: -+ rtnl_unlock(); -+ return ret; - } - - static ssize_t xps_cpus_store(struct netdev_queue *queue, -@@ -1314,7 +1329,13 @@ static ssize_t xps_cpus_store(struct netdev_queue *queue, - return err; - } - -+ if (!rtnl_trylock()) { -+ free_cpumask_var(mask); -+ return restart_syscall(); -+ } -+ - err = netif_set_xps_queue(dev, mask, index); -+ rtnl_unlock(); - - free_cpumask_var(mask); - -@@ -1326,22 +1347,29 @@ static struct netdev_queue_attribute xps_cpus_attribute __ro_after_init - - static ssize_t xps_rxqs_show(struct netdev_queue *queue, char *buf) - { -+ int j, len, ret, num_tc = 1, tc = 0; - struct net_device *dev = queue->dev; - struct xps_dev_maps *dev_maps; - unsigned long *mask, index; -- int j, len, num_tc = 1, tc = 0; - - index = get_netdev_queue_index(queue); - -+ if (!rtnl_trylock()) -+ return restart_syscall(); -+ - if (dev->num_tc) { - num_tc = dev->num_tc; - tc = netdev_txq_to_tc(dev, index); -- if (tc < 0) -- return -EINVAL; -+ if (tc < 0) { -+ ret = -EINVAL; -+ goto err_rtnl_unlock; -+ } - } - mask = bitmap_zalloc(dev->num_rx_queues, GFP_KERNEL); -- if (!mask) -- return -ENOMEM; -+ if (!mask) { -+ ret = -ENOMEM; -+ goto err_rtnl_unlock; -+ } - - rcu_read_lock(); - dev_maps = rcu_dereference(dev->xps_rxqs_map); -@@ -1367,10 +1395,16 @@ static ssize_t xps_rxqs_show(struct netdev_queue *queue, char *buf) - out_no_maps: - rcu_read_unlock(); - -+ rtnl_unlock(); -+ - len = bitmap_print_to_pagebuf(false, buf, mask, dev->num_rx_queues); - bitmap_free(mask); - - return len < PAGE_SIZE ? len : -EINVAL; -+ -+err_rtnl_unlock: -+ rtnl_unlock(); -+ return ret; - } - - static ssize_t xps_rxqs_store(struct netdev_queue *queue, const char *buf, -@@ -1396,10 +1430,17 @@ static ssize_t xps_rxqs_store(struct netdev_queue *queue, const char *buf, - return err; - } - -+ if (!rtnl_trylock()) { -+ bitmap_free(mask); -+ return restart_syscall(); -+ } -+ - cpus_read_lock(); - err = __netif_set_xps_queue(dev, mask, index, true); - cpus_read_unlock(); - -+ rtnl_unlock(); -+ - bitmap_free(mask); - return err ? : len; - } -diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c -index da994f7e3def9..2ce191019526e 100644 ---- a/net/ipv4/fib_frontend.c -+++ b/net/ipv4/fib_frontend.c -@@ -302,7 +302,7 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb) - .flowi4_iif = LOOPBACK_IFINDEX, - .flowi4_oif = l3mdev_master_ifindex_rcu(dev), - .daddr = ip_hdr(skb)->saddr, -- .flowi4_tos = RT_TOS(ip_hdr(skb)->tos), -+ .flowi4_tos = ip_hdr(skb)->tos & IPTOS_RT_MASK, - .flowi4_scope = scope, - .flowi4_mark = vmark ? skb->mark : 0, - }; -diff --git a/net/ipv4/gre_demux.c b/net/ipv4/gre_demux.c -index 66fdbfe5447cd..5d1e6fe9d8387 100644 ---- a/net/ipv4/gre_demux.c -+++ b/net/ipv4/gre_demux.c -@@ -128,7 +128,7 @@ int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi, - * to 0 and sets the configured key in the - * inner erspan header field - */ -- if (greh->protocol == htons(ETH_P_ERSPAN) || -+ if ((greh->protocol == htons(ETH_P_ERSPAN) && hdr_len != 4) || - greh->protocol == htons(ETH_P_ERSPAN2)) { - struct erspan_base_hdr *ershdr; - -diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c -index 8a6a4384e7916..12d242fedffdc 100644 ---- a/net/ipv4/netfilter/arp_tables.c -+++ b/net/ipv4/netfilter/arp_tables.c -@@ -1406,7 +1406,7 @@ static int compat_get_entries(struct net *net, - xt_compat_lock(NFPROTO_ARP); - t = xt_find_table_lock(net, NFPROTO_ARP, get.name); - if (!IS_ERR(t)) { -- const struct xt_table_info *private = t->private; -+ const struct xt_table_info *private = xt_table_get_private_protected(t); - struct xt_table_info info; - - ret = compat_table_info(private, &info); -diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c -index 4852769995440..cbbc8a7b82788 100644 ---- a/net/ipv4/netfilter/ip_tables.c -+++ b/net/ipv4/netfilter/ip_tables.c -@@ -1616,7 +1616,7 @@ compat_get_entries(struct net *net, struct compat_ipt_get_entries __user *uptr, - xt_compat_lock(AF_INET); - t = xt_find_table_lock(net, AF_INET, get.name); - if (!IS_ERR(t)) { -- const struct xt_table_info *private = t->private; -+ const struct xt_table_info *private = xt_table_get_private_protected(t); - struct xt_table_info info; - ret = compat_table_info(private, &info); - if (!ret && get.size == info.size) -diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c -index 12735ee7713a7..01cdde25eb16d 100644 ---- a/net/ipv6/netfilter/ip6_tables.c -+++ b/net/ipv6/netfilter/ip6_tables.c -@@ -1625,7 +1625,7 @@ compat_get_entries(struct net *net, struct compat_ip6t_get_entries __user *uptr, - xt_compat_lock(AF_INET6); - t = xt_find_table_lock(net, AF_INET6, get.name); - if (!IS_ERR(t)) { -- const struct xt_table_info *private = t->private; -+ const struct xt_table_info *private = xt_table_get_private_protected(t); - struct xt_table_info info; - ret = compat_table_info(private, &info); - if (!ret && get.size == info.size) -diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c -index d5611f04926de..7c893c3799202 100644 ---- a/net/ncsi/ncsi-rsp.c -+++ b/net/ncsi/ncsi-rsp.c -@@ -1114,7 +1114,7 @@ int ncsi_rcv_rsp(struct sk_buff *skb, struct net_device *dev, - int payload, i, ret; - - /* Find the NCSI device */ -- nd = ncsi_find_dev(dev); -+ nd = ncsi_find_dev(orig_dev); - ndp = nd ? TO_NCSI_DEV_PRIV(nd) : NULL; - if (!ndp) - return -ENODEV; -diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h -index a7a982a3e6761..1a58cfdb862d6 100644 ---- a/net/netfilter/ipset/ip_set_hash_gen.h -+++ b/net/netfilter/ipset/ip_set_hash_gen.h -@@ -143,20 +143,6 @@ htable_size(u8 hbits) - return hsize * sizeof(struct hbucket *) + sizeof(struct htable); - } - --/* Compute htable_bits from the user input parameter hashsize */ --static u8 --htable_bits(u32 hashsize) --{ -- /* Assume that hashsize == 2^htable_bits */ -- u8 bits = fls(hashsize - 1); -- -- if (jhash_size(bits) != hashsize) -- /* Round up to the first 2^n value */ -- bits = fls(hashsize); -- -- return bits; --} -- - #ifdef IP_SET_HASH_WITH_NETS - #if IPSET_NET_COUNT > 1 - #define __CIDR(cidr, i) (cidr[i]) -@@ -1520,7 +1506,11 @@ IPSET_TOKEN(HTYPE, _create)(struct net *net, struct ip_set *set, - if (!h) - return -ENOMEM; - -- hbits = htable_bits(hashsize); -+ /* Compute htable_bits from the user input parameter hashsize. -+ * Assume that hashsize == 2^htable_bits, -+ * otherwise round up to the first 2^n value. -+ */ -+ hbits = fls(hashsize - 1); - hsize = htable_size(hbits); - if (hsize == 0) { - kfree(h); -diff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c -index 217fd1bdc55e7..60236cc316d03 100644 ---- a/net/netfilter/nft_dynset.c -+++ b/net/netfilter/nft_dynset.c -@@ -146,7 +146,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx, - u32 flags = ntohl(nla_get_be32(tb[NFTA_DYNSET_FLAGS])); - - if (flags & ~NFT_DYNSET_F_INV) -- return -EINVAL; -+ return -EOPNOTSUPP; - if (flags & NFT_DYNSET_F_INV) - priv->invert = true; - } -@@ -179,7 +179,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx, - timeout = 0; - if (tb[NFTA_DYNSET_TIMEOUT] != NULL) { - if (!(set->flags & NFT_SET_TIMEOUT)) -- return -EINVAL; -+ return -EOPNOTSUPP; - - err = nf_msecs_to_jiffies64(tb[NFTA_DYNSET_TIMEOUT], &timeout); - if (err) -@@ -193,7 +193,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx, - - if (tb[NFTA_DYNSET_SREG_DATA] != NULL) { - if (!(set->flags & NFT_SET_MAP)) -- return -EINVAL; -+ return -EOPNOTSUPP; - if (set->dtype == NFT_DATA_VERDICT) - return -EOPNOTSUPP; - -diff --git a/net/netfilter/xt_RATEEST.c b/net/netfilter/xt_RATEEST.c -index 2236455b10a36..182c1285b4ada 100644 ---- a/net/netfilter/xt_RATEEST.c -+++ b/net/netfilter/xt_RATEEST.c -@@ -115,6 +115,9 @@ static int xt_rateest_tg_checkentry(const struct xt_tgchk_param *par) - } cfg; - int ret; - -+ if (strnlen(info->name, sizeof(est->name)) >= sizeof(est->name)) -+ return -ENAMETOOLONG; -+ - net_get_random_once(&jhash_rnd, sizeof(jhash_rnd)); - - mutex_lock(&xn->hash_lock); -diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c -index 4021f726b58fd..d856b395ee8eb 100644 ---- a/net/sched/sch_choke.c -+++ b/net/sched/sch_choke.c -@@ -368,7 +368,7 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt, - - ctl = nla_data(tb[TCA_CHOKE_PARMS]); - -- if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog)) -+ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log)) - return -EINVAL; - - if (ctl->limit > CHOKE_MAX_QUEUE) -diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c -index 8599c6f31b057..e0bc77533acc3 100644 ---- a/net/sched/sch_gred.c -+++ b/net/sched/sch_gred.c -@@ -480,7 +480,7 @@ static inline int gred_change_vq(struct Qdisc *sch, int dp, - struct gred_sched *table = qdisc_priv(sch); - struct gred_sched_data *q = table->tab[dp]; - -- if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog)) { -+ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log)) { - NL_SET_ERR_MSG_MOD(extack, "invalid RED parameters"); - return -EINVAL; - } -diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c -index 1695421333e38..71e167e91a48d 100644 ---- a/net/sched/sch_red.c -+++ b/net/sched/sch_red.c -@@ -213,7 +213,7 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt, - max_P = tb[TCA_RED_MAX_P] ? nla_get_u32(tb[TCA_RED_MAX_P]) : 0; - - ctl = nla_data(tb[TCA_RED_PARMS]); -- if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog)) -+ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log)) - return -EINVAL; - - if (ctl->limit > 0) { -diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c -index 5a6def5e4e6df..6e13e137883c3 100644 ---- a/net/sched/sch_sfq.c -+++ b/net/sched/sch_sfq.c -@@ -647,7 +647,7 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt) - } - - if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max, -- ctl_v1->Wlog)) -+ ctl_v1->Wlog, ctl_v1->Scell_log)) - return -EINVAL; - if (ctl_v1 && ctl_v1->qth_min) { - p = kmalloc(sizeof(*p), GFP_KERNEL); -diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c -index f2b1305e79d2f..09116be995113 100644 ---- a/net/sched/sch_taprio.c -+++ b/net/sched/sch_taprio.c -@@ -1626,7 +1626,7 @@ static void taprio_destroy(struct Qdisc *sch) - taprio_disable_offload(dev, q, NULL); - - if (q->qdiscs) { -- for (i = 0; i < dev->num_tx_queues && q->qdiscs[i]; i++) -+ for (i = 0; i < dev->num_tx_queues; i++) - qdisc_put(q->qdiscs[i]); - - kfree(q->qdiscs); -diff --git a/scripts/depmod.sh b/scripts/depmod.sh -index e083bcae343f3..3643b4f896ede 100755 ---- a/scripts/depmod.sh -+++ b/scripts/depmod.sh -@@ -15,6 +15,8 @@ if ! test -r System.map ; then - exit 0 - fi - -+# legacy behavior: "depmod" in /sbin, no /sbin in PATH -+PATH="$PATH:/sbin" - if [ -z $(command -v $DEPMOD) ]; then - echo "Warning: 'make modules_install' requires $DEPMOD. Please install it." >&2 - echo "This is probably in the kmod package." >&2 -diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c -index 192e580561efd..5f515a29668c8 100644 ---- a/sound/pci/hda/hda_intel.c -+++ b/sound/pci/hda/hda_intel.c -@@ -2186,8 +2186,6 @@ static struct snd_pci_quirk power_save_blacklist[] = { - SND_PCI_QUIRK(0x1849, 0x7662, "Asrock H81M-HDS", 0), - /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ - SND_PCI_QUIRK(0x1043, 0x8733, "Asus Prime X370-Pro", 0), -- /* https://bugzilla.redhat.com/show_bug.cgi?id=1581607 */ -- SND_PCI_QUIRK(0x1558, 0x3501, "Clevo W35xSS_370SS", 0), - /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ - SND_PCI_QUIRK(0x1558, 0x6504, "Clevo W65_67SB", 0), - /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ -diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c -index 396b5503038ad..c3a1ce129b3d9 100644 ---- a/sound/pci/hda/patch_conexant.c -+++ b/sound/pci/hda/patch_conexant.c -@@ -1075,6 +1075,7 @@ static int patch_conexant_auto(struct hda_codec *codec) - static const struct hda_device_id snd_hda_id_conexant[] = { - HDA_CODEC_ENTRY(0x14f11f86, "CX8070", patch_conexant_auto), - HDA_CODEC_ENTRY(0x14f12008, "CX8200", patch_conexant_auto), -+ HDA_CODEC_ENTRY(0x14f120d0, "CX11970", patch_conexant_auto), - HDA_CODEC_ENTRY(0x14f15045, "CX20549 (Venice)", patch_conexant_auto), - HDA_CODEC_ENTRY(0x14f15047, "CX20551 (Waikiki)", patch_conexant_auto), - HDA_CODEC_ENTRY(0x14f15051, "CX20561 (Hermosa)", patch_conexant_auto), -diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c -index ec0938923f5de..8adbe45a54c11 100644 ---- a/sound/pci/hda/patch_realtek.c -+++ b/sound/pci/hda/patch_realtek.c -@@ -6236,6 +6236,7 @@ enum { - ALC221_FIXUP_HP_FRONT_MIC, - ALC292_FIXUP_TPT460, - ALC298_FIXUP_SPK_VOLUME, -+ ALC298_FIXUP_LENOVO_SPK_VOLUME, - ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, - ALC269_FIXUP_ATIV_BOOK_8, - ALC221_FIXUP_HP_MIC_NO_PRESENCE, -@@ -7062,6 +7063,10 @@ static const struct hda_fixup alc269_fixups[] = { - .chained = true, - .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, - }, -+ [ALC298_FIXUP_LENOVO_SPK_VOLUME] = { -+ .type = HDA_FIXUP_FUNC, -+ .v.func = alc298_fixup_speaker_volume, -+ }, - [ALC295_FIXUP_DISABLE_DAC3] = { - .type = HDA_FIXUP_FUNC, - .v.func = alc295_fixup_disable_dac3, -@@ -7875,6 +7880,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { - SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), - SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), - SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), -+ SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED), - SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED), - SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT), - SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED), -@@ -7935,6 +7941,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { - SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), - SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), - SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), -+ SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), -+ SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), - SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), - SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), - SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), -@@ -8040,6 +8048,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { - SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), - SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), - SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), -+ SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME), - SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), - SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), - SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), -diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c -index 7ef8f3105cdb7..0ab40a8a68fb5 100644 ---- a/sound/pci/hda/patch_via.c -+++ b/sound/pci/hda/patch_via.c -@@ -1002,6 +1002,7 @@ static const struct hda_verb vt1802_init_verbs[] = { - enum { - VIA_FIXUP_INTMIC_BOOST, - VIA_FIXUP_ASUS_G75, -+ VIA_FIXUP_POWER_SAVE, - }; - - static void via_fixup_intmic_boost(struct hda_codec *codec, -@@ -1011,6 +1012,13 @@ static void via_fixup_intmic_boost(struct hda_codec *codec, - override_mic_boost(codec, 0x30, 0, 2, 40); - } - -+static void via_fixup_power_save(struct hda_codec *codec, -+ const struct hda_fixup *fix, int action) -+{ -+ if (action == HDA_FIXUP_ACT_PRE_PROBE) -+ codec->power_save_node = 0; -+} -+ - static const struct hda_fixup via_fixups[] = { - [VIA_FIXUP_INTMIC_BOOST] = { - .type = HDA_FIXUP_FUNC, -@@ -1025,11 +1033,16 @@ static const struct hda_fixup via_fixups[] = { - { } - } - }, -+ [VIA_FIXUP_POWER_SAVE] = { -+ .type = HDA_FIXUP_FUNC, -+ .v.func = via_fixup_power_save, -+ }, - }; - - static const struct snd_pci_quirk vt2002p_fixups[] = { - SND_PCI_QUIRK(0x1043, 0x1487, "Asus G75", VIA_FIXUP_ASUS_G75), - SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST), -+ SND_PCI_QUIRK(0x1558, 0x3501, "Clevo W35xSS_370SS", VIA_FIXUP_POWER_SAVE), - {} - }; - -diff --git a/sound/usb/midi.c b/sound/usb/midi.c -index bc9068b616bb9..1cc17c449407c 100644 ---- a/sound/usb/midi.c -+++ b/sound/usb/midi.c -@@ -1889,6 +1889,8 @@ 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->bNumEmbMIDIJack > 0x10) -+ continue; - if (usb_endpoint_dir_out(ep)) { - if (endpoints[epidx].out_ep) { - if (++epidx >= MIDI_MAX_ENDPOINTS) { -@@ -2141,6 +2143,8 @@ static int snd_usbmidi_detect_roland(struct snd_usb_midi *umidi, - cs_desc[1] == USB_DT_CS_INTERFACE && - cs_desc[2] == 0xf1 && - cs_desc[3] == 0x02) { -+ if (cs_desc[4] > 0x10 || cs_desc[5] > 0x10) -+ continue; - endpoint->in_cables = (1 << cs_desc[4]) - 1; - endpoint->out_cables = (1 << cs_desc[5]) - 1; - return snd_usbmidi_detect_endpoints(umidi, endpoint, 1); -diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c -index 1dfa49d26de91..8f3b40ec02b77 100644 ---- a/virt/kvm/kvm_main.c -+++ b/virt/kvm/kvm_main.c -@@ -428,9 +428,8 @@ static int kvm_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn, - kvm->mmu_notifier_count++; - need_tlb_flush = kvm_unmap_hva_range(kvm, range->start, range->end, - range->flags); -- need_tlb_flush |= kvm->tlbs_dirty; - /* we've to flush the tlb before the pages can be freed */ -- if (need_tlb_flush) -+ if (need_tlb_flush || kvm->tlbs_dirty) - kvm_flush_remote_tlbs(kvm); - - spin_unlock(&kvm->mmu_lock); diff --git a/patch/kernel/odroidxu4-current/patch-5.4.89-90.patch b/patch/kernel/odroidxu4-current/patch-5.4.89-90.patch deleted file mode 100644 index bc5ebac353..0000000000 --- a/patch/kernel/odroidxu4-current/patch-5.4.89-90.patch +++ /dev/null @@ -1,1787 +0,0 @@ -diff --git a/Makefile b/Makefile -index 95848875110ef..5c9d680b7ce51 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - VERSION = 5 - PATCHLEVEL = 4 --SUBLEVEL = 89 -+SUBLEVEL = 90 - EXTRAVERSION = - NAME = Kleptomaniac Octopus - -diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c -index 3acb4192918df..f85a0fd6aca5c 100644 ---- a/arch/arm/mach-omap2/omap_device.c -+++ b/arch/arm/mach-omap2/omap_device.c -@@ -234,10 +234,12 @@ static int _omap_device_notifier_call(struct notifier_block *nb, - break; - case BUS_NOTIFY_BIND_DRIVER: - od = to_omap_device(pdev); -- if (od && (od->_state == OMAP_DEVICE_STATE_ENABLED) && -- pm_runtime_status_suspended(dev)) { -+ if (od) { - od->_driver_status = BUS_NOTIFY_BIND_DRIVER; -- pm_runtime_set_active(dev); -+ if (od->_state == OMAP_DEVICE_STATE_ENABLED && -+ pm_runtime_status_suspended(dev)) { -+ pm_runtime_set_active(dev); -+ } - } - break; - case BUS_NOTIFY_ADD_DEVICE: -diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c -index 6478635ff2142..98a177dd1f89f 100644 ---- a/arch/arm64/kvm/sys_regs.c -+++ b/arch/arm64/kvm/sys_regs.c -@@ -625,6 +625,10 @@ static void reset_pmcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) - { - u64 pmcr, val; - -+ /* No PMU available, PMCR_EL0 may UNDEF... */ -+ if (!kvm_arm_support_pmu_v3()) -+ return; -+ - pmcr = read_sysreg(pmcr_el0); - /* - * Writable bits of PMCR_EL0 (ARMV8_PMU_PMCR_MASK) are reset to UNKNOWN -diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S -index 390edb7638265..bde3e0f85425f 100644 ---- a/arch/x86/entry/entry_32.S -+++ b/arch/x86/entry/entry_32.S -@@ -869,9 +869,10 @@ GLOBAL(__begin_SYSENTER_singlestep_region) - * Xen doesn't set %esp to be precisely what the normal SYSENTER - * entry point expects, so fix it up before using the normal path. - */ --ENTRY(xen_sysenter_target) -+SYM_CODE_START(xen_sysenter_target) - addl $5*4, %esp /* remove xen-provided frame */ - jmp .Lsysenter_past_esp -+SYM_CODE_END(xen_sysenter_target) - #endif - - /* -diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S -index e95e95960156b..5b076cb79f5fb 100644 ---- a/arch/x86/kernel/acpi/wakeup_32.S -+++ b/arch/x86/kernel/acpi/wakeup_32.S -@@ -9,8 +9,7 @@ - .code32 - ALIGN - --ENTRY(wakeup_pmode_return) --wakeup_pmode_return: -+SYM_CODE_START(wakeup_pmode_return) - movw $__KERNEL_DS, %ax - movw %ax, %ss - movw %ax, %fs -@@ -39,6 +38,7 @@ wakeup_pmode_return: - # jump to place where we left off - movl saved_eip, %eax - jmp *%eax -+SYM_CODE_END(wakeup_pmode_return) - - bogus_magic: - jmp bogus_magic -@@ -72,7 +72,7 @@ restore_registers: - popfl - ret - --ENTRY(do_suspend_lowlevel) -+SYM_CODE_START(do_suspend_lowlevel) - call save_processor_state - call save_registers - pushl $3 -@@ -87,6 +87,7 @@ ret_point: - call restore_registers - call restore_processor_state - ret -+SYM_CODE_END(do_suspend_lowlevel) - - .data - ALIGN -diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c -index 830ccc396e26d..28f786289fce4 100644 ---- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c -+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c -@@ -525,85 +525,70 @@ static void rdtgroup_remove(struct rdtgroup *rdtgrp) - kfree(rdtgrp); - } - --struct task_move_callback { -- struct callback_head work; -- struct rdtgroup *rdtgrp; --}; -- --static void move_myself(struct callback_head *head) -+static void _update_task_closid_rmid(void *task) - { -- struct task_move_callback *callback; -- struct rdtgroup *rdtgrp; -- -- callback = container_of(head, struct task_move_callback, work); -- rdtgrp = callback->rdtgrp; -- - /* -- * If resource group was deleted before this task work callback -- * was invoked, then assign the task to root group and free the -- * resource group. -+ * If the task is still current on this CPU, update PQR_ASSOC MSR. -+ * Otherwise, the MSR is updated when the task is scheduled in. - */ -- if (atomic_dec_and_test(&rdtgrp->waitcount) && -- (rdtgrp->flags & RDT_DELETED)) { -- current->closid = 0; -- current->rmid = 0; -- rdtgroup_remove(rdtgrp); -- } -- -- preempt_disable(); -- /* update PQR_ASSOC MSR to make resource group go into effect */ -- resctrl_sched_in(); -- preempt_enable(); -+ if (task == current) -+ resctrl_sched_in(); -+} - -- kfree(callback); -+static void update_task_closid_rmid(struct task_struct *t) -+{ -+ if (IS_ENABLED(CONFIG_SMP) && task_curr(t)) -+ smp_call_function_single(task_cpu(t), _update_task_closid_rmid, t, 1); -+ else -+ _update_task_closid_rmid(t); - } - - static int __rdtgroup_move_task(struct task_struct *tsk, - struct rdtgroup *rdtgrp) - { -- struct task_move_callback *callback; -- int ret; -- -- callback = kzalloc(sizeof(*callback), GFP_KERNEL); -- if (!callback) -- return -ENOMEM; -- callback->work.func = move_myself; -- callback->rdtgrp = rdtgrp; -+ /* If the task is already in rdtgrp, no need to move the task. */ -+ if ((rdtgrp->type == RDTCTRL_GROUP && tsk->closid == rdtgrp->closid && -+ tsk->rmid == rdtgrp->mon.rmid) || -+ (rdtgrp->type == RDTMON_GROUP && tsk->rmid == rdtgrp->mon.rmid && -+ tsk->closid == rdtgrp->mon.parent->closid)) -+ return 0; - - /* -- * Take a refcount, so rdtgrp cannot be freed before the -- * callback has been invoked. -+ * Set the task's closid/rmid before the PQR_ASSOC MSR can be -+ * updated by them. -+ * -+ * For ctrl_mon groups, move both closid and rmid. -+ * For monitor groups, can move the tasks only from -+ * their parent CTRL group. - */ -- atomic_inc(&rdtgrp->waitcount); -- ret = task_work_add(tsk, &callback->work, true); -- if (ret) { -- /* -- * Task is exiting. Drop the refcount and free the callback. -- * No need to check the refcount as the group cannot be -- * deleted before the write function unlocks rdtgroup_mutex. -- */ -- atomic_dec(&rdtgrp->waitcount); -- kfree(callback); -- rdt_last_cmd_puts("Task exited\n"); -- } else { -- /* -- * For ctrl_mon groups move both closid and rmid. -- * For monitor groups, can move the tasks only from -- * their parent CTRL group. -- */ -- if (rdtgrp->type == RDTCTRL_GROUP) { -- tsk->closid = rdtgrp->closid; -+ -+ if (rdtgrp->type == RDTCTRL_GROUP) { -+ tsk->closid = rdtgrp->closid; -+ tsk->rmid = rdtgrp->mon.rmid; -+ } else if (rdtgrp->type == RDTMON_GROUP) { -+ if (rdtgrp->mon.parent->closid == tsk->closid) { - tsk->rmid = rdtgrp->mon.rmid; -- } else if (rdtgrp->type == RDTMON_GROUP) { -- if (rdtgrp->mon.parent->closid == tsk->closid) { -- tsk->rmid = rdtgrp->mon.rmid; -- } else { -- rdt_last_cmd_puts("Can't move task to different control group\n"); -- ret = -EINVAL; -- } -+ } else { -+ rdt_last_cmd_puts("Can't move task to different control group\n"); -+ return -EINVAL; - } - } -- return ret; -+ -+ /* -+ * Ensure the task's closid and rmid are written before determining if -+ * the task is current that will decide if it will be interrupted. -+ */ -+ barrier(); -+ -+ /* -+ * By now, the task's closid and rmid are set. If the task is current -+ * on a CPU, the PQR_ASSOC MSR needs to be updated to make the resource -+ * group go into effect. If the task is not current, the MSR will be -+ * updated when the task is scheduled in. -+ */ -+ update_task_closid_rmid(tsk); -+ -+ return 0; - } - - /** -diff --git a/arch/x86/kernel/ftrace_32.S b/arch/x86/kernel/ftrace_32.S -index 073aab525d800..2cc0303522c99 100644 ---- a/arch/x86/kernel/ftrace_32.S -+++ b/arch/x86/kernel/ftrace_32.S -@@ -89,7 +89,7 @@ WEAK(ftrace_stub) - ret - END(ftrace_caller) - --ENTRY(ftrace_regs_caller) -+SYM_CODE_START(ftrace_regs_caller) - /* - * We're here from an mcount/fentry CALL, and the stack frame looks like: - * -@@ -163,6 +163,7 @@ GLOBAL(ftrace_regs_call) - popl %eax - - jmp .Lftrace_ret -+SYM_CODE_END(ftrace_regs_caller) - - #ifdef CONFIG_FUNCTION_GRAPH_TRACER - ENTRY(ftrace_graph_caller) -diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S -index 2e6a0676c1f43..11a5d5ade52ce 100644 ---- a/arch/x86/kernel/head_32.S -+++ b/arch/x86/kernel/head_32.S -@@ -64,7 +64,7 @@ RESERVE_BRK(pagetables, INIT_MAP_SIZE) - * can. - */ - __HEAD --ENTRY(startup_32) -+SYM_CODE_START(startup_32) - movl pa(initial_stack),%ecx - - /* test KEEP_SEGMENTS flag to see if the bootloader is asking -@@ -172,6 +172,7 @@ num_subarch_entries = (. - subarch_entries) / 4 - #else - jmp .Ldefault_entry - #endif /* CONFIG_PARAVIRT */ -+SYM_CODE_END(startup_32) - - #ifdef CONFIG_HOTPLUG_CPU - /* -diff --git a/arch/x86/power/hibernate_asm_32.S b/arch/x86/power/hibernate_asm_32.S -index 6fe383002125f..a19ed3d231853 100644 ---- a/arch/x86/power/hibernate_asm_32.S -+++ b/arch/x86/power/hibernate_asm_32.S -@@ -35,7 +35,7 @@ ENTRY(swsusp_arch_suspend) - ret - ENDPROC(swsusp_arch_suspend) - --ENTRY(restore_image) -+SYM_CODE_START(restore_image) - /* prepare to jump to the image kernel */ - movl restore_jump_address, %ebx - movl restore_cr3, %ebp -@@ -45,9 +45,10 @@ ENTRY(restore_image) - /* jump to relocated restore code */ - movl relocated_restore_code, %eax - jmpl *%eax -+SYM_CODE_END(restore_image) - - /* code below has been relocated to a safe page */ --ENTRY(core_restore_code) -+SYM_CODE_START(core_restore_code) - movl temp_pgt, %eax - movl %eax, %cr3 - -@@ -77,6 +78,7 @@ copy_loop: - - done: - jmpl *%ebx -+SYM_CODE_END(core_restore_code) - - /* code below belongs to the image kernel */ - .align PAGE_SIZE -diff --git a/arch/x86/realmode/rm/trampoline_32.S b/arch/x86/realmode/rm/trampoline_32.S -index 1868b158480d4..3a0ef0d577344 100644 ---- a/arch/x86/realmode/rm/trampoline_32.S -+++ b/arch/x86/realmode/rm/trampoline_32.S -@@ -29,7 +29,7 @@ - .code16 - - .balign PAGE_SIZE --ENTRY(trampoline_start) -+SYM_CODE_START(trampoline_start) - wbinvd # Needed for NUMA-Q should be harmless for others - - LJMPW_RM(1f) -@@ -54,11 +54,13 @@ ENTRY(trampoline_start) - lmsw %dx # into protected mode - - ljmpl $__BOOT_CS, $pa_startup_32 -+SYM_CODE_END(trampoline_start) - - .section ".text32","ax" - .code32 --ENTRY(startup_32) # note: also used from wakeup_asm.S -+SYM_CODE_START(startup_32) # note: also used from wakeup_asm.S - jmp *%eax -+SYM_CODE_END(startup_32) - - .bss - .balign 8 -diff --git a/arch/x86/xen/xen-asm_32.S b/arch/x86/xen/xen-asm_32.S -index cd177772fe4d5..2712e91553063 100644 ---- a/arch/x86/xen/xen-asm_32.S -+++ b/arch/x86/xen/xen-asm_32.S -@@ -56,7 +56,7 @@ - _ASM_EXTABLE(1b,2b) - .endm - --ENTRY(xen_iret) -+SYM_CODE_START(xen_iret) - /* test eflags for special cases */ - testl $(X86_EFLAGS_VM | XEN_EFLAGS_NMI), 8(%esp) - jnz hyper_iret -@@ -122,6 +122,7 @@ xen_iret_end_crit: - hyper_iret: - /* put this out of line since its very rarely used */ - jmp hypercall_page + __HYPERVISOR_iret * 32 -+SYM_CODE_END(xen_iret) - - .globl xen_iret_start_crit, xen_iret_end_crit - -@@ -152,7 +153,7 @@ hyper_iret: - * The only caveat is that if the outer eax hasn't been restored yet (i.e. - * it's still on stack), we need to restore its value here. - */ --ENTRY(xen_iret_crit_fixup) -+SYM_CODE_START(xen_iret_crit_fixup) - /* - * Paranoia: Make sure we're really coming from kernel space. - * One could imagine a case where userspace jumps into the -@@ -179,4 +180,4 @@ ENTRY(xen_iret_crit_fixup) - - 2: - ret --END(xen_iret_crit_fixup) -+SYM_CODE_END(xen_iret_crit_fixup) -diff --git a/block/genhd.c b/block/genhd.c -index 26b31fcae217f..604f0a2cbc9a0 100644 ---- a/block/genhd.c -+++ b/block/genhd.c -@@ -222,14 +222,17 @@ struct hd_struct *disk_part_iter_next(struct disk_part_iter *piter) - part = rcu_dereference(ptbl->part[piter->idx]); - if (!part) - continue; -+ get_device(part_to_dev(part)); -+ piter->part = part; - if (!part_nr_sects_read(part) && - !(piter->flags & DISK_PITER_INCL_EMPTY) && - !(piter->flags & DISK_PITER_INCL_EMPTY_PART0 && -- piter->idx == 0)) -+ piter->idx == 0)) { -+ put_device(part_to_dev(part)); -+ piter->part = NULL; - continue; -+ } - -- get_device(part_to_dev(part)); -- piter->part = part; - piter->idx += inc; - break; - } -diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c -index f58baff2be0af..398991381e9af 100644 ---- a/drivers/base/regmap/regmap-debugfs.c -+++ b/drivers/base/regmap/regmap-debugfs.c -@@ -583,8 +583,12 @@ void regmap_debugfs_init(struct regmap *map, const char *name) - devname = dev_name(map->dev); - - if (name) { -- map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s", -+ if (!map->debugfs_name) { -+ map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s", - devname, name); -+ if (!map->debugfs_name) -+ return; -+ } - name = map->debugfs_name; - } else { - name = devname; -@@ -592,9 +596,10 @@ void regmap_debugfs_init(struct regmap *map, const char *name) - - if (!strcmp(name, "dummy")) { - kfree(map->debugfs_name); -- - map->debugfs_name = kasprintf(GFP_KERNEL, "dummy%d", - dummy_index); -+ if (!map->debugfs_name) -+ return; - name = map->debugfs_name; - dummy_index++; - } -diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig -index 1bb8ec5753527..0fc27ac14f29c 100644 ---- a/drivers/block/Kconfig -+++ b/drivers/block/Kconfig -@@ -461,6 +461,7 @@ config BLK_DEV_RBD - config BLK_DEV_RSXX - tristate "IBM Flash Adapter 900GB Full Height PCIe Device Driver" - depends on PCI -+ select CRC32 - help - Device driver for IBM's high speed PCIe SSD - storage device: Flash Adapter 900GB Full Height. -diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c -index 2db2f1739e092..1b2ec3be59eb7 100644 ---- a/drivers/cpufreq/powernow-k8.c -+++ b/drivers/cpufreq/powernow-k8.c -@@ -878,9 +878,9 @@ static int get_transition_latency(struct powernow_k8_data *data) - - /* Take a frequency, and issue the fid/vid transition command */ - static int transition_frequency_fidvid(struct powernow_k8_data *data, -- unsigned int index) -+ unsigned int index, -+ struct cpufreq_policy *policy) - { -- struct cpufreq_policy *policy; - u32 fid = 0; - u32 vid = 0; - int res; -@@ -912,9 +912,6 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, - freqs.old = find_khz_freq_from_fid(data->currfid); - freqs.new = find_khz_freq_from_fid(fid); - -- policy = cpufreq_cpu_get(smp_processor_id()); -- cpufreq_cpu_put(policy); -- - cpufreq_freq_transition_begin(policy, &freqs); - res = transition_fid_vid(data, fid, vid); - cpufreq_freq_transition_end(policy, &freqs, res); -@@ -969,7 +966,7 @@ static long powernowk8_target_fn(void *arg) - - powernow_k8_acpi_pst_values(data, newstate); - -- ret = transition_frequency_fidvid(data, newstate); -+ ret = transition_frequency_fidvid(data, newstate, pol); - - if (ret) { - pr_err("transition frequency failed\n"); -diff --git a/drivers/crypto/chelsio/chtls/chtls_cm.c b/drivers/crypto/chelsio/chtls/chtls_cm.c -index f81a5e35d8fd1..eddc6d1bdb2d1 100644 ---- a/drivers/crypto/chelsio/chtls/chtls_cm.c -+++ b/drivers/crypto/chelsio/chtls/chtls_cm.c -@@ -577,7 +577,7 @@ static void chtls_reset_synq(struct listen_ctx *listen_ctx) - - while (!skb_queue_empty(&listen_ctx->synq)) { - struct chtls_sock *csk = -- container_of((struct synq *)__skb_dequeue -+ container_of((struct synq *)skb_peek - (&listen_ctx->synq), struct chtls_sock, synq); - struct sock *child = csk->sk; - -@@ -1021,6 +1021,7 @@ static struct sock *chtls_recv_sock(struct sock *lsk, - const struct cpl_pass_accept_req *req, - struct chtls_dev *cdev) - { -+ struct adapter *adap = pci_get_drvdata(cdev->pdev); - struct inet_sock *newinet; - const struct iphdr *iph; - struct tls_context *ctx; -@@ -1030,9 +1031,10 @@ static struct sock *chtls_recv_sock(struct sock *lsk, - struct neighbour *n; - struct tcp_sock *tp; - struct sock *newsk; -+ bool found = false; - u16 port_id; - int rxq_idx; -- int step; -+ int step, i; - - iph = (const struct iphdr *)network_hdr; - newsk = tcp_create_openreq_child(lsk, oreq, cdev->askb); -@@ -1044,7 +1046,7 @@ static struct sock *chtls_recv_sock(struct sock *lsk, - goto free_sk; - - n = dst_neigh_lookup(dst, &iph->saddr); -- if (!n) -+ if (!n || !n->dev) - goto free_sk; - - ndev = n->dev; -@@ -1053,6 +1055,13 @@ static struct sock *chtls_recv_sock(struct sock *lsk, - if (is_vlan_dev(ndev)) - ndev = vlan_dev_real_dev(ndev); - -+ for_each_port(adap, i) -+ if (cdev->ports[i] == ndev) -+ found = true; -+ -+ if (!found) -+ goto free_dst; -+ - port_id = cxgb4_port_idx(ndev); - - csk = chtls_sock_create(cdev); -@@ -1108,6 +1117,7 @@ static struct sock *chtls_recv_sock(struct sock *lsk, - free_csk: - chtls_sock_release(&csk->kref); - free_dst: -+ neigh_release(n); - dst_release(dst); - free_sk: - inet_csk_prepare_forced_close(newsk); -@@ -1443,6 +1453,11 @@ static int chtls_pass_establish(struct chtls_dev *cdev, struct sk_buff *skb) - sk_wake_async(sk, 0, POLL_OUT); - - data = lookup_stid(cdev->tids, stid); -+ if (!data) { -+ /* listening server close */ -+ kfree_skb(skb); -+ goto unlock; -+ } - lsk = ((struct listen_ctx *)data)->lsk; - - bh_lock_sock(lsk); -@@ -1828,39 +1843,6 @@ static void send_defer_abort_rpl(struct chtls_dev *cdev, struct sk_buff *skb) - kfree_skb(skb); - } - --static void send_abort_rpl(struct sock *sk, struct sk_buff *skb, -- struct chtls_dev *cdev, int status, int queue) --{ -- struct cpl_abort_req_rss *req = cplhdr(skb); -- struct sk_buff *reply_skb; -- struct chtls_sock *csk; -- -- csk = rcu_dereference_sk_user_data(sk); -- -- reply_skb = alloc_skb(sizeof(struct cpl_abort_rpl), -- GFP_KERNEL); -- -- if (!reply_skb) { -- req->status = (queue << 1); -- send_defer_abort_rpl(cdev, skb); -- return; -- } -- -- set_abort_rpl_wr(reply_skb, GET_TID(req), status); -- kfree_skb(skb); -- -- set_wr_txq(reply_skb, CPL_PRIORITY_DATA, queue); -- if (csk_conn_inline(csk)) { -- struct l2t_entry *e = csk->l2t_entry; -- -- if (e && sk->sk_state != TCP_SYN_RECV) { -- cxgb4_l2t_send(csk->egress_dev, reply_skb, e); -- return; -- } -- } -- cxgb4_ofld_send(cdev->lldi->ports[0], reply_skb); --} -- - /* - * Add an skb to the deferred skb queue for processing from process context. - */ -@@ -1923,9 +1905,9 @@ static void bl_abort_syn_rcv(struct sock *lsk, struct sk_buff *skb) - queue = csk->txq_idx; - - skb->sk = NULL; -+ chtls_send_abort_rpl(child, skb, BLOG_SKB_CB(skb)->cdev, -+ CPL_ABORT_NO_RST, queue); - do_abort_syn_rcv(child, lsk); -- send_abort_rpl(child, skb, BLOG_SKB_CB(skb)->cdev, -- CPL_ABORT_NO_RST, queue); - } - - static int abort_syn_rcv(struct sock *sk, struct sk_buff *skb) -@@ -1955,8 +1937,8 @@ static int abort_syn_rcv(struct sock *sk, struct sk_buff *skb) - if (!sock_owned_by_user(psk)) { - int queue = csk->txq_idx; - -+ chtls_send_abort_rpl(sk, skb, cdev, CPL_ABORT_NO_RST, queue); - do_abort_syn_rcv(sk, psk); -- send_abort_rpl(sk, skb, cdev, CPL_ABORT_NO_RST, queue); - } else { - skb->sk = sk; - BLOG_SKB_CB(skb)->backlog_rcv = bl_abort_syn_rcv; -@@ -1974,9 +1956,6 @@ static void chtls_abort_req_rss(struct sock *sk, struct sk_buff *skb) - int queue = csk->txq_idx; - - if (is_neg_adv(req->status)) { -- if (sk->sk_state == TCP_SYN_RECV) -- chtls_set_tcb_tflag(sk, 0, 0); -- - kfree_skb(skb); - return; - } -@@ -2002,12 +1981,11 @@ static void chtls_abort_req_rss(struct sock *sk, struct sk_buff *skb) - - if (sk->sk_state == TCP_SYN_RECV && !abort_syn_rcv(sk, skb)) - return; -- -- chtls_release_resources(sk); -- chtls_conn_done(sk); - } - - chtls_send_abort_rpl(sk, skb, csk->cdev, rst_status, queue); -+ chtls_release_resources(sk); -+ chtls_conn_done(sk); - } - - static void chtls_abort_rpl_rss(struct sock *sk, struct sk_buff *skb) -diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c -index 7f9a86c3c58ff..31577316f80bc 100644 ---- a/drivers/dma/dw-edma/dw-edma-core.c -+++ b/drivers/dma/dw-edma/dw-edma-core.c -@@ -85,12 +85,12 @@ static struct dw_edma_chunk *dw_edma_alloc_chunk(struct dw_edma_desc *desc) - - if (desc->chunk) { - /* Create and add new element into the linked list */ -- desc->chunks_alloc++; -- list_add_tail(&chunk->list, &desc->chunk->list); - if (!dw_edma_alloc_burst(chunk)) { - kfree(chunk); - return NULL; - } -+ desc->chunks_alloc++; -+ list_add_tail(&chunk->list, &desc->chunk->list); - } else { - /* List head */ - chunk->burst = NULL; -diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c -index 4c58da7421432..04d89eec11e74 100644 ---- a/drivers/dma/mediatek/mtk-hsdma.c -+++ b/drivers/dma/mediatek/mtk-hsdma.c -@@ -1007,6 +1007,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev) - return 0; - - err_free: -+ mtk_hsdma_hw_deinit(hsdma); - of_dma_controller_free(pdev->dev.of_node); - err_unregister: - dma_async_device_unregister(dd); -diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c -index a6abfe702c5a3..1b5f3e9f43d70 100644 ---- a/drivers/dma/xilinx/xilinx_dma.c -+++ b/drivers/dma/xilinx/xilinx_dma.c -@@ -2431,7 +2431,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev, - has_dre = false; - - if (!has_dre) -- xdev->common.copy_align = fls(width - 1); -+ xdev->common.copy_align = (enum dmaengine_alignment)fls(width - 1); - - if (of_device_is_compatible(node, "xlnx,axi-vdma-mm2s-channel") || - of_device_is_compatible(node, "xlnx,axi-dma-mm2s-channel") || -@@ -2543,7 +2543,8 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev, - static int xilinx_dma_child_probe(struct xilinx_dma_device *xdev, - struct device_node *node) - { -- int ret, i, nr_channels = 1; -+ int ret, i; -+ u32 nr_channels = 1; - - ret = of_property_read_u32(node, "dma-channels", &nr_channels); - if ((ret < 0) && xdev->mcdma) -@@ -2742,7 +2743,11 @@ static int xilinx_dma_probe(struct platform_device *pdev) - } - - /* Register the DMA engine with the core */ -- dma_async_device_register(&xdev->common); -+ err = dma_async_device_register(&xdev->common); -+ if (err) { -+ dev_err(xdev->dev, "failed to register the dma device\n"); -+ goto error; -+ } - - err = of_dma_controller_register(node, of_dma_xilinx_xlate, - xdev); -diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c -index cd71e71339446..9e852b4bbf92b 100644 ---- a/drivers/hid/wacom_sys.c -+++ b/drivers/hid/wacom_sys.c -@@ -1270,6 +1270,37 @@ static int wacom_devm_sysfs_create_group(struct wacom *wacom, - group); - } - -+static void wacom_devm_kfifo_release(struct device *dev, void *res) -+{ -+ struct kfifo_rec_ptr_2 *devres = res; -+ -+ kfifo_free(devres); -+} -+ -+static int wacom_devm_kfifo_alloc(struct wacom *wacom) -+{ -+ struct wacom_wac *wacom_wac = &wacom->wacom_wac; -+ struct kfifo_rec_ptr_2 *pen_fifo = &wacom_wac->pen_fifo; -+ int error; -+ -+ pen_fifo = devres_alloc(wacom_devm_kfifo_release, -+ sizeof(struct kfifo_rec_ptr_2), -+ GFP_KERNEL); -+ -+ if (!pen_fifo) -+ return -ENOMEM; -+ -+ error = kfifo_alloc(pen_fifo, WACOM_PKGLEN_MAX, GFP_KERNEL); -+ if (error) { -+ devres_free(pen_fifo); -+ return error; -+ } -+ -+ devres_add(&wacom->hdev->dev, pen_fifo); -+ -+ return 0; -+} -+ - enum led_brightness wacom_leds_brightness_get(struct wacom_led *led) - { - struct wacom *wacom = led->wacom; -@@ -2724,7 +2755,7 @@ static int wacom_probe(struct hid_device *hdev, - if (features->check_for_hid_type && features->hid_type != hdev->type) - return -ENODEV; - -- error = kfifo_alloc(&wacom_wac->pen_fifo, WACOM_PKGLEN_MAX, GFP_KERNEL); -+ error = wacom_devm_kfifo_alloc(wacom); - if (error) - return error; - -@@ -2786,8 +2817,6 @@ static void wacom_remove(struct hid_device *hdev) - - if (wacom->wacom_wac.features.type != REMOTE) - wacom_release_resources(wacom); -- -- kfifo_free(&wacom_wac->pen_fifo); - } - - #ifdef CONFIG_PM -diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c -index c40eef4e7a985..2b6a4c1f188f4 100644 ---- a/drivers/i2c/busses/i2c-i801.c -+++ b/drivers/i2c/busses/i2c-i801.c -@@ -1424,7 +1424,7 @@ static int i801_add_mux(struct i801_priv *priv) - - /* Register GPIO descriptor lookup table */ - lookup = devm_kzalloc(dev, -- struct_size(lookup, table, mux_config->n_gpios), -+ struct_size(lookup, table, mux_config->n_gpios + 1), - GFP_KERNEL); - if (!lookup) - return -ENOMEM; -diff --git a/drivers/i2c/busses/i2c-sprd.c b/drivers/i2c/busses/i2c-sprd.c -index b432e7580458d..b2dc802864641 100644 ---- a/drivers/i2c/busses/i2c-sprd.c -+++ b/drivers/i2c/busses/i2c-sprd.c -@@ -72,6 +72,8 @@ - - /* timeout (ms) for pm runtime autosuspend */ - #define SPRD_I2C_PM_TIMEOUT 1000 -+/* timeout (ms) for transfer message */ -+#define I2C_XFER_TIMEOUT 1000 - - /* SPRD i2c data structure */ - struct sprd_i2c { -@@ -244,6 +246,7 @@ static int sprd_i2c_handle_msg(struct i2c_adapter *i2c_adap, - struct i2c_msg *msg, bool is_last_msg) - { - struct sprd_i2c *i2c_dev = i2c_adap->algo_data; -+ unsigned long time_left; - - i2c_dev->msg = msg; - i2c_dev->buf = msg->buf; -@@ -273,7 +276,10 @@ static int sprd_i2c_handle_msg(struct i2c_adapter *i2c_adap, - - sprd_i2c_opt_start(i2c_dev); - -- wait_for_completion(&i2c_dev->complete); -+ time_left = wait_for_completion_timeout(&i2c_dev->complete, -+ msecs_to_jiffies(I2C_XFER_TIMEOUT)); -+ if (!time_left) -+ return -ETIMEDOUT; - - return i2c_dev->err; - } -diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c -index b0f3da1976e4f..d1f2109012ed5 100644 ---- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c -+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c -@@ -664,13 +664,29 @@ static irqreturn_t st_lsm6dsx_handler_irq(int irq, void *private) - static irqreturn_t st_lsm6dsx_handler_thread(int irq, void *private) - { - struct st_lsm6dsx_hw *hw = private; -- int count; -+ int fifo_len = 0, len; - -- mutex_lock(&hw->fifo_lock); -- count = hw->settings->fifo_ops.read_fifo(hw); -- mutex_unlock(&hw->fifo_lock); -+ /* -+ * If we are using edge IRQs, new samples can arrive while -+ * processing current interrupt since there are no hw -+ * guarantees the irq line stays "low" long enough to properly -+ * detect the new interrupt. In this case the new sample will -+ * be missed. -+ * Polling FIFO status register allow us to read new -+ * samples even if the interrupt arrives while processing -+ * previous data and the timeslot where the line is "low" is -+ * too short to be properly detected. -+ */ -+ do { -+ mutex_lock(&hw->fifo_lock); -+ len = hw->settings->fifo_ops.read_fifo(hw); -+ mutex_unlock(&hw->fifo_lock); -+ -+ if (len > 0) -+ fifo_len += len; -+ } while (len > 0); - -- return count ? IRQ_HANDLED : IRQ_NONE; -+ return fifo_len ? IRQ_HANDLED : IRQ_NONE; - } - - static int st_lsm6dsx_buffer_preenable(struct iio_dev *iio_dev) -diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c -index f697f3a1d46bc..5dcc81b1df623 100644 ---- a/drivers/iommu/intel_irq_remapping.c -+++ b/drivers/iommu/intel_irq_remapping.c -@@ -1400,6 +1400,8 @@ static int intel_irq_remapping_alloc(struct irq_domain *domain, - irq_data = irq_domain_get_irq_data(domain, virq + i); - irq_cfg = irqd_cfg(irq_data); - if (!irq_data || !irq_cfg) { -+ if (!i) -+ kfree(data); - ret = -EINVAL; - goto out_free_data; - } -diff --git a/drivers/lightnvm/Kconfig b/drivers/lightnvm/Kconfig -index 8f39f9ba5c80e..4c2ce210c1237 100644 ---- a/drivers/lightnvm/Kconfig -+++ b/drivers/lightnvm/Kconfig -@@ -19,6 +19,7 @@ if NVM - - config NVM_PBLK - tristate "Physical Block Device Open-Channel SSD target" -+ select CRC32 - help - Allows an open-channel SSD to be exposed as a block device to the - host. The target assumes the device exposes raw flash and must be -diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig -index 17c166cc8482d..e4d944770ccaf 100644 ---- a/drivers/net/can/Kconfig -+++ b/drivers/net/can/Kconfig -@@ -123,6 +123,7 @@ config CAN_JANZ_ICAN3 - config CAN_KVASER_PCIEFD - depends on PCI - tristate "Kvaser PCIe FD cards" -+ select CRC32 - help - This is a driver for the Kvaser PCI Express CAN FD family. - -diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c -index d2bb9a87eff9a..8a842545e3f69 100644 ---- a/drivers/net/can/m_can/m_can.c -+++ b/drivers/net/can/m_can/m_can.c -@@ -1868,8 +1868,6 @@ void m_can_class_unregister(struct m_can_classdev *m_can_dev) - { - unregister_candev(m_can_dev->net); - -- m_can_clk_stop(m_can_dev); -- - free_candev(m_can_dev->net); - } - EXPORT_SYMBOL_GPL(m_can_class_unregister); -diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c -index 681bb861de05e..1f8710b35c6d7 100644 ---- a/drivers/net/can/m_can/tcan4x5x.c -+++ b/drivers/net/can/m_can/tcan4x5x.c -@@ -126,30 +126,6 @@ struct tcan4x5x_priv { - int reg_offset; - }; - --static struct can_bittiming_const tcan4x5x_bittiming_const = { -- .name = DEVICE_NAME, -- .tseg1_min = 2, -- .tseg1_max = 31, -- .tseg2_min = 2, -- .tseg2_max = 16, -- .sjw_max = 16, -- .brp_min = 1, -- .brp_max = 32, -- .brp_inc = 1, --}; -- --static struct can_bittiming_const tcan4x5x_data_bittiming_const = { -- .name = DEVICE_NAME, -- .tseg1_min = 1, -- .tseg1_max = 32, -- .tseg2_min = 1, -- .tseg2_max = 16, -- .sjw_max = 16, -- .brp_min = 1, -- .brp_max = 32, -- .brp_inc = 1, --}; -- - static void tcan4x5x_check_wake(struct tcan4x5x_priv *priv) - { - int wake_state = 0; -@@ -449,8 +425,6 @@ static int tcan4x5x_can_probe(struct spi_device *spi) - mcan_class->dev = &spi->dev; - mcan_class->ops = &tcan4x5x_ops; - mcan_class->is_peripheral = true; -- mcan_class->bit_timing = &tcan4x5x_bittiming_const; -- mcan_class->data_timing = &tcan4x5x_data_bittiming_const; - mcan_class->net->irq = spi->irq; - - spi_set_drvdata(spi, priv); -diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c -index 0d9b3fa7bd94e..ee1e67df1e7b4 100644 ---- a/drivers/net/dsa/lantiq_gswip.c -+++ b/drivers/net/dsa/lantiq_gswip.c -@@ -1419,11 +1419,12 @@ static void gswip_phylink_validate(struct dsa_switch *ds, int port, - phylink_set(mask, Pause); - phylink_set(mask, Asym_Pause); - -- /* With the exclusion of MII and Reverse MII, we support Gigabit, -- * including Half duplex -+ /* With the exclusion of MII, Reverse MII and Reduced MII, we -+ * support Gigabit, including Half duplex - */ - if (state->interface != PHY_INTERFACE_MODE_MII && -- state->interface != PHY_INTERFACE_MODE_REVMII) { -+ state->interface != PHY_INTERFACE_MODE_REVMII && -+ state->interface != PHY_INTERFACE_MODE_RMII) { - phylink_set(mask, 1000baseT_Full); - phylink_set(mask, 1000baseT_Half); - } -diff --git a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h -index f8a87f8ca9833..148e53812d89c 100644 ---- a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h -+++ b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h -@@ -123,7 +123,7 @@ struct hclgevf_mbx_arq_ring { - #define hclge_mbx_ring_ptr_move_crq(crq) \ - (crq->next_to_use = (crq->next_to_use + 1) % crq->desc_num) - #define hclge_mbx_tail_ptr_move_arq(arq) \ -- (arq.tail = (arq.tail + 1) % HCLGE_MBX_MAX_ARQ_MSG_SIZE) -+ (arq.tail = (arq.tail + 1) % HCLGE_MBX_MAX_ARQ_MSG_NUM) - #define hclge_mbx_head_ptr_move_arq(arq) \ -- (arq.head = (arq.head + 1) % HCLGE_MBX_MAX_ARQ_MSG_SIZE) -+ (arq.head = (arq.head + 1) % HCLGE_MBX_MAX_ARQ_MSG_NUM) - #endif -diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c -index 6c3d13110993f..6887b7fda6e07 100644 ---- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c -+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c -@@ -746,7 +746,8 @@ static int hclge_get_sset_count(struct hnae3_handle *handle, int stringset) - handle->flags |= HNAE3_SUPPORT_SERDES_SERIAL_LOOPBACK; - handle->flags |= HNAE3_SUPPORT_SERDES_PARALLEL_LOOPBACK; - -- if (hdev->hw.mac.phydev) { -+ if (hdev->hw.mac.phydev && hdev->hw.mac.phydev->drv && -+ hdev->hw.mac.phydev->drv->set_loopback) { - count += 1; - handle->flags |= HNAE3_SUPPORT_PHY_LOOPBACK; - } -diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c -index 8827ab4b4932e..6988bbf2576f5 100644 ---- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c -+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c -@@ -4545,7 +4545,7 @@ static int mvpp2_port_init(struct mvpp2_port *port) - struct mvpp2 *priv = port->priv; - struct mvpp2_txq_pcpu *txq_pcpu; - unsigned int thread; -- int queue, err; -+ int queue, err, val; - - /* Checks for hardware constraints */ - if (port->first_rxq + port->nrxqs > -@@ -4559,6 +4559,18 @@ static int mvpp2_port_init(struct mvpp2_port *port) - mvpp2_egress_disable(port); - mvpp2_port_disable(port); - -+ if (mvpp2_is_xlg(port->phy_interface)) { -+ val = readl(port->base + MVPP22_XLG_CTRL0_REG); -+ val &= ~MVPP22_XLG_CTRL0_FORCE_LINK_PASS; -+ val |= MVPP22_XLG_CTRL0_FORCE_LINK_DOWN; -+ writel(val, port->base + MVPP22_XLG_CTRL0_REG); -+ } else { -+ val = readl(port->base + MVPP2_GMAC_AUTONEG_CONFIG); -+ val &= ~MVPP2_GMAC_FORCE_LINK_PASS; -+ val |= MVPP2_GMAC_FORCE_LINK_DOWN; -+ writel(val, port->base + MVPP2_GMAC_AUTONEG_CONFIG); -+ } -+ - port->tx_time_coal = MVPP2_TXDONE_COAL_USEC; - - port->txqs = devm_kcalloc(dev, port->ntxqs, sizeof(*port->txqs), -diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c -index 6d55e3d0b7ea2..54e9f6dc24ea0 100644 ---- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c -+++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c -@@ -725,8 +725,10 @@ static int cgx_lmac_init(struct cgx *cgx) - if (!lmac) - return -ENOMEM; - lmac->name = kcalloc(1, sizeof("cgx_fwi_xxx_yyy"), GFP_KERNEL); -- if (!lmac->name) -- return -ENOMEM; -+ if (!lmac->name) { -+ err = -ENOMEM; -+ goto err_lmac_free; -+ } - sprintf(lmac->name, "cgx_fwi_%d_%d", cgx->cgx_id, i); - lmac->lmac_id = i; - lmac->cgx = cgx; -@@ -737,7 +739,7 @@ static int cgx_lmac_init(struct cgx *cgx) - CGX_LMAC_FWI + i * 9), - cgx_fwi_event_handler, 0, lmac->name, lmac); - if (err) -- return err; -+ goto err_irq; - - /* Enable interrupt */ - cgx_write(cgx, lmac->lmac_id, CGXX_CMRX_INT_ENA_W1S, -@@ -748,6 +750,12 @@ static int cgx_lmac_init(struct cgx *cgx) - } - - return cgx_lmac_verify_fwi_version(cgx); -+ -+err_irq: -+ kfree(lmac->name); -+err_lmac_free: -+ kfree(lmac); -+ return err; - } - - static int cgx_lmac_exit(struct cgx *cgx) -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c -index 8cd529556b214..01089c2283d7f 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c -@@ -976,6 +976,22 @@ static int mlx5e_get_link_ksettings(struct net_device *netdev, - return mlx5e_ethtool_get_link_ksettings(priv, link_ksettings); - } - -+static int mlx5e_speed_validate(struct net_device *netdev, bool ext, -+ const unsigned long link_modes, u8 autoneg) -+{ -+ /* Extended link-mode has no speed limitations. */ -+ if (ext) -+ return 0; -+ -+ if ((link_modes & MLX5E_PROT_MASK(MLX5E_56GBASE_R4)) && -+ autoneg != AUTONEG_ENABLE) { -+ netdev_err(netdev, "%s: 56G link speed requires autoneg enabled\n", -+ __func__); -+ return -EINVAL; -+ } -+ return 0; -+} -+ - static u32 mlx5e_ethtool2ptys_adver_link(const unsigned long *link_modes) - { - u32 i, ptys_modes = 0; -@@ -1068,13 +1084,9 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, - link_modes = autoneg == AUTONEG_ENABLE ? ethtool2ptys_adver_func(adver) : - mlx5e_port_speed2linkmodes(mdev, speed, !ext); - -- if ((link_modes & MLX5E_PROT_MASK(MLX5E_56GBASE_R4)) && -- autoneg != AUTONEG_ENABLE) { -- netdev_err(priv->netdev, "%s: 56G link speed requires autoneg enabled\n", -- __func__); -- err = -EINVAL; -+ err = mlx5e_speed_validate(priv->netdev, ext, link_modes, autoneg); -+ if (err) - goto out; -- } - - link_modes = link_modes & eproto.cap; - if (!link_modes) { -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c -index 713dc210f710c..c4ac7a9968d16 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c -@@ -927,6 +927,7 @@ static int mlx5e_create_ttc_table_groups(struct mlx5e_ttc_table *ttc, - in = kvzalloc(inlen, GFP_KERNEL); - if (!in) { - kfree(ft->g); -+ ft->g = NULL; - return -ENOMEM; - } - -@@ -1067,6 +1068,7 @@ static int mlx5e_create_inner_ttc_table_groups(struct mlx5e_ttc_table *ttc) - in = kvzalloc(inlen, GFP_KERNEL); - if (!in) { - kfree(ft->g); -+ ft->g = NULL; - return -ENOMEM; - } - -@@ -1346,6 +1348,7 @@ err_destroy_groups: - ft->g[ft->num_groups] = NULL; - mlx5e_destroy_groups(ft); - kvfree(in); -+ kfree(ft->g); - - return err; - } -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c -index 0fc7de4aa572f..8e0dddc6383f0 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c -@@ -116,7 +116,7 @@ free: - static void mlx5_rdma_del_roce_addr(struct mlx5_core_dev *dev) - { - mlx5_core_roce_gid_set(dev, 0, 0, 0, -- NULL, NULL, false, 0, 0); -+ NULL, NULL, false, 0, 1); - } - - static void mlx5_rdma_make_default_gid(struct mlx5_core_dev *dev, union ib_gid *gid) -diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c -index 0937fc2a928ed..23c9394cd5d22 100644 ---- a/drivers/net/ethernet/natsemi/macsonic.c -+++ b/drivers/net/ethernet/natsemi/macsonic.c -@@ -540,10 +540,14 @@ static int mac_sonic_platform_probe(struct platform_device *pdev) - - err = register_netdev(dev); - if (err) -- goto out; -+ goto undo_probe; - - return 0; - -+undo_probe: -+ dma_free_coherent(lp->device, -+ SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode), -+ lp->descriptors, lp->descriptors_laddr); - out: - free_netdev(dev); - -@@ -618,12 +622,16 @@ static int mac_sonic_nubus_probe(struct nubus_board *board) - - err = register_netdev(ndev); - if (err) -- goto out; -+ goto undo_probe; - - nubus_set_drvdata(board, ndev); - - return 0; - -+undo_probe: -+ dma_free_coherent(lp->device, -+ SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode), -+ lp->descriptors, lp->descriptors_laddr); - out: - free_netdev(ndev); - return err; -diff --git a/drivers/net/ethernet/natsemi/xtsonic.c b/drivers/net/ethernet/natsemi/xtsonic.c -index e1b886e87a762..44171d7bb434c 100644 ---- a/drivers/net/ethernet/natsemi/xtsonic.c -+++ b/drivers/net/ethernet/natsemi/xtsonic.c -@@ -265,11 +265,14 @@ int xtsonic_probe(struct platform_device *pdev) - sonic_msg_init(dev); - - if ((err = register_netdev(dev))) -- goto out1; -+ goto undo_probe1; - - return 0; - --out1: -+undo_probe1: -+ dma_free_coherent(lp->device, -+ SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode), -+ lp->descriptors, lp->descriptors_laddr); - release_region(dev->base_addr, SONIC_MEM_SIZE); - out: - free_netdev(dev); -diff --git a/drivers/net/ethernet/qlogic/Kconfig b/drivers/net/ethernet/qlogic/Kconfig -index 55a29ec766807..58eac2471d53a 100644 ---- a/drivers/net/ethernet/qlogic/Kconfig -+++ b/drivers/net/ethernet/qlogic/Kconfig -@@ -78,6 +78,7 @@ config QED - depends on PCI - select ZLIB_INFLATE - select CRC8 -+ select CRC32 - select NET_DEVLINK - ---help--- - This enables the support for ... -diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c -index e9e0867ec139d..c4c9cbdeb601e 100644 ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c -@@ -64,6 +64,7 @@ struct emac_variant { - * @variant: reference to the current board variant - * @regmap: regmap for using the syscon - * @internal_phy_powered: Does the internal PHY is enabled -+ * @use_internal_phy: Is the internal PHY selected for use - * @mux_handle: Internal pointer used by mdio-mux lib - */ - struct sunxi_priv_data { -@@ -74,6 +75,7 @@ struct sunxi_priv_data { - const struct emac_variant *variant; - struct regmap_field *regmap_field; - bool internal_phy_powered; -+ bool use_internal_phy; - void *mux_handle; - }; - -@@ -523,8 +525,11 @@ static const struct stmmac_dma_ops sun8i_dwmac_dma_ops = { - .dma_interrupt = sun8i_dwmac_dma_interrupt, - }; - -+static int sun8i_dwmac_power_internal_phy(struct stmmac_priv *priv); -+ - static int sun8i_dwmac_init(struct platform_device *pdev, void *priv) - { -+ struct net_device *ndev = platform_get_drvdata(pdev); - struct sunxi_priv_data *gmac = priv; - int ret; - -@@ -538,13 +543,25 @@ static int sun8i_dwmac_init(struct platform_device *pdev, void *priv) - - ret = clk_prepare_enable(gmac->tx_clk); - if (ret) { -- if (gmac->regulator) -- regulator_disable(gmac->regulator); - dev_err(&pdev->dev, "Could not enable AHB clock\n"); -- return ret; -+ goto err_disable_regulator; -+ } -+ -+ if (gmac->use_internal_phy) { -+ ret = sun8i_dwmac_power_internal_phy(netdev_priv(ndev)); -+ if (ret) -+ goto err_disable_clk; - } - - return 0; -+ -+err_disable_clk: -+ clk_disable_unprepare(gmac->tx_clk); -+err_disable_regulator: -+ if (gmac->regulator) -+ regulator_disable(gmac->regulator); -+ -+ return ret; - } - - static void sun8i_dwmac_core_init(struct mac_device_info *hw, -@@ -815,7 +832,6 @@ static int mdio_mux_syscon_switch_fn(int current_child, int desired_child, - struct sunxi_priv_data *gmac = priv->plat->bsp_priv; - u32 reg, val; - int ret = 0; -- bool need_power_ephy = false; - - if (current_child ^ desired_child) { - regmap_field_read(gmac->regmap_field, ®); -@@ -823,13 +839,12 @@ static int mdio_mux_syscon_switch_fn(int current_child, int desired_child, - case DWMAC_SUN8I_MDIO_MUX_INTERNAL_ID: - dev_info(priv->device, "Switch mux to internal PHY"); - val = (reg & ~H3_EPHY_MUX_MASK) | H3_EPHY_SELECT; -- -- need_power_ephy = true; -+ gmac->use_internal_phy = true; - break; - case DWMAC_SUN8I_MDIO_MUX_EXTERNAL_ID: - dev_info(priv->device, "Switch mux to external PHY"); - val = (reg & ~H3_EPHY_MUX_MASK) | H3_EPHY_SHUTDOWN; -- need_power_ephy = false; -+ gmac->use_internal_phy = false; - break; - default: - dev_err(priv->device, "Invalid child ID %x\n", -@@ -837,7 +852,7 @@ static int mdio_mux_syscon_switch_fn(int current_child, int desired_child, - return -EINVAL; - } - regmap_field_write(gmac->regmap_field, val); -- if (need_power_ephy) { -+ if (gmac->use_internal_phy) { - ret = sun8i_dwmac_power_internal_phy(priv); - if (ret) - return ret; -@@ -988,17 +1003,12 @@ static void sun8i_dwmac_exit(struct platform_device *pdev, void *priv) - struct sunxi_priv_data *gmac = priv; - - if (gmac->variant->soc_has_internal_phy) { -- /* sun8i_dwmac_exit could be called with mdiomux uninit */ -- if (gmac->mux_handle) -- mdio_mux_uninit(gmac->mux_handle); - if (gmac->internal_phy_powered) - sun8i_dwmac_unpower_internal_phy(gmac); - } - - sun8i_dwmac_unset_syscon(gmac); - -- reset_control_put(gmac->rst_ephy); -- - clk_disable_unprepare(gmac->tx_clk); - - if (gmac->regulator) -@@ -1227,12 +1237,32 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) - - return ret; - dwmac_mux: -+ reset_control_put(gmac->rst_ephy); -+ clk_put(gmac->ephy_clk); - sun8i_dwmac_unset_syscon(gmac); - dwmac_exit: - stmmac_pltfr_remove(pdev); - return ret; - } - -+static int sun8i_dwmac_remove(struct platform_device *pdev) -+{ -+ struct net_device *ndev = platform_get_drvdata(pdev); -+ struct stmmac_priv *priv = netdev_priv(ndev); -+ struct sunxi_priv_data *gmac = priv->plat->bsp_priv; -+ -+ if (gmac->variant->soc_has_internal_phy) { -+ mdio_mux_uninit(gmac->mux_handle); -+ sun8i_dwmac_unpower_internal_phy(gmac); -+ reset_control_put(gmac->rst_ephy); -+ clk_put(gmac->ephy_clk); -+ } -+ -+ stmmac_pltfr_remove(pdev); -+ -+ return 0; -+} -+ - static const struct of_device_id sun8i_dwmac_match[] = { - { .compatible = "allwinner,sun8i-h3-emac", - .data = &emac_variant_h3 }, -@@ -1252,7 +1282,7 @@ MODULE_DEVICE_TABLE(of, sun8i_dwmac_match); - - static struct platform_driver sun8i_dwmac_driver = { - .probe = sun8i_dwmac_probe, -- .remove = stmmac_pltfr_remove, -+ .remove = sun8i_dwmac_remove, - .driver = { - .name = "dwmac-sun8i", - .pm = &stmmac_pltfr_pm_ops, -diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c -index d407489cec904..cbe7f35eac982 100644 ---- a/drivers/net/usb/cdc_ncm.c -+++ b/drivers/net/usb/cdc_ncm.c -@@ -1126,7 +1126,10 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign) - * accordingly. Otherwise, we should check here. - */ - if (ctx->drvflags & CDC_NCM_FLAG_NDP_TO_END) -- delayed_ndp_size = ALIGN(ctx->max_ndp_size, ctx->tx_ndp_modulus); -+ delayed_ndp_size = ctx->max_ndp_size + -+ max_t(u32, -+ ctx->tx_ndp_modulus, -+ ctx->tx_modulus + ctx->tx_remainder) - 1; - else - delayed_ndp_size = 0; - -@@ -1307,7 +1310,8 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign) - if (!(dev->driver_info->flags & FLAG_SEND_ZLP) && - skb_out->len > ctx->min_tx_pkt) { - padding_count = ctx->tx_curr_size - skb_out->len; -- skb_put_zero(skb_out, padding_count); -+ if (!WARN_ON(padding_count > ctx->tx_curr_size)) -+ skb_put_zero(skb_out, padding_count); - } else if (skb_out->len < ctx->tx_curr_size && - (skb_out->len % dev->maxpacket) == 0) { - skb_put_u8(skb_out, 0); /* force short packet */ -diff --git a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig -index 058d77d2e693d..0d6e1829e0ac9 100644 ---- a/drivers/net/wan/Kconfig -+++ b/drivers/net/wan/Kconfig -@@ -282,6 +282,7 @@ config SLIC_DS26522 - tristate "Slic Maxim ds26522 card support" - depends on SPI - depends on FSL_SOC || ARCH_MXC || ARCH_LAYERSCAPE || COMPILE_TEST -+ select BITREVERSE - help - This module initializes and configures the slic maxim card - in T1 or E1 mode. -diff --git a/drivers/net/wireless/ath/wil6210/Kconfig b/drivers/net/wireless/ath/wil6210/Kconfig -index 0d1a8dab30ed4..32e1c036f3ac9 100644 ---- a/drivers/net/wireless/ath/wil6210/Kconfig -+++ b/drivers/net/wireless/ath/wil6210/Kconfig -@@ -2,6 +2,7 @@ - config WIL6210 - tristate "Wilocity 60g WiFi card wil6210 support" - select WANT_DEV_COREDUMP -+ select CRC32 - depends on CFG80211 - depends on PCI - default n -diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c -index f11e4bfbc91be..a47f87b8373df 100644 ---- a/drivers/regulator/qcom-rpmh-regulator.c -+++ b/drivers/regulator/qcom-rpmh-regulator.c -@@ -726,7 +726,7 @@ static const struct rpmh_vreg_hw_data pmic5_ftsmps510 = { - static const struct rpmh_vreg_hw_data pmic5_hfsmps515 = { - .regulator_type = VRM, - .ops = &rpmh_regulator_vrm_ops, -- .voltage_range = REGULATOR_LINEAR_RANGE(2800000, 0, 4, 1600), -+ .voltage_range = REGULATOR_LINEAR_RANGE(2800000, 0, 4, 16000), - .n_voltages = 5, - .pmic_mode_map = pmic_mode_map_pmic5_smps, - .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, -diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c -index a1c23e998f977..8dee16aca421f 100644 ---- a/drivers/s390/net/qeth_l3_main.c -+++ b/drivers/s390/net/qeth_l3_main.c -@@ -2114,7 +2114,7 @@ static netdev_features_t qeth_l3_osa_features_check(struct sk_buff *skb, - struct net_device *dev, - netdev_features_t features) - { -- if (qeth_get_ip_version(skb) != 4) -+ if (vlan_get_protocol(skb) != htons(ETH_P_IP)) - features &= ~NETIF_F_HW_VLAN_CTAG_TX; - return qeth_features_check(skb, dev, features); - } -diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c -index ed20ad2950885..77ddf23b65d65 100644 ---- a/drivers/spi/spi-stm32.c -+++ b/drivers/spi/spi-stm32.c -@@ -494,9 +494,9 @@ static u32 stm32h7_spi_prepare_fthlv(struct stm32_spi *spi, u32 xfer_len) - - /* align packet size with data registers access */ - if (spi->cur_bpw > 8) -- fthlv -= (fthlv % 2); /* multiple of 2 */ -+ fthlv += (fthlv % 2) ? 1 : 0; - else -- fthlv -= (fthlv % 4); /* multiple of 4 */ -+ fthlv += (fthlv % 4) ? (4 - (fthlv % 4)) : 0; - - if (!fthlv) - fthlv = 1; -diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c -index 58c7d66060f7e..dd12777b9a788 100644 ---- a/drivers/staging/exfat/exfat_super.c -+++ b/drivers/staging/exfat/exfat_super.c -@@ -59,7 +59,7 @@ static void exfat_write_super(struct super_block *sb); - /* Convert a FAT time/date pair to a UNIX date (seconds since 1 1 70). */ - static void exfat_time_fat2unix(struct timespec64 *ts, struct date_time_t *tp) - { -- ts->tv_sec = mktime64(tp->Year + 1980, tp->Month + 1, tp->Day, -+ ts->tv_sec = mktime64(tp->Year + 1980, tp->Month, tp->Day, - tp->Hour, tp->Minute, tp->Second); - - ts->tv_nsec = tp->MilliSecond * NSEC_PER_MSEC; -diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c -index 3b31e83a92155..bc6ba41686fa3 100644 ---- a/drivers/vfio/vfio_iommu_type1.c -+++ b/drivers/vfio/vfio_iommu_type1.c -@@ -2303,6 +2303,24 @@ out_unlock: - return ret; - } - -+static int vfio_iommu_dma_avail_build_caps(struct vfio_iommu *iommu, -+ struct vfio_info_cap *caps) -+{ -+ struct vfio_iommu_type1_info_dma_avail cap_dma_avail; -+ int ret; -+ -+ mutex_lock(&iommu->lock); -+ cap_dma_avail.header.id = VFIO_IOMMU_TYPE1_INFO_DMA_AVAIL; -+ cap_dma_avail.header.version = 1; -+ -+ cap_dma_avail.avail = iommu->dma_avail; -+ -+ ret = vfio_info_add_capability(caps, &cap_dma_avail.header, -+ sizeof(cap_dma_avail)); -+ mutex_unlock(&iommu->lock); -+ return ret; -+} -+ - static long vfio_iommu_type1_ioctl(void *iommu_data, - unsigned int cmd, unsigned long arg) - { -@@ -2349,6 +2367,10 @@ static long vfio_iommu_type1_ioctl(void *iommu_data, - info.iova_pgsizes = vfio_pgsize_bitmap(iommu); - - ret = vfio_iommu_iova_build_caps(iommu, &caps); -+ -+ if (!ret) -+ ret = vfio_iommu_dma_avail_build_caps(iommu, &caps); -+ - if (ret) - return ret; - -diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h -index e5e2425875953..130f16cc0b86d 100644 ---- a/include/asm-generic/vmlinux.lds.h -+++ b/include/asm-generic/vmlinux.lds.h -@@ -520,7 +520,10 @@ - */ - #define TEXT_TEXT \ - ALIGN_FUNCTION(); \ -- *(.text.hot TEXT_MAIN .text.fixup .text.unlikely) \ -+ *(.text.hot .text.hot.*) \ -+ *(TEXT_MAIN .text.fixup) \ -+ *(.text.unlikely .text.unlikely.*) \ -+ *(.text.unknown .text.unknown.*) \ - *(.text..refcount) \ - *(.ref.text) \ - MEM_KEEP(init.text*) \ -diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h -index 9e843a147ead0..cabc93118f9c8 100644 ---- a/include/uapi/linux/vfio.h -+++ b/include/uapi/linux/vfio.h -@@ -748,6 +748,21 @@ struct vfio_iommu_type1_info_cap_iova_range { - struct vfio_iova_range iova_ranges[]; - }; - -+/* -+ * The DMA available capability allows to report the current number of -+ * simultaneously outstanding DMA mappings that are allowed. -+ * -+ * The structure below defines version 1 of this capability. -+ * -+ * avail: specifies the current number of outstanding DMA mappings allowed. -+ */ -+#define VFIO_IOMMU_TYPE1_INFO_DMA_AVAIL 3 -+ -+struct vfio_iommu_type1_info_dma_avail { -+ struct vfio_info_cap_header header; -+ __u32 avail; -+}; -+ - #define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) - - /** -diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c -index d4bcfd8f95bf6..3f47abf9ef4a6 100644 ---- a/net/8021q/vlan.c -+++ b/net/8021q/vlan.c -@@ -280,7 +280,8 @@ static int register_vlan_device(struct net_device *real_dev, u16 vlan_id) - return 0; - - out_free_newdev: -- if (new_dev->reg_state == NETREG_UNINITIALIZED) -+ if (new_dev->reg_state == NETREG_UNINITIALIZED || -+ new_dev->reg_state == NETREG_UNREGISTERED) - free_netdev(new_dev); - return err; - } -diff --git a/net/core/skbuff.c b/net/core/skbuff.c -index a0486dcf5425b..49d923c227a21 100644 ---- a/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -2017,6 +2017,12 @@ int pskb_trim_rcsum_slow(struct sk_buff *skb, unsigned int len) - skb->csum = csum_block_sub(skb->csum, - skb_checksum(skb, len, delta, 0), - len); -+ } else if (skb->ip_summed == CHECKSUM_PARTIAL) { -+ int hdlen = (len > skb_headlen(skb)) ? skb_headlen(skb) : len; -+ int offset = skb_checksum_start_offset(skb) + skb->csum_offset; -+ -+ if (offset + sizeof(__sum16) > hdlen) -+ return -EINVAL; - } - return __pskb_trim(skb, len); - } -diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c -index 079dcf9f0c56d..7a394479dd56c 100644 ---- a/net/ipv4/ip_output.c -+++ b/net/ipv4/ip_output.c -@@ -303,7 +303,7 @@ static int __ip_finish_output(struct net *net, struct sock *sk, struct sk_buff * - if (skb_is_gso(skb)) - return ip_finish_output_gso(net, sk, skb, mtu); - -- if (skb->len > mtu || (IPCB(skb)->flags & IPSKB_FRAG_PMTU)) -+ if (skb->len > mtu || IPCB(skb)->frag_max_size) - return ip_fragment(net, sk, skb, mtu, ip_finish_output2); - - return ip_finish_output2(net, sk, skb); -diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c -index f61c5a0b502a8..ca525cf681a4e 100644 ---- a/net/ipv4/ip_tunnel.c -+++ b/net/ipv4/ip_tunnel.c -@@ -765,8 +765,11 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, - goto tx_error; - } - -- if (tnl_update_pmtu(dev, skb, rt, tnl_params->frag_off, inner_iph, -- 0, 0, false)) { -+ df = tnl_params->frag_off; -+ if (skb->protocol == htons(ETH_P_IP) && !tunnel->ignore_df) -+ df |= (inner_iph->frag_off & htons(IP_DF)); -+ -+ if (tnl_update_pmtu(dev, skb, rt, df, inner_iph, 0, 0, false)) { - ip_rt_put(rt); - goto tx_error; - } -@@ -794,10 +797,6 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, - ttl = ip4_dst_hoplimit(&rt->dst); - } - -- df = tnl_params->frag_off; -- if (skb->protocol == htons(ETH_P_IP) && !tunnel->ignore_df) -- df |= (inner_iph->frag_off&htons(IP_DF)); -- - max_headroom = LL_RESERVED_SPACE(rt->dst.dev) + sizeof(struct iphdr) - + rt->dst.header_len + ip_encap_hlen(&tunnel->encap); - if (max_headroom > dev->needed_headroom) -diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c -index ea32b113089d3..c2b7d43d92b0e 100644 ---- a/net/ipv4/nexthop.c -+++ b/net/ipv4/nexthop.c -@@ -1157,8 +1157,10 @@ static struct nexthop *nexthop_create_group(struct net *net, - return nh; - - out_no_nh: -- for (; i >= 0; --i) -+ for (i--; i >= 0; --i) { -+ list_del(&nhg->nh_entries[i].nh_list); - nexthop_put(nhg->nh_entries[i].nh); -+ } - - kfree(nhg->spare); - kfree(nhg); -diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c -index 0646fce31b67a..906ac5e6d96cd 100644 ---- a/net/ipv6/ip6_fib.c -+++ b/net/ipv6/ip6_fib.c -@@ -973,6 +973,8 @@ static void fib6_purge_rt(struct fib6_info *rt, struct fib6_node *fn, - { - struct fib6_table *table = rt->fib6_table; - -+ /* Flush all cached dst in exception table */ -+ rt6_flush_exceptions(rt); - fib6_drop_pcpu_from(rt, table); - - if (rt->nh && !list_empty(&rt->nh_list)) -@@ -1839,9 +1841,6 @@ static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn, - net->ipv6.rt6_stats->fib_rt_entries--; - net->ipv6.rt6_stats->fib_discarded_routes++; - -- /* Flush all cached dst in exception table */ -- rt6_flush_exceptions(rt); -- - /* Reset round-robin state, if necessary */ - if (rcu_access_pointer(fn->rr_ptr) == rt) - fn->rr_ptr = NULL; -diff --git a/tools/bpf/bpftool/net.c b/tools/bpf/bpftool/net.c -index bb311ccc6c487..c6787a1daa481 100644 ---- a/tools/bpf/bpftool/net.c -+++ b/tools/bpf/bpftool/net.c -@@ -9,7 +9,6 @@ - #include - #include - #include --#include - #include - #include - #include -diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh -index 71a62e7e35b1c..3429767cadcdd 100755 ---- a/tools/testing/selftests/net/pmtu.sh -+++ b/tools/testing/selftests/net/pmtu.sh -@@ -119,7 +119,15 @@ - # - list_flush_ipv6_exception - # Using the same topology as in pmtu_ipv6, create exceptions, and check - # they are shown when listing exception caches, gone after flushing them -- -+# -+# - pmtu_ipv4_route_change -+# Use the same topology as in pmtu_ipv4, but issue a route replacement -+# command and delete the corresponding device afterward. This tests for -+# proper cleanup of the PMTU exceptions by the route replacement path. -+# Device unregistration should complete successfully -+# -+# - pmtu_ipv6_route_change -+# Same as above but with IPv6 - - # Kselftest framework requirement - SKIP code is 4. - ksft_skip=4 -@@ -161,7 +169,9 @@ tests=" - cleanup_ipv4_exception ipv4: cleanup of cached exceptions 1 - cleanup_ipv6_exception ipv6: cleanup of cached exceptions 1 - list_flush_ipv4_exception ipv4: list and flush cached exceptions 1 -- list_flush_ipv6_exception ipv6: list and flush cached exceptions 1" -+ list_flush_ipv6_exception ipv6: list and flush cached exceptions 1 -+ pmtu_ipv4_route_change ipv4: PMTU exception w/route replace 1 -+ pmtu_ipv6_route_change ipv6: PMTU exception w/route replace 1" - - NS_A="ns-A" - NS_B="ns-B" -@@ -1316,6 +1326,63 @@ test_list_flush_ipv6_exception() { - return ${fail} - } - -+test_pmtu_ipvX_route_change() { -+ family=${1} -+ -+ setup namespaces routing || return 2 -+ trace "${ns_a}" veth_A-R1 "${ns_r1}" veth_R1-A \ -+ "${ns_r1}" veth_R1-B "${ns_b}" veth_B-R1 \ -+ "${ns_a}" veth_A-R2 "${ns_r2}" veth_R2-A \ -+ "${ns_r2}" veth_R2-B "${ns_b}" veth_B-R2 -+ -+ if [ ${family} -eq 4 ]; then -+ ping=ping -+ dst1="${prefix4}.${b_r1}.1" -+ dst2="${prefix4}.${b_r2}.1" -+ gw="${prefix4}.${a_r1}.2" -+ else -+ ping=${ping6} -+ dst1="${prefix6}:${b_r1}::1" -+ dst2="${prefix6}:${b_r2}::1" -+ gw="${prefix6}:${a_r1}::2" -+ fi -+ -+ # Set up initial MTU values -+ mtu "${ns_a}" veth_A-R1 2000 -+ mtu "${ns_r1}" veth_R1-A 2000 -+ mtu "${ns_r1}" veth_R1-B 1400 -+ mtu "${ns_b}" veth_B-R1 1400 -+ -+ mtu "${ns_a}" veth_A-R2 2000 -+ mtu "${ns_r2}" veth_R2-A 2000 -+ mtu "${ns_r2}" veth_R2-B 1500 -+ mtu "${ns_b}" veth_B-R2 1500 -+ -+ # Create route exceptions -+ run_cmd ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1800 ${dst1} -+ run_cmd ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1800 ${dst2} -+ -+ # Check that exceptions have been created with the correct PMTU -+ pmtu_1="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst1})" -+ check_pmtu_value "1400" "${pmtu_1}" "exceeding MTU" || return 1 -+ pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})" -+ check_pmtu_value "1500" "${pmtu_2}" "exceeding MTU" || return 1 -+ -+ # Replace the route from A to R1 -+ run_cmd ${ns_a} ip route change default via ${gw} -+ -+ # Delete the device in A -+ run_cmd ${ns_a} ip link del "veth_A-R1" -+} -+ -+test_pmtu_ipv4_route_change() { -+ test_pmtu_ipvX_route_change 4 -+} -+ -+test_pmtu_ipv6_route_change() { -+ test_pmtu_ipvX_route_change 6 -+} -+ - usage() { - echo - echo "$0 [OPTIONS] [TEST]..." diff --git a/patch/kernel/odroidxu4-current/patch-5.4.90-91.patch b/patch/kernel/odroidxu4-current/patch-5.4.90-91.patch deleted file mode 100644 index 7e767856f5..0000000000 --- a/patch/kernel/odroidxu4-current/patch-5.4.90-91.patch +++ /dev/null @@ -1,2316 +0,0 @@ -diff --git a/Makefile b/Makefile -index 5c9d680b7ce51..a5edbd4f34145 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - VERSION = 5 - PATCHLEVEL = 4 --SUBLEVEL = 90 -+SUBLEVEL = 91 - EXTRAVERSION = - NAME = Kleptomaniac Octopus - -@@ -480,7 +480,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE - KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \ - -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \ - -Werror=implicit-function-declaration -Werror=implicit-int \ -- -Wno-format-security \ -+ -Werror=return-type -Wno-format-security \ - -std=gnu89 - KBUILD_CPPFLAGS := -D__KERNEL__ - KBUILD_AFLAGS_KERNEL := -diff --git a/arch/arc/Makefile b/arch/arc/Makefile -index f1c44cccf8d6c..6f05e509889f6 100644 ---- a/arch/arc/Makefile -+++ b/arch/arc/Makefile -@@ -90,16 +90,22 @@ libs-y += arch/arc/lib/ $(LIBGCC) - - boot := arch/arc/boot - --#default target for make without any arguments. --KBUILD_IMAGE := $(boot)/bootpImage -- --all: bootpImage --bootpImage: vmlinux -- --boot_targets += uImage uImage.bin uImage.gz -+boot_targets := uImage.bin uImage.gz uImage.lzma - -+PHONY += $(boot_targets) - $(boot_targets): vmlinux - $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ - -+uimage-default-y := uImage.bin -+uimage-default-$(CONFIG_KERNEL_GZIP) := uImage.gz -+uimage-default-$(CONFIG_KERNEL_LZMA) := uImage.lzma -+ -+PHONY += uImage -+uImage: $(uimage-default-y) -+ @ln -sf $< $(boot)/uImage -+ @$(kecho) ' Image $(boot)/uImage is ready' -+ -+CLEAN_FILES += $(boot)/uImage -+ - archclean: - $(Q)$(MAKE) $(clean)=$(boot) -diff --git a/arch/arc/boot/Makefile b/arch/arc/boot/Makefile -index 538b92f4dd253..3b1f8a69a89ef 100644 ---- a/arch/arc/boot/Makefile -+++ b/arch/arc/boot/Makefile -@@ -1,5 +1,5 @@ - # SPDX-License-Identifier: GPL-2.0 --targets := vmlinux.bin vmlinux.bin.gz uImage -+targets := vmlinux.bin vmlinux.bin.gz - - # uImage build relies on mkimage being availble on your host for ARC target - # You will need to build u-boot for ARC, rename mkimage to arc-elf32-mkimage -@@ -13,11 +13,6 @@ LINUX_START_TEXT = $$(readelf -h vmlinux | \ - UIMAGE_LOADADDR = $(CONFIG_LINUX_LINK_BASE) - UIMAGE_ENTRYADDR = $(LINUX_START_TEXT) - --suffix-y := bin --suffix-$(CONFIG_KERNEL_GZIP) := gz --suffix-$(CONFIG_KERNEL_LZMA) := lzma -- --targets += uImage - targets += uImage.bin - targets += uImage.gz - targets += uImage.lzma -@@ -42,7 +37,3 @@ $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE - - $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE - $(call if_changed,uimage,lzma) -- --$(obj)/uImage: $(obj)/uImage.$(suffix-y) -- @ln -sf $(notdir $<) $@ -- @echo ' Image $@ is ready' -diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h -index 0a32e8cfd074d..bcd1920ae75a3 100644 ---- a/arch/arc/include/asm/page.h -+++ b/arch/arc/include/asm/page.h -@@ -10,6 +10,7 @@ - #ifndef __ASSEMBLY__ - - #define clear_page(paddr) memset((paddr), 0, PAGE_SIZE) -+#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) - #define copy_page(to, from) memcpy((to), (from), PAGE_SIZE) - - struct vm_area_struct; -diff --git a/arch/arm/boot/dts/picoxcell-pc3x2.dtsi b/arch/arm/boot/dts/picoxcell-pc3x2.dtsi -index 5ae8607883395..3fcc86d7b735f 100644 ---- a/arch/arm/boot/dts/picoxcell-pc3x2.dtsi -+++ b/arch/arm/boot/dts/picoxcell-pc3x2.dtsi -@@ -45,18 +45,21 @@ - emac: gem@30000 { - compatible = "cadence,gem"; - reg = <0x30000 0x10000>; -+ interrupt-parent = <&vic0>; - interrupts = <31>; - }; - - dmac1: dmac@40000 { - compatible = "snps,dw-dmac"; - reg = <0x40000 0x10000>; -+ interrupt-parent = <&vic0>; - interrupts = <25>; - }; - - dmac2: dmac@50000 { - compatible = "snps,dw-dmac"; - reg = <0x50000 0x10000>; -+ interrupt-parent = <&vic0>; - interrupts = <26>; - }; - -@@ -234,6 +237,7 @@ - axi2pico@c0000000 { - compatible = "picochip,axi2pico-pc3x2"; - reg = <0xc0000000 0x10000>; -+ interrupt-parent = <&vic0>; - interrupts = <13 14 15 16 17 18 19 20 21>; - }; - }; -diff --git a/arch/mips/boot/compressed/decompress.c b/arch/mips/boot/compressed/decompress.c -index 88f5d637b1c49..a52e929381ea4 100644 ---- a/arch/mips/boot/compressed/decompress.c -+++ b/arch/mips/boot/compressed/decompress.c -@@ -13,6 +13,7 @@ - #include - - #include -+#include - - /* - * These two variables specify the free mem region -@@ -113,7 +114,7 @@ void decompress_kernel(unsigned long boot_heap_start) - dtb_size = fdt_totalsize((void *)&__appended_dtb); - - /* last four bytes is always image size in little endian */ -- image_size = le32_to_cpup((void *)&__image_end - 4); -+ image_size = get_unaligned_le32((void *)&__image_end - 4); - - /* copy dtb to where the booted kernel will expect it */ - memcpy((void *)VMLINUX_LOAD_ADDRESS_ULL + image_size, -diff --git a/arch/mips/kernel/relocate.c b/arch/mips/kernel/relocate.c -index 3d80a51256de6..dab8febb57419 100644 ---- a/arch/mips/kernel/relocate.c -+++ b/arch/mips/kernel/relocate.c -@@ -187,8 +187,14 @@ static int __init relocate_exception_table(long offset) - static inline __init unsigned long rotate_xor(unsigned long hash, - const void *area, size_t size) - { -- size_t i; -- unsigned long *ptr = (unsigned long *)area; -+ const typeof(hash) *ptr = PTR_ALIGN(area, sizeof(hash)); -+ size_t diff, i; -+ -+ diff = (void *)ptr - area; -+ if (unlikely(size < diff + sizeof(hash))) -+ return hash; -+ -+ size = ALIGN_DOWN(size - diff, sizeof(hash)); - - for (i = 0; i < size / sizeof(hash); i++) { - /* Rotate by odd number of bits and XOR. */ -diff --git a/arch/mips/lib/uncached.c b/arch/mips/lib/uncached.c -index 09d5deea747f2..f80a67c092b63 100644 ---- a/arch/mips/lib/uncached.c -+++ b/arch/mips/lib/uncached.c -@@ -37,10 +37,12 @@ - */ - unsigned long run_uncached(void *func) - { -- register long sp __asm__("$sp"); - register long ret __asm__("$2"); - long lfunc = (long)func, ufunc; - long usp; -+ long sp; -+ -+ __asm__("move %0, $sp" : "=r" (sp)); - - if (sp >= (long)CKSEG0 && sp < (long)CKSEG2) - usp = CKSEG1ADDR(sp); -diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c -index c4785a456dedc..504fd61592405 100644 ---- a/arch/mips/mm/c-r4k.c -+++ b/arch/mips/mm/c-r4k.c -@@ -1576,7 +1576,7 @@ static void __init loongson2_sc_init(void) - c->options |= MIPS_CPU_INCLUSIVE_CACHES; - } - --static void __init loongson3_sc_init(void) -+static void loongson3_sc_init(void) - { - struct cpuinfo_mips *c = ¤t_cpu_data; - unsigned int config2, lsize; -diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c -index dbdbfe5d84086..e67374268b42d 100644 ---- a/arch/mips/mm/sc-mips.c -+++ b/arch/mips/mm/sc-mips.c -@@ -147,7 +147,7 @@ static inline int mips_sc_is_activated(struct cpuinfo_mips *c) - return 1; - } - --static int __init mips_sc_probe_cm3(void) -+static int mips_sc_probe_cm3(void) - { - struct cpuinfo_mips *c = ¤t_cpu_data; - unsigned long cfg = read_gcr_l2_config(); -@@ -181,7 +181,7 @@ static int __init mips_sc_probe_cm3(void) - return 0; - } - --static inline int __init mips_sc_probe(void) -+static inline int mips_sc_probe(void) - { - struct cpuinfo_mips *c = ¤t_cpu_data; - unsigned int config1, config2; -diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c -index 5208ba49c89a9..2c87350c1fb09 100644 ---- a/arch/x86/hyperv/mmu.c -+++ b/arch/x86/hyperv/mmu.c -@@ -66,11 +66,17 @@ static void hyperv_flush_tlb_others(const struct cpumask *cpus, - if (!hv_hypercall_pg) - goto do_native; - -- if (cpumask_empty(cpus)) -- return; -- - local_irq_save(flags); - -+ /* -+ * Only check the mask _after_ interrupt has been disabled to avoid the -+ * mask changing under our feet. -+ */ -+ if (cpumask_empty(cpus)) { -+ local_irq_restore(flags); -+ return; -+ } -+ - flush_pcpu = (struct hv_tlb_flush **) - this_cpu_ptr(hyperv_pcpu_input_arg); - -diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c -index ba32adaeefdd0..7d19aae015aeb 100644 ---- a/block/bfq-iosched.c -+++ b/block/bfq-iosched.c -@@ -6320,13 +6320,13 @@ static unsigned int bfq_update_depths(struct bfq_data *bfqd, - * limit 'something'. - */ - /* no more than 50% of tags for async I/O */ -- bfqd->word_depths[0][0] = max((1U << bt->sb.shift) >> 1, 1U); -+ bfqd->word_depths[0][0] = max(bt->sb.depth >> 1, 1U); - /* - * no more than 75% of tags for sync writes (25% extra tags - * w.r.t. async I/O, to prevent async I/O from starving sync - * writes) - */ -- bfqd->word_depths[0][1] = max(((1U << bt->sb.shift) * 3) >> 2, 1U); -+ bfqd->word_depths[0][1] = max((bt->sb.depth * 3) >> 2, 1U); - - /* - * In-word depths in case some bfq_queue is being weight- -@@ -6336,9 +6336,9 @@ static unsigned int bfq_update_depths(struct bfq_data *bfqd, - * shortage. - */ - /* no more than ~18% of tags for async I/O */ -- bfqd->word_depths[1][0] = max(((1U << bt->sb.shift) * 3) >> 4, 1U); -+ bfqd->word_depths[1][0] = max((bt->sb.depth * 3) >> 4, 1U); - /* no more than ~37% of tags for sync writes (~20% extra tags) */ -- bfqd->word_depths[1][1] = max(((1U << bt->sb.shift) * 6) >> 4, 1U); -+ bfqd->word_depths[1][1] = max((bt->sb.depth * 6) >> 4, 1U); - - for (i = 0; i < 2; i++) - for (j = 0; j < 2; j++) -diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h -index afe6636f9ad39..1db2e1bb72ba6 100644 ---- a/drivers/acpi/internal.h -+++ b/drivers/acpi/internal.h -@@ -97,7 +97,7 @@ void acpi_scan_table_handler(u32 event, void *table, void *context); - extern struct list_head acpi_bus_id_list; - - struct acpi_device_bus_id { -- char bus_id[15]; -+ const char *bus_id; - unsigned int instance_no; - struct list_head node; - }; -diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c -index 2527938a30b54..6c8c9509e03d1 100644 ---- a/drivers/acpi/scan.c -+++ b/drivers/acpi/scan.c -@@ -487,6 +487,7 @@ static void acpi_device_del(struct acpi_device *device) - acpi_device_bus_id->instance_no--; - else { - list_del(&acpi_device_bus_id->node); -+ kfree_const(acpi_device_bus_id->bus_id); - kfree(acpi_device_bus_id); - } - break; -@@ -675,7 +676,14 @@ int acpi_device_add(struct acpi_device *device, - } - if (!found) { - acpi_device_bus_id = new_bus_id; -- strcpy(acpi_device_bus_id->bus_id, acpi_device_hid(device)); -+ acpi_device_bus_id->bus_id = -+ kstrdup_const(acpi_device_hid(device), GFP_KERNEL); -+ if (!acpi_device_bus_id->bus_id) { -+ pr_err(PREFIX "Memory allocation error for bus id\n"); -+ result = -ENOMEM; -+ goto err_free_new_bus_id; -+ } -+ - acpi_device_bus_id->instance_no = 0; - list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); - } -@@ -710,6 +718,11 @@ int acpi_device_add(struct acpi_device *device, - if (device->parent) - list_del(&device->node); - list_del(&device->wakeup_list); -+ -+ err_free_new_bus_id: -+ if (!found) -+ kfree(new_bus_id); -+ - mutex_unlock(&acpi_device_lock); - - err_detach: -diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c -index 29141bff4b572..3b3fc9a426e91 100644 ---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c -+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c -@@ -2057,11 +2057,11 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev) - if (adev->gmc.xgmi.num_physical_nodes > 1) - amdgpu_xgmi_remove_device(adev); - -- amdgpu_amdkfd_device_fini(adev); -- - amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE); - amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE); - -+ amdgpu_amdkfd_device_fini(adev); -+ - /* need to disable SMC first */ - for (i = 0; i < adev->num_ip_blocks; i++) { - if (!adev->ip_blocks[i].status.hw) -diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c -index bc14e9c0285a0..23edc1b8e43fa 100644 ---- a/drivers/gpu/drm/i915/display/intel_panel.c -+++ b/drivers/gpu/drm/i915/display/intel_panel.c -@@ -1603,20 +1603,21 @@ static int lpt_setup_backlight(struct intel_connector *connector, enum pipe unus - val = pch_get_backlight(connector); - else - val = lpt_get_backlight(connector); -- val = intel_panel_compute_brightness(connector, val); -- panel->backlight.level = clamp(val, panel->backlight.min, -- panel->backlight.max); - - if (cpu_mode) { - DRM_DEBUG_KMS("CPU backlight register was enabled, switching to PCH override\n"); - - /* Write converted CPU PWM value to PCH override register */ -- lpt_set_backlight(connector->base.state, panel->backlight.level); -+ lpt_set_backlight(connector->base.state, val); - I915_WRITE(BLC_PWM_PCH_CTL1, pch_ctl1 | BLM_PCH_OVERRIDE_ENABLE); - - I915_WRITE(BLC_PWM_CPU_CTL2, cpu_ctl2 & ~BLM_PWM_ENABLE); - } - -+ val = intel_panel_compute_brightness(connector, val); -+ panel->backlight.level = clamp(val, panel->backlight.min, -+ panel->backlight.max); -+ - return 0; - } - -diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c -index a71b22bdd95b5..7f329d8118a46 100644 ---- a/drivers/gpu/drm/i915/display/vlv_dsi.c -+++ b/drivers/gpu/drm/i915/display/vlv_dsi.c -@@ -797,10 +797,20 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder, - if (intel_dsi->gpio_panel) - gpiod_set_value_cansleep(intel_dsi->gpio_panel, 1); - intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_POWER_ON); -- intel_dsi_msleep(intel_dsi, intel_dsi->panel_on_delay); - -- /* Deassert reset */ -- intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET); -+ /* -+ * Give the panel time to power-on and then deassert its reset. -+ * Depending on the VBT MIPI sequences version the deassert-seq -+ * may contain the necessary delay, intel_dsi_msleep() will skip -+ * the delay in that case. If there is no deassert-seq, then an -+ * unconditional msleep is used to give the panel time to power-on. -+ */ -+ if (dev_priv->vbt.dsi.sequence[MIPI_SEQ_DEASSERT_RESET]) { -+ intel_dsi_msleep(intel_dsi, intel_dsi->panel_on_delay); -+ intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET); -+ } else { -+ msleep(intel_dsi->panel_on_delay); -+ } - - if (IS_GEMINILAKE(dev_priv)) { - glk_cold_boot = glk_dsi_enable_io(encoder); -diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c -index 108632a1f2438..8d9d86c76a4e9 100644 ---- a/drivers/gpu/drm/msm/msm_drv.c -+++ b/drivers/gpu/drm/msm/msm_drv.c -@@ -432,14 +432,14 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) - - drm_mode_config_init(ddev); - -- /* Bind all our sub-components: */ -- ret = component_bind_all(dev, ddev); -+ ret = msm_init_vram(ddev); - if (ret) - goto err_destroy_mdss; - -- ret = msm_init_vram(ddev); -+ /* Bind all our sub-components: */ -+ ret = component_bind_all(dev, ddev); - if (ret) -- goto err_msm_uninit; -+ goto err_destroy_mdss; - - if (!dev->dma_parms) { - dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms), -diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c -index c88ce77fe6763..df6f042fb605e 100644 ---- a/drivers/hwmon/pwm-fan.c -+++ b/drivers/hwmon/pwm-fan.c -@@ -330,8 +330,18 @@ static int pwm_fan_probe(struct platform_device *pdev) - - ctx->pwm_value = MAX_PWM; - -- /* Set duty cycle to maximum allowed and enable PWM output */ - pwm_init_state(ctx->pwm, &state); -+ /* -+ * __set_pwm assumes that MAX_PWM * (period - 1) fits into an unsigned -+ * long. Check this here to prevent the fan running at a too low -+ * frequency. -+ */ -+ if (state.period > ULONG_MAX / MAX_PWM + 1) { -+ dev_err(dev, "Configured period too big\n"); -+ return -EINVAL; -+ } -+ -+ /* Set duty cycle to maximum allowed and enable PWM output */ - state.duty_cycle = ctx->pwm->args.period - 1; - state.enabled = true; - -diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c -index a07665f7ef8ce..f1b4db80913f7 100644 ---- a/drivers/infiniband/core/restrack.c -+++ b/drivers/infiniband/core/restrack.c -@@ -234,6 +234,7 @@ static void rdma_restrack_add(struct rdma_restrack_entry *res) - } else { - ret = xa_alloc_cyclic(&rt->xa, &res->id, res, xa_limit_32b, - &rt->next_id, GFP_KERNEL); -+ ret = (ret < 0) ? ret : 0; - } - - if (!ret) -diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c -index 40c1a05c2445d..c9e583c05ef27 100644 ---- a/drivers/infiniband/hw/mlx5/main.c -+++ b/drivers/infiniband/hw/mlx5/main.c -@@ -6173,7 +6173,7 @@ static int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev) - - err = set_has_smi_cap(dev); - if (err) -- return err; -+ goto err_mp; - - if (!mlx5_core_mp_enabled(mdev)) { - for (i = 1; i <= dev->num_ports; i++) { -@@ -6626,7 +6626,7 @@ static int mlx5_ib_stage_bfrag_init(struct mlx5_ib_dev *dev) - - err = mlx5_alloc_bfreg(dev->mdev, &dev->fp_bfreg, false, true); - if (err) -- mlx5_free_bfreg(dev->mdev, &dev->fp_bfreg); -+ mlx5_free_bfreg(dev->mdev, &dev->bfreg); - - return err; - } -diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c -index e8267e5907722..55bd8873da466 100644 ---- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c -+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c -@@ -442,9 +442,9 @@ static void ocrdma_dealloc_ucontext_pd(struct ocrdma_ucontext *uctx) - pr_err("%s(%d) Freeing in use pdid=0x%x.\n", - __func__, dev->id, pd->id); - } -- kfree(uctx->cntxt_pd); - uctx->cntxt_pd = NULL; - _ocrdma_dealloc_pd(dev, pd); -+ kfree(pd); - } - - static struct ocrdma_pd *ocrdma_get_ucontext_pd(struct ocrdma_ucontext *uctx) -diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c -index 556b8e44a51c4..a102a5d8769f2 100644 ---- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c -+++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c -@@ -214,6 +214,7 @@ find_free_vf_and_create_qp_grp(struct usnic_ib_dev *us_ibdev, - - } - usnic_uiom_free_dev_list(dev_list); -+ dev_list = NULL; - } - - /* Try to find resources on an unused vf */ -@@ -239,6 +240,8 @@ find_free_vf_and_create_qp_grp(struct usnic_ib_dev *us_ibdev, - qp_grp_check: - if (IS_ERR_OR_NULL(qp_grp)) { - usnic_err("Failed to allocate qp_grp\n"); -+ if (usnic_ib_share_vf) -+ usnic_uiom_free_dev_list(dev_list); - return ERR_PTR(qp_grp ? PTR_ERR(qp_grp) : -ENOMEM); - } - return qp_grp; -diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c -index ec69a99b99bab..a3739f626629c 100644 ---- a/drivers/iommu/intel-svm.c -+++ b/drivers/iommu/intel-svm.c -@@ -99,8 +99,10 @@ int intel_svm_finish_prq(struct intel_iommu *iommu) - return 0; - } - --static void intel_flush_svm_range_dev (struct intel_svm *svm, struct intel_svm_dev *sdev, -- unsigned long address, unsigned long pages, int ih) -+static void __flush_svm_range_dev(struct intel_svm *svm, -+ struct intel_svm_dev *sdev, -+ unsigned long address, -+ unsigned long pages, int ih) - { - struct qi_desc desc; - -@@ -151,6 +153,22 @@ static void intel_flush_svm_range_dev (struct intel_svm *svm, struct intel_svm_d - } - } - -+static void intel_flush_svm_range_dev(struct intel_svm *svm, -+ struct intel_svm_dev *sdev, -+ unsigned long address, -+ unsigned long pages, int ih) -+{ -+ unsigned long shift = ilog2(__roundup_pow_of_two(pages)); -+ unsigned long align = (1ULL << (VTD_PAGE_SHIFT + shift)); -+ unsigned long start = ALIGN_DOWN(address, align); -+ unsigned long end = ALIGN(address + (pages << VTD_PAGE_SHIFT), align); -+ -+ while (start < end) { -+ __flush_svm_range_dev(svm, sdev, start, align >> VTD_PAGE_SHIFT, ih); -+ start += align; -+ } -+} -+ - static void intel_flush_svm_range(struct intel_svm *svm, unsigned long address, - unsigned long pages, int ih) - { -diff --git a/drivers/isdn/mISDN/Kconfig b/drivers/isdn/mISDN/Kconfig -index 26cf0ac9c4ad0..c9a53c2224728 100644 ---- a/drivers/isdn/mISDN/Kconfig -+++ b/drivers/isdn/mISDN/Kconfig -@@ -13,6 +13,7 @@ if MISDN != n - config MISDN_DSP - tristate "Digital Audio Processing of transparent data" - depends on MISDN -+ select BITREVERSE - help - Enable support for digital audio processing capability. - -diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c -index 2d519c2235626..a9529dc2b26e6 100644 ---- a/drivers/md/dm-bufio.c -+++ b/drivers/md/dm-bufio.c -@@ -1446,6 +1446,12 @@ sector_t dm_bufio_get_device_size(struct dm_bufio_client *c) - } - EXPORT_SYMBOL_GPL(dm_bufio_get_device_size); - -+struct dm_io_client *dm_bufio_get_dm_io_client(struct dm_bufio_client *c) -+{ -+ return c->dm_io; -+} -+EXPORT_SYMBOL_GPL(dm_bufio_get_dm_io_client); -+ - sector_t dm_bufio_get_block_number(struct dm_buffer *b) - { - return b->block; -diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c -index d6edfe84e7490..25efe382e78fa 100644 ---- a/drivers/md/dm-integrity.c -+++ b/drivers/md/dm-integrity.c -@@ -1343,12 +1343,52 @@ static int dm_integrity_rw_tag(struct dm_integrity_c *ic, unsigned char *tag, se - return 0; - } - --static void dm_integrity_flush_buffers(struct dm_integrity_c *ic) -+struct flush_request { -+ struct dm_io_request io_req; -+ struct dm_io_region io_reg; -+ struct dm_integrity_c *ic; -+ struct completion comp; -+}; -+ -+static void flush_notify(unsigned long error, void *fr_) -+{ -+ struct flush_request *fr = fr_; -+ if (unlikely(error != 0)) -+ dm_integrity_io_error(fr->ic, "flusing disk cache", -EIO); -+ complete(&fr->comp); -+} -+ -+static void dm_integrity_flush_buffers(struct dm_integrity_c *ic, bool flush_data) - { - int r; -+ -+ struct flush_request fr; -+ -+ if (!ic->meta_dev) -+ flush_data = false; -+ if (flush_data) { -+ fr.io_req.bi_op = REQ_OP_WRITE, -+ fr.io_req.bi_op_flags = REQ_PREFLUSH | REQ_SYNC, -+ fr.io_req.mem.type = DM_IO_KMEM, -+ fr.io_req.mem.ptr.addr = NULL, -+ fr.io_req.notify.fn = flush_notify, -+ fr.io_req.notify.context = &fr; -+ fr.io_req.client = dm_bufio_get_dm_io_client(ic->bufio), -+ fr.io_reg.bdev = ic->dev->bdev, -+ fr.io_reg.sector = 0, -+ fr.io_reg.count = 0, -+ fr.ic = ic; -+ init_completion(&fr.comp); -+ r = dm_io(&fr.io_req, 1, &fr.io_reg, NULL); -+ BUG_ON(r); -+ } -+ - r = dm_bufio_write_dirty_buffers(ic->bufio); - if (unlikely(r)) - dm_integrity_io_error(ic, "writing tags", r); -+ -+ if (flush_data) -+ wait_for_completion(&fr.comp); - } - - static void sleep_on_endio_wait(struct dm_integrity_c *ic) -@@ -2077,7 +2117,7 @@ static void integrity_commit(struct work_struct *w) - flushes = bio_list_get(&ic->flush_bio_list); - if (unlikely(ic->mode != 'J')) { - spin_unlock_irq(&ic->endio_wait.lock); -- dm_integrity_flush_buffers(ic); -+ dm_integrity_flush_buffers(ic, true); - goto release_flush_bios; - } - -@@ -2287,7 +2327,7 @@ skip_io: - complete_journal_op(&comp); - wait_for_completion_io(&comp.comp); - -- dm_integrity_flush_buffers(ic); -+ dm_integrity_flush_buffers(ic, true); - } - - static void integrity_writer(struct work_struct *w) -@@ -2329,7 +2369,7 @@ static void recalc_write_super(struct dm_integrity_c *ic) - { - int r; - -- dm_integrity_flush_buffers(ic); -+ dm_integrity_flush_buffers(ic, false); - if (dm_integrity_failed(ic)) - return; - -@@ -2532,7 +2572,7 @@ static void bitmap_flush_work(struct work_struct *work) - unsigned long limit; - struct bio *bio; - -- dm_integrity_flush_buffers(ic); -+ dm_integrity_flush_buffers(ic, false); - - range.logical_sector = 0; - range.n_sectors = ic->provided_data_sectors; -@@ -2541,7 +2581,7 @@ static void bitmap_flush_work(struct work_struct *work) - add_new_range_and_wait(ic, &range); - spin_unlock_irq(&ic->endio_wait.lock); - -- dm_integrity_flush_buffers(ic); -+ dm_integrity_flush_buffers(ic, true); - if (ic->meta_dev) - blkdev_issue_flush(ic->dev->bdev, GFP_NOIO, NULL); - -@@ -2812,11 +2852,11 @@ static void dm_integrity_postsuspend(struct dm_target *ti) - if (ic->meta_dev) - queue_work(ic->writer_wq, &ic->writer_work); - drain_workqueue(ic->writer_wq); -- dm_integrity_flush_buffers(ic); -+ dm_integrity_flush_buffers(ic, true); - } - - if (ic->mode == 'B') { -- dm_integrity_flush_buffers(ic); -+ dm_integrity_flush_buffers(ic, true); - #if 1 - /* set to 0 to test bitmap replay code */ - init_journal(ic, 0, ic->journal_sections, 0); -@@ -3585,7 +3625,7 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv) - unsigned extra_args; - struct dm_arg_set as; - static const struct dm_arg _args[] = { -- {0, 9, "Invalid number of feature args"}, -+ {0, 15, "Invalid number of feature args"}, - }; - unsigned journal_sectors, interleave_sectors, buffer_sectors, journal_watermark, sync_msec; - bool should_write_sb; -diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c -index b0aa595e4375d..70210a7e4bc80 100644 ---- a/drivers/md/dm-raid.c -+++ b/drivers/md/dm-raid.c -@@ -3744,10 +3744,10 @@ static void raid_io_hints(struct dm_target *ti, struct queue_limits *limits) - blk_limits_io_opt(limits, chunk_size_bytes * mddev_data_stripes(rs)); - - /* -- * RAID1 and RAID10 personalities require bio splitting, -- * RAID0/4/5/6 don't and process large discard bios properly. -+ * RAID0 and RAID10 personalities require bio splitting, -+ * RAID1/4/5/6 don't and process large discard bios properly. - */ -- if (rs_is_raid1(rs) || rs_is_raid10(rs)) { -+ if (rs_is_raid0(rs) || rs_is_raid10(rs)) { - limits->discard_granularity = chunk_size_bytes; - limits->max_discard_sectors = rs->md.chunk_sectors; - } -diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c -index 4fb1a40e68a08..0164c9ca984ba 100644 ---- a/drivers/md/dm-snap.c -+++ b/drivers/md/dm-snap.c -@@ -141,6 +141,11 @@ struct dm_snapshot { - * for them to be committed. - */ - struct bio_list bios_queued_during_merge; -+ -+ /* -+ * Flush data after merge. -+ */ -+ struct bio flush_bio; - }; - - /* -@@ -1121,6 +1126,17 @@ shut: - - static void error_bios(struct bio *bio); - -+static int flush_data(struct dm_snapshot *s) -+{ -+ struct bio *flush_bio = &s->flush_bio; -+ -+ bio_reset(flush_bio); -+ bio_set_dev(flush_bio, s->origin->bdev); -+ flush_bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH; -+ -+ return submit_bio_wait(flush_bio); -+} -+ - static void merge_callback(int read_err, unsigned long write_err, void *context) - { - struct dm_snapshot *s = context; -@@ -1134,6 +1150,11 @@ static void merge_callback(int read_err, unsigned long write_err, void *context) - goto shut; - } - -+ if (flush_data(s) < 0) { -+ DMERR("Flush after merge failed: shutting down merge"); -+ goto shut; -+ } -+ - if (s->store->type->commit_merge(s->store, - s->num_merging_chunks) < 0) { - DMERR("Write error in exception store: shutting down merge"); -@@ -1318,6 +1339,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) - s->first_merging_chunk = 0; - s->num_merging_chunks = 0; - bio_list_init(&s->bios_queued_during_merge); -+ bio_init(&s->flush_bio, NULL, 0); - - /* Allocate hash table for COW data */ - if (init_hash_tables(s)) { -@@ -1504,6 +1526,8 @@ static void snapshot_dtr(struct dm_target *ti) - - dm_exception_store_destroy(s->store); - -+ bio_uninit(&s->flush_bio); -+ - dm_put_device(ti, s->cow); - - dm_put_device(ti, s->origin); -diff --git a/drivers/md/dm.c b/drivers/md/dm.c -index bf3c2a1159e68..c6ce42daff27b 100644 ---- a/drivers/md/dm.c -+++ b/drivers/md/dm.c -@@ -548,7 +548,7 @@ static int dm_blk_ioctl(struct block_device *bdev, fmode_t mode, - * subset of the parent bdev; require extra privileges. - */ - if (!capable(CAP_SYS_RAWIO)) { -- DMWARN_LIMIT( -+ DMDEBUG_LIMIT( - "%s: sending ioctl %x to DM device without required privilege.", - current->comm, cmd); - r = -ENOIOCTLCMD; -diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c -index 3eeb1920ddb43..3486bf33474d9 100644 ---- a/drivers/misc/habanalabs/device.c -+++ b/drivers/misc/habanalabs/device.c -@@ -959,6 +959,7 @@ again: - GFP_KERNEL); - if (!hdev->kernel_ctx) { - rc = -ENOMEM; -+ hl_mmu_fini(hdev); - goto out_err; - } - -@@ -970,6 +971,7 @@ again: - "failed to init kernel ctx in hard reset\n"); - kfree(hdev->kernel_ctx); - hdev->kernel_ctx = NULL; -+ hl_mmu_fini(hdev); - goto out_err; - } - } -diff --git a/drivers/misc/habanalabs/habanalabs_drv.c b/drivers/misc/habanalabs/habanalabs_drv.c -index 8c342fb499ca6..ae50bd55f30af 100644 ---- a/drivers/misc/habanalabs/habanalabs_drv.c -+++ b/drivers/misc/habanalabs/habanalabs_drv.c -@@ -443,6 +443,7 @@ static struct pci_driver hl_pci_driver = { - .id_table = ids, - .probe = hl_pci_probe, - .remove = hl_pci_remove, -+ .shutdown = hl_pci_remove, - .driver.pm = &hl_pm_ops, - }; - -diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c -index 30816ec4fa915..13ef6a9afaa09 100644 ---- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c -+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c -@@ -216,8 +216,12 @@ int bnxt_get_ulp_msix_base(struct bnxt *bp) - - int bnxt_get_ulp_stat_ctxs(struct bnxt *bp) - { -- if (bnxt_ulp_registered(bp->edev, BNXT_ROCE_ULP)) -- return BNXT_MIN_ROCE_STAT_CTXS; -+ if (bnxt_ulp_registered(bp->edev, BNXT_ROCE_ULP)) { -+ struct bnxt_en_dev *edev = bp->edev; -+ -+ if (edev->ulp_tbl[BNXT_ROCE_ULP].msix_requested) -+ return BNXT_MIN_ROCE_STAT_CTXS; -+ } - - return 0; - } -diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c -index c8e5d889bd81f..21de56345503f 100644 ---- a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c -+++ b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c -@@ -223,3 +223,4 @@ static struct platform_driver fs_enet_bb_mdio_driver = { - }; - - module_platform_driver(fs_enet_bb_mdio_driver); -+MODULE_LICENSE("GPL"); -diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c -index 1582d82483eca..4e6a9c5d8af55 100644 ---- a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c -+++ b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c -@@ -224,3 +224,4 @@ static struct platform_driver fs_enet_fec_mdio_driver = { - }; - - module_platform_driver(fs_enet_fec_mdio_driver); -+MODULE_LICENSE("GPL"); -diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h -index a86a42131fc71..b00fbef612cfe 100644 ---- a/drivers/net/ethernet/freescale/ucc_geth.h -+++ b/drivers/net/ethernet/freescale/ucc_geth.h -@@ -576,7 +576,14 @@ struct ucc_geth_tx_global_pram { - u32 vtagtable[0x8]; /* 8 4-byte VLAN tags */ - u32 tqptr; /* a base pointer to the Tx Queues Memory - Region */ -- u8 res2[0x80 - 0x74]; -+ u8 res2[0x78 - 0x74]; -+ u64 snums_en; -+ u32 l2l3baseptr; /* top byte consists of a few other bit fields */ -+ -+ u16 mtu[8]; -+ u8 res3[0xa8 - 0x94]; -+ u32 wrrtablebase; /* top byte is reserved */ -+ u8 res4[0xc0 - 0xac]; - } __packed; - - /* structure representing Extended Filtering Global Parameters in PRAM */ -diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c -index 9bb37ac99a108..8325f6d65dccc 100644 ---- a/drivers/net/usb/cdc_ether.c -+++ b/drivers/net/usb/cdc_ether.c -@@ -787,6 +787,13 @@ static const struct usb_device_id products[] = { - .driver_info = 0, - }, - -+/* Lenovo Powered USB-C Travel Hub (4X90S92381, based on Realtek RTL8153) */ -+{ -+ USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x721e, USB_CLASS_COMM, -+ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), -+ .driver_info = 0, -+}, -+ - /* ThinkPad USB-C Dock Gen 2 (based on Realtek RTL8153) */ - { - USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0xa387, USB_CLASS_COMM, -diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index cd1a07175e111..22f093797f417 100644 ---- a/drivers/net/usb/r8152.c -+++ b/drivers/net/usb/r8152.c -@@ -5845,6 +5845,7 @@ static const struct usb_device_id rtl8152_table[] = { - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214)}, -+ {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x721e)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387)}, - {REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041)}, - {REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff)}, -diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c -index 9b1fc8633cfe1..ef93bd3ed339c 100644 ---- a/drivers/nvme/host/pci.c -+++ b/drivers/nvme/host/pci.c -@@ -3145,7 +3145,8 @@ static const struct pci_device_id nvme_id_table[] = { - { PCI_DEVICE(0x144d, 0xa821), /* Samsung PM1725 */ - .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, - { PCI_DEVICE(0x144d, 0xa822), /* Samsung PM1725a */ -- .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, -+ .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY | -+ NVME_QUIRK_IGNORE_DEV_SUBNQN, }, - { PCI_DEVICE(0x1d1d, 0x1f1f), /* LighNVM qemu device */ - .driver_data = NVME_QUIRK_LIGHTNVM, }, - { PCI_DEVICE(0x1d1d, 0x2807), /* CNEX WL */ -diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c -index a31c6e1f6063a..a554021e1ab92 100644 ---- a/drivers/nvme/host/tcp.c -+++ b/drivers/nvme/host/tcp.c -@@ -186,7 +186,7 @@ static inline size_t nvme_tcp_req_cur_offset(struct nvme_tcp_request *req) - - static inline size_t nvme_tcp_req_cur_length(struct nvme_tcp_request *req) - { -- return min_t(size_t, req->iter.bvec->bv_len - req->iter.iov_offset, -+ return min_t(size_t, iov_iter_single_seg_count(&req->iter), - req->pdu_len - req->pdu_sent); - } - -diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c -index b5314164479e9..50e2007092bc0 100644 ---- a/drivers/nvme/target/rdma.c -+++ b/drivers/nvme/target/rdma.c -@@ -1351,6 +1351,16 @@ static void __nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue) - spin_lock_irqsave(&queue->state_lock, flags); - switch (queue->state) { - case NVMET_RDMA_Q_CONNECTING: -+ while (!list_empty(&queue->rsp_wait_list)) { -+ struct nvmet_rdma_rsp *rsp; -+ -+ rsp = list_first_entry(&queue->rsp_wait_list, -+ struct nvmet_rdma_rsp, -+ wait_list); -+ list_del(&rsp->wait_list); -+ nvmet_rdma_put_rsp(rsp); -+ } -+ fallthrough; - case NVMET_RDMA_Q_LIVE: - queue->state = NVMET_RDMA_Q_DISCONNECTING; - disconnect = true; -diff --git a/drivers/regulator/bd718x7-regulator.c b/drivers/regulator/bd718x7-regulator.c -index bdab46a5c4617..6c431456d2983 100644 ---- a/drivers/regulator/bd718x7-regulator.c -+++ b/drivers/regulator/bd718x7-regulator.c -@@ -15,6 +15,36 @@ - #include - #include - -+/* Typical regulator startup times as per data sheet in uS */ -+#define BD71847_BUCK1_STARTUP_TIME 144 -+#define BD71847_BUCK2_STARTUP_TIME 162 -+#define BD71847_BUCK3_STARTUP_TIME 162 -+#define BD71847_BUCK4_STARTUP_TIME 240 -+#define BD71847_BUCK5_STARTUP_TIME 270 -+#define BD71847_BUCK6_STARTUP_TIME 200 -+#define BD71847_LDO1_STARTUP_TIME 440 -+#define BD71847_LDO2_STARTUP_TIME 370 -+#define BD71847_LDO3_STARTUP_TIME 310 -+#define BD71847_LDO4_STARTUP_TIME 400 -+#define BD71847_LDO5_STARTUP_TIME 530 -+#define BD71847_LDO6_STARTUP_TIME 400 -+ -+#define BD71837_BUCK1_STARTUP_TIME 160 -+#define BD71837_BUCK2_STARTUP_TIME 180 -+#define BD71837_BUCK3_STARTUP_TIME 180 -+#define BD71837_BUCK4_STARTUP_TIME 180 -+#define BD71837_BUCK5_STARTUP_TIME 160 -+#define BD71837_BUCK6_STARTUP_TIME 240 -+#define BD71837_BUCK7_STARTUP_TIME 220 -+#define BD71837_BUCK8_STARTUP_TIME 200 -+#define BD71837_LDO1_STARTUP_TIME 440 -+#define BD71837_LDO2_STARTUP_TIME 370 -+#define BD71837_LDO3_STARTUP_TIME 310 -+#define BD71837_LDO4_STARTUP_TIME 400 -+#define BD71837_LDO5_STARTUP_TIME 310 -+#define BD71837_LDO6_STARTUP_TIME 400 -+#define BD71837_LDO7_STARTUP_TIME 530 -+ - /* - * BUCK1/2/3/4 - * BUCK1RAMPRATE[1:0] BUCK1 DVS ramp rate setting -@@ -495,6 +525,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = { - .vsel_mask = DVS_BUCK_RUN_MASK, - .enable_reg = BD718XX_REG_BUCK1_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71847_BUCK1_STARTUP_TIME, - .owner = THIS_MODULE, - .of_parse_cb = buck1_set_hw_dvs_levels, - }, -@@ -519,6 +550,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = { - .vsel_mask = DVS_BUCK_RUN_MASK, - .enable_reg = BD718XX_REG_BUCK2_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71847_BUCK2_STARTUP_TIME, - .owner = THIS_MODULE, - .of_parse_cb = buck2_set_hw_dvs_levels, - }, -@@ -547,6 +579,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = { - .linear_range_selectors = bd71847_buck3_volt_range_sel, - .enable_reg = BD718XX_REG_1ST_NODVS_BUCK_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71847_BUCK3_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -574,6 +607,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = { - .vsel_range_mask = BD71847_BUCK4_RANGE_MASK, - .linear_range_selectors = bd71847_buck4_volt_range_sel, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71847_BUCK4_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -596,6 +630,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = { - .vsel_mask = BD718XX_3RD_NODVS_BUCK_MASK, - .enable_reg = BD718XX_REG_3RD_NODVS_BUCK_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71847_BUCK5_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -620,6 +655,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = { - .vsel_mask = BD718XX_4TH_NODVS_BUCK_MASK, - .enable_reg = BD718XX_REG_4TH_NODVS_BUCK_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71847_BUCK6_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -646,6 +682,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = { - .linear_range_selectors = bd718xx_ldo1_volt_range_sel, - .enable_reg = BD718XX_REG_LDO1_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71847_LDO1_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -668,6 +705,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = { - .n_voltages = ARRAY_SIZE(ldo_2_volts), - .enable_reg = BD718XX_REG_LDO2_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71847_LDO2_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -691,6 +729,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = { - .vsel_mask = BD718XX_LDO3_MASK, - .enable_reg = BD718XX_REG_LDO3_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71847_LDO3_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -714,6 +753,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = { - .vsel_mask = BD718XX_LDO4_MASK, - .enable_reg = BD718XX_REG_LDO4_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71847_LDO4_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -740,6 +780,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = { - .linear_range_selectors = bd71847_ldo5_volt_range_sel, - .enable_reg = BD718XX_REG_LDO5_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71847_LDO5_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -765,6 +806,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = { - .vsel_mask = BD718XX_LDO6_MASK, - .enable_reg = BD718XX_REG_LDO6_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71847_LDO6_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -791,6 +833,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .vsel_mask = DVS_BUCK_RUN_MASK, - .enable_reg = BD718XX_REG_BUCK1_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71837_BUCK1_STARTUP_TIME, - .owner = THIS_MODULE, - .of_parse_cb = buck1_set_hw_dvs_levels, - }, -@@ -815,6 +858,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .vsel_mask = DVS_BUCK_RUN_MASK, - .enable_reg = BD718XX_REG_BUCK2_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71837_BUCK2_STARTUP_TIME, - .owner = THIS_MODULE, - .of_parse_cb = buck2_set_hw_dvs_levels, - }, -@@ -839,6 +883,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .vsel_mask = DVS_BUCK_RUN_MASK, - .enable_reg = BD71837_REG_BUCK3_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71837_BUCK3_STARTUP_TIME, - .owner = THIS_MODULE, - .of_parse_cb = buck3_set_hw_dvs_levels, - }, -@@ -863,6 +908,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .vsel_mask = DVS_BUCK_RUN_MASK, - .enable_reg = BD71837_REG_BUCK4_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71837_BUCK4_STARTUP_TIME, - .owner = THIS_MODULE, - .of_parse_cb = buck4_set_hw_dvs_levels, - }, -@@ -891,6 +937,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .linear_range_selectors = bd71837_buck5_volt_range_sel, - .enable_reg = BD718XX_REG_1ST_NODVS_BUCK_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71837_BUCK5_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -915,6 +962,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .vsel_mask = BD71837_BUCK6_MASK, - .enable_reg = BD718XX_REG_2ND_NODVS_BUCK_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71837_BUCK6_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -937,6 +985,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .vsel_mask = BD718XX_3RD_NODVS_BUCK_MASK, - .enable_reg = BD718XX_REG_3RD_NODVS_BUCK_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71837_BUCK7_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -961,6 +1010,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .vsel_mask = BD718XX_4TH_NODVS_BUCK_MASK, - .enable_reg = BD718XX_REG_4TH_NODVS_BUCK_CTRL, - .enable_mask = BD718XX_BUCK_EN, -+ .enable_time = BD71837_BUCK8_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -987,6 +1037,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .linear_range_selectors = bd718xx_ldo1_volt_range_sel, - .enable_reg = BD718XX_REG_LDO1_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71837_LDO1_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -1009,6 +1060,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .n_voltages = ARRAY_SIZE(ldo_2_volts), - .enable_reg = BD718XX_REG_LDO2_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71837_LDO2_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -1032,6 +1084,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .vsel_mask = BD718XX_LDO3_MASK, - .enable_reg = BD718XX_REG_LDO3_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71837_LDO3_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -1055,6 +1108,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .vsel_mask = BD718XX_LDO4_MASK, - .enable_reg = BD718XX_REG_LDO4_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71837_LDO4_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -1080,6 +1134,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .vsel_mask = BD71837_LDO5_MASK, - .enable_reg = BD718XX_REG_LDO5_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71837_LDO5_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -1107,6 +1162,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .vsel_mask = BD718XX_LDO6_MASK, - .enable_reg = BD718XX_REG_LDO6_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71837_LDO6_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -@@ -1132,6 +1188,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = { - .vsel_mask = BD71837_LDO7_MASK, - .enable_reg = BD71837_REG_LDO7_VOLT, - .enable_mask = BD718XX_LDO_EN, -+ .enable_time = BD71837_LDO7_STARTUP_TIME, - .owner = THIS_MODULE, - }, - .init = { -diff --git a/drivers/usb/typec/altmodes/Kconfig b/drivers/usb/typec/altmodes/Kconfig -index 187690fd1a5bd..60d375e9c3c7c 100644 ---- a/drivers/usb/typec/altmodes/Kconfig -+++ b/drivers/usb/typec/altmodes/Kconfig -@@ -20,6 +20,6 @@ config TYPEC_NVIDIA_ALTMODE - to enable support for VirtualLink devices with NVIDIA GPUs. - - To compile this driver as a module, choose M here: the -- module will be called typec_displayport. -+ module will be called typec_nvidia. - - endmenu -diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c -index 60c21cfb19480..95205bde240f7 100644 ---- a/fs/btrfs/extent_io.c -+++ b/fs/btrfs/extent_io.c -@@ -647,9 +647,7 @@ alloc_extent_state_atomic(struct extent_state *prealloc) - - static void extent_io_tree_panic(struct extent_io_tree *tree, int err) - { -- struct inode *inode = tree->private_data; -- -- btrfs_panic(btrfs_sb(inode->i_sb), err, -+ btrfs_panic(tree->fs_info, err, - "locking error: extent tree was modified by another thread while locked"); - } - -diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c -index d9246fb8cea65..cd8e81c02f63f 100644 ---- a/fs/btrfs/qgroup.c -+++ b/fs/btrfs/qgroup.c -@@ -3144,6 +3144,12 @@ out: - return ret; - } - -+static bool rescan_should_stop(struct btrfs_fs_info *fs_info) -+{ -+ return btrfs_fs_closing(fs_info) || -+ test_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state); -+} -+ - static void btrfs_qgroup_rescan_worker(struct btrfs_work *work) - { - struct btrfs_fs_info *fs_info = container_of(work, struct btrfs_fs_info, -@@ -3152,6 +3158,7 @@ static void btrfs_qgroup_rescan_worker(struct btrfs_work *work) - struct btrfs_trans_handle *trans = NULL; - int err = -ENOMEM; - int ret = 0; -+ bool stopped = false; - - path = btrfs_alloc_path(); - if (!path) -@@ -3164,7 +3171,7 @@ static void btrfs_qgroup_rescan_worker(struct btrfs_work *work) - path->skip_locking = 1; - - err = 0; -- while (!err && !btrfs_fs_closing(fs_info)) { -+ while (!err && !(stopped = rescan_should_stop(fs_info))) { - trans = btrfs_start_transaction(fs_info->fs_root, 0); - if (IS_ERR(trans)) { - err = PTR_ERR(trans); -@@ -3207,7 +3214,7 @@ out: - } - - mutex_lock(&fs_info->qgroup_rescan_lock); -- if (!btrfs_fs_closing(fs_info)) -+ if (!stopped) - fs_info->qgroup_flags &= ~BTRFS_QGROUP_STATUS_FLAG_RESCAN; - if (trans) { - ret = update_qgroup_status_item(trans); -@@ -3226,7 +3233,7 @@ out: - - btrfs_end_transaction(trans); - -- if (btrfs_fs_closing(fs_info)) { -+ if (stopped) { - btrfs_info(fs_info, "qgroup scan paused"); - } else if (err >= 0) { - btrfs_info(fs_info, "qgroup scan completed%s", -diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c -index 6a2ae208ff80a..1a69bdb96fb2a 100644 ---- a/fs/btrfs/super.c -+++ b/fs/btrfs/super.c -@@ -1792,6 +1792,14 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) - btrfs_scrub_cancel(fs_info); - btrfs_pause_balance(fs_info); - -+ /* -+ * Pause the qgroup rescan worker if it is running. We don't want -+ * it to be still running after we are in RO mode, as after that, -+ * by the time we unmount, it might have left a transaction open, -+ * so we would leak the transaction and/or crash. -+ */ -+ btrfs_qgroup_wait_for_completion(fs_info, false); -+ - ret = btrfs_commit_super(fs_info); - if (ret) - goto restore; -diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c -index 9feb8a1793efb..7d06842a3d747 100644 ---- a/fs/btrfs/tree-checker.c -+++ b/fs/btrfs/tree-checker.c -@@ -571,6 +571,7 @@ int btrfs_check_chunk_valid(struct extent_buffer *leaf, - { - struct btrfs_fs_info *fs_info = leaf->fs_info; - u64 length; -+ u64 chunk_end; - u64 stripe_len; - u16 num_stripes; - u16 sub_stripes; -@@ -625,6 +626,12 @@ int btrfs_check_chunk_valid(struct extent_buffer *leaf, - "invalid chunk length, have %llu", length); - return -EUCLEAN; - } -+ if (unlikely(check_add_overflow(logical, length, &chunk_end))) { -+ chunk_err(leaf, chunk, logical, -+"invalid chunk logical start and length, have logical start %llu length %llu", -+ logical, length); -+ return -EUCLEAN; -+ } - if (!is_power_of_2(stripe_len) || stripe_len != BTRFS_STRIPE_LEN) { - chunk_err(leaf, chunk, logical, - "invalid chunk stripe length: %llu", -diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c -index 7ff05c06f2a4c..be06b26d6ca03 100644 ---- a/fs/cifs/smb2pdu.c -+++ b/fs/cifs/smb2pdu.c -@@ -2945,8 +2945,8 @@ SMB2_close_free(struct smb_rqst *rqst) - } - - int --SMB2_close_flags(const unsigned int xid, struct cifs_tcon *tcon, -- u64 persistent_fid, u64 volatile_fid, int flags) -+SMB2_close(const unsigned int xid, struct cifs_tcon *tcon, -+ u64 persistent_fid, u64 volatile_fid) - { - struct smb_rqst rqst; - struct smb2_close_rsp *rsp = NULL; -@@ -2955,6 +2955,7 @@ SMB2_close_flags(const unsigned int xid, struct cifs_tcon *tcon, - struct kvec rsp_iov; - int resp_buftype = CIFS_NO_BUFFER; - int rc = 0; -+ int flags = 0; - - cifs_dbg(FYI, "Close\n"); - -@@ -2993,27 +2994,17 @@ SMB2_close_flags(const unsigned int xid, struct cifs_tcon *tcon, - close_exit: - SMB2_close_free(&rqst); - free_rsp_buf(resp_buftype, rsp); -- return rc; --} -- --int --SMB2_close(const unsigned int xid, struct cifs_tcon *tcon, -- u64 persistent_fid, u64 volatile_fid) --{ -- int rc; -- int tmp_rc; -- -- rc = SMB2_close_flags(xid, tcon, persistent_fid, volatile_fid, 0); - - /* retry close in a worker thread if this one is interrupted */ -- if (rc == -EINTR) { -+ if (is_interrupt_error(rc)) { -+ int tmp_rc; -+ - tmp_rc = smb2_handle_cancelled_close(tcon, persistent_fid, - volatile_fid); - if (tmp_rc) - cifs_dbg(VFS, "handle cancelled close fid 0x%llx returned error %d\n", - persistent_fid, tmp_rc); - } -- - return rc; - } - -diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h -index 2a12a2fa38a22..57f7075a35871 100644 ---- a/fs/cifs/smb2proto.h -+++ b/fs/cifs/smb2proto.h -@@ -156,8 +156,6 @@ extern int SMB2_change_notify(const unsigned int xid, struct cifs_tcon *tcon, - - extern int SMB2_close(const unsigned int xid, struct cifs_tcon *tcon, - u64 persistent_file_id, u64 volatile_file_id); --extern int SMB2_close_flags(const unsigned int xid, struct cifs_tcon *tcon, -- u64 persistent_fid, u64 volatile_fid, int flags); - extern int SMB2_close_init(struct cifs_tcon *tcon, struct smb_rqst *rqst, - u64 persistent_file_id, u64 volatile_file_id); - extern void SMB2_close_free(struct smb_rqst *rqst); -diff --git a/fs/ext4/file.c b/fs/ext4/file.c -index fd7ce3573a00a..1513e90fb6d2f 100644 ---- a/fs/ext4/file.c -+++ b/fs/ext4/file.c -@@ -432,7 +432,7 @@ static int ext4_sample_last_mounted(struct super_block *sb, - err = ext4_journal_get_write_access(handle, sbi->s_sbh); - if (err) - goto out_journal; -- strlcpy(sbi->s_es->s_last_mounted, cp, -+ strncpy(sbi->s_es->s_last_mounted, cp, - sizeof(sbi->s_es->s_last_mounted)); - ext4_handle_dirty_super(handle, sb); - out_journal: -diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c -index 0b7f316fd30f4..ba13fbb443d58 100644 ---- a/fs/ext4/ioctl.c -+++ b/fs/ext4/ioctl.c -@@ -1160,7 +1160,10 @@ resizefs_out: - err = ext4_journal_get_write_access(handle, sbi->s_sbh); - if (err) - goto pwsalt_err_journal; -+ lock_buffer(sbi->s_sbh); - generate_random_uuid(sbi->s_es->s_encrypt_pw_salt); -+ ext4_superblock_csum_set(sb); -+ unlock_buffer(sbi->s_sbh); - err = ext4_handle_dirty_metadata(handle, NULL, - sbi->s_sbh); - pwsalt_err_journal: -diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c -index 59038e361337c..f05ec9bfbf4fd 100644 ---- a/fs/ext4/namei.c -+++ b/fs/ext4/namei.c -@@ -3544,8 +3544,6 @@ static int ext4_setent(handle_t *handle, struct ext4_renament *ent, - return retval; - } - } -- brelse(ent->bh); -- ent->bh = NULL; - - return 0; - } -@@ -3745,6 +3743,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, - } - } - -+ old_file_type = old.de->file_type; - if (IS_DIRSYNC(old.dir) || IS_DIRSYNC(new.dir)) - ext4_handle_sync(handle); - -@@ -3772,7 +3771,6 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, - force_reread = (new.dir->i_ino == old.dir->i_ino && - ext4_test_inode_flag(new.dir, EXT4_INODE_INLINE_DATA)); - -- old_file_type = old.de->file_type; - if (whiteout) { - /* - * Do this before adding a new entry, so the old entry is sure -@@ -3844,15 +3842,19 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, - retval = 0; - - end_rename: -- brelse(old.dir_bh); -- brelse(old.bh); -- brelse(new.bh); - if (whiteout) { -- if (retval) -+ if (retval) { -+ ext4_setent(handle, &old, -+ old.inode->i_ino, old_file_type); - drop_nlink(whiteout); -+ } - unlock_new_inode(whiteout); - iput(whiteout); -+ - } -+ brelse(old.dir_bh); -+ brelse(old.bh); -+ brelse(new.bh); - if (handle) - ext4_journal_stop(handle); - return retval; -diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h -index 447a3c17fa8e6..9e717796e57b7 100644 ---- a/fs/nfs/internal.h -+++ b/fs/nfs/internal.h -@@ -569,12 +569,14 @@ extern void nfs4_test_session_trunk(struct rpc_clnt *clnt, - - static inline struct inode *nfs_igrab_and_active(struct inode *inode) - { -- inode = igrab(inode); -- if (inode != NULL && !nfs_sb_active(inode->i_sb)) { -- iput(inode); -- inode = NULL; -+ struct super_block *sb = inode->i_sb; -+ -+ if (sb && nfs_sb_active(sb)) { -+ if (igrab(inode)) -+ return inode; -+ nfs_sb_deactive(sb); - } -- return inode; -+ return NULL; - } - - static inline void nfs_iput_and_deactive(struct inode *inode) -diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c -index 8598eba3fc234..30e44b33040a4 100644 ---- a/fs/nfs/nfs4proc.c -+++ b/fs/nfs/nfs4proc.c -@@ -3488,10 +3488,8 @@ static void nfs4_close_done(struct rpc_task *task, void *data) - trace_nfs4_close(state, &calldata->arg, &calldata->res, task->tk_status); - - /* Handle Layoutreturn errors */ -- if (pnfs_roc_done(task, calldata->inode, -- &calldata->arg.lr_args, -- &calldata->res.lr_res, -- &calldata->res.lr_ret) == -EAGAIN) -+ if (pnfs_roc_done(task, &calldata->arg.lr_args, &calldata->res.lr_res, -+ &calldata->res.lr_ret) == -EAGAIN) - goto out_restart; - - /* hmm. we are done with the inode, and in the process of freeing -@@ -6238,10 +6236,8 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata) - trace_nfs4_delegreturn_exit(&data->args, &data->res, task->tk_status); - - /* Handle Layoutreturn errors */ -- if (pnfs_roc_done(task, data->inode, -- &data->args.lr_args, -- &data->res.lr_res, -- &data->res.lr_ret) == -EAGAIN) -+ if (pnfs_roc_done(task, &data->args.lr_args, &data->res.lr_res, -+ &data->res.lr_ret) == -EAGAIN) - goto out_restart; - - switch (task->tk_status) { -@@ -6290,10 +6286,10 @@ static void nfs4_delegreturn_release(void *calldata) - struct nfs4_delegreturndata *data = calldata; - struct inode *inode = data->inode; - -+ if (data->lr.roc) -+ pnfs_roc_release(&data->lr.arg, &data->lr.res, -+ data->res.lr_ret); - if (inode) { -- if (data->lr.roc) -- pnfs_roc_release(&data->lr.arg, &data->lr.res, -- data->res.lr_ret); - nfs_post_op_update_inode_force_wcc(inode, &data->fattr); - nfs_iput_and_deactive(inode); - } -@@ -6368,16 +6364,14 @@ static int _nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred, - nfs_fattr_init(data->res.fattr); - data->timestamp = jiffies; - data->rpc_status = 0; -- data->lr.roc = pnfs_roc(inode, &data->lr.arg, &data->lr.res, cred); - data->inode = nfs_igrab_and_active(inode); -- if (data->inode) { -+ if (data->inode || issync) { -+ data->lr.roc = pnfs_roc(inode, &data->lr.arg, &data->lr.res, -+ cred); - if (data->lr.roc) { - data->args.lr_args = &data->lr.arg; - data->res.lr_res = &data->lr.res; - } -- } else if (data->lr.roc) { -- pnfs_roc_release(&data->lr.arg, &data->lr.res, 0); -- data->lr.roc = false; - } - - task_setup_data.callback_data = data; -@@ -6959,9 +6953,9 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f - data->arg.new_lock_owner, ret); - } else - data->cancelled = true; -+ trace_nfs4_set_lock(fl, state, &data->res.stateid, cmd, ret); - rpc_put_task(task); - dprintk("%s: done, ret = %d!\n", __func__, ret); -- trace_nfs4_set_lock(fl, state, &data->res.stateid, cmd, ret); - return ret; - } - -diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c -index 9fd115c4d0a2f..4232f956bdac0 100644 ---- a/fs/nfs/pnfs.c -+++ b/fs/nfs/pnfs.c -@@ -1475,10 +1475,8 @@ out_noroc: - return false; - } - --int pnfs_roc_done(struct rpc_task *task, struct inode *inode, -- struct nfs4_layoutreturn_args **argpp, -- struct nfs4_layoutreturn_res **respp, -- int *ret) -+int pnfs_roc_done(struct rpc_task *task, struct nfs4_layoutreturn_args **argpp, -+ struct nfs4_layoutreturn_res **respp, int *ret) - { - struct nfs4_layoutreturn_args *arg = *argpp; - int retval = -EAGAIN; -@@ -1511,7 +1509,7 @@ int pnfs_roc_done(struct rpc_task *task, struct inode *inode, - return 0; - case -NFS4ERR_OLD_STATEID: - if (!nfs4_layout_refresh_old_stateid(&arg->stateid, -- &arg->range, inode)) -+ &arg->range, arg->inode)) - break; - *ret = -NFS4ERR_NOMATCHING_LAYOUT; - return -EAGAIN; -@@ -1526,12 +1524,18 @@ void pnfs_roc_release(struct nfs4_layoutreturn_args *args, - int ret) - { - struct pnfs_layout_hdr *lo = args->layout; -+ struct inode *inode = args->inode; - const nfs4_stateid *arg_stateid = NULL; - const nfs4_stateid *res_stateid = NULL; - struct nfs4_xdr_opaque_data *ld_private = args->ld_private; - - switch (ret) { - case -NFS4ERR_NOMATCHING_LAYOUT: -+ spin_lock(&inode->i_lock); -+ if (pnfs_layout_is_valid(lo) && -+ nfs4_stateid_match_other(&args->stateid, &lo->plh_stateid)) -+ pnfs_set_plh_return_info(lo, args->range.iomode, 0); -+ spin_unlock(&inode->i_lock); - break; - case 0: - if (res->lrs_present) -@@ -1982,6 +1986,27 @@ lookup_again: - goto lookup_again; - } - -+ /* -+ * Because we free lsegs when sending LAYOUTRETURN, we need to wait -+ * for LAYOUTRETURN. -+ */ -+ if (test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags)) { -+ spin_unlock(&ino->i_lock); -+ dprintk("%s wait for layoutreturn\n", __func__); -+ lseg = ERR_PTR(pnfs_prepare_to_retry_layoutget(lo)); -+ if (!IS_ERR(lseg)) { -+ pnfs_put_layout_hdr(lo); -+ dprintk("%s retrying\n", __func__); -+ trace_pnfs_update_layout(ino, pos, count, iomode, lo, -+ lseg, -+ PNFS_UPDATE_LAYOUT_RETRY); -+ goto lookup_again; -+ } -+ trace_pnfs_update_layout(ino, pos, count, iomode, lo, lseg, -+ PNFS_UPDATE_LAYOUT_RETURN); -+ goto out_put_layout_hdr; -+ } -+ - lseg = pnfs_find_lseg(lo, &arg, strict_iomode); - if (lseg) { - trace_pnfs_update_layout(ino, pos, count, iomode, lo, lseg, -@@ -2035,28 +2060,6 @@ lookup_again: - nfs4_stateid_copy(&stateid, &lo->plh_stateid); - } - -- /* -- * Because we free lsegs before sending LAYOUTRETURN, we need to wait -- * for LAYOUTRETURN even if first is true. -- */ -- if (test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags)) { -- spin_unlock(&ino->i_lock); -- dprintk("%s wait for layoutreturn\n", __func__); -- lseg = ERR_PTR(pnfs_prepare_to_retry_layoutget(lo)); -- if (!IS_ERR(lseg)) { -- if (first) -- pnfs_clear_first_layoutget(lo); -- pnfs_put_layout_hdr(lo); -- dprintk("%s retrying\n", __func__); -- trace_pnfs_update_layout(ino, pos, count, iomode, lo, -- lseg, PNFS_UPDATE_LAYOUT_RETRY); -- goto lookup_again; -- } -- trace_pnfs_update_layout(ino, pos, count, iomode, lo, lseg, -- PNFS_UPDATE_LAYOUT_RETURN); -- goto out_put_layout_hdr; -- } -- - if (pnfs_layoutgets_blocked(lo)) { - trace_pnfs_update_layout(ino, pos, count, iomode, lo, lseg, - PNFS_UPDATE_LAYOUT_BLOCKED); -@@ -2212,6 +2215,7 @@ static void _lgopen_prepare_attached(struct nfs4_opendata *data, - &rng, GFP_KERNEL); - if (!lgp) { - pnfs_clear_first_layoutget(lo); -+ nfs_layoutget_end(lo); - pnfs_put_layout_hdr(lo); - return; - } -diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h -index 63da33a92d831..3d55edd6b25ad 100644 ---- a/fs/nfs/pnfs.h -+++ b/fs/nfs/pnfs.h -@@ -283,10 +283,8 @@ bool pnfs_roc(struct inode *ino, - struct nfs4_layoutreturn_args *args, - struct nfs4_layoutreturn_res *res, - const struct cred *cred); --int pnfs_roc_done(struct rpc_task *task, struct inode *inode, -- struct nfs4_layoutreturn_args **argpp, -- struct nfs4_layoutreturn_res **respp, -- int *ret); -+int pnfs_roc_done(struct rpc_task *task, struct nfs4_layoutreturn_args **argpp, -+ struct nfs4_layoutreturn_res **respp, int *ret); - void pnfs_roc_release(struct nfs4_layoutreturn_args *args, - struct nfs4_layoutreturn_res *res, - int ret); -@@ -711,7 +709,7 @@ pnfs_roc(struct inode *ino, - } - - static inline int --pnfs_roc_done(struct rpc_task *task, struct inode *inode, -+pnfs_roc_done(struct rpc_task *task, - struct nfs4_layoutreturn_args **argpp, - struct nfs4_layoutreturn_res **respp, - int *ret) -diff --git a/include/linux/acpi.h b/include/linux/acpi.h -index ce29a014e591c..dd6170357ec72 100644 ---- a/include/linux/acpi.h -+++ b/include/linux/acpi.h -@@ -837,6 +837,13 @@ static inline int acpi_device_modalias(struct device *dev, - return -ENODEV; - } - -+static inline struct platform_device * -+acpi_create_platform_device(struct acpi_device *adev, -+ struct property_entry *properties) -+{ -+ return NULL; -+} -+ - static inline bool acpi_dma_supported(struct acpi_device *adev) - { - return false; -diff --git a/include/linux/dm-bufio.h b/include/linux/dm-bufio.h -index 3c8b7d274bd9b..45ba37aaf6b78 100644 ---- a/include/linux/dm-bufio.h -+++ b/include/linux/dm-bufio.h -@@ -138,6 +138,7 @@ void dm_bufio_set_minimum_buffers(struct dm_bufio_client *c, unsigned n); - - unsigned dm_bufio_get_block_size(struct dm_bufio_client *c); - sector_t dm_bufio_get_device_size(struct dm_bufio_client *c); -+struct dm_io_client *dm_bufio_get_dm_io_client(struct dm_bufio_client *c); - sector_t dm_bufio_get_block_number(struct dm_buffer *b); - void *dm_bufio_get_block_data(struct dm_buffer *b); - void *dm_bufio_get_aux_data(struct dm_buffer *b); -diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig -index f3f2fc8ad81aa..9fa01dad655b4 100644 ---- a/kernel/trace/Kconfig -+++ b/kernel/trace/Kconfig -@@ -478,7 +478,7 @@ config KPROBE_EVENTS - config KPROBE_EVENTS_ON_NOTRACE - bool "Do NOT protect notrace function from kprobe events" - depends on KPROBE_EVENTS -- depends on KPROBES_ON_FTRACE -+ depends on DYNAMIC_FTRACE - default n - help - This is only for the developers who want to debug ftrace itself -diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c -index 26de9c6549566..1074a69beff3f 100644 ---- a/kernel/trace/trace_kprobe.c -+++ b/kernel/trace/trace_kprobe.c -@@ -433,7 +433,7 @@ static int disable_trace_kprobe(struct trace_event_call *call, - return 0; - } - --#if defined(CONFIG_KPROBES_ON_FTRACE) && \ -+#if defined(CONFIG_DYNAMIC_FTRACE) && \ - !defined(CONFIG_KPROBE_EVENTS_ON_NOTRACE) - static bool __within_notrace_func(unsigned long addr) - { -diff --git a/lib/raid6/Makefile b/lib/raid6/Makefile -index 0083b5cc646c9..d4d56ca6eafce 100644 ---- a/lib/raid6/Makefile -+++ b/lib/raid6/Makefile -@@ -48,7 +48,7 @@ endif - endif - - quiet_cmd_unroll = UNROLL $@ -- cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$* < $< > $@ -+ cmd_unroll = $(AWK) -v N=$* -f $(srctree)/$(src)/unroll.awk < $< > $@ - - targets += int1.c int2.c int4.c int8.c int16.c int32.c - $(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE -diff --git a/mm/hugetlb.c b/mm/hugetlb.c -index 62ec514dae658..3bc33fa838177 100644 ---- a/mm/hugetlb.c -+++ b/mm/hugetlb.c -@@ -4036,7 +4036,7 @@ retry: - * So we need to block hugepage fault by PG_hwpoison bit check. - */ - if (unlikely(PageHWPoison(page))) { -- ret = VM_FAULT_HWPOISON | -+ ret = VM_FAULT_HWPOISON_LARGE | - VM_FAULT_SET_HINDEX(hstate_index(h)); - goto backout_unlocked; - } -diff --git a/mm/slub.c b/mm/slub.c -index f41414571c9eb..8b3ef45a0f103 100644 ---- a/mm/slub.c -+++ b/mm/slub.c -@@ -1887,7 +1887,7 @@ static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, - - t = acquire_slab(s, n, page, object == NULL, &objects); - if (!t) -- break; -+ continue; /* cmpxchg raced */ - - available += objects; - if (!object) { -diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h -index 1a58cfdb862d6..500de37858ac8 100644 ---- a/net/netfilter/ipset/ip_set_hash_gen.h -+++ b/net/netfilter/ipset/ip_set_hash_gen.h -@@ -630,7 +630,7 @@ mtype_resize(struct ip_set *set, bool retried) - struct htype *h = set->data; - struct htable *t, *orig; - u8 htable_bits; -- size_t dsize = set->dsize; -+ size_t hsize, dsize = set->dsize; - #ifdef IP_SET_HASH_WITH_NETS - u8 flags; - struct mtype_elem *tmp; -@@ -654,14 +654,12 @@ mtype_resize(struct ip_set *set, bool retried) - retry: - ret = 0; - htable_bits++; -- if (!htable_bits) { -- /* In case we have plenty of memory :-) */ -- pr_warn("Cannot increase the hashsize of set %s further\n", -- set->name); -- ret = -IPSET_ERR_HASH_FULL; -- goto out; -- } -- t = ip_set_alloc(htable_size(htable_bits)); -+ if (!htable_bits) -+ goto hbwarn; -+ hsize = htable_size(htable_bits); -+ if (!hsize) -+ goto hbwarn; -+ t = ip_set_alloc(hsize); - if (!t) { - ret = -ENOMEM; - goto out; -@@ -803,6 +801,12 @@ cleanup: - if (ret == -EAGAIN) - goto retry; - goto out; -+ -+hbwarn: -+ /* In case we have plenty of memory :-) */ -+ pr_warn("Cannot increase the hashsize of set %s further\n", set->name); -+ ret = -IPSET_ERR_HASH_FULL; -+ goto out; - } - - /* Get the current number of elements and ext_size in the set */ -diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c -index 4912069627b65..dc57f530df9db 100644 ---- a/net/netfilter/nf_conntrack_standalone.c -+++ b/net/netfilter/nf_conntrack_standalone.c -@@ -521,6 +521,9 @@ nf_conntrack_hash_sysctl(struct ctl_table *table, int write, - { - int ret; - -+ /* module_param hashsize could have changed value */ -+ nf_conntrack_htable_size_user = nf_conntrack_htable_size; -+ - ret = proc_dointvec(table, write, buffer, lenp, ppos); - if (ret < 0 || !write) - return ret; -diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c -index bfc555fcbc729..89b58aa890a74 100644 ---- a/net/netfilter/nf_nat_core.c -+++ b/net/netfilter/nf_nat_core.c -@@ -1174,6 +1174,7 @@ static int __init nf_nat_init(void) - ret = register_pernet_subsys(&nat_net_ops); - if (ret < 0) { - nf_ct_extend_unregister(&nat_extend); -+ kvfree(nf_nat_bysource); - return ret; - } - -diff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c -index 0e3e0ff805812..bbe03b9a03b12 100644 ---- a/net/netfilter/nft_compat.c -+++ b/net/netfilter/nft_compat.c -@@ -27,8 +27,6 @@ struct nft_xt_match_priv { - void *info; - }; - --static refcount_t nft_compat_pending_destroy = REFCOUNT_INIT(1); -- - static int nft_compat_chain_validate_dependency(const struct nft_ctx *ctx, - const char *tablename) - { -@@ -215,6 +213,17 @@ static int nft_parse_compat(const struct nlattr *attr, u16 *proto, bool *inv) - return 0; - } - -+static void nft_compat_wait_for_destructors(void) -+{ -+ /* xtables matches or targets can have side effects, e.g. -+ * creation/destruction of /proc files. -+ * The xt ->destroy functions are run asynchronously from -+ * work queue. If we have pending invocations we thus -+ * need to wait for those to finish. -+ */ -+ nf_tables_trans_destroy_flush_work(); -+} -+ - static int - nft_target_init(const struct nft_ctx *ctx, const struct nft_expr *expr, - const struct nlattr * const tb[]) -@@ -238,14 +247,7 @@ nft_target_init(const struct nft_ctx *ctx, const struct nft_expr *expr, - - nft_target_set_tgchk_param(&par, ctx, target, info, &e, proto, inv); - -- /* xtables matches or targets can have side effects, e.g. -- * creation/destruction of /proc files. -- * The xt ->destroy functions are run asynchronously from -- * work queue. If we have pending invocations we thus -- * need to wait for those to finish. -- */ -- if (refcount_read(&nft_compat_pending_destroy) > 1) -- nf_tables_trans_destroy_flush_work(); -+ nft_compat_wait_for_destructors(); - - ret = xt_check_target(&par, size, proto, inv); - if (ret < 0) -@@ -260,7 +262,6 @@ nft_target_init(const struct nft_ctx *ctx, const struct nft_expr *expr, - - static void __nft_mt_tg_destroy(struct module *me, const struct nft_expr *expr) - { -- refcount_dec(&nft_compat_pending_destroy); - module_put(me); - kfree(expr->ops); - } -@@ -468,6 +469,8 @@ __nft_match_init(const struct nft_ctx *ctx, const struct nft_expr *expr, - - nft_match_set_mtchk_param(&par, ctx, match, info, &e, proto, inv); - -+ nft_compat_wait_for_destructors(); -+ - return xt_check_match(&par, size, proto, inv); - } - -@@ -716,14 +719,6 @@ static const struct nfnetlink_subsystem nfnl_compat_subsys = { - - static struct nft_expr_type nft_match_type; - --static void nft_mt_tg_deactivate(const struct nft_ctx *ctx, -- const struct nft_expr *expr, -- enum nft_trans_phase phase) --{ -- if (phase == NFT_TRANS_COMMIT) -- refcount_inc(&nft_compat_pending_destroy); --} -- - static const struct nft_expr_ops * - nft_match_select_ops(const struct nft_ctx *ctx, - const struct nlattr * const tb[]) -@@ -762,7 +757,6 @@ nft_match_select_ops(const struct nft_ctx *ctx, - ops->type = &nft_match_type; - ops->eval = nft_match_eval; - ops->init = nft_match_init; -- ops->deactivate = nft_mt_tg_deactivate, - ops->destroy = nft_match_destroy; - ops->dump = nft_match_dump; - ops->validate = nft_match_validate; -@@ -853,7 +847,6 @@ nft_target_select_ops(const struct nft_ctx *ctx, - ops->size = NFT_EXPR_SIZE(XT_ALIGN(target->targetsize)); - ops->init = nft_target_init; - ops->destroy = nft_target_destroy; -- ops->deactivate = nft_mt_tg_deactivate, - ops->dump = nft_target_dump; - ops->validate = nft_target_validate; - ops->data = target; -@@ -917,8 +910,6 @@ static void __exit nft_compat_module_exit(void) - nfnetlink_subsys_unregister(&nfnl_compat_subsys); - nft_unregister_expr(&nft_target_type); - nft_unregister_expr(&nft_match_type); -- -- WARN_ON_ONCE(refcount_read(&nft_compat_pending_destroy) != 1); - } - - MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_NFT_COMPAT); -diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c -index 105d17af4abcc..0d4a2bb09589c 100644 ---- a/net/sunrpc/addr.c -+++ b/net/sunrpc/addr.c -@@ -185,7 +185,7 @@ static int rpc_parse_scope_id(struct net *net, const char *buf, - scope_id = dev->ifindex; - dev_put(dev); - } else { -- if (kstrtou32(p, 10, &scope_id) == 0) { -+ if (kstrtou32(p, 10, &scope_id) != 0) { - kfree(p); - return 0; - } -diff --git a/security/lsm_audit.c b/security/lsm_audit.c -index e40874373f2b4..d025f575a9e30 100644 ---- a/security/lsm_audit.c -+++ b/security/lsm_audit.c -@@ -274,7 +274,9 @@ static void dump_common_audit_data(struct audit_buffer *ab, - struct inode *inode; - - audit_log_format(ab, " name="); -+ spin_lock(&a->u.dentry->d_lock); - audit_log_untrustedstring(ab, a->u.dentry->d_name.name); -+ spin_unlock(&a->u.dentry->d_lock); - - inode = d_backing_inode(a->u.dentry); - if (inode) { -@@ -292,8 +294,9 @@ static void dump_common_audit_data(struct audit_buffer *ab, - dentry = d_find_alias(inode); - if (dentry) { - audit_log_format(ab, " name="); -- audit_log_untrustedstring(ab, -- dentry->d_name.name); -+ spin_lock(&dentry->d_lock); -+ audit_log_untrustedstring(ab, dentry->d_name.name); -+ spin_unlock(&dentry->d_lock); - dput(dentry); - } - audit_log_format(ab, " dev="); -diff --git a/sound/firewire/fireface/ff-transaction.c b/sound/firewire/fireface/ff-transaction.c -index 7f82762ccc8c8..ee7122c461d46 100644 ---- a/sound/firewire/fireface/ff-transaction.c -+++ b/sound/firewire/fireface/ff-transaction.c -@@ -88,7 +88,7 @@ static void transmit_midi_msg(struct snd_ff *ff, unsigned int port) - - /* Set interval to next transaction. */ - ff->next_ktime[port] = ktime_add_ns(ktime_get(), -- ff->rx_bytes[port] * 8 * NSEC_PER_SEC / 31250); -+ ff->rx_bytes[port] * 8 * (NSEC_PER_SEC / 31250)); - - if (quad_count == 1) - tcode = TCODE_WRITE_QUADLET_REQUEST; -diff --git a/sound/firewire/tascam/tascam-transaction.c b/sound/firewire/tascam/tascam-transaction.c -index 90288b4b46379..a073cece4a7d5 100644 ---- a/sound/firewire/tascam/tascam-transaction.c -+++ b/sound/firewire/tascam/tascam-transaction.c -@@ -209,7 +209,7 @@ static void midi_port_work(struct work_struct *work) - - /* Set interval to next transaction. */ - port->next_ktime = ktime_add_ns(ktime_get(), -- port->consume_bytes * 8 * NSEC_PER_SEC / 31250); -+ port->consume_bytes * 8 * (NSEC_PER_SEC / 31250)); - - /* Start this transaction. */ - port->idling = false; -diff --git a/sound/soc/intel/skylake/cnl-sst.c b/sound/soc/intel/skylake/cnl-sst.c -index c6abcd5aa67b9..e808f62960ba7 100644 ---- a/sound/soc/intel/skylake/cnl-sst.c -+++ b/sound/soc/intel/skylake/cnl-sst.c -@@ -224,6 +224,7 @@ static int cnl_set_dsp_D0(struct sst_dsp *ctx, unsigned int core_id) - "dsp boot timeout, status=%#x error=%#x\n", - sst_dsp_shim_read(ctx, CNL_ADSP_FW_STATUS), - sst_dsp_shim_read(ctx, CNL_ADSP_ERROR_CODE)); -+ ret = -ETIMEDOUT; - goto err; - } - } else { -diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c -index e25336f739123..f5a431b8de6c3 100644 ---- a/sound/soc/meson/axg-tdm-interface.c -+++ b/sound/soc/meson/axg-tdm-interface.c -@@ -467,8 +467,20 @@ static int axg_tdm_iface_set_bias_level(struct snd_soc_component *component, - return ret; - } - -+static const struct snd_soc_dapm_widget axg_tdm_iface_dapm_widgets[] = { -+ SND_SOC_DAPM_SIGGEN("Playback Signal"), -+}; -+ -+static const struct snd_soc_dapm_route axg_tdm_iface_dapm_routes[] = { -+ { "Loopback", NULL, "Playback Signal" }, -+}; -+ - static const struct snd_soc_component_driver axg_tdm_iface_component_drv = { -- .set_bias_level = axg_tdm_iface_set_bias_level, -+ .dapm_widgets = axg_tdm_iface_dapm_widgets, -+ .num_dapm_widgets = ARRAY_SIZE(axg_tdm_iface_dapm_widgets), -+ .dapm_routes = axg_tdm_iface_dapm_routes, -+ .num_dapm_routes = ARRAY_SIZE(axg_tdm_iface_dapm_routes), -+ .set_bias_level = axg_tdm_iface_set_bias_level, - }; - - static const struct of_device_id axg_tdm_iface_of_match[] = { -diff --git a/sound/soc/meson/axg-tdmin.c b/sound/soc/meson/axg-tdmin.c -index 88ed95ae886bb..b4faf9d5c1aad 100644 ---- a/sound/soc/meson/axg-tdmin.c -+++ b/sound/soc/meson/axg-tdmin.c -@@ -224,15 +224,6 @@ static const struct axg_tdm_formatter_ops axg_tdmin_ops = { - }; - - static const struct axg_tdm_formatter_driver axg_tdmin_drv = { -- .component_drv = &axg_tdmin_component_drv, -- .regmap_cfg = &axg_tdmin_regmap_cfg, -- .ops = &axg_tdmin_ops, -- .quirks = &(const struct axg_tdm_formatter_hw) { -- .skew_offset = 2, -- }, --}; -- --static const struct axg_tdm_formatter_driver g12a_tdmin_drv = { - .component_drv = &axg_tdmin_component_drv, - .regmap_cfg = &axg_tdmin_regmap_cfg, - .ops = &axg_tdmin_ops, -@@ -247,10 +238,10 @@ static const struct of_device_id axg_tdmin_of_match[] = { - .data = &axg_tdmin_drv, - }, { - .compatible = "amlogic,g12a-tdmin", -- .data = &g12a_tdmin_drv, -+ .data = &axg_tdmin_drv, - }, { - .compatible = "amlogic,sm1-tdmin", -- .data = &g12a_tdmin_drv, -+ .data = &axg_tdmin_drv, - }, {} - }; - MODULE_DEVICE_TABLE(of, axg_tdmin_of_match); -diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c -index 06aa393797497..7c4d5963692dd 100644 ---- a/sound/soc/soc-dapm.c -+++ b/sound/soc/soc-dapm.c -@@ -2484,6 +2484,7 @@ void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w) - enum snd_soc_dapm_direction dir; - - list_del(&w->list); -+ list_del(&w->dirty); - /* - * remove source and sink paths associated to this widget. - * While removing the path, remove reference to it from both -diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c -index ea277ce63a463..767fe1bfd922c 100644 ---- a/tools/perf/util/machine.c -+++ b/tools/perf/util/machine.c -@@ -2587,7 +2587,7 @@ int machines__for_each_thread(struct machines *machines, - - pid_t machine__get_current_tid(struct machine *machine, int cpu) - { -- int nr_cpus = min(machine->env->nr_cpus_online, MAX_NR_CPUS); -+ int nr_cpus = min(machine->env->nr_cpus_avail, MAX_NR_CPUS); - - if (cpu < 0 || cpu >= nr_cpus || !machine->current_tid) - return -1; -@@ -2599,7 +2599,7 @@ int machine__set_current_tid(struct machine *machine, int cpu, pid_t pid, - pid_t tid) - { - struct thread *thread; -- int nr_cpus = min(machine->env->nr_cpus_online, MAX_NR_CPUS); -+ int nr_cpus = min(machine->env->nr_cpus_avail, MAX_NR_CPUS); - - if (cpu < 0) - return -EINVAL; -diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c -index ff524a3fc5003..b21a4b1918db5 100644 ---- a/tools/perf/util/session.c -+++ b/tools/perf/util/session.c -@@ -2314,7 +2314,7 @@ int perf_session__cpu_bitmap(struct perf_session *session, - { - int i, err = -1; - struct perf_cpu_map *map; -- int nr_cpus = min(session->header.env.nr_cpus_online, MAX_NR_CPUS); -+ int nr_cpus = min(session->header.env.nr_cpus_avail, MAX_NR_CPUS); - - for (i = 0; i < PERF_TYPE_MAX; ++i) { - struct evsel *evsel; -diff --git a/tools/testing/selftests/net/udpgro.sh b/tools/testing/selftests/net/udpgro.sh -index ac2a30be9b325..f8a19f548ae9d 100755 ---- a/tools/testing/selftests/net/udpgro.sh -+++ b/tools/testing/selftests/net/udpgro.sh -@@ -5,6 +5,14 @@ - - readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)" - -+# set global exit status, but never reset nonzero one. -+check_err() -+{ -+ if [ $ret -eq 0 ]; then -+ ret=$1 -+ fi -+} -+ - cleanup() { - local -r jobs="$(jobs -p)" - local -r ns="$(ip netns list|grep $PEER_NS)" -@@ -44,7 +52,9 @@ run_one() { - # Hack: let bg programs complete the startup - sleep 0.1 - ./udpgso_bench_tx ${tx_args} -+ ret=$? - wait $(jobs -p) -+ return $ret - } - - run_test() { -@@ -87,8 +97,10 @@ run_one_nat() { - - sleep 0.1 - ./udpgso_bench_tx ${tx_args} -+ ret=$? - kill -INT $pid - wait $(jobs -p) -+ return $ret - } - - run_one_2sock() { -@@ -110,7 +122,9 @@ run_one_2sock() { - sleep 0.1 - # first UDP GSO socket should be closed at this point - ./udpgso_bench_tx ${tx_args} -+ ret=$? - wait $(jobs -p) -+ return $ret - } - - run_nat_test() { -@@ -131,36 +145,54 @@ run_all() { - local -r core_args="-l 4" - local -r ipv4_args="${core_args} -4 -D 192.168.1.1" - local -r ipv6_args="${core_args} -6 -D 2001:db8::1" -+ ret=0 - - echo "ipv4" - run_test "no GRO" "${ipv4_args} -M 10 -s 1400" "-4 -n 10 -l 1400" -+ check_err $? - - # explicitly check we are not receiving UDP_SEGMENT cmsg (-S -1) - # when GRO does not take place - run_test "no GRO chk cmsg" "${ipv4_args} -M 10 -s 1400" "-4 -n 10 -l 1400 -S -1" -+ check_err $? - - # the GSO packets are aggregated because: - # * veth schedule napi after each xmit - # * segmentation happens in BH context, veth napi poll is delayed after - # the transmission of the last segment - run_test "GRO" "${ipv4_args} -M 1 -s 14720 -S 0 " "-4 -n 1 -l 14720" -+ check_err $? - run_test "GRO chk cmsg" "${ipv4_args} -M 1 -s 14720 -S 0 " "-4 -n 1 -l 14720 -S 1472" -+ check_err $? - run_test "GRO with custom segment size" "${ipv4_args} -M 1 -s 14720 -S 500 " "-4 -n 1 -l 14720" -+ check_err $? - run_test "GRO with custom segment size cmsg" "${ipv4_args} -M 1 -s 14720 -S 500 " "-4 -n 1 -l 14720 -S 500" -+ check_err $? - - run_nat_test "bad GRO lookup" "${ipv4_args} -M 1 -s 14720 -S 0" "-n 10 -l 1472" -+ check_err $? - run_2sock_test "multiple GRO socks" "${ipv4_args} -M 1 -s 14720 -S 0 " "-4 -n 1 -l 14720 -S 1472" -+ check_err $? - - echo "ipv6" - run_test "no GRO" "${ipv6_args} -M 10 -s 1400" "-n 10 -l 1400" -+ check_err $? - run_test "no GRO chk cmsg" "${ipv6_args} -M 10 -s 1400" "-n 10 -l 1400 -S -1" -+ check_err $? - run_test "GRO" "${ipv6_args} -M 1 -s 14520 -S 0" "-n 1 -l 14520" -+ check_err $? - run_test "GRO chk cmsg" "${ipv6_args} -M 1 -s 14520 -S 0" "-n 1 -l 14520 -S 1452" -+ check_err $? - run_test "GRO with custom segment size" "${ipv6_args} -M 1 -s 14520 -S 500" "-n 1 -l 14520" -+ check_err $? - run_test "GRO with custom segment size cmsg" "${ipv6_args} -M 1 -s 14520 -S 500" "-n 1 -l 14520 -S 500" -+ check_err $? - - run_nat_test "bad GRO lookup" "${ipv6_args} -M 1 -s 14520 -S 0" "-n 10 -l 1452" -+ check_err $? - run_2sock_test "multiple GRO socks" "${ipv6_args} -M 1 -s 14520 -S 0 " "-n 1 -l 14520 -S 1452" -+ check_err $? -+ return $ret - } - - if [ ! -f ../bpf/xdp_dummy.o ]; then -@@ -180,3 +212,5 @@ elif [[ $1 == "__subprocess_2sock" ]]; then - shift - run_one_2sock $@ - fi -+ -+exit $? diff --git a/patch/kernel/odroidxu4-current/patch-5.4.91-92.patch b/patch/kernel/odroidxu4-current/patch-5.4.91-92.patch deleted file mode 100644 index 65ab41d4d3..0000000000 --- a/patch/kernel/odroidxu4-current/patch-5.4.91-92.patch +++ /dev/null @@ -1,756 +0,0 @@ -diff --git a/Makefile b/Makefile -index a5edbd4f34145..5bae2206a35e7 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - VERSION = 5 - PATCHLEVEL = 4 --SUBLEVEL = 91 -+SUBLEVEL = 92 - EXTRAVERSION = - NAME = Kleptomaniac Octopus - -diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c -index 6988bbf2576f5..9a77b70ad601b 100644 ---- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c -+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c -@@ -4790,8 +4790,6 @@ static void mvpp2_phylink_validate(struct phylink_config *config, - - phylink_set(mask, Autoneg); - phylink_set_port_modes(mask); -- phylink_set(mask, Pause); -- phylink_set(mask, Asym_Pause); - - switch (state->interface) { - case PHY_INTERFACE_MODE_10GKR: -diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -index 71c90c8a9e943..c3fc1cc4bb2b9 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -19,7 +19,7 @@ - #define MLXSW_THERMAL_ASIC_TEMP_NORM 75000 /* 75C */ - #define MLXSW_THERMAL_ASIC_TEMP_HIGH 85000 /* 85C */ - #define MLXSW_THERMAL_ASIC_TEMP_HOT 105000 /* 105C */ --#define MLXSW_THERMAL_ASIC_TEMP_CRIT 110000 /* 110C */ -+#define MLXSW_THERMAL_ASIC_TEMP_CRIT 140000 /* 140C */ - #define MLXSW_THERMAL_HYSTERESIS_TEMP 5000 /* 5C */ - #define MLXSW_THERMAL_MODULE_TEMP_SHIFT (MLXSW_THERMAL_HYSTERESIS_TEMP * 2) - #define MLXSW_THERMAL_ZONE_MAX_NAME 16 -@@ -177,6 +177,12 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core, - if (err) - return err; - -+ if (crit_temp > emerg_temp) { -+ dev_warn(dev, "%s : Critical threshold %d is above emergency threshold %d\n", -+ tz->tzdev->type, crit_temp, emerg_temp); -+ return 0; -+ } -+ - /* According to the system thermal requirements, the thermal zones are - * defined with four trip points. The critical and emergency - * temperature thresholds, provided by QSFP module are set as "active" -@@ -191,11 +197,8 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core, - tz->trips[MLXSW_THERMAL_TEMP_TRIP_NORM].temp = crit_temp; - tz->trips[MLXSW_THERMAL_TEMP_TRIP_HIGH].temp = crit_temp; - tz->trips[MLXSW_THERMAL_TEMP_TRIP_HOT].temp = emerg_temp; -- if (emerg_temp > crit_temp) -- tz->trips[MLXSW_THERMAL_TEMP_TRIP_CRIT].temp = emerg_temp + -+ tz->trips[MLXSW_THERMAL_TEMP_TRIP_CRIT].temp = emerg_temp + - MLXSW_THERMAL_MODULE_TEMP_SHIFT; -- else -- tz->trips[MLXSW_THERMAL_TEMP_TRIP_CRIT].temp = emerg_temp; - - return 0; - } -diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c -index c692a41e45480..25b6f2ee2beb8 100644 ---- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c -+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c -@@ -564,11 +564,6 @@ static const struct net_device_ops netxen_netdev_ops = { - .ndo_set_features = netxen_set_features, - }; - --static inline bool netxen_function_zero(struct pci_dev *pdev) --{ -- return (PCI_FUNC(pdev->devfn) == 0) ? true : false; --} -- - static inline void netxen_set_interrupt_mode(struct netxen_adapter *adapter, - u32 mode) - { -@@ -664,7 +659,7 @@ static int netxen_setup_intr(struct netxen_adapter *adapter) - netxen_initialize_interrupt_registers(adapter); - netxen_set_msix_bit(pdev, 0); - -- if (netxen_function_zero(pdev)) { -+ if (adapter->portnum == 0) { - if (!netxen_setup_msi_interrupts(adapter, num_msix)) - netxen_set_interrupt_mode(adapter, NETXEN_MSI_MODE); - else -diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -index 18c5a9bb6759c..ce5d3e9e5dff4 100644 ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -3739,6 +3739,7 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu) - { - struct stmmac_priv *priv = netdev_priv(dev); - int txfifosz = priv->plat->tx_fifo_size; -+ const int mtu = new_mtu; - - if (txfifosz == 0) - txfifosz = priv->dma_cap.tx_fifo_size; -@@ -3756,7 +3757,7 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu) - if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB)) - return -EINVAL; - -- dev->mtu = new_mtu; -+ dev->mtu = mtu; - - netdev_update_features(dev); - -diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c -index 6fa7a009a24a4..f9b359d4e2939 100644 ---- a/drivers/net/usb/rndis_host.c -+++ b/drivers/net/usb/rndis_host.c -@@ -387,7 +387,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) - reply_len = sizeof *phym; - retval = rndis_query(dev, intf, u.buf, - RNDIS_OID_GEN_PHYSICAL_MEDIUM, -- 0, (void **) &phym, &reply_len); -+ reply_len, (void **)&phym, &reply_len); - if (retval != 0 || !phym) { - /* OID is optional so don't fail here. */ - phym_unspec = cpu_to_le32(RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED); -diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c -index 590a49e847626..418d62e945544 100644 ---- a/drivers/scsi/lpfc/lpfc_nportdisc.c -+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c -@@ -286,7 +286,7 @@ lpfc_els_abort(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) - * This routine is only called if we are SLI3, direct connect pt2pt - * mode and the remote NPort issues the PLOGI after link up. - */ --void -+static void - lpfc_defer_pt2pt_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *link_mbox) - { - LPFC_MBOXQ_t *login_mbox; -@@ -340,7 +340,7 @@ lpfc_defer_pt2pt_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *link_mbox) - * This routine is only called if we are SLI4, acting in target - * mode and the remote NPort issues the PLOGI after link up. - **/ --void -+static void - lpfc_defer_acc_rsp(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) - { - struct lpfc_vport *vport = pmb->vport; -diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c -index 82a0ee09cbe14..1d0c335b0bf88 100644 ---- a/drivers/spi/spi-cadence.c -+++ b/drivers/spi/spi-cadence.c -@@ -115,6 +115,7 @@ struct cdns_spi { - void __iomem *regs; - struct clk *ref_clk; - struct clk *pclk; -+ unsigned int clk_rate; - u32 speed_hz; - const u8 *txbuf; - u8 *rxbuf; -@@ -250,7 +251,7 @@ static void cdns_spi_config_clock_freq(struct spi_device *spi, - u32 ctrl_reg, baud_rate_val; - unsigned long frequency; - -- frequency = clk_get_rate(xspi->ref_clk); -+ frequency = xspi->clk_rate; - - ctrl_reg = cdns_spi_read(xspi, CDNS_SPI_CR); - -@@ -558,8 +559,9 @@ static int cdns_spi_probe(struct platform_device *pdev) - master->auto_runtime_pm = true; - master->mode_bits = SPI_CPOL | SPI_CPHA; - -+ xspi->clk_rate = clk_get_rate(xspi->ref_clk); - /* Set to default valid value */ -- master->max_speed_hz = clk_get_rate(xspi->ref_clk) / 4; -+ master->max_speed_hz = xspi->clk_rate / 4; - xspi->speed_hz = master->max_speed_hz; - - master->bits_per_word_mask = SPI_BPW_MASK(8); -diff --git a/drivers/spi/spi-npcm-fiu.c b/drivers/spi/spi-npcm-fiu.c -index 5ed7c9e017fb1..1e770d6739050 100644 ---- a/drivers/spi/spi-npcm-fiu.c -+++ b/drivers/spi/spi-npcm-fiu.c -@@ -677,8 +677,7 @@ static int npcm_fiu_probe(struct platform_device *pdev) - struct npcm_fiu_spi *fiu; - void __iomem *regbase; - struct resource *res; -- int ret; -- int id; -+ int id, ret; - - ctrl = devm_spi_alloc_master(dev, sizeof(*fiu)); - if (!ctrl) -@@ -738,9 +737,9 @@ static int npcm_fiu_probe(struct platform_device *pdev) - - ret = devm_spi_register_master(dev, ctrl); - if (ret) -- return ret; -+ clk_disable_unprepare(fiu->clk); - -- return 0; -+ return ret; - } - - static int npcm_fiu_remove(struct platform_device *pdev) -diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c -index 5eb62240c7f87..833f51282accc 100644 ---- a/drivers/usb/host/ohci-hcd.c -+++ b/drivers/usb/host/ohci-hcd.c -@@ -102,7 +102,7 @@ static void io_watchdog_func(struct timer_list *t); - - - /* Some boards misreport power switching/overcurrent */ --static bool distrust_firmware = true; -+static bool distrust_firmware; - module_param (distrust_firmware, bool, 0); - MODULE_PARM_DESC (distrust_firmware, - "true to distrust firmware power/overcurrent setup"); -diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c -index c6070e70dd73d..9c9422e9fac4d 100644 ---- a/drivers/xen/privcmd.c -+++ b/drivers/xen/privcmd.c -@@ -724,14 +724,15 @@ static long privcmd_ioctl_restrict(struct file *file, void __user *udata) - return 0; - } - --static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata) -+static long privcmd_ioctl_mmap_resource(struct file *file, -+ struct privcmd_mmap_resource __user *udata) - { - struct privcmd_data *data = file->private_data; - struct mm_struct *mm = current->mm; - struct vm_area_struct *vma; - struct privcmd_mmap_resource kdata; - xen_pfn_t *pfns = NULL; -- struct xen_mem_acquire_resource xdata; -+ struct xen_mem_acquire_resource xdata = { }; - int rc; - - if (copy_from_user(&kdata, udata, sizeof(kdata))) -@@ -741,6 +742,22 @@ static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata) - if (data->domid != DOMID_INVALID && data->domid != kdata.dom) - return -EPERM; - -+ /* Both fields must be set or unset */ -+ if (!!kdata.addr != !!kdata.num) -+ return -EINVAL; -+ -+ xdata.domid = kdata.dom; -+ xdata.type = kdata.type; -+ xdata.id = kdata.id; -+ -+ if (!kdata.addr && !kdata.num) { -+ /* Query the size of the resource. */ -+ rc = HYPERVISOR_memory_op(XENMEM_acquire_resource, &xdata); -+ if (rc) -+ return rc; -+ return __put_user(xdata.nr_frames, &udata->num); -+ } -+ - down_write(&mm->mmap_sem); - - vma = find_vma(mm, kdata.addr); -@@ -775,10 +792,6 @@ static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata) - } else - vma->vm_private_data = PRIV_VMA_LOCKED; - -- memset(&xdata, 0, sizeof(xdata)); -- xdata.domid = kdata.dom; -- xdata.type = kdata.type; -- xdata.id = kdata.id; - xdata.frame = kdata.idx; - xdata.nr_frames = kdata.num; - set_xen_guest_handle(xdata.frame_list, pfns); -diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c -index 86e5658651f10..8f077e66e613f 100644 ---- a/fs/nfsd/nfs3xdr.c -+++ b/fs/nfsd/nfs3xdr.c -@@ -857,9 +857,14 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp, - if (isdotent(name, namlen)) { - if (namlen == 2) { - dchild = dget_parent(dparent); -- /* filesystem root - cannot return filehandle for ".." */ -+ /* -+ * Don't return filehandle for ".." if we're at -+ * the filesystem or export root: -+ */ - if (dchild == dparent) - goto out; -+ if (dparent == exp->ex_path.dentry) -+ goto out; - } else - dchild = dget(dparent); - } else -diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h -index d8fab3ecf5120..180b52419136f 100644 ---- a/include/linux/compiler-gcc.h -+++ b/include/linux/compiler-gcc.h -@@ -12,6 +12,12 @@ - - #if GCC_VERSION < 40600 - # error Sorry, your compiler is too old - please upgrade it. -+#elif defined(CONFIG_ARM64) && GCC_VERSION < 50100 -+/* -+ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293 -+ * https://lore.kernel.org/r/20210107111841.GN1551@shell.armlinux.org.uk -+ */ -+# error Sorry, your version of GCC is too old - please use 5.1 or newer. - #endif - - /* -diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h -index 4cad0e784b286..b81f9e1d74b0a 100644 ---- a/include/linux/elfcore.h -+++ b/include/linux/elfcore.h -@@ -58,6 +58,7 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse - } - #endif - -+#if defined(CONFIG_UM) || defined(CONFIG_IA64) - /* - * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out - * extra segments containing the gate DSO contents. Dumping its -@@ -72,5 +73,26 @@ elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset); - extern int - elf_core_write_extra_data(struct coredump_params *cprm); - extern size_t elf_core_extra_data_size(void); -+#else -+static inline Elf_Half elf_core_extra_phdrs(void) -+{ -+ return 0; -+} -+ -+static inline int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset) -+{ -+ return 1; -+} -+ -+static inline int elf_core_write_extra_data(struct coredump_params *cprm) -+{ -+ return 1; -+} -+ -+static inline size_t elf_core_extra_data_size(void) -+{ -+ return 0; -+} -+#endif - - #endif /* _LINUX_ELFCORE_H */ -diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h -index 68139cc2f3ca3..6493c98c86317 100644 ---- a/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -1480,6 +1480,11 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb) - skb->next = NULL; - } - -+/* Iterate through singly-linked GSO fragments of an skb. */ -+#define skb_list_walk_safe(first, skb, next_skb) \ -+ for ((skb) = (first), (next_skb) = (skb) ? (skb)->next : NULL; (skb); \ -+ (skb) = (next_skb), (next_skb) = (skb) ? (skb)->next : NULL) -+ - static inline void skb_list_del_init(struct sk_buff *skb) - { - __list_del_entry(&skb->list); -diff --git a/kernel/Makefile b/kernel/Makefile -index f2cc0d118a0bc..6aef13053a5c4 100644 ---- a/kernel/Makefile -+++ b/kernel/Makefile -@@ -93,7 +93,6 @@ obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o - obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o - obj-$(CONFIG_TRACEPOINTS) += tracepoint.o - obj-$(CONFIG_LATENCYTOP) += latencytop.o --obj-$(CONFIG_ELFCORE) += elfcore.o - obj-$(CONFIG_FUNCTION_TRACER) += trace/ - obj-$(CONFIG_TRACING) += trace/ - obj-$(CONFIG_TRACE_CLOCK) += trace/ -diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c -index b701af27a7799..5a8b4dfdb1419 100644 ---- a/kernel/bpf/cgroup.c -+++ b/kernel/bpf/cgroup.c -@@ -1057,12 +1057,13 @@ int __cgroup_bpf_run_filter_setsockopt(struct sock *sk, int *level, - if (ctx.optlen != 0) { - *optlen = ctx.optlen; - *kernel_optval = ctx.optval; -+ /* export and don't free sockopt buf */ -+ return 0; - } - } - - out: -- if (ret) -- sockopt_free_buf(&ctx); -+ sockopt_free_buf(&ctx); - return ret; - } - EXPORT_SYMBOL(__cgroup_bpf_run_filter_setsockopt); -diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c -index 5e28718928cad..a77d2814cac5d 100644 ---- a/kernel/bpf/helpers.c -+++ b/kernel/bpf/helpers.c -@@ -105,7 +105,7 @@ BPF_CALL_2(bpf_map_peek_elem, struct bpf_map *, map, void *, value) - } - - const struct bpf_func_proto bpf_map_peek_elem_proto = { -- .func = bpf_map_pop_elem, -+ .func = bpf_map_peek_elem, - .gpl_only = false, - .ret_type = RET_INTEGER, - .arg1_type = ARG_CONST_MAP_PTR, -diff --git a/kernel/elfcore.c b/kernel/elfcore.c -deleted file mode 100644 -index 57fb4dcff4349..0000000000000 ---- a/kernel/elfcore.c -+++ /dev/null -@@ -1,26 +0,0 @@ --// SPDX-License-Identifier: GPL-2.0 --#include --#include --#include --#include --#include -- --Elf_Half __weak elf_core_extra_phdrs(void) --{ -- return 0; --} -- --int __weak elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset) --{ -- return 1; --} -- --int __weak elf_core_write_extra_data(struct coredump_params *cprm) --{ -- return 1; --} -- --size_t __weak elf_core_extra_data_size(void) --{ -- return 0; --} -diff --git a/net/core/filter.c b/net/core/filter.c -index b040b7bf28582..2fa10fdcf6b1d 100644 ---- a/net/core/filter.c -+++ b/net/core/filter.c -@@ -1475,7 +1475,7 @@ struct bpf_prog *__get_filter(struct sock_fprog *fprog, struct sock *sk) - - if (copy_from_user(prog->insns, fprog->filter, fsize)) { - __bpf_prog_free(prog); -- return ERR_PTR(-EFAULT); -+ return ERR_PTR(-EINVAL); - } - - prog->len = fprog->len; -diff --git a/net/core/skbuff.c b/net/core/skbuff.c -index 49d923c227a21..961cb5a88c958 100644 ---- a/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -496,13 +496,17 @@ EXPORT_SYMBOL(__netdev_alloc_skb); - struct sk_buff *__napi_alloc_skb(struct napi_struct *napi, unsigned int len, - gfp_t gfp_mask) - { -- struct napi_alloc_cache *nc = this_cpu_ptr(&napi_alloc_cache); -+ struct napi_alloc_cache *nc; - struct sk_buff *skb; - void *data; - - len += NET_SKB_PAD + NET_IP_ALIGN; - -- if ((len > SKB_WITH_OVERHEAD(PAGE_SIZE)) || -+ /* If requested length is either too small or too big, -+ * we use kmalloc() for skb->head allocation. -+ */ -+ if (len <= SKB_WITH_OVERHEAD(1024) || -+ len > SKB_WITH_OVERHEAD(PAGE_SIZE) || - (gfp_mask & (__GFP_DIRECT_RECLAIM | GFP_DMA))) { - skb = __alloc_skb(len, gfp_mask, SKB_ALLOC_RX, NUMA_NO_NODE); - if (!skb) -@@ -510,6 +514,7 @@ struct sk_buff *__napi_alloc_skb(struct napi_struct *napi, unsigned int len, - goto skb_success; - } - -+ nc = this_cpu_ptr(&napi_alloc_cache); - len += SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); - len = SKB_DATA_ALIGN(len); - -diff --git a/net/core/sock_reuseport.c b/net/core/sock_reuseport.c -index 40829111fe00c..273c921751e49 100644 ---- a/net/core/sock_reuseport.c -+++ b/net/core/sock_reuseport.c -@@ -302,7 +302,7 @@ select_by_hash: - i = j = reciprocal_scale(hash, socks); - while (reuse->socks[i]->sk_state == TCP_ESTABLISHED) { - i++; -- if (i >= reuse->num_socks) -+ if (i >= socks) - i = 0; - if (i == j) - goto out; -diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c -index 0fd1c2aa13615..e9ecbb57df455 100644 ---- a/net/dcb/dcbnl.c -+++ b/net/dcb/dcbnl.c -@@ -1765,6 +1765,8 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, - fn = &reply_funcs[dcb->cmd]; - if (!fn->cb) - return -EOPNOTSUPP; -+ if (fn->type == RTM_SETDCB && !netlink_capable(skb, CAP_NET_ADMIN)) -+ return -EPERM; - - if (!tb[DCB_ATTR_IFNAME]) - return -EINVAL; -diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c -index 5c967764041f4..00210e55b4cd1 100644 ---- a/net/ipv4/esp4.c -+++ b/net/ipv4/esp4.c -@@ -272,7 +272,6 @@ static int esp_output_udp_encap(struct xfrm_state *x, struct sk_buff *skb, struc - int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) - { - u8 *tail; -- u8 *vaddr; - int nfrags; - int esph_offset; - struct page *page; -@@ -314,14 +313,10 @@ int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info * - page = pfrag->page; - get_page(page); - -- vaddr = kmap_atomic(page); -- -- tail = vaddr + pfrag->offset; -+ tail = page_address(page) + pfrag->offset; - - esp_output_fill_trailer(tail, esp->tfclen, esp->plen, esp->proto); - -- kunmap_atomic(vaddr); -- - nfrags = skb_shinfo(skb)->nr_frags; - - __skb_fill_page_desc(skb, nfrags, page, pfrag->offset, -diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c -index a3b403ba8f8f0..7a739f16d82b2 100644 ---- a/net/ipv6/esp6.c -+++ b/net/ipv6/esp6.c -@@ -226,7 +226,6 @@ static void esp_output_fill_trailer(u8 *tail, int tfclen, int plen, __u8 proto) - int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp) - { - u8 *tail; -- u8 *vaddr; - int nfrags; - struct page *page; - struct sk_buff *trailer; -@@ -259,14 +258,10 @@ int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info - page = pfrag->page; - get_page(page); - -- vaddr = kmap_atomic(page); -- -- tail = vaddr + pfrag->offset; -+ tail = page_address(page) + pfrag->offset; - - esp_output_fill_trailer(tail, esp->tfclen, esp->plen, esp->proto); - -- kunmap_atomic(vaddr); -- - nfrags = skb_shinfo(skb)->nr_frags; - - __skb_fill_page_desc(skb, nfrags, page, pfrag->offset, -diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c -index 78d495581d696..7a80c42fcce2f 100644 ---- a/net/ipv6/ip6_output.c -+++ b/net/ipv6/ip6_output.c -@@ -124,8 +124,43 @@ static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff * - return -EINVAL; - } - -+static int -+ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk, -+ struct sk_buff *skb, unsigned int mtu) -+{ -+ struct sk_buff *segs, *nskb; -+ netdev_features_t features; -+ int ret = 0; -+ -+ /* Please see corresponding comment in ip_finish_output_gso -+ * describing the cases where GSO segment length exceeds the -+ * egress MTU. -+ */ -+ features = netif_skb_features(skb); -+ segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK); -+ if (IS_ERR_OR_NULL(segs)) { -+ kfree_skb(skb); -+ return -ENOMEM; -+ } -+ -+ consume_skb(skb); -+ -+ skb_list_walk_safe(segs, segs, nskb) { -+ int err; -+ -+ skb_mark_not_on_list(segs); -+ err = ip6_fragment(net, sk, segs, ip6_finish_output2); -+ if (err && ret == 0) -+ ret = err; -+ } -+ -+ return ret; -+} -+ - static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff *skb) - { -+ unsigned int mtu; -+ - #if defined(CONFIG_NETFILTER) && defined(CONFIG_XFRM) - /* Policy lookup after SNAT yielded a new policy */ - if (skb_dst(skb)->xfrm) { -@@ -134,7 +169,11 @@ static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff - } - #endif - -- if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) || -+ mtu = ip6_skb_dst_mtu(skb); -+ if (skb_is_gso(skb) && !skb_gso_validate_network_len(skb, mtu)) -+ return ip6_finish_output_gso_slowpath_drop(net, sk, skb, mtu); -+ -+ if ((skb->len > mtu && !skb_is_gso(skb)) || - dst_allfrag(skb_dst(skb)) || - (IP6CB(skb)->frag_max_size && skb->len > IP6CB(skb)->frag_max_size)) - return ip6_fragment(net, sk, skb, ip6_finish_output2); -diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c -index 2872f7a00e863..de4c871787e2f 100644 ---- a/net/ipv6/sit.c -+++ b/net/ipv6/sit.c -@@ -1597,8 +1597,11 @@ static int ipip6_newlink(struct net *src_net, struct net_device *dev, - } - - #ifdef CONFIG_IPV6_SIT_6RD -- if (ipip6_netlink_6rd_parms(data, &ip6rd)) -+ if (ipip6_netlink_6rd_parms(data, &ip6rd)) { - err = ipip6_tunnel_update_6rd(nt, &ip6rd); -+ if (err < 0) -+ unregister_netdevice_queue(dev, NULL); -+ } - #endif - - return err; -diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c -index 30a0c7c6224b3..da0e285302f9d 100644 ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -657,7 +657,7 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx) - if (!skip_hw && tx->key && - tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) - info->control.hw_key = &tx->key->conf; -- } else if (!ieee80211_is_mgmt(hdr->frame_control) && tx->sta && -+ } else if (ieee80211_is_data_present(hdr->frame_control) && tx->sta && - test_sta_flag(tx->sta, WLAN_STA_USES_ENCRYPTION)) { - return TX_DROP; - } -@@ -3773,7 +3773,7 @@ void __ieee80211_schedule_txq(struct ieee80211_hw *hw, - * get immediately moved to the back of the list on the next - * call to ieee80211_next_txq(). - */ -- if (txqi->txq.sta && -+ if (txqi->txq.sta && local->airtime_flags && - wiphy_ext_feature_isset(local->hw.wiphy, - NL80211_EXT_FEATURE_AIRTIME_FAIRNESS)) - list_add(&txqi->schedule_order, -diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c -index 6cace43b217ee..916d1f455b218 100644 ---- a/net/rxrpc/input.c -+++ b/net/rxrpc/input.c -@@ -431,7 +431,7 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb) - return; - } - -- if (call->state == RXRPC_CALL_SERVER_RECV_REQUEST) { -+ if (state == RXRPC_CALL_SERVER_RECV_REQUEST) { - unsigned long timo = READ_ONCE(call->next_req_timo); - unsigned long now, expect_req_by; - -diff --git a/net/rxrpc/key.c b/net/rxrpc/key.c -index 85a9ff8cd236a..2b26c4d229a5a 100644 ---- a/net/rxrpc/key.c -+++ b/net/rxrpc/key.c -@@ -1110,7 +1110,7 @@ static long rxrpc_read(const struct key *key, - default: /* we have a ticket we can't encode */ - pr_err("Unsupported key token type (%u)\n", - token->security_index); -- continue; -+ return -ENOPKG; - } - - _debug("token[%u]: toksize=%u", ntoks, toksize); -@@ -1225,7 +1225,9 @@ static long rxrpc_read(const struct key *key, - break; - - default: -- break; -+ pr_err("Unsupported key token type (%u)\n", -+ token->security_index); -+ return -ENOPKG; - } - - ASSERTCMP((unsigned long)xdr - (unsigned long)oldxdr, ==, -diff --git a/net/sctp/socket.c b/net/sctp/socket.c -index 1fcc13f6073ef..41abfff6a6a3d 100644 ---- a/net/sctp/socket.c -+++ b/net/sctp/socket.c -@@ -1319,7 +1319,7 @@ static int __sctp_setsockopt_connectx(struct sock *sk, - - kaddrs = memdup_user(addrs, addrs_size); - if (IS_ERR(kaddrs)) -- return PTR_ERR(kaddrs); -+ return PTR_ERR(kaddrs) == -EFAULT ? -EINVAL : PTR_ERR(kaddrs); - - /* Allow security module to validate connectx addresses. */ - err = security_sctp_bind_connect(sk, SCTP_SOCKOPT_CONNECTX, -diff --git a/net/tipc/link.c b/net/tipc/link.c -index a9d8a81e80cfd..f25010261a9e0 100644 ---- a/net/tipc/link.c -+++ b/net/tipc/link.c -@@ -939,9 +939,7 @@ void tipc_link_reset(struct tipc_link *l) - int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list, - struct sk_buff_head *xmitq) - { -- struct tipc_msg *hdr = buf_msg(skb_peek(list)); - unsigned int maxwin = l->window; -- int imp = msg_importance(hdr); - unsigned int mtu = l->mtu; - u16 ack = l->rcv_nxt - 1; - u16 seqno = l->snd_nxt; -@@ -950,8 +948,14 @@ int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list, - struct sk_buff_head *backlogq = &l->backlogq; - struct sk_buff *skb, *_skb, **tskb; - int pkt_cnt = skb_queue_len(list); -+ struct tipc_msg *hdr; - int rc = 0; -+ int imp; -+ -+ if (pkt_cnt <= 0) -+ return 0; - -+ hdr = buf_msg(skb_peek(list)); - if (unlikely(msg_size(hdr) > mtu)) { - pr_warn("Too large msg, purging xmit list %d %d %d %d %d!\n", - skb_queue_len(list), msg_user(hdr), -@@ -960,6 +964,7 @@ int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list, - return -EMSGSIZE; - } - -+ imp = msg_importance(hdr); - /* Allow oversubscription of one data msg per source at congestion */ - if (unlikely(l->backlog[imp].len >= l->backlog[imp].limit)) { - if (imp == TIPC_SYSTEM_IMPORTANCE) { diff --git a/patch/kernel/odroidxu4-current/patch-5.4.92-93.patch b/patch/kernel/odroidxu4-current/patch-5.4.92-93.patch deleted file mode 100644 index b35e765de9..0000000000 --- a/patch/kernel/odroidxu4-current/patch-5.4.92-93.patch +++ /dev/null @@ -1,2413 +0,0 @@ -diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt -index 74ba077e99e56..a19ae163c0589 100644 ---- a/Documentation/admin-guide/kernel-parameters.txt -+++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -5452,6 +5452,10 @@ - This option is obsoleted by the "nopv" option, which - has equivalent effect for XEN platform. - -+ xen_no_vector_callback -+ [KNL,X86,XEN] Disable the vector callback for Xen -+ event channel interrupts. -+ - xen_scrub_pages= [XEN] - Boolean option to control scrubbing pages before giving them back - to Xen, for use by other domains. Can be also changed at runtime -diff --git a/Makefile b/Makefile -index 5bae2206a35e7..f8462f8d8a151 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - VERSION = 5 - PATCHLEVEL = 4 --SUBLEVEL = 92 -+SUBLEVEL = 93 - EXTRAVERSION = - NAME = Kleptomaniac Octopus - -diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c -index dd6804a64f1a0..f45bff158fc20 100644 ---- a/arch/arm/xen/enlighten.c -+++ b/arch/arm/xen/enlighten.c -@@ -371,7 +371,7 @@ static int __init xen_guest_init(void) - } - gnttab_init(); - if (!xen_initial_domain()) -- xenbus_probe(NULL); -+ xenbus_probe(); - - /* - * Making sure board specific code will not set up ops for -diff --git a/arch/arm64/include/asm/atomic.h b/arch/arm64/include/asm/atomic.h -index 9543b5e0534d2..6e0f48ddfc656 100644 ---- a/arch/arm64/include/asm/atomic.h -+++ b/arch/arm64/include/asm/atomic.h -@@ -17,7 +17,7 @@ - #include - - #define ATOMIC_OP(op) \ --static inline void arch_##op(int i, atomic_t *v) \ -+static __always_inline void arch_##op(int i, atomic_t *v) \ - { \ - __lse_ll_sc_body(op, i, v); \ - } -@@ -32,7 +32,7 @@ ATOMIC_OP(atomic_sub) - #undef ATOMIC_OP - - #define ATOMIC_FETCH_OP(name, op) \ --static inline int arch_##op##name(int i, atomic_t *v) \ -+static __always_inline int arch_##op##name(int i, atomic_t *v) \ - { \ - return __lse_ll_sc_body(op##name, i, v); \ - } -@@ -56,7 +56,7 @@ ATOMIC_FETCH_OPS(atomic_sub_return) - #undef ATOMIC_FETCH_OPS - - #define ATOMIC64_OP(op) \ --static inline void arch_##op(long i, atomic64_t *v) \ -+static __always_inline void arch_##op(long i, atomic64_t *v) \ - { \ - __lse_ll_sc_body(op, i, v); \ - } -@@ -71,7 +71,7 @@ ATOMIC64_OP(atomic64_sub) - #undef ATOMIC64_OP - - #define ATOMIC64_FETCH_OP(name, op) \ --static inline long arch_##op##name(long i, atomic64_t *v) \ -+static __always_inline long arch_##op##name(long i, atomic64_t *v) \ - { \ - return __lse_ll_sc_body(op##name, i, v); \ - } -@@ -94,7 +94,7 @@ ATOMIC64_FETCH_OPS(atomic64_sub_return) - #undef ATOMIC64_FETCH_OP - #undef ATOMIC64_FETCH_OPS - --static inline long arch_atomic64_dec_if_positive(atomic64_t *v) -+static __always_inline long arch_atomic64_dec_if_positive(atomic64_t *v) - { - return __lse_ll_sc_body(atomic64_dec_if_positive, v); - } -diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S -index 4def51c12e1bf..a4e576019d79c 100644 ---- a/arch/powerpc/kernel/vmlinux.lds.S -+++ b/arch/powerpc/kernel/vmlinux.lds.S -@@ -210,6 +210,12 @@ SECTIONS - .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { - _sinittext = .; - INIT_TEXT -+ -+ /* -+ *.init.text might be RO so we must ensure this section ends on -+ * a page boundary. -+ */ -+ . = ALIGN(PAGE_SIZE); - _einittext = .; - #ifdef CONFIG_PPC64 - *(.tramp.ftrace.init); -@@ -223,21 +229,9 @@ SECTIONS - EXIT_TEXT - } - -- .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { -- INIT_DATA -- } -- -- .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) { -- INIT_SETUP(16) -- } -+ . = ALIGN(PAGE_SIZE); - -- .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) { -- INIT_CALLS -- } -- -- .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) { -- CON_INITCALL -- } -+ INIT_DATA_SECTION(16) - - . = ALIGN(8); - __ftr_fixup : AT(ADDR(__ftr_fixup) - LOAD_OFFSET) { -@@ -265,9 +259,6 @@ SECTIONS - __stop___fw_ftr_fixup = .; - } - #endif -- .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { -- INIT_RAM_FS -- } - - PERCPU_SECTION(L1_CACHE_BYTES) - -diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts -index 88cfcb96bf233..cc04e66752aac 100644 ---- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts -+++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts -@@ -83,6 +83,7 @@ - phy-mode = "gmii"; - phy-handle = <&phy0>; - phy0: ethernet-phy@0 { -+ compatible = "ethernet-phy-id0007.0771"; - reg = <0>; - }; - }; -diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig -index 420a0dbef3866..3c656fe97e583 100644 ---- a/arch/riscv/configs/defconfig -+++ b/arch/riscv/configs/defconfig -@@ -62,6 +62,8 @@ CONFIG_HW_RANDOM=y - CONFIG_HW_RANDOM_VIRTIO=y - CONFIG_SPI=y - CONFIG_SPI_SIFIVE=y -+CONFIG_GPIOLIB=y -+CONFIG_GPIO_SIFIVE=y - # CONFIG_PTP_1588_CLOCK is not set - CONFIG_DRM=y - CONFIG_DRM_RADEON=y -diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c -index 6a53c02e9c734..8aa70b519e04f 100644 ---- a/arch/riscv/kernel/time.c -+++ b/arch/riscv/kernel/time.c -@@ -4,6 +4,7 @@ - * Copyright (C) 2017 SiFive - */ - -+#include - #include - #include - #include -@@ -24,5 +25,7 @@ void __init time_init(void) - riscv_timebase = prop; - - lpj_fine = riscv_timebase / HZ; -+ -+ of_clk_init(NULL); - timer_probe(); - } -diff --git a/arch/sh/drivers/dma/Kconfig b/arch/sh/drivers/dma/Kconfig -index d0de378beefe5..7d54f284ce10f 100644 ---- a/arch/sh/drivers/dma/Kconfig -+++ b/arch/sh/drivers/dma/Kconfig -@@ -63,8 +63,7 @@ config PVR2_DMA - - config G2_DMA - tristate "G2 Bus DMA support" -- depends on SH_DREAMCAST -- select SH_DMA_API -+ depends on SH_DREAMCAST && SH_DMA_API - help - This enables support for the DMA controller for the Dreamcast's - G2 bus. Drivers that want this will generally enable this on -diff --git a/arch/x86/include/asm/fpu/api.h b/arch/x86/include/asm/fpu/api.h -index b774c52e5411f..06e767bca0c14 100644 ---- a/arch/x86/include/asm/fpu/api.h -+++ b/arch/x86/include/asm/fpu/api.h -@@ -16,14 +16,25 @@ - * Use kernel_fpu_begin/end() if you intend to use FPU in kernel context. It - * disables preemption so be careful if you intend to use it for long periods - * of time. -- * If you intend to use the FPU in softirq you need to check first with -+ * If you intend to use the FPU in irq/softirq you need to check first with - * irq_fpu_usable() if it is possible. - */ --extern void kernel_fpu_begin(void); -+ -+/* Kernel FPU states to initialize in kernel_fpu_begin_mask() */ -+#define KFPU_387 _BITUL(0) /* 387 state will be initialized */ -+#define KFPU_MXCSR _BITUL(1) /* MXCSR will be initialized */ -+ -+extern void kernel_fpu_begin_mask(unsigned int kfpu_mask); - extern void kernel_fpu_end(void); - extern bool irq_fpu_usable(void); - extern void fpregs_mark_activate(void); - -+/* Code that is unaware of kernel_fpu_begin_mask() can use this */ -+static inline void kernel_fpu_begin(void) -+{ -+ kernel_fpu_begin_mask(KFPU_387 | KFPU_MXCSR); -+} -+ - /* - * Use fpregs_lock() while editing CPU's FPU registers or fpu->state. - * A context switch will (and softirq might) save CPU's FPU registers to -diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h -index 4b14d2318251e..f3459df117aa8 100644 ---- a/arch/x86/include/asm/topology.h -+++ b/arch/x86/include/asm/topology.h -@@ -110,6 +110,8 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu); - #define topology_die_id(cpu) (cpu_data(cpu).cpu_die_id) - #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) - -+extern unsigned int __max_die_per_package; -+ - #ifdef CONFIG_SMP - #define topology_die_cpumask(cpu) (per_cpu(cpu_die_map, cpu)) - #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) -@@ -118,8 +120,6 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu); - extern unsigned int __max_logical_packages; - #define topology_max_packages() (__max_logical_packages) - --extern unsigned int __max_die_per_package; -- - static inline int topology_max_die_per_package(void) - { - return __max_die_per_package; -diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c -index 52373921af2eb..753f3dfbc9c91 100644 ---- a/arch/x86/kernel/cpu/amd.c -+++ b/arch/x86/kernel/cpu/amd.c -@@ -545,12 +545,12 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) - u32 ecx; - - ecx = cpuid_ecx(0x8000001e); -- nodes_per_socket = ((ecx >> 8) & 7) + 1; -+ __max_die_per_package = nodes_per_socket = ((ecx >> 8) & 7) + 1; - } else if (boot_cpu_has(X86_FEATURE_NODEID_MSR)) { - u64 value; - - rdmsrl(MSR_FAM10H_NODE_ID, value); -- nodes_per_socket = ((value >> 3) & 7) + 1; -+ __max_die_per_package = nodes_per_socket = ((value >> 3) & 7) + 1; - } - - if (!boot_cpu_has(X86_FEATURE_AMD_SSBD) && -diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c -index ee48c3fc8a65e..24da5ee4f0220 100644 ---- a/arch/x86/kernel/cpu/topology.c -+++ b/arch/x86/kernel/cpu/topology.c -@@ -25,10 +25,10 @@ - #define BITS_SHIFT_NEXT_LEVEL(eax) ((eax) & 0x1f) - #define LEVEL_MAX_SIBLINGS(ebx) ((ebx) & 0xffff) - --#ifdef CONFIG_SMP - unsigned int __max_die_per_package __read_mostly = 1; - EXPORT_SYMBOL(__max_die_per_package); - -+#ifdef CONFIG_SMP - /* - * Check if given CPUID extended toplogy "leaf" is implemented - */ -diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c -index cd8839027f66d..8c9b202f3e6db 100644 ---- a/arch/x86/kernel/fpu/core.c -+++ b/arch/x86/kernel/fpu/core.c -@@ -82,7 +82,7 @@ bool irq_fpu_usable(void) - } - EXPORT_SYMBOL(irq_fpu_usable); - --void kernel_fpu_begin(void) -+void kernel_fpu_begin_mask(unsigned int kfpu_mask) - { - preempt_disable(); - -@@ -102,13 +102,14 @@ void kernel_fpu_begin(void) - } - __cpu_invalidate_fpregs_state(); - -- if (boot_cpu_has(X86_FEATURE_XMM)) -+ /* Put sane initial values into the control registers. */ -+ if (likely(kfpu_mask & KFPU_MXCSR) && boot_cpu_has(X86_FEATURE_XMM)) - ldmxcsr(MXCSR_DEFAULT); - -- if (boot_cpu_has(X86_FEATURE_FPU)) -+ if (unlikely(kfpu_mask & KFPU_387) && boot_cpu_has(X86_FEATURE_FPU)) - asm volatile ("fninit"); - } --EXPORT_SYMBOL_GPL(kernel_fpu_begin); -+EXPORT_SYMBOL_GPL(kernel_fpu_begin_mask); - - void kernel_fpu_end(void) - { -diff --git a/arch/x86/lib/mmx_32.c b/arch/x86/lib/mmx_32.c -index 4321fa02e18df..419365c48b2ad 100644 ---- a/arch/x86/lib/mmx_32.c -+++ b/arch/x86/lib/mmx_32.c -@@ -26,6 +26,16 @@ - #include - #include - -+/* -+ * Use KFPU_387. MMX instructions are not affected by MXCSR, -+ * but both AMD and Intel documentation states that even integer MMX -+ * operations will result in #MF if an exception is pending in FCW. -+ * -+ * EMMS is not needed afterwards because, after calling kernel_fpu_end(), -+ * any subsequent user of the 387 stack will reinitialize it using -+ * KFPU_387. -+ */ -+ - void *_mmx_memcpy(void *to, const void *from, size_t len) - { - void *p; -@@ -37,7 +47,7 @@ void *_mmx_memcpy(void *to, const void *from, size_t len) - p = to; - i = len >> 6; /* len/64 */ - -- kernel_fpu_begin(); -+ kernel_fpu_begin_mask(KFPU_387); - - __asm__ __volatile__ ( - "1: prefetch (%0)\n" /* This set is 28 bytes */ -@@ -127,7 +137,7 @@ static void fast_clear_page(void *page) - { - int i; - -- kernel_fpu_begin(); -+ kernel_fpu_begin_mask(KFPU_387); - - __asm__ __volatile__ ( - " pxor %%mm0, %%mm0\n" : : -@@ -160,7 +170,7 @@ static void fast_copy_page(void *to, void *from) - { - int i; - -- kernel_fpu_begin(); -+ kernel_fpu_begin_mask(KFPU_387); - - /* - * maybe the prefetch stuff can go before the expensive fnsave... -@@ -247,7 +257,7 @@ static void fast_clear_page(void *page) - { - int i; - -- kernel_fpu_begin(); -+ kernel_fpu_begin_mask(KFPU_387); - - __asm__ __volatile__ ( - " pxor %%mm0, %%mm0\n" : : -@@ -282,7 +292,7 @@ static void fast_copy_page(void *to, void *from) - { - int i; - -- kernel_fpu_begin(); -+ kernel_fpu_begin_mask(KFPU_387); - - __asm__ __volatile__ ( - "1: prefetch (%0)\n" -diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c -index e138f7de52d20..6024fafed1642 100644 ---- a/arch/x86/xen/enlighten_hvm.c -+++ b/arch/x86/xen/enlighten_hvm.c -@@ -175,6 +175,8 @@ static int xen_cpu_dead_hvm(unsigned int cpu) - return 0; - } - -+static bool no_vector_callback __initdata; -+ - static void __init xen_hvm_guest_init(void) - { - if (xen_pv_domain()) -@@ -194,7 +196,7 @@ static void __init xen_hvm_guest_init(void) - - xen_panic_handler_init(); - -- if (xen_feature(XENFEAT_hvm_callback_vector)) -+ if (!no_vector_callback && xen_feature(XENFEAT_hvm_callback_vector)) - xen_have_vector_callback = 1; - - xen_hvm_smp_init(); -@@ -220,6 +222,13 @@ static __init int xen_parse_nopv(char *arg) - } - early_param("xen_nopv", xen_parse_nopv); - -+static __init int xen_parse_no_vector_callback(char *arg) -+{ -+ no_vector_callback = true; -+ return 0; -+} -+early_param("xen_no_vector_callback", xen_parse_no_vector_callback); -+ - bool __init xen_hvm_need_lapic(void) - { - if (xen_pv_domain()) -diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c -index 6c8c9509e03d1..8887a72712d4b 100644 ---- a/drivers/acpi/scan.c -+++ b/drivers/acpi/scan.c -@@ -587,6 +587,8 @@ static int acpi_get_device_data(acpi_handle handle, struct acpi_device **device, - if (!device) - return -EINVAL; - -+ *device = NULL; -+ - status = acpi_get_data_full(handle, acpi_scan_drop_device, - (void **)device, callback); - if (ACPI_FAILURE(status) || !*device) { -diff --git a/drivers/base/core.c b/drivers/base/core.c -index c5edb00938f69..a119479fe3f42 100644 ---- a/drivers/base/core.c -+++ b/drivers/base/core.c -@@ -106,6 +106,16 @@ int device_links_read_lock_held(void) - #endif - #endif /* !CONFIG_SRCU */ - -+static bool device_is_ancestor(struct device *dev, struct device *target) -+{ -+ while (target->parent) { -+ target = target->parent; -+ if (dev == target) -+ return true; -+ } -+ return false; -+} -+ - /** - * device_is_dependent - Check if one device depends on another one - * @dev: Device to check dependencies for. -@@ -119,7 +129,12 @@ static int device_is_dependent(struct device *dev, void *target) - struct device_link *link; - int ret; - -- if (dev == target) -+ /* -+ * The "ancestors" check is needed to catch the case when the target -+ * device has not been completely initialized yet and it is still -+ * missing from the list of children of its parent device. -+ */ -+ if (dev == target || device_is_ancestor(dev, target)) - return 1; - - ret = device_for_each_child(dev, target, device_is_dependent); -diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c -index 7b4c6a488527d..501929d9f70ed 100644 ---- a/drivers/clk/tegra/clk-tegra30.c -+++ b/drivers/clk/tegra/clk-tegra30.c -@@ -1263,6 +1263,8 @@ static struct tegra_clk_init_table init_table[] __initdata = { - { TEGRA30_CLK_I2S3_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 }, - { TEGRA30_CLK_I2S4_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 }, - { TEGRA30_CLK_VIMCLK_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 }, -+ { TEGRA30_CLK_HDA, TEGRA30_CLK_PLL_P, 102000000, 0 }, -+ { TEGRA30_CLK_HDA2CODEC_2X, TEGRA30_CLK_PLL_P, 48000000, 0 }, - /* must be the last entry */ - { TEGRA30_CLK_CLK_MAX, TEGRA30_CLK_CLK_MAX, 0, 0 }, - }; -diff --git a/drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h b/drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h -index 74a9fe8e0cfb9..8c54f0be51bab 100644 ---- a/drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h -+++ b/drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h -@@ -44,7 +44,7 @@ enum psp_gfx_crtl_cmd_id - GFX_CTRL_CMD_ID_DISABLE_INT = 0x00060000, /* disable PSP-to-Gfx interrupt */ - GFX_CTRL_CMD_ID_MODE1_RST = 0x00070000, /* trigger the Mode 1 reset */ - GFX_CTRL_CMD_ID_GBR_IH_SET = 0x00080000, /* set Gbr IH_RB_CNTL registers */ -- GFX_CTRL_CMD_ID_CONSUME_CMD = 0x000A0000, /* send interrupt to psp for updating write pointer of vf */ -+ GFX_CTRL_CMD_ID_CONSUME_CMD = 0x00090000, /* send interrupt to psp for updating write pointer of vf */ - GFX_CTRL_CMD_ID_DESTROY_GPCOM_RING = 0x000C0000, /* destroy GPCOM ring */ - - GFX_CTRL_CMD_ID_MAX = 0x000F0000, /* max command ID */ -diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c -index a549c7c717ddc..f0b001b3af578 100644 ---- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c -+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c -@@ -113,7 +113,7 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc, - mutex_lock(&adev->dm.dc_lock); - - /* Enable CRTC CRC generation if necessary. */ -- if (dm_is_crc_source_crtc(source)) { -+ if (dm_is_crc_source_crtc(source) || source == AMDGPU_DM_PIPE_CRC_SOURCE_NONE) { - if (!dc_stream_configure_crc(stream_state->ctx->dc, - stream_state, enable, enable)) { - ret = -EINVAL; -diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c -index 2dd2cd87cdbb3..5e906ea6df67d 100644 ---- a/drivers/gpu/drm/drm_atomic_helper.c -+++ b/drivers/gpu/drm/drm_atomic_helper.c -@@ -2948,7 +2948,7 @@ int drm_atomic_helper_set_config(struct drm_mode_set *set, - - ret = handle_conflicting_encoders(state, true); - if (ret) -- return ret; -+ goto fail; - - ret = drm_atomic_commit(state); - -diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c -index 4b5c7b0ed7148..8fdb271354061 100644 ---- a/drivers/gpu/drm/drm_syncobj.c -+++ b/drivers/gpu/drm/drm_syncobj.c -@@ -326,19 +326,18 @@ int drm_syncobj_find_fence(struct drm_file *file_private, - return -ENOENT; - - *fence = drm_syncobj_fence_get(syncobj); -- drm_syncobj_put(syncobj); - - if (*fence) { - ret = dma_fence_chain_find_seqno(fence, point); - if (!ret) -- return 0; -+ goto out; - dma_fence_put(*fence); - } else { - ret = -EINVAL; - } - - if (!(flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT)) -- return ret; -+ goto out; - - memset(&wait, 0, sizeof(wait)); - wait.task = current; -@@ -370,6 +369,9 @@ int drm_syncobj_find_fence(struct drm_file *file_private, - if (wait.node.next) - drm_syncobj_remove_wait(syncobj, &wait); - -+out: -+ drm_syncobj_put(syncobj); -+ - return ret; - } - EXPORT_SYMBOL(drm_syncobj_find_fence); -diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c -index 2fa491f826824..398068b173891 100644 ---- a/drivers/gpu/drm/i915/gt/intel_lrc.c -+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c -@@ -2245,6 +2245,9 @@ err: - static void lrc_destroy_wa_ctx(struct intel_engine_cs *engine) - { - i915_vma_unpin_and_release(&engine->wa_ctx.vma, 0); -+ -+ /* Called on error unwind, clear all flags to prevent further use */ -+ memset(&engine->wa_ctx, 0, sizeof(engine->wa_ctx)); - } - - typedef u32 *(*wa_bb_func_t)(struct intel_engine_cs *engine, u32 *batch); -diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c -index ee2b1e1199e09..daa79d39201f9 100644 ---- a/drivers/gpu/drm/nouveau/dispnv50/disp.c -+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c -@@ -132,7 +132,7 @@ nv50_dmac_destroy(struct nv50_dmac *dmac) - - int - nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp, -- const s32 *oclass, u8 head, void *data, u32 size, u64 syncbuf, -+ const s32 *oclass, u8 head, void *data, u32 size, s64 syncbuf, - struct nv50_dmac *dmac) - { - struct nouveau_cli *cli = (void *)device->object.client; -@@ -167,7 +167,7 @@ nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp, - if (ret) - return ret; - -- if (!syncbuf) -+ if (syncbuf < 0) - return 0; - - ret = nvif_object_init(&dmac->base.user, 0xf0000000, NV_DMA_IN_MEMORY, -diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.h b/drivers/gpu/drm/nouveau/dispnv50/disp.h -index 7c41b0599d1ac..284068fa6d007 100644 ---- a/drivers/gpu/drm/nouveau/dispnv50/disp.h -+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.h -@@ -70,7 +70,7 @@ struct nv50_dmac { - - int nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp, - const s32 *oclass, u8 head, void *data, u32 size, -- u64 syncbuf, struct nv50_dmac *dmac); -+ s64 syncbuf, struct nv50_dmac *dmac); - void nv50_dmac_destroy(struct nv50_dmac *); - - u32 *evo_wait(struct nv50_dmac *, int nr); -diff --git a/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c b/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c -index f7dbd965e4e72..b49a212af4d8d 100644 ---- a/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c -+++ b/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c -@@ -68,7 +68,7 @@ wimmc37b_init_(const struct nv50_wimm_func *func, struct nouveau_drm *drm, - int ret; - - ret = nv50_dmac_create(&drm->client.device, &disp->disp->object, -- &oclass, 0, &args, sizeof(args), 0, -+ &oclass, 0, &args, sizeof(args), -1, - &wndw->wimm); - if (ret) { - NV_ERROR(drm, "wimm%04x allocation failed: %d\n", oclass, ret); -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c -index 7deb81b6dbac6..4b571cc6bc70f 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c -@@ -75,7 +75,7 @@ shadow_image(struct nvkm_bios *bios, int idx, u32 offset, struct shadow *mthd) - nvkm_debug(subdev, "%08x: type %02x, %d bytes\n", - image.base, image.type, image.size); - -- if (!shadow_fetch(bios, mthd, image.size)) { -+ if (!shadow_fetch(bios, mthd, image.base + image.size)) { - nvkm_debug(subdev, "%08x: fetch failed\n", image.base); - return 0; - } -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c -index edb6148cbca04..d0e80ad526845 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c -@@ -33,7 +33,7 @@ static void - gm200_i2c_aux_fini(struct gm200_i2c_aux *aux) - { - struct nvkm_device *device = aux->base.pad->i2c->subdev.device; -- nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00310000, 0x00000000); -+ nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00710000, 0x00000000); - } - - static int -@@ -54,10 +54,10 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux) - AUX_ERR(&aux->base, "begin idle timeout %08x", ctrl); - return -EBUSY; - } -- } while (ctrl & 0x03010000); -+ } while (ctrl & 0x07010000); - - /* set some magic, and wait up to 1ms for it to appear */ -- nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00300000, ureq); -+ nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00700000, ureq); - timeout = 1000; - do { - ctrl = nvkm_rd32(device, 0x00d954 + (aux->ch * 0x50)); -@@ -67,7 +67,7 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux) - gm200_i2c_aux_fini(aux); - return -EBUSY; - } -- } while ((ctrl & 0x03000000) != urep); -+ } while ((ctrl & 0x07000000) != urep); - - return 0; - } -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c -index d80dbc8f09b20..55a4ea4393c62 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c -@@ -22,6 +22,7 @@ - * Authors: Ben Skeggs - */ - #include "priv.h" -+#include - - static void - gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i) -@@ -31,7 +32,6 @@ gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i) - u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0400)); - u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0400)); - nvkm_debug(ibus, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat); -- nvkm_mask(device, 0x122128 + (i * 0x0400), 0x00000200, 0x00000000); - } - - static void -@@ -42,7 +42,6 @@ gf100_ibus_intr_rop(struct nvkm_subdev *ibus, int i) - u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0400)); - u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0400)); - nvkm_debug(ibus, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat); -- nvkm_mask(device, 0x124128 + (i * 0x0400), 0x00000200, 0x00000000); - } - - static void -@@ -53,7 +52,6 @@ gf100_ibus_intr_gpc(struct nvkm_subdev *ibus, int i) - u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0400)); - u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0400)); - nvkm_debug(ibus, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat); -- nvkm_mask(device, 0x128128 + (i * 0x0400), 0x00000200, 0x00000000); - } - - void -@@ -90,6 +88,12 @@ gf100_ibus_intr(struct nvkm_subdev *ibus) - intr1 &= ~stat; - } - } -+ -+ nvkm_mask(device, 0x121c4c, 0x0000003f, 0x00000002); -+ nvkm_msec(device, 2000, -+ if (!(nvkm_rd32(device, 0x121c4c) & 0x0000003f)) -+ break; -+ ); - } - - static int -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c -index 9025ed1bd2a99..4caf3ef087e1d 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c -@@ -22,6 +22,7 @@ - * Authors: Ben Skeggs - */ - #include "priv.h" -+#include - - static void - gk104_ibus_intr_hub(struct nvkm_subdev *ibus, int i) -@@ -31,7 +32,6 @@ gk104_ibus_intr_hub(struct nvkm_subdev *ibus, int i) - u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0800)); - u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0800)); - nvkm_debug(ibus, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat); -- nvkm_mask(device, 0x122128 + (i * 0x0800), 0x00000200, 0x00000000); - } - - static void -@@ -42,7 +42,6 @@ gk104_ibus_intr_rop(struct nvkm_subdev *ibus, int i) - u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0800)); - u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0800)); - nvkm_debug(ibus, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat); -- nvkm_mask(device, 0x124128 + (i * 0x0800), 0x00000200, 0x00000000); - } - - static void -@@ -53,7 +52,6 @@ gk104_ibus_intr_gpc(struct nvkm_subdev *ibus, int i) - u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0800)); - u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0800)); - nvkm_debug(ibus, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat); -- nvkm_mask(device, 0x128128 + (i * 0x0800), 0x00000200, 0x00000000); - } - - void -@@ -90,6 +88,12 @@ gk104_ibus_intr(struct nvkm_subdev *ibus) - intr1 &= ~stat; - } - } -+ -+ nvkm_mask(device, 0x12004c, 0x0000003f, 0x00000002); -+ nvkm_msec(device, 2000, -+ if (!(nvkm_rd32(device, 0x12004c) & 0x0000003f)) -+ break; -+ ); - } - - static int -diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c -index ee11ccaf0563c..cb51e248cb41b 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c -+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c -@@ -316,9 +316,9 @@ nvkm_mmu_vram(struct nvkm_mmu *mmu) - { - struct nvkm_device *device = mmu->subdev.device; - struct nvkm_mm *mm = &device->fb->ram->vram; -- const u32 sizeN = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NORMAL); -- const u32 sizeU = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NOMAP); -- const u32 sizeM = nvkm_mm_heap_size(mm, NVKM_RAM_MM_MIXED); -+ const u64 sizeN = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NORMAL); -+ const u64 sizeU = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NOMAP); -+ const u64 sizeM = nvkm_mm_heap_size(mm, NVKM_RAM_MM_MIXED); - u8 type = NVKM_MEM_KIND * !!mmu->func->kind; - u8 heap = NVKM_MEM_VRAM; - int heapM, heapN, heapU; -diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h -index 2aa810665a78c..33183933337af 100644 ---- a/drivers/hid/hid-ids.h -+++ b/drivers/hid/hid-ids.h -@@ -393,6 +393,7 @@ - #define USB_DEVICE_ID_TOSHIBA_CLICK_L9W 0x0401 - #define USB_DEVICE_ID_HP_X2 0x074d - #define USB_DEVICE_ID_HP_X2_10_COVER 0x0755 -+#define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN 0x2706 - - #define USB_VENDOR_ID_ELECOM 0x056e - #define USB_DEVICE_ID_ELECOM_BM084 0x0061 -diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c -index b2da8476d0d30..ec08895e7b1dc 100644 ---- a/drivers/hid/hid-input.c -+++ b/drivers/hid/hid-input.c -@@ -322,6 +322,8 @@ static const struct hid_device_id hid_battery_quirks[] = { - { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, - USB_DEVICE_ID_LOGITECH_DINOVO_EDGE_KBD), - HID_BATTERY_QUIRK_IGNORE }, -+ { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN), -+ HID_BATTERY_QUIRK_IGNORE }, - {} - }; - -diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c -index 54d811fdcdb44..e5550a5bf49d0 100644 ---- a/drivers/hid/hid-logitech-dj.c -+++ b/drivers/hid/hid-logitech-dj.c -@@ -1862,6 +1862,10 @@ static const struct hid_device_id logi_dj_receivers[] = { - HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, - 0xc531), - .driver_data = recvr_type_gaming_hidpp}, -+ { /* Logitech G602 receiver (0xc537) */ -+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, -+ 0xc537), -+ .driver_data = recvr_type_gaming_hidpp}, - { /* Logitech lightspeed receiver (0xc539) */ - HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, - USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED_1), -diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c -index 128d8f4319b9f..d91e6679afb18 100644 ---- a/drivers/hid/hid-multitouch.c -+++ b/drivers/hid/hid-multitouch.c -@@ -2084,6 +2084,10 @@ static const struct hid_device_id mt_devices[] = { - HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, - USB_VENDOR_ID_SYNAPTICS, 0xce08) }, - -+ { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT, -+ HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, -+ USB_VENDOR_ID_SYNAPTICS, 0xce09) }, -+ - /* TopSeed panels */ - { .driver_data = MT_CLS_TOPSEED, - MT_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, -diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c -index 21fdf0b935166..d7d99acac52f2 100644 ---- a/drivers/hwtracing/intel_th/pci.c -+++ b/drivers/hwtracing/intel_th/pci.c -@@ -258,6 +258,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = { - PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4b26), - .driver_data = (kernel_ulong_t)&intel_th_2x, - }, -+ { -+ /* Alder Lake-P */ -+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x51a6), -+ .driver_data = (kernel_ulong_t)&intel_th_2x, -+ }, - { - /* Emmitsburg PCH */ - PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x1bcc), -diff --git a/drivers/hwtracing/stm/heartbeat.c b/drivers/hwtracing/stm/heartbeat.c -index 3e7df1c0477f7..81d7b21d31ec2 100644 ---- a/drivers/hwtracing/stm/heartbeat.c -+++ b/drivers/hwtracing/stm/heartbeat.c -@@ -64,7 +64,7 @@ static void stm_heartbeat_unlink(struct stm_source_data *data) - - static int stm_heartbeat_init(void) - { -- int i, ret = -ENOMEM; -+ int i, ret; - - if (nr_devs < 0 || nr_devs > STM_HEARTBEAT_MAX) - return -EINVAL; -@@ -72,8 +72,10 @@ static int stm_heartbeat_init(void) - for (i = 0; i < nr_devs; i++) { - stm_heartbeat[i].data.name = - kasprintf(GFP_KERNEL, "heartbeat.%d", i); -- if (!stm_heartbeat[i].data.name) -+ if (!stm_heartbeat[i].data.name) { -+ ret = -ENOMEM; - goto fail_unregister; -+ } - - stm_heartbeat[i].data.nr_chans = 1; - stm_heartbeat[i].data.link = stm_heartbeat_link; -diff --git a/drivers/i2c/busses/i2c-octeon-core.c b/drivers/i2c/busses/i2c-octeon-core.c -index d9607905dc2f1..845eda70b8cab 100644 ---- a/drivers/i2c/busses/i2c-octeon-core.c -+++ b/drivers/i2c/busses/i2c-octeon-core.c -@@ -347,7 +347,7 @@ static int octeon_i2c_read(struct octeon_i2c *i2c, int target, - if (result) - return result; - if (recv_len && i == 0) { -- if (data[i] > I2C_SMBUS_BLOCK_MAX + 1) -+ if (data[i] > I2C_SMBUS_BLOCK_MAX) - return -EPROTO; - length += data[i]; - } -diff --git a/drivers/i2c/busses/i2c-tegra-bpmp.c b/drivers/i2c/busses/i2c-tegra-bpmp.c -index ec7a7e917eddb..c0c7d01473f2b 100644 ---- a/drivers/i2c/busses/i2c-tegra-bpmp.c -+++ b/drivers/i2c/busses/i2c-tegra-bpmp.c -@@ -80,7 +80,7 @@ static int tegra_bpmp_xlate_flags(u16 flags, u16 *out) - flags &= ~I2C_M_RECV_LEN; - } - -- return (flags != 0) ? -EINVAL : 0; -+ return 0; - } - - /** -diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac/ad5504.c -index c64e6898ff20a..d1ffc8cb08ed6 100644 ---- a/drivers/iio/dac/ad5504.c -+++ b/drivers/iio/dac/ad5504.c -@@ -188,9 +188,9 @@ static ssize_t ad5504_write_dac_powerdown(struct iio_dev *indio_dev, - return ret; - - if (pwr_down) -- st->pwr_down_mask |= (1 << chan->channel); -- else - st->pwr_down_mask &= ~(1 << chan->channel); -+ else -+ st->pwr_down_mask |= (1 << chan->channel); - - ret = ad5504_spi_write(st, AD5504_ADDR_CTRL, - AD5504_DAC_PWRDWN_MODE(st->pwr_down_mode) | -diff --git a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c -index 95d4fd8f7a968..0bbb0b2d0dd5f 100644 ---- a/drivers/irqchip/irq-mips-cpu.c -+++ b/drivers/irqchip/irq-mips-cpu.c -@@ -197,6 +197,13 @@ static int mips_cpu_ipi_alloc(struct irq_domain *domain, unsigned int virq, - if (ret) - return ret; - -+ ret = irq_domain_set_hwirq_and_chip(domain->parent, virq + i, hwirq, -+ &mips_mt_cpu_irq_controller, -+ NULL); -+ -+ if (ret) -+ return ret; -+ - ret = irq_set_irq_type(virq + i, IRQ_TYPE_LEVEL_HIGH); - if (ret) - return ret; -diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c -index a2ebc75af8c79..4714aa936b2a2 100644 ---- a/drivers/lightnvm/core.c -+++ b/drivers/lightnvm/core.c -@@ -849,11 +849,10 @@ static int nvm_bb_chunk_sense(struct nvm_dev *dev, struct ppa_addr ppa) - rqd.ppa_addr = generic_to_dev_addr(dev, ppa); - - ret = nvm_submit_io_sync_raw(dev, &rqd); -+ __free_page(page); - if (ret) - return ret; - -- __free_page(page); -- - return rqd.error; - } - -diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig -index aa98953f4462e..7dd6e98257c72 100644 ---- a/drivers/md/Kconfig -+++ b/drivers/md/Kconfig -@@ -565,6 +565,7 @@ config DM_INTEGRITY - select BLK_DEV_INTEGRITY - select DM_BUFIO - select CRYPTO -+ select CRYPTO_SKCIPHER - select ASYNC_XOR - ---help--- - This device-mapper target emulates a block device that has -diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c -index 25efe382e78fa..57f66f2ad98dc 100644 ---- a/drivers/md/dm-integrity.c -+++ b/drivers/md/dm-integrity.c -@@ -4059,6 +4059,12 @@ try_smaller_buffer: - r = -ENOMEM; - goto bad; - } -+ } else { -+ if (ic->sb->flags & cpu_to_le32(SB_FLAG_RECALCULATING)) { -+ ti->error = "Recalculate can only be specified with internal_hash"; -+ r = -EINVAL; -+ goto bad; -+ } - } - - ic->bufio = dm_bufio_client_create(ic->meta_dev ? ic->meta_dev->bdev : ic->dev->bdev, -diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c -index 6dd56afa048c2..98be040cf958c 100644 ---- a/drivers/md/dm-table.c -+++ b/drivers/md/dm-table.c -@@ -428,14 +428,23 @@ int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, - { - int r; - dev_t dev; -+ unsigned int major, minor; -+ char dummy; - struct dm_dev_internal *dd; - struct dm_table *t = ti->table; - - BUG_ON(!t); - -- dev = dm_get_dev_t(path); -- if (!dev) -- return -ENODEV; -+ if (sscanf(path, "%u:%u%c", &major, &minor, &dummy) == 2) { -+ /* Extract the major/minor numbers */ -+ dev = MKDEV(major, minor); -+ if (MAJOR(dev) != major || MINOR(dev) != minor) -+ return -EOVERFLOW; -+ } else { -+ dev = dm_get_dev_t(path); -+ if (!dev) -+ return -ENODEV; -+ } - - dd = find_device(&t->devices, dev); - if (!dd) { -diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c -index 81b8d5ede484e..9cee10e44e2fc 100644 ---- a/drivers/mmc/core/queue.c -+++ b/drivers/mmc/core/queue.c -@@ -370,8 +370,10 @@ static void mmc_setup_queue(struct mmc_queue *mq, struct mmc_card *card) - "merging was advertised but not possible"); - blk_queue_max_segments(mq->queue, mmc_get_max_segments(host)); - -- if (mmc_card_mmc(card)) -+ if (mmc_card_mmc(card) && card->ext_csd.data_sector_size) { - block_size = card->ext_csd.data_sector_size; -+ WARN_ON(block_size != 512 && block_size != 4096); -+ } - - blk_queue_logical_block_size(mq->queue, block_size); - /* -diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c -index 4703cd540c7fd..5f57e78e5f13f 100644 ---- a/drivers/mmc/host/sdhci-xenon.c -+++ b/drivers/mmc/host/sdhci-xenon.c -@@ -167,7 +167,12 @@ static void xenon_reset_exit(struct sdhci_host *host, - /* Disable tuning request and auto-retuning again */ - xenon_retune_setup(host); - -- xenon_set_acg(host, true); -+ /* -+ * The ACG should be turned off at the early init time, in order -+ * to solve a possible issues with the 1.8V regulator stabilization. -+ * The feature is enabled in later stage. -+ */ -+ xenon_set_acg(host, false); - - xenon_set_sdclk_off_idle(host, sdhc_id, false); - -diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c -index 5b8791135de13..247aeacb3a440 100644 ---- a/drivers/net/can/dev.c -+++ b/drivers/net/can/dev.c -@@ -567,11 +567,11 @@ static void can_restart(struct net_device *dev) - } - cf->can_id |= CAN_ERR_RESTARTED; - -- netif_rx_ni(skb); -- - stats->rx_packets++; - stats->rx_bytes += cf->can_dlc; - -+ netif_rx_ni(skb); -+ - restart: - netdev_dbg(dev, "restarted\n"); - priv->can_stats.restarts++; -diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c -index dee3e689b54da..96bbdef672bc9 100644 ---- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c -+++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c -@@ -512,11 +512,11 @@ static int pcan_usb_fd_decode_canmsg(struct pcan_usb_fd_if *usb_if, - else - memcpy(cfd->data, rm->d, cfd->len); - -- peak_usb_netif_rx(skb, &usb_if->time_ref, le32_to_cpu(rm->ts_low)); -- - netdev->stats.rx_packets++; - netdev->stats.rx_bytes += cfd->len; - -+ peak_usb_netif_rx(skb, &usb_if->time_ref, le32_to_cpu(rm->ts_low)); -+ - return 0; - } - -@@ -578,11 +578,11 @@ static int pcan_usb_fd_decode_status(struct pcan_usb_fd_if *usb_if, - if (!skb) - return -ENOMEM; - -- peak_usb_netif_rx(skb, &usb_if->time_ref, le32_to_cpu(sm->ts_low)); -- - netdev->stats.rx_packets++; - netdev->stats.rx_bytes += cf->can_dlc; - -+ peak_usb_netif_rx(skb, &usb_if->time_ref, le32_to_cpu(sm->ts_low)); -+ - return 0; - } - -diff --git a/drivers/net/can/vxcan.c b/drivers/net/can/vxcan.c -index d6ba9426be4de..b1baa4ac1d537 100644 ---- a/drivers/net/can/vxcan.c -+++ b/drivers/net/can/vxcan.c -@@ -39,6 +39,7 @@ static netdev_tx_t vxcan_xmit(struct sk_buff *skb, struct net_device *dev) - struct net_device *peer; - struct canfd_frame *cfd = (struct canfd_frame *)skb->data; - struct net_device_stats *peerstats, *srcstats = &dev->stats; -+ u8 len; - - if (can_dropped_invalid_skb(dev, skb)) - return NETDEV_TX_OK; -@@ -61,12 +62,13 @@ static netdev_tx_t vxcan_xmit(struct sk_buff *skb, struct net_device *dev) - skb->dev = peer; - skb->ip_summed = CHECKSUM_UNNECESSARY; - -+ len = cfd->len; - if (netif_rx_ni(skb) == NET_RX_SUCCESS) { - srcstats->tx_packets++; -- srcstats->tx_bytes += cfd->len; -+ srcstats->tx_bytes += len; - peerstats = &peer->stats; - peerstats->rx_packets++; -- peerstats->rx_bytes += cfd->len; -+ peerstats->rx_bytes += len; - } - - out_unlock: -diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c -index 4bd66ba72c03c..0b1223f360d97 100644 ---- a/drivers/net/dsa/b53/b53_common.c -+++ b/drivers/net/dsa/b53/b53_common.c -@@ -1330,7 +1330,7 @@ int b53_vlan_prepare(struct dsa_switch *ds, int port, - if ((is5325(dev) || is5365(dev)) && vlan->vid_begin == 0) - return -EOPNOTSUPP; - -- if (vlan->vid_end > dev->num_vlans) -+ if (vlan->vid_end >= dev->num_vlans) - return -ERANGE; - - b53_enable_vlan(dev, true, ds->vlan_filtering); -diff --git a/drivers/net/dsa/mv88e6xxx/global1_vtu.c b/drivers/net/dsa/mv88e6xxx/global1_vtu.c -index c51c01345223d..fcfda1a1cecfc 100644 ---- a/drivers/net/dsa/mv88e6xxx/global1_vtu.c -+++ b/drivers/net/dsa/mv88e6xxx/global1_vtu.c -@@ -351,6 +351,10 @@ int mv88e6250_g1_vtu_getnext(struct mv88e6xxx_chip *chip, - if (err) - return err; - -+ err = mv88e6185_g1_stu_data_read(chip, entry); -+ if (err) -+ return err; -+ - /* VTU DBNum[3:0] are located in VTU Operation 3:0 - * VTU DBNum[5:4] are located in VTU Operation 9:8 - */ -diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c -index da1fd0e08c36e..6030c90d50ccb 100644 ---- a/drivers/net/ethernet/mscc/ocelot.c -+++ b/drivers/net/ethernet/mscc/ocelot.c -@@ -1716,10 +1716,8 @@ static int ocelot_netdevice_event(struct notifier_block *unused, - struct net_device *dev = netdev_notifier_info_to_dev(ptr); - int ret = 0; - -- if (!ocelot_netdevice_dev_check(dev)) -- return 0; -- - if (event == NETDEV_PRECHANGEUPPER && -+ ocelot_netdevice_dev_check(dev) && - netif_is_lag_master(info->upper_dev)) { - struct netdev_lag_upper_info *lag_upper_info = info->upper_info; - struct netlink_ext_ack *extack; -diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c -index 8aa1b1bda96d1..18f86e441570c 100644 ---- a/drivers/net/ethernet/renesas/sh_eth.c -+++ b/drivers/net/ethernet/renesas/sh_eth.c -@@ -2640,10 +2640,10 @@ static int sh_eth_close(struct net_device *ndev) - /* Free all the skbuffs in the Rx queue and the DMA buffer. */ - sh_eth_ring_free(ndev); - -- pm_runtime_put_sync(&mdp->pdev->dev); -- - mdp->is_opened = 0; - -+ pm_runtime_put(&mdp->pdev->dev); -+ - return 0; - } - -diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c -index bb07024d22edc..0a745769e7127 100644 ---- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c -+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c -@@ -334,7 +334,7 @@ FUNC_GROUP_DECL(RMII4, F24, E23, E24, E25, C25, C24, B26, B25, B24); - - #define D22 40 - SIG_EXPR_LIST_DECL_SESG(D22, SD1CLK, SD1, SIG_DESC_SET(SCU414, 8)); --SIG_EXPR_LIST_DECL_SEMG(D22, PWM8, PWM8G0, PWM8, SIG_DESC_SET(SCU414, 8)); -+SIG_EXPR_LIST_DECL_SEMG(D22, PWM8, PWM8G0, PWM8, SIG_DESC_SET(SCU4B4, 8)); - PIN_DECL_2(D22, GPIOF0, SD1CLK, PWM8); - GROUP_DECL(PWM8G0, D22); - -diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c -index 8bd0a078bfc47..61e7d938d4c5c 100644 ---- a/drivers/pinctrl/pinctrl-ingenic.c -+++ b/drivers/pinctrl/pinctrl-ingenic.c -@@ -1378,7 +1378,7 @@ static inline bool ingenic_gpio_get_value(struct ingenic_gpio_chip *jzgc, - static void ingenic_gpio_set_value(struct ingenic_gpio_chip *jzgc, - u8 offset, int value) - { -- if (jzgc->jzpc->version >= ID_JZ4760) -+ if (jzgc->jzpc->version >= ID_JZ4770) - ingenic_gpio_set_bit(jzgc, JZ4760_GPIO_PAT0, offset, !!value); - else - ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_DATA, offset, !!value); -@@ -1389,7 +1389,7 @@ static void irq_set_type(struct ingenic_gpio_chip *jzgc, - { - u8 reg1, reg2; - -- if (jzgc->jzpc->version >= ID_JZ4760) { -+ if (jzgc->jzpc->version >= ID_JZ4770) { - reg1 = JZ4760_GPIO_PAT1; - reg2 = JZ4760_GPIO_PAT0; - } else { -@@ -1464,7 +1464,7 @@ static void ingenic_gpio_irq_enable(struct irq_data *irqd) - struct ingenic_gpio_chip *jzgc = gpiochip_get_data(gc); - int irq = irqd->hwirq; - -- if (jzgc->jzpc->version >= ID_JZ4760) -+ if (jzgc->jzpc->version >= ID_JZ4770) - ingenic_gpio_set_bit(jzgc, JZ4760_GPIO_INT, irq, true); - else - ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_SELECT, irq, true); -@@ -1480,7 +1480,7 @@ static void ingenic_gpio_irq_disable(struct irq_data *irqd) - - ingenic_gpio_irq_mask(irqd); - -- if (jzgc->jzpc->version >= ID_JZ4760) -+ if (jzgc->jzpc->version >= ID_JZ4770) - ingenic_gpio_set_bit(jzgc, JZ4760_GPIO_INT, irq, false); - else - ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_SELECT, irq, false); -@@ -1505,7 +1505,7 @@ static void ingenic_gpio_irq_ack(struct irq_data *irqd) - irq_set_type(jzgc, irq, IRQ_TYPE_LEVEL_HIGH); - } - -- if (jzgc->jzpc->version >= ID_JZ4760) -+ if (jzgc->jzpc->version >= ID_JZ4770) - ingenic_gpio_set_bit(jzgc, JZ4760_GPIO_FLAG, irq, false); - else - ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_DATA, irq, true); -@@ -1562,7 +1562,7 @@ static void ingenic_gpio_irq_handler(struct irq_desc *desc) - - chained_irq_enter(irq_chip, desc); - -- if (jzgc->jzpc->version >= ID_JZ4760) -+ if (jzgc->jzpc->version >= ID_JZ4770) - flag = ingenic_gpio_read_reg(jzgc, JZ4760_GPIO_FLAG); - else - flag = ingenic_gpio_read_reg(jzgc, JZ4740_GPIO_FLAG); -@@ -1643,7 +1643,7 @@ static int ingenic_gpio_get_direction(struct gpio_chip *gc, unsigned int offset) - struct ingenic_pinctrl *jzpc = jzgc->jzpc; - unsigned int pin = gc->base + offset; - -- if (jzpc->version >= ID_JZ4760) -+ if (jzpc->version >= ID_JZ4770) - return ingenic_get_pin_config(jzpc, pin, JZ4760_GPIO_INT) || - ingenic_get_pin_config(jzpc, pin, JZ4760_GPIO_PAT1); - -@@ -1676,7 +1676,7 @@ static int ingenic_pinmux_set_pin_fn(struct ingenic_pinctrl *jzpc, - ingenic_shadow_config_pin(jzpc, pin, JZ4760_GPIO_PAT1, func & 0x2); - ingenic_shadow_config_pin(jzpc, pin, JZ4760_GPIO_PAT0, func & 0x1); - ingenic_shadow_config_pin_load(jzpc, pin); -- } else if (jzpc->version >= ID_JZ4760) { -+ } else if (jzpc->version >= ID_JZ4770) { - ingenic_config_pin(jzpc, pin, JZ4760_GPIO_INT, false); - ingenic_config_pin(jzpc, pin, GPIO_MSK, false); - ingenic_config_pin(jzpc, pin, JZ4760_GPIO_PAT1, func & 0x2); -@@ -1684,7 +1684,7 @@ static int ingenic_pinmux_set_pin_fn(struct ingenic_pinctrl *jzpc, - } else { - ingenic_config_pin(jzpc, pin, JZ4740_GPIO_FUNC, true); - ingenic_config_pin(jzpc, pin, JZ4740_GPIO_TRIG, func & 0x2); -- ingenic_config_pin(jzpc, pin, JZ4740_GPIO_SELECT, func > 0); -+ ingenic_config_pin(jzpc, pin, JZ4740_GPIO_SELECT, func & 0x1); - } - - return 0; -@@ -1734,7 +1734,7 @@ static int ingenic_pinmux_gpio_set_direction(struct pinctrl_dev *pctldev, - ingenic_shadow_config_pin(jzpc, pin, GPIO_MSK, true); - ingenic_shadow_config_pin(jzpc, pin, JZ4760_GPIO_PAT1, input); - ingenic_shadow_config_pin_load(jzpc, pin); -- } else if (jzpc->version >= ID_JZ4760) { -+ } else if (jzpc->version >= ID_JZ4770) { - ingenic_config_pin(jzpc, pin, JZ4760_GPIO_INT, false); - ingenic_config_pin(jzpc, pin, GPIO_MSK, true); - ingenic_config_pin(jzpc, pin, JZ4760_GPIO_PAT1, input); -@@ -1764,7 +1764,7 @@ static int ingenic_pinconf_get(struct pinctrl_dev *pctldev, - unsigned int offt = pin / PINS_PER_GPIO_CHIP; - bool pull; - -- if (jzpc->version >= ID_JZ4760) -+ if (jzpc->version >= ID_JZ4770) - pull = !ingenic_get_pin_config(jzpc, pin, JZ4760_GPIO_PEN); - else - pull = !ingenic_get_pin_config(jzpc, pin, JZ4740_GPIO_PULL_DIS); -@@ -1796,7 +1796,7 @@ static int ingenic_pinconf_get(struct pinctrl_dev *pctldev, - static void ingenic_set_bias(struct ingenic_pinctrl *jzpc, - unsigned int pin, bool enabled) - { -- if (jzpc->version >= ID_JZ4760) -+ if (jzpc->version >= ID_JZ4770) - ingenic_config_pin(jzpc, pin, JZ4760_GPIO_PEN, !enabled); - else - ingenic_config_pin(jzpc, pin, JZ4740_GPIO_PULL_DIS, !enabled); -diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c -index ffb8d5d1eb5ff..f85a5c720507b 100644 ---- a/drivers/platform/x86/i2c-multi-instantiate.c -+++ b/drivers/platform/x86/i2c-multi-instantiate.c -@@ -166,13 +166,29 @@ static const struct i2c_inst_data bsg2150_data[] = { - {} - }; - --static const struct i2c_inst_data int3515_data[] = { -- { "tps6598x", IRQ_RESOURCE_APIC, 0 }, -- { "tps6598x", IRQ_RESOURCE_APIC, 1 }, -- { "tps6598x", IRQ_RESOURCE_APIC, 2 }, -- { "tps6598x", IRQ_RESOURCE_APIC, 3 }, -- {} --}; -+/* -+ * Device with _HID INT3515 (TI PD controllers) has some unresolved interrupt -+ * issues. The most common problem seen is interrupt flood. -+ * -+ * There are at least two known causes. Firstly, on some boards, the -+ * I2CSerialBus resource index does not match the Interrupt resource, i.e. they -+ * are not one-to-one mapped like in the array below. Secondly, on some boards -+ * the IRQ line from the PD controller is not actually connected at all. But the -+ * interrupt flood is also seen on some boards where those are not a problem, so -+ * there are some other problems as well. -+ * -+ * Because of the issues with the interrupt, the device is disabled for now. If -+ * you wish to debug the issues, uncomment the below, and add an entry for the -+ * INT3515 device to the i2c_multi_instance_ids table. -+ * -+ * static const struct i2c_inst_data int3515_data[] = { -+ * { "tps6598x", IRQ_RESOURCE_APIC, 0 }, -+ * { "tps6598x", IRQ_RESOURCE_APIC, 1 }, -+ * { "tps6598x", IRQ_RESOURCE_APIC, 2 }, -+ * { "tps6598x", IRQ_RESOURCE_APIC, 3 }, -+ * { } -+ * }; -+ */ - - /* - * Note new device-ids must also be added to i2c_multi_instantiate_ids in -@@ -181,7 +197,6 @@ static const struct i2c_inst_data int3515_data[] = { - static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = { - { "BSG1160", (unsigned long)bsg1160_data }, - { "BSG2150", (unsigned long)bsg2150_data }, -- { "INT3515", (unsigned long)int3515_data }, - { } - }; - MODULE_DEVICE_TABLE(acpi, i2c_multi_inst_acpi_ids); -diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c -index 7598cd46cf606..5b81bafa5c165 100644 ---- a/drivers/platform/x86/ideapad-laptop.c -+++ b/drivers/platform/x86/ideapad-laptop.c -@@ -92,6 +92,7 @@ struct ideapad_private { - struct dentry *debug; - unsigned long cfg; - bool has_hw_rfkill_switch; -+ bool has_touchpad_switch; - const char *fnesc_guid; - }; - -@@ -535,7 +536,9 @@ static umode_t ideapad_is_visible(struct kobject *kobj, - } else if (attr == &dev_attr_fn_lock.attr) { - supported = acpi_has_method(priv->adev->handle, "HALS") && - acpi_has_method(priv->adev->handle, "SALS"); -- } else -+ } else if (attr == &dev_attr_touchpad.attr) -+ supported = priv->has_touchpad_switch; -+ else - supported = true; - - return supported ? attr->mode : 0; -@@ -867,6 +870,9 @@ static void ideapad_sync_touchpad_state(struct ideapad_private *priv) - { - unsigned long value; - -+ if (!priv->has_touchpad_switch) -+ return; -+ - /* Without reading from EC touchpad LED doesn't switch state */ - if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) { - /* Some IdeaPads don't really turn off touchpad - they only -@@ -989,6 +995,9 @@ static int ideapad_acpi_add(struct platform_device *pdev) - priv->platform_device = pdev; - priv->has_hw_rfkill_switch = dmi_check_system(hw_rfkill_list); - -+ /* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */ -+ priv->has_touchpad_switch = !acpi_dev_present("ELAN0634", NULL, -1); -+ - ret = ideapad_sysfs_init(priv); - if (ret) - return ret; -@@ -1006,6 +1015,10 @@ static int ideapad_acpi_add(struct platform_device *pdev) - if (!priv->has_hw_rfkill_switch) - write_ec_cmd(priv->adev->handle, VPCCMD_W_RF, 1); - -+ /* The same for Touchpad */ -+ if (!priv->has_touchpad_switch) -+ write_ec_cmd(priv->adev->handle, VPCCMD_W_TOUCHPAD, 1); -+ - for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) - if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg)) - ideapad_register_rfkill(priv, i); -diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c -index bc8b0098d4f32..37035dca469cf 100644 ---- a/drivers/platform/x86/intel-vbtn.c -+++ b/drivers/platform/x86/intel-vbtn.c -@@ -191,12 +191,6 @@ static const struct dmi_system_id dmi_switches_allow_list[] = { - DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7130"), - }, - }, -- { -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), -- DMI_MATCH(DMI_PRODUCT_NAME, "HP Stream x360 Convertible PC 11"), -- }, -- }, - { - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), -diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c -index 4a23dd8b7f9aa..b9c1f722f1ded 100644 ---- a/drivers/scsi/megaraid/megaraid_sas_base.c -+++ b/drivers/scsi/megaraid/megaraid_sas_base.c -@@ -8174,11 +8174,9 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, - goto out; - } - -+ /* always store 64 bits regardless of addressing */ - sense_ptr = (void *)cmd->frame + ioc->sense_off; -- if (instance->consistent_mask_64bit) -- put_unaligned_le64(sense_handle, sense_ptr); -- else -- put_unaligned_le32(sense_handle, sense_ptr); -+ put_unaligned_le64(sense_handle, sense_ptr); - } - - /* -diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c -index 35c96ea2653be..fdd966fea7f6a 100644 ---- a/drivers/scsi/qedi/qedi_main.c -+++ b/drivers/scsi/qedi/qedi_main.c -@@ -2175,7 +2175,7 @@ qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type, - chap_name); - break; - case ISCSI_BOOT_TGT_CHAP_SECRET: -- rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN, -+ rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN, - chap_secret); - break; - case ISCSI_BOOT_TGT_REV_CHAP_NAME: -@@ -2183,7 +2183,7 @@ qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type, - mchap_name); - break; - case ISCSI_BOOT_TGT_REV_CHAP_SECRET: -- rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN, -+ rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN, - mchap_secret); - break; - case ISCSI_BOOT_TGT_FLAGS: -diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c -index 6a2f8bacfacea..f55249766d224 100644 ---- a/drivers/scsi/sd.c -+++ b/drivers/scsi/sd.c -@@ -934,8 +934,10 @@ static blk_status_t sd_setup_write_zeroes_cmnd(struct scsi_cmnd *cmd) - } - } - -- if (sdp->no_write_same) -+ if (sdp->no_write_same) { -+ rq->rq_flags |= RQF_QUIET; - return BLK_STS_TARGET; -+ } - - if (sdkp->ws16 || lba > 0xffffffff || nr_blocks > 0xffff) - return sd_setup_write_same16_cmnd(cmd, false); -diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c -index b888117f4ecd3..476ef8044ae59 100644 ---- a/drivers/scsi/ufs/ufshcd.c -+++ b/drivers/scsi/ufs/ufshcd.c -@@ -5980,19 +5980,16 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd) - { - struct Scsi_Host *host; - struct ufs_hba *hba; -- unsigned int tag; - u32 pos; - int err; -- u8 resp = 0xF; -- struct ufshcd_lrb *lrbp; -+ u8 resp = 0xF, lun; - unsigned long flags; - - host = cmd->device->host; - hba = shost_priv(host); -- tag = cmd->request->tag; - -- lrbp = &hba->lrb[tag]; -- err = ufshcd_issue_tm_cmd(hba, lrbp->lun, 0, UFS_LOGICAL_RESET, &resp); -+ lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun); -+ err = ufshcd_issue_tm_cmd(hba, lun, 0, UFS_LOGICAL_RESET, &resp); - if (err || resp != UPIU_TASK_MANAGEMENT_FUNC_COMPL) { - if (!err) - err = resp; -@@ -6001,7 +5998,7 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd) - - /* clear the commands that were pending for corresponding LUN */ - for_each_set_bit(pos, &hba->outstanding_reqs, hba->nutrs) { -- if (hba->lrb[pos].lun == lrbp->lun) { -+ if (hba->lrb[pos].lun == lun) { - err = ufshcd_clear_cmd(hba, pos); - if (err) - break; -diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c -index 4e9a590712cb2..e006f40ffdc04 100644 ---- a/drivers/tty/serial/mvebu-uart.c -+++ b/drivers/tty/serial/mvebu-uart.c -@@ -648,6 +648,14 @@ static void wait_for_xmitr(struct uart_port *port) - (val & STAT_TX_RDY(port)), 1, 10000); - } - -+static void wait_for_xmite(struct uart_port *port) -+{ -+ u32 val; -+ -+ readl_poll_timeout_atomic(port->membase + UART_STAT, val, -+ (val & STAT_TX_EMP), 1, 10000); -+} -+ - static void mvebu_uart_console_putchar(struct uart_port *port, int ch) - { - wait_for_xmitr(port); -@@ -675,7 +683,7 @@ static void mvebu_uart_console_write(struct console *co, const char *s, - - uart_console_write(port, s, count, mvebu_uart_console_putchar); - -- wait_for_xmitr(port); -+ wait_for_xmite(port); - - if (ier) - writel(ier, port->membase + UART_CTRL(port)); -diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c -index b4343c6aa6512..6a2dc823ea828 100644 ---- a/drivers/tty/serial/sifive.c -+++ b/drivers/tty/serial/sifive.c -@@ -973,6 +973,7 @@ static int sifive_serial_probe(struct platform_device *pdev) - /* Set up clock divider */ - ssp->clkin_rate = clk_get_rate(ssp->clk); - ssp->baud_rate = SIFIVE_DEFAULT_BAUD_RATE; -+ ssp->port.uartclk = ssp->baud_rate * 16; - __ssp_update_div(ssp); - - platform_set_drvdata(pdev, ssp); -diff --git a/drivers/usb/gadget/udc/aspeed-vhub/epn.c b/drivers/usb/gadget/udc/aspeed-vhub/epn.c -index 7475c74aa5c5e..66d8884615f0e 100644 ---- a/drivers/usb/gadget/udc/aspeed-vhub/epn.c -+++ b/drivers/usb/gadget/udc/aspeed-vhub/epn.c -@@ -420,7 +420,10 @@ static void ast_vhub_stop_active_req(struct ast_vhub_ep *ep, - u32 state, reg, loops; - - /* Stop DMA activity */ -- writel(0, ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); -+ if (ep->epn.desc_mode) -+ writel(VHUB_EP_DMA_CTRL_RESET, ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); -+ else -+ writel(0, ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); - - /* Wait for it to complete */ - for (loops = 0; loops < 1000; loops++) { -diff --git a/drivers/usb/gadget/udc/bdc/Kconfig b/drivers/usb/gadget/udc/bdc/Kconfig -index 3e88c7670b2ed..fb01ff47b64cf 100644 ---- a/drivers/usb/gadget/udc/bdc/Kconfig -+++ b/drivers/usb/gadget/udc/bdc/Kconfig -@@ -17,7 +17,7 @@ if USB_BDC_UDC - comment "Platform Support" - config USB_BDC_PCI - tristate "BDC support for PCIe based platforms" -- depends on USB_PCI -+ depends on USB_PCI && BROKEN - default USB_BDC_UDC - help - Enable support for platforms which have BDC connected through PCIe, such as Lego3 FPGA platform. -diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c -index 0e7820158aaa9..e41f67cd3d469 100644 ---- a/drivers/usb/gadget/udc/core.c -+++ b/drivers/usb/gadget/udc/core.c -@@ -1477,10 +1477,13 @@ static ssize_t soft_connect_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t n) - { - struct usb_udc *udc = container_of(dev, struct usb_udc, dev); -+ ssize_t ret; - -+ mutex_lock(&udc_lock); - if (!udc->driver) { - dev_err(dev, "soft-connect without a gadget driver\n"); -- return -EOPNOTSUPP; -+ ret = -EOPNOTSUPP; -+ goto out; - } - - if (sysfs_streq(buf, "connect")) { -@@ -1491,10 +1494,14 @@ static ssize_t soft_connect_store(struct device *dev, - usb_gadget_udc_stop(udc); - } else { - dev_err(dev, "unsupported command '%s'\n", buf); -- return -EINVAL; -+ ret = -EINVAL; -+ goto out; - } - -- return n; -+ ret = n; -+out: -+ mutex_unlock(&udc_lock); -+ return ret; - } - static DEVICE_ATTR_WO(soft_connect); - -diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c -index 0e5c56e065591..5c6ce1ef3f4b0 100644 ---- a/drivers/usb/host/ehci-hcd.c -+++ b/drivers/usb/host/ehci-hcd.c -@@ -574,6 +574,7 @@ static int ehci_run (struct usb_hcd *hcd) - struct ehci_hcd *ehci = hcd_to_ehci (hcd); - u32 temp; - u32 hcc_params; -+ int rc; - - hcd->uses_new_polling = 1; - -@@ -629,9 +630,20 @@ static int ehci_run (struct usb_hcd *hcd) - down_write(&ehci_cf_port_reset_rwsem); - ehci->rh_state = EHCI_RH_RUNNING; - ehci_writel(ehci, FLAG_CF, &ehci->regs->configured_flag); -+ -+ /* Wait until HC become operational */ - ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */ - msleep(5); -+ rc = ehci_handshake(ehci, &ehci->regs->status, STS_HALT, 0, 100 * 1000); -+ - up_write(&ehci_cf_port_reset_rwsem); -+ -+ if (rc) { -+ ehci_err(ehci, "USB %x.%x, controller refused to start: %d\n", -+ ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f), rc); -+ return rc; -+ } -+ - ehci->last_periodic_enable = ktime_get_real(); - - temp = HC_VERSION(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase)); -diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c -index 087402aec5cbe..9f9ab5ccea889 100644 ---- a/drivers/usb/host/ehci-hub.c -+++ b/drivers/usb/host/ehci-hub.c -@@ -345,6 +345,9 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) - - unlink_empty_async_suspended(ehci); - -+ /* Some Synopsys controllers mistakenly leave IAA turned on */ -+ ehci_writel(ehci, STS_IAA, &ehci->regs->status); -+ - /* Any IAA cycle that started before the suspend is now invalid */ - end_iaa_cycle(ehci); - ehci_handle_start_intr_unlinks(ehci); -diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index 49894541ea9a5..52e156c018042 100644 ---- a/drivers/usb/host/xhci-ring.c -+++ b/drivers/usb/host/xhci-ring.c -@@ -2918,6 +2918,8 @@ static void queue_trb(struct xhci_hcd *xhci, struct xhci_ring *ring, - trb->field[0] = cpu_to_le32(field1); - trb->field[1] = cpu_to_le32(field2); - trb->field[2] = cpu_to_le32(field3); -+ /* make sure TRB is fully written before giving it to the controller */ -+ wmb(); - trb->field[3] = cpu_to_le32(field4); - - trace_xhci_queue_trb(ring, trb); -diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c -index b8e24ccba9f3e..6087b1fa530f8 100644 ---- a/drivers/usb/host/xhci-tegra.c -+++ b/drivers/usb/host/xhci-tegra.c -@@ -562,6 +562,13 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra, - enable); - if (err < 0) - break; -+ -+ /* -+ * wait 500us for LFPS detector to be disabled before -+ * sending ACK -+ */ -+ if (!enable) -+ usleep_range(500, 1000); - } - - if (err < 0) { -diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c -index 26df84c45db4e..7b94a6c316643 100644 ---- a/drivers/xen/events/events_base.c -+++ b/drivers/xen/events/events_base.c -@@ -1988,16 +1988,6 @@ static struct irq_chip xen_percpu_chip __read_mostly = { - .irq_ack = ack_dynirq, - }; - --int xen_set_callback_via(uint64_t via) --{ -- struct xen_hvm_param a; -- a.domid = DOMID_SELF; -- a.index = HVM_PARAM_CALLBACK_IRQ; -- a.value = via; -- return HYPERVISOR_hvm_op(HVMOP_set_param, &a); --} --EXPORT_SYMBOL_GPL(xen_set_callback_via); -- - #ifdef CONFIG_XEN_PVHVM - /* Vector callbacks are better than PCI interrupts to receive event - * channel notifications because we can receive vector callbacks on any -diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c -index 5e30602fdbad8..c45646450135f 100644 ---- a/drivers/xen/platform-pci.c -+++ b/drivers/xen/platform-pci.c -@@ -149,7 +149,6 @@ static int platform_pci_probe(struct pci_dev *pdev, - ret = gnttab_init(); - if (ret) - goto grant_out; -- xenbus_probe(NULL); - return 0; - grant_out: - gnttab_free_auto_xlat_frames(); -diff --git a/drivers/xen/xenbus/xenbus.h b/drivers/xen/xenbus/xenbus.h -index 88516a8a9f932..a9bb5f91082d3 100644 ---- a/drivers/xen/xenbus/xenbus.h -+++ b/drivers/xen/xenbus/xenbus.h -@@ -115,6 +115,7 @@ int xenbus_probe_node(struct xen_bus_type *bus, - const char *type, - const char *nodename); - int xenbus_probe_devices(struct xen_bus_type *bus); -+void xenbus_probe(void); - - void xenbus_dev_changed(const char *node, struct xen_bus_type *bus); - -diff --git a/drivers/xen/xenbus/xenbus_comms.c b/drivers/xen/xenbus/xenbus_comms.c -index eb5151fc8efab..e5fda0256feb3 100644 ---- a/drivers/xen/xenbus/xenbus_comms.c -+++ b/drivers/xen/xenbus/xenbus_comms.c -@@ -57,16 +57,8 @@ DEFINE_MUTEX(xs_response_mutex); - static int xenbus_irq; - static struct task_struct *xenbus_task; - --static DECLARE_WORK(probe_work, xenbus_probe); -- -- - static irqreturn_t wake_waiting(int irq, void *unused) - { -- if (unlikely(xenstored_ready == 0)) { -- xenstored_ready = 1; -- schedule_work(&probe_work); -- } -- - wake_up(&xb_waitq); - return IRQ_HANDLED; - } -diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c -index e6d0903459e11..14ccf13ab8fa1 100644 ---- a/drivers/xen/xenbus/xenbus_probe.c -+++ b/drivers/xen/xenbus/xenbus_probe.c -@@ -683,29 +683,76 @@ void unregister_xenstore_notifier(struct notifier_block *nb) - } - EXPORT_SYMBOL_GPL(unregister_xenstore_notifier); - --void xenbus_probe(struct work_struct *unused) -+void xenbus_probe(void) - { - xenstored_ready = 1; - -+ /* -+ * In the HVM case, xenbus_init() deferred its call to -+ * xs_init() in case callbacks were not operational yet. -+ * So do it now. -+ */ -+ if (xen_store_domain_type == XS_HVM) -+ xs_init(); -+ - /* Notify others that xenstore is up */ - blocking_notifier_call_chain(&xenstore_chain, 0, NULL); - } --EXPORT_SYMBOL_GPL(xenbus_probe); - --static int __init xenbus_probe_initcall(void) -+/* -+ * Returns true when XenStore init must be deferred in order to -+ * allow the PCI platform device to be initialised, before we -+ * can actually have event channel interrupts working. -+ */ -+static bool xs_hvm_defer_init_for_callback(void) - { -- if (!xen_domain()) -- return -ENODEV; -+#ifdef CONFIG_XEN_PVHVM -+ return xen_store_domain_type == XS_HVM && -+ !xen_have_vector_callback; -+#else -+ return false; -+#endif -+} - -- if (xen_initial_domain() || xen_hvm_domain()) -- return 0; -+static int __init xenbus_probe_initcall(void) -+{ -+ /* -+ * Probe XenBus here in the XS_PV case, and also XS_HVM unless we -+ * need to wait for the platform PCI device to come up. -+ */ -+ if (xen_store_domain_type == XS_PV || -+ (xen_store_domain_type == XS_HVM && -+ !xs_hvm_defer_init_for_callback())) -+ xenbus_probe(); - -- xenbus_probe(NULL); - return 0; - } -- - device_initcall(xenbus_probe_initcall); - -+int xen_set_callback_via(uint64_t via) -+{ -+ struct xen_hvm_param a; -+ int ret; -+ -+ a.domid = DOMID_SELF; -+ a.index = HVM_PARAM_CALLBACK_IRQ; -+ a.value = via; -+ -+ ret = HYPERVISOR_hvm_op(HVMOP_set_param, &a); -+ if (ret) -+ return ret; -+ -+ /* -+ * If xenbus_probe_initcall() deferred the xenbus_probe() -+ * due to the callback not functioning yet, we can do it now. -+ */ -+ if (!xenstored_ready && xs_hvm_defer_init_for_callback()) -+ xenbus_probe(); -+ -+ return ret; -+} -+EXPORT_SYMBOL_GPL(xen_set_callback_via); -+ - /* Set up event channel for xenstored which is run as a local process - * (this is normally used only in dom0) - */ -@@ -818,11 +865,17 @@ static int __init xenbus_init(void) - break; - } - -- /* Initialize the interface to xenstore. */ -- err = xs_init(); -- if (err) { -- pr_warn("Error initializing xenstore comms: %i\n", err); -- goto out_error; -+ /* -+ * HVM domains may not have a functional callback yet. In that -+ * case let xs_init() be called from xenbus_probe(), which will -+ * get invoked at an appropriate time. -+ */ -+ if (xen_store_domain_type != XS_HVM) { -+ err = xs_init(); -+ if (err) { -+ pr_warn("Error initializing xenstore comms: %i\n", err); -+ goto out_error; -+ } - } - - if ((xen_store_domain_type != XS_LOCAL) && -diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c -index ace49a999ecec..59e7a2ad440fc 100644 ---- a/fs/btrfs/block-group.c -+++ b/fs/btrfs/block-group.c -@@ -2497,7 +2497,8 @@ again: - * Go through delayed refs for all the stuff we've just kicked off - * and then loop back (just once) - */ -- ret = btrfs_run_delayed_refs(trans, 0); -+ if (!ret) -+ ret = btrfs_run_delayed_refs(trans, 0); - if (!ret && loops == 0) { - loops++; - spin_lock(&cur_trans->dirty_bgs_lock); -diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c -index c0dd839e99b79..6317394f02b86 100644 ---- a/fs/btrfs/extent-tree.c -+++ b/fs/btrfs/extent-tree.c -@@ -5390,7 +5390,15 @@ int btrfs_drop_snapshot(struct btrfs_root *root, - goto out_free; - } - -- trans = btrfs_start_transaction(tree_root, 0); -+ /* -+ * Use join to avoid potential EINTR from transaction -+ * start. See wait_reserve_ticket and the whole -+ * reservation callchain. -+ */ -+ if (for_reloc) -+ trans = btrfs_join_transaction(tree_root); -+ else -+ trans = btrfs_start_transaction(tree_root, 0); - if (IS_ERR(trans)) { - err = PTR_ERR(trans); - goto out_free; -diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c -index 903136ceac34a..ecdefa7262d2b 100644 ---- a/fs/btrfs/send.c -+++ b/fs/btrfs/send.c -@@ -5519,6 +5519,21 @@ static int clone_range(struct send_ctx *sctx, - break; - offset += clone_len; - clone_root->offset += clone_len; -+ -+ /* -+ * If we are cloning from the file we are currently processing, -+ * and using the send root as the clone root, we must stop once -+ * the current clone offset reaches the current eof of the file -+ * at the receiver, otherwise we would issue an invalid clone -+ * operation (source range going beyond eof) and cause the -+ * receiver to fail. So if we reach the current eof, bail out -+ * and fallback to a regular write. -+ */ -+ if (clone_root->root == sctx->send_root && -+ clone_root->ino == sctx->cur_ino && -+ clone_root->offset >= sctx->cur_inode_next_write_offset) -+ break; -+ - data_offset += clone_len; - next: - path->slots[0]++; -diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c -index 67ffbe92944c6..db3b17bca11f5 100644 ---- a/fs/btrfs/volumes.c -+++ b/fs/btrfs/volumes.c -@@ -4409,6 +4409,8 @@ int btrfs_recover_balance(struct btrfs_fs_info *fs_info) - btrfs_warn(fs_info, - "balance: cannot set exclusive op status, resume manually"); - -+ btrfs_release_path(path); -+ - mutex_lock(&fs_info->balance_mutex); - BUG_ON(fs_info->balance_ctl); - spin_lock(&fs_info->balance_lock); -diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c -index 6d6de183915b5..4ffbf8f965814 100644 ---- a/fs/cifs/transport.c -+++ b/fs/cifs/transport.c -@@ -339,7 +339,7 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, - if (ssocket == NULL) - return -EAGAIN; - -- if (signal_pending(current)) { -+ if (fatal_signal_pending(current)) { - cifs_dbg(FYI, "signal pending before send request\n"); - return -ERESTARTSYS; - } -@@ -431,7 +431,7 @@ unmask: - - if (signal_pending(current) && (total_len != send_length)) { - cifs_dbg(FYI, "signal is pending after attempt to send\n"); -- rc = -EINTR; -+ rc = -ERESTARTSYS; - } - - /* uncork it */ -diff --git a/include/asm-generic/bitops/atomic.h b/include/asm-generic/bitops/atomic.h -index dd90c9792909d..0e7316a86240b 100644 ---- a/include/asm-generic/bitops/atomic.h -+++ b/include/asm-generic/bitops/atomic.h -@@ -11,19 +11,19 @@ - * See Documentation/atomic_bitops.txt for details. - */ - --static inline void set_bit(unsigned int nr, volatile unsigned long *p) -+static __always_inline void set_bit(unsigned int nr, volatile unsigned long *p) - { - p += BIT_WORD(nr); - atomic_long_or(BIT_MASK(nr), (atomic_long_t *)p); - } - --static inline void clear_bit(unsigned int nr, volatile unsigned long *p) -+static __always_inline void clear_bit(unsigned int nr, volatile unsigned long *p) - { - p += BIT_WORD(nr); - atomic_long_andnot(BIT_MASK(nr), (atomic_long_t *)p); - } - --static inline void change_bit(unsigned int nr, volatile unsigned long *p) -+static __always_inline void change_bit(unsigned int nr, volatile unsigned long *p) - { - p += BIT_WORD(nr); - atomic_long_xor(BIT_MASK(nr), (atomic_long_t *)p); -diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h -index c71eb294da954..6c8f8e5e33c3d 100644 ---- a/include/net/inet_connection_sock.h -+++ b/include/net/inet_connection_sock.h -@@ -83,6 +83,8 @@ struct inet_connection_sock_af_ops { - * @icsk_ext_hdr_len: Network protocol overhead (IP/IPv6 options) - * @icsk_ack: Delayed ACK control data - * @icsk_mtup; MTU probing control data -+ * @icsk_probes_tstamp: Probe timestamp (cleared by non-zero window ack) -+ * @icsk_user_timeout: TCP_USER_TIMEOUT value - */ - struct inet_connection_sock { - /* inet_sock has to be the first member! */ -@@ -133,6 +135,7 @@ struct inet_connection_sock { - - u32 probe_timestamp; - } icsk_mtup; -+ u32 icsk_probes_tstamp; - u32 icsk_user_timeout; - - u64 icsk_ca_priv[104 / sizeof(u64)]; -diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h -index eba01ab5a55e0..fe9a9fa2ebc45 100644 ---- a/include/xen/xenbus.h -+++ b/include/xen/xenbus.h -@@ -187,7 +187,7 @@ void xs_suspend_cancel(void); - - struct work_struct; - --void xenbus_probe(struct work_struct *); -+void xenbus_probe(void); - - #define XENBUS_IS_ERR_READ(str) ({ \ - if (!IS_ERR(str) && strlen(str) == 0) { \ -diff --git a/mm/kasan/init.c b/mm/kasan/init.c -index ce45c491ebcdb..ee21e1c1150c6 100644 ---- a/mm/kasan/init.c -+++ b/mm/kasan/init.c -@@ -388,9 +388,10 @@ static void kasan_remove_pmd_table(pmd_t *pmd, unsigned long addr, - - if (kasan_pte_table(*pmd)) { - if (IS_ALIGNED(addr, PMD_SIZE) && -- IS_ALIGNED(next, PMD_SIZE)) -+ IS_ALIGNED(next, PMD_SIZE)) { - pmd_clear(pmd); -- continue; -+ continue; -+ } - } - pte = pte_offset_kernel(pmd, addr); - kasan_remove_pte_table(pte, addr, next); -@@ -413,9 +414,10 @@ static void kasan_remove_pud_table(pud_t *pud, unsigned long addr, - - if (kasan_pmd_table(*pud)) { - if (IS_ALIGNED(addr, PUD_SIZE) && -- IS_ALIGNED(next, PUD_SIZE)) -+ IS_ALIGNED(next, PUD_SIZE)) { - pud_clear(pud); -- continue; -+ continue; -+ } - } - pmd = pmd_offset(pud, addr); - pmd_base = pmd_offset(pud, 0); -@@ -439,9 +441,10 @@ static void kasan_remove_p4d_table(p4d_t *p4d, unsigned long addr, - - if (kasan_pud_table(*p4d)) { - if (IS_ALIGNED(addr, P4D_SIZE) && -- IS_ALIGNED(next, P4D_SIZE)) -+ IS_ALIGNED(next, P4D_SIZE)) { - p4d_clear(p4d); -- continue; -+ continue; -+ } - } - pud = pud_offset(p4d, addr); - kasan_remove_pud_table(pud, addr, next); -@@ -473,9 +476,10 @@ void kasan_remove_zero_shadow(void *start, unsigned long size) - - if (kasan_p4d_table(*pgd)) { - if (IS_ALIGNED(addr, PGDIR_SIZE) && -- IS_ALIGNED(next, PGDIR_SIZE)) -+ IS_ALIGNED(next, PGDIR_SIZE)) { - pgd_clear(pgd); -- continue; -+ continue; -+ } - } - - p4d = p4d_offset(pgd, addr); -@@ -499,7 +503,6 @@ int kasan_add_zero_shadow(void *start, unsigned long size) - - ret = kasan_populate_early_shadow(shadow_start, shadow_end); - if (ret) -- kasan_remove_zero_shadow(shadow_start, -- size >> KASAN_SHADOW_SCALE_SHIFT); -+ kasan_remove_zero_shadow(start, size); - return ret; - } -diff --git a/net/core/dev.c b/net/core/dev.c -index 20c7fd7b8b4bc..ec66d13d2bdad 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -8692,6 +8692,11 @@ static netdev_features_t netdev_fix_features(struct net_device *dev, - } - } - -+ if ((features & NETIF_F_HW_TLS_RX) && !(features & NETIF_F_RXCSUM)) { -+ netdev_dbg(dev, "Dropping TLS RX HW offload feature since no RXCSUM feature.\n"); -+ features &= ~NETIF_F_HW_TLS_RX; -+ } -+ - return features; - } - -diff --git a/net/core/skbuff.c b/net/core/skbuff.c -index 961cb5a88c958..45117fa299837 100644 ---- a/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -431,7 +431,11 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len, - - len += NET_SKB_PAD; - -- if ((len > SKB_WITH_OVERHEAD(PAGE_SIZE)) || -+ /* If requested length is either too small or too big, -+ * we use kmalloc() for skb->head allocation. -+ */ -+ if (len <= SKB_WITH_OVERHEAD(1024) || -+ len > SKB_WITH_OVERHEAD(PAGE_SIZE) || - (gfp_mask & (__GFP_DIRECT_RECLAIM | GFP_DMA))) { - skb = __alloc_skb(len, gfp_mask, SKB_ALLOC_RX, NUMA_NO_NODE); - if (!skb) -diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c -index 9745c52f49ca4..ac5c4f6cdefee 100644 ---- a/net/ipv4/inet_connection_sock.c -+++ b/net/ipv4/inet_connection_sock.c -@@ -840,6 +840,7 @@ struct sock *inet_csk_clone_lock(const struct sock *sk, - newicsk->icsk_retransmits = 0; - newicsk->icsk_backoff = 0; - newicsk->icsk_probes_out = 0; -+ newicsk->icsk_probes_tstamp = 0; - - /* Deinitialize accept_queue to trap illegal accesses. */ - memset(&newicsk->icsk_accept_queue, 0, sizeof(newicsk->icsk_accept_queue)); -diff --git a/net/ipv4/netfilter/ipt_rpfilter.c b/net/ipv4/netfilter/ipt_rpfilter.c -index cc23f1ce239c2..8cd3224d913e0 100644 ---- a/net/ipv4/netfilter/ipt_rpfilter.c -+++ b/net/ipv4/netfilter/ipt_rpfilter.c -@@ -76,7 +76,7 @@ static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par) - flow.daddr = iph->saddr; - flow.saddr = rpfilter_get_saddr(iph->daddr); - flow.flowi4_mark = info->flags & XT_RPFILTER_VALID_MARK ? skb->mark : 0; -- flow.flowi4_tos = RT_TOS(iph->tos); -+ flow.flowi4_tos = iph->tos & IPTOS_RT_MASK; - flow.flowi4_scope = RT_SCOPE_UNIVERSE; - flow.flowi4_oif = l3mdev_master_ifindex_rcu(xt_in(par)); - -diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c -index d3ced6a39bcf1..6ddec8a23942b 100644 ---- a/net/ipv4/tcp.c -+++ b/net/ipv4/tcp.c -@@ -2627,6 +2627,7 @@ int tcp_disconnect(struct sock *sk, int flags) - icsk->icsk_backoff = 0; - tp->snd_cwnd = 2; - icsk->icsk_probes_out = 0; -+ icsk->icsk_probes_tstamp = 0; - icsk->icsk_rto = TCP_TIMEOUT_INIT; - tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; - tp->snd_cwnd = TCP_INIT_CWND; -diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c -index adace90f49fac..7411a43134629 100644 ---- a/net/ipv4/tcp_input.c -+++ b/net/ipv4/tcp_input.c -@@ -3286,6 +3286,7 @@ static void tcp_ack_probe(struct sock *sk) - return; - if (!after(TCP_SKB_CB(head)->end_seq, tcp_wnd_end(tp))) { - icsk->icsk_backoff = 0; -+ icsk->icsk_probes_tstamp = 0; - inet_csk_clear_xmit_timer(sk, ICSK_TIME_PROBE0); - /* Socket must be waked up by subsequent tcp_data_snd_check(). - * This function is not for random using! -diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c -index 87a5037a9cb3e..04acdca4bb0d5 100644 ---- a/net/ipv4/tcp_ipv4.c -+++ b/net/ipv4/tcp_ipv4.c -@@ -1657,6 +1657,7 @@ int tcp_v4_early_demux(struct sk_buff *skb) - bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb) - { - u32 limit = READ_ONCE(sk->sk_rcvbuf) + READ_ONCE(sk->sk_sndbuf); -+ u32 tail_gso_size, tail_gso_segs; - struct skb_shared_info *shinfo; - const struct tcphdr *th; - struct tcphdr *thtail; -@@ -1664,6 +1665,7 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb) - unsigned int hdrlen; - bool fragstolen; - u32 gso_segs; -+ u32 gso_size; - int delta; - - /* In case all data was pulled from skb frags (in __pskb_pull_tail()), -@@ -1689,13 +1691,6 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb) - */ - th = (const struct tcphdr *)skb->data; - hdrlen = th->doff * 4; -- shinfo = skb_shinfo(skb); -- -- if (!shinfo->gso_size) -- shinfo->gso_size = skb->len - hdrlen; -- -- if (!shinfo->gso_segs) -- shinfo->gso_segs = 1; - - tail = sk->sk_backlog.tail; - if (!tail) -@@ -1718,6 +1713,15 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb) - goto no_coalesce; - - __skb_pull(skb, hdrlen); -+ -+ shinfo = skb_shinfo(skb); -+ gso_size = shinfo->gso_size ?: skb->len; -+ gso_segs = shinfo->gso_segs ?: 1; -+ -+ shinfo = skb_shinfo(tail); -+ tail_gso_size = shinfo->gso_size ?: (tail->len - hdrlen); -+ tail_gso_segs = shinfo->gso_segs ?: 1; -+ - if (skb_try_coalesce(tail, skb, &fragstolen, &delta)) { - TCP_SKB_CB(tail)->end_seq = TCP_SKB_CB(skb)->end_seq; - -@@ -1744,11 +1748,8 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb) - } - - /* Not as strict as GRO. We only need to carry mss max value */ -- skb_shinfo(tail)->gso_size = max(shinfo->gso_size, -- skb_shinfo(tail)->gso_size); -- -- gso_segs = skb_shinfo(tail)->gso_segs + shinfo->gso_segs; -- skb_shinfo(tail)->gso_segs = min_t(u32, gso_segs, 0xFFFF); -+ shinfo->gso_size = max(gso_size, tail_gso_size); -+ shinfo->gso_segs = min_t(u32, gso_segs + tail_gso_segs, 0xFFFF); - - sk->sk_backlog.len += delta; - __NET_INC_STATS(sock_net(sk), -diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c -index 5e311e6a31d51..5da6ffce390c2 100644 ---- a/net/ipv4/tcp_output.c -+++ b/net/ipv4/tcp_output.c -@@ -3835,6 +3835,7 @@ void tcp_send_probe0(struct sock *sk) - /* Cancel probe timer, if it is not required. */ - icsk->icsk_probes_out = 0; - icsk->icsk_backoff = 0; -+ icsk->icsk_probes_tstamp = 0; - return; - } - -diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c -index dd5a6317a8018..7fcd116fbd378 100644 ---- a/net/ipv4/tcp_timer.c -+++ b/net/ipv4/tcp_timer.c -@@ -344,6 +344,7 @@ static void tcp_probe_timer(struct sock *sk) - - if (tp->packets_out || !skb) { - icsk->icsk_probes_out = 0; -+ icsk->icsk_probes_tstamp = 0; - return; - } - -@@ -355,13 +356,12 @@ static void tcp_probe_timer(struct sock *sk) - * corresponding system limit. We also implement similar policy when - * we use RTO to probe window in tcp_retransmit_timer(). - */ -- if (icsk->icsk_user_timeout) { -- u32 elapsed = tcp_model_timeout(sk, icsk->icsk_probes_out, -- tcp_probe0_base(sk)); -- -- if (elapsed >= icsk->icsk_user_timeout) -- goto abort; -- } -+ if (!icsk->icsk_probes_tstamp) -+ icsk->icsk_probes_tstamp = tcp_jiffies32; -+ else if (icsk->icsk_user_timeout && -+ (s32)(tcp_jiffies32 - icsk->icsk_probes_tstamp) >= -+ msecs_to_jiffies(icsk->icsk_user_timeout)) -+ goto abort; - - max_probes = sock_net(sk)->ipv4.sysctl_tcp_retries2; - if (sock_flag(sk, SOCK_DEAD)) { -diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c -index c7ff200d0bd41..994a150ae3e90 100644 ---- a/net/ipv4/udp.c -+++ b/net/ipv4/udp.c -@@ -2495,7 +2495,8 @@ int udp_v4_early_demux(struct sk_buff *skb) - */ - if (!inet_sk(sk)->inet_daddr && in_dev) - return ip_mc_validate_source(skb, iph->daddr, -- iph->saddr, iph->tos, -+ iph->saddr, -+ iph->tos & IPTOS_RT_MASK, - skb->dev, in_dev, &itag); - } - return 0; -diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c -index 635b2482fa204..52feab2baeee5 100644 ---- a/net/ipv6/addrconf.c -+++ b/net/ipv6/addrconf.c -@@ -2452,8 +2452,9 @@ static void addrconf_add_mroute(struct net_device *dev) - .fc_ifindex = dev->ifindex, - .fc_dst_len = 8, - .fc_flags = RTF_UP, -- .fc_type = RTN_UNICAST, -+ .fc_type = RTN_MULTICAST, - .fc_nlinfo.nl_net = dev_net(dev), -+ .fc_protocol = RTPROT_KERNEL, - }; - - ipv6_addr_set(&cfg.fc_dst, htonl(0xFF000000), 0, 0, 0); -diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c -index 61e95029c18f5..c9399e81c5059 100644 ---- a/net/sched/cls_tcindex.c -+++ b/net/sched/cls_tcindex.c -@@ -366,9 +366,13 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base, - if (tb[TCA_TCINDEX_MASK]) - cp->mask = nla_get_u16(tb[TCA_TCINDEX_MASK]); - -- if (tb[TCA_TCINDEX_SHIFT]) -+ if (tb[TCA_TCINDEX_SHIFT]) { - cp->shift = nla_get_u32(tb[TCA_TCINDEX_SHIFT]); -- -+ if (cp->shift > 16) { -+ err = -EINVAL; -+ goto errout; -+ } -+ } - if (!cp->hash) { - /* Hash not specified, use perfect hash if the upper limit - * of the hashing index is below the threshold. -diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c -index 50794125bf024..b65a405f607b2 100644 ---- a/net/sched/sch_api.c -+++ b/net/sched/sch_api.c -@@ -409,7 +409,8 @@ struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, - { - struct qdisc_rate_table *rtab; - -- if (tab == NULL || r->rate == 0 || r->cell_log == 0 || -+ if (tab == NULL || r->rate == 0 || -+ r->cell_log == 0 || r->cell_log >= 32 || - nla_len(tab) != TC_RTAB_SIZE) { - NL_SET_ERR_MSG(extack, "Invalid rate table parameters for searching"); - return NULL; -diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c -index 11554d0412f06..1b8409ec2c97f 100644 ---- a/sound/core/seq/oss/seq_oss_synth.c -+++ b/sound/core/seq/oss/seq_oss_synth.c -@@ -611,7 +611,8 @@ snd_seq_oss_synth_make_info(struct seq_oss_devinfo *dp, int dev, struct synth_in - - if (info->is_midi) { - struct midi_info minf; -- snd_seq_oss_midi_make_info(dp, info->midi_mapped, &minf); -+ if (snd_seq_oss_midi_make_info(dp, info->midi_mapped, &minf)) -+ return -ENXIO; - inf->synth_type = SYNTH_TYPE_MIDI; - inf->synth_subtype = 0; - inf->nr_voices = 16; -diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c -index 0ab40a8a68fb5..834367dd54e1b 100644 ---- a/sound/pci/hda/patch_via.c -+++ b/sound/pci/hda/patch_via.c -@@ -113,6 +113,7 @@ static struct via_spec *via_new_spec(struct hda_codec *codec) - spec->codec_type = VT1708S; - spec->gen.indep_hp = 1; - spec->gen.keep_eapd_on = 1; -+ spec->gen.dac_min_mute = 1; - spec->gen.pcm_playback_hook = via_playback_pcm_hook; - spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO; - codec->power_save_node = 1; -diff --git a/sound/soc/intel/boards/haswell.c b/sound/soc/intel/boards/haswell.c -index 3dadf9bff796a..cf47fd9cd506b 100644 ---- a/sound/soc/intel/boards/haswell.c -+++ b/sound/soc/intel/boards/haswell.c -@@ -206,6 +206,7 @@ static struct platform_driver haswell_audio = { - .probe = haswell_audio_probe, - .driver = { - .name = "haswell-audio", -+ .pm = &snd_soc_pm_ops, - }, - }; - -diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh -index 4811067d9b053..4e19a1c00ddd8 100755 ---- a/tools/testing/selftests/net/fib_tests.sh -+++ b/tools/testing/selftests/net/fib_tests.sh -@@ -1055,7 +1055,6 @@ ipv6_addr_metric_test() - - check_route6 "2001:db8:104::1 dev dummy2 proto kernel metric 260" - log_test $? 0 "Set metric with peer route on local side" -- log_test $? 0 "User specified metric on local address" - check_route6 "2001:db8:104::2 dev dummy2 proto kernel metric 260" - log_test $? 0 "Set metric with peer route on peer side" - diff --git a/patch/kernel/odroidxu4-current/patch-5.4.93-94.patch b/patch/kernel/odroidxu4-current/patch-5.4.93-94.patch deleted file mode 100644 index e14ba30e62..0000000000 --- a/patch/kernel/odroidxu4-current/patch-5.4.93-94.patch +++ /dev/null @@ -1,1065 +0,0 @@ -diff --git a/Documentation/admin-guide/device-mapper/dm-integrity.rst b/Documentation/admin-guide/device-mapper/dm-integrity.rst -index a30aa91b5fbe9..3463883844c0b 100644 ---- a/Documentation/admin-guide/device-mapper/dm-integrity.rst -+++ b/Documentation/admin-guide/device-mapper/dm-integrity.rst -@@ -177,6 +177,12 @@ bitmap_flush_interval:number - The bitmap flush interval in milliseconds. The metadata buffers - are synchronized when this interval expires. - -+legacy_recalculate -+ Allow recalculating of volumes with HMAC keys. This is disabled by -+ default for security reasons - an attacker could modify the volume, -+ set recalc_sector to zero, and the kernel would not detect the -+ modification. -+ - - The journal mode (D/J), buffer_sectors, journal_watermark, commit_time can - be changed when reloading the target (load an inactive table and swap the -diff --git a/Makefile b/Makefile -index f8462f8d8a151..ad1b8dc6e462a 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - VERSION = 5 - PATCHLEVEL = 4 --SUBLEVEL = 93 -+SUBLEVEL = 94 - EXTRAVERSION = - NAME = Kleptomaniac Octopus - -diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h -index 08df42e4db96c..51d867cf146c1 100644 ---- a/arch/arm64/include/asm/memory.h -+++ b/arch/arm64/include/asm/memory.h -@@ -178,7 +178,6 @@ extern u64 vabits_actual; - #include - #include - --extern s64 physvirt_offset; - extern s64 memstart_addr; - /* PHYS_OFFSET - the physical address of the start of memory. */ - #define PHYS_OFFSET ({ VM_BUG_ON(memstart_addr & 1); memstart_addr; }) -@@ -254,7 +253,7 @@ static inline const void *__tag_set(const void *addr, u8 tag) - */ - #define __is_lm_address(addr) (!(((u64)addr) & BIT(vabits_actual - 1))) - --#define __lm_to_phys(addr) (((addr) + physvirt_offset)) -+#define __lm_to_phys(addr) (((addr) & ~PAGE_OFFSET) + PHYS_OFFSET) - #define __kimg_to_phys(addr) ((addr) - kimage_voffset) - - #define __virt_to_phys_nodebug(x) ({ \ -@@ -272,7 +271,7 @@ extern phys_addr_t __phys_addr_symbol(unsigned long x); - #define __phys_addr_symbol(x) __pa_symbol_nodebug(x) - #endif /* CONFIG_DEBUG_VIRTUAL */ - --#define __phys_to_virt(x) ((unsigned long)((x) - physvirt_offset)) -+#define __phys_to_virt(x) ((unsigned long)((x) - PHYS_OFFSET) | PAGE_OFFSET) - #define __phys_to_kimg(x) ((unsigned long)((x) + kimage_voffset)) - - /* -diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h -index 69dfc340e71b1..8c420f916fe2e 100644 ---- a/arch/arm64/include/asm/pgtable.h -+++ b/arch/arm64/include/asm/pgtable.h -@@ -23,6 +23,8 @@ - #define VMALLOC_START (MODULES_END) - #define VMALLOC_END (- PUD_SIZE - VMEMMAP_SIZE - SZ_64K) - -+#define vmemmap ((struct page *)VMEMMAP_START - (memstart_addr >> PAGE_SHIFT)) -+ - #define FIRST_USER_ADDRESS 0UL - - #ifndef __ASSEMBLY__ -@@ -33,8 +35,6 @@ - #include - #include - --extern struct page *vmemmap; -- - extern void __pte_error(const char *file, int line, unsigned long val); - extern void __pmd_error(const char *file, int line, unsigned long val); - extern void __pud_error(const char *file, int line, unsigned long val); -diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c -index 45c00a54909c9..602bd19630ff8 100644 ---- a/arch/arm64/mm/init.c -+++ b/arch/arm64/mm/init.c -@@ -50,12 +50,6 @@ - s64 memstart_addr __ro_after_init = -1; - EXPORT_SYMBOL(memstart_addr); - --s64 physvirt_offset __ro_after_init; --EXPORT_SYMBOL(physvirt_offset); -- --struct page *vmemmap __ro_after_init; --EXPORT_SYMBOL(vmemmap); -- - phys_addr_t arm64_dma_phys_limit __ro_after_init; - - #ifdef CONFIG_KEXEC_CORE -@@ -321,20 +315,6 @@ void __init arm64_memblock_init(void) - memstart_addr = round_down(memblock_start_of_DRAM(), - ARM64_MEMSTART_ALIGN); - -- physvirt_offset = PHYS_OFFSET - PAGE_OFFSET; -- -- vmemmap = ((struct page *)VMEMMAP_START - (memstart_addr >> PAGE_SHIFT)); -- -- /* -- * If we are running with a 52-bit kernel VA config on a system that -- * does not support it, we have to offset our vmemmap and physvirt_offset -- * s.t. we avoid the 52-bit portion of the direct linear map -- */ -- if (IS_ENABLED(CONFIG_ARM64_VA_BITS_52) && (vabits_actual != 52)) { -- vmemmap += (_PAGE_OFFSET(48) - _PAGE_OFFSET(52)) >> PAGE_SHIFT; -- physvirt_offset = PHYS_OFFSET - _PAGE_OFFSET(48); -- } -- - /* - * Remove the memory that we will not be able to cover with the - * linear mapping. Take care not to clip the kernel which may be -@@ -349,6 +329,16 @@ void __init arm64_memblock_init(void) - memblock_remove(0, memstart_addr); - } - -+ /* -+ * If we are running with a 52-bit kernel VA config on a system that -+ * does not support it, we have to place the available physical -+ * memory in the 48-bit addressable part of the linear region, i.e., -+ * we have to move it upward. Since memstart_addr represents the -+ * physical address of PAGE_OFFSET, we have to *subtract* from it. -+ */ -+ if (IS_ENABLED(CONFIG_ARM64_VA_BITS_52) && (vabits_actual != 52)) -+ memstart_addr -= _PAGE_OFFSET(48) - _PAGE_OFFSET(52); -+ - /* - * Apply the memory limit if it was set. Since the kernel may be loaded - * high up in memory, add back the kernel region that must be accessible -diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c -index 3985d6e1c17dc..89a053b1d2799 100644 ---- a/drivers/gpio/gpio-mvebu.c -+++ b/drivers/gpio/gpio-mvebu.c -@@ -657,9 +657,8 @@ static void mvebu_pwm_get_state(struct pwm_chip *chip, - - spin_lock_irqsave(&mvpwm->lock, flags); - -- val = (unsigned long long) -- readl_relaxed(mvebu_pwmreg_blink_on_duration(mvpwm)); -- val *= NSEC_PER_SEC; -+ u = readl_relaxed(mvebu_pwmreg_blink_on_duration(mvpwm)); -+ val = (unsigned long long) u * NSEC_PER_SEC; - do_div(val, mvpwm->clk_rate); - if (val > UINT_MAX) - state->duty_cycle = UINT_MAX; -@@ -668,21 +667,17 @@ static void mvebu_pwm_get_state(struct pwm_chip *chip, - else - state->duty_cycle = 1; - -- val = (unsigned long long) -- readl_relaxed(mvebu_pwmreg_blink_off_duration(mvpwm)); -+ val = (unsigned long long) u; /* on duration */ -+ /* period = on + off duration */ -+ val += readl_relaxed(mvebu_pwmreg_blink_off_duration(mvpwm)); - val *= NSEC_PER_SEC; - do_div(val, mvpwm->clk_rate); -- if (val < state->duty_cycle) { -+ if (val > UINT_MAX) -+ state->period = UINT_MAX; -+ else if (val) -+ state->period = val; -+ else - state->period = 1; -- } else { -- val -= state->duty_cycle; -- if (val > UINT_MAX) -- state->period = UINT_MAX; -- else if (val) -- state->period = val; -- else -- state->period = 1; -- } - - regmap_read(mvchip->regs, GPIO_BLINK_EN_OFF + mvchip->offset, &u); - if (u) -diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c -index 9e852b4bbf92b..73dafa60080f1 100644 ---- a/drivers/hid/wacom_sys.c -+++ b/drivers/hid/wacom_sys.c -@@ -147,9 +147,9 @@ static int wacom_wac_pen_serial_enforce(struct hid_device *hdev, - } - - if (flush) -- wacom_wac_queue_flush(hdev, &wacom_wac->pen_fifo); -+ wacom_wac_queue_flush(hdev, wacom_wac->pen_fifo); - else if (insert) -- wacom_wac_queue_insert(hdev, &wacom_wac->pen_fifo, -+ wacom_wac_queue_insert(hdev, wacom_wac->pen_fifo, - raw_data, report_size); - - return insert && !flush; -@@ -1280,7 +1280,7 @@ static void wacom_devm_kfifo_release(struct device *dev, void *res) - static int wacom_devm_kfifo_alloc(struct wacom *wacom) - { - struct wacom_wac *wacom_wac = &wacom->wacom_wac; -- struct kfifo_rec_ptr_2 *pen_fifo = &wacom_wac->pen_fifo; -+ struct kfifo_rec_ptr_2 *pen_fifo; - int error; - - pen_fifo = devres_alloc(wacom_devm_kfifo_release, -@@ -1297,6 +1297,7 @@ static int wacom_devm_kfifo_alloc(struct wacom *wacom) - } - - devres_add(&wacom->hdev->dev, pen_fifo); -+ wacom_wac->pen_fifo = pen_fifo; - - return 0; - } -diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h -index da612b6e9c779..195910dd2154e 100644 ---- a/drivers/hid/wacom_wac.h -+++ b/drivers/hid/wacom_wac.h -@@ -342,7 +342,7 @@ struct wacom_wac { - struct input_dev *pen_input; - struct input_dev *touch_input; - struct input_dev *pad_input; -- struct kfifo_rec_ptr_2 pen_fifo; -+ struct kfifo_rec_ptr_2 *pen_fifo; - int pid; - int num_contacts_left; - u8 bt_features; -diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c -index 57f66f2ad98dc..c967c2cdba870 100644 ---- a/drivers/md/dm-integrity.c -+++ b/drivers/md/dm-integrity.c -@@ -254,6 +254,7 @@ struct dm_integrity_c { - bool journal_uptodate; - bool just_formatted; - bool recalculate_flag; -+ bool legacy_recalculate; - - struct alg_spec internal_hash_alg; - struct alg_spec journal_crypt_alg; -@@ -381,6 +382,14 @@ static int dm_integrity_failed(struct dm_integrity_c *ic) - return READ_ONCE(ic->failed); - } - -+static bool dm_integrity_disable_recalculate(struct dm_integrity_c *ic) -+{ -+ if ((ic->internal_hash_alg.key || ic->journal_mac_alg.key) && -+ !ic->legacy_recalculate) -+ return true; -+ return false; -+} -+ - static commit_id_t dm_integrity_commit_id(struct dm_integrity_c *ic, unsigned i, - unsigned j, unsigned char seq) - { -@@ -2998,6 +3007,7 @@ static void dm_integrity_status(struct dm_target *ti, status_type_t type, - arg_count += !!ic->internal_hash_alg.alg_string; - arg_count += !!ic->journal_crypt_alg.alg_string; - arg_count += !!ic->journal_mac_alg.alg_string; -+ arg_count += ic->legacy_recalculate; - DMEMIT("%s %llu %u %c %u", ic->dev->name, (unsigned long long)ic->start, - ic->tag_size, ic->mode, arg_count); - if (ic->meta_dev) -@@ -3017,6 +3027,8 @@ static void dm_integrity_status(struct dm_target *ti, status_type_t type, - DMEMIT(" sectors_per_bit:%llu", (unsigned long long)ic->sectors_per_block << ic->log2_blocks_per_bitmap_bit); - DMEMIT(" bitmap_flush_interval:%u", jiffies_to_msecs(ic->bitmap_flush_interval)); - } -+ if (ic->legacy_recalculate) -+ DMEMIT(" legacy_recalculate"); - - #define EMIT_ALG(a, n) \ - do { \ -@@ -3625,7 +3637,7 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv) - unsigned extra_args; - struct dm_arg_set as; - static const struct dm_arg _args[] = { -- {0, 15, "Invalid number of feature args"}, -+ {0, 14, "Invalid number of feature args"}, - }; - unsigned journal_sectors, interleave_sectors, buffer_sectors, journal_watermark, sync_msec; - bool should_write_sb; -@@ -3769,6 +3781,8 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv) - goto bad; - } else if (!strcmp(opt_string, "recalculate")) { - ic->recalculate_flag = true; -+ } else if (!strcmp(opt_string, "legacy_recalculate")) { -+ ic->legacy_recalculate = true; - } else { - r = -EINVAL; - ti->error = "Invalid argument"; -@@ -4067,6 +4081,14 @@ try_smaller_buffer: - } - } - -+ if (ic->sb->flags & cpu_to_le32(SB_FLAG_RECALCULATING) && -+ le64_to_cpu(ic->sb->recalc_sector) < ic->provided_data_sectors && -+ dm_integrity_disable_recalculate(ic)) { -+ ti->error = "Recalculating with HMAC is disabled for security reasons - if you really need it, use the argument \"legacy_recalculate\""; -+ r = -EOPNOTSUPP; -+ goto bad; -+ } -+ - ic->bufio = dm_bufio_client_create(ic->meta_dev ? ic->meta_dev->bdev : ic->dev->bdev, - 1U << (SECTOR_SHIFT + ic->log2_buffer_sectors), 1, 0, NULL, NULL); - if (IS_ERR(ic->bufio)) { -diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c -index be06b26d6ca03..7adecfd0c1e99 100644 ---- a/fs/cifs/smb2pdu.c -+++ b/fs/cifs/smb2pdu.c -@@ -490,8 +490,8 @@ build_preauth_ctxt(struct smb2_preauth_neg_context *pneg_ctxt) - pneg_ctxt->ContextType = SMB2_PREAUTH_INTEGRITY_CAPABILITIES; - pneg_ctxt->DataLength = cpu_to_le16(38); - pneg_ctxt->HashAlgorithmCount = cpu_to_le16(1); -- pneg_ctxt->SaltLength = cpu_to_le16(SMB311_SALT_SIZE); -- get_random_bytes(pneg_ctxt->Salt, SMB311_SALT_SIZE); -+ pneg_ctxt->SaltLength = cpu_to_le16(SMB311_LINUX_CLIENT_SALT_SIZE); -+ get_random_bytes(pneg_ctxt->Salt, SMB311_LINUX_CLIENT_SALT_SIZE); - pneg_ctxt->HashAlgorithms = SMB2_PREAUTH_INTEGRITY_SHA512; - } - -@@ -617,6 +617,9 @@ static void decode_preauth_context(struct smb2_preauth_neg_context *ctxt) - if (len < MIN_PREAUTH_CTXT_DATA_LEN) { - printk_once(KERN_WARNING "server sent bad preauth context\n"); - return; -+ } else if (len < MIN_PREAUTH_CTXT_DATA_LEN + le16_to_cpu(ctxt->SaltLength)) { -+ pr_warn_once("server sent invalid SaltLength\n"); -+ return; - } - if (le16_to_cpu(ctxt->HashAlgorithmCount) != 1) - printk_once(KERN_WARNING "illegal SMB3 hash algorithm count\n"); -diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h -index f264e1d36fe16..2482978f09486 100644 ---- a/fs/cifs/smb2pdu.h -+++ b/fs/cifs/smb2pdu.h -@@ -271,12 +271,20 @@ struct smb2_neg_context { - /* Followed by array of data */ - } __packed; - --#define SMB311_SALT_SIZE 32 -+#define SMB311_LINUX_CLIENT_SALT_SIZE 32 - /* Hash Algorithm Types */ - #define SMB2_PREAUTH_INTEGRITY_SHA512 cpu_to_le16(0x0001) - #define SMB2_PREAUTH_HASH_SIZE 64 - --#define MIN_PREAUTH_CTXT_DATA_LEN (SMB311_SALT_SIZE + 6) -+/* -+ * SaltLength that the server send can be zero, so the only three required -+ * fields (all __le16) end up six bytes total, so the minimum context data len -+ * in the response is six bytes which accounts for -+ * -+ * HashAlgorithmCount, SaltLength, and 1 HashAlgorithm. -+ */ -+#define MIN_PREAUTH_CTXT_DATA_LEN 6 -+ - struct smb2_preauth_neg_context { - __le16 ContextType; /* 1 */ - __le16 DataLength; -@@ -284,7 +292,7 @@ struct smb2_preauth_neg_context { - __le16 HashAlgorithmCount; /* 1 */ - __le16 SaltLength; - __le16 HashAlgorithms; /* HashAlgorithms[0] since only one defined */ -- __u8 Salt[SMB311_SALT_SIZE]; -+ __u8 Salt[SMB311_LINUX_CLIENT_SALT_SIZE]; - } __packed; - - /* Encryption Algorithms Ciphers */ -diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c -index 3bac525f0439d..539d95bd364d4 100644 ---- a/fs/ext4/inode.c -+++ b/fs/ext4/inode.c -@@ -5209,7 +5209,7 @@ static int other_inode_match(struct inode * inode, unsigned long ino, - (inode->i_state & I_DIRTY_TIME)) { - struct ext4_inode_info *ei = EXT4_I(inode); - -- inode->i_state &= ~(I_DIRTY_TIME | I_DIRTY_TIME_EXPIRED); -+ inode->i_state &= ~I_DIRTY_TIME; - spin_unlock(&inode->i_lock); - - spin_lock(&ei->i_raw_lock); -diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c -index 5f6400ba82c00..a2cf2db0d3def 100644 ---- a/fs/fs-writeback.c -+++ b/fs/fs-writeback.c -@@ -1238,7 +1238,7 @@ static bool inode_dirtied_after(struct inode *inode, unsigned long t) - */ - static int move_expired_inodes(struct list_head *delaying_queue, - struct list_head *dispatch_queue, -- int flags, unsigned long dirtied_before) -+ unsigned long dirtied_before) - { - LIST_HEAD(tmp); - struct list_head *pos, *node; -@@ -1254,8 +1254,6 @@ static int move_expired_inodes(struct list_head *delaying_queue, - list_move(&inode->i_io_list, &tmp); - moved++; - spin_lock(&inode->i_lock); -- if (flags & EXPIRE_DIRTY_ATIME) -- inode->i_state |= I_DIRTY_TIME_EXPIRED; - inode->i_state |= I_SYNC_QUEUED; - spin_unlock(&inode->i_lock); - if (sb_is_blkdev_sb(inode->i_sb)) -@@ -1303,11 +1301,11 @@ static void queue_io(struct bdi_writeback *wb, struct wb_writeback_work *work, - - assert_spin_locked(&wb->list_lock); - list_splice_init(&wb->b_more_io, &wb->b_io); -- moved = move_expired_inodes(&wb->b_dirty, &wb->b_io, 0, dirtied_before); -+ moved = move_expired_inodes(&wb->b_dirty, &wb->b_io, dirtied_before); - if (!work->for_sync) - time_expire_jif = jiffies - dirtytime_expire_interval * HZ; - moved += move_expired_inodes(&wb->b_dirty_time, &wb->b_io, -- EXPIRE_DIRTY_ATIME, time_expire_jif); -+ time_expire_jif); - if (moved) - wb_io_lists_populated(wb); - trace_writeback_queue_io(wb, work, dirtied_before, moved); -@@ -1475,26 +1473,26 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) - ret = err; - } - -+ /* -+ * If the inode has dirty timestamps and we need to write them, call -+ * mark_inode_dirty_sync() to notify the filesystem about it and to -+ * change I_DIRTY_TIME into I_DIRTY_SYNC. -+ */ -+ if ((inode->i_state & I_DIRTY_TIME) && -+ (wbc->sync_mode == WB_SYNC_ALL || wbc->for_sync || -+ time_after(jiffies, inode->dirtied_time_when + -+ dirtytime_expire_interval * HZ))) { -+ trace_writeback_lazytime(inode); -+ mark_inode_dirty_sync(inode); -+ } -+ - /* - * Some filesystems may redirty the inode during the writeback - * due to delalloc, clear dirty metadata flags right before - * write_inode() - */ - spin_lock(&inode->i_lock); -- - dirty = inode->i_state & I_DIRTY; -- if (inode->i_state & I_DIRTY_TIME) { -- if ((dirty & I_DIRTY_INODE) || -- wbc->sync_mode == WB_SYNC_ALL || -- unlikely(inode->i_state & I_DIRTY_TIME_EXPIRED) || -- unlikely(time_after(jiffies, -- (inode->dirtied_time_when + -- dirtytime_expire_interval * HZ)))) { -- dirty |= I_DIRTY_TIME | I_DIRTY_TIME_EXPIRED; -- trace_writeback_lazytime(inode); -- } -- } else -- inode->i_state &= ~I_DIRTY_TIME_EXPIRED; - inode->i_state &= ~dirty; - - /* -@@ -1515,8 +1513,6 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) - - spin_unlock(&inode->i_lock); - -- if (dirty & I_DIRTY_TIME) -- mark_inode_dirty_sync(inode); - /* Don't write the inode if only I_DIRTY_PAGES was set */ - if (dirty & ~I_DIRTY_PAGES) { - int err = write_inode(inode, wbc); -diff --git a/fs/io_uring.c b/fs/io_uring.c -index 4127ea027a14d..478df7e10767a 100644 ---- a/fs/io_uring.c -+++ b/fs/io_uring.c -@@ -2226,7 +2226,8 @@ restart: - /* Ensure we clear previously set non-block flag */ - req->rw.ki_flags &= ~IOCB_NOWAIT; - -- if (req->fs != current->fs && current->fs != old_fs_struct) { -+ if ((req->fs && req->fs != current->fs) || -+ (!req->fs && current->fs != old_fs_struct)) { - task_lock(current); - if (req->fs) - current->fs = req->fs; -@@ -2351,7 +2352,7 @@ out: - mmput(cur_mm); - } - revert_creds(old_cred); -- if (old_fs_struct) { -+ if (old_fs_struct != current->fs) { - task_lock(current); - current->fs = old_fs_struct; - task_unlock(current); -diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c -index 6c7354abd0aea..0ba7368b9a5f0 100644 ---- a/fs/xfs/libxfs/xfs_trans_inode.c -+++ b/fs/xfs/libxfs/xfs_trans_inode.c -@@ -100,9 +100,9 @@ xfs_trans_log_inode( - * to log the timestamps, or will clear already cleared fields in the - * worst case. - */ -- if (inode->i_state & (I_DIRTY_TIME | I_DIRTY_TIME_EXPIRED)) { -+ if (inode->i_state & I_DIRTY_TIME) { - spin_lock(&inode->i_lock); -- inode->i_state &= ~(I_DIRTY_TIME | I_DIRTY_TIME_EXPIRED); -+ inode->i_state &= ~I_DIRTY_TIME; - spin_unlock(&inode->i_lock); - } - -diff --git a/include/linux/fs.h b/include/linux/fs.h -index 4c82683e034a7..ef118b8ba6993 100644 ---- a/include/linux/fs.h -+++ b/include/linux/fs.h -@@ -2161,7 +2161,6 @@ static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) - #define I_DIO_WAKEUP (1 << __I_DIO_WAKEUP) - #define I_LINKABLE (1 << 10) - #define I_DIRTY_TIME (1 << 11) --#define I_DIRTY_TIME_EXPIRED (1 << 12) - #define I_WB_SWITCH (1 << 13) - #define I_OVL_INUSE (1 << 14) - #define I_CREATING (1 << 15) -diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h -index a8af22e469ce5..011e8faa608b9 100644 ---- a/include/trace/events/writeback.h -+++ b/include/trace/events/writeback.h -@@ -20,7 +20,6 @@ - {I_CLEAR, "I_CLEAR"}, \ - {I_SYNC, "I_SYNC"}, \ - {I_DIRTY_TIME, "I_DIRTY_TIME"}, \ -- {I_DIRTY_TIME_EXPIRED, "I_DIRTY_TIME_EXPIRED"}, \ - {I_REFERENCED, "I_REFERENCED"} \ - ) - -diff --git a/kernel/futex.c b/kernel/futex.c -index b6dec5f79370c..042c2707e9131 100644 ---- a/kernel/futex.c -+++ b/kernel/futex.c -@@ -857,6 +857,29 @@ static struct futex_pi_state *alloc_pi_state(void) - return pi_state; - } - -+static void pi_state_update_owner(struct futex_pi_state *pi_state, -+ struct task_struct *new_owner) -+{ -+ struct task_struct *old_owner = pi_state->owner; -+ -+ lockdep_assert_held(&pi_state->pi_mutex.wait_lock); -+ -+ if (old_owner) { -+ raw_spin_lock(&old_owner->pi_lock); -+ WARN_ON(list_empty(&pi_state->list)); -+ list_del_init(&pi_state->list); -+ raw_spin_unlock(&old_owner->pi_lock); -+ } -+ -+ if (new_owner) { -+ raw_spin_lock(&new_owner->pi_lock); -+ WARN_ON(!list_empty(&pi_state->list)); -+ list_add(&pi_state->list, &new_owner->pi_state_list); -+ pi_state->owner = new_owner; -+ raw_spin_unlock(&new_owner->pi_lock); -+ } -+} -+ - static void get_pi_state(struct futex_pi_state *pi_state) - { - WARN_ON_ONCE(!refcount_inc_not_zero(&pi_state->refcount)); -@@ -879,17 +902,11 @@ static void put_pi_state(struct futex_pi_state *pi_state) - * and has cleaned up the pi_state already - */ - if (pi_state->owner) { -- struct task_struct *owner; - unsigned long flags; - - raw_spin_lock_irqsave(&pi_state->pi_mutex.wait_lock, flags); -- owner = pi_state->owner; -- if (owner) { -- raw_spin_lock(&owner->pi_lock); -- list_del_init(&pi_state->list); -- raw_spin_unlock(&owner->pi_lock); -- } -- rt_mutex_proxy_unlock(&pi_state->pi_mutex, owner); -+ pi_state_update_owner(pi_state, NULL); -+ rt_mutex_proxy_unlock(&pi_state->pi_mutex); - raw_spin_unlock_irqrestore(&pi_state->pi_mutex.wait_lock, flags); - } - -@@ -1035,7 +1052,8 @@ static inline void exit_pi_state_list(struct task_struct *curr) { } - * FUTEX_OWNER_DIED bit. See [4] - * - * [10] There is no transient state which leaves owner and user space -- * TID out of sync. -+ * TID out of sync. Except one error case where the kernel is denied -+ * write access to the user address, see fixup_pi_state_owner(). - * - * - * Serialization and lifetime rules: -@@ -1614,26 +1632,15 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_pi_state *pi_ - ret = -EINVAL; - } - -- if (ret) -- goto out_unlock; -- -- /* -- * This is a point of no return; once we modify the uval there is no -- * going back and subsequent operations must not fail. -- */ -- -- raw_spin_lock(&pi_state->owner->pi_lock); -- WARN_ON(list_empty(&pi_state->list)); -- list_del_init(&pi_state->list); -- raw_spin_unlock(&pi_state->owner->pi_lock); -- -- raw_spin_lock(&new_owner->pi_lock); -- WARN_ON(!list_empty(&pi_state->list)); -- list_add(&pi_state->list, &new_owner->pi_state_list); -- pi_state->owner = new_owner; -- raw_spin_unlock(&new_owner->pi_lock); -- -- postunlock = __rt_mutex_futex_unlock(&pi_state->pi_mutex, &wake_q); -+ if (!ret) { -+ /* -+ * This is a point of no return; once we modified the uval -+ * there is no going back and subsequent operations must -+ * not fail. -+ */ -+ pi_state_update_owner(pi_state, new_owner); -+ postunlock = __rt_mutex_futex_unlock(&pi_state->pi_mutex, &wake_q); -+ } - - out_unlock: - raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); -@@ -2456,18 +2463,13 @@ static void unqueue_me_pi(struct futex_q *q) - spin_unlock(q->lock_ptr); - } - --static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, -- struct task_struct *argowner) -+static int __fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, -+ struct task_struct *argowner) - { -+ u32 uval, uninitialized_var(curval), newval, newtid; - struct futex_pi_state *pi_state = q->pi_state; -- u32 uval, uninitialized_var(curval), newval; - struct task_struct *oldowner, *newowner; -- u32 newtid; -- int ret, err = 0; -- -- lockdep_assert_held(q->lock_ptr); -- -- raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); -+ int err = 0; - - oldowner = pi_state->owner; - -@@ -2501,14 +2503,12 @@ retry: - * We raced against a concurrent self; things are - * already fixed up. Nothing to do. - */ -- ret = 0; -- goto out_unlock; -+ return 0; - } - - if (__rt_mutex_futex_trylock(&pi_state->pi_mutex)) { -- /* We got the lock after all, nothing to fix. */ -- ret = 0; -- goto out_unlock; -+ /* We got the lock. pi_state is correct. Tell caller. */ -+ return 1; - } - - /* -@@ -2535,8 +2535,7 @@ retry: - * We raced against a concurrent self; things are - * already fixed up. Nothing to do. - */ -- ret = 0; -- goto out_unlock; -+ return 1; - } - newowner = argowner; - } -@@ -2566,22 +2565,9 @@ retry: - * We fixed up user space. Now we need to fix the pi_state - * itself. - */ -- if (pi_state->owner != NULL) { -- raw_spin_lock(&pi_state->owner->pi_lock); -- WARN_ON(list_empty(&pi_state->list)); -- list_del_init(&pi_state->list); -- raw_spin_unlock(&pi_state->owner->pi_lock); -- } -+ pi_state_update_owner(pi_state, newowner); - -- pi_state->owner = newowner; -- -- raw_spin_lock(&newowner->pi_lock); -- WARN_ON(!list_empty(&pi_state->list)); -- list_add(&pi_state->list, &newowner->pi_state_list); -- raw_spin_unlock(&newowner->pi_lock); -- raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); -- -- return 0; -+ return argowner == current; - - /* - * In order to reschedule or handle a page fault, we need to drop the -@@ -2602,17 +2588,16 @@ handle_err: - - switch (err) { - case -EFAULT: -- ret = fault_in_user_writeable(uaddr); -+ err = fault_in_user_writeable(uaddr); - break; - - case -EAGAIN: - cond_resched(); -- ret = 0; -+ err = 0; - break; - - default: - WARN_ON_ONCE(1); -- ret = err; - break; - } - -@@ -2622,17 +2607,44 @@ handle_err: - /* - * Check if someone else fixed it for us: - */ -- if (pi_state->owner != oldowner) { -- ret = 0; -- goto out_unlock; -- } -+ if (pi_state->owner != oldowner) -+ return argowner == current; - -- if (ret) -- goto out_unlock; -+ /* Retry if err was -EAGAIN or the fault in succeeded */ -+ if (!err) -+ goto retry; - -- goto retry; -+ /* -+ * fault_in_user_writeable() failed so user state is immutable. At -+ * best we can make the kernel state consistent but user state will -+ * be most likely hosed and any subsequent unlock operation will be -+ * rejected due to PI futex rule [10]. -+ * -+ * Ensure that the rtmutex owner is also the pi_state owner despite -+ * the user space value claiming something different. There is no -+ * point in unlocking the rtmutex if current is the owner as it -+ * would need to wait until the next waiter has taken the rtmutex -+ * to guarantee consistent state. Keep it simple. Userspace asked -+ * for this wreckaged state. -+ * -+ * The rtmutex has an owner - either current or some other -+ * task. See the EAGAIN loop above. -+ */ -+ pi_state_update_owner(pi_state, rt_mutex_owner(&pi_state->pi_mutex)); - --out_unlock: -+ return err; -+} -+ -+static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, -+ struct task_struct *argowner) -+{ -+ struct futex_pi_state *pi_state = q->pi_state; -+ int ret; -+ -+ lockdep_assert_held(q->lock_ptr); -+ -+ raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); -+ ret = __fixup_pi_state_owner(uaddr, q, argowner); - raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); - return ret; - } -@@ -2656,8 +2668,6 @@ static long futex_wait_restart(struct restart_block *restart); - */ - static int fixup_owner(u32 __user *uaddr, struct futex_q *q, int locked) - { -- int ret = 0; -- - if (locked) { - /* - * Got the lock. We might not be the anticipated owner if we -@@ -2668,8 +2678,8 @@ static int fixup_owner(u32 __user *uaddr, struct futex_q *q, int locked) - * stable state, anything else needs more attention. - */ - if (q->pi_state->owner != current) -- ret = fixup_pi_state_owner(uaddr, q, current); -- goto out; -+ return fixup_pi_state_owner(uaddr, q, current); -+ return 1; - } - - /* -@@ -2680,24 +2690,17 @@ static int fixup_owner(u32 __user *uaddr, struct futex_q *q, int locked) - * Another speculative read; pi_state->owner == current is unstable - * but needs our attention. - */ -- if (q->pi_state->owner == current) { -- ret = fixup_pi_state_owner(uaddr, q, NULL); -- goto out; -- } -+ if (q->pi_state->owner == current) -+ return fixup_pi_state_owner(uaddr, q, NULL); - - /* - * Paranoia check. If we did not take the lock, then we should not be -- * the owner of the rt_mutex. -+ * the owner of the rt_mutex. Warn and establish consistent state. - */ -- if (rt_mutex_owner(&q->pi_state->pi_mutex) == current) { -- printk(KERN_ERR "fixup_owner: ret = %d pi-mutex: %p " -- "pi-state %p\n", ret, -- q->pi_state->pi_mutex.owner, -- q->pi_state->owner); -- } -+ if (WARN_ON_ONCE(rt_mutex_owner(&q->pi_state->pi_mutex) == current)) -+ return fixup_pi_state_owner(uaddr, q, current); - --out: -- return ret ? ret : locked; -+ return 0; - } - - /** -@@ -2909,7 +2912,6 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, - ktime_t *time, int trylock) - { - struct hrtimer_sleeper timeout, *to; -- struct futex_pi_state *pi_state = NULL; - struct task_struct *exiting = NULL; - struct rt_mutex_waiter rt_waiter; - struct futex_hash_bucket *hb; -@@ -3046,23 +3048,9 @@ no_block: - if (res) - ret = (res < 0) ? res : 0; - -- /* -- * If fixup_owner() faulted and was unable to handle the fault, unlock -- * it and return the fault to userspace. -- */ -- if (ret && (rt_mutex_owner(&q.pi_state->pi_mutex) == current)) { -- pi_state = q.pi_state; -- get_pi_state(pi_state); -- } -- - /* Unqueue and drop the lock */ - unqueue_me_pi(&q); - -- if (pi_state) { -- rt_mutex_futex_unlock(&pi_state->pi_mutex); -- put_pi_state(pi_state); -- } -- - goto out_put_key; - - out_unlock_put_key: -@@ -3328,7 +3316,6 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, - u32 __user *uaddr2) - { - struct hrtimer_sleeper timeout, *to; -- struct futex_pi_state *pi_state = NULL; - struct rt_mutex_waiter rt_waiter; - struct futex_hash_bucket *hb; - union futex_key key2 = FUTEX_KEY_INIT; -@@ -3406,16 +3393,17 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, - if (q.pi_state && (q.pi_state->owner != current)) { - spin_lock(q.lock_ptr); - ret = fixup_pi_state_owner(uaddr2, &q, current); -- if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current) { -- pi_state = q.pi_state; -- get_pi_state(pi_state); -- } - /* - * Drop the reference to the pi state which - * the requeue_pi() code acquired for us. - */ - put_pi_state(q.pi_state); - spin_unlock(q.lock_ptr); -+ /* -+ * Adjust the return value. It's either -EFAULT or -+ * success (1) but the caller expects 0 for success. -+ */ -+ ret = ret < 0 ? ret : 0; - } - } else { - struct rt_mutex *pi_mutex; -@@ -3446,25 +3434,10 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, - if (res) - ret = (res < 0) ? res : 0; - -- /* -- * If fixup_pi_state_owner() faulted and was unable to handle -- * the fault, unlock the rt_mutex and return the fault to -- * userspace. -- */ -- if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current) { -- pi_state = q.pi_state; -- get_pi_state(pi_state); -- } -- - /* Unqueue and drop the lock. */ - unqueue_me_pi(&q); - } - -- if (pi_state) { -- rt_mutex_futex_unlock(&pi_state->pi_mutex); -- put_pi_state(pi_state); -- } -- - if (ret == -EINTR) { - /* - * We've already been requeued, but cannot restart by calling -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index 2874bf5561620..734698aec5f9e 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -1718,8 +1718,7 @@ void rt_mutex_init_proxy_locked(struct rt_mutex *lock, - * possible because it belongs to the pi_state which is about to be freed - * and it is not longer visible to other tasks. - */ --void rt_mutex_proxy_unlock(struct rt_mutex *lock, -- struct task_struct *proxy_owner) -+void rt_mutex_proxy_unlock(struct rt_mutex *lock) - { - debug_rt_mutex_proxy_unlock(lock); - rt_mutex_set_owner(lock, NULL); -diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h -index d1d62f942be22..ca6fb489007b6 100644 ---- a/kernel/locking/rtmutex_common.h -+++ b/kernel/locking/rtmutex_common.h -@@ -133,8 +133,7 @@ enum rtmutex_chainwalk { - extern struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock); - extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, - struct task_struct *proxy_owner); --extern void rt_mutex_proxy_unlock(struct rt_mutex *lock, -- struct task_struct *proxy_owner); -+extern void rt_mutex_proxy_unlock(struct rt_mutex *lock); - extern void rt_mutex_init_waiter(struct rt_mutex_waiter *waiter); - extern int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, - struct rt_mutex_waiter *waiter, -diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c -index 077877ed54f73..7283741666538 100644 ---- a/kernel/trace/ring_buffer.c -+++ b/kernel/trace/ring_buffer.c -@@ -4448,6 +4448,8 @@ void ring_buffer_reset_cpu(struct ring_buffer *buffer, int cpu) - - if (!cpumask_test_cpu(cpu, buffer->cpumask)) - return; -+ /* prevent another thread from changing buffer sizes */ -+ mutex_lock(&buffer->mutex); - - atomic_inc(&buffer->resize_disabled); - atomic_inc(&cpu_buffer->record_disabled); -@@ -4471,6 +4473,8 @@ void ring_buffer_reset_cpu(struct ring_buffer *buffer, int cpu) - - atomic_dec(&cpu_buffer->record_disabled); - atomic_dec(&buffer->resize_disabled); -+ -+ mutex_unlock(&buffer->mutex); - } - EXPORT_SYMBOL_GPL(ring_buffer_reset_cpu); - -diff --git a/mm/slub.c b/mm/slub.c -index 8b3ef45a0f103..e622e8f4c2ac4 100644 ---- a/mm/slub.c -+++ b/mm/slub.c -@@ -5819,10 +5819,8 @@ static int sysfs_slab_add(struct kmem_cache *s) - - s->kobj.kset = kset; - err = kobject_init_and_add(&s->kobj, &slab_ktype, NULL, "%s", name); -- if (err) { -- kobject_put(&s->kobj); -+ if (err) - goto out; -- } - - err = sysfs_create_group(&s->kobj, &slab_attr_group); - if (err) -diff --git a/tools/build/Makefile b/tools/build/Makefile -index 727050c40f096..8a55378e8b7ce 100644 ---- a/tools/build/Makefile -+++ b/tools/build/Makefile -@@ -15,10 +15,6 @@ endef - $(call allow-override,CC,$(CROSS_COMPILE)gcc) - $(call allow-override,LD,$(CROSS_COMPILE)ld) - --HOSTCC ?= gcc --HOSTLD ?= ld --HOSTAR ?= ar -- - export HOSTCC HOSTLD HOSTAR - - ifeq ($(V),1) -diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile -index f591c4d1b6fe2..9ae4a10438ee3 100644 ---- a/tools/objtool/Makefile -+++ b/tools/objtool/Makefile -@@ -3,15 +3,6 @@ include ../scripts/Makefile.include - include ../scripts/Makefile.arch - - # always use the host compiler --ifneq ($(LLVM),) --HOSTAR ?= llvm-ar --HOSTCC ?= clang --HOSTLD ?= ld.lld --else --HOSTAR ?= ar --HOSTCC ?= gcc --HOSTLD ?= ld --endif - AR = $(HOSTAR) - CC = $(HOSTCC) - LD = $(HOSTLD) -diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf -index 902c792f326a5..961f5e4fd6566 100644 ---- a/tools/perf/Makefile.perf -+++ b/tools/perf/Makefile.perf -@@ -163,10 +163,6 @@ endef - - LD += $(EXTRA_LDFLAGS) - --HOSTCC ?= gcc --HOSTLD ?= ld --HOSTAR ?= ar -- - PKG_CONFIG = $(CROSS_COMPILE)pkg-config - LLVM_CONFIG ?= llvm-config - -diff --git a/tools/power/acpi/Makefile.config b/tools/power/acpi/Makefile.config -index 54a2857c2510a..331f6d30f4726 100644 ---- a/tools/power/acpi/Makefile.config -+++ b/tools/power/acpi/Makefile.config -@@ -54,7 +54,6 @@ INSTALL_SCRIPT = ${INSTALL_PROGRAM} - CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- - CROSS_COMPILE ?= $(CROSS) - LD = $(CC) --HOSTCC = gcc - - # check if compiler option is supported - cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;} -diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include -index 6d2f3a1b22493..812fc97bb1a97 100644 ---- a/tools/scripts/Makefile.include -+++ b/tools/scripts/Makefile.include -@@ -59,6 +59,16 @@ $(call allow-override,LD,$(CROSS_COMPILE)ld) - $(call allow-override,CXX,$(CROSS_COMPILE)g++) - $(call allow-override,STRIP,$(CROSS_COMPILE)strip) - -+ifneq ($(LLVM),) -+HOSTAR ?= llvm-ar -+HOSTCC ?= clang -+HOSTLD ?= ld.lld -+else -+HOSTAR ?= ar -+HOSTCC ?= gcc -+HOSTLD ?= ld -+endif -+ - ifeq ($(CC_NO_CLANG), 1) - EXTRA_WARNINGS += -Wstrict-aliasing=3 - endif diff --git a/patch/kernel/odroidxu4-current/patch-5.4.94-95.patch b/patch/kernel/odroidxu4-current/patch-5.4.94-95.patch deleted file mode 100644 index f6a36b55c2..0000000000 --- a/patch/kernel/odroidxu4-current/patch-5.4.94-95.patch +++ /dev/null @@ -1,1747 +0,0 @@ -diff --git a/Documentation/virt/kvm/api.txt b/Documentation/virt/kvm/api.txt -index a18e996fa54b0..7064efd3b5ea3 100644 ---- a/Documentation/virt/kvm/api.txt -+++ b/Documentation/virt/kvm/api.txt -@@ -1132,6 +1132,9 @@ field userspace_addr, which must point at user addressable memory for - the entire memory slot size. Any object may back this memory, including - anonymous memory, ordinary files, and hugetlbfs. - -+On architectures that support a form of address tagging, userspace_addr must -+be an untagged address. -+ - It is recommended that the lower 21 bits of guest_phys_addr and userspace_addr - be identical. This allows large pages in the guest to be backed by large - pages in the host. -diff --git a/Makefile b/Makefile -index ad1b8dc6e462a..aa3c2e834442e 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - VERSION = 5 - PATCHLEVEL = 4 --SUBLEVEL = 94 -+SUBLEVEL = 95 - EXTRAVERSION = - NAME = Kleptomaniac Octopus - -diff --git a/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi -index 1a9a9d98f2848..14d6fec50dee2 100644 ---- a/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi -+++ b/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi -@@ -273,7 +273,7 @@ - - /* VDD_AUD_1P8: Audio codec */ - reg_aud_1p8v: ldo3 { -- regulator-name = "vdd1p8"; -+ regulator-name = "vdd1p8a"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-boot-on; -diff --git a/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi b/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi -index 6acc8591219a7..eea317b41020d 100644 ---- a/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi -+++ b/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi -@@ -167,7 +167,7 @@ - i2c-gpio,delay-us = <2>; /* ~100 kHz */ - #address-cells = <1>; - #size-cells = <0>; -- status = "disabld"; -+ status = "disabled"; - }; - - i2c_cam: i2c-gpio-cam { -@@ -179,7 +179,7 @@ - i2c-gpio,delay-us = <2>; /* ~100 kHz */ - #address-cells = <1>; - #size-cells = <0>; -- status = "disabld"; -+ status = "disabled"; - }; - }; - -diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S -index 1eabf2d2834be..e06f946b75b96 100644 ---- a/arch/arm/mach-imx/suspend-imx6.S -+++ b/arch/arm/mach-imx/suspend-imx6.S -@@ -67,6 +67,7 @@ - #define MX6Q_CCM_CCR 0x0 - - .align 3 -+ .arm - - .macro sync_l2_cache - -diff --git a/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi b/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi -index aef8f2b00778d..5401a646c8406 100644 ---- a/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi -+++ b/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi -@@ -4,11 +4,16 @@ - */ - usb { - compatible = "simple-bus"; -- dma-ranges; - #address-cells = <2>; - #size-cells = <2>; - ranges = <0x0 0x0 0x0 0x68500000 0x0 0x00400000>; - -+ /* -+ * Internally, USB bus to the interconnect can only address up -+ * to 40-bit -+ */ -+ dma-ranges = <0 0 0 0 0x100 0x0>; -+ - usbphy0: usb-phy@0 { - compatible = "brcm,sr-usb-combo-phy"; - reg = <0x0 0x00000000 0x0 0x100>; -diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi -index 795d6ca4bbd1f..bd99fa68b7630 100644 ---- a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi -+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi -@@ -103,7 +103,7 @@ - reboot { - compatible ="syscon-reboot"; - regmap = <&rst>; -- offset = <0xb0>; -+ offset = <0>; - mask = <0x02>; - }; - -diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c -index 08e1e7544f823..e32e8bcf94553 100644 ---- a/arch/x86/kvm/vmx/nested.c -+++ b/arch/x86/kvm/vmx/nested.c -@@ -5579,11 +5579,14 @@ static int vmx_get_nested_state(struct kvm_vcpu *vcpu, - if (is_guest_mode(vcpu)) { - sync_vmcs02_to_vmcs12(vcpu, vmcs12); - sync_vmcs02_to_vmcs12_rare(vcpu, vmcs12); -- } else if (!vmx->nested.need_vmcs12_to_shadow_sync) { -- if (vmx->nested.hv_evmcs) -- copy_enlightened_to_vmcs12(vmx); -- else if (enable_shadow_vmcs) -- copy_shadow_to_vmcs12(vmx); -+ } else { -+ copy_vmcs02_to_vmcs12_rare(vcpu, get_vmcs12(vcpu)); -+ if (!vmx->nested.need_vmcs12_to_shadow_sync) { -+ if (vmx->nested.hv_evmcs) -+ copy_enlightened_to_vmcs12(vmx); -+ else if (enable_shadow_vmcs) -+ copy_shadow_to_vmcs12(vmx); -+ } - } - - BUILD_BUG_ON(sizeof(user_vmx_nested_state->vmcs12) < VMCS12_SIZE); -diff --git a/arch/x86/kvm/vmx/pmu_intel.c b/arch/x86/kvm/vmx/pmu_intel.c -index f8998a7bc7d56..181e352d38de4 100644 ---- a/arch/x86/kvm/vmx/pmu_intel.c -+++ b/arch/x86/kvm/vmx/pmu_intel.c -@@ -26,7 +26,7 @@ static struct kvm_event_hw_type_mapping intel_arch_events[] = { - [4] = { 0x2e, 0x41, PERF_COUNT_HW_CACHE_MISSES }, - [5] = { 0xc4, 0x00, PERF_COUNT_HW_BRANCH_INSTRUCTIONS }, - [6] = { 0xc5, 0x00, PERF_COUNT_HW_BRANCH_MISSES }, -- [7] = { 0x00, 0x30, PERF_COUNT_HW_REF_CPU_CYCLES }, -+ [7] = { 0x00, 0x03, PERF_COUNT_HW_REF_CPU_CYCLES }, - }; - - /* mapping between fixed pmc index and intel_arch_events array */ -@@ -296,7 +296,9 @@ static void intel_pmu_refresh(struct kvm_vcpu *vcpu) - - pmu->nr_arch_gp_counters = min_t(int, eax.split.num_counters, - x86_pmu.num_counters_gp); -+ eax.split.bit_width = min_t(int, eax.split.bit_width, x86_pmu.bit_width_gp); - pmu->counter_bitmask[KVM_PMC_GP] = ((u64)1 << eax.split.bit_width) - 1; -+ eax.split.mask_length = min_t(int, eax.split.mask_length, x86_pmu.events_mask_len); - pmu->available_event_types = ~entry->ebx & - ((1ull << eax.split.mask_length) - 1); - -@@ -306,6 +308,8 @@ static void intel_pmu_refresh(struct kvm_vcpu *vcpu) - pmu->nr_arch_fixed_counters = - min_t(int, edx.split.num_counters_fixed, - x86_pmu.num_counters_fixed); -+ edx.split.bit_width_fixed = min_t(int, -+ edx.split.bit_width_fixed, x86_pmu.bit_width_fixed); - pmu->counter_bitmask[KVM_PMC_FIXED] = - ((u64)1 << edx.split.bit_width_fixed) - 1; - } -diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c -index 72990c3c6faf7..73095d7213993 100644 ---- a/arch/x86/kvm/x86.c -+++ b/arch/x86/kvm/x86.c -@@ -102,6 +102,7 @@ static u64 __read_mostly cr4_reserved_bits = CR4_RESERVED_BITS; - - static void update_cr8_intercept(struct kvm_vcpu *vcpu); - static void process_nmi(struct kvm_vcpu *vcpu); -+static void process_smi(struct kvm_vcpu *vcpu); - static void enter_smm(struct kvm_vcpu *vcpu); - static void __kvm_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags); - static void store_regs(struct kvm_vcpu *vcpu); -@@ -3772,6 +3773,10 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu, - { - process_nmi(vcpu); - -+ -+ if (kvm_check_request(KVM_REQ_SMI, vcpu)) -+ process_smi(vcpu); -+ - /* - * The API doesn't provide the instruction length for software - * exceptions, so don't report them. As long as the guest RIP -diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c -index 96869f1538b93..bfca116482b8b 100644 ---- a/drivers/acpi/device_sysfs.c -+++ b/drivers/acpi/device_sysfs.c -@@ -251,20 +251,12 @@ int __acpi_device_uevent_modalias(struct acpi_device *adev, - if (add_uevent_var(env, "MODALIAS=")) - return -ENOMEM; - -- len = create_pnp_modalias(adev, &env->buf[env->buflen - 1], -- sizeof(env->buf) - env->buflen); -- if (len < 0) -- return len; -- -- env->buflen += len; -- if (!adev->data.of_compatible) -- return 0; -- -- if (len > 0 && add_uevent_var(env, "MODALIAS=")) -- return -ENOMEM; -- -- len = create_of_modalias(adev, &env->buf[env->buflen - 1], -- sizeof(env->buf) - env->buflen); -+ if (adev->data.of_compatible) -+ len = create_of_modalias(adev, &env->buf[env->buflen - 1], -+ sizeof(env->buf) - env->buflen); -+ else -+ len = create_pnp_modalias(adev, &env->buf[env->buflen - 1], -+ sizeof(env->buf) - env->buflen); - if (len < 0) - return len; - -diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c -index a3037fe54c3ab..f068bb5d650eb 100644 ---- a/drivers/block/nbd.c -+++ b/drivers/block/nbd.c -@@ -1014,6 +1014,12 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, - if (!sock) - return err; - -+ /* -+ * We need to make sure we don't get any errant requests while we're -+ * reallocating the ->socks array. -+ */ -+ blk_mq_freeze_queue(nbd->disk->queue); -+ - if (!netlink && !nbd->task_setup && - !test_bit(NBD_RT_BOUND, &config->runtime_flags)) - nbd->task_setup = current; -@@ -1052,10 +1058,12 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, - nsock->cookie = 0; - socks[config->num_connections++] = nsock; - atomic_inc(&config->live_connections); -+ blk_mq_unfreeze_queue(nbd->disk->queue); - - return 0; - - put_socket: -+ blk_mq_unfreeze_queue(nbd->disk->queue); - sockfd_put(sock); - return err; - } -diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c -index ab5482202cfb3..def41e1bd7364 100644 ---- a/drivers/block/xen-blkfront.c -+++ b/drivers/block/xen-blkfront.c -@@ -936,7 +936,8 @@ static void blkif_set_queue_limits(struct blkfront_info *info) - if (info->feature_discard) { - blk_queue_flag_set(QUEUE_FLAG_DISCARD, rq); - blk_queue_max_discard_sectors(rq, get_capacity(gd)); -- rq->limits.discard_granularity = info->discard_granularity; -+ rq->limits.discard_granularity = info->discard_granularity ?: -+ info->physical_sector_size; - rq->limits.discard_alignment = info->discard_alignment; - if (info->feature_secdiscard) - blk_queue_flag_set(QUEUE_FLAG_SECERASE, rq); -@@ -2169,19 +2170,12 @@ static void blkfront_closing(struct blkfront_info *info) - - static void blkfront_setup_discard(struct blkfront_info *info) - { -- int err; -- unsigned int discard_granularity; -- unsigned int discard_alignment; -- - info->feature_discard = 1; -- err = xenbus_gather(XBT_NIL, info->xbdev->otherend, -- "discard-granularity", "%u", &discard_granularity, -- "discard-alignment", "%u", &discard_alignment, -- NULL); -- if (!err) { -- info->discard_granularity = discard_granularity; -- info->discard_alignment = discard_alignment; -- } -+ info->discard_granularity = xenbus_read_unsigned(info->xbdev->otherend, -+ "discard-granularity", -+ 0); -+ info->discard_alignment = xenbus_read_unsigned(info->xbdev->otherend, -+ "discard-alignment", 0); - info->feature_secdiscard = - !!xenbus_read_unsigned(info->xbdev->otherend, "discard-secure", - 0); -diff --git a/drivers/firmware/imx/Kconfig b/drivers/firmware/imx/Kconfig -index 0dbee32da4c6d..5d995fe64b5ca 100644 ---- a/drivers/firmware/imx/Kconfig -+++ b/drivers/firmware/imx/Kconfig -@@ -13,6 +13,7 @@ config IMX_DSP - config IMX_SCU - bool "IMX SCU Protocol driver" - depends on IMX_MBOX -+ select SOC_BUS - help - The System Controller Firmware (SCFW) is a low-level system function - which runs on a dedicated Cortex-M core to provide power, clock, and -diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h -index 126a0eb6e0542..00335a1c02b0e 100644 ---- a/drivers/gpu/drm/i915/i915_drv.h -+++ b/drivers/gpu/drm/i915/i915_drv.h -@@ -1894,7 +1894,7 @@ intel_subplatform(const struct intel_runtime_info *info, enum intel_platform p) - { - const unsigned int pi = __platform_mask_index(info, p); - -- return info->platform_mask[pi] & INTEL_SUBPLATFORM_BITS; -+ return info->platform_mask[pi] & ((1 << INTEL_SUBPLATFORM_BITS) - 1); - } - - static __always_inline bool -diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c -index 0be4668c780bf..8556804e96efd 100644 ---- a/drivers/gpu/drm/nouveau/nouveau_svm.c -+++ b/drivers/gpu/drm/nouveau/nouveau_svm.c -@@ -306,6 +306,10 @@ nouveau_svmm_init(struct drm_device *dev, void *data, - struct drm_nouveau_svm_init *args = data; - int ret; - -+ /* We need to fail if svm is disabled */ -+ if (!cli->drm->svm) -+ return -ENOSYS; -+ - /* Allocate tracking for SVM-enabled VMM. */ - if (!(svmm = kzalloc(sizeof(*svmm), GFP_KERNEL))) - return -ENOMEM; -diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c -index 89ac2f9ae6dd8..e7472f0da59d2 100644 ---- a/drivers/infiniband/hw/cxgb4/qp.c -+++ b/drivers/infiniband/hw/cxgb4/qp.c -@@ -2471,7 +2471,7 @@ int c4iw_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, - init_attr->cap.max_send_wr = qhp->attr.sq_num_entries; - init_attr->cap.max_recv_wr = qhp->attr.rq_num_entries; - init_attr->cap.max_send_sge = qhp->attr.sq_max_sges; -- init_attr->cap.max_recv_sge = qhp->attr.sq_max_sges; -+ init_attr->cap.max_recv_sge = qhp->attr.rq_max_sges; - init_attr->cap.max_inline_data = T4_MAX_SEND_INLINE; - init_attr->sq_sig_type = qhp->sq_sig_all ? IB_SIGNAL_ALL_WR : 0; - return 0; -diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c -index 30ac0ba55864e..1b9795743276d 100644 ---- a/drivers/iommu/dmar.c -+++ b/drivers/iommu/dmar.c -@@ -1020,8 +1020,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd) - { - struct intel_iommu *iommu; - u32 ver, sts; -- int agaw = 0; -- int msagaw = 0; -+ int agaw = -1; -+ int msagaw = -1; - int err; - - if (!drhd->reg_base_addr) { -@@ -1046,17 +1046,28 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd) - } - - err = -EINVAL; -- agaw = iommu_calculate_agaw(iommu); -- if (agaw < 0) { -- pr_err("Cannot get a valid agaw for iommu (seq_id = %d)\n", -- iommu->seq_id); -- goto err_unmap; -+ if (cap_sagaw(iommu->cap) == 0) { -+ pr_info("%s: No supported address widths. Not attempting DMA translation.\n", -+ iommu->name); -+ drhd->ignored = 1; - } -- msagaw = iommu_calculate_max_sagaw(iommu); -- if (msagaw < 0) { -- pr_err("Cannot get a valid max agaw for iommu (seq_id = %d)\n", -- iommu->seq_id); -- goto err_unmap; -+ -+ if (!drhd->ignored) { -+ agaw = iommu_calculate_agaw(iommu); -+ if (agaw < 0) { -+ pr_err("Cannot get a valid agaw for iommu (seq_id = %d)\n", -+ iommu->seq_id); -+ drhd->ignored = 1; -+ } -+ } -+ if (!drhd->ignored) { -+ msagaw = iommu_calculate_max_sagaw(iommu); -+ if (msagaw < 0) { -+ pr_err("Cannot get a valid max agaw for iommu (seq_id = %d)\n", -+ iommu->seq_id); -+ drhd->ignored = 1; -+ agaw = -1; -+ } - } - iommu->agaw = agaw; - iommu->msagaw = msagaw; -@@ -1083,7 +1094,12 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd) - - raw_spin_lock_init(&iommu->register_lock); - -- if (intel_iommu_enabled) { -+ /* -+ * This is only for hotplug; at boot time intel_iommu_enabled won't -+ * be set yet. When intel_iommu_init() runs, it registers the units -+ * present at boot time, then sets intel_iommu_enabled. -+ */ -+ if (intel_iommu_enabled && !drhd->ignored) { - err = iommu_device_sysfs_add(&iommu->iommu, NULL, - intel_iommu_groups, - "%s", iommu->name); -@@ -1098,6 +1114,7 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd) - } - - drhd->iommu = iommu; -+ iommu->drhd = drhd; - - return 0; - -@@ -1112,7 +1129,7 @@ error: - - static void free_iommu(struct intel_iommu *iommu) - { -- if (intel_iommu_enabled) { -+ if (intel_iommu_enabled && !iommu->drhd->ignored) { - iommu_device_unregister(&iommu->iommu); - iommu_device_sysfs_remove(&iommu->iommu); - } -diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c -index 23963e5cb5d6a..0d59763e40de1 100644 ---- a/drivers/leds/led-triggers.c -+++ b/drivers/leds/led-triggers.c -@@ -318,14 +318,15 @@ void led_trigger_event(struct led_trigger *trig, - enum led_brightness brightness) - { - struct led_classdev *led_cdev; -+ unsigned long flags; - - if (!trig) - return; - -- read_lock(&trig->leddev_list_lock); -+ read_lock_irqsave(&trig->leddev_list_lock, flags); - list_for_each_entry(led_cdev, &trig->led_cdevs, trig_list) - led_set_brightness(led_cdev, brightness); -- read_unlock(&trig->leddev_list_lock); -+ read_unlock_irqrestore(&trig->leddev_list_lock, flags); - } - EXPORT_SYMBOL_GPL(led_trigger_event); - -@@ -336,11 +337,12 @@ static void led_trigger_blink_setup(struct led_trigger *trig, - int invert) - { - struct led_classdev *led_cdev; -+ unsigned long flags; - - if (!trig) - return; - -- read_lock(&trig->leddev_list_lock); -+ read_lock_irqsave(&trig->leddev_list_lock, flags); - list_for_each_entry(led_cdev, &trig->led_cdevs, trig_list) { - if (oneshot) - led_blink_set_oneshot(led_cdev, delay_on, delay_off, -@@ -348,7 +350,7 @@ static void led_trigger_blink_setup(struct led_trigger *trig, - else - led_blink_set(led_cdev, delay_on, delay_off); - } -- read_unlock(&trig->leddev_list_lock); -+ read_unlock_irqrestore(&trig->leddev_list_lock, flags); - } - - void led_trigger_blink(struct led_trigger *trig, -diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c -index e84f9dccf448a..c4d7e06974d2c 100644 ---- a/drivers/media/rc/rc-main.c -+++ b/drivers/media/rc/rc-main.c -@@ -1892,6 +1892,8 @@ int rc_register_device(struct rc_dev *dev) - goto out_raw; - } - -+ dev->registered = true; -+ - rc = device_add(&dev->dev); - if (rc) - goto out_rx_free; -@@ -1901,8 +1903,6 @@ int rc_register_device(struct rc_dev *dev) - dev->device_name ?: "Unspecified device", path ?: "N/A"); - kfree(path); - -- dev->registered = true; -- - /* - * once the the input device is registered in rc_setup_rx_device, - * userspace can open the input device and rc_open() will be called -diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c -index 247aeacb3a440..2ae9feb99a07d 100644 ---- a/drivers/net/can/dev.c -+++ b/drivers/net/can/dev.c -@@ -1134,7 +1134,7 @@ static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) - { - struct can_priv *priv = netdev_priv(dev); - struct can_ctrlmode cm = {.flags = priv->ctrlmode}; -- struct can_berr_counter bec; -+ struct can_berr_counter bec = { }; - enum can_state state = priv->state; - - if (priv->do_get_state) -diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c -index c952212900fcf..c20dc689698ed 100644 ---- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c -+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c -@@ -3980,20 +3980,16 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac) - goto error_param; - - vf = &pf->vf[vf_id]; -- vsi = pf->vsi[vf->lan_vsi_idx]; - - /* When the VF is resetting wait until it is done. - * It can take up to 200 milliseconds, - * but wait for up to 300 milliseconds to be safe. -- * If the VF is indeed in reset, the vsi pointer has -- * to show on the newly loaded vsi under pf->vsi[id]. -+ * Acquire the VSI pointer only after the VF has been -+ * properly initialized. - */ - for (i = 0; i < 15; i++) { -- if (test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) { -- if (i > 0) -- vsi = pf->vsi[vf->lan_vsi_idx]; -+ if (test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) - break; -- } - msleep(20); - } - if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) { -@@ -4002,6 +3998,7 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac) - ret = -EAGAIN; - goto error_param; - } -+ vsi = pf->vsi[vf->lan_vsi_idx]; - - if (is_multicast_ether_addr(mac)) { - dev_err(&pf->pdev->dev, -diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c -index ac98f1d968921..0303eeb760505 100644 ---- a/drivers/net/ethernet/intel/igc/igc_ethtool.c -+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c -@@ -1670,12 +1670,18 @@ static int igc_get_link_ksettings(struct net_device *netdev, - cmd->base.phy_address = hw->phy.addr; - - /* advertising link modes */ -- ethtool_link_ksettings_add_link_mode(cmd, advertising, 10baseT_Half); -- ethtool_link_ksettings_add_link_mode(cmd, advertising, 10baseT_Full); -- ethtool_link_ksettings_add_link_mode(cmd, advertising, 100baseT_Half); -- ethtool_link_ksettings_add_link_mode(cmd, advertising, 100baseT_Full); -- ethtool_link_ksettings_add_link_mode(cmd, advertising, 1000baseT_Full); -- ethtool_link_ksettings_add_link_mode(cmd, advertising, 2500baseT_Full); -+ if (hw->phy.autoneg_advertised & ADVERTISE_10_HALF) -+ ethtool_link_ksettings_add_link_mode(cmd, advertising, 10baseT_Half); -+ if (hw->phy.autoneg_advertised & ADVERTISE_10_FULL) -+ ethtool_link_ksettings_add_link_mode(cmd, advertising, 10baseT_Full); -+ if (hw->phy.autoneg_advertised & ADVERTISE_100_HALF) -+ ethtool_link_ksettings_add_link_mode(cmd, advertising, 100baseT_Half); -+ if (hw->phy.autoneg_advertised & ADVERTISE_100_FULL) -+ ethtool_link_ksettings_add_link_mode(cmd, advertising, 100baseT_Full); -+ if (hw->phy.autoneg_advertised & ADVERTISE_1000_FULL) -+ ethtool_link_ksettings_add_link_mode(cmd, advertising, 1000baseT_Full); -+ if (hw->phy.autoneg_advertised & ADVERTISE_2500_FULL) -+ ethtool_link_ksettings_add_link_mode(cmd, advertising, 2500baseT_Full); - - /* set autoneg settings */ - if (hw->mac.autoneg == 1) { -@@ -1786,6 +1792,12 @@ static int igc_set_link_ksettings(struct net_device *netdev, - - ethtool_convert_link_mode_to_legacy_u32(&advertising, - cmd->link_modes.advertising); -+ /* Converting to legacy u32 drops ETHTOOL_LINK_MODE_2500baseT_Full_BIT. -+ * We have to check this and convert it to ADVERTISE_2500_FULL -+ * (aka ETHTOOL_LINK_MODE_2500baseX_Full_BIT) explicitly. -+ */ -+ if (ethtool_link_ksettings_test_link_mode(cmd, advertising, 2500baseT_Full)) -+ advertising |= ADVERTISE_2500_FULL; - - if (cmd->base.autoneg == AUTONEG_ENABLE) { - hw->mac.autoneg = 1; -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c -index ec117e4414250..6495c26d95969 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c -@@ -57,6 +57,7 @@ - #include "lib/devcom.h" - #include "lib/geneve.h" - #include "diag/en_tc_tracepoint.h" -+#include - - struct mlx5_nic_flow_attr { - u32 action; -@@ -1837,8 +1838,8 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, - BIT(FLOW_DISSECTOR_KEY_ENC_IP) | - BIT(FLOW_DISSECTOR_KEY_ENC_OPTS))) { - NL_SET_ERR_MSG_MOD(extack, "Unsupported key"); -- netdev_warn(priv->netdev, "Unsupported key used: 0x%x\n", -- dissector->used_keys); -+ netdev_dbg(priv->netdev, "Unsupported key used: 0x%x\n", -+ dissector->used_keys); - return -EOPNOTSUPP; - } - -@@ -3943,13 +3944,13 @@ errout: - return err; - } - --static int apply_police_params(struct mlx5e_priv *priv, u32 rate, -+static int apply_police_params(struct mlx5e_priv *priv, u64 rate, - struct netlink_ext_ack *extack) - { - struct mlx5e_rep_priv *rpriv = priv->ppriv; - struct mlx5_eswitch *esw; -+ u32 rate_mbps = 0; - u16 vport_num; -- u32 rate_mbps; - int err; - - vport_num = rpriv->rep->vport; -@@ -3966,7 +3967,11 @@ static int apply_police_params(struct mlx5e_priv *priv, u32 rate, - * Moreover, if rate is non zero we choose to configure to a minimum of - * 1 mbit/sec. - */ -- rate_mbps = rate ? max_t(u32, (rate * 8 + 500000) / 1000000, 1) : 0; -+ if (rate) { -+ rate = (rate * BITS_PER_BYTE) + 500000; -+ rate_mbps = max_t(u32, do_div(rate, 1000000), 1); -+ } -+ - err = mlx5_esw_modify_vport_rate(esw, vport_num, rate_mbps); - if (err) - NL_SET_ERR_MSG_MOD(extack, "failed applying action to hardware"); -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c -index 2eceb72f0f647..4944c40436f08 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c -@@ -1068,6 +1068,7 @@ static struct mlx5_flow_table *__mlx5_create_flow_table(struct mlx5_flow_namespa - destroy_ft: - root->cmds->destroy_flow_table(root, ft); - free_ft: -+ rhltable_destroy(&ft->fgs_hash); - kfree(ft); - unlock_root: - mutex_unlock(&root->chain_lock); -diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c -index 606fee99221b8..0eb894b7c0bda 100644 ---- a/drivers/net/team/team.c -+++ b/drivers/net/team/team.c -@@ -991,7 +991,8 @@ static void __team_compute_features(struct team *team) - unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE | - IFF_XMIT_DST_RELEASE_PERM; - -- list_for_each_entry(port, &team->port_list, list) { -+ rcu_read_lock(); -+ list_for_each_entry_rcu(port, &team->port_list, list) { - vlan_features = netdev_increment_features(vlan_features, - port->dev->vlan_features, - TEAM_VLAN_FEATURES); -@@ -1005,6 +1006,7 @@ static void __team_compute_features(struct team *team) - if (port->dev->hard_header_len > max_hard_header_len) - max_hard_header_len = port->dev->hard_header_len; - } -+ rcu_read_unlock(); - - team->dev->vlan_features = vlan_features; - team->dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL | -@@ -1020,9 +1022,7 @@ static void __team_compute_features(struct team *team) - - static void team_compute_features(struct team *team) - { -- mutex_lock(&team->lock); - __team_compute_features(team); -- mutex_unlock(&team->lock); - netdev_change_features(team->dev); - } - -diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c -index b0d748a614a9e..72a3a5dc51319 100644 ---- a/drivers/net/usb/qmi_wwan.c -+++ b/drivers/net/usb/qmi_wwan.c -@@ -1347,6 +1347,7 @@ static const struct usb_device_id products[] = { - {QMI_FIXED_INTF(0x0b3c, 0xc00a, 6)}, /* Olivetti Olicard 160 */ - {QMI_FIXED_INTF(0x0b3c, 0xc00b, 4)}, /* Olivetti Olicard 500 */ - {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */ -+ {QMI_QUIRK_SET_DTR(0x1e2d, 0x006f, 8)}, /* Cinterion PLS83/PLS63 */ - {QMI_FIXED_INTF(0x1e2d, 0x0053, 4)}, /* Cinterion PHxx,PXxx */ - {QMI_FIXED_INTF(0x1e2d, 0x0063, 10)}, /* Cinterion ALASxx (1 RmNet) */ - {QMI_FIXED_INTF(0x1e2d, 0x0082, 4)}, /* Cinterion PHxx,PXxx (2 RmNet) */ -diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c -index ef5a8ecabc60a..0581f082301e0 100644 ---- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c -+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c -@@ -2183,7 +2183,8 @@ static int iwl_trans_pcie_read_mem(struct iwl_trans *trans, u32 addr, - - while (offs < dwords) { - /* limit the time we spin here under lock to 1/2s */ -- ktime_t timeout = ktime_add_us(ktime_get(), 500 * USEC_PER_MSEC); -+ unsigned long end = jiffies + HZ / 2; -+ bool resched = false; - - if (iwl_trans_grab_nic_access(trans, &flags)) { - iwl_write32(trans, HBUS_TARG_MEM_RADDR, -@@ -2194,14 +2195,15 @@ static int iwl_trans_pcie_read_mem(struct iwl_trans *trans, u32 addr, - HBUS_TARG_MEM_RDAT); - offs++; - -- /* calling ktime_get is expensive so -- * do it once in 128 reads -- */ -- if (offs % 128 == 0 && ktime_after(ktime_get(), -- timeout)) -+ if (time_after(jiffies, end)) { -+ resched = true; - break; -+ } - } - iwl_trans_release_nic_access(trans, &flags); -+ -+ if (resched) -+ cond_resched(); - } else { - return -EBUSY; - } -diff --git a/drivers/net/wireless/mediatek/mt7601u/dma.c b/drivers/net/wireless/mediatek/mt7601u/dma.c -index f6a0454abe044..6f2172be7b66a 100644 ---- a/drivers/net/wireless/mediatek/mt7601u/dma.c -+++ b/drivers/net/wireless/mediatek/mt7601u/dma.c -@@ -152,8 +152,7 @@ mt7601u_rx_process_entry(struct mt7601u_dev *dev, struct mt7601u_dma_buf_rx *e) - - if (new_p) { - /* we have one extra ref from the allocator */ -- __free_pages(e->p, MT_RX_ORDER); -- -+ put_page(e->p); - e->p = new_p; - } - } -@@ -310,7 +309,6 @@ static int mt7601u_dma_submit_tx(struct mt7601u_dev *dev, - } - - e = &q->e[q->end]; -- e->skb = skb; - usb_fill_bulk_urb(e->urb, usb_dev, snd_pipe, skb->data, skb->len, - mt7601u_complete_tx, q); - ret = usb_submit_urb(e->urb, GFP_ATOMIC); -@@ -328,6 +326,7 @@ static int mt7601u_dma_submit_tx(struct mt7601u_dev *dev, - - q->end = (q->end + 1) % q->entries; - q->used++; -+ e->skb = skb; - - if (q->used >= q->entries) - ieee80211_stop_queue(dev->hw, skb_get_queue_mapping(skb)); -diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c -index 3968f89f7855a..0ac0bd4c65c4c 100644 ---- a/drivers/nvme/host/multipath.c -+++ b/drivers/nvme/host/multipath.c -@@ -233,7 +233,7 @@ static struct nvme_ns *nvme_round_robin_path(struct nvme_ns_head *head, - } - - for (ns = nvme_next_ns(head, old); -- ns != old; -+ ns && ns != old; - ns = nvme_next_ns(head, ns)) { - if (nvme_path_is_disabled(ns)) - continue; -diff --git a/drivers/s390/crypto/vfio_ap_drv.c b/drivers/s390/crypto/vfio_ap_drv.c -index be2520cc010be..7dc72cb718b0e 100644 ---- a/drivers/s390/crypto/vfio_ap_drv.c -+++ b/drivers/s390/crypto/vfio_ap_drv.c -@@ -71,15 +71,11 @@ static int vfio_ap_queue_dev_probe(struct ap_device *apdev) - static void vfio_ap_queue_dev_remove(struct ap_device *apdev) - { - struct vfio_ap_queue *q; -- int apid, apqi; - - mutex_lock(&matrix_dev->lock); - q = dev_get_drvdata(&apdev->device); -+ vfio_ap_mdev_reset_queue(q, 1); - dev_set_drvdata(&apdev->device, NULL); -- apid = AP_QID_CARD(q->apqn); -- apqi = AP_QID_QUEUE(q->apqn); -- vfio_ap_mdev_reset_queue(apid, apqi, 1); -- vfio_ap_irq_disable(q); - kfree(q); - mutex_unlock(&matrix_dev->lock); - } -diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c -index 5c0f53c6dde75..790b0b2b36272 100644 ---- a/drivers/s390/crypto/vfio_ap_ops.c -+++ b/drivers/s390/crypto/vfio_ap_ops.c -@@ -25,6 +25,7 @@ - #define VFIO_AP_MDEV_NAME_HWVIRT "VFIO AP Passthrough Device" - - static int vfio_ap_mdev_reset_queues(struct mdev_device *mdev); -+static struct vfio_ap_queue *vfio_ap_find_queue(int apqn); - - static int match_apqn(struct device *dev, const void *data) - { -@@ -49,20 +50,15 @@ static struct vfio_ap_queue *vfio_ap_get_queue( - int apqn) - { - struct vfio_ap_queue *q; -- struct device *dev; - - if (!test_bit_inv(AP_QID_CARD(apqn), matrix_mdev->matrix.apm)) - return NULL; - if (!test_bit_inv(AP_QID_QUEUE(apqn), matrix_mdev->matrix.aqm)) - return NULL; - -- dev = driver_find_device(&matrix_dev->vfio_ap_drv->driver, NULL, -- &apqn, match_apqn); -- if (!dev) -- return NULL; -- q = dev_get_drvdata(dev); -- q->matrix_mdev = matrix_mdev; -- put_device(dev); -+ q = vfio_ap_find_queue(apqn); -+ if (q) -+ q->matrix_mdev = matrix_mdev; - - return q; - } -@@ -119,13 +115,18 @@ static void vfio_ap_wait_for_irqclear(int apqn) - */ - static void vfio_ap_free_aqic_resources(struct vfio_ap_queue *q) - { -- if (q->saved_isc != VFIO_AP_ISC_INVALID && q->matrix_mdev) -+ if (!q) -+ return; -+ if (q->saved_isc != VFIO_AP_ISC_INVALID && -+ !WARN_ON(!(q->matrix_mdev && q->matrix_mdev->kvm))) { - kvm_s390_gisc_unregister(q->matrix_mdev->kvm, q->saved_isc); -- if (q->saved_pfn && q->matrix_mdev) -+ q->saved_isc = VFIO_AP_ISC_INVALID; -+ } -+ if (q->saved_pfn && !WARN_ON(!q->matrix_mdev)) { - vfio_unpin_pages(mdev_dev(q->matrix_mdev->mdev), - &q->saved_pfn, 1); -- q->saved_pfn = 0; -- q->saved_isc = VFIO_AP_ISC_INVALID; -+ q->saved_pfn = 0; -+ } - } - - /** -@@ -144,7 +145,7 @@ static void vfio_ap_free_aqic_resources(struct vfio_ap_queue *q) - * Returns if ap_aqic function failed with invalid, deconfigured or - * checkstopped AP. - */ --struct ap_queue_status vfio_ap_irq_disable(struct vfio_ap_queue *q) -+static struct ap_queue_status vfio_ap_irq_disable(struct vfio_ap_queue *q) - { - struct ap_qirq_ctrl aqic_gisa = {}; - struct ap_queue_status status; -@@ -1114,48 +1115,70 @@ static int vfio_ap_mdev_group_notifier(struct notifier_block *nb, - return NOTIFY_OK; - } - --static void vfio_ap_irq_disable_apqn(int apqn) -+static struct vfio_ap_queue *vfio_ap_find_queue(int apqn) - { - struct device *dev; -- struct vfio_ap_queue *q; -+ struct vfio_ap_queue *q = NULL; - - dev = driver_find_device(&matrix_dev->vfio_ap_drv->driver, NULL, - &apqn, match_apqn); - if (dev) { - q = dev_get_drvdata(dev); -- vfio_ap_irq_disable(q); - put_device(dev); - } -+ -+ return q; - } - --int vfio_ap_mdev_reset_queue(unsigned int apid, unsigned int apqi, -+int vfio_ap_mdev_reset_queue(struct vfio_ap_queue *q, - unsigned int retry) - { - struct ap_queue_status status; -+ int ret; - int retry2 = 2; -- int apqn = AP_MKQID(apid, apqi); - -- do { -- status = ap_zapq(apqn); -- switch (status.response_code) { -- case AP_RESPONSE_NORMAL: -- while (!status.queue_empty && retry2--) { -- msleep(20); -- status = ap_tapq(apqn, NULL); -- } -- WARN_ON_ONCE(retry2 <= 0); -- return 0; -- case AP_RESPONSE_RESET_IN_PROGRESS: -- case AP_RESPONSE_BUSY: -+ if (!q) -+ return 0; -+ -+retry_zapq: -+ status = ap_zapq(q->apqn); -+ switch (status.response_code) { -+ case AP_RESPONSE_NORMAL: -+ ret = 0; -+ break; -+ case AP_RESPONSE_RESET_IN_PROGRESS: -+ if (retry--) { - msleep(20); -- break; -- default: -- /* things are really broken, give up */ -- return -EIO; -+ goto retry_zapq; - } -- } while (retry--); -+ ret = -EBUSY; -+ break; -+ case AP_RESPONSE_Q_NOT_AVAIL: -+ case AP_RESPONSE_DECONFIGURED: -+ case AP_RESPONSE_CHECKSTOPPED: -+ WARN_ON_ONCE(status.irq_enabled); -+ ret = -EBUSY; -+ goto free_resources; -+ default: -+ /* things are really broken, give up */ -+ WARN(true, "PQAP/ZAPQ completed with invalid rc (%x)\n", -+ status.response_code); -+ return -EIO; -+ } -+ -+ /* wait for the reset to take effect */ -+ while (retry2--) { -+ if (status.queue_empty && !status.irq_enabled) -+ break; -+ msleep(20); -+ status = ap_tapq(q->apqn, NULL); -+ } -+ WARN_ON_ONCE(retry2 <= 0); - -- return -EBUSY; -+free_resources: -+ vfio_ap_free_aqic_resources(q); -+ -+ return ret; - } - - static int vfio_ap_mdev_reset_queues(struct mdev_device *mdev) -@@ -1163,13 +1186,15 @@ static int vfio_ap_mdev_reset_queues(struct mdev_device *mdev) - int ret; - int rc = 0; - unsigned long apid, apqi; -+ struct vfio_ap_queue *q; - struct ap_matrix_mdev *matrix_mdev = mdev_get_drvdata(mdev); - - for_each_set_bit_inv(apid, matrix_mdev->matrix.apm, - matrix_mdev->matrix.apm_max + 1) { - for_each_set_bit_inv(apqi, matrix_mdev->matrix.aqm, - matrix_mdev->matrix.aqm_max + 1) { -- ret = vfio_ap_mdev_reset_queue(apid, apqi, 1); -+ q = vfio_ap_find_queue(AP_MKQID(apid, apqi)); -+ ret = vfio_ap_mdev_reset_queue(q, 1); - /* - * Regardless whether a queue turns out to be busy, or - * is not operational, we need to continue resetting -@@ -1177,7 +1202,6 @@ static int vfio_ap_mdev_reset_queues(struct mdev_device *mdev) - */ - if (ret) - rc = ret; -- vfio_ap_irq_disable_apqn(AP_MKQID(apid, apqi)); - } - } - -diff --git a/drivers/s390/crypto/vfio_ap_private.h b/drivers/s390/crypto/vfio_ap_private.h -index f46dde56b4644..28e9d99897682 100644 ---- a/drivers/s390/crypto/vfio_ap_private.h -+++ b/drivers/s390/crypto/vfio_ap_private.h -@@ -88,11 +88,6 @@ struct ap_matrix_mdev { - struct mdev_device *mdev; - }; - --extern int vfio_ap_mdev_register(void); --extern void vfio_ap_mdev_unregister(void); --int vfio_ap_mdev_reset_queue(unsigned int apid, unsigned int apqi, -- unsigned int retry); -- - struct vfio_ap_queue { - struct ap_matrix_mdev *matrix_mdev; - unsigned long saved_pfn; -@@ -100,5 +95,10 @@ struct vfio_ap_queue { - #define VFIO_AP_ISC_INVALID 0xff - unsigned char saved_isc; - }; --struct ap_queue_status vfio_ap_irq_disable(struct vfio_ap_queue *q); -+ -+int vfio_ap_mdev_register(void); -+void vfio_ap_mdev_unregister(void); -+int vfio_ap_mdev_reset_queue(struct vfio_ap_queue *q, -+ unsigned int retry); -+ - #endif /* _VFIO_AP_PRIVATE_H_ */ -diff --git a/drivers/soc/atmel/soc.c b/drivers/soc/atmel/soc.c -index 096a83cf0caf3..4b4174597150d 100644 ---- a/drivers/soc/atmel/soc.c -+++ b/drivers/soc/atmel/soc.c -@@ -264,8 +264,21 @@ struct soc_device * __init at91_soc_init(const struct at91_soc *socs) - return soc_dev; - } - -+static const struct of_device_id at91_soc_allowed_list[] __initconst = { -+ { .compatible = "atmel,at91rm9200", }, -+ { .compatible = "atmel,at91sam9", }, -+ { .compatible = "atmel,sama5", }, -+ { .compatible = "atmel,samv7", }, -+ { } -+}; -+ - static int __init atmel_soc_device_init(void) - { -+ struct device_node *np = of_find_node_by_path("/"); -+ -+ if (!of_match_node(at91_soc_allowed_list, np)) -+ return 0; -+ - at91_soc_init(socs); - - return 0; -diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c -index aadedec3bfe7b..ea79482ebda46 100644 ---- a/drivers/tee/optee/call.c -+++ b/drivers/tee/optee/call.c -@@ -7,6 +7,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -148,7 +149,8 @@ u32 optee_do_call_with_arg(struct tee_context *ctx, phys_addr_t parg) - */ - optee_cq_wait_for_completion(&optee->call_queue, &w); - } else if (OPTEE_SMC_RETURN_IS_RPC(res.a0)) { -- might_sleep(); -+ if (need_resched()) -+ cond_resched(); - param.a0 = res.a0; - param.a1 = res.a1; - param.a2 = res.a2; -diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c -index 14ccf13ab8fa1..786494bb7f20b 100644 ---- a/drivers/xen/xenbus/xenbus_probe.c -+++ b/drivers/xen/xenbus/xenbus_probe.c -@@ -714,6 +714,23 @@ static bool xs_hvm_defer_init_for_callback(void) - #endif - } - -+static int xenbus_probe_thread(void *unused) -+{ -+ DEFINE_WAIT(w); -+ -+ /* -+ * We actually just want to wait for *any* trigger of xb_waitq, -+ * and run xenbus_probe() the moment it occurs. -+ */ -+ prepare_to_wait(&xb_waitq, &w, TASK_INTERRUPTIBLE); -+ schedule(); -+ finish_wait(&xb_waitq, &w); -+ -+ DPRINTK("probing"); -+ xenbus_probe(); -+ return 0; -+} -+ - static int __init xenbus_probe_initcall(void) - { - /* -@@ -725,6 +742,20 @@ static int __init xenbus_probe_initcall(void) - !xs_hvm_defer_init_for_callback())) - xenbus_probe(); - -+ /* -+ * For XS_LOCAL, spawn a thread which will wait for xenstored -+ * or a xenstore-stubdom to be started, then probe. It will be -+ * triggered when communication starts happening, by waiting -+ * on xb_waitq. -+ */ -+ if (xen_store_domain_type == XS_LOCAL) { -+ struct task_struct *probe_task; -+ -+ probe_task = kthread_run(xenbus_probe_thread, NULL, -+ "xenbus_probe"); -+ if (IS_ERR(probe_task)) -+ return PTR_ERR(probe_task); -+ } - return 0; - } - device_initcall(xenbus_probe_initcall); -diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c -index 59e7a2ad440fc..a32f23981f60f 100644 ---- a/fs/btrfs/block-group.c -+++ b/fs/btrfs/block-group.c -@@ -640,7 +640,15 @@ static noinline void caching_thread(struct btrfs_work *work) - mutex_lock(&caching_ctl->mutex); - down_read(&fs_info->commit_root_sem); - -- if (btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) -+ /* -+ * If we are in the transaction that populated the free space tree we -+ * can't actually cache from the free space tree as our commit root and -+ * real root are the same, so we could change the contents of the blocks -+ * while caching. Instead do the slow caching in this case, and after -+ * the transaction has committed we will be safe. -+ */ -+ if (btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE) && -+ !(test_bit(BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED, &fs_info->flags))) - ret = load_free_space_tree(caching_ctl); - else - ret = load_extent_tree_free(caching_ctl); -diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h -index 27128164fac97..cda5534d3d0e3 100644 ---- a/fs/btrfs/ctree.h -+++ b/fs/btrfs/ctree.h -@@ -136,6 +136,9 @@ enum { - BTRFS_FS_STATE_DEV_REPLACING, - /* The btrfs_fs_info created for self-tests */ - BTRFS_FS_STATE_DUMMY_FS_INFO, -+ -+ /* Indicate that we can't trust the free space tree for caching yet */ -+ BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED, - }; - - #define BTRFS_BACKREF_REV_MAX 256 -diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c -index 48a03f5240f59..dfabbbfc94ccb 100644 ---- a/fs/btrfs/free-space-tree.c -+++ b/fs/btrfs/free-space-tree.c -@@ -1149,6 +1149,7 @@ int btrfs_create_free_space_tree(struct btrfs_fs_info *fs_info) - return PTR_ERR(trans); - - set_bit(BTRFS_FS_CREATING_FREE_SPACE_TREE, &fs_info->flags); -+ set_bit(BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED, &fs_info->flags); - free_space_root = btrfs_create_tree(trans, - BTRFS_FREE_SPACE_TREE_OBJECTID); - if (IS_ERR(free_space_root)) { -@@ -1170,11 +1171,18 @@ int btrfs_create_free_space_tree(struct btrfs_fs_info *fs_info) - btrfs_set_fs_compat_ro(fs_info, FREE_SPACE_TREE); - btrfs_set_fs_compat_ro(fs_info, FREE_SPACE_TREE_VALID); - clear_bit(BTRFS_FS_CREATING_FREE_SPACE_TREE, &fs_info->flags); -+ ret = btrfs_commit_transaction(trans); - -- return btrfs_commit_transaction(trans); -+ /* -+ * Now that we've committed the transaction any reading of our commit -+ * root will be safe, so we can cache from the free space tree now. -+ */ -+ clear_bit(BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED, &fs_info->flags); -+ return ret; - - abort: - clear_bit(BTRFS_FS_CREATING_FREE_SPACE_TREE, &fs_info->flags); -+ clear_bit(BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED, &fs_info->flags); - btrfs_abort_transaction(trans, ret); - btrfs_end_transaction(trans); - return ret; -diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c -index 4232f956bdac0..ca1d98f274d12 100644 ---- a/fs/nfs/pnfs.c -+++ b/fs/nfs/pnfs.c -@@ -2388,6 +2388,7 @@ out_forget: - spin_unlock(&ino->i_lock); - lseg->pls_layout = lo; - NFS_SERVER(ino)->pnfs_curr_ld->free_lseg(lseg); -+ pnfs_free_lseg_list(&free_me); - return ERR_PTR(-EAGAIN); - } - -diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h -index 6b559d25a84ee..88ac8edf44e31 100644 ---- a/include/linux/intel-iommu.h -+++ b/include/linux/intel-iommu.h -@@ -556,6 +556,8 @@ struct intel_iommu { - struct iommu_device iommu; /* IOMMU core code handle */ - int node; - u32 flags; /* Software defined flags */ -+ -+ struct dmar_drhd_unit *drhd; - }; - - /* PCI domain-device relationship */ -diff --git a/include/net/tcp.h b/include/net/tcp.h -index 377179283c46c..4b38ba101b9b7 100644 ---- a/include/net/tcp.h -+++ b/include/net/tcp.h -@@ -2030,7 +2030,7 @@ void tcp_mark_skb_lost(struct sock *sk, struct sk_buff *skb); - void tcp_newreno_mark_lost(struct sock *sk, bool snd_una_advanced); - extern s32 tcp_rack_skb_timeout(struct tcp_sock *tp, struct sk_buff *skb, - u32 reo_wnd); --extern void tcp_rack_mark_lost(struct sock *sk); -+extern bool tcp_rack_mark_lost(struct sock *sk); - extern void tcp_rack_advance(struct tcp_sock *tp, u8 sacked, u32 end_seq, - u64 xmit_time); - extern void tcp_rack_reo_timeout(struct sock *sk); -diff --git a/include/uapi/linux/icmpv6.h b/include/uapi/linux/icmpv6.h -index 2622b5a3e6163..9a31ea2ad1cfc 100644 ---- a/include/uapi/linux/icmpv6.h -+++ b/include/uapi/linux/icmpv6.h -@@ -137,6 +137,7 @@ struct icmp6hdr { - #define ICMPV6_HDR_FIELD 0 - #define ICMPV6_UNK_NEXTHDR 1 - #define ICMPV6_UNK_OPTION 2 -+#define ICMPV6_HDR_INCOMP 3 - - /* - * constants for (set|get)sockopt -diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c -index 15d70a90b50dc..d65b0fc8fb48b 100644 ---- a/kernel/kexec_core.c -+++ b/kernel/kexec_core.c -@@ -1129,7 +1129,6 @@ int kernel_kexec(void) - - #ifdef CONFIG_KEXEC_JUMP - if (kexec_image->preserve_context) { -- lock_system_sleep(); - pm_prepare_console(); - error = freeze_processes(); - if (error) { -@@ -1192,7 +1191,6 @@ int kernel_kexec(void) - thaw_processes(); - Restore_console: - pm_restore_console(); -- unlock_system_sleep(); - } - #endif - -diff --git a/kernel/power/swap.c b/kernel/power/swap.c -index ca0fcb5ced714..0516c422206d8 100644 ---- a/kernel/power/swap.c -+++ b/kernel/power/swap.c -@@ -489,10 +489,10 @@ static int swap_writer_finish(struct swap_map_handle *handle, - unsigned int flags, int error) - { - if (!error) { -- flush_swap_writer(handle); - pr_info("S"); - error = mark_swapfiles(handle, flags); - pr_cont("|\n"); -+ flush_swap_writer(handle); - } - - if (error) -diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c -index 7411a43134629..26305aa88651f 100644 ---- a/net/ipv4/tcp_input.c -+++ b/net/ipv4/tcp_input.c -@@ -2764,7 +2764,8 @@ static void tcp_identify_packet_loss(struct sock *sk, int *ack_flag) - } else if (tcp_is_rack(sk)) { - u32 prior_retrans = tp->retrans_out; - -- tcp_rack_mark_lost(sk); -+ if (tcp_rack_mark_lost(sk)) -+ *ack_flag &= ~FLAG_SET_XMIT_TIMER; - if (prior_retrans > tp->retrans_out) - *ack_flag |= FLAG_LOST_RETRANS; - } -@@ -3713,9 +3714,6 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) - - if (tp->tlp_high_seq) - tcp_process_tlp_ack(sk, ack, flag); -- /* If needed, reset TLP/RTO timer; RACK may later override this. */ -- if (flag & FLAG_SET_XMIT_TIMER) -- tcp_set_xmit_timer(sk); - - if (tcp_ack_is_dubious(sk, flag)) { - if (!(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP))) { -@@ -3728,6 +3726,10 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) - &rexmit); - } - -+ /* If needed, reset TLP/RTO timer when RACK doesn't set. */ -+ if (flag & FLAG_SET_XMIT_TIMER) -+ tcp_set_xmit_timer(sk); -+ - if ((flag & FLAG_FORWARD_PROGRESS) || !(flag & FLAG_NOT_DUP)) - sk_dst_confirm(sk); - -diff --git a/net/ipv4/tcp_recovery.c b/net/ipv4/tcp_recovery.c -index fdb715bdd2d11..8757bb6cb1d93 100644 ---- a/net/ipv4/tcp_recovery.c -+++ b/net/ipv4/tcp_recovery.c -@@ -110,13 +110,13 @@ static void tcp_rack_detect_loss(struct sock *sk, u32 *reo_timeout) - } - } - --void tcp_rack_mark_lost(struct sock *sk) -+bool tcp_rack_mark_lost(struct sock *sk) - { - struct tcp_sock *tp = tcp_sk(sk); - u32 timeout; - - if (!tp->rack.advanced) -- return; -+ return false; - - /* Reset the advanced flag to avoid unnecessary queue scanning */ - tp->rack.advanced = 0; -@@ -126,6 +126,7 @@ void tcp_rack_mark_lost(struct sock *sk) - inet_csk_reset_xmit_timer(sk, ICSK_TIME_REO_TIMEOUT, - timeout, inet_csk(sk)->icsk_rto); - } -+ return !!timeout; - } - - /* Record the most recently (re)sent time among the (s)acked packets -diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c -index 7d3a3894f785c..e9bb89131e02a 100644 ---- a/net/ipv6/icmp.c -+++ b/net/ipv6/icmp.c -@@ -158,7 +158,13 @@ static bool is_ineligible(const struct sk_buff *skb) - tp = skb_header_pointer(skb, - ptr+offsetof(struct icmp6hdr, icmp6_type), - sizeof(_type), &_type); -- if (!tp || !(*tp & ICMPV6_INFOMSG_MASK)) -+ -+ /* Based on RFC 8200, Section 4.5 Fragment Header, return -+ * false if this is a fragment packet with no icmp header info. -+ */ -+ if (!tp && frag_off != 0) -+ return false; -+ else if (!tp || !(*tp & ICMPV6_INFOMSG_MASK)) - return true; - } - return false; -diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c -index 1f5d4d196dcce..c8cf1bbad74a2 100644 ---- a/net/ipv6/reassembly.c -+++ b/net/ipv6/reassembly.c -@@ -42,6 +42,8 @@ - #include - #include - #include -+#include -+#include - - #include - #include -@@ -322,7 +324,9 @@ static int ipv6_frag_rcv(struct sk_buff *skb) - struct frag_queue *fq; - const struct ipv6hdr *hdr = ipv6_hdr(skb); - struct net *net = dev_net(skb_dst(skb)->dev); -- int iif; -+ __be16 frag_off; -+ int iif, offset; -+ u8 nexthdr; - - if (IP6CB(skb)->flags & IP6SKB_FRAGMENTED) - goto fail_hdr; -@@ -351,6 +355,33 @@ static int ipv6_frag_rcv(struct sk_buff *skb) - return 1; - } - -+ /* RFC 8200, Section 4.5 Fragment Header: -+ * If the first fragment does not include all headers through an -+ * Upper-Layer header, then that fragment should be discarded and -+ * an ICMP Parameter Problem, Code 3, message should be sent to -+ * the source of the fragment, with the Pointer field set to zero. -+ */ -+ nexthdr = hdr->nexthdr; -+ offset = ipv6_skip_exthdr(skb, skb_transport_offset(skb), &nexthdr, &frag_off); -+ if (offset >= 0) { -+ /* Check some common protocols' header */ -+ if (nexthdr == IPPROTO_TCP) -+ offset += sizeof(struct tcphdr); -+ else if (nexthdr == IPPROTO_UDP) -+ offset += sizeof(struct udphdr); -+ else if (nexthdr == IPPROTO_ICMPV6) -+ offset += sizeof(struct icmp6hdr); -+ else -+ offset += 1; -+ -+ if (!(frag_off & htons(IP6_OFFSET)) && offset > skb->len) { -+ __IP6_INC_STATS(net, __in6_dev_get_safely(skb->dev), -+ IPSTATS_MIB_INHDRERRORS); -+ icmpv6_param_prob(skb, ICMPV6_HDR_INCOMP, 0); -+ return -1; -+ } -+ } -+ - iif = skb->dev ? skb->dev->ifindex : 0; - fq = fq_find(net, fhdr->identification, hdr, iif); - if (fq) { -diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h -index 05406e9c05b32..268f1d8f440ba 100644 ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -1061,6 +1061,7 @@ enum queue_stop_reason { - IEEE80211_QUEUE_STOP_REASON_FLUSH, - IEEE80211_QUEUE_STOP_REASON_TDLS_TEARDOWN, - IEEE80211_QUEUE_STOP_REASON_RESERVE_TID, -+ IEEE80211_QUEUE_STOP_REASON_IFTYPE_CHANGE, - - IEEE80211_QUEUE_STOP_REASONS, - }; -diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c -index af8b09214786d..6089b09ec13b6 100644 ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -1537,6 +1537,10 @@ static int ieee80211_runtime_change_iftype(struct ieee80211_sub_if_data *sdata, - if (ret) - return ret; - -+ ieee80211_stop_vif_queues(local, sdata, -+ IEEE80211_QUEUE_STOP_REASON_IFTYPE_CHANGE); -+ synchronize_net(); -+ - ieee80211_do_stop(sdata, false); - - ieee80211_teardown_sdata(sdata); -@@ -1557,6 +1561,8 @@ static int ieee80211_runtime_change_iftype(struct ieee80211_sub_if_data *sdata, - err = ieee80211_do_open(&sdata->wdev, false); - WARN(err, "type change: do_open returned %d", err); - -+ ieee80211_wake_vif_queues(local, sdata, -+ IEEE80211_QUEUE_STOP_REASON_IFTYPE_CHANGE); - return ret; - } - -diff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c -index 60236cc316d03..95415d2b81c93 100644 ---- a/net/netfilter/nft_dynset.c -+++ b/net/netfilter/nft_dynset.c -@@ -233,8 +233,10 @@ static int nft_dynset_init(const struct nft_ctx *ctx, - nft_set_ext_add_length(&priv->tmpl, NFT_SET_EXT_EXPR, - priv->expr->ops->size); - if (set->flags & NFT_SET_TIMEOUT) { -- if (timeout || set->timeout) -+ if (timeout || set->timeout) { -+ nft_set_ext_add(&priv->tmpl, NFT_SET_EXT_TIMEOUT); - nft_set_ext_add(&priv->tmpl, NFT_SET_EXT_EXPIRATION); -+ } - } - - priv->timeout = timeout; -diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c -index 4170acc2dc282..99b06a16b8086 100644 ---- a/net/nfc/netlink.c -+++ b/net/nfc/netlink.c -@@ -860,6 +860,7 @@ static int nfc_genl_stop_poll(struct sk_buff *skb, struct genl_info *info) - - if (!dev->polling) { - device_unlock(&dev->dev); -+ nfc_put_device(dev); - return -EINVAL; - } - -diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c -index b5c867fe32324..23d5e56306a4c 100644 ---- a/net/nfc/rawsock.c -+++ b/net/nfc/rawsock.c -@@ -105,7 +105,7 @@ static int rawsock_connect(struct socket *sock, struct sockaddr *_addr, - if (addr->target_idx > dev->target_next_idx - 1 || - addr->target_idx < dev->target_next_idx - dev->n_targets) { - rc = -EINVAL; -- goto error; -+ goto put_dev; - } - - rc = nfc_activate_target(dev, addr->target_idx, addr->nfc_protocol); -diff --git a/net/rxrpc/call_accept.c b/net/rxrpc/call_accept.c -index 032ed76c0166d..55fb3744552de 100644 ---- a/net/rxrpc/call_accept.c -+++ b/net/rxrpc/call_accept.c -@@ -207,6 +207,7 @@ void rxrpc_discard_prealloc(struct rxrpc_sock *rx) - tail = b->peer_backlog_tail; - while (CIRC_CNT(head, tail, size) > 0) { - struct rxrpc_peer *peer = b->peer_backlog[tail]; -+ rxrpc_put_local(peer->local); - kfree(peer); - tail = (tail + 1) & (size - 1); - } -diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c -index 69102fda9ebd4..76a80a41615be 100644 ---- a/net/wireless/wext-core.c -+++ b/net/wireless/wext-core.c -@@ -896,8 +896,9 @@ out: - int call_commit_handler(struct net_device *dev) - { - #ifdef CONFIG_WIRELESS_EXT -- if ((netif_running(dev)) && -- (dev->wireless_handlers->standard[0] != NULL)) -+ if (netif_running(dev) && -+ dev->wireless_handlers && -+ dev->wireless_handlers->standard[0]) - /* Call the commit handler on the driver */ - return dev->wireless_handlers->standard[0](dev, NULL, - NULL, NULL); -diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c -index 7a84745477919..e120df0a6da13 100644 ---- a/net/xfrm/xfrm_input.c -+++ b/net/xfrm/xfrm_input.c -@@ -656,7 +656,7 @@ resume: - /* only the first xfrm gets the encap type */ - encap_type = 0; - -- if (async && x->repl->recheck(x, skb, seq)) { -+ if (x->repl->recheck(x, skb, seq)) { - XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATESEQERROR); - goto drop_unlock; - } -diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c -index 2917711ff8ab6..32c8163427970 100644 ---- a/net/xfrm/xfrm_policy.c -+++ b/net/xfrm/xfrm_policy.c -@@ -790,15 +790,22 @@ static int xfrm_policy_addr_delta(const xfrm_address_t *a, - const xfrm_address_t *b, - u8 prefixlen, u16 family) - { -+ u32 ma, mb, mask; - unsigned int pdw, pbi; - int delta = 0; - - switch (family) { - case AF_INET: -- if (sizeof(long) == 4 && prefixlen == 0) -- return ntohl(a->a4) - ntohl(b->a4); -- return (ntohl(a->a4) & ((~0UL << (32 - prefixlen)))) - -- (ntohl(b->a4) & ((~0UL << (32 - prefixlen)))); -+ if (prefixlen == 0) -+ return 0; -+ mask = ~0U << (32 - prefixlen); -+ ma = ntohl(a->a4) & mask; -+ mb = ntohl(b->a4) & mask; -+ if (ma < mb) -+ delta = -1; -+ else if (ma > mb) -+ delta = 1; -+ break; - case AF_INET6: - pdw = prefixlen >> 5; - pbi = prefixlen & 0x1f; -@@ -809,10 +816,13 @@ static int xfrm_policy_addr_delta(const xfrm_address_t *a, - return delta; - } - if (pbi) { -- u32 mask = ~0u << (32 - pbi); -- -- delta = (ntohl(a->a6[pdw]) & mask) - -- (ntohl(b->a6[pdw]) & mask); -+ mask = ~0U << (32 - pbi); -+ ma = ntohl(a->a6[pdw]) & mask; -+ mb = ntohl(b->a6[pdw]) & mask; -+ if (ma < mb) -+ delta = -1; -+ else if (ma > mb) -+ delta = 1; - } - break; - default: -@@ -3065,8 +3075,8 @@ struct dst_entry *xfrm_lookup_with_ifid(struct net *net, - xflo.flags = flags; - - /* To accelerate a bit... */ -- if ((dst_orig->flags & DST_NOXFRM) || -- !net->xfrm.policy_count[XFRM_POLICY_OUT]) -+ if (!if_id && ((dst_orig->flags & DST_NOXFRM) || -+ !net->xfrm.policy_count[XFRM_POLICY_OUT])) - goto nopol; - - xdst = xfrm_bundle_lookup(net, fl, family, dir, &xflo, if_id); -diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c -index 8adbe45a54c11..f548bd48bf729 100644 ---- a/sound/pci/hda/patch_realtek.c -+++ b/sound/pci/hda/patch_realtek.c -@@ -7907,6 +7907,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { - SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), - SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), - SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), -+ SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE), - SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), - SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), - SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), -diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c -index 834367dd54e1b..a5c1a2c4eae4e 100644 ---- a/sound/pci/hda/patch_via.c -+++ b/sound/pci/hda/patch_via.c -@@ -1043,7 +1043,7 @@ static const struct hda_fixup via_fixups[] = { - static const struct snd_pci_quirk vt2002p_fixups[] = { - SND_PCI_QUIRK(0x1043, 0x1487, "Asus G75", VIA_FIXUP_ASUS_G75), - SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST), -- SND_PCI_QUIRK(0x1558, 0x3501, "Clevo W35xSS_370SS", VIA_FIXUP_POWER_SAVE), -+ SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", VIA_FIXUP_POWER_SAVE), - {} - }; - -diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c -index aa5833001fde5..2cb719893324a 100644 ---- a/sound/soc/intel/skylake/skl-topology.c -+++ b/sound/soc/intel/skylake/skl-topology.c -@@ -3619,15 +3619,16 @@ static void skl_tplg_complete(struct snd_soc_component *component) - - list_for_each_entry(dobj, &component->dobj_list, list) { - struct snd_kcontrol *kcontrol = dobj->control.kcontrol; -- struct soc_enum *se = -- (struct soc_enum *)kcontrol->private_value; -- char **texts = dobj->control.dtexts; -+ struct soc_enum *se; -+ char **texts; - char chan_text[4]; - -- if (dobj->type != SND_SOC_DOBJ_ENUM || -- dobj->control.kcontrol->put != -- skl_tplg_multi_config_set_dmic) -+ if (dobj->type != SND_SOC_DOBJ_ENUM || !kcontrol || -+ kcontrol->put != skl_tplg_multi_config_set_dmic) - continue; -+ -+ se = (struct soc_enum *)kcontrol->private_value; -+ texts = dobj->control.dtexts; - sprintf(chan_text, "c%d", mach->mach_params.dmic_num); - - for (i = 0; i < se->items; i++) { -diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c -index 0100f123484e6..c367609433bfc 100644 ---- a/sound/soc/soc-topology.c -+++ b/sound/soc/soc-topology.c -@@ -982,7 +982,7 @@ static int soc_tplg_denum_create_values(struct soc_enum *se, - return -EINVAL; - - se->dobj.control.dvalues = kzalloc(le32_to_cpu(ec->items) * -- sizeof(u32), -+ sizeof(*se->dobj.control.dvalues), - GFP_KERNEL); - if (!se->dobj.control.dvalues) - return -ENOMEM; -diff --git a/tools/testing/selftests/net/forwarding/router_mpath_nh.sh b/tools/testing/selftests/net/forwarding/router_mpath_nh.sh -index cf3d26c233e8e..7fcc42bc076fa 100755 ---- a/tools/testing/selftests/net/forwarding/router_mpath_nh.sh -+++ b/tools/testing/selftests/net/forwarding/router_mpath_nh.sh -@@ -197,7 +197,7 @@ multipath4_test() - t0_rp12=$(link_stats_tx_packets_get $rp12) - t0_rp13=$(link_stats_tx_packets_get $rp13) - -- ip vrf exec vrf-h1 $MZ -q -p 64 -A 192.0.2.2 -B 198.51.100.2 \ -+ ip vrf exec vrf-h1 $MZ $h1 -q -p 64 -A 192.0.2.2 -B 198.51.100.2 \ - -d 1msec -t udp "sp=1024,dp=0-32768" - - t1_rp12=$(link_stats_tx_packets_get $rp12) -diff --git a/tools/testing/selftests/net/forwarding/router_multipath.sh b/tools/testing/selftests/net/forwarding/router_multipath.sh -index 79a2099279621..464821c587a5e 100755 ---- a/tools/testing/selftests/net/forwarding/router_multipath.sh -+++ b/tools/testing/selftests/net/forwarding/router_multipath.sh -@@ -178,7 +178,7 @@ multipath4_test() - t0_rp12=$(link_stats_tx_packets_get $rp12) - t0_rp13=$(link_stats_tx_packets_get $rp13) - -- ip vrf exec vrf-h1 $MZ -q -p 64 -A 192.0.2.2 -B 198.51.100.2 \ -+ ip vrf exec vrf-h1 $MZ $h1 -q -p 64 -A 192.0.2.2 -B 198.51.100.2 \ - -d 1msec -t udp "sp=1024,dp=0-32768" - - t1_rp12=$(link_stats_tx_packets_get $rp12) -diff --git a/tools/testing/selftests/net/xfrm_policy.sh b/tools/testing/selftests/net/xfrm_policy.sh -index 7a1bf94c5bd38..bdf450eaf60cf 100755 ---- a/tools/testing/selftests/net/xfrm_policy.sh -+++ b/tools/testing/selftests/net/xfrm_policy.sh -@@ -202,7 +202,7 @@ check_xfrm() { - # 1: iptables -m policy rule count != 0 - rval=$1 - ip=$2 -- lret=0 -+ local lret=0 - - ip netns exec ns1 ping -q -c 1 10.0.2.$ip > /dev/null - -@@ -287,6 +287,47 @@ check_hthresh_repeat() - return 0 - } - -+# insert non-overlapping policies in a random order and check that -+# all of them can be fetched using the traffic selectors. -+check_random_order() -+{ -+ local ns=$1 -+ local log=$2 -+ -+ for i in $(seq 100); do -+ ip -net $ns xfrm policy flush -+ for j in $(seq 0 16 255 | sort -R); do -+ ip -net $ns xfrm policy add dst $j.0.0.0/24 dir out priority 10 action allow -+ done -+ for j in $(seq 0 16 255); do -+ if ! ip -net $ns xfrm policy get dst $j.0.0.0/24 dir out > /dev/null; then -+ echo "FAIL: $log" 1>&2 -+ return 1 -+ fi -+ done -+ done -+ -+ for i in $(seq 100); do -+ ip -net $ns xfrm policy flush -+ for j in $(seq 0 16 255 | sort -R); do -+ local addr=$(printf "e000:0000:%02x00::/56" $j) -+ ip -net $ns xfrm policy add dst $addr dir out priority 10 action allow -+ done -+ for j in $(seq 0 16 255); do -+ local addr=$(printf "e000:0000:%02x00::/56" $j) -+ if ! ip -net $ns xfrm policy get dst $addr dir out > /dev/null; then -+ echo "FAIL: $log" 1>&2 -+ return 1 -+ fi -+ done -+ done -+ -+ ip -net $ns xfrm policy flush -+ -+ echo "PASS: $log" -+ return 0 -+} -+ - #check for needed privileges - if [ "$(id -u)" -ne 0 ];then - echo "SKIP: Need root privileges" -@@ -438,6 +479,8 @@ check_exceptions "exceptions and block policies after htresh change to normal" - - check_hthresh_repeat "policies with repeated htresh change" - -+check_random_order ns3 "policies inserted in random order" -+ - for i in 1 2 3 4;do ip netns del ns$i;done - - exit $ret -diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c -index 8f3b40ec02b77..f25b5043cbcae 100644 ---- a/virt/kvm/kvm_main.c -+++ b/virt/kvm/kvm_main.c -@@ -1017,6 +1017,7 @@ int __kvm_set_memory_region(struct kvm *kvm, - /* We can read the guest memory with __xxx_user() later on. */ - if ((id < KVM_USER_MEM_SLOTS) && - ((mem->userspace_addr & (PAGE_SIZE - 1)) || -+ (mem->userspace_addr != untagged_addr(mem->userspace_addr)) || - !access_ok((void __user *)(unsigned long)mem->userspace_addr, - mem->memory_size))) - goto out; diff --git a/patch/kernel/odroidxu4-current/patch-5.4.95-96.patch b/patch/kernel/odroidxu4-current/patch-5.4.95-96.patch deleted file mode 100644 index 5e7c4fa590..0000000000 --- a/patch/kernel/odroidxu4-current/patch-5.4.95-96.patch +++ /dev/null @@ -1,1218 +0,0 @@ -diff --git a/Makefile b/Makefile -index aa3c2e834442e..7a47a2594f957 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - VERSION = 5 - PATCHLEVEL = 4 --SUBLEVEL = 95 -+SUBLEVEL = 96 - EXTRAVERSION = - NAME = Kleptomaniac Octopus - -diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h -index 51d867cf146c1..6c295a231882a 100644 ---- a/arch/arm64/include/asm/memory.h -+++ b/arch/arm64/include/asm/memory.h -@@ -247,11 +247,11 @@ static inline const void *__tag_set(const void *addr, u8 tag) - - - /* -- * The linear kernel range starts at the bottom of the virtual address -- * space. Testing the top bit for the start of the region is a -- * sufficient check and avoids having to worry about the tag. -+ * Check whether an arbitrary address is within the linear map, which -+ * lives in the [PAGE_OFFSET, PAGE_END) interval at the bottom of the -+ * kernel's TTBR1 address range. - */ --#define __is_lm_address(addr) (!(((u64)addr) & BIT(vabits_actual - 1))) -+#define __is_lm_address(addr) (((u64)(addr) ^ PAGE_OFFSET) < (PAGE_END - PAGE_OFFSET)) - - #define __lm_to_phys(addr) (((addr) & ~PAGE_OFFSET) + PHYS_OFFSET) - #define __kimg_to_phys(addr) ((addr) - kimage_voffset) -@@ -332,7 +332,7 @@ static inline void *phys_to_virt(phys_addr_t x) - #endif /* !CONFIG_SPARSEMEM_VMEMMAP || CONFIG_DEBUG_VIRTUAL */ - - #define virt_addr_valid(addr) ({ \ -- __typeof__(addr) __addr = addr; \ -+ __typeof__(addr) __addr = __tag_reset(addr); \ - __is_lm_address(__addr) && pfn_valid(virt_to_pfn(__addr)); \ - }) - -diff --git a/arch/arm64/mm/physaddr.c b/arch/arm64/mm/physaddr.c -index 67a9ba9eaa96b..cde44c13dda1b 100644 ---- a/arch/arm64/mm/physaddr.c -+++ b/arch/arm64/mm/physaddr.c -@@ -9,7 +9,7 @@ - - phys_addr_t __virt_to_phys(unsigned long x) - { -- WARN(!__is_lm_address(x), -+ WARN(!__is_lm_address(__tag_reset(x)), - "virt_to_phys used for non-linear address: %pK (%pS)\n", - (void *)x, - (void *)x); -diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h -index 86f20d520a079..b40d0295d8129 100644 ---- a/arch/x86/include/asm/msr.h -+++ b/arch/x86/include/asm/msr.h -@@ -88,7 +88,7 @@ static inline void do_trace_rdpmc(unsigned int msr, u64 val, int failed) {} - * think of extending them - you will be slapped with a stinking trout or a frozen - * shark will reach you, wherever you are! You've been warned. - */ --static inline unsigned long long notrace __rdmsr(unsigned int msr) -+static __always_inline unsigned long long __rdmsr(unsigned int msr) - { - DECLARE_ARGS(val, low, high); - -@@ -100,7 +100,7 @@ static inline unsigned long long notrace __rdmsr(unsigned int msr) - return EAX_EDX_VAL(val, low, high); - } - --static inline void notrace __wrmsr(unsigned int msr, u32 low, u32 high) -+static __always_inline void __wrmsr(unsigned int msr, u32 low, u32 high) - { - asm volatile("1: wrmsr\n" - "2:\n" -diff --git a/block/blk-core.c b/block/blk-core.c -index d2213220099d3..5808baa950c35 100644 ---- a/block/blk-core.c -+++ b/block/blk-core.c -@@ -886,11 +886,14 @@ generic_make_request_checks(struct bio *bio) - } - - /* -- * For a REQ_NOWAIT based request, return -EOPNOTSUPP -- * if queue is not a request based queue. -+ * Non-mq queues do not honor REQ_NOWAIT, so complete a bio -+ * with BLK_STS_AGAIN status in order to catch -EAGAIN and -+ * to give a chance to the caller to repeat request gracefully. - */ -- if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q)) -- goto not_supported; -+ if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q)) { -+ status = BLK_STS_AGAIN; -+ goto end_io; -+ } - - if (should_fail_bio(bio)) - goto end_io; -diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c -index d831a61e0010e..383c7029d3cee 100644 ---- a/drivers/acpi/thermal.c -+++ b/drivers/acpi/thermal.c -@@ -174,6 +174,8 @@ struct acpi_thermal { - int tz_enabled; - int kelvin_offset; - struct work_struct thermal_check_work; -+ struct mutex thermal_check_lock; -+ refcount_t thermal_check_count; - }; - - /* -------------------------------------------------------------------------- -@@ -494,17 +496,6 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) - return 0; - } - --static void acpi_thermal_check(void *data) --{ -- struct acpi_thermal *tz = data; -- -- if (!tz->tz_enabled) -- return; -- -- thermal_zone_device_update(tz->thermal_zone, -- THERMAL_EVENT_UNSPECIFIED); --} -- - /* sys I/F for generic thermal sysfs support */ - - static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp) -@@ -538,6 +529,8 @@ static int thermal_get_mode(struct thermal_zone_device *thermal, - return 0; - } - -+static void acpi_thermal_check_fn(struct work_struct *work); -+ - static int thermal_set_mode(struct thermal_zone_device *thermal, - enum thermal_device_mode mode) - { -@@ -563,7 +556,7 @@ static int thermal_set_mode(struct thermal_zone_device *thermal, - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "%s kernel ACPI thermal control\n", - tz->tz_enabled ? "Enable" : "Disable")); -- acpi_thermal_check(tz); -+ acpi_thermal_check_fn(&tz->thermal_check_work); - } - return 0; - } -@@ -932,6 +925,12 @@ static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz) - Driver Interface - -------------------------------------------------------------------------- */ - -+static void acpi_queue_thermal_check(struct acpi_thermal *tz) -+{ -+ if (!work_pending(&tz->thermal_check_work)) -+ queue_work(acpi_thermal_pm_queue, &tz->thermal_check_work); -+} -+ - static void acpi_thermal_notify(struct acpi_device *device, u32 event) - { - struct acpi_thermal *tz = acpi_driver_data(device); -@@ -942,17 +941,17 @@ static void acpi_thermal_notify(struct acpi_device *device, u32 event) - - switch (event) { - case ACPI_THERMAL_NOTIFY_TEMPERATURE: -- acpi_thermal_check(tz); -+ acpi_queue_thermal_check(tz); - break; - case ACPI_THERMAL_NOTIFY_THRESHOLDS: - acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_THRESHOLDS); -- acpi_thermal_check(tz); -+ acpi_queue_thermal_check(tz); - acpi_bus_generate_netlink_event(device->pnp.device_class, - dev_name(&device->dev), event, 0); - break; - case ACPI_THERMAL_NOTIFY_DEVICES: - acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_DEVICES); -- acpi_thermal_check(tz); -+ acpi_queue_thermal_check(tz); - acpi_bus_generate_netlink_event(device->pnp.device_class, - dev_name(&device->dev), event, 0); - break; -@@ -1052,7 +1051,27 @@ static void acpi_thermal_check_fn(struct work_struct *work) - { - struct acpi_thermal *tz = container_of(work, struct acpi_thermal, - thermal_check_work); -- acpi_thermal_check(tz); -+ -+ if (!tz->tz_enabled) -+ return; -+ /* -+ * In general, it is not sufficient to check the pending bit, because -+ * subsequent instances of this function may be queued after one of them -+ * has started running (e.g. if _TMP sleeps). Avoid bailing out if just -+ * one of them is running, though, because it may have done the actual -+ * check some time ago, so allow at least one of them to block on the -+ * mutex while another one is running the update. -+ */ -+ if (!refcount_dec_not_one(&tz->thermal_check_count)) -+ return; -+ -+ mutex_lock(&tz->thermal_check_lock); -+ -+ thermal_zone_device_update(tz->thermal_zone, THERMAL_EVENT_UNSPECIFIED); -+ -+ refcount_inc(&tz->thermal_check_count); -+ -+ mutex_unlock(&tz->thermal_check_lock); - } - - static int acpi_thermal_add(struct acpi_device *device) -@@ -1084,6 +1103,8 @@ static int acpi_thermal_add(struct acpi_device *device) - if (result) - goto free_memory; - -+ refcount_set(&tz->thermal_check_count, 3); -+ mutex_init(&tz->thermal_check_lock); - INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn); - - pr_info(PREFIX "%s [%s] (%ld C)\n", acpi_device_name(device), -@@ -1149,7 +1170,7 @@ static int acpi_thermal_resume(struct device *dev) - tz->state.active |= tz->trips.active[i].flags.enabled; - } - -- queue_work(acpi_thermal_pm_queue, &tz->thermal_check_work); -+ acpi_queue_thermal_check(tz); - - return AE_OK; - } -diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c -index 959eb075d11ed..c18f39271b034 100644 ---- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c -+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c -@@ -1914,6 +1914,9 @@ static bool decide_dp_link_settings(struct dc_link *link, struct dc_link_setting - initial_link_setting; - uint32_t link_bw; - -+ if (req_bw > dc_link_bandwidth_kbps(link, &link->verified_link_cap)) -+ return false; -+ - /* search for the minimum link setting that: - * 1. is supported according to the link training result - * 2. could support the b/w requested by the timing -diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c -index bb7add5ea2273..a6d5beada6634 100644 ---- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c -+++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c -@@ -257,7 +257,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn2_1_soc = { - .num_banks = 8, - .num_chans = 4, - .vmm_page_size_bytes = 4096, -- .dram_clock_change_latency_us = 23.84, -+ .dram_clock_change_latency_us = 11.72, - .return_bus_width_bytes = 64, - .dispclk_dppclk_vco_speed_mhz = 3600, - .xfc_bus_transport_time_us = 4, -diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c -index b16aea0e39992..6dd29bad1609f 100644 ---- a/drivers/net/dsa/bcm_sf2.c -+++ b/drivers/net/dsa/bcm_sf2.c -@@ -421,15 +421,19 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds) - /* Find our integrated MDIO bus node */ - dn = of_find_compatible_node(NULL, NULL, "brcm,unimac-mdio"); - priv->master_mii_bus = of_mdio_find_bus(dn); -- if (!priv->master_mii_bus) -+ if (!priv->master_mii_bus) { -+ of_node_put(dn); - return -EPROBE_DEFER; -+ } - - get_device(&priv->master_mii_bus->dev); - priv->master_mii_dn = dn; - - priv->slave_mii_bus = devm_mdiobus_alloc(ds->dev); -- if (!priv->slave_mii_bus) -+ if (!priv->slave_mii_bus) { -+ of_node_put(dn); - return -ENOMEM; -+ } - - priv->slave_mii_bus->priv = priv; - priv->slave_mii_bus->name = "sf2 slave mii"; -diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c -index 9040340fad198..c3079f436f6d7 100644 ---- a/drivers/net/ethernet/ibm/ibmvnic.c -+++ b/drivers/net/ethernet/ibm/ibmvnic.c -@@ -4752,6 +4752,12 @@ static void ibmvnic_tasklet(void *data) - while (!done) { - /* Pull all the valid messages off the CRQ */ - while ((crq = ibmvnic_next_crq(adapter)) != NULL) { -+ /* This barrier makes sure ibmvnic_next_crq()'s -+ * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded -+ * before ibmvnic_handle_crq()'s -+ * switch(gen_crq->first) and switch(gen_crq->cmd). -+ */ -+ dma_rmb(); - ibmvnic_handle_crq(crq, adapter); - crq->generic.first = 0; - } -diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c -index 7a964271959d8..c2cabd77884bf 100644 ---- a/drivers/nvme/host/core.c -+++ b/drivers/nvme/host/core.c -@@ -1295,8 +1295,21 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio) - } - - length = (io.nblocks + 1) << ns->lba_shift; -- meta_len = (io.nblocks + 1) * ns->ms; -- metadata = nvme_to_user_ptr(io.metadata); -+ -+ if ((io.control & NVME_RW_PRINFO_PRACT) && -+ ns->ms == sizeof(struct t10_pi_tuple)) { -+ /* -+ * Protection information is stripped/inserted by the -+ * controller. -+ */ -+ if (nvme_to_user_ptr(io.metadata)) -+ return -EINVAL; -+ meta_len = 0; -+ metadata = NULL; -+ } else { -+ meta_len = (io.nblocks + 1) * ns->ms; -+ metadata = nvme_to_user_ptr(io.metadata); -+ } - - if (ns->ext) { - length += meta_len; -diff --git a/drivers/phy/motorola/phy-cpcap-usb.c b/drivers/phy/motorola/phy-cpcap-usb.c -index 5baf64dfb24de..1bebad36bf2e5 100644 ---- a/drivers/phy/motorola/phy-cpcap-usb.c -+++ b/drivers/phy/motorola/phy-cpcap-usb.c -@@ -625,35 +625,42 @@ static int cpcap_usb_phy_probe(struct platform_device *pdev) - generic_phy = devm_phy_create(ddata->dev, NULL, &ops); - if (IS_ERR(generic_phy)) { - error = PTR_ERR(generic_phy); -- return PTR_ERR(generic_phy); -+ goto out_reg_disable; - } - - phy_set_drvdata(generic_phy, ddata); - - phy_provider = devm_of_phy_provider_register(ddata->dev, - of_phy_simple_xlate); -- if (IS_ERR(phy_provider)) -- return PTR_ERR(phy_provider); -+ if (IS_ERR(phy_provider)) { -+ error = PTR_ERR(phy_provider); -+ goto out_reg_disable; -+ } - - error = cpcap_usb_init_optional_pins(ddata); - if (error) -- return error; -+ goto out_reg_disable; - - cpcap_usb_init_optional_gpios(ddata); - - error = cpcap_usb_init_iio(ddata); - if (error) -- return error; -+ goto out_reg_disable; - - error = cpcap_usb_init_interrupts(pdev, ddata); - if (error) -- return error; -+ goto out_reg_disable; - - usb_add_phy_dev(&ddata->phy); - atomic_set(&ddata->active, 1); - schedule_delayed_work(&ddata->detect_work, msecs_to_jiffies(1)); - - return 0; -+ -+out_reg_disable: -+ regulator_disable(ddata->vusb); -+ -+ return error; - } - - static int cpcap_usb_phy_remove(struct platform_device *pdev) -diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c -index 37035dca469cf..d4fc2cbf78703 100644 ---- a/drivers/platform/x86/intel-vbtn.c -+++ b/drivers/platform/x86/intel-vbtn.c -@@ -203,6 +203,12 @@ static const struct dmi_system_id dmi_switches_allow_list[] = { - DMI_MATCH(DMI_PRODUCT_NAME, "Switch SA5-271"), - }, - }, -+ { -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), -+ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7352"), -+ }, -+ }, - {} /* Array terminator */ - }; - -diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c -index 1e072dbba30d6..7ed1189a7200c 100644 ---- a/drivers/platform/x86/touchscreen_dmi.c -+++ b/drivers/platform/x86/touchscreen_dmi.c -@@ -231,6 +231,16 @@ static const struct ts_dmi_data digma_citi_e200_data = { - .properties = digma_citi_e200_props, - }; - -+static const struct property_entry estar_beauty_hd_props[] = { -+ PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), -+ { } -+}; -+ -+static const struct ts_dmi_data estar_beauty_hd_data = { -+ .acpi_name = "GDIX1001:00", -+ .properties = estar_beauty_hd_props, -+}; -+ - static const struct property_entry gp_electronic_t701_props[] = { - PROPERTY_ENTRY_U32("touchscreen-size-x", 960), - PROPERTY_ENTRY_U32("touchscreen-size-y", 640), -@@ -747,6 +757,14 @@ static const struct dmi_system_id touchscreen_dmi_table[] = { - DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"), - }, - }, -+ { -+ /* Estar Beauty HD (MID 7316R) */ -+ .driver_data = (void *)&estar_beauty_hd_data, -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "Estar"), -+ DMI_MATCH(DMI_PRODUCT_NAME, "eSTAR BEAUTY HD Intel Quad core"), -+ }, -+ }, - { - /* GP-electronic T701 */ - .driver_data = (void *)&gp_electronic_t701_data, -diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c -index 522636e946282..c8bf8c7ada6a7 100644 ---- a/drivers/scsi/fnic/vnic_dev.c -+++ b/drivers/scsi/fnic/vnic_dev.c -@@ -444,7 +444,8 @@ int vnic_dev_init_devcmd2(struct vnic_dev *vdev) - fetch_index = ioread32(&vdev->devcmd2->wq.ctrl->fetch_index); - if (fetch_index == 0xFFFFFFFF) { /* check for hardware gone */ - pr_err("error in devcmd2 init"); -- return -ENODEV; -+ err = -ENODEV; -+ goto err_free_wq; - } - - /* -@@ -460,7 +461,7 @@ int vnic_dev_init_devcmd2(struct vnic_dev *vdev) - err = vnic_dev_alloc_desc_ring(vdev, &vdev->devcmd2->results_ring, - DEVCMD2_RING_SIZE, DEVCMD2_DESC_SIZE); - if (err) -- goto err_free_wq; -+ goto err_disable_wq; - - vdev->devcmd2->result = - (struct devcmd2_result *) vdev->devcmd2->results_ring.descs; -@@ -481,8 +482,9 @@ int vnic_dev_init_devcmd2(struct vnic_dev *vdev) - - err_free_desc_ring: - vnic_dev_free_desc_ring(vdev, &vdev->devcmd2->results_ring); --err_free_wq: -+err_disable_wq: - vnic_wq_disable(&vdev->devcmd2->wq); -+err_free_wq: - vnic_wq_free(&vdev->devcmd2->wq); - err_free_devcmd2: - kfree(vdev->devcmd2); -diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c -index 8a76284b59b08..523809a8a2323 100644 ---- a/drivers/scsi/ibmvscsi/ibmvfc.c -+++ b/drivers/scsi/ibmvscsi/ibmvfc.c -@@ -2881,8 +2881,10 @@ static int ibmvfc_slave_configure(struct scsi_device *sdev) - unsigned long flags = 0; - - spin_lock_irqsave(shost->host_lock, flags); -- if (sdev->type == TYPE_DISK) -+ if (sdev->type == TYPE_DISK) { - sdev->allow_restart = 1; -+ blk_queue_rq_timeout(sdev->request_queue, 120 * HZ); -+ } - spin_unlock_irqrestore(shost->host_lock, flags); - return 0; - } -diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c -index 52e8666598531..e5b18e5d46dac 100644 ---- a/drivers/scsi/libfc/fc_exch.c -+++ b/drivers/scsi/libfc/fc_exch.c -@@ -1619,8 +1619,13 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) - rc = fc_exch_done_locked(ep); - WARN_ON(fc_seq_exch(sp) != ep); - spin_unlock_bh(&ep->ex_lock); -- if (!rc) -+ if (!rc) { - fc_exch_delete(ep); -+ } else { -+ FC_EXCH_DBG(ep, "ep is completed already," -+ "hence skip calling the resp\n"); -+ goto skip_resp; -+ } - } - - /* -@@ -1639,6 +1644,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) - if (!fc_invoke_resp(ep, sp, fp)) - fc_frame_free(fp); - -+skip_resp: - fc_exch_release(ep); - return; - rel: -@@ -1895,10 +1901,16 @@ static void fc_exch_reset(struct fc_exch *ep) - - fc_exch_hold(ep); - -- if (!rc) -+ if (!rc) { - fc_exch_delete(ep); -+ } else { -+ FC_EXCH_DBG(ep, "ep is completed already," -+ "hence skip calling the resp\n"); -+ goto skip_resp; -+ } - - fc_invoke_resp(ep, sp, ERR_PTR(-FC_EX_CLOSED)); -+skip_resp: - fc_seq_set_resp(sp, NULL, ep->arg); - fc_exch_release(ep); - } -diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c -index d4d1104fac991..8cd0a87764dfd 100644 ---- a/drivers/scsi/scsi_transport_srp.c -+++ b/drivers/scsi/scsi_transport_srp.c -@@ -541,7 +541,14 @@ int srp_reconnect_rport(struct srp_rport *rport) - res = mutex_lock_interruptible(&rport->mutex); - if (res) - goto out; -- scsi_target_block(&shost->shost_gendev); -+ if (rport->state != SRP_RPORT_FAIL_FAST) -+ /* -+ * sdev state must be SDEV_TRANSPORT_OFFLINE, transition -+ * to SDEV_BLOCK is illegal. Calling scsi_target_unblock() -+ * later is ok though, scsi_internal_device_unblock_nowait() -+ * treats SDEV_TRANSPORT_OFFLINE like SDEV_BLOCK. -+ */ -+ scsi_target_block(&shost->shost_gendev); - res = rport->state != SRP_RPORT_LOST ? i->f->reconnect(rport) : -ENODEV; - pr_debug("%s (state %d): transport.reconnect() returned %d\n", - dev_name(&shost->shost_gendev), rport->state, res); -diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c -index 86e280edf8040..7f644a58db511 100644 ---- a/fs/btrfs/backref.c -+++ b/fs/btrfs/backref.c -@@ -347,33 +347,10 @@ static int add_prelim_ref(const struct btrfs_fs_info *fs_info, - return -ENOMEM; - - ref->root_id = root_id; -- if (key) { -+ if (key) - ref->key_for_search = *key; -- /* -- * We can often find data backrefs with an offset that is too -- * large (>= LLONG_MAX, maximum allowed file offset) due to -- * underflows when subtracting a file's offset with the data -- * offset of its corresponding extent data item. This can -- * happen for example in the clone ioctl. -- * So if we detect such case we set the search key's offset to -- * zero to make sure we will find the matching file extent item -- * at add_all_parents(), otherwise we will miss it because the -- * offset taken form the backref is much larger then the offset -- * of the file extent item. This can make us scan a very large -- * number of file extent items, but at least it will not make -- * us miss any. -- * This is an ugly workaround for a behaviour that should have -- * never existed, but it does and a fix for the clone ioctl -- * would touch a lot of places, cause backwards incompatibility -- * and would not fix the problem for extents cloned with older -- * kernels. -- */ -- if (ref->key_for_search.type == BTRFS_EXTENT_DATA_KEY && -- ref->key_for_search.offset >= LLONG_MAX) -- ref->key_for_search.offset = 0; -- } else { -+ else - memset(&ref->key_for_search, 0, sizeof(ref->key_for_search)); -- } - - ref->inode_list = NULL; - ref->level = level; -@@ -409,10 +386,36 @@ static int add_indirect_ref(const struct btrfs_fs_info *fs_info, - wanted_disk_byte, count, sc, gfp_mask); - } - -+static int is_shared_data_backref(struct preftrees *preftrees, u64 bytenr) -+{ -+ struct rb_node **p = &preftrees->direct.root.rb_root.rb_node; -+ struct rb_node *parent = NULL; -+ struct prelim_ref *ref = NULL; -+ struct prelim_ref target = {0}; -+ int result; -+ -+ target.parent = bytenr; -+ -+ while (*p) { -+ parent = *p; -+ ref = rb_entry(parent, struct prelim_ref, rbnode); -+ result = prelim_ref_compare(ref, &target); -+ -+ if (result < 0) -+ p = &(*p)->rb_left; -+ else if (result > 0) -+ p = &(*p)->rb_right; -+ else -+ return 1; -+ } -+ return 0; -+} -+ - static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path, -- struct ulist *parents, struct prelim_ref *ref, -+ struct ulist *parents, -+ struct preftrees *preftrees, struct prelim_ref *ref, - int level, u64 time_seq, const u64 *extent_item_pos, -- u64 total_refs, bool ignore_offset) -+ bool ignore_offset) - { - int ret = 0; - int slot; -@@ -424,6 +427,7 @@ static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path, - u64 disk_byte; - u64 wanted_disk_byte = ref->wanted_disk_byte; - u64 count = 0; -+ u64 data_offset; - - if (level != 0) { - eb = path->nodes[level]; -@@ -434,18 +438,26 @@ static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path, - } - - /* -- * We normally enter this function with the path already pointing to -- * the first item to check. But sometimes, we may enter it with -- * slot==nritems. In that case, go to the next leaf before we continue. -+ * 1. We normally enter this function with the path already pointing to -+ * the first item to check. But sometimes, we may enter it with -+ * slot == nritems. -+ * 2. We are searching for normal backref but bytenr of this leaf -+ * matches shared data backref -+ * 3. The leaf owner is not equal to the root we are searching -+ * -+ * For these cases, go to the next leaf before we continue. - */ -- if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) { -+ eb = path->nodes[0]; -+ if (path->slots[0] >= btrfs_header_nritems(eb) || -+ is_shared_data_backref(preftrees, eb->start) || -+ ref->root_id != btrfs_header_owner(eb)) { - if (time_seq == SEQ_LAST) - ret = btrfs_next_leaf(root, path); - else - ret = btrfs_next_old_leaf(root, path, time_seq); - } - -- while (!ret && count < total_refs) { -+ while (!ret && count < ref->count) { - eb = path->nodes[0]; - slot = path->slots[0]; - -@@ -455,13 +467,31 @@ static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path, - key.type != BTRFS_EXTENT_DATA_KEY) - break; - -+ /* -+ * We are searching for normal backref but bytenr of this leaf -+ * matches shared data backref, OR -+ * the leaf owner is not equal to the root we are searching for -+ */ -+ if (slot == 0 && -+ (is_shared_data_backref(preftrees, eb->start) || -+ ref->root_id != btrfs_header_owner(eb))) { -+ if (time_seq == SEQ_LAST) -+ ret = btrfs_next_leaf(root, path); -+ else -+ ret = btrfs_next_old_leaf(root, path, time_seq); -+ continue; -+ } - fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item); - disk_byte = btrfs_file_extent_disk_bytenr(eb, fi); -+ data_offset = btrfs_file_extent_offset(eb, fi); - - if (disk_byte == wanted_disk_byte) { - eie = NULL; - old = NULL; -- count++; -+ if (ref->key_for_search.offset == key.offset - data_offset) -+ count++; -+ else -+ goto next; - if (extent_item_pos) { - ret = check_extent_in_eb(&key, eb, fi, - *extent_item_pos, -@@ -502,9 +532,9 @@ next: - */ - static int resolve_indirect_ref(struct btrfs_fs_info *fs_info, - struct btrfs_path *path, u64 time_seq, -+ struct preftrees *preftrees, - struct prelim_ref *ref, struct ulist *parents, -- const u64 *extent_item_pos, u64 total_refs, -- bool ignore_offset) -+ const u64 *extent_item_pos, bool ignore_offset) - { - struct btrfs_root *root; - struct btrfs_key root_key; -@@ -513,6 +543,7 @@ static int resolve_indirect_ref(struct btrfs_fs_info *fs_info, - int root_level; - int level = ref->level; - int index; -+ struct btrfs_key search_key = ref->key_for_search; - - root_key.objectid = ref->root_id; - root_key.type = BTRFS_ROOT_ITEM_KEY; -@@ -545,13 +576,33 @@ static int resolve_indirect_ref(struct btrfs_fs_info *fs_info, - goto out; - } - -+ /* -+ * We can often find data backrefs with an offset that is too large -+ * (>= LLONG_MAX, maximum allowed file offset) due to underflows when -+ * subtracting a file's offset with the data offset of its -+ * corresponding extent data item. This can happen for example in the -+ * clone ioctl. -+ * -+ * So if we detect such case we set the search key's offset to zero to -+ * make sure we will find the matching file extent item at -+ * add_all_parents(), otherwise we will miss it because the offset -+ * taken form the backref is much larger then the offset of the file -+ * extent item. This can make us scan a very large number of file -+ * extent items, but at least it will not make us miss any. -+ * -+ * This is an ugly workaround for a behaviour that should have never -+ * existed, but it does and a fix for the clone ioctl would touch a lot -+ * of places, cause backwards incompatibility and would not fix the -+ * problem for extents cloned with older kernels. -+ */ -+ if (search_key.type == BTRFS_EXTENT_DATA_KEY && -+ search_key.offset >= LLONG_MAX) -+ search_key.offset = 0; - path->lowest_level = level; - if (time_seq == SEQ_LAST) -- ret = btrfs_search_slot(NULL, root, &ref->key_for_search, path, -- 0, 0); -+ ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); - else -- ret = btrfs_search_old_slot(root, &ref->key_for_search, path, -- time_seq); -+ ret = btrfs_search_old_slot(root, &search_key, path, time_seq); - - /* root node has been locked, we can release @subvol_srcu safely here */ - srcu_read_unlock(&fs_info->subvol_srcu, index); -@@ -574,8 +625,8 @@ static int resolve_indirect_ref(struct btrfs_fs_info *fs_info, - eb = path->nodes[level]; - } - -- ret = add_all_parents(root, path, parents, ref, level, time_seq, -- extent_item_pos, total_refs, ignore_offset); -+ ret = add_all_parents(root, path, parents, preftrees, ref, level, -+ time_seq, extent_item_pos, ignore_offset); - out: - path->lowest_level = 0; - btrfs_release_path(path); -@@ -609,7 +660,7 @@ unode_aux_to_inode_list(struct ulist_node *node) - static int resolve_indirect_refs(struct btrfs_fs_info *fs_info, - struct btrfs_path *path, u64 time_seq, - struct preftrees *preftrees, -- const u64 *extent_item_pos, u64 total_refs, -+ const u64 *extent_item_pos, - struct share_check *sc, bool ignore_offset) - { - int err; -@@ -653,9 +704,9 @@ static int resolve_indirect_refs(struct btrfs_fs_info *fs_info, - ret = BACKREF_FOUND_SHARED; - goto out; - } -- err = resolve_indirect_ref(fs_info, path, time_seq, ref, -- parents, extent_item_pos, -- total_refs, ignore_offset); -+ err = resolve_indirect_ref(fs_info, path, time_seq, preftrees, -+ ref, parents, extent_item_pos, -+ ignore_offset); - /* - * we can only tolerate ENOENT,otherwise,we should catch error - * and return directly. -@@ -758,8 +809,7 @@ static int add_missing_keys(struct btrfs_fs_info *fs_info, - */ - static int add_delayed_refs(const struct btrfs_fs_info *fs_info, - struct btrfs_delayed_ref_head *head, u64 seq, -- struct preftrees *preftrees, u64 *total_refs, -- struct share_check *sc) -+ struct preftrees *preftrees, struct share_check *sc) - { - struct btrfs_delayed_ref_node *node; - struct btrfs_delayed_extent_op *extent_op = head->extent_op; -@@ -793,7 +843,6 @@ static int add_delayed_refs(const struct btrfs_fs_info *fs_info, - default: - BUG(); - } -- *total_refs += count; - switch (node->type) { - case BTRFS_TREE_BLOCK_REF_KEY: { - /* NORMAL INDIRECT METADATA backref */ -@@ -876,7 +925,7 @@ out: - static int add_inline_refs(const struct btrfs_fs_info *fs_info, - struct btrfs_path *path, u64 bytenr, - int *info_level, struct preftrees *preftrees, -- u64 *total_refs, struct share_check *sc) -+ struct share_check *sc) - { - int ret = 0; - int slot; -@@ -900,7 +949,6 @@ static int add_inline_refs(const struct btrfs_fs_info *fs_info, - - ei = btrfs_item_ptr(leaf, slot, struct btrfs_extent_item); - flags = btrfs_extent_flags(leaf, ei); -- *total_refs += btrfs_extent_refs(leaf, ei); - btrfs_item_key_to_cpu(leaf, &found_key, slot); - - ptr = (unsigned long)(ei + 1); -@@ -1125,8 +1173,6 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans, - struct prelim_ref *ref; - struct rb_node *node; - struct extent_inode_elem *eie = NULL; -- /* total of both direct AND indirect refs! */ -- u64 total_refs = 0; - struct preftrees preftrees = { - .direct = PREFTREE_INIT, - .indirect = PREFTREE_INIT, -@@ -1195,7 +1241,7 @@ again: - } - spin_unlock(&delayed_refs->lock); - ret = add_delayed_refs(fs_info, head, time_seq, -- &preftrees, &total_refs, sc); -+ &preftrees, sc); - mutex_unlock(&head->mutex); - if (ret) - goto out; -@@ -1216,8 +1262,7 @@ again: - (key.type == BTRFS_EXTENT_ITEM_KEY || - key.type == BTRFS_METADATA_ITEM_KEY)) { - ret = add_inline_refs(fs_info, path, bytenr, -- &info_level, &preftrees, -- &total_refs, sc); -+ &info_level, &preftrees, sc); - if (ret) - goto out; - ret = add_keyed_refs(fs_info, path, bytenr, info_level, -@@ -1236,7 +1281,7 @@ again: - WARN_ON(!RB_EMPTY_ROOT(&preftrees.indirect_missing_keys.root.rb_root)); - - ret = resolve_indirect_refs(fs_info, path, time_seq, &preftrees, -- extent_item_pos, total_refs, sc, ignore_offset); -+ extent_item_pos, sc, ignore_offset); - if (ret) - goto out; - -diff --git a/fs/udf/super.c b/fs/udf/super.c -index 4aba4878ed967..8bb001c7927f0 100644 ---- a/fs/udf/super.c -+++ b/fs/udf/super.c -@@ -705,6 +705,7 @@ static int udf_check_vsd(struct super_block *sb) - struct buffer_head *bh = NULL; - int nsr = 0; - struct udf_sb_info *sbi; -+ loff_t session_offset; - - sbi = UDF_SB(sb); - if (sb->s_blocksize < sizeof(struct volStructDesc)) -@@ -712,7 +713,8 @@ static int udf_check_vsd(struct super_block *sb) - else - sectorsize = sb->s_blocksize; - -- sector += (((loff_t)sbi->s_session) << sb->s_blocksize_bits); -+ session_offset = (loff_t)sbi->s_session << sb->s_blocksize_bits; -+ sector += session_offset; - - udf_debug("Starting at sector %u (%lu byte sectors)\n", - (unsigned int)(sector >> sb->s_blocksize_bits), -@@ -757,8 +759,7 @@ static int udf_check_vsd(struct super_block *sb) - - if (nsr > 0) - return 1; -- else if (!bh && sector - (sbi->s_session << sb->s_blocksize_bits) == -- VSD_FIRST_SECTOR_OFFSET) -+ else if (!bh && sector - session_offset == VSD_FIRST_SECTOR_OFFSET) - return -1; - else - return 0; -diff --git a/include/linux/kthread.h b/include/linux/kthread.h -index 0f9da966934e2..c7108ce5a051c 100644 ---- a/include/linux/kthread.h -+++ b/include/linux/kthread.h -@@ -31,6 +31,9 @@ struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data), - unsigned int cpu, - const char *namefmt); - -+void kthread_set_per_cpu(struct task_struct *k, int cpu); -+bool kthread_is_per_cpu(struct task_struct *k); -+ - /** - * kthread_run - create and wake a thread. - * @threadfn: the function to run until signal_pending(current). -diff --git a/include/net/tcp.h b/include/net/tcp.h -index 4b38ba101b9b7..37b51456784f8 100644 ---- a/include/net/tcp.h -+++ b/include/net/tcp.h -@@ -619,6 +619,7 @@ static inline void tcp_clear_xmit_timers(struct sock *sk) - - unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu); - unsigned int tcp_current_mss(struct sock *sk); -+u32 tcp_clamp_probe0_to_user_timeout(const struct sock *sk, u32 when); - - /* Bound MSS / TSO packet size with the half of the window */ - static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) -diff --git a/kernel/kthread.c b/kernel/kthread.c -index e51f0006057df..1d4c98a19043f 100644 ---- a/kernel/kthread.c -+++ b/kernel/kthread.c -@@ -469,11 +469,36 @@ struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data), - return p; - kthread_bind(p, cpu); - /* CPU hotplug need to bind once again when unparking the thread. */ -- set_bit(KTHREAD_IS_PER_CPU, &to_kthread(p)->flags); - to_kthread(p)->cpu = cpu; - return p; - } - -+void kthread_set_per_cpu(struct task_struct *k, int cpu) -+{ -+ struct kthread *kthread = to_kthread(k); -+ if (!kthread) -+ return; -+ -+ WARN_ON_ONCE(!(k->flags & PF_NO_SETAFFINITY)); -+ -+ if (cpu < 0) { -+ clear_bit(KTHREAD_IS_PER_CPU, &kthread->flags); -+ return; -+ } -+ -+ kthread->cpu = cpu; -+ set_bit(KTHREAD_IS_PER_CPU, &kthread->flags); -+} -+ -+bool kthread_is_per_cpu(struct task_struct *k) -+{ -+ struct kthread *kthread = to_kthread(k); -+ if (!kthread) -+ return false; -+ -+ return test_bit(KTHREAD_IS_PER_CPU, &kthread->flags); -+} -+ - /** - * kthread_unpark - unpark a thread created by kthread_create(). - * @k: thread created by kthread_create(). -diff --git a/kernel/smpboot.c b/kernel/smpboot.c -index 2efe1e206167c..f25208e8df836 100644 ---- a/kernel/smpboot.c -+++ b/kernel/smpboot.c -@@ -188,6 +188,7 @@ __smpboot_create_thread(struct smp_hotplug_thread *ht, unsigned int cpu) - kfree(td); - return PTR_ERR(tsk); - } -+ kthread_set_per_cpu(tsk, cpu); - /* - * Park the thread so that it could start right on the CPU - * when it is available. -diff --git a/kernel/workqueue.c b/kernel/workqueue.c -index 28e52657e0930..29c36c0290623 100644 ---- a/kernel/workqueue.c -+++ b/kernel/workqueue.c -@@ -1847,12 +1847,6 @@ static void worker_attach_to_pool(struct worker *worker, - { - mutex_lock(&wq_pool_attach_mutex); - -- /* -- * set_cpus_allowed_ptr() will fail if the cpumask doesn't have any -- * online CPUs. It'll be re-applied when any of the CPUs come up. -- */ -- set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask); -- - /* - * The wq_pool_attach_mutex ensures %POOL_DISASSOCIATED remains - * stable across this function. See the comments above the flag -@@ -1861,6 +1855,9 @@ static void worker_attach_to_pool(struct worker *worker, - if (pool->flags & POOL_DISASSOCIATED) - worker->flags |= WORKER_UNBOUND; - -+ if (worker->rescue_wq) -+ set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask); -+ - list_add_tail(&worker->node, &pool->workers); - worker->pool = pool; - -diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c -index bfe7bdd4c3406..98c396769be94 100644 ---- a/net/core/gen_estimator.c -+++ b/net/core/gen_estimator.c -@@ -80,11 +80,11 @@ static void est_timer(struct timer_list *t) - u64 rate, brate; - - est_fetch_counters(est, &b); -- brate = (b.bytes - est->last_bytes) << (10 - est->ewma_log - est->intvl_log); -- brate -= (est->avbps >> est->ewma_log); -+ brate = (b.bytes - est->last_bytes) << (10 - est->intvl_log); -+ brate = (brate >> est->ewma_log) - (est->avbps >> est->ewma_log); - -- rate = (u64)(b.packets - est->last_packets) << (10 - est->ewma_log - est->intvl_log); -- rate -= (est->avpps >> est->ewma_log); -+ rate = (u64)(b.packets - est->last_packets) << (10 - est->intvl_log); -+ rate = (rate >> est->ewma_log) - (est->avpps >> est->ewma_log); - - write_seqcount_begin(&est->seq); - est->avbps += brate; -@@ -143,6 +143,9 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats, - if (parm->interval < -2 || parm->interval > 3) - return -EINVAL; - -+ if (parm->ewma_log == 0 || parm->ewma_log >= 31) -+ return -EINVAL; -+ - est = kzalloc(sizeof(*est), GFP_KERNEL); - if (!est) - return -ENOBUFS; -diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c -index 26305aa88651f..a1768ded2d545 100644 ---- a/net/ipv4/tcp_input.c -+++ b/net/ipv4/tcp_input.c -@@ -3295,6 +3295,7 @@ static void tcp_ack_probe(struct sock *sk) - } else { - unsigned long when = tcp_probe0_when(sk, TCP_RTO_MAX); - -+ when = tcp_clamp_probe0_to_user_timeout(sk, when); - tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0, - when, TCP_RTO_MAX, NULL); - } -diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c -index 5da6ffce390c2..d0774b4e934d6 100644 ---- a/net/ipv4/tcp_output.c -+++ b/net/ipv4/tcp_output.c -@@ -3850,6 +3850,8 @@ void tcp_send_probe0(struct sock *sk) - */ - timeout = TCP_RESOURCE_PROBE_INTERVAL; - } -+ -+ timeout = tcp_clamp_probe0_to_user_timeout(sk, timeout); - tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0, timeout, TCP_RTO_MAX, NULL); - } - -diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c -index 7fcd116fbd378..fa2ae96ecdc40 100644 ---- a/net/ipv4/tcp_timer.c -+++ b/net/ipv4/tcp_timer.c -@@ -40,6 +40,24 @@ static u32 tcp_clamp_rto_to_user_timeout(const struct sock *sk) - return min_t(u32, icsk->icsk_rto, msecs_to_jiffies(remaining)); - } - -+u32 tcp_clamp_probe0_to_user_timeout(const struct sock *sk, u32 when) -+{ -+ struct inet_connection_sock *icsk = inet_csk(sk); -+ u32 remaining; -+ s32 elapsed; -+ -+ if (!icsk->icsk_user_timeout || !icsk->icsk_probes_tstamp) -+ return when; -+ -+ elapsed = tcp_jiffies32 - icsk->icsk_probes_tstamp; -+ if (unlikely(elapsed < 0)) -+ elapsed = 0; -+ remaining = msecs_to_jiffies(icsk->icsk_user_timeout) - elapsed; -+ remaining = max_t(u32, remaining, TCP_TIMEOUT_MIN); -+ -+ return min_t(u32, remaining, when); -+} -+ - /** - * tcp_write_err() - close socket and save error info - * @sk: The socket the error has appeared on. -diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c -index 3ab85e1e38d82..1a15e7bae106a 100644 ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -4080,6 +4080,8 @@ void ieee80211_check_fast_rx(struct sta_info *sta) - - rcu_read_lock(); - key = rcu_dereference(sta->ptk[sta->ptk_idx]); -+ if (!key) -+ key = rcu_dereference(sdata->default_unicast_key); - if (key) { - switch (key->conf.cipher) { - case WLAN_CIPHER_SUITE_TKIP: -diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c -index 3a1d428c13369..ea9ddea35a886 100644 ---- a/net/switchdev/switchdev.c -+++ b/net/switchdev/switchdev.c -@@ -461,10 +461,11 @@ static int __switchdev_handle_port_obj_add(struct net_device *dev, - extack = switchdev_notifier_info_to_extack(&port_obj_info->info); - - if (check_cb(dev)) { -- /* This flag is only checked if the return value is success. */ -- port_obj_info->handled = true; -- return add_cb(dev, port_obj_info->obj, port_obj_info->trans, -- extack); -+ err = add_cb(dev, port_obj_info->obj, port_obj_info->trans, -+ extack); -+ if (err != -EOPNOTSUPP) -+ port_obj_info->handled = true; -+ return err; - } - - /* Switch ports might be stacked under e.g. a LAG. Ignore the -@@ -513,9 +514,10 @@ static int __switchdev_handle_port_obj_del(struct net_device *dev, - int err = -EOPNOTSUPP; - - if (check_cb(dev)) { -- /* This flag is only checked if the return value is success. */ -- port_obj_info->handled = true; -- return del_cb(dev, port_obj_info->obj); -+ err = del_cb(dev, port_obj_info->obj); -+ if (err != -EOPNOTSUPP) -+ port_obj_info->handled = true; -+ return err; - } - - /* Switch ports might be stacked under e.g. a LAG. Ignore the -@@ -563,9 +565,10 @@ static int __switchdev_handle_port_attr_set(struct net_device *dev, - int err = -EOPNOTSUPP; - - if (check_cb(dev)) { -- port_attr_info->handled = true; -- return set_cb(dev, port_attr_info->attr, -- port_attr_info->trans); -+ err = set_cb(dev, port_attr_info->attr, port_attr_info->trans); -+ if (err != -EOPNOTSUPP) -+ port_attr_info->handled = true; -+ return err; - } - - /* Switch ports might be stacked under e.g. a LAG. Ignore the -diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c -index 5f515a29668c8..b3667a5efdc1f 100644 ---- a/sound/pci/hda/hda_intel.c -+++ b/sound/pci/hda/hda_intel.c -@@ -2450,6 +2450,9 @@ static const struct pci_device_id azx_ids[] = { - /* CometLake-S */ - { PCI_DEVICE(0x8086, 0xa3f0), - .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, -+ /* CometLake-R */ -+ { PCI_DEVICE(0x8086, 0xf0c8), -+ .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, - /* Icelake */ - { PCI_DEVICE(0x8086, 0x34c8), - .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, -diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c -index 9e8233c10d860..df38616c431a6 100644 ---- a/sound/soc/sof/intel/hda-codec.c -+++ b/sound/soc/sof/intel/hda-codec.c -@@ -68,8 +68,7 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev) - * has been recorded in STATESTS - */ - if (codec->jacktbl.used) -- schedule_delayed_work(&codec->jackpoll_work, -- codec->jackpoll_interval); -+ pm_request_resume(&codec->core.dev); - } - #else - void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) {} -diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c -index edba4745f25a9..693d740107a8b 100644 ---- a/tools/objtool/elf.c -+++ b/tools/objtool/elf.c -@@ -214,8 +214,11 @@ static int read_symbols(struct elf *elf) - - symtab = find_section_by_name(elf, ".symtab"); - if (!symtab) { -- WARN("missing symbol table"); -- return -1; -+ /* -+ * A missing symbol table is actually possible if it's an empty -+ * .o file. This can happen for thunk_64.o. -+ */ -+ return 0; - } - - symbols_nr = symtab->sh.sh_size / symtab->sh.sh_entsize; -diff --git a/tools/testing/selftests/powerpc/alignment/alignment_handler.c b/tools/testing/selftests/powerpc/alignment/alignment_handler.c -index 0453c50c949cb..0725239bbd85c 100644 ---- a/tools/testing/selftests/powerpc/alignment/alignment_handler.c -+++ b/tools/testing/selftests/powerpc/alignment/alignment_handler.c -@@ -380,7 +380,6 @@ int test_alignment_handler_integer(void) - LOAD_DFORM_TEST(ldu); - LOAD_XFORM_TEST(ldx); - LOAD_XFORM_TEST(ldux); -- LOAD_DFORM_TEST(lmw); - STORE_DFORM_TEST(stb); - STORE_XFORM_TEST(stbx); - STORE_DFORM_TEST(stbu); -@@ -399,7 +398,11 @@ int test_alignment_handler_integer(void) - STORE_XFORM_TEST(stdx); - STORE_DFORM_TEST(stdu); - STORE_XFORM_TEST(stdux); -+ -+#ifdef __BIG_ENDIAN__ -+ LOAD_DFORM_TEST(lmw); - STORE_DFORM_TEST(stmw); -+#endif - - return rc; - } diff --git a/patch/kernel/odroidxu4-current/patch-5.4.96-97.patch b/patch/kernel/odroidxu4-current/patch-5.4.96-97.patch deleted file mode 100644 index eefa48f024..0000000000 --- a/patch/kernel/odroidxu4-current/patch-5.4.96-97.patch +++ /dev/null @@ -1,2250 +0,0 @@ -diff --git a/Makefile b/Makefile -index 7a47a2594f957..032751f6be0c1 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - VERSION = 5 - PATCHLEVEL = 4 --SUBLEVEL = 96 -+SUBLEVEL = 97 - EXTRAVERSION = - NAME = Kleptomaniac Octopus - -@@ -920,12 +920,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) - # change __FILE__ to the relative path from the srctree - KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) - --# ensure -fcf-protection is disabled when using retpoline as it is --# incompatible with -mindirect-branch=thunk-extern --ifdef CONFIG_RETPOLINE --KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) --endif -- - include scripts/Makefile.kasan - include scripts/Makefile.extrawarn - include scripts/Makefile.ubsan -diff --git a/arch/arm/boot/dts/sun7i-a20-bananapro.dts b/arch/arm/boot/dts/sun7i-a20-bananapro.dts -index 01ccff756996d..5740f9442705c 100644 ---- a/arch/arm/boot/dts/sun7i-a20-bananapro.dts -+++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts -@@ -110,7 +110,7 @@ - pinctrl-names = "default"; - pinctrl-0 = <&gmac_rgmii_pins>; - phy-handle = <&phy1>; -- phy-mode = "rgmii"; -+ phy-mode = "rgmii-id"; - phy-supply = <®_gmac_3v3>; - status = "okay"; - }; -diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c -index 8b81a17f675d9..e17ec92b90dd8 100644 ---- a/arch/arm/mach-footbridge/dc21285.c -+++ b/arch/arm/mach-footbridge/dc21285.c -@@ -66,15 +66,15 @@ dc21285_read_config(struct pci_bus *bus, unsigned int devfn, int where, - if (addr) - switch (size) { - case 1: -- asm("ldrb %0, [%1, %2]" -+ asm volatile("ldrb %0, [%1, %2]" - : "=r" (v) : "r" (addr), "r" (where) : "cc"); - break; - case 2: -- asm("ldrh %0, [%1, %2]" -+ asm volatile("ldrh %0, [%1, %2]" - : "=r" (v) : "r" (addr), "r" (where) : "cc"); - break; - case 4: -- asm("ldr %0, [%1, %2]" -+ asm volatile("ldr %0, [%1, %2]" - : "=r" (v) : "r" (addr), "r" (where) : "cc"); - break; - } -@@ -100,17 +100,17 @@ dc21285_write_config(struct pci_bus *bus, unsigned int devfn, int where, - if (addr) - switch (size) { - case 1: -- asm("strb %0, [%1, %2]" -+ asm volatile("strb %0, [%1, %2]" - : : "r" (value), "r" (addr), "r" (where) - : "cc"); - break; - case 2: -- asm("strh %0, [%1, %2]" -+ asm volatile("strh %0, [%1, %2]" - : : "r" (value), "r" (addr), "r" (where) - : "cc"); - break; - case 4: -- asm("str %0, [%1, %2]" -+ asm volatile("str %0, [%1, %2]" - : : "r" (value), "r" (addr), "r" (where) - : "cc"); - break; -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi -index 354ef2f3eac67..9533c85fb0a30 100644 ---- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi -@@ -2382,7 +2382,7 @@ - interrupts = ; - dr_mode = "host"; - snps,dis_u2_susphy_quirk; -- snps,quirk-frame-length-adjustment; -+ snps,quirk-frame-length-adjustment = <0x20>; - snps,parkmode-disable-ss-quirk; - }; - }; -diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi -index d4c1da3d4bde2..04d4b1b11a00a 100644 ---- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi -+++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi -@@ -304,7 +304,7 @@ - - dcfg: dcfg@1ee0000 { - compatible = "fsl,ls1046a-dcfg", "syscon"; -- reg = <0x0 0x1ee0000 0x0 0x10000>; -+ reg = <0x0 0x1ee0000 0x0 0x1000>; - big-endian; - }; - -diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts -index f539b3655f6b9..e638f216dbfb3 100644 ---- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts -+++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts -@@ -243,6 +243,8 @@ - &i2c3 { - status = "okay"; - clock-frequency = <400000>; -+ /* Overwrite pinctrl-0 from sdm845.dtsi */ -+ pinctrl-0 = <&qup_i2c3_default &i2c3_hid_active>; - - tsel: hid@15 { - compatible = "hid-over-i2c"; -@@ -250,9 +252,6 @@ - hid-descr-addr = <0x1>; - - interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>; -- -- pinctrl-names = "default"; -- pinctrl-0 = <&i2c3_hid_active>; - }; - - tsc2: hid@2c { -@@ -261,11 +260,6 @@ - hid-descr-addr = <0x20>; - - interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>; -- -- pinctrl-names = "default"; -- pinctrl-0 = <&i2c3_hid_active>; -- -- status = "disabled"; - }; - }; - -diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi -index 9e09909a510a1..98b014a8f9165 100644 ---- a/arch/arm64/boot/dts/rockchip/px30.dtsi -+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi -@@ -860,7 +860,7 @@ - vopl_mmu: iommu@ff470f00 { - compatible = "rockchip,iommu"; - reg = <0x0 0xff470f00 0x0 0x100>; -- interrupts = ; -+ interrupts = ; - interrupt-names = "vopl_mmu"; - clocks = <&cru ACLK_VOPL>, <&cru HCLK_VOPL>; - clock-names = "aclk", "hclk"; -diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c -index 179b41ad63baf..18618af3835f9 100644 ---- a/arch/um/drivers/virtio_uml.c -+++ b/arch/um/drivers/virtio_uml.c -@@ -959,6 +959,7 @@ static void virtio_uml_release_dev(struct device *d) - } - - os_close_file(vu_dev->sock); -+ kfree(vu_dev); - } - - /* Platform device */ -@@ -977,7 +978,7 @@ static int virtio_uml_probe(struct platform_device *pdev) - if (!pdata) - return -EINVAL; - -- vu_dev = devm_kzalloc(&pdev->dev, sizeof(*vu_dev), GFP_KERNEL); -+ vu_dev = kzalloc(sizeof(*vu_dev), GFP_KERNEL); - if (!vu_dev) - return -ENOMEM; - -diff --git a/arch/x86/Makefile b/arch/x86/Makefile -index 94df0868804bc..b5e3bfd4facea 100644 ---- a/arch/x86/Makefile -+++ b/arch/x86/Makefile -@@ -131,6 +131,9 @@ else - - KBUILD_CFLAGS += -mno-red-zone - KBUILD_CFLAGS += -mcmodel=kernel -+ -+ # Intel CET isn't enabled in the kernel -+ KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) - endif - - ifdef CONFIG_X86_X32 -diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h -index 6016559ed1713..5bef1575708dc 100644 ---- a/arch/x86/include/asm/apic.h -+++ b/arch/x86/include/asm/apic.h -@@ -197,16 +197,6 @@ static inline bool apic_needs_pit(void) { return true; } - #endif /* !CONFIG_X86_LOCAL_APIC */ - - #ifdef CONFIG_X86_X2APIC --/* -- * Make previous memory operations globally visible before -- * sending the IPI through x2apic wrmsr. We need a serializing instruction or -- * mfence for this. -- */ --static inline void x2apic_wrmsr_fence(void) --{ -- asm volatile("mfence" : : : "memory"); --} -- - static inline void native_apic_msr_write(u32 reg, u32 v) - { - if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR || -diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h -index 7f828fe497978..4819d5e5a3353 100644 ---- a/arch/x86/include/asm/barrier.h -+++ b/arch/x86/include/asm/barrier.h -@@ -84,4 +84,22 @@ do { \ - - #include - -+/* -+ * Make previous memory operations globally visible before -+ * a WRMSR. -+ * -+ * MFENCE makes writes visible, but only affects load/store -+ * instructions. WRMSR is unfortunately not a load/store -+ * instruction and is unaffected by MFENCE. The LFENCE ensures -+ * that the WRMSR is not reordered. -+ * -+ * Most WRMSRs are full serializing instructions themselves and -+ * do not require this barrier. This is only required for the -+ * IA32_TSC_DEADLINE and X2APIC MSRs. -+ */ -+static inline void weak_wrmsr_fence(void) -+{ -+ asm volatile("mfence; lfence" : : : "memory"); -+} -+ - #endif /* _ASM_X86_BARRIER_H */ -diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c -index 06fa808d72032..3dca7b8642e9c 100644 ---- a/arch/x86/kernel/apic/apic.c -+++ b/arch/x86/kernel/apic/apic.c -@@ -42,6 +42,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -472,6 +473,9 @@ static int lapic_next_deadline(unsigned long delta, - { - u64 tsc; - -+ /* This MSR is special and need a special fence: */ -+ weak_wrmsr_fence(); -+ - tsc = rdtsc(); - wrmsrl(MSR_IA32_TSC_DEADLINE, tsc + (((u64) delta) * TSC_DIVISOR)); - return 0; -diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c -index b0889c48a2ac5..7eec3c154fa24 100644 ---- a/arch/x86/kernel/apic/x2apic_cluster.c -+++ b/arch/x86/kernel/apic/x2apic_cluster.c -@@ -29,7 +29,8 @@ static void x2apic_send_IPI(int cpu, int vector) - { - u32 dest = per_cpu(x86_cpu_to_logical_apicid, cpu); - -- x2apic_wrmsr_fence(); -+ /* x2apic MSRs are special and need a special fence: */ -+ weak_wrmsr_fence(); - __x2apic_send_IPI_dest(dest, vector, APIC_DEST_LOGICAL); - } - -@@ -41,7 +42,8 @@ __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest) - unsigned long flags; - u32 dest; - -- x2apic_wrmsr_fence(); -+ /* x2apic MSRs are special and need a special fence: */ -+ weak_wrmsr_fence(); - local_irq_save(flags); - - tmpmsk = this_cpu_cpumask_var_ptr(ipi_mask); -diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c -index e14eae6d6ea71..032a00e5d9fa6 100644 ---- a/arch/x86/kernel/apic/x2apic_phys.c -+++ b/arch/x86/kernel/apic/x2apic_phys.c -@@ -43,7 +43,8 @@ static void x2apic_send_IPI(int cpu, int vector) - { - u32 dest = per_cpu(x86_cpu_to_apicid, cpu); - -- x2apic_wrmsr_fence(); -+ /* x2apic MSRs are special and need a special fence: */ -+ weak_wrmsr_fence(); - __x2apic_send_IPI_dest(dest, vector, APIC_DEST_PHYSICAL); - } - -@@ -54,7 +55,8 @@ __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest) - unsigned long this_cpu; - unsigned long flags; - -- x2apic_wrmsr_fence(); -+ /* x2apic MSRs are special and need a special fence: */ -+ weak_wrmsr_fence(); - - local_irq_save(flags); - -@@ -125,7 +127,8 @@ void __x2apic_send_IPI_shorthand(int vector, u32 which) - { - unsigned long cfg = __prepare_ICR(which, vector, 0); - -- x2apic_wrmsr_fence(); -+ /* x2apic MSRs are special and need a special fence: */ -+ weak_wrmsr_fence(); - native_x2apic_icr_write(cfg, 0); - } - -diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c -index 39265b55929d2..60c8dcb907a50 100644 ---- a/arch/x86/kvm/emulate.c -+++ b/arch/x86/kvm/emulate.c -@@ -2890,6 +2890,8 @@ static int em_sysenter(struct x86_emulate_ctxt *ctxt) - ops->get_msr(ctxt, MSR_IA32_SYSENTER_ESP, &msr_data); - *reg_write(ctxt, VCPU_REGS_RSP) = (efer & EFER_LMA) ? msr_data : - (u32)msr_data; -+ if (efer & EFER_LMA) -+ ctxt->mode = X86EMUL_MODE_PROT64; - - return X86EMUL_CONTINUE; - } -diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c -index 2b506904be024..4906e480b5bb6 100644 ---- a/arch/x86/kvm/svm.c -+++ b/arch/x86/kvm/svm.c -@@ -889,6 +889,11 @@ static int has_svm(void) - return 0; - } - -+ if (sev_active()) { -+ pr_info("KVM is unsupported when running as an SEV guest\n"); -+ return 0; -+ } -+ - return 1; - } - -diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c -index 9268c12458c84..dfa01bcdc3694 100644 ---- a/arch/x86/mm/mem_encrypt.c -+++ b/arch/x86/mm/mem_encrypt.c -@@ -375,6 +375,7 @@ bool force_dma_unencrypted(struct device *dev) - - return false; - } -+EXPORT_SYMBOL_GPL(sev_active); - - /* Architecture __weak replacement functions */ - void __init mem_encrypt_free_decrypted_mem(void) -diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -index d2dd387c95d86..de06ee7d2ad46 100644 ---- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -@@ -1434,8 +1434,6 @@ amdgpu_dm_update_connector_after_detect(struct amdgpu_dm_connector *aconnector) - - drm_connector_update_edid_property(connector, - aconnector->edid); -- drm_add_edid_modes(connector, aconnector->edid); -- - if (aconnector->dc_link->aux_mode) - drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux, - aconnector->edid); -diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c -index 8c73377ac82ca..3d004ca76b6ed 100644 ---- a/drivers/input/joystick/xpad.c -+++ b/drivers/input/joystick/xpad.c -@@ -215,9 +215,17 @@ static const struct xpad_device { - { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, - { 0x0e6f, 0x021f, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, - { 0x0e6f, 0x0246, "Rock Candy Gamepad for Xbox One 2015", 0, XTYPE_XBOXONE }, -- { 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE }, -+ { 0x0e6f, 0x02a0, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, -+ { 0x0e6f, 0x02a1, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, -+ { 0x0e6f, 0x02a2, "PDP Wired Controller for Xbox One - Crimson Red", 0, XTYPE_XBOXONE }, - { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 0, XTYPE_XBOXONE }, - { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 0, XTYPE_XBOXONE }, -+ { 0x0e6f, 0x02a7, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, -+ { 0x0e6f, 0x02a8, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, -+ { 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE }, -+ { 0x0e6f, 0x02ad, "PDP Wired Controller for Xbox One - Stealth Series", 0, XTYPE_XBOXONE }, -+ { 0x0e6f, 0x02b3, "Afterglow Prismatic Wired Controller", 0, XTYPE_XBOXONE }, -+ { 0x0e6f, 0x02b8, "Afterglow Prismatic Wired Controller", 0, XTYPE_XBOXONE }, - { 0x0e6f, 0x0301, "Logic3 Controller", 0, XTYPE_XBOX360 }, - { 0x0e6f, 0x0346, "Rock Candy Gamepad for Xbox One 2016", 0, XTYPE_XBOXONE }, - { 0x0e6f, 0x0401, "Logic3 Controller", 0, XTYPE_XBOX360 }, -@@ -296,6 +304,9 @@ static const struct xpad_device { - { 0x1bad, 0xfa01, "MadCatz GamePad", 0, XTYPE_XBOX360 }, - { 0x1bad, 0xfd00, "Razer Onza TE", 0, XTYPE_XBOX360 }, - { 0x1bad, 0xfd01, "Razer Onza", 0, XTYPE_XBOX360 }, -+ { 0x20d6, 0x2001, "BDA Xbox Series X Wired Controller", 0, XTYPE_XBOXONE }, -+ { 0x20d6, 0x281f, "PowerA Wired Controller For Xbox 360", 0, XTYPE_XBOX360 }, -+ { 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE }, - { 0x24c6, 0x5000, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, - { 0x24c6, 0x5300, "PowerA MINI PROEX Controller", 0, XTYPE_XBOX360 }, - { 0x24c6, 0x5303, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 }, -@@ -429,8 +440,12 @@ static const struct usb_device_id xpad_table[] = { - XPAD_XBOX360_VENDOR(0x162e), /* Joytech X-Box 360 controllers */ - XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */ - XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */ -+ XPAD_XBOX360_VENDOR(0x20d6), /* PowerA Controllers */ -+ XPAD_XBOXONE_VENDOR(0x20d6), /* PowerA Controllers */ - XPAD_XBOX360_VENDOR(0x24c6), /* PowerA Controllers */ - XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */ -+ XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */ -+ XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */ - { } - }; - -diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h -index eca931da76c3a..b7dbcbac3a1a5 100644 ---- a/drivers/input/serio/i8042-x86ia64io.h -+++ b/drivers/input/serio/i8042-x86ia64io.h -@@ -219,6 +219,8 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = { - DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"), - DMI_MATCH(DMI_PRODUCT_NAME, "C15B"), - }, -+ }, -+ { - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"), - DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"), -diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c -index 984c7a6ea4fe8..953d86ca6d2b2 100644 ---- a/drivers/iommu/intel-iommu.c -+++ b/drivers/iommu/intel-iommu.c -@@ -3285,6 +3285,12 @@ static int __init init_dmars(void) - - if (!ecap_pass_through(iommu->ecap)) - hw_pass_through = 0; -+ -+ if (!intel_iommu_strict && cap_caching_mode(iommu->cap)) { -+ pr_info("Disable batched IOTLB flush due to virtualization"); -+ intel_iommu_strict = 1; -+ } -+ - #ifdef CONFIG_INTEL_IOMMU_SVM - if (pasid_supported(iommu)) - intel_svm_init(iommu); -diff --git a/drivers/md/md.c b/drivers/md/md.c -index ec5dfb7ae4e16..cc38530804c90 100644 ---- a/drivers/md/md.c -+++ b/drivers/md/md.c -@@ -538,8 +538,10 @@ static void md_submit_flush_data(struct work_struct *ws) - * could wait for this and below md_handle_request could wait for those - * bios because of suspend check - */ -+ spin_lock_irq(&mddev->lock); - mddev->last_flush = mddev->start_flush; - mddev->flush_bio = NULL; -+ spin_unlock_irq(&mddev->lock); - wake_up(&mddev->sb_wait); - - if (bio->bi_iter.bi_size == 0) { -diff --git a/drivers/mmc/core/sdio_cis.c b/drivers/mmc/core/sdio_cis.c -index 3efaa9534a777..9a5aaac29099b 100644 ---- a/drivers/mmc/core/sdio_cis.c -+++ b/drivers/mmc/core/sdio_cis.c -@@ -20,6 +20,8 @@ - #include "sdio_cis.h" - #include "sdio_ops.h" - -+#define SDIO_READ_CIS_TIMEOUT_MS (10 * 1000) /* 10s */ -+ - static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func, - const unsigned char *buf, unsigned size) - { -@@ -266,6 +268,8 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func) - - do { - unsigned char tpl_code, tpl_link; -+ unsigned long timeout = jiffies + -+ msecs_to_jiffies(SDIO_READ_CIS_TIMEOUT_MS); - - ret = mmc_io_rw_direct(card, 0, 0, ptr++, 0, &tpl_code); - if (ret) -@@ -318,6 +322,8 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func) - prev = &this->next; - - if (ret == -ENOENT) { -+ if (time_after(jiffies, timeout)) -+ break; - /* warn about unknown tuples */ - pr_warn_ratelimited("%s: queuing unknown" - " CIS tuple 0x%02x (%u bytes)\n", -diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c -index 469b155df4885..1af09fd3fed1c 100644 ---- a/drivers/net/dsa/mv88e6xxx/chip.c -+++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -1517,7 +1517,11 @@ static int mv88e6xxx_port_db_load_purge(struct mv88e6xxx_chip *chip, int port, - if (!entry.portvec) - entry.state = 0; - } else { -- entry.portvec |= BIT(port); -+ if (state == MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC) -+ entry.portvec = BIT(port); -+ else -+ entry.portvec |= BIT(port); -+ - entry.state = state; - } - -diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c -index c20dc689698ed..5acd599d6b9af 100644 ---- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c -+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c -@@ -55,12 +55,7 @@ static void i40e_vc_notify_vf_link_state(struct i40e_vf *vf) - - pfe.event = VIRTCHNL_EVENT_LINK_CHANGE; - pfe.severity = PF_EVENT_SEVERITY_INFO; -- -- /* Always report link is down if the VF queues aren't enabled */ -- if (!vf->queues_enabled) { -- pfe.event_data.link_event.link_status = false; -- pfe.event_data.link_event.link_speed = 0; -- } else if (vf->link_forced) { -+ if (vf->link_forced) { - pfe.event_data.link_event.link_status = vf->link_up; - pfe.event_data.link_event.link_speed = - (vf->link_up ? VIRTCHNL_LINK_SPEED_40GB : 0); -@@ -70,7 +65,6 @@ static void i40e_vc_notify_vf_link_state(struct i40e_vf *vf) - pfe.event_data.link_event.link_speed = - i40e_virtchnl_link_speed(ls->link_speed); - } -- - i40e_aq_send_msg_to_vf(hw, abs_vf_id, VIRTCHNL_OP_EVENT, - 0, (u8 *)&pfe, sizeof(pfe), NULL); - } -@@ -2393,8 +2387,6 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg) - } - } - -- vf->queues_enabled = true; -- - error_param: - /* send the response to the VF */ - return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ENABLE_QUEUES, -@@ -2416,9 +2408,6 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg) - struct i40e_pf *pf = vf->pf; - i40e_status aq_ret = 0; - -- /* Immediately mark queues as disabled */ -- vf->queues_enabled = false; -- - if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) { - aq_ret = I40E_ERR_PARAM; - goto error_param; -diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h -index 7164b9bb294ff..f65cc0c165502 100644 ---- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h -+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h -@@ -99,7 +99,6 @@ struct i40e_vf { - unsigned int tx_rate; /* Tx bandwidth limit in Mbps */ - bool link_forced; - bool link_up; /* only valid if VF link is forced */ -- bool queues_enabled; /* true if the VF queues are enabled */ - bool spoofchk; - u16 num_mac; - u16 num_vlan; -diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c -index 0303eeb760505..0365bf2b480e3 100644 ---- a/drivers/net/ethernet/intel/igc/igc_ethtool.c -+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c -@@ -1709,7 +1709,8 @@ static int igc_get_link_ksettings(struct net_device *netdev, - Asym_Pause); - } - -- status = rd32(IGC_STATUS); -+ status = pm_runtime_suspended(&adapter->pdev->dev) ? -+ 0 : rd32(IGC_STATUS); - - if (status & IGC_STATUS_LU) { - if (status & IGC_STATUS_SPEED_1000) { -diff --git a/drivers/net/ethernet/intel/igc/igc_i225.c b/drivers/net/ethernet/intel/igc/igc_i225.c -index c25f555aaf822..ed5d09c11c389 100644 ---- a/drivers/net/ethernet/intel/igc/igc_i225.c -+++ b/drivers/net/ethernet/intel/igc/igc_i225.c -@@ -219,9 +219,9 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words, - u16 *data) - { - struct igc_nvm_info *nvm = &hw->nvm; -+ s32 ret_val = -IGC_ERR_NVM; - u32 attempts = 100000; - u32 i, k, eewr = 0; -- s32 ret_val = 0; - - /* A check for invalid values: offset too large, too many words, - * too many words for the offset, and not enough words. -@@ -229,7 +229,6 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words, - if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) || - words == 0) { - hw_dbg("nvm parameter(s) out of bounds\n"); -- ret_val = -IGC_ERR_NVM; - goto out; - } - -diff --git a/drivers/net/ethernet/intel/igc/igc_mac.c b/drivers/net/ethernet/intel/igc/igc_mac.c -index 5eeb4c8caf4ae..08adf103e90b4 100644 ---- a/drivers/net/ethernet/intel/igc/igc_mac.c -+++ b/drivers/net/ethernet/intel/igc/igc_mac.c -@@ -647,7 +647,7 @@ s32 igc_config_fc_after_link_up(struct igc_hw *hw) - } - - out: -- return 0; -+ return ret_val; - } - - /** -diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c -index a30eb90ba3d28..dd590086fe6a5 100644 ---- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c -+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c -@@ -29,16 +29,16 @@ static int mvpp2_prs_hw_write(struct mvpp2 *priv, struct mvpp2_prs_entry *pe) - /* Clear entry invalidation bit */ - pe->tcam[MVPP2_PRS_TCAM_INV_WORD] &= ~MVPP2_PRS_TCAM_INV_MASK; - -- /* Write tcam index - indirect access */ -- mvpp2_write(priv, MVPP2_PRS_TCAM_IDX_REG, pe->index); -- for (i = 0; i < MVPP2_PRS_TCAM_WORDS; i++) -- mvpp2_write(priv, MVPP2_PRS_TCAM_DATA_REG(i), pe->tcam[i]); -- - /* Write sram index - indirect access */ - mvpp2_write(priv, MVPP2_PRS_SRAM_IDX_REG, pe->index); - for (i = 0; i < MVPP2_PRS_SRAM_WORDS; i++) - mvpp2_write(priv, MVPP2_PRS_SRAM_DATA_REG(i), pe->sram[i]); - -+ /* Write tcam index - indirect access */ -+ mvpp2_write(priv, MVPP2_PRS_TCAM_IDX_REG, pe->index); -+ for (i = 0; i < MVPP2_PRS_TCAM_WORDS; i++) -+ mvpp2_write(priv, MVPP2_PRS_TCAM_DATA_REG(i), pe->tcam[i]); -+ - return 0; - } - -diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c -index 4944c40436f08..11e12761b0a6e 100644 ---- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c -@@ -1697,6 +1697,7 @@ search_again_locked: - if (!fte_tmp) - continue; - rule = add_rule_fg(g, spec, flow_act, dest, dest_num, fte_tmp); -+ /* No error check needed here, because insert_fte() is not called */ - up_write_ref_node(&fte_tmp->node, false); - tree_put_node(&fte_tmp->node, false); - kmem_cache_free(steering->ftes_cache, fte); -@@ -1745,6 +1746,8 @@ skip_search: - up_write_ref_node(&g->node, false); - rule = add_rule_fg(g, spec, flow_act, dest, dest_num, fte); - up_write_ref_node(&fte->node, false); -+ if (IS_ERR(rule)) -+ tree_put_node(&fte->node, false); - return rule; - } - rule = ERR_PTR(-ENOENT); -@@ -1844,6 +1847,8 @@ search_again_locked: - up_write_ref_node(&g->node, false); - rule = add_rule_fg(g, spec, flow_act, dest, dest_num, fte); - up_write_ref_node(&fte->node, false); -+ if (IS_ERR(rule)) -+ tree_put_node(&fte->node, false); - tree_put_node(&g->node, false); - return rule; - -diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c -index 366ca1b5da5cc..1e8244ec5b332 100644 ---- a/drivers/net/ethernet/realtek/r8169_main.c -+++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -6419,10 +6419,10 @@ static int rtl8169_close(struct net_device *dev) - - cancel_work_sync(&tp->wk.work); - -- phy_disconnect(tp->phydev); -- - free_irq(pci_irq_vector(pdev, 0), tp); - -+ phy_disconnect(tp->phydev); -+ - dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, - tp->RxPhyAddr); - dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray, -diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c -index c54fe6650018e..7272d8522a9e9 100644 ---- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c -+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c -@@ -134,7 +134,14 @@ static int iwl_configure_rxq(struct iwl_mvm *mvm) - .dataflags[0] = IWL_HCMD_DFL_NOCOPY, - }; - -- /* Do not configure default queue, it is configured via context info */ -+ /* -+ * The default queue is configured via context info, so if we -+ * have a single queue, there's nothing to do here. -+ */ -+ if (mvm->trans->num_rx_queues == 1) -+ return 0; -+ -+ /* skip the default queue */ - num_queues = mvm->trans->num_rx_queues - 1; - - size = struct_size(cmd, data, num_queues); -diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c -index 196aa44c4936a..e0f411021c59d 100644 ---- a/drivers/nvdimm/dimm_devs.c -+++ b/drivers/nvdimm/dimm_devs.c -@@ -344,16 +344,16 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr, - } - static DEVICE_ATTR_RO(state); - --static ssize_t available_slots_show(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t __available_slots_show(struct nvdimm_drvdata *ndd, char *buf) - { -- struct nvdimm_drvdata *ndd = dev_get_drvdata(dev); -+ struct device *dev; - ssize_t rc; - u32 nfree; - - if (!ndd) - return -ENXIO; - -+ dev = ndd->dev; - nvdimm_bus_lock(dev); - nfree = nd_label_nfree(ndd); - if (nfree - 1 > nfree) { -@@ -365,6 +365,18 @@ static ssize_t available_slots_show(struct device *dev, - nvdimm_bus_unlock(dev); - return rc; - } -+ -+static ssize_t available_slots_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ ssize_t rc; -+ -+ nd_device_lock(dev); -+ rc = __available_slots_show(dev_get_drvdata(dev), buf); -+ nd_device_unlock(dev); -+ -+ return rc; -+} - static DEVICE_ATTR_RO(available_slots); - - __weak ssize_t security_show(struct device *dev, -diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c -index ef93bd3ed339c..434d3f21f0e13 100644 ---- a/drivers/nvme/host/pci.c -+++ b/drivers/nvme/host/pci.c -@@ -3161,6 +3161,8 @@ static const struct pci_device_id nvme_id_table[] = { - { PCI_DEVICE(0x1c5c, 0x1504), /* SK Hynix PC400 */ - .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, - { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, -+ { PCI_DEVICE(0x2646, 0x2263), /* KINGSTON A2000 NVMe SSD */ -+ .driver_data = NVME_QUIRK_NO_DEEPEST_PS, }, - { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001), - .driver_data = NVME_QUIRK_SINGLE_VECTOR }, - { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) }, -diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c -index e31823f19a0fa..9242224156f5b 100644 ---- a/drivers/nvme/target/tcp.c -+++ b/drivers/nvme/target/tcp.c -@@ -292,7 +292,7 @@ static void nvmet_tcp_map_pdu_iovec(struct nvmet_tcp_cmd *cmd) - length = cmd->pdu_len; - cmd->nr_mapped = DIV_ROUND_UP(length, PAGE_SIZE); - offset = cmd->rbytes_done; -- cmd->sg_idx = DIV_ROUND_UP(offset, PAGE_SIZE); -+ cmd->sg_idx = offset / PAGE_SIZE; - sg_offset = offset % PAGE_SIZE; - sg = &cmd->req.sg[cmd->sg_idx]; - -@@ -305,6 +305,7 @@ static void nvmet_tcp_map_pdu_iovec(struct nvmet_tcp_cmd *cmd) - length -= iov_len; - sg = sg_next(sg); - iov++; -+ sg_offset = 0; - } - - iov_iter_kvec(&cmd->recv_msg.msg_iter, READ, cmd->iov, -diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c -index 134dc2005ce97..c9f6e97582885 100644 ---- a/drivers/usb/class/usblp.c -+++ b/drivers/usb/class/usblp.c -@@ -1329,14 +1329,17 @@ static int usblp_set_protocol(struct usblp *usblp, int protocol) - if (protocol < USBLP_FIRST_PROTOCOL || protocol > USBLP_LAST_PROTOCOL) - return -EINVAL; - -- alts = usblp->protocol[protocol].alt_setting; -- if (alts < 0) -- return -EINVAL; -- r = usb_set_interface(usblp->dev, usblp->ifnum, alts); -- if (r < 0) { -- printk(KERN_ERR "usblp: can't set desired altsetting %d on interface %d\n", -- alts, usblp->ifnum); -- return r; -+ /* Don't unnecessarily set the interface if there's a single alt. */ -+ if (usblp->intf->num_altsetting > 1) { -+ alts = usblp->protocol[protocol].alt_setting; -+ if (alts < 0) -+ return -EINVAL; -+ r = usb_set_interface(usblp->dev, usblp->ifnum, alts); -+ if (r < 0) { -+ printk(KERN_ERR "usblp: can't set desired altsetting %d on interface %d\n", -+ alts, usblp->ifnum); -+ return r; -+ } - } - - usblp->bidir = (usblp->protocol[protocol].epread != NULL); -diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c -index 70ac47a341ac2..e3f1f20c49221 100644 ---- a/drivers/usb/dwc2/gadget.c -+++ b/drivers/usb/dwc2/gadget.c -@@ -1543,7 +1543,6 @@ static void dwc2_hsotg_complete_oursetup(struct usb_ep *ep, - static struct dwc2_hsotg_ep *ep_from_windex(struct dwc2_hsotg *hsotg, - u32 windex) - { -- struct dwc2_hsotg_ep *ep; - int dir = (windex & USB_DIR_IN) ? 1 : 0; - int idx = windex & 0x7F; - -@@ -1553,12 +1552,7 @@ static struct dwc2_hsotg_ep *ep_from_windex(struct dwc2_hsotg *hsotg, - if (idx > hsotg->num_of_eps) - return NULL; - -- ep = index_to_ep(hsotg, idx, dir); -- -- if (idx && ep->dir_in != dir) -- return NULL; -- -- return ep; -+ return index_to_ep(hsotg, idx, dir); - } - - /** -diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c -index 440dbf55ddf70..90ec65d31059f 100644 ---- a/drivers/usb/dwc3/core.c -+++ b/drivers/usb/dwc3/core.c -@@ -1718,7 +1718,7 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg) - if (PMSG_IS_AUTO(msg)) - break; - -- ret = dwc3_core_init(dwc); -+ ret = dwc3_core_init_for_resume(dwc); - if (ret) - return ret; - -diff --git a/drivers/usb/gadget/legacy/ether.c b/drivers/usb/gadget/legacy/ether.c -index 30313b233680d..99c7fc0d1d597 100644 ---- a/drivers/usb/gadget/legacy/ether.c -+++ b/drivers/usb/gadget/legacy/ether.c -@@ -403,8 +403,10 @@ static int eth_bind(struct usb_composite_dev *cdev) - struct usb_descriptor_header *usb_desc; - - usb_desc = usb_otg_descriptor_alloc(gadget); -- if (!usb_desc) -+ if (!usb_desc) { -+ status = -ENOMEM; - goto fail1; -+ } - usb_otg_descriptor_init(gadget, usb_desc); - otg_desc[0] = usb_desc; - otg_desc[1] = NULL; -diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c -index 45c54d56ecbd5..b45e5bf089979 100644 ---- a/drivers/usb/host/xhci-mtk-sch.c -+++ b/drivers/usb/host/xhci-mtk-sch.c -@@ -200,6 +200,8 @@ static struct mu3h_sch_ep_info *create_sch_ep(struct usb_device *udev, - - sch_ep->sch_tt = tt; - sch_ep->ep = ep; -+ INIT_LIST_HEAD(&sch_ep->endpoint); -+ INIT_LIST_HEAD(&sch_ep->tt_endpoint); - - return sch_ep; - } -@@ -373,6 +375,7 @@ static void update_bus_bw(struct mu3h_sch_bw_info *sch_bw, - sch_ep->bw_budget_table[j]; - } - } -+ sch_ep->allocated = used; - } - - static int check_sch_tt(struct usb_device *udev, -@@ -541,6 +544,22 @@ static int check_sch_bw(struct usb_device *udev, - return 0; - } - -+static void destroy_sch_ep(struct usb_device *udev, -+ struct mu3h_sch_bw_info *sch_bw, struct mu3h_sch_ep_info *sch_ep) -+{ -+ /* only release ep bw check passed by check_sch_bw() */ -+ if (sch_ep->allocated) -+ update_bus_bw(sch_bw, sch_ep, 0); -+ -+ list_del(&sch_ep->endpoint); -+ -+ if (sch_ep->sch_tt) { -+ list_del(&sch_ep->tt_endpoint); -+ drop_tt(udev); -+ } -+ kfree(sch_ep); -+} -+ - static bool need_bw_sch(struct usb_host_endpoint *ep, - enum usb_device_speed speed, int has_tt) - { -@@ -583,6 +602,8 @@ int xhci_mtk_sch_init(struct xhci_hcd_mtk *mtk) - - mtk->sch_array = sch_array; - -+ INIT_LIST_HEAD(&mtk->bw_ep_chk_list); -+ - return 0; - } - EXPORT_SYMBOL_GPL(xhci_mtk_sch_init); -@@ -601,19 +622,14 @@ int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, - struct xhci_ep_ctx *ep_ctx; - struct xhci_slot_ctx *slot_ctx; - struct xhci_virt_device *virt_dev; -- struct mu3h_sch_bw_info *sch_bw; - struct mu3h_sch_ep_info *sch_ep; -- struct mu3h_sch_bw_info *sch_array; - unsigned int ep_index; -- int bw_index; -- int ret = 0; - - xhci = hcd_to_xhci(hcd); - virt_dev = xhci->devs[udev->slot_id]; - ep_index = xhci_get_endpoint_index(&ep->desc); - slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); - ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); -- sch_array = mtk->sch_array; - - xhci_dbg(xhci, "%s() type:%d, speed:%d, mpkt:%d, dir:%d, ep:%p\n", - __func__, usb_endpoint_type(&ep->desc), udev->speed, -@@ -632,35 +648,13 @@ int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, - return 0; - } - -- bw_index = get_bw_index(xhci, udev, ep); -- sch_bw = &sch_array[bw_index]; -- - sch_ep = create_sch_ep(udev, ep, ep_ctx); - if (IS_ERR_OR_NULL(sch_ep)) - return -ENOMEM; - - setup_sch_info(udev, ep_ctx, sch_ep); - -- ret = check_sch_bw(udev, sch_bw, sch_ep); -- if (ret) { -- xhci_err(xhci, "Not enough bandwidth!\n"); -- if (is_fs_or_ls(udev->speed)) -- drop_tt(udev); -- -- kfree(sch_ep); -- return -ENOSPC; -- } -- -- list_add_tail(&sch_ep->endpoint, &sch_bw->bw_ep_list); -- -- ep_ctx->reserved[0] |= cpu_to_le32(EP_BPKTS(sch_ep->pkts) -- | EP_BCSCOUNT(sch_ep->cs_count) | EP_BBM(sch_ep->burst_mode)); -- ep_ctx->reserved[1] |= cpu_to_le32(EP_BOFFSET(sch_ep->offset) -- | EP_BREPEAT(sch_ep->repeat)); -- -- xhci_dbg(xhci, " PKTS:%x, CSCOUNT:%x, BM:%x, OFFSET:%x, REPEAT:%x\n", -- sch_ep->pkts, sch_ep->cs_count, sch_ep->burst_mode, -- sch_ep->offset, sch_ep->repeat); -+ list_add_tail(&sch_ep->endpoint, &mtk->bw_ep_chk_list); - - return 0; - } -@@ -675,7 +669,7 @@ void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, - struct xhci_virt_device *virt_dev; - struct mu3h_sch_bw_info *sch_array; - struct mu3h_sch_bw_info *sch_bw; -- struct mu3h_sch_ep_info *sch_ep; -+ struct mu3h_sch_ep_info *sch_ep, *tmp; - int bw_index; - - xhci = hcd_to_xhci(hcd); -@@ -694,17 +688,79 @@ void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, - bw_index = get_bw_index(xhci, udev, ep); - sch_bw = &sch_array[bw_index]; - -- list_for_each_entry(sch_ep, &sch_bw->bw_ep_list, endpoint) { -+ list_for_each_entry_safe(sch_ep, tmp, &sch_bw->bw_ep_list, endpoint) { - if (sch_ep->ep == ep) { -- update_bus_bw(sch_bw, sch_ep, 0); -- list_del(&sch_ep->endpoint); -- if (is_fs_or_ls(udev->speed)) { -- list_del(&sch_ep->tt_endpoint); -- drop_tt(udev); -- } -- kfree(sch_ep); -+ destroy_sch_ep(udev, sch_bw, sch_ep); - break; - } - } - } - EXPORT_SYMBOL_GPL(xhci_mtk_drop_ep_quirk); -+ -+int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) -+{ -+ struct xhci_hcd_mtk *mtk = hcd_to_mtk(hcd); -+ struct xhci_hcd *xhci = hcd_to_xhci(hcd); -+ struct xhci_virt_device *virt_dev = xhci->devs[udev->slot_id]; -+ struct mu3h_sch_bw_info *sch_bw; -+ struct mu3h_sch_ep_info *sch_ep, *tmp; -+ int bw_index, ret; -+ -+ xhci_dbg(xhci, "%s() udev %s\n", __func__, dev_name(&udev->dev)); -+ -+ list_for_each_entry(sch_ep, &mtk->bw_ep_chk_list, endpoint) { -+ bw_index = get_bw_index(xhci, udev, sch_ep->ep); -+ sch_bw = &mtk->sch_array[bw_index]; -+ -+ ret = check_sch_bw(udev, sch_bw, sch_ep); -+ if (ret) { -+ xhci_err(xhci, "Not enough bandwidth!\n"); -+ return -ENOSPC; -+ } -+ } -+ -+ list_for_each_entry_safe(sch_ep, tmp, &mtk->bw_ep_chk_list, endpoint) { -+ struct xhci_ep_ctx *ep_ctx; -+ struct usb_host_endpoint *ep = sch_ep->ep; -+ unsigned int ep_index = xhci_get_endpoint_index(&ep->desc); -+ -+ bw_index = get_bw_index(xhci, udev, ep); -+ sch_bw = &mtk->sch_array[bw_index]; -+ -+ list_move_tail(&sch_ep->endpoint, &sch_bw->bw_ep_list); -+ -+ ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); -+ ep_ctx->reserved[0] |= cpu_to_le32(EP_BPKTS(sch_ep->pkts) -+ | EP_BCSCOUNT(sch_ep->cs_count) -+ | EP_BBM(sch_ep->burst_mode)); -+ ep_ctx->reserved[1] |= cpu_to_le32(EP_BOFFSET(sch_ep->offset) -+ | EP_BREPEAT(sch_ep->repeat)); -+ -+ xhci_dbg(xhci, " PKTS:%x, CSCOUNT:%x, BM:%x, OFFSET:%x, REPEAT:%x\n", -+ sch_ep->pkts, sch_ep->cs_count, sch_ep->burst_mode, -+ sch_ep->offset, sch_ep->repeat); -+ } -+ -+ return xhci_check_bandwidth(hcd, udev); -+} -+EXPORT_SYMBOL_GPL(xhci_mtk_check_bandwidth); -+ -+void xhci_mtk_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) -+{ -+ struct xhci_hcd_mtk *mtk = hcd_to_mtk(hcd); -+ struct xhci_hcd *xhci = hcd_to_xhci(hcd); -+ struct mu3h_sch_bw_info *sch_bw; -+ struct mu3h_sch_ep_info *sch_ep, *tmp; -+ int bw_index; -+ -+ xhci_dbg(xhci, "%s() udev %s\n", __func__, dev_name(&udev->dev)); -+ -+ list_for_each_entry_safe(sch_ep, tmp, &mtk->bw_ep_chk_list, endpoint) { -+ bw_index = get_bw_index(xhci, udev, sch_ep->ep); -+ sch_bw = &mtk->sch_array[bw_index]; -+ destroy_sch_ep(udev, sch_bw, sch_ep); -+ } -+ -+ xhci_reset_bandwidth(hcd, udev); -+} -+EXPORT_SYMBOL_GPL(xhci_mtk_reset_bandwidth); -diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c -index 85f1ff0399a9c..09b67219fd146 100644 ---- a/drivers/usb/host/xhci-mtk.c -+++ b/drivers/usb/host/xhci-mtk.c -@@ -347,6 +347,8 @@ static void usb_wakeup_set(struct xhci_hcd_mtk *mtk, bool enable) - static int xhci_mtk_setup(struct usb_hcd *hcd); - static const struct xhci_driver_overrides xhci_mtk_overrides __initconst = { - .reset = xhci_mtk_setup, -+ .check_bandwidth = xhci_mtk_check_bandwidth, -+ .reset_bandwidth = xhci_mtk_reset_bandwidth, - }; - - static struct hc_driver __read_mostly xhci_mtk_hc_driver; -diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h -index 5ac458b7d2e0e..734c5513aa1bf 100644 ---- a/drivers/usb/host/xhci-mtk.h -+++ b/drivers/usb/host/xhci-mtk.h -@@ -59,6 +59,7 @@ struct mu3h_sch_bw_info { - * @ep_type: endpoint type - * @maxpkt: max packet size of endpoint - * @ep: address of usb_host_endpoint struct -+ * @allocated: the bandwidth is aready allocated from bus_bw - * @offset: which uframe of the interval that transfer should be - * scheduled first time within the interval - * @repeat: the time gap between two uframes that transfers are -@@ -86,6 +87,7 @@ struct mu3h_sch_ep_info { - u32 ep_type; - u32 maxpkt; - void *ep; -+ bool allocated; - /* - * mtk xHCI scheduling information put into reserved DWs - * in ep context -@@ -131,6 +133,7 @@ struct xhci_hcd_mtk { - struct device *dev; - struct usb_hcd *hcd; - struct mu3h_sch_bw_info *sch_array; -+ struct list_head bw_ep_chk_list; - struct mu3c_ippc_regs __iomem *ippc_regs; - bool has_ippc; - int num_u2_ports; -@@ -166,6 +169,8 @@ int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, - struct usb_host_endpoint *ep); - void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, - struct usb_host_endpoint *ep); -+int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); -+void xhci_mtk_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); - - #else - static inline int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, -@@ -179,6 +184,16 @@ static inline void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, - { - } - -+static inline int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, -+ struct usb_device *udev) -+{ -+ return 0; -+} -+ -+static inline void xhci_mtk_reset_bandwidth(struct usb_hcd *hcd, -+ struct usb_device *udev) -+{ -+} - #endif - - #endif /* _XHCI_MTK_H_ */ -diff --git a/drivers/usb/host/xhci-mvebu.c b/drivers/usb/host/xhci-mvebu.c -index 60651a50770f9..f27d5c2c42f31 100644 ---- a/drivers/usb/host/xhci-mvebu.c -+++ b/drivers/usb/host/xhci-mvebu.c -@@ -8,6 +8,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -74,6 +75,47 @@ int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd) - return 0; - } - -+int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd) -+{ -+ struct xhci_hcd *xhci = hcd_to_xhci(hcd); -+ struct device *dev = hcd->self.controller; -+ struct phy *phy; -+ int ret; -+ -+ /* Old bindings miss the PHY handle */ -+ phy = of_phy_get(dev->of_node, "usb3-phy"); -+ if (IS_ERR(phy) && PTR_ERR(phy) == -EPROBE_DEFER) -+ return -EPROBE_DEFER; -+ else if (IS_ERR(phy)) -+ goto phy_out; -+ -+ ret = phy_init(phy); -+ if (ret) -+ goto phy_put; -+ -+ ret = phy_set_mode(phy, PHY_MODE_USB_HOST_SS); -+ if (ret) -+ goto phy_exit; -+ -+ ret = phy_power_on(phy); -+ if (ret == -EOPNOTSUPP) { -+ /* Skip initializatin of XHCI PHY when it is unsupported by firmware */ -+ dev_warn(dev, "PHY unsupported by firmware\n"); -+ xhci->quirks |= XHCI_SKIP_PHY_INIT; -+ } -+ if (ret) -+ goto phy_exit; -+ -+ phy_power_off(phy); -+phy_exit: -+ phy_exit(phy); -+phy_put: -+ phy_put(phy); -+phy_out: -+ -+ return 0; -+} -+ - int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd) - { - struct xhci_hcd *xhci = hcd_to_xhci(hcd); -diff --git a/drivers/usb/host/xhci-mvebu.h b/drivers/usb/host/xhci-mvebu.h -index ca0a3a5721dd7..74b4d21a498a0 100644 ---- a/drivers/usb/host/xhci-mvebu.h -+++ b/drivers/usb/host/xhci-mvebu.h -@@ -12,6 +12,7 @@ struct usb_hcd; - - #if IS_ENABLED(CONFIG_USB_XHCI_MVEBU) - int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd); -+int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd); - int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd); - #else - static inline int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd) -@@ -19,6 +20,11 @@ static inline int xhci_mvebu_mbus_init_quirk(struct usb_hcd *hcd) - return 0; - } - -+static inline int xhci_mvebu_a3700_plat_setup(struct usb_hcd *hcd) -+{ -+ return 0; -+} -+ - static inline int xhci_mvebu_a3700_init_quirk(struct usb_hcd *hcd) - { - return 0; -diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c -index 52c625c023410..84cfa85442852 100644 ---- a/drivers/usb/host/xhci-plat.c -+++ b/drivers/usb/host/xhci-plat.c -@@ -44,6 +44,16 @@ static void xhci_priv_plat_start(struct usb_hcd *hcd) - priv->plat_start(hcd); - } - -+static int xhci_priv_plat_setup(struct usb_hcd *hcd) -+{ -+ struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); -+ -+ if (!priv->plat_setup) -+ return 0; -+ -+ return priv->plat_setup(hcd); -+} -+ - static int xhci_priv_init_quirk(struct usb_hcd *hcd) - { - struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); -@@ -101,6 +111,7 @@ static const struct xhci_plat_priv xhci_plat_marvell_armada = { - }; - - static const struct xhci_plat_priv xhci_plat_marvell_armada3700 = { -+ .plat_setup = xhci_mvebu_a3700_plat_setup, - .init_quirk = xhci_mvebu_a3700_init_quirk, - }; - -@@ -163,6 +174,8 @@ static int xhci_plat_probe(struct platform_device *pdev) - struct usb_hcd *hcd; - int ret; - int irq; -+ struct xhci_plat_priv *priv = NULL; -+ - - if (usb_disabled()) - return -ENODEV; -@@ -257,8 +270,7 @@ static int xhci_plat_probe(struct platform_device *pdev) - - priv_match = of_device_get_match_data(&pdev->dev); - if (priv_match) { -- struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); -- -+ priv = hcd_to_xhci_priv(hcd); - /* Just copy data for now */ - if (priv_match) - *priv = *priv_match; -@@ -307,6 +319,16 @@ static int xhci_plat_probe(struct platform_device *pdev) - - hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node); - xhci->shared_hcd->tpl_support = hcd->tpl_support; -+ -+ if (priv) { -+ ret = xhci_priv_plat_setup(hcd); -+ if (ret) -+ goto disable_usb_phy; -+ } -+ -+ if ((xhci->quirks & XHCI_SKIP_PHY_INIT) || (priv && (priv->quirks & XHCI_SKIP_PHY_INIT))) -+ hcd->skip_phy_initialization = 1; -+ - ret = usb_add_hcd(hcd, irq, IRQF_SHARED); - if (ret) - goto disable_usb_phy; -diff --git a/drivers/usb/host/xhci-plat.h b/drivers/usb/host/xhci-plat.h -index 5681723fc9cd7..b7749151bdfb8 100644 ---- a/drivers/usb/host/xhci-plat.h -+++ b/drivers/usb/host/xhci-plat.h -@@ -13,6 +13,7 @@ - struct xhci_plat_priv { - const char *firmware_name; - unsigned long long quirks; -+ int (*plat_setup)(struct usb_hcd *); - void (*plat_start)(struct usb_hcd *); - int (*init_quirk)(struct usb_hcd *); - int (*resume_quirk)(struct usb_hcd *); -diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index 52e156c018042..900ea91fb3c6b 100644 ---- a/drivers/usb/host/xhci-ring.c -+++ b/drivers/usb/host/xhci-ring.c -@@ -695,11 +695,16 @@ static void xhci_unmap_td_bounce_buffer(struct xhci_hcd *xhci, - dma_unmap_single(dev, seg->bounce_dma, ring->bounce_buf_len, - DMA_FROM_DEVICE); - /* for in tranfers we need to copy the data from bounce to sg */ -- len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs, seg->bounce_buf, -- seg->bounce_len, seg->bounce_offs); -- if (len != seg->bounce_len) -- xhci_warn(xhci, "WARN Wrong bounce buffer read length: %zu != %d\n", -- len, seg->bounce_len); -+ if (urb->num_sgs) { -+ len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs, seg->bounce_buf, -+ seg->bounce_len, seg->bounce_offs); -+ if (len != seg->bounce_len) -+ xhci_warn(xhci, "WARN Wrong bounce buffer read length: %zu != %d\n", -+ len, seg->bounce_len); -+ } else { -+ memcpy(urb->transfer_buffer + seg->bounce_offs, seg->bounce_buf, -+ seg->bounce_len); -+ } - seg->bounce_len = 0; - seg->bounce_offs = 0; - } -@@ -3263,12 +3268,16 @@ static int xhci_align_td(struct xhci_hcd *xhci, struct urb *urb, u32 enqd_len, - - /* create a max max_pkt sized bounce buffer pointed to by last trb */ - if (usb_urb_dir_out(urb)) { -- len = sg_pcopy_to_buffer(urb->sg, urb->num_sgs, -- seg->bounce_buf, new_buff_len, enqd_len); -- if (len != new_buff_len) -- xhci_warn(xhci, -- "WARN Wrong bounce buffer write length: %zu != %d\n", -- len, new_buff_len); -+ if (urb->num_sgs) { -+ len = sg_pcopy_to_buffer(urb->sg, urb->num_sgs, -+ seg->bounce_buf, new_buff_len, enqd_len); -+ if (len != new_buff_len) -+ xhci_warn(xhci, "WARN Wrong bounce buffer write length: %zu != %d\n", -+ len, new_buff_len); -+ } else { -+ memcpy(seg->bounce_buf, urb->transfer_buffer + enqd_len, new_buff_len); -+ } -+ - seg->bounce_dma = dma_map_single(dev, seg->bounce_buf, - max_pkt, DMA_TO_DEVICE); - } else { -diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index 70aa3055c41e7..91330517444e7 100644 ---- a/drivers/usb/host/xhci.c -+++ b/drivers/usb/host/xhci.c -@@ -2861,7 +2861,7 @@ static void xhci_check_bw_drop_ep_streams(struct xhci_hcd *xhci, - * else should be touching the xhci->devs[slot_id] structure, so we - * don't need to take the xhci->lock for manipulating that. - */ --static int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) -+int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) - { - int i; - int ret = 0; -@@ -2959,7 +2959,7 @@ command_cleanup: - return ret; - } - --static void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) -+void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) - { - struct xhci_hcd *xhci; - struct xhci_virt_device *virt_dev; -@@ -5380,6 +5380,10 @@ void xhci_init_driver(struct hc_driver *drv, - drv->reset = over->reset; - if (over->start) - drv->start = over->start; -+ if (over->check_bandwidth) -+ drv->check_bandwidth = over->check_bandwidth; -+ if (over->reset_bandwidth) -+ drv->reset_bandwidth = over->reset_bandwidth; - } - } - EXPORT_SYMBOL_GPL(xhci_init_driver); -diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index b483317bcb17b..1ad1d6e9e9979 100644 ---- a/drivers/usb/host/xhci.h -+++ b/drivers/usb/host/xhci.h -@@ -1873,6 +1873,7 @@ struct xhci_hcd { - #define XHCI_DEFAULT_PM_RUNTIME_ALLOW BIT_ULL(33) - #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) - #define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35) -+#define XHCI_SKIP_PHY_INIT BIT_ULL(37) - #define XHCI_DISABLE_SPARSE BIT_ULL(38) - - unsigned int num_active_eps; -@@ -1911,6 +1912,8 @@ struct xhci_driver_overrides { - size_t extra_priv_size; - int (*reset)(struct usb_hcd *hcd); - int (*start)(struct usb_hcd *hcd); -+ int (*check_bandwidth)(struct usb_hcd *, struct usb_device *); -+ void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); - }; - - #define XHCI_CFC_DELAY 10 -@@ -2063,6 +2066,8 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks); - void xhci_shutdown(struct usb_hcd *hcd); - void xhci_init_driver(struct hc_driver *drv, - const struct xhci_driver_overrides *over); -+int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); -+void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); - int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id); - int xhci_ext_cap_init(struct xhci_hcd *xhci); - -diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c -index 05cdad13933b1..cfc16943979d5 100644 ---- a/drivers/usb/renesas_usbhs/fifo.c -+++ b/drivers/usb/renesas_usbhs/fifo.c -@@ -126,6 +126,7 @@ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt) - } - - usbhs_pipe_clear_without_sequence(pipe, 0, 0); -+ usbhs_pipe_running(pipe, 0); - - __usbhsf_pkt_del(pkt); - } -diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c -index a90801ef00554..361a2e3ccad8d 100644 ---- a/drivers/usb/serial/cp210x.c -+++ b/drivers/usb/serial/cp210x.c -@@ -61,6 +61,7 @@ static const struct usb_device_id id_table[] = { - { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ - { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */ - { USB_DEVICE(0x0908, 0x01FF) }, /* Siemens RUGGEDCOM USB Serial Console */ -+ { USB_DEVICE(0x0988, 0x0578) }, /* Teraoka AD2000 */ - { USB_DEVICE(0x0B00, 0x3070) }, /* Ingenico 3070 */ - { USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */ - { USB_DEVICE(0x0BED, 0x1101) }, /* MEI series 2000 Combo Acceptor */ -@@ -201,6 +202,7 @@ static const struct usb_device_id id_table[] = { - { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */ - { USB_DEVICE(0x1901, 0x0195) }, /* GE B850/B650/B450 CP2104 DP UART interface */ - { USB_DEVICE(0x1901, 0x0196) }, /* GE B850 CP2105 DP UART interface */ -+ { USB_DEVICE(0x199B, 0xBA30) }, /* LORD WSDA-200-USB */ - { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */ - { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ - { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ -diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c -index fd41b07b5aaf1..f49eae18500cc 100644 ---- a/drivers/usb/serial/option.c -+++ b/drivers/usb/serial/option.c -@@ -425,6 +425,8 @@ static void option_instat_callback(struct urb *urb); - #define CINTERION_PRODUCT_AHXX_2RMNET 0x0084 - #define CINTERION_PRODUCT_AHXX_AUDIO 0x0085 - #define CINTERION_PRODUCT_CLS8 0x00b0 -+#define CINTERION_PRODUCT_MV31_MBIM 0x00b3 -+#define CINTERION_PRODUCT_MV31_RMNET 0x00b7 - - /* Olivetti products */ - #define OLIVETTI_VENDOR_ID 0x0b3c -@@ -1914,6 +1916,10 @@ static const struct usb_device_id option_ids[] = { - { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) }, - { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */ - { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, -+ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_MBIM, 0xff), -+ .driver_info = RSVD(3)}, -+ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_RMNET, 0xff), -+ .driver_info = RSVD(0)}, - { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100), - .driver_info = RSVD(4) }, - { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120), -diff --git a/fs/afs/main.c b/fs/afs/main.c -index c9c45d7078bd1..5cd26af2464c9 100644 ---- a/fs/afs/main.c -+++ b/fs/afs/main.c -@@ -186,7 +186,7 @@ static int __init afs_init(void) - goto error_cache; - #endif - -- ret = register_pernet_subsys(&afs_net_ops); -+ ret = register_pernet_device(&afs_net_ops); - if (ret < 0) - goto error_net; - -@@ -206,7 +206,7 @@ static int __init afs_init(void) - error_proc: - afs_fs_exit(); - error_fs: -- unregister_pernet_subsys(&afs_net_ops); -+ unregister_pernet_device(&afs_net_ops); - error_net: - #ifdef CONFIG_AFS_FSCACHE - fscache_unregister_netfs(&afs_cache_netfs); -@@ -237,7 +237,7 @@ static void __exit afs_exit(void) - - proc_remove(afs_proc_symlink); - afs_fs_exit(); -- unregister_pernet_subsys(&afs_net_ops); -+ unregister_pernet_device(&afs_net_ops); - #ifdef CONFIG_AFS_FSCACHE - fscache_unregister_netfs(&afs_cache_netfs); - #endif -diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c -index 5a35850ccb1ab..9ae9a514676c3 100644 ---- a/fs/cifs/dir.c -+++ b/fs/cifs/dir.c -@@ -738,6 +738,7 @@ static int - cifs_d_revalidate(struct dentry *direntry, unsigned int flags) - { - struct inode *inode; -+ int rc; - - if (flags & LOOKUP_RCU) - return -ECHILD; -@@ -747,8 +748,25 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags) - if ((flags & LOOKUP_REVAL) && !CIFS_CACHE_READ(CIFS_I(inode))) - CIFS_I(inode)->time = 0; /* force reval */ - -- if (cifs_revalidate_dentry(direntry)) -- return 0; -+ rc = cifs_revalidate_dentry(direntry); -+ if (rc) { -+ cifs_dbg(FYI, "cifs_revalidate_dentry failed with rc=%d", rc); -+ switch (rc) { -+ case -ENOENT: -+ case -ESTALE: -+ /* -+ * Those errors mean the dentry is invalid -+ * (file was deleted or recreated) -+ */ -+ return 0; -+ default: -+ /* -+ * Otherwise some unexpected error happened -+ * report it as-is to VFS layer -+ */ -+ return rc; -+ } -+ } - else { - /* - * If the inode wasn't known to be a dfs entry when -diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h -index 2482978f09486..739556e385be8 100644 ---- a/fs/cifs/smb2pdu.h -+++ b/fs/cifs/smb2pdu.h -@@ -227,7 +227,7 @@ struct smb2_negotiate_req { - __le32 NegotiateContextOffset; /* SMB3.1.1 only. MBZ earlier */ - __le16 NegotiateContextCount; /* SMB3.1.1 only. MBZ earlier */ - __le16 Reserved2; -- __le16 Dialects[1]; /* One dialect (vers=) at a time for now */ -+ __le16 Dialects[4]; /* BB expand this if autonegotiate > 4 dialects */ - } __packed; - - /* Dialects */ -diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c -index 4ffbf8f965814..eab7940bfebef 100644 ---- a/fs/cifs/transport.c -+++ b/fs/cifs/transport.c -@@ -659,10 +659,22 @@ wait_for_compound_request(struct TCP_Server_Info *server, int num, - spin_lock(&server->req_lock); - if (*credits < num) { - /* -- * Return immediately if not too many requests in flight since -- * we will likely be stuck on waiting for credits. -+ * If the server is tight on resources or just gives us less -+ * credits for other reasons (e.g. requests are coming out of -+ * order and the server delays granting more credits until it -+ * processes a missing mid) and we exhausted most available -+ * credits there may be situations when we try to send -+ * a compound request but we don't have enough credits. At this -+ * point the client needs to decide if it should wait for -+ * additional credits or fail the request. If at least one -+ * request is in flight there is a high probability that the -+ * server will return enough credits to satisfy this compound -+ * request. -+ * -+ * Return immediately if no requests in flight since we will be -+ * stuck on waiting for credits. - */ -- if (server->in_flight < num - *credits) { -+ if (server->in_flight == 0) { - spin_unlock(&server->req_lock); - return -ENOTSUPP; - } -diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c -index 5fff7cb3582f0..cf3af2140c3d8 100644 ---- a/fs/hugetlbfs/inode.c -+++ b/fs/hugetlbfs/inode.c -@@ -675,9 +675,10 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, - - mutex_unlock(&hugetlb_fault_mutex_table[hash]); - -+ set_page_huge_active(page); - /* - * unlock_page because locked by add_to_page_cache() -- * page_put due to reference from alloc_huge_page() -+ * put_page() due to reference from alloc_huge_page() - */ - unlock_page(page); - put_page(page); -diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c -index 29abdb1d3b5c6..6509ec3cb3730 100644 ---- a/fs/overlayfs/dir.c -+++ b/fs/overlayfs/dir.c -@@ -940,8 +940,8 @@ static char *ovl_get_redirect(struct dentry *dentry, bool abs_redirect) - - buflen -= thislen; - memcpy(&buf[buflen], name, thislen); -- tmp = dget_dlock(d->d_parent); - spin_unlock(&d->d_lock); -+ tmp = dget_parent(d); - - dput(d); - d = tmp; -diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h -index 8a03f392f3680..0e080ba5efbcc 100644 ---- a/include/linux/hugetlb.h -+++ b/include/linux/hugetlb.h -@@ -590,6 +590,8 @@ static inline void huge_ptep_modify_prot_commit(struct vm_area_struct *vma, - } - #endif - -+void set_page_huge_active(struct page *page); -+ - #else /* CONFIG_HUGETLB_PAGE */ - struct hstate {}; - -diff --git a/include/linux/msi.h b/include/linux/msi.h -index 8ad679e9d9c04..d695e2eb2092d 100644 ---- a/include/linux/msi.h -+++ b/include/linux/msi.h -@@ -139,6 +139,12 @@ struct msi_desc { - list_for_each_entry((desc), dev_to_msi_list((dev)), list) - #define for_each_msi_entry_safe(desc, tmp, dev) \ - list_for_each_entry_safe((desc), (tmp), dev_to_msi_list((dev)), list) -+#define for_each_msi_vector(desc, __irq, dev) \ -+ for_each_msi_entry((desc), (dev)) \ -+ if ((desc)->irq) \ -+ for (__irq = (desc)->irq; \ -+ __irq < ((desc)->irq + (desc)->nvec_used); \ -+ __irq++) - - #ifdef CONFIG_IRQ_MSI_IOMMU - static inline const void *msi_desc_get_iommu_cookie(struct msi_desc *desc) -diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h -index 3d03756e10699..b2ceec7b280d4 100644 ---- a/include/net/sch_generic.h -+++ b/include/net/sch_generic.h -@@ -1158,7 +1158,7 @@ static inline struct Qdisc *qdisc_replace(struct Qdisc *sch, struct Qdisc *new, - old = *pold; - *pold = new; - if (old != NULL) -- qdisc_tree_flush_backlog(old); -+ qdisc_purge_queue(old); - sch_tree_unlock(sch); - - return old; -diff --git a/init/init_task.c b/init/init_task.c -index df7041be96fca..5d8359c44564a 100644 ---- a/init/init_task.c -+++ b/init/init_task.c -@@ -171,7 +171,8 @@ struct task_struct init_task - .lockdep_recursion = 0, - #endif - #ifdef CONFIG_FUNCTION_GRAPH_TRACER -- .ret_stack = NULL, -+ .ret_stack = NULL, -+ .tracing_graph_pause = ATOMIC_INIT(0), - #endif - #if defined(CONFIG_TRACING) && defined(CONFIG_PREEMPTION) - .trace_recursion = 0, -diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c -index 5a8b4dfdb1419..c2f0aa818b7af 100644 ---- a/kernel/bpf/cgroup.c -+++ b/kernel/bpf/cgroup.c -@@ -1109,6 +1109,11 @@ int __cgroup_bpf_run_filter_getsockopt(struct sock *sk, int level, - goto out; - } - -+ if (ctx.optlen < 0) { -+ ret = -EFAULT; -+ goto out; -+ } -+ - if (copy_from_user(ctx.optval, optval, - min(ctx.optlen, max_optlen)) != 0) { - ret = -EFAULT; -@@ -1126,7 +1131,7 @@ int __cgroup_bpf_run_filter_getsockopt(struct sock *sk, int level, - goto out; - } - -- if (ctx.optlen > max_optlen) { -+ if (ctx.optlen > max_optlen || ctx.optlen < 0) { - ret = -EFAULT; - goto out; - } -diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c -index eb95f6106a1ee..5d3da0db092ff 100644 ---- a/kernel/irq/msi.c -+++ b/kernel/irq/msi.c -@@ -437,22 +437,22 @@ int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev, - - can_reserve = msi_check_reservation_mode(domain, info, dev); - -- for_each_msi_entry(desc, dev) { -- virq = desc->irq; -- if (desc->nvec_used == 1) -- dev_dbg(dev, "irq %d for MSI\n", virq); -- else -+ /* -+ * This flag is set by the PCI layer as we need to activate -+ * the MSI entries before the PCI layer enables MSI in the -+ * card. Otherwise the card latches a random msi message. -+ */ -+ if (!(info->flags & MSI_FLAG_ACTIVATE_EARLY)) -+ goto skip_activate; -+ -+ for_each_msi_vector(desc, i, dev) { -+ if (desc->irq == i) { -+ virq = desc->irq; - dev_dbg(dev, "irq [%d-%d] for MSI\n", - virq, virq + desc->nvec_used - 1); -- /* -- * This flag is set by the PCI layer as we need to activate -- * the MSI entries before the PCI layer enables MSI in the -- * card. Otherwise the card latches a random msi message. -- */ -- if (!(info->flags & MSI_FLAG_ACTIVATE_EARLY)) -- continue; -+ } - -- irq_data = irq_domain_get_irq_data(domain, desc->irq); -+ irq_data = irq_domain_get_irq_data(domain, i); - if (!can_reserve) { - irqd_clr_can_reserve(irq_data); - if (domain->flags & IRQ_DOMAIN_MSI_NOMASK_QUIRK) -@@ -463,28 +463,24 @@ int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev, - goto cleanup; - } - -+skip_activate: - /* - * If these interrupts use reservation mode, clear the activated bit - * so request_irq() will assign the final vector. - */ - if (can_reserve) { -- for_each_msi_entry(desc, dev) { -- irq_data = irq_domain_get_irq_data(domain, desc->irq); -+ for_each_msi_vector(desc, i, dev) { -+ irq_data = irq_domain_get_irq_data(domain, i); - irqd_clr_activated(irq_data); - } - } - return 0; - - cleanup: -- for_each_msi_entry(desc, dev) { -- struct irq_data *irqd; -- -- if (desc->irq == virq) -- break; -- -- irqd = irq_domain_get_irq_data(domain, desc->irq); -- if (irqd_is_activated(irqd)) -- irq_domain_deactivate_irq(irqd); -+ for_each_msi_vector(desc, i, dev) { -+ irq_data = irq_domain_get_irq_data(domain, i); -+ if (irqd_is_activated(irq_data)) -+ irq_domain_deactivate_irq(irq_data); - } - msi_domain_free_irqs(domain, dev); - return ret; -diff --git a/kernel/kprobes.c b/kernel/kprobes.c -index 283c8b01ce789..26ae92c12fc22 100644 ---- a/kernel/kprobes.c -+++ b/kernel/kprobes.c -@@ -1972,6 +1972,10 @@ int register_kretprobe(struct kretprobe *rp) - if (!kprobe_on_func_entry(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset)) - return -EINVAL; - -+ /* If only rp->kp.addr is specified, check reregistering kprobes */ -+ if (rp->kp.addr && check_kprobe_rereg(&rp->kp)) -+ return -EINVAL; -+ - if (kretprobe_blacklist_size) { - addr = kprobe_addr(&rp->kp); - if (IS_ERR(addr)) -diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c -index 7950a0356042a..888cd00174fe3 100644 ---- a/kernel/trace/fgraph.c -+++ b/kernel/trace/fgraph.c -@@ -367,7 +367,6 @@ static int alloc_retstack_tasklist(struct ftrace_ret_stack **ret_stack_list) - } - - if (t->ret_stack == NULL) { -- atomic_set(&t->tracing_graph_pause, 0); - atomic_set(&t->trace_overrun, 0); - t->curr_ret_stack = -1; - t->curr_ret_depth = -1; -@@ -462,7 +461,6 @@ static DEFINE_PER_CPU(struct ftrace_ret_stack *, idle_ret_stack); - static void - graph_init_task(struct task_struct *t, struct ftrace_ret_stack *ret_stack) - { -- atomic_set(&t->tracing_graph_pause, 0); - atomic_set(&t->trace_overrun, 0); - t->ftrace_timestamp = 0; - /* make curr_ret_stack visible before we add the ret_stack */ -diff --git a/mm/compaction.c b/mm/compaction.c -index 92470625f0b1e..88c3f6bad1aba 100644 ---- a/mm/compaction.c -+++ b/mm/compaction.c -@@ -1276,7 +1276,7 @@ fast_isolate_freepages(struct compact_control *cc) - { - unsigned int limit = min(1U, freelist_scan_limit(cc) >> 1); - unsigned int nr_scanned = 0; -- unsigned long low_pfn, min_pfn, high_pfn = 0, highest = 0; -+ unsigned long low_pfn, min_pfn, highest = 0; - unsigned long nr_isolated = 0; - unsigned long distance; - struct page *page = NULL; -@@ -1321,6 +1321,7 @@ fast_isolate_freepages(struct compact_control *cc) - struct page *freepage; - unsigned long flags; - unsigned int order_scanned = 0; -+ unsigned long high_pfn = 0; - - if (!area->nr_free) - continue; -diff --git a/mm/huge_memory.c b/mm/huge_memory.c -index 11aa763a31440..7bbf419bb86d6 100644 ---- a/mm/huge_memory.c -+++ b/mm/huge_memory.c -@@ -2306,7 +2306,7 @@ void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, - { - spinlock_t *ptl; - struct mmu_notifier_range range; -- bool was_locked = false; -+ bool do_unlock_page = false; - pmd_t _pmd; - - mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, vma, vma->vm_mm, -@@ -2322,7 +2322,6 @@ void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, - VM_BUG_ON(freeze && !page); - if (page) { - VM_WARN_ON_ONCE(!PageLocked(page)); -- was_locked = true; - if (page != pmd_page(*pmd)) - goto out; - } -@@ -2331,19 +2330,29 @@ repeat: - if (pmd_trans_huge(*pmd)) { - if (!page) { - page = pmd_page(*pmd); -- if (unlikely(!trylock_page(page))) { -- get_page(page); -- _pmd = *pmd; -- spin_unlock(ptl); -- lock_page(page); -- spin_lock(ptl); -- if (unlikely(!pmd_same(*pmd, _pmd))) { -- unlock_page(page); -+ /* -+ * An anonymous page must be locked, to ensure that a -+ * concurrent reuse_swap_page() sees stable mapcount; -+ * but reuse_swap_page() is not used on shmem or file, -+ * and page lock must not be taken when zap_pmd_range() -+ * calls __split_huge_pmd() while i_mmap_lock is held. -+ */ -+ if (PageAnon(page)) { -+ if (unlikely(!trylock_page(page))) { -+ get_page(page); -+ _pmd = *pmd; -+ spin_unlock(ptl); -+ lock_page(page); -+ spin_lock(ptl); -+ if (unlikely(!pmd_same(*pmd, _pmd))) { -+ unlock_page(page); -+ put_page(page); -+ page = NULL; -+ goto repeat; -+ } - put_page(page); -- page = NULL; -- goto repeat; - } -- put_page(page); -+ do_unlock_page = true; - } - } - if (PageMlocked(page)) -@@ -2353,7 +2362,7 @@ repeat: - __split_huge_pmd_locked(vma, pmd, range.start, freeze); - out: - spin_unlock(ptl); -- if (!was_locked && page) -+ if (do_unlock_page) - unlock_page(page); - /* - * No need to double call mmu_notifier->invalidate_range() callback. -diff --git a/mm/hugetlb.c b/mm/hugetlb.c -index 3bc33fa838177..d5b03b9262d4f 100644 ---- a/mm/hugetlb.c -+++ b/mm/hugetlb.c -@@ -71,6 +71,21 @@ DEFINE_SPINLOCK(hugetlb_lock); - static int num_fault_mutexes; - struct mutex *hugetlb_fault_mutex_table ____cacheline_aligned_in_smp; - -+static inline bool PageHugeFreed(struct page *head) -+{ -+ return page_private(head + 4) == -1UL; -+} -+ -+static inline void SetPageHugeFreed(struct page *head) -+{ -+ set_page_private(head + 4, -1UL); -+} -+ -+static inline void ClearPageHugeFreed(struct page *head) -+{ -+ set_page_private(head + 4, 0); -+} -+ - /* Forward declaration */ - static int hugetlb_acct_memory(struct hstate *h, long delta); - -@@ -869,6 +884,7 @@ static void enqueue_huge_page(struct hstate *h, struct page *page) - list_move(&page->lru, &h->hugepage_freelists[nid]); - h->free_huge_pages++; - h->free_huge_pages_node[nid]++; -+ SetPageHugeFreed(page); - } - - static struct page *dequeue_huge_page_node_exact(struct hstate *h, int nid) -@@ -886,6 +902,7 @@ static struct page *dequeue_huge_page_node_exact(struct hstate *h, int nid) - return NULL; - list_move(&page->lru, &h->hugepage_activelist); - set_page_refcounted(page); -+ ClearPageHugeFreed(page); - h->free_huge_pages--; - h->free_huge_pages_node[nid]--; - return page; -@@ -1217,12 +1234,11 @@ struct hstate *size_to_hstate(unsigned long size) - */ - bool page_huge_active(struct page *page) - { -- VM_BUG_ON_PAGE(!PageHuge(page), page); -- return PageHead(page) && PagePrivate(&page[1]); -+ return PageHeadHuge(page) && PagePrivate(&page[1]); - } - - /* never called for tail page */ --static void set_page_huge_active(struct page *page) -+void set_page_huge_active(struct page *page) - { - VM_BUG_ON_PAGE(!PageHeadHuge(page), page); - SetPagePrivate(&page[1]); -@@ -1375,6 +1391,7 @@ static void prep_new_huge_page(struct hstate *h, struct page *page, int nid) - set_hugetlb_cgroup(page, NULL); - h->nr_huge_pages++; - h->nr_huge_pages_node[nid]++; -+ ClearPageHugeFreed(page); - spin_unlock(&hugetlb_lock); - } - -@@ -1602,6 +1619,7 @@ int dissolve_free_huge_page(struct page *page) - { - int rc = -EBUSY; - -+retry: - /* Not to disrupt normal path by vainly holding hugetlb_lock */ - if (!PageHuge(page)) - return 0; -@@ -1618,6 +1636,26 @@ int dissolve_free_huge_page(struct page *page) - int nid = page_to_nid(head); - if (h->free_huge_pages - h->resv_huge_pages == 0) - goto out; -+ -+ /* -+ * We should make sure that the page is already on the free list -+ * when it is dissolved. -+ */ -+ if (unlikely(!PageHugeFreed(head))) { -+ spin_unlock(&hugetlb_lock); -+ cond_resched(); -+ -+ /* -+ * Theoretically, we should return -EBUSY when we -+ * encounter this race. In fact, we have a chance -+ * to successfully dissolve the page if we do a -+ * retry. Because the race window is quite small. -+ * If we seize this opportunity, it is an optimization -+ * for increasing the success rate of dissolving page. -+ */ -+ goto retry; -+ } -+ - /* - * Move PageHWPoison flag from head page to the raw error page, - * which makes any subpages rather than the error page reusable. -@@ -5136,9 +5174,9 @@ bool isolate_huge_page(struct page *page, struct list_head *list) - { - bool ret = true; - -- VM_BUG_ON_PAGE(!PageHead(page), page); - spin_lock(&hugetlb_lock); -- if (!page_huge_active(page) || !get_page_unless_zero(page)) { -+ if (!PageHeadHuge(page) || !page_huge_active(page) || -+ !get_page_unless_zero(page)) { - ret = false; - goto unlock; - } -diff --git a/mm/memblock.c b/mm/memblock.c -index c4b16cae2bc9b..11f6ae37d6699 100644 ---- a/mm/memblock.c -+++ b/mm/memblock.c -@@ -257,14 +257,6 @@ __memblock_find_range_top_down(phys_addr_t start, phys_addr_t end, - * - * Find @size free area aligned to @align in the specified range and node. - * -- * When allocation direction is bottom-up, the @start should be greater -- * than the end of the kernel image. Otherwise, it will be trimmed. The -- * reason is that we want the bottom-up allocation just near the kernel -- * image so it is highly likely that the allocated memory and the kernel -- * will reside in the same node. -- * -- * If bottom-up allocation failed, will try to allocate memory top-down. -- * - * Return: - * Found address on success, 0 on failure. - */ -@@ -273,8 +265,6 @@ static phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size, - phys_addr_t end, int nid, - enum memblock_flags flags) - { -- phys_addr_t kernel_end, ret; -- - /* pump up @end */ - if (end == MEMBLOCK_ALLOC_ACCESSIBLE || - end == MEMBLOCK_ALLOC_KASAN) -@@ -283,40 +273,13 @@ static phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size, - /* avoid allocating the first page */ - start = max_t(phys_addr_t, start, PAGE_SIZE); - end = max(start, end); -- kernel_end = __pa_symbol(_end); -- -- /* -- * try bottom-up allocation only when bottom-up mode -- * is set and @end is above the kernel image. -- */ -- if (memblock_bottom_up() && end > kernel_end) { -- phys_addr_t bottom_up_start; -- -- /* make sure we will allocate above the kernel */ -- bottom_up_start = max(start, kernel_end); - -- /* ok, try bottom-up allocation first */ -- ret = __memblock_find_range_bottom_up(bottom_up_start, end, -- size, align, nid, flags); -- if (ret) -- return ret; -- -- /* -- * we always limit bottom-up allocation above the kernel, -- * but top-down allocation doesn't have the limit, so -- * retrying top-down allocation may succeed when bottom-up -- * allocation failed. -- * -- * bottom-up allocation is expected to be fail very rarely, -- * so we use WARN_ONCE() here to see the stack trace if -- * fail happens. -- */ -- WARN_ONCE(IS_ENABLED(CONFIG_MEMORY_HOTREMOVE), -- "memblock: bottom-up allocation failed, memory hotremove may be affected\n"); -- } -- -- return __memblock_find_range_top_down(start, end, size, align, nid, -- flags); -+ if (memblock_bottom_up()) -+ return __memblock_find_range_bottom_up(start, end, size, align, -+ nid, flags); -+ else -+ return __memblock_find_range_top_down(start, end, size, align, -+ nid, flags); - } - - /** -diff --git a/net/core/neighbour.c b/net/core/neighbour.c -index 6c270fce200f4..7080d708b7d08 100644 ---- a/net/core/neighbour.c -+++ b/net/core/neighbour.c -@@ -1244,13 +1244,14 @@ static int __neigh_update(struct neighbour *neigh, const u8 *lladdr, - old = neigh->nud_state; - err = -EPERM; - -- if (!(flags & NEIGH_UPDATE_F_ADMIN) && -- (old & (NUD_NOARP | NUD_PERMANENT))) -- goto out; - if (neigh->dead) { - NL_SET_ERR_MSG(extack, "Neighbor entry is now dead"); -+ new = old; - goto out; - } -+ if (!(flags & NEIGH_UPDATE_F_ADMIN) && -+ (old & (NUD_NOARP | NUD_PERMANENT))) -+ goto out; - - ext_learn_change = neigh_update_ext_learned(neigh, flags, ¬ify); - -diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c -index ca525cf681a4e..f64d1743b86d6 100644 ---- a/net/ipv4/ip_tunnel.c -+++ b/net/ipv4/ip_tunnel.c -@@ -317,7 +317,7 @@ static int ip_tunnel_bind_dev(struct net_device *dev) - } - - dev->needed_headroom = t_hlen + hlen; -- mtu -= (dev->hard_header_len + t_hlen); -+ mtu -= t_hlen; - - if (mtu < IPV4_MIN_MTU) - mtu = IPV4_MIN_MTU; -@@ -347,7 +347,7 @@ static struct ip_tunnel *ip_tunnel_create(struct net *net, - nt = netdev_priv(dev); - t_hlen = nt->hlen + sizeof(struct iphdr); - dev->min_mtu = ETH_MIN_MTU; -- dev->max_mtu = IP_MAX_MTU - dev->hard_header_len - t_hlen; -+ dev->max_mtu = IP_MAX_MTU - t_hlen; - ip_tunnel_add(itn, nt); - return nt; - -@@ -494,11 +494,10 @@ static int tnl_update_pmtu(struct net_device *dev, struct sk_buff *skb, - int mtu; - - tunnel_hlen = md ? tunnel_hlen : tunnel->hlen; -- pkt_size = skb->len - tunnel_hlen - dev->hard_header_len; -+ pkt_size = skb->len - tunnel_hlen; - - if (df) -- mtu = dst_mtu(&rt->dst) - dev->hard_header_len -- - sizeof(struct iphdr) - tunnel_hlen; -+ mtu = dst_mtu(&rt->dst) - (sizeof(struct iphdr) + tunnel_hlen); - else - mtu = skb_valid_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu; - -@@ -964,7 +963,7 @@ int __ip_tunnel_change_mtu(struct net_device *dev, int new_mtu, bool strict) - { - struct ip_tunnel *tunnel = netdev_priv(dev); - int t_hlen = tunnel->hlen + sizeof(struct iphdr); -- int max_mtu = IP_MAX_MTU - dev->hard_header_len - t_hlen; -+ int max_mtu = IP_MAX_MTU - t_hlen; - - if (new_mtu < ETH_MIN_MTU) - return -EINVAL; -@@ -1141,10 +1140,9 @@ int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[], - - mtu = ip_tunnel_bind_dev(dev); - if (tb[IFLA_MTU]) { -- unsigned int max = IP_MAX_MTU - dev->hard_header_len - nt->hlen; -+ unsigned int max = IP_MAX_MTU - (nt->hlen + sizeof(struct iphdr)); - -- mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU, -- (unsigned int)(max - sizeof(struct iphdr))); -+ mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU, max); - } - - err = dev_set_mtu(dev, mtu); -diff --git a/net/lapb/lapb_out.c b/net/lapb/lapb_out.c -index 7a4d0715d1c32..a966d29c772d9 100644 ---- a/net/lapb/lapb_out.c -+++ b/net/lapb/lapb_out.c -@@ -82,7 +82,8 @@ void lapb_kick(struct lapb_cb *lapb) - skb = skb_dequeue(&lapb->write_queue); - - do { -- if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) { -+ skbn = skb_copy(skb, GFP_ATOMIC); -+ if (!skbn) { - skb_queue_head(&lapb->write_queue, skb); - break; - } -diff --git a/net/mac80211/driver-ops.c b/net/mac80211/driver-ops.c -index c9a8a2433e8ac..48322e45e7ddb 100644 ---- a/net/mac80211/driver-ops.c -+++ b/net/mac80211/driver-ops.c -@@ -125,8 +125,11 @@ int drv_sta_state(struct ieee80211_local *local, - } else if (old_state == IEEE80211_STA_AUTH && - new_state == IEEE80211_STA_ASSOC) { - ret = drv_sta_add(local, sdata, &sta->sta); -- if (ret == 0) -+ if (ret == 0) { - sta->uploaded = true; -+ if (rcu_access_pointer(sta->sta.rates)) -+ drv_sta_rate_tbl_update(local, sdata, &sta->sta); -+ } - } else if (old_state == IEEE80211_STA_ASSOC && - new_state == IEEE80211_STA_AUTH) { - drv_sta_remove(local, sdata, &sta->sta); -diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c -index b051f125d3af2..9841db84bce0a 100644 ---- a/net/mac80211/rate.c -+++ b/net/mac80211/rate.c -@@ -934,7 +934,8 @@ int rate_control_set_rates(struct ieee80211_hw *hw, - if (old) - kfree_rcu(old, rcu_head); - -- drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta); -+ if (sta->uploaded) -+ drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta); - - ieee80211_sta_set_expected_throughput(pubsta, sta_get_expected_throughput(sta)); - -diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c -index 2921fc2767134..9bacec6653bac 100644 ---- a/net/rxrpc/af_rxrpc.c -+++ b/net/rxrpc/af_rxrpc.c -@@ -976,7 +976,7 @@ static int __init af_rxrpc_init(void) - goto error_security; - } - -- ret = register_pernet_subsys(&rxrpc_net_ops); -+ ret = register_pernet_device(&rxrpc_net_ops); - if (ret) - goto error_pernet; - -@@ -1021,7 +1021,7 @@ error_key_type: - error_sock: - proto_unregister(&rxrpc_proto); - error_proto: -- unregister_pernet_subsys(&rxrpc_net_ops); -+ unregister_pernet_device(&rxrpc_net_ops); - error_pernet: - rxrpc_exit_security(); - error_security: -@@ -1043,7 +1043,7 @@ static void __exit af_rxrpc_exit(void) - unregister_key_type(&key_type_rxrpc); - sock_unregister(PF_RXRPC); - proto_unregister(&rxrpc_proto); -- unregister_pernet_subsys(&rxrpc_net_ops); -+ unregister_pernet_device(&rxrpc_net_ops); - ASSERTCMP(atomic_read(&rxrpc_n_tx_skbs), ==, 0); - ASSERTCMP(atomic_read(&rxrpc_n_rx_skbs), ==, 0); - diff --git a/patch/kernel/odroidxu4-current/patch-5.4.97-98.patch b/patch/kernel/odroidxu4-current/patch-5.4.97-98.patch deleted file mode 100644 index 6e7c8524e0..0000000000 --- a/patch/kernel/odroidxu4-current/patch-5.4.97-98.patch +++ /dev/null @@ -1,1203 +0,0 @@ -diff --git a/Makefile b/Makefile -index 032751f6be0c1..4f6bfcf434e80 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - VERSION = 5 - PATCHLEVEL = 4 --SUBLEVEL = 97 -+SUBLEVEL = 98 - EXTRAVERSION = - NAME = Kleptomaniac Octopus - -diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c -index 4906e480b5bb6..296b0d7570d06 100644 ---- a/arch/x86/kvm/svm.c -+++ b/arch/x86/kvm/svm.c -@@ -1835,6 +1835,8 @@ static struct page **sev_pin_memory(struct kvm *kvm, unsigned long uaddr, - struct page **pages; - unsigned long first, last; - -+ lockdep_assert_held(&kvm->lock); -+ - if (ulen == 0 || uaddr + ulen < uaddr) - return NULL; - -@@ -7091,12 +7093,21 @@ static int svm_register_enc_region(struct kvm *kvm, - if (!region) - return -ENOMEM; - -+ mutex_lock(&kvm->lock); - region->pages = sev_pin_memory(kvm, range->addr, range->size, ®ion->npages, 1); - if (!region->pages) { - ret = -ENOMEM; -+ mutex_unlock(&kvm->lock); - goto e_free; - } - -+ region->uaddr = range->addr; -+ region->size = range->size; -+ -+ mutex_lock(&kvm->lock); -+ list_add_tail(®ion->list, &sev->regions_list); -+ mutex_unlock(&kvm->lock); -+ - /* - * The guest may change the memory encryption attribute from C=0 -> C=1 - * or vice versa for this memory range. Lets make sure caches are -@@ -7105,13 +7116,6 @@ static int svm_register_enc_region(struct kvm *kvm, - */ - sev_clflush_pages(region->pages, region->npages); - -- region->uaddr = range->addr; -- region->size = range->size; -- -- mutex_lock(&kvm->lock); -- list_add_tail(®ion->list, &sev->regions_list); -- mutex_unlock(&kvm->lock); -- - return ret; - - e_free: -diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c -index 3d34ac02d76ef..cb3d44d200055 100644 ---- a/block/blk-cgroup.c -+++ b/block/blk-cgroup.c -@@ -1089,6 +1089,8 @@ static void blkcg_css_offline(struct cgroup_subsys_state *css) - */ - void blkcg_destroy_blkgs(struct blkcg *blkcg) - { -+ might_sleep(); -+ - spin_lock_irq(&blkcg->lock); - - while (!hlist_empty(&blkcg->blkg_list)) { -@@ -1096,14 +1098,20 @@ void blkcg_destroy_blkgs(struct blkcg *blkcg) - struct blkcg_gq, blkcg_node); - struct request_queue *q = blkg->q; - -- if (spin_trylock(&q->queue_lock)) { -- blkg_destroy(blkg); -- spin_unlock(&q->queue_lock); -- } else { -+ if (need_resched() || !spin_trylock(&q->queue_lock)) { -+ /* -+ * Given that the system can accumulate a huge number -+ * of blkgs in pathological cases, check to see if we -+ * need to rescheduling to avoid softlockup. -+ */ - spin_unlock_irq(&blkcg->lock); -- cpu_relax(); -+ cond_resched(); - spin_lock_irq(&blkcg->lock); -+ continue; - } -+ -+ blkg_destroy(blkg); -+ spin_unlock(&q->queue_lock); - } - - spin_unlock_irq(&blkcg->lock); -diff --git a/drivers/crypto/chelsio/chtls/chtls_cm.c b/drivers/crypto/chelsio/chtls/chtls_cm.c -index eddc6d1bdb2d1..82b76df43ae57 100644 ---- a/drivers/crypto/chelsio/chtls/chtls_cm.c -+++ b/drivers/crypto/chelsio/chtls/chtls_cm.c -@@ -1047,11 +1047,9 @@ static struct sock *chtls_recv_sock(struct sock *lsk, - - n = dst_neigh_lookup(dst, &iph->saddr); - if (!n || !n->dev) -- goto free_sk; -+ goto free_dst; - - ndev = n->dev; -- if (!ndev) -- goto free_dst; - if (is_vlan_dev(ndev)) - ndev = vlan_dev_real_dev(ndev); - -@@ -1117,7 +1115,8 @@ static struct sock *chtls_recv_sock(struct sock *lsk, - free_csk: - chtls_sock_release(&csk->kref); - free_dst: -- neigh_release(n); -+ if (n) -+ neigh_release(n); - dst_release(dst); - free_sk: - inet_csk_prepare_forced_close(newsk); -diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c -index 5a9f0d17f52c8..e1ef0122ef759 100644 ---- a/drivers/i2c/busses/i2c-mt65xx.c -+++ b/drivers/i2c/busses/i2c-mt65xx.c -@@ -1008,7 +1008,8 @@ static int mtk_i2c_probe(struct platform_device *pdev) - mtk_i2c_clock_disable(i2c); - - ret = devm_request_irq(&pdev->dev, irq, mtk_i2c_irq, -- IRQF_TRIGGER_NONE, I2C_DRV_NAME, i2c); -+ IRQF_NO_SUSPEND | IRQF_TRIGGER_NONE, -+ I2C_DRV_NAME, i2c); - if (ret < 0) { - dev_err(&pdev->dev, - "Request I2C IRQ %d fail\n", irq); -@@ -1035,7 +1036,16 @@ static int mtk_i2c_remove(struct platform_device *pdev) - } - - #ifdef CONFIG_PM_SLEEP --static int mtk_i2c_resume(struct device *dev) -+static int mtk_i2c_suspend_noirq(struct device *dev) -+{ -+ struct mtk_i2c *i2c = dev_get_drvdata(dev); -+ -+ i2c_mark_adapter_suspended(&i2c->adap); -+ -+ return 0; -+} -+ -+static int mtk_i2c_resume_noirq(struct device *dev) - { - int ret; - struct mtk_i2c *i2c = dev_get_drvdata(dev); -@@ -1050,12 +1060,15 @@ static int mtk_i2c_resume(struct device *dev) - - mtk_i2c_clock_disable(i2c); - -+ i2c_mark_adapter_resumed(&i2c->adap); -+ - return 0; - } - #endif - - static const struct dev_pm_ops mtk_i2c_pm = { -- SET_SYSTEM_SLEEP_PM_OPS(NULL, mtk_i2c_resume) -+ SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_i2c_suspend_noirq, -+ mtk_i2c_resume_noirq) - }; - - static struct platform_driver mtk_i2c_driver = { -diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c -index f043eefabb4ec..7b1d2dac6ceb8 100644 ---- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c -+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c -@@ -514,7 +514,10 @@ static ssize_t iwl_dbgfs_os_device_timediff_read(struct file *file, - const size_t bufsz = sizeof(buf); - int pos = 0; - -+ mutex_lock(&mvm->mutex); - iwl_mvm_get_sync_time(mvm, &curr_gp2, &curr_os); -+ mutex_unlock(&mvm->mutex); -+ - do_div(curr_os, NSEC_PER_USEC); - diff = curr_os - curr_gp2; - pos += scnprintf(buf + pos, bufsz - pos, "diff=%lld\n", diff); -diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c -index daae86cd61140..fc6430edd1107 100644 ---- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c -+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c -@@ -4169,6 +4169,9 @@ static void __iwl_mvm_unassign_vif_chanctx(struct iwl_mvm *mvm, - iwl_mvm_binding_remove_vif(mvm, vif); - - out: -+ if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD) && -+ switching_chanctx) -+ return; - mvmvif->phy_ctxt = NULL; - iwl_mvm_power_update_mac(mvm); - } -diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c -index b04cc6214bac8..8b0576cde797e 100644 ---- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c -+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c -@@ -838,6 +838,10 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, - if (!mvm->scan_cmd) - goto out_free; - -+ /* invalidate ids to prevent accidental removal of sta_id 0 */ -+ mvm->aux_sta.sta_id = IWL_MVM_INVALID_STA; -+ mvm->snif_sta.sta_id = IWL_MVM_INVALID_STA; -+ - /* Set EBS as successful as long as not stated otherwise by the FW. */ - mvm->last_ebs_successful = true; - -@@ -1238,6 +1242,7 @@ static void iwl_mvm_reprobe_wk(struct work_struct *wk) - reprobe = container_of(wk, struct iwl_mvm_reprobe, work); - if (device_reprobe(reprobe->dev)) - dev_err(reprobe->dev, "reprobe failed!\n"); -+ put_device(reprobe->dev); - kfree(reprobe); - module_put(THIS_MODULE); - } -@@ -1288,7 +1293,7 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error) - module_put(THIS_MODULE); - return; - } -- reprobe->dev = mvm->trans->dev; -+ reprobe->dev = get_device(mvm->trans->dev); - INIT_WORK(&reprobe->work, iwl_mvm_reprobe_wk); - schedule_work(&reprobe->work); - } else if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, -diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c -index a36aa9e85e0b3..40cafcf40ccf0 100644 ---- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c -+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c -@@ -2070,6 +2070,9 @@ int iwl_mvm_rm_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) - - lockdep_assert_held(&mvm->mutex); - -+ if (WARN_ON_ONCE(mvm->snif_sta.sta_id == IWL_MVM_INVALID_STA)) -+ return -EINVAL; -+ - iwl_mvm_disable_txq(mvm, NULL, mvm->snif_queue, IWL_MAX_TID_COUNT, 0); - ret = iwl_mvm_rm_sta_common(mvm, mvm->snif_sta.sta_id); - if (ret) -@@ -2084,6 +2087,9 @@ int iwl_mvm_rm_aux_sta(struct iwl_mvm *mvm) - - lockdep_assert_held(&mvm->mutex); - -+ if (WARN_ON_ONCE(mvm->aux_sta.sta_id == IWL_MVM_INVALID_STA)) -+ return -EINVAL; -+ - iwl_mvm_disable_txq(mvm, NULL, mvm->aux_queue, IWL_MAX_TID_COUNT, 0); - ret = iwl_mvm_rm_sta_common(mvm, mvm->aux_sta.sta_id); - if (ret) -diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c -index 7a5b024a6d384..eab159205e48b 100644 ---- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c -+++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c -@@ -164,8 +164,10 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, - /* Allocate IML */ - iml_img = dma_alloc_coherent(trans->dev, trans->iml_len, - &trans_pcie->iml_dma_addr, GFP_KERNEL); -- if (!iml_img) -- return -ENOMEM; -+ if (!iml_img) { -+ ret = -ENOMEM; -+ goto err_free_ctxt_info; -+ } - - memcpy(iml_img, trans->iml, trans->iml_len); - -@@ -207,6 +209,11 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, - - return 0; - -+err_free_ctxt_info: -+ dma_free_coherent(trans->dev, sizeof(*trans_pcie->ctxt_info_gen3), -+ trans_pcie->ctxt_info_gen3, -+ trans_pcie->ctxt_info_dma_addr); -+ trans_pcie->ctxt_info_gen3 = NULL; - err_free_prph_info: - dma_free_coherent(trans->dev, - sizeof(*prph_info), -diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c -index d3b58334e13ea..e7dcf8bc99b7c 100644 ---- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c -+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c -@@ -657,6 +657,11 @@ static void iwl_pcie_txq_unmap(struct iwl_trans *trans, int txq_id) - struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); - struct iwl_txq *txq = trans_pcie->txq[txq_id]; - -+ if (!txq) { -+ IWL_ERR(trans, "Trying to free a queue that wasn't allocated?\n"); -+ return; -+ } -+ - spin_lock_bh(&txq->lock); - while (txq->write_ptr != txq->read_ptr) { - IWL_DEBUG_TX_REPLY(trans, "Q %d Free %d\n", -diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c -index c9b8613e69db2..5b9d570df85cc 100644 ---- a/drivers/regulator/core.c -+++ b/drivers/regulator/core.c -@@ -1772,13 +1772,13 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) - { - struct regulator_dev *r; - struct device *dev = rdev->dev.parent; -- int ret; -+ int ret = 0; - - /* No supply to resolve? */ - if (!rdev->supply_name) - return 0; - -- /* Supply already resolved? */ -+ /* Supply already resolved? (fast-path without locking contention) */ - if (rdev->supply) - return 0; - -@@ -1788,7 +1788,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) - - /* Did the lookup explicitly defer for us? */ - if (ret == -EPROBE_DEFER) -- return ret; -+ goto out; - - if (have_full_constraints()) { - r = dummy_regulator_rdev; -@@ -1796,15 +1796,18 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) - } else { - dev_err(dev, "Failed to resolve %s-supply for %s\n", - rdev->supply_name, rdev->desc->name); -- return -EPROBE_DEFER; -+ ret = -EPROBE_DEFER; -+ goto out; - } - } - - if (r == rdev) { - dev_err(dev, "Supply for %s (%s) resolved to itself\n", - rdev->desc->name, rdev->supply_name); -- if (!have_full_constraints()) -- return -EINVAL; -+ if (!have_full_constraints()) { -+ ret = -EINVAL; -+ goto out; -+ } - r = dummy_regulator_rdev; - get_device(&r->dev); - } -@@ -1818,7 +1821,8 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) - if (r->dev.parent && r->dev.parent != rdev->dev.parent) { - if (!device_is_bound(r->dev.parent)) { - put_device(&r->dev); -- return -EPROBE_DEFER; -+ ret = -EPROBE_DEFER; -+ goto out; - } - } - -@@ -1826,15 +1830,32 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) - ret = regulator_resolve_supply(r); - if (ret < 0) { - put_device(&r->dev); -- return ret; -+ goto out; -+ } -+ -+ /* -+ * Recheck rdev->supply with rdev->mutex lock held to avoid a race -+ * between rdev->supply null check and setting rdev->supply in -+ * set_supply() from concurrent tasks. -+ */ -+ regulator_lock(rdev); -+ -+ /* Supply just resolved by a concurrent task? */ -+ if (rdev->supply) { -+ regulator_unlock(rdev); -+ put_device(&r->dev); -+ goto out; - } - - ret = set_supply(rdev, r); - if (ret < 0) { -+ regulator_unlock(rdev); - put_device(&r->dev); -- return ret; -+ goto out; - } - -+ regulator_unlock(rdev); -+ - /* - * In set_machine_constraints() we may have turned this regulator on - * but we couldn't propagate to the supply if it hadn't been resolved -@@ -1845,11 +1866,12 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) - if (ret < 0) { - _regulator_put(rdev->supply); - rdev->supply = NULL; -- return ret; -+ goto out; - } - } - -- return 0; -+out: -+ return ret; - } - - /* Internal regulator request function */ -diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c -index ca1d98f274d12..e3a79e6958124 100644 ---- a/fs/nfs/pnfs.c -+++ b/fs/nfs/pnfs.c -@@ -2369,7 +2369,13 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) - * We got an entirely new state ID. Mark all segments for the - * inode invalid, and retry the layoutget - */ -- pnfs_mark_layout_stateid_invalid(lo, &free_me); -+ struct pnfs_layout_range range = { -+ .iomode = IOMODE_ANY, -+ .length = NFS4_MAX_UINT64, -+ }; -+ pnfs_set_plh_return_info(lo, IOMODE_ANY, 0); -+ pnfs_mark_matching_lsegs_return(lo, &lo->plh_return_segs, -+ &range, 0); - goto out_forget; - } - -diff --git a/fs/squashfs/export.c b/fs/squashfs/export.c -index ae2c87bb0fbec..eb02072d28dd6 100644 ---- a/fs/squashfs/export.c -+++ b/fs/squashfs/export.c -@@ -41,12 +41,17 @@ static long long squashfs_inode_lookup(struct super_block *sb, int ino_num) - struct squashfs_sb_info *msblk = sb->s_fs_info; - int blk = SQUASHFS_LOOKUP_BLOCK(ino_num - 1); - int offset = SQUASHFS_LOOKUP_BLOCK_OFFSET(ino_num - 1); -- u64 start = le64_to_cpu(msblk->inode_lookup_table[blk]); -+ u64 start; - __le64 ino; - int err; - - TRACE("Entered squashfs_inode_lookup, inode_number = %d\n", ino_num); - -+ if (ino_num == 0 || (ino_num - 1) >= msblk->inodes) -+ return -EINVAL; -+ -+ start = le64_to_cpu(msblk->inode_lookup_table[blk]); -+ - err = squashfs_read_metadata(sb, &ino, &start, &offset, sizeof(ino)); - if (err < 0) - return err; -@@ -111,7 +116,10 @@ __le64 *squashfs_read_inode_lookup_table(struct super_block *sb, - u64 lookup_table_start, u64 next_table, unsigned int inodes) - { - unsigned int length = SQUASHFS_LOOKUP_BLOCK_BYTES(inodes); -+ unsigned int indexes = SQUASHFS_LOOKUP_BLOCKS(inodes); -+ int n; - __le64 *table; -+ u64 start, end; - - TRACE("In read_inode_lookup_table, length %d\n", length); - -@@ -121,20 +129,37 @@ __le64 *squashfs_read_inode_lookup_table(struct super_block *sb, - if (inodes == 0) - return ERR_PTR(-EINVAL); - -- /* length bytes should not extend into the next table - this check -- * also traps instances where lookup_table_start is incorrectly larger -- * than the next table start -+ /* -+ * The computed size of the lookup table (length bytes) should exactly -+ * match the table start and end points - */ -- if (lookup_table_start + length > next_table) -+ if (length != (next_table - lookup_table_start)) - return ERR_PTR(-EINVAL); - - table = squashfs_read_table(sb, lookup_table_start, length); -+ if (IS_ERR(table)) -+ return table; - - /* -- * table[0] points to the first inode lookup table metadata block, -- * this should be less than lookup_table_start -+ * table0], table[1], ... table[indexes - 1] store the locations -+ * of the compressed inode lookup blocks. Each entry should be -+ * less than the next (i.e. table[0] < table[1]), and the difference -+ * between them should be SQUASHFS_METADATA_SIZE or less. -+ * table[indexes - 1] should be less than lookup_table_start, and -+ * again the difference should be SQUASHFS_METADATA_SIZE or less - */ -- if (!IS_ERR(table) && le64_to_cpu(table[0]) >= lookup_table_start) { -+ for (n = 0; n < (indexes - 1); n++) { -+ start = le64_to_cpu(table[n]); -+ end = le64_to_cpu(table[n + 1]); -+ -+ if (start >= end || (end - start) > SQUASHFS_METADATA_SIZE) { -+ kfree(table); -+ return ERR_PTR(-EINVAL); -+ } -+ } -+ -+ start = le64_to_cpu(table[indexes - 1]); -+ if (start >= lookup_table_start || (lookup_table_start - start) > SQUASHFS_METADATA_SIZE) { - kfree(table); - return ERR_PTR(-EINVAL); - } -diff --git a/fs/squashfs/id.c b/fs/squashfs/id.c -index 6be5afe7287d6..11581bf31af41 100644 ---- a/fs/squashfs/id.c -+++ b/fs/squashfs/id.c -@@ -35,10 +35,15 @@ int squashfs_get_id(struct super_block *sb, unsigned int index, - struct squashfs_sb_info *msblk = sb->s_fs_info; - int block = SQUASHFS_ID_BLOCK(index); - int offset = SQUASHFS_ID_BLOCK_OFFSET(index); -- u64 start_block = le64_to_cpu(msblk->id_table[block]); -+ u64 start_block; - __le32 disk_id; - int err; - -+ if (index >= msblk->ids) -+ return -EINVAL; -+ -+ start_block = le64_to_cpu(msblk->id_table[block]); -+ - err = squashfs_read_metadata(sb, &disk_id, &start_block, &offset, - sizeof(disk_id)); - if (err < 0) -@@ -56,7 +61,10 @@ __le64 *squashfs_read_id_index_table(struct super_block *sb, - u64 id_table_start, u64 next_table, unsigned short no_ids) - { - unsigned int length = SQUASHFS_ID_BLOCK_BYTES(no_ids); -+ unsigned int indexes = SQUASHFS_ID_BLOCKS(no_ids); -+ int n; - __le64 *table; -+ u64 start, end; - - TRACE("In read_id_index_table, length %d\n", length); - -@@ -67,20 +75,36 @@ __le64 *squashfs_read_id_index_table(struct super_block *sb, - return ERR_PTR(-EINVAL); - - /* -- * length bytes should not extend into the next table - this check -- * also traps instances where id_table_start is incorrectly larger -- * than the next table start -+ * The computed size of the index table (length bytes) should exactly -+ * match the table start and end points - */ -- if (id_table_start + length > next_table) -+ if (length != (next_table - id_table_start)) - return ERR_PTR(-EINVAL); - - table = squashfs_read_table(sb, id_table_start, length); -+ if (IS_ERR(table)) -+ return table; - - /* -- * table[0] points to the first id lookup table metadata block, this -- * should be less than id_table_start -+ * table[0], table[1], ... table[indexes - 1] store the locations -+ * of the compressed id blocks. Each entry should be less than -+ * the next (i.e. table[0] < table[1]), and the difference between them -+ * should be SQUASHFS_METADATA_SIZE or less. table[indexes - 1] -+ * should be less than id_table_start, and again the difference -+ * should be SQUASHFS_METADATA_SIZE or less - */ -- if (!IS_ERR(table) && le64_to_cpu(table[0]) >= id_table_start) { -+ for (n = 0; n < (indexes - 1); n++) { -+ start = le64_to_cpu(table[n]); -+ end = le64_to_cpu(table[n + 1]); -+ -+ if (start >= end || (end - start) > SQUASHFS_METADATA_SIZE) { -+ kfree(table); -+ return ERR_PTR(-EINVAL); -+ } -+ } -+ -+ start = le64_to_cpu(table[indexes - 1]); -+ if (start >= id_table_start || (id_table_start - start) > SQUASHFS_METADATA_SIZE) { - kfree(table); - return ERR_PTR(-EINVAL); - } -diff --git a/fs/squashfs/squashfs_fs_sb.h b/fs/squashfs/squashfs_fs_sb.h -index 34c21ffb6df37..166e98806265b 100644 ---- a/fs/squashfs/squashfs_fs_sb.h -+++ b/fs/squashfs/squashfs_fs_sb.h -@@ -64,5 +64,6 @@ struct squashfs_sb_info { - unsigned int inodes; - unsigned int fragments; - int xattr_ids; -+ unsigned int ids; - }; - #endif -diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c -index 0cc4ceec05624..2110323b610b9 100644 ---- a/fs/squashfs/super.c -+++ b/fs/squashfs/super.c -@@ -166,6 +166,7 @@ static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc) - msblk->directory_table = le64_to_cpu(sblk->directory_table_start); - msblk->inodes = le32_to_cpu(sblk->inodes); - msblk->fragments = le32_to_cpu(sblk->fragments); -+ msblk->ids = le16_to_cpu(sblk->no_ids); - flags = le16_to_cpu(sblk->flags); - - TRACE("Found valid superblock on %pg\n", sb->s_bdev); -@@ -177,7 +178,7 @@ static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc) - TRACE("Block size %d\n", msblk->block_size); - TRACE("Number of inodes %d\n", msblk->inodes); - TRACE("Number of fragments %d\n", msblk->fragments); -- TRACE("Number of ids %d\n", le16_to_cpu(sblk->no_ids)); -+ TRACE("Number of ids %d\n", msblk->ids); - TRACE("sblk->inode_table_start %llx\n", msblk->inode_table); - TRACE("sblk->directory_table_start %llx\n", msblk->directory_table); - TRACE("sblk->fragment_table_start %llx\n", -@@ -236,8 +237,7 @@ static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc) - allocate_id_index_table: - /* Allocate and read id index table */ - msblk->id_table = squashfs_read_id_index_table(sb, -- le64_to_cpu(sblk->id_table_start), next_table, -- le16_to_cpu(sblk->no_ids)); -+ le64_to_cpu(sblk->id_table_start), next_table, msblk->ids); - if (IS_ERR(msblk->id_table)) { - errorf(fc, "unable to read id index table"); - err = PTR_ERR(msblk->id_table); -diff --git a/fs/squashfs/xattr.h b/fs/squashfs/xattr.h -index 184129afd4566..d8a270d3ac4cb 100644 ---- a/fs/squashfs/xattr.h -+++ b/fs/squashfs/xattr.h -@@ -17,8 +17,16 @@ extern int squashfs_xattr_lookup(struct super_block *, unsigned int, int *, - static inline __le64 *squashfs_read_xattr_id_table(struct super_block *sb, - u64 start, u64 *xattr_table_start, int *xattr_ids) - { -+ struct squashfs_xattr_id_table *id_table; -+ -+ id_table = squashfs_read_table(sb, start, sizeof(*id_table)); -+ if (IS_ERR(id_table)) -+ return (__le64 *) id_table; -+ -+ *xattr_table_start = le64_to_cpu(id_table->xattr_table_start); -+ kfree(id_table); -+ - ERROR("Xattrs in filesystem, these will be ignored\n"); -- *xattr_table_start = start; - return ERR_PTR(-ENOTSUPP); - } - -diff --git a/fs/squashfs/xattr_id.c b/fs/squashfs/xattr_id.c -index d99e08464554f..ead66670b41a5 100644 ---- a/fs/squashfs/xattr_id.c -+++ b/fs/squashfs/xattr_id.c -@@ -31,10 +31,15 @@ int squashfs_xattr_lookup(struct super_block *sb, unsigned int index, - struct squashfs_sb_info *msblk = sb->s_fs_info; - int block = SQUASHFS_XATTR_BLOCK(index); - int offset = SQUASHFS_XATTR_BLOCK_OFFSET(index); -- u64 start_block = le64_to_cpu(msblk->xattr_id_table[block]); -+ u64 start_block; - struct squashfs_xattr_id id; - int err; - -+ if (index >= msblk->xattr_ids) -+ return -EINVAL; -+ -+ start_block = le64_to_cpu(msblk->xattr_id_table[block]); -+ - err = squashfs_read_metadata(sb, &id, &start_block, &offset, - sizeof(id)); - if (err < 0) -@@ -50,13 +55,17 @@ int squashfs_xattr_lookup(struct super_block *sb, unsigned int index, - /* - * Read uncompressed xattr id lookup table indexes from disk into memory - */ --__le64 *squashfs_read_xattr_id_table(struct super_block *sb, u64 start, -+__le64 *squashfs_read_xattr_id_table(struct super_block *sb, u64 table_start, - u64 *xattr_table_start, int *xattr_ids) - { -- unsigned int len; -+ struct squashfs_sb_info *msblk = sb->s_fs_info; -+ unsigned int len, indexes; - struct squashfs_xattr_id_table *id_table; -+ __le64 *table; -+ u64 start, end; -+ int n; - -- id_table = squashfs_read_table(sb, start, sizeof(*id_table)); -+ id_table = squashfs_read_table(sb, table_start, sizeof(*id_table)); - if (IS_ERR(id_table)) - return (__le64 *) id_table; - -@@ -70,13 +79,52 @@ __le64 *squashfs_read_xattr_id_table(struct super_block *sb, u64 start, - if (*xattr_ids == 0) - return ERR_PTR(-EINVAL); - -- /* xattr_table should be less than start */ -- if (*xattr_table_start >= start) -+ len = SQUASHFS_XATTR_BLOCK_BYTES(*xattr_ids); -+ indexes = SQUASHFS_XATTR_BLOCKS(*xattr_ids); -+ -+ /* -+ * The computed size of the index table (len bytes) should exactly -+ * match the table start and end points -+ */ -+ start = table_start + sizeof(*id_table); -+ end = msblk->bytes_used; -+ -+ if (len != (end - start)) - return ERR_PTR(-EINVAL); - -- len = SQUASHFS_XATTR_BLOCK_BYTES(*xattr_ids); -+ table = squashfs_read_table(sb, start, len); -+ if (IS_ERR(table)) -+ return table; -+ -+ /* table[0], table[1], ... table[indexes - 1] store the locations -+ * of the compressed xattr id blocks. Each entry should be less than -+ * the next (i.e. table[0] < table[1]), and the difference between them -+ * should be SQUASHFS_METADATA_SIZE or less. table[indexes - 1] -+ * should be less than table_start, and again the difference -+ * shouls be SQUASHFS_METADATA_SIZE or less. -+ * -+ * Finally xattr_table_start should be less than table[0]. -+ */ -+ for (n = 0; n < (indexes - 1); n++) { -+ start = le64_to_cpu(table[n]); -+ end = le64_to_cpu(table[n + 1]); -+ -+ if (start >= end || (end - start) > SQUASHFS_METADATA_SIZE) { -+ kfree(table); -+ return ERR_PTR(-EINVAL); -+ } -+ } -+ -+ start = le64_to_cpu(table[indexes - 1]); -+ if (start >= table_start || (table_start - start) > SQUASHFS_METADATA_SIZE) { -+ kfree(table); -+ return ERR_PTR(-EINVAL); -+ } - -- TRACE("In read_xattr_index_table, length %d\n", len); -+ if (*xattr_table_start >= le64_to_cpu(table[0])) { -+ kfree(table); -+ return ERR_PTR(-EINVAL); -+ } - -- return squashfs_read_table(sb, start + sizeof(*id_table), len); -+ return table; - } -diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h -index a60488867dd06..a121fd8e7c3a0 100644 ---- a/include/linux/kprobes.h -+++ b/include/linux/kprobes.h -@@ -232,7 +232,7 @@ extern void kprobes_inc_nmissed_count(struct kprobe *p); - extern bool arch_within_kprobe_blacklist(unsigned long addr); - extern int arch_populate_kprobe_blacklist(void); - extern bool arch_kprobe_on_func_entry(unsigned long offset); --extern bool kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset); -+extern int kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset); - - extern bool within_kprobe_blacklist(unsigned long addr); - extern int kprobe_add_ksym_blacklist(unsigned long entry); -diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h -index 9db6097c22c5d..a8d68c5a4ca61 100644 ---- a/include/linux/sunrpc/xdr.h -+++ b/include/linux/sunrpc/xdr.h -@@ -27,8 +27,7 @@ struct rpc_rqst; - #define XDR_QUADLEN(l) (((l) + 3) >> 2) - - /* -- * Generic opaque `network object.' At the kernel level, this type -- * is used only by lockd. -+ * Generic opaque `network object.' - */ - #define XDR_MAX_NETOBJ 1024 - struct xdr_netobj { -diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c -index a67bfa803d983..2c248c4f6419c 100644 ---- a/kernel/bpf/verifier.c -+++ b/kernel/bpf/verifier.c -@@ -9002,30 +9002,28 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env) - insn->code == (BPF_ALU | BPF_MOD | BPF_X) || - insn->code == (BPF_ALU | BPF_DIV | BPF_X)) { - bool is64 = BPF_CLASS(insn->code) == BPF_ALU64; -- struct bpf_insn mask_and_div[] = { -- BPF_MOV32_REG(insn->src_reg, insn->src_reg), -+ bool isdiv = BPF_OP(insn->code) == BPF_DIV; -+ struct bpf_insn *patchlet; -+ struct bpf_insn chk_and_div[] = { - /* Rx div 0 -> 0 */ -- BPF_JMP_IMM(BPF_JNE, insn->src_reg, 0, 2), -+ BPF_RAW_INSN((is64 ? BPF_JMP : BPF_JMP32) | -+ BPF_JNE | BPF_K, insn->src_reg, -+ 0, 2, 0), - BPF_ALU32_REG(BPF_XOR, insn->dst_reg, insn->dst_reg), - BPF_JMP_IMM(BPF_JA, 0, 0, 1), - *insn, - }; -- struct bpf_insn mask_and_mod[] = { -- BPF_MOV32_REG(insn->src_reg, insn->src_reg), -+ struct bpf_insn chk_and_mod[] = { - /* Rx mod 0 -> Rx */ -- BPF_JMP_IMM(BPF_JEQ, insn->src_reg, 0, 1), -+ BPF_RAW_INSN((is64 ? BPF_JMP : BPF_JMP32) | -+ BPF_JEQ | BPF_K, insn->src_reg, -+ 0, 1, 0), - *insn, - }; -- struct bpf_insn *patchlet; - -- if (insn->code == (BPF_ALU64 | BPF_DIV | BPF_X) || -- insn->code == (BPF_ALU | BPF_DIV | BPF_X)) { -- patchlet = mask_and_div + (is64 ? 1 : 0); -- cnt = ARRAY_SIZE(mask_and_div) - (is64 ? 1 : 0); -- } else { -- patchlet = mask_and_mod + (is64 ? 1 : 0); -- cnt = ARRAY_SIZE(mask_and_mod) - (is64 ? 1 : 0); -- } -+ patchlet = isdiv ? chk_and_div : chk_and_mod; -+ cnt = isdiv ? ARRAY_SIZE(chk_and_div) : -+ ARRAY_SIZE(chk_and_mod); - - new_prog = bpf_patch_insn_data(env, i + delta, patchlet, cnt); - if (!new_prog) -diff --git a/kernel/kprobes.c b/kernel/kprobes.c -index 26ae92c12fc22..a7812c115e487 100644 ---- a/kernel/kprobes.c -+++ b/kernel/kprobes.c -@@ -1948,29 +1948,45 @@ bool __weak arch_kprobe_on_func_entry(unsigned long offset) - return !offset; - } - --bool kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset) -+/** -+ * kprobe_on_func_entry() -- check whether given address is function entry -+ * @addr: Target address -+ * @sym: Target symbol name -+ * @offset: The offset from the symbol or the address -+ * -+ * This checks whether the given @addr+@offset or @sym+@offset is on the -+ * function entry address or not. -+ * This returns 0 if it is the function entry, or -EINVAL if it is not. -+ * And also it returns -ENOENT if it fails the symbol or address lookup. -+ * Caller must pass @addr or @sym (either one must be NULL), or this -+ * returns -EINVAL. -+ */ -+int kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset) - { - kprobe_opcode_t *kp_addr = _kprobe_addr(addr, sym, offset); - - if (IS_ERR(kp_addr)) -- return false; -+ return PTR_ERR(kp_addr); - -- if (!kallsyms_lookup_size_offset((unsigned long)kp_addr, NULL, &offset) || -- !arch_kprobe_on_func_entry(offset)) -- return false; -+ if (!kallsyms_lookup_size_offset((unsigned long)kp_addr, NULL, &offset)) -+ return -ENOENT; - -- return true; -+ if (!arch_kprobe_on_func_entry(offset)) -+ return -EINVAL; -+ -+ return 0; - } - - int register_kretprobe(struct kretprobe *rp) - { -- int ret = 0; -+ int ret; - struct kretprobe_instance *inst; - int i; - void *addr; - -- if (!kprobe_on_func_entry(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset)) -- return -EINVAL; -+ ret = kprobe_on_func_entry(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset); -+ if (ret) -+ return ret; - - /* If only rp->kp.addr is specified, check reregistering kprobes */ - if (rp->kp.addr && check_kprobe_rereg(&rp->kp)) -diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c -index 1074a69beff3f..233322c77b76c 100644 ---- a/kernel/trace/trace_kprobe.c -+++ b/kernel/trace/trace_kprobe.c -@@ -220,9 +220,9 @@ bool trace_kprobe_on_func_entry(struct trace_event_call *call) - { - struct trace_kprobe *tk = trace_kprobe_primary_from_call(call); - -- return tk ? kprobe_on_func_entry(tk->rp.kp.addr, -+ return tk ? (kprobe_on_func_entry(tk->rp.kp.addr, - tk->rp.kp.addr ? NULL : tk->rp.kp.symbol_name, -- tk->rp.kp.addr ? 0 : tk->rp.kp.offset) : false; -+ tk->rp.kp.addr ? 0 : tk->rp.kp.offset) == 0) : false; - } - - bool trace_kprobe_error_injectable(struct trace_event_call *call) -@@ -811,9 +811,11 @@ static int trace_kprobe_create(int argc, const char *argv[]) - trace_probe_log_err(0, BAD_PROBE_ADDR); - goto parse_error; - } -- if (kprobe_on_func_entry(NULL, symbol, offset)) -+ ret = kprobe_on_func_entry(NULL, symbol, offset); -+ if (ret == 0) - flags |= TPARG_FL_FENTRY; -- if (offset && is_return && !(flags & TPARG_FL_FENTRY)) { -+ /* Defer the ENOENT case until register kprobe */ -+ if (ret == -EINVAL && is_return) { - trace_probe_log_err(0, BAD_RETPROBE); - goto parse_error; - } -diff --git a/net/key/af_key.c b/net/key/af_key.c -index a915bc86620af..907d04a474597 100644 ---- a/net/key/af_key.c -+++ b/net/key/af_key.c -@@ -2902,7 +2902,7 @@ static int count_ah_combs(const struct xfrm_tmpl *t) - break; - if (!aalg->pfkey_supported) - continue; -- if (aalg_tmpl_set(t, aalg) && aalg->available) -+ if (aalg_tmpl_set(t, aalg)) - sz += sizeof(struct sadb_comb); - } - return sz + sizeof(struct sadb_prop); -@@ -2920,7 +2920,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t) - if (!ealg->pfkey_supported) - continue; - -- if (!(ealg_tmpl_set(t, ealg) && ealg->available)) -+ if (!(ealg_tmpl_set(t, ealg))) - continue; - - for (k = 1; ; k++) { -@@ -2931,7 +2931,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t) - if (!aalg->pfkey_supported) - continue; - -- if (aalg_tmpl_set(t, aalg) && aalg->available) -+ if (aalg_tmpl_set(t, aalg)) - sz += sizeof(struct sadb_comb); - } - } -diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c -index 5fe2b645912f6..132f8423addaa 100644 ---- a/net/mac80211/spectmgmt.c -+++ b/net/mac80211/spectmgmt.c -@@ -132,16 +132,20 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata, - } - - if (wide_bw_chansw_ie) { -+ u8 new_seg1 = wide_bw_chansw_ie->new_center_freq_seg1; - struct ieee80211_vht_operation vht_oper = { - .chan_width = - wide_bw_chansw_ie->new_channel_width, - .center_freq_seg0_idx = - wide_bw_chansw_ie->new_center_freq_seg0, -- .center_freq_seg1_idx = -- wide_bw_chansw_ie->new_center_freq_seg1, -+ .center_freq_seg1_idx = new_seg1, - /* .basic_mcs_set doesn't matter */ - }; -- struct ieee80211_ht_operation ht_oper = {}; -+ struct ieee80211_ht_operation ht_oper = { -+ .operation_mode = -+ cpu_to_le16(new_seg1 << -+ IEEE80211_HT_OP_MODE_CCFS2_SHIFT), -+ }; - - /* default, for the case of IEEE80211_VHT_CHANWIDTH_USE_HT, - * to the previously parsed chandef -diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c -index 5fc6c028f89c0..b7a71578bd986 100644 ---- a/net/sunrpc/auth_gss/auth_gss.c -+++ b/net/sunrpc/auth_gss/auth_gss.c -@@ -29,6 +29,7 @@ - #include - #include - -+#include "auth_gss_internal.h" - #include "../netns.h" - - #include -@@ -125,35 +126,6 @@ gss_cred_set_ctx(struct rpc_cred *cred, struct gss_cl_ctx *ctx) - clear_bit(RPCAUTH_CRED_NEW, &cred->cr_flags); - } - --static const void * --simple_get_bytes(const void *p, const void *end, void *res, size_t len) --{ -- const void *q = (const void *)((const char *)p + len); -- if (unlikely(q > end || q < p)) -- return ERR_PTR(-EFAULT); -- memcpy(res, p, len); -- return q; --} -- --static inline const void * --simple_get_netobj(const void *p, const void *end, struct xdr_netobj *dest) --{ -- const void *q; -- unsigned int len; -- -- p = simple_get_bytes(p, end, &len, sizeof(len)); -- if (IS_ERR(p)) -- return p; -- q = (const void *)((const char *)p + len); -- if (unlikely(q > end || q < p)) -- return ERR_PTR(-EFAULT); -- dest->data = kmemdup(p, len, GFP_NOFS); -- if (unlikely(dest->data == NULL)) -- return ERR_PTR(-ENOMEM); -- dest->len = len; -- return q; --} -- - static struct gss_cl_ctx * - gss_cred_get_ctx(struct rpc_cred *cred) - { -diff --git a/net/sunrpc/auth_gss/auth_gss_internal.h b/net/sunrpc/auth_gss/auth_gss_internal.h -new file mode 100644 -index 0000000000000..f6d9631bd9d00 ---- /dev/null -+++ b/net/sunrpc/auth_gss/auth_gss_internal.h -@@ -0,0 +1,45 @@ -+// SPDX-License-Identifier: BSD-3-Clause -+/* -+ * linux/net/sunrpc/auth_gss/auth_gss_internal.h -+ * -+ * Internal definitions for RPCSEC_GSS client authentication -+ * -+ * Copyright (c) 2000 The Regents of the University of Michigan. -+ * All rights reserved. -+ * -+ */ -+#include -+#include -+#include -+ -+static inline const void * -+simple_get_bytes(const void *p, const void *end, void *res, size_t len) -+{ -+ const void *q = (const void *)((const char *)p + len); -+ if (unlikely(q > end || q < p)) -+ return ERR_PTR(-EFAULT); -+ memcpy(res, p, len); -+ return q; -+} -+ -+static inline const void * -+simple_get_netobj(const void *p, const void *end, struct xdr_netobj *dest) -+{ -+ const void *q; -+ unsigned int len; -+ -+ p = simple_get_bytes(p, end, &len, sizeof(len)); -+ if (IS_ERR(p)) -+ return p; -+ q = (const void *)((const char *)p + len); -+ if (unlikely(q > end || q < p)) -+ return ERR_PTR(-EFAULT); -+ if (len) { -+ dest->data = kmemdup(p, len, GFP_NOFS); -+ if (unlikely(dest->data == NULL)) -+ return ERR_PTR(-ENOMEM); -+ } else -+ dest->data = NULL; -+ dest->len = len; -+ return q; -+} -diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c -index 6e5d6d2402158..b552dd4f32f80 100644 ---- a/net/sunrpc/auth_gss/gss_krb5_mech.c -+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c -@@ -21,6 +21,8 @@ - #include - #include - -+#include "auth_gss_internal.h" -+ - #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) - # define RPCDBG_FACILITY RPCDBG_AUTH - #endif -@@ -164,35 +166,6 @@ get_gss_krb5_enctype(int etype) - return NULL; - } - --static const void * --simple_get_bytes(const void *p, const void *end, void *res, int len) --{ -- const void *q = (const void *)((const char *)p + len); -- if (unlikely(q > end || q < p)) -- return ERR_PTR(-EFAULT); -- memcpy(res, p, len); -- return q; --} -- --static const void * --simple_get_netobj(const void *p, const void *end, struct xdr_netobj *res) --{ -- const void *q; -- unsigned int len; -- -- p = simple_get_bytes(p, end, &len, sizeof(len)); -- if (IS_ERR(p)) -- return p; -- q = (const void *)((const char *)p + len); -- if (unlikely(q > end || q < p)) -- return ERR_PTR(-EFAULT); -- res->data = kmemdup(p, len, GFP_NOFS); -- if (unlikely(res->data == NULL)) -- return ERR_PTR(-ENOMEM); -- res->len = len; -- return q; --} -- - static inline const void * - get_key(const void *p, const void *end, - struct krb5_ctx *ctx, struct crypto_sync_skcipher **res) -diff --git a/sound/soc/codecs/ak4458.c b/sound/soc/codecs/ak4458.c -index 71562154c0b1e..217e8ce9a4ba4 100644 ---- a/sound/soc/codecs/ak4458.c -+++ b/sound/soc/codecs/ak4458.c -@@ -523,18 +523,10 @@ static struct snd_soc_dai_driver ak4497_dai = { - .ops = &ak4458_dai_ops, - }; - --static void ak4458_power_off(struct ak4458_priv *ak4458) -+static void ak4458_reset(struct ak4458_priv *ak4458, bool active) - { - if (ak4458->reset_gpiod) { -- gpiod_set_value_cansleep(ak4458->reset_gpiod, 0); -- usleep_range(1000, 2000); -- } --} -- --static void ak4458_power_on(struct ak4458_priv *ak4458) --{ -- if (ak4458->reset_gpiod) { -- gpiod_set_value_cansleep(ak4458->reset_gpiod, 1); -+ gpiod_set_value_cansleep(ak4458->reset_gpiod, active); - usleep_range(1000, 2000); - } - } -@@ -548,7 +540,7 @@ static int ak4458_init(struct snd_soc_component *component) - if (ak4458->mute_gpiod) - gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); - -- ak4458_power_on(ak4458); -+ ak4458_reset(ak4458, false); - - ret = snd_soc_component_update_bits(component, AK4458_00_CONTROL1, - 0x80, 0x80); /* ACKS bit = 1; 10000000 */ -@@ -571,7 +563,7 @@ static void ak4458_remove(struct snd_soc_component *component) - { - struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); - -- ak4458_power_off(ak4458); -+ ak4458_reset(ak4458, true); - } - - #ifdef CONFIG_PM -@@ -581,7 +573,7 @@ static int __maybe_unused ak4458_runtime_suspend(struct device *dev) - - regcache_cache_only(ak4458->regmap, true); - -- ak4458_power_off(ak4458); -+ ak4458_reset(ak4458, true); - - if (ak4458->mute_gpiod) - gpiod_set_value_cansleep(ak4458->mute_gpiod, 0); -@@ -596,8 +588,8 @@ static int __maybe_unused ak4458_runtime_resume(struct device *dev) - if (ak4458->mute_gpiod) - gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); - -- ak4458_power_off(ak4458); -- ak4458_power_on(ak4458); -+ ak4458_reset(ak4458, true); -+ ak4458_reset(ak4458, false); - - regcache_cache_only(ak4458->regmap, false); - regcache_mark_dirty(ak4458->regmap); -diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c -index 2cb719893324a..1940b17f27efa 100644 ---- a/sound/soc/intel/skylake/skl-topology.c -+++ b/sound/soc/intel/skylake/skl-topology.c -@@ -3632,7 +3632,7 @@ static void skl_tplg_complete(struct snd_soc_component *component) - sprintf(chan_text, "c%d", mach->mach_params.dmic_num); - - for (i = 0; i < se->items; i++) { -- struct snd_ctl_elem_value val; -+ struct snd_ctl_elem_value val = {}; - - if (strstr(texts[i], chan_text)) { - val.value.enumerated.item[0] = i;