Commit graph

881,528 commits

Author SHA1 Message Date
Greg Kroah-Hartman
91f19a26c8 ANDROID: GKI: update ABI definitions based on recent wifi backports
Leaf changes summary: 9 artifacts changed
Changed leaf types summary: 9 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

'enum nl80211_attrs at nl80211.h:2380:1' changed:
  type size hasn't changed
  7 enumerator insertions:
    'nl80211_attrs::NL80211_ATTR_VLAN_ID' value '282'
    'nl80211_attrs::NL80211_ATTR_HE_BSS_COLOR' value '283'
    'nl80211_attrs::NL80211_ATTR_IFTYPE_AKM_SUITES' value '284'
    'nl80211_attrs::NL80211_ATTR_TID_CONFIG' value '285'
    'nl80211_attrs::NL80211_ATTR_CONTROL_PORT_NO_PREAUTH' value '286'
    'nl80211_attrs::NL80211_ATTR_PMK_LIFETIME' value '287'
    'nl80211_attrs::NL80211_ATTR_PMK_REAUTH_THRESHOLD' value '288'
  3 enumerator changes:
    'nl80211_attrs::NL80211_ATTR_MAX' from value '281' to '288' at nl80211.h:2469:1
    'nl80211_attrs::NUM_NL80211_ATTR' from value '282' to '289' at nl80211.h:2469:1
    'nl80211_attrs::__NL80211_ATTR_AFTER_LAST' from value '282' to '289' at nl80211.h:2469:1
  2 impacted interfaces

'enum nl80211_commands at nl80211.h:1107:1' changed:
  type size hasn't changed
  1 enumerator insertion:
    'nl80211_commands::NL80211_CMD_SET_TID_CONFIG' value '137'
  2 enumerator changes:
    'nl80211_commands::NL80211_CMD_MAX' from value '136' to '137' at nl80211.h:1149:1
    'nl80211_commands::__NL80211_CMD_AFTER_LAST' from value '137' to '138' at nl80211.h:1149:1
  2 impacted interfaces
'struct cfg80211_ap_settings at cfg80211.h:992:1' changed:
  type size hasn't changed
  1 data member insertion:
    'cfg80211_he_bss_color cfg80211_ap_settings::he_bss_color', at offset 4120 (in bits) at cfg80211.h:1063:1
  one impacted interface

'struct cfg80211_cached_keys at core.h:272:1' changed (indirectly):
  type size changed from 1472 to 1728 (in bits)
  there are data member changes:
    'key_params cfg80211_cached_keys::params[4]' size changed from 1024 to 1280 (in bits) (by +256 bits)
    'u8 cfg80211_cached_keys::data[4][13]' offset changed from 1024 to 1280 (in bits) (by +256 bits)
    'int cfg80211_cached_keys::def' offset changed from 1440 to 1696 (in bits) (by +256 bits)
  55 impacted interfaces

