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.5 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=unavailable 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 09B1AC433DB for ; Thu, 28 Jan 2021 14:38:55 +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 A850B64DDC for ; Thu, 28 Jan 2021 14:38:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A850B64DDC Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.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-Transfer-Encoding: Content-Type: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=0nIeQ2MpO2EG8SwmpVvYKoGdPPQkdfcxmD6CnG1R8Dc=; b=PQOZLON7ZwhZ33tJarY+qqEtR iAs3M0n2EpHdEsXcFlNAjLx9ibLVeqwrPYEI2VJT/0go/jChiVScN4tFJWuFEa1SlER3THOGdFSvk gerd8aDGUHfL6T0l1RyiBk5/EyBdv7jvBmdtoHvGacKqOyvyUoaYGH+dUA+A6ni22y2i0b71v1sGY XdgJADwJ2X4UgRWqFNhriNEtsw3WkoAAF2D92iiuM5VKF15kr9YHqLRGRU9gbLcOSqnMt1sQXKg7x rXLmrd55deYc6nEJ/klqlcpcUxo9CknYEScU6Fofy91D6KXRKW+Pz2hoWJ35tc3YbgdxtU0VXTZli osumAAVVA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l581u-0004dp-FR; Thu, 28 Jan 2021 14:12:14 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l581q-0004dK-Jh for linux-arm-kernel@lists.infradead.org; Thu, 28 Jan 2021 14:12:12 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 10SEC2pA032804; Thu, 28 Jan 2021 08:12:02 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1611843122; bh=AudpKSlaZboe1uf2RLBPZd0j5l8pLIG2KQCVcoHb/Pk=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=uPJ7p4RKAidWFI38PN1NVSopf6Q7AB8r16q1edIU8BR6ItGm+4Fdt1N/Y0DtJXhvi q4K257lDVAD5/IKRGm5H8F/CauOzOtcX1Ac6+XDTM5ToStp5yrE69X1RJEFqxm5lw4 GBgIKOUbMCy0nGkR07Nk0IT2mcN8fYDJN6RbIFFY= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 10SEC2n4026339 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 28 Jan 2021 08:12:02 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 28 Jan 2021 08:12:02 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 28 Jan 2021 08:12:02 -0600 Received: from [10.250.235.36] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 10SEBwH7081595; Thu, 28 Jan 2021 08:11:59 -0600 Subject: Re: [PATCH v2 1/3] PCI: endpoint: Add 'started' to pci_epc to set whether the controller is started To: Kunihiko Hayashi , 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> From: Kishon Vijay Abraham I Message-ID: <1253c4c9-4e5e-1456-6475-0334f3bb8634@ti.com> Date: Thu, 28 Jan 2021 19:41:57 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1611500977-24816-2-git-send-email-hayashi.kunihiko@socionext.com> Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210128_091210_745965_F85FF9F1 X-CRM114-Status: GOOD ( 23.36 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Thanks Kishon > + > struct pci_epc * > __devm_pci_epc_create(struct device *dev, const struct pci_epc_ops *ops, > struct module *owner); > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel