New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 289754 link

Starred by 5 users

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Dec 2013
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug-Regression



Sign in to add a comment

[Butterfly] Hot plugging SD card is not working.

Project Member Reported by sontis@chromium.org, Sep 11 2013

Issue description

Google Chrome  30.0.1599.38 (Official Build 222409) beta
Platform       4537.56.0 (Official Build) beta-channel butterfly
Blink          537.36 (@157551)
JavaScript V8  3.20.17.7
Flash          11.8.800.170-r1


What steps will reproduce the problem?
1. Power on and sign in to the device.
2. Plugin any SD Card in to device.


What is the expected output? 
SD card should be mounted peppery.

What do you see instead?
SD card is not mounted.

Please use labels and text to provide additional information.
Boot with SD card and suspend/resume with SD card are mounting SD card.
Unplugging SD card is not unmounging

 
Owner: sha...@chromium.org
Status: Assigned

Comment 3 by sha...@chromium.org, Sep 12 2013

Cc: jean@chromium.org
Card insert / removal detection is not working on Butterfly. Strangely, it works perfectly  on Stout, which uses the same controller.

Probably it is related to this series of patches, which I stupidly only tested on Stout:

https://gerrit.chromium.org/gerrit/#/c/64352/
https://gerrit.chromium.org/gerrit/#/c/64353/
https://gerrit.chromium.org/gerrit/#/c/64354/
https://gerrit.chromium.org/gerrit/#/c/64355/
https://gerrit.chromium.org/gerrit/#/c/64356/

I will debug more and find the difference causing Butterfly to fail.

Comment 4 by sha...@chromium.org, Sep 12 2013

The problems started with this patch:

https://gerrit.chromium.org/gerrit/#/c/64352/

@@ -918,6 +920,9 @@ static void rtsx_pci_idle_work(struct work_struct *work)
         if (pcr->ops->turn_off_led)
                 pcr->ops->turn_off_led(pcr);

+        if (pcr->aspm_en)
+                rtsx_pci_write_config_byte(pcr, LCTLR, pcr->aspm_en);
+
         mutex_unlock(&pcr->pcr_mutex);
 }

After setting this register (which leads to the controller going to a low-power state, I think), card insertion / removal events are no longer seen.

I don't know why this is working perfectly on Stout but fails on Butterfly. I'm checking with Realtek now to see if they have suggestions. There are a few small differences in the lspci dump between the two parts, so the parts may not be entirely identical, even though they claim to be the same.

Comment 5 by sha...@chromium.org, Sep 13 2013

Cc: sonnyrao@chromium.org
Checking with Josafat, we have until Tuesday to fix this. Realtek has promised to help and is looking into the issue, but there is no update so far.

To workaround the issue, I have found that it's sufficient to just disable L1 on the CR (L0s is fine). If there is no resolution soon, I can try to commit a patch like this which disables L1 on Butterfly only:

diff --git a/drivers/mfd/rts5209.c b/drivers/mfd/rts5209.c
index 99e0ee2..ffdb64b 100644
--- a/drivers/mfd/rts5209.c
+++ b/drivers/mfd/rts5209.c
@@ -22,6 +22,7 @@
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/mfd/rtsx_pci.h>
+#include <linux/dmi.h>
 
 #include "rtsx_pcr.h"
 