'struct cfg80211_ops at cfg80211.h:3632:1' changed:
  type size changed from 6976 to 7168 (in bits)
  3 data member insertions:
    'int (wiphy*, net_device*, typedef u8)* cfg80211_ops::set_default_beacon_key', at offset 704 (in bits) at cfg80211.h:3730:1
    'int (wiphy*, net_device*, cfg80211_tid_config*)* cfg80211_ops::set_tid_config', at offset 7040 (in bits) at cfg80211.h:4020:1
    'int (wiphy*, net_device*, const u8*, typedef u8)* cfg80211_ops::reset_tid_config', at offset 7104 (in bits) at cfg80211.h:4022:1
  there are data member changes:
    'int (wiphy*, net_device*, cfg80211_ap_settings*)* cfg80211_ops::start_ap' offset changed from 704 to 768 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_beacon_data*)* cfg80211_ops::change_beacon' offset changed from 768 to 832 (in bits) (by +64 bits)
    'int (wiphy*, net_device*)* cfg80211_ops::stop_ap' offset changed from 832 to 896 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, station_parameters*)* cfg80211_ops::add_station' offset changed from 896 to 960 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, station_del_parameters*)* cfg80211_ops::del_station' offset changed from 960 to 1024 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, station_parameters*)* cfg80211_ops::change_station' offset changed from 1024 to 1088 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, station_info*)* cfg80211_ops::get_station' offset changed from 1088 to 1152 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, int, u8*, station_info*)* cfg80211_ops::dump_station' offset changed from 1152 to 1216 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, const u8*)* cfg80211_ops::add_mpath' offset changed from 1216 to 1280 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*)* cfg80211_ops::del_mpath' offset changed from 1280 to 1344 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, const u8*)* cfg80211_ops::change_mpath' offset changed from 1344 to 1408 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, u8*, u8*, mpath_info*)* cfg80211_ops::get_mpath' offset changed from 1408 to 1472 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, int, u8*, u8*, mpath_info*)* cfg80211_ops::dump_mpath' offset changed from 1472 to 1536 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, u8*, u8*, mpath_info*)* cfg80211_ops::get_mpp' offset changed from 1536 to 1600 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, int, u8*, u8*, mpath_info*)* cfg80211_ops::dump_mpp' offset changed from 1600 to 1664 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, mesh_config*)* cfg80211_ops::get_mesh_config' offset changed from 1664 to 1728 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u32, const mesh_config*)* cfg80211_ops::update_mesh_config' offset changed from 1728 to 1792 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const mesh_config*, const mesh_setup*)* cfg80211_ops::join_mesh' offset changed from 1792 to 1856 (in bits) (by +64 bits)
    'int (wiphy*, net_device*)* cfg80211_ops::leave_mesh' offset changed from 1856 to 1920 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, ocb_setup*)* cfg80211_ops::join_ocb' offset changed from 1920 to 1984 (in bits) (by +64 bits)
    'int (wiphy*, net_device*)* cfg80211_ops::leave_ocb' offset changed from 1984 to 2048 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, bss_parameters*)* cfg80211_ops::change_bss' offset changed from 2048 to 2112 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, ieee80211_txq_params*)* cfg80211_ops::set_txq_params' offset changed from 2112 to 2176 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, ieee80211_channel*)* cfg80211_ops::libertas_set_mesh_channel' offset changed from 2176 to 2240 (in bits) (by +64 bits)
    'int (wiphy*, cfg80211_chan_def*)* cfg80211_ops::set_monitor_channel' offset changed from 2240 to 2304 (in bits) (by +64 bits)
    'int (wiphy*, cfg80211_scan_request*)* cfg80211_ops::scan' offset changed from 2304 to 2368 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*)* cfg80211_ops::abort_scan' offset changed from 2368 to 2432 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_auth_request*)* cfg80211_ops::auth' offset changed from 2432 to 2496 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_assoc_request*)* cfg80211_ops::assoc' offset changed from 2496 to 2560 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_deauth_request*)* cfg80211_ops::deauth' offset changed from 2560 to 2624 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_disassoc_request*)* cfg80211_ops::disassoc' offset changed from 2624 to 2688 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_connect_params*)* cfg80211_ops::connect' offset changed from 2688 to 2752 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_connect_params*, typedef u32)* cfg80211_ops::update_connect_params' offset changed from 2752 to 2816 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u16)* cfg80211_ops::disconnect' offset changed from 2816 to 2880 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_ibss_params*)* cfg80211_ops::join_ibss' offset changed from 2880 to 2944 (in bits) (by +64 bits)
    'int (wiphy*, net_device*)* cfg80211_ops::leave_ibss' offset changed from 2944 to 3008 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, int*)* cfg80211_ops::set_mcast_rate' offset changed from 3008 to 3072 (in bits) (by +64 bits)
    'int (wiphy*, typedef u32)* cfg80211_ops::set_wiphy_params' offset changed from 3072 to 3136 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, enum nl80211_tx_power_setting, int)* cfg80211_ops::set_tx_power' offset changed from 3136 to 3200 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, int*)* cfg80211_ops::get_tx_power' offset changed from 3200 to 3264 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*)* cfg80211_ops::set_wds_peer' offset changed from 3264 to 3328 (in bits) (by +64 bits)
    'void (wiphy*)* cfg80211_ops::rfkill_poll' offset changed from 3328 to 3392 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, const cfg80211_bitrate_mask*)* cfg80211_ops::set_bitrate_mask' offset changed from 3392 to 3456 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, int, survey_info*)* cfg80211_ops::dump_survey' offset changed from 3456 to 3520 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_pmksa*)* cfg80211_ops::set_pmksa' offset changed from 3520 to 3584 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_pmksa*)* cfg80211_ops::del_pmksa' offset changed from 3584 to 3648 (in bits) (by +64 bits)
    'int (wiphy*, net_device*)* cfg80211_ops::flush_pmksa' offset changed from 3648 to 3712 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, ieee80211_channel*, unsigned int, u64*)* cfg80211_ops::remain_on_channel' offset changed from 3712 to 3776 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, typedef u64)* cfg80211_ops::cancel_remain_on_channel' offset changed from 3776 to 3840 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_mgmt_tx_params*, u64*)* cfg80211_ops::mgmt_tx' offset changed from 3840 to 3904 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, typedef u64)* cfg80211_ops::mgmt_tx_cancel_wait' offset changed from 3904 to 3968 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef bool, int)* cfg80211_ops::set_power_mgmt' offset changed from 3968 to 4032 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef s32, typedef u32)* cfg80211_ops::set_cqm_rssi_config' offset changed from 4032 to 4096 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef s32, typedef s32)* cfg80211_ops::set_cqm_rssi_range_config' offset changed from 4096 to 4160 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u32, typedef u32, typedef u32)* cfg80211_ops::set_cqm_txe_config' offset changed from 4160 to 4224 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*, typedef u16, typedef bool)* cfg80211_ops::mgmt_frame_register' offset changed from 4224 to 4288 (in bits) (by +64 bits)
    'int (wiphy*, typedef u32, typedef u32)* cfg80211_ops::set_antenna' offset changed from 4288 to 4352 (in bits) (by +64 bits)
    'int (wiphy*, u32*, u32*)* cfg80211_ops::get_antenna' offset changed from 4352 to 4416 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_sched_scan_request*)* cfg80211_ops::sched_scan_start' offset changed from 4416 to 4480 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u64)* cfg80211_ops::sched_scan_stop' offset changed from 4480 to 4544 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_gtk_rekey_data*)* cfg80211_ops::set_rekey_data' offset changed from 4544 to 4608 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, typedef u8, typedef u8, typedef u16, typedef u32, typedef bool, const u8*, typedef size_t)* cfg80211_ops::tdls_mgmt' offset changed from 4608 to 4672 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, enum nl80211_tdls_operation)* cfg80211_ops::tdls_oper' offset changed from 4672 to 4736 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, u64*)* cfg80211_ops::probe_client' offset changed from 4736 to 4800 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u16)* cfg80211_ops::set_noack_map' offset changed from 4800 to 4864 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_chan_def*)* cfg80211_ops::get_channel' offset changed from 4864 to 4928 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*)* cfg80211_ops::start_p2p_device' offset changed from 4928 to 4992 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*)* cfg80211_ops::stop_p2p_device' offset changed from 4992 to 5056 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const cfg80211_acl_data*)* cfg80211_ops::set_mac_acl' offset changed from 5056 to 5120 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_chan_def*, typedef u32)* cfg80211_ops::start_radar_detection' offset changed from 5120 to 5184 (in bits) (by +64 bits)
    'void (wiphy*, net_device*)* cfg80211_ops::end_cac' offset changed from 5184 to 5248 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_update_ft_ies_params*)* cfg80211_ops::update_ft_ies' offset changed from 5248 to 5312 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, enum nl80211_crit_proto_id, typedef u16)* cfg80211_ops::crit_proto_start' offset changed from 5312 to 5376 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*)* cfg80211_ops::crit_proto_stop' offset changed from 5376 to 5440 (in bits) (by +64 bits)
    'int (wiphy*, cfg80211_coalesce*)* cfg80211_ops::set_coalesce' offset changed from 5440 to 5504 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_csa_settings*)* cfg80211_ops::channel_switch' offset changed from 5504 to 5568 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_qos_map*)* cfg80211_ops::set_qos_map' offset changed from 5568 to 5632 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_chan_def*)* cfg80211_ops::set_ap_chanwidth' offset changed from 5632 to 5696 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u8, const u8*, typedef u8, typedef u16)* cfg80211_ops::add_tx_ts' offset changed from 5696 to 5760 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, typedef u8, const u8*)* cfg80211_ops::del_tx_ts' offset changed from 5760 to 5824 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, typedef u8, cfg80211_chan_def*)* cfg80211_ops::tdls_channel_switch' offset changed from 5824 to 5888 (in bits) (by +64 bits)
    'void (wiphy*, net_device*, const u8*)* cfg80211_ops::tdls_cancel_channel_switch' offset changed from 5888 to 5952 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_nan_conf*)* cfg80211_ops::start_nan' offset changed from 5952 to 6016 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*)* cfg80211_ops::stop_nan' offset changed from 6016 to 6080 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_nan_func*)* cfg80211_ops::add_nan_func' offset changed from 6080 to 6144 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*, typedef u64)* cfg80211_ops::del_nan_func' offset changed from 6144 to 6208 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_nan_conf*, typedef u32)* cfg80211_ops::nan_change_conf' offset changed from 6208 to 6272 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const bool)* cfg80211_ops::set_multicast_to_unicast' offset changed from 6272 to 6336 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_txq_stats*)* cfg80211_ops::get_txq_stats' offset changed from 6336 to 6400 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const cfg80211_pmk_conf*)* cfg80211_ops::set_pmk' offset changed from 6400 to 6464 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*)* cfg80211_ops::del_pmk' offset changed from 6464 to 6528 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_external_auth_params*)* cfg80211_ops::external_auth' offset changed from 6528 to 6592 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, typedef size_t, const u8*, const __be16, const bool)* cfg80211_ops::tx_control_port' offset changed from 6592 to 6656 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_ftm_responder_stats*)* cfg80211_ops::get_ftm_responder_stats' offset changed from 6656 to 6720 (in bits) (by +64 bits)
    'int (wiphy*, wireless_dev*, cfg80211_pmsr_request*)* cfg80211_ops::start_pmsr' offset changed from 6720 to 6784 (in bits) (by +64 bits)
    'void (wiphy*, wireless_dev*, cfg80211_pmsr_request*)* cfg80211_ops::abort_pmsr' offset changed from 6784 to 6848 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, cfg80211_update_owe_info*)* cfg80211_ops::update_owe_info' offset changed from 6848 to 6912 (in bits) (by +64 bits)
    'int (wiphy*, net_device*, const u8*, typedef size_t)* cfg80211_ops::probe_mesh_link' offset changed from 6912 to 6976 (in bits) (by +64 bits)
  one impacted interface

'struct cfg80211_pmksa at cfg80211.h:2624:1' changed:
  type size changed from 448 to 512 (in bits)
  2 data member insertions:
    'u32 cfg80211_pmksa::pmk_lifetime', at offset 448 (in bits) at cfg80211.h:2690:1
    'u8 cfg80211_pmksa::pmk_reauth_threshold', at offset 480 (in bits) at cfg80211.h:2691:1
  one impacted interface

