Skip to contentSkip to conversation

mmc: core: log empty non-removable slots

PATCH In review Marc Gonzalez 2 participants 4 messages Mar 21, 2023 – Mar 24, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: core: log empty non-removable slots

An empty non-removable slot might be the symptom of probing too early.

---
 drivers/mmc/core/core.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/core/core.c +4 -0
index 426c7f66b3492..b8137baecee7c 100644
@@ -2257,6 +2257,10 @@ void mmc_rescan(struct work_struct *work)
 			break;
 	}
 
+	if (!mmc_card_is_removable(host) && !host->card)
+		pr_info("%s: no card detected, check post-power-on-delay-ms",
+			mmc_hostname(host));
+
 	/*
 	 * Ignore the command timeout errors observed during
 	 * the card init as those are excepted.
Signature · 1 line
2.25.1
#1 lore raw
Quoted 4 lines · Marc Gonzalez

An empty non-removable slot might be the symptom of probing too early.

I took the liberty of adjusting the code and the commit message a bit. Please let me know if it doesn't look good to you.

So, applied for next, thanks!

Kind regards
Uffe

Quoted 20 lines
---
 drivers/mmc/core/core.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/core/core.c +4 -1
index 426c7f66b3492..b8137baecee7c 100644
@@ -2257,6 +2257,10 @@ void mmc_rescan(struct work_struct *work)
                        break;
        }
 
+       if (!mmc_card_is_removable(host) && !host->card)
+               pr_info("%s: no card detected, check post-power-on-delay-ms",
+                       mmc_hostname(host));
+
        /*
         * Ignore the command timeout errors observed during
         * the card init as those are excepted.
--
Quoted 1 line

2.25.1

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

#2 lore raw
Quoted 8 lines · Ulf Hansson
Quoted 1 line · Marc Gonzalez

An empty non-removable slot might be the symptom of probing too early.

I took the liberty of adjusting the code and the commit message a bit. Please let me know if it doesn't look good to you.

So, applied for next, thanks!

Thanks for reviewing & merging.

Can you tell me (for my knowledge) why it's better to check host->bus_ops than host->card ?

If the situation should not happen, perhaps we should use pr_warn?

Regards

#3 lore raw
Quoted 10 lines · Marc Gonzalez
Quoted 7 lines · Ulf Hansson
Quoted 1 line · Marc Gonzalez

An empty non-removable slot might be the symptom of probing too early.

I took the liberty of adjusting the code and the commit message a bit. Please let me know if it doesn't look good to you.

Quoted 6 lines
Quoted 1 line

So, applied for next, thanks!

Thanks for reviewing & merging.

Can you tell me (for my knowledge) why it's better to check host->bus_ops than host->card ?

It doesn't really matter at this point, but to keep consistency for some other earlier code in mmc_rescan(), I decided to use host->bus_ops instead.

Quoted 2 lines

If the situation should not happen, perhaps we should use pr_warn?

Yes, maybe you are right.

In principle, I didn't want to use the warning level as I simply didn't know if we would end up spamming the log with lots of prints for various platforms. Perhaps we should change, when we know a bit more?

Kind regards
Uffe