Re: [Bug 11267] SD cards stopped working on my machine



On Thu, 7 Aug 2008, Romano Giannetti wrote:
I just posted a regression bug on bugzilla:

http://bugzilla.kernel.org/show_bug.cgi?id=11267

the new kernel stopped to notice the fact that I introduce an SD card into the
slot of the machine. It used to work perfectly in 2.6.26 (came back and
tested, so it's not hardware).

In 2.6.26 I had on the dmesg:

[ 131.145237] mmc0: new high speed SD card at address b368
[ 131.145295] PM: Adding info for mmc:mmc0:b368
[ 131.176370] mmcblk0: mmc0:b368 SD 2009600KiB (ro)
[ 131.176370] PM: Adding info for No Bus:mmcblk0
[ 131.176370] mmcblk0: p1
[ 131.176434] PM: Adding info for No Bus:mmcblk0p1
[ 131.176434] PM: Adding info for No Bus:179:0

In 2.6.27-rc2 nothing happens. I have not a lot of time in my hands, so if
it's possible at all I'd like to avoid a bisect (It's more than one hour per
compile here...)

Please try yesterday's patch from the scsi-rc-fixes tree,
commit d211f052fa58a053639bc51501cb64421157d362
which fixed SD cards over USB storage for me:

[SCSI] sd: fix USB devices incorrectly reporting DIF support

Some USB devices set the protect bit in the INQUIRY data which
currently causes the DIF code in sd to assume (incorrectly) that they
support READ_CAPACITY(16). Fix this (only for the time being) by
making sure we only believe the protect bit in the inquiry data if the
device claims conformance to SCSI-3 or above.

Acked-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
Signed-off-by: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>
---

diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 291d56a..80b2e93 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -6,6 +6,7 @@
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/blkdev.h>
+#include <scsi/scsi.h>
#include <asm/atomic.h>

struct request_queue;
@@ -426,7 +427,7 @@ static inline int scsi_device_enclosure(struct scsi_device *sdev)

static inline int scsi_device_protection(struct scsi_device *sdev)
{
- return sdev->inquiry[5] & (1<<0);
+ return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0);
}

#define MODULE_ALIAS_SCSI_DEVICE(type) \
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Rogue Diallers
    ... >>> have one plugged into a socket that could cost you money. ... If you don't think it is a fact that civilised societies try and protect ... I have an card issued by my bank which allows me to withdraw cash from their ...
    (uk.legal)
  • Re: British house arrest for those not wanting ID card.
    ... gooders who continue to protect those with something to hide) ... suggest a "National Drop You Card In The Street Day". ... strentgh of a healthy democracy relies on the people holding power and ...
    (uk.legal)
  • Re: [PATCH 2.5] fixes for airo.c
    ... On Mon July 21 2003 21:44, Javier Achirica wrote: ... >> but we need to protect from interrupts while accessing the card and waiting for ... You can still read the received packets from the card (as ... queue can wake right after it is stopped in the down_trylock section. ...
    (Linux-Kernel)
  • Re: FBWF Question: What files are protected
    ... Emdedded on an SD Card: Sometimes file data is lost and sometimes the ... image doesn't boot any more. ... to protect files on the SC card:FBWF. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Macys requires govt ID to use credit cards - new policy
    ... Circuit City still won't take a CC without ID. ... from corporate and a $75 gift card. ... It does nothing to protect ME. ... any reduction in the rate of fraud reduces the prices you get to pay. ...
    (misc.consumers)