mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Echo Zhang (张玉)" <Echo.Zhang@mediatek.com>
To: Roman Vivchar <rva333@protonmail.com>
Cc: "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Brian Masney" <bmasney+clk@redhat.com>,
	"Jerome Brunet" <jbrunet+clk@baylibre.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	"MMDVFS Team" <linux-mediatek@lists.infradead.org>,
	"Kyrie Wu (吴晗)" <Kyrie.Wu@mediatek.com>,
	"Ming-Fan Chen (陳明汎)" <Ming-Fan.Chen@mediatek.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"llvm@lists.linux.dev" <llvm@lists.linux.dev>
Subject: Re: [PATCH 4/7] soc: mediatek: mmdvfs: add VCP backend
Date: Thu, 26 Nov 2026 09:15:24 +0000	[thread overview]
Message-ID: <aec7ad7951653fc1494aead59c61de3c144316bc.camel@mediatek.com> (raw)

On 三, 2026-11-25 at 08:38 +0000, Roman Vivchar wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On Wednesday, November 25th, 2026 at 8:01 AM, Echo Zhang
> <echo.zhang@mediatek.com> wrote:
> 
> > Add the VCP transport used by MMDVFS to map AP and firmware shared
> > memory, manage feature power references and send IPI commands.
> > 
> > Wait for VCP readiness and handle the selected MMUP or VCP READY
> > notification to initialize firmware after boot and resume.
> > Serialize
> > IPI transactions while shared memory and acknowledgment state are
> > in
> > use.
> > 
> > Signed-off-by: Echo Zhang <echo.zhang@mediatek.com>
> > ---
> 
> ...
> 
> > diff --git a/drivers/soc/mediatek/mmdvfs/mmdvfs-core.c
> > b/drivers/soc/mediatek/mmdvfs/mmdvfs-core.c
> > index c32fa11557af..3388a5a3a145 100644
> > --- a/drivers/soc/mediatek/mmdvfs/mmdvfs-core.c
> > +++ b/drivers/soc/mediatek/mmdvfs/mmdvfs-core.c
> > @@ -7,22 +7,23 @@
> > 
> >  #include <linux/atomic.h>
> >  #include <linux/clk-provider.h>
> > +#include <linux/delay.h>
> >  #include <linux/device.h>
> >  #include <linux/err.h>
> >  #include <linux/io.h>
> > +#include <linux/kthread.h>
> >  #include <linux/module.h>
> >  #include <linux/mutex.h>
> > -#include <linux/notifier.h>
> >  #include <linux/of.h>
> >  #include <linux/of_address.h>
> >  #include <linux/platform_device.h>
> > +#include <linux/remoteproc/mtk_vcp_public.h>
> >  #include <linux/sched/clock.h>
> >  #include <linux/slab.h>
> >  #include <linux/string.h>
> > -#include <linux/suspend.h>
> > -#include <linux/workqueue.h>
> > 
> >  #include "mmdvfs-internal.h"
> > +#include "mmdvfs-up-priv.h"
> > 
> >  static int mmdvfs_register_device(struct mmdvfs_device *mmdvfs);
> >  static void mmdvfs_unregister_device(struct mmdvfs_device
> > *mmdvfs);
> > @@ -34,14 +35,13 @@ struct mmdvfs_device
> > *mmdvfs_find_device_any(void)
> >  {
> >       return
> > mmdvfs_find_device_by_version(MMDVFS_VERSION_HWCCF_DVFS_VOTER);
> >  }
> > -EXPORT_SYMBOL_GPL(mmdvfs_find_device_any);
> > 
> >  /**
> >   * mmdvfs_get_version - Get MMDVFS voting mechanism type
> >   *
> >   * Return:
> >   *   0 - No hardware voter
> > - *   1 - HWCCF DVFS voter
> > + *   1 - HWCCF DVFS voter (VCP IPI with MMUP SRAM)
> >   */
> >  u32 mmdvfs_get_version(void)
> >  {
> > @@ -96,7 +96,8 @@ static int mmdvfs_validate_topology(struct
> > mmdvfs_device *mmdvfs)
> >                       return -EINVAL;
> >               }
> > 
> > -             if (mux->freq_num == 0 || mux->freq_num >
> > MMDVFS_MAX_LEVELS) {
> > +             if (mux->freq_num == 0 || mux->freq_num > rc-
> > >level_num ||
> > +                 mux->freq_num > MMDVFS_MAX_LEVELS) {
> >                       mmdvfs_err(mmdvfs->dev,
> >                                  "MUX %d (%s): invalid freq_num:
> > %d\n",
> >                                  i, mux->name, mux->freq_num);
> > @@ -112,10 +113,11 @@ static int mmdvfs_validate_topology(struct
> > mmdvfs_device *mmdvfs)
> >                       }
> > 
> >                       if (j > 0 && mux->freq[j] <= mux->freq[j -
> > 1]) {
> > -                             mmdvfs_warn(mmdvfs->dev,
> > -                                         "MUX %d (%s): freq not
> > ascending: freq[%d]=%llu <= freq[%d]=%llu\n",
> > -                                         i, mux->name, j, mux-
> > >freq[j],
> > -                                         j - 1, mux->freq[j - 1]);
> > +                             mmdvfs_err(mmdvfs->dev,
> > +                                        "MUX %d (%s): freq not
> > ascending: freq[%d]=%llu <= freq[%d]=%llu\n",
> > +                                        i, mux->name, j, mux-
> > >freq[j],
> > +                                        j - 1, mux->freq[j - 1]);
> > +                             return -EINVAL;
> 
> Why this can't be in the previous patch?
> 
> ...
> 
> > diff --git a/drivers/soc/mediatek/mmdvfs/mmdvfs-vcp.c
> > b/drivers/soc/mediatek/mmdvfs/mmdvfs-vcp.c
> > new file mode 100644
> > index 000000000000..fc6db1c89294
> > --- /dev/null
> > +++ b/drivers/soc/mediatek/mmdvfs/mmdvfs-vcp.c
> 
> ...
> 
> > +/*
> > + * mmdvfs_get_bootmode - Get system boot mode
> > + *
> > + * Query boot mode from device tree /chosen node
> > + */
> > +static void mmdvfs_get_bootmode(void)
> > +{
> > +     struct device_node *np_chosen;
> > +     struct tag_bootmode {
> > +             u32 size;
> > +             u32 tag;
> > +             u32 bootmode;
> > +             u32 boottype;
> > +     } *tag;
> > +
> > +     if (bootmode < UNKNOWN_BOOT)
> > +             return;
> > +
> > +     np_chosen = of_find_node_by_path("/chosen");
> > +     if (!np_chosen) {
> > +             bootmode = NORMAL_BOOT;
> > +             return;
> > +     }
> > +
> > +     tag = (struct tag_bootmode *)of_get_property(np_chosen,
> > "atag,boot", NULL);
> > +     of_node_put(np_chosen);
> > +
> > +     if (tag)
> > +             bootmode = tag->bootmode;
> > +     else
> > +             bootmode = NORMAL_BOOT;
> > +}
> 
> No. Please don't add your downstream code.
> 
> I'll stop here. This patch modifies too many things from the previous
> one, and the series overall needs more cleanup.
> 
> Best regards,
> Roman

Hi Roman,

Agreed. The topology validation correction belongs in the patch that
first adds the validation code. I will move it there in v2 instead of
adding code in one patch and fixing it in the next.

I will also remove the downstream bootmode handling, including the
atag,boot lookup and the recovery-mode IPI shortcut. The VCP backend
patch changes too much of the preceding core patch; I will rework the
split and remove downstream-specific code before resubmitting.

Thanks,
Echo

             reply	other threads:[~2026-11-26  9:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  9:15 Echo Zhang (张玉) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-11-26  9:03 Echo Zhang (张玉)
2026-11-25  6:00 [PATCH 0/7] soc: mediatek: add MMDVFS support for MT8196 Echo Zhang
2026-11-25  6:00 ` [PATCH 4/7] soc: mediatek: mmdvfs: add VCP backend Echo Zhang
2026-11-25  8:38   ` Roman Vivchar
2026-11-25 10:59   ` Krzysztof Kozlowski
2026-11-25 11:00   ` Krzysztof Kozlowski
2026-11-25 14:32   ` Ben Grisdale

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=aec7ad7951653fc1494aead59c61de3c144316bc.camel@mediatek.com \
    --to=echo.zhang@mediatek.com \
    --cc=Kyrie.Wu@mediatek.com \
    --cc=Ming-Fan.Chen@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bmasney+clk@redhat.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet+clk@baylibre.com \
    --cc=justinstitt@google.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=llvm@lists.linux.dev \
    --cc=matthias.bgg@gmail.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=robh@kernel.org \
    --cc=rva333@protonmail.com \
    --cc=sboyd@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®