s390/qeth: Make hw_trap sysfs attribute idempotent
Subsystems (4)
Alexandra Winter
maintainerPATCH 1/1 s390/qeth: Make hw_trap sysfs attribute idempotent
From: Aswin Karuvally <[email protected]>
Update qeth driver to allow writing an existing value to the "hw_trap" sysfs attribute. Attempting such a write earlier resulted in -EINVAL. In other words, make the sysfs attribute idempotent.
After:
$ cat hw_trap
disarm
$ echo disarm > hw_trap
$--- drivers/s390/net/qeth_core_sys.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
drivers/s390/net/qeth_core_sys.c +13 -9
@@ -518,28 +518,32 @@ static ssize_t qeth_hw_trap_store(struct device *dev,if (qeth_card_hw_is_reachable (card)) state =1 ; -if (sysfs_streq (buf,"arm" ) && !card->info.hwtrap) { -if (state) { +if (sysfs_streq (buf,"arm" )) { +if (state && !card->info.hwtrap) {if (qeth_is_diagass_supported (card,QETH_DIAGS_CMD_TRAP )) { rc =qeth_hw_trap (card,QETH_DIAGS_TRAP_ARM );if (!rc) card->info.hwtrap =1 ; - }else + }else { rc = -EINVAL ; - }else + } + }else { card->info.hwtrap =1 ; - }else if (sysfs_streq (buf,"disarm" ) && card->info.hwtrap) { -if (state) { + } + }else if (sysfs_streq (buf,"disarm" )) { +if (state && card->info.hwtrap) { rc =qeth_hw_trap (card,QETH_DIAGS_TRAP_DISARM );if (!rc) card->info.hwtrap =0 ; - }else + }else { card->info.hwtrap =0 ; - }else if (sysfs_streq (buf,"trap" ) && state && card->info.hwtrap) + } + }else if (sysfs_streq (buf,"trap" ) && state && card->info.hwtrap) { rc =qeth_hw_trap (card,QETH_DIAGS_TRAP_CAPTURE ); -else + }else { rc = -EINVAL ; + }mutex_unlock (&card->conf_mutex);return rc ? rc : count;
Signature · 1 line
2.48.1
Quoted 12 lines · Alexandra Winter
From: Aswin Karuvally <[email protected]>
Update qeth driver to allow writing an existing value to the "
hw_trap" sysfs attribute. Attempting such a write earlier resulted in-EINVAL. In other words, make the sysfs attribute idempotent.After:
$ cat hw_trap disarm $ echo disarm > hw_trap $
Quoted 4 lines
Suggested-by Alexandra Winter <[email protected]>Signed-off-by Aswin Karuvally <[email protected]>Reviewed-by Alexandra Winter <[email protected]>Signed-off-by Alexandra Winter <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Fri, 18 Jul 2025 16:17:11 +0200 you wrote:
From: Aswin Karuvally <[email protected]>
Update qeth driver to allow writing an existing value to the "
hw_trap" sysfs attribute. Attempting such a write earlier resulted in-EINVAL. In other words, make the sysfs attribute idempotent.
Quoted 7 lines
After:
$ cat hw_trap disarm $ echo disarm > hw_trap $[...]
Here is the summary with links:
- [net-next] s390/qeth: Make hw_trap sysfs attribute idempotent
https://git.kernel.org/netdev/net-next/c/1b02c861714b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html