Although image information is already available in sysfs,
only root has the ability to write to the select_image node,
a necessary step for reading the CRM, variant and version
info for a specific image. Additionally, multiple clients
cannot safely read the image information without some
caller-side locking to prevent updates of the select_image
node while one of the other files are being read.
Work around this by introducing a new 'images' node that
can be used to dump information about all images without
the need to write to select_image, and make it readable
to non-root.
Change-Id: I71dfda8c7c170b35a66f2f740202a8a79e8b8c0c
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Add new hardware platform type for RCM boards.
Change-Id: Ie3708cf1444691ebb1fa7708764808d58bba794a
Signed-off-by: Aparna Mallavarapu <aparnam@codeaurora.org>
When support for socinfo v0.11 was added, the necessary switch/case
update for sysfs node creation was not added. As a result, many
socinfo sysfs nodes are missing. Add them back.
Change-Id: Ic79c9de22d04d4da7e86e273ab80f9efdafb58d5
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Add SOC chip ID information for apq8096.
Change-Id: I76822bb3750f1e1d237ce87be7528dccb0306b51
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
socinfo exports a number of APIs left over from the days before
device tree, for targets which are no longer supported in the
current kernel. Remove these unused APIs:
get_core_count()
read_msm_cpu_type()
cpu_is_*()
soc_class_is_*()
Change-Id: I2fb23c44649f0582fb0e2523a0235470f76a3da9
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
These comments are documenting something that fairly obvious,
yet the comments themselves are incorrect. They should use '>='
not '=='. Just remove them to save a few lines.
Change-Id: I2964478a21a01c1d3b684d49678a9bf212ff01fa
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Presently, if the bootchain updates the socinfo format version,
a corresponding change to the Linux soconfi driver must first be
made to avoid an "Unknown format found" error.
Avoid this by taking advantage of the fact that new format versions
with the same major version number are defined to be backward-
compatible with older formats having the same major number.
Change-Id: I985a46eeefaacd3425bbc17f72fe09b86264f8b1
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
The v0.11 format adds two new fields:
uint32_t num_pmics;
uint32_t pmic_array_offset;
where num_pmics is the number of PMICs in the system and
pmic_array_offset is the offset from the start of the socinfo
struct, in bytes, to the start of an array of size 'num_pmics'
with pmic struct members:
struct pmic {
uint32_t pmic_model;
uint32_t pmic_die_revision;
};
The legacy PMIC model and revision fields defined in previous
versions of socinfo will continue to be populated with the
first three PMICs, however the full list (including those
three) can be found at pmic_array_offset.
Change-Id: I554f70f8b3ac1cf82eb1fed1180dd9c5dcbe39e6
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
socinfo format v0.10 introduced a serial number field, which is
presently only printed at boot, and not made visible via sysfs.
Make it readable from sysfs also.
Change-Id: I523c6cb8829c0dfee31b35913e085cf3996ef21a
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Avoid the repeating "__func__" in every print to reduce code
clutter. No functional change is expected due to this.
Change-Id: I88a3d9ce22785cc9a99fa50a38ce3686cae45f2a
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
The socinfo format version includes a 16-bit major field number
field that has always been zero, but may be changed in the future
to indicate a non-backwards-compatible format change. Update
current prints and checks to properly interpret both the major
and minor components.
Change-Id: I87a6d2e3f9379662857e03bb5b7e918f699c61ab
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Instead calling smem_find() repeatedly with different sizes
for SMEM_HW_SW_BUILD_ID, call smem_get_entry() which returns
a pointer to the region regardless of its size.
Change-Id: If68ab31f808e2ecb740e1560ec5d9a7edd9a8c9f
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
With the official announcement of 8976, remove all references to its
internal code name, and replace them with 8976.
Change-Id: Iadedabf16a7bef92c582524ae6ea38b31ba26ac4
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Move the "Snapdragon" string from the machine node to the
previously-unused family node. The machine node is updated
to instead contain the SoC name (ex. "MSM8996"). The soc_id
field remains untouched, and contains the numerical id
corresponding to the specific SoC variant
Change-Id: I659bdc0516cd85ed44d8b4a337411b540e3e404f
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
This is a snapshot of the socinfo driver as of
msm-3.14 commit:
3bc54cf86bdc7affa7cd4bf7faa3c57fe8f8819d (Merge "msm:
camera: Add dummy sub module in sensor pipeline")
Change-Id: I6b5b866ede0e84432fad460e9d95babfdbc556fc
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Write magic cookies/PON reset reason to indicate reasons
of dm-verity corruption, re-enable enforcing mode, and
(unrelated) keys clear.
Change-Id: I49904c79940515863d794b23fa7ac84e472b2466
Signed-off-by: David Ng <dave@codeaurora.org>
Present, hard resets are used only when rebooting for "recovery",
"rtc", or "bootload" reboot commands or when the reboot command
is an empty string. Perform hard resets for invalid reboot commands
also, to avoid accidental warm resets if an invalid reboot command
is mistakenly used.
Continue to use warm resets for entry into download mode. This is
required for collection of ramdumps.
Change-Id: I71f657e9c8c20abcbbda86d789c843060c8ffce7
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Rebooting to recovery, bootloader and rtc should be treated as
hard reset if PMIC sparse regs are used to store reset reason.
Otherwise it should be set as warm reset to keep compatible with
legacy design. So correct logic of need_warm_reset here.
Change-Id: Ica173cc379df16a28f11bf5da87cb928e73ecdfb
Signed-off-by: Lijuan Gao <lijuang@codeaurora.org>
The set_dload_mode() call in msm_restart_probe() may depend
on the TCSR base address, which is initialized later in the
probe function. Move this call to the end of
msm_restart_probe() to avoid potentially trying to use an
uninitialized resource.
Change-Id: I65c408f065cc7c68a929ec43d50b0a493942a189
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Since the qcom,pshold device now supports up to two
distinct register definitions, add the 'reg-names' property
to assign names to the memory resources, rather than
relying on resource numbering.
Change-Id: Ie0bc5eae0119901239efae05357ae107a112b87a
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Some targets require that the Download Mode / EDL
configuration be performed by means of a Secure I/O write
to the TCSR_BOOT_MISC_DETECT register rather than through a
generic SCM operation. Provide a mechanism for specifying
the address of this register in the device tree, to use as
a fallback method if the generic SCM call to set the
download mode configuration is unavailable.
This is necessary to comply with atomicity requirements of the
secure environment.
Change-Id: I5d3fcb48b0b47815d4839a3b722b0462a1bca087
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Support a new SCM call which disables the PMIC arbiter and
deasserts PS_HOLD in a single operation. Fall back on the
legacy behavior of disabling the PMIC abriter and directly
deasserting PS_HOLD if this call is not available.
This is necessary comply with atomicity requirements of the
secure environment.
Change-Id: Ia3b13d469932edf94d3249fa3e7234a1c12eee1b
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
We only define in_panic when CONFIG_MSM_DLOAD_MODE is enabled. Otherwise
we get the following compile error:
drivers/power/reset/msm-poweroff.c: In function ‘do_msm_restart’:
drivers/power/reset/msm-poweroff.c:276:28: error: ‘in_panic’
undeclared (first use in this function)
if (WDOG_BITE_ON_PANIC && in_panic)
^
drivers/power/reset/msm-poweroff.c:276:28: note: each undeclared identifier
is reported only once for each function it appears in
Just add simple #ifdef CONFIG_MSM_DLOAD_MODE around the code to fix.
Change-Id: I01f8641e90dd000813127a5b8ce730529f3485cc
Signed-off-by: Kumar Gala <galak@codeaurora.org>
In certain cases during a kernel panic,the interrupts on non-panicking
CPUs are disabled. Since CPU context cannot be collected by sending IPI
to those CPUs, we're limited to debug the problem. Forcing a watchdog
bite during kernel panic will ensure us getting the proper CPU context.
Hence adding support for the same.
Change-Id: Id06030d9bc46d94209da7f0ef8c47bfd3477baf6
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
[abhimany: resolve trivial merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
The SCM library now provides a new API that implements
a secure world syscall interface that is more aligned
with the ARMv8 SMC calling convention. Add support for
this new API.
Change-Id: Ia76309de556e97e43c1e8ab782f89c4115d5fac6
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
This is a snapshot of the msm-poweroff driver as of msm-3.10 commit
acdce027751d5a7488b283f0ce3111f873a5816d (Merge "defconfig: arm64: Enable
ONESHOT_SYNC for msm8994")
In addition, make this driver selectable when ARCH_MSM || ARCH_QCOM.
Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
[abhimany: resolve trivial merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Change-Id: Ifca5e017ad67cd78cbd507864fd3a0ee37d8713e
SMP2P is a simple, low-latency interprocessor communication protocol for
communicating simple state changes between processors in the SoC.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
module_init() declaration has moved from init.h to module.h. Fix the
"implicit module_init() declaration" compile-time error by including
the module.h header file.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
The internals of irq_domain data structure has changed and of_node element
has been replaced with fwnode element.
Use irq_domain_get_of_node accessor to refer to of_node element in
irq_domain data structure.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
set_irq_flags is ARM specific with custom flags which have genirq equivalents.
The translation of flags is as follows:
IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN
For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
This snapshot is taken as of msm-3.18 commit e70ad0cd (Promotion of
kernel.lnx.3.18-151201.)
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Olof Johansson <olofj@chromium.org>
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206724
Git-commit: a98a5186344c027fb53506994ce93f7af8a79960
Git-repo: https://chromium.googlesource.com/chromiumos/third_party/kernel
[joonwoop@codeaurora.org: fixed merge conflict in arch/arm64/Kconfig.
removed Change-Id tag from commit text.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Use the upstream naming convention and update the ufs driver
compatible string.
Change-Id: I599f774a92ad2f795f0c49ce095b26173f597b24
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
ifdef msm-bus include and api's with CONFIG_MSM_BUS_SCALING.
This makes compiling UFS driver clean when MSM_BUS_SCALING
is not enabled.
Change-Id: I50a3f43c7c1deb1033d4ece1493e0f205d8ed553
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
ifdef qcom ufs crypto related code based on CONFIG_SCSI_UFS_QCOM_ICE.
This makes compiling UFS driver clean when QCOM_ICE is not enabled.
Change-Id: I57917ccfa76bc1e80f15a024d1fefd15e0e902da
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
The function signature of bio_end_io_t is changed in 4.4 kernel and
the error value is assigned in bi_error field of the bio struct, so
just free the bio after bio completion.
Change-Id: I08f64d8d51ae401fa608351b90b1120d8b84605f
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
nr_pending can go negative if we attempt to decrement it without matching
increment call earlier. If nr_pending goes negative, LLD's runtime suspend
might race with the ongoing request. This change allows decrementing
nr_pending only if it is non-zero.
Change-Id: I5f1e93ab0e0f950307e2e3c4f95c7cb01e83ffdd
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Adding a new element "tsk_dirty" to struct page increases the size
of mem_map/vmemmap, restrict this to a debug only functionality to
save few MB of memory.
Considering a system with 1G of RAM, there will be nearly 262144
pages and thus that many number of page structures in mem_map/vmemmap.
With pointer size of 8 bytes on a 64 bit system, adding this
pointer to "struct page" means an increase of "2MB" for mem_map.
CRs-Fixed: 738692
Change-Id: Idf3217dcbe17cf1ab4d462d2aa8d39da1ffd8b13
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[venkatg@codeaurora.org: Fixed trivial merge conflict]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Background writes happen in the context of a background thread.
It is very useful to identify the actual task that generated the
request instead of background task that submited the request.
Hence keep track of the task when a page gets dirtied and dump
this task info while tracing. Not all the pages in the bio are
dirtied by the same task but most likely it will be, since the
sectors accessed on the device must be adjacent.
Change-Id: I6afba85a2063dd3350a0141ba87cf8440ce9f777
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[venkatg@codeaurora.org: Fixed trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
spin_lock_irq() / spin_unlock_irq() is used so interrupts are
enabled after unlocking the spinlock. However, it is not guaranteed
they were enabled before.
This change uses the proper irqsave / irqrestore variants instead.
Without it, a spinlock recursion on the scsi request completion path
is possible if completion interrupt occurs when used for UFS testing.
Change-Id: I25a9bf6faaa2bbfedc807111fbcb32276cccea2f
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Expose "sector_range", which will indicate to the low-level driver
unit-tests the size (in sectors, starting from "start_sector") of the
address space in which they can perform I/O operations. This user-defined
variable can be used to change the address space size from the default
512MiB.
Change-Id: I515a6849eb39b78e653f4018993a2c8e64e2a77f
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
Unit tests submit large requests of 512KB made of 128 bios.
Current allocation was done via kmalloc which may not be able
to allocate such a large buffer which is also physically contiguous.
Using kmalloc to allocate each bio separately is also problematic as
it might not be page aligned. Some bio may end up using more than a
single memory segment which will fail the mapping of the bios to
the request which supports up to 128 physical segments.
To avoid such failure, allocate a separate page for each bio
(bio size is single page size).
Change-Id: Id0da394d458942e093d924bc7aa23aa3231cdca7
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[venkatg@codeaurora.org: Drop changes to mmc_block_test.c]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Current test-iosched design enables running only a single test
for a single block device.
This change modifies the test-iosched framework to allow running
several tests on several block devices.
Change-Id: I051d842733873488b64e89053d9c4e30e1249870
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
[merez@codeaurora.org: fix conflicts due to removal of BKOPs UT]
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[venkatg@codeaurora.org: Drop changes to ufs_test.c and
mmc_block_test.c]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
blk_run_queue() takes the queue spinlock and disabled irqs.
Consider the following callstack:
blk_run_queue
->__blk_run_queue
-> scsi_request_fn
-> blk_peek_request
-> __elv_next_request
-> elevator_dispatch_fn
-> test_dispatch_requests
-> test_dispatch_from
test_dispatch_from() will release the test-iosched spinlock
using spin_unlock_irq which will enable interrupts, however,
caller is assuming interrupts are disabled.
An interrupt can occur now and scsi soft-irq may be scheduled
with the following call stack:
scsi_softirq_done
-> scsi_finish_command
-> scsi_device_unbusy
scsi_device_unbusy() tries to lock the queue spinlock which was
previously locked when blk_run_queue was called, resulting in a
spinlock recursion.
Change test_dispatch_from() to use the spinlock irq save/restore variants
to prevent enabling the irq in case they were previously disabled.
Change-Id: Icaea4f9ba54771edb0302c6005047fcc5478ce8d
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
When running a test, a timer was set to detect test timeout
and to unblock the wait_event() function which is waiting for the
test to finish. This is redundant as wait_event timeout variant
gives the same functionality without the overhead of managing a
timer for this purpose and improve code readability.
Change-Id: Icbd3cb0f3fcb5854673f4506b102b0c80e97d6bb
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
The UFS tests are used for testing the functionality and performance
of the UFS driver. Some of the tests call compare_buffer_to_pattern
for data integrity checking. This function should be exposed in order
to allow compilation of ufs_test as a module.
Change-Id: I2279b0ae9dbdf4ecad073fab2b15116be2ea1713
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>