summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2019-07-02 02:10:00 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2019-07-02 02:10:00 +0000
commit5cff1a77887847ab6e8fb21cdba9ca83fe414fd0 (patch)
tree023ca49a8d1eb80bfb2b0d6e0599bc41fe310ff7
parentb09b3678fca5fa5e2876eab7292cbd8072c31525 (diff)
Use IPL_TTY for locks used as arguments to spin_lock_irq() and
spin_lock_irqsave() to closer match the linux interrupt blocking behaviour. Prompted by a discussion with kettenis@. ok kettenis@
-rw-r--r--sys/dev/pci/drm/drm_fb_helper.c2
-rw-r--r--sys/dev/pci/drm/i915/i915_perf.c2
-rw-r--r--sys/dev/pci/drm/i915/intel_breadcrumbs.c4
-rw-r--r--sys/dev/pci/drm/i915/intel_guc_ct.c2
-rw-r--r--sys/dev/pci/drm/i915/intel_guc_submission.c2
-rw-r--r--sys/dev/pci/drm/i915/intel_lpe_audio.c2
-rw-r--r--sys/dev/pci/drm/include/linux/spinlock_types.h2
7 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/pci/drm/drm_fb_helper.c b/sys/dev/pci/drm/drm_fb_helper.c
index 63897e9f5ee..368d7f2a83f 100644
--- a/sys/dev/pci/drm/drm_fb_helper.c
+++ b/sys/dev/pci/drm/drm_fb_helper.c
@@ -834,7 +834,7 @@ void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
const struct drm_fb_helper_funcs *funcs)
{
INIT_LIST_HEAD(&helper->kernel_fb_list);
- mtx_init(&helper->dirty_lock, IPL_NONE);
+ mtx_init(&helper->dirty_lock, IPL_TTY);
INIT_WORK(&helper->resume_work, drm_fb_helper_resume_worker);
INIT_WORK(&helper->dirty_work, drm_fb_helper_dirty_work);
helper->dirty_clip.x1 = helper->dirty_clip.y1 = ~0;
diff --git a/sys/dev/pci/drm/i915/i915_perf.c b/sys/dev/pci/drm/i915/i915_perf.c
index 13f728590b4..4c674e45934 100644
--- a/sys/dev/pci/drm/i915/i915_perf.c
+++ b/sys/dev/pci/drm/i915/i915_perf.c
@@ -3653,7 +3653,7 @@ void i915_perf_init(struct drm_i915_private *dev_priv)
INIT_LIST_HEAD(&dev_priv->perf.streams);
rw_init(&dev_priv->perf.lock, "perflk");
- mtx_init(&dev_priv->perf.oa.oa_buffer.ptr_lock, IPL_NONE);
+ mtx_init(&dev_priv->perf.oa.oa_buffer.ptr_lock, IPL_TTY);
oa_sample_rate_hard_limit = 1000 *
(INTEL_INFO(dev_priv)->cs_timestamp_frequency_khz / 2);
diff --git a/sys/dev/pci/drm/i915/intel_breadcrumbs.c b/sys/dev/pci/drm/i915/intel_breadcrumbs.c
index 656a25725cf..7f127435293 100644
--- a/sys/dev/pci/drm/i915/intel_breadcrumbs.c
+++ b/sys/dev/pci/drm/i915/intel_breadcrumbs.c
@@ -900,8 +900,8 @@ int intel_engine_init_breadcrumbs(struct intel_engine_cs *engine)
{
struct intel_breadcrumbs *b = &engine->breadcrumbs;
- mtx_init(&b->rb_lock, IPL_NONE);
- mtx_init(&b->irq_lock, IPL_NONE);
+ mtx_init(&b->rb_lock, IPL_TTY);
+ mtx_init(&b->irq_lock, IPL_TTY);
timeout_set(&b->fake_irq, intel_breadcrumbs_fake_irq, engine);
timeout_set(&b->hangcheck, intel_breadcrumbs_hangcheck, engine);
diff --git a/sys/dev/pci/drm/i915/intel_guc_ct.c b/sys/dev/pci/drm/i915/intel_guc_ct.c
index 013f5990e9c..f142b76e736 100644
--- a/sys/dev/pci/drm/i915/intel_guc_ct.c
+++ b/sys/dev/pci/drm/i915/intel_guc_ct.c
@@ -58,7 +58,7 @@ void intel_guc_ct_init_early(struct intel_guc_ct *ct)
/* we're using static channel owners */
ct->host_channel.owner = CTB_OWNER_HOST;
- mtx_init(&ct->lock, IPL_NONE);
+ mtx_init(&ct->lock, IPL_TTY);
INIT_LIST_HEAD(&ct->pending_requests);
INIT_LIST_HEAD(&ct->incoming_requests);
INIT_WORK(&ct->worker, ct_incoming_request_worker_func);
diff --git a/sys/dev/pci/drm/i915/intel_guc_submission.c b/sys/dev/pci/drm/i915/intel_guc_submission.c
index 1d8c663bde5..c71e06b583c 100644
--- a/sys/dev/pci/drm/i915/intel_guc_submission.c
+++ b/sys/dev/pci/drm/i915/intel_guc_submission.c
@@ -966,7 +966,7 @@ guc_client_alloc(struct drm_i915_private *dev_priv,
client->engines = engines;
client->priority = priority;
client->doorbell_id = GUC_DOORBELL_INVALID;
- mtx_init(&client->wq_lock, IPL_NONE);
+ mtx_init(&client->wq_lock, IPL_TTY);
ret = ida_simple_get(&guc->stage_ids, 0, GUC_MAX_STAGE_DESCRIPTORS,
GFP_KERNEL);
diff --git a/sys/dev/pci/drm/i915/intel_lpe_audio.c b/sys/dev/pci/drm/i915/intel_lpe_audio.c
index d70b570f6b5..78cb32c7e1c 100644
--- a/sys/dev/pci/drm/i915/intel_lpe_audio.c
+++ b/sys/dev/pci/drm/i915/intel_lpe_audio.c
@@ -119,7 +119,7 @@ lpe_audio_platdev_create(struct drm_i915_private *dev_priv)
pdata->port[0].pipe = -1;
pdata->port[1].pipe = -1;
pdata->port[2].pipe = -1;
- mtx_init(&pdata->lpe_audio_slock);
+ mtx_init(&pdata->lpe_audio_slock, IPL_TTY);
platdev = platform_device_register_full(&pinfo);
kfree(rsc);
diff --git a/sys/dev/pci/drm/include/linux/spinlock_types.h b/sys/dev/pci/drm/include/linux/spinlock_types.h
index 37b42507759..f76354838c9 100644
--- a/sys/dev/pci/drm/include/linux/spinlock_types.h
+++ b/sys/dev/pci/drm/include/linux/spinlock_types.h
@@ -8,6 +8,6 @@
#include <linux/rwlock_types.h>
typedef struct mutex spinlock_t;
-#define DEFINE_SPINLOCK(x) struct mutex x
+#define DEFINE_SPINLOCK(x) struct mutex x = MUTEX_INITIALIZER(IPL_TTY)
#endif