From patchwork Thu Oct 3 15:51: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: 175104 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp528553ill; Thu, 3 Oct 2019 09:09:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLzV9y1m1cnmxgIsBx/daDRk0VEZ1j8KTC6kgdE9bSfXOvtJbkddZ760fPyMzQy/6e1W4f X-Received: by 2002:aa7:db02:: with SMTP id t2mr10291012eds.252.1570118871856; Thu, 03 Oct 2019 09:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570118871; cv=none; d=google.com; s=arc-20160816; b=jTpFB/Gke90NXVC8L3kYRy1B46mJNYxixTRmcOLlqm6RvAck41F0kojdaPjoUZ4goM f454YETvvc9GnUUqBih6cMM2WBQfnc0xKxaGLBXRawjvp+tBB7PuR2UsKdwqqNhzpOVB 3SctUQla/CfLi873DEwqhybmW4ShXN2BXblIuzSnKHCPGz2GJMRZlqUhDP9UKHC6FPeF 5GHuGd2DSNBT1I+vU26EXmA+BMWN9t2I5PAuZYE8uRuiS0R2rYxjNS6WM1ulP/l9de/V 4HGVfIjiWXPV1nWXW8Do9ha4gQKnO3ZG7SJLrJ0nAK6DfDrGCHQxWrsJHwzC/8f1Q1Bz uzbw== 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=NlJO9U6IBULnsI4a3a6TYkmbBUXozpo/ilGyLtcjOuI=; b=A/IOqIsBAa2yZRML9pR5C6Z4dMa0ekJ5fl8aJ9v4enwJPaKFnAD/2dxNsMkEWzY/8y EE/G8as7iTQmbpUtinNDRsCptvH/PIZiDNgvydKfKgtUOXCzR96u7x3wpgoRDi0ykovj zskft+o32tEjRNxXBTZ3o5YtY6NeweqRTsYkabPIbSAgCphYpAbGAEbVGCt0+L60vdvt dgPFtTUx/a82a/vB8mTd3cSJLB0hKK6pBCMkMccIK0kbI62UL35fsfRQuTqqGPMyGhzz VUkH/AxbNwqhRpepUHVZdyCGvF4y/gWkpBRVLPSKBe2595ZS78N/AzorNiIw0DSRUipq Nc+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QMy3egQS; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 h14si1730133edb.425.2019.10.03.09.07.51; Thu, 03 Oct 2019 09:07:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=QMy3egQS; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733008AbfJCQHu (ORCPT + 14 others); Thu, 3 Oct 2019 12:07:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:55758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733002AbfJCQHt (ORCPT ); Thu, 3 Oct 2019 12:07:49 -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 2817920865; Thu, 3 Oct 2019 16:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118868; bh=Qd6Fx4HR0MEy1fkhsPPqO3Z/s2WW9q4MQSyVMAfTlqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QMy3egQSz0hb5GzBmjvJ9nqbjgeAwwGB6CclapMLVKlLQvuaZRG7+hvx1/3U6e8j8 AaskTuUxIA6knT/n5oj15eyJ9pSq0t84c2hlb6J+qjqctdiIsZ2y6Z1gvyxKn/iopa aVvSwc+Y7GoxOg/m6j2Qrs1sNFb7a5u970PmSqcc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Andersson , Jakub Kicinski Subject: [PATCH 4.14 038/185] net: qrtr: Stop rx_worker before freeing node Date: Thu, 3 Oct 2019 17:51:56 +0200 Message-Id: <20191003154446.167148984@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Bjorn Andersson [ Upstream commit 73f0c11d11329a0d6d205d4312b6e5d2512af7c5 ] As the endpoint is unregistered there might still be work pending to handle incoming messages, which will result in a use after free scenario. The plan is to remove the rx_worker, but until then (and for stable@) ensure that the work is stopped before the node is freed. Fixes: bdabad3e363d ("net: Add Qualcomm IPC router") Cc: stable@vger.kernel.org Signed-off-by: Bjorn Andersson Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/qrtr/qrtr.c | 1 + 1 file changed, 1 insertion(+) --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -129,6 +129,7 @@ static void __qrtr_node_release(struct k list_del(&node->item); mutex_unlock(&qrtr_node_lock); + cancel_work_sync(&node->work); skb_queue_purge(&node->rx_queue); kfree(node); } From patchwork Thu Oct 3 15:52:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175188 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp635458ill; Thu, 3 Oct 2019 10:32:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQhGiT6heLAfVRT0QtO4eJXJS8DwP5ponjuO2dsPlunPbk9UJr4QPrMfYmBityL79RccEv X-Received: by 2002:a05:6402:78b:: with SMTP id d11mr10960236edy.14.1570123979084; Thu, 03 Oct 2019 10:32:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570123979; cv=none; d=google.com; s=arc-20160816; b=YNZRNFqc3NMAYzCwI+H0h1PNu+zszq7hxpOdV/YSHR0a/lnD8jB4bclItvfUGlLYIb zA8YaTi2s1QsrbNBPVzIZgO/iF4XjFqGq24kd8ZRUag0AqpHsWpY1RQuuetXA8b9hVqo hgFUzZ0bJIYYslvyCX19knK2gO22rw3moFlxW10SLUy4yBE65W8vZr5xebvQVVtyN5aH y8BIECS5Ci0TTRy4Cj/nVtkEFwPVan9/awbBplx56THR43c5EMkIATl/fusx4lI1t2Lo V3z/0hYPRWY4BSGTM8VCHcqVCo3M3My1r3lHF8M6AVCjKwGjrQqTtvs9mdyFyApIv/z+ kQkQ== 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=Aq0+OUd2h4NwUlsGLdIQjIwgsyzo6qMH6pwMeYSoQn8=; b=mayh0MpK9XJyWY0AvbNm6umD/wRZPNFSLvAaRyMixDh/vVoxBjkV5VBNWtON4YGka6 qvwVAW2SPv69pKhisMkEXPIdxZlBiORl5IC3QSzh096P9EGPvg44IV7ktDkRS5nD7jck 8I2tNWgbjLR8gewrKefD4bNXYVh1DC9TERtdikOYx064ZYnYvGursfpmYbXQ7Ru3rR1e vXsKc+iQ2vz/99jPLBxBjRJESqCaN3XYsBUcsLrnj1lDr4cF9Njd0+ltOAPNTR0bFxa5 Mru2fqT056d/Z1HQHGrd9yVxfe0JtqrjqvWE6jf14SVZSOxQliw7DOUfZN4G/RLDQSxu 5GHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KVCKStx0; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e5si1582390ejj.70.2019.10.03.10.32.58; Thu, 03 Oct 2019 10:32:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=KVCKStx0; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729041AbfJCRcv (ORCPT + 14 others); Thu, 3 Oct 2019 13:32:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:56898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730823AbfJCQIi (ORCPT ); Thu, 3 Oct 2019 12:08:38 -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 2BF2320865; Thu, 3 Oct 2019 16:08:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118916; bh=dN6+/uKXWq+iF1R17oTdBOC8Uzm9ThThdUa5PTr1FtY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KVCKStx0846gXadzRB2kB7iQnGO+h2GWXLmlAJqIQmryFAzq/ifDJ8Y+B2LexyhMq DhMKdik+OyodHG0ZIVYkn4YY5iQ8x1qZKWD3/+rR8ukj036R9QfunokuWwTKcZoOrF RCBr5d8hiugDkfQYQHjQeviKhG6V1wLVJSY8loV0= 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.14 058/185] media: dib0700: fix link error for dibx000_i2c_set_speed Date: Thu, 3 Oct 2019 17:52:16 +0200 Message-Id: <20191003154450.386437023@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 9be1e658ef47e..969358f57d91a 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:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175100 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp527842ill; Thu, 3 Oct 2019 09:08:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0w5Gu9Ebm9lRq9gJ5S1VDLdAMzFtv0mgIsE5Wmi5YfzVZhraHiMQeVphi9PsQx1ygvQ/5 X-Received: by 2002:a50:cf8b:: with SMTP id h11mr9853496edk.236.1570118936813; Thu, 03 Oct 2019 09:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570118936; cv=none; d=google.com; s=arc-20160816; b=cUCGOY2nsfOKhawL3hyoFPFEqJI+rj9oQShRXzJYh0UUNR2QOohWlZ1+hzspkyhMFk In97rQHddLJ4WnWwISGouf4W3TSFh0zVBTeB39CyOWfqOUO8E56fx5jui/fNFiwF5D0J wg04SKfzKeZvH/6XDxm8MTzIkRjK2z18TFIxJ2b86jCdq5doQaTAq5vqwuOXiPd0vYuF 9Mt8FL05pSHJJOHrf7Rnfr7hfLUrfKqen57IrwhAMAp/gVpOT21L+XEDzxV45ipMnnao +meqOV+gEyZbX98HOg6JetuC2DQjCipsZJvXfhZwWn/veYzMNeu6b0mEubhHLMWBP7oz T5qw== 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=Z168jmRtF+E4yAEUvYCiJW6/FIJdCvOgjeo7H539ccc=; b=pWSmAc3kiUgFGbfOvzlDn93MpZoRGd+CxS2wVWgsgX3UkWGpUqkCDNiTNJ65en5va0 8kN/kw87gj+ioeMwZTx4aV1ymYuSUf5K6FDGyAAJUb4PyOLCzmL/EF0uSzkgVAnAmRzX C6r6l9wfeFCJmMed0zXMRMbzU/ISg9cmGljFPhs2ls0eRCfNLUZI1crUyxUi1u1b/WJv eXoVeMdeGHciFT67XLeynFzS2p099nPWYqoHWYk2e5SwlC4YrseTpFKGqmhHaS6iysTg vBuFTh2mKJ/tr7NDhDT6GBYCwTI/hfdxg9rxzw57ylkSbiR2592XRwTGSGKSsp3NNbnx z4Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SThtAwg2; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 l45si1862661edb.18.2019.10.03.09.08.56; Thu, 03 Oct 2019 09:08:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=SThtAwg2; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731945AbfJCQIz (ORCPT + 14 others); Thu, 3 Oct 2019 12:08:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:57296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733288AbfJCQIx (ORCPT ); Thu, 3 Oct 2019 12:08:53 -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 2B781207FF; Thu, 3 Oct 2019 16:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118932; bh=lQFsJo/ifnDFbQ6bmQ5/++QOotlYuVYGBuf+IwxkEQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SThtAwg2p9/wB/zC16wsdM5cys4DdgcRf9/BzCzq47d0pAgRh0OrHmIv2x9CxO3ZE VOq+VbjpFawfDuARFGQmEyInq3zDNNA6QeP3gV3tN90u84M6186NVJ00/jpr9qIzvG Ov2fprcdVKdNMIiE0d++BWCUfDOQ8Zz9LstN/Jhg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Guittot , "Peter Zijlstra (Intel)" , Linus Torvalds , Thomas Gleixner , Ingo Molnar , Sasha Levin Subject: [PATCH 4.14 063/185] sched/fair: Fix imbalance due to CPU affinity Date: Thu, 3 Oct 2019 17:52:21 +0200 Message-Id: <20191003154451.628695736@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vincent Guittot [ Upstream commit f6cad8df6b30a5d2bbbd2e698f74b4cafb9fb82b ] The load_balance() has a dedicated mecanism to detect when an imbalance is due to CPU affinity and must be handled at parent level. In this case, the imbalance field of the parent's sched_group is set. The description of sg_imbalanced() gives a typical example of two groups of 4 CPUs each and 4 tasks each with a cpumask covering 1 CPU of the first group and 3 CPUs of the second group. Something like: { 0 1 2 3 } { 4 5 6 7 } * * * * But the load_balance fails to fix this UC on my octo cores system made of 2 clusters of quad cores. Whereas the load_balance is able to detect that the imbalanced is due to CPU affinity, it fails to fix it because the imbalance field is cleared before letting parent level a chance to run. In fact, when the imbalance is detected, the load_balance reruns without the CPU with pinned tasks. But there is no other running tasks in the situation described above and everything looks balanced this time so the imbalance field is immediately cleared. The imbalance field should not be cleared if there is no other task to move when the imbalance is detected. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/1561996022-28829-1-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- kernel/sched/fair.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c298d47888ed8..808db3566ddbc 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8359,9 +8359,10 @@ static int load_balance(int this_cpu, struct rq *this_rq, out_balanced: /* * We reach balance although we may have faced some affinity - * constraints. Clear the imbalance flag if it was set. + * constraints. Clear the imbalance flag only if other tasks got + * a chance to move and fix the imbalance. */ - if (sd_parent) { + if (sd_parent && !(env.flags & LBF_ALL_PINNED)) { int *group_imbalance = &sd_parent->groups->sgc->imbalance; if (*group_imbalance) From patchwork Thu Oct 3 15:52:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175187 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp633212ill; Thu, 3 Oct 2019 10:31:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwko4Puh/YMhxQFwONhGTaSwq5Km3hQpvVHHVlsnXSo8Q3Uv5n0Lxh5HKuzmM5WSFbEQ3f1 X-Received: by 2002:a50:918d:: with SMTP id g13mr10769105eda.64.1570123884258; Thu, 03 Oct 2019 10:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570123884; cv=none; d=google.com; s=arc-20160816; b=0WRu/TaozJwSrZ3ShBLU5n7f6YCCBsuhaG4N3fgmC55b1o7RcYNIkcC2hxx3ncdRTP aMRBzti+YQ3rOxCMBcnUlrB9Vsplw1BkMx5ZzBy/dnRNi8NVRKIJT73F4V7BgxdskvMa XGss99Gd5G4q+JtBSahTCoWxKoFGB9Adl4FLKZxFgcxiM37ETlRNDW1rw/e9W23qvz9i aU6C3QbXDryIKKh9hHqFvv8VztYlT16A8RWNA+ky7KMMlIHEmFuFZ7cUBOGvpWQqb4a7 UOW665684OLqs2irxFJGDgpCGArfu9oLYTmaTlYmXsOJ5fk+ZX14FO4uPZBTAIrEzLLA hF8Q== 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=+Ykyth3w6e1UJf8EoVG4DsuklbFrgVLfob+veYDTh9U=; b=YYGTnAeTA+iSP0PCZ0Pw/VyAfDrh4sX3Fss4DnTLwNBsEc9VIPY1lpuj7+Nl1VVI0m nNxyZbkKz2kL17rGqscrtmLmjumew3HlGneWnMGcue333b+4sW9z899Td6ZIAU84wv3u OoCqSzmKkCpBTtd0h0YLl+UjfJkAIRcG4QAAf6MesncdN02wWfU5QtphKUYOMmkkeE6t kdnncotXiWEJOURhH4pwfAumlPx+rIMBXRuZcWoNxBqJtksRL7+xjYj7JXolX3zi9LdE XjoK9HVhX/3Q560yY8RwSkhzQwTAp1v7RmyBNvoaw9WzpHVgceRd+flEwTA1AwtgPzTr NYlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tzvFHoCZ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 p38si1923627edc.449.2019.10.03.10.31.24; Thu, 03 Oct 2019 10:31:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=tzvFHoCZ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731298AbfJCQKR (ORCPT + 14 others); Thu, 3 Oct 2019 12:10:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:59416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387585AbfJCQKN (ORCPT ); Thu, 3 Oct 2019 12:10:13 -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 89D88207FF; Thu, 3 Oct 2019 16:10:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119013; bh=++ww0M8FldhONH/sKfUkcOspcDTMgTrhuVQH5MzsDWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tzvFHoCZrr6Db+GfCUPcWT0hY2OKXqqbLXPbqvt5yFiFWHckn25tWOMZ0mCTZMxuz aR8G5JWmrPs7Sru4l/7oid0Q6uis1JVMau4qY2MqDxYfSMWyWja6EX8KQtv37AeJqs g0vq0Air8MDfoc/XjAYNF2vw0yIZvSXrJ1Ox8JGA= 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.14 094/185] net: lpc-enet: fix printk format strings Date: Thu, 3 Oct 2019 17:52:52 +0200 Message-Id: <20191003154459.576180428@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 08381ef8bdb48..41d30f55c946b 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -1371,13 +1371,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); @@ -1424,8 +1425,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:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175107 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp532378ill; Thu, 3 Oct 2019 09:11:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAiKPCQrwnJ4kgYjIfSi7pXvnLt6BmWf/4GLDIvUkt/nr11/RB0CxleYXyi+aW/SHHTnIe X-Received: by 2002:a17:906:d97a:: with SMTP id rp26mr8569458ejb.251.1570119117676; Thu, 03 Oct 2019 09:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570119117; cv=none; d=google.com; s=arc-20160816; b=I02GtqcPbOp9+CmNAQTDgyC/QvLbp7spGrdTB8eoFaB38CBNZtZfWvLh9JXUpAnahB XDLY/N5i6E/aMpg/5TXo5AdJy8/jS3BFdcDl8TtNkFkRVj31u+G46sVhOGmh9gidPwzt 3/JOI3htp2yIfdxFCu/wRjpurANBUnlxc5d5zkLx710f2v6OAgLtyw49Alaf4pQgbjYU ABb59HJDI7foia4U+KN3E+A2HWW9lXWMwAr43UNjhs/BvmEc0uLssoAMdR4nYHV3ntyR rgSBAlQtvWk8uyPmWTlp2mL78uAbot0nIsM+ioSjKyLo/U3DzZuHiyBvkn2jaXgtSE9e miHw== 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=p1Kszr7d5Pr7WOposQLln38Sa4epVCcKv/sghi8zGS0=; b=vAbwUE8370GRyk40743RPsitpYs3W72HNKurTWF3gpUs1wVJukK1pd1Hd9SQz41rpm W3XxJQZOLFt3wl1k89pD5XMDJxndJ0j2Q+sXAi8L3D9GOIbwS4F2uzmcx9KYD6ZAuC75 8+psCWdTFRZYBWJ70MMbmmFdj0sDrzT7EDxW/NZnPOGB3Bt7swnkcBDvS3FTq0AJY5xa DgK5cYvZm7DZNHqJifkIGkbQ/RRuRgS/Xf5/rWg3iUF+1JL+Z3dtXGOiX2K6Qc0xoi7D adHdEnUd/Hw1HCB3CMIfvPz8RNGSrKlnvlq7oSWs47zi/cSCCCKkVHMGTmmIEY7MnUG+ p+NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1UOPMFLZ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 h2si1806071edb.346.2019.10.03.09.11.57; Thu, 03 Oct 2019 09:11:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=1UOPMFLZ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733047AbfJCQLy (ORCPT + 14 others); Thu, 3 Oct 2019 12:11:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:33786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387928AbfJCQLx (ORCPT ); Thu, 3 Oct 2019 12:11:53 -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 EF52A20865; Thu, 3 Oct 2019 16:11:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119112; bh=rhHRo2v442EhnNaf/8eTEgT06HCu/RNtjBI3CumZBPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1UOPMFLZp7naOFCE2vxg3OGhoD3grQyE47I7TlbUWgpLOudcj+u+yGcKwHVNXl6CG ssbY0QU/kl4NFz1WqJ0Yc3e0Bu46qhTq/41eKv/nDsxrHS/nnRienC9vWkrEgSQwGO GsiK3sWTQpeLEsvCNs8ygCAYStS/WNSYlr3FG7Ts= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Vinod Koul , Sasha Levin Subject: [PATCH 4.14 123/185] dmaengine: ti: edma: Do not reset reserved paRAM slots Date: Thu, 3 Oct 2019 17:53:21 +0200 Message-Id: <20191003154505.673074578@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Peter Ujfalusi [ Upstream commit c5dbe60664b3660f5ac5854e21273ea2e7ff698f ] Skip resetting paRAM slots marked as reserved as they might be used by other cores. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20190823125618.8133-2-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/edma.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index a7ea20e7b8e94..519c24465dea4 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c @@ -2268,9 +2268,6 @@ static int edma_probe(struct platform_device *pdev) ecc->default_queue = info->default_queue; - for (i = 0; i < ecc->num_slots; i++) - edma_write_slot(ecc, i, &dummy_paramset); - if (info->rsv) { /* Set the reserved slots in inuse list */ rsv_slots = info->rsv->rsv_slots; @@ -2283,6 +2280,12 @@ static int edma_probe(struct platform_device *pdev) } } + for (i = 0; i < ecc->num_slots; i++) { + /* Reset only unused - not reserved - paRAM slots */ + if (!test_bit(i, ecc->slot_inuse)) + edma_write_slot(ecc, i, &dummy_paramset); + } + /* Clear the xbar mapped channels in unused list */ xbar_chans = info->xbar_chans; if (xbar_chans) { From patchwork Thu Oct 3 15:53:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175186 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp629750ill; Thu, 3 Oct 2019 10:28:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqylILGoIXR/QNM6kWuwaAbxApSXtetztXfvIS3Vv8I52zIQviUgdqRofEc6qjA+VykDbT0B X-Received: by 2002:a17:906:fc20:: with SMTP id ov32mr8802201ejb.22.1570123717356; Thu, 03 Oct 2019 10:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570123717; cv=none; d=google.com; s=arc-20160816; b=aGlzPQ7GFOkdLNZ5lmIpLtAYKn35tIyb63DF1FOCWpRPROHQ2nZBLu6X4lKoPJAGuA 94ebXQQtzvJOdGBpsBizeIgfXx9mPCKwfJzA+MJC3nduCY1y37XS5Q/GWUeRm7NQ6AP4 GQ9XAHsG7jIv9EnBSNuMGJYor6dwGI6Xt4k6VIvQO/4tLEN831H56zRiuiGitBaCTwcZ VE9AgZ49ZlbPcgj5A7iVj0NvH2wjxjX2WNpY5k4PAkXOv2TClnem+uftNFtSs0A26cE9 bJPwdL8SUVS+13IVEIGCFez91W2JQeSsMrfGTk3dCS8E0fHRXzTKl/I0VEC9bA4GnKIe SGkA== 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=fQkp+GufTqoL68pzMZR1rVC6RW/pkFpOkKEmWUpgoGQ=; b=K1Om0CE9YVTOjF+Dn4t3bquLnGIIEPcuOFOaXfAOcXxpJWRb6+vnUJwqKplWamSw9w r/0isawikxCyFWI+eXzWZ/2LD6TW5hr2zgv7K3Fj0KmqGnWv/63RppVfz+4T66jn+TGD jC43vlG9++3ulOSjAEPnp+rTOHjSqxBqITUu5jABpqga9EekQEn2Wdi3yKm+5O4PkSAH Lz/tBOb/sVOJVz+XpePiX5yZHXZa4y9+wzIKaTo5mr0hqLnBGIjLT2AKr691BfebknTO VlfoExs5oDlowE2gV7dbnf03H0h9umco295OnG07ue+YmMq+w+6EqwZS0jtS4V6JVycn A2EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0d+JYRCX; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 f35si1943365eda.415.2019.10.03.10.28.37; Thu, 03 Oct 2019 10:28:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=0d+JYRCX; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729278AbfJCR2g (ORCPT + 14 others); Thu, 3 Oct 2019 13:28:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:36298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388354AbfJCQNd (ORCPT ); Thu, 3 Oct 2019 12:13:33 -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 772282054F; Thu, 3 Oct 2019 16:13:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119212; bh=6b5jTT1uSMagUS3nV3QpOU2+HHivB8utPxBdWmXGx7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0d+JYRCXYZ4iy8loQGGfwM+x6Xu+Oqi+gY6rB1lzyrD7ERw0oQvfpgnaWupNo6r98 Lv8+MlWjgt9ME2FI8K7L8cnnYK/Q8aUESCz5aee/qsPtskmqFwJ4lfV6Trikx+sLOi s8AChB52Hl6B7loqgZGV5Jec8S3YYDqenrc0A5h0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Ulf Hansson , Douglas Anderson , Sasha Levin Subject: [PATCH 4.14 128/185] mmc: core: Clarify sdio_irq_pending flag for MMC_CAP2_SDIO_IRQ_NOTHREAD Date: Thu, 3 Oct 2019 17:53:26 +0200 Message-Id: <20191003154506.607376909@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ulf Hansson [ Upstream commit 36d57efb4af534dd6b442ea0b9a04aa6dfa37abe ] The sdio_irq_pending flag is used to let host drivers indicate that it has signaled an IRQ. If that is the case and we only have a single SDIO func that have claimed an SDIO IRQ, our assumption is that we can avoid reading the SDIO_CCCR_INTx register and just call the SDIO func irq handler immediately. This makes sense, but the flag is set/cleared in a somewhat messy order, let's fix that up according to below. First, the flag is currently set in sdio_run_irqs(), which is executed as a work that was scheduled from sdio_signal_irq(). To make it more implicit that the host have signaled an IRQ, let's instead immediately set the flag in sdio_signal_irq(). This also makes the behavior consistent with host drivers that uses the legacy, mmc_signal_sdio_irq() API. This have no functional impact, because we don't expect host drivers to call sdio_signal_irq() until after the work (sdio_run_irqs()) have been executed anyways. Second, currently we never clears the flag when using the sdio_run_irqs() work, but only when using the sdio_irq_thread(). Let make the behavior consistent, by moving the flag to be cleared inside the common process_sdio_pending_irqs() function. Additionally, tweak the behavior of the flag slightly, by avoiding to clear it unless we processed the SDIO IRQ. The purpose with this at this point, is to keep the information about whether there have been an SDIO IRQ signaled by the host, so at system resume we can decide to process it without reading the SDIO_CCCR_INTx register. Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke Signed-off-by: Ulf Hansson Reviewed-by: Douglas Anderson Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/core/sdio_irq.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c index 2fdd84c67f191..0656d740b0dd2 100644 --- a/drivers/mmc/core/sdio_irq.c +++ b/drivers/mmc/core/sdio_irq.c @@ -35,6 +35,7 @@ static int process_sdio_pending_irqs(struct mmc_host *host) { struct mmc_card *card = host->card; int i, ret, count; + bool sdio_irq_pending = host->sdio_irq_pending; unsigned char pending; struct sdio_func *func; @@ -42,13 +43,16 @@ static int process_sdio_pending_irqs(struct mmc_host *host) if (mmc_card_suspended(card)) return 0; + /* Clear the flag to indicate that we have processed the IRQ. */ + host->sdio_irq_pending = false; + /* * Optimization, if there is only 1 function interrupt registered * and we know an IRQ was signaled then call irq handler directly. * Otherwise do the full probe. */ func = card->sdio_single_irq; - if (func && host->sdio_irq_pending) { + if (func && sdio_irq_pending) { func->irq_handler(func); return 1; } @@ -100,7 +104,6 @@ void sdio_run_irqs(struct mmc_host *host) { mmc_claim_host(host); if (host->sdio_irqs) { - host->sdio_irq_pending = true; process_sdio_pending_irqs(host); if (host->ops->ack_sdio_irq) host->ops->ack_sdio_irq(host); @@ -119,6 +122,7 @@ void sdio_irq_work(struct work_struct *work) void sdio_signal_irq(struct mmc_host *host) { + host->sdio_irq_pending = true; queue_delayed_work(system_wq, &host->sdio_irq_work, 0); } EXPORT_SYMBOL_GPL(sdio_signal_irq); @@ -163,7 +167,6 @@ static int sdio_irq_thread(void *_host) if (ret) break; ret = process_sdio_pending_irqs(host); - host->sdio_irq_pending = false; mmc_release_host(host); /* From patchwork Thu Oct 3 15:54:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175109 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp534586ill; Thu, 3 Oct 2019 09:13:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrvRXqb7en5Ga77LRhZbVrVRahJRhDB4iI99fRUVlHSxDq3xdMFR3WLALqatJ47CLK2frx X-Received: by 2002:aa7:c4d0:: with SMTP id p16mr10430273edr.266.1570119208561; Thu, 03 Oct 2019 09:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570119208; cv=none; d=google.com; s=arc-20160816; b=w4eQSyirKDbiHnb/gUYh6lXTTANv9y47RNVVfAhobHibYbjZHaSQAChUPKApZBFrj2 0UvQCycPzsRioPIvtinQGiN4xM43LF0+Hi2ymQYBX9+wlzuYXgR3SRPCf13iopOmVnUZ +7jN4136q2KqWN+SwXnPTx8LianhKFRpJlHE5H0TVO9w8bjH4qskYsRh0+iwJ4q1Iblm RMiZZRwaIe+csYx1qYY/ludktokmrOvvfy3N50sy8zKHmvbmy7TWAN3lWLSrAfe+LBCx T0mVoMoJE8F3lc5kRd+JkPlKZ/rB2vqMd+IKwT0pYmPRY2E55LweXVNO02ryYT6H6xes p+sQ== 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=IvpuYupW2J+9W9QXyQ6HvbsRtTU+Y30WQHtcCZCSqqw=; b=oDiElXOXYSWm/3QccNJ9XgRV+b4hImlip9ojRC3iE7SPgFWJngTHQrKV2MVkckRFXj oUrnZTeVNX/RvfPmeI6p/teif0tW1A39jVGfBgN0Uv3V8qlnWZagvf9R1xfCLvckyTLk p6OeycR/XehGjfH/ZkNQwsqRmEBTvydBEWk7Q9MrLvEgOMubfXwg7kgs0+WxIzzfjJ+c n85Xqj8ZR/b0MyUgmvoSk5aRK9ZKVBYfywM3wfiGO6WAjlFR0mkmwNiA8+vrBARpJ4xq cUX3qVimkEgRL/+k9wWeh5+pBhkqmmNJxzdhgbGU8eIL2YFMNuQlt1hxTCMEW+AX0Fsc iV8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VI6ALlh3; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 p23si295233eju.435.2019.10.03.09.13.28; Thu, 03 Oct 2019 09:13:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=VI6ALlh3; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731695AbfJCQNZ (ORCPT + 14 others); Thu, 3 Oct 2019 12:13:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:36112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388293AbfJCQNZ (ORCPT ); Thu, 3 Oct 2019 12:13:25 -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 4F957222C2; Thu, 3 Oct 2019 16:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119203; bh=FJYnZg6WMObUE1C/7zbp248X1y4DM67iXnpE0grTntk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VI6ALlh3aRHfmaQKPCk9j8a313lwY7/RdzJwoWrEuBdeVj/ZpjnClOxmAyQRgieID 0jqGnDo5CePDZL+dmt5unV7twOuzSzdFuhVkg4wchuxcV2xGax2jfkXKBYAVSuGiUO ynoulvwftDItIoOnpZrlgELFRP+1diPaHetVyQpA= 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.14 162/185] regulator: Defer init completion for a while after late_initcall Date: Thu, 3 Oct 2019 17:54:00 +0200 Message-Id: <20191003154515.611438519@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154437.541662648@linuxfoundation.org> References: <20191003154437.541662648@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 @@ -4503,7 +4503,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; @@ -4552,18 +4552,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 @@ -4580,6 +4571,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; }