stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] misc: rtsx: modify rts522a init flow
@ 2021-02-02 10:56 ricky_wu
  2021-02-02 12:27 ` Bjorn Helgaas
  0 siblings, 1 reply; 4+ messages in thread
From: ricky_wu @ 2021-02-02 10:56 UTC (permalink / raw)
  To: arnd, gregkh, ricky_wu, yuehaibing, ulf.hansson, bhelgaas, linux-kernel
  Cc: stable

From: Ricky Wu <ricky_wu@realtek.com>

Power down OCP for power consumption
when card is not exist at init_hw()

Cc: stable@vger.kernel.org
Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
---
 drivers/misc/cardreader/rts5227.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/misc/cardreader/rts5227.c b/drivers/misc/cardreader/rts5227.c
index 8859011672cb..8200af22b529 100644
--- a/drivers/misc/cardreader/rts5227.c
+++ b/drivers/misc/cardreader/rts5227.c
@@ -398,6 +398,11 @@ static int rts522a_extra_init_hw(struct rtsx_pcr *pcr)
 {
 	rts5227_extra_init_hw(pcr);
 
+	/* Power down OCP for power consumption */
+	if (!pcr->card_exist)
+		rtsx_pci_write_register(pcr, FPDCTL, OC_POWER_DOWN,
+				OC_POWER_DOWN);
+
 	rtsx_pci_write_register(pcr, FUNC_FORCE_CTL, FUNC_FORCE_UPME_XMT_DBG,
 		FUNC_FORCE_UPME_XMT_DBG);
 	rtsx_pci_write_register(pcr, PCLK_CTL, 0x04, 0x04);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] misc: rtsx: modify rts522a init flow
  2021-02-02 10:56 [PATCH] misc: rtsx: modify rts522a init flow ricky_wu
@ 2021-02-02 12:27 ` Bjorn Helgaas
  2021-02-03  3:13   ` 吳昊澄 Ricky
  0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2021-02-02 12:27 UTC (permalink / raw)
  To: ricky_wu
  Cc: arnd, gregkh, yuehaibing, ulf.hansson, bhelgaas, linux-kernel, stable

The subject line could be more descriptive.  All patches modify
something, so the only real information it contains is "rts522a" and
"init".  Maybe it could say something about powering off OCP (whatever
that is) when no memory card is present.

On Tue, Feb 02, 2021 at 06:56:41PM +0800, ricky_wu@realtek.com wrote:
> From: Ricky Wu <ricky_wu@realtek.com>
> 
> Power down OCP for power consumption
> when card is not exist at init_hw()

I assume "card is not exist" means "no SD/MMC card is present".

Why do you only do this for 5227?  "card_exist" seems to be a generic
concept (it's in struct rtsx_pcr and set by the generic
rtsx_pci_init_hw()).  Could/should this be done for other card readers
as well?

> Cc: stable@vger.kernel.org

Per https://www.kernel.org/doc/html/v5.10/process/stable-kernel-rules.html
(option 1) this is sufficient.  You should not include
stable@kernel.org in the cc: list above.

> Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
> ---
>  drivers/misc/cardreader/rts5227.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/misc/cardreader/rts5227.c b/drivers/misc/cardreader/rts5227.c
> index 8859011672cb..8200af22b529 100644
> --- a/drivers/misc/cardreader/rts5227.c
> +++ b/drivers/misc/cardreader/rts5227.c
> @@ -398,6 +398,11 @@ static int rts522a_extra_init_hw(struct rtsx_pcr *pcr)
>  {
>  	rts5227_extra_init_hw(pcr);
>  
> +	/* Power down OCP for power consumption */
> +	if (!pcr->card_exist)
> +		rtsx_pci_write_register(pcr, FPDCTL, OC_POWER_DOWN,
> +				OC_POWER_DOWN);
> +
>  	rtsx_pci_write_register(pcr, FUNC_FORCE_CTL, FUNC_FORCE_UPME_XMT_DBG,
>  		FUNC_FORCE_UPME_XMT_DBG);
>  	rtsx_pci_write_register(pcr, PCLK_CTL, 0x04, 0x04);
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] misc: rtsx: modify rts522a init flow
  2021-02-02 12:27 ` Bjorn Helgaas
@ 2021-02-03  3:13   ` 吳昊澄 Ricky
  2021-02-03 12:48     ` Bjorn Helgaas
  0 siblings, 1 reply; 4+ messages in thread
From: 吳昊澄 Ricky @ 2021-02-03  3:13 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: arnd, gregkh, yuehaibing, ulf.hansson, bhelgaas, linux-kernel, stable



