From patchwork Thu Mar 30 14:08:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9654301 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2B4E760349 for ; Thu, 30 Mar 2017 14:08:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D334284BC for ; Thu, 30 Mar 2017 14:08:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11FE3284D0; Thu, 30 Mar 2017 14:08:40 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable 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 D4AC0284BC for ; Thu, 30 Mar 2017 14:08:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6D216E8D1; Thu, 30 Mar 2017 14:08:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8C3306E8D0; Thu, 30 Mar 2017 14:08:36 +0000 (UTC) Received: by mail-wr0-x243.google.com with SMTP id w43so12517451wrb.1; Thu, 30 Mar 2017 07:08:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WsAYyhWfGKVkST2xqFuDyPxjPPXRaXysRD6hjoK5s6U=; b=ed//7RpJ+NXi3BsdXv28hFbIg3MOUNuVo9B9vRr36896p8CvKG8rBqwsB6cehuSCQ9 b0WtyQC1TqMtt8oD6qZslz7lM18MinAfcfp3PIT1RcuA+qvvQ2+OdFtUKZWm4MKWfUQ8 qknXPUsqYOpsXY+V6WIXrzJdxzstW9y6W2W6jCje7E0nFStuqmqviASezbajwtg+5ZMJ w8lbTbmh8Q9oqb0zZ0BcewzLU4tf4c/CuOenosVIvKZ1g8HlgCnqlrkk8G8YgKv08/dR dosNMlHNlMLa6fmWQXzWYXMbzXEscXaiiYtonR9OCseuSLijOFAM/AVx0R+re+RJIg2V sX8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=WsAYyhWfGKVkST2xqFuDyPxjPPXRaXysRD6hjoK5s6U=; b=P10wmGMPc+DmMbCRZz3SWdgaYtiCyBWkSXulYCoRN4/grfQ74GB4aEIFR9ZsBY4gnE 46geh2KOysLjZO8wNgh4JIOukcE/tFJf1QVZsHhmn5j6uM5qf7RRSWBOjofy1wPag4mW H0/9xbDG02SPatYYOjVR3/HvPiXNZXua4HwzHGmZKLGLY9lslmSyGAhzzbYcDGs3LQHg 1hl1Td33lQBRc915kum+Sab7eu+Wld2atkzTXDJrMONxhOoI+w+eg6/XZs1JEoTTXR1C QI70HYMRXrrT9ccPIbCXXFU2VlxWsh3j3OGW8OCZjixiH7fSVbYlNFALfg3etuZGz/vr +vog== X-Gm-Message-State: AFeK/H3pd1LaD1UfZ+A2+m4hCqFe0cV5+pQIHqCgk8+vzW6hxzHBtBGQZjzDOMKhw4OkXQ== X-Received: by 10.28.107.13 with SMTP id g13mr560493wmc.117.1490882915163; Thu, 30 Mar 2017 07:08:35 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id b13sm3425160wmf.6.2017.03.30.07.08.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 07:08:34 -0700 (PDT) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: Convert cmpxchg(bool) back to a two step operation Date: Thu, 30 Mar 2017 15:08:32 +0100 Message-Id: <20170330140832.32377-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP ARM v6 (at least) only allows cmpxchg on 32bit variables which doesn't always include the bool type. drivers/built-in.o: In function `vblank_disable_and_save': imx-ocotp.c:(.text+0xb45e8): undefined reference to `__bad_cmpxchg' Makefile:986: recipe for target 'vmlinux' failed Reported-by: kbuild test robot Reported-by: Leonard Crestez Fixes: 43dc7fe2b211 ("drm: Mark up accesses of vblank->enabled outside of its spinlock") Signed-off-by: Chris Wilson Cc: Ville Syrjälä Cc: Daniel Vetter --- drivers/gpu/drm/drm_irq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index aa23b9833588..dac1b2593cb1 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -338,8 +338,10 @@ static void vblank_disable_and_save(struct drm_device *dev, unsigned int pipe) * calling the ->disable_vblank() operation in atomic context with the * hardware potentially runtime suspended. */ - if (cmpxchg_relaxed(&vblank->enabled, true, false)) + if (vblank->enabled) { __disable_vblank(dev, pipe); + vblank->enabled = false; + } /* * Always update the count and timestamp to maintain the