From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 598E1C433E0 for ; Tue, 2 Feb 2021 16:14:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01FD264DBA for ; Tue, 2 Feb 2021 16:14:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01FD264DBA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8zsU/AGEx6PJy4fE+gvBko9PA1fyce/8Fq7Q/Sveh7U=; b=ksiDZ5uLORlCCqbMU/hbAwAPF +4cBTGtks9F5VeGXc0VolzI8DiO1PQV+PWJDp0VcPRJl4Fsc57JomuNHowtGzQQRrYM0D+LgQI+Cq 26MzhKyoF+86pjjFPJP92d5HsTMeWx8e2YZeYepDuGZ1eUJmsiF2pXibcHXyO5Yga9IrWRShY7SAW XiZ4nvf8FPjjFxuEmv8VvqsGmZ5KHwRbbt7qr+5UArkTY9dQDOAw2i1ejtkD+t2MqjOVltaLqJPJi b4h5cuTRNYIie9MOxs6eH39h3xXJ5W53fxxTNBzSGf2doDmVXSOkTHEoERbOaLUThSndrch0G2cim u7jnqvKkg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6yJ1-0003S1-G8; Tue, 02 Feb 2021 16:13:31 +0000 Received: from mx.socionext.com ([202.248.49.38]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6yIy-0003QT-Cy for linux-arm-kernel@lists.infradead.org; Tue, 02 Feb 2021 16:13:29 +0000 Received: from unknown (HELO iyokan2-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 03 Feb 2021 01:13:27 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan2-ex.css.socionext.com (Postfix) with ESMTP id EAA732059027; Wed, 3 Feb 2021 01:13:27 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Wed, 3 Feb 2021 01:13:27 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 6B16EB1D40; Wed, 3 Feb 2021 01:13:27 +0900 (JST) Received: from [10.212.20.246] (unknown [10.212.20.246]) by yuzu.css.socionext.com (Postfix) with ESMTP id C6B731202F7; Wed, 3 Feb 2021 01:13:26 +0900 (JST) Subject: Re: [PATCH v2 1/3] PCI: endpoint: Add 'started' to pci_epc to set whether the controller is started To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas References: <1611500977-24816-1-git-send-email-hayashi.kunihiko@socionext.com> <1611500977-24816-2-git-send-email-hayashi.kunihiko@socionext.com> <1253c4c9-4e5e-1456-6475-0334f3bb8634@ti.com> From: Kunihiko Hayashi Message-ID: <83a6ec4e-3f59-5084-2241-404169d50116@socionext.com> Date: Wed, 3 Feb 2021 01:13:26 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <1253c4c9-4e5e-1456-6475-0334f3bb8634@ti.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210202_111328_611130_D580CA94 X-CRM114-Status: GOOD ( 24.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pci@vger.kernel.org, Masami Hiramatsu , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jassi Brar Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Kishon, On 2021/01/28 23:11, Kishon Vijay Abraham I wrote: > Hi Kunihiko, > > On 24/01/21 8:39 pm, Kunihiko Hayashi wrote: >> This adds a member 'started' as a boolean value to struct pci_epc to set >> whether the controller is started, and also adds a function to get the >> value. >> >> Signed-off-by: Kunihiko Hayashi >> --- >> drivers/pci/endpoint/pci-epc-core.c | 2 ++ >> include/linux/pci-epc.h | 7 +++++++ >> 2 files changed, 9 insertions(+) >> >> diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c >> index cc8f9eb..2904175 100644 >> --- a/drivers/pci/endpoint/pci-epc-core.c >> +++ b/drivers/pci/endpoint/pci-epc-core.c >> @@ -174,6 +174,7 @@ void pci_epc_stop(struct pci_epc *epc) >> >> mutex_lock(&epc->lock); >> epc->ops->stop(epc); >> + epc->started = false; >> mutex_unlock(&epc->lock); >> } >> EXPORT_SYMBOL_GPL(pci_epc_stop); >> @@ -196,6 +197,7 @@ int pci_epc_start(struct pci_epc *epc) >> >> mutex_lock(&epc->lock); >> ret = epc->ops->start(epc); >> + epc->started = true; >> mutex_unlock(&epc->lock); >> >> return ret; >> diff --git a/include/linux/pci-epc.h b/include/linux/pci-epc.h >> index b82c9b1..5808952 100644 >> --- a/include/linux/pci-epc.h >> +++ b/include/linux/pci-epc.h >> @@ -131,6 +131,7 @@ struct pci_epc_mem { >> * @lock: mutex to protect pci_epc ops >> * @function_num_map: bitmap to manage physical function number >> * @notifier: used to notify EPF of any EPC events (like linkup) >> + * @started: true if this EPC is started >> */ >> struct pci_epc { >> struct device dev; >> @@ -145,6 +146,7 @@ struct pci_epc { >> struct mutex lock; >> unsigned long function_num_map; >> struct atomic_notifier_head notifier; >> + bool started; >> }; >> >> /** >> @@ -191,6 +193,11 @@ pci_epc_register_notifier(struct pci_epc *epc, struct notifier_block *nb) >> return atomic_notifier_chain_register(&epc->notifier, nb); >> } >> >> +static inline bool pci_epc_is_started(struct pci_epc *epc) >> +{ >> + return epc->started; >> +} > > This should also be protected. Ok, I prepared this function for restart management in patch 2/3. This also needs to be reconsidered. Thank you, --- Best Regards Kunihiko Hayashi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel