Commit 21b8715
s390/qeth: unbreak OSM and OSN support
[ Upstream commit 2d2ebb3ed0c6acfb014f98e427298673a5d07b82 ]
commit b4d72c0 ("qeth: bridgeport support - basic control")
broke the support for OSM and OSN devices as follows:
As OSM and OSN are L2 only, qeth_core_probe_device() does an early
setup by loading the l2 discipline and calling qeth_l2_probe_device().
In this context, adding the l2-specific bridgeport sysfs attributes
via qeth_l2_create_device_attributes() hits a BUG_ON in fs/sysfs/group.c,
since the basic sysfs infrastructure for the device hasn't been
established yet.
Note that OSN actually has its own unique sysfs attributes
(qeth_osn_devtype), so the additional attributes shouldn't be created
at all.
For OSM, add a new qeth_l2_devtype that contains all the common
and l2-specific sysfs attributes.
When qeth_core_probe_device() does early setup for OSM or OSN, assign
the corresponding devtype so that the ccwgroup probe code creates the
full set of sysfs attributes.
This allows us to skip qeth_l2_create_device_attributes() in case
of an early setup.
Any device that can't do early setup will initially have only the
generic sysfs attributes, and when it's probed later
qeth_l2_probe_device() adds the l2-specific attributes.
If an early-setup device is removed (by calling ccwgroup_ungroup()),
device_unregister() will - using the devtype - delete the
l2-specific attributes before qeth_l2_remove_device() is called.
So make sure to not remove them twice.
What complicates the issue is that qeth_l2_probe_device() and
qeth_l2_remove_device() is also called on a device when its
layer2 attribute changes (ie. its layer mode is switched).
For early-setup devices this wouldn't work properly - we wouldn't
remove the l2-specific attributes when switching to L3.
But switching the layer mode doesn't actually make any sense;
we already decided that the device can only operate in L2!
So just refuse to switch the layer mode on such devices. Note that
OSN doesn't have a layer2 attribute, so we only need to special-case
OSM.
Based on an initial patch by Ursula Braun.
Fixes: b4d72c0 ("qeth: bridgeport support - basic control")
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 2ac3709 commit 21b8715
7 files changed
Lines changed: 51 additions & 20 deletions
File tree
- drivers/s390/net
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
717 | 717 | | |
718 | 718 | | |
719 | 719 | | |
| 720 | + | |
720 | 721 | | |
721 | 722 | | |
722 | 723 | | |
| |||
881 | 882 | | |
882 | 883 | | |
883 | 884 | | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
884 | 888 | | |
885 | 889 | | |
886 | 890 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5449 | 5449 | | |
5450 | 5450 | | |
5451 | 5451 | | |
5452 | | - | |
| 5452 | + | |
5453 | 5453 | | |
5454 | 5454 | | |
5455 | 5455 | | |
| 5456 | + | |
| 5457 | + | |
5456 | 5458 | | |
5457 | 5459 | | |
5458 | 5460 | | |
| |||
5578 | 5580 | | |
5579 | 5581 | | |
5580 | 5582 | | |
5581 | | - | |
5582 | | - | |
5583 | | - | |
5584 | | - | |
5585 | | - | |
5586 | 5583 | | |
5587 | 5584 | | |
5588 | 5585 | | |
5589 | 5586 | | |
5590 | 5587 | | |
5591 | 5588 | | |
| 5589 | + | |
| 5590 | + | |
| 5591 | + | |
| 5592 | + | |
5592 | 5593 | | |
5593 | 5594 | | |
5594 | 5595 | | |
5595 | | - | |
5596 | | - | |
| 5596 | + | |
5597 | 5597 | | |
| 5598 | + | |
5598 | 5599 | | |
5599 | 5600 | | |
5600 | 5601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
418 | 422 | | |
419 | 423 | | |
420 | 424 | | |
| |||
701 | 705 | | |
702 | 706 | | |
703 | 707 | | |
704 | | - | |
| 708 | + | |
705 | 709 | | |
706 | 710 | | |
707 | 711 | | |
| 712 | + | |
708 | 713 | | |
709 | 714 | | |
710 | 715 | | |
| |||
724 | 729 | | |
725 | 730 | | |
726 | 731 | | |
727 | | - | |
| 732 | + | |
728 | 733 | | |
729 | 734 | | |
| 735 | + | |
730 | 736 | | |
731 | 737 | | |
732 | 738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1027 | 1027 | | |
1028 | 1028 | | |
1029 | 1029 | | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
1030 | 1035 | | |
1031 | 1036 | | |
1032 | 1037 | | |
1033 | 1038 | | |
1034 | 1039 | | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1038 | 1045 | | |
1039 | 1046 | | |
1040 | 1047 | | |
| |||
1046 | 1053 | | |
1047 | 1054 | | |
1048 | 1055 | | |
1049 | | - | |
| 1056 | + | |
| 1057 | + | |
1050 | 1058 | | |
1051 | 1059 | | |
1052 | 1060 | | |
| |||
1432 | 1440 | | |
1433 | 1441 | | |
1434 | 1442 | | |
| 1443 | + | |
1435 | 1444 | | |
1436 | 1445 | | |
1437 | 1446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3522 | 3522 | | |
3523 | 3523 | | |
3524 | 3524 | | |
| 3525 | + | |
3525 | 3526 | | |
3526 | 3527 | | |
3527 | 3528 | | |
| |||
0 commit comments