'struct key_params at cfg80211.h:570:1' changed:
  type size changed from 256 to 320 (in bits)
  1 data member insertion:
    'u16 key_params::vlan_id', at offset 192 (in bits) at cfg80211.h:589:1
  there are data member changes:
    'u32 key_params::cipher' offset changed from 192 to 224 (in bits) (by +32 bits)
    'nl80211_key_mode key_params::mode' offset changed from 224 to 256 (in bits) (by +32 bits)
  55 impacted interfaces

'struct station_parameters at cfg80211.h:1155:1' changed:
  type size changed from 1152 to 1216 (in bits)
  1 data member insertion:
    'u16 station_parameters::vlan_id', at offset 272 (in bits) at cfg80211.h:1208:1
  there are data member changes:
    'u16 station_parameters::peer_aid' offset changed from 272 to 288 (in bits) (by +16 bits)
    'u8 station_parameters::supported_rates_len' offset changed from 288 to 304 (in bits) (by +16 bits)
    'u8 station_parameters::plink_action' offset changed from 296 to 312 (in bits) (by +16 bits)
    'u8 station_parameters::plink_state' offset changed from 304 to 320 (in bits) (by +16 bits)
    'const ieee80211_ht_cap* station_parameters::ht_capa' offset changed from 320 to 384 (in bits) (by +64 bits)
    'const ieee80211_vht_cap* station_parameters::vht_capa' offset changed from 384 to 448 (in bits) (by +64 bits)
    'u8 station_parameters::uapsd_queues' offset changed from 448 to 512 (in bits) (by +64 bits)
    'u8 station_parameters::max_sp' offset changed from 456 to 520 (in bits) (by +64 bits)
    'nl80211_mesh_power_mode station_parameters::local_pm' offset changed from 480 to 544 (in bits) (by +64 bits)
    'u16 station_parameters::capability' offset changed from 512 to 576 (in bits) (by +64 bits)
    'const u8* station_parameters::ext_capab' offset changed from 576 to 640 (in bits) (by +64 bits)
    'u8 station_parameters::ext_capab_len' offset changed from 640 to 704 (in bits) (by +64 bits)
    'const u8* station_parameters::supported_channels' offset changed from 704 to 768 (in bits) (by +64 bits)
    'u8 station_parameters::supported_channels_len' offset changed from 768 to 832 (in bits) (by +64 bits)
    'const u8* station_parameters::supported_oper_classes' offset changed from 832 to 896 (in bits) (by +64 bits)
    'u8 station_parameters::supported_oper_classes_len' offset changed from 896 to 960 (in bits) (by +64 bits)
    'u8 station_parameters::opmode_notif' offset changed from 904 to 968 (in bits) (by +64 bits)
    'bool station_parameters::opmode_notif_used' offset changed from 912 to 976 (in bits) (by +64 bits)
    'int station_parameters::support_p2p_ps' offset changed from 928 to 992 (in bits) (by +64 bits)
    'const ieee80211_he_cap_elem* station_parameters::he_capa' offset changed from 960 to 1024 (in bits) (by +64 bits)
    'u8 station_parameters::he_capa_len' offset changed from 1024 to 1088 (in bits) (by +64 bits)
    'u16 station_parameters::airtime_weight' offset changed from 1040 to 1104 (in bits) (by +64 bits)
    'sta_txpwr station_parameters::txpwr' offset changed from 1056 to 1120 (in bits) (by +64 bits)
  one impacted interface

'struct wiphy at cfg80211.h:4541:1' changed:
  type size changed from 10752 to 11008 (in bits)
  3 data member insertions:
    'const wiphy_iftype_akm_suites* wiphy::iftype_akm_suites', at offset 1088 (in bits) at cfg80211.h:4690:1
    'unsigned int wiphy::num_iftype_akm_suites', at offset 1152 (in bits) at cfg80211.h:4691:1
    'struct {u64 curr; u64 next;} wiphy::tid_config_support', at offset 10752 (in bits) at cfg80211.h:4792:1
  there are data member changes:
    type 'u8[5]' of 'wiphy::ext_features' changed:
      type name changed from 'u8[5]' to 'u8[6]'
      array type size changed from 40 to 48
      array type subrange 1 changed length from 5 to 6
    'u8 wiphy::retry_short' offset changed from 1088 to 1184 (in bits) (by +96 bits)
    'u8 wiphy::retry_long' offset changed from 1096 to 1192 (in bits) (by +96 bits)
    'u32 wiphy::frag_threshold' offset changed from 1120 to 1216 (in bits) (by +96 bits)
    'u32 wiphy::rts_threshold' offset changed from 1152 to 1248 (in bits) (by +96 bits)
    'u8 wiphy::coverage_class' offset changed from 1184 to 1280 (in bits) (by +96 bits)
    'char wiphy::fw_version[32]' offset changed from 1192 to 1288 (in bits) (by +96 bits)
    'u32 wiphy::hw_version' offset changed from 1472 to 1568 (in bits) (by +96 bits)
    'const wiphy_wowlan_support* wiphy::wowlan' offset changed from 1536 to 1600 (in bits) (by +64 bits)
    'cfg80211_wowlan* wiphy::wowlan_config' offset changed from 1600 to 1664 (in bits) (by +64 bits)
    'u16 wiphy::max_remain_on_channel_duration' offset changed from 1664 to 1728 (in bits) (by +64 bits)
    'u8 wiphy::max_num_pmkids' offset changed from 1680 to 1744 (in bits) (by +64 bits)
    'u32 wiphy::available_antennas_tx' offset changed from 1696 to 1760 (in bits) (by +64 bits)
    'u32 wiphy::available_antennas_rx' offset changed from 1728 to 1792 (in bits) (by +64 bits)
    'u32 wiphy::probe_resp_offload' offset changed from 1760 to 1824 (in bits) (by +64 bits)
    'const u8* wiphy::extended_capabilities' offset changed from 1792 to 1856 (in bits) (by +64 bits)
    'const u8* wiphy::extended_capabilities_mask' offset changed from 1856 to 1920 (in bits) (by +64 bits)
    'u8 wiphy::extended_capabilities_len' offset changed from 1920 to 1984 (in bits) (by +64 bits)
    'const wiphy_iftype_ext_capab* wiphy::iftype_ext_capab' offset changed from 1984 to 2048 (in bits) (by +64 bits)
    'unsigned int wiphy::num_iftype_ext_capab' offset changed from 2048 to 2112 (in bits) (by +64 bits)
    'void* wiphy::privid' offset changed from 2112 to 2176 (in bits) (by +64 bits)
    'ieee80211_supported_band* wiphy::bands[4]' offset changed from 2176 to 2240 (in bits) (by +64 bits)
    'void (wiphy*, regulatory_request*)* wiphy::reg_notifier' offset changed from 2432 to 2496 (in bits) (by +64 bits)
    'const ieee80211_regdomain* wiphy::regd' offset changed from 2496 to 2560 (in bits) (by +64 bits)
    'device wiphy::dev' offset changed from 2560 to 2624 (in bits) (by +64 bits)
    'bool wiphy::registered' offset changed from 9664 to 9728 (in bits) (by +64 bits)
    'dentry* wiphy::debugfsdir' offset changed from 9728 to 9792 (in bits) (by +64 bits)
    'const ieee80211_ht_cap* wiphy::ht_capa_mod_mask' offset changed from 9792 to 9856 (in bits) (by +64 bits)
    'const ieee80211_vht_cap* wiphy::vht_capa_mod_mask' offset changed from 9856 to 9920 (in bits) (by +64 bits)
    'list_head wiphy::wdev_list' offset changed from 9920 to 9984 (in bits) (by +64 bits)
    'possible_net_t wiphy::_net' offset changed from 10048 to 10112 (in bits) (by +64 bits)
    'const wiphy_coalesce_support* wiphy::coalesce' offset changed from 10112 to 10176 (in bits) (by +64 bits)
    'const wiphy_vendor_command* wiphy::vendor_commands' offset changed from 10176 to 10240 (in bits) (by +64 bits)
    'const nl80211_vendor_cmd_info* wiphy::vendor_events' offset changed from 10240 to 10304 (in bits) (by +64 bits)
    'int wiphy::n_vendor_commands' offset changed from 10304 to 10368 (in bits) (by +64 bits)
    'int wiphy::n_vendor_events' offset changed from 10336 to 10400 (in bits) (by +64 bits)
    'u16 wiphy::max_ap_assoc_sta' offset changed from 10368 to 10432 (in bits) (by +64 bits)
    'u8 wiphy::max_num_csa_counters' offset changed from 10384 to 10448 (in bits) (by +64 bits)
    'u8 wiphy::max_adj_channel_rssi_comp' offset changed from 10392 to 10456 (in bits) (by +64 bits)
    'u32 wiphy::bss_select_support' offset changed from 10400 to 10464 (in bits) (by +64 bits)
    'u8 wiphy::nan_supported_bands' offset changed from 10432 to 10496 (in bits) (by +64 bits)
    'u32 wiphy::txq_limit' offset changed from 10464 to 10528 (in bits) (by +64 bits)
    'u32 wiphy::txq_memory_limit' offset changed from 10496 to 10560 (in bits) (by +64 bits)
    'u32 wiphy::txq_quantum' offset changed from 10528 to 10592 (in bits) (by +64 bits)
    'const cfg80211_pmsr_capabilities* wiphy::pmsr_capa' offset changed from 10624 to 10688 (in bits) (by +64 bits)
    'char wiphy::priv[]' offset changed from 10752 to 11008 (in bits) (by +256 bits)
  55 impacted interfaces

