iio: invensense: Prevent possible integer overflow while multiplicationTypecast a variable to int64_t for 64-bit arithmetic multiplication.Signed-off-by: Karan Sanghavi <karansanghvi98@gmail.com>
iio: invensense: Prevent possible integer overflow while multiplicationTypecast a variable to int64_t for 64-bit arithmetic multiplication.Signed-off-by: Karan Sanghavi <karansanghvi98@gmail.com>Link: https://scan7.scan.coverity.com/#/project-view/51946/11354?selectedIssue=1586045Link: https://patch.msgid.link/20241103-coverity1586045integeroverflow-v1-1-43ea37a3f3cd@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
module: Convert symbol namespace to string literalClean up the existing export namespace code along the same lines ofcommit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)to __s
module: Convert symbol namespace to string literalClean up the existing export namespace code along the same lines ofcommit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)to __section("foo")") and for the same reason, it is not desired for thenamespace argument to be a macro expansion itself.Scripted using git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file; do awk -i inplace ' /^#define EXPORT_SYMBOL_NS/ { gsub(/__stringify\(ns\)/, "ns"); print; next; } /^#define MODULE_IMPORT_NS/ { gsub(/__stringify\(ns\)/, "ns"); print; next; } /MODULE_IMPORT_NS/ { $0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g"); } /EXPORT_SYMBOL_NS/ { if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) { if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ && $0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ && $0 !~ /^my/) { getline line; gsub(/[[:space:]]*\\$/, ""); gsub(/[[:space:]]/, "", line); $0 = $0 " " line; } $0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/, "\\1(\\2, \"\\3\")", "g"); } } { print }' $file; doneRequested-by: Masahiro Yamada <masahiroy@kernel.org>Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlcAcked-by: Greg KH <gregkh@linuxfoundation.org>Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
iio: invensense: fix multiple odr switch when FIFO is offWhen multiple ODR switch happens during FIFO off, the change couldnot be taken into account if you get back to previous FIFO on value.For
iio: invensense: fix multiple odr switch when FIFO is offWhen multiple ODR switch happens during FIFO off, the change couldnot be taken into account if you get back to previous FIFO on value.For example, if you run sensor buffer at 50Hz, stop, change to200Hz, then back to 50Hz and restart buffer, data will be timestampedat 200Hz. This due to testing against mult and not new_mult.To prevent this, let's just run apply_odr automatically when FIFO isoff. It will also simplify driver code.Update inv_mpu6050 and inv_icm42600 to delete now useless apply_odr.Fixes: 95444b9eeb8c ("iio: invensense: fix odr switching to same value")Cc: stable@vger.kernel.orgSigned-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>Link: https://patch.msgid.link/20241021-invn-inv-sensors-timestamp-fix-switch-fifo-off-v2-1-39ffd43edcc4@tdk.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: invensense: fix odr switching to same valueODR switching happens in 2 steps, update to store the new value and thenapply when the ODR change flag is received in the data. When switching toth
iio: invensense: fix odr switching to same valueODR switching happens in 2 steps, update to store the new value and thenapply when the ODR change flag is received in the data. When switching tothe same ODR value, the ODR change flag is never happening, and frequencyswitching is blocked waiting for the never coming apply.Fix the issue by preventing update to happen when switching to same ODRvalue.Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module generic")Cc: stable@vger.kernel.orgSigned-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>Link: https://lore.kernel.org/r/20240524124851.567485-1-inv.git-commit@tdk.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: invensense: fix timestamp glitches when switching frequencyWhen a sensor is running and there is a FIFO frequency change due toanother sensor turned on/off, there are glitches on timestamp. F
iio: invensense: fix timestamp glitches when switching frequencyWhen a sensor is running and there is a FIFO frequency change due toanother sensor turned on/off, there are glitches on timestamp. Fix thatby using only interrupt timestamp when there is the corresponding sensordata in the FIFO.Delete FIFO period handling and simplify internal functions.Update integration inside inv_mpu6050 and inv_icm42600 drivers.Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module generic")Cc: Stable@vger.kernel.orgSigned-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>Link: https://lore.kernel.org/r/20240426094835.138389-1-inv.git-commit@tdk.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: invensense: fix interrupt timestamp alignmentRestrict interrupt timestamp alignment for not overflowing max/minperiod thresholds.Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module
iio: invensense: fix interrupt timestamp alignmentRestrict interrupt timestamp alignment for not overflowing max/minperiod thresholds.Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module generic")Cc: stable@vger.kernel.orgSigned-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>Link: https://lore.kernel.org/r/20240426135814.141837-1-inv.git-commit@tdk.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: invensense: remove redundant initialization of variable periodThe variable period is being initialized with a value that is neverread, it is being re-assigned a new value later on before it i
iio: invensense: remove redundant initialization of variable periodThe variable period is being initialized with a value that is neverread, it is being re-assigned a new value later on before it is read.The initialization is redundant and can be removed.Cleans up clang scan build warning:Value stored to 'period' during its initialization is neverread [deadcode.DeadStores]Signed-off-by: Colin Ian King <colin.i.king@gmail.com>Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>Link: https://lore.kernel.org/r/20240106153202.54861-1-colin.i.king@gmail.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: make invensense timestamp module genericRename common module to inv_sensors_timestamp, add configurationat init (chip internal clock, acceptable jitter, ...) and updateinv_icm42600 driver in
iio: make invensense timestamp module genericRename common module to inv_sensors_timestamp, add configurationat init (chip internal clock, acceptable jitter, ...) and updateinv_icm42600 driver integration.Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>Link: https://lore.kernel.org/r/20230606162147.79667-4-inv.git-commit@tdk.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: move inv_icm42600 timestamp module in commonCreate new inv_sensors common modules and move inv_icm42600timestamp module inside. This module will be used by IMUs andalso in the future by othe
iio: move inv_icm42600 timestamp module in commonCreate new inv_sensors common modules and move inv_icm42600timestamp module inside. This module will be used by IMUs andalso in the future by other chips.Modify inv_icm42600 driver to use timestamp module and do someheaders cleanup.Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>Link: https://lore.kernel.org/r/20230606162147.79667-3-inv.git-commit@tdk.comSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>