[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: |
Maxim Levitsky |
Subject: |
Re: [PATCH 3/4] device-core: use atomic_set on .realized property |
Date: |
Mon, 11 May 2020 14:14:49 +0300 |
On Mon, 2020-05-11 at 13:11 +0200, Paolo Bonzini wrote:
> 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
>
All right then.
Best regards,
Maxim Levitsky