| c30dcfd4 | 07-Aug-2025 |
Ryan Chen <ryan_chen@aspeedtech.com> |
soc: aspeed: socinfo: Add AST27xx silicon IDs
Extend the ASPEED SoC info driver to support AST27XX silicon IDs.
Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com> Link: https://patch.msgid.link/20
soc: aspeed: socinfo: Add AST27xx silicon IDs
Extend the ASPEED SoC info driver to support AST27XX silicon IDs.
Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com> Link: https://patch.msgid.link/20250807005208.3517283-1-ryan_chen@aspeedtech.com Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
| fdf003f3 | 16-Jun-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
soc: aspeed: lpc-snoop: Lift channel config to const structs
The shifts and masks for each channel are defined by hardware and are not something that changes at runtime. Accordingly, describe the in
soc: aspeed: lpc-snoop: Lift channel config to const structs
The shifts and masks for each channel are defined by hardware and are not something that changes at runtime. Accordingly, describe the information in an array of const structs and associate elements with each channel instance, removing the need for the switch and handling of its default case.
Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-10-3cdd59c934d3@codeconstruct.com.au Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
| 4483e3c4 | 16-Jun-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
soc: aspeed: lpc-snoop: Consolidate channel initialisation
Previously, channel initialisation was a bit perilous with respect to resource cleanup in error paths. While the implementation had issues,
soc: aspeed: lpc-snoop: Consolidate channel initialisation
Previously, channel initialisation was a bit perilous with respect to resource cleanup in error paths. While the implementation had issues, it at least made an effort to eliminate some of its problems by first testing whether any channels were enabled, and bailing out if not.
Having improved the robustness of resource handling in probe() we can now rearrange the initial channel test to be located with the subsequent test, and rework the unrolled conditional logic to use a loop for an improvement in readability.
Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-9-3cdd59c934d3@codeconstruct.com.au Acked-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
| fa4ffb06 | 16-Jun-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
soc: aspeed: lpc-snoop: Use dev_err_probe() where possible
Exploit that it returns the provided error to eliminate some lines, and return the actual error involved rather than -ENODEV.
Link: https:
soc: aspeed: lpc-snoop: Use dev_err_probe() where possible
Exploit that it returns the provided error to eliminate some lines, and return the actual error involved rather than -ENODEV.
Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-8-3cdd59c934d3@codeconstruct.com.au Acked-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
| 08ebd4c5 | 16-Jun-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
soc: aspeed: lpc-snoop: Switch to devm_clk_get_enabled()
Simplify clock handling as done in other drivers.
Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-7-3cdd59c934d3@codeconst
soc: aspeed: lpc-snoop: Switch to devm_clk_get_enabled()
Simplify clock handling as done in other drivers.
Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-7-3cdd59c934d3@codeconstruct.com.au Acked-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
| 6c64e1a8 | 16-Jun-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
soc: aspeed: lpc-snoop: Rearrange channel paths
Order assignments such that tests for conditions not involving resource acquisition are ordered before those testing acquired resources, and order man
soc: aspeed: lpc-snoop: Rearrange channel paths
Order assignments such that tests for conditions not involving resource acquisition are ordered before those testing acquired resources, and order managed resource acquisition before unmanaged where possible. This way we minimise the amount of manual cleanup required.
In the process, improve readability of the code by introducing a channel pointer that takes the place of the repeated object lookups.
Acked-by: Jean Delvare <jdelvare@suse.de> Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-6-3cdd59c934d3@codeconstruct.com.au Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
| e88c9a71 | 16-Jun-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
soc: aspeed: lpc-snoop: Rename 'channel' to 'index' in channel paths
We'll introduce another 'channel' variable shortly
Acked-by: Jean Delvare <jdelvare@suse.de> Link: https://patch.msgid.link/2025
soc: aspeed: lpc-snoop: Rename 'channel' to 'index' in channel paths
We'll introduce another 'channel' variable shortly
Acked-by: Jean Delvare <jdelvare@suse.de> Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-5-3cdd59c934d3@codeconstruct.com.au Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
| 3e9c1578 | 16-Jun-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
soc: aspeed: lpc-snoop: Constrain parameters in channel paths
Ensure pointers and the channel index are valid before use.
Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-4-3cdd59c
soc: aspeed: lpc-snoop: Constrain parameters in channel paths
Ensure pointers and the channel index are valid before use.
Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-4-3cdd59c934d3@codeconstruct.com.au Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
| 3795e993 | 16-Jun-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
soc: aspeed: lpc-snoop: Ensure model_data is valid
of_device_get_match_data() can return NULL, though shouldn't in current circumstances. Regardless, initialise model_data closer to use so it's clea
soc: aspeed: lpc-snoop: Ensure model_data is valid
of_device_get_match_data() can return NULL, though shouldn't in current circumstances. Regardless, initialise model_data closer to use so it's clear we need to test for validity prior to dereferencing.
Acked-by: Jean Delvare <jdelvare@suse.de> Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-3-3cdd59c934d3@codeconstruct.com.au Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
| 56448e78 | 16-Jun-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
soc: aspeed: lpc-snoop: Don't disable channels that aren't enabled
Mitigate e.g. the following:
# echo 1e789080.lpc-snoop > /sys/bus/platform/drivers/aspeed-lpc-snoop/unbind ... [ 120.
soc: aspeed: lpc-snoop: Don't disable channels that aren't enabled
Mitigate e.g. the following:
# echo 1e789080.lpc-snoop > /sys/bus/platform/drivers/aspeed-lpc-snoop/unbind ... [ 120.363594] Unable to handle kernel NULL pointer dereference at virtual address 00000004 when write [ 120.373866] [00000004] *pgd=00000000 [ 120.377910] Internal error: Oops: 805 [#1] SMP ARM [ 120.383306] CPU: 1 UID: 0 PID: 315 Comm: sh Not tainted 6.15.0-rc1-00009-g926217bc7d7d-dirty #20 NONE ... [ 120.679543] Call trace: [ 120.679559] misc_deregister from aspeed_lpc_snoop_remove+0x84/0xac [ 120.692462] aspeed_lpc_snoop_remove from platform_remove+0x28/0x38 [ 120.700996] platform_remove from device_release_driver_internal+0x188/0x200 ...
Fixes: 9f4f9ae81d0a ("drivers/misc: add Aspeed LPC snoop driver") Cc: stable@vger.kernel.org Cc: Jean Delvare <jdelvare@suse.de> Acked-by: Jean Delvare <jdelvare@suse.de> Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-2-3cdd59c934d3@codeconstruct.com.au Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
| f1706e0e | 15-May-2025 |
Henry Martin <bsdhenrymartin@gmail.com> |
soc: aspeed: Add NULL check in aspeed_lpc_enable_snoop()
devm_kasprintf() returns NULL when memory allocation fails. Currently, aspeed_lpc_enable_snoop() does not check for this case, which results
soc: aspeed: Add NULL check in aspeed_lpc_enable_snoop()
devm_kasprintf() returns NULL when memory allocation fails. Currently, aspeed_lpc_enable_snoop() does not check for this case, which results in a NULL pointer dereference.
Add NULL check after devm_kasprintf() to prevent this issue.
Fixes: 3772e5da4454 ("drivers/misc: Aspeed LPC snoop output using misc chardev") Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com> Link: https://patch.msgid.link/20250401074647.21300-1-bsdhenrymartin@gmail.com [arj: Fix Fixes: tag to use subject from 3772e5da4454] Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
show more ...
|
| 6e6d847a | 10-Aug-2023 |
Jiasheng Jiang <jiasheng@iscas.ac.cn> |
soc: aspeed: socinfo: Add kfree for kstrdup
Add kfree() in the later error handling in order to avoid memory leak.
Fixes: e0218dca5787 ("soc: aspeed: Add soc info driver") Signed-off-by: Jiasheng J
soc: aspeed: socinfo: Add kfree for kstrdup
Add kfree() in the later error handling in order to avoid memory leak.
Fixes: e0218dca5787 ("soc: aspeed: Add soc info driver") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Link: https://lore.kernel.org/r/20230707021625.7727-1-jiasheng@iscas.ac.cn Signed-off-by: Joel Stanley <joel@jms.id.au> Link: https://lore.kernel.org/r/20230810123104.231167-1-joel@jms.id.au Signed-off-by: Arnd Bergmann <arnd@arndb.de>
show more ...
|