From patchwork Thu Jan 24 18:54:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 156507 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2310351jaa; Thu, 24 Jan 2019 10:54:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN6OfO1rUJExJKM8MiVtffT+LRnO9FTxG94PXFo/dNWvqcpgdQ9eGDGL+5PN1RwljHHxnerU X-Received: by 2002:a63:d547:: with SMTP id v7mr6906678pgi.339.1548356072189; Thu, 24 Jan 2019 10:54:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548356072; cv=none; d=google.com; s=arc-20160816; b=r+vZhc2OywC+SzmrT5BZXHkynHAbtfznQ0YqfMS2yEmvNeVVlDUp4QRkV22owgdP4n fEeBf4WP9EJZeT1GAkUqCQPM9gga5uzCnV3rEhyIMLMwyJpdtcNzVcu3/5L4R8p3me2i 0MmyP984FuC5Jxnrk5m9vulBp02dfdVGjME+9BC0E5136M0WqPkfavxK0H37gn7Fqwm6 iXvLEKTl4X3a/x6hovPSBmVCzfGuxF0g9UNeoCyQMjCyCRXBFW9FOECaEDELQ0eyug6V raOpTedeJBgqAvVGwr+1wx+Vtp/Euw6PQKWrYXfGHvcggCkZ5aZFHAO8zSblorVzE3mj 8bRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=PNm2FjucWdj951svjfwXemOrsp6u1/+JPEKoFOmaUC0=; b=sYre/L/gaEc/IW/LCiwZCOTl+pPA4iBtoJ6OEhsjocTRlQJlTuHAJRvyxrFHpUgdUu lLWJDcZFsbcpACF/Qm5IoeV7LT7ZA4uoZCrlD62aC4kTNyXgkwDtSiwYy8OELjstXgGZ GtyKVY3gsdbT/+flc8w+s/+Z/82/8dQrsnw/IxGUyjHeQvLJxLsZvUtZOhMMi5vFRdh1 rBZgp6JqT4OHasGJ6q1Wv2uv7X2CYx0XR2JHnjyWMdUM53/+4lBuvzs5N6/+ooGQjgMc v7CtA9gi3j2UaJgqjHNlGLEHKrvaHcK1ac4WNhw+REBUW3mTfL283CdM0KkvlY9yRkGq /gWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 d19si22651950pgg.314.2019.01.24.10.54.31; Thu, 24 Jan 2019 10:54:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726049AbfAXSyb (ORCPT + 15 others); Thu, 24 Jan 2019 13:54:31 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34432 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbfAXSyb (ORCPT ); Thu, 24 Jan 2019 13:54:31 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F2FBDEBD; Thu, 24 Jan 2019 10:54:30 -0800 (PST) Received: from brain-police.canterbury.ac.nz (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 936703F237; Thu, 24 Jan 2019 10:54:29 -0800 (PST) From: Will Deacon To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Dave Airlie , stable@vger.kernel.org, Will Deacon Subject: [PATCH stable-4.9.y] locking/qspinlock: Pull in asm/byteorder.h to ensure correct endianness Date: Thu, 24 Jan 2019 18:54:15 +0000 Message-Id: <20190124185415.29830-1-will.deacon@arm.com> X-Mailer: git-send-email 2.17.1 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dave Airlie This commit is not required upstream, but is required for the 4.9.y stable series. Upstream commit 101110f6271c ("Kbuild: always define endianess in kconfig.h") ensures that either __LITTLE_ENDIAN or __BIG_ENDIAN is defined to reflect the endianness of the target CPU architecture regardless of whether or not has been #included. The upstream definition of 'struct qspinlock' relies on this property. Unfortunately, the 4.9.y stable series does not provide this guarantee, so the 'spin_unlock()' routine can erroneously treat the underlying lockword as big-endian on little-endian architectures using native qspinlock (i.e. x86_64 without PV) if the caller has not included . This can lead to hangs such as the one in 'i915_gem_request()' reported via bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202063 Fix the issue by ensuring that is #included in , where 'struct qspinlock' is defined. Cc: # 4.9 Signed-off-by: Dave Airlie [will: wrote commit message] Signed-off-by: Will Deacon --- include/asm-generic/qspinlock_types.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 diff --git a/include/asm-generic/qspinlock_types.h b/include/asm-generic/qspinlock_types.h index d10f1e7d6ba8..6503e96710fa 100644 --- a/include/asm-generic/qspinlock_types.h +++ b/include/asm-generic/qspinlock_types.h @@ -18,6 +18,8 @@ #ifndef __ASM_GENERIC_QSPINLOCK_TYPES_H #define __ASM_GENERIC_QSPINLOCK_TYPES_H +#include + /* * Including atomic.h with PARAVIRT on will cause compilation errors because * of recursive header file incluson via paravirt_types.h. So don't include