Merge android11-5.4.58+ (33cc3e7) into msm-5.4

* refs/heads/tmp-33cc3e7:
  ANDROID: db845c: set BUILD_INITRAMFS=1
  ANDROID: GKI: Build CEC_{CORE,NOTIFIER,PIN} in
  ANDROID: GKI: Enable CEC support
  ANDROID: ABI: Update ABI snapshot after additions to struct io_pgtable_cfg
  ANDROID: iommu/io-pgtable: Allow IOMMU drivers to allocate/free page-table memory
  ANDROID: update ABI
  UPSTREAM: update to latest version of scripts/checkpatch.pl
  FROMLIST: ufs: change the way to complete fDeviceInit
  ANDROID: GKI: add built-in BCM Bluetooth driver
  Revert "Revert "genetlink: remove genl_bind""
  ANDROID: GKI: enable CONFIG_LEDS_TRIGGER_TIMER
  ANDROID: GKI: add abi_gki_aarch64_oplus
  ANDROID: GKI: fix up abi .xml file due to previous changes.
  ANDROID: GKI: add some padding to some driver core structures
  ANDROID: vendor_hooks: add waiting information for blocked tasks
  ANDROID: GKI: Update abi_gki_aarch64_exynos
  ANDROID: include/linux: add low power mode and fps to notifier
  BACKPORT: scsi: ufs: Fix and simplify setup_xfer_req variant operation
  ANDROID: GKI: enable USB UVC drivers
  ANDROID: GKI: enabled CONFIG_USB_CONFIGFS_NCM=y
  ANDROID: GKI: enable LEDS_CLASS_FLASH

Conflicts:
	drivers/iommu/io-pgtable-arm.c
	drivers/iommu/io-pgtable.c
	include/linux/io-pgtable.h
	scripts/checkpatch.pl

Change-Id: I6cbac7d913653388280a4c58f4f98e6f8b6b29f7
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
This commit is contained in:
Blagovest Kolenichev 2020-08-28 10:35:08 -07:00
commit 7546983cd7
28 changed files with 11723 additions and 10156 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -499,6 +499,7 @@
wiphy_unregister
# required by virt_wifi_sim.ko
ieee80211_get_channel_khz
kstrtoull
release_firmware
request_firmware

View file

