21 Commits

Author SHA1 Message Date
Michael Bestas
7ecf2405ae
power: reset: Move in_panic handling out of dload mode
* Some devices might want to use that logic
  without enabling download mode

Change-Id: Idd4a2cc8a47041740f8d4e9f43bffd84fae5830d
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-03-19 07:13:26 +00:00
Akshay Adiga
9d69cd78cf power: reset: Don't set dload_mode in kdump kernel
Kdump kernel needs to retain the dload type set by primary
kernel. Currenly dload type will be set to default value of fulldump.

Change-Id: I9f2a4f4b815166c86d103d2ef94c56c4005df1a3
Signed-off-by: Akshay Adiga <aadiga@codeaurora.org>
2020-09-15 09:11:52 +05:30
Arun KS
3bc30dbaaa drivers: msm-poweroff: Restore kaslr offset during hibernation
kaslr offset in IMEM is required to decode the ram dumps with
kaslr enabled kernel. Add hibernation callback to restore kaslr
offset during hibernation restore. Use syscore callbacks in this
case to restore the value as soon as possible.

Change-Id: I07923530983841753db0a6aaca24b4ee66655537
Signed-off-by: Arun KS <arunks@codeaurora.org>
2020-01-31 21:26:02 -08:00
Rakesh Kumar
a06a6f514b drivers: qcom: Add SCM API support for armv7
SCM APIs support is added for tz_log,msm-poweroff,
watchdog for mdm9607 target.

Change-Id: I7574e12b831dac471d449722138daf77b07075ed
Signed-off-by: Hari babu <haribabu@codeaurora.org>
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
2019-11-21 04:06:27 -08:00
Prateek Sood
30f955d3f0 power: reset: remove compilation error
Remove compilation error when CONFIG_QCOM_DLOAD_MODE
is disabled.

Change-Id: I02a099f639854bacb69b6600dd4b7c6e8e90af03
Signed-off-by: Prateek Sood <prsood@codeaurora.org>
2019-02-28 16:29:50 +05:30
Prateek Sood
5796bd2e94 power: reset: block SDI dynamic enablement
Dynamic enable of SDI is not supported. Blocking
dynamic enablement of SDI from module parameter.

Change-Id: I35b5760342b40ca07fb648f3cc9783d4b4dff3f3
Signed-off-by: Prateek Sood <prsood@codeaurora.org>
2019-02-25 21:59:38 +05:30
Raghavendra Rao Ananta
fbf34e7838 power: reset: Add force warm reboot support
Some entities, such as PCIe on the LE pltforms, do not want
to lose the communication link on a system reboot. As a result,
add support to force warm reboot of the system and preserve the
link.

