From patchwork Wed Nov 27 20:30:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180352 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp6683410ilf; Wed, 27 Nov 2019 13:35:44 -0800 (PST) X-Google-Smtp-Source: APXvYqyJKT/zAyWTOqX0k6kwESNmwNQNX06PqhhvZbXr29tb0BMp/8p4L/8sHDphFpR4lroCg8Lt X-Received: by 2002:a17:907:11cc:: with SMTP id va12mr31607033ejb.164.1574890544081; Wed, 27 Nov 2019 13:35:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890544; cv=none; d=google.com; s=arc-20160816; b=FaDpYBSRxO8fuuIf16VVLcPd7PyVsgUSe4rk0srbXA61B6xgJpoejyYg2peE+FPbze D74jtKS4xybTzVrpJ4G3vouGDo1PvSWgMfZcmDzzklksXVJVL8t2pezv5YtxeoPJNLeu hUocRlTD/DBeYwaUAS67znJ9XpsPKmrNGjamzeXvLCiYoNaQYubjAOMj4w21nydvaDsk QLO1wT3LPAs7AEfyJicIpiVYzKTSXTxY6Xlc4klEXGx510WKn3lnpHiwq523RYECtgB+ 8v/rjUq4z9JZgxRmols603ACD9hgyJaG82iYGCjwgeMOD55WZK7hdb+0HujQ+Vby8+PG vlHA== 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=fnTYu1ulmmQEp7CT4KHew8/Z23nI9YA/sw0yHSCB6Ck=; b=jbOMBC2TrauS+b7u8tgu1z1VsihU+G9F/ljettf09Ixq3ctoPoCufAAxgV/TqOY+Th Nb7pa6Yn6UoK/futGG6KtvpiOxNif96HyS3+2Su464/d9ZSJI5V8gxOF/5DVrMURPRpd 7IloPu6W1l3Vhw4JO74Bd7eIGweWocWmzpFhUBRpKS2X7J+zAv49MObl2lSCKWkYgD61 KQ1MzwP7Kyq3Cq8bNds9lDMSpqm+Ti2ubCM/Zr+u/7EVnu6GGk7JiGN4htX7gnhf1N2d vt1sOmS2+9LvpU/o14HCWfoHcyVp1ESr9t8RRcA+IeAa199w/RgMDRsM9YSi1n2dnhPE cfog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=H6KuFrB9; 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 bt15si271915edb.259.2019.11.27.13.35.43; Wed, 27 Nov 2019 13:35:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=H6KuFrB9; 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 S1730744AbfK0Vfm (ORCPT + 26 others); Wed, 27 Nov 2019 16:35:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:34716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730212AbfK0UtO (ORCPT ); Wed, 27 Nov 2019 15:49:14 -0500 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 1F662217C3; Wed, 27 Nov 2019 20:49:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574887753; bh=lMd0ULnEjuLF1xXeEfYBsc42wu6keCNdLjOP6QIpqZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H6KuFrB9TRNE2kkz4OYYV4K5HyOD+jXf1VztO/anFY4IKTk8JG2R2yj7QSJrC1h7g h+IRzJ35GKSXibzVmnnUi3DouNir7ZyxrG4z2mwld1s0GzGDCD/8WiZfw1up8xMDgk 8n+kOmHMw8DkmhfEK0Jumh/trRHlZcZsAY0QL9rk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ivan Khoronzhuk , Grygorii Strashko , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 080/211] net: ethernet: ti: cpsw: unsync mcast entries while switch promisc mode Date: Wed, 27 Nov 2019 21:30:13 +0100 Message-Id: <20191127203101.351058354@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203049.431810767@linuxfoundation.org> References: <20191127203049.431810767@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: 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.20.1 diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 8cb44eabc2835..a44838aac97de 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -601,6 +601,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 Nov 27 20:30: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: 180325 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp6638263ilf; Wed, 27 Nov 2019 12:51:49 -0800 (PST) X-Google-Smtp-Source: APXvYqwQhJNvRd+zc5FyD3eeH1SEED6d03U++xaq4qdBUrZx/KFEOqLnmxgHfxXZV8WMPi2/HzpB X-Received: by 2002:a50:b626:: with SMTP id b35mr34403752ede.183.1574887909149; Wed, 27 Nov 2019 12:51:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574887909; cv=none; d=google.com; s=arc-20160816; b=qsTDwYvdMzzajnigU8t6GEptgWnlTdzLN07LyT8lS/2M4/GLEAQqK+TMFvCnsNy3lh TCLBcLJlrjfdAnhZDdvX/ZtoRwdk1cyDhPHpY+VuwIuAE/CaUi7TNSyc/2Okvnf70Rf/ uZdIL/YcCYvNbdsVH0x9SUWlwR/eOxERLyVcbDckxYZ0oefhtMqx4XoWtNF7X6lQrhso wQ3hM/HriHLvFVM+zeWELM8m7uw3uvaLqtNmoU9mk3k9y7BucpLtUJZ2euo2/mjwkGOZ ZsanPgndHsfbbPpTGc+Tevga90nRZvyoR7e3JG7Vzp3EErRRIRKb8rPd4FVPBFND/iXB Fksw== 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=jz//2/zmF1uLNex+dP9eVNW00/XTGI0+qNVcAIq846Y=; b=i6wasobmremXfP867bcmpSpe9hrEt1I+dhDhZYVlmXsb467RIbiuJbxNP8oOP8nk+v Qr5KLk6pDq7u7No5nEBnM3MAil1RMXLpsX6m9Si3oNrjPawpJi3XmZg5NeXcZdR+Zm30 zltp6HtleS7WbCVQORlReBbw2+BpU/ecY8wqgzWuF95HrUjWbShN4km38fcN36OJE3Lj g+Xq8MEOvnEQlHe9wVzB57EbeABY/zH/1Pn69/zbe3RcY4Sb2i1RY48h+Qs24PiIeVgl aUYDavMSrtgzkNYmZ5n9VTqBKsvqp8SIDMtwzVxP/oA/lomn+nF+PtIZyGjlLFJlIrtP 9Kmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qJ9feTuZ; 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 r8si3932684edp.343.2019.11.27.12.51.48; Wed, 27 Nov 2019 12:51:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qJ9feTuZ; 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 S1730535AbfK0Uvr (ORCPT + 26 others); Wed, 27 Nov 2019 15:51:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:38632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730519AbfK0Uvo (ORCPT ); Wed, 27 Nov 2019 15:51:44 -0500 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 2832B21850; Wed, 27 Nov 2019 20:51:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574887903; bh=NjWy5znEkoWXqsJzxRB5cmvhQBP3xr8ifrgF/0d3lR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qJ9feTuZMp0dR3VBrbKEQOMG6SYWXAliVWa0ovxYus+yj96FH8T8N+NrAf77SxLC0 JKCjV6SEENcciUcIpJDRhvi0NbHzLRPmmRSV87P3VGnXqD8D4//swaOIVgNLyJ8c6G kHzZz6PBbeQX43rZhpj7qFtxTuh7qepbqJzda6xk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Wolfram Sang , Sasha Levin Subject: [PATCH 4.14 098/211] i2c: uniphier-f: make driver robust against concurrency Date: Wed, 27 Nov 2019 21:30:31 +0100 Message-Id: <20191127203102.959083592@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203049.431810767@linuxfoundation.org> References: <20191127203049.431810767@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: Masahiro Yamada [ Upstream commit f1fdcbbdf45d9609f3d4063b67e9ea941ba3a58f ] This is unlikely to happen, but it is possible for a CPU to enter the interrupt handler just after wait_for_completion_timeout() has expired. If this happens, the hardware is accessed from multiple contexts concurrently. Disable the IRQ after wait_for_completion_timeout(), and do nothing from the handler when the IRQ is disabled. Fixes: 6a62974b667f ("i2c: uniphier_f: add UniPhier FIFO-builtin I2C driver") Signed-off-by: Masahiro Yamada Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-uniphier-f.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/i2c/busses/i2c-uniphier-f.c b/drivers/i2c/busses/i2c-uniphier-f.c index bc26ec822e268..b9a0690b4fd73 100644 --- a/drivers/i2c/busses/i2c-uniphier-f.c +++ b/drivers/i2c/busses/i2c-uniphier-f.c @@ -98,6 +98,7 @@ struct uniphier_fi2c_priv { unsigned int flags; unsigned int busy_cnt; unsigned int clk_cycle; + spinlock_t lock; /* IRQ synchronization */ }; static void uniphier_fi2c_fill_txfifo(struct uniphier_fi2c_priv *priv, @@ -162,7 +163,10 @@ static irqreturn_t uniphier_fi2c_interrupt(int irq, void *dev_id) struct uniphier_fi2c_priv *priv = dev_id; u32 irq_status; + spin_lock(&priv->lock); + irq_status = readl(priv->membase + UNIPHIER_FI2C_INT); + irq_status &= priv->enabled_irqs; dev_dbg(&priv->adap.dev, "interrupt: enabled_irqs=%04x, irq_status=%04x\n", @@ -230,6 +234,8 @@ static irqreturn_t uniphier_fi2c_interrupt(int irq, void *dev_id) goto handled; } + spin_unlock(&priv->lock); + return IRQ_NONE; data_done: @@ -246,6 +252,8 @@ static irqreturn_t uniphier_fi2c_interrupt(int irq, void *dev_id) handled: uniphier_fi2c_clear_irqs(priv); + spin_unlock(&priv->lock); + return IRQ_HANDLED; } @@ -311,7 +319,7 @@ static int uniphier_fi2c_master_xfer_one(struct i2c_adapter *adap, { struct uniphier_fi2c_priv *priv = i2c_get_adapdata(adap); bool is_read = msg->flags & I2C_M_RD; - unsigned long time_left; + unsigned long time_left, flags; dev_dbg(&adap->dev, "%s: addr=0x%02x, len=%d, stop=%d\n", is_read ? "receive" : "transmit", msg->addr, msg->len, stop); @@ -342,6 +350,12 @@ static int uniphier_fi2c_master_xfer_one(struct i2c_adapter *adap, priv->membase + UNIPHIER_FI2C_CR); time_left = wait_for_completion_timeout(&priv->comp, adap->timeout); + + spin_lock_irqsave(&priv->lock, flags); + priv->enabled_irqs = 0; + uniphier_fi2c_set_irqs(priv); + spin_unlock_irqrestore(&priv->lock, flags); + if (!time_left) { dev_err(&adap->dev, "transaction timeout.\n"); uniphier_fi2c_recover(priv); @@ -546,6 +560,7 @@ static int uniphier_fi2c_probe(struct platform_device *pdev) priv->clk_cycle = clk_rate / bus_speed; init_completion(&priv->comp); + spin_lock_init(&priv->lock); priv->adap.owner = THIS_MODULE; priv->adap.algo = &uniphier_fi2c_algo; priv->adap.dev.parent = dev; From patchwork Wed Nov 27 20:30:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180327 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp6638370ilf; Wed, 27 Nov 2019 12:51:57 -0800 (PST) X-Google-Smtp-Source: APXvYqykCX7nL+drvTPaMP7BhDpQZZSLN6uWmSgBTZeEaxEy8R1BqUdYzY6uoSp45JH7Pq4gGFQh X-Received: by 2002:a17:906:f245:: with SMTP id gy5mr7631201ejb.225.1574887917588; Wed, 27 Nov 2019 12:51:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574887917; cv=none; d=google.com; s=arc-20160816; b=XuMEfopJJSskfwq74Yg+/JUXWYI6S2ZBAQ7nPaZCrUL+LY2p6gpyJbhDLYy/Q9uTah Qm3D84WR+qlf17VAnRl0ngmTZyiutOJoaMv1o/wyQMCl/iVaYGOMjzCTPkyLw/10hai0 o8bY21mML0+xhUFJU7NH4vUxUmh+NWU33w/Ti4r4KHHkh91GUWZgzVvFBBIdO6ODOG07 F/0q288+y2XIa4FYA/UGh5RtX5Cx7Vp6sMflXC3Cx6UtfrWLXl77r3e2nQJJb7jry0+L sMTtbiOTW+smKQpRXIonkTe3o7nOWHRuJvOTA+wHorGvH6MOlf9SLPFAvCiGE/HqT0j2 xAjg== 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=Yv/x3n3oH1IlsHslfuGw9kEP/V8UNUAWY6fS4jVFbLY=; b=J5fOk6W7MLHoVg0NQxyE8LwfX9TsPmKwoRbEWwUQF9JNKcTj0ptmNihWRIF49ZoCty 3ibMu22DuEqE6BmeG7lKJrJbCbJEEFi8gdzjwdaTY+PObRYSHjNc6ahDQUCkPNEYKbuW OSV6aDQs/HXtk6VWSOZVy6MO5vzLsOIfBCVmcYSFZnWH6ElfsQeKhJKzZ92FpKKsHO3r krgdW/5vaDPAUfNsBNBXU3BLQrjvn5LakToF9Me8O5XJUQlANH7D7/lZ2n0l4p/hUYik py21C5ZhQsD29erWMfN/OzEMtvd+5DEq5g/+RJfQTqHFLa9KNl5LVR0EfRdgf39ASb4y nP7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U0XxXbDe; 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 u25si12479645edt.225.2019.11.27.12.51.57; Wed, 27 Nov 2019 12:51:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U0XxXbDe; 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 S1730540AbfK0Uvx (ORCPT + 26 others); Wed, 27 Nov 2019 15:51:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:38858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728358AbfK0Uvt (ORCPT ); Wed, 27 Nov 2019 15:51:49 -0500 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 3988B21871; Wed, 27 Nov 2019 20:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574887908; bh=by66fafWIkFfkatStvHYRKlIhFEru2T56686wGJEHj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U0XxXbDeFnHpQm3Yr1y3JgWSudMY/vRnkB+ZQ/s+DLDoq4TFiPM/SbDLD9bRGQyLj rW6cch3B1Ptp1zsCKY86DtQliSNM1C3l5p6h2hLPy2R8KO9Y0g22yDSw+SZO3Ty5n+ BNbBlIjLuCFxxzNyFWyodOBzKNOvwCvfsI9zXKKY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Wolfram Sang , Sasha Levin Subject: [PATCH 4.14 100/211] i2c: uniphier-f: fix race condition when IRQ is cleared Date: Wed, 27 Nov 2019 21:30:33 +0100 Message-Id: <20191127203103.134044152@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203049.431810767@linuxfoundation.org> References: <20191127203049.431810767@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: Masahiro Yamada [ Upstream commit eaba68785c2d24ebf1f0d46c24e11b79cc2f94c7 ] The current IRQ handler clears all the IRQ status bits when it bails out. This is dangerous because it might clear away the status bits that have just been set while processing the current handler. If this happens, the IRQ event for the latest transfer is lost forever. The IRQ status bits must be cleared *before* the next transfer is kicked. Fixes: 6a62974b667f ("i2c: uniphier_f: add UniPhier FIFO-builtin I2C driver") Signed-off-by: Masahiro Yamada Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-uniphier-f.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/drivers/i2c/busses/i2c-uniphier-f.c b/drivers/i2c/busses/i2c-uniphier-f.c index bbd5b137aa216..928ea9930d17e 100644 --- a/drivers/i2c/busses/i2c-uniphier-f.c +++ b/drivers/i2c/busses/i2c-uniphier-f.c @@ -143,9 +143,10 @@ static void uniphier_fi2c_set_irqs(struct uniphier_fi2c_priv *priv) writel(priv->enabled_irqs, priv->membase + UNIPHIER_FI2C_IE); } -static void uniphier_fi2c_clear_irqs(struct uniphier_fi2c_priv *priv) +static void uniphier_fi2c_clear_irqs(struct uniphier_fi2c_priv *priv, + u32 mask) { - writel(-1, priv->membase + UNIPHIER_FI2C_IC); + writel(mask, priv->membase + UNIPHIER_FI2C_IC); } static void uniphier_fi2c_stop(struct uniphier_fi2c_priv *priv) @@ -172,6 +173,8 @@ static irqreturn_t uniphier_fi2c_interrupt(int irq, void *dev_id) "interrupt: enabled_irqs=%04x, irq_status=%04x\n", priv->enabled_irqs, irq_status); + uniphier_fi2c_clear_irqs(priv, irq_status); + if (irq_status & UNIPHIER_FI2C_INT_STOP) goto complete; @@ -250,8 +253,6 @@ static irqreturn_t uniphier_fi2c_interrupt(int irq, void *dev_id) } handled: - uniphier_fi2c_clear_irqs(priv); - spin_unlock(&priv->lock); return IRQ_HANDLED; @@ -340,7 +341,7 @@ static int uniphier_fi2c_master_xfer_one(struct i2c_adapter *adap, priv->flags |= UNIPHIER_FI2C_STOP; reinit_completion(&priv->comp); - uniphier_fi2c_clear_irqs(priv); + uniphier_fi2c_clear_irqs(priv, U32_MAX); writel(UNIPHIER_FI2C_RST_TBRST | UNIPHIER_FI2C_RST_RBRST, priv->membase + UNIPHIER_FI2C_RST); /* reset TX/RX FIFO */ From patchwork Wed Nov 27 20:30:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180322 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp6636972ilf; Wed, 27 Nov 2019 12:50:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxdP2EDyKfDztCNtsiVc0vwUjdax4Ju0SWl3S28pr6sWkqR1vI8hE+vlM3sYQL8ZET6X766 X-Received: by 2002:a17:906:5c0d:: with SMTP id e13mr49435790ejq.82.1574887818357; Wed, 27 Nov 2019 12:50:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574887818; cv=none; d=google.com; s=arc-20160816; b=Pb84Ph3249L8bJceH3Sem/L3sjacLucqVqSp8Ka8BV4k29EfBW0OxP5rq/TV4E1BMo T1hdzCSg0L156Hb5pCP+UGpXlxsD4i4xyH/iBWkKTNXxdR0mzKzW0nXQw2dvnN0z8taf /t1AVYPcCbpA9C2lvflwowf+/cdoDp2shPkP2ptl1mKTs5h34/N5JssjxCsMzMXr9AEu NIh//6sWJjJlB8vgDHRP97BzPw56pRwE6VUXFDaUzhad3pZiWULZ4QJHKKKPveSkjjO9 UDpAuzQNrznN7gFk9E0fNgRIFZt3t4HrKf0tqEVMUEEa19tXLtmmNIcCf992JZLA3BO0 sO8g== 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=7bia1O60XMjofHErHS4nkts/a4chNXtZulNMK/tyIdk=; b=ZFNwE7lrtqNPJidZkIwXpp/opyOyP2f5IlD4m3reOmqgV9iV1Xe228vGiSsgljJ/yS o+5QEWemWIkVFQuJjztSwG/GpYfHgqvrA2pQcltRJEbH26b4kXGMwXFf8wWkqPN5eDEx O9NfRQJzeBdfkRI+EnQiE/yXzOG2LVYS5DEPtPgGXtiY1/+UmPa/G5CuFNj6eu2vs/3l 1zePBcoCD7Id2Oxlb9hM3UdOwjL1aV1gGbYbYKSoTj6hZyBR1jgGBavorQWttvfdrDko S0xOlRobW2eKY5b/xEEfcRfLQH7K+v7YqOhw0irw3VbhWhxSL8yYcUI/gf5OO8YMtPhC ZnrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SFH2UYN7; 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 o21si11046986edt.135.2019.11.27.12.50.18; Wed, 27 Nov 2019 12:50:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SFH2UYN7; 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 S1729850AbfK0UuP (ORCPT + 26 others); Wed, 27 Nov 2019 15:50:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:35984 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729907AbfK0UuK (ORCPT ); Wed, 27 Nov 2019 15:50:10 -0500 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 A265721843; Wed, 27 Nov 2019 20:50:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574887810; bh=+jRBefN1uwEbzARKvRxsl294CfyeOzMo4klRHllFCY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SFH2UYN7fkXj1Jo8Zy0vWgFIRnF9knI1hMsY5raImIynlnC5Hg+IduICbHJLtb2LU me9r3TdYrNo3F5z7rncunaqGIUAQ6YLXkoElJ/SYmuciJKzlytCYkBwMH6oBVDVhoT zF9p7jlpBuRFunpU7cx5Yg1mZ0h7HLGl5Xkzji2M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joel Stanley , Michael Ellerman , Sasha Levin Subject: [PATCH 4.14 104/211] selftests/powerpc/signal: Fix out-of-tree build Date: Wed, 27 Nov 2019 21:30:37 +0100 Message-Id: <20191127203103.526628802@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203049.431810767@linuxfoundation.org> References: <20191127203049.431810767@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: Joel Stanley [ Upstream commit 27825349d7b238533a47e3d98b8bb0efd886b752 ] We should use TEST_GEN_PROGS, not TEST_PROGS. That tells the selftests makefile (lib.mk) that those tests are generated (built), and so it adds the $(OUTPUT) prefix for us, making the out-of-tree build work correctly. It also means we don't need our own clean rule, lib.mk does it. We also have to update the signal_tm rule to use $(OUTPUT). Signed-off-by: Joel Stanley Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- tools/testing/selftests/powerpc/signal/Makefile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) -- 2.20.1 diff --git a/tools/testing/selftests/powerpc/signal/Makefile b/tools/testing/selftests/powerpc/signal/Makefile index a7cbd5082e271..4213978f3ee2c 100644 --- a/tools/testing/selftests/powerpc/signal/Makefile +++ b/tools/testing/selftests/powerpc/signal/Makefile @@ -1,14 +1,9 @@ # SPDX-License-Identifier: GPL-2.0 -TEST_PROGS := signal signal_tm - -all: $(TEST_PROGS) - -$(TEST_PROGS): ../harness.c ../utils.c signal.S +TEST_GEN_PROGS := signal signal_tm CFLAGS += -maltivec -signal_tm: CFLAGS += -mhtm +$(OUTPUT)/signal_tm: CFLAGS += -mhtm include ../../lib.mk -clean: - rm -f $(TEST_PROGS) *.o +$(TEST_GEN_PROGS): ../harness.c ../utils.c signal.S From patchwork Wed Nov 27 20:31:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180323 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp6637910ilf; Wed, 27 Nov 2019 12:51:25 -0800 (PST) X-Google-Smtp-Source: APXvYqzBRbPAQFbz8HLbJAZxyo9AkbI09lADsrbSYwV4yklNA/ZI9j+HNUWsmnsjNw5kkJUooJS7 X-Received: by 2002:a05:6402:1694:: with SMTP id a20mr34415564edv.211.1574887885115; Wed, 27 Nov 2019 12:51:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574887885; cv=none; d=google.com; s=arc-20160816; b=ZFxMygPX0Qfa2wht4AskZvJ4DdROj74OKpj1QT2YQ9AEasqasj6ccFjYgPICw/t/nf zqngAaV2eV4rQ8ZAjaS2M46R1wcoSrzUZFddlj1t4fK67A1EWx9Et6XceKzmUjdk769q Un7lCVtQX28EbBAGZ4V/+wjXzfCbzUUyZYwP+dK9lm+/crXvPEc5CTWbCuPh1xsWapCj rrqdgvKiQt1HuQt0x0ItJp4WJm3SAhVK0p3yJPhrcGXIpL5YomG1EiLpPJMHh39Clfwn c4HXyN9dD87ALENHju0hADJJXBHQ2IVwPoW0SbE2c58rzYwr4FlOUA2CWGr9F3cbEdSV t0sA== 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=4euF3goeXv8bS5dGUnXytWJsRHSsiBGfK8YmfmXVfUs=; b=KB/e+x7rS4QLMoGsHVoK8ZI3LNRvJ+2945OeGvib3nDmBnvETD8MLquRNqZoeUu0Lm uV/F9r5G7Efp/zxEaTqRiFjdRMU8vhBRCpQW5rQ2IYmpdkAQv4dqJJhL+dghIOSg+Xbp oAkVcLaAEsSgdTESpMi+KXyzRDzSiucH7dBKxFEh6ybPclqAINhkFJ62M9aRLQl8FcJU XRhU2IRE3HxEQu0uFPNXu5Og1ibqz7PQi/eVfcTFu+CR7kNpvb8muzI05J/FFbZ8VxuC YrqxuHwntt5tOMAh/nEoXQkFeGCrxl/WtUy/txtkhS17GqXK/a6HPAcQJ4niWwT+FwDy +3ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vYqPotm8; 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 x14si12008348edl.128.2019.11.27.12.51.24; Wed, 27 Nov 2019 12:51:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vYqPotm8; 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 S1729251AbfK0UvX (ORCPT + 26 others); Wed, 27 Nov 2019 15:51:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:37976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730462AbfK0UvU (ORCPT ); Wed, 27 Nov 2019 15:51:20 -0500 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 6F6132184C; Wed, 27 Nov 2019 20:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574887879; bh=Y4lAoQyQxZwgpe8S14AlWKNoT/13S/b0oclnwxddKWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vYqPotm8GTsuqhrJ7qaPf0UmjPoKpl5O2H5OXmYS5Z2xQJlN8D1K40oEgS+XGLX1G iKhgrBiKfeAu8w2/5ZeJI59Lg2j2YulA3/Y9KfGF7vdbmUy6GIEYziuMnTpPWMCVoT Z2O42BL3hVM0c9aojzB7vW5EKch0uEvjDvoLmISI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 129/211] openvswitch: fix linking without CONFIG_NF_CONNTRACK_LABELS Date: Wed, 27 Nov 2019 21:31:02 +0100 Message-Id: <20191127203106.276796645@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203049.431810767@linuxfoundation.org> References: <20191127203049.431810767@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 a277d516de5f498c91d91189717ef7e01102ad27 ] When CONFIG_CC_OPTIMIZE_FOR_DEBUGGING is enabled, the compiler fails to optimize out a dead code path, which leads to a link failure: net/openvswitch/conntrack.o: In function `ovs_ct_set_labels': conntrack.c:(.text+0x2e60): undefined reference to `nf_connlabels_replace' In this configuration, we can take a shortcut, and completely remove the contrack label code. This may also help the regular optimization. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/openvswitch/conntrack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c index 0171b27a2b81b..48d81857961ca 100644 --- a/net/openvswitch/conntrack.c +++ b/net/openvswitch/conntrack.c @@ -1083,7 +1083,8 @@ static int ovs_ct_commit(struct net *net, struct sw_flow_key *key, &info->labels.mask); if (err) return err; - } else if (labels_nonzero(&info->labels.mask)) { + } else if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) && + labels_nonzero(&info->labels.mask)) { err = ovs_ct_set_labels(ct, key, &info->labels.value, &info->labels.mask); if (err) From patchwork Wed Nov 27 20:31:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180324 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp6638084ilf; Wed, 27 Nov 2019 12:51:36 -0800 (PST) X-Google-Smtp-Source: APXvYqwFcOeWpFsvz1a9wCLzQjaDfUEFrlqD0tVEBbdhozf21h7DAzMZCK0KH7NAeuKxeSjXvV1V X-Received: by 2002:aa7:cac7:: with SMTP id l7mr34545488edt.196.1574887896147; Wed, 27 Nov 2019 12:51:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574887896; cv=none; d=google.com; s=arc-20160816; b=ghDPfafPOWzwgxtNMVfBYkGW54GJi4CbwVQXrC5ws9E7/wzbjxVnLQWwzyB9aQS7DH QdWk3EoVIIOgu1A4CJdh4QX4FSl8t/wLArXYPKlQtqeAlJfztzFCl67Upf2lRp4eqFhp nhtvSghr+KZtDoq0pspTv62PHQ3uAx+tXjmYGwZHgUcYCYwxe9cc7/29rE2s2o0Djel0 qECKjhgDURK6kd+/E6tZLTtF/cpqx15zEAc3zcmQ8wZomA3TthUNQ51jBicPFrcDGYlV H+U4QwBJhZISUwisDeT5D0+69Wd5ZVesmHp19Jh93LswONQeXi6K5/Sk24HIpiDNMxP5 Kgtw== 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=MF7EUjgkLxFmiuZkCElusTmEkiOe6yQYYugLOR//FKQ=; b=C33tORx27pgFIziA3DWj+ckXuU/mIV0Jxz5J2dnowQb8MAIGHcIIEjYMOcSovceBOJ aEIPGi7Eb49ji0tlvAxSxdADOJfV1cMAxdZ/wBElv0l1uEQQDHrbO7wxP6YRhHpKpdfx RcojEzdN8l822gI//x878KhEVbJvAF6kizoVAJa9uso8i185qI09PpBEsLgh3CNo2/jJ 7gntHo/wbtUjtuYXKou3iagyEbrEK1gNqxmOLP/ZhH0dLRpAYw9rEk+AgW8cpIO6hN+d 2GZpo4brej/BCIw9eHQsvBJZnnqsvlGTHrPUJXEFOmJ2WCOZaawT5uw4RLIWyXwOBgIZ R6tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zNGSA3f6; 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 p92si12059751edd.407.2019.11.27.12.51.35; Wed, 27 Nov 2019 12:51:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zNGSA3f6; 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 S1730498AbfK0Uvd (ORCPT + 26 others); Wed, 27 Nov 2019 15:51:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:38258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730490AbfK0Uva (ORCPT ); Wed, 27 Nov 2019 15:51:30 -0500 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 610682084D; Wed, 27 Nov 2019 20:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574887889; bh=e0kwQxqjl/q5q36XpJycaaUijSZMetJRcSRLw0P4rkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zNGSA3f6nTzl6qLfsC/XwtWchdVBvyBusLhvqYLM6ZZ+Wb5+MUkrfYHuqe+PNEVnR 0Jw1lvaIixoQrgOAKW5hHpqKJR+pw46qCAgDnOP46jOFTwHsMX0fiU+fzaVoiMb0Vf Er9j6S/5OH70e+pxOAapIIHOHwWcQIgGXBZLDhS4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nikolay Borisov , Changbin Du , Arnd Bergmann , David Sterba , Sasha Levin Subject: [PATCH 4.14 132/211] btrfs: avoid link error with CONFIG_NO_AUTO_INLINE Date: Wed, 27 Nov 2019 21:31:05 +0100 Message-Id: <20191127203106.519625908@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203049.431810767@linuxfoundation.org> References: <20191127203049.431810767@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 7e17916b35797396f681a3270245fd29c1e4c250 ] Note: this patch fixes a problem in a feature outside of btrfs ("kernel hacking: add a config option to disable compiler auto-inlining") and is applied ahead of time due to cross-subsystem dependencies. On 32-bit ARM with gcc-8, I see a link error with the addition of the CONFIG_NO_AUTO_INLINE option: fs/btrfs/super.o: In function `btrfs_statfs': super.c:(.text+0x67b8): undefined reference to `__aeabi_uldivmod' super.c:(.text+0x67fc): undefined reference to `__aeabi_uldivmod' super.c:(.text+0x6858): undefined reference to `__aeabi_uldivmod' super.c:(.text+0x6920): undefined reference to `__aeabi_uldivmod' super.c:(.text+0x693c): undefined reference to `__aeabi_uldivmod' fs/btrfs/super.o:super.c:(.text+0x6958): more undefined references to `__aeabi_uldivmod' follow So far this is the only file that shows the behavior, so I'd propose to just work around it by marking the functions as 'static inline' that normally get inlined here. The reference to __aeabi_uldivmod comes from a div_u64() which has an optimization for a constant division that uses a straight '/' operator when the result should be known to the compiler. My interpretation is that as we turn off inlining, gcc still expects the result to be constant but fails to use that constant value. Link: https://lkml.kernel.org/r/20181103153941.1881966-1-arnd@arndb.de Reviewed-by: Nikolay Borisov Reviewed-by: Changbin Du Signed-off-by: Arnd Bergmann [ add the note ] Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/super.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 49a02bf091aea..204d585e012a8 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1863,7 +1863,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) } /* Used to sort the devices by max_avail(descending sort) */ -static int btrfs_cmp_device_free_bytes(const void *dev_info1, +static inline int btrfs_cmp_device_free_bytes(const void *dev_info1, const void *dev_info2) { if (((struct btrfs_device_info *)dev_info1)->max_avail > @@ -1892,8 +1892,8 @@ static inline void btrfs_descending_sort_devices( * The helper to calc the free space on the devices that can be used to store * file data. */ -static int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info, - u64 *free_bytes) +static inline int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info, + u64 *free_bytes) { struct btrfs_device_info *devices_info; struct btrfs_fs_devices *fs_devices = fs_info->fs_devices;