@ -2,6 +2,7 @@
add_timer
add_timer_on
add_uevent_var
add_wait_queue
adjust_managed_page_count
alarm_cancel
alarm_init
@ -36,6 +37,7 @@
__bitmap_parse
bitmap_parselist
__bitmap_set
bitmap_to_arr32
__bitmap_weight
blkdev_get_by_dev
blkdev_get_by_path
@ -48,8 +50,13 @@
bpf_trace_run2
bpf_trace_run3
bpf_trace_run4
bpf_trace_run5
bpf_trace_run6
bpf_trace_run7
bpf_trace_run9
build_skb
bus_find_device
bus_for_each_dev
bus_register
bus_register_notifier
bus_set_iommu
@ -60,6 +67,7 @@
cancel_delayed_work_sync
cancel_work_sync
cdev_add
cdev_alloc
cdev_del
cdev_device_add
cdev_device_del
@ -103,6 +111,8 @@
clk_set_parent
clk_set_rate
clk_unprepare
clockevents_config_and_register
__clocksource_register_scale
__close_fd
cma_alloc
cma_get_name
@ -113,11 +123,13 @@
complete_and_exit
completion_done
config_ep_by_speed
config_group_init_type_name
console_lock
console_trylock
console_unlock
__const_udelay
consume_skb
contig_page_data
__cpu_active_mask
cpu_all_bits
cpu_bit_bitmap
@ -131,7 +143,9 @@
cpufreq_frequency_table_verify
cpufreq_generic_attr
cpufreq_quick_get
cpufreq_quick_get_max
cpufreq_register_driver
cpufreq_register_notifier
cpufreq_table_index_unsorted
__cpuhp_setup_state
__cpuhp_setup_state_cpuslocked
@ -153,9 +167,11 @@
crypto_destroy_tfm
crypto_shash_final
crypto_shash_update
_ctype
dapm_pinctrl_event
dapm_regulator_event
default_llseek
default_wake_function
delayed_work_timer_fn
del_timer
del_timer_sync
@ -172,6 +188,7 @@
devfreq_unregister_opp_notifier
devfreq_update_status
dev_fwnode
dev_get_by_name
dev_get_regmap
dev_get_stats
device_add
@ -196,25 +213,35 @@
device_property_read_u8_array
device_register
device_remove_file
device_set_wakeup_enable
device_show_bool
device_show_int
device_store_bool
device_store_int
device_unregister
device_wakeup_enable
_dev_info
__dev_kfree_skb_any
devm_add_action
devm_backlight_device_register
devm_clk_get
devm_clk_get_optional
devm_clk_put
devm_extcon_dev_allocate
devm_extcon_dev_register
devm_extcon_dev_unregister
devm_extcon_register_notifier
devm_free_irq
devm_gpiochip_add_data
devm_gpiod_get_optional
devm_gpio_request_one
devm_iio_device_alloc
devm_input_allocate_device
devm_ioremap
devm_ioremap_nocache
devm_ioremap_resource
devm_iounmap
__devm_irq_alloc_descs
devm_kasprintf
devm_kfree
devm_kmalloc
@ -223,7 +250,9 @@
__devm_of_phy_provider_register
devm_phy_create
devm_phy_get
devm_phy_put
devm_pinctrl_get
devm_pinctrl_put
devm_pinctrl_register
devm_platform_ioremap_resource
__devm_regmap_init_i2c
@ -231,6 +260,7 @@
devm_regulator_bulk_get
devm_regulator_get
devm_regulator_register
__devm_release_region
__devm_request_region
devm_request_threaded_irq
devm_reset_control_array_get
@ -245,15 +275,19 @@
dev_pm_opp_add
dev_pm_opp_disable
dev_pm_opp_find_freq_ceil
dev_pm_opp_find_freq_exact
dev_pm_opp_find_freq_floor
dev_pm_opp_get_freq
dev_pm_opp_get_opp_count
dev_pm_opp_get_voltage
dev_pm_opp_of_add_table
dev_pm_opp_of_register_em
dev_pm_opp_of_remove_table
dev_pm_opp_put
dev_pm_opp_put_regulators
dev_pm_opp_set_regulators
dev_printk
dev_queue_xmit
devres_add
devres_alloc_node
devres_free
@ -262,6 +296,7 @@
_dev_warn
disable_irq
disable_irq_nosync
disable_percpu_irq
dma_alloc_attrs
dma_async_device_register
dma_async_device_unregister
@ -306,6 +341,10 @@
dma_get_slave_channel
dmam_alloc_attrs
dma_mmap_attrs
dma_pool_alloc
dma_pool_create
dma_pool_destroy
dma_pool_free
dma_release_channel
dma_request_chan
dma_request_slave_channel
@ -314,6 +353,7 @@
do_SAK
down
downgrade_write
down_interruptible
down_read
down_trylock
down_write
@ -328,6 +368,7 @@
dw_pcie_setup_rc
dw_pcie_write
enable_irq
enable_percpu_irq
end_buffer_read_sync
eth_mac_addr
ethtool_op_get_link
@ -336,14 +377,17 @@
event_triggers_call
extcon_get_edev_by_phandle
extcon_get_state
extcon_set_state_sync
fb_mode_option
fd_install
fget
find_get_pid
find_next_bit
find_next_zero_bit
find_vma
finish_wait
firmware_request_nowarn
flush_dcache_page
flush_delayed_work
flush_work
flush_workqueue
@ -355,25 +399,36 @@
free_netdev
__free_pages
free_pages
free_percpu
free_percpu_irq
freezing_slow_path
freq_qos_add_request
freq_qos_remove_request
freq_qos_update_request
fwnode_property_present
fwnode_property_read_u16_array
generic_file_llseek
generic_handle_irq
gen_pool_add_owner
gen_pool_alloc_algo_owner
gen_pool_avail
gen_pool_create
gen_pool_destroy
gen_pool_first_fit_align
gen_pool_free_owner
gen_pool_size
__getblk_gfp
get_cpu_device
get_cpu_idle_time
get_device
__get_free_pages
get_pid_task
get_random_bytes
get_random_u32
__get_task_comm
get_task_exe_file
get_task_mm
get_thermal_instance
get_unused_fd_flags
get_user_pages
get_user_pages_fast
@ -406,6 +461,7 @@
handle_level_irq
handle_nested_irq
handle_sysrq
hex_dump_to_buffer
hex_to_bin
hrtimer_active
hrtimer_cancel
@ -439,6 +495,8 @@
ida_alloc_range
ida_destroy
ida_free
idr_alloc
idr_remove
ignore_console_lock_warning
iio_channel_get
iio_channel_release
@ -448,6 +506,7 @@
in4_pton
in6_pton
init_dummy_netdev
init_net
__init_rwsem
init_task
init_timer_key
@ -463,6 +522,7 @@
input_set_abs_params
input_set_capability
input_unregister_device
int_sqrt
iomem_resource
iommu_attach_group
iommu_device_link
@ -496,9 +556,13 @@
iommu_unregister_device_fault_handler
ion_alloc
ion_buffer_prep_noncached
ion_buffer_zero
__ion_device_add_heap
ion_device_remove_heap
ion_free
ion_heap_map_kernel
ion_heap_map_user
ion_heap_unmap_kernel
ion_query_heaps_kernel
__ioread32_copy
__ioremap
@ -507,7 +571,10 @@
__irq_alloc_descs
irq_create_mapping
__irq_domain_add
irq_domain_get_irq_data
irq_domain_remove
irq_domain_set_info
irq_domain_xlate_onetwocell
irq_domain_xlate_twocell
irq_find_mapping
irq_get_irq_data
@ -515,11 +582,14 @@
irq_of_parse_and_map
irq_set_affinity_hint
irq_set_chained_handler_and_data
irq_set_chip
irq_set_chip_and_handler_name
irq_set_chip_data
__irq_set_handler
irq_set_handler_data
irq_set_irq_wake
irq_to_desc
irq_work_queue
is_console_locked
jiffies
jiffies_64
@ -538,6 +608,7 @@
kfree
kfree_call_rcu
kfree_const
kfree_skb
kimage_vaddr
kimage_voffset
__kmalloc
@ -549,7 +620,9 @@
kmem_cache_destroy
kmem_cache_free
kmemdup
kobject_add
kobject_create_and_add
kobject_init
kobject_init_and_add
kobject_put
kobject_uevent
@ -559,17 +632,26 @@
kstrdup
kstrndup
kstrtobool
kstrtobool_from_user
kstrtoint
kstrtoint_from_user
kstrtoll
kstrtou16
kstrtou8
kstrtouint
kstrtoull
kstrtoull_from_user
kthread_bind
kthread_cancel_delayed_work_sync
kthread_cancel_work_sync
kthread_create_on_node
kthread_create_worker
kthread_delayed_work_timer_fn
kthread_destroy_worker
kthread_flush_work
kthread_flush_worker
__kthread_init_worker
kthread_mod_delayed_work
kthread_queue_work
kthread_should_stop
kthread_stop
@ -578,6 +660,7 @@
ktime_get_mono_fast_ns
ktime_get_raw_ts64
ktime_get_real_ts64
ktime_get_ts64
ktime_get_with_offset
kvasprintf
kvfree
@ -585,6 +668,8 @@
kzfree
__list_add_valid
__list_del_entry_valid
list_sort
llist_add_batch
__lock_buffer
loops_per_jiffy
match_string
@ -602,6 +687,7 @@
__memcpy_fromio
__memcpy_toio
memdup_user
memmove
memset
__memset_io
mfd_add_devices
@ -626,6 +712,7 @@
mmput
mm_trace_rss_stat
mod_delayed_work_on
mod_node_page_state
mod_timer
__module_get
module_layout
@ -633,12 +720,14 @@
__msecs_to_jiffies
msleep
__mutex_init
mutex_is_locked
mutex_lock
mutex_lock_interruptible
mutex_trylock
mutex_unlock
__napi_alloc_skb
napi_complete_done
napi_disable
napi_gro_flush
napi_gro_receive
__napi_schedule
@ -656,14 +745,17 @@
nr_irqs
nsecs_to_jiffies
ns_to_timespec
ns_to_timespec64
ns_to_timeval
__num_online_cpus
of_address_to_resource
of_alias_get_highest_id
of_alias_get_id
of_clk_add_hw_provider
of_clk_add_provider
of_clk_del_provider
of_clk_get
of_clk_get_by_name
of_clk_get_parent_count
of_clk_hw_onecell_get
of_clk_src_onecell_get
@ -680,19 +772,26 @@
of_find_node_by_type
of_find_node_opts_by_path
of_find_property
of_fwnode_ops
of_genpd_add_provider_simple
of_get_child_by_name
of_get_cpu_node
of_get_dma_window
of_get_named_gpio_flags
of_get_next_available_child
of_get_next_child
of_get_property
of_get_regulator_init_data
of_get_videomode
of_iomap
of_irq_get_byname
of_irq_parse_one
of_machine_is_compatible
of_match_device
of_match_node
of_node_name_eq
of_parse_phandle
of_parse_phandle_with_fixed_args
of_phandle_iterator_init
of_phandle_iterator_next
of_platform_depopulate
@ -712,29 +811,44 @@
of_reserved_mem_lookup
of_reset_control_array_get
of_root
of_thermal_get_ntrips
of_usb_get_phy_mode
of_usb_host_tpl_support
oops_in_progress
panic
panic_notifier_list
param_array_ops
param_ops_bool
param_ops_byte
param_ops_charp
param_ops_int
param_ops_long
param_ops_uint
param_ops_ullong
param_ops_ulong
param_set_uint
pci_alloc_irq_vectors_affinity
pci_bus_type
pci_d3cold_disable
pci_find_bus
pci_free_irq_vectors
pci_get_device
pci_irq_vector
pci_load_saved_state
pcim_enable_device
pci_read_config_byte
pci_read_config_dword
__pci_register_driver
pci_rescan_bus
pci_restore_state
pci_save_state
pci_set_master
pci_set_mwi
pci_set_power_state
pci_store_saved_state
pci_unregister_driver
pci_write_config_dword
PDE_DATA
__per_cpu_offset
perf_event_create_kernel_counter
perf_event_disable
@ -745,6 +859,7 @@
perf_trace_run_bpf_submit
pfn_valid
phy_calibrate
phy_configure
phy_exit
phy_init
phy_power_off
@ -773,6 +888,7 @@
platform_device_register
platform_device_register_full
platform_device_unregister
__platform_driver_probe
__platform_driver_register
platform_driver_unregister
platform_get_irq
@ -781,8 +897,10 @@
platform_get_resource
platform_get_resource_byname
__platform_register_drivers
pm_genpd_add_subdomain
pm_genpd_init
pm_power_off
pm_qos_add_request
pm_qos_remove_request
pm_qos_update_request
__pm_relax
@ -819,7 +937,13 @@
prepare_to_wait_event
print_hex_dump
printk
proc_create
proc_create_data
proc_create_seq_private
proc_mkdir
proc_remove
proc_set_size
proc_symlink
__put_cred
put_device
__put_page
@ -833,6 +957,11 @@
pwm_set_chip_data
queue_delayed_work_on
queue_work_on
radix_tree_delete
radix_tree_insert
radix_tree_lookup
radix_tree_maybe_preload
___ratelimit
__raw_notifier_call_chain
raw_notifier_call_chain
raw_notifier_chain_register
@ -867,6 +996,7 @@
refcount_inc_checked
refcount_inc_not_zero_checked
__refrigerator
regcache_cache_bypass
regcache_cache_only
regcache_drop_region
regcache_mark_dirty
@ -876,6 +1006,7 @@
register_console
register_die_notifier
register_netdev
register_oom_notifier
register_pm_notifier
register_reboot_notifier
register_restart_handler
@ -898,20 +1029,25 @@
regulator_force_disable
regulator_get
regulator_get_optional
regulator_get_voltage
regulator_is_enabled
regulator_list_voltage_linear
regulator_map_voltage_linear
regulator_put
regulator_set_mode
regulator_set_voltage
release_firmware
release_pages
__release_region
remap_pfn_range
remap_vmalloc_range
remove_proc_entry
remove_wait_queue
request_firmware
request_firmware_direct
request_firmware_nowait
__request_module
__request_percpu_irq
__request_region
request_threaded_irq
reset_control_assert
@ -935,6 +1071,7 @@
sched_show_task
schedule
schedule_timeout
schedule_timeout_uninterruptible
scnprintf
scsi_block_when_processing_errors
scsi_device_get
@ -945,10 +1082,12 @@
sdio_signal_irq
seq_lseek
seq_printf
seq_puts
seq_read
set_cpus_allowed_ptr
set_normalized_timespec64
set_page_dirty_lock
setup_irq
sg_alloc_table
sg_alloc_table_from_pages
sg_copy_to_buffer
@ -960,10 +1099,15 @@
sg_miter_stop
sg_nents_for_len
sg_next
__sg_page_iter_next
__sg_page_iter_start
sg_pcopy_from_buffer
sg_pcopy_to_buffer
simple_open
simple_read_from_buffer
simple_strtol
simple_strtoul
simple_write_to_buffer
single_open
single_release
skb_copy_expand
@ -978,9 +1122,13 @@
skb_trim
smpboot_register_percpu_thread
smp_call_function
smp_call_function_many
smp_call_function_single
smp_call_on_cpu
snd_compr_stop_error
snd_ctl_add
snd_ctl_boolean_mono_info
snd_ctl_new1
snd_ctl_notify
snd_device_free
snd_dma_alloc_pages
@ -989,6 +1137,7 @@
snd_hwdep_new
snd_pcm_format_physical_width
snd_pcm_format_width
snd_pcm_hw_constraint_integer
snd_pcm_hw_constraint_list
snd_pcm_lib_free_pages
snd_pcm_lib_ioctl
@ -1024,6 +1173,7 @@
snd_soc_dapm_get_volsw
snd_soc_dapm_ignore_suspend
snd_soc_dapm_info_pin_switch
snd_soc_dapm_kcontrol_dapm
snd_soc_dapm_new_control
snd_soc_dapm_new_controls
snd_soc_dapm_put_enum_double
@ -1062,10 +1212,13 @@
snd_soc_tplg_widget_bind_event
snd_soc_unregister_card
snd_soc_unregister_component
snd_vendor_set_ops
snprintf
soc_device_register
softnet_data
sort
__spi_alloc_controller
spi_bus_type
spi_controller_resume
spi_controller_suspend
spi_finalize_current_message
@ -1087,6 +1240,7 @@
static_key_initialized
static_key_slow_dec
static_key_slow_inc
strcasecmp
strcat
strchr
strchrnul
@ -1094,14 +1248,17 @@
strcpy
strcspn
stream_open
strim
strlcat
strlcpy
strlen
strncasecmp
strncat
strncmp
strncpy
strnlen
strpbrk
strrchr
strsep
strstr
submit_bh
@ -1115,12 +1272,15 @@
synchronize_rcu
syscon_regmap_lookup_by_phandle
sysfs_add_file_to_group
sysfs_create_bin_file
sysfs_create_file_ns
sysfs_create_files
sysfs_create_group
sysfs_create_groups
sysfs_create_link
__sysfs_match_string
sysfs_notify
sysfs_remove_bin_file
sysfs_remove_file_ns
sysfs_remove_group
sysfs_remove_link
@ -1135,6 +1295,13 @@
tasklet_init
tasklet_kill
__tasklet_schedule
thermal_cooling_device_unregister
thermal_of_cooling_device_register
thermal_zone_device_update
thermal_zone_get_temp
thermal_zone_get_zone_by_name
thermal_zone_of_sensor_register
thermal_zone_of_sensor_unregister
time64_to_tm
_totalram_pages
touch_softlockup_watchdog
@ -1145,6 +1312,15 @@
trace_event_raw_init
trace_event_reg
trace_handle_return
trace_output_call
__tracepoint_device_pm_callback_end
__tracepoint_device_pm_callback_start
__tracepoint_pelt_cfs_tp
tracepoint_probe_register
__tracepoint_suspend_resume
trace_print_array_seq
trace_print_flags_seq
trace_print_symbols_seq
__trace_puts
trace_raw_output_prep
trace_seq_printf
@ -1205,10 +1381,31 @@
up_write
usb_add_function
usb_add_gadget_udc
usb_add_hcd
usb_alloc_urb
usb_amd_dev_put
usb_amd_pt_check_port
usb_amd_quirk_pll_check
usb_amd_quirk_pll_disable
usb_amd_quirk_pll_enable
usb_anchor_urb
usb_asmedia_modifyflowcontrol
usb_assign_descriptors
usb_autopm_get_interface
usb_autopm_put_interface
usb_choose_configuration
usb_control_msg
usb_copy_descriptors
__usb_create_hcd
usb_create_shared_hcd
usb_decode_ctrl
usb_del_gadget_udc
usb_deregister
usb_deregister_dev
usb_disabled
usb_disable_xhci_ports
usb_enable_autosuspend
usb_enable_intel_xhci_ports
usb_ep_alloc_request
usb_ep_autoconfig
usb_ep_dequeue
@ -1218,7 +1415,10 @@
usb_ep_queue
usb_ep_set_halt
usb_ep_set_maxpacket_limit
usb_find_common_endpoints
usb_find_interface
usb_free_all_descriptors
usb_free_urb
usb_function_register
usb_function_unregister
usb_gadget_giveback_request
@ -1229,17 +1429,48 @@
usb_gadget_vbus_connect
usb_gadget_vbus_disconnect
usb_get_dr_mode
usb_get_intf
usb_get_maximum_speed
usb_gstrings_attach
usb_hcd_check_unlink_urb
usb_hcd_end_port_resume
usb_hcd_giveback_urb
usb_hc_died
usb_hcd_irq
usb_hcd_is_primary_hcd
usb_hcd_link_urb_to_ep
usb_hcd_map_urb_for_dma
usb_hcd_pci_pm_ops
usb_hcd_pci_probe
usb_hcd_pci_remove
usb_hcd_pci_shutdown
usb_hcd_platform_shutdown
usb_hcd_poll_rh_status
usb_hcd_resume_root_hub
usb_hcd_start_port_resume
usb_hcd_unlink_urb_from_ep
usb_hub_clear_tt_buffer
usb_hub_find_child
usb_interface_id
usb_kill_anchored_urbs
usb_os_desc_prepare_interf_dir
usb_otg_state_string
usb_poison_anchored_urbs
usb_put_function_instance
usb_put_hcd
usb_put_intf
usb_register_dev
usb_register_driver
usb_register_notify
usb_remove_hcd
usb_root_hub_lost_power
usb_set_interface
usb_speed_string
usb_string_id
usb_submit_urb
usb_unanchor_urb
usb_unregister_notify
usb_wakeup_notification
__usecs_to_jiffies
usleep_range
v4l2_ctrl_handler_free
@ -1252,6 +1483,7 @@
v4l2_device_register
v4l2_device_register_subdev
v4l2_device_register_subdev_nodes
v4l2_device_set_name
v4l2_device_unregister
v4l2_device_unregister_subdev
v4l2_event_pending
@ -1259,12 +1491,18 @@
v4l2_fh_del
v4l2_fh_exit
v4l2_fh_init
v4l2_i2c_subdev_init
v4l2_match_dv_timings
v4l2_print_dv_timings
v4l2_subdev_call_wrappers
v4l2_subdev_init
v4l_bound_align_image
vabits_actual
vb2_buffer_done
vb2_common_vm_ops
vb2_create_bufs
vb2_create_framevec
vb2_destroy_framevec
vb2_dqbuf
vb2_expbuf
vb2_mmap
@ -1284,6 +1522,8 @@
vb2_streamon
vb2_wait_for_all_buffers
vfree
vfs_fsync
vfs_llseek
video_devdata
video_device_alloc
video_device_release
@ -1301,7 +1541,9 @@
vm_map_pages
vm_map_ram
vm_unmap_ram
vscnprintf
vsnprintf
vsprintf
vunmap
vzalloc
wait_for_completion

