You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
Merge branch 'android12-5.10' into branch 'android12-5.10-lts'
Sync up with android12-5.10 for the following commits:b389838308ANDROID: GKI: Add symbols to abi_gki_aarch64_transsion5b696d45bfBACKPORT: nfc: nfcmrvl: main: reorder destructive operations in nfcmrvl_nci_unregister_dev to avoid bugs01680ae117ANDROID: vendor_hook: Add hook in __free_pages()e064059673ANDROID: create and export is_swap_slot_cache_enabledf6f18f7ffaANDROID: vendor_hook: Add hook in swap_slots034877c195ANDROID: mm: export swapcache_free_entries06c2766cbcANDROID: mm: export symbols used in vendor hook android_vh_get_swap_page()d4eef93a9dANDROID: vendor_hooks: Add hooks to extend struct swap_slots_cache4506bcbba5ANDROID: mm: export swap_type_to_swap_infoed2b11d639ANDROID: vendor_hook: Add hook in si_swapinfo()667f0d71dcANDROID: vendor_hooks: Add hooks to extend the struct swap_info_structbc4c73c182ANDROID: vendor_hook: Add hooks in unuse_pte_range() and try_to_unuse()7222a0b29bANDROID: vendor_hook: Add hooks in free_swap_slot()d2fea0ba9aANDROID: vendor_hook: Add hook to update nr_swap_pages and total_swap_pages1aa26f0017ANDROID: vendor_hook: Add hook in page_referenced_one()851672a4b2ANDROID: vendor_hooks: Add hooks to record the I/O statistics of swap:5bc9b10c45ANDROID: vendor_hook: Add hook in migrate_page_states()89a247a638ANDROID: vendor_hook: Add hook in __migration_entry_wait()f7c932399eANDROID: vendor_hook: Add hook in handle_pte_fault()50148ce249ANDROID: vendor_hook: Add hook in do_swap_page()9d4b553252ANDROID: vendor_hook: Add hook in wp_page_copy()e3f469befbANDROID: vendor_hooks: Add hooks to madvise_cold_or_pageout_pte_range()6b7243da5eANDROID: vendor_hook: Add hook in snapshot_refaults()6b04959511ANDROID: vendor_hook: Add hook in inactive_is_low()bb9c8f5256FROMGIT: usb: gadget: f_fs: change ep->ep safe in ffs_epfile_io()7d2bd28eaeFROMGIT: usb: gadget: f_fs: change ep->status safe in ffs_epfile_io()abb407e9ffANDROID: GKI: forward declare struct cgroup_taskset in vendor hooks8d6d335851ANDROID: Fix build error with CONFIG_UCLAMP_TASK disabled1590a0e8e1ANDROID: GKI: include more type definitions in vendor hooks583c0f7c1cANDROID: Update symbol list for mtk5146690a6cANDROID: dma/debug: fix warning of check_sync564ba93050FROMGIT: usb: common: usb-conn-gpio: Allow wakeup from system suspendd41cf0b55bBACKPORT: FROMLIST: usb: gadget: uvc: fix list double add in uvcg_video_pump74769685e4BACKPORT: exfat: improve write performance when dirsync enabled47fa973d9eFROMLIST: devcoredump : Serialize devcd_del workb92ac32536FROMGIT: usb: gadget: uvc: calculate the number of request depending on framesize59d057a3f9ANDROID: GKI: Add tracing_is_on interface into symbol listdb16bd36e8UPSTREAM: usb: gadget: f_mass_storage: Make CD-ROM emulation work with Mac OS-Xfefdf99a96BACKPORT: io_uring: fix race between timeout flush and removal07b78bf6d0BACKPORT: net/sched: cls_u32: fix netns refcount changes in u32_change()95e278bdc8UPSTREAM: io_uring: always use original task when preparing req identity0f77129416FROMLIST: remoteproc: Fix dma_mem leak after rproc_shutdown6a15abd604FROMLIST: dma-mapping: Add dma_release_coherent_memory to DMA API9efe21cd8fANDROID: Update QCOM symbol list for __reset_control_get131b12d50fMerge tag 'android12-5.10.110_r01' into android12-5.108c3ac02bcaANDROID: vendor_hooks: Add hooks for mutexa27d9caa6aBACKPORT: can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path1292f51788BACKPORT: can: usb_8dev: usb_8dev_start_xmit(): fix double dev_kfree_skb() in error path82a3c7ee8dANDROID: GKI: Update symbols to symbol list59735a7d31ANDROID: oplus: Update the ABI xml and symbol list76c90b9959UPSTREAM: remoteproc: Fix count check in rproc_coredump_write()3e71aa523eBACKPORT: esp: Fix possible buffer overflow in ESP transformation66f0c91b2fANDROID: Fix the drain_all_pages default condition broken by a hook393be9a064UPSTREAM: Revert "xfrm: xfrm_state_mtu should return at least 1280 for ipv6"73f6098941UPSTREAM: xfrm: fix MTU regressione27ad1d211ANDROID: signal: Add vendor hook for memory reaping And track more new symbols that were added to the 'android12-5.10' branch: Leaf changes summary: 33 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 31 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 2 Added variables 31 Added functions: [A] 'function int __traceiter_android_vh_killed_process(void*, task_struct*, task_struct*, bool*)' [A] 'function void _snd_pcm_hw_params_any(snd_pcm_hw_params*)' [A] 'function bool check_cache_active()' [A] 'function int copy_to_user_fromio(void*, const volatile void*, size_t)' [A] 'function void debugfs_create_file_size(const char*, umode_t, dentry*, void*, const file_operations*, loff_t)' [A] 'function int devm_regmap_field_bulk_alloc(device*, regmap*, regmap_field**, reg_field*, int)' [A] 'function mem_cgroup* get_mem_cgroup_from_mm(mm_struct*)' [A] 'function bool is_swap_slot_cache_enabled()' [A] 'function void ktime_get_coarse_ts64(timespec64*)' [A] 'function unsigned int linear_range_get_max_value(const linear_range*)' [A] 'function int linear_range_get_value(const linear_range*, unsigned int, unsigned int*)' [A] 'function int platform_irqchip_probe(platform_device*)' [A] 'function int register_tcf_proto_ops(tcf_proto_ops*)' [A] 'function int scan_swap_map_slots(swap_info_struct*, unsigned char, int, swp_entry_t*)' [A] 'function int snd_pcm_kernel_ioctl(snd_pcm_substream*, unsigned int, void*)' [A] 'function int snd_pcm_open_substream(snd_pcm*, int, file*, snd_pcm_substream**)' [A] 'function int snd_pcm_stop(snd_pcm_substream*, snd_pcm_state_t)' [A] 'function long int strnlen_user(const char*, long int)' [A] 'function int swap_alloc_cluster(swap_info_struct*, swp_entry_t*)' [A] 'function swap_info_struct* swap_type_to_swap_info(int)' [A] 'function void swapcache_free_entries(swp_entry_t*, int)' [A] 'function int tcf_action_exec(sk_buff*, tc_action**, int, tcf_result*)' [A] 'function void tcf_exts_destroy(tcf_exts*)' [A] 'function int tcf_exts_dump(sk_buff*, tcf_exts*)' [A] 'function int tcf_exts_dump_stats(sk_buff*, tcf_exts*)' [A] 'function int tcf_exts_validate(net*, tcf_proto*, nlattr**, nlattr*, tcf_exts*, bool, bool, netlink_ext_ack*)' [A] 'function bool tcf_queue_work(rcu_work*, work_func_t)' [A] 'function int thermal_zone_unbind_cooling_device(thermal_zone_device*, int, thermal_cooling_device*)' [A] 'function int tracing_is_on()' [A] 'function int unregister_tcf_proto_ops(tcf_proto_ops*)' [A] 'function usb_role usb_role_switch_get_role(usb_role_switch*)' 2 Added variables: [A] 'tracepoint __tracepoint_android_vh_killed_process' [A] 'void* high_memory' Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ia4a34d9aa1929161e2587529f700f49c31b4c2cc
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2130,6 +2130,7 @@
|
||||
register_shrinker
|
||||
register_syscore_ops
|
||||
register_sysctl_table
|
||||
register_tcf_proto_ops
|
||||
register_virtio_device
|
||||
register_virtio_driver
|
||||
regmap_bulk_read
|
||||
@@ -2629,6 +2630,12 @@
|
||||
__task_pid_nr_ns
|
||||
__task_rq_lock
|
||||
task_rq_lock
|
||||
tcf_action_exec
|
||||
tcf_exts_destroy
|
||||
tcf_exts_dump
|
||||
tcf_exts_dump_stats
|
||||
tcf_exts_validate
|
||||
tcf_queue_work
|
||||
tcp_hashinfo
|
||||
tcp_parse_options
|
||||
thaw_bdev
|
||||
@@ -2812,6 +2819,7 @@
|
||||
__traceiter_android_vh_prepare_update_load_avg_se
|
||||
__traceiter_android_vh_printk_hotplug
|
||||
__traceiter_android_vh_process_killed
|
||||
__traceiter_android_vh_killed_process
|
||||
__traceiter_android_vh_revert_creds
|
||||
__traceiter_android_vh_rmqueue
|
||||
__traceiter_android_vh_rwsem_init
|
||||
@@ -3019,6 +3027,7 @@
|
||||
__tracepoint_android_vh_prepare_update_load_avg_se
|
||||
__tracepoint_android_vh_printk_hotplug
|
||||
__tracepoint_android_vh_process_killed
|
||||
__tracepoint_android_vh_killed_process
|
||||
__tracepoint_android_vh_revert_creds
|
||||
__tracepoint_android_vh_rmqueue
|
||||
__tracepoint_android_vh_rwsem_init
|
||||
@@ -3094,6 +3103,7 @@
|
||||
trace_raw_output_prep
|
||||
trace_seq_printf
|
||||
trace_seq_putc
|
||||
tracing_is_on
|
||||
tracing_off
|
||||
truncate_inode_pages_range
|
||||
truncate_pagecache_range
|
||||
@@ -3209,6 +3219,7 @@
|
||||
unregister_shrinker
|
||||
unregister_syscore_ops
|
||||
unregister_sysctl_table
|
||||
unregister_tcf_proto_ops
|
||||
unregister_virtio_device
|
||||
unregister_virtio_driver
|
||||
up
|
||||
|
||||
@@ -2034,6 +2034,7 @@
|
||||
resched_curr
|
||||
reset_control_assert
|
||||
reset_control_deassert
|
||||
__reset_control_get
|
||||
reset_control_put
|
||||
reset_control_reset
|
||||
resume_cpus
|
||||
|
||||
8
android/abi_gki_aarch64_transsion
Normal file
8
android/abi_gki_aarch64_transsion
Normal file
@@ -0,0 +1,8 @@
|
||||
[abi_symbol_list]
|
||||
get_mem_cgroup_from_mm
|
||||
is_swap_slot_cache_enabled
|
||||
swapcache_free_entries
|
||||
swap_type_to_swap_info
|
||||
scan_swap_map_slots
|
||||
swap_alloc_cluster
|
||||
check_cache_active
|
||||
@@ -29,6 +29,7 @@ android/abi_gki_aarch64_virtual_device
|
||||
android/abi_gki_aarch64_vivo
|
||||
android/abi_gki_aarch64_xiaomi
|
||||
android/abi_gki_aarch64_asus
|
||||
android/abi_gki_aarch64_transsion
|
||||
"
|
||||
|
||||
FILES="${FILES}
|
||||
|
||||
@@ -99,6 +99,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_restore_priority);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_wakeup_ilocked);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_send_sig_info);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_process_killed);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_killed_process);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_init);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_finished);
|
||||
@@ -242,6 +243,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_build_sched_domains);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alter_mutex_list_add);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_unlock_slowpath);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_unlock_slowpath_end);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_start_check_new_owner);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake_finish);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_undefinstr);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_ptrauth_fault);
|
||||
@@ -405,3 +407,26 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_handle_tlb_conf);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_node_memcgs);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ra_tuning_max_page);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_memcg_scan_type);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_handle_pte_fault_end);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cow_user_page);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_swapin_add_anon_rmap);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_waiting_for_page_migration);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_migrate_page_states);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_referenced_one_end);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_count_pswpin);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_count_pswpout);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_count_swpout_vm_event);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_swap_slot_cache_active);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_drain_slots_cache_cpu);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_swap_slot_cache);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_swap_slot);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_get_swap_page);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_isolated_for_reclaim);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_inactive_is_low);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snapshot_refaults);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_swap_pages);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_init_swap_info_struct);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_si);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_pages);
|
||||
|
||||
@@ -29,6 +29,47 @@ struct devcd_entry {
|
||||
struct device devcd_dev;
|
||||
void *data;
|
||||
size_t datalen;
|
||||
/*
|
||||
* Here, mutex is required to serialize the calls to del_wk work between
|
||||
* user/kernel space which happens when devcd is added with device_add()
|
||||
* and that sends uevent to user space. User space reads the uevents,
|
||||
* and calls to devcd_data_write() which try to modify the work which is
|
||||
* not even initialized/queued from devcoredump.
|
||||
*
|
||||
*
|
||||
*
|
||||
* cpu0(X) cpu1(Y)
|
||||
*
|
||||
* dev_coredump() uevent sent to user space
|
||||
* device_add() ======================> user space process Y reads the
|
||||
* uevents writes to devcd fd
|
||||
* which results into writes to
|
||||
*
|
||||
* devcd_data_write()
|
||||
* mod_delayed_work()
|
||||
* try_to_grab_pending()
|
||||
* del_timer()
|
||||
* debug_assert_init()
|
||||
* INIT_DELAYED_WORK()
|
||||
* schedule_delayed_work()
|
||||
*
|
||||
*
|
||||
* Also, mutex alone would not be enough to avoid scheduling of
|
||||
* del_wk work after it get flush from a call to devcd_free()
|
||||
* mentioned as below.
|
||||
*
|
||||
* disabled_store()
|
||||
* devcd_free()
|
||||
* mutex_lock() devcd_data_write()
|
||||
* flush_delayed_work()
|
||||
* mutex_unlock()
|
||||
* mutex_lock()
|
||||
* mod_delayed_work()
|
||||
* mutex_unlock()
|
||||
* So, delete_work flag is required.
|
||||
*/
|
||||
struct mutex mutex;
|
||||
bool delete_work;
|
||||
struct module *owner;
|
||||
ssize_t (*read)(char *buffer, loff_t offset, size_t count,
|
||||
void *data, size_t datalen);
|
||||
@@ -88,7 +129,12 @@ static ssize_t devcd_data_write(struct file *filp, struct kobject *kobj,
|
||||
struct device *dev = kobj_to_dev(kobj);
|
||||
struct devcd_entry *devcd = dev_to_devcd(dev);
|
||||
|
||||
mod_delayed_work(system_wq, &devcd->del_wk, 0);
|
||||
mutex_lock(&devcd->mutex);
|
||||
if (!devcd->delete_work) {
|
||||
devcd->delete_work = true;
|
||||
mod_delayed_work(system_wq, &devcd->del_wk, 0);
|
||||
}
|
||||
mutex_unlock(&devcd->mutex);
|
||||
|
||||
return count;
|
||||
}
|
||||
@@ -116,7 +162,12 @@ static int devcd_free(struct device *dev, void *data)
|
||||
{
|
||||
struct devcd_entry *devcd = dev_to_devcd(dev);
|
||||
|
||||
mutex_lock(&devcd->mutex);
|
||||
if (!devcd->delete_work)
|
||||
devcd->delete_work = true;
|
||||
|
||||
flush_delayed_work(&devcd->del_wk);
|
||||
mutex_unlock(&devcd->mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -126,6 +177,30 @@ static ssize_t disabled_show(struct class *class, struct class_attribute *attr,
|
||||
return sysfs_emit(buf, "%d\n", devcd_disabled);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* disabled_store() worker()
|
||||
* class_for_each_device(&devcd_class,
|
||||
* NULL, NULL, devcd_free)
|
||||
* ...
|
||||
* ...
|
||||
* while ((dev = class_dev_iter_next(&iter))
|
||||
* devcd_del()
|
||||
* device_del()
|
||||
* put_device() <- last reference
|
||||
* error = fn(dev, data) devcd_dev_release()
|
||||
* devcd_free(dev, data) kfree(devcd)
|
||||
* mutex_lock(&devcd->mutex);
|
||||
*
|
||||
*
|
||||
* In the above diagram, It looks like disabled_store() would be racing with parallely
|
||||
* running devcd_del() and result in memory abort while acquiring devcd->mutex which
|
||||
* is called after kfree of devcd memory after dropping its last reference with
|
||||
* put_device(). However, this will not happens as fn(dev, data) runs
|
||||
* with its own reference to device via klist_node so it is not its last reference.
|
||||
* so, above situation would not occur.
|
||||
*/
|
||||
|
||||
static ssize_t disabled_store(struct class *class, struct class_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
@@ -282,13 +357,16 @@ void dev_coredumpm(struct device *dev, struct module *owner,
|
||||
devcd->read = read;
|
||||
devcd->free = free;
|
||||
devcd->failing_dev = get_device(dev);
|
||||
devcd->delete_work = false;
|
||||
|
||||
mutex_init(&devcd->mutex);
|
||||
device_initialize(&devcd->devcd_dev);
|
||||
|
||||
dev_set_name(&devcd->devcd_dev, "devcd%d",
|
||||
atomic_inc_return(&devcd_count));
|
||||
devcd->devcd_dev.class = &devcd_class;
|
||||
|
||||
mutex_lock(&devcd->mutex);
|
||||
if (device_add(&devcd->devcd_dev))
|
||||
goto put_device;
|
||||
|
||||
@@ -302,10 +380,11 @@ void dev_coredumpm(struct device *dev, struct module *owner,
|
||||
|
||||
INIT_DELAYED_WORK(&devcd->del_wk, devcd_del);
|
||||
schedule_delayed_work(&devcd->del_wk, DEVCD_TIMEOUT);
|
||||
|
||||
mutex_unlock(&devcd->mutex);
|
||||
return;
|
||||
put_device:
|
||||
put_device(&devcd->devcd_dev);
|
||||
mutex_unlock(&devcd->mutex);
|
||||
put_module:
|
||||
module_put(owner);
|
||||
free:
|
||||
|
||||
@@ -461,6 +461,7 @@ static void rproc_rvdev_release(struct device *dev)
|
||||
struct rproc_vdev *rvdev = container_of(dev, struct rproc_vdev, dev);
|
||||
|
||||
of_reserved_mem_device_release(dev);
|
||||
dma_release_coherent_memory(dev);
|
||||
|
||||
kfree(rvdev);
|
||||
}
|
||||
|
||||
@@ -275,6 +275,7 @@ static int usb_conn_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, info);
|
||||
device_set_wakeup_capable(&pdev->dev, true);
|
||||
|
||||
/* Perform initial detection */
|
||||
usb_conn_queue_dwork(info, 0);
|
||||
@@ -304,6 +305,14 @@ static int __maybe_unused usb_conn_suspend(struct device *dev)
|
||||
{
|
||||
struct usb_conn_info *info = dev_get_drvdata(dev);
|
||||
|
||||
if (device_may_wakeup(dev)) {
|
||||
if (info->id_gpiod)
|
||||
enable_irq_wake(info->id_irq);
|
||||
if (info->vbus_gpiod)
|
||||
enable_irq_wake(info->vbus_irq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (info->id_gpiod)
|
||||
disable_irq(info->id_irq);
|
||||
if (info->vbus_gpiod)
|
||||
@@ -318,6 +327,14 @@ static int __maybe_unused usb_conn_resume(struct device *dev)
|
||||
{
|
||||
struct usb_conn_info *info = dev_get_drvdata(dev);
|
||||
|
||||
if (device_may_wakeup(dev)) {
|
||||
if (info->id_gpiod)
|
||||
disable_irq_wake(info->id_irq);
|
||||
if (info->vbus_gpiod)
|
||||
disable_irq_wake(info->vbus_irq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pinctrl_pm_select_default_state(dev);
|
||||
|
||||
if (info->id_gpiod)
|
||||
|
||||
@@ -122,8 +122,6 @@ struct ffs_ep {
|
||||
struct usb_endpoint_descriptor *descs[3];
|
||||
|
||||
u8 num;
|
||||
|
||||
int status; /* P: epfile->mutex */
|
||||
};
|
||||
|
||||
struct ffs_epfile {
|
||||
@@ -227,6 +225,9 @@ struct ffs_io_data {
|
||||
bool use_sg;
|
||||
|
||||
struct ffs_data *ffs;
|
||||
|
||||
int status;
|
||||
struct completion done;
|
||||
};
|
||||
|
||||
struct ffs_desc_helper {
|
||||
@@ -705,12 +706,15 @@ static const struct file_operations ffs_ep0_operations = {
|
||||
|
||||
static void ffs_epfile_io_complete(struct usb_ep *_ep, struct usb_request *req)
|
||||
{
|
||||
struct ffs_io_data *io_data = req->context;
|
||||
|
||||
ENTER();
|
||||
if (likely(req->context)) {
|
||||
struct ffs_ep *ep = _ep->driver_data;
|
||||
ep->status = req->status ? req->status : req->actual;
|
||||
complete(req->context);
|
||||
}
|
||||
if (req->status)
|
||||
io_data->status = req->status;
|
||||
else
|
||||
io_data->status = req->actual;
|
||||
|
||||
complete(&io_data->done);
|
||||
}
|
||||
|
||||
static ssize_t ffs_copy_to_iter(void *data, int data_len, struct iov_iter *iter)
|
||||
@@ -1048,7 +1052,6 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
|
||||
WARN(1, "%s: data_len == -EINVAL\n", __func__);
|
||||
ret = -EINVAL;
|
||||
} else if (!io_data->aio) {
|
||||
DECLARE_COMPLETION_ONSTACK(done);
|
||||
bool interrupted = false;
|
||||
|
||||
req = ep->req;
|
||||
@@ -1064,7 +1067,8 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
|
||||
|
||||
io_data->buf = data;
|
||||
|
||||
req->context = &done;
|
||||
init_completion(&io_data->done);
|
||||
req->context = io_data;
|
||||
req->complete = ffs_epfile_io_complete;
|
||||
|
||||
ret = usb_ep_queue(ep->ep, req, GFP_ATOMIC);
|
||||
@@ -1073,7 +1077,12 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
|
||||
|
||||
spin_unlock_irq(&epfile->ffs->eps_lock);
|
||||
|
||||
if (unlikely(wait_for_completion_interruptible(&done))) {
|
||||
if (unlikely(wait_for_completion_interruptible(&io_data->done))) {
|
||||
spin_lock_irq(&epfile->ffs->eps_lock);
|
||||
if (epfile->ep != ep) {
|
||||
ret = -ESHUTDOWN;
|
||||
goto error_lock;
|
||||
}
|
||||
/*
|
||||
* To avoid race condition with ffs_epfile_io_complete,
|
||||
* dequeue the request first then check
|
||||
@@ -1081,17 +1090,18 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
|
||||
* condition with req->complete callback.
|
||||
*/
|
||||
usb_ep_dequeue(ep->ep, req);
|
||||
wait_for_completion(&done);
|
||||
interrupted = ep->status < 0;
|
||||
spin_unlock_irq(&epfile->ffs->eps_lock);
|
||||
wait_for_completion(&io_data->done);
|
||||
interrupted = io_data->status < 0;
|
||||
}
|
||||
|
||||
if (interrupted)
|
||||
ret = -EINTR;
|
||||
else if (io_data->read && ep->status > 0)
|
||||
ret = __ffs_epfile_read_data(epfile, data, ep->status,
|
||||
else if (io_data->read && io_data->status > 0)
|
||||
ret = __ffs_epfile_read_data(epfile, data, io_data->status,
|
||||
&io_data->data);
|
||||
else
|
||||
ret = ep->status;
|
||||
ret = io_data->status;
|
||||
goto error_mutex;
|
||||
} else if (!(req = usb_ep_alloc_request(ep->ep, GFP_ATOMIC))) {
|
||||
ret = -ENOMEM;
|
||||
|
||||
@@ -1188,6 +1188,8 @@ static int do_read_toc(struct fsg_common *common, struct fsg_buffhd *bh)
|
||||
int msf = common->cmnd[1] & 0x02;
|
||||
int start_track = common->cmnd[6];
|
||||
u8 *buf = (u8 *)bh->buf;
|
||||
u8 format;
|
||||
int i, len;
|
||||
|
||||
if ((common->cmnd[1] & ~0x02) != 0 || /* Mask away MSF */
|
||||
start_track > 1) {
|
||||
@@ -1195,18 +1197,62 @@ static int do_read_toc(struct fsg_common *common, struct fsg_buffhd *bh)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
memset(buf, 0, 20);
|
||||
buf[1] = (20-2); /* TOC data length */
|
||||
buf[2] = 1; /* First track number */
|
||||
buf[3] = 1; /* Last track number */
|
||||
buf[5] = 0x16; /* Data track, copying allowed */
|
||||
buf[6] = 0x01; /* Only track is number 1 */
|
||||
store_cdrom_address(&buf[8], msf, 0);
|
||||
format = common->cmnd[2] & 0xf;
|
||||
/*
|
||||
* Check if CDB is old style SFF-8020i
|
||||
* i.e. format is in 2 MSBs of byte 9
|
||||
* Mac OS-X host sends us this.
|
||||
*/
|
||||
if (format == 0)
|
||||
format = (common->cmnd[9] >> 6) & 0x3;
|
||||
|
||||
buf[13] = 0x16; /* Lead-out track is data */
|
||||
buf[14] = 0xAA; /* Lead-out track number */
|
||||
store_cdrom_address(&buf[16], msf, curlun->num_sectors);
|
||||
return 20;
|
||||
switch (format) {
|
||||
case 0:
|
||||
/* Formatted TOC */
|
||||
len = 4 + 2*8; /* 4 byte header + 2 descriptors */
|
||||
memset(buf, 0, len);
|
||||
buf[1] = len - 2; /* TOC Length excludes length field */
|
||||
buf[2] = 1; /* First track number */
|
||||
buf[3] = 1; /* Last track number */
|
||||
buf[5] = 0x16; /* Data track, copying allowed */
|
||||
buf[6] = 0x01; /* Only track is number 1 */
|
||||
store_cdrom_address(&buf[8], msf, 0);
|
||||
|
||||
buf[13] = 0x16; /* Lead-out track is data */
|
||||
buf[14] = 0xAA; /* Lead-out track number */
|
||||
store_cdrom_address(&buf[16], msf, curlun->num_sectors);
|
||||
return len;
|
||||
|
||||
case 2:
|
||||
/* Raw TOC */
|
||||
len = 4 + 3*11; /* 4 byte header + 3 descriptors */
|
||||
memset(buf, 0, len); /* Header + A0, A1 & A2 descriptors */
|
||||
buf[1] = len - 2; /* TOC Length excludes length field */
|
||||
buf[2] = 1; /* First complete session */
|
||||
buf[3] = 1; /* Last complete session */
|
||||
|
||||
buf += 4;
|
||||
/* fill in A0, A1 and A2 points */
|
||||
for (i = 0; i < 3; i++) {
|
||||
buf[0] = 1; /* Session number */
|
||||
buf[1] = 0x16; /* Data track, copying allowed */
|
||||
/* 2 - Track number 0 -> TOC */
|
||||
buf[3] = 0xA0 + i; /* A0, A1, A2 point */
|
||||
/* 4, 5, 6 - Min, sec, frame is zero */
|
||||
buf[8] = 1; /* Pmin: last track number */
|
||||
buf += 11; /* go to next track descriptor */
|
||||
}
|
||||
buf -= 11; /* go back to A2 descriptor */
|
||||
|
||||
/* For A2, 7, 8, 9, 10 - zero, Pmin, Psec, Pframe of Lead out */
|
||||
store_cdrom_address(&buf[7], msf, curlun->num_sectors);
|
||||
return len;
|
||||
|
||||
default:
|
||||
/* Multi-session, PMA, ATIP, CD-TEXT not supported/required */
|
||||
curlun->sense_data = SS_INVALID_FIELD_IN_CDB;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static int do_mode_sense(struct fsg_common *common, struct fsg_buffhd *bh)
|
||||
@@ -1933,7 +1979,7 @@ static int do_scsi_command(struct fsg_common *common)
|
||||
common->data_size_from_cmnd =
|
||||
get_unaligned_be16(&common->cmnd[7]);
|
||||
reply = check_command(common, 10, DATA_DIR_TO_HOST,
|
||||
(7<<6) | (1<<1), 1,
|
||||
(0xf<<6) | (3<<1), 1,
|
||||
"READ TOC");
|
||||
if (reply == 0)
|
||||
reply = do_read_toc(common, bh);
|
||||
|
||||
@@ -43,7 +43,8 @@ static int uvc_queue_setup(struct vb2_queue *vq,
|
||||
{
|
||||
struct uvc_video_queue *queue = vb2_get_drv_priv(vq);
|
||||
struct uvc_video *video = container_of(queue, struct uvc_video, queue);
|
||||
struct usb_composite_dev *cdev = video->uvc->func.config->cdev;
|
||||
unsigned int req_size;
|
||||
unsigned int nreq;
|
||||
|
||||
if (*nbuffers > UVC_MAX_VIDEO_BUFFERS)
|
||||
*nbuffers = UVC_MAX_VIDEO_BUFFERS;
|
||||
@@ -52,10 +53,16 @@ static int uvc_queue_setup(struct vb2_queue *vq,
|
||||
|
||||
sizes[0] = video->imagesize;
|
||||
|
||||
if (cdev->gadget->speed < USB_SPEED_SUPER)
|
||||
video->uvc_num_requests = 4;
|
||||
else
|
||||
video->uvc_num_requests = 64;
|
||||
req_size = video->ep->maxpacket
|
||||
* max_t(unsigned int, video->ep->maxburst, 1)
|
||||
* (video->ep->mult);
|
||||
|
||||
/* We divide by two, to increase the chance to run
|
||||
* into fewer requests for smaller framesizes.
|
||||
*/
|
||||
nreq = DIV_ROUND_UP(DIV_ROUND_UP(sizes[0], 2), req_size);
|
||||
nreq = clamp(nreq, 4U, 64U);
|
||||
video->uvc_num_requests = nreq;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -302,6 +302,9 @@ static void uvcg_video_pump(struct work_struct *work)
|
||||
uvcg_queue_cancel(queue, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Endpoint now owns the request */
|
||||
req = NULL;
|
||||
}
|
||||
|
||||
if (!req)
|
||||
|
||||
@@ -141,7 +141,7 @@ void exfat_free_bitmap(struct exfat_sb_info *sbi)
|
||||
kfree(sbi->vol_amap);
|
||||
}
|
||||
|
||||
int exfat_set_bitmap(struct inode *inode, unsigned int clu)
|
||||
int exfat_set_bitmap(struct inode *inode, unsigned int clu, bool sync)
|
||||
{
|
||||
int i, b;
|
||||
unsigned int ent_idx;
|
||||
@@ -154,7 +154,7 @@ int exfat_set_bitmap(struct inode *inode, unsigned int clu)
|
||||
b = BITMAP_OFFSET_BIT_IN_SECTOR(sb, ent_idx);
|
||||
|
||||
set_bit_le(b, sbi->vol_amap[i]->b_data);
|
||||
exfat_update_bh(sbi->vol_amap[i], IS_DIRSYNC(inode));
|
||||
exfat_update_bh(sbi->vol_amap[i], sync);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -317,7 +317,7 @@ int exfat_alloc_new_dir(struct inode *inode, struct exfat_chain *clu)
|
||||
|
||||
exfat_chain_set(clu, EXFAT_EOF_CLUSTER, 0, ALLOC_NO_FAT_CHAIN);
|
||||
|
||||
ret = exfat_alloc_cluster(inode, 1, clu);
|
||||
ret = exfat_alloc_cluster(inode, 1, clu, IS_DIRSYNC(inode));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -388,7 +388,7 @@ int exfat_clear_volume_dirty(struct super_block *sb);
|
||||
#define exfat_get_next_cluster(sb, pclu) exfat_ent_get(sb, *(pclu), pclu)
|
||||
|
||||
int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
|
||||
struct exfat_chain *p_chain);
|
||||
struct exfat_chain *p_chain, bool sync_bmap);
|
||||
int exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain);
|
||||
int exfat_ent_get(struct super_block *sb, unsigned int loc,
|
||||
unsigned int *content);
|
||||
@@ -407,7 +407,7 @@ int exfat_count_num_clusters(struct super_block *sb,
|
||||
/* balloc.c */
|
||||
int exfat_load_bitmap(struct super_block *sb);
|
||||
void exfat_free_bitmap(struct exfat_sb_info *sbi);
|
||||
int exfat_set_bitmap(struct inode *inode, unsigned int clu);
|
||||
int exfat_set_bitmap(struct inode *inode, unsigned int clu, bool sync);
|
||||
void exfat_clear_bitmap(struct inode *inode, unsigned int clu);
|
||||
unsigned int exfat_find_free_bitmap(struct super_block *sb, unsigned int clu);
|
||||
int exfat_count_used_clusters(struct super_block *sb, unsigned int *ret_count);
|
||||
|
||||
@@ -277,7 +277,7 @@ release_bhs:
|
||||
}
|
||||
|
||||
int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
|
||||
struct exfat_chain *p_chain)
|
||||
struct exfat_chain *p_chain, bool sync_bmap)
|
||||
{
|
||||
int ret = -ENOSPC;
|
||||
unsigned int num_clusters = 0, total_cnt;
|
||||
@@ -339,7 +339,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
|
||||
}
|
||||
|
||||
/* update allocation bitmap */
|
||||
if (exfat_set_bitmap(inode, new_clu)) {
|
||||
if (exfat_set_bitmap(inode, new_clu, sync_bmap)) {
|
||||
ret = -EIO;
|
||||
goto free_cluster;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,8 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset,
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
ret = exfat_alloc_cluster(inode, num_to_be_allocated, &new_clu);
|
||||
ret = exfat_alloc_cluster(inode, num_to_be_allocated, &new_clu,
|
||||
inode_needs_sync(inode));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ static int exfat_find_empty_entry(struct inode *inode,
|
||||
exfat_chain_set(&clu, last_clu + 1, 0, p_dir->flags);
|
||||
|
||||
/* allocate a cluster */
|
||||
ret = exfat_alloc_cluster(inode, 1, &clu);
|
||||
ret = exfat_alloc_cluster(inode, 1, &clu, IS_DIRSYNC(inode));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user