All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Alex Elder <elder@linaro.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>,
	Ohad Ben-Cohen <ohad@wizery.com>,
	David Miller <davem@davemloft.net>, Arnd Bergmann <arnd@arndb.de>,
	Andy Gross <agross@kernel.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	Dan Williams <dcbw@redhat.com>, Evan Green <evgreen@google.com>,
	Eric Caruso <ejcaruso@google.com>,
	Susheel Yadav Yadagiri <syadagir@codeaurora.org>,
	Chaitanya Pratapa <cpratapa@codeaurora.org>,
	Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Siddharth Gupta <sidgup@codeaurora.org>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 01/17] remoteproc: add IPA notification to q6v5 driver
Date: Fri, 6 Mar 2020 13:49:41 +0200	[thread overview]
Message-ID: <20200306114941.GO184088@unreal> (raw)
In-Reply-To: <20200306042831.17827-2-elder@linaro.org>

On Thu, Mar 05, 2020 at 10:28:15PM -0600, Alex Elder wrote:
> Set up a subdev in the q6v5 modem remoteproc driver that generates
> event notifications for the IPA driver to use for initialization and
> recovery following a modem shutdown or crash.
>
> A pair of new functions provides a way for the IPA driver to register
> and deregister a notification callback function that will be called
> whenever modem events (about to boot, running, about to shut down,
> etc.) occur.  A void pointer value (provided by the IPA driver at
> registration time) and an event type are supplied to the callback
> function.
>
> One event, MODEM_REMOVING, is signaled whenever the q6v5 driver is
> about to remove the notification subdevice.  It requires the IPA
> driver de-register its callback.
>
> This sub-device is only used by the modem subsystem (MSS) driver,
> so the code that adds the new subdev and allows registration and
> deregistration of the notifier is found in "qcom_q6v6_mss.c".
>
> Signed-off-by: Alex Elder <elder@linaro.org>
> ---
>  drivers/remoteproc/Kconfig                    |  6 ++
>  drivers/remoteproc/Makefile                   |  1 +
>  drivers/remoteproc/qcom_q6v5_ipa_notify.c     | 85 +++++++++++++++++++
>  drivers/remoteproc/qcom_q6v5_mss.c            | 38 +++++++++
>  .../linux/remoteproc/qcom_q6v5_ipa_notify.h   | 82 ++++++++++++++++++
>  5 files changed, 212 insertions(+)
>  create mode 100644 drivers/remoteproc/qcom_q6v5_ipa_notify.c
>  create mode 100644 include/linux/remoteproc/qcom_q6v5_ipa_notify.h
>
> diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
> index de3862c15fcc..56084635dd63 100644
> --- a/drivers/remoteproc/Kconfig
> +++ b/drivers/remoteproc/Kconfig
> @@ -167,6 +167,12 @@ config QCOM_Q6V5_WCSS
>  	  Say y here to support the Qualcomm Peripheral Image Loader for the
>  	  Hexagon V5 based WCSS remote processors.
>
> +config QCOM_Q6V5_IPA_NOTIFY
> +	tristate
> +	depends on QCOM_IPA
> +	depends on QCOM_Q6V5_MSS
> +	default QCOM_IPA
> +
>  config QCOM_SYSMON
>  	tristate "Qualcomm sysmon driver"
>  	depends on RPMSG
> diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile
> index e30a1b15fbac..0effd3825035 100644
> --- a/drivers/remoteproc/Makefile
> +++ b/drivers/remoteproc/Makefile
> @@ -21,6 +21,7 @@ obj-$(CONFIG_QCOM_Q6V5_ADSP)		+= qcom_q6v5_adsp.o
>  obj-$(CONFIG_QCOM_Q6V5_MSS)		+= qcom_q6v5_mss.o
>  obj-$(CONFIG_QCOM_Q6V5_PAS)		+= qcom_q6v5_pas.o
>  obj-$(CONFIG_QCOM_Q6V5_WCSS)		+= qcom_q6v5_wcss.o
> +obj-$(CONFIG_QCOM_Q6V5_IPA_NOTIFY)	+= qcom_q6v5_ipa_notify.o
>  obj-$(CONFIG_QCOM_SYSMON)		+= qcom_sysmon.o
>  obj-$(CONFIG_QCOM_WCNSS_PIL)		+= qcom_wcnss_pil.o
>  qcom_wcnss_pil-y			+= qcom_wcnss.o
> diff --git a/drivers/remoteproc/qcom_q6v5_ipa_notify.c b/drivers/remoteproc/qcom_q6v5_ipa_notify.c
> new file mode 100644
> index 000000000000..e1c10a128bfd
> --- /dev/null
> +++ b/drivers/remoteproc/qcom_q6v5_ipa_notify.c
> @@ -0,0 +1,85 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +/*
> + * Qualcomm IPA notification subdev support
> + *
> + * Copyright (C) 2019 Linaro Ltd.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/remoteproc.h>
> +#include <linux/remoteproc/qcom_q6v5_ipa_notify.h>
> +
> +static void
> +ipa_notify_common(struct rproc_subdev *subdev, enum qcom_rproc_event event)
> +{
> +	struct qcom_rproc_ipa_notify *ipa_notify;
> +	qcom_ipa_notify_t notify;
> +
> +	ipa_notify = container_of(subdev, struct qcom_rproc_ipa_notify, subdev);
> +	notify = ipa_notify->notify;
> +	if (notify)
> +		notify(ipa_notify->data, event);
> +}
> +
> +static int ipa_notify_prepare(struct rproc_subdev *subdev)
> +{
> +	ipa_notify_common(subdev, MODEM_STARTING);
> +
> +	return 0;
> +}
> +
> +static int ipa_notify_start(struct rproc_subdev *subdev)
> +{
> +	ipa_notify_common(subdev, MODEM_RUNNING);
> +
> +	return 0;
> +}
> +
> +static void ipa_notify_stop(struct rproc_subdev *subdev, bool crashed)
> +
> +{
> +	ipa_notify_common(subdev, crashed ? MODEM_CRASHED : MODEM_STOPPING);
> +}
> +
> +static void ipa_notify_unprepare(struct rproc_subdev *subdev)
> +{
> +	ipa_notify_common(subdev, MODEM_OFFLINE);
> +}
> +
> +static void ipa_notify_removing(struct rproc_subdev *subdev)
> +{
> +	ipa_notify_common(subdev, MODEM_REMOVING);
> +}
> +
> +/* Register the IPA notification subdevice with the Q6V5 MSS remoteproc */
> +void qcom_add_ipa_notify_subdev(struct rproc *rproc,
> +		struct qcom_rproc_ipa_notify *ipa_notify)
> +{
> +	ipa_notify->notify = NULL;
> +	ipa_notify->data = NULL;
> +	ipa_notify->subdev.prepare = ipa_notify_prepare;
> +	ipa_notify->subdev.start = ipa_notify_start;
> +	ipa_notify->subdev.stop = ipa_notify_stop;
> +	ipa_notify->subdev.unprepare = ipa_notify_unprepare;
> +
> +	rproc_add_subdev(rproc, &ipa_notify->subdev);
> +}
> +EXPORT_SYMBOL_GPL(qcom_add_ipa_notify_subdev);
> +
> +/* Remove the IPA notification subdevice */
> +void qcom_remove_ipa_notify_subdev(struct rproc *rproc,
> +		struct qcom_rproc_ipa_notify *ipa_notify)
> +{
> +	struct rproc_subdev *subdev = &ipa_notify->subdev;
> +
> +	ipa_notify_removing(subdev);
> +
> +	rproc_remove_subdev(rproc, subdev);
> +	ipa_notify->notify = NULL;	/* Make it obvious */
> +}
> +EXPORT_SYMBOL_GPL(qcom_remove_ipa_notify_subdev);
> +
> +MODULE_LICENSE("GPL v2");
> +MODULE_DESCRIPTION("Qualcomm IPA notification remoteproc subdev");
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index a1cc9cbe038f..f9ccce76e44b 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -22,6 +22,7 @@
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/remoteproc.h>
> +#include "linux/remoteproc/qcom_q6v5_ipa_notify.h"
>  #include <linux/reset.h>
>  #include <linux/soc/qcom/mdt_loader.h>
>  #include <linux/iopoll.h>
> @@ -201,6 +202,7 @@ struct q6v5 {
>  	struct qcom_rproc_glink glink_subdev;
>  	struct qcom_rproc_subdev smd_subdev;
>  	struct qcom_rproc_ssr ssr_subdev;
> +	struct qcom_rproc_ipa_notify ipa_notify_subdev;
>  	struct qcom_sysmon *sysmon;
>  	bool need_mem_protection;
>  	bool has_alt_reset;
> @@ -1540,6 +1542,39 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc)
>  	return 0;
>  }
>
> +#if IS_ENABLED(CONFIG_QCOM_Q6V5_IPA_NOTIFY)
> +
> +/* Register IPA notification function */
> +int qcom_register_ipa_notify(struct rproc *rproc, qcom_ipa_notify_t notify,
> +			     void *data)
> +{
> +	struct qcom_rproc_ipa_notify *ipa_notify;
> +	struct q6v5 *qproc = rproc->priv;
> +
> +	if (!notify)
> +		return -EINVAL;
> +
> +	ipa_notify = &qproc->ipa_notify_subdev;
> +	if (ipa_notify->notify)
> +		return -EBUSY;
> +
> +	ipa_notify->notify = notify;
> +	ipa_notify->data = data;
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(qcom_register_ipa_notify);
> +
> +/* Deregister IPA notification function */
> +void qcom_deregister_ipa_notify(struct rproc *rproc)
> +{
> +	struct q6v5 *qproc = rproc->priv;
> +
> +	qproc->ipa_notify_subdev.notify = NULL;
> +}
> +EXPORT_SYMBOL_GPL(qcom_deregister_ipa_notify);
> +#endif /* !IS_ENABLED(CONFIG_QCOM_Q6V5_IPA_NOTIFY) */
> +
>  static int q6v5_probe(struct platform_device *pdev)
>  {
>  	const struct rproc_hexagon_res *desc;
> @@ -1664,6 +1699,7 @@ static int q6v5_probe(struct platform_device *pdev)
>  	qcom_add_glink_subdev(rproc, &qproc->glink_subdev);
>  	qcom_add_smd_subdev(rproc, &qproc->smd_subdev);
>  	qcom_add_ssr_subdev(rproc, &qproc->ssr_subdev, "mpss");
> +	qcom_add_ipa_notify_subdev(rproc, &qproc->ipa_notify_subdev);
>  	qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12);
>  	if (IS_ERR(qproc->sysmon)) {
>  		ret = PTR_ERR(qproc->sysmon);
> @@ -1677,6 +1713,7 @@ static int q6v5_probe(struct platform_device *pdev)
>  	return 0;
>
>  detach_proxy_pds:
> +	qcom_remove_ipa_notify_subdev(qproc->rproc, &qproc->ipa_notify_subdev);
>  	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
>  detach_active_pds:
>  	q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
> @@ -1693,6 +1730,7 @@ static int q6v5_remove(struct platform_device *pdev)
>  	rproc_del(qproc->rproc);
>
>  	qcom_remove_sysmon_subdev(qproc->sysmon);
> +	qcom_remove_ipa_notify_subdev(qproc->rproc, &qproc->ipa_notify_subdev);
>  	qcom_remove_glink_subdev(qproc->rproc, &qproc->glink_subdev);
>  	qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
>  	qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
> diff --git a/include/linux/remoteproc/qcom_q6v5_ipa_notify.h b/include/linux/remoteproc/qcom_q6v5_ipa_notify.h
> new file mode 100644
> index 000000000000..0820edc0ab7d
> --- /dev/null
> +++ b/include/linux/remoteproc/qcom_q6v5_ipa_notify.h
> @@ -0,0 +1,82 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +/* Copyright (C) 2019 Linaro Ltd. */
> +
> +#ifndef __QCOM_Q6V5_IPA_NOTIFY_H__
> +#define __QCOM_Q6V5_IPA_NOTIFY_H__
> +
> +#if IS_ENABLED(CONFIG_QCOM_Q6V5_IPA_NOTIFY)

Why don't you put this guard in the places where such include is called?
Or the best variant is to ensure that this include is compiled in only
in CONFIG_QCOM_Q6V5_IPA_NOTIFY flows.

That is more common way to guard internal header files.

Thanks

WARNING: multiple messages have this Message-ID (diff)
From: Leon Romanovsky <leon@kernel.org>
To: Alex Elder <elder@linaro.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Susheel Yadav Yadagiri <syadagir@codeaurora.org>,
	Eric Caruso <ejcaruso@google.com>, Arnd Bergmann <arnd@arndb.de>,
	devicetree@vger.kernel.org, Dan Williams <dcbw@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rob Herring <robh+dt@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Siddharth Gupta <sidgup@codeaurora.org>,
	Andy Gross <agross@kernel.org>, Evan Green <evgreen@google.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org,
	Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-soc@vger.kernel.org, David Miller <davem@davemloft.net>,
	Chaitanya Pratapa <cpratapa@codeaurora.org>
Subject: Re: [PATCH v2 01/17] remoteproc: add IPA notification to q6v5 driver
Date: Fri, 6 Mar 2020 13:49:41 +0200	[thread overview]
Message-ID: <20200306114941.GO184088@unreal> (raw)
In-Reply-To: <20200306042831.17827-2-elder@linaro.org>

On Thu, Mar 05, 2020 at 10:28:15PM -0600, Alex Elder wrote:
> Set up a subdev in the q6v5 modem remoteproc driver that generates
> event notifications for the IPA driver to use for initialization and
> recovery following a modem shutdown or crash.
>
> A pair of new functions provides a way for the IPA driver to register
> and deregister a notification callback function that will be called
> whenever modem events (about to boot, running, about to shut down,
> etc.) occur.  A void pointer value (provided by the IPA driver at
> registration time) and an event type are supplied to the callback
> function.
>
> One event, MODEM_REMOVING, is signaled whenever the q6v5 driver is
> about to remove the notification subdevice.  It requires the IPA
> driver de-register its callback.
>
> This sub-device is only used by the modem subsystem (MSS) driver,
> so the code that adds the new subdev and allows registration and
> deregistration of the notifier is found in "qcom_q6v6_mss.c".
>
> Signed-off-by: Alex Elder <elder@linaro.org>
> ---
>  drivers/remoteproc/Kconfig                    |  6 ++
>  drivers/remoteproc/Makefile                   |  1 +
>  drivers/remoteproc/qcom_q6v5_ipa_notify.c     | 85 +++++++++++++++++++
>  drivers/remoteproc/qcom_q6v5_mss.c            | 38 +++++++++
>  .../linux/remoteproc/qcom_q6v5_ipa_notify.h   | 82 ++++++++++++++++++
>  5 files changed, 212 insertions(+)
>  create mode 100644 drivers/remoteproc/qcom_q6v5_ipa_notify.c
>  create mode 100644 include/linux/remoteproc/qcom_q6v5_ipa_notify.h
>
> diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
> index de3862c15fcc..56084635dd63 100644
> --- a/drivers/remoteproc/Kconfig
> +++ b/drivers/remoteproc/Kconfig
> @@ -167,6 +167,12 @@ config QCOM_Q6V5_WCSS
>  	  Say y here to support the Qualcomm Peripheral Image Loader for the
>  	  Hexagon V5 based WCSS remote processors.
>
> +config QCOM_Q6V5_IPA_NOTIFY
> +	tristate
> +	depends on QCOM_IPA
> +	depends on QCOM_Q6V5_MSS
> +	default QCOM_IPA
> +
>  config QCOM_SYSMON
>  	tristate "Qualcomm sysmon driver"
>  	depends on RPMSG
> diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile
> index e30a1b15fbac..0effd3825035 100644
> --- a/drivers/remoteproc/Makefile
> +++ b/drivers/remoteproc/Makefile
> @@ -21,6 +21,7 @@ obj-$(CONFIG_QCOM_Q6V5_ADSP)		+= qcom_q6v5_adsp.o
>  obj-$(CONFIG_QCOM_Q6V5_MSS)		+= qcom_q6v5_mss.o
>  obj-$(CONFIG_QCOM_Q6V5_PAS)		+= qcom_q6v5_pas.o
>  obj-$(CONFIG_QCOM_Q6V5_WCSS)		+= qcom_q6v5_wcss.o
> +obj-$(CONFIG_QCOM_Q6V5_IPA_NOTIFY)	+= qcom_q6v5_ipa_notify.o
>  obj-$(CONFIG_QCOM_SYSMON)		+= qcom_sysmon.o
>  obj-$(CONFIG_QCOM_WCNSS_PIL)		+= qcom_wcnss_pil.o
>  qcom_wcnss_pil-y			+= qcom_wcnss.o
> diff --git a/drivers/remoteproc/qcom_q6v5_ipa_notify.c b/drivers/remoteproc/qcom_q6v5_ipa_notify.c
> new file mode 100644
> index 000000000000..e1c10a128bfd
> --- /dev/null
> +++ b/drivers/remoteproc/qcom_q6v5_ipa_notify.c
> @@ -0,0 +1,85 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +/*
> + * Qualcomm IPA notification subdev support
> + *
> + * Copyright (C) 2019 Linaro Ltd.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/remoteproc.h>
> +#include <linux/remoteproc/qcom_q6v5_ipa_notify.h>
> +
> +static void
> +ipa_notify_common(struct rproc_subdev *subdev, enum qcom_rproc_event event)
> +{
> +	struct qcom_rproc_ipa_notify *ipa_notify;
> +	qcom_ipa_notify_t notify;
> +
> +	ipa_notify = container_of(subdev, struct qcom_rproc_ipa_notify, subdev);
> +	notify = ipa_notify->notify;
> +	if (notify)
> +		notify(ipa_notify->data, event);
> +}
> +
> +static int ipa_notify_prepare(struct rproc_subdev *subdev)
> +{
> +	ipa_notify_common(subdev, MODEM_STARTING);
> +
> +	return 0;
> +}
> +
> +static int ipa_notify_start(struct rproc_subdev *subdev)
> +{
> +	ipa_notify_common(subdev, MODEM_RUNNING);
> +
> +	return 0;
> +}
> +
> +static void ipa_notify_stop(struct rproc_subdev *subdev, bool crashed)
> +
> +{
> +	ipa_notify_common(subdev, crashed ? MODEM_CRASHED : MODEM_STOPPING);
> +}
> +
> +static void ipa_notify_unprepare(struct rproc_subdev *subdev)
> +{
> +	ipa_notify_common(subdev, MODEM_OFFLINE);
> +}
> +
> +static void ipa_notify_removing(struct rproc_subdev *subdev)
> +{
> +	ipa_notify_common(subdev, MODEM_REMOVING);
> +}
> +
> +/* Register the IPA notification subdevice with the Q6V5 MSS remoteproc */
> +void qcom_add_ipa_notify_subdev(struct rproc *rproc,
> +		struct qcom_rproc_ipa_notify *ipa_notify)
> +{
> +	ipa_notify->notify = NULL;
> +	ipa_notify->data = NULL;
> +	ipa_notify->subdev.prepare = ipa_notify_prepare;
> +	ipa_notify->subdev.start = ipa_notify_start;
> +	ipa_notify->subdev.stop = ipa_notify_stop;
> +	ipa_notify->subdev.unprepare = ipa_notify_unprepare;
> +
> +	rproc_add_subdev(rproc, &ipa_notify->subdev);
> +}
> +EXPORT_SYMBOL_GPL(qcom_add_ipa_notify_subdev);
> +
> +/* Remove the IPA notification subdevice */
> +void qcom_remove_ipa_notify_subdev(struct rproc *rproc,
> +		struct qcom_rproc_ipa_notify *ipa_notify)
> +{
> +	struct rproc_subdev *subdev = &ipa_notify->subdev;
> +
> +	ipa_notify_removing(subdev);
> +
> +	rproc_remove_subdev(rproc, subdev);
> +	ipa_notify->notify = NULL;	/* Make it obvious */
> +}
> +EXPORT_SYMBOL_GPL(qcom_remove_ipa_notify_subdev);
> +
> +MODULE_LICENSE("GPL v2");
> +MODULE_DESCRIPTION("Qualcomm IPA notification remoteproc subdev");
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index a1cc9cbe038f..f9ccce76e44b 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -22,6 +22,7 @@
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/remoteproc.h>
> +#include "linux/remoteproc/qcom_q6v5_ipa_notify.h"
>  #include <linux/reset.h>
>  #include <linux/soc/qcom/mdt_loader.h>
>  #include <linux/iopoll.h>
> @@ -201,6 +202,7 @@ struct q6v5 {
>  	struct qcom_rproc_glink glink_subdev;
>  	struct qcom_rproc_subdev smd_subdev;
>  	struct qcom_rproc_ssr ssr_subdev;
> +	struct qcom_rproc_ipa_notify ipa_notify_subdev;
>  	struct qcom_sysmon *sysmon;
>  	bool need_mem_protection;
>  	bool has_alt_reset;
> @@ -1540,6 +1542,39 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc)
>  	return 0;
>  }
>
> +#if IS_ENABLED(CONFIG_QCOM_Q6V5_IPA_NOTIFY)
> +
> +/* Register IPA notification function */
> +int qcom_register_ipa_notify(struct rproc *rproc, qcom_ipa_notify_t notify,
> +			     void *data)
> +{
> +	struct qcom_rproc_ipa_notify *ipa_notify;
> +	struct q6v5 *qproc = rproc->priv;
> +
> +	if (!notify)
> +		return -EINVAL;
> +
> +	ipa_notify = &qproc->ipa_notify_subdev;
> +	if (ipa_notify->notify)
> +		return -EBUSY;
> +
> +	ipa_notify->notify = notify;
> +	ipa_notify->data = data;
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(qcom_register_ipa_notify);
> +
> +/* Deregister IPA notification function */
> +void qcom_deregister_ipa_notify(struct rproc *rproc)
> +{
> +	struct q6v5 *qproc = rproc->priv;
> +
> +	qproc->ipa_notify_subdev.notify = NULL;
> +}
> +EXPORT_SYMBOL_GPL(qcom_deregister_ipa_notify);
> +#endif /* !IS_ENABLED(CONFIG_QCOM_Q6V5_IPA_NOTIFY) */
> +
>  static int q6v5_probe(struct platform_device *pdev)
>  {
>  	const struct rproc_hexagon_res *desc;
> @@ -1664,6 +1699,7 @@ static int q6v5_probe(struct platform_device *pdev)
>  	qcom_add_glink_subdev(rproc, &qproc->glink_subdev);
>  	qcom_add_smd_subdev(rproc, &qproc->smd_subdev);
>  	qcom_add_ssr_subdev(rproc, &qproc->ssr_subdev, "mpss");
> +	qcom_add_ipa_notify_subdev(rproc, &qproc->ipa_notify_subdev);
>  	qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12);
>  	if (IS_ERR(qproc->sysmon)) {
>  		ret = PTR_ERR(qproc->sysmon);
> @@ -1677,6 +1713,7 @@ static int q6v5_probe(struct platform_device *pdev)
>  	return 0;
>
>  detach_proxy_pds:
> +	qcom_remove_ipa_notify_subdev(qproc->rproc, &qproc->ipa_notify_subdev);
>  	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
>  detach_active_pds:
>  	q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
> @@ -1693,6 +1730,7 @@ static int q6v5_remove(struct platform_device *pdev)
>  	rproc_del(qproc->rproc);
>
>  	qcom_remove_sysmon_subdev(qproc->sysmon);
> +	qcom_remove_ipa_notify_subdev(qproc->rproc, &qproc->ipa_notify_subdev);
>  	qcom_remove_glink_subdev(qproc->rproc, &qproc->glink_subdev);
>  	qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
>  	qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
> diff --git a/include/linux/remoteproc/qcom_q6v5_ipa_notify.h b/include/linux/remoteproc/qcom_q6v5_ipa_notify.h
> new file mode 100644
> index 000000000000..0820edc0ab7d
> --- /dev/null
> +++ b/include/linux/remoteproc/qcom_q6v5_ipa_notify.h
> @@ -0,0 +1,82 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +/* Copyright (C) 2019 Linaro Ltd. */
> +
> +#ifndef __QCOM_Q6V5_IPA_NOTIFY_H__
> +#define __QCOM_Q6V5_IPA_NOTIFY_H__
> +
> +#if IS_ENABLED(CONFIG_QCOM_Q6V5_IPA_NOTIFY)

Why don't you put this guard in the places where such include is called?
Or the best variant is to ensure that this include is compiled in only
in CONFIG_QCOM_Q6V5_IPA_NOTIFY flows.

That is more common way to guard internal header files.

Thanks

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-03-06 11:49 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06  4:28 [PATCH v2 00/17] net: introduce Qualcomm IPA driver (UPDATED) Alex Elder
2020-03-06  4:28 ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 01/17] remoteproc: add IPA notification to q6v5 driver Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06 11:49   ` Leon Romanovsky [this message]
2020-03-06 11:49     ` Leon Romanovsky
2020-03-06 13:29     ` Alex Elder
2020-03-06 13:29       ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 02/17] dt-bindings: soc: qcom: add IPA bindings Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 03/17] soc: qcom: ipa: main code Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 04/17] soc: qcom: ipa: configuration data Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 05/17] soc: qcom: ipa: clocking, interrupts, and memory Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 06/17] soc: qcom: ipa: GSI headers Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 07/17] soc: qcom: ipa: the generic software interface Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 08/17] soc: qcom: ipa: IPA interface to GSI Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 09/17] soc: qcom: ipa: GSI transactions Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 10/17] soc: qcom: ipa: IPA endpoints Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 11/17] soc: qcom: ipa: filter and routing tables Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 12/17] soc: qcom: ipa: immediate commands Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 13/17] soc: qcom: ipa: modem and microcontroller Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 14/17] soc: qcom: ipa: AP/modem communications Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 15/17] soc: qcom: ipa: support build of IPA code Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-11 10:54   ` Jon Hunter
2020-03-11 10:54     ` Jon Hunter
2020-03-11 12:33     ` Alex Elder
2020-03-11 12:33       ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 16/17] MAINTAINERS: add entry for the Qualcomm IPA driver Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-06  4:28 ` [PATCH v2 17/17] arm64: dts: sdm845: add IPA information Alex Elder
2020-03-06  4:28   ` Alex Elder
2020-03-11 10:49   ` Jon Hunter
2020-03-11 10:49     ` Jon Hunter
2020-03-11 14:39     ` Alex Elder
2020-03-11 14:39       ` Alex Elder
2020-03-11 19:02       ` Bjorn Andersson
2020-03-11 19:02         ` Bjorn Andersson
2020-03-09  5:09 ` [PATCH v2 00/17] net: introduce Qualcomm IPA driver (UPDATED) David Miller
2020-03-09  5:09   ` David Miller
2020-03-09 16:54 ` Dave Taht
2020-03-09 16:54   ` Dave Taht
2020-03-12  3:09   ` Alex Elder
2020-03-12  3:09     ` Alex Elder
2020-04-29 23:17 ` Evan Green
2020-04-29 23:17   ` Evan Green

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200306114941.GO184088@unreal \
    --to=leon@kernel.org \
    --cc=agross@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bjorn.andersson@linaro.org \
    --cc=cpratapa@codeaurora.org \
    --cc=davem@davemloft.net \
    --cc=dcbw@redhat.com \
    --cc=devicetree@vger.kernel.org \
    --cc=ejcaruso@google.com \
    --cc=elder@linaro.org \
    --cc=evgreen@google.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=ohad@wizery.com \
    --cc=robh+dt@kernel.org \
    --cc=sidgup@codeaurora.org \
    --cc=subashab@codeaurora.org \
    --cc=syadagir@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.