Commit Graph

798371 Commits

Author SHA1 Message Date
Mark Salyzyn
958192fe7f ANDROID: GKI: power: supply: Add POWER_SUPPLY_PROP_CC_UAH
Partially taken from commit d575e152ce0282819b8696e5a9fe0aac4f205b91
("qpnp-qg: get cc_uah from qg psy property")

Signed-off-by: Jack Wu <wjack@google.com>
Bug: 141451339
(cherry picked from commit d575e152ce0282819b8696e5a9fe0aac4f205b91)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: If3bb3c34cc2065cce0ac42889d1b5118e716a73f
2020-03-27 11:20:49 -07:00
Mark Salyzyn
c4b94d4cb0 ANDROID: GKI: power: supply: Add POWER_SUPPLY_PROP_VOLTAGE_FIFO
Partially taken from commit e2ad4f0b2c946a0582cb5c3a41ab3a50224c6b73
("qpnp-qg: calculate Vbat FIFO averages for FVSS scaling")

Signed-off-by: Jack Wu <wjack@google.com>
Bug: 141451339
(cherry picked from commit e2ad4f0b2c946a0582cb5c3a41ab3a50224c6b73)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Id6da95c93322bd3c84f6450fad4bfa2d50a9c2ce
2020-03-27 11:20:48 -07:00
Mark Salyzyn
d8fb4a9362 ANDROID: GKI: power: supply: Add capacity and resistance estimates
Partially taken from commit 5b4457baf0e32ba6a6a8d0933328189ff7335e4
("qpnp-qg: add properities for google_battery requirement")

Signed-off-by: Jack Wu <wjack@google.com>
Bug: 139264914
(cherry picked from commit 5b4457baf0e32ba6a6a8d0933328189ff7335e44)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I92678ec7228a46ceb870f41e3acf2f790633fc2a
2020-03-27 11:20:48 -07:00
Badhri Jagan Sridharan
cd5c0c7938 ANDROID: GKI: power_supply: Add vendor specific dead battery property
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Bug: 139264914
(cherry picked from commit 3f1939e10d25e78ab864720ddbc292cf6ae5e03d)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Iaa409f51e14c131801f70661838572d5aab94a08
2020-03-27 11:20:48 -07:00
AleX Pelosi
6c9a8542ce ANDROID: GKI: power-supply: add ADAPTER_DETAILS power supply property
store adapter details (type and capabilities)

Signed-off-by: AleX Pelosi <apelosi@google.com>
Signed-off-by: Jack Wu <wjack@google.com>
Bug: 139264914
Test: recompile
(cherry picked from commit e3328e4bfccc655851529309622004326eff53b3)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I6023dee39d393f89e1f1f56f36ccbd2d8ac41ff2
2020-03-27 11:20:48 -07:00
Mark Salyzyn
e90672c301 ANDROID: GKI: power: supply: Add POWER_SUPPLY_PROP_CHARGE_DISABLE
Partially taken from commit 7c4bd0cdf4eff0dd6774183435fc8139743cd6e4
("power_supply: support for CHARGE_DISABLE")
Change-Id: Icd7574696ada4ea5c7d8811787461bc04c922b3c

Signed-off-by: AleX Pelosi <apelosi@google.com>
Signed-off-by: Jack Wu <wjack@google.com>
Bug: 139264914
Bug: 141347448
(cherry picked from commit 7c4bd0cdf4eff0dd6774183435fc8139743cd6e4)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I178c16fe01fb262e7d9cca777c49e8ad586e8eba
2020-03-27 11:20:47 -07:00
Sahil Chandna
554dd9d906 ANDROID: GKI: power: power_supply: Add property to display skin thermal status
Add power supply property POWER_SUPPLY_PROP_SKIN_HEALTH to indicate
skin thermal status.

Signed-off-by: Sahil Chandna <chandna@codeaurora.org>
(cherry picked from commit 4c6c4e79ded2fde0e11eb9c66da737de8018d575)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Ib04d93cd0a74f39b23591c29c696c5a35c70291a
2020-03-27 11:20:47 -07:00
Sahil Chandna
55d9887cf9 ANDROID: GKI: power_supply: Add properties to support PPS constant current(CC) mode
Add power supply properties to support PPS CC mode charging for dual
charge pumps with MID-VBAT configuration, these properties are set from
user space.

Signed-off-by: Sahil Chandna <chandna@codeaurora.org>
(cherry picked from commit 04e367f45dbd8ecd4a67ce1cc7d5cd11bb8a49e9)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Ia2d467255818dbaaf2d87f56aae39584368772ce
2020-03-27 11:20:47 -07:00
Anirudh Ghayal
954e48cc31 ANDROID: GKI: power: power_supply: Add REAL_CAPACITY property
POWER_SUPPLY_PROP_REAL_CAPACITY reports the unadjusted
and unscaled battery capacity.

Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
(cherry picked from commit f2977772b1a49e065e34b47d264a46a0f02e61cb)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I7a016cdf89904f4d5ecbfd9b9afbd05fbfe62441
2020-03-27 11:20:47 -07:00
Umang Agrawal
913ef30153 ANDROID: GKI: power_supply: Add VOLTAGE_MAX_LIMIT power supply property
Add power supply property VOLTAGE_MAX_LIMIT in usb_psy to allow
external entities to impose limitation on the maximum USB adapter
output voltage.

Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
(cherry picked from commit e0219228eed9c1a3a79dc10ec7257a375560c396)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I3d05188f11ccd0c47cfca626e528bbe2e30582ae
2020-03-27 11:20:47 -07:00
Sahil Chandna
1b3d52f529 ANDROID: GKI: power_supply: Add DC_RESET power-supply property
Add property POWER_SUPPLY_PROP_DC_RESET to notify the removal
of wireless charger.