Bug: 154782456
Cc: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iedf3fbe613b23059d976c3f8048818c6a89bc141
2020-06-30 14:42:18 +02:00
Veerendranath Jakkam
e1f28e7d04 BACKPORT: cfg80211: Configure PMK lifetime and reauth threshold for PMKSA entries
Drivers that trigger roaming need to know the lifetime of the configured
PMKSA for deciding whether to trigger the full or PMKSA cache based
authentication. The configured PMKSA is invalid after the PMK lifetime
has expired and must not be used after that and the STA needs to
disassociate if the PMK expires. Hence the STA is expected to refresh
the PMK with a full authentication before this happens (e.g., when
reassociating to a new BSS the next time or by performing EAPOL
reauthentication depending on the AKM) to avoid unnecessary
disconnection.

The PMK reauthentication threshold is the percentage of the PMK lifetime
value and indicates to the driver to trigger a full authentication roam
(without PMKSA caching) after the reauthentication threshold time, but
before the PMK timer has expired. Authentication methods like SAE need
to be able to generate a new PMKSA entry without having to force a
disconnection after this threshold timeout. If no roaming occurs between
the reauthentication threshold time and PMK lifetime expiration,
disassociation is still forced.

The new attributes for providing these values correspond to the dot11
MIB variables dot11RSNAConfigPMKLifetime and
dot11RSNAConfigPMKReauthThreshold.

This type of functionality is already available in cases where user
space component is in control of roaming. This commit extends that same
capability into cases where parts or all of this functionality is
offloaded to the driver.

Bug: 154782456
Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Link: https://lore.kernel.org/r/20200312235903.18462-1-jouni@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: I899c14543653d3620e63dbf40f1dfde7b1b48512
(cherry picked from commit 7fc82af856d6bc26910902f8f42659b162864955)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Markus Theil
2d0e01ce46 BACKPORT: nl80211: add no pre-auth attribute and ext. feature flag for ctrl. port
If the nl80211 control port is used before this patch, pre-auth frames
(0x88c7) are send to userspace uncoditionally. While this enables userspace
to only use nl80211 on the station side, it is not always useful for APs.
Furthermore, pre-auth frames are ordinary data frames and not related to
the control port. Therefore it should for example be possible for pre-auth
frames to be bridged onto a wired network on AP side without touching
userspace.

For backwards compatibility to code already using pre-auth over nl80211,
this patch adds a feature flag to disable this behavior, while it remains
enabled by default. An additional ext. feature flag is added to detect this
from userspace.

Thanks to Jouni for pointing out, that pre-auth frames should be handled as
ordinary data frames.

Bug: 154782456
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
Link: https://lore.kernel.org/r/20200312091055.54257-2-markus.theil@tu-ilmenau.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: Ibb7e0a635d124881f9af9fafe5e5853a0c0a18a4
(cherry picked from commit 5631d96aa396d75b99bf522750a5a8378337aefc)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Johannes Berg
dc58762f12 BACKPORT: nl80211: modify TID-config API
Make some changes to the TID-config API:
 * use u16 in nl80211 (only, and restrict to using 8 bits for now),
   to avoid issues in the future if we ever want to use higher TIDs.
 * reject empty TIDs mask (via netlink policy)
 * change feature advertising to not use extended feature flags but
   have own mechanism for this, which simplifies the code
 * fix all variable names from 'tid' to 'tids' since it's a mask
 * change to cfg80211_ name prefixes, not ieee80211_
 * fix some minor docs/spelling things.

Bug: 154782456
Change-Id: Ia234d464b3f914cdeab82f540e018855be580dce
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 3710a8a6284f58a78ba4fe9c4b6672207636a223)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Tamizh chelvam
7a59f8cab6 BACKPORT: nl80211: Add NL command to support TID speicific configurations
Add the new NL80211_CMD_SET_TID_CONFIG command to support
data TID specific configuration. Per TID configuration is
passed in the nested NL80211_ATTR_TID_CONFIG attribute.

This patch adds support to configure per TID noack policy
through the NL80211_TID_CONFIG_ATTR_NOACK attribute.

Bug: 154782456
Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
Link: https://lore.kernel.org/r/1579506687-18296-2-git-send-email-tamizhr@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: Ia2e2c125aaba64571453838baac052014e386cd6
(cherry picked from commit 77f576deaa393b54a0f2ca8ab1ab5b2d3c6b971b)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Jouni Malinen
02d9f7e316 BACKPORT: cfg80211: Support key configuration for Beacon protection (BIGTK)
IEEE P802.11-REVmd/D3.0 adds support for protecting Beacon frames using
a new set of keys (BIGTK; key index 6..7) similarly to the way
group-addressed Robust Management frames are protected (IGTK; key index
4..5). Extend cfg80211 and nl80211 to allow the new BIGTK to be
configured. Add an extended feature flag to indicate driver support for
the new key index values to avoid array overflows in driver
implementations and also to indicate to user space when this
functionality is available.

Bug: 154782456
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Link: https://lore.kernel.org/r/20200222132548.20835-2-jouni@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: I108164b597c46d0f94fc44cbb030cb8c5cd21773
(cherry picked from commit 56be393fa8b40db2d4f54f97614f645eb8d3c32e)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Jouni Malinen
c971963639 BACKPORT: cfg80211: More error messages for key addition failures
These were helpful while working with extensions to NL80211_CMD_NEW_KEY,
so add more explicit error reporting for additional cases that can fail
while that command is being processed.