View file

@ -0,0 +1,205 @@
[abi_whitelist]
# commonly used symbols
alloc_workqueue
__arch_copy_from_user
__arch_copy_to_user
arm64_const_caps_ready
__cfi_slowpath
__check_object_size
__class_create
class_destroy
cpu_hwcap_keys
cpu_hwcaps
delayed_work_timer_fn
destroy_workqueue
device_create
device_destroy
devm_kfree
devm_kmalloc
disable_irq_nosync
enable_irq
finish_wait
gpiod_direction_output_raw
gpiod_get_raw_value
gpio_to_desc
init_timer_key
init_wait_entry
kfree
__kmalloc
kmalloc_caches
kmem_cache_alloc_trace
kobject_create_and_add
ktime_get
__list_add_valid
memcpy
memset
module_layout
msleep
__mutex_init
mutex_lock
mutex_unlock
of_find_property
of_property_read_variable_u32_array
PDE_DATA
prepare_to_wait_event
printk
proc_create
proc_create_data
proc_mkdir
__put_task_struct
queue_delayed_work_on
regulator_set_voltage
remove_proc_entry
schedule_timeout
seq_printf
seq_read
simple_open
simple_read_from_buffer
single_open
single_release
snprintf
sprintf
sscanf
__stack_chk_fail
__stack_chk_guard
strcmp
strcpy
strlcat
strlen
strncmp
strncpy
strstr
sysfs_create_group
sysfs_remove_group
usleep_range
# required by oplus_project.ko
__ioremap
iounmap
kimage_vaddr
of_find_node_by_name
# required by sec_drivers_s6sy791.ko
__const_udelay
i2c_del_driver
i2c_register_driver
strlcpy
vfree
vzalloc
# required by oplus_lcd.ko
alloc_chrdev_region
blocking_notifier_call_chain
blocking_notifier_chain_register
blocking_notifier_chain_unregister
cdev_add
cdev_del
cdev_init
drm_atomic_commit
drm_atomic_get_crtc_state
drm_atomic_state_alloc
__drm_atomic_state_free
drm_crtc_vblank_count
drm_crtc_vblank_get
drm_crtc_vblank_put
drm_crtc_vblank_waitqueue
drm_crtc_wait_one_vblank
drm_dev_dbg
drm_dev_printk
drm_modeset_lock_all
drm_modeset_unlock_all
kernel_kobj
kmemdup
kobject_put
kthread_create_on_node
kthread_flush_worker
__kthread_init_worker
kthread_queue_work
kthread_stop
kthread_worker_fn
mipi_dsi_dcs_set_display_brightness
mipi_dsi_dcs_write
mod_delayed_work_on
module_put
__msecs_to_jiffies
refcount_dec_and_test_checked
regulator_get_voltage
scnprintf
sysfs_create_link
sysfs_remove_link
try_module_get
unregister_chrdev_region
__usecs_to_jiffies
wake_up_process
# required by oplus_tp_project.ko
param_ops_string
# required by oplus_sensor.ko
of_get_next_child
of_property_count_elems_of_size
__platform_driver_register
# required by oplus_touch_comon.ko
cancel_delayed_work
cancel_delayed_work_sync
cancel_work_sync
complete
_dev_err
devm_free_irq
devm_gpio_request
devm_input_allocate_device
devm_pinctrl_get
devm_request_threaded_irq
disable_irq
drm_panel_notifier_register
dump_stack
flush_workqueue
free_irq
gpiod_to_irq
hrtimer_active
hrtimer_cancel
hrtimer_init
hrtimer_start_range_ns
i2c_transfer
__init_waitqueue_head
input_event
input_free_device
input_mt_init_slots
input_mt_report_slot_state
input_register_device
input_set_abs_params
int_sqrt
irq_set_irq_wake
irq_to_desc
__kfifo_alloc
kstrtoint
ktime_get_real_ts64
__list_del_entry_valid
of_count_phandle_with_args
of_drm_find_panel
of_get_named_gpio_flags
of_parse_phandle
of_property_read_string
of_property_read_variable_u8_array
pinctrl_lookup_state
pm_qos_add_request
pm_qos_update_request
queue_work_on
_raw_spin_lock_irqsave
_raw_spin_unlock_irqrestore
regulator_count_voltages
regulator_disable
regulator_enable
regulator_get
regulator_put
regulator_set_load
release_firmware
remove_proc_subtree
request_firmware
rtc_time64_to_tm
spi_sync
strcat
system_wq
wait_for_completion_killable_timeout
__wake_up

View file

@ -2682,6 +2682,7 @@
vb2_reqbufs
vb2_streamoff
vb2_streamon
vb2_vmalloc_memops
vchan_dma_desc_free_list
vchan_init
vchan_tx_desc_free

View file

@ -216,6 +216,7 @@ CONFIG_BT_HIDP=y
CONFIG_BT_HCIBTSDIO=y
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIUART_BCM=y
CONFIG_BT_HCIUART_QCA=y
CONFIG_CFG80211=y
# CONFIG_CFG80211_DEFAULT_PS is not set
@ -343,9 +344,14 @@ CONFIG_MFD_SYSCON=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_CEC_SUPPORT=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_GSPCA=y
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_CEC_PLATFORM_DRIVERS=y
# CONFIG_VGA_ARB is not set
CONFIG_DRM=y
# CONFIG_DRM_FBDEV_EMULATION is not set
@ -391,6 +397,7 @@ CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_UEVENT=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_FS=y
@ -406,6 +413,8 @@ CONFIG_MMC=y
CONFIG_MMC_CRYPTO=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_LEDS_CLASS_FLASH=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_EDAC=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_PL030=y

View file

@ -303,7 +303,12 @@ CONFIG_MFD_SYSCON=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_CEC_SUPPORT=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_GSPCA=y
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_CEC_PLATFORM_DRIVERS=y
CONFIG_DRM=y
# CONFIG_DRM_FBDEV_EMULATION is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
@ -347,6 +352,7 @@ CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_UEVENT=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_FS=y
@ -360,6 +366,8 @@ CONFIG_MMC=y
CONFIG_MMC_CRYPTO=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_LEDS_CLASS_FLASH=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_RTC_CLASS=y
CONFIG_DMADEVICES=y
CONFIG_UIO=y

View file

@ -1,6 +1,7 @@
. ${ROOT_DIR}/common/build.config.common
. ${ROOT_DIR}/common/build.config.aarch64
BUILD_INITRAMFS=1
DEFCONFIG=db845c_gki_defconfig
PRE_DEFCONFIG_CMDS="KCONFIG_CONFIG=${ROOT_DIR}/common/arch/arm64/configs/${DEFCONFIG} ${ROOT_DIR}/common/scripts/kconfig/merge_config.sh -m -r ${ROOT_DIR}/common/arch/arm64/configs/gki_defconfig ${ROOT_DIR}/common/arch/arm64/configs/db845c_gki.fragment"
POST_DEFCONFIG_CMDS="rm ${ROOT_DIR}/common/arch/arm64/configs/${DEFCONFIG}"
@ -8,4 +9,6 @@ POST_DEFCONFIG_CMDS="rm ${ROOT_DIR}/common/arch/arm64/configs/${DEFCONFIG}"
FILES="
arch/arm64/boot/Image.gz
arch/arm64/boot/dts/qcom/sdm845-db845c.dtb
vmlinux
System.map
"

View file

@ -10,6 +10,7 @@ android/abi_gki_aarch64_db845c
android/abi_gki_aarch64_exynos
android/abi_gki_aarch64_goldfish
android/abi_gki_aarch64_hikey960
android/abi_gki_aarch64_oplus
android/abi_gki_aarch64_qcom
android/abi_gki_aarch64_sunxi
android/abi_gki_aarch64_unisoc

View file

@ -8,9 +8,17 @@
#define CREATE_TRACE_POINTS
#include <trace/hooks/vendor_hooks.h>
#include <trace/hooks/dtask.h>
/*
* Export tracepoints that act as a bare tracehook (ie: have no trace event
* associated with them) to allow external modules to probe them.
*/
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_wait_start);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_wait_finish);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_read_wait_start);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_read_wait_finish);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_wait_start);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_wait_finish);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_show_task);

View file