Signed-off-by: Sahil Chandna <chandna@codeaurora.org>
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
(cherry picked from commit eb8871a6939acf76c0cb68d04c046b72006579c9)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I7964953ee558bc18392eec57e2d1f6a94bd866f5
2020-03-27 11:20:46 -07:00
Ashay Jaiswal
1dbd6b406d ANDROID: GKI: power_supply: Add "THERM_ICL_LIMIT" property
Add "THERM_ICL_LIMIT" property to allow userspace
thermal throttling algorithm to control input current
limit of charger.

Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
(cherry picked from commit d859ce8eb9a40f7b371a657428245d833a756610)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Ib527712b3dc5cde3555813c26f1a4b3a10b23cc1
2020-03-27 11:20:46 -07:00
Ashay Jaiswal
8b94d07235 ANDROID: GKI: power_supply: add CHIP_VERSION property
Add 'POWER_SUPPLY_PROP_CHIP_VERSION' property to expose
chip version to user-space.

Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
(cherry picked from commit 885bab7ac304a26dc57affd64bbb36b272e0850d)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Ief43130c0c206c15f95a4432ad012383a28f750e
2020-03-27 11:20:46 -07:00
Harry Yang
d4ce1e676b ANDROID: GKI: power-supply: Add VOLTAGE_VPH power supply property
Add VOLTAGE_VPH power supply property to expose VPH voltage to user space.

Signed-off-by: Harry Yang <harryy@codeaurora.org>
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
(cherry picked from commit bb818125c496cff3c299ee3a59be9b841e9c1e6f)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I16eb6efe3eef5b173b0f1a66dc21ab6c4c5cb968
2020-03-27 11:20:46 -07:00
Sahil Chandna
2193e751d6 ANDROID: GKI: power_supply: Add SCALE_MODE_EN power-supply property
Add POWER_SUPPLY_PROP_SCALE_MODE_EN property to indicate
the status of filtered voltage based SOC scaling.

Signed-off-by: Sahil Chandna <chandna@codeaurora.org>
(cherry picked from commit e9ab4eff9e48f99d318dd2bd3173a3a8cd0afd8e)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I2d110348eb5ecc85847879b9bc783ddc39e934b7
2020-03-27 11:20:45 -07:00
Subbaraman Narayanamurthy
e419098deb ANDROID: GKI: power_supply: Add local extensions of string property names properly
For displaying local extensions of properties in string format,
add them between MODEL_NAME and SERIAL_NUMBER. Otherwise, those
properties would be represented as integer.

Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
(cherry picked from commit ee0f7c41453f8b9c71f3ffb0c124f6ea5708513e)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Iddb34d7ee6f520b789bc2e085ada4053343538f0
2020-03-27 11:20:45 -07:00
Subbaraman Narayanamurthy
e58a053453 ANDROID: GKI: power_supply: add batt_age_level property
Add batt_age_level property to support loading multiple profiles
based on the battery age level specified by the user.

Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
(cherry picked from commit 0fe2e0aadcff78083a7f85f74c6e931a7c74dcc1)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I41e61c615f2d1df988a0de83e4e2dbddd7a36441
2020-03-27 11:20:45 -07:00
Umang Agrawal
eecc3db929 ANDROID: GKI: power-supply: Add CC_SOC power supply property
Add CC_SOC power supply property to expose cc soc status from the
qgauge and fuel gauge drivers.

Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
(cherry picked from commit 5e3a95732dd66a48e88ef37d279198bd5fd3c4e6)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Iacfc77d97ce14c783338ad6ced0c7356a1a63c83
2020-03-27 11:20:45 -07:00
Mark Salyzyn
48c932ac02 ANDROID: GKI: power_supply: add property to disable QC userspace optimizations
Add power_supply property to configure quick-charge(QC) userspace
optimization mode(hardware/software controlled), user-space daemon
will read the property and disable quick-charge optimization algorithms.

Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
(cherry picked from commit 18f6e9d843b517eaee5659c3a74c3e6f7c15fa41)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I3100e129ceeeeb8c83ba4b6fcf761b59a5a4ab75
2020-03-27 11:20:44 -07:00
Mark Salyzyn
2c0ee0ec51 ANDROID: GKI: power: power_supply: Add FG_RESET power supply property
Add a new power-supply property (POWER_SUPPLY_PROP_FG_RESET)
to to reset FG/QG.

Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
(cherry picked from commit 37f8e3dcdedcc3e38a91617193c8cfedaa8575fd)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Id3bf1ab5740a064d6ce7e42ff499839dbb457b17
2020-03-27 11:20:44 -07:00
Umang Agrawal
ab63e51748 ANDROID: GKI: power_supply: Add power supply type "Charge Pump"
Introduce a new power supply type "Charge Pump" under the power_supply
class. Also, add power supply properties corresponding to power supply
type charge pump.

Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
(cherry picked from commit cf749f200e1d9b665a1f4f699bcc2a008d2bb565)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Ic2ae389601afba37a882d18d5fbb986f86fd3067
2020-03-27 11:20:44 -07:00
Mark Salyzyn
7c08ec155d ANDROID: GKI: power: supply: Add snapshot of power supply framework files
This is a snapshot of the power supply framework-related files as of
msm-4.14 commit defdcf8dc74c ('Merge "power_supply: Add MAIN_FCC_MAX
 property"'). This is needed to support QTI charger and USB_PD drivers.

Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
(cherry picked from commit 9bec986d5ab779416cf977a88003057f2a48fe25)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I9cb7dd7c5f39f52a9cf708bce818a225548306be
2020-03-27 11:20:44 -07:00
Todd Poynor
8e68102cd1 ANDROID: GKI: power: power_supply: Add property CHARGE_COUNTER_EXT and 64-bit precision properties
Add POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT that stores accumulated charge
in nAh units as a signed 64-bit value.

Add generic support for signed 64-bit property values.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit 6a427739547b457e28fd46f882ea9ba22e6b7920)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I2bd34b1e95ffba24e7bfef81f398f22bd2aaf05e
2020-03-27 11:20:43 -07:00
Todd Poynor
1d4485a7be ANDROID: GKI: power: power_supply: add POWER_SUPPLY_PROP_CHARGE_ENABLED
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit 10152c2650a07958ea85add4cab67ccc808b4e02)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I3e93b502452811cbfc4d904202b4f1d94edc143d
2020-03-27 11:20:43 -07:00
Todd Poynor
d50f3843be ANDROID: GKI: power: power_supply: add POWER_SUPPLY_PROP_USB_OTG
Signed-off-by: Todd Poynor <toddpoynor@google.com>
(cherry picked from commit cd934f03c4e5c253303da9e23cf9661ca7718ffa)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: Idfc6ef2e37d62aad6f26cc8eafa53db642cd352b
2020-03-27 11:20:43 -07:00
Todd Poynor
76daf69aae ANDROID: GKI: power: power_supply: Add custom property for USB High Current mode
For smb347.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
[AmitP: Folded following android-4.9 commit changes into this patch
        af4f6ce7f5 ("ANDROID: power: power_supply: move POWER_SUPPLY_PROP_USB_HC to type 'int' order")]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
