Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha

Pull alpha updates from Matt Turner:
"A few changes for alpha. They're mostly small janitorial fixes but
there's also a build fix and most notably a patch from Mikulas that
fixes a hang on boot on the Avanti platform, which required quite a
bit of work and review"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha:
alpha: Fix build around srm_sysrq_reboot_op
alpha: c_next should increase position index
alpha: Replace sg++ with sg = sg_next(sg)
alpha: fix memory barriers so that they conform to the specification
alpha: remove unneeded semicolon in sys_eiger.c
alpha: remove unneeded semicolon in osf_sys.c
alpha: Replace strncmp with str_has_prefix
alpha: fix rtc port ranges
alpha: Kconfig: pedantic formatting

+121 -30
+2 -2
arch/alpha/Kconfig
··· 545 545 default "4" if !ALPHA_GENERIC && !ALPHA_MARVEL 546 546 help 547 547 MARVEL support can handle a maximum of 32 CPUs, all the others 548 - with working support have a maximum of 4 CPUs. 548 + with working support have a maximum of 4 CPUs. 549 549 550 550 config ARCH_DISCONTIGMEM_ENABLE 551 551 bool "Discontiguous Memory Support" ··· 657 657 endchoice 658 658 659 659 config HZ 660 - int 660 + int 661 661 default 32 if HZ_32 662 662 default 64 if HZ_64 663 663 default 128 if HZ_128
+1 -1
arch/alpha/boot/tools/objstrip.c
··· 148 148 #ifdef __ELF__ 149 149 elf = (struct elfhdr *) buf; 150 150 151 - if (elf->e_ident[0] == 0x7f && strncmp((char *)elf->e_ident + 1, "ELF", 3) == 0) { 151 + if (elf->e_ident[0] == 0x7f && str_has_prefix((char *)elf->e_ident + 1, "ELF")) { 152 152 if (elf->e_type != ET_EXEC) { 153 153 fprintf(stderr, "%s: %s is not an ELF executable\n", 154 154 prog_name, inname);
+59 -15
arch/alpha/include/asm/io.h
··· 309 309 #if IO_CONCAT(__IO_PREFIX,trivial_io_bw) 310 310 extern inline unsigned int ioread8(void __iomem *addr) 311 311 { 312 - unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread8)(addr); 312 + unsigned int ret; 313 + mb(); 314 + ret = IO_CONCAT(__IO_PREFIX,ioread8)(addr); 313 315 mb(); 314 316 return ret; 315 317 } 316 318 317 319 extern inline unsigned int ioread16(void __iomem *addr) 318 320 { 319 - unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread16)(addr); 321 + unsigned int ret; 322 + mb(); 323 + ret = IO_CONCAT(__IO_PREFIX,ioread16)(addr); 320 324 mb(); 321 325 return ret; 322 326 } ··· 361 357 #if IO_CONCAT(__IO_PREFIX,trivial_io_lq) 362 358 extern inline unsigned int ioread32(void __iomem *addr) 363 359 { 364 - unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread32)(addr); 360 + unsigned int ret; 361 + mb(); 362 + ret = IO_CONCAT(__IO_PREFIX,ioread32)(addr); 365 363 mb(); 366 364 return ret; 367 365 } ··· 408 402 409 403 extern inline u8 readb(const volatile void __iomem *addr) 410 404 { 411 - u8 ret = __raw_readb(addr); 405 + u8 ret; 406 + mb(); 407 + ret = __raw_readb(addr); 412 408 mb(); 413 409 return ret; 414 410 } 415 411 416 412 extern inline u16 readw(const volatile void __iomem *addr) 417 413 { 418 - u16 ret = __raw_readw(addr); 414 + u16 ret; 415 + mb(); 416 + ret = __raw_readw(addr); 419 417 mb(); 420 418 return ret; 421 419 } ··· 460 450 461 451 extern inline u32 readl(const volatile void __iomem *addr) 462 452 { 463 - u32 ret = __raw_readl(addr); 453 + u32 ret; 454 + mb(); 455 + ret = __raw_readl(addr); 464 456 mb(); 465 457 return ret; 466 458 } 467 459 468 460 extern inline u64 readq(const volatile void __iomem *addr) 469 461 { 470 - u64 ret = __raw_readq(addr); 462 + u64 ret; 463 + mb(); 464 + ret = __raw_readq(addr); 471 465 mb(); 472 466 return ret; 473 467 } ··· 500 486 #define outb_p outb 501 487 #define outw_p outw 502 488 #define outl_p outl 503 - #define readb_relaxed(addr) __raw_readb(addr) 504 - #define readw_relaxed(addr) __raw_readw(addr) 505 - #define readl_relaxed(addr) __raw_readl(addr) 506 - #define readq_relaxed(addr) __raw_readq(addr) 507 - #define writeb_relaxed(b, addr) __raw_writeb(b, addr) 508 - #define writew_relaxed(b, addr) __raw_writew(b, addr) 509 - #define writel_relaxed(b, addr) __raw_writel(b, addr) 510 - #define writeq_relaxed(b, addr) __raw_writeq(b, addr) 489 + 490 + extern u8 readb_relaxed(const volatile void __iomem *addr); 491 + extern u16 readw_relaxed(const volatile void __iomem *addr); 492 + extern u32 readl_relaxed(const volatile void __iomem *addr); 493 + extern u64 readq_relaxed(const volatile void __iomem *addr); 494 + 495 + #if IO_CONCAT(__IO_PREFIX,trivial_io_bw) 496 + extern inline u8 readb_relaxed(const volatile void __iomem *addr) 497 + { 498 + mb(); 499 + return __raw_readb(addr); 500 + } 501 + 502 + extern inline u16 readw_relaxed(const volatile void __iomem *addr) 503 + { 504 + mb(); 505 + return __raw_readw(addr); 506 + } 507 + #endif 508 + 509 + #if IO_CONCAT(__IO_PREFIX,trivial_io_lq) 510 + extern inline u32 readl_relaxed(const volatile void __iomem *addr) 511 + { 512 + mb(); 513 + return __raw_readl(addr); 514 + } 515 + 516 + extern inline u64 readq_relaxed(const volatile void __iomem *addr) 517 + { 518 + mb(); 519 + return __raw_readq(addr); 520 + } 521 + #endif 522 + 523 + #define writeb_relaxed writeb 524 + #define writew_relaxed writew 525 + #define writel_relaxed writel 526 + #define writeq_relaxed writeq 511 527 512 528 /* 513 529 * String version of IO memory access ops:
+53 -7
arch/alpha/kernel/io.c
··· 16 16 unsigned int 17 17 ioread8(void __iomem *addr) 18 18 { 19 - unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread8)(addr); 19 + unsigned int ret; 20 + mb(); 21 + ret = IO_CONCAT(__IO_PREFIX,ioread8)(addr); 20 22 mb(); 21 23 return ret; 22 24 } 23 25 24 26 unsigned int ioread16(void __iomem *addr) 25 27 { 26 - unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread16)(addr); 28 + unsigned int ret; 29 + mb(); 30 + ret = IO_CONCAT(__IO_PREFIX,ioread16)(addr); 27 31 mb(); 28 32 return ret; 29 33 } 30 34 31 35 unsigned int ioread32(void __iomem *addr) 32 36 { 33 - unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread32)(addr); 37 + unsigned int ret; 38 + mb(); 39 + ret = IO_CONCAT(__IO_PREFIX,ioread32)(addr); 34 40 mb(); 35 41 return ret; 36 42 } ··· 154 148 155 149 u8 readb(const volatile void __iomem *addr) 156 150 { 157 - u8 ret = __raw_readb(addr); 151 + u8 ret; 152 + mb(); 153 + ret = __raw_readb(addr); 158 154 mb(); 159 155 return ret; 160 156 } 161 157 162 158 u16 readw(const volatile void __iomem *addr) 163 159 { 164 - u16 ret = __raw_readw(addr); 160 + u16 ret; 161 + mb(); 162 + ret = __raw_readw(addr); 165 163 mb(); 166 164 return ret; 167 165 } 168 166 169 167 u32 readl(const volatile void __iomem *addr) 170 168 { 171 - u32 ret = __raw_readl(addr); 169 + u32 ret; 170 + mb(); 171 + ret = __raw_readl(addr); 172 172 mb(); 173 173 return ret; 174 174 } 175 175 176 176 u64 readq(const volatile void __iomem *addr) 177 177 { 178 - u64 ret = __raw_readq(addr); 178 + u64 ret; 179 + mb(); 180 + ret = __raw_readq(addr); 179 181 mb(); 180 182 return ret; 181 183 } ··· 221 207 EXPORT_SYMBOL(writel); 222 208 EXPORT_SYMBOL(writeq); 223 209 210 + /* 211 + * The _relaxed functions must be ordered w.r.t. each other, but they don't 212 + * have to be ordered w.r.t. other memory accesses. 213 + */ 214 + u8 readb_relaxed(const volatile void __iomem *addr) 215 + { 216 + mb(); 217 + return __raw_readb(addr); 218 + } 219 + 220 + u16 readw_relaxed(const volatile void __iomem *addr) 221 + { 222 + mb(); 223 + return __raw_readw(addr); 224 + } 225 + 226 + u32 readl_relaxed(const volatile void __iomem *addr) 227 + { 228 + mb(); 229 + return __raw_readl(addr); 230 + } 231 + 232 + u64 readq_relaxed(const volatile void __iomem *addr) 233 + { 234 + mb(); 235 + return __raw_readq(addr); 236 + } 237 + 238 + EXPORT_SYMBOL(readb_relaxed); 239 + EXPORT_SYMBOL(readw_relaxed); 240 + EXPORT_SYMBOL(readl_relaxed); 241 + EXPORT_SYMBOL(readq_relaxed); 224 242 225 243 /* 226 244 * Read COUNT 8-bit bytes from port PORT into memory starting at SRC.
+1 -1
arch/alpha/kernel/osf_sys.c
··· 677 677 default: 678 678 error = -EOPNOTSUPP; 679 679 break; 680 - }; 680 + } 681 681 return error; 682 682 } 683 683
+1 -1
arch/alpha/kernel/pci_iommu.c
··· 638 638 639 639 while (sg+1 < end && (int) sg[1].dma_address == -1) { 640 640 size += sg[1].length; 641 - sg++; 641 + sg = sg_next(sg); 642 642 } 643 643 644 644 npages = iommu_num_pages(paddr, size, PAGE_SIZE);
+3 -2
arch/alpha/kernel/setup.c
··· 253 253 254 254 /* Fix up for the Jensen's queer RTC placement. */ 255 255 standard_io_resources[0].start = RTC_PORT(0); 256 - standard_io_resources[0].end = RTC_PORT(0) + 0x10; 256 + standard_io_resources[0].end = RTC_PORT(0) + 0x0f; 257 257 258 258 for (i = 0; i < ARRAY_SIZE(standard_io_resources); ++i) 259 259 request_resource(io, standard_io_resources+i); ··· 479 479 #ifndef alpha_using_srm 480 480 /* Assume that we've booted from SRM if we haven't booted from MILO. 481 481 Detect the later by looking for "MILO" in the system serial nr. */ 482 - alpha_using_srm = strncmp((const char *)hwrpb->ssn, "MILO", 4) != 0; 482 + alpha_using_srm = !str_has_prefix((const char *)hwrpb->ssn, "MILO"); 483 483 #endif 484 484 #ifndef alpha_using_qemu 485 485 /* Similarly, look for QEMU. */ ··· 1425 1425 static void * 1426 1426 c_next(struct seq_file *f, void *v, loff_t *pos) 1427 1427 { 1428 + (*pos)++; 1428 1429 return NULL; 1429 1430 } 1430 1431
+1 -1
arch/alpha/kernel/sys_eiger.c
··· 175 175 case 0x03: bridge_count = 2; break; /* 2 */ 176 176 case 0x07: bridge_count = 3; break; /* 3 */ 177 177 case 0x0f: bridge_count = 4; break; /* 4 */ 178 - }; 178 + } 179 179 180 180 slot = PCI_SLOT(dev->devfn); 181 181 while (dev->bus->self) {