Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1155868ybt; Tue, 7 Jul 2020 08:59:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4rtRLjpZRB9hKeu9JzWdvfLaYzKIvLLCKGLv7Gs1pOFJ9VKw6bEC67Xd5RrlXigIfy/xG X-Received: by 2002:a50:aca6:: with SMTP id x35mr59881592edc.328.1594137595138; Tue, 07 Jul 2020 08:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594137595; cv=none; d=google.com; s=arc-20160816; b=JD7k9+BH0ZFzZwScO++ergNdffJNNHzII4SD13KMiKn+dewOavNUW6Pdm96zTCH0Wn AD23Moi4dg8YunyOAXsjaEjC0JEfF6ttVWTd4r7slhSHswTpu3uvtOiNPCimHr7clDpf F3eTn8Vk094WnehqOoZUqAIdtil3rcByW0315S0HVbgc8dzXEeza0yK0mfqt91sk1jLO QRmxMIe4aktNciJn0/hzVTtDL9HFrTAdhjEeyAUlBKmQDlH6/XdIvW1Mwvpu0UMfDZQ9 IANENs9B1g7k8ngcZeN30PUlBfBXeYykf1fI+qPa3Ym8oJaFUcZFSmBO4ymcY7c9FGSo 9nCA== 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 :ironport-sdr:ironport-sdr; bh=J2ogyeVIpYMC2eAqe4ub5L5+m55g32st2bKDlkGepVY=; b=D4ZazAzFSYpYcTwa03RbuyriyV8RCfiUWIqJgSsHvXpg4zjMCzod7JjqBmHNITZREG AZxHD7yx+76o72rYwBZhGbpp6v0xnXkN0ptXRxAM4sk8BhWxzRAK7N80/y7OtgJz2fqv pWqz1HmsyrtcmAAz8Xxy93CyqTPgmbkQqdZzYmkJ4F2qorE6HGmVHX9VTpA9gNPnjkTp SWo0wahex77KSxTLudR64HIzsW9FzZia8urBrYf2TUIF/h3XDd+wA5JkTSS/69WarBFA 2RCIL8d2ofX628IpM5J5q/Baaa9VOFtF9uCMlOIMbfWGCSAGZJWNwOnjCfGXhZZxheqf OLVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bk19si15677931ejb.338.2020.07.07.08.59.32; Tue, 07 Jul 2020 08:59:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728321AbgGGP7H (ORCPT + 99 others); Tue, 7 Jul 2020 11:59:07 -0400 Received: from mga18.intel.com ([134.134.136.126]:27064 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728110AbgGGP7H (ORCPT ); Tue, 7 Jul 2020 11:59:07 -0400 IronPort-SDR: zIx8mHwfzqnmQ8rGu5OH4gtH/3rAEqEwh8w7IAxA0US8qmc/ndCsYX2ifffv6/6/N+VL2d8gyc bwDE5xwx+YAg== X-IronPort-AV: E=McAfee;i="6000,8403,9675"; a="135098093" X-IronPort-AV: E=Sophos;i="5.75,324,1589266800"; d="scan'208";a="135098093" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2020 08:59:05 -0700 IronPort-SDR: ecctsqBL/nqF2OifVsSD3NjgWHb+/wN5P/fusefWSqr4U/+mBUlM7rxByfUJhOdF32llWvorQm SfiCuUYNT1Sw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,324,1589266800"; d="scan'208";a="305709944" Received: from marshy.an.intel.com ([10.122.105.159]) by fmsmga004.fm.intel.com with ESMTP; 07 Jul 2020 08:59:04 -0700 From: richard.gong@linux.intel.com To: mdf@kernel.org Cc: linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, dinguyen@kernel.org, richard.gong@linux.intel.com, richard.gong@intel.com Subject: [PATCH] fpga: stratix10-soc: make FPGA task un-interruptible Date: Tue, 7 Jul 2020 11:14:07 -0500 Message-Id: <1594138447-21488-1-git-send-email-richard.gong@linux.intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Richard Gong When CTRL+C occurs during the process of FPGA reconfiguration, the FPGA reconfiguration process stops and the user can't perform a new FPGA reconfiguration properly. Set FPGA complete task to be not interruptible so that the user can properly perform FPGA reconfiguration after CTRL+C event. Signed-off-by: Richard Gong --- drivers/fpga/stratix10-soc.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c index 44b7c56..657a70c 100644 --- a/drivers/fpga/stratix10-soc.c +++ b/drivers/fpga/stratix10-soc.c @@ -196,17 +196,13 @@ static int s10_ops_write_init(struct fpga_manager *mgr, if (ret < 0) goto init_done; - ret = wait_for_completion_interruptible_timeout( + ret = wait_for_completion_timeout( &priv->status_return_completion, S10_RECONFIG_TIMEOUT); if (!ret) { dev_err(dev, "timeout waiting for RECONFIG_REQUEST\n"); ret = -ETIMEDOUT; goto init_done; } - if (ret < 0) { - dev_err(dev, "error (%d) waiting for RECONFIG_REQUEST\n", ret); - goto init_done; - } ret = 0; if (!test_and_clear_bit(SVC_STATUS_OK, &priv->status)) { @@ -318,7 +314,7 @@ static int s10_ops_write(struct fpga_manager *mgr, const char *buf, */ wait_status = 1; /* not timed out */ if (!priv->status) - wait_status = wait_for_completion_interruptible_timeout( + wait_status = wait_for_completion_timeout( &priv->status_return_completion, S10_BUFFER_TIMEOUT); @@ -340,13 +336,6 @@ static int s10_ops_write(struct fpga_manager *mgr, const char *buf, ret = -ETIMEDOUT; break; } - if (wait_status < 0) { - ret = wait_status; - dev_err(dev, - "error (%d) waiting for svc layer buffers\n", - ret); - break; - } } if (!s10_free_buffers(mgr)) @@ -372,7 +361,7 @@ static int s10_ops_write_complete(struct fpga_manager *mgr, if (ret < 0) break; - ret = wait_for_completion_interruptible_timeout( + ret = wait_for_completion_timeout( &priv->status_return_completion, timeout); if (!ret) { dev_err(dev, @@ -380,12 +369,6 @@ static int s10_ops_write_complete(struct fpga_manager *mgr, ret = -ETIMEDOUT; break; } - if (ret < 0) { - dev_err(dev, - "error (%d) waiting for RECONFIG_COMPLETED\n", - ret); - break; - } /* Not error or timeout, so ret is # of jiffies until timeout */ timeout = ret; ret = 0; -- 2.7.4