(cherry picked from commit 314f5bb4b843d2cc99885c07056fe39ef4bdb67d)
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I3323469072e1ee5085d61af8a89612b06b91f94a
2020-03-27 11:20:43 -07:00
Dan Carpenter
73bab97706 UPSTREAM: coresight: Potential uninitialized variable in probe()
(Upstream commit 0530ef6b41).

The "drvdata->atclk" clock is optional, but if it gets set to an error
pointer then we're accidentally return an uninitialized variable instead
of success.

Fixes: 78e6427b4e ("coresight: funnel: Support static funnel")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20190620221237.3536-6-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 140266694
Bug: 151593592
Signed-off-by: Yabin Cui <yabinc@google.com>
Change-Id: Ie1f1a45b66f351b53c440d788888c201cb4bce7f
2020-03-27 02:11:00 +00:00
Hridya Valsaraju
3b543839dd ANDROID: GKI: Update ABI.
Changed leaf types summary: 4 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 5 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

5 Added functions:

  [A] 'function void create_pgtable_mapping(phys_addr_t, phys_addr_t)'
  [A] 'function usb_ep* usb_ep_autoconfig_by_name(usb_gadget*, usb_endpoint_descriptor*, const char*)'
  [A] 'function int usb_func_ep_queue(usb_function*, usb_ep*, usb_request*, gfp_t)'
  [A] 'function int usb_func_wakeup(usb_function*)'
  [A] 'function int usb_get_controller_id(usb_device*)'

'struct hc_driver at hcd.h:246:1' changed:
  type size changed from 2880 to 2944 (in bits)
  1 data member insertion:
    'void ()* hc_driver::get_core_id', at offset 2880 (in bits) at hcd.h:409:1
  13 impacted interfaces

'struct usb_ep at gadget.h:218:1' changed:
  type size changed from 576 to 640 (in bits)
  4 data member insertions:
    'ep_type usb_ep::ep_type', at offset 576 (in bits) at gadget.h:245:1
    'u8 usb_ep::ep_num', at offset 608 (in bits) at gadget.h:246:1
    'u8 usb_ep::ep_intr_num', at offset 616 (in bits) at gadget.h:247:1
    'bool usb_ep::endless', at offset 624 (in bits) at gadget.h:248:1
  30 impacted interfaces

'struct usb_function at composite.h:191:1' changed:
  type size changed from 1728 to 1856 (in bits)
  4 data member insertions:
    'unsigned int usb_function::func_wakeup_pending', at offset 29 (in bits) at composite.h:247:1
    'unsigned int usb_function::func_wakeup_allowed', at offset 30 (in bits) at composite.h:246:1
    'unsigned int usb_function::func_is_suspended', at offset 31 (in bits) at composite.h:245:1
    'int usb_function::intf_id', at offset 64 (in bits) at composite.h:201:1
  there are data member changes:
    'usb_gadget_strings** usb_function::strings' offset changed from 64 to 128 (in bits) (by +64 bits)
    'usb_descriptor_header** usb_function::fs_descriptors' offset changed from 128 to 192 (in bits) (by +64 bits)
    'usb_descriptor_header** usb_function::hs_descriptors' offset changed from 192 to 256 (in bits) (by +64 bits)
    'usb_descriptor_header** usb_function::ss_descriptors' offset changed from 256 to 320 (in bits) (by +64 bits)
    'usb_descriptor_header** usb_function::ssp_descriptors' offset changed from 320 to 384 (in bits) (by +64 bits)
    'usb_configuration* usb_function::config' offset changed from 384 to 448 (in bits) (by +64 bits)
    'usb_os_desc_table* usb_function::os_desc_table' offset changed from 448 to 512 (in bits) (by +64 bits)
    'unsigned int usb_function::os_desc_n' offset changed from 512 to 576 (in bits) (by +64 bits)
    'void ()* usb_function::bind' offset changed from 576 to 640 (in bits) (by +64 bits)
    'void ()* usb_function::unbind' offset changed from 640 to 704 (in bits) (by +64 bits)
    'void ()* usb_function::free_func' offset changed from 704 to 768 (in bits) (by +64 bits)
    'module* usb_function::mod' offset changed from 768 to 832 (in bits) (by +64 bits)
    'void ()* usb_function::set_alt' offset changed from 832 to 896 (in bits) (by +64 bits)
    'void ()* usb_function::get_alt' offset changed from 896 to 960 (in bits) (by +64 bits)
    'void ()* usb_function::disable' offset changed from 960 to 1024 (in bits) (by +64 bits)
    'void ()* usb_function::setup' offset changed from 1024 to 1088 (in bits) (by +64 bits)
    'void ()* usb_function::req_match' offset changed from 1088 to 1152 (in bits) (by +64 bits)
    'void ()* usb_function::suspend' offset changed from 1152 to 1216 (in bits) (by +64 bits)
    'void ()* usb_function::resume' offset changed from 1216 to 1280 (in bits) (by +64 bits)
    'void ()* usb_function::get_status' offset changed from 1280 to 1344 (in bits) (by +64 bits)
    'void ()* usb_function::func_suspend' offset changed from 1344 to 1408 (in bits) (by +64 bits)
    'list_head usb_function::list' offset changed from 1408 to 1536 (in bits) (by +128 bits)
    'unsigned long int usb_function::endpoints[1]' offset changed from 1536 to 1664 (in bits) (by +128 bits)
    'const usb_function_instance* usb_function::fi' offset changed from 1600 to 1728 (in bits) (by +128 bits)
  9 impacted interfaces

