5.19.17-rc1 review
Subsystems (9)
Greg Kroah-Hartman
maintainerPATCH 362/717 ia64: export memory_add_physaddr_to_nid to fix cxl build error
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit 97c318bfbe84efded246e80428054f300042f110 ]
cxl_pmem.ko uses memory_add_physaddr_to_nid() but ia64 does not export it, so this causes a build error:
ERROR: modpost: "memory_add_physaddr_to_nid" [drivers/cxl/cxl_pmem.ko] undefined!
Fix this by exporting that function.
--- arch/ia64/mm/numa.c | 1 + 1 file changed, 1 insertion(+)
arch/ia64/mm/numa.c +1 -0
@@ -75,5 +75,6 @@ int memory_add_physaddr_to_nid(u64 addr)return 0 ;return nid; } +EXPORT_SYMBOL (memory_add_physaddr_to_nid);#endif #endif
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 1/717 Revert "fs: check FMODE_LSEEK to control internal pipe splicing"
In reply to Greg Kroah-HartmanThis reverts commit fd0a6e99b61e6c08fa5cf585d54fd956f70c73a6.
Which was upstream commit 97ef77c52b789ec1411d360ed99dca1efe4b2c81.
The commit is missing dependencies and breaks NFS tests, remove it for now.
--- fs/splice.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fs/splice.c +6 -4
@@ -814,15 +814,17 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, {struct pipe_inode_info *pipe;long ret, bytes; +umode_t i_mode;size_t len;int i, flags, more;/* -* We require the input to be seekable, as we don't want to randomly -* drop data for eg socket -> socket splicing. Use the piped splicing -* for that! +* We require the input being a regular file, as we don't want to +* randomly drop data for eg socket -> socket splicing. Use the +* piped splicing for that! */ -if (unlikely (!(in->f_mode &FMODE_LSEEK ))) + i_mode =file_inode (in)->i_mode; +if (unlikely (!S_ISREG (i_mode) && !S_ISBLK (i_mode)))return -EINVAL ;/*
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 10/717 mtd: rawnand: atmel: Unmap streaming DMA mappings
In reply to Greg Kroah-HartmanFrom: Tudor Ambarus <[email protected]>
commit 1161703c9bd664da5e3b2eb1a3bb40c210e026ea upstream.
Every dma_map_single() call should have its dma_unmap_single() counterpart, because the DMA address space is a shared resource and one could render the machine unusable by consuming all DMA addresses.
--- drivers/mtd/nand/raw/atmel/nand-controller.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/nand/raw/atmel/nand-controller.c +1 -0
@@ -405,6 +405,7 @@ static int atmel_nand_dma_transfer(strucdma_async_issue_pending (nc->dmac);wait_for_completion (&finished); +dma_unmap_single (nc->dev, buf_dma, len, dir);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 11/717 io_uring/rw: fix unexpected link breakage
In reply to Greg Kroah-HartmanFrom: Pavel Begunkov <[email protected]>
commit bf68b5b34311ee57ed40749a1257a30b46127556 upstream.
req->cqe.res is set in io_read() to the amount of bytes left to be done, which is used to figure out whether to fail a read or not. However, io_read() may do another without returning, and we stash the previous value into ->bytes_done but forget to update cqe.res. Then we ask a read to do strictly less than cqe.res but expect the return to be exactly cqe.res.
Fix the bug by updating cqe.res for retries.
--- io_uring/io_uring.c | 1 + 1 file changed, 1 insertion(+)
io_uring/io_uring.c +1 -0
@@ -4215,6 +4215,7 @@ static int io_read(struct io_kiocb *req,return -EAGAIN ; } + req->cqe.res =iov_iter_count (&s->iter);/* * Now retry read with the IOCB_WAITQ parts set in the iocb. If * we get -EIOCBQUEUED, then we'll get a notification when the
Greg Kroah-Hartman
maintainerPATCH 12/717 io_uring/net: fix fast_iov assignment in io_setup_async_msg()
In reply to Greg Kroah-HartmanFrom: Stefan Metzmacher <[email protected]>
commit 3e4cb6ebbb2bad201c1186bc0b7e8cf41dd7f7e6 upstream.
I hit a very bad problem during my tests of SENDMSG_ZC. BUG(); in first_iovec_segment() triggered very easily. The problem was io_setup_async_msg() in the partial retry case, which seems to happen more often with _ZC.
iov_iter_iovec_advance() may change i->iov in order to have i->iov_offset being only relative to the first element.
Which means kmsg->msg.msg_iter.iov is no longer the same as kmsg->fast_iov.
But this would rewind the copy to be the start ofasync_msg->fast_iov, which means the internal
state of sync_msg->msg.msg_iter is inconsitent.
I tested with 5 vectors with length like this 4, 0, 64, 20, 8388608 and got a short writes with:
- ret=2675244 min_ret=8388692 => remaining 5713448 sr->done_io=2675244
- ret=-EAGAIN => io_uring_poll_arm
- ret=4911225 min_ret=5713448 => remaining 802223 sr->done_io=7586469
- ret=-EAGAIN => io_uring_poll_arm
- ret=802223 min_ret=802223 => res=8388692
While this was easily triggered with SENDMSG_ZC (queued for 6.1),
it was a potential problem starting with 7ba89d2af17aa879dda30f5d5d3f152e587fc551 in 5.18 for IORING_OP_RECVMSG.
And also with 4c3c09439c08b03d9503df0ca4c7619c5842892e in 5.19
for IORING_OP_SENDMSG.
However 257e84a5377fbbc336ff563833a8712619acce56 introduced the critical code into io_setup_async_msg() in 5.11.
--- io_uring/io_uring.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
io_uring/io_uring.c +4 -2
@@ -5852,8 +5852,10 @@ static int io_setup_async_msg(struct io_memcpy (async_msg, kmsg,sizeof (*kmsg)); async_msg->msg.msg_name = &async_msg->addr;/* if were using fast_iov, set it to the new one */ -if (!async_msg->free_iov) - async_msg->msg.msg_iter.iov = async_msg->fast_iov; +if (!kmsg->free_iov) { +size_t fast_idx = kmsg->msg.msg_iter.iov - kmsg->fast_iov; + async_msg->msg.msg_iter.iov = &async_msg->fast_iov[fast_idx]; + }return -EAGAIN ; }
Greg Kroah-Hartman
maintainerPATCH 13/717 io_uring/net: dont update msg_name if not provided
In reply to Greg Kroah-HartmanFrom: Pavel Begunkov <[email protected]>
commit 6f10ae8a155446248055c7ddd480ef40139af788 upstream.
io_sendmsg_copy_hdr() may clear msg->msg_name if the userspace didn't provide it, we should retain NULL in this case.
--- io_uring/io_uring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
io_uring/io_uring.c +2 -1
@@ -5850,7 +5850,8 @@ static int io_setup_async_msg(struct io_ async_msg = req->async_data; req->flags |=REQ_F_NEED_CLEANUP ;memcpy (async_msg, kmsg,sizeof (*kmsg)); - async_msg->msg.msg_name = &async_msg->addr; +if (async_msg->msg.msg_name) + async_msg->msg.msg_name = &async_msg->addr;/* if were using fast_iov, set it to the new one */ if (!kmsg->free_iov) {size_t fast_idx = kmsg->msg.msg_iter.iov - kmsg->fast_iov;
Greg Kroah-Hartman
maintainerPATCH 14/717 io_uring/af_unix: defer registered files gc to io_uring release
In reply to Greg Kroah-HartmanFrom: Pavel Begunkov <[email protected]>
commit 0091bfc81741b8d3aeb3b7ab8636f911b2de6e80 upstream.
Instead of putting io_uring's registered files in unix_gc() we want it to be done by io_uring itself. The trick here is to consider io_uring registered files for cycle detection but not actually putting them down. Because io_uring can't register other ring instances, this will remove all refs to the ring file triggering the ->release path and clean up with io_ring_ctx_free().
--- include/linux/skbuff.h | 2 ++ io_uring/io_uring.c | 1 + net/unix/garbage.c | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+)
include/linux/skbuff.h +2 -0
@@ -965,6 +965,7 @@ typedef unsigned char *sk_buff_data_t;* @csum_level: indicates the number of consecutive checksums found in * the packet minus one that have been verified as * CHECKSUM_UNNECESSARY (max 3) +* @scm_io_uring: SKB holds io_uring registered files * @dst_pending_confirm: need to confirm neighbour * @decrypted: Decrypted SKB * @slow_gro: state present at GRO time, slower prepare step required
@@ -1144,6 +1145,7 @@ struct sk_buff {#endif __u8 slow_gro:1; __u8 csum_not_inet:1; + __u8 scm_io_uring:1;#ifdef CONFIG_NET_SCHED __u16 tc_index;/* traffic control index */
io_uring/io_uring.c +1 -0
@@ -9484,6 +9484,7 @@ static int io_scm_file_account(struct ioUNIXCB (skb).fp = fpl; skb->sk = sk; + skb->scm_io_uring =1 ; skb->destructor = unix_destruct_scm;refcount_add (skb->truesize, &sk->sk_wmem_alloc); }
net/unix/garbage.c +20 -0
@@ -204,6 +204,7 @@ void wait_for_unix_gc(void)/* The external entry point: unix_gc() */ void unix_gc (void ) { +struct sk_buff *next_skb, *skb;struct unix_sock *u;struct unix_sock *next;struct sk_buff_head hitlist;
@@ -297,11 +298,30 @@ void unix_gc(void)spin_unlock (&unix_gc_lock); +/* We need io_uring to clean its registered files, ignore all io_uring +* originated skbs. It's fine as io_uring doesn't keep references to +* other io_uring instances and so killing all other files in the cycle +* will put all io_uring references forcing it to go through normal +* release.path eventually putting registered files. +*/ + skb_queue_walk_safe(&hitlist, skb, next_skb) { +if (skb->scm_io_uring) { +__skb_unlink (skb, &hitlist); +skb_queue_tail (&skb->sk->sk_receive_queue, skb); + } + } +/* Here we are. Hitlist is filled. Die. */ __skb_queue_purge (&hitlist);spin_lock (&unix_gc_lock); +/* There could be io_uring registered files, just push them back to +* the inflight list +*/ +list_for_each_entry_safe (u, next, &gc_candidates, link) +list_move_tail (&u->link, &gc_inflight_list); +/* All candidates should have been detached by now. */ BUG_ON (!list_empty (&gc_candidates));
Greg Kroah-Hartman
maintainerPATCH 15/717 io_uring: correct pinned_vm accounting
In reply to Greg Kroah-HartmanFrom: Pavel Begunkov <[email protected]>
commit 42b6419d0aba47c5d8644cdc0b68502254671de5 upstream.
->mm_account should be released only after we free all registered buffers, otherwise __io_sqe_buffers_unregister() will see a NULL ->mm_account and skip locked_vm accounting.
--- io_uring/io_uring.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
io_uring/io_uring.c +4 -6
@@ -10711,12 +10711,6 @@ static void io_flush_apoll_cache(structstatic __cold void io_ring_ctx_free (struct io_ring_ctx *ctx) {io_sq_thread_finish (ctx); - -if (ctx->mm_account) { -mmdrop (ctx->mm_account); - ctx->mm_account =NULL ; - } -io_rsrc_refs_drop (ctx);/* __io_rsrc_put_work() may need uring_lock to progress, wait w/o it */ io_wait_rsrc_data (ctx->buf_data);
@@ -10755,6 +10749,10 @@ static __cold void io_ring_ctx_free(stru#endif WARN_ON_ONCE (!list_empty (&ctx->ltimeout_list)); +if (ctx->mm_account) { +mmdrop (ctx->mm_account); + ctx->mm_account =NULL ; + }io_mem_free (ctx->rings);io_mem_free (ctx->sq_sqes);
Greg Kroah-Hartman
maintainerPATCH 17/717 cifs: destage dirty pages before re-reading them for cache=none
In reply to Greg Kroah-HartmanFrom: Ronnie Sahlberg <[email protected]>
commit bb44c31cdcac107344dd2fcc3bd0504a53575c51 upstream.
This is the opposite case of kernel bugzilla 216301.
If we mmap a file using cache=none and then proceed to update the mmapped area these updates are not reflected in a later pread() of that part of the file.
To fix this we must first destage any dirty pages in the range before we allow the pread() to proceed.
--- fs/cifs/file.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/cifs/file.c +9 -0
@@ -4024,6 +4024,15 @@ static ssize_t __cifs_readv( len = ctx->len; } +if (direct) { + rc =filemap_write_and_wait_range (file->f_inode->i_mapping, + offset, offset + len -1 ); +if (rc) { +kref_put (&ctx->refcount, cifs_aio_ctx_release); +return -EAGAIN ; + } + } +/* grab a lock here due to read response handlers can access ctx */ mutex_lock (&ctx->aio_mutex);
Greg Kroah-Hartman
maintainerPATCH 16/717 hv_netvsc: Fix race between VF offering and VF association message from host
In reply to Greg Kroah-HartmanFrom: Gaurav Kohli <[email protected]>
commit 365e1ececb2905f94cc10a5817c5b644a32a3ae2 upstream.
During vm boot, there might be possibility that vf registration call comes before the vf association from host to vm.
And this might break netvsc vf path, To prevent the same block vf registration until vf bind message comes from host.
--- drivers/net/hyperv/hyperv_net.h | 3 ++- drivers/net/hyperv/netvsc.c | 4 ++++ drivers/net/hyperv/netvsc_drv.c | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-)
drivers/net/hyperv/hyperv_net.h +2 -1
@@ -1051,7 +1051,8 @@ struct net_device_context {u32 vf_alloc;/* Serial number of the VF to team with */ u32 vf_serial; - +/* completion variable to confirm vf association */ +struct completion vf_add;/* Is the current data path through the VF NIC? */ bool data_path_is_vf;
drivers/net/hyperv/netvsc.c +4 -0
@@ -1580,6 +1580,10 @@ static void netvsc_send_vf(struct net_de net_device_ctx->vf_alloc = nvmsg->msg.v4_msg.vf_assoc.allocated; net_device_ctx->vf_serial = nvmsg->msg.v4_msg.vf_assoc.serial; + +if (net_device_ctx->vf_alloc) +complete (&net_device_ctx->vf_add); +netdev_info (ndev,"VF slot %u %s\n" , net_device_ctx->vf_serial, net_device_ctx->vf_alloc ?"added" :"removed" );
drivers/net/hyperv/netvsc_drv.c +19 -0
@@ -2313,6 +2313,18 @@ static struct net_device *get_netvsc_bys } +/* Fallback path to check synthetic vf with +* help of mac addr +*/ +list_for_each_entry (ndev_ctx, &netvsc_dev_list, list) { + ndev =hv_get_drvdata (ndev_ctx->device_ctx); +if (ether_addr_equal (vf_netdev->perm_addr, ndev->perm_addr)) { +netdev_notice (vf_netdev, +"falling back to mac addr based matching\n" ); +return ndev; + } + } +netdev_notice (vf_netdev,"no netdev found for vf serial:%u\n" , serial);return NULL ;
@@ -2409,6 +2421,11 @@ static int netvsc_vf_changed(struct net_if (net_device_ctx->data_path_is_vf == vf_is_up)return NOTIFY_OK ; +if (vf_is_up && !net_device_ctx->vf_alloc) { +netdev_info (ndev,"Waiting for the VF association from host\n" ); +wait_for_completion (&net_device_ctx->vf_add); + } + ret =netvsc_switch_datapath (ndev, vf_is_up);if (ret) {
@@ -2440,6 +2457,7 @@ static int netvsc_unregister_vf(struct nnetvsc_vf_setxdp (vf_netdev,NULL ); +reinit_completion (&net_device_ctx->vf_add);netdev_rx_handler_unregister (vf_netdev);netdev_upper_dev_unlink (vf_netdev, ndev);RCU_INIT_POINTER (net_device_ctx->vf_netdev,NULL );
@@ -2479,6 +2497,7 @@ static int netvsc_probe(struct hv_deviceINIT_DELAYED_WORK (&net_device_ctx->dwork, netvsc_link_change); +init_completion (&net_device_ctx->vf_add);spin_lock_init (&net_device_ctx->lock);INIT_LIST_HEAD (&net_device_ctx->reconfig_events);INIT_DELAYED_WORK (&net_device_ctx->vf_takeover, netvsc_vf_setup);
Greg Kroah-Hartman
maintainerPATCH 18/717 cifs: Fix the error length of VALIDATE_NEGOTIATE_INFO message
In reply to Greg Kroah-HartmanFrom: Zhang Xiaoxu <[email protected]>
commit e98ecc6e94f4e6d21c06660b0f336df02836694f upstream.
Commit d5c7076b772a ("smb3: add smb3.1.1 to default dialect list") extend the dialects from 3 to 4, but forget to decrease the extended length when specific the dialect, then the message length is larger than expected.
This maybe leak some info through network because not initialize the message body.
After apply this patch, the VALIDATE_NEGOTIATE_INFO message length is reduced from 28 bytes to 26 bytes.
--- fs/cifs/smb2pdu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/smb2pdu.c +2 -2
@@ -1168,9 +1168,9 @@ int smb3_validate_negotiate(const unsign pneg_inbuf->Dialects[0 ] =cpu_to_le16 (server->vals->protocol_id); pneg_inbuf->DialectCount =cpu_to_le16 (1 ); -/* structure is big enough for 3 dialects, sending only 1 */ +/* structure is big enough for 4 dialects, sending only 1 */ inbuflen =sizeof (*pneg_inbuf) - -sizeof (pneg_inbuf->Dialects[0 ]) *2 ; +sizeof (pneg_inbuf->Dialects[0 ]) *3 ; } rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
Greg Kroah-Hartman
maintainerPATCH 19/717 iio: dac: ad5593r: Fix i2c read protocol requirements
In reply to Greg Kroah-HartmanFrom: Michael Hennerich <[email protected]>
commit 558a25f903b4af6361b7fbeea08a6446a0745653 upstream.
For reliable operation across the full range of supported interface rates, the AD5593R needs a STOP condition between address write, and data read (like show in the datasheet Figure 40) so in turn i2c_smbus_read_word_swapped cannot be used.
While at it, a simple helper was added to make the code simpler.
--- drivers/iio/dac/ad5593r.c | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-)
drivers/iio/dac/ad5593r.c +27 -19
@@ -13,6 +13,8 @@#include <linux/module.h> #include <linux/mod_devicetable.h> +#include <asm/unaligned.h> +#define AD5593R_MODE_CONF (0 << 4)#define AD5593R_MODE_DAC_WRITE (1 << 4)#define AD5593R_MODE_ADC_READBACK (4 << 4)
@@ -20,6 +22,24 @@#define AD5593R_MODE_GPIO_READBACK (6 << 4)#define AD5593R_MODE_REG_READBACK (7 << 4) +static int ad5593r_read_word (struct i2c_client *i2c,u8 reg,u16 *value) +{ +int ret; +u8 buf[2 ]; + + ret =i2c_smbus_write_byte (i2c, reg); +if (ret <0 ) +return ret; + + ret =i2c_master_recv (i2c, buf,sizeof (buf)); +if (ret <0 ) +return ret; + + *value =get_unaligned_be16 (buf); + +return 0 ; +} +static int ad5593r_write_dac (struct ad5592r_state *st,unsigned chan,u16 value) {struct i2c_client *i2c =to_i2c_client (st->dev);
@@ -38,13 +58,7 @@ static int ad5593r_read_adc(struct ad559if (val <0 )return (int ) val; - val =i2c_smbus_read_word_swapped (i2c,AD5593R_MODE_ADC_READBACK ); -if (val <0 ) -return (int ) val; - - *value = (u16 ) val; - -return 0 ; +return ad5593r_read_word (i2c,AD5593R_MODE_ADC_READBACK , value); }static int ad5593r_reg_write (struct ad5592r_state *st,u8 reg,u16 value)
@@ -58,25 +72,19 @@ static int ad5593r_reg_write(struct ad55static int ad5593r_reg_read (struct ad5592r_state *st,u8 reg,u16 *value) {struct i2c_client *i2c =to_i2c_client (st->dev); -s32 val; - - val =i2c_smbus_read_word_swapped (i2c,AD5593R_MODE_REG_READBACK | reg); -if (val <0 ) -return (int ) val; - *value = (u16 ) val; - -return 0 ; +return ad5593r_read_word (i2c,AD5593R_MODE_REG_READBACK | reg, value); }static int ad5593r_gpio_read (struct ad5592r_state *st,u8 *value) {struct i2c_client *i2c =to_i2c_client (st->dev); -s32 val; +u16 val; +int ret; - val =i2c_smbus_read_word_swapped (i2c,AD5593R_MODE_GPIO_READBACK ); -if (val <0 ) -return (int ) val; + ret =ad5593r_read_word (i2c,AD5593R_MODE_GPIO_READBACK , &val); +if (ret) +return ret; *value = (u8 ) val;
Greg Kroah-Hartman
maintainerPATCH 2/717 ALSA: oss: Fix potential deadlock at unregistration
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 97d917879d7f92df09c3f21fd54609a8bcd654b2 upstream.
We took sound_oss_mutex around the calls of unregister_sound_special() at unregistering OSS devices. This may, however, lead to a deadlock, because we manage the card release via the card's device object, and the release may happen at unregister_sound_special() call -- which will take sound_oss_mutex again in turn.
Although the deadlock might be fixed by relaxing the rawmidi mutex in the previous commit, it's safer to move unregister_sound_special() calls themselves out of the sound_oss_mutex, too. The call is race-safe as the function has a spinlock protection by itself.
--- sound/core/sound_oss.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
sound/core/sound_oss.c +9 -4
@@ -162,7 +162,6 @@ int snd_unregister_oss_device(int type,mutex_unlock (&sound_oss_mutex);return -ENOENT ; } -unregister_sound_special (minor);switch (SNDRV_MINOR_OSS_DEVICE (minor)) {case SNDRV_MINOR_OSS_PCM : track2 =SNDRV_MINOR_OSS (cidx,SNDRV_MINOR_OSS_AUDIO );
@@ -174,12 +173,18 @@ int snd_unregister_oss_device(int type, track2 =SNDRV_MINOR_OSS (cidx,SNDRV_MINOR_OSS_DMMIDI1 );break ; } -if (track2 >=0 ) { -unregister_sound_special (track2); +if (track2 >=0 ) snd_oss_minors[track2] =NULL ; - } snd_oss_minors[minor] =NULL ;mutex_unlock (&sound_oss_mutex); + +/* call unregister_sound_special() outside sound_oss_mutex; +* otherwise may deadlock, as it can trigger the release of a card +*/ +unregister_sound_special (minor); +if (track2 >=0 ) +unregister_sound_special (track2); +kfree (mptr);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 20/717 iio: ltc2497: Fix reading conversion results
In reply to Greg Kroah-HartmanFrom: Uwe Kleine-König <[email protected]>
commit 7f4f1096d5921f5d90547596f9ce80e0b924f887 upstream.
After the result of the previous conversion is read the chip automatically starts a new conversion and doesn't accept new i2c transfers until this conversion is completed which makes the function return failure.
So add an early return iff the programming of the new address isn't needed. Note this will not fix the problem in general, but all cases that are currently used. Once this changes we get the failure back, but this can be addressed when the need arises.
--- drivers/iio/adc/ltc2497.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/iio/adc/ltc2497.c +13 -0
@@ -41,6 +41,19 @@ static int ltc2497_result_and_measure(st } *val = (be32_to_cpu (st->buf) >>14 ) - (1 <<17 ); + +/* +* The part started a new conversion at the end of the above i2c +* transfer, so if the address didn't change since the last call +* everything is fine and we can return early. +* If not (which should only happen when some sort of bulk +* conversion is implemented) we have to program the new +* address. Note that this probably fails as the conversion that +* was triggered above is like not complete yet and the two +* operations have to be done in a single transfer. +*/ +if (ddata->addr_prev == address) +return 0 ; } ret = i2c_smbus_write_byte(st->client,
Greg Kroah-Hartman
maintainerPATCH 21/717 iio: adc: ad7923: fix channel readings for some variants
In reply to Greg Kroah-HartmanFrom: Nuno Sá <[email protected]>
commit f4f43f01cff2f29779343ade755191afd2581c77 upstream.
Some of the supported devices have 4 or 2 LSB trailing bits that should not be taken into account. Hence we need to shift these bits out which fits perfectly on the scan type shift property. This change fixes both raw and buffered reads.
--- drivers/iio/adc/ad7923.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/adc/ad7923.c +3 -1
@@ -93,6 +93,7 @@ enum ad7923_id { .sign = 'u', \ .realbits = (bits), \ .storagebits = 16, \ + .shift = 12 - (bits), \ .endianness = IIO_BE, \ }, \ }
@@ -268,7 +269,8 @@ static int ad7923_read_raw(struct iio_dereturn ret;if (chan->address ==EXTRACT (ret,12 ,4 )) - *val =EXTRACT (ret,0 ,12 ); + *val =EXTRACT (ret, chan->scan_type.shift, + chan->scan_type.realbits);else return -EIO ;
Greg Kroah-Hartman
maintainerPATCH 24/717 xhci: dbc: Fix memory leak in xhci_alloc_dbc()
In reply to Greg Kroah-HartmanFrom: Rafael Mendonca <[email protected]>
commit d591b32e519603524a35b172156db71df9116902 upstream.
If DbC is already in use, then the allocated memory for the xhci_dbc struct doesn't get freed before returning NULL, which leads to a memleak.
--- drivers/usb/host/xhci-dbgcap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-dbgcap.c +1 -1
@@ -988,7 +988,7 @@ xhci_alloc_dbc(struct device *dev, void dbc->driver = driver;if (readl (&dbc->regs->control) &DBC_CTRL_DBC_ENABLE ) -return NULL ; + goto err;INIT_DELAYED_WORK (&dbc->event_work, xhci_dbc_handle_events);spin_lock_init (&dbc->lock);
Greg Kroah-Hartman
maintainerPATCH 23/717 iio: pressure: dps310: Reset chip after timeout
In reply to Greg Kroah-HartmanFrom: Eddie James <[email protected]>
commit 7b4ab4abcea4c0c10b25187bf2569e5a07e9a20c upstream.
The DPS310 chip has been observed to get "stuck" such that pressure and temperature measurements are never indicated as "ready" in the MEAS_CFG register. The only solution is to reset the device and try again. In order to avoid continual failures, use a boolean flag to only try the reset after timeout once if errors persist.
--- drivers/iio/pressure/dps310.c | 74 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 64 insertions(+), 10 deletions(-)
drivers/iio/pressure/dps310.c +64 -10
@@ -89,6 +89,7 @@ struct dps310_data {s32 c00, c10, c20, c30, c01, c11, c21;s32 pressure_raw;s32 temp_raw; +bool timeout_recovery_failed; };static const struct iio_chan_spec dps310_channels[] = {
@@ -393,11 +394,69 @@ static int dps310_get_temp_k(struct dps3return scale_factors[ilog2 (rc)]; } +static int dps310_reset_wait (struct dps310_data *data) +{ +int rc; + + rc =regmap_write (data->regmap,DPS310_RESET ,DPS310_RESET_MAGIC ); +if (rc) +return rc; + +/* Wait for device chip access: 2.5ms in specification */ +usleep_range (2500 ,12000 ); +return 0 ; +} + +static int dps310_reset_reinit (struct dps310_data *data) +{ +int rc; + + rc =dps310_reset_wait (data); +if (rc) +return rc; + +return dps310_startup (data); +} + +static int dps310_ready_status (struct dps310_data *data,int ready_bit,int timeout) +{ +int sleep =DPS310_POLL_SLEEP_US (timeout); +int ready; + +return regmap_read_poll_timeout (data->regmap,DPS310_MEAS_CFG , ready, ready & ready_bit, + sleep, timeout); +} + +static int dps310_ready (struct dps310_data *data,int ready_bit,int timeout) +{ +int rc; + + rc =dps310_ready_status (data, ready_bit, timeout); +if (rc) { +if (rc == -ETIMEDOUT && !data->timeout_recovery_failed) { +/* Reset and reinitialize the chip. */ +if (dps310_reset_reinit (data)) { + data->timeout_recovery_failed = true; + }else { +/* Try again to get sensor ready status. */ +if (dps310_ready_status (data, ready_bit, timeout)) + data->timeout_recovery_failed = true; +else +return 0 ; + } + } + +return rc; + } + + data->timeout_recovery_failed = false; +return 0 ; +} +static int dps310_read_pres_raw (struct dps310_data *data) {int rc;int rate; -int ready;int timeout;s32 raw;u8 val[3 ];
@@ -409,9 +468,7 @@ static int dps310_read_pres_raw(struct d timeout =DPS310_POLL_TIMEOUT_US (rate);/* Poll for sensor readiness; base the timeout upon the sample rate. */ - rc =regmap_read_poll_timeout (data->regmap,DPS310_MEAS_CFG , ready, - ready &DPS310_PRS_RDY , -DPS310_POLL_SLEEP_US (timeout), timeout); + rc =dps310_ready (data,DPS310_PRS_RDY , timeout);if (rc) goto done;
@@ -448,7 +505,6 @@ static int dps310_read_temp_raw(struct d {int rc;int rate; -int ready;int timeout;if (mutex_lock_interruptible (&data->lock))
@@ -458,10 +514,8 @@ static int dps310_read_temp_raw(struct d timeout =DPS310_POLL_TIMEOUT_US (rate);/* Poll for sensor readiness; base the timeout upon the sample rate. */ - rc =regmap_read_poll_timeout (data->regmap,DPS310_MEAS_CFG , ready, - ready &DPS310_TMP_RDY , -DPS310_POLL_SLEEP_US (timeout), timeout); -if (rc <0 ) + rc =dps310_ready (data,DPS310_TMP_RDY , timeout); +if (rc) goto done; rc =dps310_read_temp_ready (data);
@@ -756,7 +810,7 @@ static void dps310_reset(void *action_da {struct dps310_data *data = action_data; -regmap_write (data->regmap,DPS310_RESET ,DPS310_RESET_MAGIC ); +dps310_reset_wait (data); }static const struct regmap_config dps310_regmap_config = {
Greg Kroah-Hartman
maintainerPATCH 22/717 iio: pressure: dps310: Refactor startup procedure
In reply to Greg Kroah-HartmanFrom: Eddie James <[email protected]>
commit c2329717bdd3fa62f8a2f3d8d85ad0bee4556bd7 upstream.
Move the startup procedure into a function, and correct a missing check on the return code for writing the PRS_CFG register.
--- drivers/iio/pressure/dps310.c | 188 ++++++++++++++++++++++-------------------- 1 file changed, 99 insertions(+), 89 deletions(-)
drivers/iio/pressure/dps310.c +99 -89
@@ -159,6 +159,102 @@ static int dps310_get_coefs(struct dps31return 0 ; } +/* +* Some versions of the chip will read temperatures in the ~60C range when +* it's actually ~20C. This is the manufacturer recommended workaround +* to correct the issue. The registers used below are undocumented. +*/ +static int dps310_temp_workaround (struct dps310_data *data) +{ +int rc; +int reg; + + rc =regmap_read (data->regmap,0x32 , ®); +if (rc) +return rc; + +/* +* If bit 1 is set then the device is okay, and the workaround does not +* need to be applied +*/ +if (reg &BIT (1 )) +return 0 ; + + rc =regmap_write (data->regmap,0x0e ,0xA5 ); +if (rc) +return rc; + + rc =regmap_write (data->regmap,0x0f ,0x96 ); +if (rc) +return rc; + + rc =regmap_write (data->regmap,0x62 ,0x02 ); +if (rc) +return rc; + + rc =regmap_write (data->regmap,0x0e ,0x00 ); +if (rc) +return rc; + +return regmap_write (data->regmap,0x0f ,0x00 ); +} + +static int dps310_startup (struct dps310_data *data) +{ +int rc; +int ready; + +/* +* Set up pressure sensor in single sample, one measurement per second +* mode +*/ + rc =regmap_write (data->regmap,DPS310_PRS_CFG ,0 ); +if (rc) +return rc; + +/* +* Set up external (MEMS) temperature sensor in single sample, one +* measurement per second mode +*/ + rc =regmap_write (data->regmap,DPS310_TMP_CFG ,DPS310_TMP_EXT ); +if (rc) +return rc; + +/* Temp and pressure shifts are disabled when PRC <= 8 */ + rc =regmap_write_bits (data->regmap,DPS310_CFG_REG , +DPS310_PRS_SHIFT_EN |DPS310_TMP_SHIFT_EN ,0 ); +if (rc) +return rc; + +/* MEAS_CFG doesn't update correctly unless first written with 0 */ + rc =regmap_write_bits (data->regmap,DPS310_MEAS_CFG , +DPS310_MEAS_CTRL_BITS ,0 ); +if (rc) +return rc; + +/* Turn on temperature and pressure measurement in the background */ + rc =regmap_write_bits (data->regmap,DPS310_MEAS_CFG , +DPS310_MEAS_CTRL_BITS ,DPS310_PRS_EN | +DPS310_TEMP_EN |DPS310_BACKGROUND ); +if (rc) +return rc; + +/* +* Calibration coefficients required for reporting temperature. +* They are available 40ms after the device has started +*/ + rc =regmap_read_poll_timeout (data->regmap,DPS310_MEAS_CFG , ready, + ready &DPS310_COEF_RDY ,10000 ,40000 ); +if (rc) +return rc; + + rc =dps310_get_coefs (data); +if (rc) +return rc; + +return dps310_temp_workaround (data); +} +static int dps310_get_pres_precision (struct dps310_data *data) {int rc;
@@ -677,52 +773,12 @@ static const struct iio_info dps310_info .write_raw = dps310_write_raw, }; -/* -* Some verions of chip will read temperatures in the ~60C range when -* its actually ~20C. This is the manufacturer recommended workaround -* to correct the issue. The registers used below are undocumented. -*/ -static int dps310_temp_workaround (struct dps310_data *data) -{ -int rc; -int reg; - - rc =regmap_read (data->regmap,0x32 , ®); -if (rc <0 ) -return rc; - -/* -* If bit 1 is set then the device is okay, and the workaround does not -* need to be applied -*/ -if (reg &BIT (1 )) -return 0 ; - - rc =regmap_write (data->regmap,0x0e ,0xA5 ); -if (rc <0 ) -return rc; - - rc =regmap_write (data->regmap,0x0f ,0x96 ); -if (rc <0 ) -return rc; - - rc =regmap_write (data->regmap,0x62 ,0x02 ); -if (rc <0 ) -return rc; - - rc =regmap_write (data->regmap,0x0e ,0x00 ); -if (rc <0 ) -return rc; - -return regmap_write (data->regmap,0x0f ,0x00 ); -} -static int dps310_probe (struct i2c_client *client,const struct i2c_device_id *id) {struct dps310_data *data;struct iio_dev *iio; -int rc, ready; +int rc; iio =devm_iio_device_alloc (&client->dev,sizeof (*data));if (!iio)
@@ -747,54 +803,8 @@ static int dps310_probe(struct i2c_clienif (rc)return rc; -/* -* Set up pressure sensor in single sample, one measurement per second -* mode -*/ - rc =regmap_write (data->regmap,DPS310_PRS_CFG ,0 ); - -/* -* Set up external (MEMS) temperature sensor in single sample, one -* measurement per second mode -*/ - rc =regmap_write (data->regmap,DPS310_TMP_CFG ,DPS310_TMP_EXT ); -if (rc <0 ) -return rc; - -/* Temp and pressure shifts are disabled when PRC <= 8 */ - rc =regmap_write_bits (data->regmap,DPS310_CFG_REG , -DPS310_PRS_SHIFT_EN |DPS310_TMP_SHIFT_EN ,0 ); -if (rc <0 ) -return rc; - -/* MEAS_CFG doesn't update correctly unless first written with 0 */ - rc =regmap_write_bits (data->regmap,DPS310_MEAS_CFG , -DPS310_MEAS_CTRL_BITS ,0 ); -if (rc <0 ) -return rc; - -/* Turn on temperature and pressure measurement in the background */ - rc =regmap_write_bits (data->regmap,DPS310_MEAS_CFG , -DPS310_MEAS_CTRL_BITS ,DPS310_PRS_EN | -DPS310_TEMP_EN |DPS310_BACKGROUND ); -if (rc <0 ) -return rc; - -/* -* Calibration coefficients required for reporting temperature. -* They are available 40ms after the device has started -*/ - rc =regmap_read_poll_timeout (data->regmap,DPS310_MEAS_CFG , ready, - ready &DPS310_COEF_RDY ,10000 ,40000 ); -if (rc <0 ) -return rc; - - rc =dps310_get_coefs (data); -if (rc <0 ) -return rc; - - rc =dps310_temp_workaround (data); -if (rc <0 ) + rc =dps310_startup (data); +if (rc)return rc; rc =devm_iio_device_register (&client->dev, iio);
Greg Kroah-Hartman
maintainerPATCH 25/717 usb: gadget: uvc: Fix argument to sizeof() in uvc_register_video()
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
commit a15e17acce5aaae54243f55a7349c2225450b9bc upstream.
When building s390 allmodconfig after commit 9b91a6523078 ("usb: gadget:
uvc: increase worker prio to WQ_HIGHPRI"), the following error occurs:
In file included from ../include/linux/string.h:253,
from ../include/linux/bitmap.h:11,
from ../include/linux/cpumask.h:12,
from ../include/linux/smp.h:13,
from ../include/linux/lockdep.h:14,
from ../include/linux/rcupdate.h:29,
from ../include/linux/rculist.h:11,
from ../include/linux/pid.h:5,
from ../include/linux/sched.h:14,
from ../include/linux/ratelimit.h:6,
from ../include/linux/dev_printk.h:16,
from ../include/linux/device.h:15,
from ../drivers/usb/gadget/function/f_uvc.c:9:
In function ‘fortify_memset_chk’,
inlined from ‘uvc_register_video’ at ../drivers/usb/gadget/function/f_uvc.c:424:2:
../include/linux/fortify-string.h:301:25: error: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
301 | __write_overflow_field(p_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~This points to the memset() in uvc_register_video(). It is clear that the argument to sizeof() is incorrect, as uvc->vdev (a 'struct video_device') is being zeroed out but the size of uvc->video (a 'struct uvc_video') is being used as the third arugment to memset().
pahole shows that prior to commit 9b91a6523078 ("usb: gadget: uvc:
increase worker prio to WQ_HIGHPRI"), 'struct video_device' and 'struct ucv_video' had the same size, meaning that the argument to sizeof() is incorrect semantically but there is no visible issue:
$ pahole -s build/drivers/usb/gadget/function/f_uvc.o | grep -E "(uvc_video|video_device)\s+" video_device 1400 4 uvc_video 1400 3
After that change, uvc_video becomes slightly larger, meaning that the memset() will overwrite by 8 bytes:
$ pahole -s build/drivers/usb/gadget/function/f_uvc.o | grep -E "(uvc_video|video_device)\s+" video_device 1400 4 uvc_video 1408 3
Fix the arugment to sizeof() so that there is no overwrite.
--- drivers/usb/gadget/function/f_uvc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/function/f_uvc.c +1 -1
@@ -421,7 +421,7 @@ uvc_register_video(struct uvc_device *uvint ret;/* TODO reference counting. */ -memset (&uvc->vdev,0 ,sizeof (uvc->video)); +memset (&uvc->vdev,0 ,sizeof (uvc->vdev)); uvc->vdev.v4l2_dev = &uvc->v4l2_dev; uvc->vdev.v4l2_dev->dev = &cdev->gadget->dev; uvc->vdev.fops = &uvc_v4l2_fops;
Greg Kroah-Hartman
maintainerPATCH 26/717 usb: add quirks for Lenovo OneLink+ Dock
In reply to Greg Kroah-HartmanFrom: Jean-Francois Le Fillatre <[email protected]>
commit 37d49519b41405b08748392c6a7f193d9f77ecd2 upstream.
The Lenovo OneLink+ Dock contains two VL812 USB3.0 controllers:
17ef:1018 upstream
17ef:1019 downstream
These hubs suffer from two separate problems:
1) After the host system was suspended and woken up, the hubs appear to be in a random state. Some downstream ports (both internal to the built-in audio and network controllers, and external to USB sockets) may no longer be functional. The exact list of disabled ports (if any) changes from wakeup to wakeup. Ports remain in that state until the dock is power-cycled, or until the laptop is rebooted.
Wakeup sources connected to the hubs (keyboard, WoL on the integrated gigabit controller) will wake the system up from suspend, but they may no longer work after wakeup (and in that case will no longer work as wakeup source in a subsequent suspend-wakeup cycle).
This issue appears in the logs with messages such as:
usb 1-6.1-port4: cannot disable (err = -71)
usb 1-6-port2: cannot disable (err = -71)
usb 1-6.1: clear tt 1 (80c0) error -71
usb 1-6-port4: cannot disable (err = -71)
usb 1-6.4: PM: dpm_run_callback(): usb_dev_resume+0x0/0x10 [usbcore] returns -71
usb 1-6.4: PM: failed to resume async: error -71
usb 1-7: reset full-speed USB device number 5 using xhci_hcd
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: Cannot enable. Maybe the USB cable is bad?
usb 1-6.1-port1: cannot disable (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: cannot reset (err = -71)
usb 1-6.1-port1: Cannot enable. Maybe the USB cable is bad?
usb 1-6.1-port1: cannot disable (err = -71)2) Some USB devices cannot be enumerated properly. So far I have only seen the issue with USB 3.0 devices. The same devices work without problem directly connected to the host system, to other systems or to other hubs (even when those hubs are connected to the OneLink+ dock).
One very reliable reproducer is this USB 3.0 HDD enclosure:
152d:9561 JMicron Technology Corp. / JMicron USA Technology Corp. Mobius
I have seen it happen sporadically with other USB 3.0 enclosures, with controllers from different manufacturers, all self-powered.
Typical messages in the logs:
xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command usb 2-1.4: device not accepting address 6, error -62 xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command usb 2-1.4: device not accepting address 7, error -62
usb 2-1-port4: attempt power cycle
xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command usb 2-1.4: device not accepting address 8, error -62 xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command usb 2-1.4: device not accepting address 9, error -62
usb 2-1-port4: unable to enumerate USB device
Through trial and error, I found that the USB_QUIRK_RESET_RESUME solved the second issue. Further testing then uncovered the first issue. Test results are summarized in this table:
=======================================================================================
Settings USB2 hotplug USB3 hotplug State after waking up
---------------------------------------------------------------------------------------
power/control=auto works fails broken
usbcore.autosuspend=-1 works works broken
OR power/control=on
power/control=auto works (1) works (1) works
and USB_QUIRK_RESET_RESUME
power/control=on works works works
and USB_QUIRK_RESET_RESUME
HUB_QUIRK_DISABLE_AUTOSUSPEND works works works
and USB_QUIRK_RESET_RESUME
=======================================================================================
In those results, the power/control settings are applied to both hubs, both on the USB2 and USB3 side, before each test.
Quoted 1 line
From those results,
USB_QUIRK_RESET_RESUMEis required to reset the hubs
properly after a suspend-wakeup cycle, and the hubs must not autosuspend to work around the USB3 issue.
A secondary effect of USB_QUIRK_RESET_RESUME is to prevent the hubs' upstream links from suspending (the downstream ports can still suspend). This secondary effect is used in results (1). It is enough to solve the USB3 problem.
Setting USB_QUIRK_RESET_RESUME on those hubs is the smallest patch that solves both issues.
Prior to creating this patch, I have used the USB_QUIRK_RESET_RESUME via the kernel command line for over a year without noticing any side effect.
Thanks to Oliver Neukum @Suse for explanations of the operations of USB_QUIRK_RESET_RESUME, and requesting more testing.
--- drivers/usb/core/quirks.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/core/quirks.c +4 -0
@@ -437,6 +437,10 @@ static const struct usb_device_id usb_qu { USB_DEVICE(0x1532, 0x0116), .driver_info = USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL }, + /* Lenovo ThinkPad OneLink+ Dock twin hub controllers (VIA Labs VL812) */ + { USB_DEVICE(0x17ef, 0x1018), .driver_info = USB_QUIRK_RESET_RESUME }, + { USB_DEVICE(0x17ef, 0x1019), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Lenovo USB-C to Ethernet Adapter RTL8153-04 */ { USB_DEVICE(0x17ef, 0x720c), .driver_info = USB_QUIRK_NO_LPM },
Greg Kroah-Hartman
maintainerPATCH 27/717 mmc: core: Add SD card quirk for broken discard
In reply to Greg Kroah-HartmanFrom: Avri Altman <[email protected]>
commit 07d2872bf4c864eb83d034263c155746a2fb7a3b upstream.
Some SD-cards from Sandisk that are SDA-6.0 compliant reports they supports discard, while they actually don't. This might cause mk2fs to fail while trying to format the card and revert it to a read-only mode.
To fix this problem, let's add a card quirk (MMC_QUIRK_BROKEN_SD_DISCARD) to indicate that we shall fall-back to use the legacy erase command instead.
--- drivers/mmc/core/block.c | 6 +++++- drivers/mmc/core/card.h | 6 ++++++ drivers/mmc/core/quirks.h | 6 ++++++ include/linux/mmc/card.h | 1 + 4 files changed, 18 insertions(+), 1 deletion(-)
drivers/mmc/core/block.c +5 -1
@@ -1140,8 +1140,12 @@ static void mmc_blk_issue_discard_rq(str {struct mmc_blk_data *md = mq->blkdata;struct mmc_card *card = md->queue.card; +unsigned int arg = card->erase_arg; -mmc_blk_issue_erase_rq (mq, req,MMC_BLK_DISCARD , card->erase_arg); +if (mmc_card_broken_sd_discard (card)) + arg =SD_ERASE_ARG ; + +mmc_blk_issue_erase_rq (mq, req,MMC_BLK_DISCARD , arg); } static void mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
drivers/mmc/core/card.h +6 -0
@@ -73,6 +73,7 @@ struct mmc_fixup {#define EXT_CSD_REV_ANY (-1u)#define CID_MANFID_SANDISK 0x2 +#define CID_MANFID_SANDISK_SD 0x3#define CID_MANFID_ATP 0x9#define CID_MANFID_TOSHIBA 0x11#define CID_MANFID_MICRON 0x13
@@ -258,4 +259,9 @@ static inline int mmc_card_broken_hpi(co return c->quirks & MMC_QUIRK_BROKEN_HPI; } +static inline int mmc_card_broken_sd_discard (const struct mmc_card *c) +{ +return c->quirks &MMC_QUIRK_BROKEN_SD_DISCARD ; +} +#endif
drivers/mmc/core/quirks.h +6 -0
@@ -100,6 +100,12 @@ static const struct mmc_fixup __maybe_unMMC_FIXUP ("V10016" ,CID_MANFID_KINGSTON ,CID_OEMID_ANY , add_quirk_mmc,MMC_QUIRK_TRIM_BROKEN ), +/* +* Some SD cards reports discard support while they don't +*/ +MMC_FIXUP (CID_NAME_ANY ,CID_MANFID_SANDISK_SD ,0x5344 , add_quirk_sd, +MMC_QUIRK_BROKEN_SD_DISCARD ), + END_FIXUP };
include/linux/mmc/card.h +1 -0
@@ -292,6 +292,7 @@ struct mmc_card {#define MMC_QUIRK_BROKEN_IRQ_POLLING (1<<11)/* Polling SDIO_CCCR_INTx could create a fake interrupt */ #define MMC_QUIRK_TRIM_BROKEN (1<<12)/* Skip trim */ #define MMC_QUIRK_BROKEN_HPI (1<<13)/* Disable broken HPI support */ +#define MMC_QUIRK_BROKEN_SD_DISCARD (1<<14)/* Disable broken SD discard support */ bool reenable_cmdq;/* Re-enable Command Queue */
Greg Kroah-Hartman
maintainerPATCH 28/717 can: kvaser_usb: Fix use of uninitialized completion
In reply to Greg Kroah-HartmanFrom: Anssi Hannula <[email protected]>
commit cd7f30e174d09a02ca2afa5ef093fb0f0352e0d8 upstream.
flush_comp is initialized when CMD_FLUSH_QUEUE is sent to the device and completed when the device sends CMD_FLUSH_QUEUE_RESP.
This causes completion of uninitialized completion if the device sends CMD_FLUSH_QUEUE_RESP before CMD_FLUSH_QUEUE is ever sent (e.g. as a response to a flush by a previously bound driver, or a misbehaving device).
Fix that by initializing flush_comp in kvaser_usb_init_one() like the other completions.
This issue is only triggerable after RX URBs have been set up, i.e. the interface has been opened at least once.
--- drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 1 + drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c +1 -0
@@ -712,6 +712,7 @@ static int kvaser_usb_init_one(struct kvinit_usb_anchor (&priv->tx_submitted);init_completion (&priv->start_comp);init_completion (&priv->stop_comp); +init_completion (&priv->flush_comp); priv->can.ctrlmode_supported =0 ; priv->dev = dev;
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +1 -1
@@ -1914,7 +1914,7 @@ static int kvaser_usb_hydra_flush_queue( {int err; -init_completion (&priv->flush_comp); +reinit_completion (&priv->flush_comp); err =kvaser_usb_hydra_send_simple_cmd (priv->dev,CMD_FLUSH_QUEUE , priv->channel);
Greg Kroah-Hartman
maintainerPATCH 3/717 ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free()
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit a70aef7982b012e86dfd39fbb235e76a21ae778a upstream.
The register_mutex taken around the dev_unregister callback call in snd_rawmidi_free() may potentially lead to a mutex deadlock, when OSS emulation and a hot unplug are involved.
Since the mutex doesn't protect the actual race (as the registration itself is already protected by another means), let's drop it.
--- sound/core/rawmidi.c | 2 -- 1 file changed, 2 deletions(-)
sound/core/rawmidi.c +0 -2
@@ -1835,10 +1835,8 @@ static int snd_rawmidi_free(struct snd_rsnd_info_free_entry (rmidi->proc_entry); rmidi->proc_entry =NULL ; -mutex_lock (®ister_mutex);if (rmidi->ops && rmidi->ops->dev_unregister) rmidi->ops->dev_unregister (rmidi); -mutex_unlock (®ister_mutex);snd_rawmidi_free_substreams (&rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT ]);snd_rawmidi_free_substreams (&rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT ]);
Greg Kroah-Hartman
maintainerPATCH 29/717 can: kvaser_usb_leaf: Fix overread with an invalid command
In reply to Greg Kroah-HartmanFrom: Anssi Hannula <[email protected]>
commit 1499ecaea9d2ba68d5e18d80573b4561a8dc4ee7 upstream.
For command events read from the device, kvaser_usb_leaf_read_bulk_callback() verifies that cmd->len does not exceed the size of the received data, but the actual kvaser_cmd handlers will happily read any kvaser_cmd fields without checking for cmd->len.
This can cause an overread if the last cmd in the buffer is shorter than expected for the command type (with cmd->len showing the actual short size).
Maximum overread seems to be 22 bytes (CMD_LEAF_LOG_MESSAGE), some of which are delivered to userspace as-is.
Fix that by verifying the length of command before handling it.
This issue can only occur after RX URBs have been set up, i.e. the interface has been opened at least once.
--- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 75 +++++++++++++++++++++++ 1 file changed, 75 insertions(+)
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +75 -0
@@ -310,6 +310,38 @@ struct kvaser_cmd { } u; } __packed; +#define CMD_SIZE_ANY 0xff +#define kvaser_fsize (field) sizeof_field(struct kvaser_cmd, field) + +static const u8 kvaser_usb_leaf_cmd_sizes_leaf[] = { + [CMD_START_CHIP_REPLY ] =kvaser_fsize (u.simple), + [CMD_STOP_CHIP_REPLY ] =kvaser_fsize (u.simple), + [CMD_GET_CARD_INFO_REPLY ] =kvaser_fsize (u.cardinfo), + [CMD_TX_ACKNOWLEDGE ] =kvaser_fsize (u.tx_acknowledge_header), + [CMD_GET_SOFTWARE_INFO_REPLY ] =kvaser_fsize (u.leaf.softinfo), + [CMD_RX_STD_MESSAGE ] =kvaser_fsize (u.leaf.rx_can), + [CMD_RX_EXT_MESSAGE ] =kvaser_fsize (u.leaf.rx_can), + [CMD_LEAF_LOG_MESSAGE ] =kvaser_fsize (u.leaf.log_message), + [CMD_CHIP_STATE_EVENT ] =kvaser_fsize (u.leaf.chip_state_event), + [CMD_CAN_ERROR_EVENT ] =kvaser_fsize (u.leaf.error_event), +/* ignored events: */ + [CMD_FLUSH_QUEUE_REPLY ] =CMD_SIZE_ANY , +}; + +static const u8 kvaser_usb_leaf_cmd_sizes_usbcan[] = { + [CMD_START_CHIP_REPLY ] =kvaser_fsize (u.simple), + [CMD_STOP_CHIP_REPLY ] =kvaser_fsize (u.simple), + [CMD_GET_CARD_INFO_REPLY ] =kvaser_fsize (u.cardinfo), + [CMD_TX_ACKNOWLEDGE ] =kvaser_fsize (u.tx_acknowledge_header), + [CMD_GET_SOFTWARE_INFO_REPLY ] =kvaser_fsize (u.usbcan.softinfo), + [CMD_RX_STD_MESSAGE ] =kvaser_fsize (u.usbcan.rx_can), + [CMD_RX_EXT_MESSAGE ] =kvaser_fsize (u.usbcan.rx_can), + [CMD_CHIP_STATE_EVENT ] =kvaser_fsize (u.usbcan.chip_state_event), + [CMD_CAN_ERROR_EVENT ] =kvaser_fsize (u.usbcan.error_event), +/* ignored events: */ + [CMD_USBCAN_CLOCK_OVERFLOW_EVENT ] =CMD_SIZE_ANY , +}; +/* Summary of a kvaser error event, for a unified Leaf/Usbcan error * handling. Some discrepancies between the two families exist: *
@@ -397,6 +429,43 @@ static const struct kvaser_usb_dev_cfg k .bittiming_const = &kvaser_usb_flexc_bittiming_const, }; +static int kvaser_usb_leaf_verify_size (const struct kvaser_usb *dev, +const struct kvaser_cmd *cmd) +{ +/* buffer size >= cmd->len ensured by caller */ +u8 min_size =0 ; + +switch (dev->driver_info->family) { +case KVASER_LEAF : +if (cmd->id <ARRAY_SIZE (kvaser_usb_leaf_cmd_sizes_leaf)) + min_size = kvaser_usb_leaf_cmd_sizes_leaf[cmd->id]; +break ; +case KVASER_USBCAN : +if (cmd->id <ARRAY_SIZE (kvaser_usb_leaf_cmd_sizes_usbcan)) + min_size = kvaser_usb_leaf_cmd_sizes_usbcan[cmd->id]; +break ; + } + +if (min_size ==CMD_SIZE_ANY ) +return 0 ; + +if (min_size) { + min_size +=CMD_HEADER_LEN ; +if (cmd->len >= min_size) +return 0 ; + +dev_err_ratelimited (&dev->intf->dev, +"Received command %u too short (size %u, needed %u)" , + cmd->id, cmd->len, min_size); +return -EIO ; + } + +dev_warn_ratelimited (&dev->intf->dev, +"Unhandled command (%d, size %d)\n" , + cmd->id, cmd->len); +return -EINVAL ; +} +static void * kvaser_usb_leaf_frame_to_cmd(const struct kvaser_usb_net_priv *priv, const struct sk_buff *skb, int *cmd_len,
@@ -502,6 +571,9 @@ static int kvaser_usb_leaf_wait_cmd(cons end:kfree (buf); +if (err ==0 ) + err =kvaser_usb_leaf_verify_size (dev, cmd); +return err; }
@@ -1132,6 +1204,9 @@ static void kvaser_usb_leaf_stop_chip_restatic void kvaser_usb_leaf_handle_command (const struct kvaser_usb *dev,const struct kvaser_cmd *cmd) { +if (kvaser_usb_leaf_verify_size (dev, cmd) <0 ) +return ; +switch (cmd->id) {case CMD_START_CHIP_REPLY :kvaser_usb_leaf_start_chip_reply (dev, cmd);
Greg Kroah-Hartman
maintainerPATCH 4/717 ALSA: usb-audio: Fix potential memory leaks
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 6382da0828995af87aa8b8bef28cc61aceb4aff3 upstream.
When the driver hits -ENOMEM at allocating a URB or a buffer, it aborts and goes to the error path that releases the all previously allocated resources. However, when -ENOMEM hits at the middle of the sync EP URB allocation loop, the partially allocated URBs might be left without released, because ep->nurbs is still zero at that point.
Fix it by setting ep->nurbs at first, so that the error handler loops over the full URB list.
--- sound/usb/endpoint.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/usb/endpoint.c +1 -2
@@ -1261,6 +1261,7 @@ static int sync_ep_set_params(struct sndif (!ep->syncbuf)return -ENOMEM ; + ep->nurbs =SYNC_URBS ;for (i =0 ; i <SYNC_URBS ; i++) {struct snd_urb_ctx *u = &ep->urb[i]; u->index = i;
@@ -1280,8 +1281,6 @@ static int sync_ep_set_params(struct snd u->urb->complete = snd_complete_urb; } - ep->nurbs =SYNC_URBS ; -return 0 ; out_of_memory:
Greg Kroah-Hartman
maintainerPATCH 5/717 ALSA: usb-audio: Fix NULL dererence at error path
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 568be8aaf8a535f79c4db76cabe17b035aa2584d upstream.
At an error path to release URB buffers and contexts, the driver might hit a NULL dererence for u->urb pointer, when u->buffer_size has been already set but the actual URB allocation failed.
Fix it by adding the NULL check of urb. Also, make sure that buffer_size is cleared after the error path or the close.
--- sound/usb/endpoint.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/usb/endpoint.c +2 -1
@@ -93,12 +93,13 @@ static inline unsigned get_usb_high_spee*/ static void release_urb_ctx (struct snd_urb_ctx *u) { -if (u->buffer_size) +if (u->urb && u->buffer_size)usb_free_coherent (u->ep->chip->dev, u->buffer_size, u->urb->transfer_buffer, u->urb->transfer_dma);usb_free_urb (u->urb); u->urb =NULL ; + u->buffer_size =0 ; }static const char *usb_error_string (int err)
Greg Kroah-Hartman
maintainerPATCH 6/717 ALSA: hda/realtek: remove ALC289_FIXUP_DUAL_SPK for Dell 5530
In reply to Greg Kroah-HartmanFrom: Callum Osmotherly <[email protected]>
commit 417b9c51f59734d852e47252476fadc293ad994a upstream.
After some feedback from users with Dell Precision 5530 machines, this patch reverts the previous change to add ALC289_FIXUP_DUAL_SPK. While it improved the speaker output quality, it caused the headphone jack to have an audible "pop" sound when power saving was toggled.
--- sound/pci/hda/patch_realtek.c | 1 - 1 file changed, 1 deletion(-)
sound/pci/hda/patch_realtek.c +0 -1
@@ -9151,7 +9151,6 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x1028 ,0x0871 ,"Dell Precision 3630" ,ALC255_FIXUP_DELL_HEADSET_MIC ),SND_PCI_QUIRK (0x1028 ,0x0872 ,"Dell Precision 3630" ,ALC255_FIXUP_DELL_HEADSET_MIC ),SND_PCI_QUIRK (0x1028 ,0x0873 ,"Dell Precision 3930" ,ALC255_FIXUP_DUMMY_LINEOUT_VERB ), -SND_PCI_QUIRK (0x1028 ,0x087d ,"Dell Precision 5530" ,ALC289_FIXUP_DUAL_SPK ),SND_PCI_QUIRK (0x1028 ,0x08ad ,"Dell WYSE AIO" ,ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1028 ,0x08ae ,"Dell WYSE NB" ,ALC225_FIXUP_DELL1_MIC_NO_PRESENCE ), SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
Greg Kroah-Hartman
maintainercover 5.19.17-rc1 review
This is the start of the stable review cycle for the 5.19.17 release. There are 717 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Note, this will be the LAST 5.19.y kernel to be released. Please move to the 6.0.y kernel branch at this point in time, as after this is released, this branch will be end-of-life.
Responses should be made by Mon, 24 Oct 2022 07:19:57 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.19.17-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.19.17-rc1
Ville Syrjälä <[email protected]>
drm/i915/bios: Use hardcoded fp_timing size for generating LFP data pointers
Ville Syrjälä <[email protected]>
drm/i915/bios: Validate fp_timing terminator presence
Ville Syrjälä <[email protected]>
drm/i915: Rename block_size()/block_offset()
Jerry Lee 李修賢 <[email protected]>
ext4: continue to expand file system when the target size doesn't reach
José Expósito <[email protected]>
HID: uclogic: Add missing suffix for digitalizers
Nathan Chancellor <[email protected]>
lib/Kconfig.debug: Add check for non-constant .{s,u}leb128 support to DWARF5
Masahiro Yamada <[email protected]>
Kconfig.debug: add toolchain checks for DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
Masahiro Yamada <[email protected]>
Kconfig.debug: simplify the dependency of DEBUG_INFO_DWARF4/5
Martin Rodriguez Reboredo <[email protected]>
kbuild: Add skip_encoding_btf_enum64 option to pahole
Nathan Chancellor <[email protected]>
drm/amd/display: Fix build breakage with CONFIG_DEBUG_FS=n
Nicholas Piggin <[email protected]>
powerpc/64s/interrupt: Fix lost interrupts when returning to soft-masked context
Tetsuo Handa <[email protected]>
net/ieee802154: don't warn zero-sized raw_sendmsg()
Alexander Aring <[email protected]>
Revert "net/ieee802154: reject zero-sized raw_sendmsg()"
Aric Cyr <[email protected]>
Revert "drm/amd/display: correct hostvm flag"
Randy Dunlap <[email protected]>
net: ethernet: ti: davinci_mdio: fix build for mdio bitbang uses
Yu Kuai <[email protected]>
blk-wbt: fix that 'rwb->wc' is always set to 1 in wbt_init()
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix last interface check for registration
Alexander Aring <[email protected]>
net: ieee802154: return -EINVAL for unknown addr type
Liu Shixin <[email protected]>
mm: hugetlb: fix UAF in hugetlb_handle_userfault
Adrian Hunter <[email protected]>
perf intel-pt: Fix system_wide dummy event for hybrid
Adrian Hunter <[email protected]>
perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc
Rob Herring <[email protected]>
perf: Skip and warn on unknown format 'configN' attrs
Ivan T. Ivanov <[email protected]>
clk: bcm2835: Round UART input clock up
Maxime Ripard <[email protected]>
clk: bcm2835: Make peripheral PLLC critical
Wayne Chang <[email protected]>
usb: typec: ucsi: Don't warn on probe deferral
Lv Ruyi <[email protected]>
fsi: master-ast-cf: Fix missing of_node_put in fsi_master_acf_probe
Eddie James <[email protected]>
fsi: occ: Prevent use after free
Eddie James <[email protected]>
hwmon (occ): Retry for checksum failure
Keith Busch <[email protected]>
blk-mq: use quiesced elevator switch when reinitializing queues
Dongliang Mu <[email protected]>
usb: idmouse: fix an uninit-value in idmouse_open
Varun Prakash <[email protected]>
nvmet-tcp: add bounds check on Transfer Tag
Keith Busch <[email protected]>
nvme: copy firmware_rev on each init
Keith Busch <[email protected]>
nvme: handle effects after freeing the request
Jan Kara <[email protected]>
ext2: Use kvmalloc() for group descriptor array
Arun Easi <[email protected]>
scsi: tracing: Fix compile error in trace_array calls when TRACING is disabled
Xiaoke Wang <[email protected]>
staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv()
Xiaoke Wang <[email protected]>
staging: rtl8723bs: fix potential memory leak in rtw_init_drv_sw()
sunghwan jung <[email protected]>
Revert "usb: storage: Add quirk for Samsung Fit flash"
Piyush Mehta <[email protected]>
usb: dwc3: core: Enable GUCTL1 bit 10 for fixing termination error after resume bug
Alexander Stein <[email protected]>
arm64: dts: imx8mp: Add snps,gfladj-refclk-lpm-sel quirk to USB nodes
Alexander Stein <[email protected]>
usb: dwc3: core: add gfladj_refclk_lpm_sel quirk
Robin Guo <[email protected]>
usb: musb: Fix musb_gadget.c rxstate overflow bug
Jianglei Nie <[email protected]>
usb: host: xhci: Fix potential memory leak in xhci_alloc_stream_info()
Logan Gunthorpe <[email protected]>
md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d
Dylan Yudaken <[email protected]>
eventfd: guard wake_up in eventfd fs calls as well
Johnothan King <[email protected]>
HID: nintendo: check analog user calibration for plausibility
Jianglei Nie <[email protected]>
HSI: ssi_protocol: fix potential resource leak in ssip_pn_open()
Hyunwoo Kim <[email protected]>
HID: roccat: Fix use-after-free in roccat_read()
Pierre-Louis Bossart <[email protected]>
soundwire: intel: fix error handling on dai registration issues
Richard Fitzgerald <[email protected]>
soundwire: cadence: Don't overwrite msg->buf during write commands
Coly Li <[email protected]>
bcache: fix set_at_max_writeback_rate() for multiple attached devices
Serge Semin <[email protected]>
ata: libahci_platform: Sanity check the DT child nodes number
Yu Kuai <[email protected]>
blk-throttle: prevent overflow while calculating wait time
Nam Cao <[email protected]>
staging: vt6655: fix potential memory leak
Wei Yongjun <[email protected]>
power: supply: adp5061: fix out-of-bounds read in adp5061_get_chg_type()
Michael Grzeschik <[email protected]>
usb: gadget: uvc: increase worker prio to WQ_HIGHPRI
Yicong Yang <[email protected]>
iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity
Shigeru Yoshida <[email protected]>
nbd: Fix hung when signal interrupts nbd_start_device_ioctl()
Letu Ren <[email protected]>
scsi: 3w-9xxx: Avoid disabling device if failing to enable it
Vaishnav Achath <[email protected]>
dmaengine: ti: k3-udma: Reset UDMA_CHAN_RT byte counters to prevent overflow
James Smart <[email protected]>
scsi: lpfc: Fix null ndlp ptr dereference in abnormal exit path for GFT_ID
Justin Chen <[email protected]>
usb: host: xhci-plat: suspend/resume clks for brcm
Justin Chen <[email protected]>
usb: host: xhci-plat: suspend and resume clocks
Daisuke Matsuda <[email protected]>
RDMA/rxe: Delete error messages triggered by incoming Read requests
Quanyang Wang <[email protected]>
clk: zynqmp: pll: rectify rate rounding in zynqmp_pll_round_rate
Hangyu Hua <[email protected]>
media: platform: fix some double free in meson-ge2d and mtk-jpeg and s5p-mfc
Zheyu Ma <[email protected]>
media: cx88: Fix a null-ptr-deref bug in buffer_prepare()
Ian Nam <[email protected]>
clk: zynqmp: Fix stack-out-of-bounds in strncpy`
Alex Sverdlin <[email protected]>
ARM: 9242/1: kasan: Only map modules if CONFIG_KASAN_VMALLOC=n
Li Huafei <[email protected]>
ARM: 9234/1: stacktrace: Avoid duplicate saving of exception PC value
Li Huafei <[email protected]>
ARM: 9233/1: stacktrace: Skip frame pointer boundary check for call_with_stack()
Josef Bacik <[email protected]>
btrfs: call __btrfs_remove_free_space_cache_locked on cache load failure
Maciej S. Szmigiero <[email protected]>
btrfs: don't print information about space cache or tree every remount
Qu Wenruo <[email protected]>
btrfs: scrub: try to fix super block errors
Qu Wenruo <[email protected]>
btrfs: scrub: properly report super block errors in system log
Qu Wenruo <[email protected]>
btrfs: dump extra info if one free space cache has more bitmaps than it should
Sebastian Krzyszkowiak <[email protected]>
arm64: dts: imx8mq-librem5: Add bq25895 as max17055's power supply
Frieder Schrempf <[email protected]>
arm64: dts: imx8mm-kontron: Use the VSELECT signal to switch SD card IO voltage
Mark Brown <[email protected]>
kselftest/arm64: Fix validatation termination record after EXTRA_CONTEXT
Marcel Ziswiler <[email protected]>
ARM: dts: imx6sx-udoo-neo: don't use multiple blank lines
Marcel Ziswiler <[email protected]>
ARM: dts: imx6sl: use tabs for code indent
Alexander Stein <[email protected]>
ARM: dts: imx6sx: add missing properties for sram
Alexander Stein <[email protected]>
ARM: dts: imx6sll: add missing properties for sram
Alexander Stein <[email protected]>
ARM: dts: imx6sl: add missing properties for sram
Alexander Stein <[email protected]>
ARM: dts: imx6qp: add missing properties for sram
Alexander Stein <[email protected]>
ARM: dts: imx6dl: add missing properties for sram
Alexander Stein <[email protected]>
ARM: dts: imx6q: add missing properties for sram
Haibo Chen <[email protected]>
ARM: dts: imx7d-sdb: config the max pressure for tsc2046
Alexander Stein <[email protected]>
ARM: dts: imx6: delete interrupts property if interrupts-extended is set
Felix Kuehling <[email protected]>
drm/amdkfd: Fix UBSAN shift-out-of-bounds warning
Wenjing Liu <[email protected]>
drm/amd/display: polling vid stream status in hpo dp blank
Aric Cyr <[email protected]>
drm/amd/display: Remove interface for periodic interrupt 1
Khaled Almahallawy <[email protected]>
drm/dp: Don't rewrite link config when setting phy test pattern
Adrián Larumbe <[email protected]>
drm/meson: remove drm bridges at aggregate driver unbind time
Adrián Larumbe <[email protected]>
drm/meson: explicitly remove aggregate driver at module unload time
Adrián Larumbe <[email protected]>
drm/meson: reorder driver deinit sequence to fix use-after-free bug
hongao <[email protected]>
drm/amdgpu: fix initial connector audio value
Sherry Wang <[email protected]>
drm/amd/display: correct hostvm flag
Philip Yang <[email protected]>
drm/amdgpu: SDMA update use unlocked iterator
Pierre-Louis Bossart <[email protected]>
ASoC: SOF: add quirk to override topology mclk_id
Jairaj Arava <[email protected]>
ASoC: SOF: pci: Change DMI match info to support all Chrome platforms
Muralidhar Reddy <[email protected]>
ALSA: intel-dspconfig: add ES8336 support for AlderLake-PS
Hans de Goede <[email protected]>
platform/x86: msi-laptop: Change DMI match / alias strings to fix module autoloading
Jorge Lopez <[email protected]>
platform/x86: hp-wmi: Setting thermal profile fails with 0x06
Jameson Thies <[email protected]>
platform/chrome: cros_ec: Notify the PM of wake events during resume
Maya Matuszczyk <[email protected]>
drm: panel-orientation-quirks: Add quirk for Aya Neo Air
Maya Matuszczyk <[email protected]>
drm: panel-orientation-quirks: Add quirk for Anbernic Win600
Mateusz Kwiatkowski <[email protected]>
drm/vc4: vec: Fix timings for VEC modes
Takashi Iwai <[email protected]>
ALSA: usb-audio: Register card at the last interface
Yifan Zha <[email protected]>
drm/admgpu: Skip CG/PG on SOC21 under SRIOV VF
Yifan Zha <[email protected]>
drm/amdgpu: Skip the program of MMMC_VM_AGP_* in SRIOV on MMHUB v3_0_0
Lucas Stach <[email protected]>
drm: bridge: dw_hdmi: only trigger hotplug event on link change
Andy Shevchenko <[email protected]>
platform/x86: pmc_atom: Improve quirk message to be less cryptic
Vivek Kasireddy <[email protected]>
udmabuf: Set ubuf->sg = NULL if the creation of sg table fails
David Gow <[email protected]>
drm/amd/display: fix overflow on MIN_I64 definition
Zeng Jingxiang <[email protected]>
gpu: lontium-lt9611: Fix NULL pointer dereference in lt9611_connector_init()
Liviu Dudau <[email protected]>
drm/komeda: Fix handling of atomic commits in the atomic_commit_tail hook
Javier Martinez Canillas <[email protected]>
drm: Prevent drm_copy_field() to attempt copying a NULL pointer
Javier Martinez Canillas <[email protected]>
drm: Use size_t type for len variable in drm_copy_field()
Jianglei Nie <[email protected]>
drm/nouveau/nouveau_bo: fix potential memory leak in nouveau_bo_alloc()
Andrew Gaul <[email protected]>
r8152: Rate limit overflow messages
Andy Shevchenko <[email protected]>
i2c: designware-pci: Group AMD NAVI quirk parts together
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix user-after-free
Song Liu <[email protected]>
bpf: use bpf_prog_pack for bpf_dispatcher
Jiri Olsa <[email protected]>
bpf: Adjust kprobe_multi entry_ip for CONFIG_X86_KERNEL_IBT
Liu Jian <[email protected]>
net: If sock is dead don't access sock's sk_wq in sk_stream_wait_memory
Jason A. Donenfeld <[email protected]>
hwmon: (sht4x) do not overflow clamping operation on 32-bit platforms
Daniel Golle <[email protected]>
wifi: rt2x00: correctly set BBP register 86 for MT7620
Daniel Golle <[email protected]>
wifi: rt2x00: set SoC wmac clock register
Daniel Golle <[email protected]>
wifi: rt2x00: set VGC gain for both chains of MT7620
Daniel Golle <[email protected]>
wifi: rt2x00: set correct TX_SW_CFG1 MAC register for MT7620
Daniel Golle <[email protected]>
wifi: rt2x00: don't run Rt5592 IQ calibration on MT7620
Ziyang Xuan <[email protected]>
can: bcm: check the result of can_send() in bcm_can_tx()
Hou Tao <[email protected]>
selftests/bpf: Free the allocated resources after test case succeeds
Vadim Fedorenko <[email protected]>
bnxt_en: replace reset with config timestamps
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_sysfs: Fix attempting to call device_add multiple times
Tetsuo Handa <[email protected]>
Bluetooth: L2CAP: initialize delayed works at l2cap_chan_create()
Po-Hao Huang <[email protected]>
wifi: rtw89: fix rx filter after scan
Po-Hao Huang <[email protected]>
wifi: rtw89: free unused skb to prevent memory leak
Sean Wang <[email protected]>
wifi: mt76: mt7921: reset msta->airtime_ac while clearing up hw value
Jianglei Nie <[email protected]>
wifi: ath11k: mhi: fix potential memory leak in ath11k_mhi_register()
Patrick Rudolph <[email protected]>
regulator: core: Prevent integer underflow
Kiran K <[email protected]>
Bluetooth: btintel: Mark Intel controller to support LE_STATES quirk
Alexander Coffin <[email protected]>
wifi: brcmfmac: fix use-after-free bug in brcmf_netdev_start_xmit()
Michal Jaron <[email protected]>
iavf: Fix race between iavf_close and iavf_reset_task
Zong-Zhe Yang <[email protected]>
rtw89: ser: leave lps with mutex
Manikanta Pubbisetty <[email protected]>
wifi: ath11k: Register shutdown handler for WCN6750
Khalid Masum <[email protected]>
xfrm: Update ipcomp_scratches with NULL when freed
Richard Gobert <[email protected]>
net-next: Fix IP_UNICAST_IF option behavior for connected sockets
Robert Hancock <[email protected]>
net: axienet: Switch to 64-bit RX/TX statistics
Daniel Sneddon <[email protected]>
x86/apic: Don't disable x2APIC if locked
Mika Westerberg <[email protected]>
thunderbolt: Add back Intel Falcon Ridge end-to-end flow control workaround
Tetsuo Handa <[email protected]>
wifi: ath9k: avoid uninit memory read in ath9k_htc_rx_msg()
Jane Chu <[email protected]>
x86/mce: Retrieve poison range from hardware
Eric Dumazet <[email protected]>
tcp: annotate data-race around tcp_md5sig_pool_populated
Mike Pattrick <[email protected]>
openvswitch: Fix overreporting of drops in dropwatch
Mike Pattrick <[email protected]>
openvswitch: Fix double reporting of drops in dropwatch
Ravi Gunasekaran <[email protected]>
net: ethernet: ti: davinci_mdio: Add workaround for errata i2329
Jacob Keller <[email protected]>
ice: set tx_tstamps when creating new Tx rings via ethtool
Quentin Monnet <[email protected]>
bpftool: Clear errno after libcap's checks
Wright Feng <[email protected]>
wifi: brcmfmac: fix invalid address access when enabling SCAN log level
Youghandhar Chintala <[email protected]>
wifi: ath10k: Set tx credit to one for WCN3990 snoc based devices
Dai Ngo <[email protected]>
NFSD: fix use-after-free on source server when doing inter-server copy
Anna Schumaker <[email protected]>
NFSD: Return nfserr_serverfault if splice_ok but buf->pages have data
Kees Cook <[email protected]>
x86/entry: Work around Clang __bdos() bug
Mario Limonciello <[email protected]>
ACPI: x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable
Kees Cook <[email protected]>
ARM: decompressor: Include .data.rel.ro.local
Srinivas Pandruvada <[email protected]>
thermal: intel_powerclamp: Use get_cpu() instead of smp_processor_id() to avoid crash
Chao Qin <[email protected]>
powercap: intel_rapl: fix UBSAN shift-out-of-bounds issue
Kees Cook <[email protected]>
MIPS: BCM47XX: Cast memcmp() of function to (void *)
Doug Smythies <[email protected]>
cpufreq: intel_pstate: Add Tigerlake support in no-HWP mode
Hans de Goede <[email protected]>
ACPI: tables: FPDT: Don't call acpi_os_map_memory() on invalid phys address
Kees Cook <[email protected]>
fortify: Fix __compiletime_strlen() under UBSAN_BOUNDS_LOCAL
Arvid Norlander <[email protected]>
ACPI: video: Add Toshiba Satellite/Portege Z830 quirk
Perry Yuan <[email protected]>
cpufreq: amd_pstate: fix wrong lowest perf fetch
Michal Hocko <[email protected]>
rcu: Back off upon fill_page_cache_func() allocation failure
Zqiang <[email protected]>
rcu: Avoid triggering strict-GP irq-work when RCU is idle
Alexander Aring <[email protected]>
fs: dlm: fix race in lowcomms
Aaron Tomlin <[email protected]>
module: tracking: Keep a record of tainted unloaded modules only
Stefan Berger <[email protected]>
selftest: tpm2: Add Client.__del__() to close /dev/tpm* handle
Chao Yu <[email protected]>
f2fs: fix to account FS_CP_DATA_IO correctly
Zhang Qilong <[email protected]>
f2fs: fix race condition on setting FI_NO_EXTENT flag
Shuai Xue <[email protected]>
ACPI: APEI: do not add task_work to kernel thread to avoid memory leak
Vincent Knecht <[email protected]>
thermal/drivers/qcom/tsens-v0_1: Fix MSM8939 fourth sensor hw_id
Jason A. Donenfeld <[email protected]>
random: schedule jitter credit for next jiffy, not in two jiffies
Dan Carpenter <[email protected]>
crypto: cavium - prevent integer overflow loading firmware
Dan Carpenter <[email protected]>
crypto: marvell/octeontx - prevent integer overflows
Janis Schoetterl-Glausch <[email protected]>
kbuild: rpm-pkg: fix breakage when V=1 is used
Masahiro Yamada <[email protected]>
linux/export: use inline assembler to populate symbol CRCs
Masahiro Yamada <[email protected]>
kbuild: remove the target in signal traps when interrupted
Nico Pache <[email protected]>
tracing/osnoise: Fix possible recursive locking in stop_per_cpu_kthreads
Yipeng Zou <[email protected]>
tracing: kprobe: Make gen test module work in arm and riscv
Yipeng Zou <[email protected]>
tracing: kprobe: Fix kprobe event gen test module on exit
Robin Murphy <[email protected]>
iommu/iova: Fix module config properly
Enzo Matsumiya <[email protected]>
cifs: return correct error in ->calc_signature()
Lin Yujun <[email protected]>
clocksource/drivers/timer-gxp: Add missing error handling in gxp_timer_probe
Kunkun Jiang <[email protected]>
clocksource/drivers/arm_arch_timer: Fix handling of ARM erratum 858921
Damian Muszynski <[email protected]>
crypto: qat - fix DMA transfer direction
Peter Harliman Liem <[email protected]>
crypto: inside-secure - Change swab to swab32
Koba Ko <[email protected]>
crypto: ccp - Release dma channels before dmaengine unrgister
Ignat Korchagin <[email protected]>
crypto: akcipher - default implementation for setting a private key
Dan Carpenter <[email protected]>
iommu/omap: Fix buffer overflow in debugfs
Waiman Long <[email protected]>
cgroup/cpuset: Enable update_tasks_cpumask() on top_cpuset
Weili Qian <[email protected]>
crypto: hisilicon/qm - fix missing put dfx access
Lucas Segarra Fernandez <[email protected]>
crypto: qat - fix default value of WDT timer
Kshitiz Varshney <[email protected]>
hwrng: imx-rngc - Moving IRQ handler registering after imx_rngc_irq_mask_clear()
Michal Koutný <[email protected]>
cgroup: Honor caller's cgroup NS when resolving path
Jacky Li <[email protected]>
crypto: ccp - Fail the PSP initialization when writing psp data file failed
James Cowgill <[email protected]>
hwrng: arm-smccc-trng - fix NO_ENTROPY handling
Ye Weihua <[email protected]>
crypto: hisilicon/zip - fix mismatch in get/set sgl_sge_nr
Zhengchao Shao <[email protected]>
crypto: sahara - don't sleep when in softirq
Haren Myneni <[email protected]>
powerpc/pseries/vas: Pass hw_cpu_id to node associativity HCALL
Li Huafei <[email protected]>
powerpc/kprobes: Fix null pointer reference in arch_prepare_kprobe()
Pali Rohár <[email protected]>
powerpc: Fix SPE Power ISA properties for e500v1 platforms
Nicholas Piggin <[email protected]>
powerpc/64/interrupt: Fix return to masked context after hard-mask irq becomes pending
Nicholas Piggin <[email protected]>
powerpc/64: mark irqs hard disabled in boot paca
Nicholas Piggin <[email protected]>
powerpc/64s: Fix GENERIC_CPU build flags for PPC970 / G5
Vitaly Kuznetsov <[email protected]>
x86/hyperv: Fix 'struct hv_enlightened_vmcs' definition
Rohan McLure <[email protected]>
powerpc: Fix fallocate and fadvise64_64 compat parameter combination
Anup Patel <[email protected]>
cpuidle: riscv-sbi: Fix CPU_PM_CPU_IDLE_ENTER_xyz() macro usage
Zheng Yongjun <[email protected]>
powerpc/powernv: add missing of_node_put() in opal_export_attrs()
Liang He <[email protected]>
powerpc/pci_dn: Add missing of_node_put()
Liang He <[email protected]>
powerpc/sysdev/fsl_msi: Add missing of_node_put()
Nathan Chancellor <[email protected]>
powerpc/math_emu/efp: Include module.h
Michael Ellerman <[email protected]>
powerpc/configs: Properly enable PAPR_SCM in pseries_defconfig
Hangyu Hua <[email protected]>
ipc: mqueue: fix possible memory leak in init_mqueue_fs()
Jack Wang <[email protected]>
mailbox: bcm-ferxrm-mailbox: Fix error check for dma_map_sg
Conor Dooley <[email protected]>
mailbox: mpfs: account for mbox offsets while sending
Conor Dooley <[email protected]>
mailbox: mpfs: fix handling of the reg property
Joel Stanley <[email protected]>
clk: ast2600: BCLK comes from EPLL
Miaoqian Lin <[email protected]>
clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe
Liang He <[email protected]>
clk: ti: Balance of_node_get() calls for of_find_node_by_name()
Lin Yujun <[email protected]>
clk: imx: scu: fix memleak on platform_device_add() fails
Stefan Wahren <[email protected]>
clk: bcm2835: fix bcm2835_clock_rate_from_divisor declaration
Serge Semin <[email protected]>
clk: baikal-t1: Add SATA internal ref clock buffer
Serge Semin <[email protected]>
clk: baikal-t1: Add shared xGMAC ref/ptp clocks internal parent
Serge Semin <[email protected]>
clk: baikal-t1: Fix invalid xGMAC PTP clock divider
Serge Semin <[email protected]>
clk: vc5: Fix 5P49V6901 outputs disabling when enabling FOD
David Collins <[email protected]>
spmi: pmic-arb: correct duplicate APID to PPID mapping logic
Chunfeng Yun <[email protected]>
usb: mtu3: fix failed runtime suspend in host only mode
Dave Jiang <[email protected]>
dmaengine: ioat: stop mod_timer from resurrecting deleted timer in __cleanup()
Chen-Yu Tsai <[email protected]>
clk: mediatek: Migrate remaining clk_unregister_*() to clk_hw_unregister_*()
Chen-Yu Tsai <[email protected]>
clk: mediatek: fix unregister function in mtk_clk_register_dividers cleanup
AngeloGioacchino Del Regno <[email protected]>
clk: mediatek: clk-mt8195-mfg: Reparent mfg_bg3d and propagate rate changes
Chen-Yu Tsai <[email protected]>
clk: mediatek: mt8183: mfgcfg: Propagate rate changes to parent
Jens Hillenstedt <[email protected]>
mfd: da9061: Fix Failed to set Two-Wire Bus Mode.
Jiasheng Jiang <[email protected]>
mfd: sm501: Add check for platform_driver_register()
Dan Carpenter <[email protected]>
mfd: fsl-imx25: Fix check for platform_get_irq() errors
Christophe JAILLET <[email protected]>
mfd: lp8788: Fix an error handling path in lp8788_irq_init() and lp8788_irq_init()
Christophe JAILLET <[email protected]>
mfd: lp8788: Fix an error handling path in lp8788_probe()
Christophe JAILLET <[email protected]>
mfd: fsl-imx25: Fix an error handling path in mx25_tsadc_setup_irq()
Christophe JAILLET <[email protected]>
mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe()
Jiasheng Jiang <[email protected]>
fsi: core: Check error number after calling ida_simple_get
Bob Pearson <[email protected]>
RDMA/rxe: Fix resize_finish() in rxe_queue.c
Adam Skladowski <[email protected]>
clk: qcom: gcc-sm6115: Override default Alpha PLL regs
Robert Marko <[email protected]>
clk: qcom: apss-ipq6018: mark apcs_alias0_core_clk as critical
Mike Christie <[email protected]>
scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()
Mike Christie <[email protected]>
scsi: iscsi: Run recv path from workqueue
Mike Christie <[email protected]>
scsi: iscsi: Add recv workqueue helpers
Mike Christie <[email protected]>
scsi: iscsi: Rename iscsi_conn_queue_work()
John Garry <[email protected]>
scsi: pm8001: Fix running_req for internal abort commands
Duoming Zhou <[email protected]>
scsi: libsas: Fix use-after-free bug in smp_execute_task_sg()
Pali Rohár <[email protected]>
serial: 8250: Fix restoring termios speed after suspend
Guilherme G. Piccoli <[email protected]>
firmware: google: Test spinlock on panic path to avoid lockups
Lin Yujun <[email protected]>
slimbus: qcom-ngd: Add error handling in of_qcom_slim_ngd_register
Krzysztof Kozlowski <[email protected]>
slimbus: qcom-ngd-ctrl: allow compile testing without QCOM_RPROC_COMMON
Nam Cao <[email protected]>
staging: vt6655: fix some erroneous memory clean-up loops
Dongliang Mu <[email protected]>
phy: qualcomm: call clk_disable_unprepare in the error handling
Sherry Sun <[email protected]>
tty: serial: fsl_lpuart: disable dma rx/tx use flags in lpuart_dma_shutdown
Ilpo Järvinen <[email protected]>
serial: 8250: Toggle IER bits on only after irq has been set up
Dan Carpenter <[email protected]>
drivers: serial: jsm: fix some leaks in probe
Dan Carpenter <[email protected]>
usb: dwc3: core: fix some leaks in probe
Albert Briscoe <[email protected]>
usb: gadget: function: fix dangling pnp_string in f_printer.c
Mario Limonciello <[email protected]>
xhci: Don't show warning for reinit on known broken suspend
Daisuke Matsuda <[email protected]>
IB: Set IOVA/LENGTH on IB_MR in core/uverbs layers
Mark Zhang <[email protected]>
RDMA/cm: Use SLID in the work completion as the DLID in responder side
David Sloan <[email protected]>
md/raid5: Remove unnecessary bio_put() in raid5_read_one_chunk()
Logan Gunthorpe <[email protected]>
md/raid5: Ensure stripe_fill happens on non-read IO with journal
Saurabh Sengar <[email protected]>
md: Replace snprintf with scnprintf
Dan Carpenter <[email protected]>
mtd: rawnand: meson: fix bit map use in meson_nfc_ecc_correct()
Niklas Cassel <[email protected]>
ata: fix ata_id_has_dipm()
Niklas Cassel <[email protected]>
ata: fix ata_id_has_ncq_autosense()
Niklas Cassel <[email protected]>
ata: fix ata_id_has_devslp()
Niklas Cassel <[email protected]>
ata: fix ata_id_sense_reporting_enabled() and ata_id_has_sense_reporting()
Bernard Metzler <[email protected]>
RDMA/siw: Fix QP destroy to wait for all references dropped.
Bernard Metzler <[email protected]>
RDMA/siw: Always consume all skbuf data in sk_data_ready() upcall.
Bart Van Assche <[email protected]>
RDMA/srp: Fix srp_abort()
Shiraz Saleem <[email protected]>
RDMA/irdma: Validate udata inlen and outlen
Sindhu-Devale <[email protected]>
RDMA/irdma: Align AE id codes to correct flush code and event
Pali Rohár <[email protected]>
mtd: rawnand: fsl_elbc: Fix none ECC mode
Martin Blumenstingl <[email protected]>
mtd: rawnand: intel: Remove undocumented compatible string
Martin Blumenstingl <[email protected]>
mtd: rawnand: intel: Read the chip-select line from the correct OF node
Chunfeng Yun <[email protected]>
phy: phy-mtk-tphy: fix the phy type setting issue
Liang He <[email protected]>
phy: amlogic: phy-meson-axg-mipi-pcie-analog: Hold reference returned by of_get_parent()
Dan Carpenter <[email protected]>
remoteproc: Harden rproc_handle_vdev() against integer overflow
William Dean <[email protected]>
mtd: devices: docg3: check the return value of devm_ioremap() in the probe
Dang Huynh <[email protected]>
clk: qcom: sm6115: Select QCOM_GDSC
Jim Cromie <[email protected]>
dyndbg: drop EXPORTed dynamic_debug_exec_queries
Jim Cromie <[email protected]>
dyndbg: let query-modname override actual module name
Jim Cromie <[email protected]>
dyndbg: fix module.dyndbg handling
Jim Cromie <[email protected]>
dyndbg: fix static_branch manipulation
Dan Carpenter <[email protected]>
usb: gadget: f_fs: stricter integer overflow checks
Jie Hai <[email protected]>
dmaengine: hisilicon: Add multi-thread support for a DMA channel
Jie Hai <[email protected]>
dmaengine: hisilicon: Fix CQ head update
Jie Hai <[email protected]>
dmaengine: hisilicon: Disable channels when unregister hisi_dma
Jerry Snitselaar <[email protected]>
dmaengine: idxd: avoid deadlock in process_misc_interrupts()
Peter Geis <[email protected]>
phy: rockchip-inno-usb2: Return zero after otg sync
Dan Carpenter <[email protected]>
fpga: prevent integer overflow in dfl_feature_ioctl_set_irq()
Hangyu Hua <[email protected]>
misc: ocxl: fix possible refcount leak in afu_ioctl()
AngeloGioacchino Del Regno <[email protected]>
clk: mediatek: mt8195-infra_ao: Set pwrmcu clocks as critical
AngeloGioacchino Del Regno <[email protected]>
clk: mediatek: clk-mt8195-vdo1: Reparent and set rate on vdo1_dpintf's parent
AngeloGioacchino Del Regno <[email protected]>
clk: mediatek: clk-mt8195-vdo0: Set rate on vdo0_dp_intf0_dp_intf's parent
Zhu Yanjun <[email protected]>
RDMA/rxe: Fix the error caused by qp->sk
Zhu Yanjun <[email protected]>
RDMA/rxe: Fix "kernel NULL pointer dereference" error
Miaoqian Lin <[email protected]>
media: xilinx: vipp: Fix refcount leak in xvip_graph_dma_init
Yunke Cao <[email protected]>
media: uvcvideo: Use entity get_cur in uvc_ctrl_set
José Expósito <[email protected]>
media: uvcvideo: Fix memory leak in uvc_gpio_parse
Xu Qiang <[email protected]>
media: meson: vdec: add missing clk_disable_unprepare on error in vdec_hevc_start()
Ming Qian <[email protected]>
media: amphion: fix a bug that vpu core may not resume after suspend
Ming Qian <[email protected]>
media: amphion: don't change the colorspace reported by decoder.
Ming Qian <[email protected]>
media: amphion: adjust the encoder's value range of gop size
Ming Qian <[email protected]>
media: amphion: insert picture startcode after seek for vc1g format
Shubhrajyoti Datta <[email protected]>
tty: xilinx_uartps: Fix the ignore_status
Liang He <[email protected]>
media: exynos4-is: fimc-is: Add of_node_put() when breaking out of loop
Marijn Suijten <[email protected]>
clk: qcom: gcc-sdm660: Use floor ops for SDCC1 clock
Jack Wang <[email protected]>
HSI: omap_ssi_port: Fix dma_map_sg error check
Miaoqian Lin <[email protected]>
HSI: omap_ssi: Fix refcount leak in ssi_probe
Chanho Park <[email protected]>
clk: samsung: exynosautov9: correct register offsets of peric0/c1
Miaoqian Lin <[email protected]>
clk: tegra20: Fix refcount leak in tegra20_clock_init
Miaoqian Lin <[email protected]>
clk: tegra: Fix refcount leak in tegra114_clock_init
Miaoqian Lin <[email protected]>
clk: tegra: Fix refcount leak in tegra210_clock_init
Liang He <[email protected]>
clk: sprd: Hold reference returned by of_get_parent()
Liang He <[email protected]>
clk: berlin: Add of_node_put() for of_get_parent()
Liang He <[email protected]>
clk: qoriq: Hold reference returned by of_get_parent()
Liang He <[email protected]>
clk: oxnas: Hold reference returned by of_get_parent()
Liang He <[email protected]>
clk: st: Hold reference returned by of_get_parent()
Liang He <[email protected]>
clk: meson: Hold reference returned by of_get_parent()
Thinh Nguyen <[email protected]>
usb: common: debug: Check non-standard control requests
Aharon Landau <[email protected]>
RDMA/mlx5: Don't compare mkey tags in DEVX indirect mkey
Jakob Hauser <[email protected]>
iio: magnetometer: yas530: Change data type of hard_offsets to signed
Jonathan Cameron <[email protected]>
iio: ABI: Fix wrong format of differential capacitance channel ABI.
Nuno Sá <[email protected]>
iio: inkern: fix return value in devm_of_iio_channel_get_by_name()
Nuno Sá <[email protected]>
iio: inkern: only release the device node when done with it
Claudiu Beznea <[email protected]>
iio: adc: at91-sama5d2_adc: disable/prepare buffer on suspend/resume
Claudiu Beznea <[email protected]>
iio: adc: at91-sama5d2_adc: lock around oversampling and sample freq
Claudiu Beznea <[email protected]>
iio: adc: at91-sama5d2_adc: check return status for pressure and touch
Claudiu Beznea <[email protected]>
iio: adc: at91-sama5d2_adc: fix AT91_SAMA5D2_MR_TRACKTIM_MAX
Darrick J. Wong <[email protected]>
iomap: iomap: fix memory corruption when recording errors during writeback
Dmitry Torokhov <[email protected]>
ARM: dts: exynos: fix polarity of VBUS GPIO of Origen
Mark Rutland <[email protected]>
arm64: ftrace: fix module PLTs with mcount
Josh Triplett <[email protected]>
ext4: don't run ext4lazyinit for read-only filesystems
Geert Uytterhoeven <[email protected]>
ARM: Drop CMDLINE_* dependency on ATAGS
Dmitry Torokhov <[email protected]>
ARM: dts: exynos: correct s5k6a3 reset polarity on Midas family
Matt Ranostay <[email protected]>
arm64: dts: ti: k3-j7200: fix main pinmux range
Dmitry Osipenko <[email protected]>
soc/tegra: fuse: Drop Kconfig dependency on TEGRA20_APB_DMA
Randy Dunlap <[email protected]>
ia64: export memory_add_physaddr_to_nid to fix cxl build error
Michael Walle <[email protected]>
ARM: dts: kirkwood: lsxl: remove first ethernet port
Michael Walle <[email protected]>
ARM: dts: kirkwood: lsxl: fix serial line
Marek Behún <[email protected]>
ARM: dts: turris-omnia: Fix mpp26 pin name and comment
Chanho Park <[email protected]>
dt-bindings: clock: exynosautov9: correct clock numbering of peric0/c1
Biju Das <[email protected]>
arm64: dts: renesas: r9a07g043: Fix SCI{Rx,Tx} interrupt types
Biju Das <[email protected]>
arm64: dts: renesas: r9a07g054: Fix SCI{Rx,Tx} interrupt types
Biju Das <[email protected]>
arm64: dts: renesas: r9a07g044: Fix SCI{Rx,Tx} interrupt types
Lucas Stach <[email protected]>
ARM: dts: imx6qdl-kontron-samx6i: hook up DDC i2c bus
Liang He <[email protected]>
soc: qcom: smem_state: Add refcounting for the 'state->of_node'
Liang He <[email protected]>
soc: qcom: smsm: Fix refcount leak bugs in qcom_smsm_probe()
Amir Goldstein <[email protected]>
locks: fix TOCTOU race when granting write lease
Liang He <[email protected]>
memory: of: Fix refcount leak bug in of_lpddr3_get_ddr_timings()
Liang He <[email protected]>
memory: of: Fix refcount leak bug in of_get_ddr_timings()
Liang He <[email protected]>
memory: pl353-smc: Fix refcount leak bug in pl353_smc_probe()
Takashi Iwai <[email protected]>
ALSA: hda/hdmi: Don't skip notification handling during PM operation
Zhang Qilong <[email protected]>
ASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe
Zhang Qilong <[email protected]>
ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe
Zhang Qilong <[email protected]>
ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe
Zhang Qilong <[email protected]>
ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe
Zhang Qilong <[email protected]>
ASoC: stm: Fix PM disable depth imbalance in stm32_i2s_probe
Zhang Qilong <[email protected]>
ASoC: stm32: spdifrx: Fix PM disable depth imbalance in stm32_spdifrx_probe
Zhang Qilong <[email protected]>
ASoC: stm32: dfsdm: Fix PM disable depth imbalance in stm32_adfsdm_probe
Christophe JAILLET <[email protected]>
mmc: wmt-sdmmc: Fix an error handling path in wmt_mci_probe()
Andreas Pape <[email protected]>
ALSA: dmaengine: increment buffer pointer atomically
Christophe JAILLET <[email protected]>
ASoC: da7219: Fix an error handling path in da7219_register_dai_clks()
Srinivas Kandagatla <[email protected]>
ASoC: codecs: tx-macro: fix kcontrol put
Dan Carpenter <[email protected]>
virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()
Rafael Mendonca <[email protected]>
drm/vmwgfx: Fix memory leak in vmw_mksstat_add_ioctl()
Takashi Iwai <[email protected]>
ALSA: usb-audio: Properly refcounting clock rate
Kuogee Hsieh <[email protected]>
drm/msm/dp: correct 1.62G link rate at dp_catalog_ctrl_config_msa()
Dmitry Baryshkov <[email protected]>
drm/msm/dpu: index dpu_kms->hw_vbif using vbif_idx
Dmitry Baryshkov <[email protected]>
drm/msm: lookup the ICC paths in both mdp5/dpu and mdss devices
Liang He <[email protected]>
ASoC: eureka-tlv320: Hold reference returned from of_find_xxx API
Christophe JAILLET <[email protected]>
mmc: au1xmmc: Fix an error handling path in au1xmmc_probe()
Rafael Mendonca <[email protected]>
drm/amdgpu: Fix memory leak in hpd_rx_irq_create_workqueue()
Liang He <[email protected]>
drm/omap: dss: Fix refcount leak bugs
AngeloGioacchino Del Regno <[email protected]>
ASoC: SOF: mediatek: mt8195: Import namespace SND_SOC_SOF_MTK_COMMON
Gerd Hoffmann <[email protected]>
drm/bochs: fix blanking
Chia-I Wu <[email protected]>
drm/virtio: set fb_modifiers_not_supported
Takashi Iwai <[email protected]>
ALSA: hda: beep: Simplify keep-power-at-enable behavior
Cristian Ciocaltea <[email protected]>
ASoC: wm_adsp: Handle optional legacy support
Jiasheng Jiang <[email protected]>
ASoC: rsnd: Add check for rsnd_mod_power_on
Pin-yen Lin <[email protected]>
drm/bridge: it6505: Fix the order of DP_SET_POWER commands
Zheyu Ma <[email protected]>
drm/bridge: megachips: Fix a null pointer dereference bug
Yang Yingliang <[email protected]>
drm/amdgpu: add missing pci_disable_device() in amdgpu_pmops_runtime_resume()
Prashant Malani <[email protected]>
platform/chrome: cros_ec_typec: Correct alt mode index
Hans de Goede <[email protected]>
platform/x86: msi-laptop: Fix resource cleanup
Hans de Goede <[email protected]>
platform/x86: msi-laptop: Fix old-ec check for backlight registering
Martin Povišer <[email protected]>
ASoC: tas2764: Fix mute/unmute
Martin Povišer <[email protected]>
ASoC: tas2764: Drop conflicting set_bias_level power setting
Martin Povišer <[email protected]>
ASoC: tas2764: Allow mono streams
Kuninori Morimoto <[email protected]>
ASoC: soc-pcm.c: call __soc_pcm_close() in soc_pcm_close()
Rob Clark <[email protected]>
drm/virtio: Fix same-context optimization
Dan Carpenter <[email protected]>
platform/chrome: fix memory corruption in ioctl
Rustam Subkhankulov <[email protected]>
platform/chrome: fix double-free in chromeos_laptop_prepare()
Javier Martinez Canillas <[email protected]>
drm/msm: Make .remove and .shutdown HW shutdown consistent
Dan Carpenter <[email protected]>
ASoC: mt6359: fix tests for platform_get_irq() failure
Liang He <[email protected]>
drm:pl111: Add of_node_put() when breaking out of for_each_available_child_of_node()
Simon Ser <[email protected]>
drm/dp_mst: fix drm_dp_dpcd_read return value checks
Chen-Yu Tsai <[email protected]>
drm/bridge: parade-ps8640: Fix regulator supply order
Liang He <[email protected]>
drm/bridge: tc358767: Add of_node_put() when breaking out of loop
Dmitry Osipenko <[email protected]>
drm/virtio: Correct drm_gem_shmem_get_sg_table() error handling
Pin-Yen Lin <[email protected]>
drm/bridge: it6505: Power on downstream device in .atomic_enable
Maxime Ripard <[email protected]>
drm/mipi-dsi: Detach devices when removing the host
Dan Carpenter <[email protected]>
drm/bridge: Avoid uninitialized variable warning
Alvin Šipraga <[email protected]>
drm: bridge: adv7511: unregister cec i2c device after cec adapter
Alvin Šipraga <[email protected]>
drm: bridge: adv7511: fix CEC power down control register offset
Russell King (Oracle) <[email protected]>
net: mvpp2: fix mvpp2 debugfs leak
Eric Dumazet <[email protected]>
once: add DO_ONCE_SLOW() for sleepable contexts
Tetsuo Handa <[email protected]>
net/ieee802154: reject zero-sized raw_sendmsg()
Maxim Mikityanskiy <[email protected]>
net: wwan: iosm: Call mutex_init before locking it
Zheng Wang <[email protected]>
eth: sp7021: fix use after free bug in spl2sw_nvmem_get_mac_address
Jianglei Nie <[email protected]>
bnx2x: fix potential memory leak in bnx2x_tpa_stop()
Raju Lakkaraju <[email protected]>
eth: lan743x: reject extts for non-pci11x1x devices
Jiasheng Jiang <[email protected]>
net: prestera: acl: Add check for kmemdup
Kuniyuki Iwashima <[email protected]>
af_unix: Fix memory leaks of the whole sk due to OOB skb.
Tetsuo Handa <[email protected]>
net: rds: don't hold sock lock when cancelling work from rds_tcp_reset_callbacks()
Oleksandr Shamray <[email protected]>
hwmon: (pmbus/mp2888) Fix sensors readouts for MPS Multi-phase mp2888 controller
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_sync: Fix not indicating power state
Marek Szyprowski <[email protected]>
spi: Ensure that sg_table won't be used after being freed
Neal Cardwell <[email protected]>
tcp: fix tcp_cwnd_validate() to not forget is_cwnd_limited
Xin Long <[email protected]>
sctp: handle the error returned from sctp_auth_asoc_init_active_key
Duoming Zhou <[email protected]>
mISDN: fix use-after-free bugs in l1oip timer handlers
Jakub Kicinski <[email protected]>
eth: alx: take rtnl_lock on resume
Junichi Uekawa <[email protected]>
vhost/vsock: Use kvmalloc/kvfree for larger packets.
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: Fix AIFS written to REG_EDCA_*_PARAM
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: gen2: Enable 40 MHz channel width
Vincent Whitchurch <[email protected]>
spi: s3c64xx: Fix large transfers with DMA
Phil Sutter <[email protected]>
netfilter: nft_fib: Fix for rpath check with VRF devices
Liu Jian <[email protected]>
xfrm: Reinject transport-mode packets through workqueue
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_core: Fix not handling link timeouts propertly
Asmaa Mnebhi <[email protected]>
i2c: mlxbf: support lock mechanism
Xiaomeng Tong <[email protected]>
cw1200: fix incorrect check to determine if no element is found in list
Liu Jian <[email protected]>
skmsg: Schedule psock work if the cached skb exists on the psock
Zhang Qilong <[email protected]>
spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe
Zhang Qilong <[email protected]>
spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe
Zhang Qilong <[email protected]>
spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe
Luciano Leão <[email protected]>
x86/cpu: Include the header of init_ia32_feat_ctl()'s prototype
Christian Marangi <[email protected]>
wifi: ath11k: fix peer addition/deletion error on sta band migration
Kees Cook <[email protected]>
x86/microcode/AMD: Track patch allocation size explicitly
Arınç ÜNAL <[email protected]>
mips: dts: ralink: mt7621: fix external phy on GB-PC2
Jesus Fernandez Manzano <[email protected]>
wifi: ath11k: fix number of VHT beamformee spatial streams
Wen Gong <[email protected]>
wifi: ath11k: fix failed to find the peer with peer_id 0 when disconnected
Qingqing Yang <[email protected]>
flow_dissector: Do not count vlan tags inside tunnel payload
Antoine Tenart <[email protected]>
netfilter: conntrack: revisit the gc initial rescheduling bias
Antoine Tenart <[email protected]>
netfilter: conntrack: fix the gc rescheduling delay
Tetsuo Handa <[email protected]>
Bluetooth: hci_{ldisc,serdev}: check percpu_init_rwsem() failure
Baochen Qiang <[email protected]>
wifi: ath11k: Include STA_KEEPALIVE_ARP_RESPONSE TLV header by default
Lee Jones <[email protected]>
bpf: Ensure correct locking around vulnerable function find_vpid()
Zheng Yongjun <[email protected]>
net: fs_enet: Fix wrong check in do_pd_setup
Luiz Augusto von Dentz <[email protected]>
Bluetooth: RFCOMM: Fix possible deadlock on socket shutdown/release
Deren Wu <[email protected]>
wifi: mt76: mt7921e: fix rmmod crash in driver reload test
Howard Hsu <[email protected]>
wifi: mt76: mt7915: do not check state before configuring implicit beamform
Howard Hsu <[email protected]>
wifi: mt76: mt7915: fix mcs value in ht mode
Sean Wang <[email protected]>
wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_sta_set_decap_offload
Sean Wang <[email protected]>
wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_[start, stop]_ap
Lorenzo Bianconi <[email protected]>
wifi: mt76: connac: fix possible unaligned access in mt76_connac_mcu_add_nested_tlv
Lorenzo Bianconi <[email protected]>
wifi: mt76: mt7915: fix possible unaligned access in mt7915_mac_add_twt_setup
Lorenzo Bianconi <[email protected]>
wifi: mt76: mt7615: add mt7615_mutex_acquire/release in mt7615_sta_set_decap_offload
YN Chen <[email protected]>
wifi: mt76: sdio: fix transmitting packet hangs
Sean Wang <[email protected]>
wifi: mt76: sdio: poll sta stat when device transmits data
Sean Wang <[email protected]>
wifi: mt76: sdio: fix the deadlock caused by sdio->stat_work
Sean Wang <[email protected]>
wifi: mt76: mt7921u: fix race issue between reset and suspend/resume
Sean Wang <[email protected]>
wifi: mt76: mt7921s: fix race issue between reset and suspend/resume
Sean Wang <[email protected]>
wifi: mt76: mt7921e: fix race issue between reset and suspend/resume
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: Remove copy-paste leftover in gen2_update_rate_mask
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: gen2: Fix mistake in path B IQ calibration
Lorenz Bauer <[email protected]>
bpf: btf: fix truncated last_member_type_id in btf_struct_resolve
Neil Armstrong <[email protected]>
spi: meson-spicc: do not rely on busy flag in pow2 clk ops
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: Fix skb misuse in TX queue selection
Xu Qiang <[email protected]>
spi: qup: add missing clk_disable_unprepare on error in spi_qup_pm_resume_runtime()
Xu Qiang <[email protected]>
spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume()
Ian Rogers <[email protected]>
selftests/xsk: Avoid use-after-free on ctx
Yang Yingliang <[email protected]>
wifi: rtw88: add missing destroy_workqueue() on error path in rtw_core_init()
Dan Carpenter <[email protected]>
wifi: wfx: prevent underflow in wfx_send_pds()
Dan Carpenter <[email protected]>
wifi: rtl8xxxu: tighten bounds checking in rtl8xxxu_read_efuse()
Ping-Ke Shih <[email protected]>
wifi: rtw89: pci: correct TX resource checking in low power mode
Ping-Ke Shih <[email protected]>
wifi: rtw89: pci: fix interrupt stuck after leaving low power mode
Sean Wang <[email protected]>
Bluetooth: btusb: mediatek: fix WMT failure during runtime suspend
Hou Tao <[email protected]>
bpf: Use this_cpu_{inc_return|dec} for prog->activeHou Tao <[email protected]>
bpf: Use this_cpu_{inc|dec|inc_return} for bpf_task_storage_busy
Manikanta Pubbisetty <[email protected]>
wifi: ath11k: Fix incorrect QMI message ID mappings
Hou Tao <[email protected]>
bpf: Propagate error from htab_lock_bucket() to userspace
Hou Tao <[email protected]>
bpf: Disable preemption when increasing per-cpu map_locked
Maciej Fijalkowski <[email protected]>
selftests/xsk: Add missing close() on netns fd
Maciej Fijalkowski <[email protected]>
xsk: Fix backpressure mechanism on Tx
Kohei Tarumizu <[email protected]>
x86/resctrl: Fix to restore to original value when re-enabling hardware prefetch register
Christophe JAILLET <[email protected]>
spi: mt7621: Fix an error message in mt7621_spi_probe()
Sabrina Dubroca <[email protected]>
esp: choose the correct inner protocol for GSO on inter address family tunnels
Richard Guy Briggs <[email protected]>
audit: free audit_proctitle only on task exit
Richard Guy Briggs <[email protected]>
audit: explicitly check audit_context->context enum value
Lam Thai <[email protected]>
bpftool: Fix a wrong type cast in btf_dumper_int
Hari Chandrakanthan <[email protected]>
wifi: mac80211: allow bw change during channel switch in mesh
Shaul Triebitz <[email protected]>
wifi: cfg80211: get correct AP link chandef
Kumar Kartikeya Dwivedi <[email protected]>
bpf: Fix reference state management for synchronous callbacks
Gerhard Engleder <[email protected]>
tsnep: Fix TSNEP_INFO_TX_TIME register define
Uwe Kleine-König <[email protected]>
leds: lm3601x: Don't use mutex after it was destroyed
Dave Marchevsky <[email protected]>
bpf: Cleanup check_refcount_ok
Stanislav Fomichev <[email protected]>
bpf: convert cgroup_bpf.progs to hlist
Joanne Koong <[email protected]>
bpf: Fix non-static bpf_func_proto struct definitions
Wen Gong <[email protected]>
wifi: ath10k: add peer map clean up for peer delete in ath10k_sta_state()
Ping-Ke Shih <[email protected]>
wifi: rtlwifi: 8192de: correct checking of IQK reload
Bill Wendling <[email protected]>
x86/paravirt: add extra clobbers with ZERO_CALL_USED_REGS enabled
Chuck Lever <[email protected]>
NFSD: Fix handling of oversized NFSv4 COMPOUND requests
Chuck Lever <[email protected]>
NFSD: Protect against send buffer overflow in NFSv2 READDIR
Chuck Lever <[email protected]>
SUNRPC: Fix svcxdr_init_encode's buflen calculation
Chuck Lever <[email protected]>
SUNRPC: Fix svcxdr_init_decode's end-of-buffer calculation
Christophe JAILLET <[email protected]>
nfsd: Fix a memory leak in an error handling path
Sami Tolvanen <[email protected]>
objtool: Preserve special st_shndx indexes in elf_update_symbol
Huisong Li <[email protected]>
ACPI: PCC: Fix Tx acknowledge in the PCC address space handler
Huisong Li <[email protected]>
ACPI: PCC: replace wait_for_completion()
Rafael Mendonca <[email protected]>
ACPI: PCC: Release resources on address space setup failure path
Wang Kefeng <[email protected]>
ARM: 9247/1: mm: set readonly for MT_MEMORY_RO with ARM_LPAE
Wang Kefeng <[email protected]>
ARM: 9244/1: dump: Fix wrong pg_level in walk_pmd()
Bart Van Assche <[email protected]>
ARM: 9243/1: riscpc: Unbreak the build
Jia Zhu <[email protected]>
erofs: use kill_anon_super() to kill super in fscache mode
Gao Xiang <[email protected]>
erofs: fix order >= MAX_ORDER warning due to crafted negative i_size
Lin Yujun <[email protected]>
MIPS: SGI-IP27: Fix platform-device leak in bridge_platform_create()
Lin Yujun <[email protected]>
MIPS: SGI-IP30: Fix platform-device leak in bridge_platform_create()
Kees Cook <[email protected]>
sh: machvec: Use char[] for section boundaries
Perry Yuan <[email protected]>
cpufreq: amd-pstate: Fix initial highest_perf value
Xuewen Yan <[email protected]>
thermal: cpufreq_cooling: Check the policy first in cpufreq_cooling_register()
Christian Brauner <[email protected]>
ntfs3: rework xattr handlers and switch to POSIX ACL VFS helpers
Ondrej Mosnacek <[email protected]>
userfaultfd: open userfaultfds with O_RDONLY
Mimi Zohar <[email protected]>
ima: fix blocking of security.ima xattrs of unsupported algorithms
Greg Kroah-Hartman <[email protected]>
selinux: use "grep -E" instead of "egrep"
Steve French <[email protected]>
smb3: must initialize two ACL struct fields to zero
Shirish S <[email protected]>
drm/amd/display: explicitly disable psr_feature_enable appropriately
Yunxiang Li <[email protected]>
drm/amd/display: Fix vblank refcount in vrr transition
Ville Syrjälä <[email protected]>
drm/i915: Fix watermark calculations for DG2 CCS+CC modifier
Ville Syrjälä <[email protected]>
drm/i915: Fix watermark calculations for DG2 CCS modifiers
Ville Syrjälä <[email protected]>
drm/i915: Fix watermark calculations for gen12+ CCS+CC modifier
Ville Syrjälä <[email protected]>
drm/i915: Fix watermark calculations for gen12+ MC CCS modifier
Ville Syrjälä <[email protected]>
drm/i915: Fix watermark calculations for gen12+ RC CCS modifier
Chris Wilson <[email protected]>
drm/i915/gt: Use i915_vm_put on ppgtt_create error paths
Jianglei Nie <[email protected]>
drm/nouveau: fix a use-after-free in nouveau_gem_prime_import_sg_table()
Lyude Paul <[email protected]>
drm/nouveau/kms/nv140-: Disable interlacing
Greg Kroah-Hartman <[email protected]>
staging: greybus: audio_helper: remove unused and wrong debugfs usage
Sean Christopherson <[email protected]>
KVM: VMX: Drop bits 31:16 when shoving exception error code into VMCS
Sean Christopherson <[email protected]>
KVM: nVMX: Don't propagate vmcs12's PERF_GLOBAL_CTRL settings to vmcs02
Sean Christopherson <[email protected]>
KVM: nVMX: Unconditionally purge queued/injected events on nested "exit"
Michal Luczaj <[email protected]>
KVM: x86/emulator: Fix handing of POP SS to correctly set interruptibility
Yu Kuai <[email protected]>
blk-wbt: call rq_qos_add() after wb_normal is initialized
Yu Kuai <[email protected]>
blk-throttle: fix that io throttle can only work for single bio
Dmitry Osipenko <[email protected]>
media: cedrus: Fix endless loop in cedrus_h265_skip_bits()
Dmitry Osipenko <[email protected]>
media: cedrus: Set the platform driver data earlier
Ard Biesheuvel <[email protected]>
efi: libstub: drop pointless get_memory_map() call
Mario Limonciello <[email protected]>
thunderbolt: Explicitly enable lane adapter hotplug events at startup
Shengjiu Wang <[email protected]>
rpmsg: char: Avoid double destroy of default endpoint
Steven Rostedt (Google) <[email protected]>
tracing: Fix reading strings from synthetic events
Steven Rostedt (Google) <[email protected]>
tracing: Add "(fault)" name injection to kernel probes
Steven Rostedt (Google) <[email protected]>
tracing: Move duplicate code of trace_kprobe/eprobe.c into header
Steven Rostedt (Google) <[email protected]>
tracing: Do not free snapshot if tracer is on cmdline
Steven Rostedt (Google) <[email protected]>
tracing: Add ioctl() to force ring buffer waiters to wake up
Steven Rostedt (Google) <[email protected]>
tracing: Wake up waiters when tracing is disabled
Steven Rostedt (Google) <[email protected]>
tracing: Wake up ring buffer waiters on closing of the file
Waiman Long <[email protected]>
tracing: Disable interrupt or preemption before acquiring arch_spinlock_t
Steven Rostedt (Google) <[email protected]>
ring-buffer: Fix race between reset page and reading page
Steven Rostedt (Google) <[email protected]>
ring-buffer: Add ring_buffer_wake_waiters()
Steven Rostedt (Google) <[email protected]>
ring-buffer: Check pending waiters when doing wake ups as well
Steven Rostedt (Google) <[email protected]>
ring-buffer: Have the shortest_full queue be the shortest not longest
Steven Rostedt (Google) <[email protected]>
ring-buffer: Allow splice to read previous partially read pages
Steven Rostedt (Google) <[email protected]>
ftrace: Still disable enabled records marked as disabled
Zheng Yejian <[email protected]>
ftrace: Properly unset FTRACE_HASH_FL_MOD
Rik van Riel <[email protected]>
livepatch: fix race between fork and KLP transition
Ye Bin <[email protected]>
ext4: update 'state->fc_regions_size' after successful memory allocation
Ye Bin <[email protected]>
ext4: fix potential memory leak in ext4_fc_record_regions()
Ye Bin <[email protected]>
ext4: fix potential memory leak in ext4_fc_record_modified_inode()
Ye Bin <[email protected]>
ext4: fix miss release buffer head in ext4_fc_write_inode
Zhihao Cheng <[email protected]>
ext4: fix dir corruption when ext4_dx_add_entry() fails
Jeff Layton <[email protected]>
ext4: fix i_version handling in ext4
Jinke Han <[email protected]>
ext4: place buffer head allocation before handle start
Zhang Yi <[email protected]>
ext4: ext4_read_bh_lock() should submit IO if the buffer isn't uptodate
Jeff Layton <[email protected]>
ext4: unconditionally enable the i_version counter
Lukas Czerner <[email protected]>
ext4: don't increase iversion counter for ea_inodes
Jan Kara <[email protected]>
ext4: fix check for block being out of directory size
Lalith Rajendran <[email protected]>
ext4: make ext4_lazyinit_thread freezable
Baokun Li <[email protected]>
ext4: fix null-ptr-deref in ext4_write_info
Jan Kara <[email protected]>
ext4: avoid crash when inline data creation follows DIO write
Jan Kara <[email protected]>
ext2: Add sanity checks for group and filesystem size
Ye Bin <[email protected]>
jbd2: add miss release buffer head in fc_do_one_pass()
Ye Bin <[email protected]>
jbd2: fix potential use-after-free in jbd2_fc_wait_bufs
Ye Bin <[email protected]>
jbd2: fix potential buffer head reference count leak
Andrew Perepechko <[email protected]>
jbd2: wake up journal waiters in FIFO order, not LIFO
Chao Yu <[email protected]>
f2fs: fix to do sanity check on summary info
Chao Yu <[email protected]>
f2fs: fix to do sanity check on destination blkaddr during recovery
Jaegeuk Kim <[email protected]>
f2fs: increase the limit for reserve_root
Jaegeuk Kim <[email protected]>
f2fs: flush pending checkpoints when freezing super
Jaegeuk Kim <[email protected]>
f2fs: complete checkpoints during remount
Jaegeuk Kim <[email protected]>
f2fs: fix wrong continue condition in GC
Tetsuo Handa <[email protected]>
btrfs: set generation before calling btrfs_clean_tree_block in btrfs_init_new_buffer
Filipe Manana <[email protected]>
btrfs: fix missed extent on fsync after dropping extent maps
Filipe Manana <[email protected]>
btrfs: fix race between quota enable and quota rescan ioctl
Qu Wenruo <[email protected]>
btrfs: enhance unsupported compat RO flags handling
Alexander Zhu <[email protected]>
btrfs: fix alignment of VMA for memory mapped files on THP
Lukas Czerner <[email protected]>
fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE
Mickaël Salaün <[email protected]>
ksmbd: Fix user namespace mapping
Zhang Xiaoxu <[email protected]>
ksmbd: Fix wrong return value and message length check in smb2_ioctl()
Namjae Jeon <[email protected]>
ksmbd: fix endless loop when encryption for response fails
Namjae Jeon <[email protected]>
ksmbd: fix incorrect handling of iterate_dir
Steve French <[email protected]>
smb3: do not log confusing message when server returns no network interfaces
Jason A. Donenfeld <[email protected]>
hwrng: core - let sleep be interrupted when unregistering hwrng
Hyunwoo Kim <[email protected]>
fbdev: smscufx: Fix use-after-free in ufx_ops_open()
Quentin Schulz <[email protected]>
pinctrl: rockchip: add pinmux_ops.gpio_set_direction callback
Quentin Schulz <[email protected]>
gpio: rockchip: request GPIO mux to pinctrl when setting direction
Saurav Kashyap <[email protected]>
scsi: qedf: Populate sysfs attributes for vport
James Smart <[email protected]>
scsi: lpfc: Rework MIB Rx Monitor debug info logic
Krzysztof Kozlowski <[email protected]>
slimbus: qcom-ngd: cleanup in probe error path
Krzysztof Kozlowski <[email protected]>
slimbus: qcom-ngd: use correct error in message of pdr_add_lookup() failure
Pali Rohár <[email protected]>
powerpc/boot: Explicitly disable usage of SPE instructions
Christophe Leroy <[email protected]>
powerpc/Kconfig: Fix non existing CONFIG_PPC_FSL_BOOKE
Zhang Rui <[email protected]>
powercap: intel_rapl: Use standard Energy Unit for SPR Dram RAPL domain
Viresh Kumar <[email protected]>
cpufreq: qcom-cpufreq-hw: Fix uninitialized throttled_freq warning
Chuck Lever <[email protected]>
NFSD: Protect against send buffer overflow in NFSv3 READ
Chuck Lever <[email protected]>
NFSD: Protect against send buffer overflow in NFSv2 READ
Chuck Lever <[email protected]>
NFSD: Protect against send buffer overflow in NFSv3 READDIR
Maciej W. Rozycki <[email protected]>
serial: 8250: Request full 16550A feature probing for OxSemi PCIe devices
Maciej W. Rozycki <[email protected]>
serial: 8250: Let drivers request full 16550A feature probing
Lukas Wunner <[email protected]>
serial: stm32: Deassert Transmit Enable on ->rs485_config()
Christophe Leroy <[email protected]>
serial: cpm_uart: Don't request IRQ too early for console port
Maciej W. Rozycki <[email protected]>
PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge
M. Vefa Bicakci <[email protected]>
xen/gntdev: Accommodate VMA splitting
M. Vefa Bicakci <[email protected]>
xen/gntdev: Prevent leaking grants
Carlos Llamas <[email protected]>
mm/mmap: undo ->mmap() when arch_validate_flags() fails
Peter Xu <[email protected]>
mm/uffd: fix warning without PTE_MARKER_UFFD_WP compiled in
Baolin Wang <[email protected]>
mm/damon: validate if the pmd entry is present before accessing
Baolin Wang <[email protected]>
mm/hugetlb: fix races when looking up a CONT-PTE/PMD size hugetlb page
Yang Guo <[email protected]>
clocksource/drivers/arm_arch_timer: Fix CNTPCT_LO and CNTVCT_LO value
James Morse <[email protected]>
arm64: errata: Add Cortex-A55 to the repeat tlbi list
Peter Collingbourne <[email protected]>
arm64: mte: move register initialization to C
Takashi Iwai <[email protected]>
drm/udl: Restore display mode on resume
Dmitry Osipenko <[email protected]>
drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb()
Dmitry Osipenko <[email protected]>
drm/virtio: Unlock reservations on dma_resv_reserve_fences() error
Dmitry Osipenko <[email protected]>
drm/virtio: Unlock reservations on virtio_gpu_object_shmem_init() error
Dmitry Osipenko <[email protected]>
drm/virtio: Check whether transferred 2D BO is shmem
Christian Marangi <[email protected]>
dmaengine: qcom-adm: fix wrong calling convention for prep_slave_sg
Christian Marangi <[email protected]>
dmaengine: qcom-adm: fix wrong sizeof config in slave_config
Dario Binacchi <[email protected]>
dmaengine: mxs: use platform_driver_register
Hamza Mahfooz <[email protected]>
Revert "drm/amdgpu: use dirty framebuffer helper"
Sagi Grimberg <[email protected]>
nvme-multipath: fix possible hang in live ns resize with ANA access
Gaosheng Cui <[email protected]>
nvmem: core: Fix memleak in nvmem_register()
Huacai Chen <[email protected]>
UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK
Fangrui Song <[email protected]>
riscv: Pass -mno-relax only on lld < 15.0.0
Wenting Zhang <[email protected]>
riscv: always honor the CONFIG_CMDLINE_FORCE when parsing dtb
Andrew Bresticker <[email protected]>
riscv: Make VM_WRITE imply VM_READ
Andrew Bresticker <[email protected]>
riscv: Allow PROT_WRITE-only mmap()
Jisheng Zhang <[email protected]>
riscv: vdso: fix NULL deference in vdso_join_timens() when vfork
Helge Deller <[email protected]>
parisc: Fix userspace graphics card breakage due to pgtable special bit
Helge Deller <[email protected]>
parisc: fbdev/stifb: Align graphics memory size to 4MB
Maciej W. Rozycki <[email protected]>
RISC-V: Make port I/O string accessors actually work
Palmer Dabbelt <[email protected]>
RISC-V: Re-enable counter access from userspace
Conor Dooley <[email protected]>
riscv: topology: fix default topology reporting
Conor Dooley <[email protected]>
arm64: topology: move store_cpu_topology() to shared code
Linus Walleij <[email protected]>
regulator: qcom_rpm: Fix circular deferral regression
Mika Westerberg <[email protected]>
net: thunderbolt: Enable DMA paths only after rings are enabled
Liang He <[email protected]>
hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API
Krzysztof Kozlowski <[email protected]>
ASoC: wcd934x: fix order of Slimbus unprepare/disable
Krzysztof Kozlowski <[email protected]>
ASoC: wcd9335: fix order of Slimbus unprepare/disable
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sdm845-mtp: correct ADC settle time
Patryk Duda <[email protected]>
platform/chrome: cros_ec_proto: Update version on GET_NEXT_EVENT failure
Zhihao Cheng <[email protected]>
quota: Check next/prev free block number after reading from quota file
Andri Yngvason <[email protected]>
HID: multitouch: Add memory barriers
Roberto Sassu <[email protected]>
btf: Export bpf_dynptr definition
Alexander Aring <[email protected]>
fs: dlm: fix invalid derefence of sb_lvbptr
Alexander Aring <[email protected]>
fs: dlm: handle -EBUSY first in lock arg validation
Alexander Aring <[email protected]>
fs: dlm: fix race between test_bit() and queue_work()
Jarkko Nikula <[email protected]>
i2c: designware: Fix handling of real but unexpected device interrupts
Wenchao Chen <[email protected]>
mmc: sdhci-sprd: Fix minimum clock limit
Prathamesh Shete <[email protected]>
mmc: sdhci-tegra: Use actual clock rate for SW tuning correction
Biju Das <[email protected]>
mmc: renesas_sdhi: Fix rounding errors
Anssi Hannula <[email protected]>
can: kvaser_usb_leaf: Fix CAN state after restart
Anssi Hannula <[email protected]>
can: kvaser_usb_leaf: Fix TX queue out of sync after restart
Anssi Hannula <[email protected]>
can: kvaser_usb_leaf: Fix overread with an invalid command
Anssi Hannula <[email protected]>
can: kvaser_usb: Fix use of uninitialized completion
Avri Altman <[email protected]>
mmc: core: Add SD card quirk for broken discard
Jean-Francois Le Fillatre <[email protected]>
usb: add quirks for Lenovo OneLink+ Dock
Nathan Chancellor <[email protected]>
usb: gadget: uvc: Fix argument to sizeof() in uvc_register_video()
Rafael Mendonca <[email protected]>
xhci: dbc: Fix memory leak in xhci_alloc_dbc()
Eddie James <[email protected]>
iio: pressure: dps310: Reset chip after timeout
Eddie James <[email protected]>
iio: pressure: dps310: Refactor startup procedure
Nuno Sá <[email protected]>
iio: adc: ad7923: fix channel readings for some variants
Uwe Kleine-König <[email protected]>
iio: ltc2497: Fix reading conversion results
Michael Hennerich <[email protected]>
iio: dac: ad5593r: Fix i2c read protocol requirements
Zhang Xiaoxu <[email protected]>
cifs: Fix the error length of VALIDATE_NEGOTIATE_INFO message
Ronnie Sahlberg <[email protected]>
cifs: destage dirty pages before re-reading them for cache=none
Gaurav Kohli <[email protected]>
hv_netvsc: Fix race between VF offering and VF association message from host
Pavel Begunkov <[email protected]>
io_uring: correct pinned_vm accounting
Pavel Begunkov <[email protected]>
io_uring/af_unix: defer registered files gc to io_uring release
Pavel Begunkov <[email protected]>
io_uring/net: don't update msg_name if not provided
Stefan Metzmacher <[email protected]>
io_uring/net: fix fast_iov assignment in io_setup_async_msg()
Pavel Begunkov <[email protected]>
io_uring/rw: fix unexpected link breakage
Tudor Ambarus <[email protected]>
mtd: rawnand: atmel: Unmap streaming DMA mappings
Saranya Gopal <[email protected]>
ALSA: hda/realtek: Add Intel Reference SSID to support headset keys
Luke D. Jones <[email protected]>
ALSA: hda/realtek: Add quirk for ASUS GV601R laptop
Luke D. Jones <[email protected]>
ALSA: hda/realtek: Correct pin configs for ASUS G533Z
Callum Osmotherly <[email protected]>
ALSA: hda/realtek: remove ALC289_FIXUP_DUAL_SPK for Dell 5530
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix NULL dererence at error path
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix potential memory leaks
Takashi Iwai <[email protected]>
ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free()
Takashi Iwai <[email protected]>
ALSA: oss: Fix potential deadlock at unregistration
Sasha Levin <[email protected]>
Revert "fs: check FMODE_LSEEK to control internal pipe splicing"
-------------
Diffstat:
Documentation/ABI/testing/sysfs-bus-iio | 2 +- Documentation/admin-guide/kernel-parameters.txt | 4 + Documentation/arm64/silicon-errata.rst | 2 + Documentation/filesystems/vfs.rst | 3 + Makefile | 4 +- arch/arm/Kconfig | 1 - arch/arm/boot/compressed/misc.c | 2 + arch/arm/boot/compressed/vmlinux.lds.S | 2 + arch/arm/boot/dts/armada-385-turris-omnia.dts | 4 +- arch/arm/boot/dts/exynos4412-midas.dtsi | 2 +- arch/arm/boot/dts/exynos4412-origen.dts | 2 +- arch/arm/boot/dts/imx6dl-riotboard.dts | 1 + arch/arm/boot/dts/imx6dl.dtsi | 3 + arch/arm/boot/dts/imx6q-arm2.dts | 1 + arch/arm/boot/dts/imx6q-evi.dts | 1 + arch/arm/boot/dts/imx6q-mccmon6.dts | 1 + arch/arm/boot/dts/imx6q.dtsi | 3 + arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi | 6 +- arch/arm/boot/dts/imx6qdl-nit6xlite.dtsi | 1 + arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi | 1 + arch/arm/boot/dts/imx6qdl-nitrogen6_som2.dtsi | 1 + arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi | 1 + arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 1 + arch/arm/boot/dts/imx6qdl-tqma6a.dtsi | 1 + arch/arm/boot/dts/imx6qdl-ts7970.dtsi | 1 + arch/arm/boot/dts/imx6qp.dtsi | 6 + arch/arm/boot/dts/imx6sl.dtsi | 23 +- arch/arm/boot/dts/imx6sll.dtsi | 3 + arch/arm/boot/dts/imx6sx-udoo-neo.dtsi | 14 +- arch/arm/boot/dts/imx6sx.dtsi | 6 + arch/arm/boot/dts/imx7d-sdb.dts | 7 +- arch/arm/boot/dts/kirkwood-lsxl.dtsi | 16 +- arch/arm/include/asm/stacktrace.h | 6 + arch/arm/kernel/return_address.c | 1 + arch/arm/kernel/stacktrace.c | 84 +++++-- arch/arm/lib/call_with_stack.S | 2 + arch/arm/mm/dump.c | 2 +- arch/arm/mm/kasan_init.c | 9 +- arch/arm/mm/mmu.c | 4 + arch/arm64/Kconfig | 17 ++ .../boot/dts/freescale/imx8mm-kontron-n801x-s.dts | 3 + .../dts/freescale/imx8mm-kontron-n801x-som.dtsi | 2 - arch/arm64/boot/dts/freescale/imx8mp.dtsi | 4 +- arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 1 + arch/arm64/boot/dts/qcom/sdm845-mtp.dts | 12 +- arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 8 +- arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 8 +- arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 8 +- .../boot/dts/ti/k3-j7200-common-proc-board.dts | 10 +- arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 11 +- arch/arm64/include/asm/mte.h | 5 + arch/arm64/kernel/cpu_errata.c | 5 + arch/arm64/kernel/cpufeature.c | 3 +- arch/arm64/kernel/ftrace.c | 17 +- arch/arm64/kernel/mte.c | 51 ++++ arch/arm64/kernel/suspend.c | 2 + arch/arm64/kernel/topology.c | 40 ---- arch/arm64/mm/proc.S | 46 +--- arch/ia64/mm/numa.c | 1 + arch/mips/bcm47xx/prom.c | 4 +- arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts | 6 +- arch/mips/sgi-ip27/ip27-xtalk.c | 70 ++++-- arch/mips/sgi-ip30/ip30-xtalk.c | 70 ++++-- arch/parisc/include/asm/pgtable.h | 7 +- arch/parisc/kernel/entry.S | 8 + arch/powerpc/Kconfig | 2 +- arch/powerpc/Makefile | 2 +- arch/powerpc/boot/Makefile | 1 + arch/powerpc/boot/dts/fsl/e500v1_power_isa.dtsi | 51 ++++ arch/powerpc/boot/dts/fsl/mpc8540ads.dts | 2 +- arch/powerpc/boot/dts/fsl/mpc8541cds.dts | 2 +- arch/powerpc/boot/dts/fsl/mpc8555cds.dts | 2 +- arch/powerpc/boot/dts/fsl/mpc8560ads.dts | 2 +- arch/powerpc/configs/pseries_defconfig | 1 + arch/powerpc/include/asm/syscalls.h | 12 + arch/powerpc/kernel/interrupt.c | 10 - arch/powerpc/kernel/interrupt_64.S | 45 +++- arch/powerpc/kernel/kprobes.c | 8 +- arch/powerpc/kernel/pci_dn.c | 1 + arch/powerpc/kernel/setup_64.c | 4 +- arch/powerpc/kernel/sys_ppc32.c | 14 +- arch/powerpc/kernel/syscalls.c | 4 +- arch/powerpc/math-emu/math_efp.c | 1 + arch/powerpc/platforms/powernv/opal.c | 1 + arch/powerpc/platforms/pseries/vas.c | 2 +- arch/powerpc/sysdev/fsl_msi.c | 2 + arch/riscv/Kconfig | 2 +- arch/riscv/Makefile | 2 + arch/riscv/include/asm/io.h | 16 +- arch/riscv/include/asm/mmu.h | 1 - arch/riscv/kernel/setup.c | 4 +- arch/riscv/kernel/smpboot.c | 3 +- arch/riscv/kernel/sys_riscv.c | 3 - arch/riscv/kernel/vdso.c | 13 +- arch/riscv/mm/fault.c | 3 +- arch/sh/include/asm/sections.h | 2 +- arch/sh/kernel/machvec.c | 10 +- arch/um/kernel/um_arch.c | 2 +- arch/x86/Kconfig | 7 +- arch/x86/include/asm/cpu.h | 2 + arch/x86/include/asm/hyperv-tlfs.h | 4 +- arch/x86/include/asm/microcode.h | 1 + arch/x86/include/asm/msr-index.h | 13 + arch/x86/include/asm/paravirt_types.h | 11 +- arch/x86/kernel/apic/apic.c | 44 +++- arch/x86/kernel/cpu/feat_ctl.c | 2 +- arch/x86/kernel/cpu/mce/apei.c | 13 +- arch/x86/kernel/cpu/microcode/amd.c | 3 +- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 12 +- arch/x86/kvm/emulate.c | 2 +- arch/x86/kvm/vmx/nested.c | 37 ++- arch/x86/kvm/vmx/vmx.c | 12 +- arch/x86/net/bpf_jit_comp.c | 16 +- arch/x86/xen/enlighten_pv.c | 3 +- block/bio.c | 2 - block/blk-mq.c | 6 +- block/blk-throttle.c | 28 +-- block/blk-throttle.h | 2 +- block/blk-wbt.c | 10 +- block/blk.h | 3 +- block/elevator.c | 4 +- crypto/akcipher.c | 8 + drivers/acpi/acpi_fpdt.c | 22 ++ drivers/acpi/acpi_pcc.c | 28 ++- drivers/acpi/acpi_video.c | 16 ++ drivers/acpi/apei/ghes.c | 2 +- drivers/acpi/x86/utils.c | 19 +- drivers/ata/libahci_platform.c | 14 +- drivers/base/arch_topology.c | 19 ++ drivers/block/nbd.c | 6 +- drivers/bluetooth/btintel.c | 17 +- drivers/bluetooth/btusb.c | 14 ++ drivers/bluetooth/hci_ldisc.c | 7 +- drivers/bluetooth/hci_serdev.c | 10 +- drivers/char/hw_random/arm_smccc_trng.c | 4 +- drivers/char/hw_random/core.c | 19 +- drivers/char/hw_random/imx-rngc.c | 14 +- drivers/char/random.c | 4 +- drivers/clk/baikal-t1/ccu-div.c | 65 +++++ drivers/clk/baikal-t1/ccu-div.h | 10 + drivers/clk/baikal-t1/clk-ccu-div.c | 26 +- drivers/clk/bcm/clk-bcm2835.c | 43 +++- drivers/clk/berlin/bg2.c | 5 +- drivers/clk/berlin/bg2q.c | 6 +- drivers/clk/clk-ast2600.c | 2 +- drivers/clk/clk-oxnas.c | 6 +- drivers/clk/clk-qoriq.c | 10 +- drivers/clk/clk-versaclock5.c | 2 +- drivers/clk/imx/clk-scu.c | 6 +- drivers/clk/mediatek/clk-mt8183-mfgcfg.c | 6 +- drivers/clk/mediatek/clk-mt8195-infra_ao.c | 13 +- drivers/clk/mediatek/clk-mt8195-mfg.c | 6 +- drivers/clk/mediatek/clk-mt8195-vdo0.c | 7 +- drivers/clk/mediatek/clk-mt8195-vdo1.c | 6 +- drivers/clk/mediatek/clk-mtk.c | 12 +- drivers/clk/meson/meson-aoclk.c | 5 +- drivers/clk/meson/meson-eeclk.c | 5 +- drivers/clk/meson/meson8b.c | 5 +- drivers/clk/qcom/Kconfig | 1 + drivers/clk/qcom/apss-ipq6018.c | 2 +- drivers/clk/qcom/gcc-sdm660.c | 2 +- drivers/clk/qcom/gcc-sm6115.c | 46 ++-- drivers/clk/samsung/clk-exynosautov9.c | 20 +- drivers/clk/sprd/common.c | 9 +- drivers/clk/st/clkgen-fsyn.c | 5 +- drivers/clk/st/clkgen-mux.c | 5 +- drivers/clk/tegra/clk-tegra114.c | 1 + drivers/clk/tegra/clk-tegra20.c | 1 + drivers/clk/tegra/clk-tegra210.c | 1 + drivers/clk/ti/clk-dra7-atl.c | 9 +- drivers/clk/ti/clk.c | 5 +- drivers/clk/zynqmp/clkc.c | 7 + drivers/clk/zynqmp/pll.c | 31 ++- drivers/clocksource/arm_arch_timer.c | 6 +- drivers/clocksource/timer-gxp.c | 7 +- drivers/cpufreq/amd-pstate.c | 16 +- drivers/cpufreq/intel_pstate.c | 1 + drivers/cpufreq/qcom-cpufreq-hw.c | 10 +- drivers/cpuidle/cpuidle-riscv-sbi.c | 7 +- drivers/crypto/cavium/cpt/cptpf_main.c | 6 +- drivers/crypto/ccp/ccp-dmaengine.c | 6 +- drivers/crypto/ccp/sev-dev.c | 26 +- drivers/crypto/hisilicon/qm.c | 6 +- drivers/crypto/hisilicon/zip/zip_crypto.c | 4 +- drivers/crypto/inside-secure/safexcel_hash.c | 8 +- drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c | 18 +- drivers/crypto/qat/qat_common/adf_gen4_hw_data.h | 2 +- drivers/crypto/qat/qat_common/qat_algs.c | 18 +- drivers/crypto/sahara.c | 18 +- drivers/dma-buf/udmabuf.c | 9 +- drivers/dma/hisi_dma.c | 28 +-- drivers/dma/idxd/irq.c | 2 - drivers/dma/ioat/dma.c | 6 +- drivers/dma/mxs-dma.c | 11 +- drivers/dma/qcom/qcom_adm.c | 22 +- drivers/dma/ti/k3-udma.c | 25 +- drivers/firmware/efi/libstub/fdt.c | 8 - drivers/firmware/google/gsmi.c | 9 + drivers/fpga/dfl.c | 2 +- drivers/fsi/fsi-core.c | 3 + drivers/fsi/fsi-master-ast-cf.c | 2 + drivers/fsi/fsi-occ.c | 18 +- drivers/gpio/gpio-rockchip.c | 7 + drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 14 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 9 +- drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c | 10 +- drivers/gpu/drm/amd/amdgpu/soc21.c | 4 + .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 45 ++-- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 67 +++--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 8 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 16 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 6 +- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 35 +-- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h | 3 +- .../display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c | 6 +- .../gpu/drm/amd/display/dc/dml/calcs/bw_fixed.c | 6 +- drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 8 +- drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 4 +- drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 21 +- drivers/gpu/drm/arm/display/komeda/komeda_kms.h | 2 + drivers/gpu/drm/bridge/adv7511/adv7511.h | 5 +- drivers/gpu/drm/bridge/adv7511/adv7511_cec.c | 4 +- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 5 +- drivers/gpu/drm/bridge/ite-it6505.c | 5 +- drivers/gpu/drm/bridge/lontium-lt9611.c | 3 +- .../drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 4 +- drivers/gpu/drm/bridge/parade-ps8640.c | 4 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 13 +- drivers/gpu/drm/bridge/tc358767.c | 5 +- drivers/gpu/drm/display/drm_dp_helper.c | 9 - drivers/gpu/drm/display/drm_dp_mst_topology.c | 6 +- drivers/gpu/drm/drm_bridge.c | 4 +- drivers/gpu/drm/drm_ioctl.c | 8 +- drivers/gpu/drm/drm_mipi_dsi.c | 1 + drivers/gpu/drm/drm_panel_orientation_quirks.c | 18 ++ drivers/gpu/drm/i915/display/intel_bios.c | 110 ++++----- drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 16 +- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 58 ++--- drivers/gpu/drm/i915/gt/intel_gtt.c | 3 + drivers/gpu/drm/i915/intel_pm.c | 16 +- drivers/gpu/drm/meson/meson_drv.c | 14 +- drivers/gpu/drm/meson/meson_drv.h | 7 + drivers/gpu/drm/meson/meson_encoder_cvbs.c | 13 + drivers/gpu/drm/meson/meson_encoder_cvbs.h | 1 + drivers/gpu/drm/meson/meson_encoder_hdmi.c | 13 + drivers/gpu/drm/meson/meson_encoder_hdmi.h | 1 + drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 19 +- drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c | 29 +-- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 9 +- drivers/gpu/drm/msm/dp/dp_catalog.c | 2 +- drivers/gpu/drm/msm/msm_drv.c | 13 +- drivers/gpu/drm/msm/msm_drv.h | 2 + drivers/gpu/drm/msm/msm_io_utils.c | 22 ++ drivers/gpu/drm/nouveau/nouveau_bo.c | 4 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +- drivers/gpu/drm/nouveau/nouveau_prime.c | 1 - drivers/gpu/drm/omapdrm/dss/dss.c | 3 + drivers/gpu/drm/pl111/pl111_versatile.c | 1 + drivers/gpu/drm/tiny/bochs.c | 2 + drivers/gpu/drm/udl/udl_modeset.c | 3 - drivers/gpu/drm/vc4/vc4_vec.c | 4 +- drivers/gpu/drm/virtio/virtgpu_display.c | 2 + drivers/gpu/drm/virtio/virtgpu_gem.c | 4 +- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 +- drivers/gpu/drm/virtio/virtgpu_object.c | 3 + drivers/gpu/drm/virtio/virtgpu_plane.c | 6 +- drivers/gpu/drm/virtio/virtgpu_vq.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 1 + drivers/hid/hid-multitouch.c | 8 +- drivers/hid/hid-nintendo.c | 55 +++-- drivers/hid/hid-roccat.c | 4 + drivers/hid/hid-uclogic-core.c | 1 + drivers/hsi/clients/ssi_protocol.c | 1 + drivers/hsi/controllers/omap_ssi_core.c | 1 + drivers/hsi/controllers/omap_ssi_port.c | 8 +- drivers/hwmon/gsc-hwmon.c | 1 + drivers/hwmon/occ/p9_sbe.c | 17 +- drivers/hwmon/pmbus/mp2888.c | 13 +- drivers/hwmon/sht4x.c | 2 +- drivers/i2c/busses/i2c-designware-core.h | 7 +- drivers/i2c/busses/i2c-designware-master.c | 13 + drivers/i2c/busses/i2c-designware-pcidrv.c | 30 +-- drivers/i2c/busses/i2c-mlxbf.c | 44 +++- drivers/iio/adc/ad7923.c | 4 +- drivers/iio/adc/at91-sama5d2_adc.c | 28 ++- drivers/iio/adc/ltc2497.c | 13 + drivers/iio/dac/ad5593r.c | 46 ++-- drivers/iio/inkern.c | 8 +- drivers/iio/magnetometer/yamaha-yas530.c | 2 +- drivers/iio/pressure/dps310.c | 262 +++++++++++++-------- drivers/infiniband/core/cm.c | 14 +- drivers/infiniband/core/uverbs_cmd.c | 5 +- drivers/infiniband/core/verbs.c | 2 + drivers/infiniband/hw/hns/hns_roce_mr.c | 1 - drivers/infiniband/hw/irdma/defs.h | 1 + drivers/infiniband/hw/irdma/hw.c | 51 ++-- drivers/infiniband/hw/irdma/type.h | 1 + drivers/infiniband/hw/irdma/user.h | 1 + drivers/infiniband/hw/irdma/utils.c | 3 + drivers/infiniband/hw/irdma/verbs.c | 69 +++++- drivers/infiniband/hw/mlx4/mr.c | 1 - drivers/infiniband/hw/mlx5/main.c | 3 + drivers/infiniband/hw/mlx5/odp.c | 3 +- drivers/infiniband/sw/rxe/rxe_qp.c | 10 +- drivers/infiniband/sw/rxe/rxe_queue.c | 12 +- drivers/infiniband/sw/rxe/rxe_resp.c | 10 +- drivers/infiniband/sw/siw/siw.h | 1 + drivers/infiniband/sw/siw/siw_qp.c | 2 +- drivers/infiniband/sw/siw/siw_qp_rx.c | 27 ++- drivers/infiniband/sw/siw/siw_verbs.c | 3 + drivers/infiniband/ulp/srp/ib_srp.c | 4 +- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 21 ++ drivers/iommu/omap-iommu-debug.c | 6 +- drivers/isdn/mISDN/l1oip.h | 1 + drivers/isdn/mISDN/l1oip_core.c | 13 +- drivers/leds/flash/leds-lm3601x.c | 2 - drivers/mailbox/bcm-flexrm-mailbox.c | 8 +- drivers/mailbox/mailbox-mpfs.c | 25 +- drivers/md/bcache/writeback.c | 73 ++++-- drivers/md/raid0.c | 2 +- drivers/md/raid5.c | 15 +- drivers/media/pci/cx88/cx88-vbi.c | 9 +- drivers/media/pci/cx88/cx88-video.c | 43 ++-- drivers/media/platform/amlogic/meson-ge2d/ge2d.c | 1 - drivers/media/platform/amphion/vdec.c | 16 +- drivers/media/platform/amphion/venc.c | 2 +- drivers/media/platform/amphion/vpu.h | 1 - drivers/media/platform/amphion/vpu_core.c | 84 +++---- drivers/media/platform/amphion/vpu_core.h | 1 + drivers/media/platform/amphion/vpu_dbg.c | 9 +- drivers/media/platform/amphion/vpu_malone.c | 2 +- .../media/platform/mediatek/jpeg/mtk_jpeg_core.c | 1 - .../media/platform/samsung/exynos4-is/fimc-is.c | 1 + drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c | 3 +- drivers/media/platform/xilinx/xilinx-vipp.c | 9 +- drivers/media/usb/uvc/uvc_ctrl.c | 83 ++++--- drivers/media/usb/uvc/uvc_driver.c | 8 +- drivers/memory/of_memory.c | 2 + drivers/memory/pl353-smc.c | 1 + drivers/mfd/da9062-core.c | 1 + drivers/mfd/fsl-imx25-tsadc.c | 34 ++- drivers/mfd/intel_soc_pmic_core.c | 1 + drivers/mfd/lp8788-irq.c | 3 + drivers/mfd/lp8788.c | 12 +- drivers/mfd/sm501.c | 7 +- drivers/misc/ocxl/file.c | 2 + drivers/mmc/core/block.c | 6 +- drivers/mmc/core/card.h | 6 + drivers/mmc/core/quirks.h | 6 + drivers/mmc/host/au1xmmc.c | 3 +- drivers/mmc/host/renesas_sdhi_core.c | 21 +- drivers/mmc/host/sdhci-sprd.c | 2 +- drivers/mmc/host/sdhci-tegra.c | 2 +- drivers/mmc/host/wmt-sdmmc.c | 5 +- drivers/mtd/devices/docg3.c | 7 +- drivers/mtd/nand/raw/atmel/nand-controller.c | 1 + drivers/mtd/nand/raw/fsl_elbc_nand.c | 28 ++- drivers/mtd/nand/raw/intel-nand-controller.c | 12 +- drivers/mtd/nand/raw/meson_nand.c | 4 +- drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 2 + drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 3 +- drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 2 +- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 79 +++++++ drivers/net/ethernet/atheros/alx/main.c | 5 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 1 + drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 10 +- drivers/net/ethernet/engleder/tsnep_hw.h | 3 +- drivers/net/ethernet/freescale/fs_enet/mac-fec.c | 2 +- drivers/net/ethernet/intel/iavf/iavf_main.c | 177 +++++++++++--- drivers/net/ethernet/intel/ice/ice_ethtool.c | 1 + drivers/net/ethernet/marvell/mvpp2/mvpp2.h | 1 + drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c | 10 +- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 13 +- .../net/ethernet/marvell/prestera/prestera_acl.c | 8 +- .../net/ethernet/marvell/prestera/prestera_acl.h | 4 +- .../ethernet/marvell/prestera/prestera_flower.c | 6 +- drivers/net/ethernet/microchip/lan743x_ptp.c | 7 + drivers/net/ethernet/sunplus/spl2sw_driver.c | 2 +- drivers/net/ethernet/ti/Kconfig | 1 + drivers/net/ethernet/ti/davinci_mdio.c | 242 ++++++++++++++++++- drivers/net/ethernet/xilinx/xilinx_axienet.h | 12 + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 37 ++- drivers/net/hyperv/hyperv_net.h | 3 +- drivers/net/hyperv/netvsc.c | 4 + drivers/net/hyperv/netvsc_drv.c | 19 ++ drivers/net/thunderbolt.c | 28 ++- drivers/net/usb/r8152.c | 4 +- drivers/net/wireless/ath/ath10k/core.c | 16 ++ drivers/net/wireless/ath/ath10k/htc.c | 11 +- drivers/net/wireless/ath/ath10k/hw.h | 2 + drivers/net/wireless/ath/ath10k/mac.c | 54 +++-- drivers/net/wireless/ath/ath11k/ahb.c | 58 ++++- drivers/net/wireless/ath/ath11k/core.c | 2 + drivers/net/wireless/ath/ath11k/dp_rx.c | 3 +- drivers/net/wireless/ath/ath11k/mac.c | 25 +- drivers/net/wireless/ath/ath11k/mhi.c | 17 +- drivers/net/wireless/ath/ath11k/peer.c | 30 ++- drivers/net/wireless/ath/ath11k/qmi.c | 38 ++- drivers/net/wireless/ath/ath11k/qmi.h | 10 +- drivers/net/wireless/ath/ath11k/wmi.c | 9 +- drivers/net/wireless/ath/ath11k/wmi.h | 2 +- drivers/net/wireless/ath/ath9k/htc_hst.c | 43 ++-- drivers/net/wireless/ath/ath9k/rng.c | 3 +- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 3 +- .../net/wireless/broadcom/brcm80211/brcmfmac/pno.c | 12 +- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 4 + .../net/wireless/mediatek/mt76/mt76_connac_mcu.c | 6 +- .../net/wireless/mediatek/mt76/mt7915/debugfs.c | 6 +- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 10 +- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 10 +- drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 5 + drivers/net/wireless/mediatek/mt76/mt7921/main.c | 26 +- drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 15 +- drivers/net/wireless/mediatek/mt76/mt7921/sdio.c | 13 +- drivers/net/wireless/mediatek/mt76/mt7921/usb.c | 28 ++- drivers/net/wireless/mediatek/mt76/sdio.c | 8 +- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 34 ++- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 6 +- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 96 ++++++-- .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 9 +- drivers/net/wireless/realtek/rtw88/main.c | 8 +- drivers/net/wireless/realtek/rtw89/core.c | 1 + drivers/net/wireless/realtek/rtw89/fw.c | 12 +- drivers/net/wireless/realtek/rtw89/pci.c | 5 +- drivers/net/wireless/realtek/rtw89/ser.c | 3 + drivers/net/wireless/silabs/wfx/main.c | 2 +- drivers/net/wireless/st/cw1200/queue.c | 18 +- drivers/net/wwan/iosm/iosm_ipc_wwan.c | 5 +- drivers/nvme/host/core.c | 20 +- drivers/nvme/host/ioctl.c | 9 +- drivers/nvme/host/multipath.c | 1 + drivers/nvme/host/nvme.h | 4 +- drivers/nvme/target/passthru.c | 7 +- drivers/nvme/target/tcp.c | 11 +- drivers/nvmem/core.c | 15 +- drivers/pci/setup-res.c | 11 + drivers/perf/riscv_pmu_sbi.c | 7 +- .../phy/amlogic/phy-meson-axg-mipi-pcie-analog.c | 6 +- drivers/phy/mediatek/phy-mtk-tphy.c | 7 +- drivers/phy/qualcomm/phy-qcom-usb-hsic.c | 6 +- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 10 +- drivers/pinctrl/pinctrl-rockchip.c | 13 + drivers/platform/chrome/chromeos_laptop.c | 24 +- drivers/platform/chrome/cros_ec.c | 8 +- drivers/platform/chrome/cros_ec_chardev.c | 3 + drivers/platform/chrome/cros_ec_proto.c | 32 +++ drivers/platform/chrome/cros_ec_typec.c | 2 +- drivers/platform/x86/hp-wmi.c | 11 +- drivers/platform/x86/msi-laptop.c | 14 +- drivers/platform/x86/pmc_atom.c | 2 +- drivers/power/supply/adp5061.c | 6 +- drivers/powercap/intel_rapl_common.c | 4 +- drivers/regulator/core.c | 2 +- drivers/regulator/qcom_rpm-regulator.c | 24 +- drivers/remoteproc/remoteproc_core.c | 5 +- drivers/rpmsg/rpmsg_char.c | 4 +- drivers/scsi/3w-9xxx.c | 2 +- drivers/scsi/cxgbi/libcxgbi.c | 2 +- drivers/scsi/iscsi_tcp.c | 140 ++++++++--- drivers/scsi/iscsi_tcp.h | 5 + drivers/scsi/libiscsi.c | 41 +++- drivers/scsi/libsas/sas_expander.c | 2 +- drivers/scsi/lpfc/lpfc.h | 14 +- drivers/scsi/lpfc/lpfc_crtn.h | 8 + drivers/scsi/lpfc/lpfc_ct.c | 7 +- drivers/scsi/lpfc/lpfc_debugfs.c | 59 +---- drivers/scsi/lpfc/lpfc_debugfs.h | 2 +- drivers/scsi/lpfc/lpfc_init.c | 83 ++----- drivers/scsi/lpfc/lpfc_mem.c | 9 +- drivers/scsi/lpfc/lpfc_sli.c | 190 ++++++++++++++- drivers/scsi/pm8001/pm8001_hwi.c | 4 + drivers/scsi/qedf/qedf_main.c | 21 ++ drivers/slimbus/Kconfig | 3 +- drivers/slimbus/qcom-ngd-ctrl.c | 22 +- drivers/soc/qcom/smem_state.c | 3 +- drivers/soc/qcom/smsm.c | 20 +- drivers/soc/tegra/Kconfig | 1 - drivers/soundwire/cadence_master.c | 9 +- drivers/soundwire/intel.c | 1 - drivers/spi/spi-cadence-quadspi.c | 3 +- drivers/spi/spi-dw-bt1.c | 4 +- drivers/spi/spi-meson-spicc.c | 6 +- drivers/spi/spi-mt7621.c | 8 +- drivers/spi/spi-omap-100k.c | 1 + drivers/spi/spi-qup.c | 21 +- drivers/spi/spi-s3c64xx.c | 9 + drivers/spi/spi.c | 2 + drivers/spmi/spmi-pmic-arb.c | 13 +- drivers/staging/greybus/audio_helper.c | 11 - drivers/staging/media/meson/vdec/vdec_hevc.c | 6 +- drivers/staging/media/sunxi/cedrus/cedrus.c | 4 +- drivers/staging/media/sunxi/cedrus/cedrus_h265.c | 5 +- drivers/staging/rtl8723bs/core/rtw_cmd.c | 16 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 60 ++--- drivers/staging/vt6655/device_main.c | 8 +- drivers/thermal/cpufreq_cooling.c | 10 +- drivers/thermal/intel/intel_powerclamp.c | 6 +- drivers/thermal/qcom/tsens-v0_1.c | 2 +- drivers/thunderbolt/nhi.c | 49 +++- drivers/thunderbolt/switch.c | 24 ++ drivers/thunderbolt/tb.h | 1 + drivers/thunderbolt/tb_regs.h | 1 + drivers/thunderbolt/usb4.c | 20 ++ drivers/tty/serial/8250/8250_core.c | 16 +- drivers/tty/serial/8250/8250_pci.c | 5 + drivers/tty/serial/8250/8250_port.c | 18 +- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 22 +- drivers/tty/serial/fsl_lpuart.c | 2 + drivers/tty/serial/jsm/jsm_driver.c | 3 +- drivers/tty/serial/stm32-usart.c | 100 ++++---- drivers/tty/serial/xilinx_uartps.c | 2 + drivers/usb/common/debug.c | 96 +++++--- drivers/usb/core/quirks.c | 4 + drivers/usb/dwc3/core.c | 83 +++++-- drivers/usb/dwc3/core.h | 6 + drivers/usb/gadget/function/f_fs.c | 4 +- drivers/usb/gadget/function/f_printer.c | 12 +- drivers/usb/gadget/function/f_uvc.c | 6 +- drivers/usb/gadget/function/uvc.h | 1 + drivers/usb/gadget/function/uvc_v4l2.c | 2 +- drivers/usb/gadget/function/uvc_video.c | 9 +- drivers/usb/host/xhci-dbgcap.c | 2 +- drivers/usb/host/xhci-mem.c | 7 +- drivers/usb/host/xhci-plat.c | 18 +- drivers/usb/host/xhci.c | 3 +- drivers/usb/host/xhci.h | 1 + drivers/usb/misc/idmouse.c | 8 +- drivers/usb/mtu3/mtu3_core.c | 2 - drivers/usb/mtu3/mtu3_plat.c | 2 + drivers/usb/musb/musb_gadget.c | 3 + drivers/usb/storage/unusual_devs.h | 6 - drivers/usb/typec/ucsi/ucsi.c | 8 +- drivers/vhost/vsock.c | 2 +- drivers/video/fbdev/smscufx.c | 14 +- drivers/video/fbdev/stifb.c | 2 +- drivers/xen/gntdev-common.h | 3 +- drivers/xen/gntdev.c | 80 ++++--- fs/btrfs/block-group.c | 11 +- fs/btrfs/extent-tree.c | 3 + fs/btrfs/file.c | 59 ++++- fs/btrfs/free-space-cache.c | 59 +++-- fs/btrfs/qgroup.c | 15 ++ fs/btrfs/scrub.c | 69 ++++-- fs/btrfs/super.c | 20 +- fs/cifs/cifsproto.h | 2 +- fs/cifs/connect.c | 2 +- fs/cifs/file.c | 9 + fs/cifs/smb2ops.c | 23 +- fs/cifs/smb2pdu.c | 7 +- fs/cifs/smb2transport.c | 10 +- fs/dlm/ast.c | 6 +- fs/dlm/lock.c | 20 +- fs/dlm/lowcomms.c | 4 + fs/erofs/inode.c | 2 +- fs/erofs/super.c | 2 +- fs/eventfd.c | 10 +- fs/ext2/super.c | 22 +- fs/ext4/fast_commit.c | 40 ++-- fs/ext4/file.c | 6 + fs/ext4/inode.c | 17 +- fs/ext4/ioctl.c | 4 + fs/ext4/namei.c | 17 +- fs/ext4/resize.c | 2 +- fs/ext4/super.c | 47 ++-- fs/ext4/xattr.c | 1 + fs/f2fs/checkpoint.c | 47 +++- fs/f2fs/data.c | 4 +- fs/f2fs/extent_cache.c | 3 +- fs/f2fs/f2fs.h | 9 +- fs/f2fs/gc.c | 22 +- fs/f2fs/recovery.c | 23 +- fs/f2fs/segment.c | 2 +- fs/f2fs/super.c | 15 +- fs/file_table.c | 7 +- fs/fs-writeback.c | 37 ++- fs/internal.h | 10 + fs/iomap/buffered-io.c | 2 +- fs/jbd2/commit.c | 2 +- fs/jbd2/journal.c | 10 +- fs/jbd2/recovery.c | 1 + fs/jbd2/transaction.c | 6 +- fs/ksmbd/server.c | 4 +- fs/ksmbd/smb2pdu.c | 27 +-- fs/ksmbd/smb_common.c | 6 +- fs/nfsd/nfs3proc.c | 11 +- fs/nfsd/nfs4proc.c | 19 +- fs/nfsd/nfs4recover.c | 4 +- fs/nfsd/nfs4state.c | 5 + fs/nfsd/nfs4xdr.c | 14 +- fs/nfsd/nfsproc.c | 6 +- fs/nfsd/xdr4.h | 3 +- fs/ntfs3/inode.c | 2 - fs/ntfs3/xattr.c | 102 +------- fs/open.c | 11 +- fs/quota/quota_tree.c | 38 +++ fs/splice.c | 10 +- fs/userfaultfd.c | 4 +- fs/xfs/xfs_super.c | 10 +- include/dt-bindings/clock/samsung,exynosautov9.h | 56 ++--- include/linux/ata.h | 39 +-- include/linux/bio.h | 2 +- include/linux/blk_types.h | 2 +- include/linux/bpf-cgroup-defs.h | 4 +- include/linux/bpf-cgroup.h | 2 +- include/linux/bpf.h | 6 +- include/linux/bpf_verifier.h | 11 + include/linux/dynamic_debug.h | 11 +- include/linux/eventfd.h | 2 +- include/linux/export-internal.h | 6 +- include/linux/filter.h | 5 + include/linux/fortify-string.h | 3 +- include/linux/fs.h | 9 +- include/linux/hugetlb.h | 8 +- include/linux/hw_random.h | 3 + include/linux/iova.h | 2 +- include/linux/mmc/card.h | 1 + include/linux/once.h | 28 +++ include/linux/ring_buffer.h | 2 +- include/linux/sched.h | 2 +- include/linux/serial_8250.h | 1 + include/linux/serial_core.h | 3 +- include/linux/skbuff.h | 2 + include/linux/sunrpc/svc.h | 19 +- include/linux/tcp.h | 2 +- include/linux/trace.h | 36 ++- include/linux/trace_events.h | 1 + include/net/ieee802154_netdev.h | 12 +- include/net/tcp.h | 5 +- include/scsi/libiscsi.h | 6 +- include/uapi/rdma/mlx5-abi.h | 1 + io_uring/io_uring.c | 21 +- ipc/mqueue.c | 1 + kernel/auditsc.c | 4 +- kernel/bpf/bpf_local_storage.c | 4 +- kernel/bpf/bpf_task_storage.c | 8 +- kernel/bpf/btf.c | 2 +- kernel/bpf/cgroup.c | 76 +++--- kernel/bpf/core.c | 9 +- kernel/bpf/dispatcher.c | 27 ++- kernel/bpf/hashtab.c | 30 ++- kernel/bpf/helpers.c | 14 +- kernel/bpf/syscall.c | 4 +- kernel/bpf/trampoline.c | 8 +- kernel/bpf/verifier.c | 116 ++++----- kernel/cgroup/cgroup.c | 6 +- kernel/cgroup/cpuset.c | 18 +- kernel/livepatch/transition.c | 18 +- kernel/module/tracking.c | 3 + kernel/rcu/tree.c | 17 +- kernel/rcu/tree_plugin.h | 3 +- kernel/trace/bpf_trace.c | 20 +- kernel/trace/ftrace.c | 28 ++- kernel/trace/kprobe_event_gen_test.c | 49 +++- kernel/trace/ring_buffer.c | 87 ++++++- kernel/trace/trace.c | 76 +++++- kernel/trace/trace_eprobe.c | 60 +---- kernel/trace/trace_events_synth.c | 23 +- kernel/trace/trace_kprobe.c | 60 +---- kernel/trace/trace_osnoise.c | 3 +- kernel/trace/trace_probe_kernel.h | 115 +++++++++ lib/Kconfig.debug | 10 +- lib/dynamic_debug.c | 45 +--- lib/once.c | 30 +++ mm/damon/vaddr.c | 10 + mm/gup.c | 14 +- mm/hugetlb.c | 68 +++--- mm/memory.c | 2 + mm/mmap.c | 5 +- mm/mprotect.c | 2 + net/bluetooth/hci_core.c | 34 ++- net/bluetooth/hci_sync.c | 1 + net/bluetooth/hci_sysfs.c | 3 + net/bluetooth/l2cap_core.c | 17 +- net/bluetooth/rfcomm/sock.c | 3 + net/can/bcm.c | 7 +- net/core/flow_dissector.c | 4 +- net/core/skmsg.c | 12 +- net/core/stream.c | 3 +- net/ieee802154/socket.c | 4 + net/ipv4/datagram.c | 2 + net/ipv4/esp4_offload.c | 5 +- net/ipv4/inet_hashtables.c | 4 +- net/ipv4/netfilter/nft_fib_ipv4.c | 3 + net/ipv4/tcp.c | 16 +- net/ipv4/tcp_output.c | 19 +- net/ipv6/esp6_offload.c | 5 +- net/ipv6/netfilter/nft_fib_ipv6.c | 6 +- net/mac80211/cfg.c | 3 - net/netfilter/nf_conntrack_core.c | 18 +- net/openvswitch/datapath.c | 18 +- net/rds/tcp.c | 2 +- net/sctp/auth.c | 18 +- net/unix/af_unix.c | 13 +- net/unix/garbage.c | 20 ++ net/vmw_vsock/virtio_transport_common.c | 2 +- net/wireless/reg.c | 4 + net/xdp/xsk.c | 22 +- net/xdp/xsk_queue.h | 22 +- net/xfrm/xfrm_input.c | 18 +- net/xfrm/xfrm_ipcomp.c | 1 + scripts/Kbuild.include | 23 +- scripts/package/mkspec | 4 +- scripts/pahole-flags.sh | 4 + scripts/selinux/install_policy.sh | 2 +- security/integrity/ima/ima_appraise.c | 12 +- sound/core/pcm_dmaengine.c | 8 +- sound/core/rawmidi.c | 2 - sound/core/sound_oss.c | 13 +- sound/hda/intel-dsp-config.c | 5 + sound/pci/hda/hda_beep.c | 15 +- sound/pci/hda/hda_beep.h | 1 + sound/pci/hda/patch_hdmi.c | 6 - sound/pci/hda/patch_realtek.c | 11 +- sound/pci/hda/patch_sigmatel.c | 25 +- sound/soc/codecs/da7219.c | 5 +- sound/soc/codecs/lpass-tx-macro.c | 13 +- sound/soc/codecs/mt6359-accdet.c | 6 +- sound/soc/codecs/mt6660.c | 8 +- sound/soc/codecs/tas2764.c | 78 ++---- sound/soc/codecs/wcd9335.c | 2 +- sound/soc/codecs/wcd934x.c | 2 +- sound/soc/codecs/wm5102.c | 6 +- sound/soc/codecs/wm5110.c | 6 +- sound/soc/codecs/wm8997.c | 6 +- sound/soc/codecs/wm_adsp.c | 4 +- sound/soc/fsl/eukrea-tlv320.c | 8 +- sound/soc/sh/rcar/ctu.c | 6 +- sound/soc/sh/rcar/dvc.c | 6 +- sound/soc/sh/rcar/mix.c | 6 +- sound/soc/sh/rcar/src.c | 5 +- sound/soc/sh/rcar/ssi.c | 4 +- sound/soc/soc-pcm.c | 2 +- sound/soc/sof/intel/hda.c | 11 + sound/soc/sof/ipc3-topology.c | 7 + sound/soc/sof/mediatek/mt8195/mt8195.c | 1 + sound/soc/sof/sof-pci-dev.c | 2 +- sound/soc/sof/sof-priv.h | 4 + sound/soc/stm/stm32_adfsdm.c | 8 +- sound/soc/stm/stm32_i2s.c | 4 +- sound/soc/stm/stm32_spdifrx.c | 4 +- sound/usb/card.c | 32 ++- sound/usb/endpoint.c | 17 +- sound/usb/quirks.c | 42 ---- sound/usb/quirks.h | 2 - sound/usb/usbaudio.h | 1 + tools/bpf/bpftool/btf_dumper.c | 2 +- tools/bpf/bpftool/main.c | 10 + tools/lib/bpf/xsk.c | 6 +- tools/objtool/elf.c | 7 +- tools/perf/arch/x86/util/intel-pt.c | 2 +- tools/perf/util/intel-pt.c | 9 +- tools/perf/util/parse-events.c | 3 + tools/perf/util/pmu.c | 17 ++ tools/perf/util/pmu.h | 2 + tools/perf/util/pmu.l | 2 - tools/perf/util/pmu.y | 15 +- .../selftests/arm64/signal/testcases/testcases.c | 2 +- .../selftests/bpf/map_tests/array_map_batch_ops.c | 2 + .../selftests/bpf/map_tests/htab_map_batch_ops.c | 2 + .../bpf/map_tests/lpm_trie_map_batch_ops.c | 2 + tools/testing/selftests/bpf/progs/kprobe_multi.c | 4 +- tools/testing/selftests/bpf/test_maps.c | 24 +- tools/testing/selftests/bpf/xdpxceiver.c | 4 + tools/testing/selftests/net/fcnal-test.sh | 30 +++ tools/testing/selftests/net/nettest.c | 16 +- tools/testing/selftests/tpm2/tpm2.py | 4 + 768 files changed, 7191 insertions(+), 3390 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 31/717 can: kvaser_usb_leaf: Fix CAN state after restart
From: Anssi Hannula <[email protected]>
commit 0be1a655fe68c8e6dcadbcbddb69cf2fb29881f5 upstream.
can_restart() expects CMD_START_CHIP to set the error state to ERROR_ACTIVE as it calls netif_carrier_on() immediately afterwards.
Otherwise the user may immediately trigger restart again and hit a BUG_ON() in can_restart().
Fix kvaser_usb_leaf set_mode(CMD_START_CHIP) to set the expected state.
--- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +2 -0
@@ -1430,6 +1430,8 @@ static int kvaser_usb_leaf_set_mode(stru err =kvaser_usb_leaf_simple_cmd_async (priv,CMD_START_CHIP );if (err)return err; + + priv->can.state =CAN_STATE_ERROR_ACTIVE ;break ;default :return -EOPNOTSUPP ;
Greg Kroah-Hartman
maintainerPATCH 9/717 ALSA: hda/realtek: Add Intel Reference SSID to support headset keys
In reply to Greg Kroah-HartmanFrom: Saranya Gopal <[email protected]>
commit 4f2e56a59b9947b3e698d3cabcb858765c12b1e8 upstream.
This patch fixes the issue with 3.5mm headset keys on RPL-P platform.
[ Rearranged the entry in SSID order by tiwai ]
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -9398,6 +9398,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x10ec ,0x10f2 ,"Intel Reference board" ,ALC700_FIXUP_INTEL_REFERENCE ),SND_PCI_QUIRK (0x10ec ,0x118c ,"Medion EE4254 MD62100" ,ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE ),SND_PCI_QUIRK (0x10ec ,0x1230 ,"Intel Reference board" ,ALC295_FIXUP_CHROME_BOOK ), +SND_PCI_QUIRK (0x10ec ,0x124c ,"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),
Greg Kroah-Hartman
maintainerPATCH 40/717 HID: multitouch: Add memory barriers
In reply to Greg Kroah-HartmanFrom: Andri Yngvason <[email protected]>
commit be6e2b5734a425941fcdcdbd2a9337be498ce2cf upstream.
This fixes broken atomic checks which cause a race between the release-timer and processing of hid input.
I noticed that contacts were sometimes sticking, even with the "sticky fingers" quirk enabled. This fixes that problem.
--- drivers/hid/hid-multitouch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hid/hid-multitouch.c +4 -4
@@ -1186,7 +1186,7 @@ static void mt_touch_report(struct hid_dint contact_count =-1 ;/* sticky fingers release in progress, abort */ -if (test_and_set_bit (MT_IO_FLAGS_RUNNING , &td->mt_io_flags)) +if (test_and_set_bit_lock (MT_IO_FLAGS_RUNNING , &td->mt_io_flags))return ; scantime = *app->scantime;
@@ -1267,7 +1267,7 @@ static void mt_touch_report(struct hid_ddel_timer (&td->release_timer); } -clear_bit (MT_IO_FLAGS_RUNNING , &td->mt_io_flags); +clear_bit_unlock (MT_IO_FLAGS_RUNNING , &td->mt_io_flags); } static int mt_touch_input_configured(struct hid_device *hdev,
@@ -1699,11 +1699,11 @@ static void mt_expired_timeout(struct ti* An input report came in just before we release the sticky fingers, * it will take care of the sticky fingers. */ -if (test_and_set_bit (MT_IO_FLAGS_RUNNING , &td->mt_io_flags)) +if (test_and_set_bit_lock (MT_IO_FLAGS_RUNNING , &td->mt_io_flags))return ;if (test_bit (MT_IO_FLAGS_PENDING_SLOTS , &td->mt_io_flags))mt_release_contacts (hdev); -clear_bit (MT_IO_FLAGS_RUNNING , &td->mt_io_flags); +clear_bit_unlock (MT_IO_FLAGS_RUNNING , &td->mt_io_flags); }static int mt_probe (struct hid_device *hdev,const struct hid_device_id *id)
Greg Kroah-Hartman
maintainerPATCH 8/717 ALSA: hda/realtek: Add quirk for ASUS GV601R laptop
In reply to Greg Kroah-HartmanFrom: Luke D. Jones <[email protected]>
commit 2ea8e1297801f7b0220ebf6ae61a5b74ca83981e upstream.
The ASUS ROG X16 (GV601R) series laptop has the same node-to-DAC pairs as early models and the G14, this includes bass speakers which are by default mapped incorrectly to the 0x06 node.
Add a quirk to use the same DAC pairs as the G14.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -9376,6 +9376,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x1043 ,0x1e8e ,"ASUS Zephyrus G15" ,ALC289_FIXUP_ASUS_GA401 ),SND_PCI_QUIRK (0x1043 ,0x1c52 ,"ASUS Zephyrus G15 2022" ,ALC289_FIXUP_ASUS_GA401 ),SND_PCI_QUIRK (0x1043 ,0x1f11 ,"ASUS Zephyrus G14" ,ALC289_FIXUP_ASUS_GA401 ), +SND_PCI_QUIRK (0x1043 ,0x1f92 ,"ASUS ROG Flow X16" ,ALC289_FIXUP_ASUS_GA401 ),SND_PCI_QUIRK (0x1043 ,0x3030 ,"ASUS ZN270IE" ,ALC256_FIXUP_ASUS_AIO_GPIO2 ),SND_PCI_QUIRK (0x1043 ,0x831a ,"ASUS P901" ,ALC269_FIXUP_STEREO_DMIC ), SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
Greg Kroah-Hartman
maintainerPATCH 41/717 quota: Check next/prev free block number after reading from quota file
In reply to Greg Kroah-HartmanFrom: Zhihao Cheng <[email protected]>
commit 6c8ea8b8cd4722efd419f91ca46a2dc81b7d89a3 upstream.
Following process:
Init: v2_read_file_info: <3> dqi_free_blk 0 dqi_free_entry 5 dqi_blks 6
Step 1. chown bin f_a -> dquot_acquire -> v2_write_dquot:
qtree_write_dquot
do_insert_tree
find_free_dqentry
get_free_dqblk
write_blk(info->dqi_blocks) // info->dqi_blocks = 6, failure. The
content in physical block (corresponding to blk 6) is random.
Step 2. chown root f_a -> dquot_transfer -> dqput_all -> dqput ->
ext4_release_dquot -> v2_release_dquot -> qtree_delete_dquot:
dquot_release
remove_tree
free_dqentry
put_free_dqblk(6)
info->dqi_free_blk = blk // info->dqi_free_blk = 6Step 3. drop cache (buffer head for block 6 is released)
Step 4. chown bin f_b -> dquot_acquire -> commit_dqblk -> v2_write_dquot:
qtree_write_dquot
do_insert_tree
find_free_dqentry
get_free_dqblk
dh = (struct qt_disk_dqdbheader *)buf
blk = info->dqi_free_blk // 6
ret = read_blk(info, blk, buf) // The content of buf is random info->dqi_free_blk = le32_to_cpu(dh->dqdh_next_free) // random blk
Step 5. chown bin f_c -> notify_change -> ext4_setattr -> dquot_transfer:
dquot = dqget -> acquire_dquot -> ext4_acquire_dquot -> dquot_acquire ->
commit_dqblk -> v2_write_dquot -> dq_insert_tree:
do_insert_tree
find_free_dqentry
get_free_dqblk
blk = info->dqi_free_blk // If blk < 0 and blk is not an error
code, it will be returned as dquot
transfer_to[USRQUOTA] = dquot // A random negative value __dquot_transfer(transfer_to)
dquot_add_inodes(transfer_to[cnt])
spin_lock(&dquot->dq_dqb_lock) // page fault
, which will lead to kernel page fault:
Quota error (device sda): qtree_write_dquot: Error -8000 occurred while creating quota
BUG: unable to handle page fault for address: ffffffffffffe120 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page Oops: 0002 [#1] PREEMPT SMP CPU: 0 PID: 5974 Comm: chown Not tainted 6.0.0-rc1-00004 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:_raw_spin_lock+0x3a/0x90 Call Trace: dquot_add_inodes+0x28/0x270 __dquot_transfer+0x377/0x840 dquot_transfer+0xde/0x540 ext4_setattr+0x405/0x14d0 notify_change+0x68e/0x9f0 chown_common+0x300/0x430 __x64_sys_fchownat+0x29/0x40
In order to avoid accessing invalid quota memory address, this patch adds block number checking of next/prev free block read from quota file.
Fetch a reproducer in [Link].
--- fs/quota/quota_tree.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
fs/quota/quota_tree.c +38 -0
@@ -71,6 +71,35 @@ static ssize_t write_blk(struct qtree_mereturn ret; } +static inline int do_check_range (struct super_block *sb,const char *val_name, +uint val,uint min_val,uint max_val) +{ +if (val < min_val || val > max_val) { +quota_error (sb,"Getting %s %u out of range %u-%u" , + val_name, val, min_val, max_val); +return -EUCLEAN ; + } + +return 0 ; +} + +static int check_dquot_block_header (struct qtree_mem_dqinfo *info, +struct qt_disk_dqdbheader *dh) +{ +int err =0 ; + + err =do_check_range (info->dqi_sb,"dqdh_next_free" , +le32_to_cpu (dh->dqdh_next_free),0 , + info->dqi_blocks -1 ); +if (err) +return err; + err =do_check_range (info->dqi_sb,"dqdh_prev_free" , +le32_to_cpu (dh->dqdh_prev_free),0 , + info->dqi_blocks -1 ); + +return err; +} +/* Remove empty block from list and return it */ static int get_free_dqblk (struct qtree_mem_dqinfo *info) {
@@ -85,6 +114,9 @@ static int get_free_dqblk(struct qtree_m ret =read_blk (info, blk, buf);if (ret <0 ) goto out_buf; + ret =check_dquot_block_header (info, dh); +if (ret) + goto out_buf; info->dqi_free_blk =le32_to_cpu (dh->dqdh_next_free); }else {
@@ -232,6 +264,9 @@ static uint find_free_dqentry(struct qtr *err =read_blk (info, blk, buf);if (*err <0 ) goto out_buf; + *err =check_dquot_block_header (info, dh); +if (*err) + goto out_buf; }else { blk =get_free_dqblk (info);if ((int )blk <0 ) {
@@ -424,6 +459,9 @@ static int free_dqentry(struct qtree_mem goto out_buf; } dh = (struct qt_disk_dqdbheader *)buf; + ret =check_dquot_block_header (info, dh); +if (ret) + goto out_buf;le16_add_cpu (&dh->dqdh_entries,-1 );if (!le16_to_cpu (dh->dqdh_entries)) {/* Block got free? */ ret =remove_free_dqentry (info, buf, blk);
Greg Kroah-Hartman
maintainerPATCH 7/717 ALSA: hda/realtek: Correct pin configs for ASUS G533Z
In reply to Greg Kroah-HartmanFrom: Luke D. Jones <[email protected]>
commit 66ba7c88507344dee68ad1acbdb630473ab36114 upstream.
The initial fix for ASUS G533Z was based on faulty information. This fixes the pincfg to values that have been verified with no existing module options or other hacks enabled.
Enables headphone jack, and 5.1 surround.
[ corrected the indent level by tiwai ]
--- sound/pci/hda/patch_realtek.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
sound/pci/hda/patch_realtek.c +5 -3
@@ -8396,11 +8396,13 @@ static const struct hda_fixup alc269_fix [ALC285_FIXUP_ASUS_G533Z_PINS] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl []) { - {0x14 ,0x90170120 }, + {0x14 ,0x90170152 },/* Speaker Surround Playback Switch */ + {0x19 ,0x03a19020 },/* Mic Boost Volume */ + {0x1a ,0x03a11c30 },/* Mic Boost Volume */ + {0x1e ,0x90170151 },/* Rear jack, IN OUT EAPD Detect */ + {0x21 ,0x03211420 }, { } }, - .chained = true, - .chain_id = ALC294_FIXUP_ASUS_G513_PINS, }, [ALC294_FIXUP_ASUS_COEF_1B] = { .type = HDA_FIXUP_VERBS,
Greg Kroah-Hartman
maintainerPATCH 42/717 platform/chrome: cros_ec_proto: Update version on GET_NEXT_EVENT failure
In reply to Greg Kroah-HartmanFrom: Patryk Duda <[email protected]>
commit f74c7557ed0d321947e8bb4e9d47c1013f8b2227 upstream.
Some EC based devices (e.g. Fingerpint MCU) can jump to RO part of the firmware (intentionally or due to device reboot). The RO part doesn't change during the device lifecycle, so it won't support newer version of EC_CMD_GET_NEXT_EVENT command.
Function cros_ec_query_all() is responsible for finding maximum supported MKBP event version. It's usually called when the device is running RW part of the firmware, so the command version can be potentially higher than version supported by the RO.
The problem was fixed by updating maximum supported version when the device returns EC_RES_INVALID_VERSION (mapped to -ENOPROTOOPT). That way the kernel will use highest common version supported by RO and RW.
--- drivers/platform/chrome/cros_ec_proto.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
drivers/platform/chrome/cros_ec_proto.c +32 -0
@@ -750,6 +750,7 @@ int cros_ec_get_next_event(struct cros_eu8 event_type;u32 host_event;int ret; +u32 ver_mask;/* * Default value for wake_event.
@@ -771,6 +772,37 @@ int cros_ec_get_next_event(struct cros_ereturn get_keyboard_state_event (ec_dev); ret =get_next_event (ec_dev); +/* +* -ENOPROTOOPT is returned when EC returns EC_RES_INVALID_VERSION. +* This can occur when EC based device (e.g. Fingerprint MCU) jumps to +* the RO image which doesn't support newer version of the command. In +* this case we will attempt to update maximum supported version of the +* EC_CMD_GET_NEXT_EVENT. +*/ +if (ret == -ENOPROTOOPT ) { +dev_dbg (ec_dev->dev, +"GET_NEXT_EVENT returned invalid version error.\n" ); + ret =cros_ec_get_host_command_version_mask (ec_dev, +EC_CMD_GET_NEXT_EVENT , + &ver_mask); +if (ret <0 || ver_mask ==0 ) +/* +* Do not change the MKBP supported version if we can't +* obtain supported version correctly. Please note that +* calling EC_CMD_GET_NEXT_EVENT returned +* EC_RES_INVALID_VERSION which means that the command +* is present. +*/ +return -ENOPROTOOPT ; + + ec_dev->mkbp_event_supported =fls (ver_mask); +dev_dbg (ec_dev->dev,"MKBP support version changed to %u\n" , + ec_dev->mkbp_event_supported -1 ); + +/* Try to get next event with new MKBP support version set. */ + ret =get_next_event (ec_dev); + } +if (ret <=0 )return ret;
Greg Kroah-Hartman
maintainerPATCH 44/717 ASoC: wcd9335: fix order of Slimbus unprepare/disable
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit ea8ef003aa53ad23e7705c5cab1c4e664faa6c79 upstream.
Slimbus streams are first prepared and then enabled, so the cleanup path should reverse it. The unprepare sets stream->num_ports to 0 and frees the stream->ports. Calling disable after unprepare was not really effective (channels was not deactivated) and could lead to further issues due to making transfers on unprepared stream.
--- sound/soc/codecs/wcd9335.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wcd9335.c +1 -1
@@ -1983,8 +1983,8 @@ static int wcd9335_trigger(struct snd_pccase SNDRV_PCM_TRIGGER_STOP :case SNDRV_PCM_TRIGGER_SUSPEND :case SNDRV_PCM_TRIGGER_PAUSE_PUSH : -slim_stream_unprepare (dai_data->sruntime);slim_stream_disable (dai_data->sruntime); +slim_stream_unprepare (dai_data->sruntime);break ;default :break ;
Greg Kroah-Hartman
maintainerPATCH 43/717 arm64: dts: qcom: sdm845-mtp: correct ADC settle time
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 209a04885ab5f76722a1671d0fbf0a5b4bccacec upstream.
The PMIC's VADC property for settle time is qcom,hw-settle-time, not qcom,hw-settle-time-us. The latter is used in PMIC's TM ADC.
qcom/sdm845-mtp.dtb: pmic@0: adc@3100:adc-chan@4c: 'qcom,hw-settle-time-us' does not match any of the regexes: 'pinctrl-[0-9]+'
--- arch/arm64/boot/dts/qcom/sdm845-mtp.dts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-mtp.dts +6 -6
@@ -536,42 +536,42 @@ reg = <ADC5_XO_THERM_100K_PU>; label = "xo_therm"; qcom,ratiometric; - qcom,hw-settle-time-us = <200>; + qcom,hw-settle-time = <200>; }; adc-chan@4d { reg = <ADC5_AMUX_THM1_100K_PU>; label = "msm_therm"; qcom,ratiometric; - qcom,hw-settle-time-us = <200>; + qcom,hw-settle-time = <200>; }; adc-chan@4f { reg = <ADC5_AMUX_THM3_100K_PU>; label = "pa_therm1"; qcom,ratiometric; - qcom,hw-settle-time-us = <200>; + qcom,hw-settle-time = <200>; }; adc-chan@51 { reg = <ADC5_AMUX_THM5_100K_PU>; label = "quiet_therm"; qcom,ratiometric; - qcom,hw-settle-time-us = <200>; + qcom,hw-settle-time = <200>; }; adc-chan@83 { reg = <ADC5_VPH_PWR>; label = "vph_pwr"; qcom,ratiometric; - qcom,hw-settle-time-us = <200>; + qcom,hw-settle-time = <200>; }; adc-chan@85 { reg = <ADC5_VCOIN>; label = "vcoin"; qcom,ratiometric; - qcom,hw-settle-time-us = <200>; + qcom,hw-settle-time = <200>; }; };
Greg Kroah-Hartman
maintainerPATCH 45/717 ASoC: wcd934x: fix order of Slimbus unprepare/disable
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit e96bca7eaa5747633ec638b065630ff83728982a upstream.
Slimbus streams are first prepared and then enabled, so the cleanup path should reverse it. The unprepare sets stream->num_ports to 0 and frees the stream->ports. Calling disable after unprepare was not really effective (channels was not deactivated) and could lead to further issues due to making transfers on unprepared stream.
--- sound/soc/codecs/wcd934x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wcd934x.c +1 -1
@@ -1913,8 +1913,8 @@ static int wcd934x_trigger(struct snd_pccase SNDRV_PCM_TRIGGER_STOP :case SNDRV_PCM_TRIGGER_SUSPEND :case SNDRV_PCM_TRIGGER_PAUSE_PUSH : -slim_stream_unprepare (dai_data->sruntime);slim_stream_disable (dai_data->sruntime); +slim_stream_unprepare (dai_data->sruntime);break ;default :break ;
Greg Kroah-Hartman
maintainerPATCH 46/717 hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
commit 7f62cf781e6567d59c8935dc8c6068ce2bb904b7 upstream.
In gsc_hwmon_get_devtree_pdata(), we should call of_node_get() before the of_find_compatible_node() which will automatically call of_node_put() for the 'from' argument.
--- drivers/hwmon/gsc-hwmon.c | 1 + 1 file changed, 1 insertion(+)
drivers/hwmon/gsc-hwmon.c +1 -0
@@ -267,6 +267,7 @@ gsc_hwmon_get_devtree_pdata(struct devic pdata->nchannels = nchannels;/* fan controller base address */ +of_node_get (dev->parent->of_node); fan =of_find_compatible_node (dev->parent->of_node,NULL ,"gw,gsc-fan" );if (fan &&of_property_read_u32 (fan,"reg" , &pdata->fan_base)) {dev_err (dev,"fan node without base\n" );
Greg Kroah-Hartman
maintainerPATCH 47/717 net: thunderbolt: Enable DMA paths only after rings are enabled
In reply to Greg Kroah-HartmanFrom: Mika Westerberg <[email protected]>
commit ff7cd07f306406493f7b78890475e85b6d0811ed upstream.
If the other host starts sending packets early on it is possible that we are still in the middle of populating the initial Rx ring packets to the ring. This causes the tbnet_poll() to mess over the queue and causes list corruption. This happens specifically when connected with macOS as it seems start sending various IP discovery packets as soon as its side of the paths are configured.
To prevent this we move the DMA path enabling to happen after we have primed the Rx ring. This makes sure no incoming packets can arrive before we are ready to handle them.
--- drivers/net/thunderbolt.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-)
drivers/net/thunderbolt.c +17 -11
@@ -612,18 +612,13 @@ static void tbnet_connected_work(structreturn ; } -/* Both logins successful so enable the high-speed DMA paths and -* start the network device queue. +/* Both logins successful so enable the rings, high-speed DMA +* paths and start the network device queue. +* +* Note we enable the DMA paths last to make sure we have primed +* the Rx ring before any incoming packets are allowed to +* arrive. */ - ret =tb_xdomain_enable_paths (net->xd, net->local_transmit_path, - net->rx_ring.ring->hop, - net->remote_transmit_path, - net->tx_ring.ring->hop); -if (ret) { -netdev_err (net->dev,"failed to enable DMA paths\n" ); -return ; - } -tb_ring_start (net->tx_ring.ring);tb_ring_start (net->rx_ring.ring);
@@ -635,10 +630,21 @@ static void tbnet_connected_work(structif (ret) goto err_free_rx_buffers; + ret =tb_xdomain_enable_paths (net->xd, net->local_transmit_path, + net->rx_ring.ring->hop, + net->remote_transmit_path, + net->tx_ring.ring->hop); +if (ret) { +netdev_err (net->dev,"failed to enable DMA paths\n" ); + goto err_free_tx_buffers; + } +netif_carrier_on (net->dev);netif_start_queue (net->dev);return ; +err_free_tx_buffers: +tbnet_free_buffers (&net->tx_ring); err_free_rx_buffers:tbnet_free_buffers (&net->rx_ring); err_stop_rings:
Greg Kroah-Hartman
maintainerPATCH 48/717 regulator: qcom_rpm: Fix circular deferral regression
In reply to Greg Kroah-HartmanFrom: Linus Walleij <[email protected]>
commit 8478ed5844588703a1a4c96a004b1525fbdbdd5e upstream.
On recent kernels, the PM8058 L16 (or any other PM8058 LDO-regulator) does not come up if they are supplied by an SMPS-regulator. This is not very strange since the regulators are registered in a long array and the L-regulators are registered before the S-regulators, and if an L-regulator defers, it will never get around to registering the S-regulator that it needs.
See arch/arm/boot/dts/qcom-apq8060-dragonboard.dts:
pm8058-regulators {
(...)
vdd_l13_l16-supply = <&pm8058_s4>;
(...)Ooops.
Fix this by moving the PM8058 S-regulators first in the array.
Do the same for the PM8901 S-regulators (though this is currently not causing any problems with out device trees) so that the pattern of registration order is the same on all PMnnnn chips.
--- drivers/regulator/qcom_rpm-regulator.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/regulator/qcom_rpm-regulator.c +12 -12
@@ -802,6 +802,12 @@ static const struct rpm_regulator_data r };static const struct rpm_regulator_data rpm_pm8058_regulators[] = { + {"s0" ,QCOM_RPM_PM8058_SMPS0 , &pm8058_smps,"vdd_s0" }, + {"s1" ,QCOM_RPM_PM8058_SMPS1 , &pm8058_smps,"vdd_s1" }, + {"s2" ,QCOM_RPM_PM8058_SMPS2 , &pm8058_smps,"vdd_s2" }, + {"s3" ,QCOM_RPM_PM8058_SMPS3 , &pm8058_smps,"vdd_s3" }, + {"s4" ,QCOM_RPM_PM8058_SMPS4 , &pm8058_smps,"vdd_s4" }, + {"l0" ,QCOM_RPM_PM8058_LDO0 , &pm8058_nldo,"vdd_l0_l1_lvs" }, {"l1" ,QCOM_RPM_PM8058_LDO1 , &pm8058_nldo,"vdd_l0_l1_lvs" }, {"l2" ,QCOM_RPM_PM8058_LDO2 , &pm8058_pldo,"vdd_l2_l11_l12" },
@@ -829,12 +835,6 @@ static const struct rpm_regulator_data r { "l24", QCOM_RPM_PM8058_LDO24, &pm8058_nldo, "vdd_l23_l24_l25" }, { "l25", QCOM_RPM_PM8058_LDO25, &pm8058_nldo, "vdd_l23_l24_l25" }, - { "s0", QCOM_RPM_PM8058_SMPS0, &pm8058_smps, "vdd_s0" }, - { "s1", QCOM_RPM_PM8058_SMPS1, &pm8058_smps, "vdd_s1" }, - { "s2", QCOM_RPM_PM8058_SMPS2, &pm8058_smps, "vdd_s2" }, - { "s3", QCOM_RPM_PM8058_SMPS3, &pm8058_smps, "vdd_s3" }, - { "s4", QCOM_RPM_PM8058_SMPS4, &pm8058_smps, "vdd_s4" }, - { "lvs0", QCOM_RPM_PM8058_LVS0, &pm8058_switch, "vdd_l0_l1_lvs" }, { "lvs1", QCOM_RPM_PM8058_LVS1, &pm8058_switch, "vdd_l0_l1_lvs" },
@@ -843,6 +843,12 @@ static const struct rpm_regulator_data r };static const struct rpm_regulator_data rpm_pm8901_regulators[] = { + {"s0" ,QCOM_RPM_PM8901_SMPS0 , &pm8901_ftsmps,"vdd_s0" }, + {"s1" ,QCOM_RPM_PM8901_SMPS1 , &pm8901_ftsmps,"vdd_s1" }, + {"s2" ,QCOM_RPM_PM8901_SMPS2 , &pm8901_ftsmps,"vdd_s2" }, + {"s3" ,QCOM_RPM_PM8901_SMPS3 , &pm8901_ftsmps,"vdd_s3" }, + {"s4" ,QCOM_RPM_PM8901_SMPS4 , &pm8901_ftsmps,"vdd_s4" }, + {"l0" ,QCOM_RPM_PM8901_LDO0 , &pm8901_nldo,"vdd_l0" }, {"l1" ,QCOM_RPM_PM8901_LDO1 , &pm8901_pldo,"vdd_l1" }, {"l2" ,QCOM_RPM_PM8901_LDO2 , &pm8901_pldo,"vdd_l2" },
@@ -851,12 +857,6 @@ static const struct rpm_regulator_data r { "l5", QCOM_RPM_PM8901_LDO5, &pm8901_pldo, "vdd_l5" }, { "l6", QCOM_RPM_PM8901_LDO6, &pm8901_pldo, "vdd_l6" }, - { "s0", QCOM_RPM_PM8901_SMPS0, &pm8901_ftsmps, "vdd_s0" }, - { "s1", QCOM_RPM_PM8901_SMPS1, &pm8901_ftsmps, "vdd_s1" }, - { "s2", QCOM_RPM_PM8901_SMPS2, &pm8901_ftsmps, "vdd_s2" }, - { "s3", QCOM_RPM_PM8901_SMPS3, &pm8901_ftsmps, "vdd_s3" }, - { "s4", QCOM_RPM_PM8901_SMPS4, &pm8901_ftsmps, "vdd_s4" }, - { "lvs0", QCOM_RPM_PM8901_LVS0, &pm8901_switch, "lvs0_in" }, { "lvs1", QCOM_RPM_PM8901_LVS1, &pm8901_switch, "lvs1_in" }, { "lvs2", QCOM_RPM_PM8901_LVS2, &pm8901_switch, "lvs2_in" },
Greg Kroah-Hartman
maintainerPATCH 32/717 mmc: renesas_sdhi: Fix rounding errors
In reply to Greg Kroah-HartmanFrom: Biju Das <[email protected]>
commit f0c00454bf78975925eccc9737faaa4d4951edbf upstream.
Due to clk rounding errors on RZ/G2L platforms, it selects a clock source with a lower clock rate compared to a higher one.
For eg: The rounding error (533333333 Hz / 4 * 4 = 533333332 Hz < 5333333 33 Hz) selects a clk source of 400 MHz instead of 533.333333 MHz.
This patch fixes this issue by adding a margin of (1/1024) higher to the clock rate.
--- drivers/mmc/host/renesas_sdhi_core.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
drivers/mmc/host/renesas_sdhi_core.c +18 -3
@@ -128,6 +128,7 @@ static unsigned int renesas_sdhi_clk_updstruct clk *ref_clk = priv->clk;unsigned int freq, diff, best_freq =0 , diff_min = ~0 ;unsigned int new_clock, clkh_shift =0 ; +unsigned int new_upper_limit;int i;/*
@@ -153,13 +154,20 @@ static unsigned int renesas_sdhi_clk_upd* greater than, new_clock. As we can divide by 1 << i for * any i in [0, 9] we want the input clock to be as close as * possible, but no greater than, new_clock << i. +* +* Add an upper limit of 1/1024 rate higher to the clock rate to fix +* clk rate jumping to lower rate due to rounding error (eg: RZ/G2L has +* 3 clk sources 533.333333 MHz, 400 MHz and 266.666666 MHz. The request +* for 533.333333 MHz will selects a slower 400 MHz due to rounding +* error (533333333 Hz / 4 * 4 = 533333332 Hz < 533333333 Hz)). */ for (i =min (9 ,ilog2 (UINT_MAX / new_clock)); i >=0 ; i--) { freq =clk_round_rate (ref_clk, new_clock << i); -if (freq > (new_clock << i)) { + new_upper_limit = (new_clock << i) + ((new_clock << i) >>10 ); +if (freq > new_upper_limit) {/* Too fast; look for a slightly slower option */ freq =clk_round_rate (ref_clk, (new_clock << i) /4 *3 ); -if (freq > (new_clock << i)) +if (freq > new_upper_limit)continue ; }
@@ -181,6 +189,7 @@ static unsigned int renesas_sdhi_clk_updstatic void renesas_sdhi_set_clock (struct tmio_mmc_host *host,unsigned int new_clock) { +unsigned int clk_margin;u32 clk =0 , clock; sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN &
@@ -194,7 +203,13 @@ static void renesas_sdhi_set_clock(struc host->mmc->actual_clock =renesas_sdhi_clk_update (host, new_clock); clock = host->mmc->actual_clock /512 ; -for (clk =0x80000080 ; new_clock >= (clock <<1 ); clk >>=1 ) +/* +* Add a margin of 1/1024 rate higher to the clock rate in order +* to avoid clk variable setting a value of 0 due to the margin +* provided for actual_clock in renesas_sdhi_clk_update(). +*/ + clk_margin = new_clock >>10 ; +for (clk =0x80000080 ; new_clock + clk_margin >= (clock <<1 ); clk >>=1 ) clock <<=1 ;/* 1/1 clock is option */
Greg Kroah-Hartman
maintainerPATCH 51/717 RISC-V: Re-enable counter access from userspace
In reply to Greg Kroah-HartmanFrom: Palmer Dabbelt <[email protected]>
commit 5a5294fbe0200d1327f0e089135dad77b45aa2ee upstream.
These counters were part of the ISA when we froze the uABI, removing them breaks userspace.
--- drivers/perf/riscv_pmu_sbi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/perf/riscv_pmu_sbi.c +5 -2
@@ -639,8 +639,11 @@ static int pmu_sbi_starting_cpu(unsigned struct riscv_pmu *pmu = hlist_entry_safe(node, struct riscv_pmu, node);struct cpu_hw_events *cpu_hw_evt =this_cpu_ptr (pmu->hw_events); -/* Enable the access for TIME csr only from the user mode now */ -csr_write (CSR_SCOUNTEREN ,0x2 ); +/* +* Enable the access for CYCLE, TIME, and INSTRET CSRs from userspace, +* as is necessary to maintain uABI compatibility. +*/ +csr_write (CSR_SCOUNTEREN ,0x7 );/* Stop all the counters so that they can be enabled from perf */ pmu_sbi_stop_all (pmu);
Greg Kroah-Hartman
maintainerPATCH 49/717 arm64: topology: move store_cpu_topology() to shared code
In reply to Greg Kroah-HartmanFrom: Conor Dooley <[email protected]>
commit 456797da792fa7cbf6698febf275fe9b36691f78 upstream.
arm64's method of defining a default cpu topology requires only minimal changes to apply to RISC-V also. The current arm64 implementation exits early in a uniprocessor configuration by reading MPIDR & claiming that uniprocessor can rely on the default values.
This is appears to be a hangover from prior to '3102bc0e6ac7 ("arm64:
topology: Stop using MPIDR for topology information")', because the current code just assigns default values for multiprocessor systems.
With the MPIDR references removed, store_cpu_topolgy() can be moved to the common arch_topology code.
--- arch/arm64/kernel/topology.c | 40 ---------------------------------------- drivers/base/arch_topology.c | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 40 deletions(-)
arch/arm64/kernel/topology.c +0 -40
@@ -22,46 +22,6 @@#include <asm/cputype.h> #include <asm/topology.h> -void store_cpu_topology (unsigned int cpuid) -{ -struct cpu_topology *cpuid_topo = &cpu_topology[cpuid]; -u64 mpidr; - -if (cpuid_topo->package_id !=-1 ) - goto topology_populated; - - mpidr =read_cpuid_mpidr (); - -/* Uniprocessor systems can rely on default topology values */ -if (mpidr &MPIDR_UP_BITMASK ) -return ; - -/* -* This would be the place to create cpu topology based on MPIDR. -* -* However, it cannot be trusted to depict the actual topology; some -* pieces of the architecture enforce an artificial cap on Aff0 values -* (e.g. GICv3's ICC_SGI1R_EL1 limits it to 15), leading to an -* artificial cycling of Aff1, Aff2 and Aff3 values. IOW, these end up -* having absolutely no relationship to the actual underlying system -* topology, and cannot be reasonably used as core / package ID. -* -* If the MT bit is set, Aff0 *could* be used to define a thread ID, but -* we still wouldn't be able to obtain a sane core ID. This means we -* need to entirely ignore MPIDR for any topology deduction. -*/ - cpuid_topo->thread_id =-1 ; - cpuid_topo->core_id = cpuid; - cpuid_topo->package_id =cpu_to_node (cpuid); - -pr_debug ("CPU%u: cluster %d core %d thread %d mpidr %#016llx\n" , - cpuid, cpuid_topo->package_id, cpuid_topo->core_id, - cpuid_topo->thread_id, mpidr); - -topology_populated: -update_siblings_masks (cpuid); -} -#ifdef CONFIG_ACPI static bool __init acpi_cpu_is_threaded (int cpu) {
drivers/base/arch_topology.c +19 -0
@@ -791,4 +791,23 @@ void __init init_cpu_topology(void) else if (of_have_populated_dt() && parse_dt_topology()) reset_cpu_topology(); } + +void store_cpu_topology (unsigned int cpuid) +{ +struct cpu_topology *cpuid_topo = &cpu_topology[cpuid]; + +if (cpuid_topo->package_id !=-1 ) + goto topology_populated; + + cpuid_topo->thread_id =-1 ; + cpuid_topo->core_id = cpuid; + cpuid_topo->package_id =cpu_to_node (cpuid); + +pr_debug ("CPU%u: package %d core %d thread %d\n" , + cpuid, cpuid_topo->package_id, cpuid_topo->core_id, + cpuid_topo->thread_id); + +topology_populated: +update_siblings_masks (cpuid); +}#endif
Greg Kroah-Hartman
maintainerPATCH 50/717 riscv: topology: fix default topology reporting
In reply to Greg Kroah-HartmanFrom: Conor Dooley <[email protected]>
commit fbd92809997a391f28075f1c8b5ee314c225557c upstream.
RISC-V has no sane defaults to fall back on where there is no cpu-map in the devicetree.
Without sane defaults, the package, core and thread IDs are all set to -1. This causes user-visible inaccuracies for tools like hwloc/lstopo which rely on the sysfs cpu topology files to detect a system's topology.
On a PolarFire SoC, which should have 4 harts with a thread each, lstopo currently reports:
Machine (793MB total)
Package L#0
NUMANode L#0 (P#0 793MB)
Core L#0
L1d L#0 (32KB) + L1i L#0 (32KB) + PU L#0 (P#0)
L1d L#1 (32KB) + L1i L#1 (32KB) + PU L#1 (P#1)
L1d L#2 (32KB) + L1i L#2 (32KB) + PU L#2 (P#2)
L1d L#3 (32KB) + L1i L#3 (32KB) + PU L#3 (P#3)Adding calls to store_cpu_topology() in {boot,smp} hart bringup code results in the correct topolgy being reported:
Machine (793MB total)
Package L#0
NUMANode L#0 (P#0 793MB)
L1d L#0 (32KB) + L1i L#0 (32KB) + Core L#0 + PU L#0 (P#0)
L1d L#1 (32KB) + L1i L#1 (32KB) + Core L#1 + PU L#1 (P#1)
L1d L#2 (32KB) + L1i L#2 (32KB) + Core L#2 + PU L#2 (P#2)
L1d L#3 (32KB) + L1i L#3 (32KB) + Core L#3 + PU L#3 (P#3)--- arch/riscv/Kconfig | 2 +- arch/riscv/kernel/smpboot.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
arch/riscv/Kconfig +1 -1
@@ -52,7 +52,7 @@ config RISCV select COMMON_CLK select CPU_PM if CPU_IDLE select EDAC_SUPPORT - select GENERIC_ARCH_TOPOLOGY if SMP + select GENERIC_ARCH_TOPOLOGY select GENERIC_ATOMIC64 if !64BIT select GENERIC_CLOCKEVENTS_BROADCAST if SMP select GENERIC_EARLY_IOREMAP
arch/riscv/kernel/smpboot.c +2 -1
@@ -49,6 +49,7 @@ void __init smp_prepare_cpus(unsigned inunsigned int curr_cpuid; curr_cpuid =smp_processor_id (); +store_cpu_topology (curr_cpuid);numa_store_cpu_info (curr_cpuid);numa_add_cpu (curr_cpuid);
@@ -161,9 +162,9 @@ asmlinkage __visible void smp_callin(voimmgrab (mm); current->active_mm = mm; +store_cpu_topology (curr_cpuid);notify_cpu_starting (curr_cpuid);numa_add_cpu (curr_cpuid); -update_siblings_masks (curr_cpuid);set_cpu_online (curr_cpuid,1 );/*
Greg Kroah-Hartman
maintainerPATCH 52/717 RISC-V: Make port I/O string accessors actually work
In reply to Greg Kroah-HartmanFrom: Maciej W. Rozycki <[email protected]>
commit 9cc205e3c17d5716da7ebb7fa0c985555e95d009 upstream.
Fix port I/O string accessors such as insb', outsb', etc. which use the physical PCI port I/O address rather than the corresponding memory mapping to get at the requested location, which in turn breaks at least accesses made by our parport driver to a PCIe parallel port such as:
PCI parallel port detected: 1415:c118, I/O at 0x1000(0x1008), IRQ 20
parport0: PC-style at 0x1000 (0x1008), irq 20, using FIFO [PCSPP,TRISTATE,COMPAT,EPP,ECP]
causing a memory access fault:
Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000000001008 Oops [#1] Modules linked in: CPU: 1 PID: 350 Comm: cat Not tainted 6.0.0-rc2-00283-g10d4879f9ef0-dirty #23 Hardware name: SiFive HiFive Unmatched A00 (DT) epc : parport_pc_fifo_write_block_pio+0x266/0x416 ra : parport_pc_fifo_write_block_pio+0xb4/0x416
epc : ffffffff80542c3e ra : ffffffff80542a8c sp : ffffffd88899fc60
gp : ffffffff80fa2700 tp : ffffffd882b1e900 t0 : ffffffd883d0b000 t1 : ffffffffff000002 t2 : 4646393043330a38 s0 : ffffffd88899fcf0 s1 : 0000000000001000 a0 : 0000000000000010 a1 : 0000000000000000 a2 : ffffffd883d0a010 a3 : 0000000000000023 a4 : 00000000ffff8fbb a5 : ffffffd883d0a001 a6 : 0000000100000000 a7 : ffffffc800000000 s2 : ffffffffff000002 s3 : ffffffff80d28880 s4 : ffffffff80fa1f50 s5 : 0000000000001008 s6 : 0000000000000008 s7 : ffffffd883d0a000 s8 : 0004000000000000 s9 : ffffffff80dc1d80 s10: ffffffd8807e4000
s11: 0000000000000000 t3 : 00000000000000ff t4 : 393044410a303930 t5 : 0000000000001000 t6 : 0000000000040000
status: 0000000200000120 badaddr: 0000000000001008 cause: 000000000000000f
[<ffffffff80543212>] parport_pc_compat_write_block_pio+0xfe/0x200 [<ffffffff8053bbc0>] parport_write+0x46/0xf8 [<ffffffff8050530e>] lp_write+0x158/0x2d2 [<ffffffff80185716>] vfs_write+0x8e/0x2c2 [<ffffffff80185a74>] ksys_write+0x52/0xc2 [<ffffffff80185af2>] sys_write+0xe/0x16 [<ffffffff80003770>] ret_from_syscall+0x0/0x2 ---[ end trace 0000000000000000 ]---
For simplicity address the problem by adding PCI_IOBASE to the physical address requested in the respective wrapper macros only, observing that the raw accessors such as __insb', __outsb', etc. are not supposed to be used other than by said macros. Remove the cast to long' that is no longer needed on addr' now that it is used as an offset from PCI_IOBASE and add parentheses around `addr' needed for predictable evaluation in macro expansion. No need to make said adjustments in separate changes given that current code is gravely broken and does not ever work.
--- arch/riscv/include/asm/io.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/riscv/include/asm/io.h +8 -8
@@ -101,9 +101,9 @@ __io_reads_ins(reads, u32, l, __io_br(), __io_reads_ins(ins, u8, b, __io_pbr(), __io_par(addr)) __io_reads_ins(ins, u16, w, __io_pbr(), __io_par(addr)) __io_reads_ins(ins, u32, l, __io_pbr(), __io_par(addr)) -#define insb (addr, buffer, count) __insb((void __iomem *)(long)addr, buffer, count) -#define insw (addr, buffer, count) __insw((void __iomem *)(long)addr, buffer, count) -#define insl (addr, buffer, count) __insl((void __iomem *)(long)addr, buffer, count) +#define insb (addr, buffer, count) __insb(PCI_IOBASE + (addr), buffer, count) +#define insw (addr, buffer, count) __insw(PCI_IOBASE + (addr), buffer, count) +#define insl (addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count) __io_writes_outs(writes, u8, b, __io_bw(), __io_aw())__io_writes_outs (writes, u16, w,__io_bw (),__io_aw ())
@@ -115,22 +115,22 @@ __io_writes_outs(writes, u32, l, __io_bw __io_writes_outs(outs, u8, b, __io_pbw(), __io_paw()) __io_writes_outs(outs, u16, w, __io_pbw(), __io_paw()) __io_writes_outs(outs, u32, l, __io_pbw(), __io_paw()) -#define outsb (addr, buffer, count) __outsb((void __iomem *)(long)addr, buffer, count) -#define outsw (addr, buffer, count) __outsw((void __iomem *)(long)addr, buffer, count) -#define outsl (addr, buffer, count) __outsl((void __iomem *)(long)addr, buffer, count) +#define outsb (addr, buffer, count) __outsb(PCI_IOBASE + (addr), buffer, count) +#define outsw (addr, buffer, count) __outsw(PCI_IOBASE + (addr), buffer, count) +#define outsl (addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count)#ifdef CONFIG_64BIT __io_reads_ins(reads, u64, q, __io_br(), __io_ar(addr))#define readsq (addr, buffer, count) __readsq(addr, buffer, count) __io_reads_ins(ins, u64, q, __io_pbr(), __io_par(addr)) -#define insq (addr, buffer, count) __insq((void __iomem *)addr, buffer, count) +#define insq (addr, buffer, count) __insq(PCI_IOBASE + (addr), buffer, count) __io_writes_outs(writes, u64, q, __io_bw(), __io_aw())#define writesq (addr, buffer, count) __writesq(addr, buffer, count) __io_writes_outs(outs, u64, q, __io_pbr(), __io_paw()) -#define outsq (addr, buffer, count) __outsq((void __iomem *)addr, buffer, count) +#define outsq (addr, buffer, count) __outsq(PCI_IOBASE + (addr), buffer, count)#endif #include <asm-generic/io.h>
Greg Kroah-Hartman
maintainerPATCH 53/717 parisc: fbdev/stifb: Align graphics memory size to 4MB
In reply to Greg Kroah-HartmanFrom: Helge Deller <[email protected]>
commit aca7c13d3bee81a968337a5515411409ae9d095d upstream.
Independend of the current graphics resolution, adjust the reported graphics card memory size to the next 4MB boundary.
This fixes the fbtest program which expects a naturally aligned size.
--- drivers/video/fbdev/stifb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/stifb.c +1 -1
@@ -1298,7 +1298,7 @@ static int __init stifb_init_fb(struct s/* limit fbsize to max visible screen size */ if (fix->smem_len > yres*fix->line_length) - fix->smem_len = yres*fix->line_length; + fix->smem_len =ALIGN (yres*fix->line_length,4 *1024 *1024 ); fix->accel =FB_ACCEL_NONE ;
Greg Kroah-Hartman
maintainerPATCH 54/717 parisc: Fix userspace graphics card breakage due to pgtable special bit
In reply to Greg Kroah-HartmanFrom: Helge Deller <[email protected]>
commit 70be49f2f6223ddd2fcddb0089a40864c37e1494 upstream.
Commit df24e1783e6e ("parisc: Add vDSO support") introduced the vDSO support, for which a _PAGE_SPECIAL page table flag was needed. Since we wanted to keep every page table entry in 32-bits, this patch re-used the existing - but yet unused - _PAGE_DMB flag (which triggers a hardware break if a page is accessed) to store the special bit.
But when graphics card memory is mmapped into userspace, the kernel uses vm_iomap_memory() which sets the the special flag. So, with the DMB bit set, every access to the graphics memory now triggered a hardware exception and segfaulted the userspace program.
Fix this breakage by dropping the DMB bit when writing the page protection bits to the CPU TLB.
In addition this patch adds a small optimization: if huge pages aren't configured (which is at least the case for 32-bit kernels), then the special bit is stored in the hpage (HUGE PAGE) bit instead. That way we can skip to reset the DMB bit.
--- arch/parisc/include/asm/pgtable.h | 7 ++++++- arch/parisc/kernel/entry.S | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-)
arch/parisc/include/asm/pgtable.h +6 -1
@@ -192,6 +192,11 @@ extern void __update_cache(pte_t pte);#define _PAGE_PRESENT_BIT 22/* (0x200) Software: translation valid */ #define _PAGE_HPAGE_BIT 21/* (0x400) Software: Huge Page */ #define _PAGE_USER_BIT 20/* (0x800) Software: User accessible page */ +#ifdef CONFIG_HUGETLB_PAGE +#define _PAGE_SPECIAL_BIT _PAGE_DMB_BIT/* DMB feature is currently unused */ +#else +#define _PAGE_SPECIAL_BIT _PAGE_HPAGE_BIT/* use unused HUGE PAGE bit */ +#endif /* N.B. The bits are defined in terms of a 32 bit word above, so the */ /* following macro is ok for both 32 and 64 bit. */
@@ -219,7 +224,7 @@ extern void __update_cache(pte_t pte);#define _PAGE_PRESENT (1 << xlate_pabit(_PAGE_PRESENT_BIT))#define _PAGE_HUGE (1 << xlate_pabit(_PAGE_HPAGE_BIT))#define _PAGE_USER (1 << xlate_pabit(_PAGE_USER_BIT)) -#define _PAGE_SPECIAL (_PAGE_DMB) +#define _PAGE_SPECIAL (1 << xlate_pabit(_PAGE_SPECIAL_BIT))#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | _PAGE_DIRTY | _PAGE_ACCESSED)#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_SPECIAL)
arch/parisc/kernel/entry.S +8 -0
@@ -499,6 +499,10 @@ * Finally, _PAGE_READ goes in the top bit of PL1 (so we * trigger an access rights trap in user space if the user * tries to read an unreadable page */ +#if _PAGE_SPECIAL_BIT == _PAGE_DMB_BIT + /* need to drop DMB bit, as it's used as SPECIAL flag */ + depi 0,_PAGE_SPECIAL_BIT,1,\pte +#endif depd \pte,8,7,\prot /* PAGE_USER indicates the page can be read with user privileges,
@@ -529,6 +533,10 @@ * makes the tlb entry for the differently formatted pa11 * insertion instructions */ .macro make_insert_tlb_11 spc,pte,prot +#if _PAGE_SPECIAL_BIT == _PAGE_DMB_BIT + /* need to drop DMB bit, as it's used as SPECIAL flag */ + depi 0,_PAGE_SPECIAL_BIT,1,\pte +#endif zdep \spc,30,15,\prot dep \pte,8,7,\prot extru,= \pte,_PAGE_NO_CACHE_BIT,1,%r0
Greg Kroah-Hartman
maintainerPATCH 55/717 riscv: vdso: fix NULL deference in vdso_join_timens() when vfork
In reply to Greg Kroah-HartmanFrom: Jisheng Zhang <[email protected]>
commit a8616d2dc193b6becc36b5f3cfeaa9ac7a5762f9 upstream.
Testing tools/testing/selftests/timens/vfork_exec.c got below kernel log:
[ 6.838454] Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000000000020 [ 6.842255] Oops [#1] [ 6.842871] Modules linked in: [ 6.844249] CPU: 1 PID: 64 Comm: vfork_exec Not tainted 6.0.0-rc3-rt15+ #8 [ 6.845861] Hardware name: riscv-virtio,qemu (DT) [ 6.848009] epc : vdso_join_timens+0xd2/0x110 [ 6.850097] ra : vdso_join_timens+0xd2/0x110 [ 6.851164] epc : ffffffff8000635c ra : ffffffff8000635c sp : ff6000000181fbf0 [ 6.852562] gp : ffffffff80cff648 tp : ff60000000fdb700 t0 : 3030303030303030 [ 6.853852] t1 : 0000000000000030 t2 : 3030303030303030 s0 : ff6000000181fc40 [ 6.854984] s1 : ff60000001e6c000 a0 : 0000000000000010 a1 : ffffffff8005654c [ 6.856221] a2 : 00000000ffffefff a3 : 0000000000000000 a4 : 0000000000000000 [ 6.858114] a5 : 0000000000000000 a6 : 0000000000000008 a7 : 0000000000000038 [ 6.859484] s2 : ff60000001e6c068 s3 : ff6000000108abb0 s4 : 0000000000000000 [ 6.860751] s5 : 0000000000001000 s6 : ffffffff8089dc40 s7 : ffffffff8089dc38 [ 6.862029] s8 : ffffffff8089dc30 s9 : ff60000000fdbe38 s10: 000000000000005e [ 6.863304] s11: ffffffff80cc3510 t3 : ffffffff80d1112f t4 : ffffffff80d1112f [ 6.864565] t5 : ffffffff80d11130 t6 : ff6000000181fa00 [ 6.865561] status: 0000000000000120 badaddr: 0000000000000020 cause: 000000000000000d [ 6.868046] [<ffffffff8008dc94>] timens_commit+0x38/0x11a [ 6.869089] [<ffffffff8008dde8>] timens_on_fork+0x72/0xb4 [ 6.870055] [<ffffffff80190096>] begin_new_exec+0x3c6/0x9f0 [ 6.871231] [<ffffffff801d826c>] load_elf_binary+0x628/0x1214 [ 6.872304] [<ffffffff8018ee7a>] bprm_execve+0x1f2/0x4e4 [ 6.873243] [<ffffffff8018f90c>] do_execveat_common+0x16e/0x1ee [ 6.874258] [<ffffffff8018f9c8>] sys_execve+0x3c/0x48 [ 6.875162] [<ffffffff80003556>] ret_from_syscall+0x0/0x2 [ 6.877484] ---[ end trace 0000000000000000 ]---
This is because the mm->context.vdso_info is NULL in vfork case. From another side, mm->context.vdso_info either points to vdso info for RV64 or vdso info for compat, there's no need to bloat riscv's mm_context_t, we can handle the difference when setup the additional page for vdso.
--- arch/riscv/include/asm/mmu.h | 1 - arch/riscv/kernel/vdso.c | 13 ++++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-)
arch/riscv/include/asm/mmu.h +0 -1
@@ -16,7 +16,6 @@ typedef struct {atomic_long_t id;#endif void *vdso; -void *vdso_info;#ifdef CONFIG_SMP /* A local icache flush is needed before user execution can resume. */ cpumask_t icache_stale_mask;
arch/riscv/kernel/vdso.c +10 -3
@@ -60,6 +60,11 @@ struct __vdso_info {struct vm_special_mapping *cm; }; +static struct __vdso_info vdso_info; +#ifdef CONFIG_COMPAT +static struct __vdso_info compat_vdso_info; +#endif +static int vdso_mremap (const struct vm_special_mapping *sm,struct vm_area_struct *new_vma) {
@@ -114,15 +119,18 @@ int vdso_join_timens(struct task_struct *task, struct time_namespace *ns) {struct mm_struct *mm = task->mm;struct vm_area_struct *vma; -struct __vdso_info *vdso_info = mm->context.vdso_info;mmap_read_lock (mm);for (vma = mm->mmap; vma; vma = vma->vm_next) {unsigned long size = vma->vm_end - vma->vm_start; -if (vma_is_special_mapping (vma, vdso_info->dm)) +if (vma_is_special_mapping (vma, vdso_info.dm))zap_page_range (vma, vma->vm_start, size); +#ifdef CONFIG_COMPAT +if (vma_is_special_mapping (vma, compat_vdso_info.dm)) +zap_page_range (vma, vma->vm_start, size); +#endif }mmap_read_unlock (mm);
@@ -264,7 +272,6 @@ static int __setup_additional_pages(struct mm_struct *mm, vdso_base +=VVAR_SIZE ; mm->context.vdso = (void *)vdso_base; - mm->context.vdso_info = (void *)vdso_info; ret = _install_special_mapping(mm, vdso_base, vdso_text_len,
Signature · 1 line
2.38.0
Greg Kroah-Hartman
maintainerPATCH 56/717 riscv: Allow PROT_WRITE-only mmap()
In reply to Greg Kroah-HartmanFrom: Andrew Bresticker <[email protected]>
commit 9e2e6042a7ec6504fe8e366717afa2f40cf16488 upstream.
Commit 2139619bcad7 ("riscv: mmap with PROT_WRITE but no PROT_READ is invalid") made mmap() return EINVAL if PROT_WRITE was set wihtout PROT_READ with the justification that a write-only PTE is considered a reserved PTE permission bit pattern in the privileged spec. This check is unnecessary since we let VM_WRITE imply VM_READ on RISC-V, and it is inconsistent with other architectures that don't support write-only PTEs, creating a potential software portability issue. Just remove the check altogether and let PROT_WRITE imply PROT_READ as is the case on other architectures.
Note that this also allows PROT_WRITE|PROT_EXEC mappings which were disallowed prior to the aforementioned commit; PROT_READ is implied in such mappings as well.
--- arch/riscv/kernel/sys_riscv.c | 3 --- 1 file changed, 3 deletions(-)
arch/riscv/kernel/sys_riscv.c +0 -3
@@ -18,9 +18,6 @@ static long riscv_sys_mmap(unsigned longif (unlikely (offset & (~PAGE_MASK >> page_shift_offset)))return -EINVAL ; -if (unlikely ((prot &PROT_WRITE ) && !(prot &PROT_READ ))) -return -EINVAL ; -return ksys_mmap_pgoff (addr, len, prot, flags, fd, offset >> (PAGE_SHIFT - page_shift_offset)); }
Greg Kroah-Hartman
maintainerPATCH 57/717 riscv: Make VM_WRITE imply VM_READ
In reply to Greg Kroah-HartmanFrom: Andrew Bresticker <[email protected]>
commit 7ab72c597356be1e7f0f3d856e54ce78527f43c8 upstream.
RISC-V does not presently have write-only mappings as that PTE bit pattern is considered reserved in the privileged spec, so allow handling of read faults in VMAs that have VM_WRITE without VM_READ in order to be consistent with other architectures that have similar limitations.
--- arch/riscv/mm/fault.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/riscv/mm/fault.c +2 -1
@@ -184,7 +184,8 @@ static inline bool access_error(unsigned }break ;case EXC_LOAD_PAGE_FAULT : -if (!(vma->vm_flags &VM_READ )) { +/* Write implies read */ +if (!(vma->vm_flags & (VM_READ |VM_WRITE ))) {return true; }break ;
Greg Kroah-Hartman
maintainerPATCH 37/717 fs: dlm: handle -EBUSY first in lock arg validation
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
commit 44637ca41d551d409a481117b07fa209b330fca9 upstream.
During lock arg validation, first check for -EBUSY cases, then for -EINVAL cases. The -EINVAL checks look at lkb state variables which are not stable when an lkb is busy and would cause an -EBUSY result, e.g. lkb->lkb_grmode.
--- fs/dlm/lock.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
fs/dlm/lock.c +9 -9
@@ -2920,17 +2920,9 @@ static int set_unlock_args(uint32_t flagstatic int validate_lock_args (struct dlm_ls *ls,struct dlm_lkb *lkb,struct dlm_args *args) { -int rv = -EINVAL ; +int rv = -EBUSY ;if (args->flags &DLM_LKF_CONVERT ) { -if (lkb->lkb_flags &DLM_IFL_MSTCPY ) - goto out; - -if (args->flags &DLM_LKF_QUECVT && - !__quecvt_compat_matrix[lkb->lkb_grmode+1 ][args->mode+1 ]) - goto out; - - rv = -EBUSY ;if (lkb->lkb_status !=DLM_LKSTS_GRANTED ) goto out;
@@ -2940,6 +2932,14 @@ static int validate_lock_args(struct dlmif (is_overlap (lkb)) goto out; + + rv = -EINVAL ; +if (lkb->lkb_flags &DLM_IFL_MSTCPY ) + goto out; + +if (args->flags &DLM_LKF_QUECVT && + !__quecvt_compat_matrix[lkb->lkb_grmode+1 ][args->mode+1 ]) + goto out; } lkb->lkb_exflags = args->flags;
Greg Kroah-Hartman
maintainerPATCH 59/717 riscv: Pass -mno-relax only on lld < 15.0.0
In reply to Greg Kroah-HartmanFrom: Fangrui Song <[email protected]>
commit 3cebf80e9a0d3adcb174053be32c88a640b3344b upstream.
lld since llvm:6611d58f5bbc ("[ELF] Relax R_RISCV_ALIGN"), which will be included in the 15.0.0 release, has implemented some RISC-V linker relaxation. -mno-relax is no longer needed in KBUILD_CFLAGS/KBUILD_AFLAGS to suppress R_RISCV_ALIGN which older lld can not handle:
ld.lld: error: capability.c:(.fixup+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax but the .o is already compiled with -mno-relax
--- arch/riscv/Makefile | 2 ++ 1 file changed, 2 insertions(+)
arch/riscv/Makefile +2 -0
@@ -37,6 +37,7 @@ else endif ifeq ($(CONFIG_LD_IS_LLD),y) +ifeq ($(shell test $(CONFIG_LLD_VERSION) -lt 150000; echo $$?),0) KBUILD_CFLAGS += -mno-relax KBUILD_AFLAGS += -mno-relax ifndef CONFIG_AS_IS_LLVM
@@ -44,6 +45,7 @@ ifndef CONFIG_AS_IS_LLVM KBUILD_AFLAGS += -Wa,-mno-relax endif endif +endif # ISA string setting riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima
Greg Kroah-Hartman
maintainerPATCH 58/717 riscv: always honor the CONFIG_CMDLINE_FORCE when parsing dtb
In reply to Greg Kroah-HartmanFrom: Wenting Zhang <[email protected]>
commit 10f6913c548b32ecb73801a16b120e761c6957ea upstream.
When CONFIG_CMDLINE_FORCE is enabled, cmdline provided by CONFIG_CMDLINE are always used. This allows CONFIG_CMDLINE to be used regardless of the result of device tree scanning.
This especially fixes the case where a device tree without the chosen node is supplied to the kernel. In such cases, early_init_dt_scan would return true. But inside early_init_dt_scan_chosen, the cmdline won't be updated as there is no chosen node in the device tree. As a result, CONFIG_CMDLINE is not copied into boot_command_line even if CONFIG_CMDLINE_FORCE is enabled. This commit allows properly update boot_command_line in this situation.
--- arch/riscv/kernel/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kernel/setup.c +2 -2
@@ -251,10 +251,10 @@ static void __init parse_dtb(void)pr_info ("Machine model: %s\n" , name);dump_stack_set_arch_desc ("%s (DT)" , name); } -return ; + }else { +pr_err ("No DTB passed to the kernel\n" ); } -pr_err ("No DTB passed to the kernel\n" );#ifdef CONFIG_CMDLINE_FORCE strscpy (boot_command_line,CONFIG_CMDLINE ,COMMAND_LINE_SIZE );pr_info ("Forcing kernel command line to: %s\n" , boot_command_line);
Greg Kroah-Hartman
maintainerPATCH 60/717 UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK
In reply to Greg Kroah-HartmanFrom: Huacai Chen <[email protected]>
commit 16c546e148fa6d14a019431436a6f7b4087dbccd upstream.
When CONFIG_CPUMASK_OFFSTACK and CONFIG_DEBUG_PER_CPU_MAPS is selected, cpu_max_bits_warn() generates a runtime warning similar as below while we show /proc/cpuinfo. Fix this by using nr_cpu_ids (the runtime limit) instead of NR_CPUS to iterate CPUs.
[ 3.052463] ------------[ cut here ]------------ [ 3.059679] WARNING: CPU: 3 PID: 1 at include/linux/cpumask.h:108 show_cpuinfo+0x5e8/0x5f0 [ 3.070072] Modules linked in: efivarfs autofs4 [ 3.076257] CPU: 0 PID: 1 Comm: systemd Not tainted 5.19-rc5+ #1052 [ 3.099465] Stack : 9000000100157b08 9000000000f18530 9000000000cf846c 9000000100154000 [ 3.109127] 9000000100157a50 0000000000000000 9000000100157a58 9000000000ef7430 [ 3.118774] 90000001001578e8 0000000000000040 0000000000000020 ffffffffffffffff [ 3.128412] 0000000000aaaaaa 1ab25f00eec96a37 900000010021de80 900000000101c890 [ 3.138056] 0000000000000000 0000000000000000 0000000000000000 0000000000aaaaaa [ 3.147711] ffff8000339dc220 0000000000000001 0000000006ab4000 0000000000000000 [ 3.157364] 900000000101c998 0000000000000004 9000000000ef7430 0000000000000000 [ 3.167012] 0000000000000009 000000000000006c 0000000000000000 0000000000000000 [ 3.176641] 9000000000d3de08 9000000001639390 90000000002086d8 00007ffff0080286 [ 3.186260] 00000000000000b0 0000000000000004 0000000000000000 0000000000071c1c [ 3.195868] ... [ 3.199917] Call Trace: [ 3.203941] [<90000000002086d8>] show_stack+0x38/0x14c [ 3.210666] [<9000000000cf846c>] dump_stack_lvl+0x60/0x88 [ 3.217625] [<900000000023d268>] __warn+0xd0/0x100 [ 3.223958] [<9000000000cf3c90>] warn_slowpath_fmt+0x7c/0xcc [ 3.231150] [<9000000000210220>] show_cpuinfo+0x5e8/0x5f0 [ 3.238080] [<90000000004f578c>] seq_read_iter+0x354/0x4b4 [ 3.245098] [<90000000004c2e90>] new_sync_read+0x17c/0x1c4 [ 3.252114] [<90000000004c5174>] vfs_read+0x138/0x1d0 [ 3.258694] [<90000000004c55f8>] ksys_read+0x70/0x100 [ 3.265265] [<9000000000cfde9c>] do_syscall+0x7c/0x94 [ 3.271820] [<9000000000202fe4>] handle_syscall+0xc4/0x160 [ 3.281824] ---[ end trace 8b484262b4b8c24c ]---
--- arch/um/kernel/um_arch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/kernel/um_arch.c +1 -1
@@ -96,7 +96,7 @@ static int show_cpuinfo(struct seq_filestatic void *c_start (struct seq_file *m,loff_t *pos) { -return *pos <NR_CPUS ? cpu_data + *pos :NULL ; +return *pos < nr_cpu_ids ? cpu_data + *pos :NULL ; }static void *c_next (struct seq_file *m,void *v,loff_t *pos)
Greg Kroah-Hartman
maintainerPATCH 61/717 nvmem: core: Fix memleak in nvmem_register()
In reply to Greg Kroah-HartmanFrom: Gaosheng Cui <[email protected]>
commit bd1244561fa2a4531ded40dbf09c9599084f8b29 upstream.
dev_set_name will alloc memory for nvmem->dev.kobj.name in nvmem_register, when nvmem_validate_keepouts failed, nvmem's memory will be freed and return, but nobody will free memory for nvmem->dev.kobj.name, there will be memleak, so moving nvmem_validate_keepouts() after device_register() and let the device core deal with cleaning name in error cases.
--- drivers/nvmem/core.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/nvmem/core.c +6 -9
@@ -829,21 +829,18 @@ struct nvmem_device *nvmem_register(cons nvmem->dev.groups = nvmem_dev_groups;#endif -if (nvmem->nkeepout) { - rval =nvmem_validate_keepouts (nvmem); -if (rval) { -ida_free (&nvmem_ida, nvmem->id); -kfree (nvmem); -return ERR_PTR (rval); - } - } -dev_dbg (&nvmem->dev,"Registering nvmem device %s\n" , config->name); rval =device_register (&nvmem->dev);if (rval) goto err_put_device; +if (nvmem->nkeepout) { + rval =nvmem_validate_keepouts (nvmem); +if (rval) + goto err_device_del; + } +if (config->compat) { rval =nvmem_sysfs_setup_compat (nvmem, config);if (rval)
Greg Kroah-Hartman
maintainerPATCH 33/717 mmc: sdhci-tegra: Use actual clock rate for SW tuning correction
In reply to Greg Kroah-HartmanFrom: Prathamesh Shete <[email protected]>
commit b78870e7f41534cc719c295d1f8809aca93aeeab upstream.
Ensure tegra_host member "curr_clk_rate" holds the actual clock rate instead of requested clock rate for proper use during tuning correction algorithm. Actual clk rate may not be the same as the requested clk frequency depending on the parent clock source set. Tuning correction algorithm depends on certain parameters which are sensitive to current clk rate. If the host clk is selected instead of the actual clock rate, tuning correction algorithm may end up applying invalid correction, which could result in errors
--- drivers/mmc/host/sdhci-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +1 -1
@@ -773,7 +773,7 @@ static void tegra_sdhci_set_clock(structdev_err (dev,"failed to set clk rate to %luHz: %d\n" , host_clk, err); - tegra_host->curr_clk_rate = host_clk; + tegra_host->curr_clk_rate =clk_get_rate (pltfm_host->clk);if (tegra_host->ddr_signaling) host->max_clk = host_clk;else
Greg Kroah-Hartman
maintainerPATCH 34/717 mmc: sdhci-sprd: Fix minimum clock limit
In reply to Greg Kroah-HartmanFrom: Wenchao Chen <[email protected]>
commit 6e141772e6465f937458b35ddcfd0a981b6f5280 upstream.
The Spreadtrum controller supports 100KHz minimal clock rate, which means that the current value 400KHz is wrong.
Unfortunately this has also lead to fail to initialize some cards, which are allowed to require 100KHz to work. So, let's fix the problem by changing the minimal supported clock rate to 100KHz.
--- drivers/mmc/host/sdhci-sprd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-sprd.c +1 -1
@@ -309,7 +309,7 @@ static unsigned int sdhci_sprd_get_max_cstatic unsigned int sdhci_sprd_get_min_clock (struct sdhci_host *host) { -return 400000 ; +return 100000 ; } static void sdhci_sprd_set_uhs_signaling(struct sdhci_host *host,
Greg Kroah-Hartman
maintainerPATCH 36/717 fs: dlm: fix race between test_bit() and queue_work()
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
commit eef6ec9bf390e836a6c4029f3620fe49528aa1fe upstream.
This patch fixes a race by using ls_cb_mutex around the bit operations and conditional code blocks for LSFL_CB_DELAY.
The function dlm_callback_stop() expects to stop all callbacks and flush all currently queued onces. The set_bit() is not enough because there can still be queue_work() after the workqueue was flushed. To avoid queue_work() after set_bit(), surround both by ls_cb_mutex.
--- fs/dlm/ast.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/dlm/ast.c +4 -2
@@ -200,13 +200,13 @@ void dlm_add_cb(struct dlm_lkb *lkb, uinif (!prev_seq) {kref_get (&lkb->lkb_ref); +mutex_lock (&ls->ls_cb_mutex);if (test_bit (LSFL_CB_DELAY , &ls->ls_flags)) { -mutex_lock (&ls->ls_cb_mutex);list_add (&lkb->lkb_cb_list, &ls->ls_cb_delay); -mutex_unlock (&ls->ls_cb_mutex); }else {queue_work (ls->ls_callback_wq, &lkb->lkb_cb_work); } +mutex_unlock (&ls->ls_cb_mutex); } out:mutex_unlock (&lkb->lkb_cb_mutex);
@@ -288,7 +288,9 @@ void dlm_callback_stop(struct dlm_ls *lsvoid dlm_callback_suspend (struct dlm_ls *ls) { +mutex_lock (&ls->ls_cb_mutex);set_bit (LSFL_CB_DELAY , &ls->ls_flags); +mutex_unlock (&ls->ls_cb_mutex);if (ls->ls_callback_wq)flush_workqueue (ls->ls_callback_wq);
Greg Kroah-Hartman
maintainerPATCH 96/717 scsi: qedf: Populate sysfs attributes for vport
In reply to Greg Kroah-HartmanFrom: Saurav Kashyap <[email protected]>
commit 592642e6b11e620e4b43189f8072752429fc8dc3 upstream.
Few vport parameters were displayed by systool as 'Unknown' or 'NULL'. Copy speed, supported_speed, frame_size and update port_type for NPIV port.
--- drivers/scsi/qedf/qedf_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/scsi/qedf/qedf_main.c +21 -0
@@ -1921,6 +1921,27 @@ static int qedf_vport_create(struct fc_vfc_vport_setlink (vn_port); } +/* Set symbolic node name */ +if (base_qedf->pdev->device == QL45xxx) +snprintf (fc_host_symbolic_name (vn_port->host),256 , +"Marvell FastLinQ 45xxx FCoE v%s" ,QEDF_VERSION ); + +if (base_qedf->pdev->device == QL41xxx) +snprintf (fc_host_symbolic_name (vn_port->host),256 , +"Marvell FastLinQ 41xxx FCoE v%s" ,QEDF_VERSION ); + +/* Set supported speed */ +fc_host_supported_speeds (vn_port->host) = n_port->link_supported_speeds; + +/* Set speed */ + vn_port->link_speed = n_port->link_speed; + +/* Set port type */ +fc_host_port_type (vn_port->host) =FC_PORTTYPE_NPIV ; + +/* Set maxframe size */ +fc_host_maxframe_size (vn_port->host) = n_port->mfs; +QEDF_INFO (&(base_qedf->dbg_ctx),QEDF_LOG_NPIV ,"vn_port=%p.\n" , vn_port);
Greg Kroah-Hartman
maintainerPATCH 107/717 btrfs: fix alignment of VMA for memory mapped files on THP
In reply to Greg Kroah-HartmanFrom: Alexander Zhu <[email protected]>
commit b0c582233a8563f3c4228df838cdc67a8807ec78 upstream.
With CONFIG_READ_ONLY_THP_FOR_FS, the Linux kernel supports using THPs for read-only mmapped files, such as shared libraries. However, the kernel makes no attempt to actually align those mappings on 2MB boundaries, which makes it impossible to use those THPs most of the time. This issue applies to general file mapping THP as well as existing setups using CONFIG_READ_ONLY_THP_FOR_FS. This is easily fixed by using thp_get_unmapped_area for the unmapped_area function in btrfs, which is what ext2, ext4, fuse, and xfs all use.
Initially btrfs had been left out in commit 8c07fc452ac0 ("btrfs: fix alignment of VMA for memory mapped files on THP") as btrfs does not support DAX. However, commit 1854bc6e2420 ("mm/readahead: Align file mappings for non-DAX") removed the DAX requirement. We should now be able to call thp_get_unmapped_area() for btrfs.
The problem can be seen in /proc/PID/smaps where THPeligible is set to 0 on mappings to eligible shared object files as shown below.
Before this patch:
7fc6a7e18000-7fc6a80cc000 r-xp 00000000 00:1e 199856 /usr/lib64/libcrypto.so.1.1.1k
Size: 2768 kB
THPeligible: 0
VmFlags: rd ex mr mw me
With this patch the library is mapped at a 2MB aligned address:
fbdfe200000-7fbdfe4b4000 r-xp 00000000 00:1e 199856 /usr/lib64/libcrypto.so.1.1.1k
Size: 2768 kB
THPeligible: 1
VmFlags: rd ex mr mw me
This fixes the alignment of VMAs for any mmap of a file that has the rd and ex permissions and size >= 2MB. The VMA alignment and THPeligible field for anonymous memory is handled separately and is thus not effected by this change.
--- fs/btrfs/file.c | 1 + 1 file changed, 1 insertion(+)
fs/btrfs/file.c +1 -0
@@ -3810,6 +3810,7 @@ const struct file_operations btrfs_file_operations = { .mmap = btrfs_file_mmap, .open = btrfs_file_open, .release = btrfs_release_file, + .get_unmapped_area = thp_get_unmapped_area, .fsync = btrfs_sync_file, .fallocate = btrfs_fallocate, .unlocked_ioctl = btrfs_ioctl,
Signature · 1 line
2.38.0
Greg Kroah-Hartman
maintainerPATCH 113/717 f2fs: complete checkpoints during remount
In reply to Greg Kroah-HartmanFrom: Jaegeuk Kim <[email protected]>
commit 4f99484d27961cb194cebcd917176fa038a5025f upstream.
Otherwise, pending checkpoints can contribute a race condition to give a quota warning.
- Thread - checkpoint thread
add checkpoints to the listdo_remount()
down_write(&sb->s_umount);
f2fs_remount()
block_operations()
down_read_trylock(&sb->s_umount) = 0
up_write(&sb->s_umount);
f2fs_quota_sync()
dquot_writeback_dquots()
WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount));Or,
do_remount()
down_write(&sb->s_umount);
f2fs_remount()
create a ckpt thread f2fs_enable_checkpoint() adds checkpoints wait for f2fs_sync_fs() trigger another pending checkpoint
block_operations()
down_read_trylock(&sb->s_umount) = 0
up_write(&sb->s_umount);
f2fs_quota_sync()
dquot_writeback_dquots()
WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount));--- fs/f2fs/super.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/f2fs/super.c +6 -0
@@ -2146,6 +2146,9 @@ static void f2fs_enable_checkpoint(strucf2fs_up_write (&sbi->gc_lock);f2fs_sync_fs (sbi->sb,1 ); + +/* Let's ensure there's no pending checkpoint anymore */ +f2fs_flush_ckpt_thread (sbi); }static int f2fs_remount (struct super_block *sb,int *flags,char *data)
@@ -2311,6 +2314,9 @@ static int f2fs_remount(struct super_blof2fs_stop_ckpt_thread (sbi); need_restart_ckpt = true; }else { +/* Flush if the prevous checkpoint, if exists. */ +f2fs_flush_ckpt_thread (sbi); + err =f2fs_start_ckpt_thread (sbi);if (err) { f2fs_err(sbi,
Greg Kroah-Hartman
maintainerPATCH 115/717 f2fs: increase the limit for reserve_root
In reply to Greg Kroah-HartmanFrom: Jaegeuk Kim <[email protected]>
commit da35fe96d12d15779f3cb74929b7ed03941cf983 upstream.
This patch increases the threshold that limits the reserved root space from 0.2% to 12.5% by using simple shift operation.
Typically Android sets 128MB, but if the storage capacity is 32GB, 0.2% which is around 64MB becomes too small. Let's relax it.
--- fs/f2fs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/super.c +2 -2
@@ -298,10 +298,10 @@ static void f2fs_destroy_casefold_cache(static inline void limit_reserve_root (struct f2fs_sb_info *sbi) { -block_t limit =min ((sbi->user_block_count <<1 ) /1000 , +block_t limit =min ((sbi->user_block_count >>3 ), sbi->user_block_count - sbi->reserved_blocks); -/* limit is 0.2% */ +/* limit is 12.5% */ if (test_opt (sbi,RESERVE_ROOT ) &&F2FS_OPTION (sbi).root_reserved_blocks > limit) {F2FS_OPTION (sbi).root_reserved_blocks = limit;
Greg Kroah-Hartman
maintainerPATCH 121/717 jbd2: add miss release buffer head in fc_do_one_pass()
In reply to Greg Kroah-HartmanFrom: Ye Bin <[email protected]>
commit dfff66f30f66b9524b661f311bbed8ff3d2ca49f upstream.
In fc_do_one_pass() miss release buffer head after use which will lead to reference count leak.
--- fs/jbd2/recovery.c | 1 + 1 file changed, 1 insertion(+)
fs/jbd2/recovery.c +1 -0
@@ -256,6 +256,7 @@ static int fc_do_one_pass(journal_t *jou err = journal->j_fc_replay_callback (journal, bh, pass, next_fc_block - journal->j_fc_first, expected_commit_id); +brelse (bh); next_fc_block++;if (err <0 || err ==JBD2_FC_REPLAY_STOP )break ;
Greg Kroah-Hartman
maintainerPATCH 128/717 ext4: unconditionally enable the i_version counter
In reply to Greg Kroah-HartmanFrom: Jeff Layton <[email protected]>
commit 1ff20307393e17dc57fde62226df625a3a3c36e9 upstream.
The original i_version implementation was pretty expensive, requiring a log flush on every change. Because of this, it was gated behind a mount option (implemented via the MS_I_VERSION mountoption flag).
Commit ae5e165d855d (fs: new API for handling inode->i_version) made the i_version flag much less expensive, so there is no longer a performance penalty from enabling it. xfs and btrfs already enable it unconditionally when the on-disk format can support it.
Have ext4 ignore the SB_I_VERSION flag, and just enable it unconditionally. While we're in here, mark the i_version mount option Opt_removed.
[ Removed leftover bits of i_version from ext4_apply_options() since it
now can't ever be set in ctx->mask_s_flags -- lczerner ]
--- fs/ext4/inode.c | 5 ++--- fs/ext4/super.c | 22 +++++----------------- 2 files changed, 7 insertions(+), 20 deletions(-)
fs/ext4/inode.c +2 -3
@@ -5425,7 +5425,7 @@ int ext4_setattr(struct user_namespace *return -EINVAL ; } -if (IS_I_VERSION (inode) && attr->ia_size != inode->i_size) +if (attr->ia_size != inode->i_size)inode_inc_iversion (inode);if (shrink) {
@@ -5735,8 +5735,7 @@ int ext4_mark_iloc_dirty(handle_t *handl* ea_inodes are using i_version for storing reference count, don't * mess with it */ -if (IS_I_VERSION (inode) && - !(EXT4_I (inode)->i_flags &EXT4_EA_INODE_FL )) +if (!(EXT4_I (inode)->i_flags &EXT4_EA_INODE_FL ))inode_inc_iversion (inode);/* the do_update_inode consumes one bh->b_count */
fs/ext4/super.c +5 -17
@@ -1585,7 +1585,7 @@ enum { Opt_inlinecrypt, Opt_usrjquota, Opt_grpjquota, Opt_quota, Opt_noquota, Opt_barrier, Opt_nobarrier, Opt_err, - Opt_usrquota, Opt_grpquota, Opt_prjquota, Opt_i_version, + Opt_usrquota, Opt_grpquota, Opt_prjquota, Opt_dax, Opt_dax_always, Opt_dax_inode, Opt_dax_never, Opt_stripe, Opt_delalloc, Opt_nodelalloc, Opt_warn_on_error, Opt_nowarn_on_error, Opt_mblk_io_submit, Opt_debug_want_extra_isize,
@@ -1694,7 +1694,7 @@ static const struct fs_parameter_spec exfsparam_flag ("barrier" , Opt_barrier),fsparam_u32 ("barrier" , Opt_barrier),fsparam_flag ("nobarrier" , Opt_nobarrier), -fsparam_flag ("i_version" , Opt_i_version), +fsparam_flag ("i_version" , Opt_removed),fsparam_flag ("dax" , Opt_dax),fsparam_enum ("dax" , Opt_dax_type, ext4_param_dax), fsparam_u32 ("stripe", Opt_stripe),
@@ -2140,11 +2140,6 @@ static int ext4_parse_param(struct fs_cocase Opt_abort:ctx_set_mount_flag (ctx,EXT4_MF_FS_ABORTED );return 0 ; -case Opt_i_version: -ext4_msg (NULL ,KERN_WARNING , deprecated_msg, param->key,"5.20" ); -ext4_msg (NULL ,KERN_WARNING ,"Use iversion instead\n" ); -ctx_set_flags (ctx,SB_I_VERSION ); -return 0 ;case Opt_inlinecrypt:#ifdef CONFIG_FS_ENCRYPTION_INLINE_CRYPT ctx_set_flags (ctx,SB_INLINECRYPT );
@@ -2814,14 +2809,6 @@ static void ext4_apply_options(struct fs sb->s_flags &= ~ctx->mask_s_flags; sb->s_flags |= ctx->vals_s_flags; -/* -* i_version differs from common mount option iversion so we have -* to let vfs know that it was set, otherwise it would get cleared -* on remount -*/ -if (ctx->mask_s_flags &SB_I_VERSION ) - fc->sb_flags |=SB_I_VERSION ; -#define APPLY (X ) ({ if (ctx->spec & EXT4_SPEC_##X) sbi->X = ctx->X; })APPLY (s_commit_interval);APPLY (s_stripe);
@@ -2970,8 +2957,6 @@ static int _ext4_show_options(struct seqSEQ_OPTS_PRINT ("min_batch_time=%u" , sbi->s_min_batch_time);if (nodefs || sbi->s_max_batch_time !=EXT4_DEF_MAX_BATCH_TIME )SEQ_OPTS_PRINT ("max_batch_time=%u" , sbi->s_max_batch_time); -if (sb->s_flags &SB_I_VERSION ) -SEQ_OPTS_PUTS ("i_version" );if (nodefs || sbi->s_stripe)SEQ_OPTS_PRINT ("stripe=%lu" , sbi->s_stripe); if (nodefs || EXT4_MOUNT_DATA_FLAGS &
@@ -4631,6 +4616,9 @@ static int __ext4_fill_super(struct fs_c sb->s_flags = (sb->s_flags & ~SB_POSIXACL ) | (test_opt (sb,POSIX_ACL ) ?SB_POSIXACL :0 ); +/* i_version is always enabled now */ + sb->s_flags |=SB_I_VERSION ; + if (le32_to_cpu(es->s_rev_level) == EXT4_GOOD_OLD_REV && (ext4_has_compat_features(sb) || ext4_has_ro_compat_features(sb) ||
Greg Kroah-Hartman
maintainerPATCH 63/717 Revert "drm/amdgpu: use dirty framebuffer helper"
In reply to Greg Kroah-HartmanFrom: Hamza Mahfooz <[email protected]>
commit 17d819e2828cacca2e4c909044eb9798ed379cd2 upstream.
This reverts commit 66f99628eb24409cb8feb5061f78283c8b65f820.
Unfortunately, that commit causes performance regressions on non-PSR setups. So, just revert it until FB_DAMAGE_CLIPS support can be added.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2 -12
@@ -35,8 +35,6 @@#include <linux/pci.h> #include <linux/pm_runtime.h> #include <drm/drm_crtc_helper.h> -#include <drm/drm_damage_helper.h> -#include <drm/drm_drv.h> #include <drm/drm_edid.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_helper.h>
@@ -497,12 +495,6 @@ static const struct drm_framebuffer_func .create_handle = drm_gem_fb_create_handle, }; -static const struct drm_framebuffer_funcs amdgpu_fb_funcs_atomic = { - .destroy = drm_gem_fb_destroy, - .create_handle = drm_gem_fb_create_handle, - .dirty = drm_atomic_helper_dirtyfb, -}; -uint32_t amdgpu_display_supported_domains (struct amdgpu_device *adev,uint64_t bo_flags) {
@@ -1077,10 +1069,8 @@ static int amdgpu_display_gem_fb_verify_if (ret) goto err; -if (drm_drv_uses_atomic_modeset (dev)) - ret =drm_framebuffer_init (dev, &rfb->base, &amdgpu_fb_funcs_atomic); -else - ret =drm_framebuffer_init (dev, &rfb->base, &amdgpu_fb_funcs); + ret =drm_framebuffer_init (dev, &rfb->base, &amdgpu_fb_funcs); +if (ret) goto err;
Greg Kroah-Hartman
maintainerPATCH 103/717 ksmbd: fix endless loop when encryption for response fails
In reply to Greg Kroah-HartmanFrom: Namjae Jeon <[email protected]>
commit 360c8ee6fefdb496fffd2c18bb9a96a376a1a804 upstream.
If ->encrypt_resp return error, goto statement cause endless loop. It send an error response immediately after removing it.
--- fs/ksmbd/server.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
fs/ksmbd/server.c +1 -3
@@ -235,10 +235,8 @@ send:if (work->sess && work->sess->enc && work->encrypted && conn->ops->encrypt_resp) { rc = conn->ops->encrypt_resp (work); -if (rc <0 ) { +if (rc <0 ) conn->ops->set_rsp_status (work,STATUS_DATA_ERROR ); - goto send; - } }ksmbd_conn_write (work);
Greg Kroah-Hartman
maintainerPATCH 139/717 ftrace: Still disable enabled records marked as disabled
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit cf04f2d5df0037741207382ac8fe289e8bf84ced upstream.
Weak functions started causing havoc as they showed up in the "available_filter_functions" and this confused people as to why some functions marked as "notrace" were listed, but when enabled they did nothing. This was because weak functions can still have fentry calls, and these addresses get added to the "available_filter_functions" file. kallsyms is what converts those addresses to names, and since the weak functions are not listed in kallsyms, it would just pick the function before that.
To solve this, there was a trick to detect weak functions listed, and these records would be marked as DISABLED so that they do not get enabled and are mostly ignored. As the processing of the list of all functions to figure out what is weak or not can take a long time, this process is put off into a kernel thread and run in parallel with the rest of start up.
Now the issue happens whet function tracing is enabled via the kernel command line. As it starts very early in boot up, it can be enabled before the records that are weak are marked to be disabled. This causes an issue in the accounting, as the weak records are enabled by the command line function tracing, but after boot up, they are not disabled.
The ftrace records have several accounting flags and a ref count. The DISABLED flag is just one. If the record is enabled before it is marked DISABLED it will get an ENABLED flag and also have its ref counter incremented. After it is marked for DISABLED, neither the ENABLED flag nor the ref counter is cleared. There's sanity checks on the records that are performed after an ftrace function is registered or unregistered, and this detected that there were records marked as ENABLED with ref counter that should not have been.
Note, the module loading code uses the DISABLED flag as well to keep its functions from being modified while its being loaded and some of these flags may get set in this process. So changing the verification code to ignore DISABLED records is a no go, as it still needs to verify that the module records are working too.
Also, the weak functions still are calling a trampoline. Even though they should never be called, it is dangerous to leave these weak functions calling a trampoline that is freed, so they should still be set back to nops.
There's two places that need to not skip records that have the ENABLED and the DISABLED flags set. That is where the ftrace_ops is processed and sets the records ref counts, and then later when the function itself is to be updated, and the ENABLED flag gets removed. Add a helper function "skip_record()" that returns true if the record has the DISABLED flag set but not the ENABLED flag.
--- kernel/trace/ftrace.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
kernel/trace/ftrace.c +16 -4
@@ -1644,6 +1644,18 @@ ftrace_find_tramp_ops_any_other(struct dstatic struct ftrace_ops *ftrace_find_tramp_ops_next (struct dyn_ftrace *rec,struct ftrace_ops *ops); +static bool skip_record (struct dyn_ftrace *rec) +{ +/* +* At boot up, weak functions are set to disable. Function tracing +* can be enabled before they are, and they still need to be disabled now. +* If the record is disabled, still continue if it is marked as already +* enabled (this is needed to keep the accounting working). +*/ +return rec->flags &FTRACE_FL_DISABLED && + !(rec->flags &FTRACE_FL_ENABLED ); +} +static bool __ftrace_hash_rec_update (struct ftrace_ops *ops,int filter_hash,bool inc)
@@ -1693,7 +1705,7 @@ static bool __ftrace_hash_rec_update(strint in_hash =0 ;int match =0 ; -if (rec->flags &FTRACE_FL_DISABLED ) +if (skip_record (rec))continue ;if (all) {
@@ -2090,7 +2102,7 @@ static int ftrace_check_record(struct dy ftrace_bug_type =FTRACE_BUG_UNKNOWN ; -if (rec->flags &FTRACE_FL_DISABLED ) +if (skip_record (rec))return FTRACE_UPDATE_IGNORE ;/*
@@ -2205,7 +2217,7 @@ static int ftrace_check_record(struct dyif (update) {/* If there's no more users, clear all flags */ if (!ftrace_rec_count (rec)) - rec->flags =0 ; + rec->flags &=FTRACE_FL_DISABLED ;else /* * Just disable the record, but keep the ops TRAMP
@@ -2599,7 +2611,7 @@ void __weak ftrace_replace_code(int mod_do_for_each_ftrace_rec (pg, rec) { -if (rec->flags &FTRACE_FL_DISABLED ) +if (skip_record (rec))continue ; failed =__ftrace_replace_code (rec, enable);
Greg Kroah-Hartman
maintainerPATCH 141/717 ring-buffer: Have the shortest_full queue be the shortest not longest
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit 3b19d614b61b93a131f463817e08219c9ce1fee3 upstream.
The logic to know when the shortest waiters on the ring buffer should be woken up or not has uses a less than instead of a greater than compare, which causes the shortest_full to actually be the longest.
--- kernel/trace/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ring_buffer.c +1 -1
@@ -1011,7 +1011,7 @@ int ring_buffer_wait(struct trace_buffer nr_pages = cpu_buffer->nr_pages; dirty =ring_buffer_nr_dirty_pages (buffer, cpu);if (!cpu_buffer->shortest_full || - cpu_buffer->shortest_full < full) + cpu_buffer->shortest_full > full) cpu_buffer->shortest_full = full;raw_spin_unlock_irqrestore (&cpu_buffer->reader_lock, flags); if (!pagebusy &&
Greg Kroah-Hartman
maintainerPATCH 78/717 mm/mmap: undo ->mmap() when arch_validate_flags() fails
In reply to Greg Kroah-HartmanFrom: Carlos Llamas <[email protected]>
commit deb0f6562884b5b4beb883d73e66a7d3a1b96d99 upstream.
Commit c462ac288f2c ("mm: Introduce arch_validate_flags()") added a late check in mmap_region() to let architectures validate vm_flags. The check needs to happen after calling ->mmap() as the flags can potentially be modified during this callback.
If arch_validate_flags() check fails we unmap and free the vma. However, the error path fails to undo the ->mmap() call that previously succeeded and depending on the specific ->mmap() implementation this translates to reference increments, memory allocations and other operations what will not be cleaned up.
There are several places (mainly device drivers) where this is an issue. However, one specific example is bpf_map_mmap() which keeps count of the mappings in map->writecnt. The count is incremented on ->mmap() and then decremented on vm_ops->close(). When arch_validate_flags() fails this count is off since bpf_map_mmap_close() is never called.
One can reproduce this issue in arm64 devices with MTE support. Here the vm_flags are checked to only allow VM_MTE if VM_MTE_ALLOWED has been set previously. From userspace then is enough to pass the PROT_MTE flag to mmap() syscall to trigger the arch_validate_flags() failure.
The following program reproduces this issue:
#include <stdio.h> #include <unistd.h> #include <linux/unistd.h> #include <linux/bpf.h> #include <sys/mman.h>
int main(void)
{
union bpf_attr attr = {
.map_type = BPF_MAP_TYPE_ARRAY,
.key_size = sizeof(int),
.value_size = sizeof(long long),
.max_entries = 256,
.map_flags = BPF_F_MMAPABLE,
};
int fd;
fd = syscall(__NR_bpf, BPF_MAP_CREATE, &attr, sizeof(attr));
mmap(NULL, 4096, PROT_WRITE | PROT_MTE, MAP_SHARED, fd, 0);
return 0;}
By manually adding some log statements to the vm_ops callbacks we can confirm that when passing PROT_MTE to mmap() the map->writecnt is off upon ->release():
With PROT_MTE flag:
root@debian:~# ./bpf-test [ 111.263874] bpf_map_write_active_inc: map=9 writecnt=1 [ 111.288763] bpf_map_release: map=9 writecnt=1
Without PROT_MTE flag:
root@debian:~# ./bpf-test [ 157.816912] bpf_map_write_active_inc: map=10 writecnt=1 [ 157.830442] bpf_map_write_active_dec: map=10 writecnt=0 [ 157.832396] bpf_map_release: map=10 writecnt=0
This patch fixes the above issue by calling vm_ops->close() when the arch_validate_flags() check fails, after this we can proceed to unmap and free the vma on the error path.
--- mm/mmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
mm/mmap.c +4 -1
@@ -1845,7 +1845,7 @@ unsigned long mmap_region(struct file *fif (!arch_validate_flags (vma->vm_flags)) { error = -EINVAL ;if (file) - goto unmap_and_free_vma; + goto close_and_free_vma;else goto free_vma; }
@@ -1892,6 +1892,9 @@ out:return addr; +close_and_free_vma: +if (vma->vm_ops && vma->vm_ops->close) + vma->vm_ops->close (vma); unmap_and_free_vma:fput (vma->vm_file); vma->vm_file =NULL ;
Greg Kroah-Hartman
maintainerPATCH 143/717 ring-buffer: Add ring_buffer_wake_waiters()
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit 7e9fbbb1b776d8d7969551565bc246f74ec53b27 upstream.
On closing of a file that represents a ring buffer or flushing the file, there may be waiters on the ring buffer that needs to be woken up and exit the ring_buffer_wait() function.
Add ring_buffer_wake_waiters() to wake up the waiters on the ring buffer and allow them to exit the wait loop.
--- include/linux/ring_buffer.h | 2 +- kernel/trace/ring_buffer.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-)
include/linux/ring_buffer.h +1 -1
@@ -101,7 +101,7 @@ __ring_buffer_alloc(unsigned long size,int ring_buffer_wait (struct trace_buffer *buffer,int cpu,int full);__poll_t ring_buffer_poll_wait (struct trace_buffer *buffer,int cpu,struct file *filp,poll_table *poll_table); - +void ring_buffer_wake_waiters (struct trace_buffer *buffer,int cpu);#define RING_BUFFER_ALL_CPUS -1
kernel/trace/ring_buffer.c +39 -0
@@ -413,6 +413,7 @@ struct rb_irq_work {struct irq_work work;wait_queue_head_t waiters;wait_queue_head_t full_waiters; +long wait_index;bool waiters_pending;bool full_waiters_pending;bool wakeup_full;
@@ -925,6 +926,37 @@ static void rb_wake_up_waiters(struct ir }/** +* ring_buffer_wake_waiters - wake up any waiters on this ring buffer +* @buffer: The ring buffer to wake waiters on +* +* In the case of a file that represents a ring buffer is closing, +* it is prudent to wake up any waiters that are on this. +*/ +void ring_buffer_wake_waiters (struct trace_buffer *buffer,int cpu) +{ +struct ring_buffer_per_cpu *cpu_buffer; +struct rb_irq_work *rbwork; + +if (cpu ==RING_BUFFER_ALL_CPUS ) { + +/* Wake up individual ones too. One level recursion */ +for_each_buffer_cpu (buffer, cpu) +ring_buffer_wake_waiters (buffer, cpu); + + rbwork = &buffer->irq_work; + }else { + cpu_buffer = buffer->buffers[cpu]; + rbwork = &cpu_buffer->irq_work; + } + + rbwork->wait_index++; +/* make sure the waiters see the new index */ +smp_wmb (); + +rb_wake_up_waiters (&rbwork->work); +} + +/** * ring_buffer_wait - wait for input to the ring buffer * @buffer: buffer to wait on * @cpu: the cpu buffer to wait on
@@ -939,6 +971,7 @@ int ring_buffer_wait(struct trace_bufferstruct ring_buffer_per_cpu *cpu_buffer;DEFINE_WAIT (wait);struct rb_irq_work *work; +long wait_index;int ret =0 ;/*
@@ -957,6 +990,7 @@ int ring_buffer_wait(struct trace_buffer work = &cpu_buffer->irq_work; } + wait_index =READ_ONCE (work->wait_index);while (true) {if (full)
@@ -1021,6 +1055,11 @@ int ring_buffer_wait(struct trace_buffer }schedule (); + +/* Make sure to see the new wait index */ +smp_rmb (); +if (wait_index != work->wait_index) +break ; }if (full)
Greg Kroah-Hartman
maintainerPATCH 80/717 xen/gntdev: Accommodate VMA splitting
In reply to Greg Kroah-HartmanFrom: M. Vefa Bicakci <[email protected]>
commit 5c13a4a0291b30191eff9ead8d010e1ca43a4d0c upstream.
Prior to this commit, the gntdev driver code did not handle the following scenario correctly with paravirtualized (PV) Xen domains:
* User process sets up a gntdev mapping composed of two grant mappings (i.e., two pages shared by another Xen domain).
* User process munmap()s one of the pages.
* User process munmap()s the remaining page.
* User process exits.
In the scenario above, the user process would cause the kernel to log the following messages in dmesg for the first munmap(), and the second munmap() call would result in similar log messages:
BUG: Bad page map in process doublemap.test pte:... pmd:...
page:0000000057c97bff refcount:1 mapcount:-1 \
mapping:0000000000000000 index:0x0 pfn:...
...
page dumped because: bad pte
...
file:gntdev fault:0x0 mmap:gntdev_mmap [xen_gntdev] readpage:0x0
...
Call Trace:
<TASK>
dump_stack_lvl+0x46/0x5e
print_bad_pte.cold+0x66/0xb6
unmap_page_range+0x7e5/0xdc0
unmap_vmas+0x78/0xf0
unmap_region+0xa8/0x110
__do_munmap+0x1ea/0x4e0
__vm_munmap+0x75/0x120
__x64_sys_munmap+0x28/0x40
do_syscall_64+0x38/0x90
entry_SYSCALL_64_after_hwframe+0x61/0xcb
...For each munmap() call, the Xen hypervisor (if built with CONFIG_DEBUG) would print out the following and trigger a general protection fault in the affected Xen PV domain:
(XEN) d0v... Attempt to implicitly unmap d0's grant PTE ... (XEN) d0v... Attempt to implicitly unmap d0's grant PTE ...
As of this writing, gntdev_grant_map structure's vma field (referred to as map->vma below) is mainly used for checking the start and end addresses of mappings. However, with split VMAs, these may change, and there could be more than one VMA associated with a gntdev mapping. Hence, remove the use of map->vma and rely on map->pages_vm_start for the original start address and on (map->count << PAGE_SHIFT) for the original mapping size. Let the invalidate() and find_special_page() hooks use these.
Also, given that there can be multiple VMAs associated with a gntdev mapping, move the "mmu_interval_notifier_remove(&map->notifier)" call to the end of gntdev_put_map, so that the MMU notifier is only removed after the closing of the last remaining VMA.
Finally, use an atomic to prevent inadvertent gntdev mapping re-use, instead of using the map->live_grants atomic counter and/or the map->vma pointer (the latter of which is now removed). This prevents the userspace from mmap()'ing (with MAP_FIXED) a gntdev mapping over the same address range as a previously set up gntdev mapping. This scenario can be summarized with the following call-trace, which was valid prior to this commit:
mmap
gntdev_mmap
mmap (repeat mmap with MAP_FIXED over the same address range)
gntdev_invalidate
unmap_grant_pages (sets 'being_removed' entries to true)
gnttab_unmap_refs_async
unmap_single_vma
gntdev_mmap (maps the shared pages again)
munmap
gntdev_invalidate
unmap_grant_pages
(no-op because 'being_removed' entries are true)
unmap_single_vma (For PV domains, Xen reports that a granted page
is being unmapped and triggers a general protection fault in the affected domain, if Xen was built with CONFIG_DEBUG)
The fix for this last scenario could be worth its own commit, but we opted for a single commit, because removing the gntdev_grant_map structure's vma field requires guarding the entry to gntdev_mmap(), and the live_grants atomic counter is not sufficient on its own to prevent the mmap() over a pre-existing mapping.
--- drivers/xen/gntdev-common.h | 3 +- drivers/xen/gntdev.c | 58 ++++++++++++++++++-------------------------- 2 files changed, 27 insertions(+), 34 deletions(-)
drivers/xen/gntdev-common.h +2 -1
@@ -44,9 +44,10 @@ struct gntdev_unmap_notify { };struct gntdev_grant_map { +atomic_t in_use;struct mmu_interval_notifier notifier; +bool notifier_init;struct list_head next; -struct vm_area_struct *vma;int index;int count;int flags;
drivers/xen/gntdev.c +25 -33
131 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 146/717 tracing: Wake up ring buffer waiters on closing of the file
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit f3ddb74ad0790030c9592229fb14d8c451f4e9a8 upstream.
When the file that represents the ring buffer is closed, there may be waiters waiting on more input from the ring buffer. Call ring_buffer_wake_waiters() to wake up any waiters when the file is closed.
--- include/linux/trace_events.h | 1 + kernel/trace/trace.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+)
include/linux/trace_events.h +1 -0
@@ -92,6 +92,7 @@ struct trace_iterator {unsigned int temp_size;char *fmt;/* modified format holder */ unsigned int fmt_size; +long wait_index;/* trace_seq for __print_flags() and __print_symbolic() etc. */ struct trace_seq tmp_seq;
kernel/trace/trace.c +15 -0
@@ -8160,6 +8160,12 @@ static int tracing_buffers_release(struc__trace_array_put (iter->tr); + iter->wait_index++; +/* Make sure the waiters see the new wait_index */ +smp_wmb (); + +ring_buffer_wake_waiters (iter->array_buffer->buffer, iter->cpu_file); +if (info->spare)ring_buffer_free_read_page (iter->array_buffer->buffer, info->spare_cpu, info->spare);
@@ -8313,6 +8319,8 @@ tracing_buffers_splice_read(struct file/* did we read anything? */ if (!spd.nr_pages) { +long wait_index; +if (ret) goto out;
@@ -8320,10 +8328,17 @@ tracing_buffers_splice_read(struct fileif ((file->f_flags &O_NONBLOCK ) || (flags &SPLICE_F_NONBLOCK )) goto out; + wait_index =READ_ONCE (iter->wait_index); + ret =wait_on_pipe (iter, iter->tr->buffer_percent);if (ret) goto out; +/* Make sure we see the new wait_index */ +smp_rmb (); +if (wait_index != iter->wait_index) + goto out; + goto again; }
Greg Kroah-Hartman
maintainerPATCH 187/717 ARM: 9243/1: riscpc: Unbreak the build
In reply to Greg Kroah-HartmanFrom: Bart Van Assche <[email protected]>
[ Upstream commit 32844a8eecaa4a3e65841c53e43e04a9087d1ef6 ]
This patch fixes the following build error:
In file included from ./include/linux/io.h:13,
from ./arch/arm/mach-rpc/include/mach/uncompress.h:9, from arch/arm/boot/compressed/misc.c:31:./arch/arm/include/asm/io.h:85:22: error: conflicting types for ‘__raw_writeb’
85 | #define __raw_writeb __raw_writeb
| ^~~~~~~~~~~~
./arch/arm/include/asm/io.h:86:20: note: in expansion of macro ‘__raw_writeb’
86 | static inline void __raw_writeb(u8 val, volatile void __iomem *addr)
| ^~~~~~~~~~~~
In file included from arch/arm/boot/compressed/misc.c:26:
arch/arm/boot/compressed/misc-ep93xx.h:13:20: note: previous definition of ‘__raw_writeb’ was here
13 | static inline void __raw_writeb(unsigned char value, unsigned int ptr)
| ^~~~~~~~~~~~To: Russell King <[email protected]>
--- arch/arm/boot/compressed/misc.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/compressed/misc.c +2 -0
@@ -23,7 +23,9 @@ unsigned int __machine_arch_type;#include <linux/types.h> #include <linux/linkage.h> #include "misc.h" +#ifdef CONFIG_ARCH_EP93XX #include "misc-ep93xx.h" +#endif static void putstr (const char *ptr);
Signature · 9 lines
2.35.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Greg Kroah-Hartman
maintainerPATCH 131/717 ext4: fix i_version handling in ext4
In reply to Greg Kroah-HartmanFrom: Jeff Layton <[email protected]>
commit a642c2c0827f5604a93f9fa1e5701eecdce4ae22 upstream.
ext4 currently updates the i_version counter when the atime is updated during a read. This is less than ideal as it can cause unnecessary cache invalidations with NFSv4 and unnecessary remeasurements for IMA.
The increment in ext4_mark_iloc_dirty is also problematic since it can corrupt the i_version counter for ea_inodes. We aren't bumping the file times in ext4_mark_iloc_dirty, so changing the i_version there seems wrong, and is the cause of both problems.
Remove that callsite and add increments to the setattr, setxattr and ioctl codepaths, at the same times that we update the ctime. The i_version bump that already happens during timestamp updates should take care of the rest.
In ext4_move_extents, increment the i_version on both inodes, and also add in missing ctime updates.
[ Some minor updates since we've already enabled the i_version counter
unconditionally already via another patch series. -- TYT ]
--- fs/ext4/inode.c | 14 +++++--------- fs/ext4/ioctl.c | 4 ++++ fs/ext4/xattr.c | 1 + 3 files changed, 10 insertions(+), 9 deletions(-)
fs/ext4/inode.c +5 -9
@@ -5347,6 +5347,7 @@ int ext4_setattr(struct user_namespace *int error, rc =0 ;int orphan =0 ;const unsigned int ia_valid = attr->ia_valid; +bool inc_ivers = true;if (unlikely (ext4_forced_shutdown (EXT4_SB (inode->i_sb))))return -EIO ;
@@ -5432,8 +5433,8 @@ int ext4_setattr(struct user_namespace *return -EINVAL ; } -if (attr->ia_size != inode->i_size) -inode_inc_iversion (inode); +if (attr->ia_size == inode->i_size) + inc_ivers = false;if (shrink) {if (ext4_should_order_data (inode)) {
@@ -5535,6 +5536,8 @@ out_mmap_sem: }if (!error) { +if (inc_ivers) +inode_inc_iversion (inode);setattr_copy (mnt_userns, inode, attr);mark_inode_dirty (inode); }
@@ -5738,13 +5741,6 @@ int ext4_mark_iloc_dirty(handle_t *handl }ext4_fc_track_inode (handle, inode); -/* -* ea_inodes are using i_version for storing reference count, don't -* mess with it -*/ -if (!(EXT4_I (inode)->i_flags &EXT4_EA_INODE_FL )) -inode_inc_iversion (inode); -/* the do_update_inode consumes one bh->b_count */ get_bh (iloc->bh);
fs/ext4/ioctl.c +4 -0
@@ -442,6 +442,7 @@ static long swap_inode_boot_loader(strucswap_inode_data (inode, inode_bl); inode->i_ctime = inode_bl->i_ctime =current_time (inode); +inode_inc_iversion (inode); inode->i_generation =prandom_u32 (); inode_bl->i_generation =prandom_u32 ();
@@ -655,6 +656,7 @@ static int ext4_ioctl_setflags(struct inext4_set_inode_flags (inode, false); inode->i_ctime =current_time (inode); +inode_inc_iversion (inode); err =ext4_mark_iloc_dirty (handle, inode, &iloc); flags_err:
@@ -765,6 +767,7 @@ static int ext4_ioctl_setproject(structEXT4_I (inode)->i_projid = kprojid; inode->i_ctime =current_time (inode); +inode_inc_iversion (inode); out_dirty: rc =ext4_mark_iloc_dirty (handle, inode, &iloc);if (!err)
@@ -1178,6 +1181,7 @@ static long __ext4_ioctl(struct file *fi err =ext4_reserve_inode_write (handle, inode, &iloc);if (err ==0 ) { inode->i_ctime =current_time (inode); +inode_inc_iversion (inode); inode->i_generation = generation; err =ext4_mark_iloc_dirty (handle, inode, &iloc); }
fs/ext4/xattr.c +1 -0
@@ -2412,6 +2412,7 @@ retry_inode:if (!error) {ext4_xattr_update_super_block (handle, inode->i_sb); inode->i_ctime =current_time (inode); +inode_inc_iversion (inode);if (!value) no_expand =0 ; error =ext4_mark_iloc_dirty (handle, inode, &is.iloc);
Greg Kroah-Hartman
maintainerPATCH 155/717 efi: libstub: drop pointless get_memory_map() call
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
commit d80ca810f096ff66f451e7a3ed2f0cd9ef1ff519 upstream.
Currently, the non-x86 stub code calls get_memory_map() redundantly, given that the data it returns is never used anywhere. So drop the call.
--- drivers/firmware/efi/libstub/fdt.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/firmware/efi/libstub/fdt.c +0 -8
@@ -280,14 +280,6 @@ efi_status_t allocate_new_fdt_and_exit_b goto fail; } -/* -* Now that we have done our final memory allocation (and free) -* we can get the memory map key needed for exit_boot_services(). -*/ - status =efi_get_memory_map (&map); -if (status !=EFI_SUCCESS ) - goto fail_free_new_fdt; - status =update_fdt ((void *)fdt_addr, fdt_size, (void *)*new_fdt_addr,MAX_FDT_SIZE , cmdline_ptr, initrd_addr, initrd_size);
Greg Kroah-Hartman
maintainerPATCH 82/717 serial: cpm_uart: Dont request IRQ too early for console port
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
commit 30963b2f75bfdbbcf1cc5d80bf88fec7aaba808d upstream.
The following message is seen during boot and the activation of console port gets delayed until normal serial ports activation.
[ 0.001346] irq: no irq domain found for pic@930 !
The console port doesn't need irq, perform irq reservation later, during cpm_uart probe.
While at it, don't use NO_IRQ but 0 which is the value returned by irq_of_parse_and_map() in case of error. By chance powerpc's NO_IRQ has value 0 but on some architectures it is -1.
--- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
drivers/tty/serial/cpm_uart/cpm_uart_core.c +10 -12
@@ -1214,12 +1214,6 @@ static int cpm_uart_init_port(struct dev pinfo->port.fifosize = pinfo->tx_nrfifos * pinfo->tx_fifosize;spin_lock_init (&pinfo->port.lock); - pinfo->port.irq =irq_of_parse_and_map (np,0 ); -if (pinfo->port.irq ==NO_IRQ ) { - ret = -EINVAL ; - goto out_pram; - } -for (i =0 ; i <NUM_GPIOS ; i++) {struct gpio_desc *gpiod;
@@ -1229,7 +1223,7 @@ static int cpm_uart_init_port(struct devif (IS_ERR (gpiod)) { ret =PTR_ERR (gpiod); - goto out_irq; + goto out_pram; }if (gpiod) {
@@ -1255,8 +1249,6 @@ static int cpm_uart_init_port(struct devreturn cpm_uart_request_port (&pinfo->port); -out_irq: -irq_dispose_mapping (pinfo->port.irq); out_pram:cpm_uart_unmap_pram (pinfo, pram); out_mem:
@@ -1436,11 +1428,17 @@ static int cpm_uart_probe(struct platfor/* initialize the device pointer for the port */ pinfo->port.dev = &ofdev->dev; + pinfo->port.irq =irq_of_parse_and_map (ofdev->dev.of_node,0 ); +if (!pinfo->port.irq) +return -EINVAL ; + ret =cpm_uart_init_port (ofdev->dev.of_node, pinfo); -if (ret) -return ret; +if (!ret) +return uart_add_one_port (&cpm_reg, &pinfo->port); + +irq_dispose_mapping (pinfo->port.irq); -return uart_add_one_port (&cpm_reg, &pinfo->port); +return ret; }static int cpm_uart_remove (struct platform_device *ofdev)
Greg Kroah-Hartman
maintainerPATCH 66/717 dmaengine: qcom-adm: fix wrong calling convention for prep_slave_sg
In reply to Greg Kroah-HartmanFrom: Christian Marangi <[email protected]>
commit b9d2140c3badf4107973ad77c5a0ec3075705c85 upstream.
The calling convention for pre_slave_sg is to return NULL on error and provide an error log to the system. Qcom-adm instead provide error pointer when an error occur. This indirectly cause kernel panic for example for the nandc driver that checks only if the pointer returned by device_prep_slave_sg is not NULL. Returning an error pointer makes nandc think the device_prep_slave_sg function correctly completed and makes the kernel panics later in the code.
While nandc is the one that makes the kernel crash, it was pointed out that the real problem is qcom-adm not following calling convention for that function.
To fix this, drop returning error pointer and return NULL with an error log.
--- drivers/dma/qcom/qcom_adm.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
drivers/dma/qcom/qcom_adm.c +13 -7
@@ -379,13 +379,13 @@ static struct dma_async_tx_descriptor *aif (blk_size <0 ) {dev_err (adev->dev,"invalid burst value: %d\n" , burst); -return ERR_PTR (-EINVAL ); +return NULL ; } crci = achan->crci &0xf ;if (!crci || achan->crci >0x1f ) {dev_err (adev->dev,"invalid crci value\n" ); -return ERR_PTR (-EINVAL ); +return NULL ; } }
@@ -403,8 +403,10 @@ static struct dma_async_tx_descriptor *a } async_desc =kzalloc (sizeof (*async_desc),GFP_NOWAIT ); -if (!async_desc) -return ERR_PTR (-ENOMEM ); +if (!async_desc) { +dev_err (adev->dev,"not enough memory for async_desc struct\n" ); +return NULL ; + } async_desc->mux = achan->mux ?ADM_CRCI_CTL_MUX_SEL :0 ; async_desc->crci = crci;
@@ -414,8 +416,10 @@ static struct dma_async_tx_descriptor *asizeof (*cple) +2 *ADM_DESC_ALIGN ; async_desc->cpl =kzalloc (async_desc->dma_len,GFP_NOWAIT ); -if (!async_desc->cpl) +if (!async_desc->cpl) { +dev_err (adev->dev,"not enough memory for cpl struct\n" ); goto free; + } async_desc->adev = adev;
@@ -437,8 +441,10 @@ static struct dma_async_tx_descriptor *a async_desc->dma_addr =dma_map_single (adev->dev, async_desc->cpl, async_desc->dma_len,DMA_TO_DEVICE ); -if (dma_mapping_error (adev->dev, async_desc->dma_addr)) +if (dma_mapping_error (adev->dev, async_desc->dma_addr)) { +dev_err (adev->dev,"dma mapping error for cpl\n" ); goto free; + } cple_addr = async_desc->dma_addr + ((void *)cple - async_desc->cpl);
@@ -454,7 +460,7 @@ static struct dma_async_tx_descriptor *a free:kfree (async_desc); -return ERR_PTR (-ENOMEM ); +return NULL ; }/**
Greg Kroah-Hartman
maintainerPATCH 79/717 xen/gntdev: Prevent leaking grants
In reply to Greg Kroah-HartmanFrom: M. Vefa Bicakci <[email protected]>
commit 0991028cd49567d7016d1b224fe0117c35059f86 upstream.
Prior to this commit, if a grant mapping operation failed partially, some of the entries in the map_ops array would be invalid, whereas all of the entries in the kmap_ops array would be valid. This in turn would cause the following logic in gntdev_map_grant_pages to become invalid:
for (i = 0; i < map->count; i++) {
if (map->map_ops[i].status == GNTST_okay) {
map->unmap_ops[i].handle = map->map_ops[i].handle;
if (!use_ptemod)
alloced++;
}
if (use_ptemod) {
if (map->kmap_ops[i].status == GNTST_okay) {
if (map->map_ops[i].status == GNTST_okay)
alloced++;
map->kunmap_ops[i].handle = map->kmap_ops[i].handle;
}
}
}
...
atomic_add(alloced, &map->live_grants);Assume that use_ptemod is true (i.e., the domain mapping the granted pages is a paravirtualized domain). In the code excerpt above, note that the "alloced" variable is only incremented when both kmap_ops[i].status and map_ops[i].status are set to GNTST_okay (i.e., both mapping operations are successful). However, as also noted above, there are cases where a grant mapping operation fails partially, breaking the assumption of the code excerpt above.
The aforementioned causes map->live_grants to be incorrectly set. In some cases, all of the map_ops mappings fail, but all of the kmap_ops mappings succeed, meaning that live_grants may remain zero. This in turn makes it impossible to unmap the successfully grant-mapped pages pointed to by kmap_ops, because unmap_grant_pages has the following snippet of code at its beginning:
if (atomic_read(&map->live_grants) == 0)
return; /* Nothing to do */
In other cases where only some of the map_ops mappings fail but all kmap_ops mappings succeed, live_grants is made positive, but when the user requests unmapping the grant-mapped pages, __unmap_grant_pages_done will then make map->live_grants negative, because the latter function does not check if all of the pages that were requested to be unmapped were actually unmapped, and the same function unconditionally subtracts "data->count" (i.e., a value that can be greater than map->live_grants) from map->live_grants. The side effects of a negative live_grants value have not been studied.
The net effect of all of this is that grant references are leaked in one of the above conditions. In Qubes OS v4.1 (which uses Xen's grant mechanism extensively for X11 GUI isolation), this issue manifests itself with warning messages like the following to be printed out by the Linux kernel in the VM that had granted pages (that contain X11 GUI window data) to dom0: "g.e. 0x1234 still pending", especially after the user rapidly resizes GUI VM windows (causing some grant-mapping operations to partially or completely fail, due to the fact that the VM unshares some of the pages as part of the window resizing, making the pages impossible to grant-map from dom0).
The fix for this issue involves counting all successful map_ops and kmap_ops mappings separately, and then adding the sum to live_grants. During unmapping, only the number of successfully unmapped grants is subtracted from live_grants. The code is also modified to check for negative live_grants values after the subtraction and warn the user.
--- drivers/xen/gntdev.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
drivers/xen/gntdev.c +17 -5
@@ -367,8 +367,7 @@ int gntdev_map_grant_pages(struct gntdevfor (i =0 ; i < map->count; i++) {if (map->map_ops[i].status == GNTST_okay) { map->unmap_ops[i].handle = map->map_ops[i].handle; -if (!use_ptemod) - alloced++; + alloced++; }else if (!err) err = -EINVAL ;
@@ -377,8 +376,7 @@ int gntdev_map_grant_pages(struct gntdevif (use_ptemod) {if (map->kmap_ops[i].status == GNTST_okay) { -if (map->map_ops[i].status == GNTST_okay) - alloced++; + alloced++; map->kunmap_ops[i].handle = map->kmap_ops[i].handle; }else if (!err) err = -EINVAL ;
@@ -394,8 +392,14 @@ static void __unmap_grant_pages_done(intunsigned int i;struct gntdev_grant_map *map = data->data;unsigned int offset = data->unmap_ops - map->unmap_ops; +int successful_unmaps =0 ; +int live_grants;for (i =0 ; i < data->count; i++) { +if (map->unmap_ops[offset + i].status == GNTST_okay && + map->unmap_ops[offset + i].handle !=INVALID_GRANT_HANDLE ) + successful_unmaps++; +WARN_ON (map->unmap_ops[offset + i].status != GNTST_okay && map->unmap_ops[offset + i].handle !=INVALID_GRANT_HANDLE ); pr_debug("unmap handle=%d st=%d\n",
@@ -403,6 +407,10 @@ static void __unmap_grant_pages_done(int map->unmap_ops[offset+i].status); map->unmap_ops[offset+i].handle =INVALID_GRANT_HANDLE ;if (use_ptemod) { +if (map->kunmap_ops[offset + i].status == GNTST_okay && + map->kunmap_ops[offset + i].handle !=INVALID_GRANT_HANDLE ) + successful_unmaps++; +WARN_ON (map->kunmap_ops[offset + i].status != GNTST_okay && map->kunmap_ops[offset + i].handle !=INVALID_GRANT_HANDLE ); pr_debug("kunmap handle=%u st=%d\n",
@@ -411,11 +419,15 @@ static void __unmap_grant_pages_done(int map->kunmap_ops[offset+i].handle =INVALID_GRANT_HANDLE ; } } +/* * Decrease the live-grant counter. This must happen after the loop to * prevent premature reuse of the grants by gnttab_mmap(). */ -atomic_sub (data->count, &map->live_grants); + live_grants =atomic_sub_return (successful_unmaps, &map->live_grants); +if (WARN_ON (live_grants <0 )) +pr_err ("%s: live_grants became negative (%d) after unmapping %d pages!\n" , + __func__, live_grants, successful_unmaps);/* Release reference taken by __unmap_grant_pages */ gntdev_put_map (NULL , map);
Greg Kroah-Hartman
maintainerPATCH 86/717 NFSD: Protect against send buffer overflow in NFSv3 READDIR
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
commit 640f87c190e0d1b2a0fcb2ecf6d2cd53b1c41991 upstream.
Since before the git era, NFSD has conserved the number of pages held by each nfsd thread by combining the RPC receive and send buffers into a single array of pages. This works because there are no cases where an operation needs a large RPC Call message and a large RPC Reply message at the same time.
Once an RPC Call has been received, svc_process() updates svc_rqst::rq_res to describe the part of rq_pages that can be used for constructing the Reply. This means that the send buffer (rq_res) shrinks when the received RPC record containing the RPC Call is large.
A client can force this shrinkage on TCP by sending a correctly- formed RPC Call header contained in an RPC record that is excessively large. The full maximum payload size cannot be constructed in that case.
Thanks to Aleksi Illikainen and Kari Hulkko for uncovering this issue.
--- fs/nfsd/nfs3proc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
fs/nfsd/nfs3proc.c +4 -3
@@ -550,13 +550,14 @@ static void nfsd3_init_dirlist_pages(str {struct xdr_buf *buf = &resp->dirlist;struct xdr_stream *xdr = &resp->xdr; - - count =clamp (count, (u32)(XDR_UNIT *2 ),svc_max_payload (rqstp)); + unsigned int sendbuf = min_t(unsigned int, rqstp->rq_res.buflen, +svc_max_payload (rqstp));memset (buf,0 ,sizeof (*buf));/* Reserve room for the NULL ptr & eof flag (-2 words) */ - buf->buflen = count -XDR_UNIT *2 ; + buf->buflen =clamp (count, (u32)(XDR_UNIT *2 ), sendbuf); + buf->buflen -=XDR_UNIT *2 ; buf->pages = rqstp->rq_next_page; rqstp->rq_next_page += (buf->buflen +PAGE_SIZE -1 ) >>PAGE_SHIFT ;
Greg Kroah-Hartman
maintainerPATCH 176/717 selinux: use "grep -E" instead of "egrep"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
commit c969bb8dbaf2f3628927eae73e7c579a74cf1b6e upstream.
The latest version of grep claims that egrep is now obsolete so the build now contains warnings that look like:
egrep: warning: egrep is obsolescent; using grep -E
fix this by using "grep -E" instead.
--- scripts/selinux/install_policy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/selinux/install_policy.sh +1 -1
@@ -78,7 +78,7 @@ cd /etc/selinux/dummy/contexts/files $SF -F file_contexts / mounts=`cat /proc/$$/mounts | \ - egrep "ext[234]|jfs|xfs|reiserfs|jffs2|gfs2|btrfs|f2fs|ocfs2" | \ + grep -E "ext[234]|jfs|xfs|reiserfs|jffs2|gfs2|btrfs|f2fs|ocfs2" | \ awk '{ print $2 '}` $SF -F file_contexts $mounts
Greg Kroah-Hartman
maintainerPATCH 87/717 NFSD: Protect against send buffer overflow in NFSv2 READ
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
commit 401bc1f90874280a80b93f23be33a0e7e2d1f912 upstream.
Since before the git era, NFSD has conserved the number of pages held by each nfsd thread by combining the RPC receive and send buffers into a single array of pages. This works because there are no cases where an operation needs a large RPC Call message and a large RPC Reply at the same time.
Once an RPC Call has been received, svc_process() updates svc_rqst::rq_res to describe the part of rq_pages that can be used for constructing the Reply. This means that the send buffer (rq_res) shrinks when the received RPC record containing the RPC Call is large.
A client can force this shrinkage on TCP by sending a correctly- formed RPC Call header contained in an RPC record that is excessively large. The full maximum payload size cannot be constructed in that case.
--- fs/nfsd/nfsproc.c | 1 + 1 file changed, 1 insertion(+)
fs/nfsd/nfsproc.c +1 -0
@@ -182,6 +182,7 @@ nfsd_proc_read(struct svc_rqst *rqstp) argp->count, argp->offset); argp->count =min_t (u32, argp->count,NFSSVC_MAXBLKSIZE_V2 ); + argp->count =min_t (u32, argp->count, rqstp->rq_res.buflen); v =0 ; len = argp->count;
Greg Kroah-Hartman
maintainerPATCH 90/717 powercap: intel_rapl: Use standard Energy Unit for SPR Dram RAPL domain
In reply to Greg Kroah-HartmanFrom: Zhang Rui <[email protected]>
commit 4c081324df5608b73428662ca54d5221ea03a6bd upstream.
Intel Xeon servers used to use a fixed energy resolution (15.3uj) for Dram RAPL domain. But on SPR, Dram RAPL domain follows the standard energy resolution as described in MSR_RAPL_POWER_UNIT.
Remove the SPR dram_domain_energy_unit quirk.
--- drivers/powercap/intel_rapl_common.c | 1 - 1 file changed, 1 deletion(-)
drivers/powercap/intel_rapl_common.c +0 -1
@@ -1035,7 +1035,6 @@ static const struct rapl_defaults rapl_d .check_unit = rapl_check_unit_core, .set_floor_freq = set_floor_freq_default, .compute_time_window = rapl_compute_time_window_core, - .dram_domain_energy_unit = 15300, .psys_domain_energy_unit = 1000000000, .spr_psys_bits = true, };
Greg Kroah-Hartman
maintainerPATCH 71/717 drm/udl: Restore display mode on resume
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 6d6e732835db92e66c28dbcf258a7e3d3c71420d upstream.
Restore the display mode whne resuming from suspend. Currently, the display remains dark.
On resume, the CRTC's mode does not change, but the 'active' flag changes to 'true'. Taking this into account when considering a mode switch restores the display mode.
The bug is reproducable by using Gnome with udl and observing the adapter's suspend/resume behavior.
Actually, the whole check added in udl_simple_display_pipe_enable() about the crtc_state->mode_changed was bogus. We should drop the whole check and always apply the mode change in this function.
[ tiwai -- Drop the mode_changed check entirely instead, per Daniel's
suggestion ]
--- drivers/gpu/drm/udl/udl_modeset.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/udl/udl_modeset.c +0 -3
@@ -382,9 +382,6 @@ udl_simple_display_pipe_enable(struct drudl_handle_damage (fb, &shadow_plane_state->data[0 ],0 ,0 , fb->width, fb->height); -if (!crtc_state->mode_changed) -return ; -/* enable display */ udl_crtc_write_mode_to_hw (crtc); }
Greg Kroah-Hartman
maintainerPATCH 65/717 dmaengine: qcom-adm: fix wrong sizeof config in slave_config
In reply to Greg Kroah-HartmanFrom: Christian Marangi <[email protected]>
commit 7c8765308371be30f50c1b5b97618b731514b207 upstream.
Fix broken slave_config function that uncorrectly compare the peripheral_size with the size of the config pointer instead of the size of the config struct. This cause the crci value to be ignored and cause a kernel panic on any slave that use adm driver.
To fix this, compare to the size of the struct and NOT the size of the pointer.
--- drivers/dma/qcom/qcom_adm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/qcom/qcom_adm.c +1 -1
@@ -494,7 +494,7 @@ static int adm_slave_config(struct dma_chan *chan, struct dma_slave_config *cfg)spin_lock_irqsave (&achan->vc.lock, flag);memcpy (&achan->slave, cfg,sizeof (struct dma_slave_config )); -if (cfg->peripheral_size ==sizeof (config)) +if (cfg->peripheral_size ==sizeof (*config)) achan->crci = config->crci;spin_unlock_irqrestore (&achan->vc.lock, flag);
Signature · 1 line
2.38.0
Greg Kroah-Hartman
maintainerPATCH 160/717 KVM: x86/emulator: Fix handing of POP SS to correctly set interruptibility
In reply to Greg Kroah-HartmanFrom: Michal Luczaj <[email protected]>
commit 6aa5c47c351b22c21205c87977c84809cd015fcf upstream.
The emulator checks the wrong variable while setting the CPU interruptibility state, the target segment is embedded in the instruction opcode, not the ModR/M register. Fix the condition.
--- arch/x86/kvm/emulate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/emulate.c +1 -1
@@ -1955,7 +1955,7 @@ static int em_pop_sreg(struct x86_emulatif (rc !=X86EMUL_CONTINUE )return rc; -if (ctxt->modrm_reg ==VCPU_SREG_SS ) +if (seg ==VCPU_SREG_SS ) ctxt->interruptibility =KVM_X86_SHADOW_INT_MOV_SS ;if (ctxt->op_bytes >2 )rsp_increment (ctxt, ctxt->op_bytes -2 );
Greg Kroah-Hartman
maintainerPATCH 133/717 ext4: fix miss release buffer head in ext4_fc_write_inode
In reply to Greg Kroah-HartmanFrom: Ye Bin <[email protected]>
commit ccbf8eeb39f2ff00b54726a2b20b35d788c4ecb5 upstream.
In 'ext4_fc_write_inode' function first call 'ext4_get_inode_loc' get 'iloc', after use it miss release 'iloc.bh'.
So just release 'iloc.bh' before 'ext4_fc_write_inode' return.
--- fs/ext4/fast_commit.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
fs/ext4/fast_commit.c +9 -6
@@ -874,22 +874,25 @@ static int ext4_fc_write_inode(struct in tl.fc_tag =cpu_to_le16 (EXT4_FC_TAG_INODE ); tl.fc_len =cpu_to_le16 (inode_len +sizeof (fc_inode.fc_ino)); + ret = -ECANCELED ; dst =ext4_fc_reserve_space (inode->i_sb,sizeof (tl) + inode_len +sizeof (fc_inode.fc_ino), crc);if (!dst) -return -ECANCELED ; + goto err;if (!ext4_fc_memcpy (inode->i_sb, dst, &tl,sizeof (tl), crc)) -return -ECANCELED ; + goto err; dst +=sizeof (tl);if (!ext4_fc_memcpy (inode->i_sb, dst, &fc_inode,sizeof (fc_inode), crc)) -return -ECANCELED ; + goto err; dst +=sizeof (fc_inode);if (!ext4_fc_memcpy (inode->i_sb, dst, (u8 *)ext4_raw_inode (&iloc), inode_len, crc)) -return -ECANCELED ; - -return 0 ; + goto err; + ret =0 ; +err: +brelse (iloc.bh); +return ret; }/*
Greg Kroah-Hartman
maintainerPATCH 134/717 ext4: fix potential memory leak in ext4_fc_record_modified_inode()
In reply to Greg Kroah-HartmanFrom: Ye Bin <[email protected]>
commit 9305721a309fa1bd7c194e0d4a2335bf3b29dca4 upstream.
As krealloc may return NULL, in this case 'state->fc_modified_inodes' may not be freed by krealloc, but 'state->fc_modified_inodes' already set NULL. Then will lead to 'state->fc_modified_inodes' memory leak.
--- fs/ext4/fast_commit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
fs/ext4/fast_commit.c +5 -3
@@ -1494,13 +1494,15 @@ static int ext4_fc_record_modified_inodeif (state->fc_modified_inodes[i] == ino)return 0 ;if (state->fc_modified_inodes_used == state->fc_modified_inodes_size) { - state->fc_modified_inodes =krealloc ( - state->fc_modified_inodes, +int *fc_modified_inodes; + + fc_modified_inodes =krealloc (state->fc_modified_inodes,sizeof (int ) * (state->fc_modified_inodes_size +EXT4_FC_REPLAY_REALLOC_INCREMENT ),GFP_KERNEL ); -if (!state->fc_modified_inodes) +if (!fc_modified_inodes)return -ENOMEM ; + state->fc_modified_inodes = fc_modified_inodes; state->fc_modified_inodes_size +=EXT4_FC_REPLAY_REALLOC_INCREMENT ; }
Greg Kroah-Hartman
maintainerPATCH 69/717 drm/virtio: Unlock reservations on dma_resv_reserve_fences() error
In reply to Greg Kroah-HartmanFrom: Dmitry Osipenko <[email protected]>
commit 0f877398d30e1df657a31a62f7c7de1869b072b5 upstream.
Unlock reservations on dma_resv_reserve_fences() error to fix recursive locking of the reservations when this error happens.
--- drivers/gpu/drm/virtio/virtgpu_gem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_gem.c +3 -1
@@ -228,8 +228,10 @@ int virtio_gpu_array_lock_resv(struct vifor (i =0 ; i < objs->nents; ++i) { ret =dma_resv_reserve_fences (objs->objs[i]->resv,1 ); -if (ret) +if (ret) { +virtio_gpu_array_unlock_resv (objs);return ret; + } }return ret; }
Greg Kroah-Hartman
maintainerPATCH 129/717 ext4: ext4_read_bh_lock() should submit IO if the buffer isnt uptodate
In reply to Greg Kroah-HartmanFrom: Zhang Yi <[email protected]>
commit 0b73284c564d3ae4feef4bc920292f004acf4980 upstream.
Recently we notice that ext4 filesystem would occasionally fail to read metadata from disk and report error message, but the disk and block layer looks fine. After analyse, we lockon commit 88dbcbb3a484 ("blkdev: avoid migration stalls for blkdev pages"). It provide a migration method for the bdev, we could move page that has buffers without extra users now, but it lock the buffers on the page, which breaks the fragile metadata read operation on ext4 filesystem, ext4_read_bh_lock() was copied from ll_rw_block(), it depends on the assumption of that locked buffer means it is under IO. So it just trylock the buffer and skip submit IO if it lock failed, after wait_on_buffer() we conclude IO error because the buffer is not uptodate.
This issue could be easily reproduced by add some delay just after buffer_migrate_lock_buffers() in __buffer_migrate_folio() and do fsstress on ext4 filesystem.
EXT4-fs error (device pmem1): __ext4_find_entry:1658: inode #73193:
comm fsstress: reading directory lblock 0
EXT4-fs error (device pmem1): __ext4_find_entry:1658: inode #75334:
comm fsstress: reading directory lblock 0
Fix it by removing the trylock logic in ext4_read_bh_lock(), just lock the buffer and submit IO if it's not uptodate, and also leave over readahead helper.
--- fs/ext4/super.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
fs/ext4/super.c +5 -11
@@ -205,19 +205,12 @@ int ext4_read_bh(struct buffer_head *bh,int ext4_read_bh_lock (struct buffer_head *bh,int op_flags,bool wait) { -if (trylock_buffer (bh)) { -if (wait) -return ext4_read_bh (bh, op_flags,NULL ); +lock_buffer (bh); +if (!wait) {ext4_read_bh_nowait (bh, op_flags,NULL );return 0 ; } -if (wait) { -wait_on_buffer (bh); -if (buffer_uptodate (bh)) -return 0 ; -return -EIO ; - } -return 0 ; +return ext4_read_bh (bh, op_flags,NULL ); }/*
@@ -264,7 +257,8 @@ void ext4_sb_breadahead_unmovable(structstruct buffer_head *bh =sb_getblk_gfp (sb, block,0 );if (likely (bh)) { -ext4_read_bh_lock (bh,REQ_RAHEAD , false); +if (trylock_buffer (bh)) +ext4_read_bh_nowait (bh,REQ_RAHEAD ,NULL );brelse (bh); } }
Greg Kroah-Hartman
maintainerPATCH 172/717 drm/i915: Fix watermark calculations for DG2 CCS+CC modifier
In reply to Greg Kroah-HartmanFrom: Ville Syrjälä <[email protected]>
commit b2e3a1af8cce4117de06ff1a4eab0749753ede27 upstream.
Take the DG2 CCS+CC modifier into account when calculating the watermarks. Othwerwise we'll calculate the watermarks thinking this tile-4 modifier is linear.
The rc_surface part is actually a nop since that is not used for any glk+ platform.
--- drivers/gpu/drm/i915/intel_pm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +4 -2
@@ -5312,7 +5312,8 @@ skl_compute_wm_params(const struct intel modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS || modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC || modifier ==I915_FORMAT_MOD_4_TILED_DG2_RC_CCS || - modifier ==I915_FORMAT_MOD_4_TILED_DG2_MC_CCS ; + modifier ==I915_FORMAT_MOD_4_TILED_DG2_MC_CCS || + modifier ==I915_FORMAT_MOD_4_TILED_DG2_RC_CCS_CC ; wp->x_tiled = modifier ==I915_FORMAT_MOD_X_TILED ; wp->rc_surface = modifier ==I915_FORMAT_MOD_Y_TILED_CCS || modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
@@ -5320,7 +5321,8 @@ skl_compute_wm_params(const struct intel modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS || modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC || modifier ==I915_FORMAT_MOD_4_TILED_DG2_RC_CCS || - modifier ==I915_FORMAT_MOD_4_TILED_DG2_MC_CCS ; + modifier ==I915_FORMAT_MOD_4_TILED_DG2_MC_CCS || + modifier ==I915_FORMAT_MOD_4_TILED_DG2_RC_CCS_CC ; wp->is_planar =intel_format_info_is_yuv_semiplanar (format, modifier); wp->width = width;
Greg Kroah-Hartman
maintainerPATCH 94/717 slimbus: qcom-ngd: cleanup in probe error path
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 16f14551d0df9e7cd283545d7d748829594d912f upstream.
Add proper error path in probe() to cleanup resources previously acquired/allocated to fix warnings visible during probe deferral:
notifier callback qcom_slim_ngd_ssr_notify already registered
WARNING: CPU: 6 PID: 70 at kernel/notifier.c:28 notifier_chain_register+0x5c/0x90 Modules linked in: CPU: 6 PID: 70 Comm: kworker/u16:1 Not tainted 6.0.0-rc3-next-20220830 #380 Call trace: notifier_chain_register+0x5c/0x90 srcu_notifier_chain_register+0x44/0x90 qcom_register_ssr_notifier+0x38/0x4c qcom_slim_ngd_ctrl_probe+0xd8/0x400 platform_probe+0x6c/0xe0 really_probe+0xbc/0x2d4 __driver_probe_device+0x78/0xe0 driver_probe_device+0x3c/0x12c __device_attach_driver+0xb8/0x120 bus_for_each_drv+0x78/0xd0 __device_attach+0xa8/0x1c0 device_initial_probe+0x18/0x24 bus_probe_device+0xa0/0xac deferred_probe_work_func+0x88/0xc0 process_one_work+0x1d4/0x320 worker_thread+0x2cc/0x44c kthread+0x110/0x114 ret_from_fork+0x10/0x20
--- drivers/slimbus/qcom-ngd-ctrl.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/slimbus/qcom-ngd-ctrl.c +11 -2
@@ -1576,18 +1576,27 @@ static int qcom_slim_ngd_ctrl_probe(stru ctrl->pdr =pdr_handle_alloc (slim_pd_status, ctrl);if (IS_ERR (ctrl->pdr)) {dev_err (dev,"Failed to init PDR handle\n" ); -return PTR_ERR (ctrl->pdr); + ret =PTR_ERR (ctrl->pdr); + goto err_pdr_alloc; } pds =pdr_add_lookup (ctrl->pdr,"avs/audio" ,"msm/adsp/audio_pd" );if (IS_ERR (pds) &&PTR_ERR (pds) != -EALREADY ) { ret =PTR_ERR (pds);dev_err (dev,"pdr add lookup failed: %d\n" , ret); -return ret; + goto err_pdr_lookup; }platform_driver_register (&qcom_slim_ngd_driver);return of_qcom_slim_ngd_register (dev, ctrl); + +err_pdr_alloc: +qcom_unregister_ssr_notifier (ctrl->notifier, &ctrl->nb); + +err_pdr_lookup: +pdr_handle_release (ctrl->pdr); + +return ret; }static int qcom_slim_ngd_ctrl_remove (struct platform_device *pdev)
Greg Kroah-Hartman
maintainerPATCH 70/717 drm/virtio: Use appropriate atomic state in virtio_gpu_plane_cleanup_fb()
In reply to Greg Kroah-HartmanFrom: Dmitry Osipenko <[email protected]>
commit 4656b3a26a9e9fe5f04bfd2ab55b066266ba7f4d upstream.
Make virtio_gpu_plane_cleanup_fb() to clean the state which DRM core wants to clean up and not the current plane's state. Normally the older atomic state is cleaned up, but the newer state could also be cleaned up in case of aborted commits.
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/virtio/virtgpu_plane.c +3 -3
@@ -266,14 +266,14 @@ static int virtio_gpu_plane_prepare_fb(s }static void virtio_gpu_plane_cleanup_fb (struct drm_plane *plane, -struct drm_plane_state *old_state) +struct drm_plane_state *state) {struct virtio_gpu_framebuffer *vgfb; -if (!plane->state->fb) +if (!state->fb)return ; - vgfb =to_virtio_gpu_framebuffer (plane->state->fb); + vgfb =to_virtio_gpu_framebuffer (state->fb);if (vgfb->fence) {dma_fence_put (&vgfb->fence->f); vgfb->fence =NULL ;
Greg Kroah-Hartman
maintainerPATCH 177/717 ima: fix blocking of security.ima xattrs of unsupported algorithms
In reply to Greg Kroah-HartmanFrom: Mimi Zohar <[email protected]>
[ Upstream commit 5926586f291b53cb8a0c9631fc19489be1186e2d ]
Limit validating the hash algorithm to just security.ima xattr, not the security.evm xattr or any of the protected EVM security xattrs, nor posix acls.
--- security/integrity/ima/ima_appraise.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
security/integrity/ima/ima_appraise.c +8 -4
@@ -750,22 +750,26 @@ int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name,const struct evm_ima_xattr_data *xvalue = xattr_value;int digsig =0 ;int result; +int err; result =ima_protect_xattr (dentry, xattr_name, xattr_value, xattr_value_len);if (result ==1 ) {if (!xattr_value_len || (xvalue->type >=IMA_XATTR_LAST ))return -EINVAL ; + + err =validate_hash_algo (dentry, xvalue, xattr_value_len); +if (err) +return err; + digsig = (xvalue->type ==EVM_IMA_XATTR_DIGSIG ); }else if (!strcmp (xattr_name,XATTR_NAME_EVM ) && xattr_value_len >0 ) { digsig = (xvalue->type ==EVM_XATTR_PORTABLE_DIGSIG ); }if (result ==1 ||evm_revalidate_status (xattr_name)) { - result =validate_hash_algo (dentry, xvalue, xattr_value_len); -if (result) -return result; -ima_reset_appraise_flags (d_backing_inode (dentry), digsig); +if (result ==1 ) + result =0 ; }return result; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 108/717 btrfs: enhance unsupported compat RO flags handling
In reply to Greg Kroah-HartmanFrom: Qu Wenruo <[email protected]>
commit 81d5d61454c365718655cfc87d8200c84e25d596 upstream.
Currently there are two corner cases not handling compat RO flags correctly:
- Remount
We can still mount the fs RO with compat RO flags, then remount it RW. We should not allow any write into a fs with unsupported RO flags.
- Still try to search block group items
In fact, behavior/on-disk format change to extent tree should not need a full incompat flag.
And since we can ensure fs with unsupported RO flags never got any writes (with above case fixed), then we can even skip block group items search at mount time.
This patch will enhance the unsupported RO compat flags by:
- Reject read-write remount if there are unsupported RO compat flags
- Go dummy block group items directly for unsupported RO compat flags In fact, only changes to chunk/subvolume/root/csum trees should go incompat flags.
The latter part should allow future change to extent tree to be compat RO flags.
Thus this patch also needs to be backported to all stable trees.
--- fs/btrfs/block-group.c | 11 ++++++++++- fs/btrfs/super.c | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-)
fs/btrfs/block-group.c +10 -1
@@ -2191,7 +2191,16 @@ int btrfs_read_block_groups(struct btrfsint need_clear =0 ;u64 cache_gen; -if (!root) +/* +* Either no extent root (with ibadroots rescue option) or we have +* unsupported RO options. The fs can never be mounted read-write, so no +* need to waste time searching block group items. +* +* This also allows new extent tree related changes to be RO compat, +* no need for a full incompat flag. +*/ +if (!root || (btrfs_super_compat_ro_flags (info->super_copy) & + ~BTRFS_FEATURE_COMPAT_RO_SUPP ))return fill_dummy_bgs (info); key.objectid =0 ;
fs/btrfs/super.c +9 -0
@@ -2113,6 +2113,15 @@ static int btrfs_remount(struct super_bl ret = -EINVAL ; goto restore; } +if (btrfs_super_compat_ro_flags (fs_info->super_copy) & + ~BTRFS_FEATURE_COMPAT_RO_SUPP ) { +btrfs_err (fs_info, +"can not remount read-write due to unsupported optional flags 0x%llx" , +btrfs_super_compat_ro_flags (fs_info->super_copy) & + ~BTRFS_FEATURE_COMPAT_RO_SUPP ); + ret = -EINVAL ; + goto restore; + }if (fs_info->fs_devices->rw_devices ==0 ) { ret = -EACCES ; goto restore;
Greg Kroah-Hartman
maintainerPATCH 105/717 ksmbd: Fix user namespace mapping
In reply to Greg Kroah-HartmanFrom: Mickaël Salaün <[email protected]>
commit 7c88c1e0ab1704bacb751341ee6431c3be34b834 upstream.
A kernel daemon should not rely on the current thread, which is unknown and might be malicious. Before this security fix, ksmbd_override_fsids() didn't correctly override FS UID/GID which means that arbitrary user space threads could trick the kernel to impersonate arbitrary users or groups for file system access checks, leading to file system access bypass.
This was found while investigating truncate support for Landlock:
https://lore.kernel.org/r/CAKYAXd8fpMJ7guizOjHgxEyyjoUwPsx3jLOPZP=wPYcbhkVXqA@mail.gmail.com
--- fs/ksmbd/smb_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/ksmbd/smb_common.c +4 -2
@@ -4,6 +4,8 @@* Copyright (C) 2018 Namjae Jeon <[email protected]> */ +#include <linux/user_namespace.h> +#include "smb_common.h" #include "server.h" #include "misc.h"
@@ -625,8 +627,8 @@ int ksmbd_override_fsids(struct ksmbd_woif (!cred)return -ENOMEM ; - cred->fsuid =make_kuid (current_user_ns (), uid); - cred->fsgid =make_kgid (current_user_ns (), gid); + cred->fsuid =make_kuid (&init_user_ns, uid); + cred->fsgid =make_kgid (&init_user_ns, gid); gi =groups_alloc (0 );if (!gi) {
Greg Kroah-Hartman
maintainerPATCH 116/717 f2fs: fix to do sanity check on destination blkaddr during recovery
In reply to Greg Kroah-HartmanFrom: Chao Yu <[email protected]>
commit 0ef4ca04a3f9223ff8bc440041c524b2123e09a3 upstream.
As Wenqing Liu reported in bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=216456
loop5: detected capacity change from 0 to 131072 F2FS-fs (loop5): recover_inode: ino = 6, name = hln, inline = 1 F2FS-fs (loop5): recover_data: ino = 6 (i_size: recover) err = 0 F2FS-fs (loop5): recover_inode: ino = 6, name = hln, inline = 1 F2FS-fs (loop5): recover_data: ino = 6 (i_size: recover) err = 0 F2FS-fs (loop5): recover_inode: ino = 6, name = hln, inline = 1 F2FS-fs (loop5): recover_data: ino = 6 (i_size: recover) err = 0 F2FS-fs (loop5): Bitmap was wrongly set, blk:5634
------------[ cut here ]------------ WARNING: CPU: 3 PID: 1013 at fs/f2fs/segment.c:2198 RIP: 0010:update_sit_entry+0xa55/0x10b0 [f2fs] Call Trace: <TASK> f2fs_do_replace_block+0xa98/0x1890 [f2fs] f2fs_replace_block+0xeb/0x180 [f2fs] recover_data+0x1a69/0x6ae0 [f2fs] f2fs_recover_fsync_data+0x120d/0x1fc0 [f2fs] f2fs_fill_super+0x4665/0x61e0 [f2fs] mount_bdev+0x2cf/0x3b0 legacy_get_tree+0xed/0x1d0 vfs_get_tree+0x81/0x2b0 path_mount+0x47e/0x19d0 do_mount+0xce/0xf0 __x64_sys_mount+0x12c/0x1a0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd
If we enable CONFIG_F2FS_CHECK_FS config, it will trigger a kernel panic instead of warning.
The root cause is: in fuzzed image, SIT table is inconsistent with inode mapping table, result in triggering such warning during SIT table update.
This patch introduces a new flag DATA_GENERIC_ENHANCE_UPDATE, w/ this flag, data block recovery flow can check destination blkaddr's validation in SIT table, and skip f2fs_replace_block() to avoid inconsistent status.
--- fs/f2fs/checkpoint.c | 10 +++++++++- fs/f2fs/f2fs.h | 4 ++++ fs/f2fs/recovery.c | 8 ++++++++ 3 files changed, 21 insertions(+), 1 deletion(-)
fs/f2fs/checkpoint.c +9 -1
@@ -140,7 +140,7 @@ static bool __is_bitmap_valid(struct f2funsigned int segno, offset;bool exist; -if (type !=DATA_GENERIC_ENHANCE && type !=DATA_GENERIC_ENHANCE_READ ) +if (type ==DATA_GENERIC )return true; segno =GET_SEGNO (sbi, blkaddr);
@@ -148,6 +148,13 @@ static bool __is_bitmap_valid(struct f2f se =get_seg_entry (sbi, segno); exist =f2fs_test_bit (offset, se->cur_valid_map); +if (exist && type ==DATA_GENERIC_ENHANCE_UPDATE ) { +f2fs_err (sbi,"Inconsistent error blkaddr:%u, sit bitmap:%d" , + blkaddr, exist); +set_sbi_flag (sbi,SBI_NEED_FSCK ); +return exist; + } +if (!exist && type ==DATA_GENERIC_ENHANCE ) {f2fs_err (sbi,"Inconsistent error blkaddr:%u, sit bitmap:%d" , blkaddr, exist);
@@ -185,6 +192,7 @@ bool f2fs_is_valid_blkaddr(struct f2fs_scase DATA_GENERIC :case DATA_GENERIC_ENHANCE :case DATA_GENERIC_ENHANCE_READ : +case DATA_GENERIC_ENHANCE_UPDATE :if (unlikely (blkaddr >=MAX_BLKADDR (sbi) || blkaddr <MAIN_BLKADDR (sbi))) { f2fs_warn(sbi, "access invalid blkaddr:%u",
fs/f2fs/f2fs.h +4 -0
@@ -266,6 +266,10 @@ enum {* condition of read on truncated area * by extent_cache */ +DATA_GENERIC_ENHANCE_UPDATE ,/* +* strong check on range and segment +* bitmap for update case +*/ META_GENERIC, };
fs/f2fs/recovery.c +8 -0
@@ -698,6 +698,14 @@ retry_prev: goto err; } +if (f2fs_is_valid_blkaddr (sbi, dest, +DATA_GENERIC_ENHANCE_UPDATE )) { +f2fs_err (sbi,"Inconsistent dest blkaddr:%u, ino:%lu, ofs:%u" , + dest, inode->i_ino, dn.ofs_in_node); + err = -EFSCORRUPTED ; + goto err; + } +/* write dummy data page */ f2fs_replace_block (sbi, &dn, src, dest, ni.version, false, false);
Greg Kroah-Hartman
maintainerPATCH 183/717 MIPS: SGI-IP30: Fix platform-device leak in bridge_platform_create()
In reply to Greg Kroah-HartmanFrom: Lin Yujun <[email protected]>
[ Upstream commit 1e6d11fe72e311c1989991ee318d239f650fa318 ]
In error case in bridge_platform_create after calling platform_device_add()/platform_device_add_data()/ platform_device_add_resources(), release the failed 'pdev' or it will be leak, call platform_device_put() to fix this problem.
Besides, 'pdev' is divided into 'pdev_wd' and 'pdev_bd', use platform_device_unregister() to release sgi_w1 resources when xtalk-bridge registration fails.
--- arch/mips/sgi-ip30/ip30-xtalk.c | 70 +++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 20 deletions(-)
arch/mips/sgi-ip30/ip30-xtalk.c +50 -20
@@ -40,12 +40,15 @@ static void bridge_platform_create(int widget, int masterwid) {struct xtalk_bridge_platform_data *bd;struct sgi_w1_platform_data *wd; -struct platform_device *pdev; +struct platform_device *pdev_wd; +struct platform_device *pdev_bd;struct resource w1_res; wd =kzalloc (sizeof (*wd),GFP_KERNEL ); -if (!wd) - goto no_mem; +if (!wd) { +pr_warn ("xtalk:%x bridge create out of memory\n" , widget); +return ; + }snprintf (wd->dev_id,sizeof (wd->dev_id),"bridge-%012lx" ,IP30_SWIN_BASE (widget));
@@ -56,24 +59,35 @@ static void bridge_platform_create(int widget, int masterwid) w1_res.end = w1_res.start +3 ; w1_res.flags =IORESOURCE_MEM ; - pdev =platform_device_alloc ("sgi_w1" ,PLATFORM_DEVID_AUTO ); -if (!pdev) { -kfree (wd); - goto no_mem; + pdev_wd =platform_device_alloc ("sgi_w1" ,PLATFORM_DEVID_AUTO ); +if (!pdev_wd) { +pr_warn ("xtalk:%x bridge create out of memory\n" , widget); + goto err_kfree_wd; + } +if (platform_device_add_resources (pdev_wd, &w1_res,1 )) { +pr_warn ("xtalk:%x bridge failed to add platform resources.\n" , widget); + goto err_put_pdev_wd; + } +if (platform_device_add_data (pdev_wd, wd,sizeof (*wd))) { +pr_warn ("xtalk:%x bridge failed to add platform data.\n" , widget); + goto err_put_pdev_wd; + } +if (platform_device_add (pdev_wd)) { +pr_warn ("xtalk:%x bridge failed to add platform device.\n" , widget); + goto err_put_pdev_wd; } -platform_device_add_resources (pdev, &w1_res,1 ); -platform_device_add_data (pdev, wd,sizeof (*wd));/* platform_device_add_data() duplicates the data */ kfree (wd); -platform_device_add (pdev); bd =kzalloc (sizeof (*bd),GFP_KERNEL ); -if (!bd) - goto no_mem; - pdev =platform_device_alloc ("xtalk-bridge" ,PLATFORM_DEVID_AUTO ); -if (!pdev) { -kfree (bd); - goto no_mem; +if (!bd) { +pr_warn ("xtalk:%x bridge create out of memory\n" , widget); + goto err_unregister_pdev_wd; + } + pdev_bd =platform_device_alloc ("xtalk-bridge" ,PLATFORM_DEVID_AUTO ); +if (!pdev_bd) { +pr_warn ("xtalk:%x bridge create out of memory\n" , widget); + goto err_kfree_bd; } bd->bridge_addr =IP30_RAW_SWIN_BASE (widget);
@@ -93,15 +107,31 @@ static void bridge_platform_create(int widget, int masterwid) bd->io.flags =IORESOURCE_IO ; bd->io_offset =IP30_SWIN_BASE (widget); -platform_device_add_data (pdev, bd,sizeof (*bd)); +if (platform_device_add_data (pdev_bd, bd,sizeof (*bd))) { +pr_warn ("xtalk:%x bridge failed to add platform data.\n" , widget); + goto err_put_pdev_bd; + } +if (platform_device_add (pdev_bd)) { +pr_warn ("xtalk:%x bridge failed to add platform device.\n" , widget); + goto err_put_pdev_bd; + }/* platform_device_add_data() duplicates the data */ kfree (bd); -platform_device_add (pdev);pr_info ("xtalk:%x bridge widget\n" , widget);return ; -no_mem: -pr_warn ("xtalk:%x bridge create out of memory\n" , widget); +err_put_pdev_bd: +platform_device_put (pdev_bd); +err_kfree_bd: +kfree (bd); +err_unregister_pdev_wd: +platform_device_unregister (pdev_wd); +return ; +err_put_pdev_wd: +platform_device_put (pdev_wd); +err_kfree_wd: +kfree (wd); +return ; }static unsigned int __init xbow_widget_active (s8 wid)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 114/717 f2fs: flush pending checkpoints when freezing super
In reply to Greg Kroah-HartmanFrom: Jaegeuk Kim <[email protected]>
commit c7b58576370147833999fd4cc874d0f918bdf9ca upstream.
This avoids -EINVAL when trying to freeze f2fs.
--- fs/f2fs/checkpoint.c | 24 ++++++++++++++++++------ fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 5 ++--- 3 files changed, 21 insertions(+), 9 deletions(-)
fs/f2fs/checkpoint.c +18 -6
@@ -1894,15 +1894,27 @@ int f2fs_start_ckpt_thread(struct f2fs_svoid f2fs_stop_ckpt_thread (struct f2fs_sb_info *sbi) {struct ckpt_req_control *cprc = &sbi->cprc_info; +struct task_struct *ckpt_task; -if (cprc->f2fs_issue_ckpt) { -struct task_struct *ckpt_task = cprc->f2fs_issue_ckpt; +if (!cprc->f2fs_issue_ckpt) +return ; - cprc->f2fs_issue_ckpt =NULL ; -kthread_stop (ckpt_task); + ckpt_task = cprc->f2fs_issue_ckpt; + cprc->f2fs_issue_ckpt =NULL ; +kthread_stop (ckpt_task); -flush_remained_ckpt_reqs (sbi,NULL ); - } +f2fs_flush_ckpt_thread (sbi); +} + +void f2fs_flush_ckpt_thread (struct f2fs_sb_info *sbi) +{ +struct ckpt_req_control *cprc = &sbi->cprc_info; + +flush_remained_ckpt_reqs (sbi,NULL ); + +/* Let's wait for the previous dispatched checkpoint. */ +while (atomic_read (&cprc->queued_ckpt)) +io_schedule_timeout (DEFAULT_IO_TIMEOUT ); }void f2fs_init_ckpt_req_control (struct f2fs_sb_info *sbi)
fs/f2fs/f2fs.h +1 -0
@@ -3676,6 +3676,7 @@ static inline bool f2fs_need_rand_seg(st* checkpoint.c */ void f2fs_stop_checkpoint (struct f2fs_sb_info *sbi,bool end_io); +void f2fs_flush_ckpt_thread (struct f2fs_sb_info *sbi);struct page *f2fs_grab_meta_page (struct f2fs_sb_info *sbi,pgoff_t index);struct page *f2fs_get_meta_page (struct f2fs_sb_info *sbi,pgoff_t index);struct page *f2fs_get_meta_page_retry (struct f2fs_sb_info *sbi,pgoff_t index);
fs/f2fs/super.c +2 -3
@@ -1637,9 +1637,8 @@ static int f2fs_freeze(struct super_blocif (is_sbi_flag_set (F2FS_SB (sb),SBI_IS_DIRTY ))return -EINVAL ; -/* ensure no checkpoint required */ -if (!llist_empty (&F2FS_SB (sb)->cprc_info.issue_list)) -return -EINVAL ; +/* Let's flush checkpoints and stop the thread. */ +f2fs_flush_ckpt_thread (F2FS_SB (sb));/* to avoid deadlock on f2fs_evict_inode->SB_FREEZE_FS */ set_sbi_flag (F2FS_SB (sb),SBI_IS_FREEZING );
Greg Kroah-Hartman
maintainerPATCH 191/717 ACPI: PCC: replace wait_for_completion()
In reply to Greg Kroah-HartmanFrom: Huisong Li <[email protected]>
[ Upstream commit 91cefefb699120efd0a5ba345d12626b688f86ce ]
Currently, the function waiting for completion of mailbox operation is 'wait_for_completion()'. The PCC method will be permanently blocked if this mailbox message fails to execute. So this patch replaces it with 'wait_for_completion_timeout()'. And set the timeout interval to an arbitrary retries on top of nominal to prevent the remote processor is slow to respond to PCC commands.
--- drivers/acpi/acpi_pcc.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/acpi/acpi_pcc.c +21 -2
@@ -23,6 +23,12 @@#include <acpi/pcc.h> +/* +* Arbitrary retries in case the remote processor is slow to respond +* to PCC commands +*/ +#define PCC_CMD_WAIT_RETRIES_NUM 500 +struct pcc_data {struct pcc_mbox_chan *pcc_chan;void __iomem *pcc_comm_addr;
@@ -89,6 +95,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr, {int ret;struct pcc_data *data = region_context; +u64 usecs_lat;reinit_completion (&data->done);
@@ -99,8 +106,20 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,if (ret <0 )return AE_ERROR ; -if (data->pcc_chan->mchan->mbox->txdone_irq) -wait_for_completion (&data->done); +if (data->pcc_chan->mchan->mbox->txdone_irq) { +/* +* pcc_chan->latency is just a Nominal value. In reality the remote +* processor could be much slower to reply. So add an arbitrary +* amount of wait on top of Nominal. +*/ + usecs_lat =PCC_CMD_WAIT_RETRIES_NUM * data->pcc_chan->latency; + ret =wait_for_completion_timeout (&data->done, +usecs_to_jiffies (usecs_lat)); +if (ret ==0 ) { +pr_err ("PCC command executed timeout!\n" ); +return AE_TIME ; + } + }mbox_client_txdone (data->pcc_chan->mchan, ret);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 178/717 userfaultfd: open userfaultfds with O_RDONLY
In reply to Greg Kroah-HartmanFrom: Ondrej Mosnacek <[email protected]>
[ Upstream commit abec3d015fdfb7c63105c7e1c956188bf381aa55 ]
Since userfaultfd doesn't implement a write operation, it is more appropriate to open it read-only.
When userfaultfds are opened read-write like it is now, and such fd is passed from one process to another, SELinux will check both read and write permissions for the target process, even though it can't actually do any write operation on the fd later.
Inspired by the following bug report, which has hit the SELinux scenario described above:
https://bugzilla.redhat.com/show_bug.cgi?id=1974559
--- fs/userfaultfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/userfaultfd.c +2 -2
@@ -991,7 +991,7 @@ static int resolve_userfault_fork(struct userfaultfd_ctx *new,int fd; fd =anon_inode_getfd_secure ("[userfaultfd]" , &userfaultfd_fops, new, -O_RDWR | (new->flags &UFFD_SHARED_FCNTL_FLAGS ), inode); +O_RDONLY | (new->flags &UFFD_SHARED_FCNTL_FLAGS ), inode);if (fd <0 )return fd;
@@ -2096,7 +2096,7 @@ SYSCALL_DEFINE1(userfaultfd, int, flags)mmgrab (ctx->mm); fd =anon_inode_getfd_secure ("[userfaultfd]" , &userfaultfd_fops, ctx, -O_RDWR | (flags &UFFD_SHARED_FCNTL_FLAGS ),NULL ); +O_RDONLY | (flags &UFFD_SHARED_FCNTL_FLAGS ),NULL );if (fd <0 ) {mmdrop (ctx->mm);kmem_cache_free (userfaultfd_ctx_cachep, ctx);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 193/717 objtool: Preserve special st_shndx indexes in elf_update_symbol
In reply to Greg Kroah-HartmanFrom: Sami Tolvanen <[email protected]>
[ Upstream commit 5141d3a06b2da1731ac82091298b766a1f95d3d8 ]
elf_update_symbol fails to preserve the special st_shndx values between [SHN_LORESERVE, SHN_HIRESERVE], which results in it converting SHN_ABS entries into SHN_UNDEF, for example. Explicitly check for the special indexes and ensure these symbols are not marked undefined.
--- tools/objtool/elf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tools/objtool/elf.c +6 -1
@@ -619,6 +619,11 @@ static int elf_update_symbol(struct elf *elf, struct section *symtab,Elf64_Xword entsize = symtab->sh.sh_entsize;int max_idx, idx = sym->idx;Elf_Scn *s, *t =NULL ; +bool is_special_shndx = sym->sym.st_shndx >=SHN_LORESERVE && + sym->sym.st_shndx !=SHN_XINDEX ; + +if (is_special_shndx) + shndx = sym->sym.st_shndx; s =elf_getscn (elf->elf, symtab->idx);if (!s) {
@@ -704,7 +709,7 @@ static int elf_update_symbol(struct elf *elf, struct section *symtab, }/* setup extended section index magic and write the symbol */ -if (shndx >=SHN_UNDEF && shndx <SHN_LORESERVE ) { +if ((shndx >=SHN_UNDEF && shndx <SHN_LORESERVE ) || is_special_shndx) { sym->sym.st_shndx = shndx;if (!shndx_data) shndx =0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 168/717 drm/i915: Fix watermark calculations for gen12+ RC CCS modifier
In reply to Greg Kroah-HartmanFrom: Ville Syrjälä <[email protected]>
commit c56453a00f19ccddee302f5f9fe96b80e0b47fd3 upstream.
Take the gen12+ RC CCS modifier into account when calculating the watermarks. Othwerwise we'll calculate the watermarks thinking this Y-tiled modifier is linear.
The rc_surface part is actually a nop since that is not used for any glk+ platform.
v2: Split RC CCS vs. MC CCS to separate patches
--- drivers/gpu/drm/i915/intel_pm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +4 -2
@@ -5307,10 +5307,12 @@ skl_compute_wm_params(const struct intel modifier ==I915_FORMAT_MOD_4_TILED || modifier == I915_FORMAT_MOD_Yf_TILED || modifier ==I915_FORMAT_MOD_Y_TILED_CCS || - modifier == I915_FORMAT_MOD_Yf_TILED_CCS; + modifier == I915_FORMAT_MOD_Yf_TILED_CCS || + modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS ; wp->x_tiled = modifier ==I915_FORMAT_MOD_X_TILED ; wp->rc_surface = modifier ==I915_FORMAT_MOD_Y_TILED_CCS || - modifier == I915_FORMAT_MOD_Yf_TILED_CCS; + modifier == I915_FORMAT_MOD_Yf_TILED_CCS || + modifier ==I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS ; wp->is_planar =intel_format_info_is_yuv_semiplanar (format, modifier); wp->width = width;
Greg Kroah-Hartman
maintainerPATCH 167/717 drm/i915/gt: Use i915_vm_put on ppgtt_create error paths
In reply to Greg Kroah-HartmanFrom: Chris Wilson <[email protected]>
commit 20e377e7b2e7c327039f10db80ba5bcc1f6c882d upstream.
Now that the scratch page and page directories have a reference back to the i915_address_space, we cannot do an immediate free of the ppgtt upon error as those buffer objects will perform a later i915_vm_put in their deferred frees.
The downside is that by replacing the onion unwind along the error paths, the ppgtt cleanup must handle a partially constructed vm. This includes ensuring that the vm->cleanup is set prior to the error path.
--- drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 16 ++++----- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 58 ++++++++++++++++++----------------- drivers/gpu/drm/i915/gt/intel_gtt.c | 3 + 3 files changed, 41 insertions(+), 36 deletions(-)
drivers/gpu/drm/i915/gt/gen6_ppgtt.c +8 -8
@@ -247,6 +247,7 @@ err_scratch1:i915_gem_object_put (vm->scratch[1 ]); err_scratch0:i915_gem_object_put (vm->scratch[0 ]); + vm->scratch[0 ] =NULL ;return ret; }
@@ -268,9 +269,10 @@ static void gen6_ppgtt_cleanup(struct i9gen6_ppgtt_free_pd (ppgtt);free_scratch (vm); -mutex_destroy (&ppgtt->flush); +if (ppgtt->base.pd) +free_pd (&ppgtt->base.vm, ppgtt->base.pd); -free_pd (&ppgtt->base.vm, ppgtt->base.pd); +mutex_destroy (&ppgtt->flush); } static void pd_vma_bind(struct i915_address_space *vm,
@@ -449,19 +451,17 @@ struct i915_ppgtt *gen6_ppgtt_create(str err =gen6_ppgtt_init_scratch (ppgtt);if (err) - goto err_free; + goto err_put; ppgtt->base.pd =gen6_alloc_top_pd (ppgtt);if (IS_ERR (ppgtt->base.pd)) { err =PTR_ERR (ppgtt->base.pd); - goto err_scratch; + goto err_put; }return &ppgtt->base; -err_scratch: -free_scratch (&ppgtt->base.vm); -err_free: -kfree (ppgtt); +err_put: +i915_vm_put (&ppgtt->base.vm);return ERR_PTR (err); }
drivers/gpu/drm/i915/gt/gen8_ppgtt.c +30 -28
101 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_gtt.c +3 -0
@@ -405,6 +405,9 @@ void free_scratch(struct i915_address_sp {int i; +if (!vm->scratch[0 ]) +return ; +for (i =0 ; i <= vm->top; i++)i915_gem_object_put (vm->scratch[i]); }
Greg Kroah-Hartman
maintainerPATCH 196/717 SUNRPC: Fix svcxdr_init_encodes buflen calculation
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
[ Upstream commit 1242a87da0d8cd2a428e96ca68e7ea899b0f4624 ]
Commit 2825a7f90753 ("nfsd4: allow encoding across page boundaries") added an explicit computation of the remaining length in the rq_res XDR buffer.
The computation appears to suffer from an "off-by-one" bug. Because buflen is too large by one page, XDR encoding can run off the end of the send buffer by eventually trying to use the struct page address in rq_page_end, which always contains NULL.
--- include/linux/sunrpc/svc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sunrpc/svc.h +1 -1
@@ -587,7 +587,7 @@ static inline void svcxdr_init_encode(struct svc_rqst *rqstp) xdr->end = resv->iov_base +PAGE_SIZE - rqstp->rq_auth_slack; buf->len = resv->iov_len; xdr->page_ptr = buf->pages -1 ; - buf->buflen =PAGE_SIZE * (1 + rqstp->rq_page_end - buf->pages); + buf->buflen =PAGE_SIZE * (rqstp->rq_page_end - buf->pages); buf->buflen -= rqstp->rq_auth_slack; xdr->rqst =NULL ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 213/717 esp: choose the correct inner protocol for GSO on inter address family tunnels
In reply to Greg Kroah-HartmanFrom: Sabrina Dubroca <[email protected]>
[ Upstream commit 26dbd66eab8080be51759e48280da04015221e22 ]
Commit 23c7f8d7989e ("net: Fix esp GSO on inter address family tunnels.") is incomplete. It passes to skb_eth_gso_segment the protocol for the outer IP version, instead of the inner IP version, so we end up calling inet_gso_segment on an inner IPv6 packet and ipv6_gso_segment on an inner IPv4 packet and the packets are dropped.
This patch completes the fix by selecting the correct protocol based on the inner mode's family.
--- net/ipv4/esp4_offload.c | 5 ++++- net/ipv6/esp6_offload.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-)
net/ipv4/esp4_offload.c +4 -1
@@ -110,7 +110,10 @@ static struct sk_buff *xfrm4_tunnel_gso_segment(struct xfrm_state *x, struct sk_buff *skb, netdev_features_t features) { - return skb_eth_gso_segment(skb, features, htons(ETH_P_IP)); +__be16 type = x->inner_mode.family ==AF_INET6 ?htons (ETH_P_IPV6 ) + :htons (ETH_P_IP ); + +return skb_eth_gso_segment (skb, features, type); } static struct sk_buff *xfrm4_transport_gso_segment(struct xfrm_state *x,
net/ipv6/esp6_offload.c +4 -1
@@ -145,7 +145,10 @@ static struct sk_buff *xfrm6_tunnel_gso_segment(struct xfrm_state *x, struct sk_buff *skb, netdev_features_t features) { - return skb_eth_gso_segment(skb, features, htons(ETH_P_IPV6)); +__be16 type = x->inner_mode.family ==AF_INET ?htons (ETH_P_IP ) + :htons (ETH_P_IPV6 ); + +return skb_eth_gso_segment (skb, features, type); } static struct sk_buff *xfrm6_transport_gso_segment(struct xfrm_state *x,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 64/717 dmaengine: mxs: use platform_driver_register
In reply to Greg Kroah-HartmanFrom: Dario Binacchi <[email protected]>
commit 26696d4657167112a1079f86cba1739765c1360e upstream.
Driver registration fails on SOC imx8mn as its supplier, the clock control module, is probed later than subsys initcall level. This driver uses platform_driver_probe which is not compatible with deferred probing and won't be probed again later if probe function fails due to clock not being available at that time.
This patch replaces the use of platform_driver_probe with platform_driver_register which will allow probing the driver later again when the clock control module will be available.
The __init annotation has been dropped because it is not compatible with deferred probing. The code is not executed once and its memory cannot be freed.
--- drivers/dma/mxs-dma.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/dma/mxs-dma.c +4 -7
@@ -670,7 +670,7 @@ static enum dma_status mxs_dma_tx_statusreturn mxs_chan->status; } -static int __init mxs_dma_init (struct mxs_dma_engine *mxs_dma) +static int mxs_dma_init (struct mxs_dma_engine *mxs_dma) {int ret;
@@ -741,7 +741,7 @@ static struct dma_chan *mxs_dma_xlate(st ofdma->of_node); } -static int __init mxs_dma_probe (struct platform_device *pdev) +static int mxs_dma_probe (struct platform_device *pdev) {struct device_node *np = pdev->dev.of_node;const struct mxs_dma_type *dma_type;
@@ -839,10 +839,7 @@ static struct platform_driver mxs_dma_dr .name = "mxs-dma", .of_match_table = mxs_dma_dt_ids, }, + .probe = mxs_dma_probe, }; -static int __init mxs_dma_module_init (void ) -{ -return platform_driver_probe (&mxs_dma_driver, mxs_dma_probe); -} -subsys_initcall (mxs_dma_module_init); +builtin_platform_driver (mxs_dma_driver);
Greg Kroah-Hartman
maintainerPATCH 124/717 ext4: fix null-ptr-deref in ext4_write_info
In reply to Greg Kroah-HartmanFrom: Baokun Li <[email protected]>
commit f9c1f248607d5546075d3f731e7607d5571f2b60 upstream.
I caught a null-ptr-deref bug as follows:
==================================================================
KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f] CPU: 1 PID: 1589 Comm: umount Not tainted 5.10.0-02219-dirty #339 RIP: 0010:ext4_write_info+0x53/0x1b0 [...] Call Trace: dquot_writeback_dquots+0x341/0x9a0 ext4_sync_fs+0x19e/0x800 __sync_filesystem+0x83/0x100 sync_filesystem+0x89/0xf0 generic_shutdown_super+0x79/0x3e0 kill_block_super+0xa1/0x110 deactivate_locked_super+0xac/0x130 deactivate_super+0xb6/0xd0 cleanup_mnt+0x289/0x400 __cleanup_mnt+0x16/0x20 task_work_run+0x11c/0x1c0 exit_to_user_mode_prepare+0x203/0x210 syscall_exit_to_user_mode+0x5b/0x3a0 do_syscall_64+0x59/0x70 entry_SYSCALL_64_after_hwframe+0x44/0xa9 ==================================================================
Above issue may happen as follows:
-------------------------------------exit_to_user_mode_prepare
task_work_run
__cleanup_mnt
cleanup_mnt
deactivate_super
deactivate_locked_super
kill_block_super
generic_shutdown_super
shrink_dcache_for_umount
dentry = sb->s_root
sb->s_root = NULL <--- Here set NULL
sync_filesystem
__sync_filesystem
sb->s_op->sync_fs > ext4_sync_fs
dquot_writeback_dquots
sb->dq_op->write_info > ext4_write_info
ext4_journal_start(d_inode(sb->s_root), EXT4_HT_QUOTA, 2)
d_inode(sb->s_root)
s_root->d_inode <--- Null pointer dereferenceTo solve this problem, we use ext4_journal_start_sb directly to avoid s_root being used.
--- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/super.c +1 -1
@@ -6643,7 +6643,7 @@ static int ext4_write_info(struct super_handle_t *handle;/* Data block + inode block */ - handle =ext4_journal_start (d_inode (sb->s_root),EXT4_HT_QUOTA ,2 ); + handle =ext4_journal_start_sb (sb,EXT4_HT_QUOTA ,2 );if (IS_ERR (handle))return PTR_ERR (handle); ret =dquot_commit_info (sb, type);
Greg Kroah-Hartman
maintainerPATCH 68/717 drm/virtio: Unlock reservations on virtio_gpu_object_shmem_init() error
In reply to Greg Kroah-HartmanFrom: Dmitry Osipenko <[email protected]>
commit fdf0ff4d12cbcd76b53f27c96ce51ddca400884a upstream.
Unlock reservations in the error code path of virtio_gpu_object_create() to silence debug warning splat produced by ww_mutex_destroy(&obj->lock) when GEM is released with the held lock.
--- drivers/gpu/drm/virtio/virtgpu_object.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/virtio/virtgpu_object.c +2 -0
@@ -248,6 +248,8 @@ int virtio_gpu_object_create(struct virt ret =virtio_gpu_object_shmem_init (vgdev, bo, &ents, &nents);if (ret !=0 ) { +if (fence) +virtio_gpu_array_unlock_resv (objs);virtio_gpu_array_put_free (objs);virtio_gpu_free_object (&shmem_obj->base);return ret;
Greg Kroah-Hartman
maintainerPATCH 92/717 powerpc/boot: Explicitly disable usage of SPE instructions
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
commit 110a58b9f91c66f743c01a2c217243d94c899c23 upstream.
uImage boot wrapper should not use SPE instructions, like kernel itself. Boot wrapper has already disabled Altivec and VSX instructions but not SPE. Options -mno-spe and -mspe=no already set when compilation of kernel, but not when compiling uImage wrapper yet. Fix it.
--- arch/powerpc/boot/Makefile | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/boot/Makefile +1 -0
@@ -34,6 +34,7 @@ endif BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ + $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \ -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ $(LINUXINCLUDE)
Greg Kroah-Hartman
maintainerPATCH 98/717 pinctrl: rockchip: add pinmux_ops.gpio_set_direction callback
In reply to Greg Kroah-HartmanFrom: Quentin Schulz <[email protected]>
commit 4635c0e2a7f7f3568cbfccae70121f9835efa62c upstream.
Before the split of gpio and pinctrl sections in their own driver, rockchip_set_mux was called in pinmux_ops.gpio_set_direction for configuring a pin in its GPIO function.
This is essential for cases where pinctrl is "bypassed" by gpio consumers otherwise the GPIO function is not configured for the pin and it does not work. Such was the case for the sysfs/libgpiod userspace GPIO handling.
Let's re-implement the pinmux_ops.gpio_set_direction callback so that the gpio subsystem can request from the pinctrl driver to put the pin in its GPIO function.
--- drivers/pinctrl/pinctrl-rockchip.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/pinctrl/pinctrl-rockchip.c +13 -0
@@ -2393,11 +2393,24 @@ static int rockchip_pmx_set(struct pinctreturn 0 ; } +static int rockchip_pmx_gpio_set_direction (struct pinctrl_dev *pctldev, +struct pinctrl_gpio_range *range, +unsigned offset, +bool input) +{ +struct rockchip_pinctrl *info =pinctrl_dev_get_drvdata (pctldev); +struct rockchip_pin_bank *bank; + + bank =pin_to_bank (info, offset); +return rockchip_set_mux (bank, offset - bank->pin_base,RK_FUNC_GPIO ); +} +static const struct pinmux_ops rockchip_pmx_ops = { .get_functions_count = rockchip_pmx_get_funcs_count, .get_function_name = rockchip_pmx_get_func_name, .get_function_groups = rockchip_pmx_get_groups, .set_mux = rockchip_pmx_set, + .gpio_set_direction = rockchip_pmx_gpio_set_direction, };/*
Greg Kroah-Hartman
maintainerPATCH 120/717 jbd2: fix potential use-after-free in jbd2_fc_wait_bufs
In reply to Greg Kroah-HartmanFrom: Ye Bin <[email protected]>
commit 243d1a5d505d0b0460c9af0ad56ed4a56ef0bebd upstream.
In 'jbd2_fc_wait_bufs' use 'bh' after put buffer head reference count which may lead to use-after-free.
So judge buffer if uptodate before put buffer head reference count.
--- fs/jbd2/journal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/jbd2/journal.c +3 -3
@@ -926,16 +926,16 @@ int jbd2_fc_wait_bufs(journal_t *journalfor (i = j_fc_off -1 ; i >= j_fc_off - num_blks; i--) { bh = journal->j_fc_wbuf[i];wait_on_buffer (bh); -put_bh (bh); - journal->j_fc_wbuf[i] =NULL ;/* * Update j_fc_off so jbd2_fc_release_bufs can release remain * buffer head. */ if (unlikely (!buffer_uptodate (bh))) { - journal->j_fc_off = i; + journal->j_fc_off = i +1 ;return -EIO ; } +put_bh (bh); + journal->j_fc_wbuf[i] =NULL ; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 126/717 ext4: fix check for block being out of directory size
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 61a1d87a324ad5e3ed27c6699dfc93218fcf3201 upstream.
The check in __ext4_read_dirblock() for block being outside of directory size was wrong because it compared block number against directory size in bytes. Fix it.
CVE: CVE-2022-1184
--- fs/ext4/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/namei.c +1 -1
@@ -126,7 +126,7 @@ static struct buffer_head *__ext4_read_dstruct ext4_dir_entry *dirent;int is_dx_block =0 ; -if (block >= inode->i_size) { +if (block >= inode->i_size >> inode->i_blkbits) {ext4_error_inode (inode, func, line, block,"Attempting to read directory block (%u) that is past i_size (%llu)" , block, inode->i_size);
Greg Kroah-Hartman
maintainerPATCH 122/717 ext2: Add sanity checks for group and filesystem size
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit d766f2d1e3e3bd44024a7f971ffcf8b8fbb7c5d2 upstream.
Add sanity check that filesystem size does not exceed the underlying device size and that group size is big enough so that metadata can fit into it. This avoid trying to mount some crafted filesystems with extremely large group counts.
--- fs/ext2/super.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
fs/ext2/super.c +14 -2
@@ -1053,6 +1053,13 @@ static int ext2_fill_super(struct super_ sbi->s_blocks_per_group); goto failed_mount; } +/* At least inode table, bitmaps, and sb have to fit in one group */ +if (sbi->s_blocks_per_group <= sbi->s_itb_per_group +3 ) { +ext2_msg (sb,KERN_ERR , +"error: #blocks per group smaller than metadata size: %lu <= %lu" , + sbi->s_blocks_per_group, sbi->s_inodes_per_group +3 ); + goto failed_mount; + }if (sbi->s_frags_per_group > sb->s_blocksize *8 ) { ext2_msg(sb, KERN_ERR, "error: #fragments per group too big: %lu",
@@ -1066,9 +1073,14 @@ static int ext2_fill_super(struct super_ sbi->s_inodes_per_group); goto failed_mount; } +if (sb_bdev_nr_blocks (sb) <le32_to_cpu (es->s_blocks_count)) { +ext2_msg (sb,KERN_ERR , +"bad geometry: block count %u exceeds size of device (%u blocks)" , +le32_to_cpu (es->s_blocks_count), + (unsigned )sb_bdev_nr_blocks (sb)); + goto failed_mount; + } -if (EXT2_BLOCKS_PER_GROUP (sb) ==0 ) - goto cantfind_ext2; sbi->s_groups_count = ((le32_to_cpu (es->s_blocks_count) -le32_to_cpu (es->s_first_data_block) -1 ) /EXT2_BLOCKS_PER_GROUP (sb)) +1 ;
Greg Kroah-Hartman
maintainerPATCH 100/717 hwrng: core - let sleep be interrupted when unregistering hwrng
In reply to Greg Kroah-HartmanFrom: Jason A. Donenfeld <[email protected]>
commit 36cb6494429bd64b27b7ff8b4af56f8e526da2b4 upstream.
There are two deadlock scenarios that need addressing, which cause problems when the computer goes to sleep, the interface is set down, and hwrng_unregister() is called. When the deadlock is hit, sleep is delayed for tens of seconds, causing it to fail. These scenarios are:
1) The hwrng kthread can't be stopped while it's sleeping, because it uses msleep_interruptible() which does not react to kthread_stop.
2) A normal user thread can't be interrupted by hwrng_unregister() while it's sleeping, because hwrng_unregister() is called from elsewhere.
We solve both issues by add a completion object called dying that fulfils waiters once we have started the process in hwrng_unregister.
At the same time, we should cleanup a common and useless dmesg splat in the same area.
--- drivers/char/hw_random/core.c | 19 +++++++++++++++---- drivers/net/wireless/ath/ath9k/rng.c | 3 ++- include/linux/hw_random.h | 3 +++ 3 files changed, 20 insertions(+), 5 deletions(-)
drivers/char/hw_random/core.c +15 -4
@@ -507,16 +507,17 @@ static int hwrng_fillfn(void *unused) rng->quality = current_quality;/* obsolete */ quality = rng->quality;mutex_unlock (&reading_mutex); + +if (rc <=0 ) +hwrng_msleep (rng,10000 ); +put_rng (rng);if (!quality)break ; -if (rc <=0 ) { -pr_warn ("hwrng: no data available\n" ); -msleep_interruptible (10000 ); +if (rc <=0 )continue ; - }/* If we cannot credit at least one bit of entropy, * keep track of the remainder for the next iteration
@@ -570,6 +571,7 @@ int hwrng_register(struct hwrng *rng)init_completion (&rng->cleanup_done);complete (&rng->cleanup_done); +init_completion (&rng->dying);if (!current_rng || (!cur_rng_set_by_user && rng->quality > current_rng->quality)) {
@@ -617,6 +619,7 @@ void hwrng_unregister(struct hwrng *rng) old_rng = current_rng;list_del (&rng->list); +complete_all (&rng->dying);if (current_rng == rng) { err =enable_best_rng ();if (err) {
@@ -685,6 +688,14 @@ void devm_hwrng_unregister(struct device *dev, struct hwrng *rng) }EXPORT_SYMBOL_GPL (devm_hwrng_unregister); +long hwrng_msleep (struct hwrng *rng,unsigned int msecs) +{ +unsigned long timeout =msecs_to_jiffies (msecs) +1 ; + +return wait_for_completion_interruptible_timeout (&rng->dying, timeout); +} +EXPORT_SYMBOL_GPL (hwrng_msleep); +static int __init hwrng_modinit (void ) {int ret;
drivers/net/wireless/ath/ath9k/rng.c +2 -1
@@ -83,7 +83,8 @@ static int ath9k_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait)if (!wait || !max ||likely (bytes_read) || fail_stats >110 )break ; -msleep_interruptible (ath9k_rng_delay_get (++fail_stats)); +if (hwrng_msleep (rng,ath9k_rng_delay_get (++fail_stats))) +break ; }if (wait && !bytes_read && max)
include/linux/hw_random.h +3 -0
@@ -50,6 +50,7 @@ struct hwrng {struct list_head list;struct kref ref;struct completion cleanup_done; +struct completion dying; };struct device ;
@@ -61,4 +62,6 @@ extern int devm_hwrng_register(struct device *dev, struct hwrng *rng);extern void hwrng_unregister (struct hwrng *rng);extern void devm_hwrng_unregister (struct device *dve,struct hwrng *rng); +extern long hwrng_msleep (struct hwrng *rng,unsigned int msecs); +#endif /* LINUX_HWRANDOM_H_ */
Signature · 1 line
2.38.0
Greg Kroah-Hartman
maintainerPATCH 165/717 drm/nouveau/kms/nv140-: Disable interlacing
In reply to Greg Kroah-HartmanFrom: Lyude Paul <[email protected]>
commit 8ba9249396bef37cb68be9e8dee7847f1737db9d upstream.
As it turns out: while Nvidia does actually have interlacing knobs on their GPU still pretty much no current GPUs since Volta actually support it. Trying interlacing on these GPUs will result in NVDisplay being quite unhappy like so:
nouveau 0000:1f:00.0: disp: chid 0 stat 00004802 reason 4 [INVALID_ARG] mthd 2008 data 00000001 code 00080000 nouveau 0000:1f:00.0: disp: chid 0 stat 10005080 reason 5 [INVALID_STATE] mthd 0200 data 00000001 code 00000001
So let's fix this by following the same behavior Nvidia's driver does and disable interlacing entirely.
--- drivers/gpu/drm/nouveau/nouveau_connector.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_connector.c +2 -1
@@ -503,7 +503,8 @@ nouveau_connector_set_encoder(struct drm connector->interlace_allowed = nv_encoder->caps.dp_interlace; else - connector->interlace_allowed = true; + connector->interlace_allowed = + drm->client.device.info.family <NV_DEVICE_INFO_V0_VOLTA ; connector->doublescan_allowed = true; }else if (nv_encoder->dcb->type == DCB_OUTPUT_LVDS ||
Greg Kroah-Hartman
maintainerPATCH 123/717 ext4: avoid crash when inline data creation follows DIO write
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 4bb26f2885ac6930984ee451b952c5a6042f2c0e upstream.
When inode is created and written to using direct IO, there is nothing to clear the EXT4_STATE_MAY_INLINE_DATA flag. Thus when inode gets truncated later to say 1 byte and written using normal write, we will try to store the data as inline data. This confuses the code later because the inode now has both normal block and inline data allocated and the confusion manifests for example as:
kernel BUG at fs/ext4/inode.c:2721!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 359 Comm: repro Not tainted 5.19.0-rc8-00001-g31ba1e3b8305-dirty #15 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014 RIP: 0010:ext4_writepages+0x363d/0x3660 RSP: 0018:ffffc90000ccf260 EFLAGS: 00010293 RAX: ffffffff81e1abcd RBX: 0000008000000000 RCX: ffff88810842a180 RDX: 0000000000000000 RSI: 0000008000000000 RDI: 0000000000000000 RBP: ffffc90000ccf650 R08: ffffffff81e17d58 R09: ffffed10222c680b R10: dfffe910222c680c R11: 1ffff110222c680a R12: ffff888111634128 R13: ffffc90000ccf880 R14: 0000008410000000 R15: 0000000000000001 FS: 00007f72635d2640(0000) GS:ffff88811b000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000565243379180 CR3: 000000010aa74000 CR4: 0000000000150eb0 Call Trace: <TASK> do_writepages+0x397/0x640 filemap_fdatawrite_wbc+0x151/0x1b0 file_write_and_wait_range+0x1c9/0x2b0 ext4_sync_file+0x19e/0xa00 vfs_fsync_range+0x17b/0x190 ext4_buffered_write_iter+0x488/0x530 ext4_file_write_iter+0x449/0x1b90 vfs_write+0xbcd/0xf40 ksys_write+0x198/0x2c0 __x64_sys_write+0x7b/0x90 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd </TASK>
Fix the problem by clearing EXT4_STATE_MAY_INLINE_DATA when we are doing direct IO write to a file.
--- fs/ext4/file.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/ext4/file.c +6 -0
@@ -528,6 +528,12 @@ static ssize_t ext4_dio_write_iter(struc ret = -EAGAIN ; goto out; } +/* +* Make sure inline data cannot be created anymore since we are going +* to allocate blocks for DIO. We know the inode does not have any +* inline data now because ext4_dio_supported() checked for that. +*/ +ext4_clear_inode_state (inode,EXT4_STATE_MAY_INLINE_DATA ); offset = iocb->ki_pos; count = ret;
Greg Kroah-Hartman
maintainerPATCH 102/717 ksmbd: fix incorrect handling of iterate_dir
In reply to Greg Kroah-HartmanFrom: Namjae Jeon <[email protected]>
commit 88541cb414b7a2450c45fc9c131b37b5753b7679 upstream.
if iterate_dir() returns non-negative value, caller has to treat it as normal and check there is any error while populating dentry information. ksmbd doesn't have to do anything because ksmbd already checks too small OutputBufferLength to store one file information.
And because ctx->pos is set to file->f_pos when iterative_dir is called, remove restart_ctx(). And if iterate_dir() return -EIO, which mean directory entry is corrupted, return STATUS_FILE_CORRUPT_ERROR error response.
This patch fixes some failure of SMB2_QUERY_DIRECTORY, which happens when ntfs3 is local filesystem.
--- fs/ksmbd/smb2pdu.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
fs/ksmbd/smb2pdu.c +4 -10
@@ -3798,11 +3798,6 @@ static int __query_dir(struct dir_contexreturn 0 ; } -static void restart_ctx (struct dir_context *ctx) -{ - ctx->pos =0 ; -} -static int verify_info_level (int info_level) {switch (info_level) {
@@ -3911,7 +3906,6 @@ int smb2_query_dir(struct ksmbd_work *woif (srch_flag &SMB2_REOPEN || srch_flag &SMB2_RESTART_SCANS ) {ksmbd_debug (SMB ,"Restart directory scan\n" );generic_file_llseek (dir_fp->filp,0 ,SEEK_SET ); -restart_ctx (&dir_fp->readdir_data.ctx); }memset (&d_info,0 ,sizeof (struct ksmbd_dir_info ));
@@ -3958,11 +3952,9 @@ int smb2_query_dir(struct ksmbd_work *wo*/ if (!d_info.out_buf_len && !d_info.num_entry) goto no_buf_len; -if (rc ==0 ) -restart_ctx (&dir_fp->readdir_data.ctx); -if (rc == -ENOSPC ) +if (rc >0 || rc == -ENOSPC ) rc =0 ; -if (rc) +else if (rc) goto err_out; d_info.wptr = d_info.rptr;
@@ -4019,6 +4011,8 @@ err_out2: rsp->hdr.Status =STATUS_NO_MEMORY ; else if (rc == -EFAULT) rsp->hdr.Status = STATUS_INVALID_INFO_CLASS; + else if (rc == -EIO) + rsp->hdr.Status = STATUS_FILE_CORRUPT_ERROR;if (!rsp->hdr.Status) rsp->hdr.Status =STATUS_UNEXPECTED_IO_ERROR ;
Greg Kroah-Hartman
maintainerPATCH 150/717 tracing: Move duplicate code of trace_kprobe/eprobe.c into header
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit f1d3cbfaafc10464550c6d3a125f4fc802bbaed5 upstream.
The functions:
fetch_store_strlen_user()
fetch_store_strlen()
fetch_store_string_user()
fetch_store_string()
are identical in both trace_kprobe.c and trace_eprobe.c. Move them into a new header file trace_probe_kernel.h to share it. This code will later be used by the synthetic events as well.
Marked for stable as a fix for a crash in synthetic events requires it.
--- kernel/trace/trace_eprobe.c | 60 +---------------------- kernel/trace/trace_kprobe.c | 60 +---------------------- kernel/trace/trace_probe_kernel.h | 96 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+), 110 deletions(-) create mode 100644 kernel/trace/trace_probe_kernel.h
kernel/trace/trace_eprobe.c +5 -55
@@ -16,6 +16,7 @@#include "trace_dynevent.h" #include "trace_probe.h" #include "trace_probe_tmpl.h" +#include "trace_probe_kernel.h" #define EPROBE_EVENT_SYSTEM "eprobes"
@@ -452,29 +453,14 @@ NOKPROBE_SYMBOL(process_fetch_insn) static nokprobe_inline intfetch_store_strlen_user (unsigned long addr) { -const void __user *uaddr = (__force const void __user *)addr; - -return strnlen_user_nofault (uaddr,MAX_STRING_SIZE ); +return kern_fetch_store_strlen_user (addr); }/* Return the length of string -- including null terminal byte */ static nokprobe_inline intfetch_store_strlen (unsigned long addr) { -int ret, len =0 ; -u8 c; - -#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE -if (addr <TASK_SIZE ) -return fetch_store_strlen_user (addr); -#endif - -do { - ret =copy_from_kernel_nofault (&c, (u8 *)addr + len,1 ); - len++; - }while (c && ret ==0 && len <MAX_STRING_SIZE ); - -return (ret <0 ) ? ret : len; +return kern_fetch_store_strlen (addr); }/*
@@ -484,21 +470,7 @@ fetch_store_strlen(unsigned long addr) static nokprobe_inline intfetch_store_string_user (unsigned long addr,void *dest,void *base) { -const void __user *uaddr = (__force const void __user *)addr; -int maxlen =get_loc_len (*(u32 *)dest); -void *__dest; -long ret; - -if (unlikely (!maxlen)) -return -ENOMEM ; - - __dest =get_loc_data (dest, base); - - ret =strncpy_from_user_nofault (__dest, uaddr, maxlen); -if (ret >=0 ) - *(u32 *)dest =make_data_loc (ret, __dest - base); - -return ret; +return kern_fetch_store_string_user (addr, dest, base); }/*
@@ -508,29 +480,7 @@ fetch_store_string_user(unsigned long ad static nokprobe_inline intfetch_store_string (unsigned long addr,void *dest,void *base) { -int maxlen =get_loc_len (*(u32 *)dest); -void *__dest; -long ret; - -#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE -if ((unsigned long )addr <TASK_SIZE ) -return fetch_store_string_user (addr, dest, base); -#endif - -if (unlikely (!maxlen)) -return -ENOMEM ; - - __dest =get_loc_data (dest, base); - -/* -* Try to get string again, since the string can be changed while -* probing. -*/ - ret =strncpy_from_kernel_nofault (__dest, (void *)addr, maxlen); -if (ret >=0 ) - *(u32 *)dest =make_data_loc (ret, __dest - base); - -return ret; +return kern_fetch_store_string (addr, dest, base); }static nokprobe_inline int
kernel/trace/trace_kprobe.c +5 -55
90 lines not on this page · raw message
kernel/trace/trace_probe_kernel.h new file +96 -0
96 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 154/717 thunderbolt: Explicitly enable lane adapter hotplug events at startup
In reply to Greg Kroah-HartmanFrom: Mario Limonciello <[email protected]>
commit 5d2569cb4a65c373896ec0217febdf88739ed295 upstream.
Software that has run before the USB4 CM in Linux runs may have disabled hotplug events for a given lane adapter.
Other CMs such as that one distributed with Windows 11 will enable hotplug events. Do the same thing in the Linux CM which fixes hotplug events on "AMD Pink Sardine".
--- drivers/thunderbolt/switch.c | 24 ++++++++++++++++++++++++ drivers/thunderbolt/tb.h | 1 + drivers/thunderbolt/tb_regs.h | 1 + drivers/thunderbolt/usb4.c | 20 ++++++++++++++++++++ 4 files changed, 46 insertions(+)
drivers/thunderbolt/switch.c +24 -0
@@ -2822,6 +2822,26 @@ static void tb_switch_credits_init(structb_sw_info (sw,"failed to determine preferred buffer allocation, using defaults\n" ); } +static int tb_switch_port_hotplug_enable (struct tb_switch *sw) +{ +struct tb_port *port; + +if (tb_switch_is_icm (sw)) +return 0 ; + +tb_switch_for_each_port (sw, port) { +int res; + +if (!port->cap_usb4) +continue ; + + res =usb4_port_hotplug_enable (port); +if (res) +return res; + } +return 0 ; +} +/** * tb_switch_add() - Add a switch to the domain * @sw: Switch to add
@@ -2891,6 +2911,10 @@ int tb_switch_add(struct tb_switch *sw)return ret; } + ret =tb_switch_port_hotplug_enable (sw); +if (ret) +return ret; + ret =device_add (&sw->dev);if (ret) {dev_err (&sw->dev,"failed to add device: %d\n" , ret);
drivers/thunderbolt/tb.h +1 -0
@@ -1170,6 +1170,7 @@ int usb4_switch_add_ports(struct tb_switvoid usb4_switch_remove_ports (struct tb_switch *sw);int usb4_port_unlock (struct tb_port *port); +int usb4_port_hotplug_enable (struct tb_port *port);int usb4_port_configure (struct tb_port *port);void usb4_port_unconfigure (struct tb_port *port);int usb4_port_configure_xdomain (struct tb_port *port);
drivers/thunderbolt/tb_regs.h +1 -0
@@ -302,6 +302,7 @@ struct tb_regs_port_header {#define ADP_CS_5 0x05#define ADP_CS_5_LCA_MASK GENMASK(28, 22)#define ADP_CS_5_LCA_SHIFT 22 +#define ADP_CS_5_DHP BIT(31)/* TMU adapter registers */ #define TMU_ADP_CS_3 0x03
drivers/thunderbolt/usb4.c +20 -0
@@ -1046,6 +1046,26 @@ int usb4_port_unlock(struct tb_port *porreturn tb_port_write (port, &val,TB_CFG_PORT ,ADP_CS_4 ,1 ); } +/** +* usb4_port_hotplug_enable() - Enables hotplug for a port +* @port: USB4 port to operate on +* +* Enables hot plug events on a given port. This is only intended +* to be used on lane, DP-IN, and DP-OUT adapters. +*/ +int usb4_port_hotplug_enable (struct tb_port *port) +{ +int ret; +u32 val; + + ret =tb_port_read (port, &val,TB_CFG_PORT ,ADP_CS_5 ,1 ); +if (ret) +return ret; + + val &= ~ADP_CS_5_DHP ; +return tb_port_write (port, &val,TB_CFG_PORT ,ADP_CS_5 ,1 ); +} +static int usb4_port_set_configured (struct tb_port *port,bool configured) {int ret;
Greg Kroah-Hartman
maintainerPATCH 182/717 sh: machvec: Use char[] for section boundaries
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
[ Upstream commit c5783af354688b24abd359f7086c282ec74de993 ]
As done for other sections, define the extern as a character array, which relaxes many of the compiler-time object size checks, which would otherwise assume it's a single long. Solves the following build error:
arch/sh/kernel/machvec.c: error: array subscript 'struct sh_machine_vector[0]' is partly outside array bounds of 'long int[1]' [-Werror=array-bounds]: => 105:33
--- arch/sh/include/asm/sections.h | 2 +- arch/sh/kernel/machvec.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-)
arch/sh/include/asm/sections.h +1 -1
@@ -4,7 +4,7 @@#include <asm-generic/sections.h> -extern long __machvec_start, __machvec_end; +extern char __machvec_start[], __machvec_end[];extern char __uncached_start, __uncached_end;extern char __start_eh_frame[], __stop_eh_frame[];
arch/sh/kernel/machvec.c +5 -5
@@ -20,8 +20,8 @@#define MV_NAME_SIZE 32#define for_each_mv (mv) \ - for ((mv) = (struct sh_machine_vector *)&__machvec_start; \ - (mv) && (unsigned long)(mv) < (unsigned long)&__machvec_end; \ + for ((mv) = (struct sh_machine_vector *)__machvec_start; \ + (mv) && (unsigned long)(mv) < (unsigned long)__machvec_end; \ (mv)++)static struct sh_machine_vector *__init get_mv_byname (const char *name)
@@ -87,8 +87,8 @@ void __init sh_mv_setup(void)if (!machvec_selected) {unsigned long machvec_size; - machvec_size = ((unsigned long )&__machvec_end - - (unsigned long )&__machvec_start); + machvec_size = ((unsigned long )__machvec_end - + (unsigned long )__machvec_start);/* * Sanity check for machvec section alignment. Ensure
@@ -102,7 +102,7 @@ void __init sh_mv_setup(void)* vector (usually the only one) from .machvec.init. */ if (machvec_size >=sizeof (struct sh_machine_vector )) - sh_mv = *(struct sh_machine_vector *)&__machvec_start; + sh_mv = *(struct sh_machine_vector *)__machvec_start; }pr_notice ("Booting machvec: %s\n" ,get_system_type ());
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 153/717 rpmsg: char: Avoid double destroy of default endpoint
In reply to Greg Kroah-HartmanFrom: Shengjiu Wang <[email protected]>
commit 467233a4ac29b215d492843d067a9f091e6bf0c5 upstream.
The rpmsg_dev_remove() in rpmsg_core is the place for releasing this default endpoint.
So need to avoid destroying the default endpoint in rpmsg_chrdev_eptdev_destroy(), this should be the same as rpmsg_eptdev_release(). Otherwise there will be double destroy issue that ept->refcount report warning:
refcount_t: underflow; use-after-free.
Call trace: refcount_warn_saturate+0xf8/0x150 virtio_rpmsg_destroy_ept+0xd4/0xec rpmsg_dev_remove+0x60/0x70
The issue can be reproduced by stopping remoteproc before closing the /dev/rpmsgX.
--- drivers/rpmsg/rpmsg_char.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/rpmsg/rpmsg_char.c +3 -1
@@ -76,7 +76,9 @@ int rpmsg_chrdev_eptdev_destroy(struct dmutex_lock (&eptdev->ept_lock);if (eptdev->ept) { -rpmsg_destroy_ept (eptdev->ept); +/* The default endpoint is released by the rpmsg core */ +if (!eptdev->default_ept) +rpmsg_destroy_ept (eptdev->ept); eptdev->ept =NULL ; }mutex_unlock (&eptdev->ept_lock);
Greg Kroah-Hartman
maintainerPATCH 201/717 wifi: ath10k: add peer map clean up for peer delete in ath10k_sta_state()
In reply to Greg Kroah-HartmanFrom: Wen Gong <[email protected]>
[ Upstream commit f020d9570a04df0762a2ac5c50cf1d8c511c9164 ]
When peer delete failed in a disconnect operation, use-after-free detected by KFENCE in below log. It is because for each vdev_id and address, it has only one struct ath10k_peer, it is allocated in ath10k_peer_map_event(). When connected to an AP, it has more than one HTT_T2H_MSG_TYPE_PEER_MAP reported from firmware, then the array peer_map of struct ath10k will be set muti-elements to the same ath10k_peer in ath10k_peer_map_event(). When peer delete failed in ath10k_sta_state(), the ath10k_peer will be free for the 1st peer id in array peer_map of struct ath10k, and then use-after-free happened for the 2nd peer id because they map to the same ath10k_peer.
And clean up all peers in array peer_map for the ath10k_peer, then user-after-free disappeared
peer map event log:
[ 306.911021] wlan0: authenticate with b0:2a:43:e6:75:0e [ 306.957187] ath10k_pci 0000:01:00.0: mac vdev 0 peer create b0:2a:43:e6:75:0e (new sta) sta 1 / 32 peer 1 / 33 [ 306.957395] ath10k_pci 0000:01:00.0: htt peer map vdev 0 peer b0:2a:43:e6:75:0e id 246 [ 306.957404] ath10k_pci 0000:01:00.0: htt peer map vdev 0 peer b0:2a:43:e6:75:0e id 198 [ 306.986924] ath10k_pci 0000:01:00.0: htt peer map vdev 0 peer b0:2a:43:e6:75:0e id 166
peer unmap event log:
[ 435.715691] wlan0: deauthenticating from b0:2a:43:e6:75:0e by local choice (Reason: 3=DEAUTH_LEAVING) [ 435.716802] ath10k_pci 0000:01:00.0: mac vdev 0 peer delete b0:2a:43:e6:75:0e sta ffff990e0e9c2b50 (sta gone) [ 435.717177] ath10k_pci 0000:01:00.0: htt peer unmap vdev 0 peer b0:2a:43:e6:75:0e id 246 [ 435.717186] ath10k_pci 0000:01:00.0: htt peer unmap vdev 0 peer b0:2a:43:e6:75:0e id 198 [ 435.717193] ath10k_pci 0000:01:00.0: htt peer unmap vdev 0 peer b0:2a:43:e6:75:0e id 166
use-after-free log:
[21705.888627] wlan0: deauthenticating from d0:76:8f:82:be:75 by local choice (Reason: 3=DEAUTH_LEAVING) [21713.799910] ath10k_pci 0000:01:00.0: failed to delete peer d0:76:8f:82:be:75 for vdev 0: -110 [21713.799925] ath10k_pci 0000:01:00.0: found sta peer d0:76:8f:82:be:75 (ptr 0000000000000000 id 102) entry on vdev 0 after it was supposedly removed [21713.799968] ================================================================== [21713.799991] BUG: KFENCE: use-after-free read in ath10k_sta_state+0x265/0xb8a [ath10k_core] [21713.799991] [21713.799997] Use-after-free read at 0x00000000abe1c75e (in kfence-#69): [21713.800010] ath10k_sta_state+0x265/0xb8a [ath10k_core] [21713.800041] drv_sta_state+0x115/0x677 [mac80211] [21713.800059] __sta_info_destroy_part2+0xb1/0x133 [mac80211] [21713.800076] __sta_info_flush+0x11d/0x162 [mac80211] [21713.800093] ieee80211_set_disassoc+0x12d/0x2f4 [mac80211] [21713.800110] ieee80211_mgd_deauth+0x26c/0x29b [mac80211] [21713.800137] cfg80211_mlme_deauth+0x13f/0x1bb [cfg80211] [21713.800153] nl80211_deauthenticate+0xf8/0x121 [cfg80211] [21713.800161] genl_rcv_msg+0x38e/0x3be [21713.800166] netlink_rcv_skb+0x89/0xf7 [21713.800171] genl_rcv+0x28/0x36 [21713.800176] netlink_unicast+0x179/0x24b [21713.800181] netlink_sendmsg+0x3a0/0x40e [21713.800187] sock_sendmsg+0x72/0x76 [21713.800192] ____sys_sendmsg+0x16d/0x1e3 [21713.800196] ___sys_sendmsg+0x95/0xd1 [21713.800200] __sys_sendmsg+0x85/0xbf [21713.800205] do_syscall_64+0x43/0x55 [21713.800210] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [21713.800213] [21713.800219] kfence-#69: 0x000000009149b0d5-0x000000004c0697fb, size=1064, cache=kmalloc-2k [21713.800219] [21713.800224] allocated by task 13 on cpu 0 at 21705.501373s: [21713.800241] ath10k_peer_map_event+0x7e/0x154 [ath10k_core] [21713.800254] ath10k_htt_t2h_msg_handler+0x586/0x1039 [ath10k_core] [21713.800265] ath10k_htt_htc_t2h_msg_handler+0x12/0x28 [ath10k_core] [21713.800277] ath10k_htc_rx_completion_handler+0x14c/0x1b5 [ath10k_core] [21713.800283] ath10k_pci_process_rx_cb+0x195/0x1df [ath10k_pci] [21713.800294] ath10k_ce_per_engine_service+0x55/0x74 [ath10k_core] [21713.800305] ath10k_ce_per_engine_service_any+0x76/0x84 [ath10k_core] [21713.800310] ath10k_pci_napi_poll+0x49/0x144 [ath10k_pci] [21713.800316] net_rx_action+0xdc/0x361 [21713.800320] __do_softirq+0x163/0x29a [21713.800325] asm_call_irq_on_stack+0x12/0x20 [21713.800331] do_softirq_own_stack+0x3c/0x48 [21713.800337] __irq_exit_rcu+0x9b/0x9d [21713.800342] common_interrupt+0xc9/0x14d [21713.800346] asm_common_interrupt+0x1e/0x40 [21713.800351] ksoftirqd_should_run+0x5/0x16 [21713.800357] smpboot_thread_fn+0x148/0x211 [21713.800362] kthread+0x150/0x15f [21713.800367] ret_from_fork+0x22/0x30 [21713.800370] [21713.800374] freed by task 708 on cpu 1 at 21713.799953s: [21713.800498] ath10k_sta_state+0x2c6/0xb8a [ath10k_core] [21713.800515] drv_sta_state+0x115/0x677 [mac80211] [21713.800532] __sta_info_destroy_part2+0xb1/0x133 [mac80211] [21713.800548] __sta_info_flush+0x11d/0x162 [mac80211] [21713.800565] ieee80211_set_disassoc+0x12d/0x2f4 [mac80211] [21713.800581] ieee80211_mgd_deauth+0x26c/0x29b [mac80211] [21713.800598] cfg80211_mlme_deauth+0x13f/0x1bb [cfg80211] [21713.800614] nl80211_deauthenticate+0xf8/0x121 [cfg80211] [21713.800619] genl_rcv_msg+0x38e/0x3be [21713.800623] netlink_rcv_skb+0x89/0xf7 [21713.800628] genl_rcv+0x28/0x36 [21713.800632] netlink_unicast+0x179/0x24b [21713.800637] netlink_sendmsg+0x3a0/0x40e [21713.800642] sock_sendmsg+0x72/0x76 [21713.800646] ____sys_sendmsg+0x16d/0x1e3 [21713.800651] ___sys_sendmsg+0x95/0xd1 [21713.800655] __sys_sendmsg+0x85/0xbf [21713.800659] do_syscall_64+0x43/0x55 [21713.800663] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00288-QCARMSWPZ-1
--- drivers/net/wireless/ath/ath10k/mac.c | 54 ++++++++++++++------------- 1 file changed, 29 insertions(+), 25 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +29 -25
@@ -864,11 +864,36 @@ static int ath10k_peer_delete(struct ath10k *ar, u32 vdev_id, const u8 *addr)return 0 ; } +static void ath10k_peer_map_cleanup (struct ath10k *ar,struct ath10k_peer *peer) +{ +int peer_id, i; + +lockdep_assert_held (&ar->conf_mutex); + +for_each_set_bit (peer_id, peer->peer_ids, +ATH10K_MAX_NUM_PEER_IDS ) { + ar->peer_map[peer_id] =NULL ; + } + +/* Double check that peer is properly un-referenced from +* the peer_map +*/ +for (i =0 ; i <ARRAY_SIZE (ar->peer_map); i++) { +if (ar->peer_map[i] == peer) { +ath10k_warn (ar,"removing stale peer_map entry for %pM (ptr %pK idx %d)\n" , + peer->addr, peer, i); + ar->peer_map[i] =NULL ; + } + } + +list_del (&peer->list); +kfree (peer); + ar->num_peers--; +} +static void ath10k_peer_cleanup (struct ath10k *ar,u32 vdev_id) {struct ath10k_peer *peer, *tmp; -int peer_id; -int i;lockdep_assert_held (&ar->conf_mutex);
@@ -880,25 +905,7 @@ static void ath10k_peer_cleanup(struct ath10k *ar, u32 vdev_id)ath10k_warn (ar,"removing stale peer %pM from vdev_id %d\n" , peer->addr, vdev_id); -for_each_set_bit (peer_id, peer->peer_ids, -ATH10K_MAX_NUM_PEER_IDS ) { - ar->peer_map[peer_id] =NULL ; - } - -/* Double check that peer is properly un-referenced from -* the peer_map -*/ -for (i =0 ; i <ARRAY_SIZE (ar->peer_map); i++) { -if (ar->peer_map[i] == peer) { -ath10k_warn (ar,"removing stale peer_map entry for %pM (ptr %pK idx %d)\n" , - peer->addr, peer, i); - ar->peer_map[i] =NULL ; - } - } - -list_del (&peer->list); -kfree (peer); - ar->num_peers--; +ath10k_peer_map_cleanup (ar, peer); }spin_unlock_bh (&ar->data_lock); }
@@ -7586,10 +7593,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,/* Clean up the peer object as well since we * must have failed to do this above. */ -list_del (&peer->list); - ar->peer_map[i] =NULL ; -kfree (peer); - ar->num_peers--; +ath10k_peer_map_cleanup (ar, peer); } }spin_unlock_bh (&ar->data_lock);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 147/717 tracing: Wake up waiters when tracing is disabled
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit 2b0fd9a59b7990c161fa1cb7b79edb22847c87c2 upstream.
When tracing is disabled, there's no reason that waiters should stay waiting, wake them up, otherwise tasks get stuck when they should be flushing the buffers.
--- kernel/trace/trace.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/trace/trace.c +6 -0
@@ -8334,6 +8334,10 @@ tracing_buffers_splice_read(struct fileif (ret) goto out; +/* No need to wait after waking up when tracing is off */ +if (!tracer_tracing_is_on (iter->tr)) + goto out; +/* Make sure we see the new wait_index */ smp_rmb ();if (wait_index != iter->wait_index)
@@ -9043,6 +9047,8 @@ rb_simple_write(struct file *filp, consttracer_tracing_off (tr);if (tr->current_trace->stop) tr->current_trace->stop (tr); +/* Wake up any waiters */ +ring_buffer_wake_waiters (buffer,RING_BUFFER_ALL_CPUS ); }mutex_unlock (&trace_types_lock); }
Greg Kroah-Hartman
maintainerPATCH 173/717 drm/amd/display: Fix vblank refcount in vrr transition
In reply to Greg Kroah-HartmanFrom: Yunxiang Li <[email protected]>
commit 8799c0be89ebb99a16098bdf618f49f817bef76a upstream.
manage_dm_interrupts disable/enable vblank using drm_crtc_vblank_off/on which causes drm_crtc_vblank_get in vrr_transition to fail, and later when drm_crtc_vblank_put is called the refcount on vblank will be messed up. Therefore move the call to after manage_dm_interrupts.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 55 ++++++++++------------ 1 file changed, 26 insertions(+), 29 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +26 -29
@@ -9157,15 +9157,15 @@ static void amdgpu_dm_handle_vrr_transit* We also need vupdate irq for the actual core vblank handling * at end of vblank. */ -dm_set_vupdate_irq (new_state->base.crtc, true); -drm_crtc_vblank_get (new_state->base.crtc); +WARN_ON (dm_set_vupdate_irq (new_state->base.crtc, true) !=0 ); +WARN_ON (drm_crtc_vblank_get (new_state->base.crtc) !=0 );DRM_DEBUG_DRIVER ("%s: crtc=%u VRR off->on: Get vblank ref\n" , __func__, new_state->base.crtc->base.id); }else if (old_vrr_active && !new_vrr_active) {/* Transition VRR active -> inactive: * Allow vblank irq disable again for fixed refresh rate. */ -dm_set_vupdate_irq (new_state->base.crtc, false); +WARN_ON (dm_set_vupdate_irq (new_state->base.crtc, false) !=0 );drm_crtc_vblank_put (new_state->base.crtc);DRM_DEBUG_DRIVER ("%s: crtc=%u VRR on->off: Drop vblank ref\n" , __func__, new_state->base.crtc->base.id);
@@ -9916,23 +9916,6 @@ static void amdgpu_dm_atomic_commit_tailmutex_unlock (&dm->dc_lock); } -/* Count number of newly disabled CRTCs for dropping PM refs later. */ -for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, - new_crtc_state, i) { -if (old_crtc_state->active && !new_crtc_state->active) - crtc_disable_count++; - - dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); - dm_old_crtc_state =to_dm_crtc_state (old_crtc_state); - -/* For freesync config update on crtc state and params for irq */ -update_stream_irq_parameters (dm, dm_new_crtc_state); - -/* Handle vrr on->off / off->on transitions */ -amdgpu_dm_handle_vrr_transition (dm_old_crtc_state, - dm_new_crtc_state); - } -/** * Enable interrupts for CRTCs that are newly enabled or went through * a modeset. It was intentionally deferred until after the front end
@@ -9942,16 +9925,29 @@ static void amdgpu_dm_atomic_commit_tailfor_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) {struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc);#ifdef CONFIG_DEBUG_FS -bool configure_crc = false;enum amdgpu_dm_pipe_crc_source cur_crc_src;#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY ) -struct crc_rd_work *crc_rd_wrk = dm->crc_rd_wrk; +struct crc_rd_work *crc_rd_wrk; +#endif +#endif +/* Count number of newly disabled CRTCs for dropping PM refs later. */ +if (old_crtc_state->active && !new_crtc_state->active) + crtc_disable_count++; + + dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); + dm_old_crtc_state =to_dm_crtc_state (old_crtc_state); + +/* For freesync config update on crtc state and params for irq */ +update_stream_irq_parameters (dm, dm_new_crtc_state); + +#ifdef CONFIG_DEBUG_FS +#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY ) + crc_rd_wrk = dm->crc_rd_wrk;#endif spin_lock_irqsave (&adev_to_drm (adev)->event_lock, flags); cur_crc_src = acrtc->dm_irq_params.crc_src;spin_unlock_irqrestore (&adev_to_drm (adev)->event_lock, flags);#endif - dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); if (new_crtc_state->active && (!old_crtc_state->active ||
@@ -9959,16 +9955,19 @@ static void amdgpu_dm_atomic_commit_taildc_stream_retain (dm_new_crtc_state->stream); acrtc->dm_irq_params.stream = dm_new_crtc_state->stream;manage_dm_interrupts (adev, acrtc, true); + } +/* Handle vrr on->off / off->on transitions */ +amdgpu_dm_handle_vrr_transition (dm_old_crtc_state, dm_new_crtc_state);#ifdef CONFIG_DEBUG_FS +if (new_crtc_state->active && + (!old_crtc_state->active || +drm_atomic_crtc_needs_modeset (new_crtc_state))) {/** * Frontend may have changed so reapply the CRC capture * settings for the stream. */ - dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); -if (amdgpu_dm_is_valid_crc_source (cur_crc_src)) { - configure_crc = true;#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY )if (amdgpu_dm_crc_window_is_activated (crtc)) {spin_lock_irqsave (&adev_to_drm (adev)->event_lock, flags);
@@ -9980,12 +9979,10 @@ static void amdgpu_dm_atomic_commit_tailspin_unlock_irqrestore (&adev_to_drm (adev)->event_lock, flags); }#endif - } - -if (configure_crc)if (amdgpu_dm_crtc_configure_crc_source ( crtc, dm_new_crtc_state, cur_crc_src))DRM_DEBUG_DRIVER ("Failed to configure crc source" ); + }#endif } }