History log of /linux-master/drivers/staging/media/atomisp/pci/sh_css_firmware.c
Revision Date Author Comments
# 5e131b80 24-May-2023 Hans Verkuil <hverkuil-cisco@xs4all.nl>

media: atomisp: move up sanity checks

The sanity checks were done too late, so move them up.

This fixes this smatch warning:

drivers/staging/media/atomisp/pci/sh_css_firmware.c:247 sh_css_load_firmware() warn: variable dereferenced before check 'fw_data' (see line 237)

Link: https://lore.kernel.org/r/20230524121150.435736-9-hverkuil-cisco@xs4all.nl

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


# 08b9c820 08-May-2023 Kate Hsuan <hpa@redhat.com>

media: atomisp: sh_css_firmware: determine firmware version at runtime

The firmware version of ISP2401 and 2400 is determined at runtime.

Link: https://lore.kernel.org/r/20230508062632.34537-4-hpa@redhat.com

Signed-off-by: Kate Hsuan <hpa@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


# 4cc20c9c 15-Jun-2022 Hans de Goede <hdegoede@redhat.com>

media: atomisp: Simplify hmm_alloc() calls

Make hmm_alloc() only take size as a parameter and remove other parameters.
since all callers always pass the same flags.

Link: https://lore.kernel.org/linux-media/20220615205037.16549-30-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


# 14459311 16-Jan-2022 Hans de Goede <hdegoede@redhat.com>

media: atomisp: Use irci_stable_candrpv_0415_20150423_1753 fw for byt

There is no irci_stable_candrpv_0415_20150521_0458 build for the
isp2400/byt version of the atomisp2. There is however an
irci_stable_candrpv_0415_20150423_1753 version which according to:
https://github.com/intel/ProductionKernelQuilts/blob/master/uefi/cht-m1stable/patches/cam-041

Has the exact same fw ABI, so use that on the isp2400.

Link: https://lore.kernel.org/linux-media/20220116215204.307649-4-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


# bb4924c2 17-Oct-2021 Tsuchiya Yuto <kitakar@gmail.com>

media: atomisp: pci: release_version is now irci_stable_candrpv_0415_20150521_0458

Now that we made atomisp work with firmware version
irci_stable_candrpv_0415_20150521_0458 also for ISP2401, the
release_version for ISP2401 is not irci_ecr-master_20150911_0724
anymore.

So, use the same release_version for both ISP2400 and ISP2401 (i.e.,
irci_stable_candrpv_0415_20150521_0458).

Referred to the following diff to make this patch:
- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/diff/drivers/staging/media/atomisp/pci/sh_css_firmware.c?id=3c0538fbad9f1d07d588f631e380256d941e3d3a
("media: atomisp: get rid of most checks for ISP2401 version")
changes for file sh_css_firmware.c

Signed-off-by: Tsuchiya Yuto <kitakar@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 454a6232 04-Jun-2021 Fabio M. De Francesco <fmdefrancesco@gmail.com>

media: atomisp: pci: Remove unnecessary (void *) cast

Removed an unnecessary (void *) cast for an argument passed to kfree().

Link: https://lore.kernel.org/linux-media/20210605020855.1065-3-fmdefrancesco@gmail.com
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 1c6edb28 27-May-2021 Fabio M. De Francesco <fmdefrancesco@gmail.com>

media: atomisp: pci: Remove checks before kfree/kvfree

Removed checks for pointers != NULL before freeing memory. If kvfree()
and kfree() are given NULL pointers no operations are performed, so
there is no need for the above-mentioned checks. Coccinelle detected the
second of the two unnecessary checks.

Link: https://lore.kernel.org/linux-media/20210527193922.25225-1-fmdefrancesco@gmail.com
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 655ace3c 04-Jun-2021 Fabio M. De Francesco <fmdefrancesco@gmail.com>

media: atomisp: pci: Remove unnecessary (void *) cast

Removed an unnecessary (void *) cast for an argument passed to kfree().

Link: https://lore.kernel.org/linux-media/20210605020855.1065-3-fmdefrancesco@gmail.com
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 179b1fce 27-May-2021 Fabio M. De Francesco <fmdefrancesco@gmail.com>

media: atomisp: pci: Remove checks before kfree/kvfree

Removed checks for pointers != NULL before freeing memory. If kvfree()
and kfree() are given NULL pointers no operations are performed, so
there is no need for the above-mentioned checks. Coccinelle detected the
second of the two unnecessary checks.

Link: https://lore.kernel.org/linux-media/20210527193922.25225-1-fmdefrancesco@gmail.com
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 040b8648 19-Feb-2021 Jiri Slaby <jirislaby@kernel.org>

media: atomisp: do not free kmalloc memory by vfree

