From patchwork Thu Jun 6 22:27:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10980519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E4A4A924 for ; Thu, 6 Jun 2019 22:28:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2BC71FFE4 for ; Thu, 6 Jun 2019 22:28:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C68B627EE2; Thu, 6 Jun 2019 22:28:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 809771FFE4 for ; Thu, 6 Jun 2019 22:28:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA22F899DE; Thu, 6 Jun 2019 22:28:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8E366899DC for ; Thu, 6 Jun 2019 22:28:04 +0000 (UTC) Received: by mail-ed1-x543.google.com with SMTP id h10so5506435edi.13 for ; Thu, 06 Jun 2019 15:28:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1I9sMdTtsYXfYIr7rVQo1r0PCEJ8mmlZIw88kpA45qo=; b=Np+0uv5GKrc6lmo+Cb6MKdS6QlJDrEA+x3g7/a3hrtdwUbpWc3rIBTBnv4XbHP2hqs LLY0ToCzRNoKd1YJveipv5SYOVs5EPKBJquAsMA/7boU4g+iIM68JfQDxI1UYxOYQHcU cTokHIzXQ69IEyeWLTxVYhm6XYY/NLCm2oXTqIogeETU/yjmI4WFhQg1gYM4aBjYeO7e KuShHDLsgaX9p/GaoY7B2lpnwaaS8rp2wJGWIr2mZk3lDaPOKcFfR+K/j4pLwuMWGBdq SzE+cD8YYkuGxUcrQaTQ/s1WfqmrK1524SxPA7yr99iGfOinrz6OyRSiEBUnZD0d5Nnl nhjQ== X-Gm-Message-State: APjAAAVRJMWhkVSb6xAuiS6vSEt/C1cHTG5mkWutUTCfKAE8XhlgbRNL j5HXXreTYHNAivCD7fn53GAYNxuHybk= X-Google-Smtp-Source: APXvYqxiiMZqnvdDmL931VmKRhN7LSyDzl2GZzvV8oVEahTGrMuMjIiyY4uJDXKCXzAAqWjT2bK41A== X-Received: by 2002:a17:906:9256:: with SMTP id c22mr2586191ejx.172.1559860082918; Thu, 06 Jun 2019 15:28:02 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id z10sm54228edl.35.2019.06.06.15.28.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 06 Jun 2019 15:28:02 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 02/10] drm/vkms: Use spin_lock_irq in process context Date: Fri, 7 Jun 2019 00:27:43 +0200 Message-Id: <20190606222751.32567-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190606222751.32567-1-daniel.vetter@ffwll.ch> References: <20190606222751.32567-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1I9sMdTtsYXfYIr7rVQo1r0PCEJ8mmlZIw88kpA45qo=; b=W/P2DUxM1+fk501VS2enDT/x/9MRepLNdmC+DjnJS7FOkNqL/TmL8hH4MUMuQjgd5c GGcqzqKEVS7xNebz2Gi6eqYc6Tk1q7ESAOCDhJRhU5/FW4XIIpVS+u3YbBT44C+qKlZm Bo768jZpwi7zoYOwJH04phINqZmXzzY7CRMlA= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Haneen Mohammed , Rodrigo Siqueira , Daniel Vetter , Shayenne Moura , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The worker is always in process context, no need for the _irqsafe version. Same for the set_source callback, that's only called from the debugfs handler in a syscall. Cc: Shayenne Moura Cc: Rodrigo Siqueira Signed-off-by: Daniel Vetter Cc: Haneen Mohammed Cc: Daniel Vetter Reviewed-by: Rodrigo Siqueira Tested-by: Rodrigo Siqueira --- drivers/gpu/drm/vkms/vkms_crc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_crc.c b/drivers/gpu/drm/vkms/vkms_crc.c index 66603da634fe..883e36fe7b6e 100644 --- a/drivers/gpu/drm/vkms/vkms_crc.c +++ b/drivers/gpu/drm/vkms/vkms_crc.c @@ -167,16 +167,15 @@ void vkms_crc_work_handle(struct work_struct *work) u32 crc32 = 0; u64 frame_start, frame_end; bool crc_pending; - unsigned long flags; - spin_lock_irqsave(&out->state_lock, flags); + spin_lock_irq(&out->state_lock); frame_start = crtc_state->frame_start; frame_end = crtc_state->frame_end; crc_pending = crtc_state->crc_pending; crtc_state->frame_start = 0; crtc_state->frame_end = 0; crtc_state->crc_pending = false; - spin_unlock_irqrestore(&out->state_lock, flags); + spin_unlock_irq(&out->state_lock); /* * We raced with the vblank hrtimer and previous work already computed @@ -246,7 +245,6 @@ int vkms_set_crc_source(struct drm_crtc *crtc, const char *src_name) { struct vkms_output *out = drm_crtc_to_vkms_output(crtc); bool enabled = false; - unsigned long flags; int ret = 0; ret = vkms_crc_parse_source(src_name, &enabled); @@ -254,9 +252,9 @@ int vkms_set_crc_source(struct drm_crtc *crtc, const char *src_name) /* make sure nothing is scheduled on crtc workq */ flush_workqueue(out->crc_workq); - spin_lock_irqsave(&out->lock, flags); + spin_lock_irq(&out->lock); out->crc_enabled = enabled; - spin_unlock_irqrestore(&out->lock, flags); + spin_unlock_irq(&out->lock); return ret; }