diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-30 19:21:03 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-30 19:21:03 -0800 |
| commit | c00552ebafddfe6abb397d957004f165e010abd2 (patch) | |
| tree | b397d6773b545755ffdae7566f8b96b08ee54ebb /include/linux/percpu-refcount.h | |
| parent | 842f57baab186417d89810f3dd6147f1ef3009dd (diff) | |
| parent | 009d0431c3914de64666bec0d350e54fdd59df6a (diff) | |
| download | cachepc-linux-c00552ebafddfe6abb397d957004f165e010abd2.tar.gz cachepc-linux-c00552ebafddfe6abb397d957004f165e010abd2.zip | |
Merge 3.18-rc7 into usb-next
We need the xhci fixes here and this resolves a merge issue with
drivers/usb/dwc3/ep0.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/percpu-refcount.h')
| -rw-r--r-- | include/linux/percpu-refcount.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h index d5c89e0dd0e6..51ce60c35f4c 100644 --- a/include/linux/percpu-refcount.h +++ b/include/linux/percpu-refcount.h @@ -133,7 +133,13 @@ static inline bool __ref_is_percpu(struct percpu_ref *ref, /* paired with smp_store_release() in percpu_ref_reinit() */ smp_read_barrier_depends(); - if (unlikely(percpu_ptr & __PERCPU_REF_ATOMIC)) + /* + * Theoretically, the following could test just ATOMIC; however, + * then we'd have to mask off DEAD separately as DEAD may be + * visible without ATOMIC if we race with percpu_ref_kill(). DEAD + * implies ATOMIC anyway. Test them together. + */ + if (unlikely(percpu_ptr & __PERCPU_REF_ATOMIC_DEAD)) return false; *percpu_countp = (unsigned long __percpu *)percpu_ptr; |
