Coverity complains CID 3411292: Improper use of negative valure
(NEGATIVE_RETURNS), as possibly assign a negative value to unsigned
int, fix it by use an int temp value for negative value return.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit 9ab72e25fcda73a455a434993c8186663c241f27)
Fix the b value to be compliant with FIPS 186-4 D.1.2.1. This fix is
required to make sure the SP800-56A public key test passes for P-192.
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit aef66587f1)
(cherry picked from commit b179af3efe0c48c2cec4e4add7f3c4b8129d7a07)
The iMX6 platform does not support fardware GCM, more
recent iMX does so we enable it.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(cherry picked from commit 2a4e35399f37caff111d420866a9d4beb494e2e9)
A tagged key is a key which has been tagged with metadata
using tag_object.h API.
We add the support for these keys to caamalg.
For each algo of caamalg which supports tagged keys , it is done by:
- Creating a modified version of the algo
- Registering the modified version
- When the modified transform is used, it gets
the load parameter of the key.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(cherry picked from commit 88dee97d985890dbf37cafa7934c476d0ecfd0b3)
Add functions to tag an object with metadata(configuration).
It is possible to:
- create metadata:
- init_tag_object_header
- init_blackey_conf
- set_tag_object_conf
- retrieve metadata:
- get_tag_object_conf
- get_blackey_conf
The API expects an object to be a space a memory
with an address and a size.
The implementation of the tag is currently exposed
but users shouldn't access it directly, they should
use the functions provided.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(cherry picked from commit ebbb132da8e7f9de7f3d375eff8d87f684feb1eb)
When CONFIG_PM is not defined, the runtime suspend and resume
are unused so we should use __maybe_unused attribute.
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit b2285d1937872b5023074644d0a8f7c9a2e3158a)
It is error prone to use soc_enum array for controls because introducing
new controls must always be done at the end of array or it will add
offset to existing controls.
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
(cherry picked from commit 409e235cb0e3fbf48251375e040d7f37b2734be2)
Default value must be prefixed by "0".
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit e1f214bd631bda58ab7850866447a53e4a479ac8)
Default value must be prefixed by "0".
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 1a8e10215cc07c83b0e26b55fef94aae18151633)
a) Default value must be prefixed by "0".
b) Map 2 pins case to rx=0xff tx=0x11.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit cb4d69f098ee003edc2dcfec7075b043a78345e6)
Default value must be prefixed by "0".
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit a38075f068fd07dda55cb5bb5d74450ba29d6483)
Default value must be prefixed by "0".
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit b81a9884f85f750673a4ee0da60096d330add7a5)
a) Default value must be prefixed by "0".
b) Map 2 pins case to rx=0xff tx=0x11.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit bb1d5eac8b6ba4371ec04f362071c06cd3f5066b)
Default value must be prefixed by "0".
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 5252bd4b838eaa849fafdfa42a9e322a012a1e98)
Default value must be prefixed by "0".
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 4ce702331a6c7b5a84fe4fdc210b62147e04fa84)
The patch enable mapping the number of pins required to play or record
a specific number of channels to a specific dataline mask.
Three consequent elements in "fsl,dataline" and "fsl,dataline,dsd" defines a
particular mapping, for instance for: fsl,dataline = "0 0xff 0xff 2 0x11 0x11"
there are two mappings defined:
default (0 pins) "rx" and "tx" dataline masks: 0 0xff 0xff
2 pins "rx" and "tx" dataline masks: 2 0x11 0x11
In case if property is missing, then default value "0 0x1 0x1" is considered.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
(cherry picked from commit 707fdf7759c0e11abf84573eb60bba104d681736)
If the FMT of tx and rx is different, there will be issue. for example
tx is working at TDM mode, but rx want to work at I2S mode, this case
is not supported in current ALSA driver, the best way to support this
is to distinguish substream in set_fmt function.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 897e9e8b4e7a59d81048d05f9377b8c68fc7cd64)
TDM mode can only work with codec slave mode, and the mclk
frequency should be 256FS.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 769121ead6ef8919b7f6869defe594be978d82cd)
add more rates in constraint list, Fixes commit ee959e2c9b
("MLK-19581-3: ASoC: fsl_rpmsg_i2s: support multipul rate and DSD format")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit bcc6185a392b46d2b5af315894b06e6ebaff8046)
1. reset firmware if core is hang the next time you open it.
2. add mb() before rpc_update_cmd_buffer_ptr_encoder
Signed-off-by: ming_qian <ming.qian@nxp.com>
To make sure that the message wound't be discarded when
M4 is running normally or in the suspend mode. Only use
the timeout mechanism by the first notify when the vdev
is registered.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
(cherry picked from commit aaf42a6c2c224aa9bd88b13abcf8f848f2eab073)
Set allow_zero_bytesused, to let gst-launch work, this lead to the need
to implement V4L2_DEC_CMD_STOP, dummy for now.
Implement g_fmt_vid_cap, called by gst-launch before queuing any capture
buffers, this also required some fixes in jpeg_parse and buf_queue,
which wrongly assumed capture buffers are enqueued before output buffers.
So, import the resolution and pixel-format from the output queue,
if the capture queue is not set-up yet.
Add release_active_buffers and use it in stop_streaming to properly
clean-up active buffers, this fixes warning at gst-launch stop with Ctrl+C
Check for decoding/encoding error in interrupt handler and print CAST IP
error status, found some yuv422 images with errors in SOS marker.
Partially implemented subscribe_event, V4L2_EVENT_EOS is not working yet,
will be addressed in a subsequent fix.
Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com, Robert Chiras <robert.chiras@nxp.com>
Configure the interrupt for ADV7535 so that it can generate interrupts
events for HDP when the HDMI cable is plugged in or out.
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
CID 3869707: Resource leak (RESOURCE_LEAK)
13. leaked_storage: Variable fhandler going out of scope leaks
the storage it points to
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit ddf57217892e9fefc4f04a09988f4b0ed3bf0f07)
CID 3869705: Unsigned compared against 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero comparison of an
unsigned value is always true. attr_count >= 0.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 7380600ba0d0763b6081c07f5ddcb018a54314ca)
CID 3869704: Wrong sizeof argument (SIZEOF_MISMATCH)
suspicious_sizeof: Passing argument f1a->button_control.txrx_map of
type unsigned char * and argument 8 /* sizeof (f1a->button_control.txrx_map) */
to function synaptics_rmi4_i2c_read is suspicious.
Passing argument should be sizeof(unsigned char) rather than
sizeof(unsigned char *).
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 4583a0bc1ff6684e1d850eb50308ad8ae2fea627)
Unable to handle kernel paging request at virtual address 1000100
[<ffff000008274ed8>] prefetch_freepointer.isra.37+0x8/0x14
[<ffff0000087bd3b0>] sync_file_create+0x28/0xc0
[<ffff000008b7c7e4>] gckOS_CreateNativeFence+0x74/0x110
[<ffff000008b89a78>] gckKERNEL_Dispatch+0xa54/0x15b0
[<ffff000008b8a8b8>] gckDEVICE_Dispatch+0x2e4/0x2f8
[<ffff000008b81160>] drv_ioctl+0x110/0x21c
[<ffff0000082b4478>] do_vfs_ioctl+0xb8/0x8b0
[<ffff0000082b4cf4>] SyS_ioctl+0x84/0x98
The reference count should be increased in one spin lock cycle.
Move spin lock out of _QueryIntegerId function.
Move signal reference count to gckOS_CreateNativeFence.
Change-Id: I1bf89b4de6055e5d0009baf7287f600696c4a529
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
During the time window of noirq suspend and noirq resume, if a GPIO
pin is enabled as system wakeup source, the corresponding GPIO line's
IRQ will be unmasked, and GPIO bank will NOT lost power, when GPIO irq
arrives, generic irq handler will mask it until GPIO driver is ready
to handle it, but in GPIO noirq resume callback, current
implementation will restore the IMR register using the value saved in
previous noirq suspend callback which is unmasked, so this GPIO line
with IRQ pending will be unmasked again after GPIO IMR regitster is
restored, ARM will be triggered to handle this IRQ again, because of
the change of commit bf22ff45be ("genirq: Avoid unnecessary low
level irq function calls"), the mask_irq function will check the
status of irq_data to decide whether to mask the irq, in this
scenario, since the GPIO IRQ is being masked before GPIO noirq resume,
IRQD_IRQ_MASKED flag is set, so the second time GPIO IRQ triggered by
restoring GPIO IMR register, the irq_mask callback will be skipped and
cause ARM busy handling the GPIO IRQ come all the way and no response to
user anymore.
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit c03d9ec1f861ff7cd04637ef01aa7e14388277b6)
disable intmux in m4 dts for it is component in m4 domain
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 252831d4b0699c9ee609613a7c00ab8f77bfbeb9)
disable intmux in m4 dts for it is component in m4 domain
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 2742df294bac6e1ccc1ed7e899c0b5c85a51ccbf)
Like commit d144dfea8a ("usb: chipidea: otg: change workqueue
ci_otg as freezable"), the power_lost work item may try to remove
hcd if controller is powered off during the system suspend, and
the similar deadlock happens, see below dumps.
Meanwhile, with this change, we need to disable USB interrupt
during the work item runs (after driver resume has finished),
otherwise, USB transfer will be timeout (5s) due to USB interrupt
is disabled and IAA watchdog is still not ready at that time.
Workqueue: events ci_power_lost_work
Call trace:
[<ffff000008085c44>] __switch_to+0x8c/0xd0
[<ffff000008d7bbf4>] __schedule+0x19c/0x5d8
[<ffff000008d7c068>] schedule+0x38/0xa0
[<ffff000008d7f3b4>] schedule_timeout+0x19c/0x338
[<ffff000008d7cc10>] wait_for_common+0xa0/0x148
[<ffff000008d7cccc>] wait_for_completion+0x14/0x20
[<ffff0000080e6040>] flush_work+0xd8/0x1f0
[<ffff0000080e61f4>] flush_delayed_work+0x3c/0x48
[<ffff0000081ae1c8>] wb_shutdown+0x90/0xd0
[<ffff0000081ae688>] bdi_unregister+0x58/0x1c0
[<ffff000008413a60>] del_gendisk+0x218/0x228
[<ffff00000871683c>] sd_remove+0x64/0xc0
[<ffff0000086b6eec>] device_release_driver_internal+0x154/0x1f0
[<ffff0000086b6f9c>] device_release_driver+0x14/0x20
[<ffff0000086b5d40>] bus_remove_device+0xc8/0x108
[<ffff0000086b2a08>] device_del+0x1f8/0x300
[<ffff0000087049ec>] __scsi_remove_device+0xec/0x128
[<ffff000008702c70>] scsi_forget_host+0x70/0x78
[<ffff0000086f7ee8>] scsi_remove_host+0xa0/0x140
[<ffff0000088e0588>] usb_stor_disconnect+0x50/0xc0
[<ffff00000887eab8>] usb_unbind_interface+0x78/0x280
[<ffff0000086b6eec>] device_release_driver_internal+0x154/0x1f0
[<ffff0000086b6f9c>] device_release_driver+0x14/0x20
[<ffff0000086b5d40>] bus_remove_device+0xc8/0x108
[<ffff0000086b2a08>] device_del+0x1f8/0x300
[<ffff00000887c364>] usb_disable_device+0xa4/0x210
[<ffff000008872cfc>] usb_disconnect+0x7c/0x240
[<ffff000008872e40>] usb_disconnect+0x1c0/0x240
[<ffff000008878e10>] usb_remove_hcd+0xc0/0x1d8
[<ffff0000088e7bac>] host_stop+0x34/0x90
[<ffff0000088e4088>] ci_handle_id_switch+0x70/0x1d0
[<ffff0000088e3038>] ci_power_lost_work+0x90/0xa8
[<ffff0000080e7100>] process_one_work+0x1e0/0x340
[<ffff0000080e72b0>] worker_thread+0x50/0x458
[<ffff0000080ed32c>] kthread+0xfc/0x128
[<ffff000008084eb8>] ret_from_fork+0x10/0x18
Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
(cherry picked from commit d217dacbe793641497b38f48d063a6332242e8a9)
At current code, it doesn't maintain ci->gadget.dev's runtime PM
status well. Eg, after system resume, call pm_runtime_put_sync for
ci->dev will cause ci->dev's runtime suspend is called if its
power.usage is 0 even the power.usage is 1 for its child ci->gadget.dev.
at that time. It causes the oops this ticket describes that visiting
clock without AHB clock.
To fix this issue, we use ci_hdrc device instead of ci->gadget.dev
for runtime PM APIs at udc driver, in the way, we handle runtime
PM APIs for single device structure.
Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
(cherry picked from commit d436b3a0a81b073b195d0ad29e7a4f39a1a532f3)
On i.MX8MM DDR4 EVK board, the GPIO pin to control LED is
NAND_CE3_B, correct it to make LED work properly and avoid
below failure message during kernel boot up:
[ 3.274994] leds-gpio leds: Error applying setting, reverse things back
[ 3.275015] leds-gpio: probe of leds failed with error -22
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
The iMX8QM HDMI voltage swing needs to be increased for HDMI compliance.
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
(cherry picked from commit 5ba997eef35fc74653c29bb99dbe4d97292dc6e4)
Driver does not free memory when it's removed or encounter
an error in probe. So fix potential memory leaks.
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit c236a94088903088f8ac32b12764b6d63ada43ea)
Add hardware reset for max9286 before initialization
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit dfc5061564b7d13d875f46bb883fe2e88a91e475)
Added hdmi cable plugin status check in v4l2 api function.
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
(cherry picked from commit 88613061e5f9bbe4ac45ac1064003275aec31abb)
CID 3925877: Resource leak (RESOURCE_LEAK)
14. leaked_storage: Variable pages going out of scope leaks the storage it points to.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit a38d1b1ff31ce87a231588de1a2e24a787f87143)
Drop xenvm soc data, we have userspace tool stack generate correct model
compatile and this soc data will also trigger issue on i.MX8QXP.
So drop it.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Flynn xu <flynn.xu@nxp.com>
(cherry picked from commit 9be6db046ac435f2caab7ab3561ea1a66144cdda)
Rename fsl-imx8qxp-mek.dts to fsl-imx8qxp-mek.dtsi.
remove /dts-v1/ from dtsi.
Add memreserve for dom0 dts.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 491045dead2f3294cb5ca78a6e667af00495ae48)
Config mem_printf base and size through structure DebugBufferDesc for
vpu decoder for debug on M0 core
Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
This fixes Coverity issue where an unsigned variable is tested for
less-than-zero value.
Make val a signed integer instead.
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Sandor Yu <sandor.yu@nxp.com>