fw_minibuffer[i].buffer is allocated by kmalloc in sh_css_load_blob_info
and by vmalloc in setup_binary. So use kvfree to decide which of those
allocators to use for freeing.

Also remove the useless cast.

Link: https://lore.kernel.org/linux-media/20210219101216.28406-1-jslaby@suse.cz
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 2394984f 21-Sep-2020 Alex Dewar <alex.dewar90@gmail.com>

media: staging: media: atomisp: Fix bool-related style issues

Address the following issues:
* unnecessary comparison to true/false
* use of 0/1 instead of bool values
* unnecessary conversion to bool

These were fixed using the following Coccinelle scripts:
* scripts/coccinelle/misc/bool{init,conv,return}.cocci

Build-tested with allmodconfig.

Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 714d85f0 26-Jul-2020 Rohit K Bharadwaj <bharadwaj.rohit8@gmail.com>

media: atomisp: fix code style issues

Fix warnings and errors generated after running checkpatch.pl on pci/sh_css_firmware.c.

Signed-off-by: Rohit K Bharadwaj <bharadwaj.rohit8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 662fb4fc 03-Jun-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: get rid of a string_support.h abstraction layer

Some parts of the driver have their own implementation of
memcpy() & friends. Replace all of them by strscpy().

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 469a7306 01-Jun-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: change the detection of ISP2401 at runtime

Instead of having a static var to detect it, let's use the
already-existing arch-specific bytes, as this is how other
parts of the code also checks when it needs to do something
different, depending on an specific chipset version.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# f5fbb83f 29-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: add SPDX headers

This driver is licensed under GPL 2.0, as stated inside their
headers.

Add the proper tag there. We should probably latter cleanup
the reduntant licensing text, but this could be done later,
after we get rid of other abstraction layers.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 6a9c6ba7 29-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: print firmware data during load

While there's a way to list the firmware binaries in runtime,
it is worth to also print it during firmware load.

One advantage is that this code also introduces additional
checks with regards to invalid firmware types, which can be
useful to identify problems.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 0cd8726c 29-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: provide more details about the firmware binaries

In order to make easier to identify what a firmware file
contains, add more info at the firmware dump log facility.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 41022d35 28-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: get rid of non-Linux error codes

The atomisp driver has its own error codes under the
ia_css_err.h file. On several places, those got already
replaced by standard error codes, but there are still a
lot more to be fixed.

Let's get rid of all of those, mapping them into
the already-existing set of Linux error codes.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 1a16d545 28-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: remove some trivial wrappers from compat css20

There are tons of code inside atomisp_compat_css20.c, but
several of them are just trivial wrappers to other functions.

Getting rid of all of them will take some time, but let's
start getting rid of some of the trivial ones.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 08fef4fa 26-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: get rid of memory_access.c

Now that we have everything in place, we can get rid of the
memory_access abstraction layer.

Now, everything related to heterogeneous memory management
(hmm) is under hmm.c & related pools.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 100e8989 26-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: change the type returned by mmgr alloc

The mmgr alloc code returns a different type than hmm, due to
some abstraction layer.

Change the driver to use just one type to represent the
hmm memory.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 5472b4db 26-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: get rid of mmgr_load and mmgr_store

Those functions are just wrappers for hmm_load/hmm_store.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 86df6ff2 25-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: reduce abstraction at ia_css_memory_access

Yet another memory abstraction layer. Getting rid of this
may be a little trickier, but let's reduce it to a minimal.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 33c24f8f 07-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: relax firmware version detection criteria

As getting the exact version used by the driver is not easy,
let's relax the version detection and hope for the best,
producing just a warning.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# f770e91a 07-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: limit the name of the firmware file

The firmware header has 64 bytes. Properly limit it to such
size.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 8568fe63 07-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: print a better message when fw version is wrong

The printed message when a firmware version is wrong says nothing
usefull:

atomisp-isp2 0000:00:03.0: Fw version check failed.
atomisp-isp2: probe of 0000:00:03.0 failed with error -22

Print the expected and the received firmware version instead.

In order to do that, the firmware functions will need at least
a struct device pointer, so pass it.

While writing this patch, it was noticed that some of the
abstraction layers of this driver have functions that are never
called, but use this interface. Get rid of them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 3c0538fb 30-Apr-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: get rid of most checks for ISP2401 version

There are lots of places inside this driver checking for
ISP2400/ISP2401 verison. Get rid of most of those, while
keep building for both.

Most of stuff in this patch is trivial to solve.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 9d4fa1a1 30-Apr-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: cleanup directory hierarchy

This driver has very long directories without a good
reason (IMHO). Let's drop two directories from such hierarchy,
in order to simplify things a little bit and make the dir
output a bit more readable.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>