@@ -36,6 +37,12 @@ static u8 rts5209_get_ic_version(struct rtsx_pcr *pcr)
 static void rts5209_init_settings(struct rtsx_pcr *pcr)
 {
        u32 reg;
+       static struct dmi_system_id dmi_butterfly[] = {
+               {
+                       .ident = "ChromeOS Butterfly",
+                       .matches = {DMI_MATCH(DMI_PRODUCT_NAME, "Butterfly")}
+               }, {}
+       };
 
        rtsx_pci_read_config_dword(pcr, PCR_SETTING_REG1, &reg);
        dev_dbg(&(pcr->pci->dev), "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG1, reg);
@@ -46,6 +53,17 @@ static void rts5209_init_settings(struct rtsx_pcr *pcr)
                pcr->aspm_en = rts5209_reg_to_aspm(reg);
        }
 
+       if (dmi_check_system(dmi_butterfly)) {
+               /*
+                * Do not allow L1 power state for the Butterfly CR
+                * due to card insert / removal wake-up issues.
+                * TODO(shawnn): fix real problem and remove this.
+                */
+               dev_warn(&(pcr->pci->dev), "Butterfly detected, disabling "
+                                          "device L1 state.\n");
+               pcr->aspm_en &= 0x01;
+       }
+
        rtsx_pci_read_config_dword(pcr, PCR_SETTING_REG2, &reg);
        dev_dbg(&(pcr->pci->dev), "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG2, reg);


I will run power_LoadTest over the weekend to determine the power impact of this patch. Also, +Sonny since any hack/fix will need his approval.
Cc: dbasehore@chromium.org snanda@chromium.org

Comment 7 by sha...@chromium.org, Sep 16 2013

- Disabling L1 causes a power increase of about 2.5% (about 6 minute difference on a full Butterfly battery) when the card socket is occupied during power_LoadTest.

- No power difference is seen when the card socket is unoccupied.

Realtek has requested a demo unit to work on the issue, and we're providing it. It seems unlikely that we'll have a tested fix before Tuesday evening.
snanda@ I think that is okay as long as we get it corrected in the next release?

Comment 9 by snanda@google.com, Sep 17 2013

Since the change in c#5 is butterfly specific and as long as we get it corrected soon, no objections from me.
Labels: Merge-Requested
Pre-requesting merge permission to R30:

https://chromium-review.googlesource.com/#/c/169725/

This is a Butterfly-only change to workaround the card detection bug. It will soon be tested on a ToT image.
We'll merge approve once validated in canary/tot


I have now validated the change on a ToT image (4703.0.0).
Labels: -Merge-Requested Merge-Approved
Labels: -Pri-1 -ReleaseBlock-Stable -Merge-Approved Pri-2 Merge-Merged
Merged to R30.

Removing release blocker label since the issue is now worked-around, but not marking as fixed yet since we're still working on a proper fix.
Project Member

Comment 15 by bugdroid1@chromium.org, Sep 23 2013

Project: chromiumos/third_party/kernel-next
Branch : release-R30-4537.B
Author : Shawn Nematbakhsh <shawnn@chromium.org>
Commit : bc8c3612a1b64912bcaa50467f6ca8825594162b

Code-Review  0 : chrome-internal-fetch
Code-Review  +2: Shawn Nematbakhsh
Commit-Queue 0 : chrome-internal-fetch
Commit-Queue +1: Shawn Nematbakhsh
Verified     0 : chrome-internal-fetch
Verified     +1: Shawn Nematbakhsh
Change-Id      : I52b73ad63c9cdc383bc7a22d7950a2f10a53a30e
Reviewed-at    : https://chromium-review.googlesource.com/169886

CHROMIUM: mfd: rts5209: Disable L1 power state on Butterfly.

When the rts5209 goes to L1 on Butterfly, it seems to stay there
forever, and card insertion / removal is not detected. To work around
this issue, disable device L1 on Butterfly only. This change should be
reverted once the real issue with L1 is fixed.

BUG= chromium:289754 
TEST=Manual. Update kernel on Butterfly, verify SD card removal +
insertion works properly.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Original-Change-Id: I5e945458911eab1101581d6544b62d6d13760c6b

M  drivers/mfd/rts5209.c
Project Member

Comment 16 by bugdroid1@chromium.org, Sep 23 2013

Project: chromiumos/third_party/kernel-next
Branch : chromeos-3.8
Author : Shawn Nematbakhsh <shawnn@chromium.org>
Commit : 257657aab42a430a094c8c329d8a0d562215d687

Code-Review  0 : Derek Basehore, Shawn Nematbakhsh, chrome-internal-fetch
Code-Review  +2: Sameer Nanda, Sonny Rao
Commit-Queue 0 : Derek Basehore, Sameer Nanda, Sonny Rao, chrome-internal-fetch
Commit-Queue +1: Shawn Nematbakhsh
Verified     0 : Derek Basehore, Sameer Nanda, Sonny Rao, chrome-internal-fetch
Verified     +1: Shawn Nematbakhsh
Change-Id      : I5e945458911eab1101581d6544b62d6d13760c6b
Reviewed-at    : https://chromium-review.googlesource.com/169725

CHROMIUM: mfd: rts5209: Disable L1 power state on Butterfly.

When the rts5209 goes to L1 on Butterfly, it seems to stay there
forever, and card insertion / removal is not detected. To work around
this issue, disable device L1 on Butterfly only. This change should be
reverted once the real issue with L1 is fixed.

BUG= chromium:289754 
TEST=Manual. Update kernel on Butterfly, verify SD card removal +
insertion works properly.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>

M  drivers/mfd/rts5209.c
Labels: -M-30 M-31
Moving to M-31 for proper fix
Did we ever get the proper fix?
No, there is no proper fix yet. I'll re-ping Realtek about it.
Status: WontFix
Butterfly has revered to the 3.4 kernel for unrelated reasons:

https://chromium-review.googlesource.com/#/c/179380/

This issue is no longer relevant to Butterfly or any other Chrome OS device.

Sign in to add a comment