Change-Id: Ib0c3435f92393eae31afee9c144d2aaf2abcb512
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2018-07-09 15:55:17 -07:00
Isaac J. Manjarres
4f5d011e6d Merge remote-tracking branch 'remotes/origin/tmp-bb60f28' into msm-4.14
* remotes/origin/tmp-bb60f28:
  Linux 4.14.37
  mac80211_hwsim: fix use-after-free bug in hwsim_exit_net
  Revert "KVM: X86: Fix SMRAM accessing even if VM is shutdown"
  RDMA/mlx5: Fix NULL dereference while accessing XRC_TGT QPs
  perf: Return proper values for user stack errors
  perf: Fix sample_max_stack maximum check
  netfilter: x_tables: limit allocation requests for blob rule heads
  netfilter: compat: reject huge allocation requests
  netfilter: compat: prepare xt_compat_init_offsets to return errors
  netfilter: x_tables: add counters allocation wrapper
  netfilter: x_tables: cap allocations at 512 mbyte
  alarmtimer: Init nanosleep alarm timer on stack
  RDMA/core: Reduce poll batch for direct cq polling
  irqchip/gic-v3: Change pr_debug message to pr_devel
  cpumask: Make for_each_cpu_wrap() available on UP as well
  irqchip/gic-v3: Ignore disabled ITS nodes
  perf test: Fix test trace+probe_libc_inet_pton.sh for s390x
  powerpc/powernv: IMC fix out of bounds memory access at shutdown
  locking/qspinlock: Ensure node->count is updated before initialising node
  x86/platform/UV: Fix GAM Range Table entries less than 1GB
  powerpc/mm/hash64: Zero PGD pages on allocation
  vfs/proc/kcore, x86/mm/kcore: Fix SMAP fault when dumping vsyscall user page
  PM / wakeirq: Fix unbalanced IRQ enable for wakeirq
  ACPI / EC: Restore polling during noirq suspend/resume phases
  bpf: fix rlimit in reuseport net selftest
  net: stmmac: discard disabled flags in interrupt status register
  SUNRPC: Don't call __UDPX_INC_STATS() from a preemptible context
  KVM: PPC: Book3S HV: Fix handling of secondary HPTEG in HPT resizing code
  tools/libbpf: handle issues with bpf ELF objects containing .eh_frames
  net: Extra '_get' in declaration of arch_get_platform_mac_address
  svcrdma: Fix Read chunk round-up
  rxrpc: Don't put crypto buffers on the stack
  selftests/ftrace: Add some missing glob checks
  cpufreq: intel_pstate: Enable HWP during system resume on CPU0
  bcache: return attach error when no cache set exist
  bcache: fix for data collapse after re-attaching an attached device
  bcache: fix for allocator and register thread race
  bcache: properly set task state in bch_writeback_thread()
  cifs: silence compiler warnings showing up with gcc-8.0.0
  PM / domains: Fix up domain-idle-states OF parsing
  proc: fix /proc/*/map_files lookup
  arm64: spinlock: Fix theoretical trylock() A-B-A with LSE atomics
  RDS: IB: Fix null pointer issue
  bpf: sockmap, fix leaking maps with attached but not detached progs
  xen/grant-table: Use put_page instead of free_page
  xen-netfront: Fix race between device setup and open
  perf evsel: Fix period/freq terms setup
  MIPS: Generic: Support GIC in EIC mode
  perf record: Fix period option handling
  MIPS: TXx9: use IS_BUILTIN() for CONFIG_LEDS_CLASS
  bpf: fix selftests/bpf test_kmod.sh failure when CONFIG_BPF_JIT_ALWAYS_ON=y
  ACPI / scan: Use acpi_bus_get_status() to initialize ACPI_TYPE_DEVICE devs
  ACPI / bus: Do not call _STA on battery devices with unmet dependencies
  ACPI: processor_perflib: Do not send _PPC change notification if not ready
  firmware: dmi_scan: Fix handling of empty DMI strings
  x86/dumpstack: Avoid uninitlized variable
  x86/power: Fix swsusp_arch_resume prototype
  netfilter: ipv6: nf_defrag: Kill frag queue on RFC2460 failure
  s390/eadm: fix CONFIG_BLOCK include dependency
  drm/nouveau/pmu/fuc: don't use movw directly anymore
  IB/core: Map iWarp AH type to undefined in rdma_ah_find_type
  IB/ipoib: Fix for potential no-carrier state
  IB/hfi1: Fix for potential refcount leak in hfi1_open_file()
  IB/hfi1: Re-order IRQ cleanup to address driver cleanup race
  blk-mq: fix discard merge with scheduler attached
  openvswitch: Remove padding from packet before L3+ conntrack processing
  mm/fadvise: discard partial page if endbyte is also EOF
  mm: pin address_space before dereferencing it while isolating an LRU page
  mm: thp: use down_read_trylock() in khugepaged to avoid long block
  sparc64: update pmdp_invalidate() to return old pmd value
  asm-generic: provide generic_pmdp_establish()
  mm/mempolicy: add nodes_empty check in SYSC_migrate_pages
  mm/mempolicy: fix the check of nodemask from user
  ocfs2: return error when we attempt to access a dirty bh in jbd2
  ocfs2/acl: use 'ip_xattr_sem' to protect getting extended attribute
  ocfs2: return -EROFS to mount.ocfs2 if inode block is invalid
  fs/dax.c: release PMD lock even when there is no PMD support in DAX
  x86/kvm/vmx: do not use vm-exit instruction length for fast MMIO when running nested
  kvm: Map PFN-type memory regions as writable (if possible)
  tcp_nv: fix potential integer overflow in tcpnv_acked
  netfilter: x_tables: fix pointer leaks to userspace
  x86/hyperv: Check for required priviliges in hyperv_init()
  gianfar: prevent integer wrapping in the rx handler
  ntb_transport: Fix bug with max_mw_size parameter
  RDMA/mlx5: Avoid memory leak in case of XRCD dealloc failure
  powerpc/numa: Ensure nodes initialized for hotplug
  powerpc/numa: Use ibm,max-associativity-domains to discover possible nodes
  samples/bpf: Partially fixes the bpf.o build
  i40e: fix reported mask for ntuple filters
  i40e: program fragmented IPv4 filter input set
  ixgbe: don't set RXDCTL.RLPML for 82599
  jffs2: Fix use-after-free bug in jffs2_iget()'s error handling path
  RDMA/uverbs: Use an unambiguous errno for method not supported
  crypto: artpec6 - remove select on non-existing CRYPTO_SHA384
  device property: Define type of PROPERTY_ENRTY_*() macros
  tty: serial: exar: Relocate sleep wake-up handling
  x86/hyperv: Stop suppressing X86_FEATURE_PCID
  fm10k: fix "failed to kill vid" message for VF
  igb: Clear TXSTMP when ptp_tx_work() is timeout
  igb: Allow to remove administratively set MAC on VFs
  ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink
  blk-mq-debugfs: don't allow write on attributes with seq_operations set
  KVM: s390: vsie: use READ_ONCE to access some SCB fields
  platform/x86: thinkpad_acpi: suppress warning about palm detection
  i40evf: ignore link up if not running
  i40evf: Don't schedule reset_task when device is being removed
  bpf: test_maps: cleanup sockmaps when test ends
  block: Set BIO_TRACE_COMPLETION on new bio during split
  nfp: fix error return code in nfp_pci_probe()
  HID: roccat: prevent an out of bounds read in kovaplus_profile_activated()
  Input: stmfts - set IRQ_NOAUTOEN to the irq flag
  scsi: fas216: fix sense buffer initialization
  scsi: devinfo: fix format of the device list
  f2fs: avoid hungtask when GC encrypted block if io_bits is set
  RDMA/cma: Check existence of netdevice during port validation
  Btrfs: raid56: fix race between merge_bio and rbio_orig_end_io
  Btrfs: fix unexpected EEXIST from btrfs_get_extent
  btrfs: fail mount when sb flag is not in BTRFS_SUPER_FLAG_SUPP
  Btrfs: fix scrub to repair raid6 corruption
  btrfs: Fix out of bounds access in btrfs_search_slot
  Btrfs: set plug for fsync
  ipmi/powernv: Fix error return code in ipmi_powernv_probe()
  mac80211_hwsim: fix possible memory leak in hwsim_new_radio_nl()
  kconfig: Fix expr_free() E_NOT leak
  kconfig: Fix automatic menu creation mem leak
  kconfig: Don't leak main menus during parsing
  watchdog: sp5100_tco: Fix watchdog disable bit
  PCI: Add dummy pci_irqd_intx_xlate() for CONFIG_PCI=n build
  MIPS: Fix clean of vmlinuz.{32,ecoff,bin,srec}
  nfs: Do not convert nfs_idmap_cache_timeout to jiffies
  IB/cq: Don't force IB_POLL_DIRECT poll context for ib_process_cq_direct
  spi: a3700: Clear DATA_OUT when performing a read
  net: stmmac: dwmac-meson8b: propagate rate changes to the parent clock
  net: stmmac: dwmac-meson8b: fix setting the RGMII TX clock on Meson8b
  ubifs: Fix uninitialized variable in search_dh_cookie()
  blk-mq: turn WARN_ON in __blk_mq_run_hw_queue into printk
  dm mpath: return DM_MAPIO_REQUEUE on blk-mq rq allocation failure
  dm thin: fix documentation relative to low water mark threshold
  iommu/vt-d: Use domain instead of cache fetching
  powerpc: System reset avoid interleaving oops using die synchronisation
  iommu/exynos: Don't unconditionally steal bus ops
  perf record: Fix failed memory allocation for get_cpuid_str
  tools lib traceevent: Fix get_field_str() for dynamic strings
  perf callchain: Fix attr.sample_max_stack setting
  tools lib traceevent: Simplify pointer print logic and fix %pF
  perf unwind: Do not look just at the global callchain_param.record_mode
  scsi: qla2xxx: Fix warning in qla2x00_async_iocb_timeout()
  i40iw: Zero-out consumer key on allocate stag for FMR
  i40iw: Free IEQ resources
  Input: synaptics - reset the ABS_X/Y fuzz after initializing MT axes
  libbpf: Makefile set specified permission mode
  Input: psmouse - fix Synaptics detection when protocol is disabled
  PCI: Add function 1 DMA alias quirk for Marvell 9128
  selftest: ftrace: Fix to pick text symbols for kprobes
  xprtrdma: Fix backchannel allocation of extra rpcrdma_reps
  platform/x86: dell-laptop: Filter out spurious keyboard backlight change events
  KVM: s390: use created_vcpus in more places
  tracing/hrtimer: Fix tracing bugs by taking all clock bases and modes into account
  netfilter: ipv6: nf_defrag: Pass on packets to stack per RFC2460
  KVM: PPC: Book3S HV: Enable migration of decrementer register
  RDMA/core: Clarify rdma_ah_find_type
  kvm: x86: fix KVM_XEN_HVM_CONFIG ioctl
  ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read()
  ALSA: hda - Use IS_REACHABLE() for dependency on input
  ACPI / LPSS: Do not instiate platform_dev for devs without MMIO resources
  NFSv4: always set NFS_LOCK_LOST when a lock is lost.
  x86/tsc: Allow TSC calibration without PIT
  firewire-ohci: work around oversized DMA reads on JMicron controllers
  usb: musb: Fix external abort in musb_remove on omap2430
  usb: musb: call pm_runtime_{get,put}_sync before reading vbus registers
  usb: musb: fix enumeration after resume
  drm/i915/bxt, glk: Increase PCODE timeouts during CDCLK freq changing
  drm/i915: Fix LSPCON TMDS output buffer enabling from low-power state
  drm/i915: Do no use kfree() to free a kmem_cache_alloc() return value
  drm/i915/audio: Fix audio detection issue on GLK
  drm/i915/gvt: throw error on unhandled vfio ioctls
  drm/vc4: Fix memory leak during BO teardown
  x86/tsc: Prevent 32bit truncation in calc_hpet_ref()
  clocksource/imx-tpm: Correct -ETIME return condition check
  x86/acpi: Prevent X2APIC id 0xffffffff from being accounted
  btrfs: fix unaligned access in readdir
  cifs: do not allow creating sockets except with SMB1 posix exensions
  UPSTREAM: module: Do not paper over type mismatches in module_param_call()
  UPSTREAM: treewide: Fix function prototypes for module_param_call()
  UPSTREAM: module: Prepare to convert all module_param_call() prototypes
  UPSTREAM: kbuild: add clang-version.sh
  UPSTREAM: console: Expand dummy functions for CFI
  UPSTREAM: console: SisUSB2VGA: Drop dummy con_font_get()
  ANDROID: sdcardfs: Set s_root to NULL after putting
  ANDROID: sdcardfs: d_make_root calls iput
  ANDROID: sdcardfs: Check for private data earlier
  ANDROID: sched: Remove duplicate const specifier

Conflicts:
	kernel/sched/sched.h

Change in module_param_call() definition requires alignment in:

	drivers/hwtracing/coresight/coresight-event.c
	drivers/power/reset/msm-poweroff.c

Change-Id: I0114d2226301af0b1775b37d79db5529653b135d
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2018-04-26 10:14:52 -07:00
Lingutla Chandrasekhar
f42416dabb power: reset: Support Minidump select option in dump type
On system crash, some targets are able to collect Minidump,
so add option to collect fulldump as well as minidump or both dumps.
This is snapshot of minidump driver support in msm-4.4,
'commit f4beb492260b ("power: reset: msm: add support to select both
dumps")'

Change-Id: I090653097ba12abb4fc0a1ff44bf155cc0d7a3ed
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2018-04-17 11:44:09 -07:00
Channagoud Kadabi
7805103be7 drivers: msm-poweroff: Flush all caches during reset
During reset path flush all the caches so that the kernel logs and data
structures are available as part of the ddr dump for debugging.

Change-Id: Iec2bc0de9c9b90e2f42fe0c11e636d86cc7eeac1
Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
2018-01-24 11:58:16 -08:00
Prasad Sodagudi
ec2c1980d4 power: reset: Remove secure boot mode check
Debug policy of secure devices take care of nullifying
the ram dumps in secure boot mode. So no need to check
about secure boot mode in reboot driver to enable
download feature.

Change-Id: Idb5c93aca630f0093fccc2997bf50e7958dfbf54
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2017-10-11 14:39:07 -07:00
Prasad Sodagudi
adcb42885b power: reset: Remove deprecated APIs usage related to SCM
Remove the scm related deprecated APIs getting
used in poweroff driver. As specially is_scm_armv8()
not supported from scm driver interface.

Change-Id: I6ef5690a6263f26dbe33ba5052bdfd171585081e
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2017-08-08 21:15:53 -07:00
Prasad Sodagudi
fb6ac91fd7 power: reset: Skip emmc_dload sysfs entry creation
Do not create /sys/kernel/dload/emmc_dload sysfs entry
when imem-dload-type is not defined and also fix error
paths of sysfs entry creation.

Change-Id: I354e1f7635c5163516e256ed71b8510d1665877d
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2017-08-08 21:15:35 -07:00
Prasad Sodagudi
2ee2544098 power: reset: Disable SDI when dload mode is not supported
Based on the kernel parameter download_mode, disable the SDI
execution. Also disable SDI execution for kernel panic/crash
scenarios. Currently SDI is getting executed for kernel crash/panic
scenarios, but it does not required in these scenarios.

Change-Id: I5a64107e2bf210f82d94ab03c4f86f27f9a330c8
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2017-08-08 21:15:02 -07:00
Prasad Sodagudi
e3b613a380 power: reset: Add support for EMMC dload
Add sysfs entry to support emmc dload mode.
Adds /sys/kernel/reset/emmc_dload entry to enable or disable
emmc dload mode support.

Change-Id: If38135427304316b03d3193ad16d335605e9c143
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2017-08-08 21:10:15 -07:00
Lijuan Gao
a7371149b8 power: reset: Disable SDI when dload mode is disabled
Add function to auto disable the SDI when the ramdump is disabled.
And make the device do hard reset at the same time.

Change-Id: I14e2d13792ef535364a082cdaed0b79c262ecfe5
Signed-off-by: Lijuan Gao <lijuang@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2017-08-08 21:09:30 -07:00
Channagoud Kadabi
153b85ae1e power: reset: Store KASLR offset in IMEM
Store kaslr offset in IMEM entry for debugging

Change-Id: I7520d13f0b25816f22f8beab28af812dba812abd
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
2017-08-08 21:07:56 -07:00
Kyle Yan
e939bfaf7c power: reset: Fix compilation error when CONFIG_QCOM_DLOAD_MODE=n
Move definitions out of ifdef for CONFIG_QCOM_DLOAD_MODE to allow
compilation when only CONFIG_POWER_RESET_QCOM is set. Also remove
flush_cache_all as it has been removed upstream.

Change-Id: Ic111d719e8a6ed93aa085bfd576b5277c4602f74
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2017-08-08 21:03:57 -07:00
Channagoud Kadabi
09065ffedf power: reset: replace upstream msm-poweroff driver
This is a snapshot of the msm-poweroff driver as of msm-4.4 commit
<c605e110ab18604> (Merge "usb: gadget: composite: Return bcdUSB 0x0310
for Superspeed and higher").

In addition, make this driver selectable when ARCH_MSM || ARCH_QCOM and
fix coding style issues.

CRs-Fixed: 1058357
Change-Id: Icf928f2db324ad3193b1f969c516d84149b18531
Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
[psodagud: fixed up trivial merge conflict]
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2017-08-08 21:02:56 -07:00
Pramod Gurav
18a702e0de power: reset: use restart_notifier mechanism for msm-poweroff
This change replaces use of arm_pm_restart with recently introduced
reset mechanism in Linux kernel called restart_notifier.

Choosing priority 128, which is default priority, as according to
documentation, this mechanism is sufficient to restart the entire system.

Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Josh Cartwright <joshc@codeaurora.org>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-pm@vger.kernel.org

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2014-09-26 19:54:33 +02:00
Abhimanyu Kapur
78be3176c4 power: reset: Add msm restart support
Add support for restart and poweroff functionality present on MSM chipsets
with the MPM2 ps-hold hardware.

Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Tested-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-08-09 11:47:53 -07:00