18 Jan, 2021
1 commit
-
Refine the qoriq_thermal driver to register cooling device according to dts.
modify imx_sc_thermal.c and imx_thermal.c to meet new interface.Change-Id: Ifd46f88078dadef4175aad8f4bf4ad6c0a98a97d
Signed-off-by: Zhang Bo
14 Dec, 2020
2 commits
-
Need to check the bit number before calling test_bit function to avoid
below out-of-bounds access reported by coverity:Out-of-bounds access (ARRAY_VS_SINGLETON): callee_ptr_arith:
Passing &val to function test_bit which uses it as an array.
This might corrupt or misinterpret adjacent memory locations.Signed-off-by: Anson Huang
Reviewed-by: Jacky Bai -
Register device cooling for first thermal zone manually, when
temperature exceeds passive trip, system wide cooling notification
will be triggered.Signed-off-by: Anson Huang
Reviewed-by: Jacky Bai
12 Oct, 2020
1 commit
-
dev_err_probe() can reduce code size, uniform error handling and record the
defer probe reason etc., use it to simplify the code.Signed-off-by: Anson Huang
Signed-off-by: Daniel Lezcano
Link: https://lore.kernel.org/r/1597129185-8460-2-git-send-email-Anson.Huang@nxp.com
21 Jul, 2020
1 commit
-
Add a missing MODULE_DEVICE_TABLE entry to support module autoloading.
Signed-off-by: Anson Huang
Reviewed-by: Dong Aisheng
Signed-off-by: Daniel Lezcano
Link: https://lore.kernel.org/r/1592380074-19222-1-git-send-email-Anson.Huang@nxp.com
23 May, 2020
1 commit
-
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:struct foo {
int stuff;
struct boo array[];
};By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.Also, notice that, dynamic memory allocations won't be affected by
this change:"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]sizeof(flexible-array-member) triggers a warning because flexible array
members have incomplete type[1]. There are some instances of code in
which the sizeof operator is being incorrectly/erroneously applied to
zero-length arrays and the result is zero. Such instances may be hiding
some bugs. So, this work (flexible-array member conversions) will also
help to get completely rid of those sorts of issues.This issue was found with the help of Coccinelle.
[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")Signed-off-by: Gustavo A. R. Silva
Signed-off-by: Daniel Lezcano
Link: https://lore.kernel.org/r/20200507192517.GA16557@embeddedor
23 Mar, 2020
2 commits
-
Fix below sparse warning:
drivers/thermal/imx8mm_thermal.c:82:36: sparse: sparse: incorrect type in argument 2 (different address spaces), expected unsigned long const volatile *addr
drivers/thermal/imx8mm_thermal.c:82:36: sparse: expected unsigned long const volatile *addrSigned-off-by: Anson Huang
Signed-off-by: Daniel Lezcano
Link: https://lore.kernel.org/r/1584973156-25734-1-git-send-email-Anson.Huang@nxp.com -
i.MX8MP shares same TMU with i.MX8MM, the only difference is i.MX8MP
has two thermal sensors while i.MX8MM ONLY has one, add multiple sensors
support for i.MX8MM TMU driver.Signed-off-by: Anson Huang
Signed-off-by: Daniel Lezcano
Link: https://lore.kernel.org/r/1584674791-9717-2-git-send-email-Anson.Huang@nxp.com
12 Mar, 2020
1 commit
-
i.MX8MM has a thermal monitoring unit(TMU) inside, it ONLY has one
sensor for CPU, add support for reading immediate temperature of
this sensor.Signed-off-by: Anson Huang
Signed-off-by: Daniel Lezcano
Link: https://lore.kernel.org/r/1582947862-11073-2-git-send-email-Anson.Huang@nxp.com