> -----Original Message-----
> From: Bjorn Helgaas <helgaas@kernel.org>
> Sent: Tuesday, February 2, 2021 8:28 PM
> To: 吳昊澄 Ricky <ricky_wu@realtek.com>
> Cc: arnd@arndb.de; gregkh@linuxfoundation.org; yuehaibing@huawei.com;
> ulf.hansson@linaro.org; bhelgaas@google.com; linux-kernel@vger.kernel.org;
> stable@vger.kernel.org
> Subject: Re: [PATCH] misc: rtsx: modify rts522a init flow
> 
> The subject line could be more descriptive.  All patches modify something, so
> the only real information it contains is "rts522a" and "init".  Maybe it could
> say something about powering off OCP (whatever that is) when no memory
> card is present.
> 

Ok, I will update the subject line at V2 
"misc: rtsx: init of rts522a add power off OCP when no card is present"

> On Tue, Feb 02, 2021 at 06:56:41PM +0800, ricky_wu@realtek.com wrote:
> > From: Ricky Wu <ricky_wu@realtek.com>
> >
> > Power down OCP for power consumption
> > when card is not exist at init_hw()
> 
> I assume "card is not exist" means "no SD/MMC card is present".
> 

Right, it's that means, I will modify this description at V2

> Why do you only do this for 5227?  "card_exist" seems to be a generic
> concept (it's in struct rtsx_pcr and set by the generic rtsx_pci_init_hw()).
> Could/should this be done for other card readers as well?
> 

Only rts522a need to do this, other card readers can do HW auto power down

> > Cc: stable@vger.kernel.org
> 
> Per https://www.kernel.org/doc/html/v5.10/process/stable-kernel-rules.html
> (option 1) this is sufficient.  You should not include stable@kernel.org in the
> cc: list above.
> 

I am not very clear, I want this patch to Stable tree, so I added this Tag(Cc: stable@vger.kernel.org)
If I remove this Tag, it means this patch not go to Stable Tree?

Ricky

> > Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
> > ---
> >  drivers/misc/cardreader/rts5227.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/misc/cardreader/rts5227.c
> > b/drivers/misc/cardreader/rts5227.c
> > index 8859011672cb..8200af22b529 100644
> > --- a/drivers/misc/cardreader/rts5227.c
> > +++ b/drivers/misc/cardreader/rts5227.c
> > @@ -398,6 +398,11 @@ static int rts522a_extra_init_hw(struct rtsx_pcr
> > *pcr)  {
> >  	rts5227_extra_init_hw(pcr);
> >
> > +	/* Power down OCP for power consumption */
> > +	if (!pcr->card_exist)
> > +		rtsx_pci_write_register(pcr, FPDCTL, OC_POWER_DOWN,
> > +				OC_POWER_DOWN);
> > +
> >  	rtsx_pci_write_register(pcr, FUNC_FORCE_CTL,
> FUNC_FORCE_UPME_XMT_DBG,
> >  		FUNC_FORCE_UPME_XMT_DBG);
> >  	rtsx_pci_write_register(pcr, PCLK_CTL, 0x04, 0x04);
> > --
> > 2.17.1
> >
> 
> ------Please consider the environment before printing this e-mail.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] misc: rtsx: modify rts522a init flow
  2021-02-03  3:13   ` 吳昊澄 Ricky
@ 2021-02-03 12:48     ` Bjorn Helgaas
  0 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2021-02-03 12:48 UTC (permalink / raw)
  To: 吳昊澄 Ricky
  Cc: arnd, gregkh, yuehaibing, ulf.hansson, bhelgaas, linux-kernel, stable

On Wed, Feb 03, 2021 at 03:13:58AM +0000, 吳昊澄 Ricky wrote:
> > -----Original Message-----
> > From: Bjorn Helgaas <helgaas@kernel.org>
> > Sent: Tuesday, February 2, 2021 8:28 PM
> > To: 吳昊澄 Ricky <ricky_wu@realtek.com>
> > Cc: arnd@arndb.de; gregkh@linuxfoundation.org; yuehaibing@huawei.com;
> > ulf.hansson@linaro.org; bhelgaas@google.com; linux-kernel@vger.kernel.org;
> > stable@vger.kernel.org
> > Subject: Re: [PATCH] misc: rtsx: modify rts522a init flow

> > > Cc: stable@vger.kernel.org
> > 
> > Per https://www.kernel.org/doc/html/v5.10/process/stable-kernel-rules.html
> > (option 1) this is sufficient.  You should not include stable@kernel.org in the
> > cc: list above.
> 
> I am not very clear, I want this patch to Stable tree, so I added this Tag(Cc: stable@vger.kernel.org)
> If I remove this Tag, it means this patch not go to Stable Tree?

Never mind, please ignore my comment.  I think I was mistaken.

Bjorn

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-03 12:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 10:56 [PATCH] misc: rtsx: modify rts522a init flow ricky_wu
2021-02-02 12:27 ` Bjorn Helgaas
2021-02-03  3:13   ` 吳昊澄 Ricky
2021-02-03 12:48     ` Bjorn Helgaas

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).