'struct usb_gadget_ops at gadget.h:300:1' changed:
  type size changed from 768 to 832 (in bits)
  1 data member insertion:
    'void ()* usb_gadget_ops::func_wakeup', at offset 128 (in bits) at gadget.h:317:1
  there are data member changes:
    'void ()* usb_gadget_ops::set_selfpowered' offset changed from 128 to 192 (in bits) (by +64 bits)
    'void ()* usb_gadget_ops::vbus_session' offset changed from 192 to 256 (in bits) (by +64 bits)
    'void ()* usb_gadget_ops::vbus_draw' offset changed from 256 to 320 (in bits) (by +64 bits)
    'void ()* usb_gadget_ops::pullup' offset changed from 320 to 384 (in bits) (by +64 bits)
    'void ()* usb_gadget_ops::ioctl' offset changed from 384 to 448 (in bits) (by +64 bits)
    'void ()* usb_gadget_ops::get_config_params' offset changed from 448 to 512 (in bits) (by +64 bits)
    'void ()* usb_gadget_ops::udc_start' offset changed from 512 to 576 (in bits) (by +64 bits)
    'void ()* usb_gadget_ops::udc_stop' offset changed from 576 to 640 (in bits) (by +64 bits)
    'void ()* usb_gadget_ops::udc_set_speed' offset changed from 640 to 704 (in bits) (by +64 bits)
    'void ()* usb_gadget_ops::match_ep' offset changed from 704 to 768 (in bits) (by +64 bits)
  19 impacted interfaces

Test: build
Bug: 150811237
Bug: 151977927
Bug: 151977651
Change-Id: I7a803746041fa3d711a534d0bfe60b4a7383f2a9
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2020-03-26 14:52:07 -07:00
Sudarshan Rajagopalan
a5226ba1f0 ANDROID: GKI: Add API to create pagetable mappings.
This is modified version of commit 5ea86bc10f628a06a
to only include the ABI diff, i.e. the addition of
the create_pgtable_mapping() function.

Test: build
Bug: 150811237
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
(cherry picked from commit 5ea86bc10f628a06ae97a837616483038d943542)
[hridya: added EXPORT_SYMBOL_GPL, documentation]
Signed-off-by: Hridya Valsaraju <hridya@google.com>
Change-Id: Ia5cd5f350d63fbe56b592f7f7190cb5e59317647
2020-03-26 14:45:13 -07:00
Hridya Valsaraju
b582ef5b4d ANDROID: GKI: drivers: usb: Add functions usb_func_ep_queue/usb_func_wakeup
This is required to reduce the ABI diff.

Test: build
Bug: 151977927

Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Change-Id: I253e43066a3cd9c8293e46a5f17ef0cfe002cffe
(cherry picked from commit d6c40da240f6d9c2cefbd0d82ac22e3032558181)
[hridya: amended commit to only include the ABI diff,
EXPORT_SYMBOL -> EXPORT_SYMBOL_GPL, add some pointer checks,
documentation]
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2020-03-26 14:45:13 -07:00
Hridya Valsaraju
34f6bfd951 ANDROID: GKI: Add API usb_ep_autoconfig_by_name
Also resolves ABI diff for struct usb_ep.

Test: make
Bug: 151977927
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Change-Id: I808d04f8a9dc6e4eac70cbb5a8c8a304e18531b1
(cherry picked from commit 62523500193e11a8837d4c76ef4a42be2ca4ea0f)
[hridya: commit amended to only include ABI diff
EXPORT_SYMBOL -> EXPORT_SYMBOL_GPL]
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2020-03-26 14:45:12 -07:00
Hemant Kumar
7ff8c34945 ANDROID: GKI: usb: core: Add helper function to return controller id
Function provides controller id used by a remote entity
to identify which usb controller to program to initiate
data transfer.

Test: build
Bug: 151977651
Change-Id: Ied396f34496104c139a7910ee86844c124e6803f
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
(cherry picked from commit f906c280ee2441e7abc9d21e472eca58be56cc93)
[hridya: EXPORT_SYMBOL -> EXPORT_SYMBOL_GPL]
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2020-03-26 14:45:12 -07:00
Dylan Chang
7147144b61 ANDROID: dm-bow: Fix free_show value is incorrect
Fix free_show value is incorrect

Change-Id: If7f36a64afa600c980ee8a25393f8716a6ffd474
Signed-off-by: Dylan Chang <dylan.chang@oneplus.com>
Bug: 152116739
(cherry picked from commit feff0b2236)
Signed-off-by: Paul Lawrence <paullawrence@google.com>
2020-03-26 20:56:04 +00:00
Connor O'Brien
4e614988d7 ANDROID: GKI: update ABI after fixing cfg80211_chan_def diff
Bug: 150628559
Test: build
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Idad817809b0b675b8943c82f7b939e1d4228df20
2020-03-26 19:35:40 +00:00
Alexei Avshalom Lazar
0b546fb9b5 BACKPORT: nl80211: Add support for EDMG channels
802.11ay specification defines Enhanced Directional Multi-Gigabit
(EDMG) STA and AP which allow channel bonding of 2 channels and more.

Introduce new NL attributes that are needed for enabling and
configuring EDMG support.

Two new attributes are used by kernel to publish driver's EDMG
capabilities to the userspace:
NL80211_BAND_ATTR_EDMG_CHANNELS - bitmap field that indicates the 2.16
GHz channel(s) that are supported by the driver.
When this attribute is not set it means driver does not support EDMG.
NL80211_BAND_ATTR_EDMG_BW_CONFIG - represent the channel bandwidth
configurations supported by the driver.

Additional two new attributes are used by the userspace for connect
command and for AP configuration:
NL80211_ATTR_WIPHY_EDMG_CHANNELS
NL80211_ATTR_WIPHY_EDMG_BW_CONFIG

