Skip to content

Commit 0a6f4a6

Browse files
committed
Merge: s390: Upgrade the QETH driver to latest from upstream
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7472 JIRA: https://issues.redhat.com/browse/RHEL-99997 commit 1b02c86 s390/qeth: Make hw_trap sysfs attribute idempotent 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 $ Suggested-by: Alexandra Winter <wintera@linux.ibm.com> Signed-off-by: Aswin Karuvally <aswin@linux.ibm.com> Reviewed-by: Alexandra Winter <wintera@linux.ibm.com> Signed-off-by: Alexandra Winter <wintera@linux.ibm.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250718141711.1141049-1-wintera@linux.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Aswin Karuvally <aswin@linux.ibm.com> Signed-off-by: Mete Durlu <mdurlu@redhat.com> Approved-by: Steve Best <sbest@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Patrick Talbert <ptalbert@redhat.com>
2 parents 1383ecf + 01729c9 commit 0a6f4a6

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

drivers/s390/net/qeth_core_sys.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -518,28 +518,32 @@ static ssize_t qeth_hw_trap_store(struct device *dev,
518518
if (qeth_card_hw_is_reachable(card))
519519
state = 1;
520520

521-
if (sysfs_streq(buf, "arm") && !card->info.hwtrap) {
522-
if (state) {
521+
if (sysfs_streq(buf, "arm")) {
522+
if (state && !card->info.hwtrap) {
523523
if (qeth_is_diagass_supported(card,
524524
QETH_DIAGS_CMD_TRAP)) {
525525
rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM);
526526
if (!rc)
527527
card->info.hwtrap = 1;
528-
} else
528+
} else {
529529
rc = -EINVAL;
530-
} else
530+
}
531+
} else {
531532
card->info.hwtrap = 1;
532-
} else if (sysfs_streq(buf, "disarm") && card->info.hwtrap) {
533-
if (state) {
533+
}
534+
} else if (sysfs_streq(buf, "disarm")) {
535+
if (state && card->info.hwtrap) {
534536
rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
535537
if (!rc)
536538
card->info.hwtrap = 0;
537-
} else
539+
} else {
538540
card->info.hwtrap = 0;
539-
} else if (sysfs_streq(buf, "trap") && state && card->info.hwtrap)
541+
}
542+
} else if (sysfs_streq(buf, "trap") && state && card->info.hwtrap) {
540543
rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_CAPTURE);
541-
else
544+
} else {
542545
rc = -EINVAL;
546+
}
543547

544548
mutex_unlock(&card->conf_mutex);
545549
return rc ? rc : count;

0 commit comments

Comments
 (0)