mbox series

[V1,0/2] Introduce new vendor op and export few symbols

Message ID 20230401165723.19762-1-quic_sartgarg@quicinc.com
Headers show
Series Introduce new vendor op and export few symbols | expand

Message

Sarthak Garg April 1, 2023, 4:57 p.m. UTC
For our earlier discussions on clock scaling and partial init features
we have come up with a new design where we have moved the entire logic
for both the features in our vendor related files.

But to support this new design we need a vendor op in
_mmc_suspend/_mmc_resume functions to control our feature functionality
in suspend/resume paths.
Moreover export of few symbols is also needed to make core layer
functions accessible to our vendor module.

Old discussion for Clock scaling feature :
https://patchwork.kernel.org/project/linux-mmc/cover/1571668177-3766-1-git-send-email-rampraka@codeaurora.org/

Old discussion for Partial init feature :
https://patchwork.kernel.org/project/linux-mmc/patch/1650963852-4173-1-git-send-email-quic_spathi@quicinc.com/

Hence introduce new vendor op in suspend/resume and export few symbols
nedeed for our feature.

Sarthak Garg (2):
  mmc: core: Define new vendor ops to enable internal features
  mmc: core: Export core functions to let vendors use for their features

 drivers/mmc/core/core.c    |  6 ++++++
 drivers/mmc/core/host.c    |  1 +
 drivers/mmc/core/mmc.c     | 31 ++++++++++++++++++++++---------
 drivers/mmc/core/mmc_ops.c |  1 +
 drivers/mmc/core/queue.c   |  1 +
 include/linux/mmc/host.h   |  4 ++++
 6 files changed, 35 insertions(+), 9 deletions(-)

Comments

Linus Walleij April 2, 2023, 12:48 p.m. UTC | #1
Hi Sarthak,

thanks for your patch!

On Sat, Apr 1, 2023 at 6:57 PM Sarthak Garg <quic_sartgarg@quicinc.com> wrote:

> Define new ops to let vendor enable internal features in
> mmc_suspend/resume paths like partial init feature.
>
> Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
(...)

> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -212,6 +212,10 @@ struct mmc_host_ops {
>
>         /* Initialize an SD express card, mandatory for MMC_CAP2_SD_EXP. */
>         int     (*init_sd_express)(struct mmc_host *host, struct mmc_ios *ios);
> +
> +       void    (*cache_card_properties)(struct mmc_host *host);
> +       bool    (*partial_init_card)(struct mmc_host *host);

These have confusing names, first it has nothing to do with
cards since the callbacks are to the host. Second the functions
are named after usecases in a certain host rather than function.

I would just call them .suspend() and .resume(), the use
is obvious and they are called from the driver .suspend()
and .resume() hooks.

Yours,
Linus Walleij
Sarthak Garg April 14, 2023, 5:29 a.m. UTC | #2
Hi linus,

Thanks for your comments.

As mentioned in the cover letter that these ops are needed to implement clock scaling and partial init features for which we already had below discussions but faced strong resistance from community. Since these were huge code changes so maintainability was the main concern. Hence I have redesigned our entire logic and moved complete code to vendor specific file and to support this new design now I just need these two hooks in suspend and resume functions that’s why I have added these callbacks in host_ops.

I can rename these to vendor_suspend/resume ops to let vendor modify few things needed in suspend/resume paths. Also if you want to suggest any better name then I am open for that also.

Old discussion for Clock scaling feature :
https://patchwork.kernel.org/project/linux-mmc/cover/1571668177-3766-1-git-send-email-rampraka@codeaurora.org/

Old discussion for Partial init feature :
https://patchwork.kernel.org/project/linux-mmc/patch/1650963852-4173-1-git-send-email-quic_spathi@quicinc.com/

Thanks,
Sarthak

> -----Original Message-----
> From: Linus Walleij <linus.walleij@linaro.org>
> Sent: Sunday, April 2, 2023 6:19 PM
> To: Sarthak Garg (QUIC) <quic_sartgarg@quicinc.com>
> Cc: adrian.hunter@intel.com; ulf.hansson@linaro.org; linux-
> mmc@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-
> msm@vger.kernel.org; Ram Prakash Gupta (QUIC)
> <quic_rampraka@quicinc.com>; Bhaskar Valaboju (QUIC)
> <quic_bhaskarv@quicinc.com>; Sachin Gupta (QUIC)
> <quic_sachgupt@quicinc.com>; Pradeep Pragallapati (QUIC)
> <quic_pragalla@quicinc.com>; Sayali Lokhande (QUIC)
> <quic_sayalil@quicinc.com>; Brian Norris <briannorris@chromium.org>;
> Wolfram Sang <wsa+renesas@sang-engineering.com>
> Subject: Re: [PATCH V1 1/2] mmc: core: Define new vendor ops to enable
> internal features
> 
> Hi Sarthak,
> 
> thanks for your patch!
> 
> On Sat, Apr 1, 2023 at 6:57 PM Sarthak Garg <quic_sartgarg@quicinc.com>
> wrote:
> 
> > Define new ops to let vendor enable internal features in
> > mmc_suspend/resume paths like partial init feature.
> >
> > Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
> (...)
> 
> > --- a/include/linux/mmc/host.h
> > +++ b/include/linux/mmc/host.h
> > @@ -212,6 +212,10 @@ struct mmc_host_ops {
> >
> >         /* Initialize an SD express card, mandatory for MMC_CAP2_SD_EXP. */
> >         int     (*init_sd_express)(struct mmc_host *host, struct mmc_ios *ios);
> > +
> > +       void    (*cache_card_properties)(struct mmc_host *host);
> > +       bool    (*partial_init_card)(struct mmc_host *host);
> 
> These have confusing names, first it has nothing to do with cards since the
> callbacks are to the host. Second the functions are named after usecases in a
> certain host rather than function.
> 
> I would just call them .suspend() and .resume(), the use is obvious and they are
> called from the driver .suspend() and .resume() hooks.
> 
> Yours,
> Linus Walleij