Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3797609ybi; Mon, 29 Jul 2019 12:49:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUpEnLy2LpNVZ3WJa/hGnEzJZCVMzY67+N1eevsA6cgAug2aGM/tiaKX6nfKpVN2B4SWF6 X-Received: by 2002:aa7:9afc:: with SMTP id y28mr37595968pfp.252.1564429783911; Mon, 29 Jul 2019 12:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429783; cv=none; d=google.com; s=arc-20160816; b=iacAMSeUQvI+6yKvhrVhTrHLhoO0rEBvlsJDhlgarJlvZaU63pVwhIfvGST/VzyNXc Kv25VWTUow+9Htd9A08oKqPpEzYh8ZMd1U5l01Sv3nfOeIxQMFrLVDWAwzBtGxaMl5XZ JgIQ1TpeIHCl14ZcBhfcpk2orib5ZqKEy49E1DNNtA3oUiesCx9jTkVrDB68pDlgWrXY ttxQXi8cLw8SBXKedy1VboHFX+XX63ioVwlzLlo182+xGqjcjdhkiQpaZX9yZ1L7N3ng PMDWCL9tTxJt40TDx8ywLfFxZ8x+xbLy/uEW1071nf9YH2mqRM0H5rkT8Xrvo3J8ZEsh ph9A== 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=43eA60Dd/kpiIDSv2JUylg5hEtW9Ra376KEU+n8JBe4=; b=vGJCT+Sb6fW2M3jiqFUDlQuNcf7Zf2erX6FHzjZknip92tt3CUD+yvpHhTOXyZafYz wvOR2J8gKvy8ZmIicq14alfaKCiOJdfU6/bzUneCVbAYKkkZtDG+vz0aixeGGAJToPVv 0hU7E9QZnllh3NLtzveIREwT4+dSil9ybaV06cNgSXn0ycd+bq+Vo9w3jLIZFd5/A4vD RrWbVLFYzSXtGHeRME3oDvEgpTUhpSM/Xq5L+KATwzK8LRluhzDbrNT6R0Vs74j/mBDc kJKLWtOEot/9MMijP00gAW4CTI+KZAH4V16elqz5KtZUOCPG4bdtMeUsMM5BWTMZKKfD i5bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GI6ynAHO; 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 w21si24069750plq.91.2019.07.29.12.49.29; Mon, 29 Jul 2019 12:49:43 -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=GI6ynAHO; 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 S2390287AbfG2TrJ (ORCPT + 99 others); Mon, 29 Jul 2019 15:47:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:36720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389866AbfG2TrH (ORCPT ); Mon, 29 Jul 2019 15:47:07 -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 623F8217D4; Mon, 29 Jul 2019 19:47:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429626; bh=03nD+YMz3hECF/W/qGMO6o99JCt5XJz4XizhuLrOqgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GI6ynAHOejFBbA3eBHmObkJax1zBLChOqT02fn3xOzhQ++1sxiGJ15EG8tWV6MNKm X/QY0Sk8j5w5vkQWsXx3t47Vt3Kcp4/mPxDR8I1ZuBExo2CdkXTUz3ldvaDvNsXVc8 FdS+mES6A+LlOagjnnAaLkk74fej8JcUTBkGXEp4= 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 5.2 044/215] drm/crc-debugfs: Also sprinkle irqrestore over early exits Date: Mon, 29 Jul 2019 21:20:40 +0200 Message-Id: <20190729190748.142517155@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@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 1a6a5b78e30f..fde298d9f510 100644 --- a/drivers/gpu/drm/drm_debugfs_crc.c +++ b/drivers/gpu/drm/drm_debugfs_crc.c @@ -395,7 +395,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; } @@ -406,7 +406,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