Bug: 154782456
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Link: https://lore.kernel.org/r/20200222132548.20835-1-jouni@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: Ia23707c4e47a3bf8469046ac61cc3e59c20f5da9
(cherry picked from commit f8af764bf1cb86bed615baae84e3bbb6e4d3912d)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Veerendranath Jakkam
67a67ac328 BACKPORT: cfg80211: Enhance the AKM advertizement to support per interface.
Commit ab4dfa2053 ("cfg80211: Allow drivers to advertise supported AKM
suites") introduces the support to advertize supported AKMs to userspace.

This needs an enhancement to advertize the AKM support per interface type,
specifically for the cfg80211-based drivers that implement SME and use
different mechanisms to support the AKM's for each interface type (e.g.,
the support for SAE, OWE AKM's take different paths for such drivers on
STA/AP mode).

This commit aims the same and enhances the earlier mechanism of advertizing
the AKMs per wiphy. Add new nl80211 attributes and data structure to
provide supported AKMs per interface type to userspace.

the AKMs advertized in akm_suites are default capabilities if not
advertized for a specific interface type in iftype_akm_suites.

Bug: 154782456
Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
Link: https://lore.kernel.org/r/20200126203032.21934-1-vjakkam@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: I928d355e6cfd85609261e0efbf2e9272da65ba2c
(cherry picked from commit d6039a3416f7af37c04f22c411f120ad46f51663)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
John Crispin
92a63a3d99 BACKPORT: nl80211: add handling for BSS color
This patch adds the attributes, policy and parsing code to allow userland
to send the info about the BSS coloring settings to the kernel.

Bug: 154782456
Signed-off-by: John Crispin <john@phrozen.org>
Link: https://lore.kernel.org/r/20191217141921.8114-1-john@phrozen.org
[johannes: remove the strict policy parsing, that was a misunderstanding]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: Ib24133d6825ef455819f697de6d9d67c856c315e
(cherry picked from commit 5c5e52d1bb962510fecdc1ebecdde89694d1b223)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Gurumoorthi Gnanasambandhan
50635d9eba BACKPORT: cfg80211: VLAN offload support for set_key and set_sta_vlan
This provides an alternative mechanism for AP VLAN support where a
single netdev is used with VLAN tagged frames instead of separate
netdevs for each VLAN without tagged frames from the WLAN driver.

By setting NL80211_EXT_FEATURE_VLAN_OFFLOAD flag the driver indicates
support for a single netdev with VLAN tagged frames. Separate
VLAN-specific netdevs can be added using RTM_NEWLINK/IFLA_VLAN_ID
similarly to Ethernet. NL80211_CMD_NEW_KEY (for group keys),
NL80211_CMD_NEW_STATION, and NL80211_CMD_SET_STATION will optionally
specify vlan_id using NL80211_ATTR_VLAN_ID.

Bug: 154782456
Signed-off-by: Gurumoorthi Gnanasambandhan <gguru@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Link: https://lore.kernel.org/r/20191031214640.5012-1-jouni@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: I74c0d2664b1dbe5846a62a433754693a2ead9f2a
(cherry picked from commit 14f34e36b36ceede9877ca422a62fcac17b52023)
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-30 14:28:41 +02:00
Eric Biggers
9d21bcd489 Revert "ANDROID: fscrypt: add key removal notifier chain"
This reverts commit 98261f39e9
because it was only needed for sdcardfs, which has now been removed.

Bug: 157700134
Bug: 142275883
Change-Id: Iaf22521ef47d48ce9c9c0604a8b2412e3b8c1faa
Signed-off-by: Eric Biggers <ebiggers@google.com>
2020-06-29 18:26:35 +00:00
Stanley Chu
ee48a99fff UPSTREAM: scsi: ufs: Fix imprecise load calculation in devfreq window
The UFS load calculation is based on "total_time" and "busy_time" in a
devfreq window.  However, the source of time is different for both
parameters: "busy_time" is assigned from "jiffies" thus has different
accuracy from "total_time" which is assigned from ktime_get().

In addition, the time of window boundary is not exactly the same as the
starting busy time in this window if UFS is actually busy in the beginning
of the window. A similar accuracy error may also happen for the end of busy
time in current window.

To guarantee the precision of load calculation, we need to

1. Align time accuracy of both devfreq_dev_status.total_time and
   devfreq_dev_status.busy_time. For example, use "ktime_get()" directly.

2. Align the following timelines:
   - The beginning time of devfreq windows
   - The beginning of busy time in a new window
   - The end of busy time in the current window

Link: https://lore.kernel.org/r/20200611101043.6379-1-stanley.chu@mediatek.com
Fixes: a3cd5ec55f ("scsi: ufs: add load based scaling of UFS gear")
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit b1bf66d1d5a8fcb54f0e584db5d196ef015b5172)
Change-Id: I9610fade4f426973b1c95a3621d0bd2b51543846
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
03911e93a0 UPSTREAM: scsi: ufs: Add trace event for UIC commands
Use the ftrace infrastructure to conditionally trace UFS UIC command
events.

New trace event "ufshcd_uic_command" is created, which samples the
following UFS UIC command data:

 - Device name
 - Optional identification string
 - UIC command opcode
 - UIC command argument1
 - UIC command argument2
 - UIC command argement3

Usage:
	echo 1 > /sys/kernel/debug/tracing/events/ufs/enable
	cat /sys/kernel/debug/tracing/trace_pipe

Link: https://lore.kernel.org/r/20200615072235.23042-3-stanley.chu@mediatek.com
Acked-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit aa5c697988b4c7e1077de1e2eb2298114d531736)
Change-Id: I23652110c51d7cd04f9e9c565f67654325e11e9d
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
95821c4676 UPSTREAM: scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices
It is confirmed that Micron device needs DELAY_BEFORE_LPM quirk to have a
delay before VCC is powered off. Sdd Micron vendor ID and this quirk for
Micron devices.

Link: https://lore.kernel.org/r/20200612012625.6615-2-stanley.chu@mediatek.com
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit c0a18ee0ce78d7957ec1a53be35b1b3beba80668)
Change-Id: Ib69fd30291227daba77f6955955fc047b0ec27b8
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
ec9cb276d9 UPSTREAM: scsi: ufs-mediatek: Allow unbound mphy
Allow unbound MPHY module since not every MediaTek UFS platform needs
specific MPHY control.

Link: https://lore.kernel.org/r/20200601104646.15436-6-stanley.chu@mediatek.com
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit fc4983018fea1237e027a9fc6530a3e04850fbfa)
Change-Id: Ie79d90079976129e37ac99c6b7e2d9b172ebdc73
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
332ca84ae3 UPSTREAM: scsi: ufs-mediatek: Fix unbalanced clock on/off
MediaTek UFS clocks are separated to two parts and controlled by different
modules: ufs-mediatek and phy-ufs-mediatek.

If both Auto-Hibern8 and clk-gating feature are enabled, mphy power control
is not balanced thus unbalanced control also happens to the clocks probed
by phy-ufs-mediatek module.

Fix this issue by:

 - Promise usage of phy_power_on/off balanced

 - Remove phy_power_on/off control in suspend/resume vops since both can be
   handled in setup_clock vops only

Link: https://lore.kernel.org/r/20200601104646.15436-5-stanley.chu@mediatek.com
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 561e3a8726b2dd94ce75cad6c9cab211551f368a)
Change-Id: I9d304e895a07c5e672a6b29e9c8d23edaeaf8a08
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
e957d1ef81 UPSTREAM: scsi: ufs-mediatek: Introduce low-power mode for device power supply
Allow device power supply to enter low-power mode.

