/*************************************************************************** * au88x0_a3d.h * * Fri Jul 18 14:16:03 2003 * Copyright 2003 mjander * mjander@users.sourceforge.net ****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _AU88X0_A3D_H #define _AU88X0_A3D_H //#include #define HRTF_SZ 0x38 #define DLINE_SZ 0x28 #define CTRLID_HRTF 1 #define CTRLID_ITD 2 #define CTRLID_ILD 4 #define CTRLID_FILTER 8 #define CTRLID_GAINS 16 /* 3D parameter structs */ typedef unsigned short int a3d_Hrtf_t[HRTF_SZ]; typedef unsigned short int a3d_ItdDline_t[DLINE_SZ]; typedef unsigned short int a3d_atmos_t[5]; typedef unsigned short int a3d_LRGains_t[2]; typedef unsigned short int a3d_Itd_t[2]; typedef unsigned short int a3d_Ild_t[2]; typedef struct { void *vortex; // Formerly CAsp4HwIO*, now vortex_t*. unsigned int source; /* this_04 */ unsigned int slice; /* this_08 */ a3d_Hrtf_t hrtf[2]; a3d_Itd_t itd; a3d_Ild_t ild; a3d_ItdDline_t dline; a3d_atmos_t filter; } a3dsrc_t; /* First Register bank */ #define A3D_A_HrtfCurrent 0x18000 /* 56 ULONG */ #define A3D_A_GainCurrent 0x180E0 #define A3D_A_GainTarget 0x180E4 #define A3D_A_A12Current 0x180E8 /* Atmospheric current. */ #define A3D_A_A21Target 0x180EC /* Atmospheric target */ #define A3D_A_B01Current 0x180F0 /* Atmospheric current */ #define A3D_A_B10Target 0x180F4 /* Atmospheric target */ #define A3D_A_B2Current 0x180F8 /* Atmospheric current */ #define A3D_A_B2Target 0x180FC /* Atmospheric target */ #define A3D_A_HrtfTarget 0x18100 /* 56 ULONG */ #define A3D_A_ITDCurrent 0x181E0 #define A3D_A_ITDTarget 0x181E4 #define A3D_A_HrtfDelayLine 0x181E8 /* 56 ULONG */ #define A3D_A_ITDDelayLine 0x182C8 /* 40/45 ULONG */ #define A3D_A_HrtfTrackTC 0x1837C /* Time Constants */ #define A3D_A_GainTrackTC 0x18380 #define A3D_A_CoeffTrackTC 0x18384 #define A3D_A_ITDTrackTC 0x18388 #define A3D_A_x1 0x1838C #define A3D_A_x2 0x18390 #define A3D_A_y1 0x18394 #define A3D_A_y2 0x18398 #define A3D_A_HrtfOutL 0x1839C #define A3D_A_HrtfOutR 0x183A0 #define A3D_A_TAIL 0x183A4 /* Second register bank */ #define A3D_B_HrtfCurrent 0x19000 /* 56 ULONG */ #define A3D_B_GainCurrent 0x190E0 #define A3D_B_GainTarget 0x190E4 #define A3D_B_A12Current 0x190E8 #define A3D_B_A21Target 0x190EC #define A3D_B_B01Current 0x190F0 #define A3D_B_B10Target 0x190F4 #define A3D_B_B2Current 0x190F8 #define A3D_B_B2Target 0x190FC #define A3D_B_HrtfTarget 0x19100 /* 56 ULONG */ #define A3D_B_ITDCurrent 0x191E0 #define A3D_B_ITDTarget 0x191E4 #define A3D_B_HrtfDelayLine 0x191E8 /* 56 ULONG */ #define A3D_B_TAIL 0x192C8 /* There are 4 slices, 4 a3d each = 16 a3d sources. */ #define A3D_SLICE_BANK_A 0x18000 /* 4 sources */ #define A3D_SLICE_BANK_B 0x19000 /* 4 sources */ #define A3D_SLICE_VDBDest 0x19C00 /* 8 ULONG */ #define A3D_SLICE_VDBSource 0x19C20 /* 4 ULONG */ #define A3D_SLICE_ABReg 0x19C30 #define A3D_SLICE_CReg 0x19C34 #define A3D_SLICE_Control 0x19C38 #define A3D_SLICE_DebugReserved 0x19C3c /* Dangerous! */ #define A3D_SLICE_Pointers 0x19C40 #define A3D_SLICE_TAIL 0x1A000 // Slice size: 0x2000 // Source size: 0x3A4, 0x2C8 /* Address generator macro. */ #define a3d_addrA(slice,source,reg) (((slice)<<0xd)+((source)*0x3A4)+(reg)) #define a3d_addrB(slice,source,reg) (((slice)<<0xd)+((source)*0x2C8)+(reg)) #define a3d_addrS(slice,reg) (((slice)<<0xd)+(reg)) //#define a3d_addr(slice,source,reg) (((reg)>=0x19000) ? a3d_addr2((slice),(source),(reg)) : a3d_addr1((slice),(source),(reg))) #endif /* _AU88X0_A3D_H */ '>15space:mode:
authorDouglas Miller <dougmill@linux.vnet.ibm.com>2017-01-28 06:42:20 -0600
committerTejun Heo <tj@kernel.org>2017-01-28 07:49:42 -0500
commit966d2b04e070bc040319aaebfec09e0144dc3341 (patch)
tree4b96156e3d1dd4dfd6039b7c219c9dc4616da52d /include/trace/events/nmi.h
parent1b1bc42c1692e9b62756323c675a44cb1a1f9dbd (diff)
percpu-refcount: fix reference leak during percpu-atomic transition
percpu_ref_tryget() and percpu_ref_tryget_live() should return "true" IFF they acquire a reference. But the return value from atomic_long_inc_not_zero() is a long and may have high bits set, e.g. PERCPU_COUNT_BIAS, and the return value of the tryget routines is bool so the reference may actually be acquired but the routines return "false" which results in a reference leak since the caller assumes it does not need to do a corresponding percpu_ref_put(). This was seen when performing CPU hotplug during I/O, as hangs in blk_mq_freeze_queue_wait where percpu_ref_kill (blk_mq_freeze_queue_start) raced with percpu_ref_tryget (blk_mq_timeout_work). Sample stack trace: __switch_to+0x2c0/0x450 __schedule+0x2f8/0x970 schedule+0x48/0xc0 blk_mq_freeze_queue_wait+0x94/0x120 blk_mq_queue_reinit_work+0xb8/0x180 blk_mq_queue_reinit_prepare+0x84/0xa0 cpuhp_invoke_callback+0x17c/0x600 cpuhp_up_callbacks+0x58/0x150 _cpu_up+0xf0/0x1c0 do_cpu_up+0x120/0x150 cpu_subsys_online+0x64/0xe0 device_online+0xb4/0x120 online_store+0xb4/0xc0 dev_attr_store+0x68/0xa0 sysfs_kf_write+0x80/0xb0 kernfs_fop_write+0x17c/0x250 __vfs_write+0x6c/0x1e0 vfs_write+0xd0/0x270 SyS_write+0x6c/0x110 system_call+0x38/0xe0 Examination of the queue showed a single reference (no PERCPU_COUNT_BIAS, and __PERCPU_REF_DEAD, __PERCPU_REF_ATOMIC set) and no requests. However, conditions at the time of the race are count of PERCPU_COUNT_BIAS + 0 and __PERCPU_REF_DEAD and __PERCPU_REF_ATOMIC set. The fix is to make the tryget routines use an actual boolean internally instead of the atomic long result truncated to a int. Fixes: e625305b3907 percpu-refcount: make percpu_ref based on longs instead of ints Link: https://bugzilla.kernel.org/show_bug.cgi?id=190751 Signed-off-by: Douglas Miller <dougmill@linux.vnet.ibm.com> Reviewed-by: Jens Axboe <axboe@fb.com> Signed-off-by: Tejun Heo <tj@kernel.org> Fixes: e625305b3907 ("percpu-refcount: make percpu_ref based on longs instead of ints") Cc: stable@vger.kernel.org # v3.18+
Diffstat (limited to 'include/trace/events/nmi.h')