From patchwork Thu Jun 18 00:49:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taku Izumi X-Patchwork-Id: 6632401 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EF77A9F358 for ; Thu, 18 Jun 2015 00:55:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 159B9207E7 for ; Thu, 18 Jun 2015 00:55:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D7C94207E5 for ; Thu, 18 Jun 2015 00:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753846AbbFRAy0 (ORCPT ); Wed, 17 Jun 2015 20:54:26 -0400 Received: from mgwym04.jp.fujitsu.com ([211.128.242.43]:52903 "EHLO mgwym04.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753227AbbFRAx3 (ORCPT ); Wed, 17 Jun 2015 20:53:29 -0400 Received: from yt-mxauth.gw.nic.fujitsu.com (unknown [192.168.229.68]) by mgwym04.jp.fujitsu.com with smtp id 7b77_18d2_781da8ed_aa41_4e17_b820_05710689d0f3; Thu, 18 Jun 2015 09:53:26 +0900 Received: from m3050.s.css.fujitsu.com (msm.b.css.fujitsu.com [10.134.21.208]) by yt-mxauth.gw.nic.fujitsu.com (Postfix) with ESMTP id 4B02CAC0D46; Thu, 18 Jun 2015 09:53:25 +0900 (JST) Received: from localhost.localdomain (unknown [10.124.196.197]) by m3050.s.css.fujitsu.com (Postfix) with ESMTP id 1B71016E; Thu, 18 Jun 2015 09:53:25 +0900 (JST) From: Taku Izumi To: platform-driver-x86@vger.kernel.org, dvhart@infradead.org Cc: rkhan@redhat.com, alexander.h.duyck@redhat.com, netdev@vger.kernel.org, linux-acpi@vger.kernel.org, Taku Izumi Subject: [PATCH 17/22] fjes: force_close_task Date: Thu, 18 Jun 2015 09:49:42 +0900 Message-Id: <1434588587-25655-17-git-send-email-izumi.taku@jp.fujitsu.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434588587-25655-1-git-send-email-izumi.taku@jp.fujitsu.com> References: <1434588359-25589-1-git-send-email-izumi.taku@jp.fujitsu.com> <1434588587-25655-1-git-send-email-izumi.taku@jp.fujitsu.com> X-TM-AS-MML: disable Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds force_close_task. This task is used to close network device forcibly. Signed-off-by: Taku Izumi --- drivers/platform/x86/fjes/fjes.h | 1 + drivers/platform/x86/fjes/fjes_main.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/drivers/platform/x86/fjes/fjes.h b/drivers/platform/x86/fjes/fjes.h index 1a880a0..e50fd01 100644 --- a/drivers/platform/x86/fjes/fjes.h +++ b/drivers/platform/x86/fjes/fjes.h @@ -49,6 +49,7 @@ struct fjes_adapter { unsigned long rx_last_jiffies; bool unset_rx_last; + struct work_struct force_close_task; bool force_reset; bool open_guard; diff --git a/drivers/platform/x86/fjes/fjes_main.c b/drivers/platform/x86/fjes/fjes_main.c index 8e78014..3931bcc 100644 --- a/drivers/platform/x86/fjes/fjes_main.c +++ b/drivers/platform/x86/fjes/fjes_main.c @@ -56,6 +56,7 @@ static netdev_tx_t fjes_xmit_frame(struct sk_buff *, struct net_device *); static void fjes_raise_intr_rxdata_task(struct work_struct *); static void fjes_tx_stall_task(struct work_struct *); +static void fjes_force_close_task(struct work_struct *); static irqreturn_t fjes_intr(int, void*); static struct rtnl_link_stats64 *fjes_get_stats64(struct net_device *, struct rtnl_link_stats64 *); @@ -509,6 +510,17 @@ static void fjes_tx_stall_task(struct work_struct *work) queue_work(adapter->txrx_wq, &adapter->tx_stall_task); } +static void fjes_force_close_task(struct work_struct *work) +{ + struct fjes_adapter *adapter = container_of(work, + struct fjes_adapter, force_close_task); + struct net_device *netdev = adapter->netdev; + + rtnl_lock(); + dev_close(netdev); + rtnl_unlock(); +} + static void fjes_raise_intr_rxdata_task(struct work_struct *work) { struct fjes_adapter *adapter = container_of(work, @@ -1053,6 +1065,7 @@ static int fjes_probe(struct platform_device *plat_dev) if (err) goto err_sw_init; + INIT_WORK(&adapter->force_close_task, fjes_force_close_task); adapter->force_reset = false; adapter->open_guard = false;