commit:     0a8168e84a737089f28f5109e70dd70467e9c2bb
Author:     Arisu Tachibana <alicef <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  6 18:23:56 2025 +0000
Commit:     Arisu Tachibana <alicef <AT> gentoo <DOT> org>
CommitDate: Sun Jul  6 18:23:56 2025 +0000
URL:        https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=0a8168e8

Linux patch 5.4.265

Signed-off-by: Arisu Tachibana <alicef <AT> gentoo.org>

 0000_README              |    4 +
 1264_linux-5.4.265.patch | 1160 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 1164 insertions(+)

diff --git a/0000_README b/0000_README
index 98a2497d..01dc3843 100644
--- a/0000_README
+++ b/0000_README
@@ -1099,6 +1099,10 @@ Patch:  1263_linux-5.4.264.patch
 From:   https://www.kernel.org
 Desc:   Linux 5.4.264
 
+Patch:  1264_linux-5.4.265.patch
+From:   https://www.kernel.org
+Desc:   Linux 5.4.265
+
 Patch:  1500_XATTR_USER_PREFIX.patch
 From:   https://bugs.gentoo.org/show_bug.cgi?id=470644
 Desc:   Support for namespace user.pax.* on tmpfs.

diff --git a/1264_linux-5.4.265.patch b/1264_linux-5.4.265.patch
new file mode 100644
index 00000000..2ba85d83
--- /dev/null
+++ b/1264_linux-5.4.265.patch
@@ -0,0 +1,1160 @@
+diff --git a/Makefile b/Makefile
+index eeb06cdcf64f4..b89f99423351f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,7 @@
+ # SPDX-License-Identifier: GPL-2.0
+ VERSION = 5
+ PATCHLEVEL = 4
+-SUBLEVEL = 264
++SUBLEVEL = 265
+ EXTRAVERSION =
+ NAME = Kleptomaniac Octopus
+ 
+diff --git a/arch/arm64/include/asm/pgtable.h 
b/arch/arm64/include/asm/pgtable.h
+index 3a057d4279007..709badd4475f5 100644
+--- a/arch/arm64/include/asm/pgtable.h
++++ b/arch/arm64/include/asm/pgtable.h
+@@ -679,6 +679,12 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t 
newprot)
+       if (pte_hw_dirty(pte))
+               pte = pte_mkdirty(pte);
+       pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);
++      /*
++       * If we end up clearing hw dirtiness for a sw-dirty PTE, set hardware
++       * dirtiness again.
++       */
++      if (pte_sw_dirty(pte))
++              pte = pte_mkdirty(pte);
+       return pte;
+ }
+ 
+diff --git a/arch/powerpc/kernel/trace/ftrace_64_mprofile.S 
b/arch/powerpc/kernel/trace/ftrace_64_mprofile.S
+index f9fd5f743eba3..0bc39ff532331 100644
+--- a/arch/powerpc/kernel/trace/ftrace_64_mprofile.S
++++ b/arch/powerpc/kernel/trace/ftrace_64_mprofile.S
+@@ -36,6 +36,9 @@ _GLOBAL(ftrace_regs_caller)
+       /* Save the original return address in A's stack frame */
+       std     r0,LRSAVE(r1)
+ 
++      /* Create a minimal stack frame for representing B */
++      stdu    r1, -STACK_FRAME_MIN_SIZE(r1)
++
+       /* Create our stack frame + pt_regs */
+       stdu    r1,-SWITCH_FRAME_SIZE(r1)
+ 
+@@ -52,7 +55,7 @@ _GLOBAL(ftrace_regs_caller)
+       SAVE_10GPRS(22, r1)
+ 
+       /* Save previous stack pointer (r1) */
+-      addi    r8, r1, SWITCH_FRAME_SIZE
++      addi    r8, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE
+       std     r8, GPR1(r1)
+ 
+       /* Load special regs for save below */
+@@ -65,6 +68,8 @@ _GLOBAL(ftrace_regs_caller)
+       mflr    r7
+       /* Save it as pt_regs->nip */
+       std     r7, _NIP(r1)
++      /* Also save it in B's stackframe header for proper unwind */
++      std     r7, LRSAVE+SWITCH_FRAME_SIZE(r1)
+       /* Save the read LR in pt_regs->link */
+       std     r0, _LINK(r1)
+ 
+@@ -121,7 +126,7 @@ ftrace_regs_call:
+       ld      r2, 24(r1)
+ 
+       /* Pop our stack frame */
+-      addi r1, r1, SWITCH_FRAME_SIZE
++      addi r1, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE
+ 
+ #ifdef CONFIG_LIVEPATCH
+         /* Based on the cmpd above, if the NIP was altered handle livepatch */
+@@ -145,7 +150,7 @@ ftrace_no_trace:
+       mflr    r3
+       mtctr   r3
+       REST_GPR(3, r1)
+-      addi    r1, r1, SWITCH_FRAME_SIZE
++      addi    r1, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE
+       mtlr    r0
+       bctr
+ 
+@@ -153,6 +158,9 @@ _GLOBAL(ftrace_caller)
+       /* Save the original return address in A's stack frame */
+       std     r0, LRSAVE(r1)
+ 
++      /* Create a minimal stack frame for representing B */
++      stdu    r1, -STACK_FRAME_MIN_SIZE(r1)
++
+       /* Create our stack frame + pt_regs */
+       stdu    r1, -SWITCH_FRAME_SIZE(r1)
+ 
+@@ -166,6 +174,7 @@ _GLOBAL(ftrace_caller)
+       /* Get the _mcount() call site out of LR */
+       mflr    r7
+       std     r7, _NIP(r1)
++      std     r7, LRSAVE+SWITCH_FRAME_SIZE(r1)
+ 
+       /* Save callee's TOC in the ABI compliant location */
+       std     r2, 24(r1)
+@@ -200,7 +209,7 @@ ftrace_call:
+       ld      r2, 24(r1)
+ 
+       /* Pop our stack frame */
+-      addi    r1, r1, SWITCH_FRAME_SIZE
++      addi    r1, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE
+ 
+       /* Reload original LR */
+       ld      r0, LRSAVE(r1)
+diff --git a/block/blk-throttle.c b/block/blk-throttle.c
+index bd870f9ae4586..43444934b9850 100644
+--- a/block/blk-throttle.c
++++ b/block/blk-throttle.c
+@@ -1374,6 +1374,7 @@ static void tg_conf_updated(struct throtl_grp *tg, bool 
global)
+                  tg_bps_limit(tg, READ), tg_bps_limit(tg, WRITE),
+                  tg_iops_limit(tg, READ), tg_iops_limit(tg, WRITE));
+ 
++      rcu_read_lock();
+       /*
+        * Update has_rules[] flags for the updated tg's subtree.  A tg is
+        * considered to have rules if either the tg itself or any of its
+@@ -1401,6 +1402,7 @@ static void tg_conf_updated(struct throtl_grp *tg, bool 
global)
+               this_tg->latency_target = max(this_tg->latency_target,
+                               parent_tg->latency_target);
+       }
++      rcu_read_unlock();
+ 
+       /*
+        * We're already holding queue_lock and know @tg is valid.  Let's
+diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
+index c32f7dd9879ac..9f2148daf8ad1 100644
+--- a/drivers/atm/solos-pci.c
++++ b/drivers/atm/solos-pci.c
+@@ -449,9 +449,9 @@ static ssize_t console_show(struct device *dev, struct 
device_attribute *attr,
+       struct sk_buff *skb;
+       unsigned int len;
+ 
+-      spin_lock(&card->cli_queue_lock);
++      spin_lock_bh(&card->cli_queue_lock);
+       skb = skb_dequeue(&card->cli_queue[SOLOS_CHAN(atmdev)]);
+-      spin_unlock(&card->cli_queue_lock);
++      spin_unlock_bh(&card->cli_queue_lock);
+       if(skb == NULL)
+               return sprintf(buf, "No data.\n");
+ 
+@@ -956,14 +956,14 @@ static void pclose(struct atm_vcc *vcc)
+       struct pkt_hdr *header;
+ 
+       /* Remove any yet-to-be-transmitted packets from the pending queue */
+-      spin_lock(&card->tx_queue_lock);
++      spin_lock_bh(&card->tx_queue_lock);
+       skb_queue_walk_safe(&card->tx_queue[port], skb, tmpskb) {
+               if (SKB_CB(skb)->vcc == vcc) {
+                       skb_unlink(skb, &card->tx_queue[port]);
+                       solos_pop(vcc, skb);
+               }
+       }
+-      spin_unlock(&card->tx_queue_lock);
++      spin_unlock_bh(&card->tx_queue_lock);
+ 
+       skb = alloc_skb(sizeof(*header), GFP_KERNEL);
+       if (!skb) {
+diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
+index e15ba7f5fe0a0..dea9268629056 100644
+--- a/drivers/hid/hid-asus.c
++++ b/drivers/hid/hid-asus.c
+@@ -336,7 +336,7 @@ static int asus_raw_event(struct hid_device *hdev,
+       return 0;
+ }
+ 
+-static int asus_kbd_set_report(struct hid_device *hdev, u8 *buf, size_t 
buf_size)
++static int asus_kbd_set_report(struct hid_device *hdev, const u8 *buf, size_t 
buf_size)
+ {
+       unsigned char *dmabuf;
+       int ret;
+@@ -355,7 +355,7 @@ static int asus_kbd_set_report(struct hid_device *hdev, u8 
*buf, size_t buf_size
+ 
+ static int asus_kbd_init(struct hid_device *hdev)
+ {
+-      u8 buf[] = { FEATURE_KBD_REPORT_ID, 0x41, 0x53, 0x55, 0x53, 0x20, 0x54,
++      const u8 buf[] = { FEATURE_KBD_REPORT_ID, 0x41, 0x53, 0x55, 0x53, 0x20, 
0x54,
+                    0x65, 0x63, 0x68, 0x2e, 0x49, 0x6e, 0x63, 0x2e, 0x00 };
+       int ret;
+ 
+@@ -369,7 +369,7 @@ static int asus_kbd_init(struct hid_device *hdev)
+ static int asus_kbd_get_functions(struct hid_device *hdev,
+                                 unsigned char *kbd_func)
+ {
+-      u8 buf[] = { FEATURE_KBD_REPORT_ID, 0x05, 0x20, 0x31, 0x00, 0x08 };
++      const u8 buf[] = { FEATURE_KBD_REPORT_ID, 0x05, 0x20, 0x31, 0x00, 0x08 
};
+       u8 *readbuf;
+       int ret;
+ 
+@@ -908,6 +908,24 @@ static int asus_start_multitouch(struct hid_device *hdev)
+       return 0;
+ }
+ 
++static int __maybe_unused asus_resume(struct hid_device *hdev) {
++      struct asus_drvdata *drvdata = hid_get_drvdata(hdev);
++      int ret = 0;
++
++      if (drvdata->kbd_backlight) {
++              const u8 buf[] = { FEATURE_KBD_REPORT_ID, 0xba, 0xc5, 0xc4,
++                              drvdata->kbd_backlight->cdev.brightness };
++              ret = asus_kbd_set_report(hdev, buf, sizeof(buf));
++              if (ret < 0) {
++                      hid_err(hdev, "Asus failed to set keyboard backlight: 
%d\n", ret);
++                      goto asus_resume_err;
++              }
++      }
++
++asus_resume_err:
++      return ret;
++}
++
+ static int __maybe_unused asus_reset_resume(struct hid_device *hdev)
+ {
+       struct asus_drvdata *drvdata = hid_get_drvdata(hdev);
+@@ -1185,6 +1203,7 @@ static struct hid_driver asus_driver = {
+       .input_configured       = asus_input_configured,
+ #ifdef CONFIG_PM
+       .reset_resume           = asus_reset_resume,
++      .resume                                 = asus_resume,
+ #endif
+       .event                  = asus_event,
+       .raw_event              = asus_raw_event
+diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
+index 590b25460456b..c37399f61c67b 100644
+--- a/drivers/hid/hid-multitouch.c
++++ b/drivers/hid/hid-multitouch.c
+@@ -2003,6 +2003,11 @@ static const struct hid_device_id mt_devices[] = {
+               MT_USB_DEVICE(USB_VENDOR_ID_HANVON_ALT,
+                       USB_DEVICE_ID_HANVON_ALT_MULTITOUCH) },
+ 
++      /* HONOR GLO-GXXX panel */
++      { .driver_data = MT_CLS_VTL,
++              HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
++                      0x347d, 0x7853) },
++
+       /* Ilitek dual touch panel */
+       {  .driver_data = MT_CLS_NSMU,
+               MT_USB_DEVICE(USB_VENDOR_ID_ILITEK,
+diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
+index fae784df084d5..fd84661df5fa7 100644
+--- a/drivers/hid/hid-quirks.c
++++ b/drivers/hid/hid-quirks.c
+@@ -33,6 +33,7 @@ static const struct hid_device_id hid_quirks[] = {
+       { HID_USB_DEVICE(USB_VENDOR_ID_AKAI, USB_DEVICE_ID_AKAI_MPKMINI2), 
HID_QUIRK_NO_INIT_REPORTS },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD), 
HID_QUIRK_BADPAD },
+       { HID_USB_DEVICE(USB_VENDOR_ID_AMI, 
USB_DEVICE_ID_AMI_VIRT_KEYBOARD_AND_MOUSE), HID_QUIRK_ALWAYS_POLL },
++      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 
USB_DEVICE_ID_APPLE_ALU_REVB_ANSI), HID_QUIRK_ALWAYS_POLL },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM), 
HID_QUIRK_NOGET },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC), 
HID_QUIRK_NOGET },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM), 
HID_QUIRK_NOGET },
+diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
+index 1dd9298cb0e02..7bce582788458 100644
+--- a/drivers/md/bcache/bcache.h
++++ b/drivers/md/bcache/bcache.h
+@@ -265,6 +265,7 @@ struct bcache_device {
+ #define BCACHE_DEV_WB_RUNNING         3
+ #define BCACHE_DEV_RATE_DW_RUNNING    4
+       int                     nr_stripes;
++#define BCH_MIN_STRIPE_SZ             ((4 << 20) >> SECTOR_SHIFT)
+       unsigned int            stripe_size;
+       atomic_t                *stripe_sectors_dirty;
+       unsigned long           *full_dirty_stripes;
+diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
+index ad1faee2e186b..5db893d6a824e 100644
+--- a/drivers/md/bcache/btree.c
++++ b/drivers/md/bcache/btree.c
+@@ -1020,6 +1020,9 @@ err:
+  *
+  * The btree node will have either a read or a write lock held, depending on
+  * level and op->lock.
++ *
++ * Note: Only error code or btree pointer will be returned, it is unncessary
++ *       for callers to check NULL pointer.
+  */
+ struct btree *bch_btree_node_get(struct cache_set *c, struct btree_op *op,
+                                struct bkey *k, int level, bool write,
+@@ -1132,6 +1135,10 @@ retry:
+       mutex_unlock(&b->c->bucket_lock);
+ }
+ 
++/*
++ * Only error code or btree pointer will be returned, it is unncessary for
++ * callers to check NULL pointer.
++ */
+ struct btree *__bch_btree_node_alloc(struct cache_set *c, struct btree_op *op,
+                                    int level, bool wait,
+                                    struct btree *parent)
+diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
+index 6afaa5e852837..5d1a4eb816694 100644
+--- a/drivers/md/bcache/super.c
++++ b/drivers/md/bcache/super.c
+@@ -822,6 +822,8 @@ static int bcache_device_init(struct bcache_device *d, 
unsigned int block_size,
+ 
+       if (!d->stripe_size)
+               d->stripe_size = 1 << 31;
++      else if (d->stripe_size < BCH_MIN_STRIPE_SZ)
++              d->stripe_size = roundup(BCH_MIN_STRIPE_SZ, d->stripe_size);
+ 
+       n = DIV_ROUND_UP_ULL(sectors, d->stripe_size);
+       if (!n || n > max_stripes) {
+@@ -1906,7 +1908,7 @@ static int run_cache_set(struct cache_set *c)
+               c->root = bch_btree_node_get(c, NULL, k,
+                                            j->btree_level,
+                                            true, NULL);
+-              if (IS_ERR_OR_NULL(c->root))
++              if (IS_ERR(c->root))
+                       goto err;
+ 
+               list_del_init(&c->root->list);
+diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
+index 67c0d1378747d..341adc1816e33 100644
+--- a/drivers/mmc/core/core.c
++++ b/drivers/mmc/core/core.c
+@@ -570,6 +570,8 @@ int mmc_cqe_recovery(struct mmc_host *host)
+       cmd.busy_timeout = MMC_CQE_RECOVERY_TIMEOUT;
+       mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES);
+ 
++      mmc_poll_for_busy(host->card, MMC_CQE_RECOVERY_TIMEOUT, true, true);
++
+       memset(&cmd, 0, sizeof(cmd));
+       cmd.opcode       = MMC_CMDQ_TASK_MGMT;
+       cmd.arg          = 1; /* Discard entire queue */
+diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
+index d495ba2f368cb..ba0731ab1467e 100644
+--- a/drivers/mmc/core/mmc_ops.c
++++ b/drivers/mmc/core/mmc_ops.c
+@@ -450,8 +450,8 @@ int mmc_switch_status(struct mmc_card *card)
+       return __mmc_switch_status(card, true);
+ }
+ 
+-static int mmc_poll_for_busy(struct mmc_card *card, unsigned int timeout_ms,
+-                      bool send_status, bool retry_crc_err)
++int mmc_poll_for_busy(struct mmc_card *card, unsigned int timeout_ms,
++                    bool send_status, bool retry_crc_err)
+ {
+       struct mmc_host *host = card->host;
+       int err;
+@@ -504,6 +504,7 @@ static int mmc_poll_for_busy(struct mmc_card *card, 
unsigned int timeout_ms,
+ 
+       return 0;
+ }
++EXPORT_SYMBOL_GPL(mmc_poll_for_busy);
+ 
+ /**
+  *    __mmc_switch - modify EXT_CSD register
+diff --git a/drivers/mmc/core/mmc_ops.h b/drivers/mmc/core/mmc_ops.h
+index 8f2f9475716de..4f36a96b9d216 100644
+--- a/drivers/mmc/core/mmc_ops.h
++++ b/drivers/mmc/core/mmc_ops.h
+@@ -31,6 +31,8 @@ int mmc_can_ext_csd(struct mmc_card *card);
+ int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd);
+ int mmc_switch_status(struct mmc_card *card);
+ int __mmc_switch_status(struct mmc_card *card, bool crc_err_fatal);
++int mmc_poll_for_busy(struct mmc_card *card, unsigned int timeout_ms,
++                    bool send_status, bool retry_crc_err);
+ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
+               unsigned int timeout_ms, unsigned char timing,
+               bool use_busy_signal, bool send_status, bool retry_crc_err);
+diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c 
b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
+index 8ea46b81b7395..8a7ac17d3ef7e 100644
+--- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c
++++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
+@@ -1023,6 +1023,7 @@ static void qed_ilt_shadow_free(struct qed_hwfn *p_hwfn)
+               p_dma->p_virt = NULL;
+       }
+       kfree(p_mngr->ilt_shadow);
++      p_mngr->ilt_shadow = NULL;
+ }
+ 
+ static int qed_ilt_blk_alloc(struct qed_hwfn *p_hwfn,
+diff --git a/drivers/net/ethernet/qualcomm/qca_debug.c 
b/drivers/net/ethernet/qualcomm/qca_debug.c
+index 702aa217a27ad..66229b300c5a4 100644
+--- a/drivers/net/ethernet/qualcomm/qca_debug.c
++++ b/drivers/net/ethernet/qualcomm/qca_debug.c
+@@ -30,6 +30,8 @@
+ 
+ #define QCASPI_MAX_REGS 0x20
+ 
++#define QCASPI_RX_MAX_FRAMES 4
++
+ static const u16 qcaspi_spi_regs[] = {
+       SPI_REG_BFR_SIZE,
+       SPI_REG_WRBUF_SPC_AVA,
+@@ -249,31 +251,30 @@ qcaspi_get_ringparam(struct net_device *dev, struct 
ethtool_ringparam *ring)
+ {
+       struct qcaspi *qca = netdev_priv(dev);
+ 
+-      ring->rx_max_pending = 4;
++      ring->rx_max_pending = QCASPI_RX_MAX_FRAMES;
+       ring->tx_max_pending = TX_RING_MAX_LEN;
+-      ring->rx_pending = 4;
++      ring->rx_pending = QCASPI_RX_MAX_FRAMES;
+       ring->tx_pending = qca->txr.count;
+ }
+ 
+ static int
+ qcaspi_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring)
+ {
+-      const struct net_device_ops *ops = dev->netdev_ops;
+       struct qcaspi *qca = netdev_priv(dev);
+ 
+-      if ((ring->rx_pending) ||
++      if (ring->rx_pending != QCASPI_RX_MAX_FRAMES ||
+           (ring->rx_mini_pending) ||
+           (ring->rx_jumbo_pending))
+               return -EINVAL;
+ 
+-      if (netif_running(dev))
+-              ops->ndo_stop(dev);
++      if (qca->spi_thread)
++              kthread_park(qca->spi_thread);
+ 
+       qca->txr.count = max_t(u32, ring->tx_pending, TX_RING_MIN_LEN);
+       qca->txr.count = min_t(u16, qca->txr.count, TX_RING_MAX_LEN);
+ 
+-      if (netif_running(dev))
+-              ops->ndo_open(dev);
++      if (qca->spi_thread)
++              kthread_unpark(qca->spi_thread);
+ 
+       return 0;
+ }
+diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c 
b/drivers/net/ethernet/qualcomm/qca_spi.c
+index db6817de24a14..036ab9dfe7fc5 100644
+--- a/drivers/net/ethernet/qualcomm/qca_spi.c
++++ b/drivers/net/ethernet/qualcomm/qca_spi.c
+@@ -573,6 +573,18 @@ qcaspi_spi_thread(void *data)
+       netdev_info(qca->net_dev, "SPI thread created\n");
+       while (!kthread_should_stop()) {
+               set_current_state(TASK_INTERRUPTIBLE);
++              if (kthread_should_park()) {
++                      netif_tx_disable(qca->net_dev);
++                      netif_carrier_off(qca->net_dev);
++                      qcaspi_flush_tx_ring(qca);
++                      kthread_parkme();
++                      if (qca->sync == QCASPI_SYNC_READY) {
++                              netif_carrier_on(qca->net_dev);
++                              netif_wake_queue(qca->net_dev);
++                      }
++                      continue;
++              }
++
+               if ((qca->intr_req == qca->intr_svc) &&
+                   !qca->txr.skb[qca->txr.head])
+                       schedule();
+@@ -601,11 +613,17 @@ qcaspi_spi_thread(void *data)
+                       if (intr_cause & SPI_INT_CPU_ON) {
+                               qcaspi_qca7k_sync(qca, QCASPI_EVENT_CPUON);
+ 
++                              /* Frame decoding in progress */
++                              if (qca->frm_handle.state != 
qca->frm_handle.init)
++                                      qca->net_dev->stats.rx_dropped++;
++
++                              qcafrm_fsm_init_spi(&qca->frm_handle);
++                              qca->stats.device_reset++;
++
+                               /* not synced. */
+                               if (qca->sync != QCASPI_SYNC_READY)
+                                       continue;
+ 
+-                              qca->stats.device_reset++;
+                               netif_wake_queue(qca->net_dev);
+                               netif_carrier_on(qca->net_dev);
+                       }
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c 
b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+index 4eaa65e8d58f2..ee48283b2d967 100644
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+@@ -4691,9 +4691,9 @@ int stmmac_dvr_probe(struct device *device,
+               /* MDIO bus Registration */
+               ret = stmmac_mdio_register(ndev);
+               if (ret < 0) {
+-                      dev_err(priv->device,
+-                              "%s: MDIO bus (id: %d) registration failed",
+-                              __func__, priv->plat->bus_id);
++                      dev_err_probe(priv->device, ret,
++                                    "%s: MDIO bus (id: %d) registration 
failed\n",
++                                    __func__, priv->plat->bus_id);
+                       goto error_mdio_register;
+               }
+       }
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c 
b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+index 40c42637ad755..580a6defe1082 100644
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+@@ -358,8 +358,12 @@ int stmmac_mdio_register(struct net_device *ndev)
+       new_bus->parent = priv->device;
+ 
+       err = of_mdiobus_register(new_bus, mdio_node);
+-      if (err != 0) {
+-              dev_err(dev, "Cannot register the MDIO bus\n");
++      if (err == -ENODEV) {
++              err = 0;
++              dev_info(dev, "MDIO bus is disabled\n");
++              goto bus_register_fail;
++      } else if (err) {
++              dev_err_probe(dev, err, "Cannot register the MDIO bus\n");
+               goto bus_register_fail;
+       }
+ 
+diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
+index 60af6956286d4..56caff2d01c45 100644
+--- a/drivers/net/team/team.c
++++ b/drivers/net/team/team.c
+@@ -284,8 +284,10 @@ static int __team_options_register(struct team *team,
+       return 0;
+ 
+ inst_rollback:
+-      for (i--; i >= 0; i--)
++      for (i--; i >= 0; i--) {
+               __team_option_inst_del_option(team, dst_opts[i]);
++              list_del(&dst_opts[i]->list);
++      }
+ 
+       i = option_count;
+ alloc_rollback:
+diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c
+index 68912e266826b..892d58b38cf5b 100644
+--- a/drivers/net/usb/aqc111.c
++++ b/drivers/net/usb/aqc111.c
+@@ -1079,17 +1079,17 @@ static int aqc111_rx_fixup(struct usbnet *dev, struct 
sk_buff *skb)
+       u16 pkt_count = 0;
+       u64 desc_hdr = 0;
+       u16 vlan_tag = 0;
+-      u32 skb_len = 0;
++      u32 skb_len;
+ 
+       if (!skb)
+               goto err;
+ 
+-      if (skb->len == 0)
++      skb_len = skb->len;
++      if (skb_len < sizeof(desc_hdr))
+               goto err;
+ 
+-      skb_len = skb->len;
+       /* RX Descriptor Header */
+-      skb_trim(skb, skb->len - sizeof(desc_hdr));
++      skb_trim(skb, skb_len - sizeof(desc_hdr));
+       desc_hdr = le64_to_cpup((u64 *)skb_tail_pointer(skb));
+ 
+       /* Check these packets */
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
+index ebc1f01d5ea27..c2bd4abce6de5 100644
+--- a/drivers/net/usb/qmi_wwan.c
++++ b/drivers/net/usb/qmi_wwan.c
+@@ -1247,6 +1247,7 @@ static const struct usb_device_id products[] = {
+       {QMI_FIXED_INTF(0x19d2, 0x0168, 4)},
+       {QMI_FIXED_INTF(0x19d2, 0x0176, 3)},
+       {QMI_FIXED_INTF(0x19d2, 0x0178, 3)},
++      {QMI_FIXED_INTF(0x19d2, 0x0189, 4)},    /* ZTE MF290 */
+       {QMI_FIXED_INTF(0x19d2, 0x0191, 4)},    /* ZTE EuFi890 */
+       {QMI_FIXED_INTF(0x19d2, 0x0199, 1)},    /* ZTE MF820S */
+       {QMI_FIXED_INTF(0x19d2, 0x0200, 1)},
+diff --git a/drivers/pci/hotplug/acpiphp_glue.c 
b/drivers/pci/hotplug/acpiphp_glue.c
+index f304bdefa8f5f..98be06ac2af24 100644
+--- a/drivers/pci/hotplug/acpiphp_glue.c
++++ b/drivers/pci/hotplug/acpiphp_glue.c
+@@ -510,15 +510,12 @@ static void enable_slot(struct acpiphp_slot *slot, bool 
bridge)
+                               if (pass && dev->subordinate) {
+                                       check_hotplug_bridge(slot, dev);
+                                       
pcibios_resource_survey_bus(dev->subordinate);
+-                                      if (pci_is_root_bus(bus))
+-                                              
__pci_bus_size_bridges(dev->subordinate, &add_list);
++                                      __pci_bus_size_bridges(dev->subordinate,
++                                                             &add_list);
+                               }
+                       }
+               }
+-              if (pci_is_root_bus(bus))
+-                      __pci_bus_assign_resources(bus, &add_list, NULL);
+-              else
+-                      pci_assign_unassigned_bridge_resources(bus->self);
++              __pci_bus_assign_resources(bus, &add_list, NULL);
+       }
+ 
+       acpiphp_sanitize_bus(bus);
+diff --git a/drivers/platform/x86/intel_telemetry_core.c 
b/drivers/platform/x86/intel_telemetry_core.c
+index d4040bb222b48..59fc6624b1ac9 100644
+--- a/drivers/platform/x86/intel_telemetry_core.c
++++ b/drivers/platform/x86/intel_telemetry_core.c
+@@ -102,7 +102,7 @@ static const struct telemetry_core_ops telm_defpltops = {
+ /**
+  * telemetry_update_events() - Update telemetry Configuration
+  * @pss_evtconfig: PSS related config. No change if num_evts = 0.
+- * @pss_evtconfig: IOSS related config. No change if num_evts = 0.
++ * @ioss_evtconfig: IOSS related config. No change if num_evts = 0.
+  *
+  * This API updates the IOSS & PSS Telemetry configuration. Old config
+  * is overwritten. Call telemetry_reset_events when logging is over
+@@ -176,7 +176,7 @@ EXPORT_SYMBOL_GPL(telemetry_reset_events);
+ /**
+  * telemetry_get_eventconfig() - Returns the pss and ioss events enabled
+  * @pss_evtconfig: Pointer to PSS related configuration.
+- * @pss_evtconfig: Pointer to IOSS related configuration.
++ * @ioss_evtconfig: Pointer to IOSS related configuration.
+  * @pss_len:     Number of u32 elements allocated for pss_evtconfig array
+  * @ioss_len:    Number of u32 elements allocated for ioss_evtconfig array
+  *
+diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
+index f7ca1f7a68f00..3b3f909407c39 100644
+--- a/drivers/soundwire/stream.c
++++ b/drivers/soundwire/stream.c
+@@ -709,14 +709,15 @@ error_1:
+  * sdw_ml_sync_bank_switch: Multilink register bank switch
+  *
+  * @bus: SDW bus instance
++ * @multi_link: whether this is a multi-link stream with hardware-based sync
+  *
+  * Caller function should free the buffers on error
+  */
+-static int sdw_ml_sync_bank_switch(struct sdw_bus *bus)
++static int sdw_ml_sync_bank_switch(struct sdw_bus *bus, bool multi_link)
+ {
+       unsigned long time_left;
+ 
+-      if (!bus->multi_link)
++      if (!multi_link)
+               return 0;
+ 
+       /* Wait for completion of transfer */
+@@ -809,7 +810,7 @@ static int do_bank_switch(struct sdw_stream_runtime 
*stream)
+                       bus->bank_switch_timeout = DEFAULT_BANK_SWITCH_TIMEOUT;
+ 
+               /* Check if bank switch was successful */
+-              ret = sdw_ml_sync_bank_switch(bus);
++              ret = sdw_ml_sync_bank_switch(bus, multi_link);
+               if (ret < 0) {
+                       dev_err(bus->dev,
+                               "multi link bank switch failed: %d\n", ret);
+diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
+index 49fcce6529a60..30952f073fb41 100644
+--- a/fs/afs/rxrpc.c
++++ b/fs/afs/rxrpc.c
+@@ -490,7 +490,7 @@ error_kill_call:
+       if (call->async) {
+               if (cancel_work_sync(&call->async_work))
+                       afs_put_call(call);
+-              afs_put_call(call);
++              afs_set_call_complete(call, ret, 0);
+       }
+ 
+       ac->error = ret;
+diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
+index a0ec645bd7ede..9e5aa625ab303 100644
+--- a/fs/ext4/mballoc.c
++++ b/fs/ext4/mballoc.c
+@@ -3182,6 +3182,10 @@ ext4_mb_normalize_request(struct 
ext4_allocation_context *ac,
+       start = max(start, rounddown(ac->ac_o_ex.fe_logical,
+                       (ext4_lblk_t)EXT4_BLOCKS_PER_GROUP(ac->ac_sb)));
+ 
++      /* avoid unnecessary preallocation that may trigger assertions */
++      if (start + size > EXT_MAX_BLOCKS)
++              size = EXT_MAX_BLOCKS - start;
++
+       /* don't cover already allocated blocks in selected range */
+       if (ar->pleft && start <= ar->lleft) {
+               size -= ar->lleft + 1 - start;
+diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h
+index fde943d180e03..6dc2269a5398a 100644
+--- a/include/asm-generic/qspinlock.h
++++ b/include/asm-generic/qspinlock.h
+@@ -38,7 +38,7 @@ static __always_inline int queued_spin_is_locked(struct 
qspinlock *lock)
+  */
+ static __always_inline int queued_spin_value_unlocked(struct qspinlock lock)
+ {
+-      return !atomic_read(&lock.val);
++      return !lock.val.counter;
+ }
+ 
+ /**
+diff --git a/include/linux/cred.h b/include/linux/cred.h
+index 18639c069263f..d35e4867d5cc7 100644
+--- a/include/linux/cred.h
++++ b/include/linux/cred.h
+@@ -109,7 +109,7 @@ static inline int groups_search(const struct group_info 
*group_info, kgid_t grp)
+  * same context as task->real_cred.
+  */
+ struct cred {
+-      atomic_t        usage;
++      atomic_long_t   usage;
+ #ifdef CONFIG_DEBUG_CREDENTIALS
+       atomic_t        subscribers;    /* number of processes subscribed */
+       void            *put_addr;
+@@ -227,7 +227,7 @@ static inline bool cap_ambient_invariant_ok(const struct 
cred *cred)
+  */
+ static inline struct cred *get_new_cred(struct cred *cred)
+ {
+-      atomic_inc(&cred->usage);
++      atomic_long_inc(&cred->usage);
+       return cred;
+ }
+ 
+@@ -259,7 +259,7 @@ static inline const struct cred *get_cred_rcu(const struct 
cred *cred)
+       struct cred *nonconst_cred = (struct cred *) cred;
+       if (!cred)
+               return NULL;
+-      if (!atomic_inc_not_zero(&nonconst_cred->usage))
++      if (!atomic_long_inc_not_zero(&nonconst_cred->usage))
+               return NULL;
+       validate_creds(cred);
+       nonconst_cred->non_rcu = 0;
+@@ -283,7 +283,7 @@ static inline void put_cred(const struct cred *_cred)
+ 
+       if (cred) {
+               validate_creds(cred);
+-              if (atomic_dec_and_test(&(cred)->usage))
++              if (atomic_long_dec_and_test(&(cred)->usage))
+                       __put_cred(cred);
+       }
+ }
+diff --git a/include/net/addrconf.h b/include/net/addrconf.h
+index 880e609b7352a..32685eaba28fc 100644
+--- a/include/net/addrconf.h
++++ b/include/net/addrconf.h
+@@ -31,17 +31,22 @@ struct prefix_info {
+       __u8                    length;
+       __u8                    prefix_len;
+ 
++      union __packed {
++              __u8            flags;
++              struct __packed {
+ #if defined(__BIG_ENDIAN_BITFIELD)
+-      __u8                    onlink : 1,
++                      __u8    onlink : 1,
+                               autoconf : 1,
+                               reserved : 6;
+ #elif defined(__LITTLE_ENDIAN_BITFIELD)
+-      __u8                    reserved : 6,
++                      __u8    reserved : 6,
+                               autoconf : 1,
+                               onlink : 1;
+ #else
+ #error "Please fix <asm/byteorder.h>"
+ #endif
++              };
++      };
+       __be32                  valid;
+       __be32                  prefered;
+       __be32                  reserved2;
+@@ -49,6 +54,9 @@ struct prefix_info {
+       struct in6_addr         prefix;
+ };
+ 
++/* rfc4861 4.6.2: IPv6 PIO is 32 bytes in size */
++static_assert(sizeof(struct prefix_info) == 32);
++
+ #include <linux/ipv6.h>
+ #include <linux/netdevice.h>
+ #include <net/if_inet6.h>
+diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
+index f6d614926e9e9..601bedda91c00 100644
+--- a/include/net/if_inet6.h
++++ b/include/net/if_inet6.h
+@@ -22,10 +22,6 @@
+ #define IF_RS_SENT    0x10
+ #define IF_READY      0x80000000
+ 
+-/* prefix flags */
+-#define IF_PREFIX_ONLINK      0x01
+-#define IF_PREFIX_AUTOCONF    0x02
+-
+ enum {
+       INET6_IFADDR_STATE_PREDAD,
+       INET6_IFADDR_STATE_DAD,
+diff --git a/kernel/cred.c b/kernel/cred.c
+index 809a985b17934..77d6f115d9447 100644
+--- a/kernel/cred.c
++++ b/kernel/cred.c
+@@ -98,17 +98,17 @@ static void put_cred_rcu(struct rcu_head *rcu)
+ 
+ #ifdef CONFIG_DEBUG_CREDENTIALS
+       if (cred->magic != CRED_MAGIC_DEAD ||
+-          atomic_read(&cred->usage) != 0 ||
++          atomic_long_read(&cred->usage) != 0 ||
+           read_cred_subscribers(cred) != 0)
+               panic("CRED: put_cred_rcu() sees %p with"
+-                    " mag %x, put %p, usage %d, subscr %d\n",
++                    " mag %x, put %p, usage %ld, subscr %d\n",
+                     cred, cred->magic, cred->put_addr,
+-                    atomic_read(&cred->usage),
++                    atomic_long_read(&cred->usage),
+                     read_cred_subscribers(cred));
+ #else
+-      if (atomic_read(&cred->usage) != 0)
+-              panic("CRED: put_cred_rcu() sees %p with usage %d\n",
+-                    cred, atomic_read(&cred->usage));
++      if (atomic_long_read(&cred->usage) != 0)
++              panic("CRED: put_cred_rcu() sees %p with usage %ld\n",
++                    cred, atomic_long_read(&cred->usage));
+ #endif
+ 
+       security_cred_free(cred);
+@@ -131,11 +131,11 @@ static void put_cred_rcu(struct rcu_head *rcu)
+  */
+ void __put_cred(struct cred *cred)
+ {
+-      kdebug("__put_cred(%p{%d,%d})", cred,
+-             atomic_read(&cred->usage),
++      kdebug("__put_cred(%p{%ld,%d})", cred,
++             atomic_long_read(&cred->usage),
+              read_cred_subscribers(cred));
+ 
+-      BUG_ON(atomic_read(&cred->usage) != 0);
++      BUG_ON(atomic_long_read(&cred->usage) != 0);
+ #ifdef CONFIG_DEBUG_CREDENTIALS
+       BUG_ON(read_cred_subscribers(cred) != 0);
+       cred->magic = CRED_MAGIC_DEAD;
+@@ -158,8 +158,8 @@ void exit_creds(struct task_struct *tsk)
+ {
+       struct cred *cred;
+ 
+-      kdebug("exit_creds(%u,%p,%p,{%d,%d})", tsk->pid, tsk->real_cred, 
tsk->cred,
+-             atomic_read(&tsk->cred->usage),
++      kdebug("exit_creds(%u,%p,%p,{%ld,%d})", tsk->pid, tsk->real_cred, 
tsk->cred,
++             atomic_long_read(&tsk->cred->usage),
+              read_cred_subscribers(tsk->cred));
+ 
+       cred = (struct cred *) tsk->real_cred;
+@@ -218,7 +218,7 @@ struct cred *cred_alloc_blank(void)
+       if (!new)
+               return NULL;
+ 
+-      atomic_set(&new->usage, 1);
++      atomic_long_set(&new->usage, 1);
+ #ifdef CONFIG_DEBUG_CREDENTIALS
+       new->magic = CRED_MAGIC;
+ #endif
+@@ -265,7 +265,7 @@ struct cred *prepare_creds(void)
+       memcpy(new, old, sizeof(struct cred));
+ 
+       new->non_rcu = 0;
+-      atomic_set(&new->usage, 1);
++      atomic_long_set(&new->usage, 1);
+       set_cred_subscribers(new, 0);
+       get_group_info(new->group_info);
+       get_uid(new->user);
+@@ -345,8 +345,8 @@ int copy_creds(struct task_struct *p, unsigned long 
clone_flags)
+               p->real_cred = get_cred(p->cred);
+               get_cred(p->cred);
+               alter_cred_subscribers(p->cred, 2);
+-              kdebug("share_creds(%p{%d,%d})",
+-                     p->cred, atomic_read(&p->cred->usage),
++              kdebug("share_creds(%p{%ld,%d})",
++                     p->cred, atomic_long_read(&p->cred->usage),
+                      read_cred_subscribers(p->cred));
+               atomic_inc(&p->cred->user->processes);
+               return 0;
+@@ -436,8 +436,8 @@ int commit_creds(struct cred *new)
+       struct task_struct *task = current;
+       const struct cred *old = task->real_cred;
+ 
+-      kdebug("commit_creds(%p{%d,%d})", new,
+-             atomic_read(&new->usage),
++      kdebug("commit_creds(%p{%ld,%d})", new,
++             atomic_long_read(&new->usage),
+              read_cred_subscribers(new));
+ 
+       BUG_ON(task->cred != old);
+@@ -446,7 +446,7 @@ int commit_creds(struct cred *new)
+       validate_creds(old);
+       validate_creds(new);
+ #endif
+-      BUG_ON(atomic_read(&new->usage) < 1);
++      BUG_ON(atomic_long_read(&new->usage) < 1);
+ 
+       get_cred(new); /* we will require a ref for the subj creds too */
+ 
+@@ -519,14 +519,14 @@ EXPORT_SYMBOL(commit_creds);
+  */
+ void abort_creds(struct cred *new)
+ {
+-      kdebug("abort_creds(%p{%d,%d})", new,
+-             atomic_read(&new->usage),
++      kdebug("abort_creds(%p{%ld,%d})", new,
++             atomic_long_read(&new->usage),
+              read_cred_subscribers(new));
+ 
+ #ifdef CONFIG_DEBUG_CREDENTIALS
+       BUG_ON(read_cred_subscribers(new) != 0);
+ #endif
+-      BUG_ON(atomic_read(&new->usage) < 1);
++      BUG_ON(atomic_long_read(&new->usage) < 1);
+       put_cred(new);
+ }
+ EXPORT_SYMBOL(abort_creds);
+@@ -542,8 +542,8 @@ const struct cred *override_creds(const struct cred *new)
+ {
+       const struct cred *old = current->cred;
+ 
+-      kdebug("override_creds(%p{%d,%d})", new,
+-             atomic_read(&new->usage),
++      kdebug("override_creds(%p{%ld,%d})", new,
++             atomic_long_read(&new->usage),
+              read_cred_subscribers(new));
+ 
+       validate_creds(old);
+@@ -565,8 +565,8 @@ const struct cred *override_creds(const struct cred *new)
+       rcu_assign_pointer(current->cred, new);
+       alter_cred_subscribers(old, -1);
+ 
+-      kdebug("override_creds() = %p{%d,%d}", old,
+-             atomic_read(&old->usage),
++      kdebug("override_creds() = %p{%ld,%d}", old,
++             atomic_long_read(&old->usage),
+              read_cred_subscribers(old));
+       return old;
+ }
+@@ -583,8 +583,8 @@ void revert_creds(const struct cred *old)
+ {
+       const struct cred *override = current->cred;
+ 
+-      kdebug("revert_creds(%p{%d,%d})", old,
+-             atomic_read(&old->usage),
++      kdebug("revert_creds(%p{%ld,%d})", old,
++             atomic_long_read(&old->usage),
+              read_cred_subscribers(old));
+ 
+       validate_creds(old);
+@@ -698,7 +698,7 @@ struct cred *prepare_kernel_cred(struct task_struct 
*daemon)
+ 
+       *new = *old;
+       new->non_rcu = 0;
+-      atomic_set(&new->usage, 1);
++      atomic_long_set(&new->usage, 1);
+       set_cred_subscribers(new, 0);
+       get_uid(new->user);
+       get_user_ns(new->user_ns);
+@@ -808,8 +808,8 @@ static void dump_invalid_creds(const struct cred *cred, 
const char *label,
+              cred == tsk->cred ? "[eff]" : "");
+       printk(KERN_ERR "CRED: ->magic=%x, put_addr=%p\n",
+              cred->magic, cred->put_addr);
+-      printk(KERN_ERR "CRED: ->usage=%d, subscr=%d\n",
+-             atomic_read(&cred->usage),
++      printk(KERN_ERR "CRED: ->usage=%ld, subscr=%d\n",
++             atomic_long_read(&cred->usage),
+              read_cred_subscribers(cred));
+       printk(KERN_ERR "CRED: ->*uid = { %d,%d,%d,%d }\n",
+               from_kuid_munged(&init_user_ns, cred->uid),
+@@ -881,9 +881,9 @@ EXPORT_SYMBOL(__validate_process_creds);
+  */
+ void validate_creds_for_do_exit(struct task_struct *tsk)
+ {
+-      kdebug("validate_creds_for_do_exit(%p,%p{%d,%d})",
++      kdebug("validate_creds_for_do_exit(%p,%p{%ld,%d})",
+              tsk->real_cred, tsk->cred,
+-             atomic_read(&tsk->cred->usage),
++             atomic_long_read(&tsk->cred->usage),
+              read_cred_subscribers(tsk->cred));
+ 
+       __validate_process_creds(tsk, __FILE__, __LINE__);
+diff --git a/kernel/events/core.c b/kernel/events/core.c
+index fcc8e3823198f..1e62a567b0d7a 100644
+--- a/kernel/events/core.c
++++ b/kernel/events/core.c
+@@ -1835,6 +1835,16 @@ static bool perf_event_validate_size(struct perf_event 
*event)
+                                  group_leader->nr_siblings + 1) > 16*1024)
+               return false;
+ 
++      /*
++       * When creating a new group leader, group_leader->ctx is initialized
++       * after the size has been validated, but we cannot safely use
++       * for_each_sibling_event() until group_leader->ctx is set. A new group
++       * leader cannot have any siblings yet, so we can safely skip checking
++       * the non-existent siblings.
++       */
++      if (event == group_leader)
++              return true;
++
+       for_each_sibling_event(sibling, group_leader) {
+               if (__perf_event_read_size(sibling->attr.read_format,
+                                          group_leader->nr_siblings + 1) > 
16*1024)
+diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
+index 9d6ba38791961..f42a7c777d26e 100644
+--- a/kernel/trace/ring_buffer.c
++++ b/kernel/trace/ring_buffer.c
+@@ -1414,6 +1414,8 @@ static void rb_free_cpu_buffer(struct 
ring_buffer_per_cpu *cpu_buffer)
+               free_buffer_page(bpage);
+       }
+ 
++      free_page((unsigned long)cpu_buffer->free_page);
++
+       kfree(cpu_buffer);
+ }
+ 
+diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
+index 4610c352849bc..70cd5f55628d3 100644
+--- a/net/appletalk/ddp.c
++++ b/net/appletalk/ddp.c
+@@ -1803,15 +1803,14 @@ static int atalk_ioctl(struct socket *sock, unsigned 
int cmd, unsigned long arg)
+               break;
+       }
+       case TIOCINQ: {
+-              /*
+-               * These two are safe on a single CPU system as only
+-               * user tasks fiddle here
+-               */
+-              struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
++              struct sk_buff *skb;
+               long amount = 0;
+ 
++              spin_lock_irq(&sk->sk_receive_queue.lock);
++              skb = skb_peek(&sk->sk_receive_queue);
+               if (skb)
+                       amount = skb->len - sizeof(struct ddpehdr);
++              spin_unlock_irq(&sk->sk_receive_queue.lock);
+               rc = put_user(amount, (int __user *)argp);
+               break;
+       }
+diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c
+index d955b683aa7c4..3a2198aabc363 100644
+--- a/net/atm/ioctl.c
++++ b/net/atm/ioctl.c
+@@ -71,14 +71,17 @@ static int do_vcc_ioctl(struct socket *sock, unsigned int 
cmd,
+       case SIOCINQ:
+       {
+               struct sk_buff *skb;
++              int amount;
+ 
+               if (sock->state != SS_CONNECTED) {
+                       error = -EINVAL;
+                       goto done;
+               }
++              spin_lock_irq(&sk->sk_receive_queue.lock);
+               skb = skb_peek(&sk->sk_receive_queue);
+-              error = put_user(skb ? skb->len : 0,
+-                               (int __user *)argp) ? -EFAULT : 0;
++              amount = skb ? skb->len : 0;
++              spin_unlock_irq(&sk->sk_receive_queue.lock);
++              error = put_user(amount, (int __user *)argp) ? -EFAULT : 0;
+               goto done;
+       }
+       case ATM_SETSC:
+diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
+index 1dce05bfa3005..6d7f441c7dd76 100644
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -2945,7 +2945,13 @@ int __tcp_retransmit_skb(struct sock *sk, struct 
sk_buff *skb, int segs)
+       if (skb_still_in_host_queue(sk, skb))
+               return -EBUSY;
+ 
++start:
+       if (before(TCP_SKB_CB(skb)->seq, tp->snd_una)) {
++              if (unlikely(TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN)) {
++                      TCP_SKB_CB(skb)->tcp_flags &= ~TCPHDR_SYN;
++                      TCP_SKB_CB(skb)->seq++;
++                      goto start;
++              }
+               if (unlikely(before(TCP_SKB_CB(skb)->end_seq, tp->snd_una))) {
+                       WARN_ON_ONCE(1);
+                       return -EINVAL;
+diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
+index c523236d934eb..4bec4c0617412 100644
+--- a/net/ipv6/addrconf.c
++++ b/net/ipv6/addrconf.c
+@@ -5977,11 +5977,7 @@ static int inet6_fill_prefix(struct sk_buff *skb, 
struct inet6_dev *idev,
+       pmsg->prefix_len = pinfo->prefix_len;
+       pmsg->prefix_type = pinfo->type;
+       pmsg->prefix_pad3 = 0;
+-      pmsg->prefix_flags = 0;
+-      if (pinfo->onlink)
+-              pmsg->prefix_flags |= IF_PREFIX_ONLINK;
+-      if (pinfo->autoconf)
+-              pmsg->prefix_flags |= IF_PREFIX_AUTOCONF;
++      pmsg->prefix_flags = pinfo->flags;
+ 
+       if (nla_put(skb, PREFIX_ADDRESS, sizeof(pinfo->prefix), &pinfo->prefix))
+               goto nla_put_failure;
+diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
+index 6fb158172ddc2..fc9ef08788f73 100644
+--- a/net/rose/af_rose.c
++++ b/net/rose/af_rose.c
+@@ -1285,9 +1285,11 @@ static int rose_ioctl(struct socket *sock, unsigned int 
cmd, unsigned long arg)
+       case TIOCINQ: {
+               struct sk_buff *skb;
+               long amount = 0L;
+-              /* These two are safe on a single CPU system as only user tasks 
fiddle here */
++
++              spin_lock_irq(&sk->sk_receive_queue.lock);
+               if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
+                       amount = skb->len;
++              spin_unlock_irq(&sk->sk_receive_queue.lock);
+               return put_user(amount, (unsigned int __user *) argp);
+       }
+ 
+diff --git a/net/vmw_vsock/virtio_transport_common.c 
b/net/vmw_vsock/virtio_transport_common.c
+index 93c11ffae92bb..e0bb83f5746c6 100644
+--- a/net/vmw_vsock/virtio_transport_common.c
++++ b/net/vmw_vsock/virtio_transport_common.c
+@@ -372,7 +372,7 @@ static s64 virtio_transport_has_space(struct vsock_sock 
*vsk)
+       struct virtio_vsock_sock *vvs = vsk->trans;
+       s64 bytes;
+ 
+-      bytes = vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt);
++      bytes = (s64)vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt);
+       if (bytes < 0)
+               bytes = 0;
+ 
+diff --git a/scripts/sign-file.c b/scripts/sign-file.c
+index 7434e9ea926e2..12acc70e5a7a5 100644
+--- a/scripts/sign-file.c
++++ b/scripts/sign-file.c
+@@ -322,7 +322,7 @@ int main(int argc, char **argv)
+                                    CMS_NOSMIMECAP | use_keyid |
+                                    use_signed_attrs),
+                   "CMS_add1_signer");
+-              ERR(CMS_final(cms, bm, NULL, CMS_NOCERTS | CMS_BINARY) < 0,
++              ERR(CMS_final(cms, bm, NULL, CMS_NOCERTS | CMS_BINARY) != 1,
+                   "CMS_final");
+ 
+ #else
+@@ -341,10 +341,10 @@ int main(int argc, char **argv)
+                       b = BIO_new_file(sig_file_name, "wb");
+                       ERR(!b, "%s", sig_file_name);
+ #ifndef USE_PKCS7
+-                      ERR(i2d_CMS_bio_stream(b, cms, NULL, 0) < 0,
++                      ERR(i2d_CMS_bio_stream(b, cms, NULL, 0) != 1,
+                           "%s", sig_file_name);
+ #else
+-                      ERR(i2d_PKCS7_bio(b, pkcs7) < 0,
++                      ERR(i2d_PKCS7_bio(b, pkcs7) != 1,
+                           "%s", sig_file_name);
+ #endif
+                       BIO_free(b);
+@@ -374,9 +374,9 @@ int main(int argc, char **argv)
+ 
+       if (!raw_sig) {
+ #ifndef USE_PKCS7
+-              ERR(i2d_CMS_bio_stream(bd, cms, NULL, 0) < 0, "%s", dest_name);
++              ERR(i2d_CMS_bio_stream(bd, cms, NULL, 0) != 1, "%s", dest_name);
+ #else
+-              ERR(i2d_PKCS7_bio(bd, pkcs7) < 0, "%s", dest_name);
++              ERR(i2d_PKCS7_bio(bd, pkcs7) != 1, "%s", dest_name);
+ #endif
+       } else {
+               BIO *b;
+@@ -396,7 +396,7 @@ int main(int argc, char **argv)
+       ERR(BIO_write(bd, &sig_info, sizeof(sig_info)) < 0, "%s", dest_name);
+       ERR(BIO_write(bd, magic_number, sizeof(magic_number) - 1) < 0, "%s", 
dest_name);
+ 
+-      ERR(BIO_free(bd) < 0, "%s", dest_name);
++      ERR(BIO_free(bd) != 1, "%s", dest_name);
+ 
+       /* Finally, if we're signing in place, replace the original. */
+       if (replace_orig)
+diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
+index c72abdaac96eb..56943daccfc72 100644
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -1822,6 +1822,8 @@ static const struct snd_pci_quirk force_connect_list[] = 
{
+       SND_PCI_QUIRK(0x103c, 0x871a, "HP", 1),
+       SND_PCI_QUIRK(0x103c, 0x8711, "HP", 1),
+       SND_PCI_QUIRK(0x103c, 0x8715, "HP", 1),
++      SND_PCI_QUIRK(0x1043, 0x86ae, "ASUS", 1),  /* Z170 PRO */
++      SND_PCI_QUIRK(0x1043, 0x86c7, "ASUS", 1),  /* Z170M PLUS */
+       SND_PCI_QUIRK(0x1462, 0xec94, "MS-7C94", 1),
+       {}
+ };


Reply via email to