From patchwork Thu Oct 3 15:52:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175093 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp517578ill; Thu, 3 Oct 2019 09:02:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5C2YkJXdcxFbQXuL6H2Yr0mTnBPQhGo5wh4ej0U0yrIEXTvH00o+9ah+fvLxbCfK4Ciuw X-Received: by 2002:a50:e718:: with SMTP id a24mr10372754edn.289.1570118535982; Thu, 03 Oct 2019 09:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570118535; cv=none; d=google.com; s=arc-20160816; b=ZFPYIvSJF18pyqN0woNUJ4FwRyjnqthbYDPLb2o5ZdLMy+aMsyAG52p6fyZZAy3M+Y L6BUA8vK/rH4r23IA17DyTYcLEmRcRWTLrgA22ScyzWgT/+Vfkk8FtoJDXQqGZshiO8W 3ClpdFEU9i/Hqw+mrbBLMnQyZb0DmbUjFgBR5AVJYjHOAMtTf8TbdSPOWmssHNF4JaOz PavU2BwnSplnoZBS+LozECJgWawdPxHqYQtIfjD4MVnV8/ct42blag+vdrZqTrQfn9Cz 5hkI+G0IEIACQb7i+kX+vX35V+hTYPUmzOz4tGbxR/PfyBwpWa5zecG5Wf64/wwsIHbR Etsg== 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=v9nVliLkt2Gd0bJ4/NDNhTWHru5u/WbeX36xQfYAXGg=; b=GCKBjwkgD4lO/Q7M+aJPZzCiu/V9iKKyRzkZPnFP194oBi75zPBJQjOQEylKSkrTsD 2J65IV4oALYlXXM+3NCyr/UrLYbJAdgh5laCFugTgbzaoWcsd9RoVVc9r6aWqCT7szMn PJk0UPkm6EbfXoudq65izF6AtV2OBU8Mgkw6n963Fc8KZ2lRSfHGxu3jnPGLWaoNobjO haUvucP68mlL9ShZGsvqx8neuhFIcQAqGc5rWPI0ctjExetp14/Qr4Dbct/aA5G725Wd Opn+r5dn9ubsAhnqtunlMWAPREhdQ334cMU6mmFMqD5qsuPhOK/BI3b7FFqRl7iytUjZ ZeaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AXoRIrSX; 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 h43si1690999ede.142.2019.10.03.09.02.15; Thu, 03 Oct 2019 09:02:15 -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=@kernel.org header.s=default header.b=AXoRIrSX; 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 S1729214AbfJCQCN (ORCPT + 27 others); Thu, 3 Oct 2019 12:02:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:46930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730052AbfJCQCK (ORCPT ); Thu, 3 Oct 2019 12:02:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 D723320700; Thu, 3 Oct 2019 16:02:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118529; bh=EHhnwzjpelJVbwpMOhDMilDvfd7Exz9RYdZKlI2NOGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AXoRIrSXHj2zhPWtyNScdtGw1ELnjGgSiC3ZvU7SmRcgLu9f0Rrc9Aq4F+ZmGSe57 K8oRqNK36jiz5LbX1Cp2PVNXeqdPqY/DOSKTjFLMjhcR1Ji2Nolykqze95ML35l0tj 9GTFyp6GXZq9CMQbWTG82EA+729rC+DtISGqU31E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Sean Young , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.9 044/129] media: dib0700: fix link error for dibx000_i2c_set_speed Date: Thu, 3 Oct 2019 17:52:47 +0200 Message-Id: <20191003154337.467011642@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154318.081116689@linuxfoundation.org> References: <20191003154318.081116689@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 765bb8610d305ee488b35d07e2a04ae52fb2df9c ] When CONFIG_DVB_DIB9000 is disabled, we can still compile code that now fails to link against dibx000_i2c_set_speed: drivers/media/usb/dvb-usb/dib0700_devices.o: In function `dib01x0_pmu_update.constprop.7': dib0700_devices.c:(.text.unlikely+0x1c9c): undefined reference to `dibx000_i2c_set_speed' The call sites are both through dib01x0_pmu_update(), which gets passed an 'i2c' pointer from dib9000_get_i2c_master(), which has returned NULL. Checking this pointer seems to be a good idea anyway, and it avoids the link failure in most cases. Sean Young found another case that is not fixed by that, where certain gcc versions leave an unused function in place that causes the link error, but adding an explict IS_ENABLED() check also solves this. Fixes: b7f54910ce01 ("V4L/DVB (4647): Added module for DiB0700 based devices") Signed-off-by: Arnd Bergmann Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/usb/dvb-usb/dib0700_devices.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.20.1 diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c index 2868766893c85..c7c8fea0f1fa1 100644 --- a/drivers/media/usb/dvb-usb/dib0700_devices.c +++ b/drivers/media/usb/dvb-usb/dib0700_devices.c @@ -2438,9 +2438,13 @@ static int dib9090_tuner_attach(struct dvb_usb_adapter *adap) 8, 0x0486, }; + if (!IS_ENABLED(CONFIG_DVB_DIB9000)) + return -ENODEV; if (dvb_attach(dib0090_fw_register, adap->fe_adap[0].fe, i2c, &dib9090_dib0090_config) == NULL) return -ENODEV; i2c = dib9000_get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_1_2, 0); + if (!i2c) + return -ENODEV; if (dib01x0_pmu_update(i2c, data_dib190, 10) != 0) return -ENODEV; dib0700_set_i2c_speed(adap->dev, 1500); @@ -2516,10 +2520,14 @@ static int nim9090md_tuner_attach(struct dvb_usb_adapter *adap) 0, 0x00ef, 8, 0x0406, }; + if (!IS_ENABLED(CONFIG_DVB_DIB9000)) + return -ENODEV; i2c = dib9000_get_tuner_interface(adap->fe_adap[0].fe); if (dvb_attach(dib0090_fw_register, adap->fe_adap[0].fe, i2c, &nim9090md_dib0090_config[0]) == NULL) return -ENODEV; i2c = dib9000_get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_1_2, 0); + if (!i2c) + return -ENODEV; if (dib01x0_pmu_update(i2c, data_dib190, 10) < 0) return -ENODEV; From patchwork Thu Oct 3 15:52:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175095 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp518654ill; Thu, 3 Oct 2019 09:02:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqATd5WoFNbltXYzxFKmP1MXicSXZhDQF3P+XJk8MrFnsIfeL80G4pvQGJ28ig+spu9tST X-Received: by 2002:a17:906:2f03:: with SMTP id v3mr809148eji.333.1570118576784; Thu, 03 Oct 2019 09:02:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570118576; cv=none; d=google.com; s=arc-20160816; b=pgQLlhFVnLhqZl8avrzV2Po3ltZQ8C431uWrKSiz/44KAAHyAdKnqtjrJFy6v0hGvO JlpHMuzt1ArhwvOHjs/MTQXb4dwgNq7dziZi3Q0kUgE66dldYYt6l+E/0ftcsz4Onqmu jy6pDgh6x6vKuu3+ENdWMxR3InToDQyJf/pGMqf7SfrjrlEBO5lbWfSxJDzqrWDP8dbe Tikp8rfzkk0MRcHQoNsni3KIoZFUT6RFXEG7MFIANQsBeWXh0mItjJFIVR2Zgso2wYW9 jRWDdnxQt+EQd2Ucdl1LsgC8KRRa0Gv64cE2jsj1+MoIQJdjdS5TpxzGpW2nOuaBHJfZ ahQQ== 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=qy5J9SHTqTziI+lte8iyJaqP6Qp4JEUdYX8yCvPJGec=; b=AmkksUB4RDlgSCQ+y/eZekHtxQyT4RU/XhXV9w1lHaEQC86SJJjSSyXVQHGl5hANJh 6126jPnrljiZcJKbHnf+vDfNWY3aXdveVFsItt6hexPLjqjeZMZpBh17BvWNug09lYRi kDoisPv4pzlVMg4/AeBWK9ww5AFGo3XXe9wCHCkEg19jOW47p0L7zg6Jk1F1hOk/D/GD TZlXIaRemMWLe+2vzJOIWUWLM6T1M/G+GNPvSRPRNzPPVkSqc9K3xDK5PH8WL7xUKMo3 EirlSVhb5+55w+J4mGR5YQswjqCUMsxbeGD0p3JEFn0UA4fEgj26i97S34XXjAHx6RjI fK9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=P09dm8yq; 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 w2si1829515edc.386.2019.10.03.09.02.56; Thu, 03 Oct 2019 09:02:56 -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=@kernel.org header.s=default header.b=P09dm8yq; 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 S1730777AbfJCQCq (ORCPT + 27 others); Thu, 3 Oct 2019 12:02:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:47646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732027AbfJCQCj (ORCPT ); Thu, 3 Oct 2019 12:02:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 29DAB20700; Thu, 3 Oct 2019 16:02:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118558; bh=4LldhGcKaiWIRhK2s/OWpvADxLRNsZW2t/xA95AQhUg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P09dm8yqaxjlWnaZmi+XDV0OyzuSLfKgFgNOnFo64j9HaJ6A25ZBwdFSIUh5K2NgR BPtS0aQEjWmQhf4Sr2+3l6ZXPXxZ2QAOPeITur/YAbVpEH7KjSQeIOaEDY/NXpf+6v k0FLe7uGMh2j6dc+Q4z93jH5VuEDrsNXDK/syojs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinod Koul , Vaishali Thakkar , Stephen Boyd , Bjorn Andersson , Sasha Levin Subject: [PATCH 4.9 054/129] base: soc: Export soc_device_register/unregister APIs Date: Thu, 3 Oct 2019 17:52:57 +0200 Message-Id: <20191003154341.843893098@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154318.081116689@linuxfoundation.org> References: <20191003154318.081116689@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: Vinod Koul [ Upstream commit f7ccc7a397cf2ef64aebb2f726970b93203858d2 ] Qcom Socinfo driver can be built as a module, so export these two APIs. Tested-by: Vinod Koul Signed-off-by: Vinod Koul Signed-off-by: Vaishali Thakkar Reviewed-by: Greg Kroah-Hartman Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/base/soc.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.20.1 diff --git a/drivers/base/soc.c b/drivers/base/soc.c index b63f23e6ad61b..ddb32c890fa6a 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -145,6 +145,7 @@ struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr out1: return ERR_PTR(ret); } +EXPORT_SYMBOL_GPL(soc_device_register); /* Ensure soc_dev->attr is freed prior to calling soc_device_unregister. */ void soc_device_unregister(struct soc_device *soc_dev) @@ -153,6 +154,7 @@ void soc_device_unregister(struct soc_device *soc_dev) device_unregister(&soc_dev->dev); } +EXPORT_SYMBOL_GPL(soc_device_unregister); static int __init soc_bus_register(void) { From patchwork Thu Oct 3 15:53:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175097 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp519198ill; Thu, 3 Oct 2019 09:03:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCwBY9c8RA+s2icwL4wCUQ7WO+T4xriuoiZYEx2x1oaVz24ptkNW9kxuwzgpqBgM3Y5zNz X-Received: by 2002:a17:906:f259:: with SMTP id gy25mr8544229ejb.2.1570118597249; Thu, 03 Oct 2019 09:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570118597; cv=none; d=google.com; s=arc-20160816; b=TFZSDQ0pxXf0+HtdAVcsCHoFDZ6grzas7LGiDMhV/nlhnuKpCU9W1oWBeJlhIo9m3w +Cd2s4z5tK/xSQ7qvHI+BXgbgc2smLTV1dmuXUC9s/JD/fuJypT9XsyKPRBVmzzKqWJP GTwzpmWF6cnE9pLmbnuHGuZqFPIHvhrYGUnpDUoGhTB5cv4bpVMfkehEip75Ev4CyLM+ kjhLpNaL7lR1YYh4SHtxZ06Sbu1nCHx3vq3ndjP3WriZzy465BYspcind+ddBsK5fP/8 93nFKLpxQD6yud6/BD454YSSUzVbTCZNlb5vVZy5QDj4pEjy8l+uDjt5jPdmRCWRgjSx k+PQ== 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=ey89vr0sCZomMH/QHmV5kjsKUOCjkyuIHluB31BWwxE=; b=NPvU9y5j4L9PjKJybATmWvDf56f+joeP+ybp+Xweay8m8dAp/ZEO1tn0QH0faRf98K fmyoZ8nSK4iA8BLfNTUmIaGCwrcZSSgUVGTY6hwrcbdeCnIu33z8h8A+loAhq/RaFfxi O95Pwj95uiZjfWPqC+Yhyu69chL/xa21x1AiF950kvjOzrmt2xvzXKlAAGvEhNxsuh+8 eS8KEALn6zHedn1ZqaPM6Mi1WbECCDxS5s1qH6Z5x3KgJ7BwXyQNt8cw1tb8bpWDvjSZ KuP75sMDcIrh+fLZijhySsK1E9jfCUkE9ex4f3Zd16WM5SmO2fKUzs54V5yeRuxmrR9B CkGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fU1x8qG6; 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 5si1889360edy.95.2019.10.03.09.03.17; Thu, 03 Oct 2019 09:03: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=@kernel.org header.s=default header.b=fU1x8qG6; 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 S1731006AbfJCQDO (ORCPT + 27 others); Thu, 3 Oct 2019 12:03:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:48268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732206AbfJCQDI (ORCPT ); Thu, 3 Oct 2019 12:03:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 916E1207FF; Thu, 3 Oct 2019 16:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118588; bh=qXmjZGCt17KUtkbDK9AyGeefrtzMuJnk7XU5Ul7MwNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fU1x8qG61cDpjrxbYAO4SnVDnFNV8NGaXu8ezDbiZr+stmS2bwIbIlh2x88UHgq/m +TwjjJo8ZhexRHss1ZNj/aziIs5Wb+3MZE1KRZOsFd27zFGT4s/J4IZaps0NAuLBEe R2sJCVfJzSVmzHBUO7n0yNUBa3GH05NVl2nVNEu0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kbuild test robot , Arnd Bergmann , Sasha Levin Subject: [PATCH 4.9 064/129] net: lpc-enet: fix printk format strings Date: Thu, 3 Oct 2019 17:53:07 +0200 Message-Id: <20191003154347.943170682@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154318.081116689@linuxfoundation.org> References: <20191003154318.081116689@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 de6f97b2bace0e2eb6c3a86e124d1e652a587b56 ] compile-testing this driver on other architectures showed multiple warnings: drivers/net/ethernet/nxp/lpc_eth.c: In function 'lpc_eth_drv_probe': drivers/net/ethernet/nxp/lpc_eth.c:1337:19: warning: format '%d' expects argument of type 'int', but argument 4 has type 'resource_size_t {aka long long unsigned int}' [-Wformat=] drivers/net/ethernet/nxp/lpc_eth.c:1342:19: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=] Use format strings that work on all architectures. Link: https://lore.kernel.org/r/20190809144043.476786-10-arnd@arndb.de Reported-by: kbuild test robot Signed-off-by: Arnd Bergmann Signed-off-by: Sasha Levin --- drivers/net/ethernet/nxp/lpc_eth.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index 8e13ec84c5381..9fcaf19106335 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -1374,13 +1374,14 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) pldat->dma_buff_base_p = dma_handle; netdev_dbg(ndev, "IO address space :%pR\n", res); - netdev_dbg(ndev, "IO address size :%d\n", resource_size(res)); + netdev_dbg(ndev, "IO address size :%zd\n", + (size_t)resource_size(res)); netdev_dbg(ndev, "IO address (mapped) :0x%p\n", pldat->net_base); netdev_dbg(ndev, "IRQ number :%d\n", ndev->irq); - netdev_dbg(ndev, "DMA buffer size :%d\n", pldat->dma_buff_size); - netdev_dbg(ndev, "DMA buffer P address :0x%08x\n", - pldat->dma_buff_base_p); + netdev_dbg(ndev, "DMA buffer size :%zd\n", pldat->dma_buff_size); + netdev_dbg(ndev, "DMA buffer P address :%pad\n", + &pldat->dma_buff_base_p); netdev_dbg(ndev, "DMA buffer V address :0x%p\n", pldat->dma_buff_base_v); @@ -1427,8 +1428,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) if (ret) goto err_out_unregister_netdev; - netdev_info(ndev, "LPC mac at 0x%08x irq %d\n", - res->start, ndev->irq); + netdev_info(ndev, "LPC mac at 0x%08lx irq %d\n", + (unsigned long)res->start, ndev->irq); phydev = ndev->phydev; From patchwork Thu Oct 3 15:53:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175189 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp639103ill; Thu, 3 Oct 2019 10:36:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSfF1rURmMZbsL90OA/oMEezSQULqsdAj7kMHDRgZFr38UwjvSB6nOHWcxxxTWdN66y8mj X-Received: by 2002:aa7:c5c1:: with SMTP id h1mr10691307eds.10.1570124165637; Thu, 03 Oct 2019 10:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570124165; cv=none; d=google.com; s=arc-20160816; b=Mq31XLiHTaivqvqt065SoflazJ2bIj+ikYOBrrC5QjvU2B87P3CCMQnOaYjo9W+aZ0 Sbl+t22b0TfpsFhs+jNoLe1uyqcp0B7SSHwroKpE36Lh5/5e2JHfIJ4ZIhSk3qlM6236 4UZwssGQKI2s2w7Ms3J19k26GQ0Q9P6mJKB8GC3KPGGi9gTck7O7MFLNpT8IXn40gC7K 23wszZD+xKPSYhMOBDmyDQPNEgW7UXDZvn3mtmJ959HVtXrhY1USgpmCxiw1O6+pvwTC ZFf3pIEU3K3dhGVQG/nEyKQM3OpGvaXEE6dS4B7M46l2vNOKDBZm9GK2F6y/84DAZ+c3 F6+g== 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=sl/jv1gP6g3Q0ZNuR9Fr4UM6E+zQsECq8IsVxaU5XrY=; b=Eu7fp7v8ysTOIE1YYAiv3YeEMSbl109cjWDNXld066lEE7AcBgwNGpbFEpzI+E2d48 fJnKFEjDxtTlE08uisCzwTR4bxzT2eyMLRpl/kpJ2j4slUzbM5x99vCq/6fMc6+SLQO/ PIt5etxMZYntIl0n40Ezh74TvVN7fc3xtTrcEBAiCStBx9CvC/fBUlf3FjVCyRI1+POR aRdUc/6BHXQWgmlYqh0uDfEWXCwszNc26pJsHNG66zxMNc9XgY1Zo4xIrjVWAghYfCnU eqknlAi3K9HX8DoUOXjFWy9wju9V67L+fDDdlyA9G1vPf3mhuud5wGekMd3Bdg6S7RUm 4Tsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="x/HkxdFk"; 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 j9si1849172edt.32.2019.10.03.10.36.05; Thu, 03 Oct 2019 10:36:05 -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=@kernel.org header.s=default header.b="x/HkxdFk"; 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 S2388555AbfJCRgD (ORCPT + 27 others); Thu, 3 Oct 2019 13:36:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:51884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732198AbfJCQFT (ORCPT ); Thu, 3 Oct 2019 12:05:19 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 13A99215EA; Thu, 3 Oct 2019 16:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118718; bh=8LVBhwOe9iKmTrHRY8JxBQfug0KuqOv9YxaYUxIzXu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x/HkxdFkFQ34TC4G88d40M2JcCAqesgXL4QxvstQUYqc6VDf2+FrixZ6Y0c5N8Ak2 Fa1VSPI6AynLy308Qc6MA7Iyb3OfFb3MjV+lWxAxsaFh1dXkrPFg8ynizSVtz16kBy 3LO2M1eSaXX0VzRLd6W7ovabxzAY8/9BQ9QmMvRA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Rutland , Catalin Marinas , James Morse , Will Deacon , Sasha Levin Subject: [PATCH 4.9 076/129] arm64: kpti: ensure patched kernel text is fetched from PoU Date: Thu, 3 Oct 2019 17:53:19 +0200 Message-Id: <20191003154353.011305485@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154318.081116689@linuxfoundation.org> References: <20191003154318.081116689@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: Mark Rutland [ Upstream commit f32c7a8e45105bd0af76872bf6eef0438ff12fb2 ] While the MMUs is disabled, I-cache speculation can result in instructions being fetched from the PoC. During boot we may patch instructions (e.g. for alternatives and jump labels), and these may be dirty at the PoU (and stale at the PoC). Thus, while the MMU is disabled in the KPTI pagetable fixup code we may load stale instructions into the I-cache, potentially leading to subsequent crashes when executing regions of code which have been modified at runtime. Similarly to commit: 8ec41987436d566f ("arm64: mm: ensure patched kernel text is fetched from PoU") ... we can invalidate the I-cache after enabling the MMU to prevent such issues. The KPTI pagetable fixup code itself should be clean to the PoC per the boot protocol, so no maintenance is required for this code. Signed-off-by: Mark Rutland Cc: Catalin Marinas Reviewed-by: James Morse Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/mm/proc.S | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.20.1 diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 3ceec224d3d24..3b95e3126eebb 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -263,6 +263,15 @@ skip_pgd: msr sctlr_el1, x18 isb + /* + * Invalidate the local I-cache so that any instructions fetched + * speculatively from the PoC are discarded, since they may have + * been dynamically patched at the PoU. + */ + ic iallu + dsb nsh + isb + /* Set the flag to zero to indicate that we're all done */ str wzr, [flag_ptr] ret From patchwork Thu Oct 3 15:53:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175190 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp640045ill; Thu, 3 Oct 2019 10:36:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwK4PwArjJBPhZCGIu6OkvBUNsHlNpenWfxJlGr42zE/zMb6niYp5ZsD4AFEA53phVd5oMh X-Received: by 2002:a05:6402:1ade:: with SMTP id ba30mr10980868edb.304.1570124213532; Thu, 03 Oct 2019 10:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570124213; cv=none; d=google.com; s=arc-20160816; b=BKwXBMPVn5trO+qfR5D/IRJeCAsi80OgRgppjo+tK3517iv7odwEr8+wsvc3Kq80bG X4s0t66s6+o0WgwjnwPw1GxICTrGaDFv7pMDXH7FAwrjW/Q+RdFg7CHUgHDHEbjRLLiQ yKS0fNFTCIk/P7pR89771CO6milSCLqQkwQxPvZWQKxo5HNRFaCvtxa+gIzdcDL4ckQn SLVnFL6MkW3hGJxOoeMzifqgBaSCCn/ZFGj0MHFKw+xpdmY8fRyliwNivH4voq/Hw9hO 0Kvik3gFKVoSPNbo113uKitQnWJK90PS6W3+p7MMfQCT1gKsYKAO9XbgNPo4uFRbZLC/ aUIg== 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=/kzyIS0dT6+FmrjfEdREDnHKWaKQXu3Jzq6SJTHXcUE=; b=lVoSjvEqwIcxpVlmqwRF8F9I1QBR/soN1iR3hwuBvh9fMTa0YzAbSJxHVAi3MLmecX nmTHPppKcKNMdYlsJokFUrR/v3mJ6Ik3UDDaoduhNL6mwlV8N40o5qw8ib3fvJguY1Pi ngCoV2QTgctt4FwAsXaKr+DkfJtYjRtXYHVfiYpU0WqfCjGEIUv787GfD3ZYwDBwT5S+ jcyTYWWrQPx91cuC4yQieSLXpB2udQtuWmT8UpncZP8i8YMLrdahvbUANhuUb/SVIsRO 2ZxDr9KKlOMoe6Rw/Dr7IderT8sZYvH5gHC0wcdIISXC+0V6S03hXouA4xI1meQpxziE YDpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bAE5haD1; 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 q13si1615102eju.46.2019.10.03.10.36.53; Thu, 03 Oct 2019 10:36:53 -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=@kernel.org header.s=default header.b=bAE5haD1; 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 S2388773AbfJCRgw (ORCPT + 27 others); Thu, 3 Oct 2019 13:36:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:49910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732345AbfJCQEI (ORCPT ); Thu, 3 Oct 2019 12:04:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 5D1C421A4C; Thu, 3 Oct 2019 16:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118647; bh=yboTTV9U5Hi5WqFc52skmFm/H4w+dx7z0bgyguhUBWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bAE5haD1mVVI02dqS7srlHuiJcOGNx3SCA+X1dLQcI9oftP1NzNPtLqOUKvlIxRuQ eZHCMxtpgFXmExvxC1W3iINcqxIUtBEQ2mTH4Yb9EKerFnppbW7uAaWlCQhWpwM7Yb opPlaEWCCawTW8Hih9fzowscdAP6dwaVZzFQRduk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Arthur She , Mark Brown , Sasha Levin Subject: [PATCH 4.9 088/129] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set Date: Thu, 3 Oct 2019 17:53:31 +0200 Message-Id: <20191003154359.394134963@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154318.081116689@linuxfoundation.org> References: <20191003154318.081116689@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: Peter Ujfalusi [ Upstream commit 2ec42f3147e1610716f184b02e65d7f493eed925 ] Some tools use the snd_pcm_info_get_name() to try to identify PCMs or for other purposes. Currently it is left empty with the dmaengine-pcm, in this case copy the pcm->id string as pcm->name. For example IGT is using this to find the HDMI PCM for testing audio on it. Signed-off-by: Peter Ujfalusi Reported-by: Arthur She Link: https://lore.kernel.org/r/20190906055524.7393-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-generic-dmaengine-pcm.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.20.1 diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 6cef3977507ae..67d22b4baeb05 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -312,6 +312,12 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) if (!dmaengine_pcm_can_report_residue(dev, pcm->chan[i])) pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE; + + if (rtd->pcm->streams[i].pcm->name[0] == '\0') { + strncpy(rtd->pcm->streams[i].pcm->name, + rtd->pcm->streams[i].pcm->id, + sizeof(rtd->pcm->streams[i].pcm->name)); + } } return 0; From patchwork Thu Oct 3 15:53:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175099 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp524186ill; Thu, 3 Oct 2019 09:06:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnQbLLVS3FQbHbzwHXdExpXpaQSYZP/o/fG5Tu6PA805GnxE8jHzjB4wHzUqNFbrwkXCTe X-Received: by 2002:a50:ea8c:: with SMTP id d12mr10361550edo.87.1570118788822; Thu, 03 Oct 2019 09:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570118788; cv=none; d=google.com; s=arc-20160816; b=FlgAYzy2DS51+bB8/HoCzbMGdXKq+flzNeotuDf4CLXTcuTPbBPTFGxuac7LqHAwMm +zOPZtizvFLgpV8QoLkFNtA1ohbr7MUlF06ZEwEIoHfvwRnV7yy4OE6HVkMZF1kGaMvr C+gUqqsREZt6bSX+dOp+gctn18byvaJTxpHczyyNBbBltsdZnQMg7Pr7dkHSc6fv2iDx QrTcn24nUXGX7vfJGKDiytmH02rpahv2ZhA0Kp6dnIF7nWz0ibDiUSvy0Pl7MFtT2FgC ETdTFb9IyW24xPqo9Js67Pyg6TOeEDVfvz3Fygb6n66VN+2IAHbDmWqxjrM0y8LsiGHL IefA== 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=iri0/ckTDfLFncABDIVSmCVKwEorfvL0NqRKCR4yfg4=; b=EPrpTkN9riflBVFJOI9AVtILFGlsnmSScp3ot4Q/qHl6Ca5RLTnpcuhxfZ+t1KnmXH 3RDqy7inTg7Bf61Cqxvr89XDb3XmsSz/aSw2gBbHbkOGLRIzazeeMtdAMwlh0C5DBFUf 5CRLN6hEbfiiGvSTJsPbFMf0VcTtroYwxNmliJ9aHrAPlGAyhFSSkwRIyU0vKiCdaNgr KZiqgoHM4A1hrHA88zOzMAQfOXUHIlgZFV2/CxLbtoVjh15ZwBh05ED0Ln8fnMeDKeP8 rmv3lzbeMG5t2A1iE2kiFnw1B+1zW7uXxg5o+ALOxIzmqgpv+7dkM+dORHFLkXnLK+qR /yxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y8L3x10C; 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 l8si296399ejc.404.2019.10.03.09.06.26; Thu, 03 Oct 2019 09:06:28 -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=@kernel.org header.s=default header.b=Y8L3x10C; 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 S1732756AbfJCQG0 (ORCPT + 27 others); Thu, 3 Oct 2019 12:06:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:53618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732165AbfJCQGY (ORCPT ); Thu, 3 Oct 2019 12:06:24 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 5763C21783; Thu, 3 Oct 2019 16:06:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118782; bh=j8smlTCBehzplc91QnNf3OQ8s2sd/rgGmQpFtQiNK0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y8L3x10CuwyY/UI6q9h8dMx2jngajwaT4rrQfgOe2NqBdnuDLoYxUKAPKKOlc1v6i s3ETZ6u1yc/t7MiNvIY3W9t8v0R0/sD+U3O7KKcOlWvhkZ4aIV54j/LrYEs9XQ3ubH AVuUywKNTkuyTvvLLGUJoqIMtuXDr1snRJN7vpsA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown , Lee Jones Subject: [PATCH 4.9 113/129] regulator: Defer init completion for a while after late_initcall Date: Thu, 3 Oct 2019 17:53:56 +0200 Message-Id: <20191003154410.878885887@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154318.081116689@linuxfoundation.org> References: <20191003154318.081116689@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: Mark Brown commit 55576cf1853798e86f620766e23b604c9224c19c upstream. The kernel has no way of knowing when we have finished instantiating drivers, between deferred probe and systems that build key drivers as modules we might be doing this long after userspace has booted. This has always been a bit of an issue with regulator_init_complete since it can power off hardware that's not had it's driver loaded which can result in user visible effects, the main case is powering off displays. Practically speaking it's not been an issue in real systems since most systems that use the regulator API are embedded and build in key drivers anyway but with Arm laptops coming on the market it's becoming more of an issue so let's do something about it. In the absence of any better idea just defer the powering off for 30s after late_initcall(), this is obviously a hack but it should mask the issue for now and it's no more arbitrary than late_initcall() itself. Ideally we'd have some heuristics to detect if we're on an affected system and tune or skip the delay appropriately, and there may be some need for a command line option to be added. Link: https://lore.kernel.org/r/20190904124250.25844-1-broonie@kernel.org Signed-off-by: Mark Brown Tested-by: Lee Jones Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/regulator/core.c | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4452,7 +4452,7 @@ static int __init regulator_init(void) /* init early to allow our consumers to complete system booting */ core_initcall(regulator_init); -static int __init regulator_late_cleanup(struct device *dev, void *data) +static int regulator_late_cleanup(struct device *dev, void *data) { struct regulator_dev *rdev = dev_to_rdev(dev); const struct regulator_ops *ops = rdev->desc->ops; @@ -4501,18 +4501,9 @@ unlock: return 0; } -static int __init regulator_init_complete(void) +static void regulator_init_complete_work_function(struct work_struct *work) { /* - * Since DT doesn't provide an idiomatic mechanism for - * enabling full constraints and since it's much more natural - * with DT to provide them just assume that a DT enabled - * system has full constraints. - */ - if (of_have_populated_dt()) - has_full_constraints = true; - - /* * Regulators may had failed to resolve their input supplies * when were registered, either because the input supply was * not registered yet or because its parent device was not @@ -4529,6 +4520,35 @@ static int __init regulator_init_complet */ class_for_each_device(®ulator_class, NULL, NULL, regulator_late_cleanup); +} + +static DECLARE_DELAYED_WORK(regulator_init_complete_work, + regulator_init_complete_work_function); + +static int __init regulator_init_complete(void) +{ + /* + * Since DT doesn't provide an idiomatic mechanism for + * enabling full constraints and since it's much more natural + * with DT to provide them just assume that a DT enabled + * system has full constraints. + */ + if (of_have_populated_dt()) + has_full_constraints = true; + + /* + * We punt completion for an arbitrary amount of time since + * systems like distros will load many drivers from userspace + * so consumers might not always be ready yet, this is + * particularly an issue with laptops where this might bounce + * the display off then on. Ideally we'd get a notification + * from userspace when this happens but we don't so just wait + * a bit and hope we waited long enough. It'd be better if + * we'd only do this on systems that need it, and a kernel + * command line option might be useful. + */ + schedule_delayed_work(®ulator_init_complete_work, + msecs_to_jiffies(30000)); return 0; }