From: jsg Date: Sat, 11 Apr 2015 05:10:13 +0000 (+0000) Subject: change back to spinlock_t/DEFINE_SPINLOCK X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c87d5b9b5572e46a81a52a0ddd019c06d04b1b4e;p=openbsd change back to spinlock_t/DEFINE_SPINLOCK --- diff --git a/sys/dev/pci/drm/drm_linux.h b/sys/dev/pci/drm/drm_linux.h index de79692de2f..0f507541e16 100644 --- a/sys/dev/pci/drm/drm_linux.h +++ b/sys/dev/pci/drm/drm_linux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_linux.h,v 1.18 2015/04/11 02:59:05 jsg Exp $ */ +/* $OpenBSD: drm_linux.h,v 1.19 2015/04/11 05:10:13 jsg Exp $ */ /* * Copyright (c) 2013, 2014 Mark Kettenis * @@ -207,6 +207,7 @@ IS_ERR_OR_NULL(const void *ptr) #endif typedef struct mutex spinlock_t; +#define DEFINE_SPINLOCK(x) struct mutex x static inline void spin_lock_irqsave(struct mutex *mtxp, __unused unsigned long flags) diff --git a/sys/dev/pci/drm/i915/i915_drv.h b/sys/dev/pci/drm/i915/i915_drv.h index ed992095b95..2f24e012f14 100644 --- a/sys/dev/pci/drm/i915/i915_drv.h +++ b/sys/dev/pci/drm/i915/i915_drv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_drv.h,v 1.59 2015/04/11 02:24:43 jsg Exp $ */ +/* $OpenBSD: i915_drv.h,v 1.60 2015/04/11 05:10:13 jsg Exp $ */ /* i915_drv.h -- Private header for the I915 driver -*- linux-c -*- */ /* @@ -608,7 +608,7 @@ struct intel_gen6_power_mgmt { u32 pm_iir; /* lock - irqsave spinlock that protectects the work_struct and * pm_iir. */ - struct mutex lock; + spinlock_t lock; /* The below variables an all the rps hw state are protected by * dev->struct mutext. */ diff --git a/sys/dev/pci/drm/i915/i915_irq.c b/sys/dev/pci/drm/i915/i915_irq.c index 536ad2cd95a..368b08c3c68 100644 --- a/sys/dev/pci/drm/i915/i915_irq.c +++ b/sys/dev/pci/drm/i915/i915_irq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_irq.c,v 1.22 2015/04/06 05:35:29 jsg Exp $ */ +/* $OpenBSD: i915_irq.c,v 1.23 2015/04/11 05:10:13 jsg Exp $ */ /* i915_irq.c -- IRQ support for the I915 -*- linux-c -*- */ /* @@ -297,7 +297,7 @@ static void i915_hotplug_work_func(void *arg1) } /* defined intel_pm.c */ -extern struct mutex mchdev_lock; +extern spinlock_t mchdev_lock; static void ironlake_handle_rps_change(struct drm_device *dev) { diff --git a/sys/dev/pci/drm/i915/intel_pm.c b/sys/dev/pci/drm/i915/intel_pm.c index e89070c6f09..3b1561c3ddc 100644 --- a/sys/dev/pci/drm/i915/intel_pm.c +++ b/sys/dev/pci/drm/i915/intel_pm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_pm.c,v 1.30 2015/04/08 04:24:40 jsg Exp $ */ +/* $OpenBSD: intel_pm.c,v 1.31 2015/04/11 05:10:13 jsg Exp $ */ /* * Copyright © 2012 Intel Corporation * @@ -2315,7 +2315,7 @@ err_unref: /** * Lock protecting IPS related data structures */ -struct mutex mchdev_lock; +DEFINE_SPINLOCK(mchdev_lock); /* Global for IPS driver to get at the current i915 device. Protected by * mchdev_lock. */ diff --git a/sys/dev/pci/drm/radeon/radeon.h b/sys/dev/pci/drm/radeon/radeon.h index b74d7ff1cb1..e077633a953 100644 --- a/sys/dev/pci/drm/radeon/radeon.h +++ b/sys/dev/pci/drm/radeon/radeon.h @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon.h,v 1.12 2015/04/06 07:38:49 jsg Exp $ */ +/* $OpenBSD: radeon.h,v 1.13 2015/04/11 05:10:13 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -597,7 +597,7 @@ union radeon_irq_stat_regs { struct radeon_irq { bool installed; - struct mutex lock; + spinlock_t lock; atomic_t ring_int[RADEON_NUM_RINGS]; bool crtc_vblank_int[RADEON_MAX_CRTCS]; atomic_t pflip[RADEON_MAX_CRTCS]; @@ -1604,7 +1604,7 @@ struct radeon_device { bus_addr_t rmmio_base; bus_size_t rmmio_size; /* protects concurrent MM_INDEX/DATA based register access */ - struct mutex mmio_idx_lock; + spinlock_t mmio_idx_lock; bus_space_handle_t rmmio; radeon_rreg_t mc_rreg; radeon_wreg_t mc_wreg; diff --git a/sys/dev/pci/drm/ttm/ttm_bo_manager.c b/sys/dev/pci/drm/ttm/ttm_bo_manager.c index 2a8111844ca..d604b555164 100644 --- a/sys/dev/pci/drm/ttm/ttm_bo_manager.c +++ b/sys/dev/pci/drm/ttm/ttm_bo_manager.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttm_bo_manager.c,v 1.3 2015/02/10 10:50:49 jsg Exp $ */ +/* $OpenBSD: ttm_bo_manager.c,v 1.4 2015/04/11 05:10:13 jsg Exp $ */ /************************************************************************** * * Copyright (c) 2007-2010 VMware, Inc., Palo Alto, CA., USA @@ -42,7 +42,7 @@ struct ttm_range_manager { struct drm_mm mm; - struct mutex lock; + spinlock_t lock; }; static int ttm_bo_man_get_node(struct ttm_mem_type_manager *man, diff --git a/sys/dev/pci/drm/ttm/ttm_object.c b/sys/dev/pci/drm/ttm/ttm_object.c index 1f9b1923223..376fc70fad4 100644 --- a/sys/dev/pci/drm/ttm/ttm_object.c +++ b/sys/dev/pci/drm/ttm/ttm_object.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttm_object.c,v 1.6 2015/02/12 06:52:11 jsg Exp $ */ +/* $OpenBSD: ttm_object.c,v 1.7 2015/04/11 05:10:13 jsg Exp $ */ /************************************************************************** * * Copyright (c) 2009 VMware, Inc., Palo Alto, CA., USA @@ -78,7 +78,7 @@ struct ttm_object_file { */ struct ttm_object_device { - struct mutex object_lock; + spinlock_t object_lock; struct drm_open_hash object_hash; atomic_t object_count; struct ttm_mem_global *mem_glob; diff --git a/sys/dev/pci/drm/ttm/ttm_page_alloc.c b/sys/dev/pci/drm/ttm/ttm_page_alloc.c index b2cb2f3e857..48e4d7d96d9 100644 --- a/sys/dev/pci/drm/ttm/ttm_page_alloc.c +++ b/sys/dev/pci/drm/ttm/ttm_page_alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttm_page_alloc.c,v 1.8 2015/02/11 07:01:37 jsg Exp $ */ +/* $OpenBSD: ttm_page_alloc.c,v 1.9 2015/04/11 05:10:13 jsg Exp $ */ /* * Copyright (c) Red Hat Inc. @@ -63,7 +63,7 @@ * @npages: Number of pages in pool. */ struct ttm_page_pool { - struct mutex lock; + spinlock_t lock; bool fill_lock; struct pglist list; int ttm_page_alloc_flags;