2021-01-22 03:38:51

by Ricky Wu

[permalink] [raw]
Subject: [PATCH v3] misc: rtsx: init value of aspm_enabled

From: Ricky Wu <[email protected]>

v1:
make sure ASPM state sync with pcr->aspm_enabled
init value pcr->aspm_enabled
v2:
fixes conditions in v1 if-statement
v3:
more description for v1 and v2

Cc: [email protected]
Signed-off-by: Ricky Wu <[email protected]>
---
drivers/misc/cardreader/rtsx_pcr.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/cardreader/rtsx_pcr.c b/drivers/misc/cardreader/rtsx_pcr.c
index 2aa6648fa41f..5a491d2cd1ae 100644
--- a/drivers/misc/cardreader/rtsx_pcr.c
+++ b/drivers/misc/cardreader/rtsx_pcr.c
@@ -1512,6 +1512,7 @@ static int rtsx_pci_probe(struct pci_dev *pcidev,
struct pcr_handle *handle;
u32 base, len;
int ret, i, bar = 0;
+ u8 val;

dev_dbg(&(pcidev->dev),
": Realtek PCI-E Card Reader found at %s [%04x:%04x] (rev %x)\n",
@@ -1577,7 +1578,11 @@ static int rtsx_pci_probe(struct pci_dev *pcidev,
pcr->host_cmds_addr = pcr->rtsx_resv_buf_addr;
pcr->host_sg_tbl_ptr = pcr->rtsx_resv_buf + HOST_CMDS_BUF_LEN;
pcr->host_sg_tbl_addr = pcr->rtsx_resv_buf_addr + HOST_CMDS_BUF_LEN;
-
+ rtsx_pci_read_register(pcr, ASPM_FORCE_CTL, &val);
+ if (val & FORCE_ASPM_CTL0 && val & FORCE_ASPM_CTL1)
+ pcr->aspm_enabled = false;
+ else
+ pcr->aspm_enabled = true;
pcr->card_inserted = 0;
pcr->card_removed = 0;
INIT_DELAYED_WORK(&pcr->carddet_work, rtsx_pci_card_detect);
--
2.17.1


2021-01-22 07:30:42

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v3] misc: rtsx: init value of aspm_enabled

On Fri, Jan 22, 2021 at 11:33:48AM +0800, [email protected] wrote:
> From: Ricky Wu <[email protected]>
>
> v1:
> make sure ASPM state sync with pcr->aspm_enabled
> init value pcr->aspm_enabled
> v2:
> fixes conditions in v1 if-statement
> v3:
> more description for v1 and v2

This needs to go below the --- line.

And there is no description of what the patch does anymore :(

Please fix up and do a v4.

thanks,

greg k-h

2021-01-22 07:33:35

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v3] misc: rtsx: init value of aspm_enabled

On Fri, Jan 22, 2021 at 11:33:48AM +0800, [email protected] wrote:
> From: Ricky Wu <[email protected]>
>
> v1:
> make sure ASPM state sync with pcr->aspm_enabled
> init value pcr->aspm_enabled
> v2:
> fixes conditions in v1 if-statement
> v3:
> more description for v1 and v2
>
> Cc: [email protected]
> Signed-off-by: Ricky Wu <[email protected]>
> ---
> drivers/misc/cardreader/rtsx_pcr.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)

Also, you forgot a "Fixes:" tag.

thanks,

greg k-h