From patchwork Wed Oct 31 23:10:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 149904 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp101619ljp; Wed, 31 Oct 2018 16:11:00 -0700 (PDT) X-Google-Smtp-Source: AJdET5eteqRZebP6XOm7vIt9Xt+Iy0sXP1MIOY9LK/WrCnmMSzRVsULNA9nPVShLVDXfEk3H0Rq4 X-Received: by 2002:a62:2fc1:: with SMTP id v184-v6mr5273315pfv.115.1541027459939; Wed, 31 Oct 2018 16:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541027459; cv=none; d=google.com; s=arc-20160816; b=H0pONwgjYKo7dWohbBCRihyvVMyMFReJZMc7St3ehI2qbQsLYf4GuXHup12zsZ2csg OdEx1SyVOzzk5+yy8KqlslPMxW0lkqHWLZtnA9xO4i2ifC8LfMX46sLuHpSUrjcYc8dG 86vUjqfkwtVR8piwFFHQqIkiEsuyJ/lX1XmZiEqNgpIj1wlZ0NNiTg8ywhUFpFnehx3H ILWtHTRc3gkcC4V9utv+rjum5ER3T5UrA003GkI8mtVTWLPJEE9cxSwfsE4/TunMZnSQ LQTCvHEmceEuRCjEe1mygyld2sBPzAIBOcfBQvcHgkJ+5jqk57KBVHlb3wI98pJNCFxg nebA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=tCWbIWgiv0vkxcEKndyhxQqA2StVpvI8AsCyMy1YD2k=; b=GToOSPJphszdYrSp4IDUWF9S0zBtKwEjANQ7/DLMFV13J9+ecUrRXcsdtlPtS59K4d Lrhui8lYq0zESJumPQBVv210d6i2IwZykVSQg+4dVGqNiZ76pNjay3bOe65gfA8L8pv1 m1yLhyGyFIHdD3hQrEpwh0hLFqtynrpEE3oehauV2pdVqoWjvWDPQkfTpBsMIaH4bJwa YzJVzWdk13njGTl0hWi1OM2Ijwpzl6Pg7X55vJI8dK3HsDdfJdYi6vL3xkrwEIVb+nYp YEYnndwu8UF5u2ScSb+XfhogEjjFa4v6nCV2n6m1Q3sVYIVo3Wq8aLt0NuXkLdb4Uw9p oBUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jKp5rzPb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5-v6si2292079plt.432.2018.10.31.16.10.59; Wed, 31 Oct 2018 16:10:59 -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=jKp5rzPb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731457AbeKAILI (ORCPT + 32 others); Thu, 1 Nov 2018 04:11:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:34314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731434AbeKAILH (ORCPT ); Thu, 1 Nov 2018 04:11:07 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 23F492064C; Wed, 31 Oct 2018 23:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027455; bh=HwzRIO/UxH9qlZtd8H+2h3nBtj+3jj9eIhPNTbiZBqM=; h=From:To:Cc:Subject:Date:From; b=jKp5rzPb7gQ7jHOVgxXVucWpxdKcTZTdhU9foyyV0WSF6T6DbqOWhi+7zjJY6cJdF KNHkU+cxzmuri3PsGq55E4l4MBzm1vU/eTdVl7yF9FaUJLdyCbujQmKhdYhAkTuk9A B9Q1xoRrd1KDoOZAVbklfRDaYIhCf5ow+2K8dNZQ= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ivan Khoronzhuk , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.9 01/48] net: ethernet: ti: cpsw: unsync mcast entries while switch promisc mode Date: Wed, 31 Oct 2018 19:10:07 -0400 Message-Id: <20181031231054.29333-1-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ivan Khoronzhuk [ Upstream commit 9737cc99dd14b5b8b9d267618a6061feade8ea68 ] After flushing all mcast entries from the table, the ones contained in mc list of ndev are not restored when promisc mode is toggled off, because they are considered as synched with ALE, thus, in order to restore them after promisc mode - reset syncing info. This fix touches only switch mode devices, including single port boards like Beagle Bone. Fixes: commit 5da1948969bc ("net: ethernet: ti: cpsw: fix lost of mcast packets while rx_mode update") Signed-off-by: Ivan Khoronzhuk Reviewed-by: Grygorii Strashko Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ti/cpsw.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index d7cb205fe7e2..892b06852e15 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -590,6 +590,7 @@ static void cpsw_set_promiscious(struct net_device *ndev, bool enable) /* Clear all mcast from ALE */ cpsw_ale_flush_multicast(ale, ALE_ALL_PORTS, -1); + __dev_mc_unsync(ndev, NULL); /* Flood All Unicast Packets to Host port */ cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1); From patchwork Wed Oct 31 23:10:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 149910 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp109743ljp; Wed, 31 Oct 2018 16:20:41 -0700 (PDT) X-Google-Smtp-Source: AJdET5fw7uhhdknffeCKxerGXlCy1uIgoO0hYFJ4g/bmZwVl+PGa2hyTLGrq7UBjst5E6vUc4A7+ X-Received: by 2002:a17:902:b612:: with SMTP id b18-v6mr5334702pls.205.1541028041282; Wed, 31 Oct 2018 16:20:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541028041; cv=none; d=google.com; s=arc-20160816; b=i8fbRxeHblR8XA3lq8bnAL426jmi509u9xTYZezpVA4p81bkC0YooJqVV4WAkiXISM 55n5LVgoO1YngqZq9KudeCDpN53twI7XgtFt7qvYLmJ1ElFijE1Y9Vwr/LZfOnJ6Rz1V CFF4qwAZjfoLXg4P4NStSxDobb0GeMoU+S88yZxLW4bxBTBheCCF1n/BEDDKu00wTR4p +5eMHqYeFpLMeo6hgbWTgI8v1fLLmPJgMaMJb8OPrIjUp9VQsTxulJUbv4pxmLr8Jwq7 upZERgD44OLmUKJGt82eGeEDZRPBxBBJwbFUptVKVhE/38TdpVFYR090l+yB1E64KYYM UgvA== 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:dkim-signature; bh=vb8uQZh3yyXwp8IVcFMsO3bjq2QkWeoDTR19a9O2NKQ=; b=xadoCfgxdfkeOR+blPli2Ha4/ms1FF5BEdawZlcBM+VxNnJNA9ERwzj+GOttPa/z3R L0XnG/9cfJmfU39TGOiReMMBheaDq1fU0SsVeJ7evgG4peY27JAVBBZ1d7AYWj9EOBqD T2rjUgt4Rna2M15LtGT5huIliMmdfElI0H7LrpETBAbqX6DMAcJ5wSKyxF66hSiIkVI6 HKxKvSzCDxnn6CDgUnXneuViquQgJKAuEJHG6v95SJbNRImFvDjHkkQPSOxNcuQsviSO 37u4bEiqui1/QZdErA6wU6tAgnBtkmMDlYdb9dBg2kOROF9wpC/aHHNLVizi9FYN/5uX cMQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yUrngDFg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si29136833plu.316.2018.10.31.16.20.41; Wed, 31 Oct 2018 16:20:41 -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=yUrngDFg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731972AbeKAIUx (ORCPT + 32 others); Thu, 1 Nov 2018 04:20:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:34820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731561AbeKAILV (ORCPT ); Thu, 1 Nov 2018 04:11:21 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BBB2D2087A; Wed, 31 Oct 2018 23:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027468; bh=LH+zed8WRzz62gAU/eBrvzz+wby9v9JQ8HI+zX8Z9ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yUrngDFgQ/UwMYs00afyJxMy1Xo2QNT+JUGUEmdpahlIu2sUy3l4sxstrJYTum0zl 6QpmhVVp5nMOc9UA8H9YVc4YqZYY8cZhpg9CsxvjUIrYiRlYg3/qEXrV+Vs7OX1EP0 yKd+6gCYx4UwVnRKY3gkxibSQhxJx4t4MIseVVH0= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Viresh Kumar , Sasha Levin Subject: [PATCH AUTOSEL 4.9 15/48] cpufreq: dt: Try freeing static OPPs only if we have added them Date: Wed, 31 Oct 2018 19:10:21 -0400 Message-Id: <20181031231054.29333-15-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031231054.29333-1-sashal@kernel.org> References: <20181031231054.29333-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Viresh Kumar [ Upstream commit 51c99dd2c06b234575661fa1e0a1dea6c3ef566f ] We can not call dev_pm_opp_of_cpumask_remove_table() freely anymore since the latest OPP core updates as that uses reference counting to free resources. There are cases where no static OPPs are added (using DT) for a platform and trying to remove the OPP table may end up decrementing refcount which is already zero and hence generating warnings. Lets track if we were able to add static OPPs or not and then only remove the table based on that. Some reshuffling of code is also done to do that. Reported-by: Niklas Cassel Tested-by: Niklas Cassel Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/cpufreq/cpufreq-dt.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) -- 2.17.1 diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 4d3ec92cbabf..1496617b05d5 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -32,6 +32,7 @@ struct private_data { struct device *cpu_dev; struct thermal_cooling_device *cdev; const char *reg_name; + bool have_static_opps; }; static struct freq_attr *cpufreq_dt_attr[] = { @@ -197,6 +198,15 @@ static int cpufreq_init(struct cpufreq_policy *policy) } } + priv = kzalloc(sizeof(*priv), GFP_KERNEL); + if (!priv) { + ret = -ENOMEM; + goto out_put_regulator; + } + + priv->reg_name = name; + priv->opp_table = opp_table; + /* * Initialize OPP tables for all policy->cpus. They will be shared by * all CPUs which have marked their CPUs shared with OPP bindings. @@ -207,7 +217,8 @@ static int cpufreq_init(struct cpufreq_policy *policy) * * OPPs might be populated at runtime, don't check for error here */ - dev_pm_opp_of_cpumask_add_table(policy->cpus); + if (!dev_pm_opp_of_cpumask_add_table(policy->cpus)) + priv->have_static_opps = true; /* * But we need OPP table to function so if it is not there let's @@ -233,19 +244,10 @@ static int cpufreq_init(struct cpufreq_policy *policy) __func__, ret); } - priv = kzalloc(sizeof(*priv), GFP_KERNEL); - if (!priv) { - ret = -ENOMEM; - goto out_free_opp; - } - - priv->reg_name = name; - priv->opp_table = opp_table; - ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); if (ret) { dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret); - goto out_free_priv; + goto out_free_opp; } priv->cpu_dev = cpu_dev; @@ -284,10 +286,11 @@ static int cpufreq_init(struct cpufreq_policy *policy) out_free_cpufreq_table: dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); -out_free_priv: - kfree(priv); out_free_opp: - dev_pm_opp_of_cpumask_remove_table(policy->cpus); + if (priv->have_static_opps) + dev_pm_opp_of_cpumask_remove_table(policy->cpus); + kfree(priv); +out_put_regulator: if (name) dev_pm_opp_put_regulator(opp_table); out_put_clk: @@ -302,7 +305,8 @@ static int cpufreq_exit(struct cpufreq_policy *policy) cpufreq_cooling_unregister(priv->cdev); dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); - dev_pm_opp_of_cpumask_remove_table(policy->related_cpus); + if (priv->have_static_opps) + dev_pm_opp_of_cpumask_remove_table(policy->related_cpus); if (priv->reg_name) dev_pm_opp_put_regulator(priv->opp_table); From patchwork Wed Oct 31 23:10:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 149911 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp109753ljp; Wed, 31 Oct 2018 16:20:42 -0700 (PDT) X-Google-Smtp-Source: AJdET5c1H8W/JN1ZWh1AjwS2j2xp3ObXhl8Dm8JcEXEPxEJZ4+V1bTEkGylSPOT+Src+uzNLzaAw X-Received: by 2002:a63:6150:: with SMTP id v77mr4894882pgb.266.1541028042631; Wed, 31 Oct 2018 16:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541028042; cv=none; d=google.com; s=arc-20160816; b=ih5kq3oJVa6aBx6i9gtVgxKg0ezOxGvG6WFd3mscz3/tT3dZIhG/W9tg1KtZ6XqqQF z6jv6VjbvQfFw8xUbSht67SbnxD7GmUE83b3hsa+6Lxi1rsUkBkPV4ZXnsoGIXflpIC4 ApB3wOE8gENzREVb8P4+cBXPNvf1+4mQ5ou0KXPHDyQ4CLHeDDGF4Hp7xJzneCcPLwOA /sPer0dngvZr7n2An5xt95wGs35Ruto98S5Pk0kAzWuO7qh5mdljE9HIbs4r/pb5z0Nk +LH+CdL4nBNz6nN867gZRqaINBTTZ11ivf/0uRE1IdChO6N7K3hOZi4wjOcf/r0OD10r mGjQ== 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:dkim-signature; bh=DkHASvWaQzP46fVNTllqBG+7zWgY5xyiIuvOH1yIhgI=; b=elPeuXwHKQ5Ti3leleRhOFibkNk4JsL46G0dDZfHKC9c+Nh7IjGf8e/AkC0lL/1m7z mo5WfulWSE09xGP87JzKPqySvljM29Nj96x3VyAkQkNHEFKZbVsR8O2/5g9XUR3YmYg6 Uunq3icyKVs8y8voiu3tMV8Y1vnOB/wEI/0VYU5J0qm76dCCEwQnLZk+gmFOBZkFwXvs uvpfeYO1apbQKzKmrfJZfYIl0VjxCtAM30kBkXWysGULct1XvzrvCd9BWUrLIT4HLeaY 3TcYizRXewsEpn1+8gACE2kF3REW+g80i2L1sUgn3zwhbzvLXpjUaeiWElizejkq7vL0 t8Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GUq5OMCc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8-v6si12023734pls.164.2018.10.31.16.20.42; Wed, 31 Oct 2018 16:20:42 -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=GUq5OMCc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731895AbeKAIUx (ORCPT + 32 others); Thu, 1 Nov 2018 04:20:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:34870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731562AbeKAILV (ORCPT ); Thu, 1 Nov 2018 04:11:21 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B167208E3; Wed, 31 Oct 2018 23:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027469; bh=xixfP+2xcVyJj/LcGiNejEQLYC1PYTYpBTx80WWdXr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GUq5OMCcnNR79GNSQ0O4NysZLIT8f+2cWjahT31P1JTCSgH5ed9XEMphH2ZTsdORo NianwAYimGk2Ci12oXeAX7/jk8n3nj9yE2LfuxxlBvt9wR99okltU9XChEljAy9HYb 0vVYqaBs71CQQxQ/PdmpAET54ZZx2j3ngKYyafkc= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 4.9 16/48] regulator: fixed: Default enable high on DT regulators Date: Wed, 31 Oct 2018 19:10:22 -0400 Message-Id: <20181031231054.29333-16-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031231054.29333-1-sashal@kernel.org> References: <20181031231054.29333-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij [ Upstream commit 28be5f15df2ee6882b0a122693159c96a28203c7 ] commit efdfeb079cc3 ("regulator: fixed: Convert to use GPIO descriptor only") switched to use gpiod_get() to look up the regulator from the gpiolib core whether that is device tree or boardfile. This meant that we activate the code in a603a2b8d86e ("gpio: of: Add special quirk to parse regulator flags") which means the descriptors coming from the device tree already have the right inversion and open drain semantics set up from the gpiolib core. As the fixed regulator was inspected again we got the inverted inversion and things broke. Fix it by ignoring the config in the device tree for now: the later patches in the series will push all inversion handling over to the gpiolib core and set it up properly in the boardfiles for legacy devices, but I did not finish that for this kernel cycle. Fixes: commit efdfeb079cc3 ("regulator: fixed: Convert to use GPIO descriptor only") Reported-by: Leonard Crestez Reported-by: Fabio Estevam Reported-by: John Stultz Reported-by: Anders Roxell Signed-off-by: Linus Walleij Tested-by: John Stultz Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/fixed.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 988a7472c2ab..d68ff65a5adc 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -84,9 +84,14 @@ of_get_fixed_voltage_config(struct device *dev, of_property_read_u32(np, "startup-delay-us", &config->startup_delay); - config->enable_high = of_property_read_bool(np, "enable-active-high"); - config->gpio_is_open_drain = of_property_read_bool(np, - "gpio-open-drain"); + /* + * FIXME: we pulled active low/high and open drain handling into + * gpiolib so it will be handled there. Delete this in the second + * step when we also remove the custom inversion handling for all + * legacy boardfiles. + */ + config->enable_high = 1; + config->gpio_is_open_drain = 0; if (of_find_property(np, "vin-supply", NULL)) config->input_supply = "vin"; From patchwork Wed Oct 31 23:10:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 149905 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp102124ljp; Wed, 31 Oct 2018 16:11:35 -0700 (PDT) X-Google-Smtp-Source: AJdET5euRjpvKwcqhv2fzimuz89WyXS94Duvea8nol5ZwenE6wJqxFdHkGgbQxNZFFHi/eyyWtxB X-Received: by 2002:a62:160c:: with SMTP id 12-v6mr5274770pfw.45.1541027494927; Wed, 31 Oct 2018 16:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541027494; cv=none; d=google.com; s=arc-20160816; b=uFU7y3EfpJcfiNFXtzGNt+QtScHzDV9gMZXTKCsclCFhFuJBgLQoDhBNZ+gIMAgxqb VtOCdMDWehPIgKoMUDB3+UrD2Ftg0hjeLL00kg7XYVLUmZf1A7J3mw2pwOb71jWQ+Fav wNz260FiqWx+ocbjJhvLcb5O1znIo4eQjjhJ05QHDrLGyZfFYknUMrZN4x15DvZxFpaM a80mLmFpwElO1peV81yvAPcYZFPPhz5KvJXqRwNL4rhXpHJo4QEwYPkCzYtF9zqhKP3k jbWA4TyBvxaDN/EXI77yCul8Fx+KdhT7kJ2hqQyKJzhTeThFQvNsfX1dqG44SIfv3fTg 4AlA== 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:dkim-signature; bh=A1rTQmK1rP5vv4JYcvZrwuri1jehBXkusafKaa1smZI=; b=ujNeUbakb8/nDEnLh8c/xDki2L7TqFP9GgPv4OqxfMJUKI14gL7YOBXXEpU2/Jb032 ZZ0bsgDG5FiZcw0ZY0TbPNZNmip4eFIdAVVwj+z5YPW/IYYSlZoQH7zvqNTW4SQoTep0 mppfe1ezq+LN+sebyJqrB5mQ5jJ5gCsuw6XIGSOujFaXB1rljIv9BmQz/4msulF0zc9W yk56vGqmhTkJSfwGGYobmhYzUYc/k5Ll6XUeyEORc8eBxz7C4u9dzqzhIIMeqVo3P5Aq jNwo34vM1PtxOOHPeR9uRSFVlFZlCgDaNvndRtYsVrDrUyBZl/YlsdcQrFvww5AZ3VLq Q2mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=woVQfJOj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7-v6si29812686pfb.16.2018.10.31.16.11.34; Wed, 31 Oct 2018 16:11:34 -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=woVQfJOj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731843AbeKAILo (ORCPT + 32 others); Thu, 1 Nov 2018 04:11:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:35716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731786AbeKAILn (ORCPT ); Thu, 1 Nov 2018 04:11:43 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0129520854; Wed, 31 Oct 2018 23:11:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027491; bh=v47CDGbxOENzAMPOKoeJKAp11j0bzEXJHNMmoo5kuG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=woVQfJOjSE4Wgho3jqho00sJJ7JIityOIFbF1v5J8tRSbC3OLPjG4gfrpzXCWsAqt bHVhulWqe+RK/yza2i8lZ+hN0qadyz1df5DZ8tShpjmtA9URKF6OR48/Sb/RLAGBHb x3oZPDPouH7Dj4cznZ0BiXj/mVvvaQgDBSDNZ/Ws= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Loic Poulain , Peter Chen , Sasha Levin Subject: [PATCH AUTOSEL 4.9 42/48] usb: chipidea: Prevent unbalanced IRQ disable Date: Wed, 31 Oct 2018 19:10:48 -0400 Message-Id: <20181031231054.29333-42-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031231054.29333-1-sashal@kernel.org> References: <20181031231054.29333-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Loic Poulain [ Upstream commit 8b97d73c4d72a2abf58f8e49062a7ee1e5f1334e ] The ChipIdea IRQ is disabled before scheduling the otg work and re-enabled on otg work completion. However if the job is already scheduled we have to undo the effect of disable_irq int order to balance the IRQ disable-depth value. Fixes: be6b0c1bd0be ("usb: chipidea: using one inline function to cover queue work operations") Signed-off-by: Loic Poulain Signed-off-by: Peter Chen Signed-off-by: Sasha Levin --- drivers/usb/chipidea/otg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/usb/chipidea/otg.h b/drivers/usb/chipidea/otg.h index 9ecb598e48f0..a5557c70034a 100644 --- a/drivers/usb/chipidea/otg.h +++ b/drivers/usb/chipidea/otg.h @@ -20,7 +20,8 @@ void ci_handle_vbus_change(struct ci_hdrc *ci); static inline void ci_otg_queue_work(struct ci_hdrc *ci) { disable_irq_nosync(ci->irq); - queue_work(ci->wq, &ci->work); + if (queue_work(ci->wq, &ci->work) == false) + enable_irq(ci->irq); } #endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */