Changeset 9155


Ignore:
Timestamp:
02/29/08 03:37:50 (5 years ago)
Author:
BrainSlayer
Message:

update to 2.6.23.17

Location:
src/linux/magicbox/linux-2.6.23
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • src/linux/magicbox/linux-2.6.23/Makefile

    r8974 r9155  
    22PATCHLEVEL = 6 
    33SUBLEVEL = 23 
    4 EXTRAVERSION = .15 
     4EXTRAVERSION = .17 
    55NAME = Arr Matey! A Hairy Bilge Rat! 
    66 
  • src/linux/magicbox/linux-2.6.23/arch/powerpc/platforms/powermac/feature.c

    r8205 r9155  
    25662566        /* Locate core99 Uni-N */ 
    25672567        uninorth_node = of_find_node_by_name(NULL, "uni-n"); 
     2568        uninorth_maj = 1; 
     2569 
    25682570        /* Locate G5 u3 */ 
    25692571        if (uninorth_node == NULL) { 
     
    25762578                uninorth_maj = 4; 
    25772579        } 
    2578         if (uninorth_node == NULL) 
     2580        if (uninorth_node == NULL) { 
     2581                uninorth_maj = 0; 
    25792582                return; 
     2583        } 
    25802584 
    25812585        addrp = of_get_property(uninorth_node, "reg", NULL); 
     
    30303034} 
    30313035EXPORT_SYMBOL(pmac_resume_agp_for_card); 
     3036 
     3037int pmac_get_uninorth_variant(void) 
     3038{ 
     3039        return uninorth_maj; 
     3040} 
  • src/linux/magicbox/linux-2.6.23/arch/x86_64/mm/pageattr.c

    r8642 r9155  
    208208                        unsigned long addr2; 
    209209                        pgprot_t prot2; 
    210                         addr2 = __START_KERNEL_map + __pa(address); 
     210                        addr2 = __START_KERNEL_map + __pa(address) - phys_base; 
    211211                        /* Make sure the kernel mappings stay executable */ 
    212212                        prot2 = pte_pgprot(pte_mkexec(pfn_pte(0, prot))); 
  • src/linux/magicbox/linux-2.6.23/drivers/macintosh/smu.c

    r8205 r9155  
    8686        struct list_head        cmd_list; 
    8787        struct smu_cmd          *cmd_cur;       /* pending command */ 
     88        int                     broken_nap; 
    8889        struct list_head        cmd_i2c_list; 
    8990        struct smu_i2c_cmd      *cmd_i2c_cur;   /* pending i2c command */ 
     
    135136        fend = faddr + smu->cmd_buf->length + 2; 
    136137        flush_inval_dcache_range(faddr, fend); 
     138 
     139 
     140        /* We also disable NAP mode for the duration of the command 
     141         * on U3 based machines. 
     142         * This is slightly racy as it can be written back to 1 by a sysctl 
     143         * but that never happens in practice. There seem to be an issue with 
     144         * U3 based machines such as the iMac G5 where napping for the 
     145         * whole duration of the command prevents the SMU from fetching it 
     146         * from memory. This might be related to the strange i2c based 
     147         * mechanism the SMU uses to access memory. 
     148         */ 
     149        if (smu->broken_nap) 
     150                powersave_nap = 0; 
    137151 
    138152        /* This isn't exactly a DMA mapping here, I suspect 
     
    212226        mb(); 
    213227        cmd->status = rc; 
     228 
     229        /* Re-enable NAP mode */ 
     230        if (smu->broken_nap) 
     231                powersave_nap = 1; 
    214232 bail: 
    215233        /* Start next command if any */ 
     
    462480                return -ENODEV; 
    463481 
    464         printk(KERN_INFO "SMU driver %s %s\n", VERSION, AUTHOR); 
     482        printk(KERN_INFO "SMU: Driver %s %s\n", VERSION, AUTHOR); 
    465483 
    466484        if (smu_cmdbuf_abs == 0) { 
     
    533551                goto fail; 
    534552        } 
     553 
     554        /* U3 has an issue with NAP mode when issuing SMU commands */ 
     555        smu->broken_nap = pmac_get_uninorth_variant() < 4; 
     556        if (smu->broken_nap) 
     557                printk(KERN_INFO "SMU: using NAP mode workaround\n"); 
    535558 
    536559        sys_ctrler = SYS_CTRLER_SMU; 
  • src/linux/magicbox/linux-2.6.23/drivers/scsi/sd.c

    r8205 r9155  
    902902        unsigned int good_bytes = result ? 0 : xfer_size; 
    903903        u64 start_lba = SCpnt->request->sector; 
     904        u64 end_lba = SCpnt->request->sector + (xfer_size / 512); 
    904905        u64 bad_lba; 
    905906        struct scsi_sense_hdr sshdr; 
     
    940941                if (xfer_size <= SCpnt->device->sector_size) 
    941942                        goto out; 
    942                 switch (SCpnt->device->sector_size) { 
    943                 case 256: 
     943                if (SCpnt->device->sector_size < 512) { 
     944                        /* only legitimate sector_size here is 256 */ 
    944945                        start_lba <<= 1; 
    945                         break; 
    946                 case 512: 
    947                         break; 
    948                 case 1024: 
    949                         start_lba >>= 1; 
    950                         break; 
    951                 case 2048: 
    952                         start_lba >>= 2; 
    953                         break; 
    954                 case 4096: 
    955                         start_lba >>= 3; 
    956                         break; 
    957                 default: 
    958                         /* Print something here with limiting frequency. */ 
     946                        end_lba <<= 1; 
     947                } else { 
     948                        /* be careful ... don't want any overflows */ 
     949                        u64 factor = SCpnt->device->sector_size / 512; 
     950                        do_div(start_lba, factor); 
     951                        do_div(end_lba, factor); 
     952                } 
     953 
     954                if (bad_lba < start_lba  || bad_lba >= end_lba) 
     955                        /* the bad lba was reported incorrectly, we have 
     956                         * no idea where the error is 
     957                         */ 
    959958                        goto out; 
    960                         break; 
    961                 } 
     959 
    962960                /* This computation should always be done in terms of 
    963961                 * the resolution of the device's medium. 
  • src/linux/magicbox/linux-2.6.23/fs/nfs/write.c

    r8424 r9155  
    718718 
    719719/* 
     720 * If the page cache is marked as unsafe or invalid, then we can't rely on 
     721 * the PageUptodate() flag. In this case, we will need to turn off 
     722 * write optimisations that depend on the page contents being correct. 
     723 */ 
     724static int nfs_write_pageuptodate(struct page *page, struct inode *inode) 
     725{ 
     726        return PageUptodate(page) && 
     727                !(NFS_I(inode)->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA)); 
     728} 
     729 
     730/* 
    720731 * Update and possibly write a cached page of an NFS file. 
    721732 * 
     
    738749 
    739750        /* If we're not using byte range locks, and we know the page 
    740          * is entirely in cache, it may be more efficient to avoid 
    741          * fragmenting write requests. 
     751         * is up to date, it may be more efficient to extend the write 
     752         * to cover the entire page in order to avoid fragmentation 
     753         * inefficiencies. 
    742754         */ 
    743         if (PageUptodate(page) && inode->i_flock == NULL && !(file->f_mode & O_SYNC)) { 
     755        if (nfs_write_pageuptodate(page, inode) && 
     756                        inode->i_flock == NULL && 
     757                        !(file->f_mode & O_SYNC)) { 
    744758                count = max(count + offset, nfs_page_length(page)); 
    745759                offset = 0; 
  • src/linux/magicbox/linux-2.6.23/fs/splice.c

    r8974 r9155  
    12901290                        break; 
    12911291                error = -EFAULT; 
    1292                 if (unlikely(!base)) 
     1292                if (!access_ok(VERIFY_READ, base, len)) 
    12931293                        break; 
    12941294 
  • src/linux/magicbox/linux-2.6.23/include/asm-powerpc/pmac_feature.h

    r8205 r9155  
    393393#define UN_BIC(r,v)     (UN_OUT((r), UN_IN(r) & ~(v))) 
    394394 
     395/* Uninorth variant: 
     396 * 
     397 * 0 = not uninorth 
     398 * 1 = U1.x or U2.x 
     399 * 3 = U3 
     400 * 4 = U4 
     401 */ 
     402extern int pmac_get_uninorth_variant(void); 
    395403 
    396404#endif /* __ASM_POWERPC_PMAC_FEATURE_H */ 
  • src/linux/magicbox/linux-2.6.23/include/linux/ktime.h

    r8205 r9155  
    290290} 
    291291 
     292extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs); 
     293 
    292294/* 
    293295 * The resolution of the clocks. The resolution value is returned in 
  • src/linux/magicbox/linux-2.6.23/kernel/futex.c

    r8642 r9155  
    20642064                t = timespec_to_ktime(ts); 
    20652065                if (cmd == FUTEX_WAIT) 
    2066                         t = ktime_add(ktime_get(), t); 
     2066                        t = ktime_add_safe(ktime_get(), t); 
    20672067                tp = &t; 
    20682068        } 
  • src/linux/magicbox/linux-2.6.23/kernel/futex_compat.c

    r8424 r9155  
    176176                t = timespec_to_ktime(ts); 
    177177                if (cmd == FUTEX_WAIT) 
    178                         t = ktime_add(ktime_get(), t); 
     178                        t = ktime_add_safe(ktime_get(), t); 
    179179                tp = &t; 
    180180        } 
  • src/linux/magicbox/linux-2.6.23/kernel/hrtimer.c

    r8642 r9155  
    301301} 
    302302#endif /* BITS_PER_LONG >= 64 */ 
     303 
     304/* 
     305 * Add two ktime values and do a safety check for overflow: 
     306 */ 
     307 
     308ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs) 
     309{ 
     310        ktime_t res = ktime_add(lhs, rhs); 
     311 
     312        /* 
     313         * We use KTIME_SEC_MAX here, the maximum timeout which we can 
     314         * return to user space in a timespec: 
     315         */ 
     316        if (res.tv64 < 0 || res.tv64 < lhs.tv64 || res.tv64 < rhs.tv64) 
     317                res = ktime_set(KTIME_SEC_MAX, 0); 
     318 
     319        return res; 
     320} 
    303321 
    304322/* High resolution timer related functions */ 
     
    659677                orun++; 
    660678        } 
    661         timer->expires = ktime_add(timer->expires, interval); 
    662         /* 
    663          * Make sure, that the result did not wrap with a very large 
    664          * interval. 
    665          */ 
    666         if (timer->expires.tv64 < 0) 
    667                 timer->expires = ktime_set(KTIME_SEC_MAX, 0); 
     679        timer->expires = ktime_add_safe(timer->expires, interval); 
    668680 
    669681        return orun; 
     
    816828 
    817829        if (mode == HRTIMER_MODE_REL) { 
    818                 tim = ktime_add(tim, new_base->get_time()); 
     830                tim = ktime_add_safe(tim, new_base->get_time()); 
    819831                /* 
    820832                 * CONFIG_TIME_LOW_RES is a temporary way for architectures 
     
    825837                 */ 
    826838#ifdef CONFIG_TIME_LOW_RES 
    827                 tim = ktime_add(tim, base->resolution); 
     839                tim = ktime_add_safe(tim, base->resolution); 
    828840#endif 
    829                 /* 
    830                  * Careful here: User space might have asked for a 
    831                  * very long sleep, so the add above might result in a 
    832                  * negative number, which enqueues the timer in front 
    833                  * of the queue. 
    834                  */ 
    835                 if (tim.tv64 < 0) 
    836                         tim.tv64 = KTIME_MAX; 
    837841        } 
    838842        timer->expires = tim; 
  • src/linux/magicbox/linux-2.6.23/kernel/irq/chip.c

    r8205 r9155  
    247247 
    248248/* 
     249 * default shutdown function 
     250 */ 
     251static void default_shutdown(unsigned int irq) 
     252{ 
     253        struct irq_desc *desc = irq_desc + irq; 
     254 
     255        desc->chip->mask(irq); 
     256        desc->status |= IRQ_MASKED; 
     257} 
     258 
     259/* 
    249260 * Fixup enable/disable function pointers 
    250261 */ 
     
    257268        if (!chip->startup) 
    258269                chip->startup = default_startup; 
     270        /* 
     271         * We use chip->disable, when the user provided its own. When 
     272         * we have default_disable set for chip->disable, then we need 
     273         * to use default_shutdown, otherwise the irq line is not 
     274         * disabled on free_irq(): 
     275         */ 
    259276        if (!chip->shutdown) 
    260                 chip->shutdown = chip->disable; 
     277                chip->shutdown = chip->disable != default_disable ? 
     278                        chip->disable : default_shutdown; 
    261279        if (!chip->name) 
    262280                chip->name = chip->typename; 
  • src/linux/magicbox/linux-2.6.23/kernel/posix-timers.c

    r8205 r9155  
    766766        if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) { 
    767767                /* Setup correct expiry time for relative timers */ 
    768                 if (mode == HRTIMER_MODE_REL) 
    769                         timer->expires = ktime_add(timer->expires, 
    770                                                    timer->base->get_time()); 
     768                if (mode == HRTIMER_MODE_REL) { 
     769                        timer->expires = 
     770                                ktime_add_safe(timer->expires, 
     771                                               timer->base->get_time()); 
     772                } 
    771773                return 0; 
    772774        } 
  • src/linux/magicbox/linux-2.6.23/mm/memory.c

    r8205 r9155  
    982982        unsigned int vm_flags; 
    983983 
     984        if (len <= 0) 
     985                return 0; 
    984986        /*  
    985987         * Require read or write permissions. 
  • src/linux/magicbox/linux-2.6.23/net/netfilter/nf_conntrack_proto_tcp.c

    r8424 r9155  
    136136 * LAST_ACK:    FIN seen (after FIN) 
    137137 * TIME_WAIT:   last ACK seen 
    138  * CLOSE:       closed connection 
     138 * CLOSE:       closed connection (RST) 
    139139 * 
    140140 * LISTEN state is not used. 
     
    835835                if (old_state < TCP_CONNTRACK_TIME_WAIT) 
    836836                        break; 
    837                 if ((conntrack->proto.tcp.seen[!dir].flags & 
    838                         IP_CT_TCP_FLAG_CLOSE_INIT) 
     837                /* RFC 1122: "When a connection is closed actively, 
     838                 * it MUST linger in TIME-WAIT state for a time 2xMSL 
     839                 * (Maximum Segment Lifetime). However, it MAY accept 
     840                 * a new SYN from the remote TCP to reopen the connection 
     841                 * directly from TIME-WAIT state, if..." 
     842                 * We ignore the conditions because we are in the 
     843                 * TIME-WAIT state anyway. 
     844                 * 
     845                 * Handle aborted connections: we and the server 
     846                 * think there is an existing connection but the client 
     847                 * aborts it and starts a new one. 
     848                 */ 
     849                if (((conntrack->proto.tcp.seen[dir].flags 
     850                      | conntrack->proto.tcp.seen[!dir].flags) 
     851                     & IP_CT_TCP_FLAG_CLOSE_INIT) 
    839852                    || (conntrack->proto.tcp.last_dir == dir 
    840853                        && conntrack->proto.tcp.last_index == TCP_RST_SET)) { 
     
    851864                /* Ignored packets: 
    852865                 * 
     866                 * Our connection entry may be out of sync, so ignore 
     867                 * packets which may signal the real connection between 
     868                 * the client and the server. 
     869                 * 
    853870                 * a) SYN in ORIGINAL 
    854871                 * b) SYN/ACK in REPLY 
    855872                 * c) ACK in reply direction after initial SYN in original. 
     873                 * 
     874                 * If the ignored packet is invalid, the receiver will send 
     875                 * a RST we'll catch below. 
    856876                 */ 
    857877                if (index == TCP_SYNACK_SET 
     
    860880                    && ntohl(th->ack_seq) == 
    861881                             conntrack->proto.tcp.last_end) { 
    862                         /* This SYN/ACK acknowledges a SYN that we earlier 
     882                        /* b) This SYN/ACK acknowledges a SYN that we earlier 
    863883                         * ignored as invalid. This means that the client and 
    864884                         * the server are both in sync, while the firewall is 
     
    885905                if (LOG_INVALID(IPPROTO_TCP)) 
    886906                        nf_log_packet(pf, 0, skb, NULL, NULL, NULL, 
    887                                   "nf_ct_tcp: invalid packed ignored "); 
     907                                  "nf_ct_tcp: invalid packet ignored "); 
    888908                return NF_ACCEPT; 
    889909        case TCP_CONNTRACK_MAX: 
     
    939959        conntrack->proto.tcp.state = new_state; 
    940960        if (old_state != new_state 
    941             && (new_state == TCP_CONNTRACK_FIN_WAIT 
    942                 || new_state == TCP_CONNTRACK_CLOSE)) 
     961            && new_state == TCP_CONNTRACK_FIN_WAIT) 
    943962                conntrack->proto.tcp.seen[dir].flags |= IP_CT_TCP_FLAG_CLOSE_INIT; 
    944963        timeout = conntrack->proto.tcp.retrans >= nf_ct_tcp_max_retrans 
Note: See TracChangeset for help on using the changeset viewer.