Changeset 9155
- Timestamp:
- 02/29/08 03:37:50 (5 years ago)
- Location:
- src/linux/magicbox/linux-2.6.23
- Files:
-
- 16 edited
-
Makefile (modified) (1 diff)
-
arch/powerpc/platforms/powermac/feature.c (modified) (3 diffs)
-
arch/x86_64/mm/pageattr.c (modified) (1 diff)
-
drivers/macintosh/smu.c (modified) (5 diffs)
-
drivers/scsi/sd.c (modified) (2 diffs)
-
fs/nfs/write.c (modified) (2 diffs)
-
fs/splice.c (modified) (1 diff)
-
include/asm-powerpc/pmac_feature.h (modified) (1 diff)
-
include/linux/ktime.h (modified) (1 diff)
-
kernel/futex.c (modified) (1 diff)
-
kernel/futex_compat.c (modified) (1 diff)
-
kernel/hrtimer.c (modified) (4 diffs)
-
kernel/irq/chip.c (modified) (2 diffs)
-
kernel/posix-timers.c (modified) (1 diff)
-
mm/memory.c (modified) (1 diff)
-
net/netfilter/nf_conntrack_proto_tcp.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/linux/magicbox/linux-2.6.23/Makefile
r8974 r9155 2 2 PATCHLEVEL = 6 3 3 SUBLEVEL = 23 4 EXTRAVERSION = .1 54 EXTRAVERSION = .17 5 5 NAME = Arr Matey! A Hairy Bilge Rat! 6 6 -
src/linux/magicbox/linux-2.6.23/arch/powerpc/platforms/powermac/feature.c
r8205 r9155 2566 2566 /* Locate core99 Uni-N */ 2567 2567 uninorth_node = of_find_node_by_name(NULL, "uni-n"); 2568 uninorth_maj = 1; 2569 2568 2570 /* Locate G5 u3 */ 2569 2571 if (uninorth_node == NULL) { … … 2576 2578 uninorth_maj = 4; 2577 2579 } 2578 if (uninorth_node == NULL) 2580 if (uninorth_node == NULL) { 2581 uninorth_maj = 0; 2579 2582 return; 2583 } 2580 2584 2581 2585 addrp = of_get_property(uninorth_node, "reg", NULL); … … 3030 3034 } 3031 3035 EXPORT_SYMBOL(pmac_resume_agp_for_card); 3036 3037 int 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 208 208 unsigned long addr2; 209 209 pgprot_t prot2; 210 addr2 = __START_KERNEL_map + __pa(address) ;210 addr2 = __START_KERNEL_map + __pa(address) - phys_base; 211 211 /* Make sure the kernel mappings stay executable */ 212 212 prot2 = pte_pgprot(pte_mkexec(pfn_pte(0, prot))); -
src/linux/magicbox/linux-2.6.23/drivers/macintosh/smu.c
r8205 r9155 86 86 struct list_head cmd_list; 87 87 struct smu_cmd *cmd_cur; /* pending command */ 88 int broken_nap; 88 89 struct list_head cmd_i2c_list; 89 90 struct smu_i2c_cmd *cmd_i2c_cur; /* pending i2c command */ … … 135 136 fend = faddr + smu->cmd_buf->length + 2; 136 137 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; 137 151 138 152 /* This isn't exactly a DMA mapping here, I suspect … … 212 226 mb(); 213 227 cmd->status = rc; 228 229 /* Re-enable NAP mode */ 230 if (smu->broken_nap) 231 powersave_nap = 1; 214 232 bail: 215 233 /* Start next command if any */ … … 462 480 return -ENODEV; 463 481 464 printk(KERN_INFO "SMU driver %s %s\n", VERSION, AUTHOR);482 printk(KERN_INFO "SMU: Driver %s %s\n", VERSION, AUTHOR); 465 483 466 484 if (smu_cmdbuf_abs == 0) { … … 533 551 goto fail; 534 552 } 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"); 535 558 536 559 sys_ctrler = SYS_CTRLER_SMU; -
src/linux/magicbox/linux-2.6.23/drivers/scsi/sd.c
r8205 r9155 902 902 unsigned int good_bytes = result ? 0 : xfer_size; 903 903 u64 start_lba = SCpnt->request->sector; 904 u64 end_lba = SCpnt->request->sector + (xfer_size / 512); 904 905 u64 bad_lba; 905 906 struct scsi_sense_hdr sshdr; … … 940 941 if (xfer_size <= SCpnt->device->sector_size) 941 942 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 */ 944 945 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 */ 959 958 goto out; 960 break; 961 } 959 962 960 /* This computation should always be done in terms of 963 961 * the resolution of the device's medium. -
src/linux/magicbox/linux-2.6.23/fs/nfs/write.c
r8424 r9155 718 718 719 719 /* 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 */ 724 static 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 /* 720 731 * Update and possibly write a cached page of an NFS file. 721 732 * … … 738 749 739 750 /* 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. 742 754 */ 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)) { 744 758 count = max(count + offset, nfs_page_length(page)); 745 759 offset = 0; -
src/linux/magicbox/linux-2.6.23/fs/splice.c
r8974 r9155 1290 1290 break; 1291 1291 error = -EFAULT; 1292 if ( unlikely(!base))1292 if (!access_ok(VERIFY_READ, base, len)) 1293 1293 break; 1294 1294 -
src/linux/magicbox/linux-2.6.23/include/asm-powerpc/pmac_feature.h
r8205 r9155 393 393 #define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v))) 394 394 395 /* Uninorth variant: 396 * 397 * 0 = not uninorth 398 * 1 = U1.x or U2.x 399 * 3 = U3 400 * 4 = U4 401 */ 402 extern int pmac_get_uninorth_variant(void); 395 403 396 404 #endif /* __ASM_POWERPC_PMAC_FEATURE_H */ -
src/linux/magicbox/linux-2.6.23/include/linux/ktime.h
r8205 r9155 290 290 } 291 291 292 extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs); 293 292 294 /* 293 295 * The resolution of the clocks. The resolution value is returned in -
src/linux/magicbox/linux-2.6.23/kernel/futex.c
r8642 r9155 2064 2064 t = timespec_to_ktime(ts); 2065 2065 if (cmd == FUTEX_WAIT) 2066 t = ktime_add (ktime_get(), t);2066 t = ktime_add_safe(ktime_get(), t); 2067 2067 tp = &t; 2068 2068 } -
src/linux/magicbox/linux-2.6.23/kernel/futex_compat.c
r8424 r9155 176 176 t = timespec_to_ktime(ts); 177 177 if (cmd == FUTEX_WAIT) 178 t = ktime_add (ktime_get(), t);178 t = ktime_add_safe(ktime_get(), t); 179 179 tp = &t; 180 180 } -
src/linux/magicbox/linux-2.6.23/kernel/hrtimer.c
r8642 r9155 301 301 } 302 302 #endif /* BITS_PER_LONG >= 64 */ 303 304 /* 305 * Add two ktime values and do a safety check for overflow: 306 */ 307 308 ktime_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 } 303 321 304 322 /* High resolution timer related functions */ … … 659 677 orun++; 660 678 } 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); 668 680 669 681 return orun; … … 816 828 817 829 if (mode == HRTIMER_MODE_REL) { 818 tim = ktime_add (tim, new_base->get_time());830 tim = ktime_add_safe(tim, new_base->get_time()); 819 831 /* 820 832 * CONFIG_TIME_LOW_RES is a temporary way for architectures … … 825 837 */ 826 838 #ifdef CONFIG_TIME_LOW_RES 827 tim = ktime_add (tim, base->resolution);839 tim = ktime_add_safe(tim, base->resolution); 828 840 #endif 829 /*830 * Careful here: User space might have asked for a831 * very long sleep, so the add above might result in a832 * negative number, which enqueues the timer in front833 * of the queue.834 */835 if (tim.tv64 < 0)836 tim.tv64 = KTIME_MAX;837 841 } 838 842 timer->expires = tim; -
src/linux/magicbox/linux-2.6.23/kernel/irq/chip.c
r8205 r9155 247 247 248 248 /* 249 * default shutdown function 250 */ 251 static 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 /* 249 260 * Fixup enable/disable function pointers 250 261 */ … … 257 268 if (!chip->startup) 258 269 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 */ 259 276 if (!chip->shutdown) 260 chip->shutdown = chip->disable; 277 chip->shutdown = chip->disable != default_disable ? 278 chip->disable : default_shutdown; 261 279 if (!chip->name) 262 280 chip->name = chip->typename; -
src/linux/magicbox/linux-2.6.23/kernel/posix-timers.c
r8205 r9155 766 766 if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) { 767 767 /* 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 } 771 773 return 0; 772 774 } -
src/linux/magicbox/linux-2.6.23/mm/memory.c
r8205 r9155 982 982 unsigned int vm_flags; 983 983 984 if (len <= 0) 985 return 0; 984 986 /* 985 987 * Require read or write permissions. -
src/linux/magicbox/linux-2.6.23/net/netfilter/nf_conntrack_proto_tcp.c
r8424 r9155 136 136 * LAST_ACK: FIN seen (after FIN) 137 137 * TIME_WAIT: last ACK seen 138 * CLOSE: closed connection 138 * CLOSE: closed connection (RST) 139 139 * 140 140 * LISTEN state is not used. … … 835 835 if (old_state < TCP_CONNTRACK_TIME_WAIT) 836 836 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) 839 852 || (conntrack->proto.tcp.last_dir == dir 840 853 && conntrack->proto.tcp.last_index == TCP_RST_SET)) { … … 851 864 /* Ignored packets: 852 865 * 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 * 853 870 * a) SYN in ORIGINAL 854 871 * b) SYN/ACK in REPLY 855 872 * 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. 856 876 */ 857 877 if (index == TCP_SYNACK_SET … … 860 880 && ntohl(th->ack_seq) == 861 881 conntrack->proto.tcp.last_end) { 862 /* This SYN/ACK acknowledges a SYN that we earlier882 /* b) This SYN/ACK acknowledges a SYN that we earlier 863 883 * ignored as invalid. This means that the client and 864 884 * the server are both in sync, while the firewall is … … 885 905 if (LOG_INVALID(IPPROTO_TCP)) 886 906 nf_log_packet(pf, 0, skb, NULL, NULL, NULL, 887 "nf_ct_tcp: invalid packe dignored ");907 "nf_ct_tcp: invalid packet ignored "); 888 908 return NF_ACCEPT; 889 909 case TCP_CONNTRACK_MAX: … … 939 959 conntrack->proto.tcp.state = new_state; 940 960 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) 943 962 conntrack->proto.tcp.seen[dir].flags |= IP_CT_TCP_FLAG_CLOSE_INIT; 944 963 timeout = conntrack->proto.tcp.retrans >= nf_ct_tcp_max_retrans
Note: See TracChangeset
for help on using the changeset viewer.
