From patchwork Mon Feb 19 10:13:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128786 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3330272ljc; Mon, 19 Feb 2018 02:14:39 -0800 (PST) X-Google-Smtp-Source: AH8x224UBW5vKcgV4kJnM+pSIA4B2BerwTng58q1EJS0RufsjChFORGg/ZztnvDMgrrYXNz2nq7N X-Received: by 10.99.141.200 with SMTP id z191mr11757144pgd.418.1519035279245; Mon, 19 Feb 2018 02:14:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519035279; cv=none; d=google.com; s=arc-20160816; b=kz0+7yXVjUlit2vPbfMnh25ocxE3HebbbSTgOQ477hs7/+IzcAYeB1G6nUqaWwO9Xn qJsLTbrBaxIAlEpXs07Er6C4x5GIi7Ko20bhCuz4saDMoBjH7CmtOnl5awdW3syXb7p4 Fn6Cb25iwUiNKWDLrharQiZCZ8YkRxqs1ugZAT1aFmrLV2QDWivtbE3X7+kbMl7Mi0rW 63HotbzEbVPeidoXnkNAlt8AXrlxRlfxj7bXD1Udp9l9BYOCEMxpUpUo6GlM1b4uNvNf NFynngaK1XW79a2NNUQLgi83/po3do4lvQOg8pT9JoX0ja46WozgJT7vcz4r2I+ruYSU R3WQ== 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:arc-authentication-results; bh=9tlNaJmQImxCGEgovGBvlohY/2u1zXVnsturf7rUYM0=; b=bsEXGYZDbVwq5uM8oVLFQcX/PztFumF2dWm9Y5tsRJo4NVnJitCUDeyGINGjLcoe1C Qhmc9fKjD/FCSxztUPX4kojRXfPl6mNgkOmbGWDPMNXsxv50p6990/0MxfZMqGyjX+rj JePCV+QrkccvXvDxtjBGvGaHCgNg/dtcPfDWEl2owJBSA2V2fWVTpJWE0ESH3AQA7k+s XBxq9bwhwxOeLAyEuu0scYmOBvIAOviFExtpjvctYzuCHwnoaSVXxMOj5LSlHbh+5Oog ZY3c7asqnu5hcM0VQr9kZAfdMmhG6ie5uHhMre4R/qDBobWL66Mfj/VYfzPPnLFmKIzh 7OTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2si3789769pfa.311.2018.02.19.02.14.38; Mon, 19 Feb 2018 02:14:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752528AbeBSKOe (ORCPT + 28 others); Mon, 19 Feb 2018 05:14:34 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:36599 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752474AbeBSKOc (ORCPT ); Mon, 19 Feb 2018 05:14:32 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0M9RBC-1euqG50Wi6-00Cfi4; Mon, 19 Feb 2018 11:14:19 +0100 From: Arnd Bergmann To: stable@vger.kernel.org Cc: Greg KH , linux-kernel@vger.kernel.org, Arnd Bergmann , Daniel Vetter , Daniel Vetter , Jani Nikula , David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [4.9-stable 2/9] drm/i915: hide unused intel_panel_set_backlight function Date: Mon, 19 Feb 2018 11:13:21 +0100 Message-Id: <20180219101343.2922561-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180219101343.2922561-1-arnd@arndb.de> References: <20180219101343.2922561-1-arnd@arndb.de> X-Provags-ID: V03:K0:syI17ig/669v7CKzy4JLez8SJzddAwYBFjG3JNgvz/oGUinw0Be jMduc6xQvGZcXf5FlO/Az9fuwDT0Z9pjz2hm+coBNStTvRmpHTLaf3WD6BuAVLp360ALxwS EwY6KsAqynyE38Y7GFHA4/+OxlQ9+LDLx8ownuXIcSSnJfUxyFPfjTjj5y3ckQmc9su3kQh lIUYFGIkMGVpW9+Aq1uPQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:XHnaQBslcDM=:bGKL52b3bWGd8VrG42bwGR BPodTtPPRufGNi8aVVZ9plBLLVfZNmjPdbUX57vD/JgF2kkLl6gWTA4to+ymI7U+phwKtUrid mRVCN6bMUXVtaxQHJGTSfaoa0QV5r8+gqo94uv989I2mhbQstXVHzsHKnX3oklXfbkMykTB5+ 7Lb7wMUW0D9XRO//UJGMkLSR9Eu7bUyWAw9TMDOj262DxmzF6poNAhHHdf4HlqsqC5BJOigKW 2/JXhO9EUCNuY9K2nPWGZ/4whsUKdUs3yuby/l6wyFFYRvk/HiWuZWuBugKeUpMCAGKXQzvaP oyAaYZtjDs8Cd+SZTeGGFFPqguEDVHHPYCqwlENjFGa9NEZ8mjq0j44CJXw5O7gj6LvfXShVg fvUgkOQmPfxEecA1yDxGfmJRgwZ5VMin5NzIeakd7Aq56JmFCrXZfkRIJ9XWtAGSYpOycJDfj 0R/RvFL8aSeNBZ7p76qzlAjEYYlTZk/yoGUhAxAkcyItCg25pHMTBZDV1I940+XxO+3lcoXVy sqObtMuHRPw1TGtJyVgTz2gLBZ1zbjdXwb1mtqSv4n1VKx8sz3yeLvgtSOeszIBmF28Qy0ZdJ uoEHicz95JKriYltgVueNobjHWceMpb49SKBgRNk6WxWqpZOqwxYor+ZQ2HxgP/g+6tVDCFit yBZgqLMVke9Un5JIQip56UnSv9UanVciBRTrwtEA/QFL5mlTm+X4xgN5A9eLQkQVH76aKvbFk AWN+WHKIETP1igsczYCU3Y+svOX2rQ9K1MnYag== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit fd94d53e55bd487368dfee9f1af24da78b2bb582 upstream. Building i915 without backlight support results in a harmless warning for intel_panel_set_backlight: drivers/gpu/drm/i915/intel_panel.c:653:13: error: 'intel_panel_set_backlight' defined but not used [-Werror=unused-function] This moves it into the CONFIG_BACKLIGHT_CLASS_DEVICE section that its caller is in. Signed-off-by: Arnd Bergmann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20171127151239.1813673-2-arnd@arndb.de [arnd: manually rebased to 4.9] Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/i915/intel_panel.c | 86 +++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 43 deletions(-) -- 2.9.0 diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index be4b4d546fd9..1cb1b01e4471 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -544,25 +544,6 @@ static u32 pwm_get_backlight(struct intel_connector *connector) return DIV_ROUND_UP(duty_ns * 100, CRC_PMIC_PWM_PERIOD_NS); } -static u32 intel_panel_get_backlight(struct intel_connector *connector) -{ - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct intel_panel *panel = &connector->panel; - u32 val = 0; - - mutex_lock(&dev_priv->backlight_lock); - - if (panel->backlight.enabled) { - val = panel->backlight.get(connector); - val = intel_panel_compute_brightness(connector, val); - } - - mutex_unlock(&dev_priv->backlight_lock); - - DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); - return val; -} - static void lpt_set_backlight(struct intel_connector *connector, u32 level) { struct drm_i915_private *dev_priv = to_i915(connector->base.dev); @@ -646,30 +627,6 @@ intel_panel_actually_set_backlight(struct intel_connector *connector, u32 level) panel->backlight.set(connector, level); } -/* set backlight brightness to level in range [0..max], scaling wrt hw min */ -static void intel_panel_set_backlight(struct intel_connector *connector, - u32 user_level, u32 user_max) -{ - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct intel_panel *panel = &connector->panel; - u32 hw_level; - - if (!panel->backlight.present) - return; - - mutex_lock(&dev_priv->backlight_lock); - - WARN_ON(panel->backlight.max == 0); - - hw_level = scale_user_to_hw(connector, user_level, user_max); - panel->backlight.level = hw_level; - - if (panel->backlight.enabled) - intel_panel_actually_set_backlight(connector, hw_level); - - mutex_unlock(&dev_priv->backlight_lock); -} - /* set backlight brightness to level in range [0..max], assuming hw min is * respected. */ @@ -1122,6 +1079,49 @@ void intel_panel_enable_backlight(struct intel_connector *connector) } #if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) +static u32 intel_panel_get_backlight(struct intel_connector *connector) +{ + struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct intel_panel *panel = &connector->panel; + u32 val = 0; + + mutex_lock(&dev_priv->backlight_lock); + + if (panel->backlight.enabled) { + val = panel->backlight.get(connector); + val = intel_panel_compute_brightness(connector, val); + } + + mutex_unlock(&dev_priv->backlight_lock); + + DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); + return val; +} + +/* set backlight brightness to level in range [0..max], scaling wrt hw min */ +static void intel_panel_set_backlight(struct intel_connector *connector, + u32 user_level, u32 user_max) +{ + struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct intel_panel *panel = &connector->panel; + u32 hw_level; + + if (!panel->backlight.present) + return; + + mutex_lock(&dev_priv->backlight_lock); + + WARN_ON(panel->backlight.max == 0); + + hw_level = scale_user_to_hw(connector, user_level, user_max); + panel->backlight.level = hw_level; + + if (panel->backlight.enabled) + intel_panel_actually_set_backlight(connector, hw_level); + + mutex_unlock(&dev_priv->backlight_lock); +} + static int intel_backlight_device_update_status(struct backlight_device *bd) { struct intel_connector *connector = bl_get_data(bd); From patchwork Mon Feb 19 10:13:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128788 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3330592ljc; Mon, 19 Feb 2018 02:15:01 -0800 (PST) X-Google-Smtp-Source: AH8x227bxHdrAIzwa+DP3XUgNwgGegBCLal2Cbl9Oe+c+nLkUIVjdHYJV0TUycJszgjj4FNvkXHV X-Received: by 2002:a17:902:7682:: with SMTP id m2-v6mr2907869pll.185.1519035301816; Mon, 19 Feb 2018 02:15:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519035301; cv=none; d=google.com; s=arc-20160816; b=1I/NZbYFnfDmZP2LgTrn63CiIJLfKZH2rQUCj26LiicufKcYo947qaNhkdU4m0JnAv DYKABv6rBAOONERnF4D94syYt0QYIXxKM6YZbZ5W/UeFPz1vm7Ni8cOGMXma7SS1mxvO yEbI1X9VJQ8+nY3mFKXioPoQEbIaKd8rptbJtVk6aVA1LH14hJtyaBxLYiAowud9nzWA M5j+MPvhXvmdPLFvA722N73G6Y4XsZ21GrTheyVsxItio4chBFOMF+sqe7XGAy1YOpyR +4zKQ92wPZVbN8yOqZxo4ZiAmVlRqZTKT/Pqu+IoeoC5sreIIuIBLXhyJSvBvhmpLygk 9Aag== 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:arc-authentication-results; bh=3EXdaR8klswLR8IkrfgcsX4O2930oPg7dMD1Fm2rf48=; b=DSX/IeCjHycEDbQuXNanelb02mPUR5fi7a9Re7MXtNZMQyJTUad0C2AvgSx1/kze2a cyT0xO2yp9zYUbj1rnt14xCMmQQt+Px7TKp0NM9R2L3Qme8seEFIj/QPhtPvZP3Ar4c/ hKQEMV4BmhxIHGR+gXWWn99zb43D6ALenXk1cpV+ll/oWqV/1vR5tAHeN4eyg5ohbXMy YpC9QZj9OrbfasixzVBBxMp2Un6R/dN5YZqhaCGEDpm/T6dO+f69ZCniO3OJ3EDavtcE Oo7SJmsN18nlyDwAaBLcM78ixayN1EQQg6i8kj1niuz6GG9XQWsQ6+l9yXES5ZXfgaWT N7YQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l36-v6si3835885plg.667.2018.02.19.02.15.01; Mon, 19 Feb 2018 02:15:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752596AbeBSKOq (ORCPT + 28 others); Mon, 19 Feb 2018 05:14:46 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:57989 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752474AbeBSKOn (ORCPT ); Mon, 19 Feb 2018 05:14:43 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0Mf6wH-1f7sqX3Ls9-00OZuh; Mon, 19 Feb 2018 11:14:40 +0100 From: Arnd Bergmann To: stable@vger.kernel.org Cc: Greg KH , linux-kernel@vger.kernel.org, Arnd Bergmann , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: [4.9-stable 4/9] binfmt_elf: compat: avoid unused function warning Date: Mon, 19 Feb 2018 11:13:23 +0100 Message-Id: <20180219101343.2922561-5-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180219101343.2922561-1-arnd@arndb.de> References: <20180219101343.2922561-1-arnd@arndb.de> X-Provags-ID: V03:K0:a7vjXUQbrfLAs8RrB/FR6oKJwbxpj3OpY3fqd2uZTcuqz0pmMmO uCeETK/I3J/yklsDp5aZM5vkmgVzNK6BYygow0iowzqxca11SQmDUs7RuXdIayEvQVy9iKy B/eEqCoc/a8HSX/jNMoeCyq8cyoMiA8AHlidWvGaWXqr+gz0gsZA1bvJxLEIBqQzvWNxKsk y4oKoMH3Gtz6w6Hdv+fhw== X-UI-Out-Filterresults: notjunk:1; V01:K0:S7avwsTmh4Q=:DnZ0WXJgMnPCo+nCmBCX0M xfZTMdg3l0qCJAnseO4sF7IMg36CC5Q5U9taziUEIgiQeWVTFc70QFnZbonkv6mDfoAae5AZy xK4FDWXXWN0qyKYfIghuVIRQIKbqPitdFeNav+oQDpiiw4487LNS+xm1xvldogRrLkuBX4Dfs famku1grCL3y6ZBvQJao5cIveY+hD9BC3pRrfSjyYiKXi7Mu/u1XL1le/LuyykUBkDCxPmpzQ LvjBUiI7B8rQlO7Vy5DkzwVXaZ7WnBrqExP3Q6tvka7GO5Db4Oz2oGKJAl3An5fpFZh5Bv3Zo xWDkNK/1625AInuwwjaF2UaHrRErdpnKVWE0ZFpLBMpF6oFnc3OjEQrDkBv/ScBCA4/YDWgK1 M3VUMF3/F/Sp9y/Pi+7Otkt4lDANmrmVMb3C0sKyMjJ9H2CkD8owNPVqEhnr6iVBdVD95MMQ8 NfNe79sokfqX3HBsaRuG72E43pq47h4PKprPIvAkRwhhYMJYlggv7jb1mRDxWa7VCjmM17sHm h7ivSoeS5z6VkWDS90v4fHsYqnutusTUs77wflSqO36wh2B9KR6OHpvbkocJe03q1U4Tt6xVn mRAaGotAwEfeIpwLM3GDSVvctnSRTeJZEIkx7KF04y4tTtIjvY2SGXGUiiHZCvcgdzqIW2OsH 068tDTe3rVD+fRtYeiMVhoJ5cDK8GbkbW+FfA6CSqPqeoTrP0pl5C7xwagV26OXv3vdkPCGfd AfblSubCEVe6S/iaJ8l/h1W3Cq3o6e5zlY4JgQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_ELF_CORE is disabled, we get a harmless warning in the compat version of binfmt_elf: fs/compat_binfmt_elf.c:58:13: error: 'cputime_to_compat_timeval' defined but not used [-Werror=unused-function] This was addressed in mainline Linux as part of a larger rework with commit cd19c364b313 ("fs/binfmt: Convert obsolete cputime type to nsecs"). For 4.9 and earlier, this just shuts up the warning by adding an #ifdef around the function definition. Signed-off-by: Arnd Bergmann --- fs/compat_binfmt_elf.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.9.0 diff --git a/fs/compat_binfmt_elf.c b/fs/compat_binfmt_elf.c index 4d24d17bcfc1..943be5ecfcd9 100644 --- a/fs/compat_binfmt_elf.c +++ b/fs/compat_binfmt_elf.c @@ -51,6 +51,7 @@ #define elf_prstatus compat_elf_prstatus #define elf_prpsinfo compat_elf_prpsinfo +#ifdef CONFIG_ELF_CORE /* * Compat version of cputime_to_compat_timeval, perhaps this * should be an inline in . @@ -63,6 +64,7 @@ static void cputime_to_compat_timeval(const cputime_t cputime, value->tv_sec = tv.tv_sec; value->tv_usec = tv.tv_usec; } +#endif #undef cputime_to_timeval #define cputime_to_timeval cputime_to_compat_timeval From patchwork Mon Feb 19 10:13:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128790 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3330748ljc; Mon, 19 Feb 2018 02:15:12 -0800 (PST) X-Google-Smtp-Source: AH8x2265YuwWoVeR3Y8v6sRSuemUKXBCD/IL1/gnfcK55YXMcOjfCGsQw2tIOPbnc0TvhhsWgvNm X-Received: by 10.98.97.198 with SMTP id v189mr14306623pfb.110.1519035312575; Mon, 19 Feb 2018 02:15:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519035312; cv=none; d=google.com; s=arc-20160816; b=uCnmYQWaI/Xs/LQr2z+9rBSyf7Y98e59z9kWTD+Nfkcr/jDf8yS8QY+pwTRYKY/omu M9njkklgE2FoKi/PhaZ3AAsRbu5j06Af/mxURz0fEJom84MWGgWBOgUWJCRai2WBo8zY kZMNAz3viZILrolswy7am8V3F8V2OrS/if5r7BQbCN/+NVO8GT8HPfnSJkEBWsWm/StR mCLcKKbLMGV3uwRpmLE+nPeSZzNzgngG0d9Gcg21lkGFJ9ZhzO40sMp6PT1empYMO77k Akzbo4bO/kDfCUg9c47wfutNahy3PQ5j4A580Jt/KeQP5p/++aS/wU1xXVhH6h8gZT+D JH3w== 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:arc-authentication-results; bh=eVXrqTXtxEG9bmultQsB61CyawsCKv0A6MAfHntmcVY=; b=hulDHZCRypXm8uVRaRFwXvZY9ylLuZ4HMo+t/7OBvQVYcNs5YVrGn5saFGTloh69I0 um3Lvqc/WcDHCiDKUsb3h1RS5WIvR9zeKZTSrvVP9vlv/E9DtlIPbkHn2fJBz7qUBE1F J/UCgurs/Sg4OqITELxczJd7k53U6Bzi8TCEQQtePHsE2rVKgfB06GMoEJ8twZ7DXoac dh0NRjjt2k3Jdzl0CP5xA9t2RoyRiREuWrewDuw4A6siiiXd2MzUmKngFEWrJ36bgNoV QhDyVTuhiqtxtpaFtmUhyPqUvATKzbZEhxcpjKj9vqq+iFy4UUP+1y88WqVXESONm56e NgHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c24-v6si8764307plo.608.2018.02.19.02.15.12; Mon, 19 Feb 2018 02:15:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752651AbeBSKPJ (ORCPT + 28 others); Mon, 19 Feb 2018 05:15:09 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:37105 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752244AbeBSKPE (ORCPT ); Mon, 19 Feb 2018 05:15:04 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0MCk22-1evvgG1uYE-009NOO; Mon, 19 Feb 2018 11:14:50 +0100 From: Arnd Bergmann To: stable@vger.kernel.org Cc: Greg KH , linux-kernel@vger.kernel.org, Arnd Bergmann , Mark Brown , Sasha Levin , Geert Uytterhoeven , linux-spi@vger.kernel.org Subject: [4.9-stable 5/9] spi: bcm-qspi: shut up warning about cfi header inclusion Date: Mon, 19 Feb 2018 11:13:24 +0100 Message-Id: <20180219101343.2922561-6-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180219101343.2922561-1-arnd@arndb.de> References: <20180219101343.2922561-1-arnd@arndb.de> X-Provags-ID: V03:K0:fNFR2SkUFidD6DOd1hU5AvN+G6oI/N4CzysfeBlm1iWZIRCXOjG lzSiGhuoVlgPkivX+6stIh5N/Jf0u9LytIbyq28exIKTIGw14a9UrOiZjRCSTzRu/lGbybA qMpS3H3sDgUDW0uUAzzK9bJCz4LO3ub7HvBrnpH9Jt+g3czQLb4vxAeeO3LeRPwrRa/WG1s 3EAsc7gB9arOjNrOzBm3A== X-UI-Out-Filterresults: notjunk:1; V01:K0:AY+2YVoWEbo=:fcLX51cy29RDGkP2X7ABTd nTnjHh6+mW6exPRfg9cVmHDnu5imP2UR6MDsWOAfSPGSGt3ptNr+bR7nQNA7uBv0gHt5Kkzu3 6h44G5xyrlDmlhfZ/WS9mXJE4dqi48R9GAEnd9iSHbJuf/y3h2SFL53eV/WSl254Yt39LVSJI 8fLuN8MgOm4wBFqWi8ohl9130IwniMzh6PAfyUcdM3BIAObboHm/9NQWClD6RHsVVLv2iy9/8 /Vsp6EUx6f2ZD/7GQKhcEcEHz3yaKxy4IK+uwbLboPJV/6rVwoRc/uB03051qq02Z4tRM5Udb 6QZsYIIyOMilbBvCLOHqPBKWF16pKkYeAh59SlzSD6TQ2nD08ER2vy6UwJkgWxXAInaMCP7xa nsZx0YWb0wgBvPMtsAGSfUc2MGZRRkOIcDhhr4ZyGiFqvKG2LG/aQoBjRwkUmZkbjAq04a96B yQH6brhEwlPXZdYUft/jgnkxVXluvhrz8M0SscUBsKwJnVwc/oOvfhiBnJXVzaz+hSJ4gjt5L NRZaSu6ll5VrjSo2mUmky7CfrS/hwEPxPfz4LnaXqReKE9dQqVVlJFZER4Co5oYG4hsKsRWHb 6chw7mabsJOmU6UYtT/7nJfybMADygwUaOA45EhVBex9Tffe1WNlI7bboKiQLruORZOfqBocc Xnqrg3hMxQZ0y5aqLVk0FLgN8mbZmK9GBkDsiDcZj7vm925RcMUElyz0+IfhmSwK5GXrPPAai +yRLugm2oY5cEDT7lpKTmSFoJQ5Xlphf+slcOw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_MTD_CFI is disabled, we get a warning for this spi driver: include/linux/mtd/cfi.h:76:2: #warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work. [-Werror=cpp] The problem here is a layering violation that was fixed in mainline kernels with a larger rework in commit 054e532f8f90 ("spi: bcm-qspi: Remove hardcoded settings and spi-nor.h dependency"). We can't really backport that to stable kernels, so this just adds a Kconfig dependency to make it either build cleanly or force it to be disabled. Signed-off-by: Arnd Bergmann --- drivers/spi/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index b7995474148c..0e7415f6d093 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -156,6 +156,7 @@ config SPI_BCM63XX_HSSPI config SPI_BCM_QSPI tristate "Broadcom BSPI and MSPI controller support" depends on ARCH_BRCMSTB || ARCH_BCM || ARCH_BCM_IPROC || COMPILE_TEST + depends on MTD_NORFLASH default ARCH_BCM_IPROC help Enables support for the Broadcom SPI flash and MSPI controller. From patchwork Mon Feb 19 10:13:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128789 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3330624ljc; Mon, 19 Feb 2018 02:15:04 -0800 (PST) X-Google-Smtp-Source: AH8x226gvGn4w0w9XT21nV+AG4f3bc5uuh7su1jkwGdDB6nZ01YFToTq+rNMjm/iBHdnQ4OVbepJ X-Received: by 10.98.231.26 with SMTP id s26mr5533263pfh.210.1519035304829; Mon, 19 Feb 2018 02:15:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519035304; cv=none; d=google.com; s=arc-20160816; b=pe2Lr2hJFouFbM66r5+b9yECl1zfO4shO1gVD1TdBvdzDY4rfp2NueCV0Koy2TNCLr s0tFeuk0ju/KIgdOXyLyjyUfK23ynWRt8/AnDIe3vmzj03cjVAt15dVIqQ2ixCsLzjlh 63q/tI+wQg19Ujx5CgCZoiM6p5jcoD6JMHXXb0SHtGWQGWn0O57ypW3lrOXy0U1hOVNp cLyHm7GI/EWiAir4fN5f5+aBFLKtOo63Oy4CSIyq16da+/GWrB9L70z23OXz0eiO5zdR ++lHKaaCvsUNAIgJk/4BpuffR6O4YHk/izc4f+dgt/AZGnxOfMIl5Oy67+pOfjp/IJM/ ZUwA== 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:arc-authentication-results; bh=Z0S1j3hz8v2hsL211MhMKIP9Xvjd89cEAimb7ZObk00=; b=c4jN5OM6sAPTp4VPFlwyc95hjK4edYouGuiuUN/A7FNbpqpmQW+FBnLW8SEKLWVi2G q21q3Nk/kQPdMtnD4X6ma8MGi9DhLK1jSpbAKhAxrrpAeCCUHJstbnk8n622J7qu6bjh ql+mULPKr0bdg1+gkLIqSzSiAJ9QMVZGvP5XaHuymTRgTEwyhmJBB0nntD0yRvM6Y3b2 ExH65SAezcvf7QwIBw4p3Zg0M7SylFY7LQr0Hvs1z/D6uTtcZQFfEEkZ3WTx2lfPzGaG KY5wU0T2/uwUVdteithVUhC/HWEtZqVlXgH9ot+Mkg32xuE+YP0aH47WNUorpN7BMc1n ZVcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f64-v6si3732911plb.377.2018.02.19.02.15.04; Mon, 19 Feb 2018 02:15:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752638AbeBSKPA (ORCPT + 28 others); Mon, 19 Feb 2018 05:15:00 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:51127 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752244AbeBSKO6 (ORCPT ); Mon, 19 Feb 2018 05:14:58 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0Mh2kG-1f9njU2iNU-00M74g; Mon, 19 Feb 2018 11:14:56 +0100 From: Arnd Bergmann To: stable@vger.kernel.org Cc: Greg KH , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [4.9-stable 6/9] idle: i7300: add PCI dependency Date: Mon, 19 Feb 2018 11:13:25 +0100 Message-Id: <20180219101343.2922561-7-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180219101343.2922561-1-arnd@arndb.de> References: <20180219101343.2922561-1-arnd@arndb.de> X-Provags-ID: V03:K0:g06e4qV9xrkpekbTSExluJ0u5GD8tMYgF0KeYa1B3rWVU/HKDM0 ppSn9OY6zbXrM9/19aawXdQGCCAeLJouxaMRk+OBg4InxLhF1H3nUKt7YDqPaSIUZnxRpip aRUNd9k63KE3w38NGAsx7bXvo0rkfxn9+UytG8Qe5xNc+KkSD+Rls0CgkVVnsU6skgiAqd1 ydPyeS7c9G1yDQlE+EAEw== X-UI-Out-Filterresults: notjunk:1; V01:K0:HMuwi/jSmFk=:t4cXaZpJRdohHwUWGk+lkm GEZ7CeuoG9ItVkw48ryUKC4qcNvqiPD2mEhG1qfHewoJDQvJVF/JIwcY9RcZvde3MwDU8nDJb CEWTCt5cAFdJ2zpTxAa+J5nM8PlE6sumTGW7kc5fv7aa/P4tRJEsEuHOIuTz5XFfJa88WE8nO 0jC0kHooDZh64RApj2a69A4J2loj+rpdj5GtY7+6NF20pTyfXRUx/AcZIPnh22efU+zWynRWH +279IOcJNY6R83JoqzEpH4Ek41YHQMqFSZZwLunw9VegAhhXxrWma6RTpTgXIj3dvcvpN+hZX x52Gd/O23d+3C96177JnddDaNXGAv3Z1cAGpfXZAvE/BkubRQ28U8jiREOrlngThJvxTbmbCP AWS0FzkZ9Lfu2LT1Urbn1dytiYx4cOdQhlckxQdpdrNxGpFp0wPfwEd/u+Uaxbawnqvh8m6TE CtX+Q+9SmRokpCOyKvMN/o2EzjoC450/hs8CFSyLpkj4N3BiRMl+m1ot4XibmhbudP0kdrhyt uD0/7mBREcyIf+wG4o9bTDHt1i8Ch/kb28u/Lk2lZjFVI+sYodLl0MiMuKVxSnkOYczIQ4ir4 wEbDvXQghZ5Sc90Xjfk5xQ3VPrpVSO65vbs/nVM9+n8cVLCdc1M4quHdpZG33Bzw1NBdaJ2i9 QT56dFv3SaeGRSG2y6vDAO2GcZEkOfgzepib98hyw3cVBWOYkpVuo3biVjERUOB7NKwgAA6mS 3iKiwreFNtao8XjymC5WVVHoMwvPXCk3oHy0hw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org GCC correctly points out an uninitialized variable use when CONFIG_PCI is disabled. drivers/idle/i7300_idle.c: In function 'i7300_idle_notifier': include/asm-generic/bug.h:119:5: error: 'got_ctl' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (unlikely(__ret_warn_once && !__warned)) { \ ^ drivers/idle/i7300_idle.c:415:5: note: 'got_ctl' was declared here u8 got_ctl; ^~~~~~~ The driver no longer exists in later kernels, so this patch only appplies to linux-4.9.y and earlier. Signed-off-by: Arnd Bergmann --- drivers/idle/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 diff --git a/drivers/idle/Kconfig b/drivers/idle/Kconfig index 4732dfc15447..331adc509f3a 100644 --- a/drivers/idle/Kconfig +++ b/drivers/idle/Kconfig @@ -17,6 +17,7 @@ config I7300_IDLE_IOAT_CHANNEL config I7300_IDLE tristate "Intel chipset idle memory power saving driver" + depends on PCI select I7300_IDLE_IOAT_CHANNEL help Enable memory power savings when idle with certain Intel server From patchwork Mon Feb 19 10:13:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128792 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3331096ljc; Mon, 19 Feb 2018 02:15:38 -0800 (PST) X-Google-Smtp-Source: AH8x225g7/9piTg/vgzA/PhokGtURNZf9areQMfTg6j771K0J/y4c8H3BvvwTLTtXTpxp67yHJTP X-Received: by 2002:a17:902:7148:: with SMTP id u8-v6mr13314772plm.91.1519035338257; Mon, 19 Feb 2018 02:15:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519035338; cv=none; d=google.com; s=arc-20160816; b=uxA55e0lPi4miMIKb/j73ghSj50ItiMg25oXVmUcm1MZ3eOsqACi/Afl3NTj1tXtSO QiDY8M2EmUYODZCyw9j8rTzln2vNeoQkumnCky1TLuojgZh7cfldSKuiB9frXmpnQa9B okwEHjf9qEEtxpJ6oXUlNToy6NODCWmtETj7cPmCdSkP2lVmIhYO73WkhB2VDgCd/azr Vj40EJVTXU+FCxYNvuRtlaAeHZgcMAlNq2w8yAodPiVPHU+p3QDscuJx2u1C4TpFOmHM 9k7pb0n+BWhaRL6iurg4tJqjrmVxuYMVdgIpsCb8i44jCFBH9NYmHNmusVadEg013ioE eLIw== 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:arc-authentication-results; bh=P/UfdSvPZ03bihsTdWgl5txTAPLLqklPc+B5niuZn0A=; b=AzAYzVcHDHg6hcWbPx4iuMt8oaaAm6/SziDBoPIuC1GpHWz42xx+gUpxSIx9bki+Ht MdsfftVupiq56JWkze9i2MQDHTKQbkh1I54dfgDeGEdPyISjuvFfKF0bVR93cX6Vtykx +GayacyHH06vdaaGEldxMc6og8QELTrgUEbUTNeVA5ySn+pQkXHDAFcPIgIQAMzVJV/X 7GVJS2M5CF8gewySJln2bg5kuUDD1qKH+o93VV7x0OJB8Ae30KgW/Ujxh1Yc07uvczYg 8WoHryiemomyQROLvPndFB9A+PvPbQ/XfhneXmdWCpmLYxNTNS0sPbvF99Ne8EKWetne 0faQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1-v6si4736343plt.67.2018.02.19.02.15.37; Mon, 19 Feb 2018 02:15:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752688AbeBSKPe (ORCPT + 28 others); Mon, 19 Feb 2018 05:15:34 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:57593 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752244AbeBSKPa (ORCPT ); Mon, 19 Feb 2018 05:15:30 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0LuWiy-1eeoUS0A2y-00zpYU; Mon, 19 Feb 2018 11:15:04 +0100 From: Arnd Bergmann To: stable@vger.kernel.org Cc: Greg KH , linux-kernel@vger.kernel.org, Arnd Bergmann , Will Deacon , Catalin Marinas , Ard Biesheuvel , Mark Rutland , linux-arm-kernel@lists.infradead.org Subject: [4.9-stable 7/9] arm64: fix warning about swapper_pg_dir overflow Date: Mon, 19 Feb 2018 11:13:26 +0100 Message-Id: <20180219101343.2922561-8-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180219101343.2922561-1-arnd@arndb.de> References: <20180219101343.2922561-1-arnd@arndb.de> X-Provags-ID: V03:K0:SAhe7T3IVieToXWBJGmlA4s3NSyYXUetj5yu1WjtIftver4eToN Gpk0Wl36N54ZJK797nhfl6b+k561922877V+bWEitopve3yGKBuJoc/M4vU/zKe0g4hn20I P8AGWyOYgKlOZa1eJeUsEMFrQJtLAMzR0p30f4nMxZTgp7d0PWqEEX8DwncqguNCJAHpy51 GJGOMvysaYv93OAHlgPOg== X-UI-Out-Filterresults: notjunk:1; V01:K0:HtneMOQWNCg=:3SwsiIrMSosazfd1sRbn1x 4+yqk6PI0GC0ueWnH1K0caqiukjBy5nk1ljaPYa9W2vPF8Wf3O95PGMOiHKOHnL5Bf2PmGUF2 WoKjfPZ4G9U9JPUZT/V3a9HuWI/fgqsTe2feEAz+pLq0/dRxgWyWPdV3cdpXBJLMRziMDxpYm 7luVv1KBfpHPU53R0LjOFHE7bw4e66KP5YcdXlNYm+QwHKOJ8aEodumtYLrIdY3tM1WuoktAm MLJG6UK5PtcwwgcfH0WT8zqZDwmKwChrjrxDG+YR2OW1r8w1vhEL10GKRszw1KOrbHqGMtK/S CzpGxPv/ZAh/7kYokaNzF/ej+g3nrNCSfZTGnmw4RTA51bOHY8PvPMzpyWd/LU+XqdH8CEsPf 1Uvu78uNcWTeG42d1vqus7SrzK9+ZpE9wVcpq9/Ytel6HfaVXdT8wKt4+v3tmwtGRkbqEP/n3 GLprks9WKqS5/4Ml11g7z1RcSfovW5ydrQi1uscIRi4PGOXZZU2gc6P+MBbfnc9N0+wxOKCyn /q3gKwwDC1M3O1X65P09zfyyEFzGcgeFpzKS+HsZG1FuYBhTdDXcDJH5LVo/IN/skBvQl55Cn MxU29RpJcMp5QOJQLatnIGrdDeGCjPluPqm9iZSHAM10tXCmj+NgiL+ckVr2aPyg3xES9dBUp gtDWwJvUjFK1p1I4XkjRutMbVxR7t4Te1CgtOQ1oozOOEyHHhBz7rceO6aY5lnSGdCXS/Y+e9 ILX5myZpi8BVD3OoAxeP3SrlGwzH0pwN7BdrAQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit 12f043ff2b28fa64c9123b454cbe30a8a9e1967e upstream. With 4 levels of 16KB pages, we get this warning about the fact that we are copying a whole page into an array that is declared as having only two pointers for the top level of the page table: arch/arm64/mm/mmu.c: In function 'paging_init': arch/arm64/mm/mmu.c:528:2: error: 'memcpy' writing 16384 bytes into a region of size 16 overflows the destination [-Werror=stringop-overflow=] This is harmless since we actually reserve a whole page in the definition of the array that comes from, and just the extern declaration is short. The pgdir is initialized to zero either way, so copying the actual entries here seems like the best solution. Acked-by: Ard Biesheuvel Acked-by: Mark Rutland Signed-off-by: Arnd Bergmann Signed-off-by: Will Deacon [slightly adapted to apply on 4.9] Signed-off-by: Arnd Bergmann --- arch/arm64/mm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 05615a3fdc6f..d5cc6d73c2c4 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -479,7 +479,7 @@ void __init paging_init(void) * To do this we need to go via a temporary pgd. */ cpu_replace_ttbr1(__va(pgd_phys)); - memcpy(swapper_pg_dir, pgd, PAGE_SIZE); + memcpy(swapper_pg_dir, pgd, PGD_SIZE); cpu_replace_ttbr1(swapper_pg_dir); pgd_clear_fixmap(); From patchwork Mon Feb 19 10:13:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128791 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3330930ljc; Mon, 19 Feb 2018 02:15:23 -0800 (PST) X-Google-Smtp-Source: AH8x226PSKGsI+1GQLUt6rsjUHupRx9Gy5gFgNmuznE4QP2wMs+Ewam9Xw8GLKqc309BKKZ3Ujkk X-Received: by 10.98.204.69 with SMTP id a66mr6887662pfg.33.1519035323530; Mon, 19 Feb 2018 02:15:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519035323; cv=none; d=google.com; s=arc-20160816; b=Wgp/QSkEydMP/G+yLQMXt9z/1EVDs7JCOefHHKfyW752Aazn44ztKsoHk8sXUpTh30 AeeyWxdN0LCUAfl+q9Krvdr9dJCRTUF5aqc1MOSsC6kisX37Uov7El6/IUFMd1RmXDqF b5jcJMmz6qiclHiNMbKFik06OLkiBhTiylb33XXPogmVJS2RKJG8MRPyRIvZcgaEi0GS llkhJaG1CmtHgUgFM4q/q8KeuZM/hFzTpSli9Hl9eQNeEk5SEX/N7GY11yQK6MUA1Q0y xz1XTUHCrVIqnWWsM3tbGAs6eOyiLToPJtZAZMr3gWhVnuGcOa3Y/dByOILGWJq0wL7u UgMQ== 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:arc-authentication-results; bh=MbZBj/uXVsw5CuRAPUWEux18gYWqwLTcdZIbHBCThvU=; b=imB73cSELOML3o5ekuoHZ4huu6yjDAlWugvl5ttuv4FaF7oQ3gAUOSjQ0Zj6GO0bQP o5TC/E77+ILi46Ei2Q5RuY3u+mrTPZZnzbgQ+1bk3z8jjlL3yQgQplJpPB7y8S0TUI1C DtW8slSmBUq3cFREf7TEFulLOmZBODT8exxzu/FXXhlzt0usAK7V38aYBpQTIWIOupK2 5XufEprtwVDJHtfmWM5MxbyLO8xrW+x0fsJsFEmgHPxB9y9fnoimZ5jzQZ2wZ6VNvKrh 5j3hXlxtewL5m6xZjMeCAllHft6BZUFlWx+3YTfyZyGIKANIdYm1ibK3qYHDF02rvhVs rrYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si5991098pfi.35.2018.02.19.02.15.23; Mon, 19 Feb 2018 02:15: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; 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 S1752672AbeBSKPS (ORCPT + 28 others); Mon, 19 Feb 2018 05:15:18 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:42061 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752244AbeBSKPQ (ORCPT ); Mon, 19 Feb 2018 05:15:16 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0MY0TD-1fJONE3P4p-00WnvN; Mon, 19 Feb 2018 11:15:11 +0100 From: Arnd Bergmann To: stable@vger.kernel.org Cc: Greg KH , linux-kernel@vger.kernel.org, Arnd Bergmann , Felipe Balbi , linux-usb@vger.kernel.org Subject: [4.9-stable 8/9] usb: phy: msm add regulator dependency Date: Mon, 19 Feb 2018 11:13:27 +0100 Message-Id: <20180219101343.2922561-9-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180219101343.2922561-1-arnd@arndb.de> References: <20180219101343.2922561-1-arnd@arndb.de> X-Provags-ID: V03:K0:iigpTvVPK3Wr0NV/L8CQi7004USg8TJWd8yIZB55rZVkogSbbod z83GZwKgvYj5Xf+9Mmfny9nJjIatOf4TWUCi9juRFJRAoc9Fa49ne4lqPsorJ+SYOb+cMzM gKRnsXTw8WNsrWWBjhrwgqhz5mEJl1o9Ez0IGzk8C/mYAEtQrttLrGRwRzKlk+ErMdio1zq AOLRFkb2fwaofH63nb4tA== X-UI-Out-Filterresults: notjunk:1; V01:K0:R0ygRDGouG4=:LN4tgf61Hu6kTa/xPpqowI J0K9oesN311D1kPp+0pFlF5/ZizNj9v9pWe9eJBVTq/t6uAKMkoygbf2Q9A3jm2lDDrejfZFv 3IKg1V3IAHKNcIYE7OzBvDJmbGX1dCQV8pAVo9X1RXGSr1J2LV/kCaPFaHIwZuQM8Af0xw+tC Gq+edbm2JifEuOYuTui0qxc9j2dbwWRo2mUW5wnyi2NOmqSObgb4Loqdc8HpjSugYFpyyqgJ1 jWuaL1vAx445GFaKK44dqt1iFDd0GY3VogZz4HYUQf6k4hno2gvWnApIhS7lws9PyZHf0Pj5S wg7gRcYWsFO8WjXWEmqQftswsk+2Oov8HjzGx8qBXKKNjY+jhH8l19IAPNZldSzCL0YSHQKaO VGI7HQW3/EKMuTgDqPHMfqXZFqJMu5sjZEGNB7/ox/g70JPYuqf4kHUXFB5aFBNzy3AtE9tKQ PZjSqqIdziiglE/q0PbcfwspQZPfO3wpx7j3MHnlhKngjD+R3+jzoGFp4sM6F6NiokMnwq4w3 B8/nqRpySsoUBfBEVL/i4BkJyq/8ENK1Bh2IYi0uOnyAjvVwABLqc9Vm5FFFToTcDnYVYlpFk k/ykGcicTyvQRsQoK6uIttY/I7HlqxjD4J2+6daoGLveaMt0122HmI3zDg7u9721kf4IHrPt8 nzIIo7alsHqPL9OFqTYX+hqRlWPbVKhbrJDbu/6xwMkxQ1ZO4k/0/qiWiW7pGLavp1cj6kMFU /AlcyZ50soTNBOyAmwE72tVFy551CNeHpEy8pQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On linux-4.4 and linux-4.9 we get a warning about an array that is never initialized when CONFIG_REGULATOR is disabled: drivers/usb/phy/phy-msm-usb.c: In function 'msm_otg_probe': drivers/usb/phy/phy-msm-usb.c:1911:14: error: 'regs[0].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized] motg->vddcx = regs[0].consumer; ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ drivers/usb/phy/phy-msm-usb.c:1912:14: error: 'regs[1].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized] motg->v3p3 = regs[1].consumer; ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ drivers/usb/phy/phy-msm-usb.c:1913:14: error: 'regs[2].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized] motg->v1p8 = regs[2].consumer; This adds a Kconfig dependency for it. In newer kernels, the driver no longer exists, so this is only needed for stable kernels. Signed-off-by: Arnd Bergmann --- drivers/usb/phy/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index b9c409a18faa..125cea1c3c8d 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -147,6 +147,7 @@ config USB_MSM_OTG depends on (USB || USB_GADGET) && (ARCH_QCOM || COMPILE_TEST) depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y' depends on RESET_CONTROLLER + depends on REGULATOR depends on EXTCON select USB_PHY help From patchwork Mon Feb 19 10:13:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128793 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3332297ljc; Mon, 19 Feb 2018 02:17:07 -0800 (PST) X-Google-Smtp-Source: AH8x2252oXUnI0q9Q8oHVkUc2lU4ynaB51NUJWBCK/HSeuesez+UpV0YbWiE1Fk8Phuez8PRUJlD X-Received: by 10.99.181.94 with SMTP id u30mr12015822pgo.205.1519035426920; Mon, 19 Feb 2018 02:17:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519035426; cv=none; d=google.com; s=arc-20160816; b=riAfO+qYxS4WWG+0L+g0BHs8Cd3lkihWe1tHaW7YcGi6SVURq3FIDZCxvuIV+eLEHm li08UqHVw5pLFaUsPV8c4o+H2QpRWl3Y3kHTGl20flBXD+NkaiSCHElvspxAGj2h9MQr lpEApKItvtUXb/cASYHUIqzVaqeo6/Tde2xSR++EapRadjegUr1gPaIrpdsrnxWbkOwX MCRxYfrgowlEy84oNqIYuni2iL11MmxjtjnAA6PhlJxy0Jvq5XEAfXjON2i8xZBPiB7k y4D14LkzPJntigBJUIrq/rBaleq1Lswul5f02Zywy6N2hNDVefYPM611tosHH2xGYlwE Jjaw== 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:arc-authentication-results; bh=acPV9+Vvii0MQv+6zcfARsxdyUCgSMkykczyp8FBWNw=; b=EXhmeqWCdFOlSho3oic1B6v0YSNB/J3m7sa9JAaz8KhK6hpRMtVdoAzNHd2XLEF2AT Ttskb0ukgZosvSC4loG9VT9L4EFifUU/VNRdbUsOoI2pAJFBbEbvBT3ZMoB+QArgcI2P QBO7DwFziFI/XDvwtXOcidG+8xPP+Cb9ip5hdA3yQwUhX2+sCPYZw6+A2qM/Y3qTOcCR NFZaG6Bc9Dlw3OBBKeqQUkCPW/bczxbZrZ942KRSkfpG8vDRo7zCOa+tWaBb8qDR6IJB IMILaPZWbwidoZ+q33TDv98nMT0dyzGSkUU3kyfUyxtPmq9eJN6nSmjKO+Lk6embnPrb kw2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x4si950150pgq.11.2018.02.19.02.17.06; Mon, 19 Feb 2018 02:17:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752648AbeBSKRD (ORCPT + 28 others); Mon, 19 Feb 2018 05:17:03 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:42783 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752340AbeBSKRB (ORCPT ); Mon, 19 Feb 2018 05:17:01 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0Mh2kG-1f9njR2rlg-00M74g; Mon, 19 Feb 2018 11:15:25 +0100 From: Arnd Bergmann To: stable@vger.kernel.org Cc: Greg KH , linux-kernel@vger.kernel.org, Borislav Petkov , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Arnd Bergmann , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Borislav Petkov , Tom Lendacky Subject: [4.9-stable 9/9] x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix preemptibility bug Date: Mon, 19 Feb 2018 11:13:28 +0100 Message-Id: <20180219101343.2922561-10-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180219101343.2922561-1-arnd@arndb.de> References: <20180219101343.2922561-1-arnd@arndb.de> X-Provags-ID: V03:K0:miF91a+nOXIMpHw0LqA4YS6FMvmvDqfDx/QEyBcZHPJ2KQxRIKm OEqMmjZuawoQOR1NyJQpXNYAZ2aj1qaYmqZwrEbC07h5sALNZK1i80TKZRwcXed19SpFq+I DBKJVY0JXqVllr1kCUEBNEHBmjV6TiKMbZ1vvhAWCWrjzz/ceOLoCky8QfPnKVL69bqoQCp oHHNu6Ix9kWJgBoybyzxw== X-UI-Out-Filterresults: notjunk:1; V01:K0:4rg4hwcvZ60=:YJTNypg7s12hmv9xz/iRSG 6j6J1yhwta+h8rB9oFkXWtHJ1HbHTeB2eRfohjNLxY+AwuqPtgYp/RG1dMDbGw+vVZ1VriX1W 339HuijABq5NqomorXzkYpl6Umxqf9j9MoGuZWzk7FjdXGhDSlvl0+Sumc/ULAqfQjTMSaadA /eV90d0bTPAr3YTzc8Pj7cmmsgJoK5urUbRXEwJbR78UnLHDjj+7sIjjCAgNNtF3V/NbiiPI2 +lVrxQv3KqvsiHooJep4WTQrvk1No2V6WkQmbi0OWQHo9n3RIxFe+OSA2/rsCbVdkpRjtZI0F R+O0FdYK7bTv+wG6n53wTODCxWEoo8DWctdDB4/WY02sQUI/IOtyGdjY7il1V3RRb1ggXGL9h H2FTQO/8j2T4JImI4GL4fuH6Y/LIJ7zAHpPWENGKwCMoZDZEJwBqSKXpuDwWsORD3uFb57SiU /e/k9/PI1ZmnrwBunN5M1Ow7A3eUIM3SCUCA6/YUGyvIoVfjTA+FpyexMyyaVc6aRSSsKsY5S 73rYZiwechNFS9AkjmhYtCM2Ei89DRASN4Joo70jbkDLkRQvxoc6S9CE4F239D8rcAnKPBycs LyEQyPstiM8gVW3fWB8MYXvp080zQKULW0KiI4UBsMgfwTJD1RlATH+oAl72w0xN2T0ugrJs6 CXcLcniUQ9HeZ75ycm3adT3/M3OpHOIiG49uA4vUSh7clthc6VfU7+Cekt3kZMGuecKNlUg+m OXUsl3Nu3oqDVWgHo7j06k0Jmz5PHUKmCAlxPg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov commit dac6ca243c4c49a9ca7507d3d66140ebfac8b04b upstream. With CONFIG_DEBUG_PREEMPT enabled, I get: BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1 caller is debug_smp_processor_id CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.12.0-rc2+ #2 Call Trace: dump_stack check_preemption_disabled debug_smp_processor_id save_microcode_in_initrd_amd ? microcode_init save_microcode_in_initrd ... because, well, it says it above, we're using smp_processor_id() in preemptible code. But passing the CPU number is not really needed. It is only used to determine whether we're on the BSP, and, if so, to save the microcode patch for early loading. [ We don't absolutely need to do it on the BSP but we do that customarily there. ] Instead, convert that function parameter to a boolean which denotes whether the patch should be saved or not, thereby avoiding the use of smp_processor_id() in preemptible code. Signed-off-by: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20170528200414.31305-1-bp@alien8.de Signed-off-by: Ingo Molnar [arnd: rebased to 4.9, after running into warning: arch/x86/kernel/cpu/microcode/amd.c:881:30: self-comparison always evaluates to true] Signed-off-by: Arnd Bergmann --- arch/x86/include/asm/microcode_amd.h | 1 - arch/x86/kernel/cpu/microcode/amd.c | 17 +++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) -- 2.9.0 diff --git a/arch/x86/include/asm/microcode_amd.h b/arch/x86/include/asm/microcode_amd.h index 15eb75484cc0..98ccbd1dbb01 100644 --- a/arch/x86/include/asm/microcode_amd.h +++ b/arch/x86/include/asm/microcode_amd.h @@ -59,7 +59,6 @@ static inline u16 find_equiv_id(struct equiv_cpu_entry *equiv_cpu_table, extern int __apply_microcode_amd(struct microcode_amd *mc_amd); extern int apply_microcode_amd(int cpu); -extern enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size); #define PATCH_MAX_SIZE PAGE_SIZE diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index b74bb29db6b9..732bb03fcf91 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -135,6 +135,9 @@ static size_t compute_container_size(u8 *data, u32 total_size) return size; } +static enum ucode_state +load_microcode_amd(bool save, u8 family, const u8 *data, size_t size); + /* * Early load occurs before we can vmalloc(). So we look for the microcode * patch container file in initrd, traverse equivalent cpu table, look for a @@ -451,7 +454,7 @@ int __init save_microcode_in_initrd_amd(void) eax = cpuid_eax(0x00000001); eax = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff); - ret = load_microcode_amd(smp_processor_id(), eax, container, container_size); + ret = load_microcode_amd(true, eax, container, container_size); if (ret != UCODE_OK) retval = -EINVAL; @@ -864,7 +867,8 @@ static enum ucode_state __load_microcode_amd(u8 family, const u8 *data, return UCODE_OK; } -enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size) +static enum ucode_state +load_microcode_amd(bool save, u8 family, const u8 *data, size_t size) { enum ucode_state ret; @@ -878,8 +882,8 @@ enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t s #ifdef CONFIG_X86_32 /* save BSP's matching patch for early load */ - if (cpu_data(cpu).cpu_index == boot_cpu_data.cpu_index) { - struct ucode_patch *p = find_patch(cpu); + if (save) { + struct ucode_patch *p = find_patch(0); if (p) { memset(amd_ucode_patch, 0, PATCH_MAX_SIZE); memcpy(amd_ucode_patch, p->data, min_t(u32, ksize(p->data), @@ -911,11 +915,12 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device, { char fw_name[36] = "amd-ucode/microcode_amd.bin"; struct cpuinfo_x86 *c = &cpu_data(cpu); + bool bsp = c->cpu_index == boot_cpu_data.cpu_index; enum ucode_state ret = UCODE_NFOUND; const struct firmware *fw; /* reload ucode container only on the boot cpu */ - if (!refresh_fw || c->cpu_index != boot_cpu_data.cpu_index) + if (!refresh_fw || !bsp) return UCODE_OK; if (c->x86 >= 0x15) @@ -932,7 +937,7 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device, goto fw_release; } - ret = load_microcode_amd(cpu, c->x86, fw->data, fw->size); + ret = load_microcode_amd(bsp, c->x86, fw->data, fw->size); fw_release: release_firmware(fw);