New rate info flag - RATE_INFO_FLAGS_EDMG, can be reported from driver
and used for bitrate calculation that will take into account EDMG
according to the 802.11ay specification.

Change-Id: I06d3f04d16b68d35c1dd9cd3624916302e8725a1
Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
Link: https://lore.kernel.org/r/1566138918-3823-2-git-send-email-ailizaro@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: 2a38075cd0
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
[ailizaro@codeaurora.org: fix conflict due to missing NLA policy]
Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
(cherry picked from commit afd697d00768139b458e5e770c6c76efa3bcbadd)
Bug: 150628559
Signed-off-by: Connor O'Brien <connoro@google.com>
2020-03-26 19:35:27 +00:00
Qais Yousef
b38208f02b FROMGIT: sched/rt: cpupri_find: Trigger a full search as fallback
If we failed to find a fitting CPU, in cpupri_find(), we only fallback
to the level we found a hit at.

But Steve suggested to fallback to a second full scan instead as this
could be a better effort.

	https://lore.kernel.org/lkml/20200304135404.146c56eb@gandalf.local.home/

We trigger the 2nd search unconditionally since the argument about
triggering a full search is that the recorded fall back level might have
become empty by then. Which means storing any data about what happened
would be meaningless and stale.

I had a humble try at timing it and it seemed okay for the small 6 CPUs
system I was running on

	https://lore.kernel.org/lkml/20200305124324.42x6ehjxbnjkklnh@e107158-lin.cambridge.arm.com/

On large system this second full scan could be expensive. But there are
no users outside capacity awareness for this fitness function at the
moment. Heterogeneous systems tend to be small with 8cores in total.

