Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4081104ybi; Mon, 29 Jul 2019 18:50:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdTZYLVqvemXSz/X4zkqg2vwm4WItXFybMgeziLsLGv1R7f13iE6KoClTsRX01jPM4E/XX X-Received: by 2002:aa7:9513:: with SMTP id b19mr39571021pfp.30.1564451457117; Mon, 29 Jul 2019 18:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564451457; cv=none; d=google.com; s=arc-20160816; b=eW/Xe/AZsR0w8Shwsc/xmkO+gIAcSbkzYH3J/hP8BZQAfC9PveDdGOTW2KM/V/Q+kV LAGqfTGl4c3WfFoMJ1TfzalEtIMC1asSH9DtI8c7zSKNp579jHD5RcGY40MJhzmsW28L qeMIleKVuVpbVJI/AUpxc6D5aDCCVTREnGjAHOK5vK5670W3/Hiyomm/Fe5KRYbI0Kv3 srPpooZMSvfEjmfrZa9bnRWj3qsaMgdJ75e9BK4Q6CGZXQ2xvnHCOLw1remnr6adIOQc SkvI+iM6gYlrwHdngW/ElmcTbQzCMCUrv/nQ5UtMcAnwjaY7/3OfF7XsF1xwtgDe/P5F xpmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=R6Gyb0ytX1gY6OxNi9RKyIY0TdL6986l7B7wNPhartQ=; b=ufZG5wbJXhMFHfDtVh7ouvAOqktpWdZkeToB/db/9tB9KzX7k2z91r4dNTnKXZUzpC BZM+NVR4YsRj09WL2nt3FAweYWUSLc1tfe6fv7wCdpWuYiL5UEbBqaOMrYwVYNpQUdHL FjCpEGhFWNqjJMJxkXbdXaOnPXGO16PtyC8/S9ihi6+GsCObxvYSoWV6KNmMFPKJSEoh 1ZJbZ/jlYDEYW3Ej6UrCAMPQDAaqPW6l3+nlZkwh624RHHM1R6Vqor62wBkiIUrePi0W k/6dsJ5dUg9lny8xDeeD+QuAiFelf2cvPRF/ajL4R1GDMAKUZCaIVjjMWPrK4/iBCcdV CNzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EpI1H7SN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t135si27978941pfc.251.2019.07.29.18.50.25; Mon, 29 Jul 2019 18:50:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EpI1H7SN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389079AbfG2Tj5 (ORCPT + 99 others); Mon, 29 Jul 2019 15:39:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:55144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389063AbfG2Tj4 (ORCPT ); Mon, 29 Jul 2019 15:39:56 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 29947217D4; Mon, 29 Jul 2019 19:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429195; bh=VmvEGOAIMGzuEZ0t5dd6qzEQ7ri/t5Em8QVNVLWiVxc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EpI1H7SNAdFK6vJYPf6FhuMHPtOQJAio1NqAf3IT+OLfwmTwznFvIOPn81yLXGoh5 97lw/kRhc9510guguqAy3ej1D0tCsXZJGUUNXInRmJyd8qn4RCmPbhJ8dTfjcDb6kY yJ19VmK4ePfXBq6aeDOJN9Y2h8RZNjRPj9EwHDII= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rodrigo Siqueira , Tomeu Vizoso , Emil Velikov , Benjamin Gaignard , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Daniel Vetter , Sasha Levin Subject: [PATCH 4.19 021/113] drm/crc-debugfs: Also sprinkle irqrestore over early exits Date: Mon, 29 Jul 2019 21:21:48 +0200 Message-Id: <20190729190700.902426445@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190655.455345569@linuxfoundation.org> References: <20190729190655.455345569@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit d99004d7201aa653658ff2390d6e516567c96ebc ] I. was. blind. Caught with vkms, which has some really slow crc computation function. Fixes: 1882018a70e0 ("drm/crc-debugfs: User irqsafe spinlock in drm_crtc_add_crc_entry") Cc: Rodrigo Siqueira Cc: Tomeu Vizoso Cc: Emil Velikov Cc: Benjamin Gaignard Cc: Ville Syrjälä Reviewed-by: Emil Velikov Reviewed-by: Benjamin Gaignard Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20190606211544.5389-1-daniel.vetter@ffwll.ch Signed-off-by: Sasha Levin --- drivers/gpu/drm/drm_debugfs_crc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c index a334a82fcb36..c88e5ff41add 100644 --- a/drivers/gpu/drm/drm_debugfs_crc.c +++ b/drivers/gpu/drm/drm_debugfs_crc.c @@ -385,7 +385,7 @@ int drm_crtc_add_crc_entry(struct drm_crtc *crtc, bool has_frame, /* Caller may not have noticed yet that userspace has stopped reading */ if (!crc->entries) { - spin_unlock(&crc->lock); + spin_unlock_irqrestore(&crc->lock, flags); return -EINVAL; } @@ -396,7 +396,7 @@ int drm_crtc_add_crc_entry(struct drm_crtc *crtc, bool has_frame, bool was_overflow = crc->overflow; crc->overflow = true; - spin_unlock(&crc->lock); + spin_unlock_irqrestore(&crc->lock, flags); if (!was_overflow) DRM_ERROR("Overflow of CRC buffer, userspace reads too slow.\n"); -- 2.20.1