22 Oct, 2025

1 commit


05 Oct, 2025

1 commit


20 Nov, 2024

1 commit

  • When using a cmdline such as "bportals=s0 qportals=s0", Linux is given a
    single QMan and a single BMan portal which is shared among all CPUs, and
    accessed with locking.

    This is only supported for the staging SDK QBMan driver and not for the
    upstream variant.

    In a strange twist of events, qman_create_affine_slave() also sets
    affine_portals[] for CPUs which use the portal affine to a different CPU
    (aka "slaves" here), and just have portal->sharing_redirect set to that
    other portal.

    But that panics the kernel hard, because these dummy portals, not
    having been created by qman_create_portal(), have uninitialized struct
    qm_portal :: addr, eqcr, dqrr, etc, but also portal->config. So any time
    these are dereferenced, the kernel panics.

    There are actually 2 code paths which are in this situation:

    qman_enable_irqs()
    -> qm_isr_status_clear()
    -> __qm_isr_write()
    -> __qm_out(&portal->addr, ...) // portal->addr uninitialized

    qm_shutdown_fq()
    -> qm_get_portal_for_channel()
    -> qman_p_get_portal_config()
    -> &p->config->public_cfg // p->config uninitialized

    Both functions were actually copied over from the upstream QBMan driver
    (for the purpose of kexec support), which does not support portal
    sharing and thus the problem does not exist there.

    Actually, we need to take into consideration in these code paths only
    those affine portals created by qman_create_affine_portal(), and not the
    fake ones with sharing_redirect. The qman_create_affine_portal() sets
    the CPU in the &affine_mask retrievable through qman_affine_cpus().

    This is also the way in which dpaa_eth_add_channel() from
    drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c avoids the
    fake channels, when dereferencing the affine_cpus[] array through the
    qman_get_affine_portal() API method.

    Fixes: a218c908c8ea ("staging: fsl_qbman: account for pre-initialized BARs in case of kexec")
    Fixes: 78ff3aa0713b ("staging: fsl_qbman: use correct portal for static dequeues in qm_shutdown_fq()")
    Signed-off-by: Vladimir Oltean

    Vladimir Oltean
     

19 Nov, 2024

2 commits

  • neutron requires more memory to support large size firmware, merge
    dtcm and dtcm-ring buffer for larger contiguous memory.

    Signed-off-by: Jiwei.Fu
    Reviewed-by: Forrest Shi
    Reviewed-by: Peng Fan
    Acked-by: Jason Liu

    Jiwei.Fu
     
  • To improve performance, we have implemented zero-copy optimization for
    neutron NPU, and third-party inference engines such as tflite can use
    neutron memory directly, thus avoiding to perform memcpy between neutron
    ddr memory and application context as follows:
    - Avoid copying input data from application to neutron memory.
    - Avoid copying output data from neutron memory back to the application.

    This patch enables the memory cache and let the driver maintain the
    memory and cache coherency.The main changes are:
    - Flush the input buffer cache for device before starting inference.
    - Invalidate the output buffer cache for cpu after inference is complete.
    - Flush other constant data for device via IOCTL in preparation.

    Signed-off-by: Jiwei.Fu
    Reviewed-by: Forrest Shi
    Acked-by: Jason Liu

    Jiwei.Fu
     

18 Nov, 2024

2 commits

  • Currently, if streamon/streamoff calls are imbalanced we can either end up
    with a negative ISI m2m usage_count (if streamoff() is called more times
    than streamon()) in which case we'll not be able to restart the ISI pipe
    next time, or the usage_count never gets to 0 and the pipe is never
    switched off.

    To avoid that, add a 'streaming' flag to mxc_isi_m2m_ctx_queue_data and use it
    in the streamon/streamoff to avoid incrementing/decrementing the usage_count
    uselessly, if called multiple times from the same context.

    Fixes: cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")
    Suggested-by: Laurent Pinchart
    Signed-off-by: Laurentiu Palcu
    Tested-by: Guoniu Zhou
    Reviewed-by: Robert Chiras
    Acked-by: Jason Liu

    Laurentiu Palcu
     
  • Running the v4l2-compliance (1.27.0-5208, SHA: af114250d48d) on the m2m
    device fails on the MMAP streaming tests, with the following messages:

    fail: v4l2-test-buffers.cpp(240): g_field() == V4L2_FIELD_ANY
    fail: v4l2-test-buffers.cpp(1508): buf.qbuf(node)

    Apparently, the driver does not properly set the field member of
    vb2_v4l2_buffer struct, returning the default V4L2_FIELD_ANY value which
    is against the guidelines.

    Fixes: cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")
    Signed-off-by: Laurentiu Palcu
    Reviewed-by: Laurent Pinchart
    Tested-by: Guoniu Zhou
    Reviewed-by: Robert Chiras
    Acked-by: Jason Liu

    Laurentiu Palcu
     

