[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/4] device-core: use atomic_set on .realized property
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 3/4] device-core: use atomic_set on .realized property |
Date: |
Mon, 11 May 2020 13:11:12 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 11/05/20 13:00, Maxim Levitsky wrote:
> On second thought, I think both cases matter, after I examined the device
> removal case.
> In device removal case, the device is first un-realized and then removed from
> the bus,
> so just like in device hotplug case, the scsi_device_find can give you an
> unrealized device.
>
> I will change this patch to set .realized to false at the start (if needed)
> of the function and to true at the end (also if needed)
> Will atomic_rcu_set work? or atomic_store_release?
> (Both are the same thing, but former documents the purpose of using with RCU.
atomic_rcu_set is more to store pointers, in this case you want to store
the value after any other change to the struct so atomic_store_release
is more appropriate.
Paolo