---Problem Description---
Issues with HVCS and hotplugging issues.
When working on Canonical bug 2023243, it was discovered that mkvterm was not working for multiple reasons. This bug will cover the issues found in HVCS, and hotplugging issues found when drmgr writes the slot information to .../add_slot.
When mkvterm is ran, it ultimately fails because it calls pvmutil which fails. pvmutil calls drmgr, and drmgr is adding a slot correctly. However, when drmgr writes the slot information to ?/add_slot, the return is -ENODEV. This leads to HVCS never having probe() called. In addition, HVCS is missing patches, and is broken without them. 8 kernel patches have been identified to fix these issues.
---uname output---
Linux neop91.pok.stglabs.ibm.com 5.4.0-173-generic #191-Ubuntu SMP Fri Feb 2 13:54:35 UTC 2024 ppc64le ppc64le ppc64le GNU/Linux
2 commits made to arch/powerpc/platforms/pseries/of_helpers.c are needed. These commits fix the hotplugging issue seen when drmgr goes to write the slot information to /sys/bus/pci/slots/control/add_slot. This is also why the HVCS device nodes were not being created, as mentioned in the previous bug.
The issue lies in rpadlpar_io and rpaphp calling an of helper function of_read_drc_info_cell(). Without these commits, the value stored drc_index_start is incorrect. This ultimately results in the entire SLOT string being incorrect, and rpaphp never finding the newly added slot by drmgr. rpadlpar then returns -ENODEV. Therefore, HVCS is never probed, and the device nodes are never created.
Ideally - HVCS, rpadlpar_io, and rpaphp should not even need to be loaded prior to drmgr adding a vio slot. If rpadlpar_io and rpaphp are not loaded, drmgr will load them. In addition, if rpadlpar_io and rpaphp register the new slot correctly, rpadlpar_io will call dlpar_add_vio_slot(), which calls vio_register_device_node() with the device node. This is what tells the driver core to init and probe HVCS (which is needed to create the device nodes).
In addition to the 2 commits mentioned above, 6 HVCS commits are needed. HVCS is essentially broken without them. Issues include race conditions, hotplug remove issues, as well as memory leaks. These commits have been added to other distros after multiple issues were seen. Without these commits, 20.04 will experience the same issues. IBM plans on stress testing these changes after an updated kernel is provided in focal-proposed.
-------
2 commits that make changes to arch/powerpc/platforms/pseries/of_helpers.c:
---Problem Description---
Issues with HVCS and hotplugging issues.
When working on Canonical bug 2023243, it was discovered that mkvterm was not working for multiple reasons. This bug will cover the issues found in HVCS, and hotplugging issues found when drmgr writes the slot information to .../add_slot.
When mkvterm is ran, it ultimately fails because it calls pvmutil which fails. pvmutil calls drmgr, and drmgr is adding a slot correctly. However, when drmgr writes the slot information to ?/add_slot, the return is -ENODEV. This leads to HVCS never having probe() called. In addition, HVCS is missing patches, and is broken without them. 8 kernel patches have been identified to fix these issues.
---uname output--- pok.stglabs. ibm.com 5.4.0-173-generic #191-Ubuntu SMP Fri Feb 2 13:54:35 UTC 2024 ppc64le ppc64le ppc64le GNU/Linux
Linux neop91.
---Steps to Reproduce--- /bugs.launchpad .net/ubuntu/ +source/ powerpc- utils/+ bug/2023243 for more information.
Run mkvterm with an id. mkvterm will fail because /dev/hvcs* device nodes are missing. See https:/
------- ------- ------- ---
2 commits made to arch/powerpc/ platforms/ pseries/ of_helpers. c are needed. These commits fix the hotplugging issue seen when drmgr goes to write the slot information to /sys/bus/ pci/slots/ control/ add_slot. This is also why the HVCS device nodes were not being created, as mentioned in the previous bug.
The issue lies in rpadlpar_io and rpaphp calling an of helper function of_read_ drc_info_ cell(). Without these commits, the value stored drc_index_start is incorrect. This ultimately results in the entire SLOT string being incorrect, and rpaphp never finding the newly added slot by drmgr. rpadlpar then returns -ENODEV. Therefore, HVCS is never probed, and the device nodes are never created.
Ideally - HVCS, rpadlpar_io, and rpaphp should not even need to be loaded prior to drmgr adding a vio slot. If rpadlpar_io and rpaphp are not loaded, drmgr will load them. In addition, if rpadlpar_io and rpaphp register the new slot correctly, rpadlpar_io will call dlpar_add_ vio_slot( ), which calls vio_register_ device_ node() with the device node. This is what tells the driver core to init and probe HVCS (which is needed to create the device nodes).
In addition to the 2 commits mentioned above, 6 HVCS commits are needed. HVCS is essentially broken without them. Issues include race conditions, hotplug remove issues, as well as memory leaks. These commits have been added to other distros after multiple issues were seen. Without these commits, 20.04 will experience the same issues. IBM plans on stress testing these changes after an updated kernel is provided in focal-proposed.
-------
2 commits that make changes to arch/powerpc/ platforms/ pseries/ of_helpers. c:
powerpc/pseries: Fix bad drc_index_start value parsing of drc-info entry /git.kernel. org/pub/ scm/linux/ kernel/ git/torvalds/ linux.git/ commit/ ?id=57409d4fb12 c185b2c0689e049 6878c8f6bb5b58
https:/
powerpc/pseries: Fix of_read_ drc_info_ cell() to point at next record /git.kernel. org/pub/ scm/linux/ kernel/ git/torvalds/ linux.git/ commit/ ?id=c5e76fa05b2 df519b9f08571cc 57e623c1569faa
https:/
HVCS commits:
hvcs: Fix hvcs port reference counting /git.kernel. org/pub/ scm/linux/ kernel/ git/torvalds/ linux.git/ commit/ ?id=6a9a733edd4 6732e906d976dc2 1a42dd361e53cc
https:/
hvcs: Use dev_groups to manage hvcs device attributes /git.kernel. org/pub/ scm/linux/ kernel/ git/torvalds/ linux.git/ commit/ ?id=760aa5e81f3 3e0da82512c4288 489739a6d1c556
https:/
hvcs: Use driver groups to manage driver attributes /git.kernel. org/pub/ scm/linux/ kernel/ git/torvalds/ linux.git/ commit/ ?id=503a90dd619 d52dcac2cc68bd7 42aa914c7cd47a
https:/
hvcs: Get reference to tty in remove /git.kernel. org/pub/ scm/linux/ kernel/ git/torvalds/ linux.git/ commit/ ?id=3a8d3b366ce 47024bf274eac78 3f8af5df2780f5
https:/
hvcs: Use vhangup in hotplug remove /git.kernel. org/pub/ scm/linux/ kernel/ git/torvalds/ linux.git/ commit/ ?id=d432228bc7b 1b3f0ed06510278 ff5a77b3749fe6
https:/
hvcs: Synchronize hotplug remove with port free /git.kernel. org/pub/ scm/linux/ kernel/ git/torvalds/ linux.git/ commit/ ?id=28d49f8cbe9 c7966f91ee1b5ec 2f997f6e55bf9f
https:/