/[linux-patches]/genpatches-2.6/tags/2.6.12-12/2305_sata-bridge-lockup.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.12-12/2305_sata-bridge-lockup.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 137 - (show annotations) (download)
Tue Aug 9 21:23:12 2005 UTC (12 years, 11 months ago) by dsd
File size: 2919 byte(s)
2.6.12-12 release
1 Author: Brad Campbell <brad@wasp.net.au>
2 Date: Thu, 12 May 2005 19:07:47 +0000 (-0400)
3 Source: http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/jgarzik/libata-dev.git;a=commitdiff;h=6f2f38128170814e151cfedf79532e19cd179567
4
5 [PATCH] libata basic detection and errata for PATA->SATA bridges
6
7 This patch works around an issue with WD drives (and possibly others)
8 over SiL PATA->SATA Bridges on SATA controllers locking up with
9 transfers > 200 sectors.
10
11 Signed-off-by: Brad Campbell <brad@wasp.net.au>
12
13 --- a/drivers/scsi/libata-core.c
14 +++ b/drivers/scsi/libata-core.c
15 @@ -1186,6 +1186,37 @@ err_out:
16 DPRINTK("EXIT, err\n");
17 }
18
19 +
20 +static inline u8 ata_dev_knobble(struct ata_port *ap)
21 +{
22 + return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id)));
23 +}
24 +
25 +/**
26 + * ata_dev_config - Run device specific handlers and check for
27 + * SATA->PATA bridges
28 + * @ap: Bus
29 + * @i: Device
30 + *
31 + * LOCKING:
32 + */
33 +
34 +void ata_dev_config(struct ata_port *ap, unsigned int i)
35 +{
36 + /* limit bridge transfers to udma5, 200 sectors */
37 + if (ata_dev_knobble(ap)) {
38 + printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
39 + ap->id, ap->device->devno);
40 + ap->udma_mask &= ATA_UDMA5;
41 + ap->host->max_sectors = ATA_MAX_SECTORS;
42 + ap->host->hostt->max_sectors = ATA_MAX_SECTORS;
43 + ap->device->flags |= ATA_DFLAG_LOCK_SECTORS;
44 + }
45 +
46 + if (ap->ops->dev_config)
47 + ap->ops->dev_config(ap, &ap->device[i]);
48 +}
49 +
50 /**
51 * ata_bus_probe - Reset and probe ATA bus
52 * @ap: Bus to probe
53 @@ -1208,8 +1239,7 @@ static int ata_bus_probe(struct ata_port
54 ata_dev_identify(ap, i);
55 if (ata_dev_present(&ap->device[i])) {
56 found = 1;
57 - if (ap->ops->dev_config)
58 - ap->ops->dev_config(ap, &ap->device[i]);
59 + ata_dev_config(ap,i);
60 }
61 }
62
63 @@ -4014,6 +4044,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_release);
64 EXPORT_SYMBOL_GPL(ata_host_intr);
65 EXPORT_SYMBOL_GPL(ata_dev_classify);
66 EXPORT_SYMBOL_GPL(ata_dev_id_string);
67 +EXPORT_SYMBOL_GPL(ata_dev_config);
68 EXPORT_SYMBOL_GPL(ata_scsi_simulate);
69
70 #ifdef CONFIG_PCI
71 --- a/include/linux/ata.h
72 +++ b/include/linux/ata.h
73 @@ -224,6 +224,7 @@ struct ata_taskfile {
74 };
75
76 #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0)
77 +#define ata_id_is_sata(id) ((id)[93] == 0)
78 #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6))
79 #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5))
80 #define ata_id_has_flush(id) ((id)[83] & (1 << 12))
81 --- a/include/linux/libata.h
82 +++ b/include/linux/libata.h
83 @@ -420,6 +420,7 @@ extern void ata_sg_init(struct ata_queue
84 extern unsigned int ata_dev_classify(struct ata_taskfile *tf);
85 extern void ata_dev_id_string(u16 *id, unsigned char *s,
86 unsigned int ofs, unsigned int len);
87 +extern void ata_dev_config(struct ata_port *ap, unsigned int i);
88 extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
89 extern void ata_bmdma_start (struct ata_queued_cmd *qc);
90 extern void ata_bmdma_stop(struct ata_port *ap);

  ViewVC Help
Powered by ViewVC 1.1.20