mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
Merge b253435746 ("Merge tag 'xtensa-20220416' of https://github.com/jcmvbkbc/linux-xtensa") into android-mainline
Steps on the way to 5.18-rc4 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ie7847dc6df558b238dc971353d9542f006c39d4d
This commit is contained in:
@@ -9,8 +9,9 @@ Description: Shows all enabled kernel features.
|
||||
What: /sys/fs/erofs/<disk>/sync_decompress
|
||||
Date: November 2021
|
||||
Contact: "Huang Jianan" <huangjianan@oppo.com>
|
||||
Description: Control strategy of sync decompression
|
||||
Description: Control strategy of sync decompression:
|
||||
|
||||
- 0 (default, auto): enable for readpage, and enable for
|
||||
readahead on atomic contexts only,
|
||||
readahead on atomic contexts only.
|
||||
- 1 (force on): enable for readpage and readahead.
|
||||
- 2 (force off): disable for all situations.
|
||||
|
||||
@@ -119,7 +119,7 @@ void __memcpy_flushcache(void *_dst, const void *_src, size_t size)
|
||||
|
||||
/* cache copy and flush to align dest */
|
||||
if (!IS_ALIGNED(dest, 8)) {
|
||||
unsigned len = min_t(unsigned, size, ALIGN(dest, 8) - dest);
|
||||
size_t len = min_t(size_t, size, ALIGN(dest, 8) - dest);
|
||||
|
||||
memcpy((void *) dest, (void *) source, len);
|
||||
clean_cache_range((void *) dest, len);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
.if XTENSA_HAVE_COPROCESSOR(x); \
|
||||
.align 4; \
|
||||
.Lsave_cp_regs_cp##x: \
|
||||
xchal_cp##x##_store a2 a4 a5 a6 a7; \
|
||||
xchal_cp##x##_store a2 a3 a4 a5 a6; \
|
||||
jx a0; \
|
||||
.endif
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
.if XTENSA_HAVE_COPROCESSOR(x); \
|
||||
.align 4; \
|
||||
.Lload_cp_regs_cp##x: \
|
||||
xchal_cp##x##_load a2 a4 a5 a6 a7; \
|
||||
xchal_cp##x##_load a2 a3 a4 a5 a6; \
|
||||
jx a0; \
|
||||
.endif
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ static int patch_text_stop_machine(void *data)
|
||||
{
|
||||
struct patch *patch = data;
|
||||
|
||||
if (atomic_inc_return(&patch->cpu_count) == 1) {
|
||||
if (atomic_inc_return(&patch->cpu_count) == num_online_cpus()) {
|
||||
local_patch_text(patch->addr, patch->data, patch->sz);
|
||||
atomic_inc(&patch->cpu_count);
|
||||
} else {
|
||||
|
||||
@@ -36,24 +36,19 @@ static void rs_poll(struct timer_list *);
|
||||
static struct tty_driver *serial_driver;
|
||||
static struct tty_port serial_port;
|
||||
static DEFINE_TIMER(serial_timer, rs_poll);
|
||||
static DEFINE_SPINLOCK(timer_lock);
|
||||
|
||||
static int rs_open(struct tty_struct *tty, struct file * filp)
|
||||
{
|
||||
spin_lock_bh(&timer_lock);
|
||||
if (tty->count == 1)
|
||||
mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE);
|
||||
spin_unlock_bh(&timer_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rs_close(struct tty_struct *tty, struct file * filp)
|
||||
{
|
||||
spin_lock_bh(&timer_lock);
|
||||
if (tty->count == 1)
|
||||
del_timer_sync(&serial_timer);
|
||||
spin_unlock_bh(&timer_lock);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,8 +68,6 @@ static void rs_poll(struct timer_list *unused)
|
||||
int rd = 1;
|
||||
unsigned char c;
|
||||
|
||||
spin_lock(&timer_lock);
|
||||
|
||||
while (simc_poll(0)) {
|
||||
rd = simc_read(0, &c, 1);
|
||||
if (rd <= 0)
|
||||
@@ -87,7 +80,6 @@ static void rs_poll(struct timer_list *unused)
|
||||
tty_flip_buffer_push(port);
|
||||
if (rd)
|
||||
mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE);
|
||||
spin_unlock(&timer_lock);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1066,12 +1066,9 @@ static void z_erofs_decompress_kickoff(struct z_erofs_decompressqueue *io,
|
||||
|
||||
/* wake up the caller thread for sync decompression */
|
||||
if (sync) {
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&io->u.wait.lock, flags);
|
||||
if (!atomic_add_return(bios, &io->pending_bios))
|
||||
wake_up_locked(&io->u.wait);
|
||||
spin_unlock_irqrestore(&io->u.wait.lock, flags);
|
||||
complete(&io->u.done);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1217,7 +1214,7 @@ jobqueue_init(struct super_block *sb,
|
||||
} else {
|
||||
fg_out:
|
||||
q = fgq;
|
||||
init_waitqueue_head(&fgq->u.wait);
|
||||
init_completion(&fgq->u.done);
|
||||
atomic_set(&fgq->pending_bios, 0);
|
||||
}
|
||||
q->sb = sb;
|
||||
@@ -1419,8 +1416,7 @@ static void z_erofs_runqueue(struct super_block *sb,
|
||||
return;
|
||||
|
||||
/* wait until all bios are completed */
|
||||
io_wait_event(io[JQ_SUBMIT].u.wait,
|
||||
!atomic_read(&io[JQ_SUBMIT].pending_bios));
|
||||
wait_for_completion_io(&io[JQ_SUBMIT].u.done);
|
||||
|
||||
/* handle synchronous decompress queue in the caller context */
|
||||
z_erofs_decompress_queue(&io[JQ_SUBMIT], pagepool);
|
||||
|
||||
@@ -97,7 +97,7 @@ struct z_erofs_decompressqueue {
|
||||
z_erofs_next_pcluster_t head;
|
||||
|
||||
union {
|
||||
wait_queue_head_t wait;
|
||||
struct completion done;
|
||||
struct work_struct work;
|
||||
} u;
|
||||
};
|
||||
|
||||
@@ -804,7 +804,7 @@ struct pipe_inode_info *alloc_pipe_info(void)
|
||||
if (too_many_pipe_buffers_hard(user_bufs) && pipe_is_unprivileged_user())
|
||||
goto out_revert_acct;
|
||||
|
||||
pipe->bufs = kvcalloc(pipe_bufs, sizeof(struct pipe_buffer),
|
||||
pipe->bufs = kcalloc(pipe_bufs, sizeof(struct pipe_buffer),
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
|
||||
if (pipe->bufs) {
|
||||
@@ -849,7 +849,7 @@ void free_pipe_info(struct pipe_inode_info *pipe)
|
||||
#endif
|
||||
if (pipe->tmp_page)
|
||||
__free_page(pipe->tmp_page);
|
||||
kvfree(pipe->bufs);
|
||||
kfree(pipe->bufs);
|
||||
kfree(pipe);
|
||||
}
|
||||
|
||||
@@ -1264,7 +1264,8 @@ int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots)
|
||||
if (nr_slots < n)
|
||||
return -EBUSY;
|
||||
|
||||
bufs = kvcalloc(nr_slots, sizeof(*bufs), GFP_KERNEL_ACCOUNT);
|
||||
bufs = kcalloc(nr_slots, sizeof(*bufs),
|
||||
GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
|
||||
if (unlikely(!bufs))
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1291,7 +1292,7 @@ int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots)
|
||||
head = n;
|
||||
tail = 0;
|
||||
|
||||
kvfree(pipe->bufs);
|
||||
kfree(pipe->bufs);
|
||||
pipe->bufs = bufs;
|
||||
pipe->ring_size = nr_slots;
|
||||
if (pipe->max_usage > nr_slots)
|
||||
|
||||
Reference in New Issue
Block a user