2f36e789 | 02-Feb-2023 |
Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
staging: pi433: fix memory leak with using debugfs_lookup()
When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler,
staging: pi433: fix memory leak with using debugfs_lookup()
When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler, just call debugfs_lookup_and_remove() instead which handles all of the logic at once. This requires saving off the root directory dentry to make creation of individual device subdirectories easier.
Cc: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Cc: Dan Carpenter <error27@gmail.com> Cc: Sidong Yang <realwakka@gmail.com> Cc: Liu Shixin <liushixin2@huawei.com> Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230202141138.2291946-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
d7e2d1e8 | 08-Mar-2022 |
Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> |
staging: pi433: formatting improvement for multi-line bitwise statement
Move bitwise & operator to the end of previous line for better readability
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.
staging: pi433: formatting improvement for multi-line bitwise statement
Move bitwise & operator to the end of previous line for better readability
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Link: https://lore.kernel.org/r/YicRpmT2xMupVp4h@mail.google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
2d19e698 | 25-Feb-2022 |
Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> |
staging: pi433: remove rf69_get_flag function resolving enum conflict
The reason why rf69_get_flag() existed was to provide a high-level way to obtain values out of 1 (of 2) flags registers using bi
staging: pi433: remove rf69_get_flag function resolving enum conflict
The reason why rf69_get_flag() existed was to provide a high-level way to obtain values out of 1 (of 2) flags registers using bit masking. The idea was to map the possible flag values found in the data sheet like shown in page 70 of the RFM69HCW datasheet.
However, due to the fact that enums values in C must be unique, there was a naming conflict on 'fifo_not_empty' which is used by the tx_start_condition enum. So the author decided to create a 'fifo_empty' one which would negate the value that comes from the flag register as the solution to that conflict (which is very confusing).
this patch removes rf69_get_flag function which subsequently solves the enum redeclaration problem so kernel developers can follow the data sheet more easily.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Link: https://lore.kernel.org/r/Yhla4a1Clpguoo2h@mail.google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
a2882e5e | 06-Feb-2022 |
Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> |
staging: pi433: remove need to recompile code to debug fifo content
Debugging content present in the FIFO register is tricky as when we read the FIFO register that changes the content of fifo struct
staging: pi433: remove need to recompile code to debug fifo content
Debugging content present in the FIFO register is tricky as when we read the FIFO register that changes the content of fifo struct which reduces number of possible ways of debugging it. Rf69 uC has the possibility of triggering certain IRQs depending on how many items are in the FIFO queue, so being able to know what's in there is an important way to troubleshoot certain problems.
This patch removes the requirement of having to compile pi433 driver with DEBUG_FIFO_ACCESS set and let that be driven by printk verbositity level and/or dynamic debug config instead.
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Link: https://lore.kernel.org/r/YgCj2P59AbFFmnbA@mail.google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
1b6a6147 | 06-Feb-2022 |
Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> |
staging: pi433: standardize use of line escape chars in dev_dbg stmts
In this driver there are strings ending with of both '\n' and '' (without '\n') when using dev_dbg function. While it doesn't af
staging: pi433: standardize use of line escape chars in dev_dbg stmts
In this driver there are strings ending with of both '\n' and '' (without '\n') when using dev_dbg function. While it doesn't affect drivers functionality, it would be good to keep it consistent across the driver's source code.
This patch add '\n' characters where it's missing to make it consistent with the other dev_dbg instances.
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Link: https://lore.kernel.org/r/YgA4XHU4uf6YkOk5@mail.google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
6c73edb5 | 23-Jan-2022 |
Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> |
staging: pi433: add missing register contants
add missing register constants present in RFM69 and/or RFM69HW so that we don't need to hardcode values when referencing them.
this patch adds REG_TEST
staging: pi433: add missing register contants
add missing register constants present in RFM69 and/or RFM69HW so that we don't need to hardcode values when referencing them.
this patch adds REG_TESTLNA, REG_TESTAFC constants
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Link: https://lore.kernel.org/r/20220124042636.GA7962@mail.google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
ce514dad | 14-Jan-2022 |
Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> |
staging: pi433: enforce tx_cfg to be set before any message can be sent
this driver relies on exposing a char device to userspace to tx messages. Every message can be sent using different trasmitter
staging: pi433: enforce tx_cfg to be set before any message can be sent
this driver relies on exposing a char device to userspace to tx messages. Every message can be sent using different trasmitter settings such so the tx_cfg must be written before sending any messages. Failing to do so will cause the message to fail silently depending on printk/dynamic_debug settings which makes it hard to troubleshoot.
This patch add a control variable that will get initialized once tx_cfg is set for the fd used when interacting with the char device.
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Link: https://lore.kernel.org/r/20220114221643.GA7843@mail.google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
ca532a56 | 18-Jan-2022 |
Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> |
staging: pi433: validate max bit_rate based on modulation used
Max bit rate is dependent on which modulation is used. Previous validation routine only took into consideration min bit rate which can
staging: pi433: validate max bit_rate based on modulation used
Max bit rate is dependent on which modulation is used. Previous validation routine only took into consideration min bit rate which can lead a misconfiguration of the rf69 chip causing the packets not to be sent/read.
This patch enhances that input check in set_bit_rate to account for modulation values and their respective max bit rate
Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Link: https://lore.kernel.org/r/20220118230555.GA4961@mail.google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
14dbdad1 | 18-Jan-2022 |
Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> |
staging: pi433: change order in which driver config the rf69 chip
There is an explicit dependency between modulation and bit rate configurations. To ensure proper validation of input value for the s
staging: pi433: change order in which driver config the rf69 chip
There is an explicit dependency between modulation and bit rate configurations. To ensure proper validation of input value for the set_bit_rate routine, we must ensure that modulation has been set before.
This patch ensures that set_modulation is always called before set_bit_rate for both RX and TX routines
Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Link: https://lore.kernel.org/r/20220118230502.GA4897@mail.google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|