From patchwork Sat Jul 15 01:26:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 107837 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1642911qge; Fri, 14 Jul 2017 18:27:30 -0700 (PDT) X-Received: by 10.98.48.69 with SMTP id w66mr8111604pfw.214.1500082050422; Fri, 14 Jul 2017 18:27:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500082050; cv=none; d=google.com; s=arc-20160816; b=Ba3cBwzAJtmp6xK0ZxSwZx4yLKXPBUt7oNCxLm2N5UplUbX1q3Qa7RtlThU6/dJShy cTDbWkWLCxzk67H8ClQnAxM6cFxYpVrUla+H3iDafuGkS1oXsU7C1+JuFhiP2G5nRfM8 tKT7mYJgG+HMQk69xJwj9K/i0VJq2aFD4JK3qv8VmjDmlG5gC5oTe5LOHz8Lj2p/ynM4 yqn77WMLM6bc618ORnQqvN8tFnQNrd/83mdnUTmevz+ISSAAiB/1gafk0vgkliU3Z7/Q /g5itTIOq1/5a7Ofv7GWAWXgHx7WUdttCEmsvFpU6PjI109qKMg0NcxDfVKWRmWrrMf3 5Jbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:dkim-signature:cc:from :dkim-signature:arc-authentication-results; bh=/afMvCuX6I1WFDKMQtlD6pzzUcQSmhp+6IfZkJgPAEY=; b=YPxoEkAUsnpGFXLuAnTbPzdYxiVE2FN+jsKNy3yoYgAssMDrHzmrRwNI64ByZC7kNZ MImjF9UmKyC+tyXgVE62D2hI+Pq1RWcfwcbwUz0fi+3KQ6UZjvFIO48qonMWYoY5+WID 2eC9EXNQbDFf1oOpRxBZYvLg7KsSd7cFuOgFuSXHImcy3EwjtXwJtvY3NmOJtVQoK8R+ ujsmOvuw+niYPLcI5VjC13uoXUw2qGvboBe55Z+XzJ4hdDtlpf98ajV40JYeSTHEfuoc V7TwWD4nKanWAK7yZ/4c7pxxbW+RxSFr3Qm6euQaeBRL2gowfWAro1foaN+kSotcc8nm FZqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.b=FxBM/302; dkim=fail header.i=@verizon.com header.b=qVHF/Vwe; 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=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d89si7605397pfl.148.2017.07.14.18.27.30; Fri, 14 Jul 2017 18:27:30 -0700 (PDT) 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=@verizon.com header.b=FxBM/302; dkim=fail header.i=@verizon.com header.b=qVHF/Vwe; 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=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751688AbdGOB10 (ORCPT + 25 others); Fri, 14 Jul 2017 21:27:26 -0400 Received: from fldsmtpe03.verizon.com ([140.108.26.142]:51562 "EHLO fldsmtpe03.verizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751338AbdGOB1I (ORCPT ); Fri, 14 Jul 2017 21:27:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1500082028; x=1531618028; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=menU+41m+/Y//DaabZ2irJfvbUS9WZd7fCEkwk2ujuQ=; b=FxBM/302YpFX1+45ifymVJIIqyx0KnCV7ngo4ANqfA5tSedGUOd/WF11 PtPvKnvbk7Cz+7QjeVMIly/95Nj8F3/cWjtY0s9jAGo+GABA3tSNn2Wwy nBchNlnJhQaRATS48mrE8iFRWHZ05DmeHLQBtfPxmFlXX/d+FUoOL+Jvz 8=; X-IronPort-Anti-Spam-Filtered: false Received: from unknown (HELO fldsmtpi03.verizon.com) ([166.68.71.145]) by fldsmtpe03.verizon.com with ESMTP; 15 Jul 2017 01:27:05 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: Arnd Bergmann , Alex Williamson , "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-0-101.rogue.vzwcorp.com (HELO Genesis.verizonwireless.com) ([10.255.0.101]) by fldsmtpi03.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 15 Jul 2017 01:26:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1500081968; x=1531617968; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=menU+41m+/Y//DaabZ2irJfvbUS9WZd7fCEkwk2ujuQ=; b=qVHF/VweJ6Cr/b36LwifUQ/btiigdgGe67rzrsfBPku6RYEWx4MO0w52 re8/Xb4omSjcZtpCKHtjiSzRzmQo5XGDAW1vyGSbOsTlOqhODC5uzhgfY +OCIR3xK+hKUG0EYk68shB8RhzZdzzbYT1353xHNGss30abPPjdR5xIed I=; Received: from casac1exh001.uswin.ad.vzwcorp.com ([10.11.218.43]) by Genesis.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 14 Jul 2017 18:26:08 -0700 Received: from scwexch18apd.uswin.ad.vzwcorp.com (153.114.130.37) by CASAC1EXH001.uswin.ad.vzwcorp.com (10.11.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 14 Jul 2017 18:26:08 -0700 Received: from OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) by scwexch18apd.uswin.ad.vzwcorp.com (153.114.130.37) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 14 Jul 2017 18:26:07 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 14 Jul 2017 20:26:06 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Fri, 14 Jul 2017 20:26:06 -0500 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH for v4.9 LTS 16/87] vfio-pci: use 32-bit comparisons for register address for gcc-4.5 Thread-Topic: [PATCH for v4.9 LTS 16/87] vfio-pci: use 32-bit comparisons for register address for gcc-4.5 Thread-Index: AQHS/QlS+BZku6Z1rUyapQSAbuAAlA== Date: Sat, 15 Jul 2017 01:26:02 +0000 Message-ID: <20170715012538.10101-16-alexander.levin@verizon.com> References: <20170715012538.10101-1-alexander.levin@verizon.com> In-Reply-To: <20170715012538.10101-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] 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 45e869714489431625c569d21fc952428d761476 ] Using ancient compilers (gcc-4.5 or older) on ARM, we get a link failure with the vfio-pci driver: ERROR: "__aeabi_lcmp" [drivers/vfio/pci/vfio-pci.ko] undefined! The reason is that the compiler tries to do a comparison of a 64-bit range. This changes it to convert to a 32-bit number explicitly first, as newer compilers do for themselves. Signed-off-by: Arnd Bergmann Signed-off-by: Alex Williamson Signed-off-by: Sasha Levin --- drivers/vfio/pci/vfio_pci_rdwr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.11.0 diff --git a/drivers/vfio/pci/vfio_pci_rdwr.c b/drivers/vfio/pci/vfio_pci_rdwr.c index 5ffd1d9ad4bd..357243d76f10 100644 --- a/drivers/vfio/pci/vfio_pci_rdwr.c +++ b/drivers/vfio/pci/vfio_pci_rdwr.c @@ -193,7 +193,10 @@ ssize_t vfio_pci_vga_rw(struct vfio_pci_device *vdev, char __user *buf, if (!vdev->has_vga) return -EINVAL; - switch (pos) { + if (pos > 0xbfffful) + return -EINVAL; + + switch ((u32)pos) { case 0xa0000 ... 0xbffff: count = min(count, (size_t)(0xc0000 - pos)); iomem = ioremap_nocache(0xa0000, 0xbffff - 0xa0000 + 1); From patchwork Sat Jul 15 01:26:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 107839 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1646864qge; Fri, 14 Jul 2017 18:32:17 -0700 (PDT) X-Received: by 10.99.177.6 with SMTP id r6mr7857905pgf.106.1500082337575; Fri, 14 Jul 2017 18:32:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500082337; cv=none; d=google.com; s=arc-20160816; b=aFHRjHRWSy2Jp9swVIXkYCa91aRqVC2N5XhmM2uuibaVSg7f9nKuc2NBtEmblFuj/i PjMg1MwCVSmXZl1vNWCGQ8uTiM/cEYM8IU6gKw7KtfpFE27JNlnpUqvTRfJ216YOdfKR bHY90lfhuBbsBSx2AH4QD4ASC4NGl2gLBsi51vj3WD1ZVHu0QbNJtGdJ0H6Q48mLWXZC P9aJL0mqZ9VIn9bU6x9vznbcJHzfEZb9Fe5fy/v1w4gb87SWFzdrtN/WlXODzo2TQ34Q DXfFbLGDXcM7FK1LDraACaiet57YKfjh1NERoGnB8pJI5yKTLiNKIq5cYlfpMZCpCES5 ZPxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:dkim-signature:cc:from :dkim-signature:arc-authentication-results; bh=GkuQAsc/gTWF6DKBr6oTJbGsN2zik2Nz0Ce1r6elOmY=; b=ScKHYiSPA8irMes34iyqFuIPB/8S9pjhS7lBTUX7zT4xqh+YW4QkGXnRXEeoWKHJrs WiOiBY3COxKm9UpEOeUTyY/x6/GxFswpxue70hgywwjFSr4EHdBj73HQWdfDHBqcutuj SXbgL4QuLR2zidGhErlGqKvt/Rp294qF8ktQi90KiIhoaUjbJbXVjyY5CmfRzoabbu6n TUXByGda539jmJVVxzFAacdJgF+NMLbPWQ76p1mXa/rm2eKFHu+TfPO5whxVHLb9WaC6 h5EzimJWTl0hoacjOAcG/da4EL5ZXpw5ep2FAKCduJKaTa/aANk1uYcV7Jb6yX51b09x Hltg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.b=jeBko5KF; dkim=fail header.i=@verizon.com header.b=M1JKeGZb; 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=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si3158301pgo.45.2017.07.14.18.32.16; Fri, 14 Jul 2017 18:32:17 -0700 (PDT) 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=@verizon.com header.b=jeBko5KF; dkim=fail header.i=@verizon.com header.b=M1JKeGZb; 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=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752684AbdGOBcA (ORCPT + 25 others); Fri, 14 Jul 2017 21:32:00 -0400 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:62832 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752095AbdGOB2B (ORCPT ); Fri, 14 Jul 2017 21:28:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1500082081; x=1531618081; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=zhBD2/lqO4AQ9CSy61xPNHFnYUM6IEmiVA8ps7o7lkQ=; b=jeBko5KFcUfu+5Lb17euHcnlyuGYkzOcH2XIEsotjOHflkLQ0tNZyNQV gIXD5fk8abV0LDt/6K1rdhzgVsupj8kJGmfFBSG392OQdP5Sb2cCfLOAo dogg5k8jTidpe2P/ANoHtqHzOrvTUJLY8IuX4Xn6BngWbecn4idAWUsxe M=; X-IronPort-Anti-Spam-Filtered: false Received: from unknown (HELO fldsmtpi03.verizon.com) ([166.68.71.145]) by omzsmtpe01.verizonbusiness.com with ESMTP; 15 Jul 2017 01:28:00 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: Marek Szyprowski , Stephen Boyd , "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-0-101.rogue.vzwcorp.com (HELO Genesis.verizonwireless.com) ([10.255.0.101]) by fldsmtpi03.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 15 Jul 2017 01:27:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1500082063; x=1531618063; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=zhBD2/lqO4AQ9CSy61xPNHFnYUM6IEmiVA8ps7o7lkQ=; b=M1JKeGZb2K20YM2WRk2AgFpWDclSIdas9YThUQI0VokhcP7J3xW/xoam cLNoavkrLeTkyr8U128jmqRb+bNmJccpXwN55oyMO6Mjsd5Z8BZzL0M5N im5tLpOLzBTDV2m8O/9iwZU2dCQjPnuHL5Zj5IzQiKCQglYpT81bvaVMH c=; Received: from casac1exh003.uswin.ad.vzwcorp.com ([10.11.218.45]) by Genesis.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 14 Jul 2017 18:27:42 -0700 Received: from scwexch07apd.uswin.ad.vzwcorp.com (153.114.130.26) by CASAC1EXH003.uswin.ad.vzwcorp.com (10.11.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 14 Jul 2017 18:27:42 -0700 Received: from OMZP1LUMXCA15.uswin.ad.vzwcorp.com (144.8.22.190) by scwexch07apd.uswin.ad.vzwcorp.com (153.114.130.26) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 14 Jul 2017 18:27:41 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA15.uswin.ad.vzwcorp.com (144.8.22.190) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 14 Jul 2017 20:27:40 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Fri, 14 Jul 2017 20:27:40 -0500 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH for v4.9 LTS 71/87] clk/samsung: exynos542x: mark some clocks as critical Thread-Topic: [PATCH for v4.9 LTS 71/87] clk/samsung: exynos542x: mark some clocks as critical Thread-Index: AQHS/QlekI16cjGgYEOY0mwjTplywA== Date: Sat, 15 Jul 2017 01:26:22 +0000 Message-ID: <20170715012538.10101-71-alexander.levin@verizon.com> References: <20170715012538.10101-1-alexander.levin@verizon.com> In-Reply-To: <20170715012538.10101-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] 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 318fa46cc60d37fec1e87dbf03a82aca0f5ce695 ] Some parent clocks of the Exynos542x clock blocks, which have separate power domains (like DISP, MFC, MSC, GSC, FSYS and G2D) must be always enabled to access any register related to power management unit or devices connected to it. For the time being, until a proper solution based on runtime PM is applied, mark those clocks as critical (instead of ignore unused or even no flags) to prevent disabling them. Signed-off-by: Marek Szyprowski Acked-by: Sylwester Nawrocki Reviewed-by: Chanwoo Choi Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas [Exynos5800 Peach Pi Chromebook] Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/samsung/clk-exynos5420.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.11.0 diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c index 8c8b495cbf0d..cdc092a1d9ef 100644 --- a/drivers/clk/samsung/clk-exynos5420.c +++ b/drivers/clk/samsung/clk-exynos5420.c @@ -586,7 +586,7 @@ static const struct samsung_gate_clock exynos5800_gate_clks[] __initconst = { GATE(CLK_ACLK550_CAM, "aclk550_cam", "mout_user_aclk550_cam", GATE_BUS_TOP, 24, 0, 0), GATE(CLK_ACLK432_SCALER, "aclk432_scaler", "mout_user_aclk432_scaler", - GATE_BUS_TOP, 27, 0, 0), + GATE_BUS_TOP, 27, CLK_IS_CRITICAL, 0), }; static const struct samsung_mux_clock exynos5420_mux_clks[] __initconst = { @@ -956,20 +956,20 @@ static const struct samsung_gate_clock exynos5x_gate_clks[] __initconst = { GATE(CLK_SMMU_G2D, "smmu_g2d", "aclk333_g2d", GATE_IP_G2D, 7, 0, 0), GATE(0, "aclk200_fsys", "mout_user_aclk200_fsys", - GATE_BUS_FSYS0, 9, CLK_IGNORE_UNUSED, 0), + GATE_BUS_FSYS0, 9, CLK_IS_CRITICAL, 0), GATE(0, "aclk200_fsys2", "mout_user_aclk200_fsys2", GATE_BUS_FSYS0, 10, CLK_IGNORE_UNUSED, 0), GATE(0, "aclk333_g2d", "mout_user_aclk333_g2d", GATE_BUS_TOP, 0, CLK_IGNORE_UNUSED, 0), GATE(0, "aclk266_g2d", "mout_user_aclk266_g2d", - GATE_BUS_TOP, 1, CLK_IGNORE_UNUSED, 0), + GATE_BUS_TOP, 1, CLK_IS_CRITICAL, 0), GATE(0, "aclk300_jpeg", "mout_user_aclk300_jpeg", GATE_BUS_TOP, 4, CLK_IGNORE_UNUSED, 0), GATE(0, "aclk333_432_isp0", "mout_user_aclk333_432_isp0", GATE_BUS_TOP, 5, 0, 0), GATE(0, "aclk300_gscl", "mout_user_aclk300_gscl", - GATE_BUS_TOP, 6, CLK_IGNORE_UNUSED, 0), + GATE_BUS_TOP, 6, CLK_IS_CRITICAL, 0), GATE(0, "aclk333_432_gscl", "mout_user_aclk333_432_gscl", GATE_BUS_TOP, 7, CLK_IGNORE_UNUSED, 0), GATE(0, "aclk333_432_isp", "mout_user_aclk333_432_isp", @@ -983,20 +983,20 @@ static const struct samsung_gate_clock exynos5x_gate_clks[] __initconst = { GATE(0, "aclk166", "mout_user_aclk166", GATE_BUS_TOP, 14, CLK_IGNORE_UNUSED, 0), GATE(CLK_ACLK333, "aclk333", "mout_user_aclk333", - GATE_BUS_TOP, 15, CLK_IGNORE_UNUSED, 0), + GATE_BUS_TOP, 15, CLK_IS_CRITICAL, 0), GATE(0, "aclk400_isp", "mout_user_aclk400_isp", GATE_BUS_TOP, 16, 0, 0), GATE(0, "aclk400_mscl", "mout_user_aclk400_mscl", GATE_BUS_TOP, 17, 0, 0), GATE(0, "aclk200_disp1", "mout_user_aclk200_disp1", - GATE_BUS_TOP, 18, 0, 0), + GATE_BUS_TOP, 18, CLK_IS_CRITICAL, 0), GATE(CLK_SCLK_MPHY_IXTAL24, "sclk_mphy_ixtal24", "mphy_refclk_ixtal24", GATE_BUS_TOP, 28, 0, 0), GATE(CLK_SCLK_HSIC_12M, "sclk_hsic_12m", "ff_hsic_12m", GATE_BUS_TOP, 29, 0, 0), GATE(0, "aclk300_disp1", "mout_user_aclk300_disp1", - SRC_MASK_TOP2, 24, 0, 0), + SRC_MASK_TOP2, 24, CLK_IS_CRITICAL, 0), GATE(CLK_MAU_EPLL, "mau_epll", "mout_mau_epll_clk", SRC_MASK_TOP7, 20, 0, 0), From patchwork Sat Jul 15 01:26:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 107838 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1644554qge; Fri, 14 Jul 2017 18:29:35 -0700 (PDT) X-Received: by 10.84.232.5 with SMTP id h5mr18631873plk.261.1500082175485; Fri, 14 Jul 2017 18:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500082175; cv=none; d=google.com; s=arc-20160816; b=r1aWUcNF3HFk3aHePdwvtbfZlsy8dZENVyi/ajPFA7TW7k29CmssuJ5kI3A/nkiwjg fm/MbaHaGZwiW11kMHtwnJTmqi9oaBxZ8j7PlQ8jLCzrzapMM9M8/om+pT6enSRzVfNq sC7U4Q6KxpXAel2rPN9D/ag787XoDIOT5/rV+q40KVm8qM9C8Q5YiqcYgzkky70CZabf mO85G1uZWujIXGBFTfOcQNqUmi/jxcOi1YJoZnWQe/JeSCTFdUPF9DAAmtJbz1V5yYaf ELsqqHzxgOQxo5c+C/26Mq0XGA1t2Wt1vStOsnlEYDHwbSz9JSmziM6cDEYBjkRDANQl DDZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:dkim-signature :dkim-signature:cc:from:dkim-signature:arc-authentication-results; bh=aaKln6pxwwsPO7T6+DcAzaGutOthOsjunDsJmoEIJBM=; b=MjsY1AXyWyV+lgJWDMOrqiJNS0d7eGaIAFPoM0dNtP6ilAiSGEy+5z+4AUqJUkXM4f +mP3XyCyh3Ted3+QgzPEby5gww+35op26EBQYYis1hXoUnGG2vSY+OeSw1TfXi3pr/bP YSBzKVrJsw8ep7m4gbqg85o13YjQWQaabTY86eVNgN8laTfthv6fEma0wccF/bqj8tnE XX6RmbMf6RPSF5cqP7pEVO3mwFcOEv0kTPq5SQQ2pMD6P/eXlDtCirnOMZKFnPddw9wN rDaay9oJAv/sMj33DoYmBbnNBlprMkNniSp1S3guUXO7qNbOiu5M1j1uYB7QOTQjPRKI mbaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.b=TMnatgLp; dkim=fail header.i=@verizon.com header.b=vIpedP6Q; dkim=fail header.i=@verizon.com header.b=vIpedP6Q; 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=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si7781072plj.559.2017.07.14.18.29.35; Fri, 14 Jul 2017 18:29:35 -0700 (PDT) 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=@verizon.com header.b=TMnatgLp; dkim=fail header.i=@verizon.com header.b=vIpedP6Q; dkim=fail header.i=@verizon.com header.b=vIpedP6Q; 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=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752564AbdGOB3b (ORCPT + 25 others); Fri, 14 Jul 2017 21:29:31 -0400 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:44101 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752222AbdGOB2F (ORCPT ); Fri, 14 Jul 2017 21:28:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1500082085; x=1531618085; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=J844v3HboFo3pYV5ZYibvF2OLJZgfjqFkJ/jIVAwVbs=; b=TMnatgLpBp0w50A64JyT7GwPO15rhOLJmrOt3zelQlfoxauWQmZBkV4a udcLMBObH9D2jsMP/NTkIKo/HjkuIGN1SDq0qifNQKRi4TlROJOP5VcNY sV6ijxygzOml1XgR9zfiFCl5SRAtEOuojPF75VHuniC7EeZ6a9Mmqylr8 8=; X-IronPort-Anti-Spam-Filtered: false Received: from unknown (HELO fldsmtpi03.verizon.com) ([166.68.71.145]) by omzsmtpe01.verizonbusiness.com with ESMTP; 15 Jul 2017 01:28:00 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: Ard Biesheuvel , Catalin Marinas , Hanjun Guo , Yisheng Xie , Robert Richter , James Morse , Andrew Morton , "Linus Torvalds" , "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi03.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 15 Jul 2017 01:27:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1500082072; x=1531618072; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=J844v3HboFo3pYV5ZYibvF2OLJZgfjqFkJ/jIVAwVbs=; b=vIpedP6Q2g1CbI/P5a3MjO5rPjGs3xeU1iezKE/QyYiFO7m4l6EvC6gL cSj1hD5ucie5brBW4cFuW3PVxAk41cydT1CvbXPXuwLbBow9l8PcB+w+o WkeiiKzLuVwl+24Y2uT4EAr5eG3AHOgQiN7XP6lKC2vr0s68EGJRPANdY 8=; Received: from ranger.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.27]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Jul 2017 21:27:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1500082072; x=1531618072; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=J844v3HboFo3pYV5ZYibvF2OLJZgfjqFkJ/jIVAwVbs=; b=vIpedP6Q2g1CbI/P5a3MjO5rPjGs3xeU1iezKE/QyYiFO7m4l6EvC6gL cSj1hD5ucie5brBW4cFuW3PVxAk41cydT1CvbXPXuwLbBow9l8PcB+w+o WkeiiKzLuVwl+24Y2uT4EAr5eG3AHOgQiN7XP6lKC2vr0s68EGJRPANdY 8=; X-Host: ranger.odc.vzwcorp.com Received: from casac1exh003.uswin.ad.vzwcorp.com ([10.11.218.45]) by mercury.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 15 Jul 2017 01:27:51 +0000 Received: from scwexch16apd.uswin.ad.vzwcorp.com (153.114.130.35) by CASAC1EXH003.uswin.ad.vzwcorp.com (10.11.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 14 Jul 2017 18:27:50 -0700 Received: from OMZP1LUMXCA12.uswin.ad.vzwcorp.com (144.8.22.187) by scwexch16apd.uswin.ad.vzwcorp.com (153.114.130.35) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 14 Jul 2017 18:27:50 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA12.uswin.ad.vzwcorp.com (144.8.22.187) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Fri, 14 Jul 2017 20:27:48 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Fri, 14 Jul 2017 20:27:49 -0500 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH for v4.9 LTS 85/87] mm: don't dereference struct page fields of invalid pages Thread-Topic: [PATCH for v4.9 LTS 85/87] mm: don't dereference struct page fields of invalid pages Thread-Index: AQHS/QlhW4HcSQaRTUqgy2uhzBt1QQ== Date: Sat, 15 Jul 2017 01:26:27 +0000 Message-ID: <20170715012538.10101-85-alexander.levin@verizon.com> References: <20170715012538.10101-1-alexander.levin@verizon.com> In-Reply-To: <20170715012538.10101-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel [ Upstream commit f073bdc51771f5a5c7a8d1191bfc3ae371d44de7 ] The VM_BUG_ON() check in move_freepages() checks whether the node id of a page matches the node id of its zone. However, it does this before having checked whether the struct page pointer refers to a valid struct page to begin with. This is guaranteed in most cases, but may not be the case if CONFIG_HOLES_IN_ZONE=y. So reorder the VM_BUG_ON() with the pfn_valid_within() check. Link: http://lkml.kernel.org/r/1481706707-6211-2-git-send-email-ard.biesheuvel@linaro.org Signed-off-by: Ard Biesheuvel Acked-by: Will Deacon Cc: Catalin Marinas Cc: Hanjun Guo Cc: Yisheng Xie Cc: Robert Richter Cc: James Morse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- mm/page_alloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.11.0 diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 56df8c24689d..85881bf01776 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1875,14 +1875,14 @@ int move_freepages(struct zone *zone, #endif for (page = start_page; page <= end_page;) { - /* Make sure we are not inadvertently changing nodes */ - VM_BUG_ON_PAGE(page_to_nid(page) != zone_to_nid(zone), page); - if (!pfn_valid_within(page_to_pfn(page))) { page++; continue; } + /* Make sure we are not inadvertently changing nodes */ + VM_BUG_ON_PAGE(page_to_nid(page) != zone_to_nid(zone), page); + if (!PageBuddy(page)) { page++; continue;