📄 1004.ide.patch
字号:
diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linux-2.6.15.ref/arch/mips/configs/tango2_defconfig linux-2.6.15/arch/mips/configs/tango2_defconfig--- linux-2.6.15.ref/arch/mips/configs/tango2_defconfig 2007-06-16 17:03:57.000000000 -0700+++ linux-2.6.15/arch/mips/configs/tango2_defconfig 2007-06-16 17:05:09.000000000 -0700@@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.15-# Fri Aug 11 09:54:22 2006+# Tue Mar 6 10:24:42 2007 # CONFIG_MIPS=y @@ -76,6 +76,7 @@ # # #+CONFIG_TANGOX_HZ_VALUE=1000 CONFIG_TANGOX_SYSTEMRAM_ACTUALSIZE=64 # CONFIG_TANGOX_IGNORE_CMDLINE is not set # CONFIG_TANGOX_PROM_CONSOLE is not set@@ -393,9 +394,18 @@ # CONFIG_IDE_GENERIC=y # CONFIG_BLK_DEV_IDEPCI is not set+CONFIG_BLK_DEV_BMIDE_TANGOX=y+CONFIG_BLK_DEV_BMIDE_TANGOX_DMA=y+CONFIG_BLK_DEV_PBIDE_TANGOX=y+CONFIG_BLK_DEV_PBIDE_TANGOX_DMA=y+# CONFIG_SD_CDROM_MAXIMUM_SECTOR_RESTRICTION is not set+CONFIG_SD_CDROM_WAIT=y+CONFIG_SD_CDROM_WAIT_TIME=5+CONFIG_SD_CDROM_KEEP_DMA=y+CONFIG_SD_CDROM_DMAPACKET=y # CONFIG_IDE_ARM is not set-# CONFIG_BLK_DEV_IDEDMA is not set-# CONFIG_IDEDMA_AUTO is not set+CONFIG_BLK_DEV_IDEDMA=y+CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set #diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linux-2.6.15.ref/arch/mips/configs/tango3_defconfig linux-2.6.15/arch/mips/configs/tango3_defconfig--- linux-2.6.15.ref/arch/mips/configs/tango3_defconfig 2007-06-16 17:03:57.000000000 -0700+++ linux-2.6.15/arch/mips/configs/tango3_defconfig 2007-06-16 17:05:09.000000000 -0700@@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.15-# Wed Aug 16 15:00:18 2006+# Mon Oct 23 14:23:16 2006 # CONFIG_MIPS=y @@ -72,6 +72,7 @@ # # # CONFIG_TANGO3_DISABLE_HWFPU is not set+CONFIG_TANGOX_HZ_VALUE=1000 CONFIG_TANGOX_SYSTEMRAM_ACTUALSIZE=64 # CONFIG_TANGOX_IGNORE_CMDLINE is not set # CONFIG_TANGOX_PROM_CONSOLE is not set@@ -389,9 +390,17 @@ # CONFIG_IDE_GENERIC=y # CONFIG_BLK_DEV_IDEPCI is not set+CONFIG_BLK_DEV_BMIDE_TANGOX=y+CONFIG_BLK_DEV_BMIDE_TANGOX_DMA=y+CONFIG_BLK_DEV_PBIDE_TANGOX=y+CONFIG_BLK_DEV_PBIDE_TANGOX_DMA=y+CONFIG_SD_CDROM_WAIT=y+CONFIG_SD_CDROM_WAIT_TIME=5+CONFIG_SD_CDROM_KEEP_DMA=y+CONFIG_SD_CDROM_DMAPACKET=y # CONFIG_IDE_ARM is not set-# CONFIG_BLK_DEV_IDEDMA is not set-# CONFIG_IDEDMA_AUTO is not set+CONFIG_BLK_DEV_IDEDMA=y+CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set #diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linux-2.6.15.ref/arch/mips/mm/cache.c linux-2.6.15/arch/mips/mm/cache.c--- linux-2.6.15.ref/arch/mips/mm/cache.c 2006-01-25 20:51:10.000000000 -0800+++ linux-2.6.15/arch/mips/mm/cache.c 2007-06-16 17:05:09.000000000 -0700@@ -66,6 +66,14 @@ return 0; } +/* write-back and invalidate dcache */+void flush_dcache_range(void __user *userbuf, unsigned int len)+{+ unsigned long start_addr, addr;+ for (start_addr = addr = (unsigned long)userbuf; addr < (start_addr + len); addr += PAGE_SIZE)+ flush_data_cache_page(addr);+}+ void __flush_dcache_page(struct page *page) { struct address_space *mapping = page_mapping(page);diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linux-2.6.15.ref/block/ll_rw_blk.c linux-2.6.15/block/ll_rw_blk.c--- linux-2.6.15.ref/block/ll_rw_blk.c 2006-01-25 20:51:15.000000000 -0800+++ linux-2.6.15/block/ll_rw_blk.c 2007-06-16 17:05:53.000000000 -0700@@ -2143,23 +2143,42 @@ unsigned long uaddr; struct bio *bio; int reading;+ int dma_alignment = 0; if (len > (q->max_sectors << 9)) return -EINVAL; if (!len || !ubuf) return -EINVAL; - reading = rq_data_dir(rq) == READ;+ reading = (rq_data_dir(rq) == READ);++ if (reading) {+ if (!access_ok(VERIFY_WRITE, (void __user *)ubuf, len)) + return -EFAULT;+ } else if (!access_ok(VERIFY_READ, (void __user *)ubuf, len))+ return -EFAULT; /* * if alignment requirement is satisfied, map in user pages for * direct dma. else, set up kernel bounce buffers */- uaddr = (unsigned long) ubuf;- if (!(uaddr & queue_dma_alignment(q)) && !(len & queue_dma_alignment(q)))+ uaddr = (unsigned long)ubuf;+ dma_alignment = queue_dma_alignment(q);++ if (((uaddr & dma_alignment) == 0) && ((len & dma_alignment) == 0)) {+#ifdef CONFIG_DMA_NONCOHERENT+ if (reading) + dma_cache_inv(uaddr, len);+ else+ dma_cache_wback_inv(uaddr, len);+#endif bio = bio_map_user(q, NULL, uaddr, len, reading);- else- bio = bio_copy_user(q, uaddr, len, reading);+ if (IS_ERR(bio)) {+ /* the map operation failed, use copy instead */+ bio = bio_copy_user(q, uaddr, len, reading);+ } + } else + bio = bio_copy_user(q, uaddr, len, reading); if (!IS_ERR(bio)) { rq->bio = rq->biotail = bio;@@ -3203,7 +3222,6 @@ rq->hard_cur_sectors = rq->current_nr_sectors; rq->hard_nr_sectors = rq->nr_sectors = bio_sectors(bio); rq->buffer = bio_data(bio);- rq->bio = rq->biotail = bio; } diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linux-2.6.15.ref/drivers/cdrom/cdrom.c linux-2.6.15/drivers/cdrom/cdrom.c--- linux-2.6.15.ref/drivers/cdrom/cdrom.c 2006-01-25 20:51:22.000000000 -0800+++ linux-2.6.15/drivers/cdrom/cdrom.c 2007-06-16 17:05:09.000000000 -0700@@ -1103,6 +1103,8 @@ } else { cdinfo(CD_OPEN, "wrong media type, but CDO_CHECK_TYPE not set.\n");+ ret=-EMEDIUMTYPE;+ goto clean_up_and_return; } } @@ -1446,10 +1448,12 @@ tracks->xa=0; tracks->error=0; cdinfo(CD_COUNT_TRACKS, "entering cdrom_count_tracks\n"); +#if 0 if (!CDROM_CAN(CDC_PLAY_AUDIO)) { tracks->error=CDS_NO_INFO; return; } +#endif /* Grab the TOC header so we can see how many tracks there are */ if ((ret = cdi->ops->audio_ioctl(cdi, CDROMREADTOCHDR, &header))) { if (ret == -ENOMEDIUM)diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linux-2.6.15.ref/drivers/ide/ide.c linux-2.6.15/drivers/ide/ide.c--- linux-2.6.15.ref/drivers/ide/ide.c 2006-01-25 20:51:25.000000000 -0800+++ linux-2.6.15/drivers/ide/ide.c 2007-06-16 17:05:09.000000000 -0700@@ -805,6 +805,10 @@ hwif->chipset = hw->chipset; hwif->gendev.parent = hw->dev; +#if defined(CONFIG_BLK_DEV_BMIDE_TANGOX_MODULE) || defined(CONFIG_BLK_DEV_PBIDE_TANGOX_MODULE)+ initializing = 1;+#endif+ if (!initializing) { probe_hwif_init_with_fixup(hwif, fixup); create_proc_ide_interfaces();@@ -1854,6 +1858,18 @@ #ifdef CONFIG_H8300 h8300_ide_init(); #endif+#ifdef CONFIG_BLK_DEV_BMIDE_TANGOX+ {+ extern int __init tangox_bmide_init(void);+ tangox_bmide_init();+ }+#endif+#ifdef CONFIG_BLK_DEV_PBIDE_TANGOX+ {+ extern int __init tangox_pbide_init(void);+ tangox_pbide_init();+ }+#endif } void ide_register_subdriver(ide_drive_t *drive, ide_driver_t *driver)diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linux-2.6.15.ref/drivers/ide/ide-cd.c linux-2.6.15/drivers/ide/ide-cd.c--- linux-2.6.15.ref/drivers/ide/ide-cd.c 2006-01-25 20:51:25.000000000 -0800+++ linux-2.6.15/drivers/ide/ide-cd.c 2007-06-16 17:05:09.000000000 -0700@@ -324,6 +324,11 @@ #include "ide-cd.h" +#ifdef CONFIG_SD_CDROM_WAIT+#define CONFIG_SD_CDROM_WAIT_TICKS (CONFIG_SD_CDROM_WAIT_TIME * HZ)+static unsigned long cdrom_wait = 0;+#endif+ static DECLARE_MUTEX(idecd_ref_sem); #define to_ide_cd(obj) container_of(obj, struct cdrom_info, kref) @@ -487,21 +492,15 @@ if (failed_command != NULL) { - int lo=0, mid, hi= ARY_LEN (packet_command_texts);+ int lo=0, hi= ARY_LEN (packet_command_texts); s = NULL; - while (hi > lo) {- mid = (lo + hi) / 2;- if (packet_command_texts[mid].packet_command ==+ for (lo = 0; lo < hi; lo++) {+ if (packet_command_texts[lo].packet_command == failed_command->cmd[0]) {- s = packet_command_texts[mid].text;+ s = packet_command_texts[lo].text; break; }- if (packet_command_texts[mid].packet_command >- failed_command->cmd[0])- hi = mid;- else- lo = mid+1; } printk (KERN_ERR " The failed \"%s\" packet command was: \n \"", s);@@ -630,6 +629,11 @@ nsectors = 1; ide_end_request(drive, uptodate, nsectors);++#ifdef CONFIG_SD_CDROM_WAIT+ if (uptodate)+ cdrom_wait = 0;+#endif } /* Returns 0 if the request should be continued.@@ -756,12 +760,31 @@ too many times. */ if (++rq->errors > ERROR_MAX) do_end_request = 1;- } else if (sense_key == ILLEGAL_REQUEST ||- sense_key == DATA_PROTECT) {+ } else if (sense_key == DATA_PROTECT) {+ /* No point in retrying after an illegal+ request or data protect error.*/+ ide_dump_status (drive, "command error", stat);+ do_end_request = 1;+ } else if (sense_key == ILLEGAL_REQUEST) {+#ifdef CONFIG_SD_CDROM_WAIT+ if (cdrom_wait == 0)+ cdrom_wait = jiffies;+ if (time_after(cdrom_wait + CONFIG_SD_CDROM_WAIT_TICKS, jiffies)) {+ printk("%s: retrying operation.\n", drive->name);+ do_end_request = 0;+ } else {+ /* No point in retrying after an illegal+ request or data protect error.*/+ cdrom_wait = 0;+ ide_dump_status (drive, "command error", stat);+ do_end_request = 1;+ }+#else /* No point in retrying after an illegal request or data protect error.*/ ide_dump_status (drive, "command error", stat); do_end_request = 1;+#endif } else if (sense_key == MEDIUM_ERROR) { /* No point in re-trying a zillion times on a bad * sector... If we got here the error is not correctable */@@ -840,6 +863,16 @@ struct cdrom_info *info = drive->driver_data; ide_hwif_t *hwif = drive->hwif; +#ifdef CONFIG_SD_CDROM_DMAPACKET+ struct request *rq = HWGROUP(drive)->rq;+ if ((rq->cmd[0] != GPCMD_READ_10) &&+ (rq->cmd[0] != GPCMD_READ_CD) &&+ (rq->cmd[0] != GPCMD_WRITE_10) &&+ (rq->cmd[0] != GPCMD_VERIFY_10) &&+ (rq->cmd[0] != GPCMD_WRITE_AND_VERIFY_10))+ info->dma = 0;+#endif+ /* Wait for the controller to be idle. */ if (ide_wait_stat(&startstop, drive, 0, BUSY_STAT, WAIT_READY)) return startstop;@@ -1332,8 +1365,6 @@ if (cdrom_read_from_buffer(drive)) return ide_stopped; - blk_attempt_remerge(drive->queue, rq);- /* Clear the local sector buffer. */ info->nsectors_buffered = 0; @@ -1874,14 +1905,6 @@ return ide_stopped; } - /*- * for dvd-ram and such media, it's a really big deal to get- * big writes all the time. so scour the queue and attempt to- * remerge requests, often the plugging will not have had time- * to do this properly- */- blk_attempt_remerge(drive->queue, rq);- info->nsectors_buffered = 0; /* use dma, if possible. we don't need to check more, since wediff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linux-2.6.15.ref/drivers/ide/ide-iops.c linux-2.6.15/drivers/ide/ide-iops.c--- linux-2.6.15.ref/drivers/ide/ide-iops.c 2006-01-25 20:51:25.000000000 -0800+++ linux-2.6.15/drivers/ide/ide-iops.c 2007-06-16 17:05:09.000000000 -0700@@ -1068,7 +1068,14 @@ if (drive->current_speed >= XFER_SW_DMA_0) (void) HWIF(drive)->ide_dma_on(drive); } else- (void)__ide_dma_off(drive);+#ifdef CONFIG_SD_CDROM_KEEP_DMA+ /* Turn off DMA only for HDD */+ if (drive->media == ide_disk) {+#endif+ (void)__ide_dma_off(drive);+#ifdef CONFIG_SD_CDROM_KEEP_DMA+ }+#endif #endif } diff -Naur --exclude=CVS --exclude='*.o' --exclude='*.a' --exclude='*.so' --exclude='*.elf' --exclude=System.map --exclude=Makefile.d --exclude='*log' --exclude='*log2' --exclude='*~' --exclude='.*~' --exclude='.#*' --exclude='*.bak' --exclude='*.orig' --exclude='*.rej' --exclude='core.[0-9]*' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=.depend --exclude='.*.o.flags' --exclude='*.gz' --exclude=vmlinux --exclude=vmlinux.bin --exclude=yamon-02.06-SIGMADESIGNS-01_el.bin linux-2.6.15.ref/drivers/ide/ide-probe.c linux-2.6.15/drivers/ide/ide-probe.c--- linux-2.6.15.ref/drivers/ide/ide-probe.c 2006-01-25 20:51:25.000000000 -0800+++ linux-2.6.15/drivers/ide/ide-probe.c 2007-06-16 17:05:09.000000000 -0700@@ -966,7 +966,11 @@ { request_queue_t *q; ide_hwif_t *hwif = HWIF(drive);+#ifndef MAX_KMALLOC_ORDER int max_sectors = 256;+#else+ int max_sectors = (PAGE_SIZE<<MAX_KMALLOC_ORDER)>>9;+#endif int max_sg_entries = PRD_ENTRIES; /*@@ -982,7 +986,15 @@ return 1; q->queuedata = drive;++#if defined(CONFIG_BLK_DEV_BMIDE_TANGOX) || defined(CONFIG_BLK_DEV_PBIDE_TANGOX)+ /* we can handle physical address crossing any boundaries,+ * this will make linux really merge all physically contiguous+ * bio */+ blk_queue_segment_boundary(q, 0xffffffff);+#else blk_queue_segment_boundary(q, 0xffff);+#endif if (!hwif->rqsize) { if (hwif->no_lba48 || hwif->no_lba48_dma)@@ -990,8 +1002,19 @@ else hwif->rqsize = 65536; }- if (hwif->rqsize < max_sectors)+ if ((hwif->rqsize < max_sectors) && (drive->media == ide_disk)) max_sectors = hwif->rqsize;++#ifdef CONFIG_SD_CDROM_MAXIMUM_SECTOR_RESTRICTION+ /*+ * limits the max_sectors for some CDROM drives+ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -