From 0c5621bdf569be3b7ab1824cb075c367f49673be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Fri, 24 Nov 2023 17:40:48 +0100 Subject: [PATCH] drm: Drop FreeBSD-specific checks of oops_in_progress [Why] With vt_drmfb, I believe they are not needed anymore. --- drivers/gpu/drm/drm_modeset_lock.c | 56 ------------------------------ 1 file changed, 56 deletions(-) diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c index 132dd21c3a7..c9732336567 100644 --- a/drivers/gpu/drm/drm_modeset_lock.c +++ b/drivers/gpu/drm/drm_modeset_lock.c @@ -138,11 +138,6 @@ void drm_modeset_lock_all(struct drm_device *dev) struct drm_modeset_acquire_ctx *ctx; int ret; -#ifdef __FreeBSD__ - if (oops_in_progress) - return; -#endif - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | __GFP_NOFAIL); if (WARN_ON(!ctx)) return; @@ -196,11 +191,6 @@ void drm_modeset_unlock_all(struct drm_device *dev) struct drm_mode_config *config = &dev->mode_config; struct drm_modeset_acquire_ctx *ctx = config->acquire_ctx; -#ifdef __FreeBSD__ - if (oops_in_progress) - return; -#endif - if (WARN_ON(!ctx)) return; @@ -225,10 +215,8 @@ void drm_warn_on_modeset_not_all_locked(struct drm_device *dev) struct drm_crtc *crtc; /* Locking is currently fubar in the panic handler. */ -#ifdef __FreeBSD__ if (oops_in_progress) return; -#endif drm_for_each_crtc(crtc, dev) WARN_ON(!drm_modeset_is_locked(&crtc->mutex)); @@ -250,11 +238,6 @@ EXPORT_SYMBOL(drm_warn_on_modeset_not_all_locked); void drm_modeset_acquire_init(struct drm_modeset_acquire_ctx *ctx, uint32_t flags) { -#ifdef __FreeBSD__ - if (oops_in_progress) - return; -#endif - memset(ctx, 0, sizeof(*ctx)); ww_acquire_init(&ctx->ww_ctx, &crtc_ww_class); INIT_LIST_HEAD(&ctx->locked); @@ -270,11 +253,6 @@ EXPORT_SYMBOL(drm_modeset_acquire_init); */ void drm_modeset_acquire_fini(struct drm_modeset_acquire_ctx *ctx) { -#ifdef __FreeBSD__ - if (oops_in_progress) - return; -#endif - ww_acquire_fini(&ctx->ww_ctx); } EXPORT_SYMBOL(drm_modeset_acquire_fini); @@ -287,11 +265,6 @@ EXPORT_SYMBOL(drm_modeset_acquire_fini); */ void drm_modeset_drop_locks(struct drm_modeset_acquire_ctx *ctx) { -#ifdef __FreeBSD__ - if (oops_in_progress) - return; -#endif - if (WARN_ON(ctx->contended)) __drm_stack_depot_print(ctx->stack_depot); @@ -312,11 +285,6 @@ static inline int modeset_lock(struct drm_modeset_lock *lock, { int ret; -#ifdef __FreeBSD__ - if (oops_in_progress) - return 0; -#endif - if (WARN_ON(ctx->contended)) __drm_stack_depot_print(ctx->stack_depot); @@ -371,11 +339,6 @@ int drm_modeset_backoff(struct drm_modeset_acquire_ctx *ctx) { struct drm_modeset_lock *contended = ctx->contended; -#ifdef __FreeBSD__ - if (oops_in_progress) - return 0; -#endif - ctx->contended = NULL; ctx->stack_depot = 0; @@ -420,11 +383,6 @@ EXPORT_SYMBOL(drm_modeset_lock_init); int drm_modeset_lock(struct drm_modeset_lock *lock, struct drm_modeset_acquire_ctx *ctx) { -#ifdef __FreeBSD__ - if (oops_in_progress) - return 0; -#endif - if (ctx) return modeset_lock(lock, ctx, ctx->interruptible, false); @@ -444,10 +402,6 @@ EXPORT_SYMBOL(drm_modeset_lock); */ int drm_modeset_lock_single_interruptible(struct drm_modeset_lock *lock) { -#ifdef __FreeBSD__ - if (oops_in_progress) - return 0; -#endif return ww_mutex_lock_interruptible(&lock->mutex, NULL); } EXPORT_SYMBOL(drm_modeset_lock_single_interruptible); @@ -458,11 +412,6 @@ EXPORT_SYMBOL(drm_modeset_lock_single_interruptible); */ void drm_modeset_unlock(struct drm_modeset_lock *lock) { -#ifdef __FreeBSD__ - if (oops_in_progress) - return; -#endif - list_del_init(&lock->head); ww_mutex_unlock(&lock->mutex); } @@ -496,11 +445,6 @@ int drm_modeset_lock_all_ctx(struct drm_device *dev, struct drm_plane *plane; int ret; -#ifdef __FreeBSD__ - if (oops_in_progress) - return 0; -#endif - ret = drm_modeset_lock(&dev->mode_config.connection_mutex, ctx); if (ret) return ret;