@ -1059,11 +1059,11 @@ static void arm_smmu_secure_pool_destroy(struct arm_smmu_domain *smmu_domain)
}
}
static void *arm_smmu_alloc_pages_exact(void *cookie,
size_t size, gfp_t gfp_mask)
static void *arm_smmu_alloc_pages_exact(void *cookie, int order, gfp_t gfp_mask)
{
int ret;
void *page;
size_t size = (1UL << order) * PAGE_SIZE;
struct arm_smmu_domain *smmu_domain = cookie;
if (!arm_smmu_has_secure_vmid(smmu_domain)) {
@ -1096,9 +1096,10 @@ static void *arm_smmu_alloc_pages_exact(void *cookie,
return page;
}
static void arm_smmu_free_pages_exact(void *cookie, void *virt, size_t size)
static void arm_smmu_free_pages_exact(void *cookie, void *virt, int order)
{
struct arm_smmu_domain *smmu_domain = cookie;
size_t size = (1UL << order) * PAGE_SIZE;
if (!arm_smmu_has_secure_vmid(smmu_domain)) {
free_pages_exact(virt, size);
@ -1109,10 +1110,13 @@ static void arm_smmu_free_pages_exact(void *cookie, void *virt, size_t size)
arm_smmu_unprepare_pgtable(smmu_domain, virt, size);
}
static const struct iommu_pgtable_ops arm_smmu_pgtable_ops = {
.alloc_pgtable = arm_smmu_alloc_pages_exact,
.free_pgtable = arm_smmu_free_pages_exact,
};
#define ARM_SMMU_INIT_MSM_TLB_OPS(_tlb_flush_all) \
{\
.alloc_pages_exact = arm_smmu_alloc_pages_exact, \
.free_pages_exact = arm_smmu_free_pages_exact, \
.tlb_ops = { \
.tlb_flush_all = _tlb_flush_all, \
.tlb_flush_walk = arm_smmu_tlb_inv_walk, \
@ -2173,6 +2177,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
.oas = oas,
.coherent_walk = is_iommu_pt_coherent(smmu_domain),
.tlb = &smmu_domain->flush_ops->tlb.tlb_ops,
.iommu_pgtable_ops = &arm_smmu_pgtable_ops,
.iommu_dev = smmu->dev,
};

View file

@ -310,10 +310,12 @@ static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp,
struct io_pgtable_cfg *cfg, void *cookie)
{
struct device *dev = cfg->iommu_dev;
int order = get_order(size);
dma_addr_t dma;
void *pages = io_pgtable_alloc_pages_exact(cfg, cookie, size,
gfp | __GFP_ZERO);
void *pages;
VM_BUG_ON((gfp & __GFP_HIGHMEM));
pages = io_pgtable_alloc_pages(cfg, cookie, order, gfp | __GFP_ZERO);
if (!pages)
return NULL;
@ -336,7 +338,7 @@ out_unmap:
dev_err(dev, "Cannot accommodate DMA translation for IOMMU page tables\n");
dma_unmap_single(dev, dma, size, DMA_TO_DEVICE);
out_free:
io_pgtable_free_pages_exact(cfg, cookie, pages, size);
io_pgtable_free_pages(cfg, cookie, pages, order);
return NULL;
}
@ -346,7 +348,7 @@ static void __arm_lpae_free_pages(void *pages, size_t size,
if (!cfg->coherent_walk)
dma_unmap_single(cfg->iommu_dev, __arm_lpae_dma_addr(pages),
size, DMA_TO_DEVICE);
io_pgtable_free_pages_exact(cfg, cookie, pages, size);
io_pgtable_free_pages(cfg, cookie, pages, get_order(size));
}
static void __arm_lpae_sync_pte(arm_lpae_iopte *ptep,
@ -1219,8 +1221,8 @@ arm_64_lpae_alloc_pgtable_s1(struct io_pgtable_cfg *cfg, void *cookie)
cfg->arm_lpae_s1_cfg.mair[1] = reg;
/* Looking good; allocate a pgd */
data->pgd = __arm_lpae_alloc_pages(data->pgd_size, GFP_KERNEL,
cfg, cookie);
data->pgd = __arm_lpae_alloc_pages(data->pgd_size, GFP_KERNEL, cfg,
cookie);
if (!data->pgd)
goto out_free_data;
@ -1322,8 +1324,8 @@ arm_64_lpae_alloc_pgtable_s2(struct io_pgtable_cfg *cfg, void *cookie)
cfg->arm_lpae_s2_cfg.vtcr = reg;
/* Allocate pgd pages */
data->pgd = __arm_lpae_alloc_pages(data->pgd_size, GFP_KERNEL,
cfg, cookie);
data->pgd = __arm_lpae_alloc_pages(data->pgd_size, GFP_KERNEL, cfg,
cookie);
if (!data->pgd)
goto out_free_data;
@ -1411,8 +1413,8 @@ arm_mali_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
(ARM_MALI_LPAE_MEMATTR_IMP_DEF
<< ARM_LPAE_MAIR_ATTR_SHIFT(ARM_LPAE_MAIR_ATTR_IDX_DEV));
data->pgd = __arm_lpae_alloc_pages(data->pgd_size, GFP_KERNEL,
cfg, cookie);
data->pgd = __arm_lpae_alloc_pages(data->pgd_size, GFP_KERNEL, cfg,
cookie);
if (!data->pgd)
goto out_free_data;

View file

@ -143,3 +143,36 @@ void io_pgtable_free_pages_exact(struct io_pgtable_cfg *cfg, void *cookie,
mod_pages_allocated(-(1 << get_order(size)));
}
void *io_pgtable_alloc_pages(struct io_pgtable_cfg *cfg, void *cookie,
int order, gfp_t gfp_mask)
{
struct device *dev;
struct page *p;
if (!cfg)
return NULL;
if (cfg->iommu_pgtable_ops && cfg->iommu_pgtable_ops->alloc_pgtable)
return cfg->iommu_pgtable_ops->alloc_pgtable(cookie, order,
gfp_mask);
dev = cfg->iommu_dev;
p = alloc_pages_node(dev ? dev_to_node(dev) : NUMA_NO_NODE,
gfp_mask, order);
if (!p)
return NULL;
return page_address(p);
}
void io_pgtable_free_pages(struct io_pgtable_cfg *cfg, void *cookie, void *virt,
int order)
{
if (!cfg)
return;
if (cfg->iommu_pgtable_ops && cfg->iommu_pgtable_ops->free_pgtable)
cfg->iommu_pgtable_ops->free_pgtable(cookie, virt, order);
else
free_pages((unsigned long)virt, order);
}

View file

@ -106,6 +106,9 @@
/* Default value of wait time before gating device ref clock */
#define UFSHCD_REF_CLK_GATING_WAIT_US 0xFF /* microsecs */
/* Polling time to wait for fDeviceInit */
#define FDEVICEINIT_COMPL_TIMEOUT 1500 /* millisecs */
#define ufshcd_toggle_vreg(_dev, _vreg, _on) \
({ \
int _ret; \
@ -2013,8 +2016,11 @@ static void ufshcd_clk_scaling_update_busy(struct ufs_hba *hba)
static inline
void ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag)
{
hba->lrb[task_tag].issue_time_stamp = ktime_get();
hba->lrb[task_tag].compl_time_stamp = ktime_set(0, 0);
struct ufshcd_lrb *lrbp = &hba->lrb[task_tag];
lrbp->issue_time_stamp = ktime_get();
lrbp->compl_time_stamp = ktime_set(0, 0);
ufshcd_vops_setup_xfer_req(hba, task_tag, (lrbp->cmd ? true : false));
ufshcd_clk_scaling_start_busy(hba);
__set_bit(task_tag, &hba->outstanding_reqs);
ufshcd_writel(hba, 1 << task_tag, REG_UTP_TRANSFER_REQ_DOOR_BELL);
@ -2660,7 +2666,6 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
/* issue command to the controller */
spin_lock_irqsave(hba->host->host_lock, flags);
ufshcd_vops_setup_xfer_req(hba, tag, (lrbp->cmd ? true : false));
ufshcd_send_command(hba, tag);
out_unlock:
spin_unlock_irqrestore(hba->host->host_lock, flags);
@ -2880,7 +2885,6 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
/* Make sure descriptors are ready before ringing the doorbell */
wmb();
spin_lock_irqsave(hba->host->host_lock, flags);
ufshcd_vops_setup_xfer_req(hba, tag, (lrbp->cmd ? true : false));
ufshcd_send_command(hba, tag);
spin_unlock_irqrestore(hba->host->host_lock, flags);
@ -4406,9 +4410,9 @@ EXPORT_SYMBOL_GPL(ufshcd_config_pwr_mode);
*/
static int ufshcd_complete_dev_init(struct ufs_hba *hba)
{
int i;
int err;
bool flag_res = 1;
ktime_t timeout;
err = ufshcd_query_flag_retry(hba, UPIU_QUERY_OPCODE_SET_FLAG,
QUERY_FLAG_IDN_FDEVICEINIT, 0, NULL);
@ -4419,20 +4423,26 @@ static int ufshcd_complete_dev_init(struct ufs_hba *hba)
goto out;
}
/* poll for max. 1000 iterations for fDeviceInit flag to clear */
for (i = 0; i < 1000 && !err && flag_res; i++)
err = ufshcd_query_flag_retry(hba, UPIU_QUERY_OPCODE_READ_FLAG,
QUERY_FLAG_IDN_FDEVICEINIT, 0, &flag_res);
/* Poll fDeviceInit flag to be cleared */
timeout = ktime_add_ms(ktime_get(), FDEVICEINIT_COMPL_TIMEOUT);
do {
err = ufshcd_query_flag(hba, UPIU_QUERY_OPCODE_READ_FLAG,
QUERY_FLAG_IDN_FDEVICEINIT, 0, &flag_res);
if (!flag_res)
break;
usleep_range(5000, 10000);
} while (ktime_before(ktime_get(), timeout));
if (err)
if (err) {
dev_err(hba->dev,
"%s reading fDeviceInit flag failed with error %d\n",
__func__, err);
else if (flag_res)
"%s reading fDeviceInit flag failed with error %d\n",
__func__, err);
} else if (flag_res) {
dev_err(hba->dev,
"%s fDeviceInit was not cleared by the device\n",
__func__);
"%s fDeviceInit was not cleared by the device\n",
__func__);
err = -EBUSY;
}
out:
return err;
}

View file

@ -39,10 +39,16 @@ enum {
DRM_PANEL_BLANK_UNBLANK,
/* panel: power off */
DRM_PANEL_BLANK_POWERDOWN,
/* panel: low power mode */
DRM_PANEL_BLANK_LP,
/* fps change */
DRM_PANEL_BLANK_FPS_CHANGE,
};
struct drm_panel_notifier {
int refresh_rate;
void *data;
uint32_t id;
};
struct device_node;

View file

@ -1155,6 +1155,11 @@ struct dev_links_info {
struct list_head defer_hook;
bool need_for_probe;
enum dl_dev_state status;
ANDROID_KABI_RESERVE(1);
ANDROID_KABI_RESERVE(2);
ANDROID_KABI_RESERVE(3);
ANDROID_KABI_RESERVE(4);
};
/**
@ -1378,6 +1383,11 @@ struct device_link {
struct rcu_head rcu_head;
#endif
bool supplier_preactivated; /* Owned by consumer probe. */
ANDROID_KABI_RESERVE(1);
ANDROID_KABI_RESERVE(2);
ANDROID_KABI_RESERVE(3);
ANDROID_KABI_RESERVE(4);
};
static inline struct device *kobj_to_dev(struct kobject *kobj)

View file

@ -10,6 +10,7 @@
#define _LINUX_FWNODE_H_
#include <linux/types.h>
#include <linux/android_kabi.h>
struct fwnode_operations;
struct device;
@ -18,6 +19,11 @@ struct fwnode_handle {
struct fwnode_handle *secondary;
const struct fwnode_operations *ops;
struct device *dev;
ANDROID_KABI_RESERVE(1);
ANDROID_KABI_RESERVE(2);
ANDROID_KABI_RESERVE(3);
ANDROID_KABI_RESERVE(4);
};
/**

View file

@ -71,6 +71,19 @@ struct msm_iommu_flush_ops {
const struct iommu_flush_ops tlb_ops;
};
/**
* struct iommu_pgtable_ops - IOMMU callbacks for page table memory management.
*
* @alloc_pgtable: Allocate page table memory, and return a page-aligned
* cacheable linear mapping address of the start of a physically
* contiguous region of memory.
* @free_pgtable: Free page table memory.
*/
struct iommu_pgtable_ops {
void *(*alloc_pgtable)(void *cookie, int order, gfp_t gfp_mask);
void (*free_pgtable)(void *cookie, void *virt, int order);
};
/**
* struct io_pgtable_cfg - Configuration data for a set of page tables.
*
@ -83,6 +96,8 @@ struct msm_iommu_flush_ops {
* @coherent_walk A flag to indicate whether or not page table walks made
* by the IOMMU are coherent with the CPU caches.
* @tlb: TLB management callbacks for this set of tables.
* @iommu_pgtable_ops: IOMMU page table memory management callbacks (optional;
* defaults to the buddy allocator if not present).
* @iommu_dev: The device representing the DMA configuration for the
* page table walker.
*/
@ -131,6 +146,7 @@ struct io_pgtable_cfg {
unsigned int oas;
bool coherent_walk;
const struct iommu_flush_ops *tlb;
const struct iommu_pgtable_ops *iommu_pgtable_ops;
struct device *iommu_dev;
/* Low-level data specific to the table format */
@ -228,6 +244,36 @@ struct io_pgtable_ops *alloc_io_pgtable_ops(enum io_pgtable_fmt fmt,
*/
void free_io_pgtable_ops(struct io_pgtable_ops *ops);
/**
* io_pgtable_alloc_pages - Allocate memory for page tables using an IOMMU
* driver's provided callback, or the buddy allocator.
*
* @cfg: The page table configuration. This will be used to determine if
* the page table memory should be allocated through the IOMMU
* driver's callback, or the buddy allocator.
* @cookie: An opaque pointer used by the IOMMU driver's callback.
* @order: The order of the size of the allocation.
* @gfp_mask: The GFP mask to be used with the allocation
*
* Returns a cacheable linear mapping address to a physically contiguous region
* of memory. The start of the region must be page-aligned.
*/
void *io_pgtable_alloc_pages(struct io_pgtable_cfg *cfg, void *cookie,
int order, gfp_t gfp_mask);
/**
* io_pgtable_free_pages - Free memory for page tables using an IOMMU
* driver's provided callback, or the buddy allocator.
*
* @cfg: The page table configuration. This will be used to determine if
* the page table memory should be allocated through the IOMMU
* driver's callback, or the buddy allocator.
* @cookie: An opage pointer used by the IOMMU driver's callback.
* @virt: The virtual address of the memory to free.
* @order: The order of the size of the allocation.
*/
void io_pgtable_free_pages(struct io_pgtable_cfg *cfg, void *cookie, void *virt,
int order);
/*
* Internal structures for page table allocator implementations.

View file

@ -32,6 +32,7 @@
#include <linux/posix-timers.h>
#include <linux/rseq.h>
#include <linux/android_kabi.h>
#include <linux/android_vendor.h>
/* task_struct member predeclarations (sorted alphabetically): */
struct audit_context;
@ -1452,6 +1453,8 @@ struct task_struct {
unsigned long prev_lowest_stack;
#endif
ANDROID_VENDOR_DATA_ARRAY(1, 2);
ANDROID_KABI_RESERVE(1);
ANDROID_KABI_RESERVE(2);
ANDROID_KABI_RESERVE(3);

View file

@ -35,12 +35,6 @@ struct genl_info;
* do additional, common, filtering and return an error
* @post_doit: called after an operation's doit callback, it may
* undo operations done by pre_doit, for example release locks
* @mcast_bind: a socket bound to the given multicast group (which
* is given as the offset into the groups array)
* @mcast_unbind: a socket was unbound from the given multicast group.
* Note that unbind() will not be called symmetrically if the
* generic netlink family is removed while there are still open
* sockets.
* @attrbuf: buffer to store parsed attributes (private)
* @mcgrps: multicast groups used by this family
* @n_mcgrps: number of multicast groups
@ -64,8 +58,6 @@ struct genl_family {
void (*post_doit)(const struct genl_ops *ops,
struct sk_buff *skb,
struct genl_info *info);
int (*mcast_bind)(struct net *net, int group);
void (*mcast_unbind)(struct net *net, int group);
struct nlattr ** attrbuf; /* private */
const struct genl_ops * ops;
const struct genl_multicast_group *mcgrps;

View file

@ -0,0 +1,53 @@
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM dtask
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_DTASK_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_DTASK_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
/*
* Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality
*/
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS)
struct mutex;
DECLARE_HOOK(android_vh_mutex_wait_start,
TP_PROTO(struct mutex *lock),
TP_ARGS(lock));
DECLARE_HOOK(android_vh_mutex_wait_finish,
TP_PROTO(struct mutex *lock),
TP_ARGS(lock));
struct rw_semaphore;
DECLARE_HOOK(android_vh_rwsem_read_wait_start,
TP_PROTO(struct rw_semaphore *sem),
TP_ARGS(sem));
DECLARE_HOOK(android_vh_rwsem_read_wait_finish,
TP_PROTO(struct rw_semaphore *sem),
TP_ARGS(sem));
DECLARE_HOOK(android_vh_rwsem_write_wait_start,
TP_PROTO(struct rw_semaphore *sem),
TP_ARGS(sem));
DECLARE_HOOK(android_vh_rwsem_write_wait_finish,
TP_PROTO(struct rw_semaphore *sem),
TP_ARGS(sem));
struct task_struct;
DECLARE_HOOK(android_vh_sched_show_task,
TP_PROTO(struct task_struct *task),
TP_ARGS(task));
#else
#define trace_android_vh_mutex_wait_start(lock)
#define trace_android_vh_mutex_wait_finish(lock)
#define trace_android_vh_rwsem_read_wait_start(sem)
#define trace_android_vh_rwsem_read_wait_finish(sem)
#define trace_android_vh_rwsem_write_wait_start(sem)
#define trace_android_vh_rwsem_write_wait_finish(sem)
#define trace_android_vh_sched_show_task(task)
#endif
#endif /* _TRACE_HOOK_DTASK_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View file

@ -87,6 +87,9 @@ config GKI_HIDDEN_MEDIA_CONFIGS
select MEDIA_SUPPORT
select FRAME_VECTOR
select VIDEOBUF2_DMA_CONTIG
select CEC_CORE
select CEC_NOTIFIER
select CEC_PIN
help
Dummy config option used to enable hidden media configs.
These are normally selected implicitly when a module

View file

@ -36,6 +36,8 @@
# include "mutex.h"
#endif
#include <trace/hooks/dtask.h>
void
__mutex_init(struct mutex *lock, const char *name, struct lock_class_key *key)
{
@ -1002,6 +1004,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
waiter.task = current;
trace_android_vh_mutex_wait_start(lock);
set_current_state(state);
for (;;) {
/*
@ -1057,6 +1060,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
spin_lock(&lock->wait_lock);
acquired:
__set_current_state(TASK_RUNNING);
trace_android_vh_mutex_wait_finish(lock);
if (use_ww_ctx && ww_ctx) {
/*
@ -1087,6 +1091,7 @@ skip_wait:
err:
__set_current_state(TASK_RUNNING);
trace_android_vh_mutex_wait_finish(lock);
mutex_remove_waiter(lock, &waiter, current);
err_early_kill:
spin_unlock(&lock->wait_lock);

View file

@ -31,6 +31,8 @@
#include "rwsem.h"
#include "lock_events.h"
#include <trace/hooks/dtask.h>
/*
* The least significant 3 bits of the owner value has the following
* meanings when set.
@ -1085,6 +1087,7 @@ queue:
wake_up_q(&wake_q);
/* wait to be given the lock */
trace_android_vh_rwsem_read_wait_start(sem);
for (;;) {
set_current_state(state);
if (!smp_load_acquire(&waiter.task)) {
@ -1104,6 +1107,7 @@ queue:
}
__set_current_state(TASK_RUNNING);
trace_android_vh_rwsem_read_wait_finish(sem);
lockevent_inc(rwsem_rlock);
return sem;
@ -1115,6 +1119,7 @@ out_nolock:
}
raw_spin_unlock_irq(&sem->wait_lock);
__set_current_state(TASK_RUNNING);
trace_android_vh_rwsem_read_wait_finish(sem);
lockevent_inc(rwsem_rlock_fail);
return ERR_PTR(-EINTR);
}
@ -1209,6 +1214,7 @@ rwsem_down_write_slowpath(struct rw_semaphore *sem, int state)
wait:
/* wait until we successfully acquire the lock */
trace_android_vh_rwsem_write_wait_start(sem);
set_current_state(state);
for (;;) {
if (rwsem_try_write_lock(sem, wstate)) {
@ -1268,6 +1274,7 @@ trylock_again:
raw_spin_lock_irq(&sem->wait_lock);
}
__set_current_state(TASK_RUNNING);
trace_android_vh_rwsem_write_wait_finish(sem);
list_del(&waiter.list);
rwsem_disable_reader_optspin(sem, disable_rspin);
raw_spin_unlock_irq(&sem->wait_lock);
@ -1277,6 +1284,7 @@ trylock_again:
out_nolock:
__set_current_state(TASK_RUNNING);
trace_android_vh_rwsem_write_wait_finish(sem);
raw_spin_lock_irq(&sem->wait_lock);
list_del(&waiter.list);

View file

@ -26,6 +26,9 @@
#define CREATE_TRACE_POINTS
#include <trace/events/sched.h>
#undef CREATE_TRACE_POINTS
#include <trace/hooks/dtask.h>
/*
* Export tracepoints that act as a bare tracehook (ie: have no trace event
* associated with them) to allow external modules to probe them.
@ -6191,6 +6194,7 @@ void sched_show_task(struct task_struct *p)
(unsigned long)task_thread_info(p)->flags);
print_worker_info(KERN_INFO, p);
trace_android_vh_sched_show_task(p);
show_stack(p, NULL);
put_task_stack(p);
}

View file

@ -989,60 +989,11 @@ static struct genl_family genl_ctrl __ro_after_init = {
.netnsok = true,
};
static int genl_bind(struct net *net, int group)
{
struct genl_family *f;
int err = -ENOENT;
unsigned int id;
down_read(&cb_lock);
idr_for_each_entry(&genl_fam_idr, f, id) {
if (group >= f->mcgrp_offset &&
group < f->mcgrp_offset + f->n_mcgrps) {
int fam_grp = group - f->mcgrp_offset;
if (!f->netnsok && net != &init_net)
err = -ENOENT;
else if (f->mcast_bind)
err = f->mcast_bind(net, fam_grp);
else
err = 0;
break;
}
}
up_read(&cb_lock);
return err;
}
static void genl_unbind(struct net *net, int group)
{
struct genl_family *f;
unsigned int id;
down_read(&cb_lock);
idr_for_each_entry(&genl_fam_idr, f, id) {
if (group >= f->mcgrp_offset &&
group < f->mcgrp_offset + f->n_mcgrps) {
int fam_grp = group - f->mcgrp_offset;
if (f->mcast_unbind)
f->mcast_unbind(net, fam_grp);
break;
}
}
up_read(&cb_lock);
}
static int __net_init genl_pernet_init(struct net *net)
{
struct netlink_kernel_cfg cfg = {
.input = genl_rcv,
.flags = NL_CFG_F_NONROOT_RECV,
.bind = genl_bind,
.unbind = genl_unbind,
};
/* we'll bump the group number right afterwards */

View file

@ -58,7 +58,7 @@ my %ignore_type = ();
my @ignore = ();
my $help = 0;
my $configuration_file = ".checkpatch.conf";
my $max_line_length = 80;
my $max_line_length = 100;
my $ignore_perl_version = 0;
my $minimum_perl_version = 5.10.0;
my $min_conf_desc_length = 4;
@ -66,11 +66,12 @@ my $spelling_file = "$D/spelling.txt";
my $codespell = 0;
my $codespellfile = "/usr/share/codespell/dictionary.txt";
my $conststructsfile = "$D/const_structs.checkpatch";
my $typedefsfile = "";
my $typedefsfile;
my $color = "auto";
my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE
# git output parsing needs US English output, so first set backtick child process LANGUAGE
my $git_command ='export LANGUAGE=en_US.UTF-8; git';
my $tabsize = 8;
sub help {
my ($exitcode) = @_;
@ -103,8 +104,11 @@ Options:
--types TYPE(,TYPE2...) show only these comma separated message types
--ignore TYPE(,TYPE2...) ignore various comma separated message types
--show-types show the specific message type in the output
--max-line-length=n set the maximum line length, if exceeded, warn
--max-line-length=n set the maximum line length, (default $max_line_length)
if exceeded, warn on patches
requires --strict for use with --file
--min-conf-desc-length=n set the min description length, if shorter, warn
--tab-size=n set the number of spaces for tab (default $tabsize)
--root=PATH PATH to the kernel tree root
--no-summary suppress the per-file summary
--mailback only produce a report in case of warnings/errors
@ -222,6 +226,7 @@ GetOptions(
'list-types!' => \$list_types,
'max-line-length=i' => \$max_line_length,
'min-conf-desc-length=i' => \$min_conf_desc_length,
'tab-size=i' => \$tabsize,
'root=s' => \$root,
'summary!' => \$summary,
'mailback!' => \$mailback,
@ -248,6 +253,8 @@ list_types(0) if ($list_types);
$fix = 1 if ($fix_inplace);
$check_orig = $check;
die "$P: --git cannot be used with --file or --fix\n" if ($git && ($file || $fix));
my $exit = 0;
my $perl_version_ok = 1;
@ -271,9 +278,12 @@ if ($color =~ /^[01]$/) {
} elsif ($color =~ /^auto$/i) {
$color = (-t STDOUT);
} else {
die "Invalid color mode: $color\n";
die "$P: Invalid color mode: $color\n";
}
# skip TAB size 1 to avoid additional checks on $tabsize - 1
die "$P: Invalid TAB size: $tabsize\n" if ($tabsize < 2);
sub hash_save_array_words {
my ($hashRef, $arrayRef) = @_;
@ -480,7 +490,7 @@ our $allocFunctions = qr{(?x:
(?:kv|k|v)[czm]alloc(?:_node|_array)? |
kstrdup(?:_const)? |
kmemdup(?:_nul)?) |
(?:\w+)?alloc_skb(?:ip_align)? |
(?:\w+)?alloc_skb(?:_ip_align)? |
# dev_alloc_skb/netdev_alloc_skb, et al
dma_alloc_coherent
)};
@ -585,6 +595,8 @@ our @mode_permission_funcs = (
["__ATTR", 2],
);
my $word_pattern = '\b[A-Z]?[a-z]{2,}\b';
#Create a search pattern for all these functions to speed up a loop below
our $mode_perms_search = "";
foreach my $entry (@mode_permission_funcs) {
@ -753,7 +765,7 @@ sub read_words {
next;
}
$$wordsRef .= '|' if ($$wordsRef ne "");
$$wordsRef .= '|' if (defined $$wordsRef);
$$wordsRef .= $line;
}
close($file);
@ -763,16 +775,18 @@ sub read_words {
return 0;
}
my $const_structs = "";
read_words(\$const_structs, $conststructsfile)
or warn "No structs that should be const will be found - file '$conststructsfile': $!\n";
my $const_structs;
if (show_type("CONST_STRUCT")) {
read_words(\$const_structs, $conststructsfile)
or warn "No structs that should be const will be found - file '$conststructsfile': $!\n";
}
my $typeOtherTypedefs = "";
if (length($typedefsfile)) {
if (defined($typedefsfile)) {
my $typeOtherTypedefs;
read_words(\$typeOtherTypedefs, $typedefsfile)
or warn "No additional types will be considered - file '$typedefsfile': $!\n";
$typeTypedefs .= '|' . $typeOtherTypedefs if (defined $typeOtherTypedefs);
}
$typeTypedefs .= '|' . $typeOtherTypedefs if ($typeOtherTypedefs ne "");
sub build_types {
my $mods = "(?x: \n" . join("|\n ", (@modifierList, @modifierListFile)) . "\n)";
@ -811,12 +825,12 @@ sub build_types {
}x;
$Type = qr{
$NonptrType
(?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+)?
(?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+){0,4}
(?:\s+$Inline|\s+$Modifier)*
}x;
$TypeMisordered = qr{
$NonptrTypeMisordered
(?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+)?
(?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+){0,4}
(?:\s+$Inline|\s+$Modifier)*
}x;
$Declare = qr{(?:$Storage\s+(?:$Inline\s+)?)?$Type};
@ -837,7 +851,6 @@ our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant|$String)};
our $declaration_macros = qr{(?x:
(?:$Storage\s+)?(?:[A-Z_][A-Z0-9]*_){0,2}(?:DEFINE|DECLARE)(?:_[A-Z0-9]+){1,6}\s*\(|
(?:$Storage\s+)?[HLP]?LIST_HEAD\s*\(|
(?:$Storage\s+)?${Type}\s+uninitialized_var\s*\(|
(?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\(
)};
@ -881,14 +894,18 @@ sub seed_camelcase_file {
}
}
our %maintained_status = ();
sub is_maintained_obsolete {
my ($filename) = @_;
return 0 if (!$tree || !(-e "$root/scripts/get_maintainer.pl"));
my $status = `perl $root/scripts/get_maintainer.pl --status --nom --nol --nogit --nogit-fallback -f $filename 2>&1`;
if (!exists($maintained_status{$filename})) {
$maintained_status{$filename} = `perl $root/scripts/get_maintainer.pl --status --nom --nol --nogit --nogit-fallback -f $filename 2>&1`;
}
return $status =~ /obsolete/i;
return $maintained_status{$filename} =~ /obsolete/i;
}
sub is_SPDX_License_valid {
@ -1055,6 +1072,7 @@ for my $filename (@ARGV) {
while (<$FILE>) {
chomp;
push(@rawlines, $_);
$vname = qq("$1") if ($filename eq '-' && $_ =~ m/^Subject:\s+(.+)/i);
}
close($FILE);
@ -1121,6 +1139,7 @@ sub parse_email {
my ($formatted_email) = @_;
my $name = "";
my $name_comment = "";
my $address = "";
my $comment = "";
@ -1153,6 +1172,10 @@ sub parse_email {
$name = trim($name);
$name =~ s/^\"|\"$//g;
$name =~ s/(\s*\([^\)]+\))\s*//;
if (defined($1)) {
$name_comment = trim($1);
}
$address = trim($address);
$address =~ s/^\<|\>$//g;
@ -1161,7 +1184,7 @@ sub parse_email {
$name = "\"$name\"";
}
return ($name, $address, $comment);
return ($name, $name_comment, $address, $comment);
}
sub format_email {
@ -1187,6 +1210,23 @@ sub format_email {
return $formatted_email;
}
sub reformat_email {
my ($email) = @_;
my ($email_name, $name_comment, $email_address, $comment) = parse_email($email);
return format_email($email_name, $email_address);
}
sub same_email_addresses {
my ($email1, $email2) = @_;
my ($email1_name, $name1_comment, $email1_address, $comment1) = parse_email($email1);
my ($email2_name, $name2_comment, $email2_address, $comment2) = parse_email($email2);
return $email1_name eq $email2_name &&
$email1_address eq $email2_address;
}
sub which {
my ($bin) = @_;
@ -1220,7 +1260,7 @@ sub expand_tabs {
if ($c eq "\t") {
$res .= ' ';
$n++;
for (; ($n % 8) != 0; $n++) {
for (; ($n % $tabsize) != 0; $n++) {
$res .= ' ';
}
next;
@ -1649,8 +1689,16 @@ sub ctx_statement_level {
sub ctx_locate_comment {
my ($first_line, $end_line) = @_;
# If c99 comment on the current line, or the line before or after
my ($current_comment) = ($rawlines[$end_line - 1] =~ m@^\+.*(//.*$)@);
return $current_comment if (defined $current_comment);
($current_comment) = ($rawlines[$end_line - 2] =~ m@^[\+ ].*(//.*$)@);
return $current_comment if (defined $current_comment);
($current_comment) = ($rawlines[$end_line] =~ m@^[\+ ].*(//.*$)@);
return $current_comment if (defined $current_comment);
# Catch a comment on the end of the line itself.
my ($current_comment) = ($rawlines[$end_line - 1] =~ m@.*(/\*.*\*/)\s*(?:\\\s*)?$@);
($current_comment) = ($rawlines[$end_line - 1] =~ m@.*(/\*.*\*/)\s*(?:\\\s*)?$@);
return $current_comment if (defined $current_comment);
# Look through the context and try and figure out if there is a
@ -2233,7 +2281,7 @@ sub string_find_replace {
sub tabify {
my ($leading) = @_;
my $source_indent = 8;
my $source_indent = $tabsize;
my $max_spaces_before_tab = $source_indent - 1;
my $spaces_to_tab = " " x $source_indent;
@ -2302,6 +2350,19 @@ sub pos_last_openparen {
return length(expand_tabs(substr($line, 0, $last_openparen))) + 1;
}
sub get_raw_comment {
my ($line, $rawline) = @_;
my $comment = '';
for my $i (0 .. (length($line) - 1)) {
if (substr($line, $i, 1) eq "$;") {
$comment .= substr($rawline, $i, 1);
}
}
return $comment;
}
sub process {
my $filename = shift;
@ -2326,6 +2387,7 @@ sub process {
my $is_binding_patch = -1;
my $in_header_lines = $file ? 0 : 1;
my $in_commit_log = 0; #Scanning lines before patch
my $has_patch_separator = 0; #Found a --- line
my $has_commit_log = 0; #Encountered lines before patch
my $commit_log_lines = 0; #Number of commit log lines
my $commit_log_possible_stack_dump = 0;
@ -2389,7 +2451,7 @@ sub process {
if ($rawline=~/^\+\+\+\s+(\S+)/) {
$setup_docs = 0;
if ($1 =~ m@Documentation/admin-guide/kernel-parameters.rst$@) {
if ($1 =~ m@Documentation/admin-guide/kernel-parameters.txt$@) {
$setup_docs = 1;
}
#next;
@ -2470,6 +2532,7 @@ sub process {
$sline =~ s/$;/ /g; #with comments as spaces
my $rawline = $rawlines[$linenr - 1];
my $raw_comment = get_raw_comment($line, $rawline);
# check if it's a mode change, rename or start of a patch
if (!$in_commit_log &&
@ -2588,7 +2651,7 @@ sub process {
if (($last_binding_patch != -1) &&
($last_binding_patch ^ $is_binding_patch)) {
WARN("DT_SPLIT_BINDING_PATCH",
"DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.txt\n");
"DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.rst\n");
}
}
@ -2734,21 +2797,26 @@ sub process {
$author = $1;
$author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i);
$author =~ s/"//g;
$author = reformat_email($author);
}
# Check the patch for a signoff:
if ($line =~ /^\s*signed-off-by:/i) {
if ($line =~ /^\s*signed-off-by:\s*(.*)/i) {
$signoff++;
$in_commit_log = 0;
if ($author ne '') {
my $l = $line;
$l =~ s/"//g;
if ($l =~ /^\s*signed-off-by:\s*\Q$author\E/i) {
$authorsignoff = 1;
if (same_email_addresses($1, $author)) {
$authorsignoff = 1;
}
}
}
# Check for patch separator
if ($line =~ /^---$/) {
$has_patch_separator = 1;
$in_commit_log = 0;
}
# Check if MAINTAINERS is being updated. If so, there's probably no need to
# emit the "does MAINTAINERS need updating?" message on file add/move/delete
if ($line =~ /^\s*MAINTAINERS\s*\|/) {
@ -2794,7 +2862,7 @@ sub process {
}
}
my ($email_name, $email_address, $comment) = parse_email($email);
my ($email_name, $name_comment, $email_address, $comment) = parse_email($email);
my $suggested_email = format_email(($email_name, $email_address));
if ($suggested_email eq "") {
ERROR("BAD_SIGN_OFF",
@ -2805,9 +2873,7 @@ sub process {
$dequoted =~ s/" </ </;
# Don't force email to have quotes
# Allow just an angle bracketed address
if ("$dequoted$comment" ne $email &&
"<$email_address>$comment" ne $email &&
"$suggested_email$comment" ne $email) {
if (!same_email_addresses($email, $suggested_email)) {
WARN("BAD_SIGN_OFF",
"email address '$email' might be better as '$suggested_email$comment'\n" . $herecurr);
}
@ -2850,10 +2916,10 @@ sub process {
"A patch subject line should describe the change not the tool that found it\n" . $herecurr);
}
# Check for unwanted Gerrit info
if ($in_commit_log && $line =~ /^\s*change-id:/i) {
# Check for Gerrit Change-Ids not in any patch context
if ($realfile eq '' && !$has_patch_separator && $line =~ /^\s*change-id:/i) {
ERROR("GERRIT_CHANGE_ID",
"Remove Gerrit Change-Id's before submitting upstream.\n" . $herecurr);
"Remove Gerrit Change-Id's before submitting upstream\n" . $herecurr);
}
# Check if the commit log is in a possible stack dump
@ -2891,7 +2957,7 @@ sub process {
# Check for git id commit length and improperly formed commit descriptions
if ($in_commit_log && !$commit_log_possible_stack_dump &&
$line !~ /^\s*(?:Link|Patchwork|http|https|BugLink):/i &&
$line !~ /^\s*(?:Link|Patchwork|http|https|BugLink|base-commit):/i &&
$line !~ /^This reverts commit [0-9a-f]{7,40}/ &&
($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||
($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[\s"'\(\[]|$)/i &&
@ -2960,6 +3026,14 @@ sub process {
"added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
}
# Check for adding new DT bindings not in schema format
if (!$in_commit_log &&
($line =~ /^new file mode\s*\d+\s*$/) &&
($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
WARN("DT_SCHEMA_BINDING_PATCH",
"DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
}
# Check for wrappage within a valid hunk of the file
if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
ERROR("CORRUPTED_PATCH",
@ -3136,14 +3210,43 @@ sub process {
#print "is_start<$is_start> is_end<$is_end> length<$length>\n";
}
# check for MAINTAINERS entries that don't have the right form
if ($realfile =~ /^MAINTAINERS$/ &&
$rawline =~ /^\+[A-Z]:/ &&
$rawline !~ /^\+[A-Z]:\t\S/) {
if (WARN("MAINTAINERS_STYLE",
"MAINTAINERS entries use one tab after TYPE:\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~ s/^(\+[A-Z]):\s*/$1:\t/;
# check MAINTAINERS entries
if ($realfile =~ /^MAINTAINERS$/) {
# check MAINTAINERS entries for the right form
if ($rawline =~ /^\+[A-Z]:/ &&
$rawline !~ /^\+[A-Z]:\t\S/) {
if (WARN("MAINTAINERS_STYLE",
"MAINTAINERS entries use one tab after TYPE:\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~ s/^(\+[A-Z]):\s*/$1:\t/;
}
}
# check MAINTAINERS entries for the right ordering too
my $preferred_order = 'MRLSWQBCPTFXNK';
if ($rawline =~ /^\+[A-Z]:/ &&
$prevrawline =~ /^[\+ ][A-Z]:/) {
$rawline =~ /^\+([A-Z]):\s*(.*)/;
my $cur = $1;
my $curval = $2;
$prevrawline =~ /^[\+ ]([A-Z]):\s*(.*)/;
my $prev = $1;
my $prevval = $2;
my $curindex = index($preferred_order, $cur);
my $previndex = index($preferred_order, $prev);
if ($curindex < 0) {
WARN("MAINTAINERS_STYLE",
"Unknown MAINTAINERS entry type: '$cur'\n" . $herecurr);
} else {
if ($previndex >= 0 && $curindex < $previndex) {
WARN("MAINTAINERS_STYLE",
"Misordered MAINTAINERS entry - list '$cur:' before '$prev:'\n" . $hereprev);
} elsif ((($prev eq 'F' && $cur eq 'F') ||
($prev eq 'X' && $cur eq 'X')) &&
($prevval cmp $curval) > 0) {
WARN("MAINTAINERS_STYLE",
"Misordered MAINTAINERS entry - list file patterns in alphabetic order\n" . $hereprev);
}
}
}
}
@ -3209,7 +3312,7 @@ sub process {
$comment = '/*';
} elsif ($realfile =~ /\.(c|dts|dtsi)$/) {
$comment = '//';
} elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc)$/) {
} elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc|yaml)$/) {
$comment = '#';
} elsif ($realfile =~ /\.rst$/) {
$comment = '..';
@ -3233,6 +3336,17 @@ sub process {
WARN("SPDX_LICENSE_TAG",
"'$spdx_license' is not supported in LICENSES/...\n" . $herecurr);
}
if ($realfile =~ m@^Documentation/devicetree/bindings/@ &&
not $spdx_license =~ /GPL-2\.0.*BSD-2-Clause/) {
my $msg_level = \&WARN;
$msg_level = \&CHK if ($file);
if (&{$msg_level}("SPDX_LICENSE_TAG",
"DT binding documents should be licensed (GPL-2.0-only OR BSD-2-Clause)\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~ s/SPDX-License-Identifier: .*/SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)/;
}
}
}
}
}
@ -3309,8 +3423,10 @@ sub process {
if ($msg_type ne "" &&
(show_type("LONG_LINE") || show_type($msg_type))) {
WARN($msg_type,
"line over $max_line_length characters\n" . $herecurr);
my $msg_level = \&WARN;
$msg_level = \&CHK if ($file);
&{$msg_level}($msg_type,
"line length of $length exceeds $max_line_length columns\n" . $herecurr);
}
}
@ -3324,7 +3440,7 @@ sub process {
next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/);
# at the beginning of a line any tabs must come first and anything
# more than 8 must use tabs.
# more than $tabsize must use tabs.
if ($rawline =~ /^\+\s* \t\s*\S/ ||
$rawline =~ /^\+\s* \s*/) {
my $herevet = "$here\n" . cat_vet($rawline) . "\n";
@ -3336,6 +3452,42 @@ sub process {
}
}
# check for repeated words separated by a single space
if ($rawline =~ /^\+/) {
while ($rawline =~ /\b($word_pattern) (?=($word_pattern))/g) {
my $first = $1;
my $second = $2;
if ($first =~ /(?:struct|union|enum)/) {
pos($rawline) += length($first) + length($second) + 1;
next;
}
next if ($first ne $second);
next if ($first eq 'long');
if (WARN("REPEATED_WORD",
"Possible repeated word: '$first'\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~ s/\b$first $second\b/$first/;
}
}
# if it's a repeated word on consecutive lines in a comment block
if ($prevline =~ /$;+\s*$/ &&
$prevrawline =~ /($word_pattern)\s*$/) {
my $last_word = $1;
if ($rawline =~ /^\+\s*\*\s*$last_word /) {
if (WARN("REPEATED_WORD",
"Possible repeated word: '$last_word'\n" . $hereprev) &&
$fix) {
$fixed[$fixlinenr] =~ s/(\+\s*\*\s*)$last_word /$1/;
}
}
}
}
# check for space before tabs.
if ($rawline =~ /^\+/ && $rawline =~ / \t/) {
my $herevet = "$here\n" . cat_vet($rawline) . "\n";
@ -3343,7 +3495,7 @@ sub process {
"please, no space before tabs\n" . $herevet) &&
$fix) {
while ($fixed[$fixlinenr] =~
s/(^\+.*) {8,8}\t/$1\t\t/) {}
s/(^\+.*) {$tabsize,$tabsize}\t/$1\t\t/) {}
while ($fixed[$fixlinenr] =~
s/(^\+.*) +\t/$1\t/) {}
}
@ -3365,11 +3517,11 @@ sub process {
if ($perl_version_ok &&
$sline =~ /^\+\t+( +)(?:$c90_Keywords\b|\{\s*$|\}\s*(?:else\b|while\b|\s*$)|$Declare\s*$Ident\s*[;=])/) {
my $indent = length($1);
if ($indent % 8) {
if ($indent % $tabsize) {
if (WARN("TABSTOP",
"Statements should start on a tabstop\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~ s@(^\+\t+) +@$1 . "\t" x ($indent/8)@e;
$fixed[$fixlinenr] =~ s@(^\+\t+) +@$1 . "\t" x ($indent/$tabsize)@e;
}
}
}
@ -3387,8 +3539,8 @@ sub process {
my $newindent = $2;
my $goodtabindent = $oldindent .
"\t" x ($pos / 8) .
" " x ($pos % 8);
"\t" x ($pos / $tabsize) .
" " x ($pos % $tabsize);
my $goodspaceindent = $oldindent . " " x $pos;
if ($newindent ne $goodtabindent &&
@ -3859,11 +4011,11 @@ sub process {
#print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s> cond_lines<$cond_lines> stat_real<$stat_real> stat<$stat>\n";
if ($check && $s ne '' &&
(($sindent % 8) != 0 ||
(($sindent % $tabsize) != 0 ||
($sindent < $indent) ||
($sindent == $indent &&
($s !~ /^\s*(?:\}|\{|else\b)/)) ||
($sindent > $indent + 8))) {
($sindent > $indent + $tabsize))) {
WARN("SUSPECT_CODE_INDENT",
"suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n");
}
@ -4140,7 +4292,7 @@ sub process {
}
# check for function declarations without arguments like "int foo()"
if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) {
if ($line =~ /(\b$Type\s*$Ident)\s*\(\s*\)/) {
if (ERROR("FUNCTION_WITHOUT_ARGS",
"Bad function definition - $1() should probably be $1(void)\n" . $herecurr) &&
$fix) {
@ -4251,15 +4403,6 @@ sub process {
"Prefer [subsystem eg: netdev]_$level2([subsystem]dev, ... then dev_$level2(dev, ... then pr_$level(... to printk(KERN_$orig ...\n" . $herecurr);
}
if ($line =~ /\bpr_warning\s*\(/) {
if (WARN("PREFER_PR_LEVEL",
"Prefer pr_warn(... to pr_warning(...\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~
s/\bpr_warning\b/pr_warn/;
}
}
if ($line =~ /\bdev_printk\s*\(\s*KERN_([A-Z]+)/) {
my $orig = $1;
my $level = lc($orig);
@ -4277,6 +4420,17 @@ sub process {
"ENOSYS means 'invalid syscall nr' and nothing else\n" . $herecurr);
}
# ENOTSUPP is not a standard error code and should be avoided in new patches.
# Folks usually mean EOPNOTSUPP (also called ENOTSUP), when they type ENOTSUPP.
# Similarly to ENOSYS warning a small number of false positives is expected.
if (!$file && $line =~ /\bENOTSUPP\b/) {
if (WARN("ENOTSUPP",
"ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~ s/\bENOTSUPP\b/EOPNOTSUPP/;
}
}
# function brace can't be on same line, except for #defines of do while,
# or if closed on same line
if ($perl_version_ok &&
@ -4717,7 +4871,7 @@ sub process {
($op eq '>' &&
$ca =~ /<\S+\@\S+$/))
{
$ok = 1;
$ok = 1;
}
# for asm volatile statements
@ -5044,15 +5198,37 @@ sub process {
my ($s, $c) = ($stat, $cond);
if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/s) {
ERROR("ASSIGN_IN_IF",
"do not use assignment in if condition\n" . $herecurr);
if (ERROR("ASSIGN_IN_IF",
"do not use assignment in if condition\n" . $herecurr) &&
$fix && $perl_version_ok) {
if ($rawline =~ /^\+(\s+)if\s*\(\s*(\!)?\s*\(\s*(($Lval)\s*=\s*$LvalOrFunc)\s*\)\s*(?:($Compare)\s*($FuncArg))?\s*\)\s*(\{)?\s*$/) {
my $space = $1;
my $not = $2;
my $statement = $3;
my $assigned = $4;
my $test = $8;
my $against = $9;
my $brace = $15;
fix_delete_line($fixlinenr, $rawline);
fix_insert_line($fixlinenr, "$space$statement;");
my $newline = "${space}if (";
$newline .= '!' if defined($not);
$newline .= '(' if (defined $not && defined($test) && defined($against));
$newline .= "$assigned";
$newline .= " $test $against" if (defined($test) && defined($against));
$newline .= ')' if (defined $not && defined($test) && defined($against));
$newline .= ')';
$newline .= " {" if (defined($brace));
fix_insert_line($fixlinenr + 1, $newline);
}
}
}
# Find out what is on the end of the line after the
# conditional.
substr($s, 0, length($c), '');
$s =~ s/\n.*//g;
$s =~ s/$;//g; # Remove any comments
$s =~ s/$;//g; # Remove any comments
if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ &&
$c !~ /}\s*while\s*/)
{
@ -5091,7 +5267,7 @@ sub process {
# if and else should not have general statements after it
if ($line =~ /^.\s*(?:}\s*)?else\b(.*)/) {
my $s = $1;
$s =~ s/$;//g; # Remove any comments
$s =~ s/$;//g; # Remove any comments
if ($s !~ /^\s*(?:\sif|(?:{|)\s*\\?\s*$)/) {
ERROR("TRAILING_STATEMENTS",
"trailing statements should be on next line\n" . $herecurr);
@ -5168,8 +5344,9 @@ sub process {
$var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
#Ignore Page<foo> variants
$var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
#Ignore SI style variants like nS, mV and dB (ie: max_uV, regulator_min_uA_show)
$var !~ /^(?:[a-z_]*?)_?[a-z][A-Z](?:_[a-z_]+)?$/ &&
#Ignore SI style variants like nS, mV and dB
#(ie: max_uV, regulator_min_uA_show, RANGE_mA_VALUE)
$var !~ /^(?:[a-z0-9_]*|[A-Z0-9_]*)?_?[a-z][A-Z](?:_[a-z0-9_]+|_[A-Z0-9_]+)?$/ &&
#Ignore some three character SI units explicitly, like MiB and KHz
$var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) {
while ($var =~ m{($Ident)}g) {
@ -5272,7 +5449,7 @@ sub process {
# to gobble any hanging open-parens.
$dstat =~ s/\(.+\\$/1/;
# Flatten any obvious string concatentation.
# Flatten any obvious string concatenation.
while ($dstat =~ s/($String)\s*$Ident/$1/ ||
$dstat =~ s/$Ident\s*($String)/$1/)
{
@ -5951,8 +6128,7 @@ sub process {
my $barriers = qr{
mb|
rmb|
wmb|
read_barrier_depends
wmb
}x;
my $barrier_stems = qr{
mb__before_atomic|
@ -5993,10 +6169,12 @@ sub process {
}
}
# check for smp_read_barrier_depends and read_barrier_depends
if (!$file && $line =~ /\b(smp_|)read_barrier_depends\s*\(/) {
WARN("READ_BARRIER_DEPENDS",
"$1read_barrier_depends should only be used in READ_ONCE or DEC Alpha code\n" . $herecurr);
# check for data_race without a comment.
if ($line =~ /\bdata_race\s*\(/) {
if (!ctx_has_comment($first_line, $linenr)) {
WARN("DATA_RACE",
"data_race without comment\n" . $herecurr);
}
}
# check of hardware specific defines
@ -6179,14 +6357,18 @@ sub process {
for (my $count = $linenr; $count <= $lc; $count++) {
my $specifier;
my $extension;
my $qualifier;
my $bad_specifier = "";
my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0));
$fmt =~ s/%%//g;
while ($fmt =~ /(\%[\*\d\.]*p(\w))/g) {
while ($fmt =~ /(\%[\*\d\.]*p(\w)(\w*))/g) {
$specifier = $1;
$extension = $2;
if ($extension !~ /[SsBKRraEhMmIiUDdgVCbGNOxt]/) {
$qualifier = $3;
if ($extension !~ /[SsBKRraEehMmIiUDdgVCbGNOxtf]/ ||
($extension eq "f" &&
defined $qualifier && $qualifier !~ /^w/)) {
$bad_specifier = $specifier;
last;
}
@ -6203,7 +6385,6 @@ sub process {
my $ext_type = "Invalid";
my $use = "";
if ($bad_specifier =~ /p[Ff]/) {
$ext_type = "Deprecated";
$use = " - use %pS instead";
$use =~ s/pS/ps/ if ($bad_specifier =~ /pf/);
}
@ -6367,8 +6548,7 @@ sub process {
if (defined $cond) {
substr($s, 0, length($cond), '');
}
if ($s =~ /^\s*;/ &&
$function_name ne 'uninitialized_var')
if ($s =~ /^\s*;/)
{
WARN("AVOID_EXTERNS",
"externs should be avoided in .c files\n" . $herecurr);
@ -6429,7 +6609,7 @@ sub process {
if (!grep(/$name/, @setup_docs)) {
CHK("UNDOCUMENTED_SETUP",
"__setup appears un-documented -- check Documentation/admin-guide/kernel-parameters.rst\n" . $herecurr);
"__setup appears un-documented -- check Documentation/admin-guide/kernel-parameters.txt\n" . $herecurr);
}
}
@ -6511,6 +6691,12 @@ sub process {
}
}
# check for IS_ENABLED() without CONFIG_<FOO> ($rawline for comments too)
if ($rawline =~ /\bIS_ENABLED\s*\(\s*(\w+)\s*\)/ && $1 !~ /^CONFIG_/) {
WARN("IS_ENABLED_CONFIG",
"IS_ENABLED($1) is normally used as IS_ENABLED(CONFIG_$1)\n" . $herecurr);
}
# check for #if defined CONFIG_<FOO> || defined CONFIG_<FOO>_MODULE
if ($line =~ /^\+\s*#\s*if\s+defined(?:\s*\(?\s*|\s+)(CONFIG_[A-Z_]+)\s*\)?\s*\|\|\s*defined(?:\s*\(?\s*|\s+)\1_MODULE\s*\)?\s*$/) {
my $config = $1;
@ -6521,28 +6707,25 @@ sub process {
}
}
# check for case / default statements not preceded by break/fallthrough/switch
if ($line =~ /^.\s*(?:case\s+(?:$Ident|$Constant)\s*|default):/) {
my $has_break = 0;
my $has_statement = 0;
my $count = 0;
my $prevline = $linenr;
while ($prevline > 1 && ($file || $count < 3) && !$has_break) {
$prevline--;
my $rline = $rawlines[$prevline - 1];
my $fline = $lines[$prevline - 1];
last if ($fline =~ /^\@\@/);
next if ($fline =~ /^\-/);
next if ($fline =~ /^.(?:\s*(?:case\s+(?:$Ident|$Constant)[\s$;]*|default):[\s$;]*)*$/);
$has_break = 1 if ($rline =~ /fall[\s_-]*(through|thru)/i);
next if ($fline =~ /^.[\s$;]*$/);
$has_statement = 1;
$count++;
$has_break = 1 if ($fline =~ /\bswitch\b|\b(?:break\s*;[\s$;]*$|exit\s*\(\b|return\b|goto\b|continue\b)/);
}
if (!$has_break && $has_statement) {
WARN("MISSING_BREAK",
"Possible switch case/default not preceded by break or fallthrough comment\n" . $herecurr);
# check for /* fallthrough */ like comment, prefer fallthrough;
my @fallthroughs = (
'fallthrough',
'@fallthrough@',
'lint -fallthrough[ \t]*',
'intentional(?:ly)?[ \t]*fall(?:(?:s | |-)[Tt]|t)hr(?:ough|u|ew)',
'(?:else,?\s*)?FALL(?:S | |-)?THR(?:OUGH|U|EW)[ \t.!]*(?:-[^\n\r]*)?',
'Fall(?:(?:s | |-)[Tt]|t)hr(?:ough|u|ew)[ \t.!]*(?:-[^\n\r]*)?',
'fall(?:s | |-)?thr(?:ough|u|ew)[ \t.!]*(?:-[^\n\r]*)?',
);
if ($raw_comment ne '') {
foreach my $ft (@fallthroughs) {
if ($raw_comment =~ /$ft/) {
my $msg_level = \&WARN;
$msg_level = \&CHK if ($file);
&{$msg_level}("PREFER_FALLTHROUGH",
"Prefer 'fallthrough;' over fallthrough comment\n" . $herecurr);
last;
}
}
}
@ -6645,7 +6828,8 @@ sub process {
# check for various structs that are normally const (ops, kgdb, device_tree)
# and avoid what seem like struct definitions 'struct foo {'
if ($line !~ /\bconst\b/ &&
if (defined($const_structs) &&
$line !~ /\bconst\b/ &&
$line =~ /\bstruct\s+($const_structs)\b(?!\s*\{)/) {
WARN("CONST_STRUCT",
"struct $1 should normally be const\n" . $herecurr);