From patchwork Fri Dec 20 12:24:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunihiko Hayashi X-Patchwork-Id: 182260 Delivered-To: patch@linaro.org Received: by 2002:a92:1f98:0:0:0:0:0 with SMTP id f24csp457362ilf; Fri, 20 Dec 2019 04:24:45 -0800 (PST) X-Google-Smtp-Source: APXvYqycVNg+7hYtbFe18QW9NNPdTrF6O//kbXdjsH5G1+calbNERi1mLKi3Bkb+5W49iIYIQZB6 X-Received: by 2002:a9d:7342:: with SMTP id l2mr14804921otk.98.1576844684988; Fri, 20 Dec 2019 04:24:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576844684; cv=none; d=google.com; s=arc-20160816; b=n/WIF8mxrpFzkrZhOaKqwj+h7avv1H0rbMSvVfUN37WlvGB/B4Fmt+Eeuoc9+B/ERM 9spvtkESKvgaJjuZRmMI4lfwH5/5vdeMbL4oCTv5iN6ZLezMhNGiFwzvgpq3b+GdOfA1 OQutpDLln4EraSreR0FzV/Y3a2qBue+g3uc+GOX7rcKkh8xc9/ZHltTpyR1UwfHAe7HJ QNZK2LqkuAlh3UPREiO8KBS0am7jwXZOjJyKSUFSkFEYDXKOmUMDZUBp8zg5y2NquHIi SmeATezmtDLrCdgxTHskPsAdj8DbNXaGaV6gGRNL1hX1sCEZ3n1x0l1mu9NHq1iFs6xZ aDrA== 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; bh=+Y5fQY3Eq/oeoAEYzl5IF3Bm8nlqNTwwRdP950ZDq1w=; b=iVrguAVyyeZck8q0/Qcdmtnvp105bKmEAyJi2eUeIYhBeJyfXCmrUn6X7FRh3VtYHh ql/BuB38Eq5SC8aCzviXzLMVW2dAl7EbJtLInmcBu7+9LmWtOxPmC4vgIEfErXwZoaSb vJnFGXpLfRY3xts2VHziBx2ZNVx1Z7UBphqMwikAAd0lBaoC0/JWPjGP700XrXSmhddn cC9i5C5ddK2kH3FcifIQPFhgnZs0NL17LSIpbRmmkdWeV8enWJcMdxp2Y5cigOHIfaY6 bZp6xgofDnF24Wg1vl4eQmTUelPJTmv9y+FArSAPLVePfOM8yag8lAKSVw8Es/nCL9La b6Vw== ARC-Authentication-Results: i=1; mx.google.com; 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 p14si5157266ota.71.2019.12.20.04.24.44; Fri, 20 Dec 2019 04:24: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; 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 S1727344AbfLTMYn (ORCPT + 27 others); Fri, 20 Dec 2019 07:24:43 -0500 Received: from mx.socionext.com ([202.248.49.38]:46531 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727262AbfLTMYn (ORCPT ); Fri, 20 Dec 2019 07:24:43 -0500 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 20 Dec 2019 21:24:41 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id E610C18008B; Fri, 20 Dec 2019 21:24:41 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Fri, 20 Dec 2019 21:25:28 +0900 Received: from plum.e01.socionext.com (unknown [10.213.132.32]) by kinkan.css.socionext.com (Postfix) with ESMTP id A4D241A01CF; Fri, 20 Dec 2019 21:24:41 +0900 (JST) From: Kunihiko Hayashi To: Kishon Vijay Abraham I , Lorenzo Pieralisi Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Kunihiko Hayashi Subject: [PATCH RESEND] PCI: endpoint: Fix clearing start entry in configfs Date: Fri, 20 Dec 2019 21:24:37 +0900 Message-Id: <1576844677-24933-1-git-send-email-hayashi.kunihiko@socionext.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 The value of 'start' entry is no change whenever writing 0 to configfs. So the endpoint that stopped once can't restart. The following command lines are an example restarting endpoint and reprogramming configurations after receiving bus-reset. echo 0 > controllers/66000000.pcie-ep/start rm controllers/66000000.pcie-ep/func1 ln -s functions/pci_epf_test/func1 controllers/66000000.pcie-ep/ echo 1 > controllers/66000000.pcie-ep/start However, the first 'echo' can't set 0 to 'start', so the last 'echo' can't restart endpoint. Fixes: d74679911610 ("PCI: endpoint: Introduce configfs entry for configuring EP functions") Cc: Kishon Vijay Abraham I Signed-off-by: Kunihiko Hayashi --- drivers/pci/endpoint/pci-ep-cfs.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c index d1288a0..4fead88 100644 --- a/drivers/pci/endpoint/pci-ep-cfs.c +++ b/drivers/pci/endpoint/pci-ep-cfs.c @@ -58,6 +58,7 @@ static ssize_t pci_epc_start_store(struct config_item *item, const char *page, if (!start) { pci_epc_stop(epc); + epc_group->start = 0; return len; }