Re: [PATCH 1/2] pci: Block config access during BIST (resend)

Paul Mackerras
2005-09-07T05:49:22Z

Grant Grundler writes:

> Ok this is good example - I see what the problem is.
> You could use the following sequence too then:
> pci_block_user_cfg_access
> pci_save_state
> block_ucfg_access = 1
> mb()
> while (spin_is_locked(&pci_lock))
> relax_cpu();
>
> Think this is sufficient?

Maybe, but it seems like a bad idea to me. It's longer, it's less
obvious what's happening, and it precludes the sorts of optimization
that we do on ppc64 where a cpu that is waiting for a lock can tell
give its time slice to the cpu that is holding the lock (on systems
where the hypervisor time-slices multiple virtual cpus on one physical
cpu).

What's wrong with just doing spin_lock/spin_unlock?

Paul.