fsi: Improve master indexing
authorEddie James <eajames@linux.ibm.com>
Wed, 9 Aug 2023 18:08:13 +0000 (13:08 -0500)
committerJoel Stanley <joel@jms.id.au>
Fri, 11 Aug 2023 04:01:57 +0000 (13:31 +0930)
commitadde0e112c6365c6a930a3d8cd0c7a4accd55adc
treed250f1b75675785b5c941651f617c3c630d3e3f8
parent85f4e899de32ba3cd27fa601b17a700c85633626
fsi: Improve master indexing

Master indexing is problematic if a hub is rescanned while the
root master is being rescanned. Always allocate an index for the
FSI master, and set the device name if it hasn't already been set.
Move the call to ida_free to the bottom of master unregistration
and set the number of links to 0 in case another call to scan
comes in before the device is removed.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/20230809180814.151984-2-eajames@linux.ibm.com
Signed-off-by: Joel Stanley <joel@jms.id.au>
drivers/fsi/fsi-core.c