Bug: 120440300
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://lkml.kernel.org/r/20200310142219.syxzn5ljpdxqtbgx@e107158-lin.cambridge.arm.com
(cherry picked from commit e94f80f6c4
 https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: Ib20d400be47cd913a43a5c71fafee6a7fffb78aa
2020-03-26 12:04:38 +00:00
Qais Yousef
32061ff6b5 FROMGIT: sched/rt: Remove unnecessary push for unfit tasks
In task_woken_rt() and switched_to_rto() we try trigger push-pull if the
task is unfit.

But the logic is found lacking because if the task was the only one
running on the CPU, then rt_rq is not in overloaded state and won't
trigger a push.

The necessity of this logic was under a debate as well, a summary of
the discussion can be found in the following thread:

  https://lore.kernel.org/lkml/20200226160247.iqvdakiqbakk2llz@e107158-lin.cambridge.arm.com/

Remove the logic for now until a better approach is agreed upon.

Bug: 120440300
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Fixes: 804d402fb6 ("sched/rt: Make RT capacity-aware")
Link: https://lkml.kernel.org/r/20200302132721.8353-6-qais.yousef@arm.com
(cherry picked from commit d94a9df490
 https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: Id120ada4a89972b3feb8d8b022babb98db1a157f
2020-03-26 12:04:38 +00:00
Qais Yousef
8efce17187 BACKPORT: FROMGIT: sched/rt: Allow pulling unfitting task
When implemented RT Capacity Awareness; the logic was done such that if
a task was running on a fitting CPU, then it was sticky and we would try
our best to keep it there.

But as Steve suggested, to adhere to the strict priority rules of RT
class; allow pulling an RT task to unfitting CPU to ensure it gets a
chance to run ASAP.

Bug: 120440300
LINK: https://lore.kernel.org/lkml/20200203111451.0d1da58f@oasis.local.home/
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Fixes: 804d402fb6 ("sched/rt: Make RT capacity-aware")
Link: https://lkml.kernel.org/r/20200302132721.8353-5-qais.yousef@arm.com
(cherry picked from commit 98ca645f82
 https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core)
[Trivial merge conflict]
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: Ie25fa5a4f3b0979ed06df8d156e5586b2928479e
2020-03-26 12:04:38 +00:00
Qais Yousef
2bf4a52c7a FROMGIT: sched/rt: Optimize cpupri_find() on non-heterogenous systems
By introducing a new cpupri_find_fitness() function that takes the
fitness_fn as an argument and only called when asym_system static key is
enabled.

cpupri_find() is now a wrapper function that calls cpupri_find_fitness()
passing NULL as a fitness_fn, hence disabling the logic that handles
fitness by default.

Bug: 120440300
LINK: https://lore.kernel.org/lkml/c0772fca-0a4b-c88d-fdf2-5715fcf8447b@arm.com/
Reported-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Fixes: 804d402fb6 ("sched/rt: Make RT capacity-aware")
Link: https://lkml.kernel.org/r/20200302132721.8353-4-qais.yousef@arm.com
(cherry picked from commit a1bd02e1f2
 https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I8ad4d9e391030ae499f7a1805485147de64abcdf
2020-03-26 12:04:38 +00:00
Qais Yousef
27d84b63b0 FROMGIT: sched/rt: Re-instate old behavior in select_task_rq_rt()
When RT Capacity Aware support was added, the logic in select_task_rq_rt
was modified to force a search for a fitting CPU if the task currently
doesn't run on one.

But if the search failed, and the search was only triggered to fulfill
the fitness request; we could end up selecting a new CPU unnecessarily.

Fix this and re-instate the original behavior by ensuring we bail out
in that case.

This behavior change only affected asymmetric systems that are using
util_clamp to implement capacity aware. None asymmetric systems weren't
affected.

Bug: 120440300
LINK: https://lore.kernel.org/lkml/20200218041620.GD28029@codeaurora.org/
Reported-by: Pavan Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Fixes: 804d402fb6 ("sched/rt: Make RT capacity-aware")
Link: https://lkml.kernel.org/r/20200302132721.8353-3-qais.yousef@arm.com
(cherry picked from commit b28bc1e002
 https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core)
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I670ab7f95a3bd8b4790e1cafe89308ead524367e
2020-03-26 12:04:38 +00:00
Qais Yousef
ca79ac3cba BACKPORT: FROMGIT: sched/rt: cpupri_find: Implement fallback mechanism for !fit case
When searching for the best lowest_mask with a fitness_fn passed, make
sure we record the lowest_level that returns a valid lowest_mask so that
we can use that as a fallback in case we fail to find a fitting CPU at
all levels.

The intention in the original patch was not to allow a down migration to
unfitting CPU. But this missed the case where we are already running on
unfitting one.

With this change now RT tasks can still move between unfitting CPUs when
they're already running on such CPU.

And as Steve suggested; to adhere to the strict priority rules of RT, if
a task is already running on a fitting CPU but due to priority it can't
run on it, allow it to downmigrate to unfitting CPU so it can run.

Bug: 120440300
Reported-by: Pavan Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Fixes: 804d402fb6 ("sched/rt: Make RT capacity-aware")
Link: https://lkml.kernel.org/r/20200302132721.8353-2-qais.yousef@arm.com
Link: https://lore.kernel.org/lkml/20200203142712.a7yvlyo2y3le5cpn@e107158-lin/
(cherry picked from commit d9cb236b94
 https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core)
[Trivial merge conflict]
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Change-Id: I3430e9624f8f7b11d3875c39c5765a51aec4a6f5
2020-03-26 12:04:38 +00:00
Sandeep Patil
374ed837f2 ANDROID: GKI: re-enable LTO, CFI and SCS
The configuration options were accidentally disabled in
aosp/1261171

Bug: none
Test: builds

Signed-off-by: Sandeep Patil <sspatil@google.com>
Change-Id: I5ba11e8cde97dd484c55e10488610f6da3fe0a4b
2020-03-25 18:11:06 +00:00
Greg Kroah-Hartman
248555d63c Merge 4.19.113 into android-4.19
Changes in 4.19.113
	drm/mediatek: Find the cursor plane instead of hard coding it
	spi: qup: call spi_qup_pm_resume_runtime before suspending
	powerpc: Include .BTF section
	ARM: dts: dra7: Add "dma-ranges" property to PCIe RC DT nodes
	spi: pxa2xx: Add CS control clock quirk
	spi/zynqmp: remove entry that causes a cs glitch
	drm/exynos: dsi: propagate error value and silence meaningless warning
	drm/exynos: dsi: fix workaround for the legacy clock name
	drivers/perf: arm_pmu_acpi: Fix incorrect checking of gicc pointer
	altera-stapl: altera_get_note: prevent write beyond end of 'key'
	dm bio record: save/restore bi_end_io and bi_integrity
	dm integrity: use dm_bio_record and dm_bio_restore
	riscv: avoid the PIC offset of static percpu data in module beyond 2G limits
	drm/amd/display: Clear link settings on MST disable connector
	drm/amd/display: fix dcc swath size calculations on dcn1
	xenbus: req->body should be updated before req->state
	xenbus: req->err should be updated before req->state
	block, bfq: fix overwrite of bfq_group pointer in bfq_find_set_group()
	parse-maintainers: Mark as executable
	USB: Disable LPM on WD19's Realtek Hub
	usb: quirks: add NO_LPM quirk for RTL8153 based ethernet adapters
	USB: serial: option: add ME910G1 ECM composition 0x110b
	usb: host: xhci-plat: add a shutdown
	USB: serial: pl2303: add device-id for HP LD381
	usb: xhci: apply XHCI_SUSPEND_DELAY to AMD XHCI controller 1022:145c
	ALSA: line6: Fix endless MIDI read loop
	ALSA: seq: virmidi: Fix running status after receiving sysex
	ALSA: seq: oss: Fix running status after receiving sysex
	ALSA: pcm: oss: Avoid plugin buffer overflow
	ALSA: pcm: oss: Remove WARNING from snd_pcm_plug_alloc() checks
	iio: st_sensors: remap SMO8840 to LIS2DH12
	iio: trigger: stm32-timer: disable master mode when stopping
	iio: magnetometer: ak8974: Fix negative raw values in sysfs
	iio: adc: at91-sama5d2_adc: fix differential channels in triggered mode
	mmc: rtsx_pci: Fix support for speed-modes that relies on tuning
	mmc: sdhci-of-at91: fix cd-gpios for SAMA5D2
	staging: rtl8188eu: Add device id for MERCUSYS MW150US v2
	staging: greybus: loopback_test: fix poll-mask build breakage
	staging/speakup: fix get_word non-space look-ahead
	intel_th: Fix user-visible error codes
	intel_th: pci: Add Elkhart Lake CPU support
	rtc: max8907: add missing select REGMAP_IRQ
	xhci: Do not open code __print_symbolic() in xhci trace events
	btrfs: fix log context list corruption after rename whiteout error
	drm/amd/amdgpu: Fix GPR read from debugfs (v2)
	drm/lease: fix WARNING in idr_destroy
	memcg: fix NULL pointer dereference in __mem_cgroup_usage_unregister_event
	mm: slub: be more careful about the double cmpxchg of freelist
	mm, slub: prevent kmalloc_node crashes and memory leaks
	page-flags: fix a crash at SetPageError(THP_SWAP)
	x86/mm: split vmalloc_sync_all()
	USB: cdc-acm: fix close_delay and closing_wait units in TIOCSSERIAL
	USB: cdc-acm: fix rounding error in TIOCSSERIAL
	iio: light: vcnl4000: update sampling periods for vcnl4200
	kbuild: Disable -Wpointer-to-enum-cast
	futex: Fix inode life-time issue
	futex: Unbreak futex hashing
	Revert "vrf: mark skb for multicast or link-local as enslaved to VRF"
	Revert "ipv6: Fix handling of LLA with VRF and sockets bound to VRF"
	ALSA: hda/realtek: Fix pop noise on ALC225
	arm64: smp: fix smp_send_stop() behaviour
	arm64: smp: fix crash_smp_send_stop() behaviour
	drm/bridge: dw-hdmi: fix AVI frame colorimetry
	staging: greybus: loopback_test: fix potential path truncation
	staging: greybus: loopback_test: fix potential path truncations
	Linux 4.19.113

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I90c48cd7189a964e59d199ecc0f32c0a68688ec5
2020-03-25 09:50:38 +01:00
Greg Kroah-Hartman
54b4fa6d39 Linux 4.19.113 2020-03-25 08:06:15 +01:00
Johan Hovold
d4462fb6c2 staging: greybus: loopback_test: fix potential path truncations
commit ae62cf5eb2 upstream.

Newer GCC warns about possible truncations of two generated path names as
we're concatenating the configurable sysfs and debugfs path prefixes
with a filename and placing the results in buffers of the same size as
the maximum length of the prefixes.

	snprintf(d->name, MAX_STR_LEN, "gb_loopback%u", dev_id);

	snprintf(d->sysfs_entry, MAX_SYSFS_PATH, "%s%s/",
		 t->sysfs_prefix, d->name);

	snprintf(d->debugfs_entry, MAX_SYSFS_PATH, "%sraw_latency_%s",
		 t->debugfs_prefix, d->name);

Fix this by separating the maximum path length from the maximum prefix
length and reducing the latter enough to fit the generated strings.

Note that we also need to reduce the device-name buffer size as GCC
isn't smart enough to figure out that we ever only used MAX_STR_LEN
bytes of it.

Fixes: 6b0658f687 ("greybus: tools: Add tools directory to greybus repo and add loopback")
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20200312110151.22028-4-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25 08:06:15 +01:00
Johan Hovold
3d96de25fd staging: greybus: loopback_test: fix potential path truncation
commit f160238348 upstream.

Newer GCC warns about a possible truncation of a generated sysfs path
name as we're concatenating a directory path with a file name and
placing the result in a buffer that is half the size of the maximum
length of the directory path (which is user controlled).

loopback_test.c: In function 'open_poll_files':
loopback_test.c:651:31: warning: '%s' directive output may be truncated writing up to 511 bytes into a region of size 255 [-Wformat-truncation=]
  651 |   snprintf(buf, sizeof(buf), "%s%s", dev->sysfs_entry, "iteration_count");
      |                               ^~
loopback_test.c:651:3: note: 'snprintf' output between 16 and 527 bytes into a destination of size 255
  651 |   snprintf(buf, sizeof(buf), "%s%s", dev->sysfs_entry, "iteration_count");
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix this by making sure the buffer is large enough the concatenated
strings.

Fixes: 6b0658f687 ("greybus: tools: Add tools directory to greybus repo and add loopback")
Fixes: 9250c0ee26 ("greybus: Loopback_test: use poll instead of inotify")
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20200312110151.22028-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25 08:06:15 +01:00
Jernej Skrabec
21213fb674 drm/bridge: dw-hdmi: fix AVI frame colorimetry
commit e8dca30f71 upstream.

CTA-861-F explicitly states that for RGB colorspace colorimetry should
be set to "none". Fix that.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Fixes: def23aa7e9 ("drm: bridge: dw-hdmi: Switch to V4L bus format and encodings")
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200304232512.51616-2-jernej.skrabec@siol.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25 08:06:15 +01:00
Cristian Marussi
d59848cab4 arm64: smp: fix crash_smp_send_stop() behaviour
commit f50b7daccc upstream.

On a system configured to trigger a crash_kexec() reboot, when only one CPU
is online and another CPU panics while starting-up, crash_smp_send_stop()
will fail to send any STOP message to the other already online core,
resulting in fail to freeze and registers not properly saved.

Moreover even if the proper messages are sent (case CPUs > 2)
it will similarly fail to account for the booting CPU when executing
the final stop wait-loop, so potentially resulting in some CPU not
been waited for shutdown before rebooting.

A tangible effect of this behaviour can be observed when, after a panic
with kexec enabled and loaded, on the following reboot triggered by kexec,
the cpu that could not be successfully stopped fails to come back online:

[  362.291022] ------------[ cut here ]------------
[  362.291525] kernel BUG at arch/arm64/kernel/cpufeature.c:886!
[  362.292023] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[  362.292400] Modules linked in:
[  362.292970] CPU: 3 PID: 0 Comm: swapper/3 Kdump: loaded Not tainted 5.6.0-rc4-00003-gc780b890948a #105
[  362.293136] Hardware name: Foundation-v8A (DT)
[  362.293382] pstate: 200001c5 (nzCv dAIF -PAN -UAO)
[  362.294063] pc : has_cpuid_feature+0xf0/0x348
[  362.294177] lr : verify_local_elf_hwcaps+0x84/0xe8
[  362.294280] sp : ffff800011b1bf60
[  362.294362] x29: ffff800011b1bf60 x28: 0000000000000000
[  362.294534] x27: 0000000000000000 x26: 0000000000000000
[  362.294631] x25: 0000000000000000 x24: ffff80001189a25c
[  362.294718] x23: 0000000000000000 x22: 0000000000000000
[  362.294803] x21: ffff8000114aa018 x20: ffff800011156a00
[  362.294897] x19: ffff800010c944a0 x18: 0000000000000004
[  362.294987] x17: 0000000000000000 x16: 0000000000000000
[  362.295073] x15: 00004e53b831ae3c x14: 00004e53b831ae3c
[  362.295165] x13: 0000000000000384 x12: 0000000000000000
[  362.295251] x11: 0000000000000000 x10: 00400032b5503510
[  362.295334] x9 : 0000000000000000 x8 : ffff800010c7e204
[  362.295426] x7 : 00000000410fd0f0 x6 : 0000000000000001
[  362.295508] x5 : 00000000410fd0f0 x4 : 0000000000000000
[  362.295592] x3 : 0000000000000000 x2 : ffff8000100939d8
[  362.295683] x1 : 0000000000180420 x0 : 0000000000180480
[  362.296011] Call trace:
[  362.296257]  has_cpuid_feature+0xf0/0x348
[  362.296350]  verify_local_elf_hwcaps+0x84/0xe8
[  362.296424]  check_local_cpu_capabilities+0x44/0x128
[  362.296497]  secondary_start_kernel+0xf4/0x188
[  362.296998] Code: 52805001 72a00301 6b01001f 54000ec0 (d4210000)
[  362.298652] SMP: stopping secondary CPUs
[  362.300615] Starting crashdump kernel...
[  362.301168] Bye!
[    0.000000] Booting Linux on physical CPU 0x0000000003 [0x410fd0f0]
[    0.000000] Linux version 5.6.0-rc4-00003-gc780b890948a (crimar01@e120937-lin) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #105 SMP PREEMPT Fri Mar 6 17:00:42 GMT 2020
[    0.000000] Machine model: Foundation-v8A
[    0.000000] earlycon: pl11 at MMIO 0x000000001c090000 (options '')
[    0.000000] printk: bootconsole [pl11] enabled
.....
[    0.138024] rcu: Hierarchical SRCU implementation.
[    0.153472] its@2f020000: unable to locate ITS domain
[    0.154078] its@2f020000: Unable to locate ITS domain
[    0.157541] EFI services will not be available.
[    0.175395] smp: Bringing up secondary CPUs ...
[    0.209182] psci: failed to boot CPU1 (-22)
[    0.209377] CPU1: failed to boot: -22
[    0.274598] Detected PIPT I-cache on CPU2
[    0.278707] GICv3: CPU2: found redistributor 1 region 0:0x000000002f120000
[    0.285212] CPU2: Booted secondary processor 0x0000000001 [0x410fd0f0]
[    0.369053] Detected PIPT I-cache on CPU3
[    0.372947] GICv3: CPU3: found redistributor 2 region 0:0x000000002f140000
[    0.378664] CPU3: Booted secondary processor 0x0000000002 [0x410fd0f0]
[    0.401707] smp: Brought up 1 node, 3 CPUs
[    0.404057] SMP: Total of 3 processors activated.

Make crash_smp_send_stop() account also for the online status of the
calling CPU while evaluating how many CPUs are effectively online: this way
the right number of STOPs is sent and all other stopped-cores's registers
are properly saved.

Fixes: 78fd584cde ("arm64: kdump: implement machine_crash_shutdown()")
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25 08:06:15 +01:00
Cristian Marussi
1dd632975d arm64: smp: fix smp_send_stop() behaviour
commit d0bab0c39e upstream.

On a system with only one CPU online, when another one CPU panics while
starting-up, smp_send_stop() will fail to send any STOP message to the
other already online core, resulting in a system still responsive and
alive at the end of the panic procedure.

[  186.700083] CPU3: shutdown
[  187.075462] CPU2: shutdown
[  187.162869] CPU1: shutdown
[  188.689998] ------------[ cut here ]------------
[  188.691645] kernel BUG at arch/arm64/kernel/cpufeature.c:886!
[  188.692079] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[  188.692444] Modules linked in:
[  188.693031] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 5.6.0-rc4-00001-g338d25c35a98 #104
[  188.693175] Hardware name: Foundation-v8A (DT)
[  188.693492] pstate: 200001c5 (nzCv dAIF -PAN -UAO)
[  188.694183] pc : has_cpuid_feature+0xf0/0x348
[  188.694311] lr : verify_local_elf_hwcaps+0x84/0xe8
[  188.694410] sp : ffff800011b1bf60
[  188.694536] x29: ffff800011b1bf60 x28: 0000000000000000
[  188.694707] x27: 0000000000000000 x26: 0000000000000000
[  188.694801] x25: 0000000000000000 x24: ffff80001189a25c
[  188.694905] x23: 0000000000000000 x22: 0000000000000000
[  188.694996] x21: ffff8000114aa018 x20: ffff800011156a38
[  188.695089] x19: ffff800010c944a0 x18: 0000000000000004
[  188.695187] x17: 0000000000000000 x16: 0000000000000000
[  188.695280] x15: 0000249dbde5431e x14: 0262cbe497efa1fa
[  188.695371] x13: 0000000000000002 x12: 0000000000002592
[  188.695472] x11: 0000000000000080 x10: 00400032b5503510
[  188.695572] x9 : 0000000000000000 x8 : ffff800010c80204
[  188.695659] x7 : 00000000410fd0f0 x6 : 0000000000000001
[  188.695750] x5 : 00000000410fd0f0 x4 : 0000000000000000
[  188.695836] x3 : 0000000000000000 x2 : ffff8000100939d8
[  188.695919] x1 : 0000000000180420 x0 : 0000000000180480
[  188.696253] Call trace:
[  188.696410]  has_cpuid_feature+0xf0/0x348
[  188.696504]  verify_local_elf_hwcaps+0x84/0xe8
[  188.696591]  check_local_cpu_capabilities+0x44/0x128
[  188.696666]  secondary_start_kernel+0xf4/0x188
[  188.697150] Code: 52805001 72a00301 6b01001f 54000ec0 (d4210000)
[  188.698639] ---[ end trace 3f12ca47652f7b72 ]---
[  188.699160] Kernel panic - not syncing: Attempted to kill the idle task!
[  188.699546] Kernel Offset: disabled
[  188.699828] CPU features: 0x00004,20c02008
[  188.700012] Memory Limit: none
[  188.700538] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

[root@arch ~]# echo Helo
Helo
[root@arch ~]# cat /proc/cpuinfo | grep proce
processor	: 0

Make smp_send_stop() account also for the online status of the calling CPU
while evaluating how many CPUs are effectively online: this way, the right
number of STOPs is sent, so enforcing a proper freeze of the system at the
end of panic even under the above conditions.

Fixes: 08e875c16a ("arm64: SMP support")
Reported-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25 08:06:14 +01:00
Kai-Heng Feng
89fba2b721 ALSA: hda/realtek: Fix pop noise on ALC225
commit 3b36b13d5e upstream.

Commit 317d931392 ("ALSA: hda/realtek - Set default power save node to
0") makes the ALC225 have pop noise on S3 resume and cold boot.

So partially revert this commit for ALC225 to fix the regression.

Fixes: 317d931392 ("ALSA: hda/realtek - Set default power save node to 0")
BugLink: https://bugs.launchpad.net/bugs/1866357
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200311061328.17614-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25 08:06:14 +01:00