Introduce a mechanism that performs an handshake between the userspace
provider and kernel driver which verifies that the user supports all
required features in order to operate correctly.
The handshake verifies the needed functionality by comparing the reported
device caps and the provider caps. If the device reports a non-zero
capability the appropriate comp mask is required from the userspace
provider in order to allocate the context.
Link: https://<email address hidden>
Reviewed-by: Shadi Ammouri <email address hidden>
Reviewed-by: Yossi Leybovich <email address hidden>
Signed-off-by: Gal Pressman <email address hidden>
Signed-off-by: Jason Gunthorpe <email address hidden>
(cherry picked from commit a5d87b698547233321466b2dc91271f5855a4df6)
Signed-off-by: Kamal Mostafa <email address hidden>
The code currently NULLs tty->driver_data in hvcs_close() with the
intent of informing the next call to hvcs_open() that device needs to be
reconfigured. However, when hvcs_cleanup() is called we copy hvcsd from
tty->driver_data which was previoulsy NULLed by hvcs_close() and our
call to tty_port_put(&hvcsd->port) doesn't actually do anything since
&hvcsd->port ends up translating to NULL by chance. This has the side
effect that when hvcs_remove() is called we have one too many port
references preventing hvcs_destuct_port() from ever being called. This
also prevents us from reusing the /dev/hvcsX node in a future
hvcs_probe() and we can eventually run out of /dev/hvcsX devices.
Fix this by waiting to NULL tty->driver_data in hvcs_cleanup().
This reverts commit 79ffe7107b13042c69c4a06394175362121b06b5. This is
commit d38a2b7a9c939e6d7329ab92b96559ccebf7b135 upstream.
Said commit causes same-sized kmemcaches to become unmergeable, and when a
new kmemcache is created, it will fail creating the sysfs entry, making the
kmemcache creation to fail.
Considering the original commit fix a leak but causes a different leak and
failures to create kmemcaches, the revert is preferable until a proper fix
is developed.
Signed-off-by: Thadeu Lima de Souza Cascardo <email address hidden>
Acked-by: Stefan Bader <email address hidden>
Acked-by: Ian May <email address hidden>
Signed-off-by: Ian May <email address hidden>