Skip to content

Commit

Permalink
tree-wide: Fix compilation after merging up to v4.4.241
Browse files Browse the repository at this point in the history
Adapt some (vendor) driver and mm modifications to kernel API changes
that were introduced since v4.4.146.
  • Loading branch information
JamiKettunen committed Nov 4, 2020
1 parent 56aee42 commit ec0feb0
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 20 deletions.
4 changes: 2 additions & 2 deletions drivers/cpufreq/cpufreq_interactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ static ssize_t store_io_is_busy(struct cpufreq_interactive_tunables *tunables,
*/
#define show_gov_pol_sys(file_name) \
static ssize_t show_##file_name##_gov_sys \
(struct kobject *kobj, struct attribute *attr, char *buf) \
(struct kobject *kobj, struct kobj_attribute *attr, char *buf) \
{ \
return show_##file_name(common_tunables, buf); \
} \
Expand All @@ -1084,7 +1084,7 @@ static ssize_t show_##file_name##_gov_pol \

#define store_gov_pol_sys(file_name) \
static ssize_t store_##file_name##_gov_sys \
(struct kobject *kobj, struct attribute *attr, const char *buf, \
(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, \
size_t count) \
{ \
return store_##file_name(common_tunables, buf, count); \
Expand Down
12 changes: 6 additions & 6 deletions drivers/cpufreq/cpufreq_times.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ static int concurrent_time_seq_show(struct seq_file *m, void *v,
hlist_for_each_entry_rcu(uid_entry, (struct hlist_head *)v, hash) {
atomic64_t *times = get_times(uid_entry->concurrent_times);

seq_put_decimal_ull(m, "", (u64)uid_entry->uid);
seq_printf(m, "%llu", (u64)uid_entry->uid);
seq_putc(m, ':');

for (i = 0; i < num_possible_cpus; ++i) {
u64 time = cputime_to_clock_t(atomic64_read(&times[i]));

seq_put_decimal_ull(m, " ", time);
seq_printf(m, " %llu", time);
}
seq_putc(m, '\n');
}
Expand All @@ -280,7 +280,7 @@ static inline atomic64_t *get_active_times(struct concurrent_times *times)
static int concurrent_active_time_seq_show(struct seq_file *m, void *v)
{
if (v == uid_hash_table) {
seq_put_decimal_ull(m, "cpus: ", num_possible_cpus());
seq_printf(m, "cpus: %d", num_possible_cpus());
seq_putc(m, '\n');
}

Expand All @@ -306,18 +306,18 @@ static int concurrent_policy_time_seq_show(struct seq_file *m, void *v)
continue;
if (freqs != last_freqs) {
if (last_freqs) {
seq_put_decimal_ull(m, ": ", cnt);
seq_printf(m, ": %d", cnt);
seq_putc(m, ' ');
cnt = 0;
}
seq_put_decimal_ull(m, "policy", i);
seq_printf(m, "policy%d", i);

last_freqs = freqs;
}
cnt++;
}
if (last_freqs) {
seq_put_decimal_ull(m, ": ", cnt);
seq_printf(m, ": %d", cnt);
seq_putc(m, '\n');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3255,8 +3255,8 @@ static int kbase_jd_user_buf_map(struct kbase_context *kctx,
pinned_pages = get_user_pages(NULL, mm,
address,
alloc->imported.user_buf.nr_pages,
reg->flags & KBASE_REG_GPU_WR,
0, pages, NULL);
(reg->flags & KBASE_REG_GPU_WR) ? FOLL_WRITE : 0,
pages, NULL);
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
pinned_pages = get_user_pages_remote(NULL, mm,
address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,8 @@ static struct kbase_va_region *kbase_mem_from_user_buffer(

#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
faulted_pages = get_user_pages(current, current->mm, address, *va_pages,
reg->flags & KBASE_REG_GPU_WR, 0, pages, NULL);
(reg->flags & KBASE_REG_GPU_WR) ? FOLL_WRITE : 0,
pages, NULL);
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
faulted_pages = get_user_pages(address, *va_pages,
reg->flags & KBASE_REG_GPU_WR, 0, pages, NULL);
Expand Down
3 changes: 2 additions & 1 deletion drivers/misc/mediatek/m4u/2.0/m4u.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ static int m4u_fill_sgtable_user(struct vm_area_struct *vma, unsigned long va, i
for (fault_cnt = 0; fault_cnt < 3000; fault_cnt++) {
if (has_page) {
ret = get_user_pages(current, current->mm, va_tmp, 1,
(vma->vm_flags & VM_WRITE), 0, &pages, NULL);
(vma->vm_flags & VM_WRITE) ? FOLL_WRITE : 0,
&pages, NULL);

if (ret == 1)
pa = page_to_phys(pages) | (va_tmp & ~PAGE_MASK);
Expand Down
4 changes: 3 additions & 1 deletion drivers/mmc/card/mtk_mmc_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ static void mt_bio_init_ctx(struct mt_bio_context *ctx, struct task_struct *thre
struct request_queue *q)
{
int i;
char tmp[TASK_COMM_LEN];

ctx->q = q;
ctx->pid = task_pid_nr(thread);
get_task_comm(ctx->comm, thread);
get_task_comm(tmp, thread);
snprintf(ctx->comm, TASK_COMM_LEN, "%s", tmp);
ctx->qid = get_qid_by_name(ctx->comm);
spin_lock_init(&ctx->lock);
ctx->id = get_ctxid_by_name(ctx->comm);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/android/ion/ion.c
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,7 @@ struct ion_handle *ion_drv_get_handle(struct ion_client *client, int user_handle
ion_handle_get(handle);
mutex_unlock(&client->lock);
} else {
handle = ion_handle_get_by_id(client, user_handle);
handle = ion_handle_get_by_id_nolock(client, user_handle);
if (!handle) {
IONMSG("%s handle invalid, handle_id=%d\n", __func__, user_handle);
return ERR_PTR(-EINVAL);
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/gadget/configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,7 @@ static void configfs_composite_unbind(struct usb_gadget *gadget)
spin_unlock_irqrestore(&gi->spinlock, flags);
}

#ifndef CONFIG_USB_CONFIGFS_UEVENT
static int configfs_composite_setup(struct usb_gadget *gadget,
const struct usb_ctrlrequest *ctrl)
{
Expand Down Expand Up @@ -1625,6 +1626,7 @@ static void configfs_composite_disconnect(struct usb_gadget *gadget)
composite_disconnect(gadget);
spin_unlock_irqrestore(&gi->spinlock, flags);
}
#endif /* CONFIG_USB_CONFIGFS_UEVENT */

static void configfs_composite_suspend(struct usb_gadget *gadget)
{
Expand Down
2 changes: 1 addition & 1 deletion include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
struct vm_area_struct **vmas);
long get_user_pages_durable(struct task_struct *tsk, struct mm_struct *mm,
unsigned long start, unsigned long nr_pages,
int write, int force, struct page **pages,
unsigned int gup_flags, struct page **pages,
struct vm_area_struct **vmas);
long get_user_pages_locked(struct task_struct *tsk, struct mm_struct *mm,
unsigned long start, unsigned long nr_pages,
Expand Down
10 changes: 6 additions & 4 deletions mm/gup.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,11 +933,13 @@ long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
EXPORT_SYMBOL(get_user_pages);

long get_user_pages_durable(struct task_struct *tsk, struct mm_struct *mm,
unsigned long start, unsigned long nr_pages, int write,
int force, struct page **pages, struct vm_area_struct **vmas)
unsigned long start, unsigned long nr_pages,
unsigned int gup_flags, struct page **pages,
struct vm_area_struct **vmas)
{
return __get_user_pages_locked(tsk, mm, start, nr_pages, write, force,
pages, vmas, NULL, false, FOLL_TOUCH | FOLL_DURABLE);
return __get_user_pages_locked(tsk, mm, start, nr_pages,
pages, vmas, NULL, false,
gup_flags | FOLL_TOUCH | FOLL_DURABLE);
}
EXPORT_SYMBOL(get_user_pages_durable);

Expand Down
2 changes: 1 addition & 1 deletion mm/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ void quiet_vmstat(void)
* it would be too expensive from this path.
* vmstat_shepherd will take care about that for us.
*/
refresh_cpu_vm_stats(false);
refresh_cpu_vm_stats();
}


Expand Down

0 comments on commit ec0feb0

Please sign in to comment.