13 Nov, 2024

2 commits

  • Currently, interrogating the controls, before they're set for the first
    time, will return all-zero values. To fix this, use the init() callback
    in the v4l2_ctrl_type_ops structure to populate the initial control
    values.

    Also, when running the sensor initialization sequence, make sure we
    don't cache the settings for the embedded data because they do not
    contain register values. They contain ranges. Otherwise we'll end up
    with wrong register values in the regmap cache.

    Signed-off-by: Laurentiu Palcu
    Reviewed-by: Robert Chiras
    Reviewed-by: Mirela Rabulea
    Tested-by: Celine Laurencin
    Reviewed-by: Celine Laurencin
    Acked-by: Jason Liu

    Laurentiu Palcu
     
  • Currently, the registers returned in the embedded data contain RW
    registers for gains and exposure. That affects the way the registers are
    updated which does not follow the specifications. Using the RO registers
    fixes the problem. Also, move the embedded data initialization sequence
    to the end and add a comment to be easier to find it out in the future.

    Signed-off-by: Laurentiu Palcu
    Reviewed-by: Mirela Rabulea
    Tested-by: Celine Laurencin
    Reviewed-by: Celine Laurencin
    Acked-by: Jason Liu

    Laurentiu Palcu
     

11 Nov, 2024

2 commits

  • Initialized the err variable to fix the coverity issue,
    "Uninitialized scalar variable"

    Signed-off-by: Rahul Kumar Yadav
    Reviewed-by: Pankaj Gupta
    Acked-by: Jason Liu

    Rahul Kumar Yadav
     
  • The ipu_task_thread thread ran by kthread_run() could be excuted
    before kthread_run() returns especially when 'nosmp' or 'maxcpus=1'
    kernel bootup parameters are used. So, in this case, the thread[0]
    or thread[1] entries in struct ipu_soc are not yet set before
    ipu_task_thread() references them to set thread affinity, hence a
    NULL pointer de-referencing issue happens. Fix this by referencing
    *current* task in ipu_task_thread() instead of the uninitialized
    thread[0] or thread[1] entries.

    This fixes an old bug introduced by the below commit in linux-imx:
    commit 0d36f8226d22 ("ENGR00175724-2 IPU: change ipu_device thread
    process mode to interrupt mode.")

    Signed-off-by: Liu Ying
    Reviewed-by: Sandor Yu
    Acked-by: Jason Liu

    Liu Ying
     

06 Nov, 2024

1 commit


05 Nov, 2024

3 commits


31 Oct, 2024

1 commit

  • The edma CHn_MUX isn't reset after warm reboot on imx95. If the dma
    client request channel is different the last channel, the src id is
    unique and can't be written the new edma CHn_MUX on imx95 so that
    the transfer fail.

    This patch writes the CHn_MUX to reserved value 0.

    Fixes: 9e34c0115e39 ("LF-10579-02: dmaengine: fsl-edma-v3: add imx95 edma support")
    Signed-off-by: Joy Zou
    Reviewed-by: Ye Li
    Acked-by: Jason Liu

    Joy Zou
     

30 Oct, 2024

1 commit


24 Oct, 2024

3 commits

  • As mentioned in reference manual, ISI actual output line
    value will be rounded up to an integer. For example, if
    the input line value equal to 800 and the output line
    value equal to 720, you must set [Y_SCALE] to a value
    such that the theoretical output line value (800/[Y_SCALE])
    is equal to or less than 720, which means:

    1. If [Y_SCALE] is set to 1C8h, the theoretical output line
    value equal to 719.859375 which will be rounded up to 720.
    2. If [Y_SCALE] is set to 1C7h, the theoretical output line
    value equal to 720.017578 which will be rounded up to 721.

    There will be one excessive line in the actual output, So
    adjust scale factor to make them equal.

    Signed-off-by: Guoniu Zhou
    Reviewed-by: Robby Cai

    Guoniu Zhou
     
  • Keep subdev name as v4l2 core set since libcamera camera module
    model identification heuristic does not work properly, it will
    identify camera modules by parsing the default name.

    Signed-off-by: Guoniu Zhou
    Reviewed-by: Robby Cai

    Guoniu Zhou
     
  • Add more RGB formats which supported by ISI.

    Signed-off-by: Guoniu Zhou
    Reviewed-by: Robby Cai

    Guoniu Zhou
     

23 Oct, 2024

8 commits


22 Oct, 2024

9 commits


21 Oct, 2024

3 commits