This reworks the broken locking of the TX queue from ground up. The
locking was broken in many ways. It didn't protect the critical state
in ivshm_net_queue consistently, leaving phases from cleanup was reading
intermediate states while xmit was running. ivshm_net_tx_ok also has to
be covered by the lock because it tests both num_free and tail against
head. The new locking is reusing the TX queue lock of the device because
this is already held across ivshm_net_xmit.
Furthermore, there were many races between the sender and the receiver
around enabling and evaluating TX interrupts. One was about turning on
the TX completion interrupt only after signaling the submission of
packets. That could potentially cause the peer to miss the need for
signaling completion.
The other race that led to stalled senders was around not properly
re-checking for updates and not posting own updates while processing
freed TX descriptors in ivshm_net_tx_clean. Doing so could cause the
sender to miss that there are more free entries or cause the receiver to
stop signaling further free ones after kicking the sender for the first.
Acked-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Just pass in the net_device, and the function and can retrieve the mtu
itself.
Acked-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Use min/max_mtu to define the limits upfront. This also fixes changing
the MTU because the default values of those two prevented it so far.
Furthermore, all limits can be calculated during probe. Thus, there is
no need to validate anything in ivshm_net_change_mtu, provided updates
of a running device are rejected so that no queue can overrun.
Acked-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This contains the changes required to work with the new revision of
ivshmem in Jailhouse, namely:
- changed PCI vendor and device ID
- vendor capability to communicate region location
- new MMIO register layout
- common interrupt control register
- state table support, removal of rstate register
- unidirectional shared memory regions
- vector value has to be written to doorbell register
- support for multiple vectors, used to split config from tx-rx
Note: Specification work for the interface is ongoing, so details may
still change.
Acked-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
The audio PLL debug interface should be only registered when
the CONFIG_DEBUG_FS is enabled.
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
In ov5640_mipi_v2.c, driver don't implement get_register/set_register
callback but assign ov5640_get_register/ov5640_set_register to
v4l2_subdev_core_ops->get_register/set_register if define
CONFIG_VIDEO_ADV_DEBUG, so implement them in this patch.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
commit 9f952e2629 upstream.
Commit 8099f58f1e ("USB: hub: Don't record a connect-change event
during reset-resume") wasn't very well conceived. The problem it
tried to fix was that if a connect-change event occurred while the
system was asleep (such as a device disconnecting itself from the bus
when it is suspended and then reconnecting when it resumes)
requiring a reset-resume during the system wakeup transition, the hub
port's change_bit entry would remain set afterward. This would cause
the hub driver to believe another connect-change event had occurred
after the reset-resume, which was wrong and would lead the driver to
send unnecessary requests to the device (which could interfere with a
firmware update).
The commit tried to fix this by not setting the change_bit during the
wakeup. But this was the wrong thing to do; it means that when a
device is unplugged while the system is asleep, the hub driver doesn't
realize anything has happened: The change_bit flag which would tell it
to handle the disconnect event is clear.
The commit needs to be reverted and the problem fixed in a different
way. Fortunately an alternative solution was noted in the commit's
Changelog: We can continue to set the change_bit entry in
hub_activate() but then clear it when a reset-resume occurs. That way
the the hub driver will see the change_bit when a device is
disconnected but won't see it when the device is still present.
That's what this patch does.
Reported-and-tested-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Fixes: 8099f58f1e ("USB: hub: Don't record a connect-change event during reset-resume")
Tested-by: Paul Zimmerman <pauldzim@gmail.com>
CC: <stable@vger.kernel.org>
Link: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fr%2FPine.LNX.4.44L0.2004221602480.11262-100000%40iolanthe.rowland.org&data=02%7C01%7Cpeter.chen%40nxp.com%7C0c4a073d13d44cd9bb3a08d7eba40fdd%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637236962191385194&sdata=gGE2I8VS%2BT2%2BrssNXoPaUKtBIk7WgnVMka7KhiGpWLA%3D&reserved=0
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add DMA configurations for LPSPI nodes on i.MX8QX/QM/DXL.
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Enable lpspi3 by default for imx8dxl-evk and imx8dxl-ddr3-evk.
Add imx8dxl-evk-lpspi-slave.dtb to support lpspi3 slave mode on
imx8dxl-evk.
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
When suspend happen between enable-HW and wait-HW-ready, user can't
fetch correct HW registers value after resume due to power off in suspend.
So drvier should explicitly restore and restore HW registers during
suspend/resume.
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Add spinlock for 'tcd_pool', otherwise, in some race condition,
'tcd_pool = NULL' cause ISR never clear edma channel INT anymore which
cause interrupt storm. Besides, clear interrupt directly before poweroff
for safe.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 37149f29a631f074ac65889375cd1b077284edf8)
For rx/tx channel for audio share the same interrupt, should check INT
before clearing it directly, otherwise, audio rx may clear wrongly audio tx
channe meaningful interrupt instead of meaningless on audio rx before power
up rx edma channel.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 1afea8def323ae2fadafb50264e52483b855f4bd)
The dpu common driver creates a irq chip for dpu irqs.
The parent of the irq chip on the i.MX8qm/qxp SoC is the irqsteer.
Since the irqsteer driver may support runtime PM, the dpu common
driver needs to call irq_chip_pm_get/put() where necessary to make
sure power of the irq chip is enabled/disabled properly. This
patch enables the power at the driver probe stage and disables it
at driver remove stage to achieve basic power management support
for the irq chip.
Suggested-by: Andy Duan <fugang.duan@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
We need to check priv->pd_dev after allocating memory. Issue
detected by Coverity (CID9607920).
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Unnecessary header files may slow down build performance.
Issue reported by coverity (CID9607920).
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
In order to be able to access SAI3/SDMA3 registers
we need to enable SAI3_IPG and SDMA3_ROOT clocks.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Currently the INFO_ flags such as PAUSE/NO_PERIOD_WAKEUP are defined
in the SOF PCM core, which doesn't scale. To account for platform
variations, these flags need to be set in DSP ops.
This patch only moves the definitions and does not change any
functionality.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
We're passing "&posn" instead of "posn" so it ends up corrupting
memory instead of doing something useful.
Fixes: 53e0c72d98 ("ASoC: SOF: Add support for IPC IO between DSP and Host")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200303101858.ytehbrivocyp3cnf@kili.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
In tx_wait_done the ipc payload is copied before the DSP transaction
error code is checked. This might lead to corrupted data in kernel side
even though the error would be handled later. It is also pointless to
copy the data in case of error. So change the order of error check and
copy.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Link: https://lore.kernel.org/r/20200228231850.9226-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
M0+ core must be released prior raising any interrupt
to M0+ core, otherwise interrupt will be lost.
Fixes: b164260078 ("MLK-23567-2 ASoC: fsl_xcvr: enable SPDIF TX")
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Use devm_kzalloc instead of kzalloc to resolve resource
leak issue. (coverity ID 9664774)
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Use devm_kzalloc instead of kzalloc to resolve resource
leak issue. (coverity ID 9664774)
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Use devm_kzalloc instead of kzalloc to resolve resource
leak issue. (coverity ID 9664774)
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Integrate local HDMI display into EVK DTB to support the
DSI + LVDS + HDMI triple display, and previous single
display support for DSI, LVDS or HDMI is also remained.
Put LCDIF3 port to the same display-subsystem node as
LCDIF1 and LCDIF2 to realize this kind of triple display.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Integrate LVDS bridge with single channel display into EVK DTB
to support DSI + LVDS dual display, and the previous single
display support for DSI or LVDS is also remained. Put LCDIF1
and LCDIF2 ports into one display-subystem node to implement
this kind of dual display.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
The component framework follows a rule that 'one component bind
fails, all components fail'. So when no panel or bridge device
attached to DSIM, if return error to component core during bind
process, all the other added components also cannot be bound.
Normally, this logic is reasonable for usages. But sometimes, if
there exists more than one independent display pipelines, and
one device does not exist in one pipeline will cause displays
in other pipelines also fail.
So in order to support this kind of cases, even if no panel and
bridge attached, return zero to make component core believe it
is bound successfully.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Since the resets are get through kzalloc() in bind(), apparently
they should be freed in unbind() to avoid any possible memory
leak issue.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
As other devices in mediamix domain have already enabled
power domains, LDB is also required to enable the power
domains.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
The mediamix block control module access requires the
'IMX8MP_CLK_MEDIA_APB_ROOT' clock to be enabled, so
add this clock to this device node.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
The PLL clock is shared among several different devices
including LDB, and its rate has been set suitably for
all of these devices in DTB. So it is unnecessary to be
changed by LDB again.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
To align with the port names of 'lcdif2_disp' and 'lcdif3_disp',
rename 'lcdif_disp0' to 'lcdif1_disp'.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Since the 'mipi_phy1_ref' clock rate is usually set to
be 27MHz and won't be changed after boot up. So assign
27MHz rate instead of 594MHz to this clock is much more
reasonable.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
The 'disp1_pix' clock is used to provide pixel clock for
LCDIF1 and its rate is closely related with the display
mode resolution which is configured. So this clock rate
is dynamically determined and unnecessary to be assigned
with a default value at boot up.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
The 'video_pll1' clock is shared by MIPI and LVDS displays
and each of the display has a specific requirement for the
PLL rate which can be satified by set 'video_pll1' rate to
be 2079MHz. So assign 2079MHz rate to 'video_pll1' under
CCM device.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
On i.MX8MP platform, 'media_disp1_pix', 'media_disp2_pix',
'media_mipi_phy1_ref' and 'media_ldb' clocks share same
video PLL 'video_pll1'. And since 'media_disp2_pix' needs
video PLL rate to be 1039.5MHz and 'media_mipi_phy1_ref'
rate is usually set to be 27MHz. So add 2079MHz rate for
'video_pll1' to support all of these requirements.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
The mxm_wifiex driver define bit-fields of type "char" in
many strunctures, GCC informs you when the offset of such
a field has changed in GCC 4.4 that may lead to differences
in the structure layout. But it doesn't impact the driver,
so use -Wno-packed-bitfield-compat to disable this warning.
Reviewed-by: tian yang <yang.tian@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Before the parameters getting from dsp is not right, now correct it.
Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
In cdns3_transfer_completed, it uses is_short to judge if current
request is short transfer to calculate req->actual correctly, but
is_short variable may for previous transfer, it causes req->actual
calculation wrong for current transfer. Eg, the previous transfer is
non-short tranfer, and the current one is short transfer, the req->actual
will accumulate the non-transfered TRB's length.
In fact, below condition already stands for short trasnfer for scatter
list:
if (priv_req->num_of_trb > 1 &&
le32_to_cpu(trb->control) & TRB_SMM)
So we could (need) to delete the parameter 'is_short'
Reviewed-by: Jun Li <jun.li@nxp.com>
Reported-by: Faqiang Zhu <faqiang.zhu@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
For each request, it needs to clear transfer_end, otherwise,
the second transfer's actual transfer length will not
report to class driver if the first transfer is short and both
the two transfers are handled in the same threaded irq handler.
Reviewed-by: Jun Li <jun.li@nxp.com>
Reported-by: Faqiang Zhu <faqiang.zhu@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Inculding below cleanup for BD71847 pmic driver:
--Remove ldo4 which's not used by board, otherwise,ldo4 will be on
since it's always_on.
--Remove buck5 which's not used by board too,although that may be off
by kernel requlator common framework after kernel bootup.
--Add dvs-run-voltage/dvs-idle-voltage setting for buck2 as i.mx8mm.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Update the mxm_wifiex license to GPL v2.
Sync the files' license header with below repo:
ssh://git@bitbucket.sw.nxp.com/wcswrel/
rel-NXP-WIFI-FP92-BT-FP85-LINUX-ANDROID-MXM4X17169-MGPL
Reviewed-by: tian yang <yang.tian@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
XCVR driver working mode is set by "fsl,xcvr-mode" DTS
property. Being static - it does not allow changing
XCVR driver mode at runtime. Rework the driver by replacing
static DTS property with amixer control.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>