Skip to contentSkip to conversation

SDHCI driver runnining in aspire one, allows to write to R/O SD cards

DISCUSSION Maxim Levitsky 4 participants 9 messages Apr 20, 2009 – May 3, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

I am an owner of aspire one, and it has a card reader.
when I take a sd card, and pull down the protection tab, it still allows to write to the card (I tested with my main notebook that indeed, it did write there).

My main notebook, acer aspire 5720, doesn't have this problem. Kernel version in use is 2.6.28 vanilla, but this did happen in former version as well.

Attached lspci, on acer one.

04:00.0 System peripheral [0880]: JMicron Technologies, Inc. SD/MMC Host Controller [197b:2382]
Subsystem: Acer Incorporated [ALI] Device [1025:015b]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 19
Region 0: Memory at 54100300 (32-bit, non-prefetchable) [size=256]
[virtual] Expansion ROM at 53100000 [disabled] [size=32K]
Capabilities: [a4] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 unlimited
ClockPM- Suprise- LLActRep- BwNot-
LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
Capabilities: [94] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable-
Address: fffffffc Data: 0000
Kernel driver in use: sdhci-pci

04:00.2 SD Host controller [0805]: JMicron Technologies, Inc. Standard SD Host Controller [197b:2381] (prog-if 01)
Subsystem: Acer Incorporated [ALI] Device [1025:015b]
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 19
Region 0: Memory at 54100200 (32-bit, non-prefetchable) [size=256]
Capabilities: [a4] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 128 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 unlimited
ClockPM- Suprise- LLActRep- BwNot-
LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
Capabilities: [94] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable-
Address: fffffffc Data: 0000

04:00.3 System peripheral [0880]: JMicron Technologies, Inc. MS Host Controller [197b:2383]
Subsystem: Acer Incorporated [ALI] Device [1025:015b]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 19
Region 0: Memory at 54100100 (32-bit, non-prefetchable) [size=256]
Capabilities: [a4] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 128 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 unlimited
ClockPM- Suprise- LLActRep- BwNot-
LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
Capabilities: [94] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable-
Address: fffffffc Data: 0000
Kernel driver in use: jmb38x_ms
Kernel modules: jmb38x_ms

04:00.4 System peripheral [0880]: JMicron Technologies, Inc. xD Host Controller [197b:2384]
Subsystem: Acer Incorporated [ALI] Device [1025:015b]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 11
Region 0: Memory at 54100000 (32-bit, non-prefetchable) [size=256]
Capabilities: [a4] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 128 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 unlimited
ClockPM- Suprise- LLActRep- BwNot-
LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
Capabilities: [94] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable-
Address: fffffffc Data: 0000

#1 lore raw
Quoted 7 lines · Maxim Levitsky

Hi,

I am an owner of aspire one, and it has a card reader.
when I take a sd card, and pull down the protection tab, it still allows to write to the card (I tested with my main notebook that indeed, it did write there).

Quoted 6 lines

My main notebook, acer aspire 5720, doesn't have this problem. Kernel version in use is 2.6.28 vanilla, but this did happen in former version as well.

Attached lspci, on acer one.

Do you know if it worked in any kernel version or OS? It's known that some SD card readers are too cheap to actually implement the write-protect detection.

#2 lore raw
Quoted 13 lines · Robert Hancock
Quoted 12 lines · Maxim Levitsky

Hi,

I am an owner of aspire one, and it has a card reader.
when I take a sd card, and pull down the protection tab, it still allows to write to the card (I tested with my main notebook that indeed, it did write there).

My main notebook, acer aspire 5720, doesn't have this problem. Kernel version in use is 2.6.28 vanilla, but this did happen in former version as well.

Quoted 5 lines
Quoted 1 line

Attached lspci, on acer one.

Do you know if it worked in any kernel version or OS? It's known that some SD card readers are too cheap to actually implement the write-protect detection.

I'll test in windows, but in linux it never did work.

Best regards,
Maxim Levitsky

#3 lore raw
Quoted 16 lines · Maxim Levitsky
Quoted 15 lines · Robert Hancock
Quoted 13 lines · Maxim Levitsky

Hi,

I am an owner of aspire one, and it has a card reader.
when I take a sd card, and pull down the protection tab, it still allows to write to the card (I tested with my main notebook that indeed, it did write there).

My main notebook, acer aspire 5720, doesn't have this problem. Kernel version in use is 2.6.28 vanilla, but this did happen in former version as well.

Attached lspci, on acer one.

Quoted 9 lines
Quoted 3 lines

Do you know if it worked in any kernel version or OS? It's known that some SD card readers are too cheap to actually implement the write-protect detection.

I'll test in windows, but in linux it never did work.

Best regards,
Maxim Levitsky

Yep, works fine in windows.
Tested with and without lock tab.

Best regards,
Maxim Levitsky

#4 lore raw

As an extra data point, my sdhost driver in OpenSolaris works fine on the AA1.. it does see that the cards are locked, and refuses to allow them to be mounted read/write.

This leads me to believe that the original linux problem is one of two things:

* either a bug in the linux code, or
* busted circuit/hardware on a specific unit (i.e. a damaged unit)

I believe that if the Linux code was buggy here, the problem would be reproducible on all platforms, not just the AA1. So my inclination, barring independent confirmation, is that most likely there are one ore more defective units out there.

