Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2334335imu; Thu, 24 Jan 2019 10:56:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN5svbUSzLwE1fG7SOGkriHH9LtdRJUy5SC1r5XKSdwcIwJEh3dhOsmelRoz1PdKmkv3b70k X-Received: by 2002:a17:902:7107:: with SMTP id a7mr7692799pll.290.1548356182453; Thu, 24 Jan 2019 10:56:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548356182; cv=none; d=google.com; s=arc-20160816; b=wsx2QPC0hdO8xpUBFHBY/uovBeF9HiiwyKDr6ZVrt4achDpuaimb1wyHSljH9Ilcpl D3aEYF05pzuHrrirWYCVjJNXhwzJJGzLGRfgr1vIvrpHlbNs5My//qPa5ra5hHvSKDUs wCaITxYH6tiMbslmVf3LK4OcahO/35j6YYi3/+BNcnaOWz29/vmZcf4ll6IvlHsZ4xeX LGZezqeYH5C5WPEQ2gU9D8EwKq3B60DqXXM+3hToUdU9VILFqSBOq558cdWBHGQSr+ny vJEi+YdvYCaG2PP/HcCR2JGCAUW2IJvP4vCAfq618u4LwWSPYmNbNcgGmisPrggql8Ae IewA== 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=zQUJnZ8rN0PD9fFCixpxImLuW/nqUyz4pZGAOzIHoZoBpFk3n3KOGDdk/XDndiCxee XDOxreg6Ku8F50UooRtTirDrDSiNvgdZoin7gKwJdWig0Ug6vFhJvCIpSCNVeIKeJaQ5 xsr+BmtvGD2YVhrF23NqR4Bc/edJ9tR3GfNfXh3UmwMjTNb6bWpwOI+dlLS56uLE9ZUz iN6Y5AH0+S0puiBcE/kXW2+Kxk1o/fF3FVME6pGa83L6E8ooKczax1vyCTSj19Y8IlLY AtQShlizulHCXNTmufOUfdYSf4aQovZL/gpFdN8XZHibfGAY4XIRXsKb6Z8Pxf5ROBmP aqjg== ARC-Authentication-Results: i=1; mx.google.com; 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 c7si22326748plz.118.2019.01.24.10.56.06; Thu, 24 Jan 2019 10:56:22 -0800 (PST) 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; 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 S1728332AbfAXSyb (ORCPT + 99 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(+) 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 -- 2.17.1