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

Sarthak Garg April 14, 2023, 5:29 a.m. UTC | #1
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
Sarthak Garg April 14, 2023, 5:33 a.m. UTC | #2
Hi christoph,

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 we have redesigned our entire logic and moved complete code to vendor specific file and to support this new design now we just need these two hooks in suspend and resume functions along with few symbols to be exported so that we can use those symbols in our vendor files. I will push the vendor specific changes in the next patchset.


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: Christoph Hellwig <hch@infradead.org>
> Sent: Tuesday, April 4, 2023 10:44 AM
> 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>; Linus Walleij
> <linus.walleij@linaro.org>
> Subject: Re: [PATCH V1 1/2] mmc: core: Define new vendor ops to enable
> internal features
> 
> On Sat, Apr 01, 2023 at 10:27:22PM +0530, Sarthak Garg wrote:
> > Define new ops to let vendor enable internal features in
> > mmc_suspend/resume paths like partial init feature.
> 
> 1) vendors have absolutely no business doing anything, you might be
>    doing either something entirely wrong or use the wrong terminology
>    here.
> 
> 2) any kind of core hook not only needs a very good description, but
>    also an actual user that goes along in the same series.
Christoph Hellwig April 14, 2023, 5:36 a.m. UTC | #3
You don't get it.  There is no such thing "as vendor files".

I'm not sure where you get your terminology from, but whatever that is
might be your source of the fundamental misunderstanding how Linux
kernel development works.  I would recommend to take some training
before wasting everyones time.
Sarthak Garg April 14, 2023, 6:52 a.m. UTC | #4
Sorry for the confusion by vendor file I meant driver file for Qualcomm SDCC controller (sdhci-msm.c).
Further to make things more clear I will push the complete series.

> -----Original Message-----
> From: Christoph Hellwig <hch@infradead.org>
> Sent: Friday, April 14, 2023 11:06 AM
> To: Sarthak Garg (QUIC) <quic_sartgarg@quicinc.com>
> Cc: Christoph Hellwig <hch@infradead.org>; 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>; Linus Walleij
> <linus.walleij@linaro.org>
> Subject: Re: [PATCH V1 1/2] mmc: core: Define new vendor ops to enable
> internal features
> 
> You don't get it.  There is no such thing "as vendor files".
> 
> I'm not sure where you get your terminology from, but whatever that is might
> be your source of the fundamental misunderstanding how Linux kernel
> development works.  I would recommend to take some training before wasting
> everyones time.
Christoph Hellwig April 14, 2023, 1:15 p.m. UTC | #5
On Fri, Apr 14, 2023 at 06:52:18AM +0000, Sarthak Garg (QUIC) wrote:
> Sorry for the confusion by vendor file I meant driver file for Qualcomm SDCC controller (sdhci-msm.c).

This is still not how we do development.  The two series you've been
pointed out got valuable feedback that;s been ignored for between one
and four years, that needs to be followed up with.

You're not going to get magic hooks for your driver that you're not
sharing with us just because you're too lazy to follow up on the review
comments.
Sarthak Garg May 11, 2023, 5 a.m. UTC | #6
Thanks for your valuable comments. We didn't ignore the previous comments instead we tried to address most of the comments by trying the suggested alternatives as well but didn't see power improvement as compared to this feature. Moreover we got the intuition that maintainability was the main concern hence we came up with this newer approach of hooks to limit the lines of code in core layer. Every change was pushed earlier in the previous posts and this time we just refactored the code and was about to push the series but as per current discussion we'll be reviving the old discussion and try to close all the comments. Closing this thread now.

> -----Original Message-----
> From: Christoph Hellwig <hch@infradead.org>
> Sent: Friday, April 14, 2023 6:46 PM
> To: Sarthak Garg (QUIC) <quic_sartgarg@quicinc.com>
> Cc: Christoph Hellwig <hch@infradead.org>; 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>; Linus Walleij
> <linus.walleij@linaro.org>
> Subject: Re: [PATCH V1 1/2] mmc: core: Define new vendor ops to enable
> internal features
> 
> On Fri, Apr 14, 2023 at 06:52:18AM +0000, Sarthak Garg (QUIC) wrote:
> > Sorry for the confusion by vendor file I meant driver file for Qualcomm SDCC
> controller (sdhci-msm.c).
> 
> This is still not how we do development.  The two series you've been pointed out
> got valuable feedback that;s been ignored for between one and four years, that
> needs to be followed up with.
> 
> You're not going to get magic hooks for your driver that you're not sharing with
> us just because you're too lazy to follow up on the review comments.