Note that the AA1 also has buggy BIOS -- OpenSolaris can't "see" the cards (registers aren't properly initialized) unless they are present when the unit first powers up.

-- Garrett

Quoted 40 lines · Maxim Levitsky
Quoted 16 lines · Maxim Levitsky
Quoted 14 lines · Robert Hancock
Quoted 12 lines · Maxim Levitsky

Hi,

I am an owner of aspire one, and it has a card reader.
when I take a sd card, and pull down the protection tab, it still allows to write to the card (I tested with my main notebook that indeed, it did write there).

My main notebook, acer aspire 5720, doesn't have this problem. Kernel version in use is 2.6.28 vanilla, but this did happen in former version as well.

Quoted 10 lines
Quoted 4 lines
Quoted 2 lines

Attached lspci, on acer one.

Do you know if it worked in any kernel version or OS? It's known that some SD card readers are too cheap to actually implement the write-protect detection.

I'll test in windows, but in linux it never did work.

Best regards,
Maxim Levitsky

Yep, works fine in windows.
Tested with and without lock tab.

Best regards,
Maxim Levitsky

_______________________________________________
sdhci-devel mailing list
[email protected]
http://list.drzeus.cx/mailman/listinfo/sdhci-devel

#5 lore raw
Quoted 10 lines · Garrett D'Amore

As an extra data point, my sdhost driver in OpenSolaris works fine on the AA1.. it does see that the cards are locked, and refuses to allow them to be mounted read/write.

This leads me to believe that the original linux problem is one of two things:

* either a bug in the linux code, or
* busted circuit/hardware on a specific unit (i.e. a damaged unit)

Quoted 8 lines

I believe that if the Linux code was buggy here, the problem would be reproducible on all platforms, not just the AA1. So my inclination, barring independent confirmation, is that most likely there are one ore more defective units out there.

Note that the AA1 also has buggy BIOS -- OpenSolaris can't "see" the cards (registers aren't properly initialized) unless they are present when the unit first powers up.

But, why it works in windows?

Regards,
Maxim Levitsky

#6 lore raw
Quoted 9 lines · Maxim Levitsky
Quoted 7 lines · Garrett D'Amore

As an extra data point, my sdhost driver in OpenSolaris works fine on the AA1.. it does see that the cards are locked, and refuses to allow them to be mounted read/write.

This leads me to believe that the original linux problem is one of two things:

* either a bug in the linux code, or
* busted circuit/hardware on a specific unit (i.e. a damaged unit)

Quoted 7 lines
Quoted 4 lines

I believe that if the Linux code was buggy here, the problem would be reproducible on all platforms, not just the AA1. So my inclination, barring independent confirmation, is that most likely there are one ore more defective units out there.

Note that the AA1 also has buggy BIOS -- OpenSolaris can't "see" the cards (registers aren't properly initialized) unless they are present when the unit first powers up.

But, why it works in windows?

The Microsoft PCI code base probably is more willing to "work around" BIOSes that don't properly configure PCI configuration registers... this is an outstanding RFE for Solaris.

The Windows code base also has some other unrelated quirks in it -- it uses DAT3 for card presence detection instead of the card detect bit in the sdhci controller, for example. (It also doesn't support MMC, which is to blame for some of the bastardized controller hacks that mfgrs like Ricoh have done to separate their MMC and SDcard handling into separate PCI functions. Yes, that's a hardware workaround for a software bug! Go figure -- its what happens when one software company has a virtual monopoly...)

-- Garrett

Quoted 4 lines

Regards,
Maxim Levitsky

#7 lore raw
In reply to Garrett D'Amore
Quoted 10 lines · On Mon, 27 Apr 2009 11:12:13 -0700 Garrett D'Amore <[email protected]> wrote:

As an extra data point, my sdhost driver in OpenSolaris works fine on the AA1.. it does see that the cards are locked, and refuses to allow them to be mounted read/write.

This leads me to believe that the original linux problem is one of two things:

* either a bug in the linux code, or
* busted circuit/hardware on a specific unit (i.e. a damaged unit)

I don't suppose you could try a Linux LiveCD to determine if your AA1 has the same issue under Linux?

Rgds

Signature · 6 lines
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.
#8 lore raw
Quoted 8 lines · Pierre Ossman
Quoted 4 lines · On Mon, 27 Apr 2009 11:12:13 -0700 Garrett D'Amore <[email protected]> wrote:

As an extra data point, my sdhost driver in OpenSolaris works fine on the AA1.. it does see that the cards are locked, and refuses to allow them to be mounted read/write.

This leads me to believe that the original linux problem is one of two things:

Quoted 8 lines
Quoted 4 lines

* either a bug in the linux code, or
* busted circuit/hardware on a specific unit (i.e. a damaged unit)

I don't suppose you could try a Linux LiveCD to determine if your AA1 has the same issue under Linux?

I'll have to download one, and I need to install via USB media... (which I've not done with Linux before) -- the AA1 doesn't have a CDROM drive.

- Garrett

Quoted 9 lines

Rgds

------------------------------------------------------------------------

_______________________________________________
sdhci-devel mailing list
[email protected]
http://list.drzeus.cx/mailman/listinfo/sdhci-devel