From patchwork Sun Nov 4 13:51:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 150104 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1537198ljp; Sun, 4 Nov 2018 05:52:07 -0800 (PST) X-Google-Smtp-Source: AJdET5eQL1Kp+bvyDbHSifl4zyL9QvQ3hpv9fbNP5Wj17E29KQseh2nf6Jyy1t4QDoWT9nCfNwfy X-Received: by 2002:a63:fd09:: with SMTP id d9-v6mr17338459pgh.164.1541339527835; Sun, 04 Nov 2018 05:52:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541339527; cv=none; d=google.com; s=arc-20160816; b=SHbQOe+X7hpoGP+Hz/7VyoGQkBoSlrPLWSXhgcq9mLtPwnO5JN+pmGFSMC/80uLT7E vlv8PVvO6AoCwq5EhVZS39N78hfYCWERWALssxM2F3zEXMCWGm1W7uGtgX7vz/u8NOGC pnNNCfy6vXUtwxdawocHd7Ok/AhRmHlR6Q4BTnds3WK2GKoUgdN29TpXDFmUhdsuRyjf aBgyHQjx16LHpcqLB0A2/KNPAj2HgN1IY/J07CxJnD7AfdaxuT+iefleEcYmHEapLo6y zmUdFCVAwAhx0/JmrBTfKpt7OZt7m1nzGx6LqiPC0A3ccbOKaYggMdDk5avFQGjDfnIM UqxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=1mgf8AOTN8rpXT6O5fyVjn0uAyS0Pacp+8CL8NAE1Ls=; b=swW6UKELvNGT12bmXVrnZyOu+/OroUjyJ25KRZ/Rkv9PyDXBrddCr2xsGN1JYOOzGA Ci2Ilprefm1/ll5h6PH+ytIB5u90SAxJ7onO1Y/XhimvujbyIa/kH6bZxAjlbDSk5DWY uT04hKAGDfIplI1C5atbT7Byhq2rLSmbAk7r8sSMci8JAadYKsYXvSHVVYg37fExyKuB Kg2ebIlNdWRCUZFEiwKjdTbB4xp+B8VB2/1F4p/LKGeufd/oXAoYtvhUhDkQKp529KHg 3Fueieyvs9R9A6/Wi9URnkekZtTMs0z+gpEGjCCM0FM9+CSYYz7kIXD5zUiF3tnjcnbZ 6hBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Hsi05Ot2; 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 f192-v6si41250407pfc.73.2018.11.04.05.52.07; Sun, 04 Nov 2018 05:52:07 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Hsi05Ot2; 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 S1730072AbeKDXHI (ORCPT + 32 others); Sun, 4 Nov 2018 18:07:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:44400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729989AbeKDXHH (ORCPT ); Sun, 4 Nov 2018 18:07:07 -0500 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 8FA6B21486; Sun, 4 Nov 2018 13:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541339523; bh=S6MfcMiCBPbQIdEY/Z9B6byaenQiRi21X2xrtwwIkzI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hsi05Ot2qrOLp++e2PfcfMNutYck2kdVCENcfLSH2CiWZabvSvUoZLvgYacjWQuTy ctd3y1Rc++SkIDLBIFKLaxl7j8dEWpzT2WCR88bgGREuYYZAqQiRoaKXGZ3Mkd7iEh fge65p6fpV0ti0qh/8lxyMkHrUflCY/TEnith3D8= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joel Stanley , Michael Ellerman , Sasha Levin Subject: [PATCH AUTOSEL 4.19 16/57] powerpc/Makefile: Fix PPC_BOOK3S_64 ASFLAGS Date: Sun, 4 Nov 2018 08:51:03 -0500 Message-Id: <20181104135144.88324-16-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181104135144.88324-1-sashal@kernel.org> References: <20181104135144.88324-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joel Stanley [ Upstream commit 960e30029863db95ec79a71009272d4661db5991 ] Ever since commit 15a3204d24a3 ("powerpc/64s: Set assembler machine type to POWER4") we force -mpower4 to be passed to the assembler irrespective of the CFLAGS used (for Book3s 64). When building a powerpc64 kernel with clang, clang will not add -many to the assembler flags, so any instructions that the compiler has generated that are not available on power4 will cause an error: /usr/bin/as -a64 -mppc64 -mlittle-endian -mpower8 \ -I ./arch/powerpc/include -I ./arch/powerpc/include/generated \ -I ./include -I ./arch/powerpc/include/uapi \ -I ./arch/powerpc/include/generated/uapi -I ./include/uapi \ -I ./include/generated/uapi -I arch/powerpc -I arch/powerpc \ -maltivec -mpower4 -o init/do_mounts.o /tmp/do_mounts-3b0a3d.s /tmp/do_mounts-51ce54.s:748: Error: unrecognized opcode: `isel' GCC does include -many, so the GCC driven gas call will succeed: as -v -I ./arch/powerpc/include -I ./arch/powerpc/include/generated -I ./include -I ./arch/powerpc/include/uapi -I ./arch/powerpc/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi -I arch/powerpc -I arch/powerpc -a64 -mpower8 -many -mlittle -maltivec -mpower4 -o init/do_mounts.o Note that isel is power7 and above for IBM CPUs. GCC only generates it for Power9 and above, but the above test was run against the clang generated assembly. Peter Bergner explains: When using -many -mpower4, gas will first try and find a matching power4 mnemonic and failing that, it will then allow any valid mnemonic that gas knows about. GCC's use of -many predates me though. IIRC, Alan looked at trying to remove it, but I forget why he didn't. Could be either a gcc or gas issue at the time. I'm not sure whether issue still exists or not. He and I have modified how gas works internally a fair amount since he tried removing gcc use of -many. I will also note that when using -many, gas will choose the first mnemonic that matches in the mnemonic table and we have (mostly) sorted the table so that server mnemonics show up earlier in the table than other mnemonics, so they'll be seen/chosen first. By explicitly setting -many we can build with Clang and GCC while retaining the -mpower4 option. Signed-off-by: Joel Stanley Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 11a1acba164a..d2824b0cc142 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -238,7 +238,11 @@ cpu-as-$(CONFIG_4xx) += -Wa,-m405 cpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec) cpu-as-$(CONFIG_E200) += -Wa,-me200 cpu-as-$(CONFIG_E500) += -Wa,-me500 -cpu-as-$(CONFIG_PPC_BOOK3S_64) += -Wa,-mpower4 + +# When using '-many -mpower4' gas will first try and find a matching power4 +# mnemonic and failing that it will allow any valid mnemonic that GAS knows +# about. GCC will pass -many to GAS when assembling, clang does not. +cpu-as-$(CONFIG_PPC_BOOK3S_64) += -Wa,-mpower4 -Wa,-many cpu-as-$(CONFIG_PPC_E500MC) += $(call as-option,-Wa$(comma)-me500mc) KBUILD_AFLAGS += $(cpu-as-y) From patchwork Sun Nov 4 13:51:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 150105 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1537289ljp; Sun, 4 Nov 2018 05:52:14 -0800 (PST) X-Google-Smtp-Source: AJdET5d1xqFb7t/3W4EyEmrGXFpAO4G5cKwGxsIqMPRTUEFzwBF360ZQNj7XKwh++RfW4pt9pDrn X-Received: by 2002:a17:902:61:: with SMTP id 88-v6mr18866647pla.189.1541339534247; Sun, 04 Nov 2018 05:52:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541339534; cv=none; d=google.com; s=arc-20160816; b=r2bV6Jwv2jyaTbwzCe8GL4S/UEoAXuVO44/HjoRvEi2titkiDpnIW4c0WFP7gwPqdT qvAlB+FIvat5zIPkX6y7S1pDGBcv9UmZoaIdhm88iaghMd4ps8lkmxZaDAZdOfRjpIfn BP+8/eNFEMfG7jqEEtU0TDpT3uL/6seazUpXqzwkjHnOo24PTaKmQv6HJfvb7j4PREEl szO87T/lszQjD8RNDt+IlapCzty/jOyXmvVL22jx1bmBYGIMbcDnwzDDJRx+29JpZTPS f357+0C8nXt9g/uMpjebWWT2ePH5SJRD80MQkJPQviR4aKBi+JXqYO3iF6w0hq50yuvf AWkg== 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=knqCbm0uitLwuj/LEkWy19P6gBX2Ww4hOrJbWe74RxU=; b=fLkVwQA0nEh6GHtNmr3GBJjgjKRYjABSafe24PKxiZxtnH1QM17PaIv342GilCcX+e 2Ukou7dYfiiOax212dycaGA3A24GQUM5rmDqY6/Z++eG5J+3m8OHEx8kvwfU0+8AuUmi GdMU0bntmIhNdipc1B3AyF7tKFh9Q7M2IVUiFl6fMJzdf0JJ4GuoiH4/pHM+SmMD9VZq IOPZCHwOW2EYf3mKwLVx/hmdEQHCqbr0wnsz07xvRWDii2PvJt2d27J9403b3fAV57EQ ZOM+yXoEFDcEgLS0O1zyQLREDLfM3toSUhloKghoHvEIejB9Kd8cj5h00wsAODVuQJ+e 20xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Xb9xpIvA; 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 m6-v6si16732341pls.35.2018.11.04.05.52.13; Sun, 04 Nov 2018 05:52:14 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Xb9xpIvA; 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 S1730175AbeKDXHO (ORCPT + 32 others); Sun, 4 Nov 2018 18:07:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:44708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730094AbeKDXHN (ORCPT ); Sun, 4 Nov 2018 18:07:13 -0500 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 568EF20869; Sun, 4 Nov 2018 13:52:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541339529; bh=zy620Y7x/m+A0bjHOCjHlZZoZhZimtRe0uUNebKIqOU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xb9xpIvA7orA5AOzid7WcKVl2c0ADFl29NU4ZQLt3j7OzXT4wGqTgpFk9yAOUIHD1 rj3xmQMa6Mej6ptB324xwXtG5VKfIhNsNKfdGLanzzOV2WPyXFg8gGQPElbgJmTVPL 5Fu6nt4cl4WtAmO4kC+fDAMcWs8wkzmDbsSKEKQ0= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Anders Roxell , Rob Clark , Sasha Levin Subject: [PATCH AUTOSEL 4.19 24/57] drm/msm/gpu: fix parameters in function msm_gpu_crashstate_capture Date: Sun, 4 Nov 2018 08:51:11 -0500 Message-Id: <20181104135144.88324-24-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181104135144.88324-1-sashal@kernel.org> References: <20181104135144.88324-1-sashal@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anders Roxell [ Upstream commit 6969019f65b43afb6da6a26f1d9e55bbdfeebcd5 ] When CONFIG_DEV_COREDUMP isn't defined msm_gpu_crashstate_capture doesn't pass the correct parameters. drivers/gpu/drm/msm/msm_gpu.c: In function ‘recover_worker’: drivers/gpu/drm/msm/msm_gpu.c:479:34: error: passing argument 2 of ‘msm_gpu_crashstate_capture’ from incompatible pointer type [-Werror=incompatible-pointer-types] msm_gpu_crashstate_capture(gpu, submit, comm, cmd); ^~~~~~ drivers/gpu/drm/msm/msm_gpu.c:388:13: note: expected ‘char *’ but argument is of type ‘struct msm_gem_submit *’ static void msm_gpu_crashstate_capture(struct msm_gpu *gpu, char *comm, ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/msm/msm_gpu.c:479:2: error: too many arguments to function ‘msm_gpu_crashstate_capture’ msm_gpu_crashstate_capture(gpu, submit, comm, cmd); ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/msm/msm_gpu.c:388:13: note: declared here static void msm_gpu_crashstate_capture(struct msm_gpu *gpu, char *comm, In current code the function msm_gpu_crashstate_capture parameters. Fixes: cdb95931dea3 ("drm/msm/gpu: Add the buffer objects from the submit to the crash dump") Signed-off-by: Anders Roxell Reviewed-By: Jordan Crouse Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/msm_gpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 5e808cfec345..46e6b82f7b66 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -367,8 +367,8 @@ static void msm_gpu_crashstate_capture(struct msm_gpu *gpu, msm_gpu_devcoredump_read, msm_gpu_devcoredump_free); } #else -static void msm_gpu_crashstate_capture(struct msm_gpu *gpu, char *comm, - char *cmd) +static void msm_gpu_crashstate_capture(struct msm_gpu *gpu, + struct msm_gem_submit *submit, char *comm, char *cmd) { } #endif From patchwork Sun Nov 4 13:51:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 150106 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1537341ljp; Sun, 4 Nov 2018 05:52:17 -0800 (PST) X-Google-Smtp-Source: AJdET5eDJFW7YacsvsimKUyzvLtoJIRjVAARiNEHAht5IeGinMa0LeeSiwKuxoPW+DbxV22mXbvg X-Received: by 2002:a62:3101:: with SMTP id x1-v6mr16654856pfx.204.1541339537860; Sun, 04 Nov 2018 05:52:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541339537; cv=none; d=google.com; s=arc-20160816; b=ebut2sACqyBz32E/p2ykevbDUpYFihzbOiNd9YAWUuM6/rDiZ3y/j21VOhTPt3Y47N 6IeVcSRLJbVNQZOP3JjNLT3fZcdwtb7gl9rtXKpEuQLZX51hGYlXW3RlswQ8I+gjU1IF tTAxUgKOPdKxLRVN9ffpMZU41QS222FSnxYBu3caaiVlWyLOanEBJX6IQZOWeq5T8/fC qgZAVeogZJNsGrEo55ZzmkGfV4TbjxlX9+6Zq7A6Q/dOlEO5kyLtr8xr3H3rgIMMCgpO E4AVftSh3LN6aKTTYHDc2049vvdWsVV5aN8ZY3ba7B06e3TxQW7BlzaZM9/M0xtiY2ZU edWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=ESpjxJKtfwaRgvJFVAHVK7vaGZUkXXNlgRtDnVWvxeg=; b=soCYVomonuK0DiLehclRDQ4CExi7df2pKSuejgP5hTH8XLX3dQ51SG/dwfTq9PWNdv CzhElG3CP31UC3LR2cKQCr1F22u//xZEe6kbtZwE1oaibWhWrSi5TauIOB64OxvIeKru yp3KwH6nGG1od4Zw730y+tLGleskHAWu+mGBeFH9wOyEwWKlEYYoV50WX698bjRzeId2 dK6mxY8HHRZd18SC+yyLcBb59ZdlFGOErNsfsXIXDnaGO3F30CYX/7FciK3+9v22ScsK r1D46UKCk8HIOaEQ9YuGmeKQXARWvpplqV4jdkX6ygMNVygobccU80PU9VMV8TH1ymrc e8ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=swhlqOXY; 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 k25-v6si30204977pfe.36.2018.11.04.05.52.17; Sun, 04 Nov 2018 05:52:17 -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; dkim=pass header.i=@kernel.org header.s=default header.b=swhlqOXY; 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 S1730243AbeKDXHT (ORCPT + 32 others); Sun, 4 Nov 2018 18:07:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:44906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730225AbeKDXHS (ORCPT ); Sun, 4 Nov 2018 18:07:18 -0500 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 3106420869; Sun, 4 Nov 2018 13:52:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541339534; bh=XsRtoR2HobAJkGooN+EhBAm9Zeet5xoJpEAy0slXurk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=swhlqOXYffkteo7tlo0KnbCjMO/3STjylK7fQiCsZTcZK7N36QxOtbwMMJ1fkbga0 q3djscOD+X+ys577GN1reTN7k3HjgFpkzibVbPQiLZVu43HGWGX0OaZTK4knO+Mcic aGYWzB9ShMXOSNhTM7JwdOZuCX2mWyiEvTXx131c= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tomi Valkeinen , Peter Ujfalusi , Sasha Levin Subject: [PATCH AUTOSEL 4.19 29/57] drm/omap: fix memory barrier bug in DMM driver Date: Sun, 4 Nov 2018 08:51:16 -0500 Message-Id: <20181104135144.88324-29-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181104135144.88324-1-sashal@kernel.org> References: <20181104135144.88324-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tomi Valkeinen [ Upstream commit 538f66ba204944470a653a4cccc5f8befdf97c22 ] A DMM timeout "timed out waiting for done" has been observed on DRA7 devices. The timeout happens rarely, and only when the system is under heavy load. Debugging showed that the timeout can be made to happen much more frequently by optimizing the DMM driver, so that there's almost no code between writing the last DMM descriptors to RAM, and writing to DMM register which starts the DMM transaction. The current theory is that a wmb() does not properly ensure that the data written to RAM is observable by all the components in the system. This DMM timeout has caused interesting (and rare) bugs as the error handling was not functioning properly (the error handling has been fixed in previous commits): * If a DMM timeout happened when a GEM buffer was being pinned for display on the screen, a timeout error would be shown, but the driver would continue programming DSS HW with broken buffer, leading to SYNCLOST floods and possible crashes. * If a DMM timeout happened when other user (say, video decoder) was pinning a GEM buffer, a timeout would be shown but if the user handled the error properly, no other issues followed. * If a DMM timeout happened when a GEM buffer was being released, the driver does not even notice the error, leading to crashes or hang later. This patch adds wmb() and readl() calls after the last bit is written to RAM, which should ensure that the execution proceeds only after the data is actually in RAM, and thus observable by DMM. The read-back should not be needed. Further study is required to understand if DMM is somehow special case and read-back is ok, or if DRA7's memory barriers do not work correctly. Signed-off-by: Tomi Valkeinen Signed-off-by: Peter Ujfalusi Signed-off-by: Sasha Levin --- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.17.1 diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c index f92fe205550b..e884183c018a 100644 --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c @@ -285,6 +285,17 @@ static int dmm_txn_commit(struct dmm_txn *txn, bool wait) } txn->last_pat->next_pa = 0; + /* ensure that the written descriptors are visible to DMM */ + wmb(); + + /* + * NOTE: the wmb() above should be enough, but there seems to be a bug + * in OMAP's memory barrier implementation, which in some rare cases may + * cause the writes not to be observable after wmb(). + */ + + /* read back to ensure the data is in RAM */ + readl(&txn->last_pat->next_pa); /* write to PAT_DESCR to clear out any pending transaction */ dmm_write(dmm, 0x0, reg[PAT_DESCR][engine->id]); From patchwork Sun Nov 4 13:51:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 150107 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1537408ljp; Sun, 4 Nov 2018 05:52:23 -0800 (PST) X-Google-Smtp-Source: AJdET5e1OtPitH/9JFL+lBWC3ceklWisHa0IhkSOiQZmM/6xFp/iPTV6COnziKzPy/W5fuxK+Gqq X-Received: by 2002:a62:1d50:: with SMTP id d77-v6mr256305pfd.87.1541339543363; Sun, 04 Nov 2018 05:52:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541339543; cv=none; d=google.com; s=arc-20160816; b=tyxbyvvgU+nQBuA0XN3FuCNMQByNyXbfaUH76set/6V6rxAjZySZFsgc0cbzDDLcFP XjNjZ/2srE81obCe0KKh8JMaIJkq3UtzqTQg6v8qjCr/zbgskjxyObcaXyMyVYxSMVfr Oi322R12mjYCANoYeHKB3pPXPLjAzVOZicy3Q0n1BSjlT5AIc8oHB7mSovFNL+EQkxHW N6sD8mCaNW+vW++FL8UR4t8xPBdzK5TslG6Ntz8d1jvNXccb1Ow6d/ZMSQSx8jBi1flR SQXvf2b2xtfDJ5an2dt5SWuGplxkjeh4TB5PXNZPacYxFthyDlrjV9g9UoyIGH+6MVdr 3gsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=M9YJTHASomuPid1YBC4H5TP0ehf3Jb/H6oWwX9qj8t4=; b=bK5f1bnJGd0DG5NlL4r5ubNKYh2fPeyHyhQ+7Wp+m37o3rgmlekaA4L6XEtV0gPe3H XyGyM1cGFRYo6w8zyVhykrqtNcJk347nD/VV1roxMHzvUFAjdPwza0XOiM0E0dzNRNGK FLyGIZfhZvAQ2KfiK6/BKj40w6rZ57n1xBs1bmgeijREU+RGqyuxm8YWaLtwK4SSOmKu Ne3trdSz5cRyHrJx+ZJaNiapsYeP19KPzEBDeItrUMHweh43mSPNfmmb6pruprTfzDOA NpKYB89O9g4Bdu+7YHvPqrzfnO+mpV43MfiRoS32bAbSxiPEJq2XHgCTkdJzPwbJG/vU zP1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uY33KcZY; 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 10-v6si30949781pgk.480.2018.11.04.05.52.22; Sun, 04 Nov 2018 05:52:23 -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; dkim=pass header.i=@kernel.org header.s=default header.b=uY33KcZY; 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 S1730293AbeKDXHY (ORCPT + 32 others); Sun, 4 Nov 2018 18:07:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:45080 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730164AbeKDXHX (ORCPT ); Sun, 4 Nov 2018 18:07:23 -0500 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 CC54220862; Sun, 4 Nov 2018 13:52:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541339539; bh=xZXo0NyrnN9ENqHCMkPUPa3ZpIa13R7fzVlMeDCtsmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uY33KcZY5qGKQMVJe2nyHuqHlPaYoaXkWEhWwyaR0rHpRMCJxOX2QSDzTK1egTw3p hMLvHkbia+JRj95gMn5z/fACmZ9Ee8p7OgY/NCVaYEBOJU3ukpesWtRcrwiMoc3RjV izZebbfoOJNE8clAXK3jzQscqMgY6jFf8yisuDqY= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: John Garry , Xinliang Liu , Sasha Levin Subject: [PATCH AUTOSEL 4.19 34/57] drm/hisilicon: hibmc: Do not carry error code in HiBMC framebuffer pointer Date: Sun, 4 Nov 2018 08:51:21 -0500 Message-Id: <20181104135144.88324-34-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181104135144.88324-1-sashal@kernel.org> References: <20181104135144.88324-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Garry [ Upstream commit 331d880b35a76b5de0eec8cbcecbf615d758a5f9 ] In hibmc_drm_fb_create(), when the call to hibmc_framebuffer_init() fails with error, do not store the error code in the HiBMC device frame-buffer pointer, as this will be later checked for non-zero value in hibmc_fbdev_destroy() when our intention is to check for a valid function pointer. This fixes the following crash: [ 9.699791] Unable to handle kernel NULL pointer dereference at virtual address 000000000000001a [ 9.708672] Mem abort info: [ 9.711489] ESR = 0x96000004 [ 9.714570] Exception class = DABT (current EL), IL = 32 bits [ 9.720551] SET = 0, FnV = 0 [ 9.723631] EA = 0, S1PTW = 0 [ 9.726799] Data abort info: [ 9.729702] ISV = 0, ISS = 0x00000004 [ 9.733573] CM = 0, WnR = 0 [ 9.736566] [000000000000001a] user address but active_mm is swapper [ 9.742987] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 9.748614] Modules linked in: [ 9.751694] CPU: 16 PID: 293 Comm: kworker/16:1 Tainted: G W 4.19.0-rc4-next-20180920-00001-g9b0012c #322 [ 9.762681] Hardware name: Huawei Taishan 2280 /D05, BIOS Hisilicon D05 IT21 Nemo 2.0 RC0 04/18/2018 [ 9.771915] Workqueue: events work_for_cpu_fn [ 9.776312] pstate: 60000005 (nZCv daif -PAN -UAO) [ 9.781150] pc : drm_mode_object_put+0x0/0x20 [ 9.785547] lr : hibmc_fbdev_fini+0x40/0x58 [ 9.789767] sp : ffff00000af1bcf0 [ 9.793108] x29: ffff00000af1bcf0 x28: 0000000000000000 [ 9.798473] x27: 0000000000000000 x26: ffff000008f66630 [ 9.803838] x25: 0000000000000000 x24: ffff0000095abb98 [ 9.809203] x23: ffff8017db92fe00 x22: ffff8017d2b13000 [ 9.814568] x21: ffffffffffffffea x20: ffff8017d2f80018 [ 9.819933] x19: ffff8017d28a0018 x18: ffffffffffffffff [ 9.825297] x17: 0000000000000000 x16: 0000000000000000 [ 9.830662] x15: ffff0000092296c8 x14: ffff00008939970f [ 9.836026] x13: ffff00000939971d x12: ffff000009229940 [ 9.841391] x11: ffff0000085f8fc0 x10: ffff00000af1b9a0 [ 9.846756] x9 : 000000000000000d x8 : 6620657a696c6169 [ 9.852121] x7 : ffff8017d3340580 x6 : ffff8017d4168000 [ 9.857486] x5 : 0000000000000000 x4 : ffff8017db92fb20 [ 9.862850] x3 : 0000000000002690 x2 : ffff8017d3340480 [ 9.868214] x1 : 0000000000000028 x0 : 0000000000000002 [ 9.873580] Process kworker/16:1 (pid: 293, stack limit = 0x(____ptrval____)) [ 9.880788] Call trace: [ 9.883252] drm_mode_object_put+0x0/0x20 [ 9.887297] hibmc_unload+0x1c/0x80 [ 9.890815] hibmc_pci_probe+0x170/0x3c8 [ 9.894773] local_pci_probe+0x3c/0xb0 [ 9.898555] work_for_cpu_fn+0x18/0x28 [ 9.902337] process_one_work+0x1e0/0x318 [ 9.906382] worker_thread+0x228/0x450 [ 9.910164] kthread+0x128/0x130 [ 9.913418] ret_from_fork+0x10/0x18 [ 9.917024] Code: a94153f3 a8c27bfd d65f03c0 d503201f (f9400c01) [ 9.923180] ---[ end trace 2695ffa0af5be375 ]--- Fixes: d1667b86795a ("drm/hisilicon/hibmc: Add support for frame buffer") Signed-off-by: John Garry Reviewed-by: Xinliang Liu Signed-off-by: Xinliang Liu Signed-off-by: Sasha Levin --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c index b92595c477ef..8bd29075ae4e 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c @@ -122,6 +122,7 @@ static int hibmc_drm_fb_create(struct drm_fb_helper *helper, hi_fbdev->fb = hibmc_framebuffer_init(priv->dev, &mode_cmd, gobj); if (IS_ERR(hi_fbdev->fb)) { ret = PTR_ERR(hi_fbdev->fb); + hi_fbdev->fb = NULL; DRM_ERROR("failed to initialize framebuffer: %d\n", ret); goto out_release_fbi; } From patchwork Sun Nov 4 13:51:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 150122 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1550198ljp; Sun, 4 Nov 2018 06:06:17 -0800 (PST) X-Google-Smtp-Source: AJdET5f+2RsBlY8ndAsmOD08js5yJOSj0Or9ZpfAbJyZNJjv/KlUq/OwssPkkEkp8ndn/omNd2ll X-Received: by 2002:a17:902:7241:: with SMTP id c1-v6mr12802510pll.143.1541340377074; Sun, 04 Nov 2018 06:06:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541340377; cv=none; d=google.com; s=arc-20160816; b=bdQe40Z7OBoIy51qpNSZk6swZkrp35oLpQaJ5SnMYIqknD49if1J8ZdMlO/si9J7Xt D4CdrOZJ8C3XDwR+KD3ylhPbd8kzsrsycSl3KK164ujqmmEcadIROn6Ds691+KPlDThG C3WsvuZeilsT44aLznOMYVdhGkl7BRrGX1Yt9hNRD24sxozobhniyUwUT/u+n4b2j3uw TWJvD6BnVRhlKZ4pFjVA4p/8XO+f+59P3flecV9HCCLwRhYNCEDkkT29EfJmNsOnevAZ wV7yEp8LdBUrVDDF7f4Mg/PJrWncRwN8oKwZWxcZgZRycP9gNUoHcnsUYNLIg3w0iKno VzMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=7oXcIrqtSmuyBPYUG1e+EHqqso2pIJMI76WGppdfM4s=; b=hCe89PSt/hNr6jWzHXLk1aQtw/KSgZNZ6+0QBhbuGtop1dNGLy3mAXh+L38KSUWKmV vGkEMRoiC7y40FuyX7GQJtt56VW3zfgOVy5HkIQON2OANHcA1X5oLkOiFeaAqIKs0DFT JhZsuR76ujgFbdSFBBQtylIRGNLj1PtPtxsvYb7gFxkMA0yixs/XIa93Od8xOtUtGaRU vBBRJaY6M1IQmw8XS+rsOCn4jpkIAjCefa55hlPan1sxuyWqrccJn0sg/6hZx1+aB0oI WyHaP6TbVLtZ+iwmSItnM/phx/Alo/YZMJNJDGCap5AzKa8LCmf3KLCVrC0c8mvXjZOH G9KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="HUeXV/TT"; 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 u2-v6si39412220pgi.329.2018.11.04.06.06.16; Sun, 04 Nov 2018 06:06:17 -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; dkim=pass header.i=@kernel.org header.s=default header.b="HUeXV/TT"; 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 S1730708AbeKDXVW (ORCPT + 32 others); Sun, 4 Nov 2018 18:21:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:45258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730327AbeKDXH2 (ORCPT ); Sun, 4 Nov 2018 18:07:28 -0500 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 A82B020868; Sun, 4 Nov 2018 13:52:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541339544; bh=M+nlvSSWJ6LODF+My80H6Ek0nsvcQgbQobsSHZ3QULs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HUeXV/TTlxlQJOHbAa6/9Hjb2KblbTxPVqROl74+H8HB+ZZU9iptb1fDisrXElfmL g425SIaF6zkG+6KtIbHZZKKsQii67ToBbnANHgW8eS9XjkROc7OJ24mFM18JWSqhFV F96MR9pFQlCLi5+vnMV/HhI9yL1/QVc21m2OTgZQ= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joel Stanley , Michael Ellerman , Sasha Levin Subject: [PATCH AUTOSEL 4.19 39/57] powerpc/boot: Ensure _zimage_start is a weak symbol Date: Sun, 4 Nov 2018 08:51:26 -0500 Message-Id: <20181104135144.88324-39-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181104135144.88324-1-sashal@kernel.org> References: <20181104135144.88324-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joel Stanley [ Upstream commit ee9d21b3b3583712029a0db65a4b7c081d08d3b3 ] When building with clang crt0's _zimage_start is not marked weak, which breaks the build when linking the kernel image: $ objdump -t arch/powerpc/boot/crt0.o |grep _zimage_start$ 0000000000000058 g .text 0000000000000000 _zimage_start ld: arch/powerpc/boot/wrapper.a(crt0.o): in function '_zimage_start': (.text+0x58): multiple definition of '_zimage_start'; arch/powerpc/boot/pseries-head.o:(.text+0x0): first defined here Clang requires the .weak directive to appear after the symbol is declared. The binutils manual says: This directive sets the weak attribute on the comma separated list of symbol names. If the symbols do not already exist, they will be created. So it appears this is different with clang. The only reference I could see for this was an OpenBSD mailing list post[1]. Changing it to be after the declaration fixes building with Clang, and still works with GCC. $ objdump -t arch/powerpc/boot/crt0.o |grep _zimage_start$ 0000000000000058 w .text 0000000000000000 _zimage_start Reported to clang as https://bugs.llvm.org/show_bug.cgi?id=38921 [1] https://groups.google.com/forum/#!topic/fa.openbsd.tech/PAgKKen2YCY Signed-off-by: Joel Stanley Reviewed-by: Nick Desaulniers Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/boot/crt0.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/arch/powerpc/boot/crt0.S b/arch/powerpc/boot/crt0.S index dcf2f15e6797..32dfe6d083f3 100644 --- a/arch/powerpc/boot/crt0.S +++ b/arch/powerpc/boot/crt0.S @@ -47,8 +47,10 @@ p_end: .long _end p_pstack: .long _platform_stack_top #endif - .weak _zimage_start .globl _zimage_start + /* Clang appears to require the .weak directive to be after the symbol + * is defined. See https://bugs.llvm.org/show_bug.cgi?id=38921 */ + .weak _zimage_start _zimage_start: .globl _zimage_start_lib _zimage_start_lib: From patchwork Sun Nov 4 13:51:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 150108 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1537534ljp; Sun, 4 Nov 2018 05:52:32 -0800 (PST) X-Google-Smtp-Source: AJdET5fCWWbcskjvr0WPyid/PO6pqtWzZJLUmdQXoyd6oR8iuC2qo9OX0PXglb1wr/97YqUa8zmE X-Received: by 2002:a63:5c16:: with SMTP id q22-v6mr16925634pgb.417.1541339552677; Sun, 04 Nov 2018 05:52:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541339552; cv=none; d=google.com; s=arc-20160816; b=hs+v2AqBuPNeKMR8b8MjZLsdFwjBy9bxpq6eYuatExR2/ztpiXX1tyGstroghDI+2K yzHrrgxd6c9dWQg4KNbD0GKJM44mQ2ItWuORLKN+ClWYUHj+THqsH/WZMcjo0gceN3vq dtrBzJ+7OHRKSRoM4IBJtjQrc3furCTLJIAMUzsQdT+iKmqK/X3zDvC4ijf9FEdDFFne ae76QT8lSe9BkMLNT0m9/bgGfS0Ix/nA51XV3AgKl36Rw3nSDWXGG4QxNNZTkSlCQLbV a8OU9qtfxOPOwPqSc2YbLbvQVhwmt/D7e4s3iL4y/lDhlfR0M44Y6cRGcNB/GBu1LtXw h+pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Hlf+RTMzsenL1GFAVghJ3KUAHyt9eVytsHhkf5uM04o=; b=h3Y06fD9To/gqHne1roKhrK/VJwMFn6ra4sPxPsl6p33JdRPjutYtysG+9CIsbSAeo ok5MuMP8noBm2dzeg0memmdqyeZuUrexcH5UmeijC44IShZ3dYZmPeuVQVPef7EKmeta Ejl2BRxrZoJ80oxtoAk8IIS9kWByJ4sAalY892skRRzqJny6sYHBJ/QOnk3JrjQx0LM+ 5k+fJIXio+hpic7zqy7WxXZFkSOnOJw31Gv+ExAR8QI3Z4lcCj4EyycC5RSVl52E/v1M jzbL9m4jAdpCr03njn7GIw4T/aNsosiKFt9mU7/czfc89FMR91gnstU+wsIZ7hdUhujS 9rTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=y2ufjeVK; 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 j20si770654pgg.162.2018.11.04.05.52.32; Sun, 04 Nov 2018 05:52:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b=y2ufjeVK; 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 S1730408AbeKDXHd (ORCPT + 32 others); Sun, 4 Nov 2018 18:07:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:45402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730390AbeKDXHb (ORCPT ); Sun, 4 Nov 2018 18:07:31 -0500 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 879062085B; Sun, 4 Nov 2018 13:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541339548; bh=A5jCYSplBYoOFQ8zRetf6AmvXC5z+rSE1tCGxdnEW/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y2ufjeVKYsxoG3vwdc5rzHegI1OqXsAQajPc59YR2IJuRgoezKOhLpbU29kqPlD6t cWJpTaol5vH7tXlWHAUkmRMDWfk6golCr+r9A55yPGHLTl56BIs0zwCe3QNCPgwnwx IvQ2YxqEXCnNIZ8gYAPsArDlrlsVEadvPlk4NE/Y= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: John Garry , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 4.19 43/57] serial: 8250_of: Fix for lack of interrupt support Date: Sun, 4 Nov 2018 08:51:30 -0500 Message-Id: <20181104135144.88324-43-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181104135144.88324-1-sashal@kernel.org> References: <20181104135144.88324-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Garry [ Upstream commit a27d938251ef40c43db81af16fc26b2cec181d4d ] In commit c58caaab3bf8 ("serial: 8250: of: Defer probe on missing IRQ"), a check was added for the UART driver being probed prior to the parent IRQ controller. Unfortunately this breaks certain boards which have no interrupt support, like Huawei D03. Indeed, the 8250 DT bindings state that interrupts should be supported - not must. To fix, switch from irq_of_parse_and_map() to of_irq_get(), which does relay whether the IRQ host controller domain is not ready, i.e. defer probe, instead of assuming it. Fixes: c58caaab3bf8 ("serial: 8250: of: Defer probe on missing IRQ") Signed-off-by: John Garry Reviewed-by: Rob Herring Reviewed-by: Alexander Sverdlin Tested-by: Alexander Sverdlin Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/8250/8250_of.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c index af8beefe9b5c..877fd7f8a8ed 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c @@ -58,7 +58,7 @@ static int of_platform_serial_setup(struct platform_device *ofdev, struct resource resource; struct device_node *np = ofdev->dev.of_node; u32 clk, spd, prop; - int ret; + int ret, irq; memset(port, 0, sizeof *port); @@ -143,21 +143,27 @@ static int of_platform_serial_setup(struct platform_device *ofdev, if (ret >= 0) port->line = ret; - port->irq = irq_of_parse_and_map(np, 0); - if (!port->irq) { - ret = -EPROBE_DEFER; - goto err_unprepare; + irq = of_irq_get(np, 0); + if (irq < 0) { + if (irq == -EPROBE_DEFER) { + ret = -EPROBE_DEFER; + goto err_unprepare; + } + /* IRQ support not mandatory */ + irq = 0; } + port->irq = irq; + info->rst = devm_reset_control_get_optional_shared(&ofdev->dev, NULL); if (IS_ERR(info->rst)) { ret = PTR_ERR(info->rst); - goto err_dispose; + goto err_unprepare; } ret = reset_control_deassert(info->rst); if (ret) - goto err_dispose; + goto err_unprepare; port->type = type; port->uartclk = clk; @@ -184,8 +190,6 @@ static int of_platform_serial_setup(struct platform_device *ofdev, port->handle_irq = fsl8250_handle_irq; return 0; -err_dispose: - irq_dispose_mapping(port->irq); err_unprepare: clk_disable_unprepare(info->clk); err_pmruntime: