From patchwork Wed Dec 4 17:53:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 180828 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp932025ile; Wed, 4 Dec 2019 10:02:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyNW/8lKt7/HRa5F0+GOJneSsE2oRTWNFoa/w5VZEE01qdwXjbgs7nYX0kNm9ZVD5gEd8mS X-Received: by 2002:aca:af54:: with SMTP id y81mr3499403oie.154.1575482575514; Wed, 04 Dec 2019 10:02:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482575; cv=none; d=google.com; s=arc-20160816; b=x7kuwW+xZlw/sGT7YQgMJBkH0XfJOF/tZqzXoVDRE6bKvqr5HTTjvLtI0WAeXU4Okt W788h1gEs5dQdVWZk2LZ6g/bK/JwSYaVWIrpMW3osrluh3B9QLnxEUEpsQkKf7707MKN 4Me/I1fIpg+MkwCZG+zg3TmuvlPPk52gEQd3Htf3Gc7pxH5vXVRcoPIcYVEtscXU548j IiDVFbGr1Bk8VSuo1suU7OeMir63GFMvYT4VC5YncWyQrTOmnlZ8ndIHj8l6m+ogPZkt Y1dPOFtLbv/jWQAdP6juLo+41N3L6ovRR6jEfBYoze7Hf3Oy1fQDgQMxV+GIqsEBJGob FF3w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RW2hRnIHeN78VrD9hgFAR4l5922tUdzgvwNixzQrTtU=; b=jkrJqvFZnngWPllPhlzt3M5cv3MRJvtqQObRTlKiiJATgWFmj3vE494W0tQhO69giJ Lns9iqRKkrzm8xKruumtz9n0cM15HsNsrpYUrJ8NAGRID361UvHs19p3d5zryR3PtyNT yAna61n6tbu3IArvmNEcmIi9+yUz3GVldbS6qzEsvJ+fGgccb1GAKMtYo6nf9cupfm0d 525kPzi6YCVcT0ek0hQzbPQoPnYg41CNQHEYxQmN0wz+I0Y0qWU6yHqaYvpZhR8YfPi9 vVFe4tumZbAAjQr0jcL1ABC1UuXuUKm2yvcwDggPGb3OtwwomlxM43bAmFy0OkPHqddc uN6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="LYLRgp/9"; 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 x22si3718220otp.107.2019.12.04.10.02.55; Wed, 04 Dec 2019 10:02:55 -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="LYLRgp/9"; 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 S1729945AbfLDSCx (ORCPT + 27 others); Wed, 4 Dec 2019 13:02:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:45476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729931AbfLDSCt (ORCPT ); Wed, 4 Dec 2019 13:02:49 -0500 Received: from localhost (unknown [217.68.49.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5E01E20675; Wed, 4 Dec 2019 18:02:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482568; bh=YmhnP20tpsgPx29MUewJ8NBV4qA6cgOJYoQR7Abm1bg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LYLRgp/9MpQafErpsO+2tLvVo9x6WYoUbXBiL/riXWMc6rkrlhCGSP+vd6EvWTZWH VRT0NwK9eZEBT8YY6eB5ApQTkl8r4FJc5/AzRHCfZr8mQ9AcHcX3K5mcTw7D/mASn/ iOxci4/AyS5xGE/bEBymKby4wUfhtwm0Nu5aJXFk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Reported-by: Marian Mihailescu" , Marek Szyprowski , Sylwester Nawrocki , Sasha Levin Subject: [PATCH 4.14 006/209] clk: samsung: exynos5420: Preserve PLL configuration during suspend/resume Date: Wed, 4 Dec 2019 18:53:38 +0100 Message-Id: <20191204175322.047825199@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Szyprowski [ Upstream commit e9323b664ce29547d996195e8a6129a351c39108 ] Properly save and restore all top PLL related configuration registers during suspend/resume cycle. So far driver only handled EPLL and RPLL clocks, all other were reset to default values after suspend/resume cycle. This caused for example lower G3D (MALI Panfrost) performance after system resume, even if performance governor has been selected. Reported-by: Reported-by: Marian Mihailescu Fixes: 773424326b51 ("clk: samsung: exynos5420: add more registers to restore list") Signed-off-by: Marek Szyprowski Signed-off-by: Sylwester Nawrocki Signed-off-by: Sasha Levin --- drivers/clk/samsung/clk-exynos5420.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.20.1 diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c index a882f7038bcec..47a14f93f8693 100644 --- a/drivers/clk/samsung/clk-exynos5420.c +++ b/drivers/clk/samsung/clk-exynos5420.c @@ -170,12 +170,18 @@ static const unsigned long exynos5x_clk_regs[] __initconst = { GATE_BUS_CPU, GATE_SCLK_CPU, CLKOUT_CMU_CPU, + CPLL_CON0, + DPLL_CON0, EPLL_CON0, EPLL_CON1, EPLL_CON2, RPLL_CON0, RPLL_CON1, RPLL_CON2, + IPLL_CON0, + SPLL_CON0, + VPLL_CON0, + MPLL_CON0, SRC_TOP0, SRC_TOP1, SRC_TOP2, From patchwork Wed Dec 4 17:54:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 180824 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp930985ile; Wed, 4 Dec 2019 10:02:15 -0800 (PST) X-Google-Smtp-Source: APXvYqzoWDKTjkUaPnT3UL7PFgUjl+WdlcgldIi2XTNk4xcf1EF8xAV1/yqgUKUoV7PyQLUScbdX X-Received: by 2002:a9d:18b:: with SMTP id e11mr3274908ote.305.1575482535331; Wed, 04 Dec 2019 10:02:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482535; cv=none; d=google.com; s=arc-20160816; b=KW9fGU3Qb5qY1ha5B7gUvnVHbr5/dafR0rEVVLCpDWdDbhmRNwitW1oawvRjRTj7js q8r5OALJjJbAGb2TQ/mBnUpYoZJ11Rl1KoVSSwosNNVDU2yECNQvfyjUYgpiqu2WrHAs uCI84rEsyqgRKmX36hwnd4TwaQGis05WK0Gm/FSeNvv4Tp41FMElHJziyk3Ip/z7oqvX B1jWga/o8z/BaXwCcGfM1tskKPJYB0FMGFhaX/qyKbbPVoq/hL4llaRzEE+LmwOQXRI4 9tl5OGdiKpk2aSa2470QZ9o2hcFWC8l/sxOsOK8fnzdGYF/YKjKm3ythGkYWduGII5CR +Ieg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xkDN+RyqZKWlaJbkZyWhRScKuosMYLrjjJ5cmmPeDQI=; b=NVQ5s/OX93ItZPYR7NejJ1YaRjx+9vBSpAWXo6r4Qe4DByPnK8+eBg7yVkl9ZCPsU9 Bj++m+0/GnJN4j5nL+67vdh2s67o4ci9Py9fY0P+q2hYPrToleiisJxQIOSUy44WZqhw THjU7gmDN0SrXnSeFUVQ66syDZY5+3ytWXltOneMq8g23ocwItdpM9tpjg2dXo07rrmZ FMqL424DwWK4O7/g5ieiPJSi1MFC7rnh8lLhs7xr9/V4S30NzQkHrlUNkOn3r+GCucZ/ hk2nMJcZg+UTC15kwb0mwfReLjO9dc9SPSmkkZT8BKRIxpV0Vegw2uLuVAW9Yt27lyiq Hrmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VI2i70dF; 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 y186si3588877oig.241.2019.12.04.10.02.14; Wed, 04 Dec 2019 10:02:15 -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=VI2i70dF; 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 S1729350AbfLDSCN (ORCPT + 27 others); Wed, 4 Dec 2019 13:02:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:43842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729782AbfLDSCK (ORCPT ); Wed, 4 Dec 2019 13:02:10 -0500 Received: from localhost (unknown [217.68.49.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B1D5B2073B; Wed, 4 Dec 2019 18:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482530; bh=JpUGC9nWCZCTQes37a4qys2DDjrsol2d6dZ4/1Ex844=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VI2i70dF85dLMK+jvDnOZ0QQ3k8PXLGJcnUuI30LY8KKqNNaStIE5SuOfexRtNhqj R1cKxDTd3CWXCilxIblj18PBUaYYUOTvsjvD/NnEbZNvE2PF61h8sxTEz/zjE9vqNR vT+ojA3a4pAWZhlhx9kAxi6OUPNNsocgvJ8WUE58= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , Sasha Levin Subject: [PATCH 4.14 032/209] ARM: dts: Fix up SQ201 flash access Date: Wed, 4 Dec 2019 18:54:04 +0100 Message-Id: <20191204175323.691598376@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij [ Upstream commit d88b11ef91b15d0af9c0676cbf4f441a0dff0c56 ] This sets the partition information on the SQ201 to be read out from the RedBoot partition table, removes the static partition table and sets our boot options to mount root from /dev/mtdblock2 where the squashfs+JFFS2 resides. Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- arch/arm/boot/dts/gemini-sq201.dts | 37 ++++-------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) -- 2.20.1 diff --git a/arch/arm/boot/dts/gemini-sq201.dts b/arch/arm/boot/dts/gemini-sq201.dts index 63c02ca9513c4..e9e2f6ff0c583 100644 --- a/arch/arm/boot/dts/gemini-sq201.dts +++ b/arch/arm/boot/dts/gemini-sq201.dts @@ -20,7 +20,7 @@ }; chosen { - bootargs = "console=ttyS0,115200n8"; + bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rw rootfstype=squashfs,jffs2 rootwait"; stdout-path = &uart0; }; @@ -71,37 +71,10 @@ /* 16MB of flash */ reg = <0x30000000 0x01000000>; - partition@0 { - label = "RedBoot"; - reg = <0x00000000 0x00120000>; - read-only; - }; - partition@120000 { - label = "Kernel"; - reg = <0x00120000 0x00200000>; - }; - partition@320000 { - label = "Ramdisk"; - reg = <0x00320000 0x00600000>; - }; - partition@920000 { - label = "Application"; - reg = <0x00920000 0x00600000>; - }; - partition@f20000 { - label = "VCTL"; - reg = <0x00f20000 0x00020000>; - read-only; - }; - partition@f40000 { - label = "CurConf"; - reg = <0x00f40000 0x000a0000>; - read-only; - }; - partition@fe0000 { - label = "FIS directory"; - reg = <0x00fe0000 0x00020000>; - read-only; + partitions { + compatible = "redboot-fis"; + /* Eraseblock at 0xfe0000 */ + fis-index-block = <0x1fc>; }; }; From patchwork Wed Dec 4 17:54:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 180827 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp931716ile; Wed, 4 Dec 2019 10:02:43 -0800 (PST) X-Google-Smtp-Source: APXvYqwvOhIcmg4WJnby3c1/apkgXuE4Dk2f4R7LUEUGpu4BihLm18ZIZ5GBy3Qb1ZzWzZEZy6A8 X-Received: by 2002:aca:2210:: with SMTP id b16mr1743444oic.32.1575482563607; Wed, 04 Dec 2019 10:02:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482563; cv=none; d=google.com; s=arc-20160816; b=Wk79EZhoe2OWt/MPIcurNkeSHMbjGEYk4GSq6Oe/MP3cndMnllorT5SlqcCg31gY8o WNzQvTOFSE+QryUsv1CYQ9fzdyEF2W3qTCzj7g4mNqlit39+MMjIVD4KsCe0Vxyu6oKy /ZepjDkkjjQbr7epN3c214LOdbVZ1xV+5bAqnpWrNLngluKQkJBlicv1K5RCmJ0AfETN FZUvSKdyJ1pAy6lV8wKOkWaW69tYZfarr7iILkw0qy5+2to7TUJYpm2yx6X2hJemrkj8 XQug0Dc1DKIHGhpAPlspdhrBCDSuAwjQTMSGbpRkRoYpTjzZYwLGHkeuWokRP07uSzRh kAiw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xyVPCHftke5kiY05JTiPiDMFPM23+/maJR7GZzivlfs=; b=oRpnLkW+TMBSYMpBE6fSHK0Fv7vccXQNpD6dQP33ziOTCINLkzt6/Ps8bXx1kOSwtq Htpk9w2/jA4QeSYG6eIKH+RLIe5rIHBrYmYFRUSxg99tLllXRK8k7TJrepxU07wjBISb 3bEW45Ch6khfwFcR1IVsMcpZYr5JVjRVcyT6wmGYfHOopgNNnwnabP1XTuz5cz4wpiFI d+QICWe4VMsrBFWRHB4ZudIMfQDwRUr8cmzWUGdpwKpBG2AMA+bDZ7UsslMXF3NN/OfI m+bJOi300VsEsGhNnLKm/M/ttqb8XZVTLjwZlc7kdVnBXdy93x/UIK2LSshfh+i6jZGO GaFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c0vqZnWp; 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 w5si3632940oia.239.2019.12.04.10.02.42; Wed, 04 Dec 2019 10:02:43 -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=c0vqZnWp; 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 S1729121AbfLDSCl (ORCPT + 27 others); Wed, 4 Dec 2019 13:02:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:44952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729899AbfLDSCi (ORCPT ); Wed, 4 Dec 2019 13:02:38 -0500 Received: from localhost (unknown [217.68.49.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B73D620865; Wed, 4 Dec 2019 18:02:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482558; bh=OzYtwF3JQAAv1AmFBZhtaXfAlBLGifIQv0NrdVQPlHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c0vqZnWpFqlRpOi+t6GIlVvfE3C5WZ7dhILpdDsbf2DyfhpqHTb+ZcuzKWhdNhPFQ ODsd/Yl5bjD7hfPMH+9N2YbqfwN/6TAHmnUmw3O09xDhiq9Ot99bL97pNx8VIqfuc4 /HbxJjqrnpxttUNr7vMV1gQsgbHOKqTio/ITYXhw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Olof Johansson , Sasha Levin Subject: [PATCH 4.14 042/209] ARM: ks8695: fix section mismatch warning Date: Wed, 4 Dec 2019 18:54:14 +0100 Message-Id: <20191204175324.319500098@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 4aa64677330beeeed721b4b122884dabad845d66 ] WARNING: vmlinux.o(.text+0x13250): Section mismatch in reference from the function acs5k_i2c_init() to the (unknown reference) .init.data:(unknown) The function acs5k_i2c_init() references the (unknown reference) __initdata (unknown). This is often because acs5k_i2c_init lacks a __initdata annotation or the annotation of (unknown) is wrong. Signed-off-by: Arnd Bergmann Signed-off-by: Olof Johansson Signed-off-by: Sasha Levin --- arch/arm/mach-ks8695/board-acs5k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/arch/arm/mach-ks8695/board-acs5k.c b/arch/arm/mach-ks8695/board-acs5k.c index e4d709c8ed32f..76d3083f1f634 100644 --- a/arch/arm/mach-ks8695/board-acs5k.c +++ b/arch/arm/mach-ks8695/board-acs5k.c @@ -92,7 +92,7 @@ static struct i2c_board_info acs5k_i2c_devs[] __initdata = { }, }; -static void acs5k_i2c_init(void) +static void __init acs5k_i2c_init(void) { /* The gpio interface */ platform_device_register(&acs5k_i2c_device); From patchwork Wed Dec 4 17:54:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 180843 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp956872ile; Wed, 4 Dec 2019 10:22:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzQ1TvnSWW+imalvIdzAFho/z9XF9/onKZE921XISAIhgjkVB6xryiARpeQI8aHDLbVWDPw X-Received: by 2002:a05:6830:204a:: with SMTP id f10mr3662853otp.29.1575483763448; Wed, 04 Dec 2019 10:22:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575483763; cv=none; d=google.com; s=arc-20160816; b=nWw6keK8P24QVHRV11V5z8mEaiow+0LmmUHZHiWruHkx3p7l45Wr4ERHCaOn9V8upt iqif/wLb/doHJnRIVfyfB/JlxK9Lw82Owe+TI/q7V43hcDR+PA4pnpQEUaGVs6asQPWq NOuWY5jI4Ufg4/trC4lpl8rY7+v7RLBmunZSM1Bgj8OoFbEewxa0tidJ3TInPj/Xf//H IxFH+UGbIDgGizumkGlLodi7Dx+aSS4Xpye3f5kP6w1c0fZ/vznXyRyCu/u5H8L5dmuU G+FxnWQ9Ewkr6UEYWU3rHCzbUrMG/1eIwnBV+YVND4wPjwQ4+FHo4bGv/oeS90Nl98HG P2zQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CobsjNX8f7FoAgiybhbsX6b3KtNRBqNzfwlHprWVEFg=; b=fjT2FOv9e/dVxs7yUcM8DjsBsy5NV3g4xmXzsTsVZXaNenex/PW5sZLnkTAqJDt927 L7MxZyHmEfEtl2pzPesPtfFaqZoU2E/52GIK/3ZeWGBbcA+WrqyGIHqVmNo3PaC304Tu dErR7x1ZAGJgSRtyfSpNjCcQctHwEpAtgBJEQVU/ps6XMe6JiaF9IaBYeqIc3tQGQe0z JJo1mS80oItaE3l6KedBTr1F/ocpCVUpVULUl55Ne3DjGsAUhP89zF9vLgTNcKjr1gCY YEH40dmHSr1Fbr6CK8VdT4zD9z4D1AOOw/OeaJsz2ADwHFQa6WxmkaECOuH0EGcNFQrz EhTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=doLi0CPF; 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 90si3259470otc.28.2019.12.04.10.22.42; Wed, 04 Dec 2019 10:22:43 -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=doLi0CPF; 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 S1730301AbfLDSFA (ORCPT + 27 others); Wed, 4 Dec 2019 13:05:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:50654 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730273AbfLDSEv (ORCPT ); Wed, 4 Dec 2019 13:04:51 -0500 Received: from localhost (unknown [217.68.49.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 99F4A206DF; Wed, 4 Dec 2019 18:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482691; bh=hoHaxQ1FpR1KmrO2bIdXBLQAaLGfFdc4kghUGkigRBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=doLi0CPF2FdLzJOv8xogeom3QX3IejPeAXqkuW6IFlBgczRjJMX1/Gs+ui5l02MdQ R8XOHUJKaUsDu6yMm0w9aaikMq1NtX1cHnqzf8G7Qh08e0Jp1TBoGag/kpwwsiepyx SBgFUtiHJ3MxJ3sgBzG6cbEK4rSlrFap8CA71/mo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Michal Simek , Sasha Levin Subject: [PATCH 4.14 053/209] microblaze: move "... is ready" messages to arch/microblaze/Makefile Date: Wed, 4 Dec 2019 18:54:25 +0100 Message-Id: <20191204175325.021720455@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit 2e14f94cf4bc2f15ca5362e81ca3a987c79e3062 ] To prepare for more fixes, move this to arch/microblaze/Makefile. Otherwise, the same "... is ready" would be printed multiple times. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Simek Signed-off-by: Sasha Levin --- arch/microblaze/Makefile | 2 ++ arch/microblaze/boot/Makefile | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile index 188f07bba0959..fe5e48184c3c2 100644 --- a/arch/microblaze/Makefile +++ b/arch/microblaze/Makefile @@ -83,9 +83,11 @@ archclean: linux.bin linux.bin.gz linux.bin.ub: vmlinux $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ + @echo 'Kernel: $(boot)/$@ is ready' ' (#'`cat .version`')' simpleImage.%: vmlinux $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ + @echo 'Kernel: $(boot)/$@ is ready' ' (#'`cat .version`')' define archhelp echo '* linux.bin - Create raw binary' diff --git a/arch/microblaze/boot/Makefile b/arch/microblaze/boot/Makefile index 7c2f52d4a0e45..49dbd1063d717 100644 --- a/arch/microblaze/boot/Makefile +++ b/arch/microblaze/boot/Makefile @@ -9,15 +9,12 @@ OBJCOPYFLAGS := -R .note -R .comment -R .note.gnu.build-id -O binary $(obj)/linux.bin: vmlinux FORCE $(call if_changed,objcopy) - @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' $(obj)/linux.bin.ub: $(obj)/linux.bin FORCE $(call if_changed,uimage) - @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' $(obj)/linux.bin.gz: $(obj)/linux.bin FORCE $(call if_changed,gzip) - @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' quiet_cmd_cp = CP $< $@$2 cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) @@ -35,6 +32,5 @@ $(obj)/simpleImage.%: vmlinux FORCE $(call if_changed,objcopy) $(call if_changed,uimage) $(call if_changed,strip,.strip) - @echo 'Kernel: $(UIMAGE_OUT) is ready' ' (#'`cat .version`')' clean-files += simpleImage.*.unstrip linux.bin.ub dts/*.dtb From patchwork Wed Dec 4 17:56:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 180842 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp954259ile; Wed, 4 Dec 2019 10:20:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxRwvOWlziN1VMxt9tnBoA315uzuEUuc427fY5G0vo9+zsprpr+2t/iJia83KVf0Dtc78RU X-Received: by 2002:a05:6830:1715:: with SMTP id 21mr3651420otk.67.1575483624819; Wed, 04 Dec 2019 10:20:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575483624; cv=none; d=google.com; s=arc-20160816; b=hTSI+qZdeIZIzXYkOaao99JqhacBQEK68up2vhXWhi7gVYQlzQtKpkVy/eR3TxznEP ARJejN6PFNE93ZnbFJ/sjFp4GT9QBurtvxFlCFm8+P1aFWFsqKJRq+G27LpxZM2dmJly Jq1IHL0KgZM87i4luvtNIcTbU5CDRid/csoV5ZwDnaADSYQA+2wUf68DZA2jxku4QyVp /BLfuwrLfNYmpTNopCqMpP51+T2ocEzUBRKORjH5h81dLGSG3v6/3Twrm2RWYdqWHzlm ps7VRB64sIfezjMMe3IIw0d/OQgLwxiDqhysnXwxkUrhfJplpSFOmVPWkU0nmo25Tmuu r+WQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/pFo6H5TRUsZXOBarzWNTInVC+M9EMm+wXIdGRL1M0w=; b=SE5v7wYa4sVr6K7GHozLFTQaq9UgU3kC1IU3GdGJFtYeQ9NtNUqq4KhRrhWR5AQQ37 CKGJctoOI+MHiR61zlEVmLw01UgpUJ2/Y7Aotk7MylIGPRwZ3if0BEgTBVorYnhT3RVw YmX6GamG8e93rNDcHxfrX74yFOa7+FsqkcfsQ0/lTao8l1Ehr5XYeIAjWO8nzOC3GHX5 LPQKDgfsPVJsb4+j9p4LDpAlactiPU1j/6+0ghcxSYbZR0DjxiFf76BynyfkvwWRVwtm pBHlaP5Mj8AOnfwM45BMVV+qyZ640xHUtkEwKTmbLaq9TOxkeIwqTWDdam+kOfqp3yuZ 7BwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hwQgqxgA; 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 l1si3722892otn.98.2019.12.04.10.20.22; Wed, 04 Dec 2019 10:20:24 -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=hwQgqxgA; 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 S1731772AbfLDSUV (ORCPT + 27 others); Wed, 4 Dec 2019 13:20:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:60950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730934AbfLDSIj (ORCPT ); Wed, 4 Dec 2019 13:08:39 -0500 Received: from localhost (unknown [217.68.49.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4AC252084B; Wed, 4 Dec 2019 18:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482917; bh=i4l7GclFuB84Q5PQuXygtKHA2bruYjOhvSMr/SzN11I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hwQgqxgAihazQe6WSYvjIrTYgQxPW+h0kWo2xo2B3jUyF7ibU4HYWQ3tK1KpUA6rH qxwa9Hi6YlWfHcWZv4npZiktlfWkOUi1kTGE0a5QWNelMpl8ZYbeFq7NWSW/F2nQG3 tcU71KXNCCzHdkkLzACVCi5/gP5fRNp545axKYBg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 4.14 185/209] y2038: futex: Move compat implementation into futex.c Date: Wed, 4 Dec 2019 18:56:37 +0100 Message-Id: <20191204175336.225467600@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 04e7712f4460585e5eed5b853fd8b82a9943958f upstream. We are going to share the compat_sys_futex() handler between 64-bit architectures and 32-bit architectures that need to deal with both 32-bit and 64-bit time_t, and this is easier if both entry points are in the same file. In fact, most other system call handlers do the same thing these days, so let's follow the trend here and merge all of futex_compat.c into futex.c. In the process, a few minor changes have to be done to make sure everything still makes sense: handle_futex_death() and futex_cmpxchg_enabled() become local symbol, and the compat version of the fetch_robust_entry() function gets renamed to compat_fetch_robust_entry() to avoid a symbol clash. This is intended as a purely cosmetic patch, no behavior should change. Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- include/linux/futex.h | 8 - kernel/Makefile | 3 kernel/futex.c | 195 +++++++++++++++++++++++++++++++++++++++++++++++- kernel/futex_compat.c | 202 -------------------------------------------------- 4 files changed, 192 insertions(+), 216 deletions(-) --- a/include/linux/futex.h +++ b/include/linux/futex.h @@ -12,9 +12,6 @@ struct task_struct; long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout, u32 __user *uaddr2, u32 val2, u32 val3); -extern int -handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi); - /* * Futexes are matched on equal values of this key. * The key type depends on whether it's a shared or private mapping. @@ -55,11 +52,6 @@ union futex_key { #ifdef CONFIG_FUTEX extern void exit_robust_list(struct task_struct *curr); -#ifdef CONFIG_HAVE_FUTEX_CMPXCHG -#define futex_cmpxchg_enabled 1 -#else -extern int futex_cmpxchg_enabled; -#endif #else static inline void exit_robust_list(struct task_struct *curr) { --- a/kernel/Makefile +++ b/kernel/Makefile @@ -49,9 +49,6 @@ obj-$(CONFIG_PROFILING) += profile.o obj-$(CONFIG_STACKTRACE) += stacktrace.o obj-y += time/ obj-$(CONFIG_FUTEX) += futex.o -ifeq ($(CONFIG_COMPAT),y) -obj-$(CONFIG_FUTEX) += futex_compat.o -endif obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o obj-$(CONFIG_SMP) += smp.o ifneq ($(CONFIG_SMP),y) --- a/kernel/futex.c +++ b/kernel/futex.c @@ -44,6 +44,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include @@ -173,8 +174,10 @@ * double_lock_hb() and double_unlock_hb(), respectively. */ -#ifndef CONFIG_HAVE_FUTEX_CMPXCHG -int __read_mostly futex_cmpxchg_enabled; +#ifdef CONFIG_HAVE_FUTEX_CMPXCHG +#define futex_cmpxchg_enabled 1 +#else +static int __read_mostly futex_cmpxchg_enabled; #endif /* @@ -3476,7 +3479,7 @@ err_unlock: * Process a futex-list entry, check whether it's owned by the * dying task, and do notification if so: */ -int handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi) +static int handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi) { u32 uval, uninitialized_var(nval), mval; int err; @@ -3723,6 +3726,192 @@ SYSCALL_DEFINE6(futex, u32 __user *, uad return do_futex(uaddr, op, val, tp, uaddr2, val2, val3); } +#ifdef CONFIG_COMPAT +/* + * Fetch a robust-list pointer. Bit 0 signals PI futexes: + */ +static inline int +compat_fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry, + compat_uptr_t __user *head, unsigned int *pi) +{ + if (get_user(*uentry, head)) + return -EFAULT; + + *entry = compat_ptr((*uentry) & ~1); + *pi = (unsigned int)(*uentry) & 1; + + return 0; +} + +static void __user *futex_uaddr(struct robust_list __user *entry, + compat_long_t futex_offset) +{ + compat_uptr_t base = ptr_to_compat(entry); + void __user *uaddr = compat_ptr(base + futex_offset); + + return uaddr; +} + +/* + * Walk curr->robust_list (very carefully, it's a userspace list!) + * and mark any locks found there dead, and notify any waiters. + * + * We silently return on any sign of list-walking problem. + */ +void compat_exit_robust_list(struct task_struct *curr) +{ + struct compat_robust_list_head __user *head = curr->compat_robust_list; + struct robust_list __user *entry, *next_entry, *pending; + unsigned int limit = ROBUST_LIST_LIMIT, pi, pip; + unsigned int uninitialized_var(next_pi); + compat_uptr_t uentry, next_uentry, upending; + compat_long_t futex_offset; + int rc; + + if (!futex_cmpxchg_enabled) + return; + + /* + * Fetch the list head (which was registered earlier, via + * sys_set_robust_list()): + */ + if (compat_fetch_robust_entry(&uentry, &entry, &head->list.next, &pi)) + return; + /* + * Fetch the relative futex offset: + */ + if (get_user(futex_offset, &head->futex_offset)) + return; + /* + * Fetch any possibly pending lock-add first, and handle it + * if it exists: + */ + if (compat_fetch_robust_entry(&upending, &pending, + &head->list_op_pending, &pip)) + return; + + next_entry = NULL; /* avoid warning with gcc */ + while (entry != (struct robust_list __user *) &head->list) { + /* + * Fetch the next entry in the list before calling + * handle_futex_death: + */ + rc = compat_fetch_robust_entry(&next_uentry, &next_entry, + (compat_uptr_t __user *)&entry->next, &next_pi); + /* + * A pending lock might already be on the list, so + * dont process it twice: + */ + if (entry != pending) { + void __user *uaddr = futex_uaddr(entry, futex_offset); + + if (handle_futex_death(uaddr, curr, pi)) + return; + } + if (rc) + return; + uentry = next_uentry; + entry = next_entry; + pi = next_pi; + /* + * Avoid excessively long or circular lists: + */ + if (!--limit) + break; + + cond_resched(); + } + if (pending) { + void __user *uaddr = futex_uaddr(pending, futex_offset); + + handle_futex_death(uaddr, curr, pip); + } +} + +COMPAT_SYSCALL_DEFINE2(set_robust_list, + struct compat_robust_list_head __user *, head, + compat_size_t, len) +{ + if (!futex_cmpxchg_enabled) + return -ENOSYS; + + if (unlikely(len != sizeof(*head))) + return -EINVAL; + + current->compat_robust_list = head; + + return 0; +} + +COMPAT_SYSCALL_DEFINE3(get_robust_list, int, pid, + compat_uptr_t __user *, head_ptr, + compat_size_t __user *, len_ptr) +{ + struct compat_robust_list_head __user *head; + unsigned long ret; + struct task_struct *p; + + if (!futex_cmpxchg_enabled) + return -ENOSYS; + + rcu_read_lock(); + + ret = -ESRCH; + if (!pid) + p = current; + else { + p = find_task_by_vpid(pid); + if (!p) + goto err_unlock; + } + + ret = -EPERM; + if (!ptrace_may_access(p, PTRACE_MODE_READ_REALCREDS)) + goto err_unlock; + + head = p->compat_robust_list; + rcu_read_unlock(); + + if (put_user(sizeof(*head), len_ptr)) + return -EFAULT; + return put_user(ptr_to_compat(head), head_ptr); + +err_unlock: + rcu_read_unlock(); + + return ret; +} + +COMPAT_SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val, + struct compat_timespec __user *, utime, u32 __user *, uaddr2, + u32, val3) +{ + struct timespec ts; + ktime_t t, *tp = NULL; + int val2 = 0; + int cmd = op & FUTEX_CMD_MASK; + + if (utime && (cmd == FUTEX_WAIT || cmd == FUTEX_LOCK_PI || + cmd == FUTEX_WAIT_BITSET || + cmd == FUTEX_WAIT_REQUEUE_PI)) { + if (compat_get_timespec(&ts, utime)) + return -EFAULT; + if (!timespec_valid(&ts)) + return -EINVAL; + + t = timespec_to_ktime(ts); + if (cmd == FUTEX_WAIT) + t = ktime_add_safe(ktime_get(), t); + tp = &t; + } + if (cmd == FUTEX_REQUEUE || cmd == FUTEX_CMP_REQUEUE || + cmd == FUTEX_CMP_REQUEUE_PI || cmd == FUTEX_WAKE_OP) + val2 = (int) (unsigned long) utime; + + return do_futex(uaddr, op, val, tp, uaddr2, val2, val3); +} +#endif /* CONFIG_COMPAT */ + static void __init futex_detect_cmpxchg(void) { #ifndef CONFIG_HAVE_FUTEX_CMPXCHG --- a/kernel/futex_compat.c +++ /dev/null @@ -1,202 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/kernel/futex_compat.c - * - * Futex compatibililty routines. - * - * Copyright 2006, Red Hat, Inc., Ingo Molnar - */ - -#include -#include -#include -#include -#include -#include - -#include - - -/* - * Fetch a robust-list pointer. Bit 0 signals PI futexes: - */ -static inline int -fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry, - compat_uptr_t __user *head, unsigned int *pi) -{ - if (get_user(*uentry, head)) - return -EFAULT; - - *entry = compat_ptr((*uentry) & ~1); - *pi = (unsigned int)(*uentry) & 1; - - return 0; -} - -static void __user *futex_uaddr(struct robust_list __user *entry, - compat_long_t futex_offset) -{ - compat_uptr_t base = ptr_to_compat(entry); - void __user *uaddr = compat_ptr(base + futex_offset); - - return uaddr; -} - -/* - * Walk curr->robust_list (very carefully, it's a userspace list!) - * and mark any locks found there dead, and notify any waiters. - * - * We silently return on any sign of list-walking problem. - */ -void compat_exit_robust_list(struct task_struct *curr) -{ - struct compat_robust_list_head __user *head = curr->compat_robust_list; - struct robust_list __user *entry, *next_entry, *pending; - unsigned int limit = ROBUST_LIST_LIMIT, pi, pip; - unsigned int uninitialized_var(next_pi); - compat_uptr_t uentry, next_uentry, upending; - compat_long_t futex_offset; - int rc; - - if (!futex_cmpxchg_enabled) - return; - - /* - * Fetch the list head (which was registered earlier, via - * sys_set_robust_list()): - */ - if (fetch_robust_entry(&uentry, &entry, &head->list.next, &pi)) - return; - /* - * Fetch the relative futex offset: - */ - if (get_user(futex_offset, &head->futex_offset)) - return; - /* - * Fetch any possibly pending lock-add first, and handle it - * if it exists: - */ - if (fetch_robust_entry(&upending, &pending, - &head->list_op_pending, &pip)) - return; - - next_entry = NULL; /* avoid warning with gcc */ - while (entry != (struct robust_list __user *) &head->list) { - /* - * Fetch the next entry in the list before calling - * handle_futex_death: - */ - rc = fetch_robust_entry(&next_uentry, &next_entry, - (compat_uptr_t __user *)&entry->next, &next_pi); - /* - * A pending lock might already be on the list, so - * dont process it twice: - */ - if (entry != pending) { - void __user *uaddr = futex_uaddr(entry, futex_offset); - - if (handle_futex_death(uaddr, curr, pi)) - return; - } - if (rc) - return; - uentry = next_uentry; - entry = next_entry; - pi = next_pi; - /* - * Avoid excessively long or circular lists: - */ - if (!--limit) - break; - - cond_resched(); - } - if (pending) { - void __user *uaddr = futex_uaddr(pending, futex_offset); - - handle_futex_death(uaddr, curr, pip); - } -} - -COMPAT_SYSCALL_DEFINE2(set_robust_list, - struct compat_robust_list_head __user *, head, - compat_size_t, len) -{ - if (!futex_cmpxchg_enabled) - return -ENOSYS; - - if (unlikely(len != sizeof(*head))) - return -EINVAL; - - current->compat_robust_list = head; - - return 0; -} - -COMPAT_SYSCALL_DEFINE3(get_robust_list, int, pid, - compat_uptr_t __user *, head_ptr, - compat_size_t __user *, len_ptr) -{ - struct compat_robust_list_head __user *head; - unsigned long ret; - struct task_struct *p; - - if (!futex_cmpxchg_enabled) - return -ENOSYS; - - rcu_read_lock(); - - ret = -ESRCH; - if (!pid) - p = current; - else { - p = find_task_by_vpid(pid); - if (!p) - goto err_unlock; - } - - ret = -EPERM; - if (!ptrace_may_access(p, PTRACE_MODE_READ_REALCREDS)) - goto err_unlock; - - head = p->compat_robust_list; - rcu_read_unlock(); - - if (put_user(sizeof(*head), len_ptr)) - return -EFAULT; - return put_user(ptr_to_compat(head), head_ptr); - -err_unlock: - rcu_read_unlock(); - - return ret; -} - -COMPAT_SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val, - struct compat_timespec __user *, utime, u32 __user *, uaddr2, - u32, val3) -{ - struct timespec ts; - ktime_t t, *tp = NULL; - int val2 = 0; - int cmd = op & FUTEX_CMD_MASK; - - if (utime && (cmd == FUTEX_WAIT || cmd == FUTEX_LOCK_PI || - cmd == FUTEX_WAIT_BITSET || - cmd == FUTEX_WAIT_REQUEUE_PI)) { - if (compat_get_timespec(&ts, utime)) - return -EFAULT; - if (!timespec_valid(&ts)) - return -EINVAL; - - t = timespec_to_ktime(ts); - if (cmd == FUTEX_WAIT) - t = ktime_add_safe(ktime_get(), t); - tp = &t; - } - if (cmd == FUTEX_REQUEUE || cmd == FUTEX_CMP_REQUEUE || - cmd == FUTEX_CMP_REQUEUE_PI || cmd == FUTEX_WAKE_OP) - val2 = (int) (unsigned long) utime; - - return do_futex(uaddr, op, val, tp, uaddr2, val2, val3); -} From patchwork Wed Dec 4 17:56:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 180833 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp940586ile; Wed, 4 Dec 2019 10:09:21 -0800 (PST) X-Google-Smtp-Source: APXvYqx3lmU/VnzSzuaEdpp+2bSm6LN0bvHTjVAQfiNHB2oHbLwfWLVQLE9M2CUGcVKQqP5f3Pqn X-Received: by 2002:aca:b204:: with SMTP id b4mr3814328oif.18.1575482960923; Wed, 04 Dec 2019 10:09:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482960; cv=none; d=google.com; s=arc-20160816; b=EXFBVwN7eArrjqE9fuIV2t8KU0rZ3uK3SocJniu2IPsnQGnmUi7HEBJQED03mDRtTW u0uRkcrrqk+3uFfiw3qcXZTjzfORJt962n1JLUvquzw190tYOyXEHz3hi+PDjQRW/3Ox jRv7ewDH867A4kcXdl1X7lU9bgT74PIE3dOvfzbIvtGPC/L0JFdj/IQjbqJSp8LoWLu6 TwAB/4gw6sa6edxqD28Shq66w4a1/AHV22gfrhmQS5mv65KFBYY5dz3k/e8BC5u8Hiq4 Q7+MNQCsoOpi0knSANpPl5cNdmVPbwRZr/iZFJNrk5jTHFinrWaSQppvQuLig+D2pwPC AOHw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=w2p0FHT9ofEAntJ+D1Egb4SIXLWlhSXAfr8ZXTAUaIk=; b=dCzc/SbRGSKNw05GqEtn5C7BEktdQZj1sK+p2B3dMjxvzEmZR5lsrXAKWu9uWU/QM8 ghwDHpJbYU6wG1vW2Q80OHcrvjiVCFsKZoXqZ9l7Qg88ZI3UU0/bK6bFkCWw7hLDJ04b 8BeLvOog0nBjqtwNrOXOT2+movdKGpGpGSW0y+M86Lg34GmvPovNtEPaBy6fZMRCI+U0 4MF6qo9K3gULg16+Wk8kaYOz6+mBnRYJxWftiDJ3ES1Kph80eNhP1yPZs5ztQM+pH6ML UMfG6m+AAmpy5gQMDIG28FtXc2QyZHW16Rka6QeDMPhpH1gWuXYKXCdWl9P4ODwgk71Z b6lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="skNItj/2"; 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 v12si3934949ote.168.2019.12.04.10.09.20; Wed, 04 Dec 2019 10:09:20 -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="skNItj/2"; 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 S1730571AbfLDSJT (ORCPT + 27 others); Wed, 4 Dec 2019 13:09:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:34412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731021AbfLDSJK (ORCPT ); Wed, 4 Dec 2019 13:09:10 -0500 Received: from localhost (unknown [217.68.49.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A421820675; Wed, 4 Dec 2019 18:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482950; bh=O4H8gKKIofBTYa/ahR2HGrSqNn62ReqrOkWXmkecmG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=skNItj/2Y5Cek6Sjnx+Y/Hp16YWFxEbo6OLKP5E+c1boFeT4gqXiDvx9/WYEWFWgH xI4KySnPIj5LJD7890z2KggqppORopYqc0DV75P1PgpN/mq2cVK1uHliLZexPZPpLO 9I7/n4qqSbCVD7Yd8xezZqvjGFIx76SOh0N3jAg8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lionel Debieve , Herbert Xu , Mathieu Poirier Subject: [PATCH 4.14 201/209] hwrng: stm32 - fix unbalanced pm_runtime_enable Date: Wed, 4 Dec 2019 18:56:53 +0100 Message-Id: <20191204175337.324862662@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lionel Debieve commit af0d4442dd6813de6e77309063beb064fa8e89ae upstream. No remove function implemented yet in the driver. Without remove function, the pm_runtime implementation complains when removing and probing again the driver. Signed-off-by: Lionel Debieve Signed-off-by: Herbert Xu Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman --- drivers/char/hw_random/stm32-rng.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/char/hw_random/stm32-rng.c +++ b/drivers/char/hw_random/stm32-rng.c @@ -166,6 +166,13 @@ static int stm32_rng_probe(struct platfo return devm_hwrng_register(dev, &priv->rng); } +static int stm32_rng_remove(struct platform_device *ofdev) +{ + pm_runtime_disable(&ofdev->dev); + + return 0; +} + #ifdef CONFIG_PM static int stm32_rng_runtime_suspend(struct device *dev) { @@ -202,6 +209,7 @@ static struct platform_driver stm32_rng_ .of_match_table = stm32_rng_match, }, .probe = stm32_rng_probe, + .remove = stm32_rng_remove, }; module_platform_driver(stm32_rng_driver);