When a USB function wishes to send new data during USB suspend state, it
needs to issue USB remote wakeup and send a function wakeup notification
after then. This scenario leads to recursive spin locking inside the
_usb_func_wakeup() function, because this function gets called recursively.
This function issues remote wakeup, which internally calls the resume
interrupt callback, which calls the _usb_func_wakeup() function again.
This issue is resolved by performing the remote wakeup in a deferred work
context, and this splits the recursion loop.
CRs-fixed: 700667
Change-Id: I59c8efde098781587d29f08cd60e4aa3521949d8
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
When a SS-USB function wishes to wake up the USB bus, it needs to send a
SS-USB function wakeup notification to the USB host after the bus is
resumed. For this purpose a function wake up pending flag is used to notify
the resume callback that a function wake up notification needs to be sent.
However, sometimes there is a race condition in which the resume interrupt
is fired before the function wakeup function is complete, and this leads to
an incorrect state of the function wakeup pending flag. This patch
resolves this issue by adding locks in the critical sections.
CRs-fixed: 695399
Change-Id: I8f15ac0c433301d6364a49cb31577e30259aa0b9
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
In Super-Speed mode, when the USB core wishes to issue remote wakeup due to
new data arriving on the BAM to BAM path, it needs to send Function Wakeup
notification to the USB host after the USB bus is resumed. However, the
sending of this notification fails when the USB core needs to wake up from
low-power mode, because the low-power mode exit is done asynchronously and
the sending of the Function Wakeup notification can not be done until the
USB bus is resumed.
This patch fixes this issue by checking whether the USB bus is suspended,
and if so, the sending Function Wakeup notification is delayed until the
USB bus is resumed.
Change-Id: I293476aaaf920b67fdbdf72a63524edc7a35750b
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
The USB 3.0 specification defines a new 'Function Suspend' feature.
This feature enables the USB host to put inactive composite device
functions in a suspended state even when the device itself is not
suspended. This patch extends the existing framework of USB gadget
to properly support the 'Function Resume' and 'Function Remote Wakeup'
related features.
Change-Id: I51713eac557eabc7b465d161377c09d4b6afa152
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
This snapshot is taken as of msm-3.18 commit 1513280 (Merge "platform: msm: msm_bus:
Fix memory leak during client unregister)"
Change Kconfig option to say QCOM_BUS* instead of MSM_BUS*
Change-Id: I6dd9aba5b26984a914714ca49ae7253c1f267b4b
Signed-off-by: David Dai <daidavid1@codeaurora.org>
The SET_CONFIGURATION control request's status phase is delayed
till the new config change is handled by the file-storage thread.
If the cable is disconnected or the bus is reset before the
previous config is handled, then composite driver is not notified
about the delayed status. As a result of which, the delayed_status
field of composite device structure remains non-zero. The status
phase of next SET_CONFIGURATION control request is not sent.
This makes the gadget unusable.
Calling usb_composite_setup_continue() after the disconnect or reset
does not make any sense. If the host sends another control request
before the status phase of the previous control request is sent, the
delayed_status must be reset to zero. This is not straight forward
as the UDC handles some control requests without delegating them to
the composite driver. A simple fix would be resetting the delayed
status value after the disconnect/reset.
CRs-Fixed: 501527
Change-Id: I67c832afc88c9e7d025247e539b7223fd83644d7
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Moving towards device tree and arm single binary referring to
machine descriptor name for hardware id information under
/proc/cpuinfo is not suitable for certain soc vendors. Add a
hook for soc vendors to supply a per-soc hardware read method.
[abhimany: resolved minor merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Conflicts:
arch/arm64/kernel/setup.c
Change-Id: I6c38a0c0dbf93acec6f6f67498c01c046a13e506
'images' sysfs node is supposed to dump information about
all images without the need to write to select_image. But
As it doesn't look up the next image correctly after a image
which doesn't have information in SMEM, it prints only the
information of the fist a few images. After increase the
correct offset of SMEM address, 'images' can print all
information correctly.
Change-Id: I08dfb2812bde42dd661d5a85d473eaf60ef215c5
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
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>