mbox series

[00/15] media: atomisp: NULL pointer deref + missing firmware fixes

Message ID 20231231103057.35837-1-hdegoede@redhat.com (mailing list archive)
Headers show
Series media: atomisp: NULL pointer deref + missing firmware fixes | expand

Message

Hans de Goede Dec. 31, 2023, 10:30 a.m. UTC
Hi All,

Here is a set of atomisp fixes I have been working on:

- The first commit in this series fixes the driver no longer
  working due to v4l2_subdev_state handling in media_stage/master

- Gracefully handle missing firmware:
  - Fix the driver crashing the system when the firmware is missing
  - Make the driver bind in power-managent-only mode when the firmware
    is missing so that the ISP is still properly turned off. This
    requires custom handling, not just standard PCI power-management.
    This allows the system to properly enter S0i3 with missing ISP
    firmware, allowing the atomisp driver to be used as a replacement
    for the pm-only drivers/platform/x86/atomisp/pm.c driver.

I am going to send out a pull-request to Mauro for this almost directly
after sending these patches to the list, leaving pretty much zero time
for review. Sorry about that, with the holidays the timing did not work
out very well.

If review finds any significant issues I'll do a set of follow up
patches to fix those.

Regards,

Hans


Hans de Goede (15):
  media: atomisp: Adjust for v4l2_subdev_state handling changes in 6.8
  media: atomisp: Refactor sensor crop + fmt setting
  media: atomisp: Remove s_routing subdev call
  media: atomisp: Remove remaining deferred firmware loading code
  media: atomisp: Drop is_valid_device() function
  media: atomisp: Call pcim_enable_device() and pcim_iomap_regions()
    later
  media: atomisp: Fix probe error-exit path
  media: atomisp: Fix atomisp_pci_remove()
  media: atomisp: Group cpu_latency_qos_add_request() call together with
    other PM calls
  media: atomisp: Fix probe()/remove() power-management
  media: atomisp: Replace atomisp_drvfs attr with using
    driver.dev_groups attr
  media: atomisp: Move power-management [un]init into
    atomisp_pm_[un]init()
  media: atomisp: Bind and do power-management without firmware
  media: atomisp: Remove unnecessary msleep(10) from
    atomisp_mrfld_power() error path
  media: atomisp: Update TODO

 drivers/staging/media/atomisp/TODO            |  10 -
 .../staging/media/atomisp/pci/atomisp_cmd.c   | 133 ++++----
 .../media/atomisp/pci/atomisp_compat_css20.c  |   2 +-
 .../staging/media/atomisp/pci/atomisp_drvfs.c | 148 +++-----
 .../staging/media/atomisp/pci/atomisp_drvfs.h |   5 +-
 .../media/atomisp/pci/atomisp_internal.h      |   5 +-
 .../staging/media/atomisp/pci/atomisp_ioctl.c |  60 ++--
 .../staging/media/atomisp/pci/atomisp_v4l2.c  | 319 ++++++++----------
 .../media/atomisp/pci/ia_css_control.h        |  29 +-
 .../media/atomisp/pci/ia_css_firmware.h       |   6 +-
 drivers/staging/media/atomisp/pci/sh_css.c    |  33 +-
 11 files changed, 309 insertions(+), 441 deletions(-)

Comments

Andy Shevchenko Jan. 2, 2024, 12:40 a.m. UTC | #1
On Sun, Dec 31, 2023 at 12:31 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi All,
>
> Here is a set of atomisp fixes I have been working on:
>
> - The first commit in this series fixes the driver no longer
>   working due to v4l2_subdev_state handling in media_stage/master
>
> - Gracefully handle missing firmware:
>   - Fix the driver crashing the system when the firmware is missing
>   - Make the driver bind in power-managent-only mode when the firmware
>     is missing so that the ISP is still properly turned off. This
>     requires custom handling, not just standard PCI power-management.
>     This allows the system to properly enter S0i3 with missing ISP
>     firmware, allowing the atomisp driver to be used as a replacement
>     for the pm-only drivers/platform/x86/atomisp/pm.c driver.
>
> I am going to send out a pull-request to Mauro for this almost directly
> after sending these patches to the list, leaving pretty much zero time
> for review. Sorry about that, with the holidays the timing did not work
> out very well.
>
> If review finds any significant issues I'll do a set of follow up
> patches to fix those.

One which would be nice to fixup is based on the sysfs patch.
Another, but not so hurried, is to have cleanup.h management for v4l2 calls.

Side note: Since we have many headers to be split from kernel.h
(array_size.h, container_of.h, hex.h, kstrtox.h, sprintf.h) consider
replacing "proxy" headers in the code. Especially when headers in the
driver include kernel.h for peanuts.