From patchwork Fri Aug 21 08:29:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taku Izumi X-Patchwork-Id: 7049961 Return-Path: X-Original-To: patchwork-platform-driver-x86@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 280CB9F373 for ; Fri, 21 Aug 2015 08:36:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4CF9D204D3 for ; Fri, 21 Aug 2015 08:36:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5A80F20253 for ; Fri, 21 Aug 2015 08:36:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753630AbbHUIf6 (ORCPT ); Fri, 21 Aug 2015 04:35:58 -0400 Received: from mgwym04.jp.fujitsu.com ([211.128.242.43]:21059 "EHLO mgwym04.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753545AbbHUIfZ (ORCPT ); Fri, 21 Aug 2015 04:35:25 -0400 Received: from yt-mxoi2.gw.nic.fujitsu.com (unknown [192.168.229.69]) by mgwym04.jp.fujitsu.com with smtp id 7634_3619_870076e0_1e86_4127_86ce_1a38c639a156; Fri, 21 Aug 2015 17:35:23 +0900 Received: from m3051.s.css.fujitsu.com (m3051.s.css.fujitsu.com [10.134.21.209]) by yt-mxoi2.gw.nic.fujitsu.com (Postfix) with ESMTP id 96AC9AC0311; Fri, 21 Aug 2015 17:35:22 +0900 (JST) Received: from RX300S6 (unknown [10.124.196.197]) by m3051.s.css.fujitsu.com (Postfix) with SMTP id 56E37D7; Fri, 21 Aug 2015 17:35:21 +0900 (JST) Received: by RX300S6 (sSMTP sendmail emulation); Fri, 21 Aug 2015 17:30:29 +0900 From: Taku Izumi To: netdev@vger.kernel.org, davem@davemloft.net Cc: platform-driver-x86@vger.kernel.org, dvhart@infradead.org, rkhan@redhat.com, alexander.h.duyck@redhat.com, linux-acpi@vger.kernel.org, joe@perches.com, sergei.shtylyov@cogentembedded.com, stephen@networkplumber.org, yasu.isimatu@gmail.com, Taku Izumi Subject: [PATCH v3 20/22] fjes: epstop_task Date: Fri, 21 Aug 2015 17:29:36 +0900 Message-Id: <1440145778-15941-20-git-send-email-izumi.taku@jp.fujitsu.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1440145778-15941-1-git-send-email-izumi.taku@jp.fujitsu.com> References: <1440145680-15851-1-git-send-email-izumi.taku@jp.fujitsu.com> <1440145778-15941-1-git-send-email-izumi.taku@jp.fujitsu.com> X-TM-AS-MML: disable Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Spam-Status: No, score=-7.7 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 epstop_task. This task is used to process other receiver's cancellation request. Signed-off-by: Taku Izumi --- drivers/net/fjes/fjes_hw.c | 31 +++++++++++++++++++++++++++++++ drivers/net/fjes/fjes_hw.h | 1 + drivers/net/fjes/fjes_main.c | 1 + 3 files changed, 33 insertions(+) diff --git a/drivers/net/fjes/fjes_hw.c b/drivers/net/fjes/fjes_hw.c index 4525d36..b5f4a78 100644 --- a/drivers/net/fjes/fjes_hw.c +++ b/drivers/net/fjes/fjes_hw.c @@ -23,6 +23,7 @@ #include "fjes.h" static void fjes_hw_update_zone_task(struct work_struct *); +static void fjes_hw_epstop_task(struct work_struct *); /* supported MTU list */ const u32 fjes_support_mtu[] = { @@ -325,6 +326,7 @@ int fjes_hw_init(struct fjes_hw *hw) fjes_hw_set_irqmask(hw, REG_ICTL_MASK_ALL, true); INIT_WORK(&hw->update_zone_task, fjes_hw_update_zone_task); + INIT_WORK(&hw->epstop_task, fjes_hw_epstop_task); mutex_init(&hw->hw_info.lock); @@ -355,6 +357,7 @@ void fjes_hw_exit(struct fjes_hw *hw) fjes_hw_cleanup(hw); cancel_work_sync(&hw->update_zone_task); + cancel_work_sync(&hw->epstop_task); } static enum fjes_dev_command_response_e @@ -1092,3 +1095,31 @@ static void fjes_hw_update_zone_task(struct work_struct *work) &adapter->unshare_watch_task); } } + +static void fjes_hw_epstop_task(struct work_struct *work) +{ + struct fjes_hw *hw = container_of(work, struct fjes_hw, epstop_task); + struct fjes_adapter *adapter = (struct fjes_adapter *)hw->back; + + ulong remain_bit; + int epid_bit; + + while ((remain_bit = hw->epstop_req_bit)) { + for (epid_bit = 0; remain_bit; remain_bit >>= 1, epid_bit++) { + if (remain_bit & 1) { + hw->ep_shm_info[epid_bit]. + tx.info->v1i.rx_status |= + FJES_RX_STOP_REQ_DONE; + + clear_bit(epid_bit, &hw->epstop_req_bit); + set_bit(epid_bit, + &adapter->unshare_watch_bitmask); + + if (!work_pending(&adapter->unshare_watch_task)) + queue_work( + adapter->control_wq, + &adapter->unshare_watch_task); + } + } + } +} diff --git a/drivers/net/fjes/fjes_hw.h b/drivers/net/fjes/fjes_hw.h index e59b737..6d57b89 100644 --- a/drivers/net/fjes/fjes_hw.h +++ b/drivers/net/fjes/fjes_hw.h @@ -283,6 +283,7 @@ struct fjes_hw { unsigned long txrx_stop_req_bit; unsigned long epstop_req_bit; struct work_struct update_zone_task; + struct work_struct epstop_task; int my_epid; int max_epid; diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c index 8e3a084..5e77d0c 100644 --- a/drivers/net/fjes/fjes_main.c +++ b/drivers/net/fjes/fjes_main.c @@ -316,6 +316,7 @@ static int fjes_close(struct net_device *netdev) cancel_work_sync(&adapter->tx_stall_task); cancel_work_sync(&hw->update_zone_task); + cancel_work_sync(&hw->epstop_task); fjes_hw_wait_epstop(hw);