On Sunday 13 July 2008 13:47:12 Ondrej Zary wrote:New patch below, this time with DMA forced on RAID volumes - as my firmware does not identify the RAID arrays as DMA capable :( diff -ur linux-2.6.26/drivers/ata/libata-core.c linux-2.6.26-pentium/drivers/ata/libata-core.c --- linux-2.6.26/drivers/ata/libata-core.c 2008-07-13 23:51:29.000000000 +0200 +++ linux-2.6.26-pentium/drivers/ata/libata-core.c 2008-07-16 20:50:33.000000000 +0200 @@ -2030,7 +2030,8 @@ * Note that ATA4 says lba is mandatory so the second check * shoud never trigger. */ - if (ata_id_major_version(id) < 4 || !ata_id_has_lba(id)) { + if ((ata_id_major_version(id) < 4 || !ata_id_has_lba(id)) && + id[3] != 0 && id[6] != 0) { err_mask = ata_dev_init_params(dev, id[3], id[6]); if (err_mask) { rc = -EIO; @@ -2195,18 +2196,23 @@ "not be fully accessable.\n"); } - dev->n_sectors = ata_id_n_sectors(id); + if (dev->horkage & ATA_HORKAGE_LBA48_FORCE) + dev->n_sectors = ata_id_u64(id, 100); + else + dev->n_sectors = ata_id_n_sectors(id); if (dev->id[59] & 0x100) dev->multi_count = dev->id[59] & 0xff; - if (ata_id_has_lba(id)) { + if (ata_id_has_lba(id) || + dev->horkage & ATA_HORKAGE_LBA48_FORCE) { const char *lba_desc; char ncq_desc[20]; lba_desc = "LBA"; dev->flags |= ATA_DFLAG_LBA; - if (ata_id_has_lba48(id)) { + if (ata_id_has_lba48(id) || + dev->horkage & ATA_HORKAGE_LBA48_FORCE) { dev->flags |= ATA_DFLAG_LBA48; lba_desc = "LBA48"; @@ -3946,6 +3952,9 @@ { "TSSTcorp CDDVDW SH-S202N", "SB00", ATA_HORKAGE_IVB, }, { "TSSTcorp CDDVDW SH-S202N", "SB01", ATA_HORKAGE_IVB, }, + /* Has LBA48 but advertises neither LBA nor LBA48 */ + { "Integrated Technology Express Inc", NULL, ATA_HORKAGE_LBA48_FORCE, }, + /* End Marker */ { } }; diff -ur linux-2.6.26/drivers/ata/pata_it821x.c linux-2.6.26-pentium/drivers/ata/pata_it821x.c --- linux-2.6.26/drivers/ata/pata_it821x.c 2008-07-13 23:51:29.000000000 +0200 +++ linux-2.6.26-pentium/drivers/ata/pata_it821x.c 2008-07-22 19:56:14.000000000 +0200 @@ -462,15 +462,19 @@ static int it821x_smart_set_mode(struct ata_link *link, struct ata_device **unused) { struct ata_device *dev; + unsigned char model_num[ATA_ID_PROD_LEN + 1]; ata_link_for_each_dev(dev, link) { if (ata_dev_enabled(dev)) { /* We don't really care */ dev->pio_mode = XFER_PIO_0; dev->dma_mode = XFER_MW_DMA_0; + ata_id_c_string(dev->id, model_num, ATA_ID_PROD, + sizeof(model_num)); /* We do need the right mode information for DMA or PIO and this comes from the current configuration flags */ - if (ata_id_has_dma(dev->id)) { + if (ata_id_has_dma(dev->id) || + strstr(model_num, "Integrated Technology Express")) { ata_dev_printk(dev, KERN_INFO, "configured for DMA\n"); dev->xfer_mode = XFER_MW_DMA_0; dev->xfer_shift = ATA_SHIFT_MWDMA; diff -ur linux-2.6.26/include/linux/libata.h linux-2.6.26-pentium/include/linux/libata.h --- linux-2.6.26/include/linux/libata.h 2008-07-13 23:51:29.000000000 +0200 +++ linux-2.6.26-pentium/include/linux/libata.h 2008-07-16 20:50:33.000000000 +0200 @@ -353,6 +353,7 @@ ATA_HORKAGE_IPM = (1 << 7), /* Link PM problems */ ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */ ATA_HORKAGE_STUCK_ERR = (1 << 9), /* stuck ERR on next PACKET */ + ATA_HORKAGE_LBA48_FORCE = (1 << 10), /* Has hidden LBA48 */ /* DMA mask for user DMA control: User visible values; DO NOT renumber */ -- Ondrej Zary --
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| David Chinner | Re: [RFD] BIO_RW_BARRIER - what it means for devices, filesystems, and dm/md. |
| Andrew Morton | -mm merge plans for 2.6.23 |
| Trent Piepho | Re: [PATCH] [POWERPC] Improve (in|out)_beXX() asm code |
git: | |
| David Miller | Re: iptables very slow after commit784544739a25c30637397ace5489eeb6e15d7d49 |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
