* [PATCH 0/2] remoteproc: convert IPA to use new notifications
@ 2020-07-24 18:11 Alex Elder
2020-07-24 18:11 ` [PATCH 1/2] net: ipa: new notification infrastructure Alex Elder
0 siblings, 1 reply; 4+ messages in thread
From: Alex Elder @ 2020-07-24 18:11 UTC (permalink / raw)
To: bjorn.andersson, ohad, davem, kuba
Cc: agross, evgreen, subashab, cpratapa, linux-remoteproc,
linux-arm-msm, netdev, linux-kernel
The IPA driver needs to be notified about changes to the state of
the modem (starting, shutting down, etc.). A notification mechanism
was put in place for that purpose, but a more general system has now
been accepted:
https://lore.kernel.org/linux-remoteproc/1592965408-16908-1-git-send-email-rishabhb@codeaurora.org/
The first patch in this series converts the IPA driver to use the
new notification mechanism. The second removes the temporary
system that was put in place for IPA use only.
-Alex
--> David: Bjorn has agreed to take both of these patches through
the remoteproc tree. They should be merged together, and the
first has a build-time dependency on patches in rproc-next.
I'd appreciate an ack from you so he can merge it.
Alex Elder (2):
net: ipa: new notification infrastructure
remoteproc: kill IPA notify code
drivers/net/ipa/ipa.h | 3 +
drivers/net/ipa/ipa_modem.c | 56 +++++++-----
drivers/remoteproc/Kconfig | 4 -
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 ------------------
7 files changed, 38 insertions(+), 231 deletions(-)
delete mode 100644 drivers/remoteproc/qcom_q6v5_ipa_notify.c
delete mode 100644 include/linux/remoteproc/qcom_q6v5_ipa_notify.h
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/2] net: ipa: new notification infrastructure 2020-07-24 18:11 [PATCH 0/2] remoteproc: convert IPA to use new notifications Alex Elder @ 2020-07-24 18:11 ` Alex Elder 2020-07-24 20:05 ` Bjorn Andersson 2020-07-25 0:33 ` David Miller 0 siblings, 2 replies; 4+ messages in thread From: Alex Elder @ 2020-07-24 18:11 UTC (permalink / raw) To: davem, kuba Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel Use the new SSR notifier infrastructure to request notifications of modem events, rather than the remoteproc IPA notification system. The latter was put in place temporarily with the knowledge that the new mechanism would become available. Signed-off-by: Alex Elder <elder@linaro.org> --- David: If you approve, please only ACK; Bjorn will merge. drivers/net/ipa/ipa.h | 3 ++ drivers/net/ipa/ipa_modem.c | 56 +++++++++++++++++++++++-------------- 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/drivers/net/ipa/ipa.h b/drivers/net/ipa/ipa.h index b10a853929525..55115cfb29720 100644 --- a/drivers/net/ipa/ipa.h +++ b/drivers/net/ipa/ipa.h @@ -10,6 +10,7 @@ #include <linux/device.h> #include <linux/notifier.h> #include <linux/pm_wakeup.h> +#include <linux/notifier.h> #include "ipa_version.h" #include "gsi.h" @@ -73,6 +74,8 @@ struct ipa { enum ipa_version version; struct platform_device *pdev; struct rproc *modem_rproc; + struct notifier_block nb; + void *notifier; struct ipa_smp2p *smp2p; struct ipa_clock *clock; atomic_t suspend_ref; diff --git a/drivers/net/ipa/ipa_modem.c b/drivers/net/ipa/ipa_modem.c index ed10818dd99f2..e34fe2d77324e 100644 --- a/drivers/net/ipa/ipa_modem.c +++ b/drivers/net/ipa/ipa_modem.c @@ -9,7 +9,7 @@ #include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/if_rmnet.h> -#include <linux/remoteproc/qcom_q6v5_ipa_notify.h> +#include <linux/remoteproc/qcom_rproc.h> #include "ipa.h" #include "ipa_data.h" @@ -311,43 +311,40 @@ static void ipa_modem_crashed(struct ipa *ipa) dev_err(dev, "error %d zeroing modem memory regions\n", ret); } -static void ipa_modem_notify(void *data, enum qcom_rproc_event event) +static int ipa_modem_notify(struct notifier_block *nb, unsigned long action, + void *data) { - struct ipa *ipa = data; - struct device *dev; + struct ipa *ipa = container_of(nb, struct ipa, nb); + struct qcom_ssr_notify_data *notify_data = data; + struct device *dev = &ipa->pdev->dev; - dev = &ipa->pdev->dev; - switch (event) { - case MODEM_STARTING: + switch (action) { + case QCOM_SSR_BEFORE_POWERUP: dev_info(dev, "received modem starting event\n"); ipa_smp2p_notify_reset(ipa); break; - case MODEM_RUNNING: + case QCOM_SSR_AFTER_POWERUP: dev_info(dev, "received modem running event\n"); break; - case MODEM_STOPPING: - case MODEM_CRASHED: + case QCOM_SSR_BEFORE_SHUTDOWN: dev_info(dev, "received modem %s event\n", - event == MODEM_STOPPING ? "stopping" - : "crashed"); + notify_data->crashed ? "crashed" : "stopping"); if (ipa->setup_complete) ipa_modem_crashed(ipa); break; - case MODEM_OFFLINE: + case QCOM_SSR_AFTER_SHUTDOWN: dev_info(dev, "received modem offline event\n"); break; - case MODEM_REMOVING: - dev_info(dev, "received modem stopping event\n"); - break; - default: - dev_err(&ipa->pdev->dev, "unrecognized event %u\n", event); + dev_err(dev, "received unrecognized event %lu\n", action); break; } + + return NOTIFY_OK; } int ipa_modem_init(struct ipa *ipa, bool modem_init) @@ -362,13 +359,30 @@ void ipa_modem_exit(struct ipa *ipa) int ipa_modem_config(struct ipa *ipa) { - return qcom_register_ipa_notify(ipa->modem_rproc, ipa_modem_notify, - ipa); + void *notifier; + + ipa->nb.notifier_call = ipa_modem_notify; + + notifier = qcom_register_ssr_notifier("mpss", &ipa->nb); + if (IS_ERR(notifier)) + return PTR_ERR(notifier); + + ipa->notifier = notifier; + + return 0; } void ipa_modem_deconfig(struct ipa *ipa) { - qcom_deregister_ipa_notify(ipa->modem_rproc); + struct device *dev = &ipa->pdev->dev; + int ret; + + ret = qcom_unregister_ssr_notifier(ipa->notifier, &ipa->nb); + if (ret) + dev_err(dev, "error %d unregistering notifier", ret); + + ipa->notifier = NULL; + memset(&ipa->nb, 0, sizeof(ipa->nb)); } int ipa_modem_setup(struct ipa *ipa) -- 2.20.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] net: ipa: new notification infrastructure 2020-07-24 18:11 ` [PATCH 1/2] net: ipa: new notification infrastructure Alex Elder @ 2020-07-24 20:05 ` Bjorn Andersson 2020-07-25 0:33 ` David Miller 1 sibling, 0 replies; 4+ messages in thread From: Bjorn Andersson @ 2020-07-24 20:05 UTC (permalink / raw) To: Alex Elder; +Cc: davem, kuba, evgreen, subashab, cpratapa, netdev, linux-kernel On Fri 24 Jul 11:11 PDT 2020, Alex Elder wrote: > Use the new SSR notifier infrastructure to request notifications of > modem events, rather than the remoteproc IPA notification system. > The latter was put in place temporarily with the knowledge that the > new mechanism would become available. > Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> > Signed-off-by: Alex Elder <elder@linaro.org> > --- > David: If you approve, please only ACK; Bjorn will merge. > David, this depends on changes I carry in the rproc-next tree, so if you're okay with it I can pick this patch through my tree. Otherwise it will have to wait until 5.9 is out and I won't be able to remove the old ipa_notify code that this depends on until 5.11... Thanks, Bjorn > drivers/net/ipa/ipa.h | 3 ++ > drivers/net/ipa/ipa_modem.c | 56 +++++++++++++++++++++++-------------- > 2 files changed, 38 insertions(+), 21 deletions(-) > > diff --git a/drivers/net/ipa/ipa.h b/drivers/net/ipa/ipa.h > index b10a853929525..55115cfb29720 100644 > --- a/drivers/net/ipa/ipa.h > +++ b/drivers/net/ipa/ipa.h > @@ -10,6 +10,7 @@ > #include <linux/device.h> > #include <linux/notifier.h> > #include <linux/pm_wakeup.h> > +#include <linux/notifier.h> > > #include "ipa_version.h" > #include "gsi.h" > @@ -73,6 +74,8 @@ struct ipa { > enum ipa_version version; > struct platform_device *pdev; > struct rproc *modem_rproc; > + struct notifier_block nb; > + void *notifier; > struct ipa_smp2p *smp2p; > struct ipa_clock *clock; > atomic_t suspend_ref; > diff --git a/drivers/net/ipa/ipa_modem.c b/drivers/net/ipa/ipa_modem.c > index ed10818dd99f2..e34fe2d77324e 100644 > --- a/drivers/net/ipa/ipa_modem.c > +++ b/drivers/net/ipa/ipa_modem.c > @@ -9,7 +9,7 @@ > #include <linux/netdevice.h> > #include <linux/skbuff.h> > #include <linux/if_rmnet.h> > -#include <linux/remoteproc/qcom_q6v5_ipa_notify.h> > +#include <linux/remoteproc/qcom_rproc.h> > > #include "ipa.h" > #include "ipa_data.h" > @@ -311,43 +311,40 @@ static void ipa_modem_crashed(struct ipa *ipa) > dev_err(dev, "error %d zeroing modem memory regions\n", ret); > } > > -static void ipa_modem_notify(void *data, enum qcom_rproc_event event) > +static int ipa_modem_notify(struct notifier_block *nb, unsigned long action, > + void *data) > { > - struct ipa *ipa = data; > - struct device *dev; > + struct ipa *ipa = container_of(nb, struct ipa, nb); > + struct qcom_ssr_notify_data *notify_data = data; > + struct device *dev = &ipa->pdev->dev; > > - dev = &ipa->pdev->dev; > - switch (event) { > - case MODEM_STARTING: > + switch (action) { > + case QCOM_SSR_BEFORE_POWERUP: > dev_info(dev, "received modem starting event\n"); > ipa_smp2p_notify_reset(ipa); > break; > > - case MODEM_RUNNING: > + case QCOM_SSR_AFTER_POWERUP: > dev_info(dev, "received modem running event\n"); > break; > > - case MODEM_STOPPING: > - case MODEM_CRASHED: > + case QCOM_SSR_BEFORE_SHUTDOWN: > dev_info(dev, "received modem %s event\n", > - event == MODEM_STOPPING ? "stopping" > - : "crashed"); > + notify_data->crashed ? "crashed" : "stopping"); > if (ipa->setup_complete) > ipa_modem_crashed(ipa); > break; > > - case MODEM_OFFLINE: > + case QCOM_SSR_AFTER_SHUTDOWN: > dev_info(dev, "received modem offline event\n"); > break; > > - case MODEM_REMOVING: > - dev_info(dev, "received modem stopping event\n"); > - break; > - > default: > - dev_err(&ipa->pdev->dev, "unrecognized event %u\n", event); > + dev_err(dev, "received unrecognized event %lu\n", action); > break; > } > + > + return NOTIFY_OK; > } > > int ipa_modem_init(struct ipa *ipa, bool modem_init) > @@ -362,13 +359,30 @@ void ipa_modem_exit(struct ipa *ipa) > > int ipa_modem_config(struct ipa *ipa) > { > - return qcom_register_ipa_notify(ipa->modem_rproc, ipa_modem_notify, > - ipa); > + void *notifier; > + > + ipa->nb.notifier_call = ipa_modem_notify; > + > + notifier = qcom_register_ssr_notifier("mpss", &ipa->nb); > + if (IS_ERR(notifier)) > + return PTR_ERR(notifier); > + > + ipa->notifier = notifier; > + > + return 0; > } > > void ipa_modem_deconfig(struct ipa *ipa) > { > - qcom_deregister_ipa_notify(ipa->modem_rproc); > + struct device *dev = &ipa->pdev->dev; > + int ret; > + > + ret = qcom_unregister_ssr_notifier(ipa->notifier, &ipa->nb); > + if (ret) > + dev_err(dev, "error %d unregistering notifier", ret); > + > + ipa->notifier = NULL; > + memset(&ipa->nb, 0, sizeof(ipa->nb)); > } > > int ipa_modem_setup(struct ipa *ipa) > -- > 2.20.1 > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] net: ipa: new notification infrastructure 2020-07-24 18:11 ` [PATCH 1/2] net: ipa: new notification infrastructure Alex Elder 2020-07-24 20:05 ` Bjorn Andersson @ 2020-07-25 0:33 ` David Miller 1 sibling, 0 replies; 4+ messages in thread From: David Miller @ 2020-07-25 0:33 UTC (permalink / raw) To: elder Cc: kuba, evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel From: Alex Elder <elder@linaro.org> Date: Fri, 24 Jul 2020 13:11:41 -0500 > Use the new SSR notifier infrastructure to request notifications of > modem events, rather than the remoteproc IPA notification system. > The latter was put in place temporarily with the knowledge that the > new mechanism would become available. > > Signed-off-by: Alex Elder <elder@linaro.org> > --- > David: If you approve, please only ACK; Bjorn will merge. Acked-by: David S. Miller <davem@davemloft.net> ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-07-25 0:33 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-07-24 18:11 [PATCH 0/2] remoteproc: convert IPA to use new notifications Alex Elder 2020-07-24 18:11 ` [PATCH 1/2] net: ipa: new notification infrastructure Alex Elder 2020-07-24 20:05 ` Bjorn Andersson 2020-07-25 0:33 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).