/* * Driver for Digigram VX222 PCI soundcards * * Copyright (c) 2002 by Takashi Iwai * * 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 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 __VX222_H #define __VX222_H #include struct snd_vx222 { struct vx_core core; /* h/w config; for PLX and for DSP */ struct pci_dev *pci; unsigned long port[2]; unsigned int regCDSP; /* current CDSP register */ unsigned int regCFG; /* current CFG register */ unsigned int regSELMIC; /* current SELMIC reg. (for VX222 Mic) */ int input_level[2]; /* input level for vx222 mic */ int mic_level; /* mic level for vx222 mic */ }; /* we use a lookup table with 148 values, see vx_mixer.c */ #define VX2_AKM_LEVEL_MAX 0x93 extern struct snd_vx_ops vx222_ops; extern struct snd_vx_ops vx222_old_ops; /* Offset of registers with base equal to portDSP. */ #define VX_RESET_DMA_REGISTER_OFFSET 0x00000008 /* Constants used to access the INTCSR register. */ #define VX_INTCSR_VALUE 0x00000001 #define VX_PCI_INTERRUPT_MASK 0x00000040 /* Constants used to access the CDSP register (0x20). */ #define VX_CDSP_TEST1_MASK 0x00000080 #define VX_CDSP_TOR1_MASK 0x00000040 #define VX_CDSP_TOR2_MASK 0x00000020 #define VX_CDSP_RESERVED0_0_MASK 0x00000010 #define VX_CDSP_CODEC_RESET_MASK 0x00000008 #define VX_CDSP_VALID_IRQ_MASK 0x00000004 #define VX_CDSP_TEST0_MASK 0x00000002 #define VX_CDSP_DSP_RESET_MASK 0x00000001 #define VX_CDSP_GPIO_OUT_MASK 0x00000060 #define VX_GPIO_OUT_BIT_OFFSET 5 // transform output to bit 0 and 1 /* Constants used to access the CFG register (0x24). */ #define VX_CFG_SYNCDSP_MASK 0x00000080 #define VX_CFG_RESERVED0_0_MASK 0x00000040 #define VX_CFG_RESERVED1_0_MASK 0x00000020 #define VX_CFG_RESERVED2_0_MASK 0x00000010 #define VX_CFG_DATAIN_SEL_MASK 0x00000008 // 0 (ana), 1 (UER) #define VX_CFG_RESERVED3_0_MASK 0x00000004 #define VX_CFG_RESERVED4_0_MASK 0x00000002 #define VX_CFG_CLOCKIN_SEL_MASK 0x00000001 // 0 (internal), 1 (AES/EBU) /* Constants used to access the STATUS register (0x30). */ #define VX_STATUS_DATA_XICOR_MASK 0x00000080 #define VX_STATUS_VAL_TEST1_MASK 0x00000040 #define VX_STATUS_VAL_TEST0_MASK 0x00000020 #define VX_STATUS_RESERVED0_MASK 0x00000010 #define VX_STATUS_VAL_TOR1_MASK 0x00000008 #define VX_STATUS_VAL_TOR0_MASK 0x00000004 #define VX_STATUS_LEVEL_IN_MASK 0x00000002 // 6 dBu (0), 22 dBu (1) #define VX_STATUS_MEMIRQ_MASK 0x00000001 #define VX_STATUS_GPIO_IN_MASK 0x0000000C #define VX_GPIO_IN_BIT_OFFSET 0 // leave input as bit 2 and 3 /* Constants used to access the MICRO INPUT SELECT register (0x40). */ #define MICRO_SELECT_INPUT_NORM 0x00 #define MICRO_SELECT_INPUT_MUTE 0x01 #define MICRO_SELECT_INPUT_LIMIT 0x02 #define MICRO_SELECT_INPUT_MASK 0x03 #define MICRO_SELECT_PREAMPLI_G_0 0x00 #define MICRO_SELECT_PREAMPLI_G_1 0x04 #define MICRO_SELECT_PREAMPLI_G_2 0x08 #define MICRO_SELECT_PREAMPLI_G_3 0x0C #define MICRO_SELECT_PREAMPLI_MASK 0x0C #define MICRO_SELECT_PREAMPLI_OFFSET 2 #define MICRO_SELECT_RAISE_COMPR 0x10 #define MICRO_SELECT_NOISE_T_52DB 0x00 #define MICRO_SELECT_NOISE_T_42DB 0x20 #define MICRO_SELECT_NOISE_T_32DB 0x40 #define MICRO_SELECT_NOISE_T_MASK 0x60 #define MICRO_SELECT_PHANTOM_ALIM 0x80 #endif /* __VX222_H */ ion>
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-29 13:50:06 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-29 13:50:06 -0800
commit39cb2c9a316e77f6dfba96c543e55b6672d5a37e (patch)
tree98fe974ee4e20121253de7f61fc8d01bdb3821c1 /net/wireless/ethtool.c
parent2c5d9555d6d937966d79d4c6529a5f7b9206e405 (diff)
drm/i915: Check for NULL i915_vma in intel_unpin_fb_obj()
I've seen this trigger twice now, where the i915_gem_object_to_ggtt() call in intel_unpin_fb_obj() returns NULL, resulting in an oops immediately afterwards as the (inlined) call to i915_vma_unpin_fence() tries to dereference it. It seems to be some race condition where the object is going away at shutdown time, since both times happened when shutting down the X server. The call chains were different: - VT ioctl(KDSETMODE, KD_TEXT): intel_cleanup_plane_fb+0x5b/0xa0 [i915] drm_atomic_helper_cleanup_planes+0x6f/0x90 [drm_kms_helper] intel_atomic_commit_tail+0x749/0xfe0 [i915] intel_atomic_commit+0x3cb/0x4f0 [i915] drm_atomic_commit+0x4b/0x50 [drm] restore_fbdev_mode+0x14c/0x2a0 [drm_kms_helper] drm_fb_helper_restore_fbdev_mode_unlocked+0x34/0x80 [drm_kms_helper] drm_fb_helper_set_par+0x2d/0x60 [drm_kms_helper] intel_fbdev_set_par+0x18/0x70 [i915] fb_set_var+0x236/0x460 fbcon_blank+0x30f/0x350 do_unblank_screen+0xd2/0x1a0 vt_ioctl+0x507/0x12a0 tty_ioctl+0x355/0xc30 do_vfs_ioctl+0xa3/0x5e0 SyS_ioctl+0x79/0x90 entry_SYSCALL_64_fastpath+0x13/0x94 - i915 unpin_work workqueue: intel_unpin_work_fn+0x58/0x140 [i915] process_one_work+0x1f1/0x480 worker_thread+0x48/0x4d0 kthread+0x101/0x140 and this patch purely papers over the issue by adding a NULL pointer check and a WARN_ON_ONCE() to avoid the oops that would then generally make the machine unresponsive. Other callers of i915_gem_object_to_ggtt() seem to also check for the returned pointer being NULL and warn about it, so this clearly has happened before in other places. [ Reported it originally to the i915 developers on Jan 8, applying the ugly workaround on my own now after triggering the problem for the second time with no feedback. This is likely to be the same bug reported as https://bugs.freedesktop.org/show_bug.cgi?id=98829 https://bugs.freedesktop.org/show_bug.cgi?id=99134 which has a patch for the underlying problem, but it hasn't gotten to me, so I'm applying the workaround. ] Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Imre Deak <imre.deak@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/wireless/ethtool.c')