All of lore.kernel.org
 help / color / mirror / Atom feed
From: Komuro <komurojun-mbn@nifty.com>
To: Alan <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH]: pcmcia - spot slave decode flaws (for testing)
Date: Wed, 21 Mar 2007 10:56:45 +0900	[thread overview]
Message-ID: <20070321105645.f16ef374.komurojun-mbn@nifty.com> (raw)
In-Reply-To: <20070221153729.5eab83b6@lxorguk.ukuu.org.uk>


Hi,

"[PATCH]: pcmcia - spot slave decode flaws (for testing)" works properly.
(kernel 2.6.21-rc4-mm1)

pccard: PCMCIA card inserted into slot 1
pcmcia: registering new device pcmcia1.0
ata3: PATA max PIO0 cmd 0x00010100 ctl 0x0001010e bmdma 0x00000000 irq 3
scsi2 : pata_pcmcia
ata3.00: CFA: SunDisk SDP5-10, Rev 3.70, max PIO0
ata3.00: 20480 sectors, multi 0: LBA 
ata3.01: CFA: SunDisk SDP5-10, Rev 3.70, max PIO0
ata3.01: 20480 sectors, multi 0: LBA 
ata3.01: is a ghost device, ignoring.
ata3.01: disabled
ata3.00: configured for PIO0
scsi 2:0:0:0: Direct-Access     ATA      SunDisk SDP5-10  Rev  PQ: 0 ANSI: 5
sd 2:0:0:0: [sda] 20480 512-byte hardware sectors (10 MB)
sd 2:0:0:0: [sda] Write Protect is off
sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sd 2:0:0:0: [sda] 20480 512-byte hardware sectors (10 MB)
sd 2:0:0:0: [sda] Write Protect is off
sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1
sd 2:0:0:0: [sda] Attached SCSI removable disk
sd 2:0:0:0: Attached scsi generic sg0 type 0

Best Regards
Komuro


>If you've got a CF adapter or PCMCIA disc which shows up twice in libata
>pata_pcmcia can you try this patch on top of the updates posted. It tries
>to spot when the slave is a mirror of the master and to fix up problems
>that causes.
>
>Signed-off-by: Alan Cox <alan@redhat.com>
>
>diff -u --new-file --recursive --exclude-from /usr/src/exclude \
>linux.vanilla-2.6.20-mm2/drivers/ata/pata_pcmcia.c \
>                linux-2.6.20-mm2/drivers/ata/pata_pcmcia.c
>--- linux.vanilla-2.6.20-mm2/drivers/ata/pata_pcmcia.c	2007-02-20 13:37:58.000000000 \
>                +0000
>+++ linux-2.6.20-mm2/drivers/ata/pata_pcmcia.c	2007-02-20 14:28:13.000000000 +0000
>@@ -54,6 +54,39 @@
> 	dev_node_t	node;
> };
> 
>+/**
>+ *	pcmcia_set_mode	-	PCMCIA specific mode setup
>+ *	@ap: Port
>+ *	@r_failed_dev: Return pointer for failed device
>+ *
>+ *	Perform the tuning and setup of the devices and timings, which
>+ *	for PCMCIA is the same as any other controller. We wrap it however
>+ *	as we need to spot hardware with incorrect or missing master/slave
>+ *	decode, which alas is embarrassingly common in the PC world
>+ */
>+ 
>+static int pcmcia_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev)
>+{
>+	struct ata_device *master = &ap->device[0];
>+	struct ata_device *slave = &ap->device[1];
>+	
>+	if (!ata_dev_enabled(master) || !ata_dev_enabled(slave))
>+		return ata_do_set_mode(ap, r_failed_dev);
>+		
>+	if (memcmp(master->id + ATA_ID_FW_REV,  slave->id + ATA_ID_FW_REV,
>+			   ATA_ID_FW_REV_LEN + ATA_ID_PROD_LEN) == 0)
>+	{
>+		/* Suspicious match, but could be two cards from
>+		   the same vendor - check serial */
>+		if (memcmp(master->id + ATA_ID_SERNO, slave->id + ATA_ID_SERNO,
>+			   ATA_ID_SERNO_LEN) == 0 && master->id[ATA_ID_SERNO] >> 8) {
>+			ata_dev_printk(slave, KERN_WARNING, "is a ghost device, ignoring.\n");
>+			ata_dev_disable(slave);
>+		}	 
>+	}
>+	return ata_do_set_mode(ap, r_failed_dev);
>+}
>+
> static struct scsi_host_template pcmcia_sht = {
> 	.module			= THIS_MODULE,
> 	.name			= DRV_NAME,
>@@ -73,6 +106,7 @@
> };
> 
> static struct ata_port_operations pcmcia_port_ops = {
>+	.set_mode	= pcmcia_set_mode,
> 	.port_disable	= ata_port_disable,
> 	.tf_load	= ata_tf_load,
> 	.tf_read	= ata_tf_read,

  parent reply	other threads:[~2007-03-21  1:56 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-17 12:27 [BUG KERNEL 2.6.20-rc1] ftp: get or put stops during file-transfer Komuro
2006-12-17  4:02 ` Al Viro
2006-12-17 14:23   ` Komuro
2006-12-18  3:01     ` Adrian Bunk
2006-12-18 20:55       ` Komuro
2006-12-23 11:17       ` Komuro
2006-12-30  9:50       ` Komuro
2006-12-30  1:23         ` YOSHIFUJI Hideaki / 吉藤英明
2006-12-30 11:59           ` Komuro
2006-12-30 14:19             ` YOSHIFUJI Hideaki / 吉藤英明
2006-12-31  9:42               ` Komuro
2007-01-01 17:18               ` Komuro
2007-01-04 20:45               ` Komuro
2007-01-04 12:23                 ` Craig Schlenter
2007-01-09  1:24                   ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-09  5:11                     ` [PATCH] " Craig Schlenter
2007-01-09  5:22                       ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-09  8:11                         ` David Miller
2007-01-09 22:01                   ` Komuro
     [not found]   ` <20070211101537.e40fa309.komurojun-mbn@nifty.com>
2007-02-11  1:56     ` [BUG] PATA_PCMCIA does not work Alan
2007-02-11 10:32       ` Haavard Skinnemoen
2007-02-11  2:40     ` Komuro
2007-02-18  2:09       ` Komuro
2007-02-21 15:37         ` Alan
2007-02-21 15:24           ` Manuel Lauss
2007-02-24  2:06           ` Komuro
2007-02-24 23:14           ` Komuro
2007-02-25  1:45             ` Jeff Garzik
2007-02-25  2:43               ` Komuro
2007-03-21  1:56           ` Komuro [this message]
2007-03-17 13:00     ` [BUG] PATA_PCMCIA cmd port Komuro
2007-03-17 15:43       ` libata reports bogus addresses for everything (was PATA_PCMCIA cmd port) Alan Cox
2007-03-18  5:48         ` Tejun Heo
2007-03-17 16:10       ` [BUG] PATA_PCMCIA cmd port Jeff Garzik
2007-02-20 18:18 [PATCH]: pcmcia - spot slave decode flaws (for testing) Alan
2007-02-23 10:44 ` Jeff Garzik
2007-02-23 12:08   ` Alan
2007-02-24 21:23     ` Eric D. Mudama

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070321105645.f16ef374.komurojun-mbn@nifty.com \
    --to=komurojun-mbn@nifty.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.