Link: https://lore.kernel.org/r/20200601104646.15436-4-stanley.chu@mediatek.com
Reviewed-by: Pengshun Zhao <pengshun.zhao@mediatek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 488edafb1120f715bebd80b6fe4089f83fb082b2)
Change-Id: Ibe3cd1f11305656f7c597940b75e0c6d71c4a802
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
c214857a9e UPSTREAM: scsi: ufs-mediatek: Do not gate clocks if auto-hibern8 is not entered yet
There is a chance that link enters hibern8 via auto-hibern8 scheme during
the clock-gating flow. Clocks shall not be gated if link is still active
otherwise host or device may hang.

Fix this by returning error code to the caller __ufshcd_setup_clocks() to
skip gating clocks there if link is not confirmed in hibern8 state yet.

Also allow some waiting time for the hibern8 state transition.

Link: https://lore.kernel.org/r/20200601104646.15436-3-stanley.chu@mediatek.com
Reviewed-by: Andy Teng <andy.teng@mediatek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 9006e3986f6689897c2f1ede2671656b1cb41582)
Change-Id: Ieeccc13fd1f05463344c8f746ba7aa8ff172cd1a
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
767e264476 UPSTREAM: scsi: ufs-mediatek: Fix imprecise waiting time for ref-clk control
Currently ref-clk control timeout is implemented by jiffies. However
jiffies is not accurate enough thus "false timeout" may happen.

Use more accurate delay mechanism instead, i.e. ktime.

Link: https://lore.kernel.org/r/20200601104646.15436-2-stanley.chu@mediatek.com
Reviewed-by: Andy Teng <andy.teng@mediatek.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit c0a18ee0ce78d7957ec1a53be35b1b3beba80668)
Change-Id: I08b6204db64bcf52d9f32ebdb23c168a8b1e88af
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
f05b5ebadf BACKPORT: scsi: ufs: Disable WriteBooster capability in non-supported UFS device
If UFS device is not qualified to enter the detection of WriteBooster
probing by disallowed UFS version or device quirks, then WriteBooster
capability in host shall be disabled to prevent any WriteBooster
operations in the future.

Link: https://lore.kernel.org/linux-arm-kernel/20200625030430.25048-1-stanley.chu@mediatek.com/
Fixes: 3d17b9b5ab11 ("scsi: ufs: Add write booster feature support")
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Tested-by: Jami Kettunen <jamipkettunen@gmail.com>
Tested-by: Steev Klimaszewski <steev@kali.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>

Bug: 151050916
[ Resolved minor conflict in drivers/scsi/ufs/ufshcd.c ]
(cherry picked from commit a7f1e69d4974666ea40886ee4801aebb2729ea81)
Change-Id: Icb60f39cc5ecf21399e7ff96b30c594fb8667501
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
7d7025426c BACKPORT: scsi: ufs: Fix WriteBooster flush during runtime suspend
Currently UFS host driver promises VCC supply if UFS device needs to do
WriteBooster flush during runtime suspend.

However the UFS specification mentions:

"While the flushing operation is in progress, the device is in Active power
mode."

Therefore UFS host driver needs to promise more: Keep UFS device as "Active
power mode", otherwise UFS device shall not do any flush if device enters
Sleep or PowerDown power mode.  Similarly, the same promises shall be
applied if device needs urgent BKOP during runtime suspend.

Fix this by not changing device power mode if WriteBooster flush or urgent
BKOP is required in ufshcd_suspend().

Now, if device finishes its job but is not resumed for a very long time,
system will have unnecessary power drain because VCC is still supplied. A
method to re-check the threshold of keeping VCC supply is required to fix
the power drain. However, the threshold re-check needs to re-activate the
link first because the decision depends on the latest device status.

Also introduce a delayed work to force runtime resume after a certain delay
during runtime suspend. This makes threshold re-check happen natually in
the entry of the next runtime-suspend. The device can continue its
WriteBooster flush or urgent BKOP jobs soon after resumed if device has no
upcoming requests and link enters hibern8 state either by Auto-Hibern8 or
hibern8 during clk-gating scheme. This solution not only prevents power
drain but also makes as much use of time as possible for device's
background jobs.

Link: https://lore.kernel.org/r/20200522083212.4008-5-stanley.chu@mediatek.com
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 51dd905bd2f617f5d6e60273bb5f0940bbd86611)
[ Resolved minor conflict in drivers/scsi/ufs/ufshcd.c ]
[ Resolved minor conflict in drivers/scsi/ufs/ufshcd.h ]
Change-Id: I5dcc9889b732a29d0c1db093ffc86f4445c50c69
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
f9e7e458ec BACKPORT: scsi: ufs: Fix index of attributes query for WriteBooster feature
For WriteBooster feature related attributes, the index used by query shall
be LUN ID if LU Dedicated buffer mode is enabled.

Link: https://lore.kernel.org/r/20200522083212.4008-4-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit e31011ab370989022abf216c606f947a3b02a53a)
[ Resolved minor conflict in drivers/scsi/ufs/ufs-sysfs.c ]
Change-Id: Ic32b2a0d821b66c4631c57b90f76ec25cec647c7
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:30 +02:00
Stanley Chu
3b7a80ece8 BACKPORT: scsi: ufs: Allow WriteBooster on UFS 2.2 devices
According to the UFS specification, WriteBooster is officially supported by
UFS 2.2.

Since UFS 2.2 specification has been finalized in JEDEC and such devices
have also showed up in the market, modify the checking rule for
ufshcd_wb_probe() to allow these devices to enable WriteBooster.

Link: https://lore.kernel.org/r/20200522083212.4008-3-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit c7cee3e746a5b5a79d415112f7b7af90e8259fa1)
[ Resolved minor conflict in drivers/scsi/ufs/ufshcd.c ]
Change-Id: Ifce7223b8892b6c0cd7f4635e96b103a86be4556
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
Stanley Chu
43dcb17356 UPSTREAM: scsi: ufs-mediatek: Customize WriteBooster flush policy
Change the WriteBooster policy to keep VCC on during runtime suspend if
available WriteBooster buffer is less than 80%.

Link: https://lore.kernel.org/r/20200509093716.21010-5-stanley.chu@mediatek.com
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit f48b285ae658b50f4ba2d3a267522f572720de6d)
Change-Id: I552f19b2806b5819a49ffff02768c2a5afa4cec7
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
Stanley Chu
7e6050a292 UPSTREAM: scsi: ufs: Customize flush threshold for WriteBooster
Allow flush threshold for WriteBooster to be customizable by vendors. To
achieve this, make the value a variable in struct ufs_hba_variant_params.

Also introduce UFS_WB_BUF_REMAIN_PERCENT() macro to provide a more flexible
way to specify WriteBooster available buffer values.

Link: https://lore.kernel.org/r/20200509093716.21010-4-stanley.chu@mediatek.com
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit d14734ae3ae79d3b0286a2431782054e5066da8f)
Change-Id: I6ff47b50d2f83c66ac541c8a1b6206a688662037
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
Stanley Chu
79ec7f2998 BACKPORT: scsi: ufs: Introduce ufs_hba_variant_params to group customizable parameters
The UFS driver is growing more and more customizable parameters. Collect
them in one place.

Link: https://lore.kernel.org/r/20200509093716.21010-2-stanley.chu@mediatek.com
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 90b8491c0033915ec1b290bc1c0de27935cb132d)
[ Resolved minor conflict in drivers/scsi/ufs/ufshcd.h ]
Change-Id: I6bddf3e39b38714db0053c606e75dd4d6fb4d0be
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
ChenTao
f3fe388ed3 UPSTREAM: scsi: ufs-mediatek: Make ufs_mtk_fixup_dev_quirks static
Fix the following warning:

drivers/scsi/ufs/ufs-mediatek.c:585:6: warning:
symbol 'ufs_mtk_fixup_dev_quirks' was not declared. Should it be static?

