bus: make conn_rwlock a low-level lock
conn_rwlock protects the connection lists on a bus. Those lists are
usually only accessed deep down in our call-paths, so we can safely order
conn_rwlock _after_ bus->lock and ep->lock. We can even order it after
registry->lock and thus fix a dead-lock in list_names where we used to
have:
down_read(&bus->conn_rwlock);
down_read(®->rwlock);
.. which dead-locks against kmsg_send():
kdbus_name_lock(reg); (=> down_read(®->rwlock))
down_read(&bus->conn_rwlock);
The new lock-order isn't particularly beautiful, but there's currently no
way around it. We have to lock destination names on kmsg_send() to make
sure an activator does not get activated concurrently. We could lock
conn_rwlock in kmsg_send() early, but this is kinda ugly regarding
kdbus_conn_wait_reply(). Therefore, for now, lock conn_rwlock late. We can
always change the lock order again later.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>