Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3140646ybi; Thu, 18 Jul 2019 21:49:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+GqvbF8iX5jgdOjYa+lNyYkuCTBMvk8gWltszcC1NcYleaRdTWfh0cegqcBSOIyQk1lQE X-Received: by 2002:a17:902:9346:: with SMTP id g6mr54319523plp.61.1563511794050; Thu, 18 Jul 2019 21:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563511794; cv=none; d=google.com; s=arc-20160816; b=GVgKTzQqyEJwnJxXDo3lr1fitKMDU/WmZTItbOFqsKNfh5dsJh3VkzpIVA1N06feLL NZLHPo9OphTk5gaRgLGeoUKk5P/gBFQat6hWK34O7nacd6sgEvdcaOFppSSbqNLQ/yyz BQ5J4oqgkw0j7IpQaelaC7X7huk06b/aKbLDU5ORO1N0u/0embfAzKvIpn/oeSLHM49u TtZ0QyWfUxGMB+Ka+42OmQ+5rrYhwhxc04pxioaSIt9x7IM3dXcj0WosY3dUwipTOCjg qReiCbyyqO0xtMDcYiFgS8O/kkpNbvP0NSIptGvnr8tql7nsuigPCjAArS1eeIM3No9X VlmA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GNj85Mgg7bWhpDDAEGeVLljKm7UleGcxR9GH4DJ7h4k=; b=EqMPvZHcUGQOq8iH74wiPIzts+h0G4Ymqdq37PLvET2XrefeZERNCR2jg/ESjciClT 0xxH6fwuaLRuRIVXdg0SjZ4R/F9q4jo9uZB2ruzNadpL4mdBg5aBSPf/jRN1aNiHleLg emVX4a+O7F4DAHD58ErRGG8TS0gXqOeX+U0Vg18oGLXwbzFZ7F19CdywDjD2TcV+mRZc rN9JGd4KNAtHaTjYCIhaO3kuMBsZu+K+VU18Dl2NJYoORASwQ3Q0zfvZHEhzPeNFS73j HsEctZxzOGPhToearLyOTiA35XryZINBTUgT14ZcpAmNbpPynF8mGH5dy57iDemK7lLQ VXcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nPEedqKc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si348744pjw.22.2019.07.18.21.49.37; Thu, 18 Jul 2019 21:49:54 -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=nPEedqKc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728091AbfGSD62 (ORCPT + 99 others); Thu, 18 Jul 2019 23:58:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:57718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728021AbfGSD6Y (ORCPT ); Thu, 18 Jul 2019 23:58:24 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D958921855; Fri, 19 Jul 2019 03:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508704; bh=WHIAtgyJYC88kgwu3EEgozkb3ZlqsrWEkHRoC+MFPxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nPEedqKcc/f+Kmro42wBG0DsF0HlqPkc+8IOvjhnHOck9UdVWkkGfQOwMe0lf+bv7 69P5UtWZXL+xYFjjGbeGUroPyBoSlFDqWnLeQW+cLetrL6iTKVXsDirMYdS6qmt9kz W52gYQ8uVrdCfrq3CHAUhyv8N0OCmUdRZprDm4+E= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Daniel Vetter , Rodrigo Siqueira , Tomeu Vizoso , Emil Velikov , Benjamin Gaignard , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Daniel Vetter , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.2 042/171] drm/crc-debugfs: Also sprinkle irqrestore over early exits Date: Thu, 18 Jul 2019 23:54:33 -0400 Message-Id: <20190719035643.14300-42-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Vetter [ 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