Link: https://lore.kernel.org/r/20200514012655.127202-1-chentao107@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: ChenTao <chentao107@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 21d2b76831fdee3754eeee995e15080098603ec5)
Change-Id: If5b822770ffc8c8798d1df05f48471895fa65e7a
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
Stanley Chu
a75bb43401 UPSTREAM: scsi: ufs: Cleanup WriteBooster feature
Small cleanup as below items,

 1. Use ufshcd_is_wb_allowed() directly instead of ufshcd_wb_sup() since
    ufshcd_wb_sup() just returns the result of ufshcd_is_wb_allowed().

 2. In ufshcd_suspend(), "else if (!ufshcd_is_runtime_pm(pm_op)) can be
    simplified to "else" since both have the same meaning.

This patch does not change any functionality.

Link: https://lore.kernel.org/r/20200508080115.24233-9-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 79e3520f82cb91e46e7db1af14ad916d6036dde8)
Change-Id: I7329575ba3ddce6976072c91570a71f1bbbbe92f
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
Stanley Chu
3ea1305d5a UPSTREAM: scsi: ufs-mediatek: Enable WriteBooster capability
Enable WriteBooster capability on MediaTek UFS platforms.

Link: https://lore.kernel.org/r/20200508080115.24233-8-stanley.chu@mediatek.com
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 29060a629135a00414d6ea3fbb246a114898f4be)
Change-Id: I1c5879a0601b38c2402b20c7a2e1f21d818f0987
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
Stanley Chu
1d3b062a35 BACKPORT: scsi: ufs: Add LU Dedicated buffer mode support for WriteBooster
According to UFS specification, there are two WriteBooster mode of
operations: "LU dedicated buffer" mode and "shared buffer" mode.  In the
"LU dedicated buffer" mode, the WriteBooster Buffer is dedicated to a
logical unit.

If the device supports the "LU dedicated buffer" mode, this mode is
configured by setting bWriteBoosterBufferType to 00h. The logical unit
WriteBooster Buffer size is configured by setting the
dLUNumWriteBoosterBufferAllocUnits field of the related Unit
Descriptor. Only a value greater than zero enables the WriteBooster feature
in the logical unit.

Modify ufshcd_wb_probe() as above description to support LU Dedicated
buffer mode.

Note that according to UFS 3.1 specification, the valid value of
bDeviceMaxWriteBoosterLUs parameter in Geometry Descriptor is 1, which
means at most one LUN can have WriteBooster buffer in "LU dedicated buffer
mode". Therefore this patch supports only one LUN with WriteBooster
enabled. All WriteBooster related sysfs nodes are specifically mapped to
the LUN with WriteBooster enabled in LU Dedicated buffer mode.

Link: https://lore.kernel.org/r/20200508080115.24233-7-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit d30293f721dde69a902789cff77a1fa27ec0e4ce)
[ Resolved minor conflict in drivers/scsi/ufs/ufs.h ]
[ Resolved minor conflict in drivers/scsi/ufs/ufs-sysfs.c ]
Change-Id: I4724647a45095e78421954beabc3732781166fe6
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
Stanley Chu
003f641e09 BACKPORT: scsi: ufs: Add "index" in parameter list of ufshcd_query_flag()
For preparation of LU Dedicated buffer mode support on WriteBooster
feature, "index" parameter shall be added and allowed to be specified by
callers.

Link: https://lore.kernel.org/r/20200508080115.24233-6-stanley.chu@mediatek.com
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Can Guo <cang@codeaurora.org>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 1f34eedf9bc15d238aece3308aba0a21a1ef5fe2)
[ Resolved minor conflict in drivers/scsi/ufs/ufshcd.c ]
[ Resolved minor conflict in drivers/scsi/ufs/ufs-sysfs.c ]
Change-Id: I81f0d6c5b66d1b6733bedd3151a7784529b5bc3f
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
Stanley Chu
5698f58e2f UPSTREAM: scsi: ufs-mediatek: Add fixup_dev_quirks vops
Add fixup_dev_quirk vops in MediaTek UFS platforms and provide an initial
vendor-specific device quirk table.

Link: https://lore.kernel.org/r/20200508080115.24233-5-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 62c2f503b54cd17bc4ad7b929354923012375f73)
Change-Id: I5451ab84d736f0e990547b5872a4ac10ebc939e2
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
Stanley Chu
38eebefa26 UPSTREAM: scsi: ufs: Export ufs_fixup_device_setup() function
Export ufs_fixup_device_setup() to allow vendors to re-use it for fixing
device quriks on specified UFS hosts.

Link: https://lore.kernel.org/r/20200508080115.24233-4-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit 8db269a5102eabfb05f4207f90e0a022caf7b804)
Change-Id: Ia29cf3947d1722944bdc023544169208e023c85f
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
Stanley Chu
dcda3bd59f BACKPORT: scsi: ufs: Introduce fixup_dev_quirks vops
Some UFS deivces may have required device quirks or have non-standard
features which are enabled only on specified UFS hosts or for special
customers.

To not "pollute" common device quirk list, i.e. ufs_fixups table, for those
devices mentioned above, introduce "fixup_dev_quirks" vops to allow vendors
to fix or modify device quirks accordingly.

Link: https://lore.kernel.org/r/20200508080115.24233-3-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 151050916
(cherry picked from commit c28c00ba4f060949c2f461f08a4aa10024a40672)
[ Resolved minor conflict in drivers/scsi/ufs/ufshcd.h ]
Change-Id: I0317f26b92c6b14569f4081937b662195e62b905
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
Stanley Chu
e854924b25 UPSTREAM: scsi: ufs-mediatek: add error recovery for suspend and resume
Once fail happens during suspend and resume flow if the desired low power
link state is H8, link recovery is required for MediaTek UFS controller.

For resume flow, since power and clocks are already enabled before invoking
vendor's resume callback, simply using ufshcd_link_recovery() inside
callback is fine.

For suspend flow, the device power enters low power mode or is disabled
before suspend callback, thus ufshcd_link_recovery() can not be directly
used in vendor callback. One solution is to set the link to off state and
then ufshcd_host_reset_and_restore() will be executed by ufshcd_suspend().

Bug: 151050916
Change-Id: I135c223a30c63e9af714ae3a3bbb950fcc0bd4c2
(cherry picked from commit 8033824bbf3c15e6321045a3f51d6f6947d89d47)
Link: https://lore.kernel.org/r/20200327095329.10083-3-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:29 +02:00
Stanley Chu
77c34d5327 UPSTREAM: scsi: ufs: export ufshcd_link_recovery
Export ufshcd_link_recovery to allow vendors to recover failed link in
vendor's callbacks.

Bug: 151050916
Change-Id: Id69485882f0943e71db06286fbe171ac9fe3a4b2
(cherry picked from commit 087c5efafa48661ac98184fbf8826a1a79dc5784)
Link: https://lore.kernel.org/r/20200327095329.10083-2-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:28 +02:00
Stanley Chu
ca2a30f1ae UPSTREAM: scsi: ufs-mediatek: customize the delay for enabling host
MediaTek platform and UFS controller can dynamically customize the delay
for host enabling according to different scenarios.

For example, if UniPro enters lower-power mode, such delay can be
minimized, otherwise longer delay shall be expected.

Bug: 151050916
Change-Id: I7113dedcc8750ddbdea69c3cd9a65045469578a7
(cherry picked from commit 73e990b4244d13599f093eab00f48d8172bbf9af)
Link: https://lore.kernel.org/r/20200318104016.28049-8-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:28 +02:00
Stanley Chu
b55279445b UPSTREAM: scsi: ufs: make HCE polling more compact to improve initialization latency
Reduce the waiting period between each HCE (Host Controller Enable) polling
from 5 ms to 1 ms. Also increase the maximum polling times to make "total
polling time" roughly the same.

