From 58ffe402d84e402a99d587a7f91001b8c3b72142 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 10 Jan 2008 16:43:26 +1100 Subject: [PATCH] --- yaml --- r: 75387 b: refs/heads/master c: aea6ad0ce5e215ce99fe9e3edd9268f696862d8f h: refs/heads/master i: 75385: ed1b52e6643f025d747027dec22ef036f0bd20a0 75383: 0e9c5a37f7dcac396d14f8fac64219511ff43e3a v: v3 --- [refs] | 2 +- trunk/Documentation/kernel-parameters.txt | 8 -- trunk/arch/mips/kernel/setup.c | 7 +- trunk/arch/mips/lasat/image/Makefile | 6 +- trunk/arch/mips/mips-boards/generic/memory.c | 2 + trunk/arch/mips/mips-boards/generic/reset.c | 10 +- trunk/arch/mips/mm/dma-default.c | 2 +- trunk/arch/mips/philips/pnx8550/common/time.c | 109 ++++++------------ trunk/block/blktrace.c | 81 ++++++++++++- trunk/drivers/ata/libata-eh.c | 24 ++-- trunk/drivers/ata/libata-pmp.c | 12 +- trunk/drivers/ata/libata-scsi.c | 3 +- trunk/drivers/ata/libata-sff.c | 7 +- trunk/drivers/ata/pata_ixp4xx_cf.c | 3 +- trunk/drivers/ata/pata_pdc202xx_old.c | 15 +-- trunk/drivers/ata/sata_qstor.c | 2 +- trunk/drivers/ata/sata_sil24.c | 37 ++---- trunk/drivers/block/loop.c | 2 +- trunk/drivers/crypto/padlock-aes.c | 4 +- trunk/drivers/ide/ide-acpi.c | 38 +----- trunk/drivers/ide/ide-iops.c | 6 +- trunk/drivers/ide/pci/trm290.c | 29 ++--- trunk/drivers/mtd/chips/cfi_cmdset_0001.c | 7 +- trunk/drivers/scsi/qla1280.c | 2 +- trunk/drivers/video/ps3fb.c | 24 ++-- trunk/fs/nfs/nfs4_fs.h | 1 - trunk/fs/nfs/nfs4state.c | 5 +- trunk/fs/xfs/linux-2.6/xfs_file.c | 16 ++- trunk/include/asm-sh/cacheflush.h | 6 - trunk/include/asm-sh/uaccess.h | 42 ++++--- trunk/include/linux/scatterlist.h | 4 +- 31 files changed, 232 insertions(+), 284 deletions(-) diff --git a/[refs] b/[refs] index b376cf521e6b..ed6657ffec71 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5d0381e21ebf55df88e1cdca2810f4a49fe0ee62 +refs/heads/master: aea6ad0ce5e215ce99fe9e3edd9268f696862d8f diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt index c4178778e7fd..e5b447a0acda 100644 --- a/trunk/Documentation/kernel-parameters.txt +++ b/trunk/Documentation/kernel-parameters.txt @@ -883,14 +883,6 @@ and is between 256 and 4096 characters. It is defined in the file lapic_timer_c2_ok [X86-32,x86-64,APIC] trust the local apic timer in C2 power state. - libata.dma= [LIBATA] DMA control - libata.dma=0 Disable all PATA and SATA DMA - libata.dma=1 PATA and SATA Disk DMA only - libata.dma=2 ATAPI (CDROM) DMA only - libata.dma=4 Compact Flash DMA only - Combinations also work, so libata.dma=3 enables DMA - for disks and CDROMs, but not CFs. - libata.noacpi [LIBATA] Disables use of ACPI in libata suspend/resume when set. Format: diff --git a/trunk/arch/mips/kernel/setup.c b/trunk/arch/mips/kernel/setup.c index f8a535afce39..7f6ddcb5d485 100644 --- a/trunk/arch/mips/kernel/setup.c +++ b/trunk/arch/mips/kernel/setup.c @@ -269,7 +269,7 @@ static void __init bootmem_init(void) static void __init bootmem_init(void) { - unsigned long reserved_end; + unsigned long init_begin, reserved_end; unsigned long mapstart = ~0UL; unsigned long bootmap_size; int i; @@ -344,6 +344,7 @@ static void __init bootmem_init(void) min_low_pfn, max_low_pfn); + init_begin = PFN_UP(__pa_symbol(&__init_begin)); for (i = 0; i < boot_mem_map.nr_map; i++) { unsigned long start, end; @@ -351,8 +352,8 @@ static void __init bootmem_init(void) end = PFN_DOWN(boot_mem_map.map[i].addr + boot_mem_map.map[i].size); - if (start <= min_low_pfn) - start = min_low_pfn; + if (start <= init_begin) + start = init_begin; if (start >= end) continue; diff --git a/trunk/arch/mips/lasat/image/Makefile b/trunk/arch/mips/lasat/image/Makefile index 460626b6d62f..5332449ec040 100644 --- a/trunk/arch/mips/lasat/image/Makefile +++ b/trunk/arch/mips/lasat/image/Makefile @@ -12,11 +12,11 @@ endif MKLASATIMG = mklasatimg MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200 -KERNEL_IMAGE = vmlinux +KERNEL_IMAGE = $(TOPDIR)/vmlinux KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ ) KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ ) -LDSCRIPT= -L$(srctree)/$(src) -Tromscript.normal +LDSCRIPT= -L$(obj) -Tromscript.normal HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ -D_kernel_entry=0x$(KERNEL_ENTRY) \ @@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ -D TIMESTAMP=$(shell date +%s) $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE) - $(CC) -fno-pic $(HEAD_DEFINES) $(LINUXINCLUDE) -c -o $@ $< + $(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $< OBJECTS = head.o kImage.o diff --git a/trunk/arch/mips/mips-boards/generic/memory.c b/trunk/arch/mips/mips-boards/generic/memory.c index dc272c188233..2c5c27c8e86d 100644 --- a/trunk/arch/mips/mips-boards/generic/memory.c +++ b/trunk/arch/mips/mips-boards/generic/memory.c @@ -169,6 +169,7 @@ void __init prom_meminit(void) void __init prom_free_prom_memory(void) { +#if 0 /* for now ... */ unsigned long addr; int i; @@ -180,4 +181,5 @@ void __init prom_free_prom_memory(void) free_init_pages("prom memory", addr, addr + boot_mem_map.map[i].size); } +#endif } diff --git a/trunk/arch/mips/mips-boards/generic/reset.c b/trunk/arch/mips/mips-boards/generic/reset.c index 583d468d98a9..7a1bb51f81ee 100644 --- a/trunk/arch/mips/mips-boards/generic/reset.c +++ b/trunk/arch/mips/mips-boards/generic/reset.c @@ -39,18 +39,16 @@ static void atlas_machine_power_off(void); static void mips_machine_restart(char *command) { - unsigned int __iomem *softres_reg = - ioremap(SOFTRES_REG, sizeof(unsigned int)); + unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, sizeof(unsigned int)); - __raw_writel(GORESET, softres_reg); + writew(GORESET, softres_reg); } static void mips_machine_halt(void) { - unsigned int __iomem *softres_reg = - ioremap(SOFTRES_REG, sizeof(unsigned int)); + unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, sizeof(unsigned int)); - __raw_writel(GORESET, softres_reg); + writew(GORESET, softres_reg); } #if defined(CONFIG_MIPS_ATLAS) diff --git a/trunk/arch/mips/mm/dma-default.c b/trunk/arch/mips/mm/dma-default.c index 810535dd091b..ae76795685cc 100644 --- a/trunk/arch/mips/mm/dma-default.c +++ b/trunk/arch/mips/mm/dma-default.c @@ -45,7 +45,7 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp) /* ignore region specifiers */ gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); -#ifdef CONFIG_ZONE_DMA +#ifdef CONFIG_ZONE_DMA32 if (dev == NULL) gfp |= __GFP_DMA; else if (dev->coherent_dma_mask < DMA_BIT_MASK(24)) diff --git a/trunk/arch/mips/philips/pnx8550/common/time.c b/trunk/arch/mips/philips/pnx8550/common/time.c index 6d494e0de3d9..e818fd0f1584 100644 --- a/trunk/arch/mips/philips/pnx8550/common/time.c +++ b/trunk/arch/mips/philips/pnx8550/common/time.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -40,60 +41,11 @@ static cycle_t hpt_read(void) return read_c0_count2(); } -static struct clocksource pnx_clocksource = { - .name = "pnx8xxx", - .rating = 200, - .read = hpt_read, - .flags = CLOCK_SOURCE_IS_CONTINUOUS, -}; - static void timer_ack(void) { write_c0_compare(cpj); } -static irqreturn_t pnx8xxx_timer_interrupt(int irq, void *dev_id) -{ - struct clock_event_device *c = dev_id; - - /* clear MATCH, signal the event */ - c->event_handler(c); - - return IRQ_HANDLED; -} - -static struct irqaction pnx8xxx_timer_irq = { - .handler = pnx8xxx_timer_interrupt, - .flags = IRQF_DISABLED | IRQF_PERCPU, - .name = "pnx8xxx_timer", -}; - -static irqreturn_t monotonic_interrupt(int irq, void *dev_id) -{ - /* Timer 2 clear interrupt */ - write_c0_compare2(-1); - return IRQ_HANDLED; -} - -static struct irqaction monotonic_irqaction = { - .handler = monotonic_interrupt, - .flags = IRQF_DISABLED, - .name = "Monotonic timer", -}; - -static int pnx8xxx_set_next_event(unsigned long delta, - struct clock_event_device *evt) -{ - write_c0_compare(delta); - return 0; -} - -static struct clock_event_device pnx8xxx_clockevent = { - .name = "pnx8xxx_clockevent", - .features = CLOCK_EVT_FEAT_ONESHOT, - .set_next_event = pnx8xxx_set_next_event, -}; - /* * plat_time_init() - it does the following things: * @@ -106,34 +58,11 @@ static struct clock_event_device pnx8xxx_clockevent = { __init void plat_time_init(void) { - unsigned int configPR; unsigned int n; unsigned int m; unsigned int p; unsigned int pow2p; - clockevents_register_device(&pnx8xxx_clockevent); - clocksource_register(&pnx_clocksource); - - setup_irq(PNX8550_INT_TIMER1, &pnx8xxx_timer_irq); - setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction); - - /* Timer 1 start */ - configPR = read_c0_config7(); - configPR &= ~0x00000008; - write_c0_config7(configPR); - - /* Timer 2 start */ - configPR = read_c0_config7(); - configPR &= ~0x00000010; - write_c0_config7(configPR); - - /* Timer 3 stop */ - configPR = read_c0_config7(); - configPR |= 0x00000020; - write_c0_config7(configPR); - - /* PLL0 sets MIPS clock (PLL1 <=> TM1, PLL6 <=> TM2, PLL5 <=> mem) */ /* (but only if CLK_MIPS_CTL select value [bits 3:1] is 1: FIXME) */ @@ -158,6 +87,42 @@ __init void plat_time_init(void) write_c0_count2(0); write_c0_compare2(0xffffffff); + clocksource_mips.read = hpt_read; + mips_timer_ack = timer_ack; +} + +static irqreturn_t monotonic_interrupt(int irq, void *dev_id) +{ + /* Timer 2 clear interrupt */ + write_c0_compare2(-1); + return IRQ_HANDLED; } +static struct irqaction monotonic_irqaction = { + .handler = monotonic_interrupt, + .flags = IRQF_DISABLED, + .name = "Monotonic timer", +}; +void __init plat_timer_setup(struct irqaction *irq) +{ + int configPR; + + setup_irq(PNX8550_INT_TIMER1, irq); + setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction); + + /* Timer 1 start */ + configPR = read_c0_config7(); + configPR &= ~0x00000008; + write_c0_config7(configPR); + + /* Timer 2 start */ + configPR = read_c0_config7(); + configPR &= ~0x00000010; + write_c0_config7(configPR); + + /* Timer 3 stop */ + configPR = read_c0_config7(); + configPR |= 0x00000020; + write_c0_config7(configPR); +} diff --git a/trunk/block/blktrace.c b/trunk/block/blktrace.c index 9b4da4ae3c7d..498a0a54a6aa 100644 --- a/trunk/block/blktrace.c +++ b/trunk/block/blktrace.c @@ -25,6 +25,7 @@ #include #include +static DEFINE_PER_CPU(unsigned long long, blk_trace_cpu_offset) = { 0, }; static unsigned int blktrace_seq __read_mostly = 1; /* @@ -40,7 +41,7 @@ static void trace_note(struct blk_trace *bt, pid_t pid, int action, const int cpu = smp_processor_id(); t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION; - t->time = ktime_to_ns(ktime_get()); + t->time = cpu_clock(cpu) - per_cpu(blk_trace_cpu_offset, cpu); t->device = bt->dev; t->action = action; t->pid = pid; @@ -158,7 +159,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes, t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION; t->sequence = ++(*sequence); - t->time = ktime_to_ns(ktime_get()); + t->time = cpu_clock(cpu) - per_cpu(blk_trace_cpu_offset, cpu); t->sector = sector; t->bytes = bytes; t->action = what; @@ -178,7 +179,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes, EXPORT_SYMBOL_GPL(__blk_add_trace); static struct dentry *blk_tree_root; -static DEFINE_MUTEX(blk_tree_mutex); +static struct mutex blk_tree_mutex; static unsigned int root_users; static inline void blk_remove_root(void) @@ -504,3 +505,77 @@ void blk_trace_shutdown(struct request_queue *q) blk_trace_remove(q); } } + +/* + * Average offset over two calls to cpu_clock() with a gettimeofday() + * in the middle + */ +static void blk_check_time(unsigned long long *t, int this_cpu) +{ + unsigned long long a, b; + struct timeval tv; + + a = cpu_clock(this_cpu); + do_gettimeofday(&tv); + b = cpu_clock(this_cpu); + + *t = tv.tv_sec * 1000000000 + tv.tv_usec * 1000; + *t -= (a + b) / 2; +} + +/* + * calibrate our inter-CPU timings + */ +static void blk_trace_check_cpu_time(void *data) +{ + unsigned long long *t; + int this_cpu = get_cpu(); + + t = &per_cpu(blk_trace_cpu_offset, this_cpu); + + /* + * Just call it twice, hopefully the second call will be cache hot + * and a little more precise + */ + blk_check_time(t, this_cpu); + blk_check_time(t, this_cpu); + + put_cpu(); +} + +static void blk_trace_set_ht_offsets(void) +{ +#if defined(CONFIG_SCHED_SMT) + int cpu, i; + + /* + * now make sure HT siblings have the same time offset + */ + preempt_disable(); + for_each_online_cpu(cpu) { + unsigned long long *cpu_off, *sibling_off; + + for_each_cpu_mask(i, per_cpu(cpu_sibling_map, cpu)) { + if (i == cpu) + continue; + + cpu_off = &per_cpu(blk_trace_cpu_offset, cpu); + sibling_off = &per_cpu(blk_trace_cpu_offset, i); + *sibling_off = *cpu_off; + } + } + preempt_enable(); +#endif +} + +static __init int blk_trace_init(void) +{ + mutex_init(&blk_tree_mutex); + on_each_cpu(blk_trace_check_cpu_time, NULL, 1, 1); + blk_trace_set_ht_offsets(); + + return 0; +} + +module_init(blk_trace_init); + diff --git a/trunk/drivers/ata/libata-eh.c b/trunk/drivers/ata/libata-eh.c index 21a81cd148e4..f0124a8d3134 100644 --- a/trunk/drivers/ata/libata-eh.c +++ b/trunk/drivers/ata/libata-eh.c @@ -1733,15 +1733,11 @@ static void ata_eh_link_autopsy(struct ata_link *link) ehc->i.action &= ~ATA_EH_PERDEV_MASK; } - /* propagate timeout to host link */ - if ((all_err_mask & AC_ERR_TIMEOUT) && !ata_is_host_link(link)) - ap->link.eh_context.i.err_mask |= AC_ERR_TIMEOUT; - - /* record error and consider speeding down */ + /* consider speeding down */ dev = ehc->i.dev; - if (!dev && ((ata_link_max_devices(link) == 1 && - ata_dev_enabled(link->device)))) - dev = link->device; + if (!dev && ata_link_max_devices(link) == 1 && + ata_dev_enabled(link->device)) + dev = link->device; if (dev) ehc->i.action |= ata_eh_speed_down(dev, is_io, all_err_mask); @@ -1763,14 +1759,8 @@ void ata_eh_autopsy(struct ata_port *ap) { struct ata_link *link; - ata_port_for_each_link(link, ap) + __ata_port_for_each_link(link, ap) ata_eh_link_autopsy(link); - - /* Autopsy of fanout ports can affect host link autopsy. - * Perform host link autopsy last. - */ - if (ap->nr_pmp_links) - ata_eh_link_autopsy(&ap->link); } /** @@ -2167,11 +2157,13 @@ int ata_eh_reset(struct ata_link *link, int classify, if (ata_link_offline(link)) continue; - /* apply class override */ + /* apply class override and convert UNKNOWN to NONE */ if (lflags & ATA_LFLAG_ASSUME_ATA) classes[dev->devno] = ATA_DEV_ATA; else if (lflags & ATA_LFLAG_ASSUME_SEMB) classes[dev->devno] = ATA_DEV_SEMB_UNSUP; /* not yet */ + else if (classes[dev->devno] == ATA_DEV_UNKNOWN) + classes[dev->devno] = ATA_DEV_NONE; } /* record current link speed */ diff --git a/trunk/drivers/ata/libata-pmp.c b/trunk/drivers/ata/libata-pmp.c index caef2bbd4a8a..c0c4dbcde091 100644 --- a/trunk/drivers/ata/libata-pmp.c +++ b/trunk/drivers/ata/libata-pmp.c @@ -495,12 +495,14 @@ static void sata_pmp_quirks(struct ata_port *ap) /* SError.N need a kick in the ass to get working */ link->flags |= ATA_LFLAG_HRST_TO_RESUME; - /* Class code report is unreliable and SRST - * times out under certain configurations. - * Config device can be at port 0 or 5 and - * locks up on SRST. + /* class code report is unreliable */ + if (link->pmp < 5) + link->flags |= ATA_LFLAG_ASSUME_ATA; + + /* The config device, which can be either at + * port 0 or 5, locks up on SRST. */ - if (link->pmp <= 5) + if (link->pmp == 0 || link->pmp == 5) link->flags |= ATA_LFLAG_NO_SRST | ATA_LFLAG_ASSUME_ATA; diff --git a/trunk/drivers/ata/libata-scsi.c b/trunk/drivers/ata/libata-scsi.c index 264ae60e3fd8..a883bb03d4c7 100644 --- a/trunk/drivers/ata/libata-scsi.c +++ b/trunk/drivers/ata/libata-scsi.c @@ -872,8 +872,7 @@ int ata_scsi_slave_config(struct scsi_device *sdev) ata_scsi_sdev_config(sdev); - if (dev->class == ATA_DEV_ATA) - sdev->manage_start_stop = 1; + sdev->manage_start_stop = 1; if (dev) ata_scsi_dev_config(sdev, dev); diff --git a/trunk/drivers/ata/libata-sff.c b/trunk/drivers/ata/libata-sff.c index b7ac80b4b1fb..48acc09dab96 100644 --- a/trunk/drivers/ata/libata-sff.c +++ b/trunk/drivers/ata/libata-sff.c @@ -806,10 +806,7 @@ int ata_pci_init_one(struct pci_dev *pdev, if (rc) goto err_out; - if (!legacy_mode && pdev->irq) { - /* We may have no IRQ assigned in which case we can poll. This - shouldn't happen on a sane system but robustness is cheap - in this case */ + if (!legacy_mode) { rc = devm_request_irq(dev, pdev->irq, pi->port_ops->irq_handler, IRQF_SHARED, DRV_NAME, host); if (rc) @@ -817,7 +814,7 @@ int ata_pci_init_one(struct pci_dev *pdev, ata_port_desc(host->ports[0], "irq %d", pdev->irq); ata_port_desc(host->ports[1], "irq %d", pdev->irq); - } else if (legacy_mode) { + } else { if (!ata_port_is_dummy(host->ports[0])) { rc = devm_request_irq(dev, ATA_PRIMARY_IRQ(pdev), pi->port_ops->irq_handler, diff --git a/trunk/drivers/ata/pata_ixp4xx_cf.c b/trunk/drivers/ata/pata_ixp4xx_cf.c index 120b5bfa7ce6..fcd532afbf2e 100644 --- a/trunk/drivers/ata/pata_ixp4xx_cf.c +++ b/trunk/drivers/ata/pata_ixp4xx_cf.c @@ -130,11 +130,10 @@ static struct ata_port_operations ixp4xx_port_ops = { .port_start = ata_port_start, }; -static void ixp4xx_setup_port(struct ata_port *ap, +static void ixp4xx_setup_port(struct ata_ioports *ioaddr, struct ixp4xx_pata_data *data, unsigned long raw_cs0, unsigned long raw_cs1) { - struct ata_ioports *ioaddr = &ap->ioaddr; unsigned long raw_cmd = raw_cs0; unsigned long raw_ctl = raw_cs1 + 0x06; diff --git a/trunk/drivers/ata/pata_pdc202xx_old.c b/trunk/drivers/ata/pata_pdc202xx_old.c index 8f2815601791..bc7c2d5d8d5e 100644 --- a/trunk/drivers/ata/pata_pdc202xx_old.c +++ b/trunk/drivers/ata/pata_pdc202xx_old.c @@ -215,8 +215,8 @@ static void pdc2026x_bmdma_stop(struct ata_queued_cmd *qc) /* Flip back to 33Mhz for PIO */ if (adev->dma_mode >= XFER_UDMA_2) iowrite8(ioread8(clock) & ~sel66, clock); + ata_bmdma_stop(qc); - pdc202xx_set_piomode(ap, adev); } /** @@ -233,17 +233,6 @@ static void pdc2026x_dev_config(struct ata_device *adev) adev->max_sectors = 256; } -static int pdc2026x_port_start(struct ata_port *ap) -{ - void __iomem *bmdma = ap->ioaddr.bmdma_addr; - if (bmdma) { - /* Enable burst mode */ - u8 burst = ioread8(bmdma + 0x1f); - iowrite8(burst | 0x01, bmdma + 0x1f); - } - return ata_sff_port_start(ap); -} - static struct scsi_host_template pdc202xx_sht = { .module = THIS_MODULE, .name = DRV_NAME, @@ -324,7 +313,7 @@ static struct ata_port_operations pdc2026x_port_ops = { .irq_clear = ata_bmdma_irq_clear, .irq_on = ata_irq_on, - .port_start = pdc2026x_port_start, + .port_start = ata_sff_port_start, }; static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) diff --git a/trunk/drivers/ata/sata_qstor.c b/trunk/drivers/ata/sata_qstor.c index c68b241805fd..2f1de6ec044c 100644 --- a/trunk/drivers/ata/sata_qstor.c +++ b/trunk/drivers/ata/sata_qstor.c @@ -270,7 +270,7 @@ static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) static void qs_error_handler(struct ata_port *ap) { qs_enter_reg_mode(ap); - ata_do_eh(ap, qs_prereset, NULL, sata_std_hardreset, + ata_do_eh(ap, qs_prereset, ata_std_softreset, NULL, ata_std_postreset); } diff --git a/trunk/drivers/ata/sata_sil24.c b/trunk/drivers/ata/sata_sil24.c index b4c674d83769..96fd5260446d 100644 --- a/trunk/drivers/ata/sata_sil24.c +++ b/trunk/drivers/ata/sata_sil24.c @@ -832,31 +832,16 @@ static int sil24_qc_defer(struct ata_queued_cmd *qc) struct ata_link *link = qc->dev->link; struct ata_port *ap = link->ap; u8 prot = qc->tf.protocol; - - /* - * There is a bug in the chip: - * Port LRAM Causes the PRB/SGT Data to be Corrupted - * If the host issues a read request for LRAM and SActive registers - * while active commands are available in the port, PRB/SGT data in - * the LRAM can become corrupted. This issue applies only when - * reading from, but not writing to, the LRAM. - * - * Therefore, reading LRAM when there is no particular error [and - * other commands may be outstanding] is prohibited. - * - * To avoid this bug there are two situations where a command must run - * exclusive of any other commands on the port: - * - * - ATAPI commands which check the sense data - * - Passthrough ATA commands which always have ATA_QCFLAG_RESULT_TF - * set. - * - */ - int is_excl = (prot == ATA_PROT_ATAPI || - prot == ATA_PROT_ATAPI_NODATA || - prot == ATA_PROT_ATAPI_DMA || - (qc->flags & ATA_QCFLAG_RESULT_TF)); - + int is_atapi = (prot == ATA_PROT_ATAPI || + prot == ATA_PROT_ATAPI_NODATA || + prot == ATA_PROT_ATAPI_DMA); + + /* ATAPI commands completing with CHECK_SENSE cause various + * weird problems if other commands are active. PMP DMA CS + * errata doesn't cover all and HSM violation occurs even with + * only one other device active. Always run an ATAPI command + * by itself. + */ if (unlikely(ap->excl_link)) { if (link == ap->excl_link) { if (ap->nr_active_links) @@ -864,7 +849,7 @@ static int sil24_qc_defer(struct ata_queued_cmd *qc) qc->flags |= ATA_QCFLAG_CLEAR_EXCL; } else return ATA_DEFER_PORT; - } else if (unlikely(is_excl)) { + } else if (unlikely(is_atapi)) { ap->excl_link = link; if (ap->nr_active_links) return ATA_DEFER_PORT; diff --git a/trunk/drivers/block/loop.c b/trunk/drivers/block/loop.c index b8af22e610df..56e23042728a 100644 --- a/trunk/drivers/block/loop.c +++ b/trunk/drivers/block/loop.c @@ -610,7 +610,7 @@ static int loop_thread(void *data) static int loop_switch(struct loop_device *lo, struct file *file) { struct switch_request w; - struct bio *bio = bio_alloc(GFP_KERNEL, 0); + struct bio *bio = bio_alloc(GFP_KERNEL, 1); if (!bio) return -ENOMEM; init_completion(&w.wait); diff --git a/trunk/drivers/crypto/padlock-aes.c b/trunk/drivers/crypto/padlock-aes.c index 5f7e71810489..a337b693b6c9 100644 --- a/trunk/drivers/crypto/padlock-aes.c +++ b/trunk/drivers/crypto/padlock-aes.c @@ -429,8 +429,8 @@ static inline void padlock_xcrypt(const u8 *input, u8 *output, void *key, static void aes_crypt_copy(const u8 *in, u8 *out, u32 *key, struct cword *cword) { - u8 buf[AES_BLOCK_SIZE * 2 + PADLOCK_ALIGNMENT - 1]; - u8 *tmp = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT); + u8 tmp[AES_BLOCK_SIZE * 2] + __attribute__ ((__aligned__(PADLOCK_ALIGNMENT))); memcpy(tmp, in, AES_BLOCK_SIZE); padlock_xcrypt(tmp, out, key, cword); diff --git a/trunk/drivers/ide/ide-acpi.c b/trunk/drivers/ide/ide-acpi.c index 899d56536e80..89df48fdc69d 100644 --- a/trunk/drivers/ide/ide-acpi.c +++ b/trunk/drivers/ide/ide-acpi.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -66,39 +65,6 @@ extern int ide_noacpi; extern int ide_noacpitfs; extern int ide_noacpionboot; -static bool ide_noacpi_psx; -static int no_acpi_psx(const struct dmi_system_id *id) -{ - ide_noacpi_psx = true; - printk(KERN_NOTICE"%s detected - disable ACPI _PSx.\n", id->ident); - return 0; -} - -static const struct dmi_system_id ide_acpi_dmi_table[] = { - /* Bug 9673. */ - /* We should check if this is because ACPI NVS isn't save/restored. */ - { - .callback = no_acpi_psx, - .ident = "HP nx9005", - .matches = { - DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies Ltd."), - DMI_MATCH(DMI_BIOS_VERSION, "KAM1.60") - }, - }, - - { } /* terminate list */ -}; - -static int ide_acpi_blacklist(void) -{ - static int done; - if (done) - return 0; - done = 1; - dmi_check_system(ide_acpi_dmi_table); - return 0; -} - /** * ide_get_dev_handle - finds acpi_handle and PCI device.function * @dev: device to locate @@ -657,7 +623,7 @@ void ide_acpi_set_state(ide_hwif_t *hwif, int on) { int unit; - if (ide_noacpi || ide_noacpi_psx) + if (ide_noacpi) return; DEBPRINT("ENTER:\n"); @@ -702,8 +668,6 @@ void ide_acpi_init(ide_hwif_t *hwif) struct ide_acpi_drive_link *master; struct ide_acpi_drive_link *slave; - ide_acpi_blacklist(); - hwif->acpidata = kzalloc(sizeof(struct ide_acpi_hwif_link), GFP_KERNEL); if (!hwif->acpidata) return; diff --git a/trunk/drivers/ide/ide-iops.c b/trunk/drivers/ide/ide-iops.c index bb9693dabe41..cef405ddaf0e 100644 --- a/trunk/drivers/ide/ide-iops.c +++ b/trunk/drivers/ide/ide-iops.c @@ -612,12 +612,12 @@ u8 eighty_ninty_three (ide_drive_t *drive) printk(KERN_DEBUG "%s: skipping word 93 validity check\n", drive->name); - if (ide_dev_is_sata(id) && !ivb) - return 1; - if (hwif->cbl != ATA_CBL_PATA80 && !ivb) goto no_80w; + if (ide_dev_is_sata(id)) + return 1; + /* * FIXME: * - force bit13 (80c cable present) check also for !ivb devices diff --git a/trunk/drivers/ide/pci/trm290.c b/trunk/drivers/ide/pci/trm290.c index 0151d7fdfb8a..0895e753a35d 100644 --- a/trunk/drivers/ide/pci/trm290.c +++ b/trunk/drivers/ide/pci/trm290.c @@ -1,8 +1,7 @@ /* - * linux/drivers/ide/pci/trm290.c Version 1.05 Dec. 26, 2007 + * linux/drivers/ide/pci/trm290.c Version 1.02 Mar. 18, 2000 * * Copyright (c) 1997-1998 Mark Lord - * Copyright (c) 2007 MontaVista Software, Inc. * May be copied or modified under the terms of the GNU General Public License * * June 22, 2004 - get rid of check_region @@ -178,7 +177,7 @@ static void trm290_selectproc (ide_drive_t *drive) trm290_prepare_drive(drive, drive->using_dma); } -static void trm290_dma_exec_cmd(ide_drive_t *drive, u8 command) +static void trm290_ide_dma_exec_cmd(ide_drive_t *drive, u8 command) { BUG_ON(HWGROUP(drive)->handler != NULL); /* paranoia check */ ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); @@ -186,7 +185,7 @@ static void trm290_dma_exec_cmd(ide_drive_t *drive, u8 command) outb(command, IDE_COMMAND_REG); } -static int trm290_dma_setup(ide_drive_t *drive) +static int trm290_ide_dma_setup(ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; struct request *rq = hwif->hwgroup->rq; @@ -216,7 +215,7 @@ static int trm290_dma_setup(ide_drive_t *drive) return 0; } -static void trm290_dma_start(ide_drive_t *drive) +static void trm290_ide_dma_start(ide_drive_t *drive) { } @@ -241,14 +240,6 @@ static int trm290_ide_dma_test_irq (ide_drive_t *drive) return (status == 0x00ff); } -static void trm290_dma_host_on(ide_drive_t *drive) -{ -} - -static void trm290_dma_host_off(ide_drive_t *drive) -{ -} - static void __devinit init_hwif_trm290(ide_hwif_t *hwif) { unsigned int cfgbase = 0; @@ -289,13 +280,11 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif) ide_setup_dma(hwif, (hwif->config_data + 4) ^ (hwif->channel ? 0x0080 : 0x0000), 3); - hwif->dma_host_off = &trm290_dma_host_off; - hwif->dma_host_on = &trm290_dma_host_on; - hwif->dma_setup = &trm290_dma_setup; - hwif->dma_exec_cmd = &trm290_dma_exec_cmd; - hwif->dma_start = &trm290_dma_start; - hwif->ide_dma_end = &trm290_ide_dma_end; - hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq; + hwif->dma_setup = &trm290_ide_dma_setup; + hwif->dma_exec_cmd = &trm290_ide_dma_exec_cmd; + hwif->dma_start = &trm290_ide_dma_start; + hwif->ide_dma_end = &trm290_ide_dma_end; + hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq; hwif->selectproc = &trm290_selectproc; #if 1 diff --git a/trunk/drivers/mtd/chips/cfi_cmdset_0001.c b/trunk/drivers/mtd/chips/cfi_cmdset_0001.c index 1707f98c322c..a9eb1c516247 100644 --- a/trunk/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/trunk/drivers/mtd/chips/cfi_cmdset_0001.c @@ -1504,12 +1504,9 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, int ret, wbufsize, word_gap, words; const struct kvec *vec; unsigned long vec_seek; - unsigned long initial_adr; - int initial_len = len; wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; adr += chip->start; - initial_adr = adr; cmd_adr = adr & ~(wbufsize-1); /* Let's determine this according to the interleave only once */ @@ -1522,7 +1519,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, return ret; } - XIP_INVAL_CACHED_RANGE(map, initial_adr, initial_len); + XIP_INVAL_CACHED_RANGE(map, adr, len); ENABLE_VPP(map); xip_disable(map, chip, cmd_adr); @@ -1613,7 +1610,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, chip->state = FL_WRITING; ret = INVAL_CACHE_AND_WAIT(map, chip, cmd_adr, - initial_adr, initial_len, + adr, len, chip->buffer_write_time); if (ret) { map_write(map, CMD(0x70), cmd_adr); diff --git a/trunk/drivers/scsi/qla1280.c b/trunk/drivers/scsi/qla1280.c index 288640756099..146d540f6281 100644 --- a/trunk/drivers/scsi/qla1280.c +++ b/trunk/drivers/scsi/qla1280.c @@ -3041,6 +3041,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) int cnt; int req_cnt; int seg_cnt; + dma_addr_t dma_handle; u8 dir; ENTER("qla1280_32bit_start_scsi"); @@ -3049,7 +3050,6 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) cmd->cmnd[0]); /* Calculate number of entries and segments required. */ - req_cnt = 1; seg_cnt = scsi_dma_map(cmd); if (seg_cnt) { /* diff --git a/trunk/drivers/video/ps3fb.c b/trunk/drivers/video/ps3fb.c index 044a423a72cb..b3128903d673 100644 --- a/trunk/drivers/video/ps3fb.c +++ b/trunk/drivers/video/ps3fb.c @@ -443,6 +443,8 @@ static int ps3fb_sync(struct fb_info *info, u32 frame) u32 ddr_line_length, xdr_line_length; u64 ddr_base, xdr_base; + acquire_console_sem(); + if (frame > par->num_frames - 1) { dev_dbg(info->device, "%s: invalid frame number (%u)\n", __func__, frame); @@ -462,6 +464,7 @@ static int ps3fb_sync(struct fb_info *info, u32 frame) xdr_line_length); out: + release_console_sem(); return error; } @@ -476,10 +479,7 @@ static int ps3fb_release(struct fb_info *info, int user) if (atomic_dec_and_test(&ps3fb.f_count)) { if (atomic_read(&ps3fb.ext_flip)) { atomic_set(&ps3fb.ext_flip, 0); - if (!try_acquire_console_sem()) { - ps3fb_sync(info, 0); /* single buffer */ - release_console_sem(); - } + ps3fb_sync(info, 0); /* single buffer */ } } return 0; @@ -865,9 +865,7 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd, break; dev_dbg(info->device, "PS3FB_IOCTL_FSEL:%d\n", val); - acquire_console_sem(); retval = ps3fb_sync(info, val); - release_console_sem(); break; default: @@ -887,9 +885,7 @@ static int ps3fbd(void *arg) set_current_state(TASK_INTERRUPTIBLE); if (ps3fb.is_kicked) { ps3fb.is_kicked = 0; - acquire_console_sem(); ps3fb_sync(info, 0); /* single buffer */ - release_console_sem(); } schedule(); } @@ -1238,6 +1234,12 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev) ps3fb_flip_ctl(0, &ps3fb); /* flip off */ ps3fb.dinfo->irq.mask = 0; + if (info) { + unregister_framebuffer(info); + fb_dealloc_cmap(&info->cmap); + framebuffer_release(info); + } + ps3av_register_flip_ctl(NULL, NULL); if (ps3fb.task) { struct task_struct *task = ps3fb.task; @@ -1248,12 +1250,6 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev) free_irq(ps3fb.irq_no, &dev->core); ps3_irq_plug_destroy(ps3fb.irq_no); } - if (info) { - unregister_framebuffer(info); - fb_dealloc_cmap(&info->cmap); - framebuffer_release(info); - info = dev->core.driver_data = NULL; - } iounmap((u8 __iomem *)ps3fb.dinfo); status = lv1_gpu_context_free(ps3fb.context_handle); diff --git a/trunk/fs/nfs/nfs4_fs.h b/trunk/fs/nfs/nfs4_fs.h index bd1b9d663fb9..b35069a2aa9e 100644 --- a/trunk/fs/nfs/nfs4_fs.h +++ b/trunk/fs/nfs/nfs4_fs.h @@ -115,7 +115,6 @@ struct nfs4_lock_state { #define NFS_LOCK_INITIALIZED 1 int ls_flags; struct nfs_seqid_counter ls_seqid; - struct rpc_sequence ls_sequence; struct nfs_unique_id ls_id; nfs4_stateid ls_stateid; atomic_t ls_count; diff --git a/trunk/fs/nfs/nfs4state.c b/trunk/fs/nfs/nfs4state.c index 5a39c6f78acf..23a9a36556bf 100644 --- a/trunk/fs/nfs/nfs4state.c +++ b/trunk/fs/nfs/nfs4state.c @@ -509,10 +509,7 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f lsp = kzalloc(sizeof(*lsp), GFP_KERNEL); if (lsp == NULL) return NULL; - rpc_init_wait_queue(&lsp->ls_sequence.wait, "lock_seqid_waitqueue"); - spin_lock_init(&lsp->ls_sequence.lock); - INIT_LIST_HEAD(&lsp->ls_sequence.list); - lsp->ls_seqid.sequence = &lsp->ls_sequence; + lsp->ls_seqid.sequence = &state->owner->so_sequence; atomic_set(&lsp->ls_count, 1); lsp->ls_owner = fl_owner; spin_lock(&clp->cl_lock); diff --git a/trunk/fs/xfs/linux-2.6/xfs_file.c b/trunk/fs/xfs/linux-2.6/xfs_file.c index 4847eb83fc18..21a1c2b1c5fc 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_file.c +++ b/trunk/fs/xfs/linux-2.6/xfs_file.c @@ -261,9 +261,9 @@ xfs_file_readdir( #else struct hack_dirent { - int namlen; - loff_t offset; u64 ino; + loff_t offset; + int namlen; unsigned int d_type; char name[]; }; @@ -285,8 +285,10 @@ xfs_hack_filldir( { struct hack_callback *buf = __buf; struct hack_dirent *de = (struct hack_dirent *)(buf->dirent + buf->used); + unsigned int reclen; - if (buf->used + sizeof(struct hack_dirent) + namlen > buf->len) + reclen = ALIGN(sizeof(struct hack_dirent) + namlen, sizeof(u64)); + if (buf->used + reclen > buf->len) return -EINVAL; de->namlen = namlen; @@ -294,7 +296,7 @@ xfs_hack_filldir( de->ino = ino; de->d_type = d_type; memcpy(de->name, name, namlen); - buf->used += sizeof(struct hack_dirent) + namlen; + buf->used += reclen; return 0; } @@ -334,7 +336,8 @@ xfs_file_readdir( offset = filp->f_pos; while (!eof) { - int reclen; + unsigned int reclen; + start_offset = offset; buf.used = 0; @@ -355,7 +358,8 @@ xfs_file_readdir( goto done; } - reclen = sizeof(struct hack_dirent) + de->namlen; + reclen = ALIGN(sizeof(struct hack_dirent) + de->namlen, + sizeof(u64)); size -= reclen; de = (struct hack_dirent *)((char *)de + reclen); curr_offset = de->offset /* & 0x7fffffff */; diff --git a/trunk/include/asm-sh/cacheflush.h b/trunk/include/asm-sh/cacheflush.h index e034c3604111..9d528ada3c14 100644 --- a/trunk/include/asm-sh/cacheflush.h +++ b/trunk/include/asm-sh/cacheflush.h @@ -43,12 +43,6 @@ extern void __flush_purge_region(void *start, int size); extern void __flush_invalidate_region(void *start, int size); #endif -#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE -static inline void flush_kernel_dcache_page(struct page *page) -{ - flush_dcache_page(page); -} - #if defined(CONFIG_CPU_SH4) && !defined(CONFIG_CACHE_OFF) extern void copy_to_user_page(struct vm_area_struct *vma, struct page *page, unsigned long vaddr, void *dst, const void *src, diff --git a/trunk/include/asm-sh/uaccess.h b/trunk/include/asm-sh/uaccess.h index 77c391fa93d6..f18a1a5c95c0 100644 --- a/trunk/include/asm-sh/uaccess.h +++ b/trunk/include/asm-sh/uaccess.h @@ -73,26 +73,38 @@ static inline int __access_ok(unsigned long addr, unsigned long size) /* * __access_ok: Check if address with size is OK or not. * - * Uhhuh, this needs 33-bit arithmetic. We have a carry.. + * We do three checks: + * (1) is it user space? + * (2) addr + size --> carry? + * (3) addr + size >= 0x80000000 (PAGE_OFFSET) * - * sum := addr + size; carry? --> flag = true; - * if (sum >= addr_limit) flag = true; + * (1) (2) (3) | RESULT + * 0 0 0 | ok + * 0 0 1 | ok + * 0 1 0 | bad + * 0 1 1 | bad + * 1 0 0 | ok + * 1 0 1 | bad + * 1 1 0 | bad + * 1 1 1 | bad */ static inline int __access_ok(unsigned long addr, unsigned long size) { - unsigned long flag, sum; - - __asm__("clrt\n\t" - "addc %3, %1\n\t" - "movt %0\n\t" - "cmp/hi %4, %1\n\t" - "rotcl %0" - :"=&r" (flag), "=r" (sum) - :"1" (addr), "r" (size), - "r" (current_thread_info()->addr_limit.seg) - :"t"); - return flag == 0; + unsigned long flag, tmp; + + __asm__("stc r7_bank, %0\n\t" + "mov.l @(8,%0), %0\n\t" + "clrt\n\t" + "addc %2, %1\n\t" + "and %1, %0\n\t" + "rotcl %0\n\t" + "rotcl %0\n\t" + "and #3, %0" + : "=&z" (flag), "=r" (tmp) + : "r" (addr), "1" (size) + : "t"); + return flag == 0; } #endif /* CONFIG_MMU */ diff --git a/trunk/include/linux/scatterlist.h b/trunk/include/linux/scatterlist.h index e3ff21dbac53..416e000dfe81 100644 --- a/trunk/include/linux/scatterlist.h +++ b/trunk/include/linux/scatterlist.h @@ -191,8 +191,8 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, /* * offset and length are unused for chain entry. Clear them. */ - prv[prv_nents - 1].offset = 0; - prv[prv_nents - 1].length = 0; + prv->offset = 0; + prv->length = 0; /* * Set lowest bit to indicate a link pointer, and make sure to clear