Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp898525imu; Tue, 11 Dec 2018 09:14:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/VPzo/pR6jX9IX1rhMLY0vEAAeVY7DEwair4MiLtTwJf+c2gGx263zvml5D6Qu2hdrt+4nc X-Received: by 2002:a63:df50:: with SMTP id h16mr15379368pgj.421.1544548484487; Tue, 11 Dec 2018 09:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544548484; cv=none; d=google.com; s=arc-20160816; b=fMI/pMm8L1g4GjgWJMSSbV3X/S3GFPkP6LeMW2Nj43MQkZX/AxRnHjgxKeNQ6OvocC WvjROqomRwK+nAY6ZYiaz/7wbnRBQTKPM0a9mGp/UN1xlIXkHuxgSPYpdVPJzJlnxOT5 Pc7Me2jG/t6oiLMuUZTFYYmf3RYgHdBZ2Pn+LvSHPofy0GbsbRTX+wYZARwo2zQGRQxW a3vNzhIR0FP9m5/LIIeQxeBAEHCMImg8oD9w6LC3DmfcP+HTOCWUiy5eQ+xuwNc9LWcK SHSZwwB1QiLEITMARzIt8si1zTFBeVQSM5ypIme48d6GZxFDJxeUb2WUmX8x1Yo4zqAU BXsg== 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=2qNh9INEMYDlvBmAXTLWcomuISFBZRYUcBehBAsgYhQ=; b=0MIulOONLxDRBtw0wH5uNpOcdFjrhMj4QvYXxa/aYKGN81zW4Ydar4ub5bXuAN8jB2 8m9l2Vczb+8akBMq9YnF57xUiCWZlttqTyW14HbZ6fWD2C64oojT2FUainUcAG5TW+TU pgPQUtTERGQP6fQ7zDMv56B2Mr1QlFGISpGVITCUmsOlnwQ/l7Lcl6shSN6EgvvkH5+Q FjePStnxi9LBbCthTxQLD2id2EFqVZAi/Uo6Ka0Ac9q0OvCVVr6jvP599WpvvZqr2bQW T3XIPmsYXn+3qyjhDKWoTzwI7CRgG3GBFck8uEDRVHp691AzUVWGd/joO5ZtkGKHWtTi 5w4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RrN69973; 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 b14si13837763pfc.156.2018.12.11.09.14.29; Tue, 11 Dec 2018 09:14: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=RrN69973; 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 S1727649AbeLKPnv (ORCPT + 99 others); Tue, 11 Dec 2018 10:43:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:60406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727627AbeLKPnt (ORCPT ); Tue, 11 Dec 2018 10:43:49 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 A308B20870; Tue, 11 Dec 2018 15:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543028; bh=+KkWSOO3i+L59g0JBEBiq0I9XqlNZBAv7BECA8Maqaw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RrN699731CUqgA1c+02iURWAdlxS9hch+Lj1GxB6xivdU3PUiMrTojV8SCn9U5xeJ WNBNp4kZqAws2jnVqzbxYWHb3sFXR+rW8ckdtVkepMBP13TeizKBpwTTrIc3pQM2N+ 15zXRgXuzEVx+vHo66kU0fZMYw2V/Or7JlGsv98M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Chen , "David S. Miller" , Sasha Levin Subject: [PATCH 3.18 38/54] net: faraday: ftmac100: remove netif_running(netdev) check before disabling interrupts Date: Tue, 11 Dec 2018 16:41:26 +0100 Message-Id: <20181211151548.232098611@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151546.010073210@linuxfoundation.org> References: <20181211151546.010073210@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 426a593e641ebf0d9288f0a2fcab644a86820220 ] In the original ftmac100_interrupt(), the interrupts are only disabled when the condition "netif_running(netdev)" is true. However, this condition causes kerenl hang in the following case. When the user requests to disable the network device, kernel will clear the bit __LINK_STATE_START from the dev->state and then call the driver's ndo_stop function. Network device interrupts are not blocked during this process. If an interrupt occurs between clearing __LINK_STATE_START and stopping network device, kernel cannot disable the interrupts due to the condition "netif_running(netdev)" in the ISR. Hence, kernel will hang due to the continuous interruption of the network device. In order to solve the above problem, the interrupts of the network device should always be disabled in the ISR without being restricted by the condition "netif_running(netdev)". [V2] Remove unnecessary curly braces. Signed-off-by: Vincent Chen Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/faraday/ftmac100.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c index 4ff1adc6bfca..9a0703f2da9a 100644 --- a/drivers/net/ethernet/faraday/ftmac100.c +++ b/drivers/net/ethernet/faraday/ftmac100.c @@ -865,11 +865,10 @@ static irqreturn_t ftmac100_interrupt(int irq, void *dev_id) struct net_device *netdev = dev_id; struct ftmac100 *priv = netdev_priv(netdev); - if (likely(netif_running(netdev))) { - /* Disable interrupts for polling */ - ftmac100_disable_all_int(priv); + /* Disable interrupts for polling */ + ftmac100_disable_all_int(priv); + if (likely(netif_running(netdev))) napi_schedule(&priv->napi); - } return IRQ_HANDLED; } -- 2.19.1