This change could make HCE initialization faster to improve latency of
ufshcd initialization, error recovery, and resume behaviors.

Bug: 151050916
Change-Id: Iad45c46387fc63b723e7e10d2100eac667130272
(cherry picked from commit 9fc305ef8eb583b3139643f90abbe38d1c2412ce)
Link: https://lore.kernel.org/r/20200318104016.28049-7-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:28 +02:00
Stanley Chu
bc215bc7f4 BACKPORT: scsi: ufs: allow custom delay prior to host enabling
Currently a 1 ms delay is applied before polling CONTROLLER_ENABLE
bit. This delay may not be required or can be changed in different
controllers. Make the delay as a changeable value in struct ufs_hba to
allow it customized by vendors.

Bug: 151050916
Change-Id: I7b7551669bd63c38874c3e6f229dcf61a6b91695
(cherry picked from commit b9dc8aca2899fb494d66b6c5f50c25563d1636a7)
[ Resolved minor conflict in drivers/scsi/ufs/ufshcd.h ]
Link: https://lore.kernel.org/r/20200318104016.28049-6-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:28 +02:00
Stanley Chu
63350d1025 UPSTREAM: scsi: ufs-mediatek: use common delay function
A common delay function is introduced in UFS core driver, thus ufs-mediatek
can use it instead of the private delay function.

Bug: 151050916
Change-Id: I531c43d56c7da92db752de047044161b5ec14547
(cherry picked from commit c2f755d2c904717ff62119b54b2e1f783884a16c)
Link: https://lore.kernel.org/r/20200318104016.28049-5-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:28 +02:00
Stanley Chu
c25f60d280 UPSTREAM: scsi: ufs: introduce common and flexible delay function
Introduce a common delay function to provide flexible way for users to take
choices of udelay and usleep_range into consideration according to the
required delay time.

Bug: 151050916
Change-Id: I8d3a22b3eec523933ced54db1ab024d33e871ce0
(cherry picked from commit 5c955c10d0c26eb920f9cfad11adb58c93f666a0)
Link: https://lore.kernel.org/r/20200318104016.28049-4-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:28 +02:00
Stanley Chu
058a7d0395 UPSTREAM: scsi: ufs: fix uninitialized tx_lanes in ufshcd_disable_tx_lcc()
In ufshcd_disable_tx_lcc(), if ufshcd_dme_get() or ufshcd_dme_peer_get()
get fail, uninitialized variable "tx_lanes" may be used as unexpected lane
ID for DME configuration.

Fix this issue by initializing "tx_lanes".

Bug: 151050916
Change-Id: Id347f4b47976a90e90ebd066c6f5d209f7155769
(cherry picked from commit ba0320fbb809de541a9b396e153171151607bac8)
Link: https://lore.kernel.org/r/20200318104016.28049-2-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Can Guo <cang@codeaurora.org>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:28 +02:00
Stanley Chu
8880ad4916 UPSTREAM: scsi: ufs-mediatek: fix HOST_PA_TACTIVATE quirk for Samsung UFS Devices
Device quirk "UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE" is enabled for all
Samsung devices by default currently.

However MediaTek UFS host requires different host PA_TACTIVATE
configuration. Hence clear this quirk first and then apply vendor-specific
value in vops callback.

Bug: 151050916
Change-Id: Icae52601cebf3416ad48a3dcc1b6b5223dec50a1
(cherry picked from commit 47d054580a75b7d14d275a76146ce2f41bc16a81)
Link: https://lore.kernel.org/r/20200302135346.16797-1-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:28 +02:00
Bean Huo
0f30b1ed21 BACKPORT: scsi: ufs: Add max_lu_supported in struct ufs_dev_info
Add one new parameter max_lu_supported in struct ufs_dev_info, which will
be used to express exactly how many general LUs being supported by UFS
device, and initialize it during booting stage.  This patch also adds a new
function ufshcd_device_geo_params_init() for initialization of UFS device
geometry descriptor related parameters.

Bug: 151050916
(cherry picked from commit 731f06216df3d605c466571a1c89222b4cca2fbc)
[ Resolved minor conflict in drivers/scsi/ufs/ufshcd.c ]
Change-Id: I2f407c726e5fe5e230c9f93075cd34b5b249b96a
Link: https://lore.kernel.org/r/20200120130820.1737-8-huobean@gmail.com
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-06-29 16:12:28 +02:00
Greg Kroah-Hartman
7b096eac4f ANDROID: GKI: remove ufshcd_* exports from whitelists
These are not needed to be exported anymore now that all drivers that
use them are built into the kernel image.

Bug: 157965270
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I098f1a280060b14133613312ebd84436376fb729
2020-06-29 14:12:18 +02:00
Greg Kroah-Hartman
11b71f23d9 ANDROID: GKI: enable CONFIG_SCSI_UFS_DWC_TC_PLATFORM
Platforms are using this, so enable the driver for all to use easier.

Bug: 157965270
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5a1a6b1231c51148810389c26bc53d734f5c1ca2
2020-06-29 14:00:26 +02:00
Greg Kroah-Hartman
cd0992a395 ANDROID: GKI: enable QCOM and HISI UFS drivers
These seem to be needed by most systems, so just build them into the
kernel so we don't have to keep messing with ABI changes.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I60801d9f98a37b4e84c56c0da2bf1e8d778d9953
2020-06-29 12:38:02 +02:00
Greg Kroah-Hartman
65343a4900 ANDROID: GKI: enable UFS for x86 gki builds and SCSI_UFSHCD_PCI
UFS was not being enabled for x86 gki builds, making it hard to test
stuff locally.

Also enable SCSI_UFSHCD_PCI=y so that the devices that were needing this
as a module do not need that anymore, to match up with the
SCSI_UFSHCD_PLATFORM setting.

Bug: 151050916
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8af43e0a55f1467c4bd670dcdefddf3746fdd5ef
2020-06-29 12:37:59 +02:00
Rob Herring
85d29c4d6e UPSTREAM: amba: Retry adding deferred devices at late_initcall
If amba bus devices defer when adding, the amba bus code simply retries
adding the devices every 5 seconds. This doesn't work well as it
completely unsynchronized with starting the init process which can
happen in less than 5 secs. Add a retry during late_initcall. If the
amba devices are added, then deferred probe takes over. If the
dependencies have not probed at this point, then there's no improvement
over previous behavior. To completely solve this, we'd need to retry
after every successful probe as deferred probe does.

The list_empty() check now happens outside the mutex, but the mutex
wasn't necessary in the first place.

This needed to use deferred probe instead of fragile initcall ordering
on 32-bit VExpress systems where the apb_pclk has a number of probe
dependencies (vexpress-sysregs, vexpress-config).

Cc: John Stultz <john.stultz@linaro.org>
Cc: Saravana Kannan <saravanak@google.com>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Russell King <linux@armlinux.org.uk>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Change-Id: Ib5260568396e3beb85baf282c68825da80dad392
(cherry picked from commit 039599c92d3b2e73689e8b6e519d653fd4770abb)
Bug: 160030772
Signed-off-by: Saravana Kannan <saravanak@google.com>
2020-06-27 01:02:29 +00:00
Todd Kjos
191e77e387 ANDROID: GKI: Enable INTERVAL_TREE
Needed by some GPU/DRM drivers that are built out-of-tree

Bug: 159733980
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Ia156d1b0a74c82d9f15b144131aff2ddeead0672
2020-06-26 14:53:44 -07:00