From de4ae09ffd36a22ff80e6587c46ee91b5609818e Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 3 Mar 2008 20:07:42 +0200 Subject: [PATCH] --- yaml --- r: 87008 b: refs/heads/master c: c31f2f3d066d49147ce297c7207cc2d49dd20382 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/scsi/ChangeLog.arcmsr | 6 - trunk/arch/blackfin/kernel/fixed_code.S | 12 +- trunk/arch/blackfin/mach-bf548/boards/ezkit.c | 4 +- trunk/arch/blackfin/mach-common/entry.S | 5 +- trunk/arch/ia64/hp/common/hwsw_iommu.c | 2 +- trunk/arch/ia64/hp/common/sba_iommu.c | 36 +- trunk/arch/ia64/hp/sim/simeth.c | 2 +- trunk/arch/ia64/hp/sim/simserial.c | 2 +- trunk/arch/ia64/ia32/sys_ia32.c | 7 +- trunk/arch/ia64/kernel/crash.c | 2 +- trunk/arch/ia64/kernel/efi.c | 32 +- trunk/arch/ia64/kernel/iosapic.c | 24 +- trunk/arch/ia64/kernel/irq_ia64.c | 8 +- trunk/arch/ia64/kernel/kprobes.c | 2 +- trunk/arch/ia64/kernel/mca.c | 73 ++-- trunk/arch/ia64/kernel/module.c | 22 +- trunk/arch/ia64/kernel/perfmon.c | 4 +- trunk/arch/ia64/kernel/perfmon_default_smpl.c | 4 +- trunk/arch/ia64/kernel/ptrace.c | 327 ++++++++++++++---- trunk/arch/ia64/kernel/setup.c | 8 +- trunk/arch/ia64/kernel/unaligned.c | 6 +- trunk/arch/ia64/kernel/unwind.c | 102 +++--- trunk/arch/ia64/mm/fault.c | 2 +- trunk/arch/ia64/mm/init.c | 2 +- trunk/arch/ia64/pci/fixup.c | 2 +- trunk/arch/ia64/pci/pci.c | 4 +- trunk/arch/ia64/sn/kernel/huberror.c | 4 +- trunk/arch/ia64/sn/kernel/io_acpi_init.c | 36 +- trunk/arch/ia64/sn/kernel/io_common.c | 2 +- trunk/arch/ia64/sn/kernel/io_init.c | 4 +- trunk/arch/ia64/sn/kernel/mca.c | 2 +- trunk/arch/ia64/sn/pci/pci_dma.c | 6 +- trunk/arch/ia64/sn/pci/tioca_provider.c | 12 +- trunk/arch/ia64/sn/pci/tioce_provider.c | 4 +- trunk/arch/s390/Kconfig | 4 - trunk/arch/s390/defconfig | 18 +- trunk/arch/s390/kernel/Makefile | 5 - trunk/arch/s390/kernel/early.c | 8 +- trunk/arch/s390/kernel/ipl.c | 1 - trunk/arch/s390/kernel/process.c | 4 - trunk/arch/s390/kernel/smp.c | 10 +- trunk/arch/s390/kernel/time.c | 2 + trunk/arch/sh/mm/pg-sh7705.c | 1 + .../x86/kernel/cpu/cpufreq/e_powersaver.c | 8 +- trunk/crypto/Kconfig | 1 - trunk/crypto/Makefile | 4 +- trunk/crypto/ablkcipher.c | 3 + trunk/crypto/blkcipher.c | 29 -- trunk/crypto/chainiv.c | 12 +- trunk/crypto/digest.c | 2 - trunk/crypto/eseqiv.c | 12 +- trunk/crypto/xcbc.c | 6 +- trunk/crypto/xts.c | 13 +- trunk/drivers/ata/ahci.c | 14 +- trunk/drivers/ata/pata_hpt366.c | 6 +- trunk/drivers/ata/pata_hpt37x.c | 6 +- trunk/drivers/ata/pata_serverworks.c | 2 +- trunk/drivers/cpufreq/cpufreq.c | 20 +- trunk/drivers/cpufreq/cpufreq_stats.c | 2 +- trunk/drivers/message/fusion/mptsas.c | 5 - trunk/drivers/mtd/ubi/build.c | 4 +- trunk/drivers/mtd/ubi/ubi.h | 10 +- trunk/drivers/mtd/ubi/vmt.c | 4 +- trunk/drivers/mtd/ubi/vtbl.c | 1 - trunk/drivers/parisc/ccio-dma.c | 4 +- trunk/drivers/parisc/sba_iommu.c | 4 +- trunk/drivers/s390/block/dasd_3990_erp.c | 6 +- trunk/drivers/s390/block/dasd_proc.c | 4 +- trunk/drivers/s390/char/sclp_vt220.c | 2 +- trunk/drivers/s390/crypto/ap_bus.c | 12 +- trunk/drivers/scsi/aic94xx/aic94xx.h | 1 - trunk/drivers/scsi/aic94xx/aic94xx_hwi.h | 3 +- trunk/drivers/scsi/aic94xx/aic94xx_init.c | 2 +- trunk/drivers/scsi/aic94xx/aic94xx_task.c | 4 +- trunk/drivers/scsi/aic94xx/aic94xx_tmf.c | 304 ++++++---------- trunk/drivers/scsi/arcmsr/arcmsr.h | 2 +- trunk/drivers/scsi/gdth.c | 112 +++--- trunk/drivers/scsi/gdth.h | 1 - trunk/drivers/scsi/ibmvscsi/ibmvstgt.c | 9 +- trunk/drivers/scsi/libiscsi.c | 4 +- trunk/drivers/scsi/libsas/sas_ata.c | 39 ++- trunk/drivers/scsi/libsas/sas_port.c | 11 +- trunk/drivers/scsi/libsas/sas_scsi_host.c | 34 +- trunk/drivers/scsi/mvsas.c | 11 +- trunk/drivers/scsi/ps3rom.c | 4 +- trunk/drivers/scsi/qla2xxx/qla_gs.c | 10 +- trunk/drivers/scsi/qla2xxx/qla_init.c | 11 +- trunk/drivers/scsi/qla2xxx/qla_isr.c | 5 - trunk/drivers/scsi/qla2xxx/qla_mbx.c | 2 +- trunk/drivers/scsi/qla2xxx/qla_version.h | 2 +- trunk/drivers/scsi/qla4xxx/ql4_init.c | 2 +- trunk/drivers/scsi/qla4xxx/ql4_os.c | 39 +-- trunk/drivers/scsi/scsi_tgt_lib.c | 6 +- trunk/drivers/scsi/scsi_transport_iscsi.c | 78 ++--- trunk/fs/nfs/internal.h | 3 - trunk/fs/nfs/super.c | 64 +--- trunk/fs/super.c | 4 +- trunk/fs/xfs/xfs_iget.c | 1 - trunk/fs/xfs/xfs_trans_ail.c | 17 +- trunk/include/asm-blackfin/mmu_context.h | 2 +- trunk/include/asm-blackfin/unistd.h | 6 +- trunk/include/asm-ia64/kprobes.h | 2 +- trunk/include/asm-ia64/ptrace.h | 9 +- trunk/include/asm-mn10300/Kbuild | 4 + trunk/include/asm-x86/Kbuild | 1 + trunk/include/crypto/internal/skcipher.h | 6 - trunk/include/linux/security.h | 99 ++---- trunk/include/scsi/libsas.h | 1 - trunk/include/scsi/scsi_transport_iscsi.h | 2 - trunk/kernel/cpuset.c | 4 +- trunk/security/dummy.c | 23 +- trunk/security/security.c | 23 +- trunk/security/selinux/hooks.c | 175 +++++----- trunk/security/selinux/include/security.h | 5 - trunk/security/smack/smack_lsm.c | 9 +- 116 files changed, 1044 insertions(+), 1133 deletions(-) diff --git a/[refs] b/[refs] index d0b31e9d0781..c6e4a73b06d1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 46fbdf8935544dcde440bd807b50e52ed2ca7f3b +refs/heads/master: c31f2f3d066d49147ce297c7207cc2d49dd20382 diff --git a/trunk/Documentation/scsi/ChangeLog.arcmsr b/trunk/Documentation/scsi/ChangeLog.arcmsr index 038a3e6ecaa4..de2bcacfa870 100644 --- a/trunk/Documentation/scsi/ChangeLog.arcmsr +++ b/trunk/Documentation/scsi/ChangeLog.arcmsr @@ -109,10 +109,4 @@ ** 8.replace pci_alloc_consistent()/pci_free_consistent() with kmalloc()/kfree() in arcmsr_iop_message_xfer() ** 9. fix the release of dma memory for type B in arcmsr_free_ccb_pool() ** 10.fix the arcmsr_polling_hbb_ccbdone() -** 1.20.00.15 02/27/2008 Erich Chen & Nick Cheng -** 1.arcmsr_iop_message_xfer() is called from atomic context under the -** queuecommand scsi_host_template handler. James Bottomley pointed out -** that the current GFP_KERNEL|GFP_DMA flags are wrong: firstly we are in -** atomic context, secondly this memory is not used for DMA. -** Also removed some unneeded casts. Thanks to Daniel Drake ************************************************************************** diff --git a/trunk/arch/blackfin/kernel/fixed_code.S b/trunk/arch/blackfin/kernel/fixed_code.S index 5ed47228a390..90262691b11a 100644 --- a/trunk/arch/blackfin/kernel/fixed_code.S +++ b/trunk/arch/blackfin/kernel/fixed_code.S @@ -101,9 +101,9 @@ ENDPROC (_atomic_ior32) .align 16 /* - * Atomic and, 32 bit. + * Atomic ior, 32 bit. * Inputs: P0: memory address to use - * R0: value to and + * R0: value to ior * Outputs: R0: new contents of the memory address. * R1: previous contents of the memory address. */ @@ -112,13 +112,13 @@ ENTRY(_atomic_and32) R0 = R1 & R0; [P0] = R0; rts; -ENDPROC (_atomic_and32) +ENDPROC (_atomic_ior32) .align 16 /* - * Atomic xor, 32 bit. + * Atomic ior, 32 bit. * Inputs: P0: memory address to use - * R0: value to xor + * R0: value to ior * Outputs: R0: new contents of the memory address. * R1: previous contents of the memory address. */ @@ -127,7 +127,7 @@ ENTRY(_atomic_xor32) R0 = R1 ^ R0; [P0] = R0; rts; -ENDPROC (_atomic_xor32) +ENDPROC (_atomic_ior32) .align 16 /* diff --git a/trunk/arch/blackfin/mach-bf548/boards/ezkit.c b/trunk/arch/blackfin/mach-bf548/boards/ezkit.c index 40846aa034c4..a0950c1fd800 100644 --- a/trunk/arch/blackfin/mach-bf548/boards/ezkit.c +++ b/trunk/arch/blackfin/mach-bf548/boards/ezkit.c @@ -323,7 +323,7 @@ static struct platform_device bf5xx_nand_device = { }; #endif -#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) +#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN) static struct platform_device bf54x_sdh_device = { .name = "bfin-sdh", .id = 0, @@ -636,7 +636,7 @@ static struct platform_device *ezkit_devices[] __initdata = { &bf5xx_nand_device, #endif -#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) +#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN) &bf54x_sdh_device, #endif diff --git a/trunk/arch/blackfin/mach-common/entry.S b/trunk/arch/blackfin/mach-common/entry.S index cee54cebbc65..2cbb7a0bc38e 100644 --- a/trunk/arch/blackfin/mach-common/entry.S +++ b/trunk/arch/blackfin/mach-common/entry.S @@ -1369,7 +1369,7 @@ ENTRY(_sys_call_table) .long _sys_epoll_pwait .long _sys_utimensat .long _sys_signalfd - .long _sys_timerfd_create + .long _sys_ni_syscall .long _sys_eventfd /* 350 */ .long _sys_pread64 .long _sys_pwrite64 @@ -1378,9 +1378,6 @@ ENTRY(_sys_call_table) .long _sys_get_robust_list /* 355 */ .long _sys_fallocate .long _sys_semtimedop - .long _sys_timerfd_settime - .long _sys_timerfd_gettime - .rept NR_syscalls-(.-_sys_call_table)/4 .long _sys_ni_syscall .endr diff --git a/trunk/arch/ia64/hp/common/hwsw_iommu.c b/trunk/arch/ia64/hp/common/hwsw_iommu.c index 8f6bcfe1dada..94e57109fad6 100644 --- a/trunk/arch/ia64/hp/common/hwsw_iommu.c +++ b/trunk/arch/ia64/hp/common/hwsw_iommu.c @@ -71,7 +71,7 @@ hwsw_init (void) #ifdef CONFIG_IA64_GENERIC /* Better to have normal DMA than panic */ printk(KERN_WARNING "%s: Failed to initialize software I/O TLB," - " reverting to hpzx1 platform vector\n", __func__); + " reverting to hpzx1 platform vector\n", __FUNCTION__); machvec_init("hpzx1"); #else panic("Unable to initialize software I/O TLB services"); diff --git a/trunk/arch/ia64/hp/common/sba_iommu.c b/trunk/arch/ia64/hp/common/sba_iommu.c index 523eae6d3e49..a94445422cc6 100644 --- a/trunk/arch/ia64/hp/common/sba_iommu.c +++ b/trunk/arch/ia64/hp/common/sba_iommu.c @@ -529,7 +529,7 @@ sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted, int use_hint) base_mask = RESMAP_MASK(bits_wanted); mask = base_mask << bitshiftcnt; - DBG_RES("%s() o %ld %p", __func__, o, res_ptr); + DBG_RES("%s() o %ld %p", __FUNCTION__, o, res_ptr); for(; res_ptr < res_end ; res_ptr++) { DBG_RES(" %p %lx %lx\n", res_ptr, mask, *res_ptr); @@ -679,7 +679,7 @@ sba_alloc_range(struct ioc *ioc, size_t size) #endif DBG_RES("%s(%x) %d -> %lx hint %x/%x\n", - __func__, size, pages_needed, pide, + __FUNCTION__, size, pages_needed, pide, (uint) ((unsigned long) ioc->res_hint - (unsigned long) ioc->res_map), ioc->res_bitshift ); @@ -722,8 +722,8 @@ sba_free_range(struct ioc *ioc, dma_addr_t iova, size_t size) m = RESMAP_MASK(bits_not_wanted) << (pide & (BITS_PER_LONG - 1)); bits_not_wanted = 0; - DBG_RES("%s( ,%x,%x) %x/%lx %x %p %lx\n", __func__, (uint) iova, size, - bits_not_wanted, m, pide, res_ptr, *res_ptr); + DBG_RES("%s( ,%x,%x) %x/%lx %x %p %lx\n", __FUNCTION__, (uint) iova, size, + bits_not_wanted, m, pide, res_ptr, *res_ptr); ASSERT(m != 0); ASSERT(bits_not_wanted); @@ -940,7 +940,8 @@ sba_map_single(struct device *dev, void *addr, size_t size, int dir) iovp = (dma_addr_t) pide << iovp_shift; - DBG_RUN("%s() 0x%p -> 0x%lx\n", __func__, addr, (long) iovp | offset); + DBG_RUN("%s() 0x%p -> 0x%lx\n", + __FUNCTION__, addr, (long) iovp | offset); pdir_start = &(ioc->pdir_base[pide]); @@ -1028,7 +1029,8 @@ void sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size, int dir) #endif offset = iova & ~iovp_mask; - DBG_RUN("%s() iovp 0x%lx/%x\n", __func__, (long) iova, size); + DBG_RUN("%s() iovp 0x%lx/%x\n", + __FUNCTION__, (long) iova, size); iova ^= offset; /* clear offset bits */ size += offset; @@ -1402,7 +1404,7 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di struct scatterlist *sg; #endif - DBG_RUN_SG("%s() START %d entries\n", __func__, nents); + DBG_RUN_SG("%s() START %d entries\n", __FUNCTION__, nents); ioc = GET_IOC(dev); ASSERT(ioc); @@ -1466,7 +1468,7 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di #endif ASSERT(coalesced == filled); - DBG_RUN_SG("%s() DONE %d mappings\n", __func__, filled); + DBG_RUN_SG("%s() DONE %d mappings\n", __FUNCTION__, filled); return filled; } @@ -1489,7 +1491,7 @@ void sba_unmap_sg (struct device *dev, struct scatterlist *sglist, int nents, in #endif DBG_RUN_SG("%s() START %d entries, %p,%x\n", - __func__, nents, sba_sg_address(sglist), sglist->length); + __FUNCTION__, nents, sba_sg_address(sglist), sglist->length); #ifdef ASSERT_PDIR_SANITY ioc = GET_IOC(dev); @@ -1507,7 +1509,7 @@ void sba_unmap_sg (struct device *dev, struct scatterlist *sglist, int nents, in nents--; } - DBG_RUN_SG("%s() DONE (nents %d)\n", __func__, nents); + DBG_RUN_SG("%s() DONE (nents %d)\n", __FUNCTION__, nents); #ifdef ASSERT_PDIR_SANITY spin_lock_irqsave(&ioc->res_lock, flags); @@ -1544,7 +1546,7 @@ ioc_iova_init(struct ioc *ioc) ioc->iov_size = ~ioc->imask + 1; DBG_INIT("%s() hpa %p IOV base 0x%lx mask 0x%lx (%dMB)\n", - __func__, ioc->ioc_hpa, ioc->ibase, ioc->imask, + __FUNCTION__, ioc->ioc_hpa, ioc->ibase, ioc->imask, ioc->iov_size >> 20); switch (iovp_size) { @@ -1567,7 +1569,7 @@ ioc_iova_init(struct ioc *ioc) memset(ioc->pdir_base, 0, ioc->pdir_size); - DBG_INIT("%s() IOV page size %ldK pdir %p size %x\n", __func__, + DBG_INIT("%s() IOV page size %ldK pdir %p size %x\n", __FUNCTION__, iovp_size >> 10, ioc->pdir_base, ioc->pdir_size); ASSERT(ALIGN((unsigned long) ioc->pdir_base, 4*1024) == (unsigned long) ioc->pdir_base); @@ -1610,7 +1612,7 @@ ioc_iova_init(struct ioc *ioc) prefetch_spill_page = virt_to_phys(addr); - DBG_INIT("%s() prefetch spill addr: 0x%lx\n", __func__, prefetch_spill_page); + DBG_INIT("%s() prefetch spill addr: 0x%lx\n", __FUNCTION__, prefetch_spill_page); } /* ** Set all the PDIR entries valid w/ the spill page as the target @@ -1639,7 +1641,7 @@ ioc_resource_init(struct ioc *ioc) /* resource map size dictated by pdir_size */ ioc->res_size = ioc->pdir_size / PDIR_ENTRY_SIZE; /* entries */ ioc->res_size >>= 3; /* convert bit count to byte count */ - DBG_INIT("%s() res_size 0x%x\n", __func__, ioc->res_size); + DBG_INIT("%s() res_size 0x%x\n", __FUNCTION__, ioc->res_size); ioc->res_map = (char *) __get_free_pages(GFP_KERNEL, get_order(ioc->res_size)); @@ -1662,7 +1664,7 @@ ioc_resource_init(struct ioc *ioc) | prefetch_spill_page); #endif - DBG_INIT("%s() res_map %x %p\n", __func__, + DBG_INIT("%s() res_map %x %p\n", __FUNCTION__, ioc->res_size, (void *) ioc->res_map); } @@ -1765,7 +1767,7 @@ ioc_init(u64 hpa, void *handle) iovp_size = (1 << iovp_shift); iovp_mask = ~(iovp_size - 1); - DBG_INIT("%s: PAGE_SIZE %ldK, iovp_size %ldK\n", __func__, + DBG_INIT("%s: PAGE_SIZE %ldK, iovp_size %ldK\n", __FUNCTION__, PAGE_SIZE >> 10, iovp_size >> 10); if (!ioc->name) { @@ -2135,7 +2137,7 @@ sba_page_override(char *str) break; default: printk("%s: unknown/unsupported iommu page size %ld\n", - __func__, page_size); + __FUNCTION__, page_size); } return 1; diff --git a/trunk/arch/ia64/hp/sim/simeth.c b/trunk/arch/ia64/hp/sim/simeth.c index 969fe9f443c4..9898febf609a 100644 --- a/trunk/arch/ia64/hp/sim/simeth.c +++ b/trunk/arch/ia64/hp/sim/simeth.c @@ -222,7 +222,7 @@ simeth_probe1(void) } if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0) - panic("%s: out of interrupt vectors!\n", __func__); + panic("%s: out of interrupt vectors!\n", __FUNCTION__); dev->irq = rc; /* diff --git a/trunk/arch/ia64/hp/sim/simserial.c b/trunk/arch/ia64/hp/sim/simserial.c index eb0c32a85fd7..ef252df50e1e 100644 --- a/trunk/arch/ia64/hp/sim/simserial.c +++ b/trunk/arch/ia64/hp/sim/simserial.c @@ -1000,7 +1000,7 @@ simrs_init (void) if (!state->irq) { if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0) panic("%s: out of interrupt vectors!\n", - __func__); + __FUNCTION__); state->irq = rc; ia64_ssc_connect_irq(KEYBOARD_INTR, state->irq); } diff --git a/trunk/arch/ia64/ia32/sys_ia32.c b/trunk/arch/ia64/ia32/sys_ia32.c index b1bf51fe97b4..d025a22eb225 100644 --- a/trunk/arch/ia64/ia32/sys_ia32.c +++ b/trunk/arch/ia64/ia32/sys_ia32.c @@ -32,8 +32,13 @@ #include #include #include -#include +#include #include +#include +#include +#include +#include +#include #include #include #include diff --git a/trunk/arch/ia64/kernel/crash.c b/trunk/arch/ia64/kernel/crash.c index fbe742ad2fde..f1cf2df97a2d 100644 --- a/trunk/arch/ia64/kernel/crash.c +++ b/trunk/arch/ia64/kernel/crash.c @@ -155,7 +155,7 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data) if (val == DIE_INIT_MONARCH_LEAVE) ia64_mca_printk(KERN_NOTICE "%s: kdump not configured\n", - __func__); + __FUNCTION__); return NOTIFY_DONE; } diff --git a/trunk/arch/ia64/kernel/efi.c b/trunk/arch/ia64/kernel/efi.c index 728d7247a1a6..919070a9aed7 100644 --- a/trunk/arch/ia64/kernel/efi.c +++ b/trunk/arch/ia64/kernel/efi.c @@ -379,8 +379,8 @@ efi_get_pal_addr (void) * a dedicated ITR for the PAL code. */ if ((vaddr & mask) == (KERNEL_START & mask)) { - printk(KERN_INFO "%s: no need to install ITR for PAL code\n", - __func__); + printk(KERN_INFO "%s: no need to install ITR for " + "PAL code\n", __FUNCTION__); continue; } @@ -399,7 +399,7 @@ efi_get_pal_addr (void) return __va(md->phys_addr); } printk(KERN_WARNING "%s: no PAL-code memory-descriptor found\n", - __func__); + __FUNCTION__); return NULL; } @@ -543,30 +543,12 @@ efi_init (void) for (i = 0, p = efi_map_start; p < efi_map_end; ++i, p += efi_desc_size) { - const char *unit; - unsigned long size; - md = p; - size = md->num_pages << EFI_PAGE_SHIFT; - - if ((size >> 40) > 0) { - size >>= 40; - unit = "TB"; - } else if ((size >> 30) > 0) { - size >>= 30; - unit = "GB"; - } else if ((size >> 20) > 0) { - size >>= 20; - unit = "MB"; - } else { - size >>= 10; - unit = "KB"; - } - - printk("mem%02d: type=%2u, attr=0x%016lx, " - "range=[0x%016lx-0x%016lx) (%4lu%s)\n", + printk("mem%02u: type=%u, attr=0x%lx, " + "range=[0x%016lx-0x%016lx) (%luMB)\n", i, md->type, md->attribute, md->phys_addr, - md->phys_addr + efi_md_size(md), size, unit); + md->phys_addr + efi_md_size(md), + md->num_pages >> (20 - EFI_PAGE_SHIFT)); } } #endif diff --git a/trunk/arch/ia64/kernel/iosapic.c b/trunk/arch/ia64/kernel/iosapic.c index 082c31dcfd99..7b3292282dea 100644 --- a/trunk/arch/ia64/kernel/iosapic.c +++ b/trunk/arch/ia64/kernel/iosapic.c @@ -534,7 +534,7 @@ iosapic_reassign_vector (int irq) if (iosapic_intr_info[irq].count) { new_irq = create_irq(); if (new_irq < 0) - panic("%s: out of interrupt vectors!\n", __func__); + panic("%s: out of interrupt vectors!\n", __FUNCTION__); printk(KERN_INFO "Reassigning vector %d to %d\n", irq_to_vector(irq), irq_to_vector(new_irq)); memcpy(&iosapic_intr_info[new_irq], &iosapic_intr_info[irq], @@ -599,7 +599,7 @@ register_intr (unsigned int gsi, int irq, unsigned char delivery, index = find_iosapic(gsi); if (index < 0) { printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", - __func__, gsi); + __FUNCTION__, gsi); return -ENODEV; } @@ -608,7 +608,7 @@ register_intr (unsigned int gsi, int irq, unsigned char delivery, rte = iosapic_alloc_rte(); if (!rte) { printk(KERN_WARNING "%s: cannot allocate memory\n", - __func__); + __FUNCTION__); return -ENOMEM; } @@ -625,7 +625,7 @@ register_intr (unsigned int gsi, int irq, unsigned char delivery, (info->trigger != trigger || info->polarity != polarity)){ printk (KERN_WARNING "%s: cannot override the interrupt\n", - __func__); + __FUNCTION__); return -EINVAL; } rte->refcnt++; @@ -647,7 +647,7 @@ register_intr (unsigned int gsi, int irq, unsigned char delivery, if (idesc->chip != &no_irq_type) printk(KERN_WARNING "%s: changing vector %d from %s to %s\n", - __func__, irq_to_vector(irq), + __FUNCTION__, irq_to_vector(irq), idesc->chip->name, irq_type->name); idesc->chip = irq_type; } @@ -920,7 +920,7 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi, case ACPI_INTERRUPT_INIT: irq = create_irq(); if (irq < 0) - panic("%s: out of interrupt vectors!\n", __func__); + panic("%s: out of interrupt vectors!\n", __FUNCTION__); vector = irq_to_vector(irq); delivery = IOSAPIC_INIT; break; @@ -931,7 +931,7 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi, mask = 1; break; default: - printk(KERN_ERR "%s: invalid int type 0x%x\n", __func__, + printk(KERN_ERR "%s: invalid int type 0x%x\n", __FUNCTION__, int_type); return -1; } @@ -996,7 +996,7 @@ iosapic_system_init (int system_pcat_compat) */ printk(KERN_INFO "%s: Disabling PC-AT compatible 8259 interrupts\n", - __func__); + __FUNCTION__); outb(0xff, 0xA1); outb(0xff, 0x21); } @@ -1011,7 +1011,7 @@ iosapic_alloc (void) if (!iosapic_lists[index].addr) return index; - printk(KERN_WARNING "%s: failed to allocate iosapic\n", __func__); + printk(KERN_WARNING "%s: failed to allocate iosapic\n", __FUNCTION__); return -1; } @@ -1109,14 +1109,14 @@ iosapic_remove (unsigned int gsi_base) index = find_iosapic(gsi_base); if (index < 0) { printk(KERN_WARNING "%s: No IOSAPIC for GSI base %u\n", - __func__, gsi_base); + __FUNCTION__, gsi_base); goto out; } if (iosapic_lists[index].rtes_inuse) { err = -EBUSY; printk(KERN_WARNING "%s: IOSAPIC for GSI base %u is busy\n", - __func__, gsi_base); + __FUNCTION__, gsi_base); goto out; } @@ -1137,7 +1137,7 @@ map_iosapic_to_node(unsigned int gsi_base, int node) index = find_iosapic(gsi_base); if (index < 0) { printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", - __func__, gsi_base); + __FUNCTION__, gsi_base); return; } iosapic_lists[index].node = node; diff --git a/trunk/arch/ia64/kernel/irq_ia64.c b/trunk/arch/ia64/kernel/irq_ia64.c index d8be23fbe6bc..2b8cf6e85af4 100644 --- a/trunk/arch/ia64/kernel/irq_ia64.c +++ b/trunk/arch/ia64/kernel/irq_ia64.c @@ -507,7 +507,7 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs) if (unlikely(irq < 0)) { printk(KERN_ERR "%s: Unexpected interrupt " "vector %d on CPU %d is not mapped " - "to any IRQ!\n", __func__, vector, + "to any IRQ!\n", __FUNCTION__, vector, smp_processor_id()); } else generic_handle_irq(irq); @@ -572,7 +572,7 @@ void ia64_process_pending_intr(void) if (unlikely(irq < 0)) { printk(KERN_ERR "%s: Unexpected interrupt " "vector %d on CPU %d not being mapped " - "to any IRQ!!\n", __func__, vector, + "to any IRQ!!\n", __FUNCTION__, vector, smp_processor_id()); } else { vectors_in_migration[irq]=0; @@ -666,7 +666,11 @@ ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect) unsigned long ipi_data; unsigned long phys_cpu_id; +#ifdef CONFIG_SMP phys_cpu_id = cpu_physical_id(cpu); +#else + phys_cpu_id = (ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff; +#endif /* * cpu number is in 8bit ID and 8bit EID diff --git a/trunk/arch/ia64/kernel/kprobes.c b/trunk/arch/ia64/kernel/kprobes.c index 8d9a446a0d17..615c3d2b6348 100644 --- a/trunk/arch/ia64/kernel/kprobes.c +++ b/trunk/arch/ia64/kernel/kprobes.c @@ -838,7 +838,7 @@ static int __kprobes post_kprobes_handler(struct pt_regs *regs) return 1; } -int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) +int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr) { struct kprobe *cur = kprobe_running(); struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); diff --git a/trunk/arch/ia64/kernel/mca.c b/trunk/arch/ia64/kernel/mca.c index 6c18221dba36..6e17aed53135 100644 --- a/trunk/arch/ia64/kernel/mca.c +++ b/trunk/arch/ia64/kernel/mca.c @@ -413,8 +413,8 @@ ia64_log_get(int sal_info_type, u8 **buffer, int irq_safe) IA64_LOG_INDEX_INC(sal_info_type); IA64_LOG_UNLOCK(sal_info_type); if (irq_safe) { - IA64_MCA_DEBUG("%s: SAL error record type %d retrieved. Record length = %ld\n", - __func__, sal_info_type, total_len); + IA64_MCA_DEBUG("%s: SAL error record type %d retrieved. " + "Record length = %ld\n", __FUNCTION__, sal_info_type, total_len); } *buffer = (u8 *) log_buffer; return total_len; @@ -518,7 +518,7 @@ ia64_mca_cpe_int_handler (int cpe_irq, void *arg) static DEFINE_SPINLOCK(cpe_history_lock); IA64_MCA_DEBUG("%s: received interrupt vector = %#x on CPU %d\n", - __func__, cpe_irq, smp_processor_id()); + __FUNCTION__, cpe_irq, smp_processor_id()); /* SAL spec states this should run w/ interrupts enabled */ local_irq_enable(); @@ -594,7 +594,7 @@ ia64_mca_register_cpev (int cpev) } IA64_MCA_DEBUG("%s: corrected platform error " - "vector %#x registered\n", __func__, cpev); + "vector %#x registered\n", __FUNCTION__, cpev); } #endif /* CONFIG_ACPI */ @@ -621,11 +621,12 @@ ia64_mca_cmc_vector_setup (void) cmcv.cmcv_vector = IA64_CMC_VECTOR; ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval); - IA64_MCA_DEBUG("%s: CPU %d corrected machine check vector %#x registered.\n", - __func__, smp_processor_id(), IA64_CMC_VECTOR); + IA64_MCA_DEBUG("%s: CPU %d corrected " + "machine check vector %#x registered.\n", + __FUNCTION__, smp_processor_id(), IA64_CMC_VECTOR); IA64_MCA_DEBUG("%s: CPU %d CMCV = %#016lx\n", - __func__, smp_processor_id(), ia64_getreg(_IA64_REG_CR_CMCV)); + __FUNCTION__, smp_processor_id(), ia64_getreg(_IA64_REG_CR_CMCV)); } /* @@ -650,8 +651,9 @@ ia64_mca_cmc_vector_disable (void *dummy) cmcv.cmcv_mask = 1; /* Mask/disable interrupt */ ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval); - IA64_MCA_DEBUG("%s: CPU %d corrected machine check vector %#x disabled.\n", - __func__, smp_processor_id(), cmcv.cmcv_vector); + IA64_MCA_DEBUG("%s: CPU %d corrected " + "machine check vector %#x disabled.\n", + __FUNCTION__, smp_processor_id(), cmcv.cmcv_vector); } /* @@ -676,8 +678,9 @@ ia64_mca_cmc_vector_enable (void *dummy) cmcv.cmcv_mask = 0; /* Unmask/enable interrupt */ ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval); - IA64_MCA_DEBUG("%s: CPU %d corrected machine check vector %#x enabled.\n", - __func__, smp_processor_id(), cmcv.cmcv_vector); + IA64_MCA_DEBUG("%s: CPU %d corrected " + "machine check vector %#x enabled.\n", + __FUNCTION__, smp_processor_id(), cmcv.cmcv_vector); } /* @@ -764,7 +767,7 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg) local_irq_save(flags); if (notify_die(DIE_MCA_RENDZVOUS_ENTER, "MCA", get_irq_regs(), (long)&nd, 0, 0) == NOTIFY_STOP) - ia64_mca_spin(__func__); + ia64_mca_spin(__FUNCTION__); ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_DONE; /* Register with the SAL monarch that the slave has @@ -774,7 +777,7 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg) if (notify_die(DIE_MCA_RENDZVOUS_PROCESS, "MCA", get_irq_regs(), (long)&nd, 0, 0) == NOTIFY_STOP) - ia64_mca_spin(__func__); + ia64_mca_spin(__FUNCTION__); /* Wait for the monarch cpu to exit. */ while (monarch_cpu != -1) @@ -782,7 +785,7 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg) if (notify_die(DIE_MCA_RENDZVOUS_LEAVE, "MCA", get_irq_regs(), (long)&nd, 0, 0) == NOTIFY_STOP) - ia64_mca_spin(__func__); + ia64_mca_spin(__FUNCTION__); ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_NOTDONE; /* Enable all interrupts */ @@ -1227,7 +1230,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw, if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, (long)&nd, 0, 0) == NOTIFY_STOP) - ia64_mca_spin(__func__); + ia64_mca_spin(__FUNCTION__); ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_CONCURRENT_MCA; if (sos->monarch) { @@ -1243,7 +1246,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw, ia64_mca_wakeup_all(); if (notify_die(DIE_MCA_MONARCH_PROCESS, "MCA", regs, (long)&nd, 0, 0) == NOTIFY_STOP) - ia64_mca_spin(__func__); + ia64_mca_spin(__FUNCTION__); } else { while (cpu_isset(cpu, mca_cpu)) cpu_relax(); /* spin until monarch wakes us */ @@ -1273,7 +1276,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw, } if (notify_die(DIE_MCA_MONARCH_LEAVE, "MCA", regs, (long)&nd, 0, recover) == NOTIFY_STOP) - ia64_mca_spin(__func__); + ia64_mca_spin(__FUNCTION__); if (atomic_dec_return(&mca_count) > 0) { @@ -1325,7 +1328,7 @@ ia64_mca_cmc_int_handler(int cmc_irq, void *arg) static DEFINE_SPINLOCK(cmc_history_lock); IA64_MCA_DEBUG("%s: received interrupt vector = %#x on CPU %d\n", - __func__, cmc_irq, smp_processor_id()); + __FUNCTION__, cmc_irq, smp_processor_id()); /* SAL spec states this should run w/ interrupts enabled */ local_irq_enable(); @@ -1611,7 +1614,7 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw, */ if (!sos->monarch && atomic_add_return(1, &slaves) == num_online_cpus()) { mprintk(KERN_WARNING "%s: Promoting cpu %d to monarch.\n", - __func__, cpu); + __FUNCTION__, cpu); atomic_dec(&slaves); sos->monarch = 1; } @@ -1623,7 +1626,7 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw, */ if (sos->monarch && atomic_add_return(1, &monarchs) > 1) { mprintk(KERN_WARNING "%s: Demoting cpu %d to slave.\n", - __func__, cpu); + __FUNCTION__, cpu); atomic_dec(&monarchs); sos->monarch = 0; } @@ -1634,15 +1637,15 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw, cpu_relax(); /* spin until monarch enters */ if (notify_die(DIE_INIT_SLAVE_ENTER, "INIT", regs, (long)&nd, 0, 0) == NOTIFY_STOP) - ia64_mca_spin(__func__); + ia64_mca_spin(__FUNCTION__); if (notify_die(DIE_INIT_SLAVE_PROCESS, "INIT", regs, (long)&nd, 0, 0) == NOTIFY_STOP) - ia64_mca_spin(__func__); + ia64_mca_spin(__FUNCTION__); while (monarch_cpu != -1) cpu_relax(); /* spin until monarch leaves */ if (notify_die(DIE_INIT_SLAVE_LEAVE, "INIT", regs, (long)&nd, 0, 0) == NOTIFY_STOP) - ia64_mca_spin(__func__); + ia64_mca_spin(__FUNCTION__); mprintk("Slave on cpu %d returning to normal service.\n", cpu); set_curr_task(cpu, previous_current); ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_NOTDONE; @@ -1653,7 +1656,7 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw, monarch_cpu = cpu; if (notify_die(DIE_INIT_MONARCH_ENTER, "INIT", regs, (long)&nd, 0, 0) == NOTIFY_STOP) - ia64_mca_spin(__func__); + ia64_mca_spin(__FUNCTION__); /* * Wait for a bit. On some machines (e.g., HP's zx2000 and zx6000, INIT can be @@ -1670,10 +1673,10 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw, */ if (notify_die(DIE_INIT_MONARCH_PROCESS, "INIT", regs, (long)&nd, 0, 0) == NOTIFY_STOP) - ia64_mca_spin(__func__); + ia64_mca_spin(__FUNCTION__); if (notify_die(DIE_INIT_MONARCH_LEAVE, "INIT", regs, (long)&nd, 0, 0) == NOTIFY_STOP) - ia64_mca_spin(__func__); + ia64_mca_spin(__FUNCTION__); mprintk("\nINIT dump complete. Monarch on cpu %d returning to normal service.\n", cpu); atomic_dec(&monarchs); set_curr_task(cpu, previous_current); @@ -1881,7 +1884,7 @@ ia64_mca_init(void) .priority = 0/* we need to notified last */ }; - IA64_MCA_DEBUG("%s: begin\n", __func__); + IA64_MCA_DEBUG("%s: begin\n", __FUNCTION__); /* Clear the Rendez checkin flag for all cpus */ for(i = 0 ; i < NR_CPUS; i++) @@ -1925,7 +1928,7 @@ ia64_mca_init(void) return; } - IA64_MCA_DEBUG("%s: registered MCA rendezvous spinloop and wakeup mech.\n", __func__); + IA64_MCA_DEBUG("%s: registered MCA rendezvous spinloop and wakeup mech.\n", __FUNCTION__); ia64_mc_info.imi_mca_handler = ia64_tpa(mca_hldlr_ptr->fp); /* @@ -1946,7 +1949,7 @@ ia64_mca_init(void) return; } - IA64_MCA_DEBUG("%s: registered OS MCA handler with SAL at 0x%lx, gp = 0x%lx\n", __func__, + IA64_MCA_DEBUG("%s: registered OS MCA handler with SAL at 0x%lx, gp = 0x%lx\n", __FUNCTION__, ia64_mc_info.imi_mca_handler, ia64_tpa(mca_hldlr_ptr->gp)); /* @@ -1958,7 +1961,7 @@ ia64_mca_init(void) ia64_mc_info.imi_slave_init_handler = ia64_tpa(init_hldlr_ptr_slave->fp); ia64_mc_info.imi_slave_init_handler_size = 0; - IA64_MCA_DEBUG("%s: OS INIT handler at %lx\n", __func__, + IA64_MCA_DEBUG("%s: OS INIT handler at %lx\n", __FUNCTION__, ia64_mc_info.imi_monarch_init_handler); /* Register the os init handler with SAL */ @@ -1979,7 +1982,7 @@ ia64_mca_init(void) return; } - IA64_MCA_DEBUG("%s: registered OS INIT handler with SAL\n", __func__); + IA64_MCA_DEBUG("%s: registered OS INIT handler with SAL\n", __FUNCTION__); /* * Configure the CMCI/P vector and handler. Interrupts for CMC are @@ -2039,7 +2042,7 @@ ia64_mca_late_init(void) cmc_polling_enabled = 0; schedule_work(&cmc_enable_work); - IA64_MCA_DEBUG("%s: CMCI/P setup and enabled.\n", __func__); + IA64_MCA_DEBUG("%s: CMCI/P setup and enabled.\n", __FUNCTION__); #ifdef CONFIG_ACPI /* Setup the CPEI/P vector and handler */ @@ -2062,17 +2065,17 @@ ia64_mca_late_init(void) ia64_cpe_irq = irq; ia64_mca_register_cpev(cpe_vector); IA64_MCA_DEBUG("%s: CPEI/P setup and enabled.\n", - __func__); + __FUNCTION__); return 0; } printk(KERN_ERR "%s: Failed to find irq for CPE " "interrupt handler, vector %d\n", - __func__, cpe_vector); + __FUNCTION__, cpe_vector); } /* If platform doesn't support CPEI, get the timer going. */ if (cpe_poll_enabled) { ia64_mca_cpe_poll(0UL); - IA64_MCA_DEBUG("%s: CPEP setup and enabled.\n", __func__); + IA64_MCA_DEBUG("%s: CPEP setup and enabled.\n", __FUNCTION__); } } #endif diff --git a/trunk/arch/ia64/kernel/module.c b/trunk/arch/ia64/kernel/module.c index e83e2ea3b3e0..e58f4367cf11 100644 --- a/trunk/arch/ia64/kernel/module.c +++ b/trunk/arch/ia64/kernel/module.c @@ -493,7 +493,7 @@ module_frob_arch_sections (Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings, mod->arch.opd->sh_addralign = 8; mod->arch.opd->sh_size = fdescs * sizeof(struct fdesc); DEBUGP("%s: core.plt=%lx, init.plt=%lx, got=%lx, fdesc=%lx\n", - __func__, mod->arch.core_plt->sh_size, mod->arch.init_plt->sh_size, + __FUNCTION__, mod->arch.core_plt->sh_size, mod->arch.init_plt->sh_size, mod->arch.got->sh_size, mod->arch.opd->sh_size); return 0; } @@ -585,7 +585,7 @@ get_plt (struct module *mod, const struct insn *insn, uint64_t value, int *okp) #if ARCH_MODULE_DEBUG if (plt_target(plt) != target_ip) { printk("%s: mistargeted PLT: wanted %lx, got %lx\n", - __func__, target_ip, plt_target(plt)); + __FUNCTION__, target_ip, plt_target(plt)); *okp = 0; return 0; } @@ -703,7 +703,7 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend, if (r_type == R_IA64_PCREL21BI) { if (!is_internal(mod, val)) { printk(KERN_ERR "%s: %s reloc against non-local symbol (%lx)\n", - __func__, reloc_name[r_type], val); + __FUNCTION__, reloc_name[r_type], val); return -ENOEXEC; } format = RF_INSN21B; @@ -737,7 +737,7 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend, case R_IA64_LDXMOV: if (gp_addressable(mod, val)) { /* turn "ld8" into "mov": */ - DEBUGP("%s: patching ld8 at %p to mov\n", __func__, location); + DEBUGP("%s: patching ld8 at %p to mov\n", __FUNCTION__, location); ia64_patch((u64) location, 0x1fff80fe000UL, 0x10000000000UL); } return 0; @@ -771,7 +771,7 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend, if (!ok) return -ENOEXEC; - DEBUGP("%s: [%p]<-%016lx = %s(%lx)\n", __func__, location, val, + DEBUGP("%s: [%p]<-%016lx = %s(%lx)\n", __FUNCTION__, location, val, reloc_name[r_type] ? reloc_name[r_type] : "?", sym->st_value + addend); switch (format) { @@ -807,7 +807,7 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind Elf64_Shdr *target_sec; int ret; - DEBUGP("%s: applying section %u (%u relocs) to %u\n", __func__, + DEBUGP("%s: applying section %u (%u relocs) to %u\n", __FUNCTION__, relsec, n, sechdrs[relsec].sh_info); target_sec = sechdrs + sechdrs[relsec].sh_info; @@ -835,7 +835,7 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind gp = mod->core_size / 2; gp = (uint64_t) mod->module_core + ((gp + 7) & -8); mod->arch.gp = gp; - DEBUGP("%s: placing gp at 0x%lx\n", __func__, gp); + DEBUGP("%s: placing gp at 0x%lx\n", __FUNCTION__, gp); } for (i = 0; i < n; i++) { @@ -903,7 +903,7 @@ register_unwind_table (struct module *mod) init = start + num_core; } - DEBUGP("%s: name=%s, gp=%lx, num_init=%lu, num_core=%lu\n", __func__, + DEBUGP("%s: name=%s, gp=%lx, num_init=%lu, num_core=%lu\n", __FUNCTION__, mod->name, mod->arch.gp, num_init, num_core); /* @@ -912,13 +912,13 @@ register_unwind_table (struct module *mod) if (num_core > 0) { mod->arch.core_unw_table = unw_add_unwind_table(mod->name, 0, mod->arch.gp, core, core + num_core); - DEBUGP("%s: core: handle=%p [%p-%p)\n", __func__, + DEBUGP("%s: core: handle=%p [%p-%p)\n", __FUNCTION__, mod->arch.core_unw_table, core, core + num_core); } if (num_init > 0) { mod->arch.init_unw_table = unw_add_unwind_table(mod->name, 0, mod->arch.gp, init, init + num_init); - DEBUGP("%s: init: handle=%p [%p-%p)\n", __func__, + DEBUGP("%s: init: handle=%p [%p-%p)\n", __FUNCTION__, mod->arch.init_unw_table, init, init + num_init); } } @@ -926,7 +926,7 @@ register_unwind_table (struct module *mod) int module_finalize (const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod) { - DEBUGP("%s: init: entry=%p\n", __func__, mod->init); + DEBUGP("%s: init: entry=%p\n", __FUNCTION__, mod->init); if (mod->arch.unwind) register_unwind_table(mod); return 0; diff --git a/trunk/arch/ia64/kernel/perfmon.c b/trunk/arch/ia64/kernel/perfmon.c index a2aabfdc80d9..f6b99719f10f 100644 --- a/trunk/arch/ia64/kernel/perfmon.c +++ b/trunk/arch/ia64/kernel/perfmon.c @@ -227,12 +227,12 @@ #ifdef PFM_DEBUGGING #define DPRINT(a) \ do { \ - if (unlikely(pfm_sysctl.debug >0)) { printk("%s.%d: CPU%d [%d] ", __func__, __LINE__, smp_processor_id(), task_pid_nr(current)); printk a; } \ + if (unlikely(pfm_sysctl.debug >0)) { printk("%s.%d: CPU%d [%d] ", __FUNCTION__, __LINE__, smp_processor_id(), task_pid_nr(current)); printk a; } \ } while (0) #define DPRINT_ovfl(a) \ do { \ - if (unlikely(pfm_sysctl.debug > 0 && pfm_sysctl.debug_ovfl >0)) { printk("%s.%d: CPU%d [%d] ", __func__, __LINE__, smp_processor_id(), task_pid_nr(current)); printk a; } \ + if (unlikely(pfm_sysctl.debug > 0 && pfm_sysctl.debug_ovfl >0)) { printk("%s.%d: CPU%d [%d] ", __FUNCTION__, __LINE__, smp_processor_id(), task_pid_nr(current)); printk a; } \ } while (0) #endif diff --git a/trunk/arch/ia64/kernel/perfmon_default_smpl.c b/trunk/arch/ia64/kernel/perfmon_default_smpl.c index 5f637bbfcccd..a7af1cb419f9 100644 --- a/trunk/arch/ia64/kernel/perfmon_default_smpl.c +++ b/trunk/arch/ia64/kernel/perfmon_default_smpl.c @@ -24,12 +24,12 @@ MODULE_LICENSE("GPL"); #ifdef DEFAULT_DEBUG #define DPRINT(a) \ do { \ - if (unlikely(pfm_sysctl.debug >0)) { printk("%s.%d: CPU%d ", __func__, __LINE__, smp_processor_id()); printk a; } \ + if (unlikely(pfm_sysctl.debug >0)) { printk("%s.%d: CPU%d ", __FUNCTION__, __LINE__, smp_processor_id()); printk a; } \ } while (0) #define DPRINT_ovfl(a) \ do { \ - if (unlikely(pfm_sysctl.debug > 0 && pfm_sysctl.debug_ovfl >0)) { printk("%s.%d: CPU%d ", __func__, __LINE__, smp_processor_id()); printk a; } \ + if (unlikely(pfm_sysctl.debug > 0 && pfm_sysctl.debug_ovfl >0)) { printk("%s.%d: CPU%d ", __FUNCTION__, __LINE__, smp_processor_id()); printk a; } \ } while (0) #else diff --git a/trunk/arch/ia64/kernel/ptrace.c b/trunk/arch/ia64/kernel/ptrace.c index ab784ec4319d..331d6768b5d5 100644 --- a/trunk/arch/ia64/kernel/ptrace.c +++ b/trunk/arch/ia64/kernel/ptrace.c @@ -697,6 +697,52 @@ thread_matches (struct task_struct *thread, unsigned long addr) return 1; /* looks like we've got a winner */ } +/* + * GDB apparently wants to be able to read the register-backing store + * of any thread when attached to a given process. If we are peeking + * or poking an address that happens to reside in the kernel-backing + * store of another thread, we need to attach to that thread, because + * otherwise we end up accessing stale data. + * + * task_list_lock must be read-locked before calling this routine! + */ +static struct task_struct * +find_thread_for_addr (struct task_struct *child, unsigned long addr) +{ + struct task_struct *p; + struct mm_struct *mm; + struct list_head *this, *next; + int mm_users; + + if (!(mm = get_task_mm(child))) + return child; + + /* -1 because of our get_task_mm(): */ + mm_users = atomic_read(&mm->mm_users) - 1; + if (mm_users <= 1) + goto out; /* not multi-threaded */ + + /* + * Traverse the current process' children list. Every task that + * one attaches to becomes a child. And it is only attached children + * of the debugger that are of interest (ptrace_check_attach checks + * for this). + */ + list_for_each_safe(this, next, ¤t->children) { + p = list_entry(this, struct task_struct, sibling); + if (p->tgid != child->tgid) + continue; + if (thread_matches(p, addr)) { + child = p; + goto out; + } + } + + out: + mmput(mm); + return child; +} + /* * Write f32-f127 back to task->thread.fph if it has been modified. */ @@ -780,14 +826,14 @@ convert_to_non_syscall (struct task_struct *child, struct pt_regs *pt, if ((long)((unsigned long)child + IA64_STK_OFFSET - sp) < IA64_PT_REGS_SIZE) { dprintk("ptrace.%s: ran off the top of the kernel " - "stack\n", __func__); + "stack\n", __FUNCTION__); return; } if (unw_get_pr (&prev_info, &pr) < 0) { unw_get_rp(&prev_info, &ip); dprintk("ptrace.%s: failed to read " "predicate register (ip=0x%lx)\n", - __func__, ip); + __FUNCTION__, ip); return; } if (unw_is_intr_frame(&info) @@ -862,7 +908,7 @@ static int access_uarea (struct task_struct *child, unsigned long addr, unsigned long *data, int write_access) { - unsigned long *ptr, regnum, urbs_end, cfm; + unsigned long *ptr, regnum, urbs_end, rnat_addr, cfm; struct switch_stack *sw; struct pt_regs *pt; # define pt_reg_addr(pt, reg) ((void *) \ @@ -965,9 +1011,14 @@ access_uarea (struct task_struct *child, unsigned long addr, * the kernel was entered. * * Furthermore, when changing the contents of - * PT_AR_BSP (or PT_CFM) while the task is - * blocked in a system call, convert the state - * so that the non-system-call exit + * PT_AR_BSP (or PT_CFM) we MUST copy any + * users-level stacked registers that are + * stored on the kernel stack back to + * user-space because otherwise, we might end + * up clobbering kernel stacked registers. + * Also, if this happens while the task is + * blocked in a system call, which convert the + * state such that the non-system-call exit * path is used. This ensures that the proper * state will be picked up when resuming * execution. However, it *also* means that @@ -984,6 +1035,10 @@ access_uarea (struct task_struct *child, unsigned long addr, urbs_end = ia64_get_user_rbs_end(child, pt, &cfm); if (write_access) { if (*data != urbs_end) { + if (ia64_sync_user_rbs(child, sw, + pt->ar_bspstore, + urbs_end) < 0) + return -1; if (in_syscall(pt)) convert_to_non_syscall(child, pt, @@ -1003,6 +1058,10 @@ access_uarea (struct task_struct *child, unsigned long addr, urbs_end = ia64_get_user_rbs_end(child, pt, &cfm); if (write_access) { if (((cfm ^ *data) & PFM_MASK) != 0) { + if (ia64_sync_user_rbs(child, sw, + pt->ar_bspstore, + urbs_end) < 0) + return -1; if (in_syscall(pt)) convert_to_non_syscall(child, pt, @@ -1034,8 +1093,16 @@ access_uarea (struct task_struct *child, unsigned long addr, return 0; case PT_AR_RNAT: - ptr = pt_reg_addr(pt, ar_rnat); - break; + urbs_end = ia64_get_user_rbs_end(child, pt, NULL); + rnat_addr = (long) ia64_rse_rnat_addr((long *) + urbs_end); + if (write_access) + return ia64_poke(child, sw, urbs_end, + rnat_addr, *data); + else + return ia64_peek(child, sw, urbs_end, + rnat_addr, data); + case PT_R1: ptr = pt_reg_addr(pt, r1); break; @@ -1454,26 +1521,13 @@ ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr) return ret; } +/* + * Called by kernel/ptrace.c when detaching.. + * + * Make sure the single step bit is not set. + */ void -user_enable_single_step (struct task_struct *child) -{ - struct ia64_psr *child_psr = ia64_psr(task_pt_regs(child)); - - set_tsk_thread_flag(child, TIF_SINGLESTEP); - child_psr->ss = 1; -} - -void -user_enable_block_step (struct task_struct *child) -{ - struct ia64_psr *child_psr = ia64_psr(task_pt_regs(child)); - - set_tsk_thread_flag(child, TIF_SINGLESTEP); - child_psr->tb = 1; -} - -void -user_disable_single_step (struct task_struct *child) +ptrace_disable (struct task_struct *child) { struct ia64_psr *child_psr = ia64_psr(task_pt_regs(child)); @@ -1483,68 +1537,199 @@ user_disable_single_step (struct task_struct *child) child_psr->tb = 0; } -/* - * Called by kernel/ptrace.c when detaching.. - * - * Make sure the single step bit is not set. - */ -void -ptrace_disable (struct task_struct *child) +asmlinkage long +sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data) { - user_disable_single_step(child); -} + struct pt_regs *pt; + unsigned long urbs_end, peek_or_poke; + struct task_struct *child; + struct switch_stack *sw; + long ret; + struct unw_frame_info info; + + lock_kernel(); + ret = -EPERM; + if (request == PTRACE_TRACEME) { + ret = ptrace_traceme(); + goto out; + } + + peek_or_poke = (request == PTRACE_PEEKTEXT + || request == PTRACE_PEEKDATA + || request == PTRACE_POKETEXT + || request == PTRACE_POKEDATA); + ret = -ESRCH; + read_lock(&tasklist_lock); + { + child = find_task_by_pid(pid); + if (child) { + if (peek_or_poke) + child = find_thread_for_addr(child, addr); + get_task_struct(child); + } + } + read_unlock(&tasklist_lock); + if (!child) + goto out; + ret = -EPERM; + if (pid == 1) /* no messing around with init! */ + goto out_tsk; + + if (request == PTRACE_ATTACH) { + ret = ptrace_attach(child); + if (!ret) + arch_ptrace_attach(child); + goto out_tsk; + } + + ret = ptrace_check_attach(child, request == PTRACE_KILL); + if (ret < 0) + goto out_tsk; + + pt = task_pt_regs(child); + sw = (struct switch_stack *) (child->thread.ksp + 16); -long -arch_ptrace (struct task_struct *child, long request, long addr, long data) -{ switch (request) { - case PTRACE_PEEKTEXT: - case PTRACE_PEEKDATA: + case PTRACE_PEEKTEXT: + case PTRACE_PEEKDATA: /* read word at location addr */ - if (access_process_vm(child, addr, &data, sizeof(data), 0) - != sizeof(data)) - return -EIO; - /* ensure return value is not mistaken for error code */ - force_successful_syscall_return(); - return data; + urbs_end = ia64_get_user_rbs_end(child, pt, NULL); + ret = ia64_peek(child, sw, urbs_end, addr, &data); + if (ret == 0) { + ret = data; + /* ensure "ret" is not mistaken as an error code: */ + force_successful_syscall_return(); + } + goto out_tsk; - /* PTRACE_POKETEXT and PTRACE_POKEDATA is handled - * by the generic ptrace_request(). - */ + case PTRACE_POKETEXT: + case PTRACE_POKEDATA: + /* write the word at location addr */ + urbs_end = ia64_get_user_rbs_end(child, pt, NULL); + ret = ia64_poke(child, sw, urbs_end, addr, data); - case PTRACE_PEEKUSR: + /* Make sure user RBS has the latest data */ + unw_init_from_blocked_task(&info, child); + do_sync_rbs(&info, ia64_sync_user_rbs); + + goto out_tsk; + + case PTRACE_PEEKUSR: /* read the word at addr in the USER area */ - if (access_uarea(child, addr, &data, 0) < 0) - return -EIO; - /* ensure return value is not mistaken for error code */ + if (access_uarea(child, addr, &data, 0) < 0) { + ret = -EIO; + goto out_tsk; + } + ret = data; + /* ensure "ret" is not mistaken as an error code */ force_successful_syscall_return(); - return data; + goto out_tsk; - case PTRACE_POKEUSR: + case PTRACE_POKEUSR: /* write the word at addr in the USER area */ - if (access_uarea(child, addr, &data, 1) < 0) - return -EIO; - return 0; + if (access_uarea(child, addr, &data, 1) < 0) { + ret = -EIO; + goto out_tsk; + } + ret = 0; + goto out_tsk; - case PTRACE_OLD_GETSIGINFO: + case PTRACE_OLD_GETSIGINFO: /* for backwards-compatibility */ - return ptrace_request(child, PTRACE_GETSIGINFO, addr, data); + ret = ptrace_request(child, PTRACE_GETSIGINFO, addr, data); + goto out_tsk; - case PTRACE_OLD_SETSIGINFO: + case PTRACE_OLD_SETSIGINFO: /* for backwards-compatibility */ - return ptrace_request(child, PTRACE_SETSIGINFO, addr, data); + ret = ptrace_request(child, PTRACE_SETSIGINFO, addr, data); + goto out_tsk; + + case PTRACE_SYSCALL: + /* continue and stop at next (return from) syscall */ + case PTRACE_CONT: + /* restart after signal. */ + ret = -EIO; + if (!valid_signal(data)) + goto out_tsk; + if (request == PTRACE_SYSCALL) + set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + else + clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + child->exit_code = data; - case PTRACE_GETREGS: - return ptrace_getregs(child, - (struct pt_all_user_regs __user *) data); + /* + * Make sure the single step/taken-branch trap bits + * are not set: + */ + clear_tsk_thread_flag(child, TIF_SINGLESTEP); + ia64_psr(pt)->ss = 0; + ia64_psr(pt)->tb = 0; - case PTRACE_SETREGS: - return ptrace_setregs(child, - (struct pt_all_user_regs __user *) data); + wake_up_process(child); + ret = 0; + goto out_tsk; - default: - return ptrace_request(child, request, addr, data); + case PTRACE_KILL: + /* + * Make the child exit. Best I can do is send it a + * sigkill. Perhaps it should be put in the status + * that it wants to exit. + */ + if (child->exit_state == EXIT_ZOMBIE) + /* already dead */ + goto out_tsk; + child->exit_code = SIGKILL; + + ptrace_disable(child); + wake_up_process(child); + ret = 0; + goto out_tsk; + + case PTRACE_SINGLESTEP: + /* let child execute for one instruction */ + case PTRACE_SINGLEBLOCK: + ret = -EIO; + if (!valid_signal(data)) + goto out_tsk; + + clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + set_tsk_thread_flag(child, TIF_SINGLESTEP); + if (request == PTRACE_SINGLESTEP) { + ia64_psr(pt)->ss = 1; + } else { + ia64_psr(pt)->tb = 1; + } + child->exit_code = data; + + /* give it a chance to run. */ + wake_up_process(child); + ret = 0; + goto out_tsk; + + case PTRACE_DETACH: + /* detach a process that was attached. */ + ret = ptrace_detach(child, data); + goto out_tsk; + + case PTRACE_GETREGS: + ret = ptrace_getregs(child, + (struct pt_all_user_regs __user *) data); + goto out_tsk; + + case PTRACE_SETREGS: + ret = ptrace_setregs(child, + (struct pt_all_user_regs __user *) data); + goto out_tsk; + + default: + ret = ptrace_request(child, request, addr, data); + goto out_tsk; } + out_tsk: + put_task_struct(child); + out: + unlock_kernel(); + return ret; } diff --git a/trunk/arch/ia64/kernel/setup.c b/trunk/arch/ia64/kernel/setup.c index 4aa9eaea76c3..ebd1a09f3201 100644 --- a/trunk/arch/ia64/kernel/setup.c +++ b/trunk/arch/ia64/kernel/setup.c @@ -690,7 +690,7 @@ get_model_name(__u8 family, __u8 model) if (overflow++ == 0) printk(KERN_ERR "%s: Table overflow. Some processor model information will be missing\n", - __func__); + __FUNCTION__); return "Unknown"; } @@ -785,7 +785,7 @@ get_max_cacheline_size (void) status = ia64_pal_cache_summary(&levels, &unique_caches); if (status != 0) { printk(KERN_ERR "%s: ia64_pal_cache_summary() failed (status=%ld)\n", - __func__, status); + __FUNCTION__, status); max = SMP_CACHE_BYTES; /* Safest setup for "flush_icache_range()" */ ia64_i_cache_stride_shift = I_CACHE_STRIDE_SHIFT; @@ -798,7 +798,7 @@ get_max_cacheline_size (void) if (status != 0) { printk(KERN_ERR "%s: ia64_pal_cache_config_info(l=%lu, 2) failed (status=%ld)\n", - __func__, l, status); + __FUNCTION__, l, status); max = SMP_CACHE_BYTES; /* The safest setup for "flush_icache_range()" */ cci.pcci_stride = I_CACHE_STRIDE_SHIFT; @@ -814,7 +814,7 @@ get_max_cacheline_size (void) if (status != 0) { printk(KERN_ERR "%s: ia64_pal_cache_config_info(l=%lu, 1) failed (status=%ld)\n", - __func__, l, status); + __FUNCTION__, l, status); /* The safest setup for "flush_icache_range()" */ cci.pcci_stride = I_CACHE_STRIDE_SHIFT; } diff --git a/trunk/arch/ia64/kernel/unaligned.c b/trunk/arch/ia64/kernel/unaligned.c index 6903361d11a5..52f70bbc192a 100644 --- a/trunk/arch/ia64/kernel/unaligned.c +++ b/trunk/arch/ia64/kernel/unaligned.c @@ -28,7 +28,7 @@ extern int die_if_kernel(char *str, struct pt_regs *regs, long err); #undef DEBUG_UNALIGNED_TRAP #ifdef DEBUG_UNALIGNED_TRAP -# define DPRINT(a...) do { printk("%s %u: ", __func__, __LINE__); printk (a); } while (0) +# define DPRINT(a...) do { printk("%s %u: ", __FUNCTION__, __LINE__); printk (a); } while (0) # define DDUMP(str,vp,len) dump(str, vp, len) static void @@ -674,7 +674,7 @@ emulate_load_updates (update_t type, load_store_t ld, struct pt_regs *regs, unsi * just in case. */ if (ld.x6_op == 1 || ld.x6_op == 3) { - printk(KERN_ERR "%s: register update on speculative load, error\n", __func__); + printk(KERN_ERR "%s: register update on speculative load, error\n", __FUNCTION__); if (die_if_kernel("unaligned reference on speculative load with register update\n", regs, 30)) return; @@ -1104,7 +1104,7 @@ emulate_load_floatpair (unsigned long ifa, load_store_t ld, struct pt_regs *regs */ if (ld.x6_op == 1 || ld.x6_op == 3) printk(KERN_ERR "%s: register update on speculative load pair, error\n", - __func__); + __FUNCTION__); setreg(ld.r3, ifa, 0, regs); } diff --git a/trunk/arch/ia64/kernel/unwind.c b/trunk/arch/ia64/kernel/unwind.c index 67810b77d998..c1bdb5131814 100644 --- a/trunk/arch/ia64/kernel/unwind.c +++ b/trunk/arch/ia64/kernel/unwind.c @@ -257,7 +257,7 @@ pt_regs_off (unsigned long reg) off = unw.pt_regs_offsets[reg]; if (off < 0) { - UNW_DPRINT(0, "unwind.%s: bad scratch reg r%lu\n", __func__, reg); + UNW_DPRINT(0, "unwind.%s: bad scratch reg r%lu\n", __FUNCTION__, reg); off = 0; } return (unsigned long) off; @@ -268,13 +268,13 @@ get_scratch_regs (struct unw_frame_info *info) { if (!info->pt) { /* This should not happen with valid unwind info. */ - UNW_DPRINT(0, "unwind.%s: bad unwind info: resetting info->pt\n", __func__); + UNW_DPRINT(0, "unwind.%s: bad unwind info: resetting info->pt\n", __FUNCTION__); if (info->flags & UNW_FLAG_INTERRUPT_FRAME) info->pt = (unsigned long) ((struct pt_regs *) info->psp - 1); else info->pt = info->sp - 16; } - UNW_DPRINT(3, "unwind.%s: sp 0x%lx pt 0x%lx\n", __func__, info->sp, info->pt); + UNW_DPRINT(3, "unwind.%s: sp 0x%lx pt 0x%lx\n", __FUNCTION__, info->sp, info->pt); return (struct pt_regs *) info->pt; } @@ -294,7 +294,7 @@ unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char return 0; } UNW_DPRINT(0, "unwind.%s: trying to access non-existent r%u\n", - __func__, regnum); + __FUNCTION__, regnum); return -1; } @@ -341,7 +341,7 @@ unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char { UNW_DPRINT(0, "unwind.%s: %p outside of regstk " "[0x%lx-0x%lx)\n", - __func__, (void *) addr, + __FUNCTION__, (void *) addr, info->regstk.limit, info->regstk.top); return -1; @@ -374,7 +374,7 @@ unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char || (unsigned long) addr >= info->regstk.top) { UNW_DPRINT(0, "unwind.%s: ignoring attempt to access register outside " - "of rbs\n", __func__); + "of rbs\n", __FUNCTION__); return -1; } if ((unsigned long) nat_addr >= info->regstk.top) @@ -385,7 +385,7 @@ unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char if (write) { if (read_only(addr)) { UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n", - __func__); + __FUNCTION__); } else { *addr = *val; if (*nat) @@ -427,13 +427,13 @@ unw_access_br (struct unw_frame_info *info, int regnum, unsigned long *val, int default: UNW_DPRINT(0, "unwind.%s: trying to access non-existent b%u\n", - __func__, regnum); + __FUNCTION__, regnum); return -1; } if (write) if (read_only(addr)) { UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n", - __func__); + __FUNCTION__); } else *addr = *val; else @@ -450,7 +450,7 @@ unw_access_fr (struct unw_frame_info *info, int regnum, struct ia64_fpreg *val, if ((unsigned) (regnum - 2) >= 126) { UNW_DPRINT(0, "unwind.%s: trying to access non-existent f%u\n", - __func__, regnum); + __FUNCTION__, regnum); return -1; } @@ -482,7 +482,7 @@ unw_access_fr (struct unw_frame_info *info, int regnum, struct ia64_fpreg *val, if (write) if (read_only(addr)) { UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n", - __func__); + __FUNCTION__); } else *addr = *val; else @@ -572,14 +572,14 @@ unw_access_ar (struct unw_frame_info *info, int regnum, unsigned long *val, int default: UNW_DPRINT(0, "unwind.%s: trying to access non-existent ar%u\n", - __func__, regnum); + __FUNCTION__, regnum); return -1; } if (write) { if (read_only(addr)) { UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n", - __func__); + __FUNCTION__); } else *addr = *val; } else @@ -600,7 +600,7 @@ unw_access_pr (struct unw_frame_info *info, unsigned long *val, int write) if (write) { if (read_only(addr)) { UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n", - __func__); + __FUNCTION__); } else *addr = *val; } else @@ -699,7 +699,7 @@ decode_abreg (unsigned char abreg, int memory) default: break; } - UNW_DPRINT(0, "unwind.%s: bad abreg=0x%x\n", __func__, abreg); + UNW_DPRINT(0, "unwind.%s: bad abreg=0x%x\n", __FUNCTION__, abreg); return UNW_REG_LC; } @@ -739,7 +739,7 @@ spill_next_when (struct unw_reg_info **regp, struct unw_reg_info *lim, unw_word return; } } - UNW_DPRINT(0, "unwind.%s: excess spill!\n", __func__); + UNW_DPRINT(0, "unwind.%s: excess spill!\n", __FUNCTION__); } static inline void @@ -855,11 +855,11 @@ desc_abi (unsigned char abi, unsigned char context, struct unw_state_record *sr) { if (abi == 3 && context == 'i') { sr->flags |= UNW_FLAG_INTERRUPT_FRAME; - UNW_DPRINT(3, "unwind.%s: interrupt frame\n", __func__); + UNW_DPRINT(3, "unwind.%s: interrupt frame\n", __FUNCTION__); } else UNW_DPRINT(0, "unwind%s: ignoring unwabi(abi=0x%x,context=0x%x)\n", - __func__, abi, context); + __FUNCTION__, abi, context); } static inline void @@ -1347,7 +1347,7 @@ script_emit (struct unw_script *script, struct unw_insn insn) { if (script->count >= UNW_MAX_SCRIPT_LEN) { UNW_DPRINT(0, "unwind.%s: script exceeds maximum size of %u instructions!\n", - __func__, UNW_MAX_SCRIPT_LEN); + __FUNCTION__, UNW_MAX_SCRIPT_LEN); return; } script->insn[script->count++] = insn; @@ -1389,7 +1389,7 @@ emit_nat_info (struct unw_state_record *sr, int i, struct unw_script *script) default: UNW_DPRINT(0, "unwind.%s: don't know how to emit nat info for where = %u\n", - __func__, r->where); + __FUNCTION__, r->where); return; } insn.opc = opc; @@ -1446,7 +1446,7 @@ compile_reg (struct unw_state_record *sr, int i, struct unw_script *script) val = offsetof(struct pt_regs, f6) + 16*(rval - 6); else UNW_DPRINT(0, "unwind.%s: kernel may not touch f%lu\n", - __func__, rval); + __FUNCTION__, rval); } break; @@ -1474,7 +1474,7 @@ compile_reg (struct unw_state_record *sr, int i, struct unw_script *script) default: UNW_DPRINT(0, "unwind%s: register %u has unexpected `where' value of %u\n", - __func__, i, r->where); + __FUNCTION__, i, r->where); break; } insn.opc = opc; @@ -1547,10 +1547,10 @@ build_script (struct unw_frame_info *info) r->when = UNW_WHEN_NEVER; sr.pr_val = info->pr; - UNW_DPRINT(3, "unwind.%s: ip 0x%lx\n", __func__, ip); + UNW_DPRINT(3, "unwind.%s: ip 0x%lx\n", __FUNCTION__, ip); script = script_new(ip); if (!script) { - UNW_DPRINT(0, "unwind.%s: failed to create unwind script\n", __func__); + UNW_DPRINT(0, "unwind.%s: failed to create unwind script\n", __FUNCTION__); STAT(unw.stat.script.build_time += ia64_get_itc() - start); return NULL; } @@ -1569,7 +1569,7 @@ build_script (struct unw_frame_info *info) if (!e) { /* no info, return default unwinder (leaf proc, no mem stack, no saved regs) */ UNW_DPRINT(1, "unwind.%s: no unwind info for ip=0x%lx (prev ip=0x%lx)\n", - __func__, ip, unw.cache[info->prev_script].ip); + __FUNCTION__, ip, unw.cache[info->prev_script].ip); sr.curr.reg[UNW_REG_RP].where = UNW_WHERE_BR; sr.curr.reg[UNW_REG_RP].when = -1; sr.curr.reg[UNW_REG_RP].val = 0; @@ -1618,13 +1618,13 @@ build_script (struct unw_frame_info *info) sr.curr.reg[UNW_REG_RP].when = -1; sr.curr.reg[UNW_REG_RP].val = sr.return_link_reg; UNW_DPRINT(1, "unwind.%s: using default for rp at ip=0x%lx where=%d val=0x%lx\n", - __func__, ip, sr.curr.reg[UNW_REG_RP].where, + __FUNCTION__, ip, sr.curr.reg[UNW_REG_RP].where, sr.curr.reg[UNW_REG_RP].val); } #ifdef UNW_DEBUG UNW_DPRINT(1, "unwind.%s: state record for func 0x%lx, t=%u:\n", - __func__, table->segment_base + e->start_offset, sr.when_target); + __FUNCTION__, table->segment_base + e->start_offset, sr.when_target); for (r = sr.curr.reg; r < sr.curr.reg + UNW_NUM_REGS; ++r) { if (r->where != UNW_WHERE_NONE || r->when != UNW_WHEN_NEVER) { UNW_DPRINT(1, " %s <- ", unw.preg_name[r - sr.curr.reg]); @@ -1746,7 +1746,7 @@ run_script (struct unw_script *script, struct unw_frame_info *state) } else { s[dst] = 0; UNW_DPRINT(0, "unwind.%s: no state->pt, dst=%ld, val=%ld\n", - __func__, dst, val); + __FUNCTION__, dst, val); } break; @@ -1756,7 +1756,7 @@ run_script (struct unw_script *script, struct unw_frame_info *state) else { s[dst] = 0; UNW_DPRINT(0, "unwind.%s: UNW_INSN_MOVE_CONST bad val=%ld\n", - __func__, val); + __FUNCTION__, val); } break; @@ -1791,7 +1791,7 @@ run_script (struct unw_script *script, struct unw_frame_info *state) || s[val] < TASK_SIZE) { UNW_DPRINT(0, "unwind.%s: rejecting bad psp=0x%lx\n", - __func__, s[val]); + __FUNCTION__, s[val]); break; } #endif @@ -1825,7 +1825,7 @@ find_save_locs (struct unw_frame_info *info) if ((info->ip & (local_cpu_data->unimpl_va_mask | 0xf)) || info->ip < TASK_SIZE) { /* don't let obviously bad addresses pollute the cache */ /* FIXME: should really be level 0 but it occurs too often. KAO */ - UNW_DPRINT(1, "unwind.%s: rejecting bad ip=0x%lx\n", __func__, info->ip); + UNW_DPRINT(1, "unwind.%s: rejecting bad ip=0x%lx\n", __FUNCTION__, info->ip); info->rp_loc = NULL; return -1; } @@ -1838,7 +1838,7 @@ find_save_locs (struct unw_frame_info *info) spin_unlock_irqrestore(&unw.lock, flags); UNW_DPRINT(0, "unwind.%s: failed to locate/build unwind script for ip %lx\n", - __func__, info->ip); + __FUNCTION__, info->ip); return -1; } have_write_lock = 1; @@ -1882,21 +1882,21 @@ unw_unwind (struct unw_frame_info *info) if (!unw_valid(info, info->rp_loc)) { /* FIXME: should really be level 0 but it occurs too often. KAO */ UNW_DPRINT(1, "unwind.%s: failed to locate return link (ip=0x%lx)!\n", - __func__, info->ip); + __FUNCTION__, info->ip); STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags)); return -1; } /* restore the ip */ ip = info->ip = *info->rp_loc; if (ip < GATE_ADDR) { - UNW_DPRINT(2, "unwind.%s: reached user-space (ip=0x%lx)\n", __func__, ip); + UNW_DPRINT(2, "unwind.%s: reached user-space (ip=0x%lx)\n", __FUNCTION__, ip); STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags)); return -1; } /* validate the previous stack frame pointer */ if (!unw_valid(info, info->pfs_loc)) { - UNW_DPRINT(0, "unwind.%s: failed to locate ar.pfs!\n", __func__); + UNW_DPRINT(0, "unwind.%s: failed to locate ar.pfs!\n", __FUNCTION__); STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags)); return -1; } @@ -1912,13 +1912,13 @@ unw_unwind (struct unw_frame_info *info) num_regs = *info->cfm_loc & 0x7f; /* size of frame */ info->pfs_loc = (unsigned long *) (info->pt + offsetof(struct pt_regs, ar_pfs)); - UNW_DPRINT(3, "unwind.%s: interrupt_frame pt 0x%lx\n", __func__, info->pt); + UNW_DPRINT(3, "unwind.%s: interrupt_frame pt 0x%lx\n", __FUNCTION__, info->pt); } else num_regs = (*info->cfm_loc >> 7) & 0x7f; /* size of locals */ info->bsp = (unsigned long) ia64_rse_skip_regs((unsigned long *) info->bsp, -num_regs); if (info->bsp < info->regstk.limit || info->bsp > info->regstk.top) { UNW_DPRINT(0, "unwind.%s: bsp (0x%lx) out of range [0x%lx-0x%lx]\n", - __func__, info->bsp, info->regstk.limit, info->regstk.top); + __FUNCTION__, info->bsp, info->regstk.limit, info->regstk.top); STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags)); return -1; } @@ -1927,14 +1927,14 @@ unw_unwind (struct unw_frame_info *info) info->sp = info->psp; if (info->sp < info->memstk.top || info->sp > info->memstk.limit) { UNW_DPRINT(0, "unwind.%s: sp (0x%lx) out of range [0x%lx-0x%lx]\n", - __func__, info->sp, info->memstk.top, info->memstk.limit); + __FUNCTION__, info->sp, info->memstk.top, info->memstk.limit); STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags)); return -1; } if (info->ip == prev_ip && info->sp == prev_sp && info->bsp == prev_bsp) { UNW_DPRINT(0, "unwind.%s: ip, sp, bsp unchanged; stopping here (ip=0x%lx)\n", - __func__, ip); + __FUNCTION__, ip); STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags)); return -1; } @@ -1961,7 +1961,7 @@ unw_unwind_to_user (struct unw_frame_info *info) if ((long)((unsigned long)info->task + IA64_STK_OFFSET - sp) < IA64_PT_REGS_SIZE) { UNW_DPRINT(0, "unwind.%s: ran off the top of the kernel stack\n", - __func__); + __FUNCTION__); break; } if (unw_is_intr_frame(info) && @@ -1971,13 +1971,13 @@ unw_unwind_to_user (struct unw_frame_info *info) unw_get_rp(info, &ip); UNW_DPRINT(0, "unwind.%s: failed to read " "predicate register (ip=0x%lx)\n", - __func__, ip); + __FUNCTION__, ip); return -1; } } while (unw_unwind(info) >= 0); unw_get_ip(info, &ip); UNW_DPRINT(0, "unwind.%s: failed to unwind to user-level (ip=0x%lx)\n", - __func__, ip); + __FUNCTION__, ip); return -1; } EXPORT_SYMBOL(unw_unwind_to_user); @@ -2028,7 +2028,7 @@ init_frame_info (struct unw_frame_info *info, struct task_struct *t, " pr 0x%lx\n" " sw 0x%lx\n" " sp 0x%lx\n", - __func__, (unsigned long) t, rbslimit, rbstop, stktop, stklimit, + __FUNCTION__, (unsigned long) t, rbslimit, rbstop, stktop, stklimit, info->pr, (unsigned long) info->sw, info->sp); STAT(unw.stat.api.init_time += ia64_get_itc() - start; local_irq_restore(flags)); } @@ -2047,7 +2047,7 @@ unw_init_frame_info (struct unw_frame_info *info, struct task_struct *t, struct " bsp 0x%lx\n" " sol 0x%lx\n" " ip 0x%lx\n", - __func__, info->bsp, sol, info->ip); + __FUNCTION__, info->bsp, sol, info->ip); find_save_locs(info); } @@ -2058,7 +2058,7 @@ unw_init_from_blocked_task (struct unw_frame_info *info, struct task_struct *t) { struct switch_stack *sw = (struct switch_stack *) (t->thread.ksp + 16); - UNW_DPRINT(1, "unwind.%s\n", __func__); + UNW_DPRINT(1, "unwind.%s\n", __FUNCTION__); unw_init_frame_info(info, t, sw); } EXPORT_SYMBOL(unw_init_from_blocked_task); @@ -2088,7 +2088,7 @@ unw_add_unwind_table (const char *name, unsigned long segment_base, unsigned lon if (end - start <= 0) { UNW_DPRINT(0, "unwind.%s: ignoring attempt to insert empty unwind table\n", - __func__); + __FUNCTION__); return NULL; } @@ -2119,14 +2119,14 @@ unw_remove_unwind_table (void *handle) if (!handle) { UNW_DPRINT(0, "unwind.%s: ignoring attempt to remove non-existent unwind table\n", - __func__); + __FUNCTION__); return; } table = handle; if (table == &unw.kernel_table) { UNW_DPRINT(0, "unwind.%s: sorry, freeing the kernel's unwind table is a " - "no-can-do!\n", __func__); + "no-can-do!\n", __FUNCTION__); return; } @@ -2139,7 +2139,7 @@ unw_remove_unwind_table (void *handle) break; if (!prev) { UNW_DPRINT(0, "unwind.%s: failed to find unwind table %p\n", - __func__, (void *) table); + __FUNCTION__, (void *) table); spin_unlock_irqrestore(&unw.lock, flags); return; } @@ -2185,7 +2185,7 @@ create_gate_table (void) } if (!punw) { - printk("%s: failed to find gate DSO's unwind table!\n", __func__); + printk("%s: failed to find gate DSO's unwind table!\n", __FUNCTION__); return 0; } @@ -2202,7 +2202,7 @@ create_gate_table (void) unw.gate_table = kmalloc(size, GFP_KERNEL); if (!unw.gate_table) { unw.gate_table_size = 0; - printk(KERN_ERR "%s: unable to create unwind data for gate page!\n", __func__); + printk(KERN_ERR "%s: unable to create unwind data for gate page!\n", __FUNCTION__); return 0; } unw.gate_table_size = size; diff --git a/trunk/arch/ia64/mm/fault.c b/trunk/arch/ia64/mm/fault.c index 23088bed111e..3e69881648a3 100644 --- a/trunk/arch/ia64/mm/fault.c +++ b/trunk/arch/ia64/mm/fault.c @@ -26,7 +26,7 @@ static inline int notify_page_fault(struct pt_regs *regs, int trap) if (!user_mode(regs)) { /* kprobe_running() needs smp_processor_id() */ preempt_disable(); - if (kprobe_running() && kprobe_fault_handler(regs, trap)) + if (kprobe_running() && kprobes_fault_handler(regs, trap)) ret = 1; preempt_enable(); } diff --git a/trunk/arch/ia64/mm/init.c b/trunk/arch/ia64/mm/init.c index a4ca657c72c6..25aef6211a54 100644 --- a/trunk/arch/ia64/mm/init.c +++ b/trunk/arch/ia64/mm/init.c @@ -714,7 +714,7 @@ int arch_add_memory(int nid, u64 start, u64 size) if (ret) printk("%s: Problem encountered in __add_pages() as ret=%d\n", - __func__, ret); + __FUNCTION__, ret); return ret; } diff --git a/trunk/arch/ia64/pci/fixup.c b/trunk/arch/ia64/pci/fixup.c index f5959c0c1810..245dc1fedc24 100644 --- a/trunk/arch/ia64/pci/fixup.c +++ b/trunk/arch/ia64/pci/fixup.c @@ -63,7 +63,7 @@ static void __devinit pci_fixup_video(struct pci_dev *pdev) pci_read_config_word(pdev, PCI_COMMAND, &config); if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; - dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); + printk(KERN_DEBUG "Boot video device is %s\n", pci_name(pdev)); } } DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video); diff --git a/trunk/arch/ia64/pci/pci.c b/trunk/arch/ia64/pci/pci.c index e282c348dcde..8fd7e825192b 100644 --- a/trunk/arch/ia64/pci/pci.c +++ b/trunk/arch/ia64/pci/pci.c @@ -765,7 +765,7 @@ static void __init set_pci_cacheline_size(void) status = ia64_pal_cache_summary(&levels, &unique_caches); if (status != 0) { printk(KERN_ERR "%s: ia64_pal_cache_summary() failed " - "(status=%ld)\n", __func__, status); + "(status=%ld)\n", __FUNCTION__, status); return; } @@ -773,7 +773,7 @@ static void __init set_pci_cacheline_size(void) /* cache_type (data_or_unified)= */ 2, &cci); if (status != 0) { printk(KERN_ERR "%s: ia64_pal_cache_config_info() failed " - "(status=%ld)\n", __func__, status); + "(status=%ld)\n", __FUNCTION__, status); return; } pci_cache_line_size = (1 << cci.pcci_line_size) / 4; diff --git a/trunk/arch/ia64/sn/kernel/huberror.c b/trunk/arch/ia64/sn/kernel/huberror.c index 0101c7924a4d..b663168da55c 100644 --- a/trunk/arch/ia64/sn/kernel/huberror.c +++ b/trunk/arch/ia64/sn/kernel/huberror.c @@ -37,7 +37,7 @@ static irqreturn_t hub_eint_handler(int irq, void *arg) (u64) nasid, 0, 0, 0, 0, 0, 0); if ((int)ret_stuff.v0) - panic("%s: Fatal %s Error", __func__, + panic("%s: Fatal %s Error", __FUNCTION__, ((nasid & 1) ? "TIO" : "HUBII")); if (!(nasid & 1)) /* Not a TIO, handle CRB errors */ @@ -48,7 +48,7 @@ static irqreturn_t hub_eint_handler(int irq, void *arg) (u64) nasid, 0, 0, 0, 0, 0, 0); if ((int)ret_stuff.v0) - panic("%s: Fatal TIO Error", __func__); + panic("%s: Fatal TIO Error", __FUNCTION__); } else bte_error_handler((unsigned long)NODEPDA(nasid_to_cnodeid(nasid))); diff --git a/trunk/arch/ia64/sn/kernel/io_acpi_init.c b/trunk/arch/ia64/sn/kernel/io_acpi_init.c index 6568942a95f0..3c7178f5dce8 100644 --- a/trunk/arch/ia64/sn/kernel/io_acpi_init.c +++ b/trunk/arch/ia64/sn/kernel/io_acpi_init.c @@ -133,7 +133,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus) if (ACPI_FAILURE(status)) { printk(KERN_ERR "%s: " "acpi_get_vendor_resource() failed (0x%x) for: ", - __func__, status); + __FUNCTION__, status); acpi_ns_print_node_pathname(handle, NULL); printk("\n"); return NULL; @@ -145,7 +145,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus) sizeof(struct pcibus_bussoft *)) { printk(KERN_ERR "%s: Invalid vendor data length %d\n", - __func__, vendor->byte_length); + __FUNCTION__, vendor->byte_length); kfree(buffer.pointer); return NULL; } @@ -184,7 +184,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info, if (ACPI_FAILURE(status)) { printk(KERN_ERR "%s: acpi_get_vendor_resource() failed (0x%x) for: ", - __func__, status); + __FUNCTION__, status); acpi_ns_print_node_pathname(handle, NULL); printk("\n"); return 1; @@ -196,7 +196,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info, sizeof(struct pci_devdev_info *)) { printk(KERN_ERR "%s: Invalid vendor data length: %d for: ", - __func__, vendor->byte_length); + __FUNCTION__, vendor->byte_length); acpi_ns_print_node_pathname(handle, NULL); printk("\n"); ret = 1; @@ -205,7 +205,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info, pcidev_ptr = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL); if (!pcidev_ptr) - panic("%s: Unable to alloc memory for pcidev_info", __func__); + panic("%s: Unable to alloc memory for pcidev_info", __FUNCTION__); memcpy(&addr, vendor->byte_data, sizeof(struct pcidev_info *)); pcidev_prom_ptr = __va(addr); @@ -214,7 +214,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info, /* Get the IRQ info */ irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL); if (!irq_info) - panic("%s: Unable to alloc memory for sn_irq_info", __func__); + panic("%s: Unable to alloc memory for sn_irq_info", __FUNCTION__); if (pcidev_ptr->pdi_sn_irq_info) { irq_info_prom = __va(pcidev_ptr->pdi_sn_irq_info); @@ -249,10 +249,10 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle) status = acpi_get_parent(child, &parent); if (ACPI_FAILURE(status)) { printk(KERN_ERR "%s: acpi_get_parent() failed " - "(0x%x) for: ", __func__, status); + "(0x%x) for: ", __FUNCTION__, status); acpi_ns_print_node_pathname(child, NULL); printk("\n"); - panic("%s: Unable to find host devfn\n", __func__); + panic("%s: Unable to find host devfn\n", __FUNCTION__); } if (parent == rootbus_handle) break; @@ -260,7 +260,7 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle) } if (!child) { printk(KERN_ERR "%s: Unable to find root bus for: ", - __func__); + __FUNCTION__); acpi_ns_print_node_pathname(device_handle, NULL); printk("\n"); BUG(); @@ -269,10 +269,10 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle) status = acpi_evaluate_integer(child, METHOD_NAME__ADR, NULL, &adr); if (ACPI_FAILURE(status)) { printk(KERN_ERR "%s: Unable to get _ADR (0x%x) for: ", - __func__, status); + __FUNCTION__, status); acpi_ns_print_node_pathname(child, NULL); printk("\n"); - panic("%s: Unable to find host devfn\n", __func__); + panic("%s: Unable to find host devfn\n", __FUNCTION__); } slot = (adr >> 16) & 0xffff; @@ -308,7 +308,7 @@ find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv) if (ACPI_FAILURE(status)) { printk(KERN_ERR "%s: acpi_get_parent() failed (0x%x) for: ", - __func__, status); + __FUNCTION__, status); acpi_ns_print_node_pathname(handle, NULL); printk("\n"); return AE_OK; @@ -318,7 +318,7 @@ find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv) if (ACPI_FAILURE(status)) { printk(KERN_ERR "%s: Failed to find _BBN in parent of: ", - __func__); + __FUNCTION__); acpi_ns_print_node_pathname(handle, NULL); printk("\n"); return AE_OK; @@ -358,14 +358,14 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info, if (segment != pci_domain_nr(dev)) { printk(KERN_ERR "%s: Segment number mismatch, 0x%lx vs 0x%x for: ", - __func__, segment, pci_domain_nr(dev)); + __FUNCTION__, segment, pci_domain_nr(dev)); acpi_ns_print_node_pathname(rootbus_handle, NULL); printk("\n"); return 1; } } else { printk(KERN_ERR "%s: Unable to get __SEG from: ", - __func__); + __FUNCTION__); acpi_ns_print_node_pathname(rootbus_handle, NULL); printk("\n"); return 1; @@ -386,7 +386,7 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info, if (!pcidev_match.handle) { printk(KERN_ERR "%s: Could not find matching ACPI device for %s.\n", - __func__, pci_name(dev)); + __FUNCTION__, pci_name(dev)); return 1; } @@ -422,7 +422,7 @@ sn_acpi_slot_fixup(struct pci_dev *dev) if (sn_acpi_get_pcidev_info(dev, &pcidev_info, &sn_irq_info)) { panic("%s: Failure obtaining pcidev_info for %s\n", - __func__, pci_name(dev)); + __FUNCTION__, pci_name(dev)); } if (pcidev_info->pdi_pio_mapped_addr[PCI_ROM_RESOURCE]) { @@ -463,7 +463,7 @@ sn_acpi_bus_fixup(struct pci_bus *bus) printk(KERN_ERR "%s: 0x%04x:0x%02x Unable to " "obtain prom_bussoft_ptr\n", - __func__, pci_domain_nr(bus), bus->number); + __FUNCTION__, pci_domain_nr(bus), bus->number); return; } sn_common_bus_fixup(bus, prom_bussoft_ptr); diff --git a/trunk/arch/ia64/sn/kernel/io_common.c b/trunk/arch/ia64/sn/kernel/io_common.c index 8a924a5661dd..c4eb84f9e781 100644 --- a/trunk/arch/ia64/sn/kernel/io_common.c +++ b/trunk/arch/ia64/sn/kernel/io_common.c @@ -364,7 +364,7 @@ void sn_bus_store_sysdata(struct pci_dev *dev) element = kzalloc(sizeof(struct sysdata_el), GFP_KERNEL); if (!element) { - dev_dbg(&dev->dev, "%s: out of memory!\n", __func__); + dev_dbg(&dev->dev, "%s: out of memory!\n", __FUNCTION__); return; } element->sysdata = SN_PCIDEV_INFO(dev); diff --git a/trunk/arch/ia64/sn/kernel/io_init.c b/trunk/arch/ia64/sn/kernel/io_init.c index c3aa851d1ca6..906b93674b76 100644 --- a/trunk/arch/ia64/sn/kernel/io_init.c +++ b/trunk/arch/ia64/sn/kernel/io_init.c @@ -209,11 +209,11 @@ sn_io_slot_fixup(struct pci_dev *dev) pcidev_info = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL); if (!pcidev_info) - panic("%s: Unable to alloc memory for pcidev_info", __func__); + panic("%s: Unable to alloc memory for pcidev_info", __FUNCTION__); sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL); if (!sn_irq_info) - panic("%s: Unable to alloc memory for sn_irq_info", __func__); + panic("%s: Unable to alloc memory for sn_irq_info", __FUNCTION__); /* Call to retrieve pci device information needed by kernel. */ status = sal_get_pcidev_info((u64) pci_domain_nr(dev), diff --git a/trunk/arch/ia64/sn/kernel/mca.c b/trunk/arch/ia64/sn/kernel/mca.c index 27793f7aa99c..868c9aa64fe2 100644 --- a/trunk/arch/ia64/sn/kernel/mca.c +++ b/trunk/arch/ia64/sn/kernel/mca.c @@ -100,7 +100,7 @@ sn_platform_plat_specific_err_print(const u8 * sect_header, u8 ** oemdata, if (!newbuf) { mutex_unlock(&sn_oemdata_mutex); printk(KERN_ERR "%s: unable to extend sn_oemdata\n", - __func__); + __FUNCTION__); return 1; } vfree(*sn_oemdata); diff --git a/trunk/arch/ia64/sn/pci/pci_dma.c b/trunk/arch/ia64/sn/pci/pci_dma.c index 18b94b792d54..511db2fd7bff 100644 --- a/trunk/arch/ia64/sn/pci/pci_dma.c +++ b/trunk/arch/ia64/sn/pci/pci_dma.c @@ -116,7 +116,7 @@ void *sn_dma_alloc_coherent(struct device *dev, size_t size, *dma_handle = provider->dma_map_consistent(pdev, phys_addr, size, SN_DMA_ADDR_PHYS); if (!*dma_handle) { - printk(KERN_ERR "%s: out of ATEs\n", __func__); + printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); free_pages((unsigned long)cpuaddr, get_order(size)); return NULL; } @@ -179,7 +179,7 @@ dma_addr_t sn_dma_map_single(struct device *dev, void *cpu_addr, size_t size, phys_addr = __pa(cpu_addr); dma_addr = provider->dma_map(pdev, phys_addr, size, SN_DMA_ADDR_PHYS); if (!dma_addr) { - printk(KERN_ERR "%s: out of ATEs\n", __func__); + printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); return 0; } return dma_addr; @@ -266,7 +266,7 @@ int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl, int nhwentries, SN_DMA_ADDR_PHYS); if (!sg->dma_address) { - printk(KERN_ERR "%s: out of ATEs\n", __func__); + printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); /* * Free any successfully allocated entries. diff --git a/trunk/arch/ia64/sn/pci/tioca_provider.c b/trunk/arch/ia64/sn/pci/tioca_provider.c index 529462c01570..ef048a674772 100644 --- a/trunk/arch/ia64/sn/pci/tioca_provider.c +++ b/trunk/arch/ia64/sn/pci/tioca_provider.c @@ -88,7 +88,7 @@ tioca_gart_init(struct tioca_kernel *tioca_kern) break; default: printk(KERN_ERR "%s: Invalid CA_APERATURE_SIZE " - "0x%lx\n", __func__, (ulong) CA_APERATURE_SIZE); + "0x%lx\n", __FUNCTION__, (ulong) CA_APERATURE_SIZE); return -1; } @@ -124,7 +124,7 @@ tioca_gart_init(struct tioca_kernel *tioca_kern) if (!tmp) { printk(KERN_ERR "%s: Could not allocate " "%lu bytes (order %d) for GART\n", - __func__, + __FUNCTION__, tioca_kern->ca_gart_size, get_order(tioca_kern->ca_gart_size)); return -ENOMEM; @@ -341,7 +341,7 @@ tioca_dma_d48(struct pci_dev *pdev, u64 paddr) if (node_upper > 64) { printk(KERN_ERR "%s: coretalk addr 0x%p node id out " - "of range\n", __func__, (void *)ct_addr); + "of range\n", __FUNCTION__, (void *)ct_addr); return 0; } @@ -349,7 +349,7 @@ tioca_dma_d48(struct pci_dev *pdev, u64 paddr) if (node_upper != (agp_dma_extn >> CA_AGP_DMA_NODE_ID_SHFT)) { printk(KERN_ERR "%s: coretalk upper node (%u) " "mismatch with ca_agp_dma_addr_extn (%lu)\n", - __func__, + __FUNCTION__, node_upper, (agp_dma_extn >> CA_AGP_DMA_NODE_ID_SHFT)); return 0; } @@ -597,7 +597,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont if (is_shub1() && sn_sal_rev() < 0x0406) { printk (KERN_ERR "%s: SGI prom rev 4.06 or greater required " - "for tioca support\n", __func__); + "for tioca support\n", __FUNCTION__); return NULL; } @@ -651,7 +651,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont printk(KERN_WARNING "%s: Unable to get irq %d. " "Error interrupts won't be routed for TIOCA bus %d\n", - __func__, SGI_TIOCA_ERROR, + __FUNCTION__, SGI_TIOCA_ERROR, (int)tioca_common->ca_common.bs_persist_busnum); sn_set_err_irq_affinity(SGI_TIOCA_ERROR); diff --git a/trunk/arch/ia64/sn/pci/tioce_provider.c b/trunk/arch/ia64/sn/pci/tioce_provider.c index 9b3c11373022..999f14f986e2 100644 --- a/trunk/arch/ia64/sn/pci/tioce_provider.c +++ b/trunk/arch/ia64/sn/pci/tioce_provider.c @@ -494,7 +494,7 @@ tioce_dma_unmap(struct pci_dev *pdev, dma_addr_t bus_addr, int dir) if (&map->ce_dmamap_list == &ce_kern->ce_dmamap_list) { printk(KERN_WARNING "%s: %s - no map found for bus_addr 0x%lx\n", - __func__, pci_name(pdev), bus_addr); + __FUNCTION__, pci_name(pdev), bus_addr); } else if (--map->refcnt == 0) { for (i = 0; i < map->ate_count; i++) { map->ate_shadow[i] = 0; @@ -1030,7 +1030,7 @@ tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont "%s: Unable to get irq %d. " "Error interrupts won't be routed for " "TIOCE bus %04x:%02x\n", - __func__, SGI_PCIASIC_ERROR, + __FUNCTION__, SGI_PCIASIC_ERROR, tioce_common->ce_pcibus.bs_persist_segment, tioce_common->ce_pcibus.bs_persist_busnum); diff --git a/trunk/arch/s390/Kconfig b/trunk/arch/s390/Kconfig index 1831833c430e..9892827b6176 100644 --- a/trunk/arch/s390/Kconfig +++ b/trunk/arch/s390/Kconfig @@ -351,10 +351,6 @@ endchoice source "fs/Kconfig.binfmt" -config FORCE_MAX_ZONEORDER - int - default "9" - config PROCESS_DEBUG bool "Show crashed user process info" help diff --git a/trunk/arch/s390/defconfig b/trunk/arch/s390/defconfig index 62f6b5a606dd..39921f3a9685 100644 --- a/trunk/arch/s390/defconfig +++ b/trunk/arch/s390/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.25-rc4 -# Wed Mar 5 11:22:59 2008 +# Linux kernel version: 2.6.24 +# Sat Feb 9 12:13:01 2008 # CONFIG_MMU=y CONFIG_ZONE_DMA=y @@ -43,15 +43,12 @@ CONFIG_CGROUPS=y # CONFIG_CGROUP_DEBUG is not set CONFIG_CGROUP_NS=y # CONFIG_CPUSETS is not set -CONFIG_GROUP_SCHED=y CONFIG_FAIR_GROUP_SCHED=y -# CONFIG_RT_GROUP_SCHED is not set -CONFIG_USER_SCHED=y -# CONFIG_CGROUP_SCHED is not set +CONFIG_FAIR_USER_SCHED=y +# CONFIG_FAIR_CGROUP_SCHED is not set # CONFIG_CGROUP_CPUACCT is not set # CONFIG_RESOURCE_COUNTERS is not set CONFIG_SYSFS_DEPRECATED=y -CONFIG_SYSFS_DEPRECATED_V2=y # CONFIG_RELAY is not set CONFIG_NAMESPACES=y CONFIG_UTS_NS=y @@ -88,9 +85,7 @@ CONFIG_SLAB=y # CONFIG_MARKERS is not set CONFIG_HAVE_OPROFILE=y CONFIG_KPROBES=y -CONFIG_KRETPROBES=y CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y CONFIG_PROC_PAGE_MONITOR=y CONFIG_SLABINFO=y CONFIG_RT_MUTEXES=y @@ -190,7 +185,6 @@ CONFIG_IPL=y CONFIG_IPL_VM=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=m -CONFIG_FORCE_MAX_ZONEORDER=9 # CONFIG_PROCESS_DEBUG is not set CONFIG_PFAULT=y # CONFIG_SHARED_KERNEL is not set @@ -441,7 +435,6 @@ CONFIG_DASD_EER=y CONFIG_MISC_DEVICES=y # CONFIG_EEPROM_93CX6 is not set # CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_HAVE_IDE is not set # # SCSI device support @@ -600,7 +593,6 @@ CONFIG_S390_VMUR=m # # Sonics Silicon Backplane # -# CONFIG_MEMSTICK is not set # # File systems @@ -758,6 +750,7 @@ CONFIG_DEBUG_BUGVERBOSE=y # CONFIG_DEBUG_LIST is not set # CONFIG_DEBUG_SG is not set # CONFIG_FRAME_POINTER is not set +CONFIG_FORCED_INLINING=y # CONFIG_RCU_TORTURE_TEST is not set # CONFIG_KPROBES_SANITY_TEST is not set # CONFIG_BACKTRACE_SELF_TEST is not set @@ -766,7 +759,6 @@ CONFIG_DEBUG_BUGVERBOSE=y # CONFIG_LATENCYTOP is not set CONFIG_SAMPLES=y # CONFIG_SAMPLE_KOBJECT is not set -# CONFIG_SAMPLE_KPROBES is not set # CONFIG_DEBUG_PAGEALLOC is not set # diff --git a/trunk/arch/s390/kernel/Makefile b/trunk/arch/s390/kernel/Makefile index 4d3e38392cb1..b3b650a93c7c 100644 --- a/trunk/arch/s390/kernel/Makefile +++ b/trunk/arch/s390/kernel/Makefile @@ -4,11 +4,6 @@ EXTRA_AFLAGS := -traditional -# -# Passing null pointers is ok for smp code, since we access the lowcore here. -# -CFLAGS_smp.o := -Wno-nonnull - obj-y := bitmap.o traps.o time.o process.o base.o early.o \ setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ semaphore.o s390_ext.o debug.o irq.o ipl.o dis.o diag.o diff --git a/trunk/arch/s390/kernel/early.c b/trunk/arch/s390/kernel/early.c index 01832c440636..9f7b73b180f0 100644 --- a/trunk/arch/s390/kernel/early.c +++ b/trunk/arch/s390/kernel/early.c @@ -88,17 +88,13 @@ static noinline __init void create_kernel_nss(void) __cpcmd(defsys_cmd, NULL, 0, &response); - if (response != 0) { - kernel_nss_name[0] = '\0'; + if (response != 0) return; - } __cpcmd(savesys_cmd, NULL, 0, &response); - if (response != strlen(savesys_cmd)) { - kernel_nss_name[0] = '\0'; + if (response != strlen(savesys_cmd)) return; - } ipl_flags = IPL_NSS_VALID; } diff --git a/trunk/arch/s390/kernel/ipl.c b/trunk/arch/s390/kernel/ipl.c index 375232c46c7a..60acdc266db1 100644 --- a/trunk/arch/s390/kernel/ipl.c +++ b/trunk/arch/s390/kernel/ipl.c @@ -704,7 +704,6 @@ void reipl_run(struct shutdown_trigger *trigger) default: break; } - disabled_wait((unsigned long) __builtin_return_address(0)); } static void __init reipl_probe(void) diff --git a/trunk/arch/s390/kernel/process.c b/trunk/arch/s390/kernel/process.c index ce203154d8ce..1c59ec161cf8 100644 --- a/trunk/arch/s390/kernel/process.c +++ b/trunk/arch/s390/kernel/process.c @@ -152,10 +152,6 @@ static void default_idle(void) local_mcck_disable(); if (test_thread_flag(TIF_MCCK_PENDING)) { local_mcck_enable(); - /* disable monitor call class 0 */ - __ctl_clear_bit(8, 15); - atomic_notifier_call_chain(&idle_chain, S390_CPU_NOT_IDLE, - hcpu); local_irq_enable(); s390_handle_mcck(); return; diff --git a/trunk/arch/s390/kernel/smp.c b/trunk/arch/s390/kernel/smp.c index 8f894d380a62..818bd09c0260 100644 --- a/trunk/arch/s390/kernel/smp.c +++ b/trunk/arch/s390/kernel/smp.c @@ -629,8 +629,14 @@ static int __cpuinit smp_alloc_lowcore(int cpu) panic_stack = __get_free_page(GFP_KERNEL); if (!panic_stack || !async_stack) goto out; - memcpy(lowcore, &S390_lowcore, 512); - memset((char *)lowcore + 512, 0, sizeof(*lowcore) - 512); + /* + * Only need to copy the first 512 bytes from address 0. But since + * the compiler emits a warning if src == NULL for memcpy use copy_page + * instead. Copies more than needed but this code is not performance + * critical. + */ + copy_page(lowcore, &S390_lowcore); + memset((void *)lowcore + 512, 0, sizeof(*lowcore) - 512); lowcore->async_stack = async_stack + ASYNC_SIZE; lowcore->panic_stack = panic_stack + PAGE_SIZE; diff --git a/trunk/arch/s390/kernel/time.c b/trunk/arch/s390/kernel/time.c index cb232c155360..76a5dd1b4ce9 100644 --- a/trunk/arch/s390/kernel/time.c +++ b/trunk/arch/s390/kernel/time.c @@ -209,6 +209,8 @@ static void stop_hz_timer(void) */ static void start_hz_timer(void) { + BUG_ON(!in_interrupt()); + if (!cpu_isset(smp_processor_id(), nohz_cpu_mask)) return; account_ticks(get_clock()); diff --git a/trunk/arch/sh/mm/pg-sh7705.c b/trunk/arch/sh/mm/pg-sh7705.c index a4b015f95a3a..7f885b7f8aff 100644 --- a/trunk/arch/sh/mm/pg-sh7705.c +++ b/trunk/arch/sh/mm/pg-sh7705.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/x86/kernel/cpu/cpufreq/e_powersaver.c b/trunk/arch/x86/kernel/cpu/cpufreq/e_powersaver.c index c2f930d86640..39f8cb18296c 100644 --- a/trunk/arch/x86/kernel/cpu/cpufreq/e_powersaver.c +++ b/trunk/arch/x86/kernel/cpu/cpufreq/e_powersaver.c @@ -55,6 +55,7 @@ static int eps_set_state(struct eps_cpu_data *centaur, { struct cpufreq_freqs freqs; u32 lo, hi; + u8 current_multiplier, current_voltage; int err = 0; int i; @@ -94,10 +95,6 @@ static int eps_set_state(struct eps_cpu_data *centaur, rdmsr(MSR_IA32_PERF_STATUS, lo, hi); freqs.new = centaur->fsb * ((lo >> 8) & 0xff); -#ifdef DEBUG - { - u8 current_multiplier, current_voltage; - /* Print voltage and multiplier */ rdmsr(MSR_IA32_PERF_STATUS, lo, hi); current_voltage = lo & 0xff; @@ -106,8 +103,7 @@ static int eps_set_state(struct eps_cpu_data *centaur, current_multiplier = (lo >> 8) & 0xff; printk(KERN_INFO "eps: Current multiplier = %d\n", current_multiplier); - } -#endif + cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); return err; } diff --git a/trunk/crypto/Kconfig b/trunk/crypto/Kconfig index 69f1be6816f7..898acc5c1967 100644 --- a/trunk/crypto/Kconfig +++ b/trunk/crypto/Kconfig @@ -575,7 +575,6 @@ config CRYPTO_TEST config CRYPTO_AUTHENC tristate "Authenc support" select CRYPTO_AEAD - select CRYPTO_BLKCIPHER select CRYPTO_MANAGER select CRYPTO_HASH help diff --git a/trunk/crypto/Makefile b/trunk/crypto/Makefile index 7cf36253a75e..48c758379954 100644 --- a/trunk/crypto/Makefile +++ b/trunk/crypto/Makefile @@ -12,9 +12,9 @@ obj-$(CONFIG_CRYPTO_AEAD) += aead.o crypto_blkcipher-objs := ablkcipher.o crypto_blkcipher-objs += blkcipher.o -crypto_blkcipher-objs += chainiv.o -crypto_blkcipher-objs += eseqiv.o obj-$(CONFIG_CRYPTO_BLKCIPHER) += crypto_blkcipher.o +obj-$(CONFIG_CRYPTO_BLKCIPHER) += chainiv.o +obj-$(CONFIG_CRYPTO_BLKCIPHER) += eseqiv.o obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o crypto_hash-objs := hash.o diff --git a/trunk/crypto/ablkcipher.c b/trunk/crypto/ablkcipher.c index 94140b3756fc..3bcb099b4a85 100644 --- a/trunk/crypto/ablkcipher.c +++ b/trunk/crypto/ablkcipher.c @@ -341,3 +341,6 @@ struct crypto_ablkcipher *crypto_alloc_ablkcipher(const char *alg_name, return ERR_PTR(err); } EXPORT_SYMBOL_GPL(crypto_alloc_ablkcipher); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Asynchronous block chaining cipher type"); diff --git a/trunk/crypto/blkcipher.c b/trunk/crypto/blkcipher.c index 185f955fb0d7..4a7e65c4df4d 100644 --- a/trunk/crypto/blkcipher.c +++ b/trunk/crypto/blkcipher.c @@ -696,34 +696,5 @@ void skcipher_geniv_exit(struct crypto_tfm *tfm) } EXPORT_SYMBOL_GPL(skcipher_geniv_exit); -static int __init blkcipher_module_init(void) -{ - int err; - - err = chainiv_module_init(); - if (err) - goto out; - - err = eseqiv_module_init(); - if (err) - goto eseqiv_err; - -out: - return err; - -eseqiv_err: - chainiv_module_exit(); - goto out; -} - -static void __exit blkcipher_module_exit(void) -{ - eseqiv_module_exit(); - chainiv_module_exit(); -} - -module_init(blkcipher_module_init); -module_exit(blkcipher_module_exit); - MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic block chaining cipher type"); diff --git a/trunk/crypto/chainiv.c b/trunk/crypto/chainiv.c index 0a7cac6e9089..d17fa0454dc3 100644 --- a/trunk/crypto/chainiv.c +++ b/trunk/crypto/chainiv.c @@ -314,14 +314,18 @@ static struct crypto_template chainiv_tmpl = { .module = THIS_MODULE, }; -int __init chainiv_module_init(void) +static int __init chainiv_module_init(void) { return crypto_register_template(&chainiv_tmpl); } -EXPORT_SYMBOL_GPL(chainiv_module_init); -void __exit chainiv_module_exit(void) +static void __exit chainiv_module_exit(void) { crypto_unregister_template(&chainiv_tmpl); } -EXPORT_SYMBOL_GPL(chainiv_module_exit); + +module_init(chainiv_module_init); +module_exit(chainiv_module_exit); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Chain IV Generator"); diff --git a/trunk/crypto/digest.c b/trunk/crypto/digest.c index b526cc348b79..6fd43bddd545 100644 --- a/trunk/crypto/digest.c +++ b/trunk/crypto/digest.c @@ -21,8 +21,6 @@ #include #include -#include "internal.h" - static int init(struct hash_desc *desc) { struct crypto_tfm *tfm = crypto_hash_tfm(desc->tfm); diff --git a/trunk/crypto/eseqiv.c b/trunk/crypto/eseqiv.c index 6f2cd063b6fe..eb90d27ae118 100644 --- a/trunk/crypto/eseqiv.c +++ b/trunk/crypto/eseqiv.c @@ -247,14 +247,18 @@ static struct crypto_template eseqiv_tmpl = { .module = THIS_MODULE, }; -int __init eseqiv_module_init(void) +static int __init eseqiv_module_init(void) { return crypto_register_template(&eseqiv_tmpl); } -EXPORT_SYMBOL_GPL(eseqiv_module_init); -void __exit eseqiv_module_exit(void) +static void __exit eseqiv_module_exit(void) { crypto_unregister_template(&eseqiv_tmpl); } -EXPORT_SYMBOL_GPL(eseqiv_module_exit); + +module_init(eseqiv_module_init); +module_exit(eseqiv_module_exit); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Encrypted Sequence Number IV Generator"); diff --git a/trunk/crypto/xcbc.c b/trunk/crypto/xcbc.c index 2feb0f239c38..86727403e5ab 100644 --- a/trunk/crypto/xcbc.c +++ b/trunk/crypto/xcbc.c @@ -124,11 +124,6 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc, unsigned int offset = sg[i].offset; unsigned int slen = sg[i].length; - if (unlikely(slen > nbytes)) - slen = nbytes; - - nbytes -= slen; - while (slen > 0) { unsigned int len = min(slen, ((unsigned int)(PAGE_SIZE)) - offset); char *p = crypto_kmap(pg, 0) + offset; @@ -182,6 +177,7 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc, offset = 0; pg++; } + nbytes-=sg[i].length; i++; } while (nbytes>0); diff --git a/trunk/crypto/xts.c b/trunk/crypto/xts.c index d87b0f3102c3..8eb08bfaf7c0 100644 --- a/trunk/crypto/xts.c +++ b/trunk/crypto/xts.c @@ -77,16 +77,16 @@ static int setkey(struct crypto_tfm *parent, const u8 *key, } struct sinfo { - be128 *t; + be128 t; struct crypto_tfm *tfm; void (*fn)(struct crypto_tfm *, u8 *, const u8 *); }; static inline void xts_round(struct sinfo *s, void *dst, const void *src) { - be128_xor(dst, s->t, src); /* PP <- T xor P */ + be128_xor(dst, &s->t, src); /* PP <- T xor P */ s->fn(s->tfm, dst, dst); /* CC <- E(Key1,PP) */ - be128_xor(dst, dst, s->t); /* C <- T xor CC */ + be128_xor(dst, dst, &s->t); /* C <- T xor CC */ } static int crypt(struct blkcipher_desc *d, @@ -101,6 +101,7 @@ static int crypt(struct blkcipher_desc *d, .tfm = crypto_cipher_tfm(ctx->child), .fn = fn }; + be128 *iv; u8 *wsrc; u8 *wdst; @@ -108,20 +109,20 @@ static int crypt(struct blkcipher_desc *d, if (!w->nbytes) return err; - s.t = (be128 *)w->iv; avail = w->nbytes; wsrc = w->src.virt.addr; wdst = w->dst.virt.addr; /* calculate first value of T */ - tw(crypto_cipher_tfm(ctx->tweak), w->iv, w->iv); + iv = (be128 *)w->iv; + tw(crypto_cipher_tfm(ctx->tweak), (void *)&s.t, w->iv); goto first; for (;;) { do { - gf128mul_x_ble(s.t, s.t); + gf128mul_x_ble(&s.t, &s.t); first: xts_round(&s, wdst, wsrc); diff --git a/trunk/drivers/ata/ahci.c b/trunk/drivers/ata/ahci.c index 8a49835bd0f8..1db93b619074 100644 --- a/trunk/drivers/ata/ahci.c +++ b/trunk/drivers/ata/ahci.c @@ -186,7 +186,6 @@ enum { AHCI_HFLAG_NO_MSI = (1 << 5), /* no PCI MSI */ AHCI_HFLAG_NO_PMP = (1 << 6), /* no PMP */ AHCI_HFLAG_NO_HOTPLUG = (1 << 7), /* ignore PxSERR.DIAG.N */ - AHCI_HFLAG_SECT255 = (1 << 8), /* max 255 sectors */ /* ap->flags bits */ @@ -256,7 +255,6 @@ static void ahci_vt8251_error_handler(struct ata_port *ap); static void ahci_p5wdh_error_handler(struct ata_port *ap); static void ahci_post_internal_cmd(struct ata_queued_cmd *qc); static int ahci_port_resume(struct ata_port *ap); -static void ahci_dev_config(struct ata_device *dev); static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl); static void ahci_fill_cmd_slot(struct ahci_port_priv *pp, unsigned int tag, u32 opts); @@ -296,8 +294,6 @@ static const struct ata_port_operations ahci_ops = { .check_altstatus = ahci_check_status, .dev_select = ata_noop_dev_select, - .dev_config = ahci_dev_config, - .tf_read = ahci_tf_read, .qc_defer = sata_pmp_qc_defer_cmd_switch, @@ -429,7 +425,7 @@ static const struct ata_port_info ahci_port_info[] = { /* board_ahci_sb600 */ { AHCI_HFLAGS (AHCI_HFLAG_IGN_SERR_INTERNAL | - AHCI_HFLAG_SECT255 | AHCI_HFLAG_NO_PMP), + AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_PMP), .flags = AHCI_FLAG_COMMON, .link_flags = AHCI_LFLAG_COMMON, .pio_mask = 0x1f, /* pio0-4 */ @@ -1180,14 +1176,6 @@ static void ahci_init_controller(struct ata_host *host) VPRINTK("HOST_CTL 0x%x\n", tmp); } -static void ahci_dev_config(struct ata_device *dev) -{ - struct ahci_host_priv *hpriv = dev->link->ap->host->private_data; - - if (hpriv->flags & AHCI_HFLAG_SECT255) - dev->max_sectors = 255; -} - static unsigned int ahci_dev_classify(struct ata_port *ap) { void __iomem *port_mmio = ahci_port_base(ap); diff --git a/trunk/drivers/ata/pata_hpt366.c b/trunk/drivers/ata/pata_hpt366.c index a742efa0da2b..0713872cf65c 100644 --- a/trunk/drivers/ata/pata_hpt366.c +++ b/trunk/drivers/ata/pata_hpt366.c @@ -27,7 +27,7 @@ #include #define DRV_NAME "pata_hpt366" -#define DRV_VERSION "0.6.2" +#define DRV_VERSION "0.6.1" struct hpt_clock { u8 xfer_speed; @@ -180,9 +180,9 @@ static unsigned long hpt366_filter(struct ata_device *adev, unsigned long mask) if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33)) mask &= ~ATA_MASK_UDMA; if (hpt_dma_blacklisted(adev, "UDMA3", bad_ata66_3)) - mask &= ~(0xF8 << ATA_SHIFT_UDMA); + mask &= ~(0x07 << ATA_SHIFT_UDMA); if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4)) - mask &= ~(0xF0 << ATA_SHIFT_UDMA); + mask &= ~(0x0F << ATA_SHIFT_UDMA); } return ata_pci_default_filter(adev, mask); } diff --git a/trunk/drivers/ata/pata_hpt37x.c b/trunk/drivers/ata/pata_hpt37x.c index 9a10878b2ad8..68eb34929cec 100644 --- a/trunk/drivers/ata/pata_hpt37x.c +++ b/trunk/drivers/ata/pata_hpt37x.c @@ -24,7 +24,7 @@ #include #define DRV_NAME "pata_hpt37x" -#define DRV_VERSION "0.6.11" +#define DRV_VERSION "0.6.9" struct hpt_clock { u8 xfer_speed; @@ -281,7 +281,7 @@ static unsigned long hpt370_filter(struct ata_device *adev, unsigned long mask) if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33)) mask &= ~ATA_MASK_UDMA; if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5)) - mask &= ~(0xE0 << ATA_SHIFT_UDMA); + mask &= ~(0x1F << ATA_SHIFT_UDMA); } return ata_pci_default_filter(adev, mask); } @@ -297,7 +297,7 @@ static unsigned long hpt370a_filter(struct ata_device *adev, unsigned long mask) { if (adev->class == ATA_DEV_ATA) { if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5)) - mask &= ~(0xE0 << ATA_SHIFT_UDMA); + mask &= ~ (0x1F << ATA_SHIFT_UDMA); } return ata_pci_default_filter(adev, mask); } diff --git a/trunk/drivers/ata/pata_serverworks.c b/trunk/drivers/ata/pata_serverworks.c index a589c0fa0dbb..9c523fbf529e 100644 --- a/trunk/drivers/ata/pata_serverworks.c +++ b/trunk/drivers/ata/pata_serverworks.c @@ -226,7 +226,7 @@ static unsigned long serverworks_csb_filter(struct ata_device *adev, unsigned lo for (i = 0; (p = csb_bad_ata100[i]) != NULL; i++) { if (!strcmp(p, model_num)) - mask &= ~(0xE0 << ATA_SHIFT_UDMA); + mask &= ~(0x1F << ATA_SHIFT_UDMA); } return ata_pci_default_filter(adev, mask); } diff --git a/trunk/drivers/cpufreq/cpufreq.c b/trunk/drivers/cpufreq/cpufreq.c index 35a26a3e5f68..89a29cd93783 100644 --- a/trunk/drivers/cpufreq/cpufreq.c +++ b/trunk/drivers/cpufreq/cpufreq.c @@ -671,13 +671,13 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr ,char * buf) { struct cpufreq_policy * policy = to_policy(kobj); struct freq_attr * fattr = to_attr(attr); - ssize_t ret = -EINVAL; + ssize_t ret; policy = cpufreq_cpu_get(policy->cpu); if (!policy) - goto no_policy; + return -EINVAL; if (lock_policy_rwsem_read(policy->cpu) < 0) - goto fail; + return -EINVAL; if (fattr->show) ret = fattr->show(policy, buf); @@ -685,9 +685,8 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr ,char * buf) ret = -EIO; unlock_policy_rwsem_read(policy->cpu); -fail: + cpufreq_cpu_put(policy); -no_policy: return ret; } @@ -696,13 +695,13 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr, { struct cpufreq_policy * policy = to_policy(kobj); struct freq_attr * fattr = to_attr(attr); - ssize_t ret = -EINVAL; + ssize_t ret; policy = cpufreq_cpu_get(policy->cpu); if (!policy) - goto no_policy; + return -EINVAL; if (lock_policy_rwsem_write(policy->cpu) < 0) - goto fail; + return -EINVAL; if (fattr->store) ret = fattr->store(policy, buf, count); @@ -710,9 +709,8 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr, ret = -EIO; unlock_policy_rwsem_write(policy->cpu); -fail: + cpufreq_cpu_put(policy); -no_policy: return ret; } @@ -1777,7 +1775,7 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static struct notifier_block __refdata cpufreq_cpu_notifier = +static struct notifier_block __cpuinitdata cpufreq_cpu_notifier = { .notifier_call = cpufreq_cpu_callback, }; diff --git a/trunk/drivers/cpufreq/cpufreq_stats.c b/trunk/drivers/cpufreq/cpufreq_stats.c index 070421a5480e..1b8312b02006 100644 --- a/trunk/drivers/cpufreq/cpufreq_stats.c +++ b/trunk/drivers/cpufreq/cpufreq_stats.c @@ -323,7 +323,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static struct notifier_block cpufreq_stat_cpu_notifier __refdata = +static struct notifier_block cpufreq_stat_cpu_notifier __cpuinitdata = { .notifier_call = cpufreq_stat_cpu_callback, }; diff --git a/trunk/drivers/message/fusion/mptsas.c b/trunk/drivers/message/fusion/mptsas.c index 78734e25edd5..f77b329f6923 100644 --- a/trunk/drivers/message/fusion/mptsas.c +++ b/trunk/drivers/message/fusion/mptsas.c @@ -1701,11 +1701,6 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info, if (error) goto out_free_consistent; - if (!buffer->NumPhys) { - error = -ENODEV; - goto out_free_consistent; - } - /* save config data */ port_info->num_phys = buffer->NumPhys; port_info->phy_info = kcalloc(port_info->num_phys, diff --git a/trunk/drivers/mtd/ubi/build.c b/trunk/drivers/mtd/ubi/build.c index 275960462970..6ac81e35355c 100644 --- a/trunk/drivers/mtd/ubi/build.c +++ b/trunk/drivers/mtd/ubi/build.c @@ -1000,8 +1000,8 @@ static int __init ubi_init(void) mutex_unlock(&ubi_devices_mutex); if (err < 0) { put_mtd_device(mtd); - printk(KERN_ERR "UBI error: cannot attach mtd%d\n", - mtd->index); + printk(KERN_ERR "UBI error: cannot attach %s\n", + p->name); goto out_detach; } } diff --git a/trunk/drivers/mtd/ubi/ubi.h b/trunk/drivers/mtd/ubi/ubi.h index a548c1d28fa8..457710615261 100644 --- a/trunk/drivers/mtd/ubi/ubi.h +++ b/trunk/drivers/mtd/ubi/ubi.h @@ -217,11 +217,11 @@ struct ubi_volume { void *upd_buf; int *eba_tbl; - unsigned int checked:1; - unsigned int corrupted:1; - unsigned int upd_marker:1; - unsigned int updating:1; - unsigned int changing_leb:1; + int checked:1; + int corrupted:1; + int upd_marker:1; + int updating:1; + int changing_leb:1; #ifdef CONFIG_MTD_UBI_GLUEBI /* diff --git a/trunk/drivers/mtd/ubi/vmt.c b/trunk/drivers/mtd/ubi/vmt.c index 5be58d85c639..a3ca2257e601 100644 --- a/trunk/drivers/mtd/ubi/vmt.c +++ b/trunk/drivers/mtd/ubi/vmt.c @@ -376,9 +376,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) get_device(&vol->dev); volume_sysfs_close(vol); out_gluebi: - if (ubi_destroy_gluebi(vol)) - dbg_err("cannot destroy gluebi for volume %d:%d", - ubi->ubi_num, vol_id); + ubi_destroy_gluebi(vol); out_cdev: cdev_del(&vol->cdev); out_mapping: diff --git a/trunk/drivers/mtd/ubi/vtbl.c b/trunk/drivers/mtd/ubi/vtbl.c index af36b12be278..56fc3fbce838 100644 --- a/trunk/drivers/mtd/ubi/vtbl.c +++ b/trunk/drivers/mtd/ubi/vtbl.c @@ -519,7 +519,6 @@ static int init_volumes(struct ubi_device *ubi, const struct ubi_scan_info *si, if (ubi->autoresize_vol_id != -1) { ubi_err("more then one auto-resize volume (%d " "and %d)", ubi->autoresize_vol_id, i); - kfree(vol); return -EINVAL; } diff --git a/trunk/drivers/parisc/ccio-dma.c b/trunk/drivers/parisc/ccio-dma.c index 62db3c3fe4dc..60d338cd8009 100644 --- a/trunk/drivers/parisc/ccio-dma.c +++ b/trunk/drivers/parisc/ccio-dma.c @@ -366,8 +366,8 @@ ccio_alloc_range(struct ioc *ioc, struct device *dev, size_t size) ** ggg sacrifices another 710 to the computer gods. */ - boundary_size = ALIGN((unsigned long long)dma_get_seg_boundary(dev) + 1, - 1ULL << IOVP_SHIFT) >> IOVP_SHIFT; + boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1, 1 << IOVP_SHIFT); + boundary_size >>= IOVP_SHIFT; if (pages_needed <= 8) { /* diff --git a/trunk/drivers/parisc/sba_iommu.c b/trunk/drivers/parisc/sba_iommu.c index bdbe780e21c5..e834127a8505 100644 --- a/trunk/drivers/parisc/sba_iommu.c +++ b/trunk/drivers/parisc/sba_iommu.c @@ -341,8 +341,8 @@ sba_search_bitmap(struct ioc *ioc, struct device *dev, unsigned long shift; int ret; - boundary_size = ALIGN((unsigned long long)dma_get_seg_boundary(dev) + 1, - 1ULL << IOVP_SHIFT) >> IOVP_SHIFT; + boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1, 1 << IOVP_SHIFT); + boundary_size >>= IOVP_SHIFT; #if defined(ZX1_SUPPORT) BUG_ON(ioc->ibase & ~IOVP_MASK); diff --git a/trunk/drivers/s390/block/dasd_3990_erp.c b/trunk/drivers/s390/block/dasd_3990_erp.c index b19db20a0bef..f69714a0e9e7 100644 --- a/trunk/drivers/s390/block/dasd_3990_erp.c +++ b/trunk/drivers/s390/block/dasd_3990_erp.c @@ -2310,8 +2310,10 @@ static int dasd_3990_erp_error_match(struct dasd_ccw_req *cqr1, struct dasd_ccw_req *cqr2) { - if (cqr1->startdev != cqr2->startdev) - return 0; + /* check failed CCW */ + if (cqr1->irb.scsw.cpa != cqr2->irb.scsw.cpa) { + // return 0; /* CCW doesn't match */ + } if (cqr1->irb.esw.esw0.erw.cons != cqr2->irb.esw.esw0.erw.cons) return 0; diff --git a/trunk/drivers/s390/block/dasd_proc.c b/trunk/drivers/s390/block/dasd_proc.c index 556063e8f7a9..28a86f070048 100644 --- a/trunk/drivers/s390/block/dasd_proc.c +++ b/trunk/drivers/s390/block/dasd_proc.c @@ -62,10 +62,8 @@ dasd_devices_show(struct seq_file *m, void *v) return 0; if (device->block) block = device->block; - else { - dasd_put_device(device); + else return 0; - } /* Print device number. */ seq_printf(m, "%s", device->cdev->dev.bus_id); /* Print discipline string. */ diff --git a/trunk/drivers/s390/char/sclp_vt220.c b/trunk/drivers/s390/char/sclp_vt220.c index f7b258dfd52c..92f527201792 100644 --- a/trunk/drivers/s390/char/sclp_vt220.c +++ b/trunk/drivers/s390/char/sclp_vt220.c @@ -367,7 +367,7 @@ sclp_vt220_timeout(unsigned long data) sclp_vt220_emit_current(); } -#define BUFFER_MAX_DELAY HZ/20 +#define BUFFER_MAX_DELAY HZ/2 /* * Internal implementation of the write function. Write COUNT bytes of data diff --git a/trunk/drivers/s390/crypto/ap_bus.c b/trunk/drivers/s390/crypto/ap_bus.c index 7b0b81901297..d0c6fd3b1c19 100644 --- a/trunk/drivers/s390/crypto/ap_bus.c +++ b/trunk/drivers/s390/crypto/ap_bus.c @@ -490,12 +490,10 @@ static int ap_device_probe(struct device *dev) int rc; ap_dev->drv = ap_drv; + spin_lock_bh(&ap_device_lock); + list_add(&ap_dev->list, &ap_device_list); + spin_unlock_bh(&ap_device_lock); rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV; - if (!rc) { - spin_lock_bh(&ap_device_lock); - list_add(&ap_dev->list, &ap_device_list); - spin_unlock_bh(&ap_device_lock); - } return rc; } @@ -534,11 +532,11 @@ static int ap_device_remove(struct device *dev) ap_flush_queue(ap_dev); del_timer_sync(&ap_dev->timeout); + if (ap_drv->remove) + ap_drv->remove(ap_dev); spin_lock_bh(&ap_device_lock); list_del_init(&ap_dev->list); spin_unlock_bh(&ap_device_lock); - if (ap_drv->remove) - ap_drv->remove(ap_dev); spin_lock_bh(&ap_dev->lock); atomic_sub(ap_dev->queue_count, &ap_poll_requests); spin_unlock_bh(&ap_dev->lock); diff --git a/trunk/drivers/scsi/aic94xx/aic94xx.h b/trunk/drivers/scsi/aic94xx/aic94xx.h index eb8efdcefe48..32f513b1b78a 100644 --- a/trunk/drivers/scsi/aic94xx/aic94xx.h +++ b/trunk/drivers/scsi/aic94xx/aic94xx.h @@ -102,7 +102,6 @@ int asd_abort_task_set(struct domain_device *, u8 *lun); int asd_clear_aca(struct domain_device *, u8 *lun); int asd_clear_task_set(struct domain_device *, u8 *lun); int asd_lu_reset(struct domain_device *, u8 *lun); -int asd_I_T_nexus_reset(struct domain_device *dev); int asd_query_task(struct sas_task *); /* ---------- Adapter and Port management ---------- */ diff --git a/trunk/drivers/scsi/aic94xx/aic94xx_hwi.h b/trunk/drivers/scsi/aic94xx/aic94xx_hwi.h index abc757559c1a..150f6706d23f 100644 --- a/trunk/drivers/scsi/aic94xx/aic94xx_hwi.h +++ b/trunk/drivers/scsi/aic94xx/aic94xx_hwi.h @@ -140,7 +140,7 @@ struct asd_ascb { /* internally generated command */ struct timer_list timer; - struct completion *completion; + struct completion completion; u8 tag_valid:1; __be16 tag; /* error recovery only */ @@ -294,6 +294,7 @@ static inline void asd_init_ascb(struct asd_ha_struct *asd_ha, ascb->timer.function = NULL; init_timer(&ascb->timer); ascb->tc_index = -1; + init_completion(&ascb->completion); } /* Must be called with the tc_index_lock held! diff --git a/trunk/drivers/scsi/aic94xx/aic94xx_init.c b/trunk/drivers/scsi/aic94xx/aic94xx_init.c index 88d1e731b65e..5d761eb67442 100644 --- a/trunk/drivers/scsi/aic94xx/aic94xx_init.c +++ b/trunk/drivers/scsi/aic94xx/aic94xx_init.c @@ -1003,7 +1003,7 @@ static struct sas_domain_function_template aic94xx_transport_functions = { .lldd_abort_task_set = asd_abort_task_set, .lldd_clear_aca = asd_clear_aca, .lldd_clear_task_set = asd_clear_task_set, - .lldd_I_T_nexus_reset = asd_I_T_nexus_reset, + .lldd_I_T_nexus_reset = NULL, .lldd_lu_reset = asd_lu_reset, .lldd_query_task = asd_query_task, diff --git a/trunk/drivers/scsi/aic94xx/aic94xx_task.c b/trunk/drivers/scsi/aic94xx/aic94xx_task.c index 008df9ab92a5..965d4bb999d9 100644 --- a/trunk/drivers/scsi/aic94xx/aic94xx_task.c +++ b/trunk/drivers/scsi/aic94xx/aic94xx_task.c @@ -343,13 +343,11 @@ static void asd_task_tasklet_complete(struct asd_ascb *ascb, task->task_state_flags &= ~SAS_TASK_AT_INITIATOR; task->task_state_flags |= SAS_TASK_STATE_DONE; if (unlikely((task->task_state_flags & SAS_TASK_STATE_ABORTED))) { - struct completion *completion = ascb->completion; spin_unlock_irqrestore(&task->task_state_lock, flags); ASD_DPRINTK("task 0x%p done with opcode 0x%x resp 0x%x " "stat 0x%x but aborted by upper layer!\n", task, opcode, ts->resp, ts->stat); - if (completion) - complete(completion); + complete(&ascb->completion); } else { spin_unlock_irqrestore(&task->task_state_lock, flags); task->lldd_task = NULL; diff --git a/trunk/drivers/scsi/aic94xx/aic94xx_tmf.c b/trunk/drivers/scsi/aic94xx/aic94xx_tmf.c index b9ac8f703a1d..144f5ad20453 100644 --- a/trunk/drivers/scsi/aic94xx/aic94xx_tmf.c +++ b/trunk/drivers/scsi/aic94xx/aic94xx_tmf.c @@ -53,64 +53,50 @@ static int asd_enqueue_internal(struct asd_ascb *ascb, return res; } -/* ---------- CLEAR NEXUS ---------- */ +static inline void asd_timedout_common(unsigned long data) +{ + struct asd_ascb *ascb = (void *) data; + struct asd_seq_data *seq = &ascb->ha->seq; + unsigned long flags; -struct tasklet_completion_status { - int dl_opcode; - int tmf_state; - u8 tag_valid:1; - __be16 tag; -}; - -#define DECLARE_TCS(tcs) \ - struct tasklet_completion_status tcs = { \ - .dl_opcode = 0, \ - .tmf_state = 0, \ - .tag_valid = 0, \ - .tag = 0, \ - } + spin_lock_irqsave(&seq->pend_q_lock, flags); + seq->pending--; + list_del_init(&ascb->list); + spin_unlock_irqrestore(&seq->pend_q_lock, flags); +} +/* ---------- CLEAR NEXUS ---------- */ static void asd_clear_nexus_tasklet_complete(struct asd_ascb *ascb, struct done_list_struct *dl) { - struct tasklet_completion_status *tcs = ascb->uldd_task; ASD_DPRINTK("%s: here\n", __FUNCTION__); if (!del_timer(&ascb->timer)) { ASD_DPRINTK("%s: couldn't delete timer\n", __FUNCTION__); return; } ASD_DPRINTK("%s: opcode: 0x%x\n", __FUNCTION__, dl->opcode); - tcs->dl_opcode = dl->opcode; - complete(ascb->completion); - asd_ascb_free(ascb); + ascb->uldd_task = (void *) (unsigned long) dl->opcode; + complete(&ascb->completion); } static void asd_clear_nexus_timedout(unsigned long data) { - struct asd_ascb *ascb = (void *)data; - struct tasklet_completion_status *tcs = ascb->uldd_task; + struct asd_ascb *ascb = (void *) data; ASD_DPRINTK("%s: here\n", __FUNCTION__); - tcs->dl_opcode = TMF_RESP_FUNC_FAILED; - complete(ascb->completion); + asd_timedout_common(data); + ascb->uldd_task = (void *) TMF_RESP_FUNC_FAILED; + complete(&ascb->completion); } #define CLEAR_NEXUS_PRE \ - struct asd_ascb *ascb; \ - struct scb *scb; \ - int res; \ - DECLARE_COMPLETION_ONSTACK(completion); \ - DECLARE_TCS(tcs); \ - \ ASD_DPRINTK("%s: PRE\n", __FUNCTION__); \ res = 1; \ ascb = asd_ascb_alloc_list(asd_ha, &res, GFP_KERNEL); \ if (!ascb) \ return -ENOMEM; \ \ - ascb->completion = &completion; \ - ascb->uldd_task = &tcs; \ scb = ascb->scb; \ scb->header.opcode = CLEAR_NEXUS @@ -121,11 +107,10 @@ static void asd_clear_nexus_timedout(unsigned long data) if (res) \ goto out_err; \ ASD_DPRINTK("%s: clear nexus posted, waiting...\n", __FUNCTION__); \ - wait_for_completion(&completion); \ - res = tcs.dl_opcode; \ + wait_for_completion(&ascb->completion); \ + res = (int) (unsigned long) ascb->uldd_task; \ if (res == TC_NO_ERROR) \ res = TMF_RESP_FUNC_COMPLETE; \ - return res; \ out_err: \ asd_ascb_free(ascb); \ return res @@ -133,6 +118,9 @@ out_err: \ int asd_clear_nexus_ha(struct sas_ha_struct *sas_ha) { struct asd_ha_struct *asd_ha = sas_ha->lldd_ha; + struct asd_ascb *ascb; + struct scb *scb; + int res; CLEAR_NEXUS_PRE; scb->clear_nexus.nexus = NEXUS_ADAPTER; @@ -142,6 +130,9 @@ int asd_clear_nexus_ha(struct sas_ha_struct *sas_ha) int asd_clear_nexus_port(struct asd_sas_port *port) { struct asd_ha_struct *asd_ha = port->ha->lldd_ha; + struct asd_ascb *ascb; + struct scb *scb; + int res; CLEAR_NEXUS_PRE; scb->clear_nexus.nexus = NEXUS_PORT; @@ -149,73 +140,29 @@ int asd_clear_nexus_port(struct asd_sas_port *port) CLEAR_NEXUS_POST; } -enum clear_nexus_phase { - NEXUS_PHASE_PRE, - NEXUS_PHASE_POST, - NEXUS_PHASE_RESUME, -}; - -static int asd_clear_nexus_I_T(struct domain_device *dev, - enum clear_nexus_phase phase) +#if 0 +static int asd_clear_nexus_I_T(struct domain_device *dev) { struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; + struct asd_ascb *ascb; + struct scb *scb; + int res; CLEAR_NEXUS_PRE; scb->clear_nexus.nexus = NEXUS_I_T; - switch (phase) { - case NEXUS_PHASE_PRE: - scb->clear_nexus.flags = EXEC_Q | SUSPEND_TX; - break; - case NEXUS_PHASE_POST: - scb->clear_nexus.flags = SEND_Q | NOTINQ; - break; - case NEXUS_PHASE_RESUME: - scb->clear_nexus.flags = RESUME_TX; - } + scb->clear_nexus.flags = SEND_Q | EXEC_Q | NOTINQ; scb->clear_nexus.conn_handle = cpu_to_le16((u16)(unsigned long) dev->lldd_dev); CLEAR_NEXUS_POST; } - -int asd_I_T_nexus_reset(struct domain_device *dev) -{ - int res, tmp_res, i; - struct sas_phy *phy = sas_find_local_phy(dev); - /* Standard mandates link reset for ATA (type 0) and - * hard reset for SSP (type 1) */ - int reset_type = (dev->dev_type == SATA_DEV || - (dev->tproto & SAS_PROTOCOL_STP)) ? 0 : 1; - - asd_clear_nexus_I_T(dev, NEXUS_PHASE_PRE); - /* send a hard reset */ - ASD_DPRINTK("sending %s reset to %s\n", - reset_type ? "hard" : "soft", phy->dev.bus_id); - res = sas_phy_reset(phy, reset_type); - if (res == TMF_RESP_FUNC_COMPLETE) { - /* wait for the maximum settle time */ - msleep(500); - /* clear all outstanding commands (keep nexus suspended) */ - asd_clear_nexus_I_T(dev, NEXUS_PHASE_POST); - } - for (i = 0 ; i < 3; i++) { - tmp_res = asd_clear_nexus_I_T(dev, NEXUS_PHASE_RESUME); - if (tmp_res == TC_RESUME) - return res; - msleep(500); - } - - /* This is a bit of a problem: the sequencer is still suspended - * and is refusing to resume. Hope it will resume on a bigger hammer - * or the disk is lost */ - dev_printk(KERN_ERR, &phy->dev, - "Failed to resume nexus after reset 0x%x\n", tmp_res); - - return TMF_RESP_FUNC_FAILED; -} +#endif static int asd_clear_nexus_I_T_L(struct domain_device *dev, u8 *lun) { struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; + struct asd_ascb *ascb; + struct scb *scb; + int res; CLEAR_NEXUS_PRE; scb->clear_nexus.nexus = NEXUS_I_T_L; @@ -230,6 +177,9 @@ static int asd_clear_nexus_tag(struct sas_task *task) { struct asd_ha_struct *asd_ha = task->dev->port->ha->lldd_ha; struct asd_ascb *tascb = task->lldd_task; + struct asd_ascb *ascb; + struct scb *scb; + int res; CLEAR_NEXUS_PRE; scb->clear_nexus.nexus = NEXUS_TAG; @@ -245,6 +195,9 @@ static int asd_clear_nexus_index(struct sas_task *task) { struct asd_ha_struct *asd_ha = task->dev->port->ha->lldd_ha; struct asd_ascb *tascb = task->lldd_task; + struct asd_ascb *ascb; + struct scb *scb; + int res; CLEAR_NEXUS_PRE; scb->clear_nexus.nexus = NEXUS_TRANS_CX; @@ -260,11 +213,11 @@ static int asd_clear_nexus_index(struct sas_task *task) static void asd_tmf_timedout(unsigned long data) { struct asd_ascb *ascb = (void *) data; - struct tasklet_completion_status *tcs = ascb->uldd_task; ASD_DPRINTK("tmf timed out\n"); - tcs->tmf_state = TMF_RESP_FUNC_FAILED; - complete(ascb->completion); + asd_timedout_common(data); + ascb->uldd_task = (void *) TMF_RESP_FUNC_FAILED; + complete(&ascb->completion); } static int asd_get_tmf_resp_tasklet(struct asd_ascb *ascb, @@ -316,24 +269,18 @@ static int asd_get_tmf_resp_tasklet(struct asd_ascb *ascb, static void asd_tmf_tasklet_complete(struct asd_ascb *ascb, struct done_list_struct *dl) { - struct tasklet_completion_status *tcs; - if (!del_timer(&ascb->timer)) return; - tcs = ascb->uldd_task; ASD_DPRINTK("tmf tasklet complete\n"); - tcs->dl_opcode = dl->opcode; - - if (dl->opcode == TC_SSP_RESP) { - tcs->tmf_state = asd_get_tmf_resp_tasklet(ascb, dl); - tcs->tag_valid = ascb->tag_valid; - tcs->tag = ascb->tag; - } + if (dl->opcode == TC_SSP_RESP) + ascb->uldd_task = (void *) (unsigned long) + asd_get_tmf_resp_tasklet(ascb, dl); + else + ascb->uldd_task = (void *) 0xFF00 + (unsigned long) dl->opcode; - complete(ascb->completion); - asd_ascb_free(ascb); + complete(&ascb->completion); } static inline int asd_clear_nexus(struct sas_task *task) @@ -341,19 +288,15 @@ static inline int asd_clear_nexus(struct sas_task *task) int res = TMF_RESP_FUNC_FAILED; int leftover; struct asd_ascb *tascb = task->lldd_task; - DECLARE_COMPLETION_ONSTACK(completion); unsigned long flags; - tascb->completion = &completion; - ASD_DPRINTK("task not done, clearing nexus\n"); if (tascb->tag_valid) res = asd_clear_nexus_tag(task); else res = asd_clear_nexus_index(task); - leftover = wait_for_completion_timeout(&completion, + leftover = wait_for_completion_timeout(&tascb->completion, AIC94XX_SCB_TIMEOUT); - tascb->completion = NULL; ASD_DPRINTK("came back from clear nexus\n"); spin_lock_irqsave(&task->task_state_lock, flags); if (leftover < 1) @@ -407,11 +350,6 @@ int asd_abort_task(struct sas_task *task) struct asd_ascb *ascb = NULL; struct scb *scb; int leftover; - DECLARE_TCS(tcs); - DECLARE_COMPLETION_ONSTACK(completion); - DECLARE_COMPLETION_ONSTACK(tascb_completion); - - tascb->completion = &tascb_completion; spin_lock_irqsave(&task->task_state_lock, flags); if (task->task_state_flags & SAS_TASK_STATE_DONE) { @@ -425,10 +363,8 @@ int asd_abort_task(struct sas_task *task) ascb = asd_ascb_alloc_list(asd_ha, &res, GFP_KERNEL); if (!ascb) return -ENOMEM; - - ascb->uldd_task = &tcs; - ascb->completion = &completion; scb = ascb->scb; + scb->header.opcode = SCB_ABORT_TASK; switch (task->task_proto) { @@ -470,12 +406,13 @@ int asd_abort_task(struct sas_task *task) res = asd_enqueue_internal(ascb, asd_tmf_tasklet_complete, asd_tmf_timedout); if (res) - goto out_free; - wait_for_completion(&completion); + goto out; + wait_for_completion(&ascb->completion); ASD_DPRINTK("tmf came back\n"); - tascb->tag = tcs.tag; - tascb->tag_valid = tcs.tag_valid; + res = (int) (unsigned long) ascb->uldd_task; + tascb->tag = ascb->tag; + tascb->tag_valid = ascb->tag_valid; spin_lock_irqsave(&task->task_state_lock, flags); if (task->task_state_flags & SAS_TASK_STATE_DONE) { @@ -486,68 +423,63 @@ int asd_abort_task(struct sas_task *task) } spin_unlock_irqrestore(&task->task_state_lock, flags); - if (tcs.dl_opcode == TC_SSP_RESP) { - /* The task to be aborted has been sent to the device. - * We got a Response IU for the ABORT TASK TMF. */ - if (tcs.tmf_state == TMF_RESP_FUNC_COMPLETE) - res = asd_clear_nexus(task); - else - res = tcs.tmf_state; - } else if (tcs.dl_opcode == TC_NO_ERROR && - tcs.tmf_state == TMF_RESP_FUNC_FAILED) { - /* timeout */ + switch (res) { + /* The task to be aborted has been sent to the device. + * We got a Response IU for the ABORT TASK TMF. */ + case TC_NO_ERROR + 0xFF00: + case TMF_RESP_FUNC_COMPLETE: + case TMF_RESP_FUNC_FAILED: + res = asd_clear_nexus(task); + break; + case TMF_RESP_INVALID_FRAME: + case TMF_RESP_OVERLAPPED_TAG: + case TMF_RESP_FUNC_ESUPP: + case TMF_RESP_NO_LUN: + goto out_done; break; + } + /* In the following we assume that the managing layer + * will _never_ make a mistake, when issuing ABORT TASK. + */ + switch (res) { + default: + res = asd_clear_nexus(task); + /* fallthrough */ + case TC_NO_ERROR + 0xFF00: + case TMF_RESP_FUNC_COMPLETE: + break; + /* The task hasn't been sent to the device xor we never got + * a (sane) Response IU for the ABORT TASK TMF. + */ + case TF_NAK_RECV + 0xFF00: + res = TMF_RESP_INVALID_FRAME; + break; + case TF_TMF_TASK_DONE + 0xFF00: /* done but not reported yet */ res = TMF_RESP_FUNC_FAILED; - } else { - /* In the following we assume that the managing layer - * will _never_ make a mistake, when issuing ABORT - * TASK. - */ - switch (tcs.dl_opcode) { - default: - res = asd_clear_nexus(task); - /* fallthrough */ - case TC_NO_ERROR: - break; - /* The task hasn't been sent to the device xor - * we never got a (sane) Response IU for the - * ABORT TASK TMF. - */ - case TF_NAK_RECV: - res = TMF_RESP_INVALID_FRAME; - break; - case TF_TMF_TASK_DONE: /* done but not reported yet */ + leftover = wait_for_completion_timeout(&tascb->completion, + AIC94XX_SCB_TIMEOUT); + spin_lock_irqsave(&task->task_state_lock, flags); + if (leftover < 1) res = TMF_RESP_FUNC_FAILED; - leftover = - wait_for_completion_timeout(&tascb_completion, - AIC94XX_SCB_TIMEOUT); - spin_lock_irqsave(&task->task_state_lock, flags); - if (leftover < 1) - res = TMF_RESP_FUNC_FAILED; - if (task->task_state_flags & SAS_TASK_STATE_DONE) - res = TMF_RESP_FUNC_COMPLETE; - spin_unlock_irqrestore(&task->task_state_lock, flags); - break; - case TF_TMF_NO_TAG: - case TF_TMF_TAG_FREE: /* the tag is in the free list */ - case TF_TMF_NO_CONN_HANDLE: /* no such device */ + if (task->task_state_flags & SAS_TASK_STATE_DONE) res = TMF_RESP_FUNC_COMPLETE; - break; - case TF_TMF_NO_CTX: /* not in seq, or proto != SSP */ - res = TMF_RESP_FUNC_ESUPP; - break; - } + spin_unlock_irqrestore(&task->task_state_lock, flags); + goto out_done; + case TF_TMF_NO_TAG + 0xFF00: + case TF_TMF_TAG_FREE + 0xFF00: /* the tag is in the free list */ + case TF_TMF_NO_CONN_HANDLE + 0xFF00: /* no such device */ + res = TMF_RESP_FUNC_COMPLETE; + goto out_done; + case TF_TMF_NO_CTX + 0xFF00: /* not in seq, or proto != SSP */ + res = TMF_RESP_FUNC_ESUPP; + goto out; } - out_done: - tascb->completion = NULL; +out_done: if (res == TMF_RESP_FUNC_COMPLETE) { task->lldd_task = NULL; mb(); asd_ascb_free(tascb); } - ASD_DPRINTK("task 0x%p aborted, res: 0x%x\n", task, res); - return res; - - out_free: +out: asd_ascb_free(ascb); ASD_DPRINTK("task 0x%p aborted, res: 0x%x\n", task, res); return res; @@ -575,8 +507,6 @@ static int asd_initiate_ssp_tmf(struct domain_device *dev, u8 *lun, struct asd_ascb *ascb; int res = 1; struct scb *scb; - DECLARE_COMPLETION_ONSTACK(completion); - DECLARE_TCS(tcs); if (!(dev->tproto & SAS_PROTOCOL_SSP)) return TMF_RESP_FUNC_ESUPP; @@ -584,9 +514,6 @@ static int asd_initiate_ssp_tmf(struct domain_device *dev, u8 *lun, ascb = asd_ascb_alloc_list(asd_ha, &res, GFP_KERNEL); if (!ascb) return -ENOMEM; - - ascb->completion = &completion; - ascb->uldd_task = &tcs; scb = ascb->scb; if (tmf == TMF_QUERY_TASK) @@ -619,32 +546,31 @@ static int asd_initiate_ssp_tmf(struct domain_device *dev, u8 *lun, asd_tmf_timedout); if (res) goto out_err; - wait_for_completion(&completion); + wait_for_completion(&ascb->completion); + res = (int) (unsigned long) ascb->uldd_task; - switch (tcs.dl_opcode) { - case TC_NO_ERROR: + switch (res) { + case TC_NO_ERROR + 0xFF00: res = TMF_RESP_FUNC_COMPLETE; break; - case TF_NAK_RECV: + case TF_NAK_RECV + 0xFF00: res = TMF_RESP_INVALID_FRAME; break; - case TF_TMF_TASK_DONE: + case TF_TMF_TASK_DONE + 0xFF00: res = TMF_RESP_FUNC_FAILED; break; - case TF_TMF_NO_TAG: - case TF_TMF_TAG_FREE: /* the tag is in the free list */ - case TF_TMF_NO_CONN_HANDLE: /* no such device */ + case TF_TMF_NO_TAG + 0xFF00: + case TF_TMF_TAG_FREE + 0xFF00: /* the tag is in the free list */ + case TF_TMF_NO_CONN_HANDLE + 0xFF00: /* no such device */ res = TMF_RESP_FUNC_COMPLETE; break; - case TF_TMF_NO_CTX: /* not in seq, or proto != SSP */ + case TF_TMF_NO_CTX + 0xFF00: /* not in seq, or proto != SSP */ res = TMF_RESP_FUNC_ESUPP; break; default: /* Allow TMF response codes to propagate upwards */ - res = tcs.dl_opcode; break; } - return res; out_err: asd_ascb_free(ascb); return res; diff --git a/trunk/drivers/scsi/arcmsr/arcmsr.h b/trunk/drivers/scsi/arcmsr/arcmsr.h index 0393707bdfce..57786502e3ec 100644 --- a/trunk/drivers/scsi/arcmsr/arcmsr.h +++ b/trunk/drivers/scsi/arcmsr/arcmsr.h @@ -48,7 +48,7 @@ struct class_device_attribute; /*The limit of outstanding scsi command that firmware can handle*/ #define ARCMSR_MAX_OUTSTANDING_CMD 256 #define ARCMSR_MAX_FREECCB_NUM 320 -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.15 2008/02/27" +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.15 2007/12/24" #define ARCMSR_SCSI_INITIATOR_ID 255 #define ARCMSR_MAX_XFER_SECTORS 512 #define ARCMSR_MAX_XFER_SECTORS_B 4096 diff --git a/trunk/drivers/scsi/gdth.c b/trunk/drivers/scsi/gdth.c index 27ebd336409b..6d67f5c0eb8e 100644 --- a/trunk/drivers/scsi/gdth.c +++ b/trunk/drivers/scsi/gdth.c @@ -160,7 +160,7 @@ static void gdth_readapp_event(gdth_ha_str *ha, unchar application, static void gdth_clear_events(void); static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp, - char *buffer, ushort count); + char *buffer, ushort count, int to_buffer); static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp); static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, ushort hdrive); @@ -182,6 +182,7 @@ static int gdth_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, unsigned long arg); static void gdth_flush(gdth_ha_str *ha); +static int gdth_halt(struct notifier_block *nb, ulong event, void *buf); static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *)); static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, struct gdth_cmndinfo *cmndinfo); @@ -416,6 +417,12 @@ static inline void gdth_set_sglist(struct scsi_cmnd *cmd, #include "gdth_proc.h" #include "gdth_proc.c" +/* notifier block to get a notify on system shutdown/halt/reboot */ +static struct notifier_block gdth_notifier = { + gdth_halt, NULL, 0 +}; +static int notifier_disabled = 0; + static gdth_ha_str *gdth_find_ha(int hanum) { gdth_ha_str *ha; @@ -438,8 +445,8 @@ static struct gdth_cmndinfo *gdth_get_cmndinfo(gdth_ha_str *ha) for (i=0; icmndinfo[i].index == 0) { priv = &ha->cmndinfo[i]; - memset(priv, 0, sizeof(*priv)); priv->index = i+1; + memset(priv, 0, sizeof(*priv)); break; } } @@ -486,6 +493,7 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd, gdth_ha_str *ha = shost_priv(sdev->host); Scsi_Cmnd *scp; struct gdth_cmndinfo cmndinfo; + struct scatterlist one_sg; DECLARE_COMPLETION_ONSTACK(wait); int rval; @@ -499,10 +507,13 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd, /* use request field to save the ptr. to completion struct. */ scp->request = (struct request *)&wait; scp->timeout_per_command = timeout*HZ; + sg_init_one(&one_sg, gdtcmd, sizeof(*gdtcmd)); + gdth_set_sglist(scp, &one_sg); + gdth_set_sg_count(scp, 1); + gdth_set_bufflen(scp, sizeof(*gdtcmd)); scp->cmd_len = 12; memcpy(scp->cmnd, cmnd, 12); cmndinfo.priority = IOCTL_PRI; - cmndinfo.internal_cmd_str = gdtcmd; cmndinfo.internal_command = 1; TRACE(("__gdth_execute() cmd 0x%x\n", scp->cmnd[0])); @@ -2344,7 +2355,7 @@ static void gdth_next(gdth_ha_str *ha) * buffers, kmap_atomic() as needed. */ static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp, - char *buffer, ushort count) + char *buffer, ushort count, int to_buffer) { ushort cpcount,i, max_sg = gdth_sg_count(scp); ushort cpsum,cpnow; @@ -2370,7 +2381,10 @@ static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp, } local_irq_save(flags); address = kmap_atomic(sg_page(sl), KM_BIO_SRC_IRQ) + sl->offset; - memcpy(address, buffer, cpnow); + if (to_buffer) + memcpy(buffer, address, cpnow); + else + memcpy(address, buffer, cpnow); flush_dcache_page(sg_page(sl)); kunmap_atomic(address, KM_BIO_SRC_IRQ); local_irq_restore(flags); @@ -2424,7 +2438,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp) strcpy(inq.vendor,ha->oem_name); sprintf(inq.product,"Host Drive #%02d",t); strcpy(inq.revision," "); - gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data)); + gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data), 0); break; case REQUEST_SENSE: @@ -2434,7 +2448,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp) sd.key = NO_SENSE; sd.info = 0; sd.add_length= 0; - gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data)); + gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data), 0); break; case MODE_SENSE: @@ -2446,7 +2460,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp) mpd.bd.block_length[0] = (SECTOR_SIZE & 0x00ff0000) >> 16; mpd.bd.block_length[1] = (SECTOR_SIZE & 0x0000ff00) >> 8; mpd.bd.block_length[2] = (SECTOR_SIZE & 0x000000ff); - gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data)); + gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data), 0); break; case READ_CAPACITY: @@ -2456,7 +2470,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp) else rdc.last_block_no = cpu_to_be32(ha->hdr[t].size-1); rdc.block_length = cpu_to_be32(SECTOR_SIZE); - gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data)); + gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data), 0); break; case SERVICE_ACTION_IN: @@ -2468,7 +2482,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp) rdc16.last_block_no = cpu_to_be64(ha->hdr[t].size-1); rdc16.block_length = cpu_to_be32(SECTOR_SIZE); gdth_copy_internal_data(ha, scp, (char*)&rdc16, - sizeof(gdth_rdcap16_data)); + sizeof(gdth_rdcap16_data), 0); } else { scp->result = DID_ABORT << 16; } @@ -2838,7 +2852,6 @@ static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar b) static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp) { register gdth_cmd_str *cmdp; - struct gdth_cmndinfo *cmndinfo = gdth_cmnd_priv(scp); int cmd_index; cmdp= ha->pccb; @@ -2847,7 +2860,7 @@ static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp) if (ha->type==GDT_EISA && ha->cmd_cnt>0) return 0; - *cmdp = *cmndinfo->internal_cmd_str; + gdth_copy_internal_data(ha, scp, (char *)cmdp, sizeof(gdth_cmd_str), 1); cmdp->RequestBuffer = scp; /* search free command index */ @@ -3781,8 +3794,6 @@ static void gdth_timeout(ulong data) gdth_ha_str *ha; ulong flags; - BUG_ON(list_empty(&gdth_instances)); - ha = list_first_entry(&gdth_instances, gdth_ha_str, list); spin_lock_irqsave(&ha->smp_lock, flags); @@ -4658,6 +4669,45 @@ static void gdth_flush(gdth_ha_str *ha) } } +/* shutdown routine */ +static int gdth_halt(struct notifier_block *nb, ulong event, void *buf) +{ + gdth_ha_str *ha; +#ifndef __alpha__ + gdth_cmd_str gdtcmd; + char cmnd[MAX_COMMAND_SIZE]; +#endif + + if (notifier_disabled) + return NOTIFY_OK; + + TRACE2(("gdth_halt() event %d\n",(int)event)); + if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF) + return NOTIFY_DONE; + + notifier_disabled = 1; + printk("GDT-HA: Flushing all host drives .. "); + list_for_each_entry(ha, &gdth_instances, list) { + gdth_flush(ha); + +#ifndef __alpha__ + /* controller reset */ + memset(cmnd, 0xff, MAX_COMMAND_SIZE); + gdtcmd.BoardNode = LOCALBOARD; + gdtcmd.Service = CACHESERVICE; + gdtcmd.OpCode = GDT_RESET; + TRACE2(("gdth_halt(): reset controller %d\n", ha->hanum)); + gdth_execute(ha->shost, &gdtcmd, cmnd, 10, NULL); +#endif + } + printk("Done.\n"); + +#ifdef GDTH_STATISTICS + del_timer(&gdth_timer); +#endif + return NOTIFY_OK; +} + /* configure lun */ static int gdth_slave_configure(struct scsi_device *sdev) { @@ -5092,13 +5142,13 @@ static void gdth_remove_one(gdth_ha_str *ha) scsi_remove_host(shp); - gdth_flush(ha); - if (ha->sdev) { scsi_free_host_dev(ha->sdev); ha->sdev = NULL; } + gdth_flush(ha); + if (shp->irq) free_irq(shp->irq,ha); @@ -5124,24 +5174,6 @@ static void gdth_remove_one(gdth_ha_str *ha) scsi_host_put(shp); } -static int gdth_halt(struct notifier_block *nb, ulong event, void *buf) -{ - gdth_ha_str *ha; - - TRACE2(("gdth_halt() event %d\n", (int)event)); - if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF) - return NOTIFY_DONE; - - list_for_each_entry(ha, &gdth_instances, list) - gdth_flush(ha); - - return NOTIFY_OK; -} - -static struct notifier_block gdth_notifier = { - gdth_halt, NULL, 0 -}; - static int __init gdth_init(void) { if (disable) { @@ -5204,6 +5236,7 @@ static int __init gdth_init(void) add_timer(&gdth_timer); #endif major = register_chrdev(0,"gdth", &gdth_fops); + notifier_disabled = 0; register_reboot_notifier(&gdth_notifier); gdth_polling = FALSE; return 0; @@ -5213,15 +5246,14 @@ static void __exit gdth_exit(void) { gdth_ha_str *ha; - unregister_chrdev(major, "gdth"); - unregister_reboot_notifier(&gdth_notifier); + list_for_each_entry(ha, &gdth_instances, list) + gdth_remove_one(ha); #ifdef GDTH_STATISTICS - del_timer_sync(&gdth_timer); + del_timer(&gdth_timer); #endif - - list_for_each_entry(ha, &gdth_instances, list) - gdth_remove_one(ha); + unregister_chrdev(major,"gdth"); + unregister_reboot_notifier(&gdth_notifier); } module_init(gdth_init); diff --git a/trunk/drivers/scsi/gdth.h b/trunk/drivers/scsi/gdth.h index 26e4e92515e0..1434c6b0297c 100644 --- a/trunk/drivers/scsi/gdth.h +++ b/trunk/drivers/scsi/gdth.h @@ -915,7 +915,6 @@ typedef struct { struct gdth_cmndinfo { /* per-command private info */ int index; int internal_command; /* don't call scsi_done */ - gdth_cmd_str *internal_cmd_str; /* crier for internal messages*/ dma_addr_t sense_paddr; /* sense dma-addr */ unchar priority; int timeout; diff --git a/trunk/drivers/scsi/ibmvscsi/ibmvstgt.c b/trunk/drivers/scsi/ibmvscsi/ibmvstgt.c index e5881e92d0fb..bd62131b97a1 100644 --- a/trunk/drivers/scsi/ibmvscsi/ibmvstgt.c +++ b/trunk/drivers/scsi/ibmvscsi/ibmvstgt.c @@ -290,7 +290,7 @@ static int ibmvstgt_cmd_done(struct scsi_cmnd *sc, int err = 0; dprintk("%p %p %x %u\n", iue, target, vio_iu(iue)->srp.cmd.cdb[0], - scsi_sg_count(sc)); + cmd->usg_sg); if (scsi_sg_count(sc)) err = srp_transfer_data(sc, &vio_iu(iue)->srp.cmd, ibmvstgt_rdma, 1, 1); @@ -838,6 +838,9 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id) if (!shost) goto free_vport; shost->transportt = ibmvstgt_transport_template; + err = scsi_tgt_alloc_queue(shost); + if (err) + goto put_host; target = host_to_srp_target(shost); target->shost = shost; @@ -869,10 +872,6 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id) if (err) goto destroy_queue; - err = scsi_tgt_alloc_queue(shost); - if (err) - goto destroy_queue; - return 0; destroy_queue: crq_queue_destroy(target); diff --git a/trunk/drivers/scsi/libiscsi.c b/trunk/drivers/scsi/libiscsi.c index bdd7de7da39a..59f8445eab0d 100644 --- a/trunk/drivers/scsi/libiscsi.c +++ b/trunk/drivers/scsi/libiscsi.c @@ -1708,8 +1708,8 @@ iscsi_session_setup(struct iscsi_transport *iscsit, qdepth = ISCSI_DEF_CMD_PER_LUN; } - if (!is_power_of_2(cmds_max) || cmds_max >= ISCSI_MGMT_ITT_OFFSET || - cmds_max < 2) { + if (!is_power_of_2(cmds_max) || + cmds_max >= ISCSI_MGMT_ITT_OFFSET) { if (cmds_max != 0) printk(KERN_ERR "iscsi: invalid can_queue of %d. " "can_queue must be a power of 2 and between " diff --git a/trunk/drivers/scsi/libsas/sas_ata.c b/trunk/drivers/scsi/libsas/sas_ata.c index b0e5ac372a32..7cd05b599a12 100644 --- a/trunk/drivers/scsi/libsas/sas_ata.c +++ b/trunk/drivers/scsi/libsas/sas_ata.c @@ -236,12 +236,12 @@ static void sas_ata_phy_reset(struct ata_port *ap) struct domain_device *dev = ap->private_data; struct sas_internal *i = to_sas_internal(dev->port->ha->core.shost->transportt); - int res = TMF_RESP_FUNC_FAILED; + int res = 0; if (i->dft->lldd_I_T_nexus_reset) res = i->dft->lldd_I_T_nexus_reset(dev); - if (res != TMF_RESP_FUNC_COMPLETE) + if (res) SAS_DPRINTK("%s: Unable to reset I T nexus?\n", __FUNCTION__); switch (dev->sata_dev.command_set) { @@ -656,6 +656,21 @@ static int sas_issue_ata_cmd(struct domain_device *dev, u8 command, return res; } +static void sas_sata_propagate_sas_addr(struct domain_device *dev) +{ + unsigned long flags; + struct asd_sas_port *port = dev->port; + struct asd_sas_phy *phy; + + BUG_ON(dev->parent); + + memcpy(port->attached_sas_addr, dev->sas_addr, SAS_ADDR_SIZE); + spin_lock_irqsave(&port->phy_list_lock, flags); + list_for_each_entry(phy, &port->phy_list, port_phy_el) + memcpy(phy->attached_sas_addr, dev->sas_addr, SAS_ADDR_SIZE); + spin_unlock_irqrestore(&port->phy_list_lock, flags); +} + #define ATA_IDENTIFY_DEV 0xEC #define ATA_IDENTIFY_PACKET_DEV 0xA1 #define ATA_SET_FEATURES 0xEF @@ -713,6 +728,26 @@ static int sas_discover_sata_dev(struct domain_device *dev) goto out_err; } cont1: + /* Get WWN */ + if (dev->port->oob_mode != SATA_OOB_MODE) { + memcpy(dev->sas_addr, dev->sata_dev.rps_resp.rps.stp_sas_addr, + SAS_ADDR_SIZE); + } else if (dev->sata_dev.command_set == ATA_COMMAND_SET && + (le16_to_cpu(dev->sata_dev.identify_device[108]) & 0xF000) + == 0x5000) { + int i; + + for (i = 0; i < 4; i++) { + dev->sas_addr[2*i] = + (le16_to_cpu(dev->sata_dev.identify_device[108+i]) & 0xFF00) >> 8; + dev->sas_addr[2*i+1] = + le16_to_cpu(dev->sata_dev.identify_device[108+i]) & 0x00FF; + } + } + sas_hash_addr(dev->hashed_sas_addr, dev->sas_addr); + if (!dev->parent) + sas_sata_propagate_sas_addr(dev); + /* XXX Hint: register this SATA device with SATL. When this returns, dev->sata_dev->lu is alive and present. diff --git a/trunk/drivers/scsi/libsas/sas_port.c b/trunk/drivers/scsi/libsas/sas_port.c index 39ae68a3b0ef..e1e2d085c920 100644 --- a/trunk/drivers/scsi/libsas/sas_port.c +++ b/trunk/drivers/scsi/libsas/sas_port.c @@ -92,6 +92,9 @@ static void sas_form_port(struct asd_sas_phy *phy) if (!port->phy) port->phy = phy->phy; + SAS_DPRINTK("phy%d added to port%d, phy_mask:0x%x\n", phy->id, + port->id, port->phy_mask); + if (*(u64 *)port->attached_sas_addr == 0) { port->class = phy->class; memcpy(port->attached_sas_addr, phy->attached_sas_addr, @@ -112,11 +115,6 @@ static void sas_form_port(struct asd_sas_phy *phy) } sas_port_add_phy(port->port, phy->phy); - SAS_DPRINTK("%s added to %s, phy_mask:0x%x (%16llx)\n", - phy->phy->dev.bus_id,port->port->dev.bus_id, - port->phy_mask, - SAS_ADDR(port->attached_sas_addr)); - if (port->port_dev) port->port_dev->pathways = port->num_phys; @@ -257,11 +255,12 @@ void sas_porte_hard_reset(struct work_struct *work) static void sas_init_port(struct asd_sas_port *port, struct sas_ha_struct *sas_ha, int i) { - memset(port, 0, sizeof(*port)); port->id = i; INIT_LIST_HEAD(&port->dev_list); spin_lock_init(&port->phy_list_lock); INIT_LIST_HEAD(&port->phy_list); + port->num_phys = 0; + port->phy_mask = 0; port->ha = sas_ha; spin_lock_init(&port->dev_list_lock); diff --git a/trunk/drivers/scsi/libsas/sas_scsi_host.c b/trunk/drivers/scsi/libsas/sas_scsi_host.c index 1f8241563c6c..704ea06a6e50 100644 --- a/trunk/drivers/scsi/libsas/sas_scsi_host.c +++ b/trunk/drivers/scsi/libsas/sas_scsi_host.c @@ -434,7 +434,7 @@ static int sas_recover_I_T(struct domain_device *dev) } /* Find the sas_phy that's attached to this device */ -struct sas_phy *sas_find_local_phy(struct domain_device *dev) +static struct sas_phy *find_local_sas_phy(struct domain_device *dev) { struct domain_device *pdev = dev->parent; struct ex_phy *exphy = NULL; @@ -456,7 +456,6 @@ struct sas_phy *sas_find_local_phy(struct domain_device *dev) BUG_ON(!exphy); return exphy->phy; } -EXPORT_SYMBOL_GPL(sas_find_local_phy); /* Attempt to send a LUN reset message to a device */ int sas_eh_device_reset_handler(struct scsi_cmnd *cmd) @@ -483,7 +482,7 @@ int sas_eh_device_reset_handler(struct scsi_cmnd *cmd) int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd) { struct domain_device *dev = cmd_to_domain_dev(cmd); - struct sas_phy *phy = sas_find_local_phy(dev); + struct sas_phy *phy = find_local_sas_phy(dev); int res; res = sas_phy_reset(phy, 1); @@ -498,10 +497,10 @@ int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd) } /* Try to reset a device */ -static int try_to_reset_cmd_device(struct scsi_cmnd *cmd) +static int try_to_reset_cmd_device(struct Scsi_Host *shost, + struct scsi_cmnd *cmd) { int res; - struct Scsi_Host *shost = cmd->device->host; if (!shost->hostt->eh_device_reset_handler) goto try_bus_reset; @@ -541,12 +540,6 @@ static int sas_eh_handle_sas_errors(struct Scsi_Host *shost, need_reset = task->task_state_flags & SAS_TASK_NEED_DEV_RESET; spin_unlock_irqrestore(&task->task_state_lock, flags); - if (need_reset) { - SAS_DPRINTK("%s: task 0x%p requests reset\n", - __FUNCTION__, task); - goto reset; - } - SAS_DPRINTK("trying to find task 0x%p\n", task); res = sas_scsi_find_task(task); @@ -557,15 +550,18 @@ static int sas_eh_handle_sas_errors(struct Scsi_Host *shost, SAS_DPRINTK("%s: task 0x%p is done\n", __FUNCTION__, task); sas_eh_finish_cmd(cmd); + if (need_reset) + try_to_reset_cmd_device(shost, cmd); continue; case TASK_IS_ABORTED: SAS_DPRINTK("%s: task 0x%p is aborted\n", __FUNCTION__, task); sas_eh_finish_cmd(cmd); + if (need_reset) + try_to_reset_cmd_device(shost, cmd); continue; case TASK_IS_AT_LU: SAS_DPRINTK("task 0x%p is at LU: lu recover\n", task); - reset: tmf_resp = sas_recover_lu(task->dev, cmd); if (tmf_resp == TMF_RESP_FUNC_COMPLETE) { SAS_DPRINTK("dev %016llx LU %x is " @@ -573,6 +569,8 @@ static int sas_eh_handle_sas_errors(struct Scsi_Host *shost, SAS_ADDR(task->dev), cmd->device->lun); sas_eh_finish_cmd(cmd); + if (need_reset) + try_to_reset_cmd_device(shost, cmd); sas_scsi_clear_queue_lu(work_q, cmd); goto Again; } @@ -583,15 +581,15 @@ static int sas_eh_handle_sas_errors(struct Scsi_Host *shost, task); tmf_resp = sas_recover_I_T(task->dev); if (tmf_resp == TMF_RESP_FUNC_COMPLETE) { - struct domain_device *dev = task->dev; SAS_DPRINTK("I_T %016llx recovered\n", SAS_ADDR(task->dev->sas_addr)); sas_eh_finish_cmd(cmd); - sas_scsi_clear_queue_I_T(work_q, dev); + if (need_reset) + try_to_reset_cmd_device(shost, cmd); + sas_scsi_clear_queue_I_T(work_q, task->dev); goto Again; } /* Hammer time :-) */ - try_to_reset_cmd_device(cmd); if (i->dft->lldd_clear_nexus_port) { struct asd_sas_port *port = task->dev->port; SAS_DPRINTK("clearing nexus for port:%d\n", @@ -601,6 +599,8 @@ static int sas_eh_handle_sas_errors(struct Scsi_Host *shost, SAS_DPRINTK("clear nexus port:%d " "succeeded\n", port->id); sas_eh_finish_cmd(cmd); + if (need_reset) + try_to_reset_cmd_device(shost, cmd); sas_scsi_clear_queue_port(work_q, port); goto Again; @@ -613,6 +613,8 @@ static int sas_eh_handle_sas_errors(struct Scsi_Host *shost, SAS_DPRINTK("clear nexus ha " "succeeded\n"); sas_eh_finish_cmd(cmd); + if (need_reset) + try_to_reset_cmd_device(shost, cmd); goto clear_q; } } @@ -626,6 +628,8 @@ static int sas_eh_handle_sas_errors(struct Scsi_Host *shost, cmd->device->lun); sas_eh_finish_cmd(cmd); + if (need_reset) + try_to_reset_cmd_device(shost, cmd); goto clear_q; } } diff --git a/trunk/drivers/scsi/mvsas.c b/trunk/drivers/scsi/mvsas.c index 5ec0665b3a3d..d4a6ac3c9c47 100644 --- a/trunk/drivers/scsi/mvsas.c +++ b/trunk/drivers/scsi/mvsas.c @@ -40,7 +40,7 @@ #include #define DRV_NAME "mvsas" -#define DRV_VERSION "0.5.1" +#define DRV_VERSION "0.5" #define _MV_DUMP 0 #define MVS_DISABLE_NVRAM #define MVS_DISABLE_MSI @@ -1005,7 +1005,7 @@ static int mvs_nvram_read(struct mvs_info *mvi, u32 addr, return rc; #else /* FIXME , For SAS target mode */ - memcpy(buf, "\x50\x05\x04\x30\x11\xab\x00\x00", 8); + memcpy(buf, "\x00\x00\xab\x11\x30\x04\x05\x50", 8); return 0; #endif } @@ -1330,7 +1330,7 @@ static int mvs_int_rx(struct mvs_info *mvi, bool self_clear) mvs_hba_cq_dump(mvi); - if (likely(rx_desc & RXQ_DONE)) + if (unlikely(rx_desc & RXQ_DONE)) mvs_slot_complete(mvi, rx_desc); if (rx_desc & RXQ_ATTN) { attn = true; @@ -2720,8 +2720,9 @@ static int __devinit mvs_hw_init(struct mvs_info *mvi) msleep(100); /* init and reset phys */ for (i = 0; i < mvi->chip->n_phy; i++) { - u32 lo = be32_to_cpu(*(u32 *)&mvi->sas_addr[4]); - u32 hi = be32_to_cpu(*(u32 *)&mvi->sas_addr[0]); + /* FIXME: is this the correct dword order? */ + u32 lo = *((u32 *)&mvi->sas_addr[0]); + u32 hi = *((u32 *)&mvi->sas_addr[4]); mvs_detect_porttype(mvi, i); diff --git a/trunk/drivers/scsi/ps3rom.c b/trunk/drivers/scsi/ps3rom.c index fad6cb5cba28..0cd614a0fa73 100644 --- a/trunk/drivers/scsi/ps3rom.c +++ b/trunk/drivers/scsi/ps3rom.c @@ -124,7 +124,7 @@ static int fill_from_dev_buffer(struct scsi_cmnd *cmd, const void *buf) } req_len += sgpnt->length; } - scsi_set_resid(cmd, buflen - act_len); + scsi_set_resid(cmd, req_len - act_len); return 0; } @@ -427,7 +427,7 @@ static struct scsi_host_template ps3rom_host_template = { .cmd_per_lun = 1, .emulated = 1, /* only sg driver uses this */ .max_sectors = PS3ROM_MAX_SECTORS, - .use_clustering = DISABLE_CLUSTERING, + .use_clustering = ENABLE_CLUSTERING, .module = THIS_MODULE, }; diff --git a/trunk/drivers/scsi/qla2xxx/qla_gs.c b/trunk/drivers/scsi/qla2xxx/qla_gs.c index c1808763d40e..6226d88479f5 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_gs.c +++ b/trunk/drivers/scsi/qla2xxx/qla_gs.c @@ -39,7 +39,7 @@ qla2x00_prep_ms_iocb(scsi_qla_host_t *ha, uint32_t req_size, uint32_t rsp_size) ms_pkt->entry_count = 1; SET_TARGET_ID(ha, ms_pkt->loop_id, SIMPLE_NAME_SERVER); ms_pkt->control_flags = __constant_cpu_to_le16(CF_READ | CF_HEAD_TAG); - ms_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2); + ms_pkt->timeout = __constant_cpu_to_le16(25); ms_pkt->cmd_dsd_count = __constant_cpu_to_le16(1); ms_pkt->total_dsd_count = __constant_cpu_to_le16(2); ms_pkt->rsp_bytecount = cpu_to_le32(rsp_size); @@ -75,7 +75,7 @@ qla24xx_prep_ms_iocb(scsi_qla_host_t *ha, uint32_t req_size, uint32_t rsp_size) ct_pkt->entry_type = CT_IOCB_TYPE; ct_pkt->entry_count = 1; ct_pkt->nport_handle = __constant_cpu_to_le16(NPH_SNS); - ct_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2); + ct_pkt->timeout = __constant_cpu_to_le16(25); ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1); ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1); ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size); @@ -1144,7 +1144,7 @@ qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *ha, uint32_t req_size, ms_pkt->entry_count = 1; SET_TARGET_ID(ha, ms_pkt->loop_id, ha->mgmt_svr_loop_id); ms_pkt->control_flags = __constant_cpu_to_le16(CF_READ | CF_HEAD_TAG); - ms_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2); + ms_pkt->timeout = __constant_cpu_to_le16(59); ms_pkt->cmd_dsd_count = __constant_cpu_to_le16(1); ms_pkt->total_dsd_count = __constant_cpu_to_le16(2); ms_pkt->rsp_bytecount = cpu_to_le32(rsp_size); @@ -1181,7 +1181,7 @@ qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *ha, uint32_t req_size, ct_pkt->entry_type = CT_IOCB_TYPE; ct_pkt->entry_count = 1; ct_pkt->nport_handle = cpu_to_le16(ha->mgmt_svr_loop_id); - ct_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2); + ct_pkt->timeout = __constant_cpu_to_le16(59); ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1); ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1); ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size); @@ -1761,7 +1761,7 @@ qla24xx_prep_ms_fm_iocb(scsi_qla_host_t *ha, uint32_t req_size, ct_pkt->entry_type = CT_IOCB_TYPE; ct_pkt->entry_count = 1; ct_pkt->nport_handle = cpu_to_le16(ha->mgmt_svr_loop_id); - ct_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2); + ct_pkt->timeout = __constant_cpu_to_le16(59); ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1); ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1); ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size); diff --git a/trunk/drivers/scsi/qla2xxx/qla_init.c b/trunk/drivers/scsi/qla2xxx/qla_init.c index 364be7d06875..d5c7853e7eba 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_init.c +++ b/trunk/drivers/scsi/qla2xxx/qla_init.c @@ -1733,8 +1733,8 @@ qla2x00_nvram_config(scsi_qla_host_t *ha) ha->login_timeout = nv->login_timeout; icb->login_timeout = nv->login_timeout; - /* Set minimum RATOV to 100 tenths of a second. */ - ha->r_a_tov = 100; + /* Set minimum RATOV to 200 tenths of a second. */ + ha->r_a_tov = 200; ha->loop_reset_delay = nv->reset_delay; @@ -3645,8 +3645,8 @@ qla24xx_nvram_config(scsi_qla_host_t *ha) ha->login_timeout = le16_to_cpu(nv->login_timeout); icb->login_timeout = cpu_to_le16(nv->login_timeout); - /* Set minimum RATOV to 100 tenths of a second. */ - ha->r_a_tov = 100; + /* Set minimum RATOV to 200 tenths of a second. */ + ha->r_a_tov = 200; ha->loop_reset_delay = nv->reset_delay; @@ -4022,8 +4022,7 @@ qla2x00_try_to_stop_firmware(scsi_qla_host_t *ha) return; ret = qla2x00_stop_firmware(ha); - for (retries = 5; ret != QLA_SUCCESS && ret != QLA_FUNCTION_TIMEOUT && - retries ; retries--) { + for (retries = 5; ret != QLA_SUCCESS && retries ; retries--) { qla2x00_reset_chip(ha); if (qla2x00_chip_diag(ha) != QLA_SUCCESS) continue; diff --git a/trunk/drivers/scsi/qla2xxx/qla_isr.c b/trunk/drivers/scsi/qla2xxx/qla_isr.c index f0337036c7bb..14e6f22944b7 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_isr.c +++ b/trunk/drivers/scsi/qla2xxx/qla_isr.c @@ -958,11 +958,6 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) } } - /* Check for overrun. */ - if (IS_FWI2_CAPABLE(ha) && comp_status == CS_COMPLETE && - scsi_status & SS_RESIDUAL_OVER) - comp_status = CS_DATA_OVERRUN; - /* * Based on Host and scsi status generate status code for Linux */ diff --git a/trunk/drivers/scsi/qla2xxx/qla_mbx.c b/trunk/drivers/scsi/qla2xxx/qla_mbx.c index bb103580e1ba..99d29fff836d 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_mbx.c +++ b/trunk/drivers/scsi/qla2xxx/qla_mbx.c @@ -2206,7 +2206,7 @@ qla24xx_abort_target(fc_port_t *fcport) tsk->p.tsk.entry_type = TSK_MGMT_IOCB_TYPE; tsk->p.tsk.entry_count = 1; tsk->p.tsk.nport_handle = cpu_to_le16(fcport->loop_id); - tsk->p.tsk.timeout = cpu_to_le16(ha->r_a_tov / 10 * 2); + tsk->p.tsk.timeout = __constant_cpu_to_le16(25); tsk->p.tsk.control_flags = __constant_cpu_to_le32(TCF_TARGET_RESET); tsk->p.tsk.port_id[0] = fcport->d_id.b.al_pa; tsk->p.tsk.port_id[1] = fcport->d_id.b.area; diff --git a/trunk/drivers/scsi/qla2xxx/qla_version.h b/trunk/drivers/scsi/qla2xxx/qla_version.h index ea08a129fee9..c5742cc15abb 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_version.h +++ b/trunk/drivers/scsi/qla2xxx/qla_version.h @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION "8.02.00-k9" +#define QLA2XXX_VERSION "8.02.00-k8" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 2 diff --git a/trunk/drivers/scsi/qla4xxx/ql4_init.c b/trunk/drivers/scsi/qla4xxx/ql4_init.c index 109c5f5985ec..10b3b9a620f3 100644 --- a/trunk/drivers/scsi/qla4xxx/ql4_init.c +++ b/trunk/drivers/scsi/qla4xxx/ql4_init.c @@ -1299,9 +1299,9 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, ddb_entry->fw_ddb_device_state = state; /* Device is back online. */ if (ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE) { - atomic_set(&ddb_entry->state, DDB_STATE_ONLINE); atomic_set(&ddb_entry->port_down_timer, ha->port_down_retry_count); + atomic_set(&ddb_entry->state, DDB_STATE_ONLINE); atomic_set(&ddb_entry->relogin_retry_count, 0); atomic_set(&ddb_entry->relogin_timer, 0); clear_bit(DF_RELOGIN, &ddb_entry->flags); diff --git a/trunk/drivers/scsi/qla4xxx/ql4_os.c b/trunk/drivers/scsi/qla4xxx/ql4_os.c index 8b92f348f02c..c3c59d763037 100644 --- a/trunk/drivers/scsi/qla4xxx/ql4_os.c +++ b/trunk/drivers/scsi/qla4xxx/ql4_os.c @@ -75,7 +75,6 @@ static int qla4xxx_eh_host_reset(struct scsi_cmnd *cmd); static int qla4xxx_slave_alloc(struct scsi_device *device); static int qla4xxx_slave_configure(struct scsi_device *device); static void qla4xxx_slave_destroy(struct scsi_device *sdev); -static void qla4xxx_scan_start(struct Scsi_Host *shost); static struct scsi_host_template qla4xxx_driver_template = { .module = THIS_MODULE, @@ -91,7 +90,6 @@ static struct scsi_host_template qla4xxx_driver_template = { .slave_destroy = qla4xxx_slave_destroy, .scan_finished = iscsi_scan_finished, - .scan_start = qla4xxx_scan_start, .this_id = -1, .cmd_per_lun = 3, @@ -301,18 +299,6 @@ struct ddb_entry *qla4xxx_alloc_sess(struct scsi_qla_host *ha) return ddb_entry; } -static void qla4xxx_scan_start(struct Scsi_Host *shost) -{ - struct scsi_qla_host *ha = shost_priv(shost); - struct ddb_entry *ddb_entry, *ddbtemp; - - /* finish setup of sessions that were already setup in firmware */ - list_for_each_entry_safe(ddb_entry, ddbtemp, &ha->ddb_list, list) { - if (ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE) - qla4xxx_add_sess(ddb_entry); - } -} - /* * Timer routines */ @@ -878,9 +864,8 @@ static void qla4xxx_flush_active_srbs(struct scsi_qla_host *ha) * qla4xxx_recover_adapter - recovers adapter after a fatal error * @ha: Pointer to host adapter structure. * @renew_ddb_list: Indicates what to do with the adapter's ddb list - * - * renew_ddb_list value can be 0=preserve ddb list, 1=destroy and rebuild - * ddb list. + * after adapter recovery has completed. + * 0=preserve ddb list, 1=destroy and rebuild ddb list **/ static int qla4xxx_recover_adapter(struct scsi_qla_host *ha, uint8_t renew_ddb_list) @@ -889,7 +874,6 @@ static int qla4xxx_recover_adapter(struct scsi_qla_host *ha, /* Stall incoming I/O until we are done */ clear_bit(AF_ONLINE, &ha->flags); - DEBUG2(printk("scsi%ld: %s calling qla4xxx_cmd_wait\n", ha->host_no, __func__)); @@ -1192,6 +1176,7 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev, int ret = -ENODEV, status; struct Scsi_Host *host; struct scsi_qla_host *ha; + struct ddb_entry *ddb_entry, *ddbtemp; uint8_t init_retry_count = 0; char buf[34]; @@ -1310,6 +1295,13 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev, if (ret) goto probe_failed; + /* Update transport device information for all devices. */ + list_for_each_entry_safe(ddb_entry, ddbtemp, &ha->ddb_list, list) { + if (ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE) + if (qla4xxx_add_sess(ddb_entry)) + goto remove_host; + } + printk(KERN_INFO " QLogic iSCSI HBA Driver version: %s\n" " QLogic ISP%04x @ %s, host#=%ld, fw=%02d.%02d.%02d.%02d\n", @@ -1319,6 +1311,10 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev, scsi_scan_host(host); return 0; +remove_host: + qla4xxx_free_ddb_list(ha); + scsi_remove_host(host); + probe_failed: qla4xxx_free_adapter(ha); scsi_host_put(ha->host); @@ -1604,12 +1600,9 @@ static int qla4xxx_eh_host_reset(struct scsi_cmnd *cmd) return FAILED; } - /* make sure the dpc thread is stopped while we reset the hba */ - clear_bit(AF_ONLINE, &ha->flags); - flush_workqueue(ha->dpc_thread); - - if (qla4xxx_recover_adapter(ha, PRESERVE_DDB_LIST) == QLA_SUCCESS) + if (qla4xxx_recover_adapter(ha, PRESERVE_DDB_LIST) == QLA_SUCCESS) { return_status = SUCCESS; + } dev_info(&ha->pdev->dev, "HOST RESET %s.\n", return_status == FAILED ? "FAILED" : "SUCCEDED"); diff --git a/trunk/drivers/scsi/scsi_tgt_lib.c b/trunk/drivers/scsi/scsi_tgt_lib.c index a0f308bd145b..3677fbb30b72 100644 --- a/trunk/drivers/scsi/scsi_tgt_lib.c +++ b/trunk/drivers/scsi/scsi_tgt_lib.c @@ -103,6 +103,7 @@ struct scsi_cmnd *scsi_host_get_command(struct Scsi_Host *shost, if (!cmd) goto release_rq; + memset(cmd, 0, sizeof(*cmd)); cmd->sc_data_direction = data_dir; cmd->jiffies_at_alloc = jiffies; cmd->request = rq; @@ -381,11 +382,6 @@ static int scsi_map_user_pages(struct scsi_tgt_cmd *tcmd, struct scsi_cmnd *cmd, scsi_release_buffers(cmd); goto unmap_rq; } - /* - * we use REQ_TYPE_BLOCK_PC so scsi_init_io doesn't set the - * length for us. - */ - cmd->sdb.length = rq->data_len; return 0; diff --git a/trunk/drivers/scsi/scsi_transport_iscsi.c b/trunk/drivers/scsi/scsi_transport_iscsi.c index ca7bb6f63bde..9981682d5302 100644 --- a/trunk/drivers/scsi/scsi_transport_iscsi.c +++ b/trunk/drivers/scsi/scsi_transport_iscsi.c @@ -33,7 +33,7 @@ #define ISCSI_SESSION_ATTRS 19 #define ISCSI_CONN_ATTRS 13 #define ISCSI_HOST_ATTRS 4 -#define ISCSI_TRANSPORT_VERSION "2.0-869" +#define ISCSI_TRANSPORT_VERSION "2.0-868" struct iscsi_internal { int daemon_pid; @@ -373,25 +373,24 @@ static void session_recovery_timedout(struct work_struct *work) scsi_target_unblock(&session->dev); } -static void __iscsi_unblock_session(struct work_struct *work) +static void __iscsi_unblock_session(struct iscsi_cls_session *session) +{ + if (!cancel_delayed_work(&session->recovery_work)) + flush_workqueue(iscsi_eh_timer_workq); + scsi_target_unblock(&session->dev); +} + +void iscsi_unblock_session(struct iscsi_cls_session *session) { - struct iscsi_cls_session *session = - container_of(work, struct iscsi_cls_session, - unblock_work); struct Scsi_Host *shost = iscsi_session_to_shost(session); struct iscsi_host *ihost = shost->shost_data; unsigned long flags; - /* - * The recovery and unblock work get run from the same workqueue, - * so try to cancel it if it was going to run after this unblock. - */ - cancel_delayed_work(&session->recovery_work); spin_lock_irqsave(&session->lock, flags); session->state = ISCSI_SESSION_LOGGED_IN; spin_unlock_irqrestore(&session->lock, flags); - /* start IO */ - scsi_target_unblock(&session->dev); + + __iscsi_unblock_session(session); /* * Only do kernel scanning if the driver is properly hooked into * the async scanning code (drivers like iscsi_tcp do login and @@ -402,43 +401,20 @@ static void __iscsi_unblock_session(struct work_struct *work) atomic_inc(&ihost->nr_scans); } } - -/** - * iscsi_unblock_session - set a session as logged in and start IO. - * @session: iscsi session - * - * Mark a session as ready to accept IO. - */ -void iscsi_unblock_session(struct iscsi_cls_session *session) -{ - queue_work(iscsi_eh_timer_workq, &session->unblock_work); - /* - * make sure all the events have completed before tell the driver - * it is safe - */ - flush_workqueue(iscsi_eh_timer_workq); -} EXPORT_SYMBOL_GPL(iscsi_unblock_session); -static void __iscsi_block_session(struct work_struct *work) +void iscsi_block_session(struct iscsi_cls_session *session) { - struct iscsi_cls_session *session = - container_of(work, struct iscsi_cls_session, - block_work); unsigned long flags; spin_lock_irqsave(&session->lock, flags); session->state = ISCSI_SESSION_FAILED; spin_unlock_irqrestore(&session->lock, flags); + scsi_target_block(&session->dev); queue_delayed_work(iscsi_eh_timer_workq, &session->recovery_work, session->recovery_tmo * HZ); } - -void iscsi_block_session(struct iscsi_cls_session *session) -{ - queue_work(iscsi_eh_timer_workq, &session->block_work); -} EXPORT_SYMBOL_GPL(iscsi_block_session); static void __iscsi_unbind_session(struct work_struct *work) @@ -487,8 +463,6 @@ iscsi_alloc_session(struct Scsi_Host *shost, INIT_DELAYED_WORK(&session->recovery_work, session_recovery_timedout); INIT_LIST_HEAD(&session->host_list); INIT_LIST_HEAD(&session->sess_list); - INIT_WORK(&session->unblock_work, __iscsi_unblock_session); - INIT_WORK(&session->block_work, __iscsi_block_session); INIT_WORK(&session->unbind_work, __iscsi_unbind_session); INIT_WORK(&session->scan_work, iscsi_scan_session); spin_lock_init(&session->lock); @@ -601,25 +575,24 @@ void iscsi_remove_session(struct iscsi_cls_session *session) list_del(&session->sess_list); spin_unlock_irqrestore(&sesslock, flags); - /* make sure there are no blocks/unblocks queued */ - flush_workqueue(iscsi_eh_timer_workq); - /* make sure the timedout callout is not running */ - if (!cancel_delayed_work(&session->recovery_work)) - flush_workqueue(iscsi_eh_timer_workq); /* * If we are blocked let commands flow again. The lld or iscsi * layer should set up the queuecommand to fail commands. - * We assume that LLD will not be calling block/unblock while - * removing the session. */ spin_lock_irqsave(&session->lock, flags); session->state = ISCSI_SESSION_FREE; spin_unlock_irqrestore(&session->lock, flags); + __iscsi_unblock_session(session); + __iscsi_unbind_session(&session->unbind_work); - scsi_target_unblock(&session->dev); - /* flush running scans then delete devices */ + /* flush running scans */ flush_workqueue(ihost->scan_workq); - __iscsi_unbind_session(&session->unbind_work); + /* + * If the session dropped while removing devices then we need to make + * sure it is not blocked + */ + if (!cancel_delayed_work(&session->recovery_work)) + flush_workqueue(iscsi_eh_timer_workq); /* hw iscsi may not have removed all connections from session */ err = device_for_each_child(&session->dev, NULL, @@ -829,16 +802,23 @@ EXPORT_SYMBOL_GPL(iscsi_recv_pdu); void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error) { + struct iscsi_cls_session *session = iscsi_conn_to_session(conn); struct nlmsghdr *nlh; struct sk_buff *skb; struct iscsi_uevent *ev; struct iscsi_internal *priv; int len = NLMSG_SPACE(sizeof(*ev)); + unsigned long flags; priv = iscsi_if_transport_lookup(conn->transport); if (!priv) return; + spin_lock_irqsave(&session->lock, flags); + if (session->state == ISCSI_SESSION_LOGGED_IN) + session->state = ISCSI_SESSION_FAILED; + spin_unlock_irqrestore(&session->lock, flags); + skb = alloc_skb(len, GFP_ATOMIC); if (!skb) { iscsi_cls_conn_printk(KERN_ERR, conn, "gracefully ignored " diff --git a/trunk/fs/nfs/internal.h b/trunk/fs/nfs/internal.h index 931992763e68..0f5619611b8d 100644 --- a/trunk/fs/nfs/internal.h +++ b/trunk/fs/nfs/internal.h @@ -3,7 +3,6 @@ */ #include -#include struct nfs_string; @@ -58,8 +57,6 @@ struct nfs_parsed_mount_data { char *export_path; int protocol; } nfs_server; - - struct security_mnt_opts lsm_opts; }; /* client.c */ diff --git a/trunk/fs/nfs/super.c b/trunk/fs/nfs/super.c index fcf4b982c885..1fb381843650 100644 --- a/trunk/fs/nfs/super.c +++ b/trunk/fs/nfs/super.c @@ -684,9 +684,8 @@ static void nfs_parse_server_address(char *value, static int nfs_parse_mount_options(char *raw, struct nfs_parsed_mount_data *mnt) { - char *p, *string, *secdata; + char *p, *string; unsigned short port = 0; - int rc; if (!raw) { dfprintk(MOUNT, "NFS: mount options string was NULL.\n"); @@ -694,20 +693,6 @@ static int nfs_parse_mount_options(char *raw, } dfprintk(MOUNT, "NFS: nfs mount opts='%s'\n", raw); - secdata = alloc_secdata(); - if (!secdata) - goto out_nomem; - - rc = security_sb_copy_data(raw, secdata); - if (rc) - goto out_security_failure; - - rc = security_sb_parse_opts_str(secdata, &mnt->lsm_opts); - if (rc) - goto out_security_failure; - - free_secdata(secdata); - while ((p = strsep(&raw, ",")) != NULL) { substring_t args[MAX_OPT_ARGS]; int option, token; @@ -1057,10 +1042,7 @@ static int nfs_parse_mount_options(char *raw, out_nomem: printk(KERN_INFO "NFS: not enough memory to parse option\n"); return 0; -out_security_failure: - free_secdata(secdata); - printk(KERN_INFO "NFS: security options invalid: %d\n", rc); - return 0; + out_unrec_vers: printk(KERN_INFO "NFS: unrecognized NFS version number\n"); return 0; @@ -1232,33 +1214,6 @@ static int nfs_validate_mount_data(void *options, args->namlen = data->namlen; args->bsize = data->bsize; args->auth_flavors[0] = data->pseudoflavor; - - /* - * The legacy version 6 binary mount data from userspace has a - * field used only to transport selinux information into the - * the kernel. To continue to support that functionality we - * have a touch of selinux knowledge here in the NFS code. The - * userspace code converted context=blah to just blah so we are - * converting back to the full string selinux understands. - */ - if (data->context[0]){ -#ifdef CONFIG_SECURITY_SELINUX - int rc; - char *opts_str = kmalloc(sizeof(data->context) + 8, GFP_KERNEL); - if (!opts_str) - return -ENOMEM; - strcpy(opts_str, "context="); - data->context[NFS_MAX_CONTEXT_LEN] = '\0'; - strcat(opts_str, &data->context[0]); - rc = security_sb_parse_opts_str(opts_str, &args->lsm_opts); - kfree(opts_str); - if (rc) - return rc; -#else - return -EINVAL; -#endif - } - break; default: { unsigned int len; @@ -1521,8 +1476,6 @@ static int nfs_get_sb(struct file_system_type *fs_type, }; int error; - security_init_mnt_opts(&data.lsm_opts); - /* Validate the mount data */ error = nfs_validate_mount_data(raw_data, &data, &mntfh, dev_name); if (error < 0) @@ -1562,10 +1515,6 @@ static int nfs_get_sb(struct file_system_type *fs_type, goto error_splat_super; } - error = security_sb_set_mnt_opts(s, &data.lsm_opts); - if (error) - goto error_splat_root; - s->s_flags |= MS_ACTIVE; mnt->mnt_sb = s; mnt->mnt_root = mntroot; @@ -1574,15 +1523,12 @@ static int nfs_get_sb(struct file_system_type *fs_type, out: kfree(data.nfs_server.hostname); kfree(data.mount_server.hostname); - security_free_mnt_opts(&data.lsm_opts); return error; out_err_nosb: nfs_free_server(server); goto out; -error_splat_root: - dput(mntroot); error_splat_super: up_write(&s->s_umount); deactivate_super(s); @@ -1662,9 +1608,6 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags, mnt->mnt_sb = s; mnt->mnt_root = mntroot; - /* clone any lsm security options from the parent to the new sb */ - security_sb_clone_mnt_opts(data->sb, s); - dprintk("<-- nfs_xdev_get_sb() = 0\n"); return 0; @@ -1907,8 +1850,6 @@ static int nfs4_get_sb(struct file_system_type *fs_type, }; int error; - security_init_mnt_opts(&data.lsm_opts); - /* Validate the mount data */ error = nfs4_validate_mount_data(raw_data, &data, dev_name); if (error < 0) @@ -1957,7 +1898,6 @@ static int nfs4_get_sb(struct file_system_type *fs_type, kfree(data.client_address); kfree(data.nfs_server.export_path); kfree(data.nfs_server.hostname); - security_free_mnt_opts(&data.lsm_opts); return error; out_free: diff --git a/trunk/fs/super.c b/trunk/fs/super.c index 010446d8c40a..88811f60c8de 100644 --- a/trunk/fs/super.c +++ b/trunk/fs/super.c @@ -870,12 +870,12 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void if (!mnt) goto out; - if (data && !(type->fs_flags & FS_BINARY_MOUNTDATA)) { + if (data) { secdata = alloc_secdata(); if (!secdata) goto out_mnt; - error = security_sb_copy_data(data, secdata); + error = security_sb_copy_data(type, data, secdata); if (error) goto out_free_secdata; } diff --git a/trunk/fs/xfs/xfs_iget.c b/trunk/fs/xfs/xfs_iget.c index 8e09b71f4104..f01b07687faf 100644 --- a/trunk/fs/xfs/xfs_iget.c +++ b/trunk/fs/xfs/xfs_iget.c @@ -235,7 +235,6 @@ xfs_iget_core( */ new_icl = kmem_zone_alloc(xfs_icluster_zone, KM_SLEEP); if (radix_tree_preload(GFP_KERNEL)) { - xfs_idestroy(ip); delay(1); goto again; } diff --git a/trunk/fs/xfs/xfs_trans_ail.c b/trunk/fs/xfs/xfs_trans_ail.c index 76d470d8a1e6..4d6330eddc8d 100644 --- a/trunk/fs/xfs/xfs_trans_ail.c +++ b/trunk/fs/xfs/xfs_trans_ail.c @@ -261,19 +261,16 @@ xfsaild_push( xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); } - if (!count) { - /* We're past our target or empty, so idle */ - tout = 1000; - } else if (XFS_LSN_CMP(lsn, target) >= 0) { - /* - * We reached the target so wait a bit longer for I/O to - * complete and remove pushed items from the AIL before we - * start the next scan from the start of the AIL. - */ + /* + * We reached the target so wait a bit longer for I/O to complete and + * remove pushed items from the AIL before we start the next scan from + * the start of the AIL. + */ + if ((XFS_LSN_CMP(lsn, target) >= 0)) { tout += 20; last_pushed_lsn = 0; } else if ((restarts > XFS_TRANS_PUSH_AIL_RESTARTS) || - ((stuck * 100) / count > 90)) { + (count && ((stuck * 100) / count > 90))) { /* * Either there is a lot of contention on the AIL or we * are stuck due to operations in progress. "Stuck" in this diff --git a/trunk/include/asm-blackfin/mmu_context.h b/trunk/include/asm-blackfin/mmu_context.h index f55ec3c23a92..b5eb67596ad5 100644 --- a/trunk/include/asm-blackfin/mmu_context.h +++ b/trunk/include/asm-blackfin/mmu_context.h @@ -73,7 +73,7 @@ static inline void destroy_context(struct mm_struct *mm) struct sram_list_struct *tmp; if (current_l1_stack_save == mm->context.l1_stack_save) - current_l1_stack_save = NULL; + current_l1_stack_save = 0; if (mm->context.l1_stack_save) free_l1stack(); diff --git a/trunk/include/asm-blackfin/unistd.h b/trunk/include/asm-blackfin/unistd.h index c18a399f6e3e..e98167358d26 100644 --- a/trunk/include/asm-blackfin/unistd.h +++ b/trunk/include/asm-blackfin/unistd.h @@ -361,7 +361,7 @@ #define __NR_epoll_pwait 346 #define __NR_utimensat 347 #define __NR_signalfd 348 -#define __NR_timerfd_create 349 +#define __NR_timerfd 349 #define __NR_eventfd 350 #define __NR_pread64 351 #define __NR_pwrite64 352 @@ -370,10 +370,8 @@ #define __NR_get_robust_list 355 #define __NR_fallocate 356 #define __NR_semtimedop 357 -#define __NR_timerfd_settime 358 -#define __NR_timerfd_gettime 359 -#define __NR_syscall 360 +#define __NR_syscall 358 #define NR_syscalls __NR_syscall /* Old optional stuff no one actually uses */ diff --git a/trunk/include/asm-ia64/kprobes.h b/trunk/include/asm-ia64/kprobes.h index d03bf9ff68e3..8233b3a964c6 100644 --- a/trunk/include/asm-ia64/kprobes.h +++ b/trunk/include/asm-ia64/kprobes.h @@ -117,7 +117,7 @@ struct arch_specific_insn { unsigned short slot; }; -extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); +extern int kprobes_fault_handler(struct pt_regs *regs, int trapnr); extern int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, void *data); diff --git a/trunk/include/asm-ia64/ptrace.h b/trunk/include/asm-ia64/ptrace.h index 4b2a8d40ebc5..0bdce7dde1b0 100644 --- a/trunk/include/asm-ia64/ptrace.h +++ b/trunk/include/asm-ia64/ptrace.h @@ -233,6 +233,8 @@ struct switch_stack { #include #include +#define __ARCH_SYS_PTRACE 1 + /* * We use the ia64_psr(regs)->ri to determine which of the three * instructions in bundle (16 bytes) took the sample. Generate @@ -312,13 +314,6 @@ struct switch_stack { #define arch_ptrace_attach(child) \ ptrace_attach_sync_user_rbs(child) - #define arch_has_single_step() (1) - extern void user_enable_single_step(struct task_struct *); - extern void user_disable_single_step(struct task_struct *); - - #define arch_has_block_step() (1) - extern void user_enable_block_step(struct task_struct *); - #endif /* !__KERNEL__ */ /* pt_all_user_regs is used for PTRACE_GETREGS PTRACE_SETREGS */ diff --git a/trunk/include/asm-mn10300/Kbuild b/trunk/include/asm-mn10300/Kbuild index c68e1680da01..79384c537dc6 100644 --- a/trunk/include/asm-mn10300/Kbuild +++ b/trunk/include/asm-mn10300/Kbuild @@ -1 +1,5 @@ include include/asm-generic/Kbuild.asm + +unifdef-y += termios.h +unifdef-y += ptrace.h +unifdef-y += page.h diff --git a/trunk/include/asm-x86/Kbuild b/trunk/include/asm-x86/Kbuild index 3b8160a2b47e..b04a7ff46df1 100644 --- a/trunk/include/asm-x86/Kbuild +++ b/trunk/include/asm-x86/Kbuild @@ -16,6 +16,7 @@ unifdef-y += ist.h unifdef-y += mce.h unifdef-y += msr.h unifdef-y += mtrr.h +unifdef-y += page.h unifdef-y += posix_types_32.h unifdef-y += posix_types_64.h unifdef-y += ptrace.h diff --git a/trunk/include/crypto/internal/skcipher.h b/trunk/include/crypto/internal/skcipher.h index a8f12644a13c..2ba42cd7d6aa 100644 --- a/trunk/include/crypto/internal/skcipher.h +++ b/trunk/include/crypto/internal/skcipher.h @@ -15,7 +15,6 @@ #include #include -#include #include struct rtattr; @@ -65,11 +64,6 @@ void skcipher_geniv_free(struct crypto_instance *inst); int skcipher_geniv_init(struct crypto_tfm *tfm); void skcipher_geniv_exit(struct crypto_tfm *tfm); -int __init eseqiv_module_init(void); -void __exit eseqiv_module_exit(void); -int __init chainiv_module_init(void); -void __exit chainiv_module_exit(void); - static inline struct crypto_ablkcipher *skcipher_geniv_cipher( struct crypto_ablkcipher *geniv) { diff --git a/trunk/include/linux/security.h b/trunk/include/linux/security.h index b07357ca2137..fe52cdeab0a6 100644 --- a/trunk/include/linux/security.h +++ b/trunk/include/linux/security.h @@ -34,6 +34,12 @@ #include #include +/* only a char in selinux superblock security struct flags */ +#define FSCONTEXT_MNT 0x01 +#define CONTEXT_MNT 0x02 +#define ROOTCONTEXT_MNT 0x04 +#define DEFCONTEXT_MNT 0x08 + extern unsigned securebits; struct ctl_table; @@ -108,32 +114,6 @@ struct request_sock; #ifdef CONFIG_SECURITY -struct security_mnt_opts { - char **mnt_opts; - int *mnt_opts_flags; - int num_mnt_opts; -}; - -static inline void security_init_mnt_opts(struct security_mnt_opts *opts) -{ - opts->mnt_opts = NULL; - opts->mnt_opts_flags = NULL; - opts->num_mnt_opts = 0; -} - -static inline void security_free_mnt_opts(struct security_mnt_opts *opts) -{ - int i; - if (opts->mnt_opts) - for(i = 0; i < opts->num_mnt_opts; i++) - kfree(opts->mnt_opts[i]); - kfree(opts->mnt_opts); - opts->mnt_opts = NULL; - kfree(opts->mnt_opts_flags); - opts->mnt_opts_flags = NULL; - opts->num_mnt_opts = 0; -} - /** * struct security_operations - main security structure * @@ -282,19 +262,19 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) * @sb_get_mnt_opts: * Get the security relevant mount options used for a superblock * @sb the superblock to get security mount options from - * @opts binary data structure containing all lsm mount data + * @mount_options array for pointers to mount options + * @mount_flags array of ints specifying what each mount options is + * @num_opts number of options in the arrays * @sb_set_mnt_opts: * Set the security relevant mount options used for a superblock * @sb the superblock to set security mount options for - * @opts binary data structure containing all lsm mount data + * @mount_options array for pointers to mount options + * @mount_flags array of ints specifying what each mount options is + * @num_opts number of options in the arrays * @sb_clone_mnt_opts: * Copy all security options from a given superblock to another * @oldsb old superblock which contain information to clone * @newsb new superblock which needs filled in - * @sb_parse_opts_str: - * Parse a string of security data filling in the opts structure - * @options string containing all mount options known by the LSM - * @opts binary data structure usable by the LSM * * Security hooks for inode operations. * @@ -1258,7 +1238,8 @@ struct security_operations { int (*sb_alloc_security) (struct super_block * sb); void (*sb_free_security) (struct super_block * sb); - int (*sb_copy_data)(char *orig, char *copy); + int (*sb_copy_data)(struct file_system_type *type, + void *orig, void *copy); int (*sb_kern_mount) (struct super_block *sb, void *data); int (*sb_statfs) (struct dentry *dentry); int (*sb_mount) (char *dev_name, struct nameidata * nd, @@ -1276,12 +1257,12 @@ struct security_operations { void (*sb_post_pivotroot) (struct nameidata * old_nd, struct nameidata * new_nd); int (*sb_get_mnt_opts) (const struct super_block *sb, - struct security_mnt_opts *opts); - int (*sb_set_mnt_opts) (struct super_block *sb, - struct security_mnt_opts *opts); + char ***mount_options, int **flags, + int *num_opts); + int (*sb_set_mnt_opts) (struct super_block *sb, char **mount_options, + int *flags, int num_opts); void (*sb_clone_mnt_opts) (const struct super_block *oldsb, struct super_block *newsb); - int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts); int (*inode_alloc_security) (struct inode *inode); void (*inode_free_security) (struct inode *inode); @@ -1526,7 +1507,7 @@ int security_bprm_check(struct linux_binprm *bprm); int security_bprm_secureexec(struct linux_binprm *bprm); int security_sb_alloc(struct super_block *sb); void security_sb_free(struct super_block *sb); -int security_sb_copy_data(char *orig, char *copy); +int security_sb_copy_data(struct file_system_type *type, void *orig, void *copy); int security_sb_kern_mount(struct super_block *sb, void *data); int security_sb_statfs(struct dentry *dentry); int security_sb_mount(char *dev_name, struct nameidata *nd, @@ -1539,12 +1520,12 @@ void security_sb_post_remount(struct vfsmount *mnt, unsigned long flags, void *d void security_sb_post_addmount(struct vfsmount *mnt, struct nameidata *mountpoint_nd); int security_sb_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd); void security_sb_post_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd); -int security_sb_get_mnt_opts(const struct super_block *sb, - struct security_mnt_opts *opts); -int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); +int security_sb_get_mnt_opts(const struct super_block *sb, char ***mount_options, + int **flags, int *num_opts); +int security_sb_set_mnt_opts(struct super_block *sb, char **mount_options, + int *flags, int num_opts); void security_sb_clone_mnt_opts(const struct super_block *oldsb, struct super_block *newsb); -int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts); int security_inode_alloc(struct inode *inode); void security_inode_free(struct inode *inode); @@ -1654,16 +1635,6 @@ int security_secctx_to_secid(char *secdata, u32 seclen, u32 *secid); void security_release_secctx(char *secdata, u32 seclen); #else /* CONFIG_SECURITY */ -struct security_mnt_opts { -}; - -static inline void security_init_mnt_opts(struct security_mnt_opts *opts) -{ -} - -static inline void security_free_mnt_opts(struct security_mnt_opts *opts) -{ -} /* * This is the default capabilities functionality. Most of these functions @@ -1791,7 +1762,8 @@ static inline int security_sb_alloc (struct super_block *sb) static inline void security_sb_free (struct super_block *sb) { } -static inline int security_sb_copy_data (char *orig, char *copy) +static inline int security_sb_copy_data (struct file_system_type *type, + void *orig, void *copy) { return 0; } @@ -1847,27 +1819,6 @@ static inline int security_sb_pivotroot (struct nameidata *old_nd, static inline void security_sb_post_pivotroot (struct nameidata *old_nd, struct nameidata *new_nd) { } -static inline int security_sb_get_mnt_opts(const struct super_block *sb, - struct security_mnt_opts *opts) -{ - security_init_mnt_opts(opts); - return 0; -} - -static inline int security_sb_set_mnt_opts(struct super_block *sb, - struct security_mnt_opts *opts) -{ - return 0; -} - -static inline void security_sb_clone_mnt_opts(const struct super_block *oldsb, - struct super_block *newsb) -{ } - -static inline int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts) -{ - return 0; -} static inline int security_inode_alloc (struct inode *inode) { diff --git a/trunk/include/scsi/libsas.h b/trunk/include/scsi/libsas.h index 39e1cac24bb7..3ffd6b582a97 100644 --- a/trunk/include/scsi/libsas.h +++ b/trunk/include/scsi/libsas.h @@ -675,6 +675,5 @@ extern int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, extern void sas_ssp_task_response(struct device *dev, struct sas_task *task, struct ssp_response_iu *iu); -struct sas_phy *sas_find_local_phy(struct domain_device *dev); #endif /* _SASLIB_H_ */ diff --git a/trunk/include/scsi/scsi_transport_iscsi.h b/trunk/include/scsi/scsi_transport_iscsi.h index aab1eae2ec4c..dbc96ef4cc72 100644 --- a/trunk/include/scsi/scsi_transport_iscsi.h +++ b/trunk/include/scsi/scsi_transport_iscsi.h @@ -177,8 +177,6 @@ struct iscsi_cls_session { struct list_head host_list; struct iscsi_transport *transport; spinlock_t lock; - struct work_struct block_work; - struct work_struct unblock_work; struct work_struct scan_work; struct work_struct unbind_work; diff --git a/trunk/kernel/cpuset.c b/trunk/kernel/cpuset.c index a1b61f414228..3e296ed81d4d 100644 --- a/trunk/kernel/cpuset.c +++ b/trunk/kernel/cpuset.c @@ -322,8 +322,8 @@ static void guarantee_online_mems(const struct cpuset *cs, nodemask_t *pmask) * Call without callback_mutex or task_lock() held. May be * called with or without cgroup_mutex held. Thanks in part to * 'the_top_cpuset_hack', the task's cpuset pointer will never - * be NULL. This routine also might acquire callback_mutex during - * call. + * be NULL. This routine also might acquire callback_mutex and + * current->mm->mmap_sem during call. * * Reading current->cpuset->mems_generation doesn't need task_lock * to guard the current->cpuset derefence, because it is guarded diff --git a/trunk/security/dummy.c b/trunk/security/dummy.c index 78d8f92310a4..649326bf64ea 100644 --- a/trunk/security/dummy.c +++ b/trunk/security/dummy.c @@ -181,7 +181,8 @@ static void dummy_sb_free_security (struct super_block *sb) return; } -static int dummy_sb_copy_data (char *orig, char *copy) +static int dummy_sb_copy_data (struct file_system_type *type, + void *orig, void *copy) { return 0; } @@ -244,17 +245,19 @@ static void dummy_sb_post_pivotroot (struct nameidata *old_nd, struct nameidata return; } -static int dummy_sb_get_mnt_opts(const struct super_block *sb, - struct security_mnt_opts *opts) +static int dummy_sb_get_mnt_opts(const struct super_block *sb, char ***mount_options, + int **flags, int *num_opts) { - security_init_mnt_opts(opts); + *mount_options = NULL; + *flags = NULL; + *num_opts = 0; return 0; } -static int dummy_sb_set_mnt_opts(struct super_block *sb, - struct security_mnt_opts *opts) +static int dummy_sb_set_mnt_opts(struct super_block *sb, char **mount_options, + int *flags, int num_opts) { - if (unlikely(opts->num_mnt_opts)) + if (unlikely(num_opts)) return -EOPNOTSUPP; return 0; } @@ -265,11 +268,6 @@ static void dummy_sb_clone_mnt_opts(const struct super_block *oldsb, return; } -static int dummy_sb_parse_opts_str(char *options, struct security_mnt_opts *opts) -{ - return 0; -} - static int dummy_inode_alloc_security (struct inode *inode) { return 0; @@ -1030,7 +1028,6 @@ void security_fixup_ops (struct security_operations *ops) set_to_dummy_if_null(ops, sb_get_mnt_opts); set_to_dummy_if_null(ops, sb_set_mnt_opts); set_to_dummy_if_null(ops, sb_clone_mnt_opts); - set_to_dummy_if_null(ops, sb_parse_opts_str); set_to_dummy_if_null(ops, inode_alloc_security); set_to_dummy_if_null(ops, inode_free_security); set_to_dummy_if_null(ops, inode_init_security); diff --git a/trunk/security/security.c b/trunk/security/security.c index b1387a6b416d..d15e56cbaade 100644 --- a/trunk/security/security.c +++ b/trunk/security/security.c @@ -244,11 +244,10 @@ void security_sb_free(struct super_block *sb) security_ops->sb_free_security(sb); } -int security_sb_copy_data(char *orig, char *copy) +int security_sb_copy_data(struct file_system_type *type, void *orig, void *copy) { - return security_ops->sb_copy_data(orig, copy); + return security_ops->sb_copy_data(type, orig, copy); } -EXPORT_SYMBOL(security_sb_copy_data); int security_sb_kern_mount(struct super_block *sb, void *data) { @@ -307,30 +306,24 @@ void security_sb_post_pivotroot(struct nameidata *old_nd, struct nameidata *new_ } int security_sb_get_mnt_opts(const struct super_block *sb, - struct security_mnt_opts *opts) + char ***mount_options, + int **flags, int *num_opts) { - return security_ops->sb_get_mnt_opts(sb, opts); + return security_ops->sb_get_mnt_opts(sb, mount_options, flags, num_opts); } int security_sb_set_mnt_opts(struct super_block *sb, - struct security_mnt_opts *opts) + char **mount_options, + int *flags, int num_opts) { - return security_ops->sb_set_mnt_opts(sb, opts); + return security_ops->sb_set_mnt_opts(sb, mount_options, flags, num_opts); } -EXPORT_SYMBOL(security_sb_set_mnt_opts); void security_sb_clone_mnt_opts(const struct super_block *oldsb, struct super_block *newsb) { security_ops->sb_clone_mnt_opts(oldsb, newsb); } -EXPORT_SYMBOL(security_sb_clone_mnt_opts); - -int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts) -{ - return security_ops->sb_parse_opts_str(options, opts); -} -EXPORT_SYMBOL(security_sb_parse_opts_str); int security_inode_alloc(struct inode *inode) { diff --git a/trunk/security/selinux/hooks.c b/trunk/security/selinux/hooks.c index 4bf4807f2d44..75c2e99bfb81 100644 --- a/trunk/security/selinux/hooks.c +++ b/trunk/security/selinux/hooks.c @@ -443,7 +443,8 @@ static int sb_finish_set_opts(struct super_block *sb) * mount options, or whatever. */ static int selinux_get_mnt_opts(const struct super_block *sb, - struct security_mnt_opts *opts) + char ***mount_options, int **mnt_opts_flags, + int *num_opts) { int rc = 0, i; struct superblock_security_struct *sbsec = sb->s_security; @@ -451,7 +452,9 @@ static int selinux_get_mnt_opts(const struct super_block *sb, u32 len; char tmp; - security_init_mnt_opts(opts); + *num_opts = 0; + *mount_options = NULL; + *mnt_opts_flags = NULL; if (!sbsec->initialized) return -EINVAL; @@ -467,18 +470,18 @@ static int selinux_get_mnt_opts(const struct super_block *sb, /* count the number of mount options for this sb */ for (i = 0; i < 8; i++) { if (tmp & 0x01) - opts->num_mnt_opts++; + (*num_opts)++; tmp >>= 1; } - opts->mnt_opts = kcalloc(opts->num_mnt_opts, sizeof(char *), GFP_ATOMIC); - if (!opts->mnt_opts) { + *mount_options = kcalloc(*num_opts, sizeof(char *), GFP_ATOMIC); + if (!*mount_options) { rc = -ENOMEM; goto out_free; } - opts->mnt_opts_flags = kcalloc(opts->num_mnt_opts, sizeof(int), GFP_ATOMIC); - if (!opts->mnt_opts_flags) { + *mnt_opts_flags = kcalloc(*num_opts, sizeof(int), GFP_ATOMIC); + if (!*mnt_opts_flags) { rc = -ENOMEM; goto out_free; } @@ -488,22 +491,22 @@ static int selinux_get_mnt_opts(const struct super_block *sb, rc = security_sid_to_context(sbsec->sid, &context, &len); if (rc) goto out_free; - opts->mnt_opts[i] = context; - opts->mnt_opts_flags[i++] = FSCONTEXT_MNT; + (*mount_options)[i] = context; + (*mnt_opts_flags)[i++] = FSCONTEXT_MNT; } if (sbsec->flags & CONTEXT_MNT) { rc = security_sid_to_context(sbsec->mntpoint_sid, &context, &len); if (rc) goto out_free; - opts->mnt_opts[i] = context; - opts->mnt_opts_flags[i++] = CONTEXT_MNT; + (*mount_options)[i] = context; + (*mnt_opts_flags)[i++] = CONTEXT_MNT; } if (sbsec->flags & DEFCONTEXT_MNT) { rc = security_sid_to_context(sbsec->def_sid, &context, &len); if (rc) goto out_free; - opts->mnt_opts[i] = context; - opts->mnt_opts_flags[i++] = DEFCONTEXT_MNT; + (*mount_options)[i] = context; + (*mnt_opts_flags)[i++] = DEFCONTEXT_MNT; } if (sbsec->flags & ROOTCONTEXT_MNT) { struct inode *root = sbsec->sb->s_root->d_inode; @@ -512,16 +515,24 @@ static int selinux_get_mnt_opts(const struct super_block *sb, rc = security_sid_to_context(isec->sid, &context, &len); if (rc) goto out_free; - opts->mnt_opts[i] = context; - opts->mnt_opts_flags[i++] = ROOTCONTEXT_MNT; + (*mount_options)[i] = context; + (*mnt_opts_flags)[i++] = ROOTCONTEXT_MNT; } - BUG_ON(i != opts->num_mnt_opts); + BUG_ON(i != *num_opts); return 0; out_free: - security_free_mnt_opts(opts); + /* don't leak context string if security_sid_to_context had an error */ + if (*mount_options && i) + for (; i > 0; i--) + kfree((*mount_options)[i-1]); + kfree(*mount_options); + *mount_options = NULL; + kfree(*mnt_opts_flags); + *mnt_opts_flags = NULL; + *num_opts = 0; return rc; } @@ -542,13 +553,12 @@ static int bad_option(struct superblock_security_struct *sbsec, char flag, return 1; return 0; } - /* * Allow filesystems with binary mount data to explicitly set mount point * labeling information. */ -static int selinux_set_mnt_opts(struct super_block *sb, - struct security_mnt_opts *opts) +static int selinux_set_mnt_opts(struct super_block *sb, char **mount_options, + int *flags, int num_opts) { int rc = 0, i; struct task_security_struct *tsec = current->security; @@ -558,9 +568,6 @@ static int selinux_set_mnt_opts(struct super_block *sb, struct inode_security_struct *root_isec = inode->i_security; u32 fscontext_sid = 0, context_sid = 0, rootcontext_sid = 0; u32 defcontext_sid = 0; - char **mount_options = opts->mnt_opts; - int *flags = opts->mnt_opts_flags; - int num_opts = opts->num_mnt_opts; mutex_lock(&sbsec->lock); @@ -581,21 +588,6 @@ static int selinux_set_mnt_opts(struct super_block *sb, goto out; } - /* - * Binary mount data FS will come through this function twice. Once - * from an explicit call and once from the generic calls from the vfs. - * Since the generic VFS calls will not contain any security mount data - * we need to skip the double mount verification. - * - * This does open a hole in which we will not notice if the first - * mount using this sb set explict options and a second mount using - * this sb does not set any security options. (The first options - * will be used for both mounts) - */ - if (sbsec->initialized && (sb->s_type->fs_flags & FS_BINARY_MOUNTDATA) - && (num_opts == 0)) - goto out; - /* * parse the mount options, check if they are valid sids. * also check if someone is trying to mount the same sb more @@ -800,14 +792,43 @@ static void selinux_sb_clone_mnt_opts(const struct super_block *oldsb, mutex_unlock(&newsbsec->lock); } -int selinux_parse_opts_str(char *options, struct security_mnt_opts *opts) +/* + * string mount options parsing and call set the sbsec + */ +static int superblock_doinit(struct super_block *sb, void *data) { - char *p; char *context = NULL, *defcontext = NULL; char *fscontext = NULL, *rootcontext = NULL; - int rc, num_mnt_opts = 0; + int rc = 0; + char *p, *options = data; + /* selinux only know about a fixed number of mount options */ + char *mnt_opts[NUM_SEL_MNT_OPTS]; + int mnt_opts_flags[NUM_SEL_MNT_OPTS], num_mnt_opts = 0; + + if (!data) + goto out; - opts->num_mnt_opts = 0; + /* with the nfs patch this will become a goto out; */ + if (sb->s_type->fs_flags & FS_BINARY_MOUNTDATA) { + const char *name = sb->s_type->name; + /* NFS we understand. */ + if (!strcmp(name, "nfs")) { + struct nfs_mount_data *d = data; + + if (d->version != NFS_MOUNT_VERSION) + goto out; + + if (d->context[0]) { + context = kstrdup(d->context, GFP_KERNEL); + if (!context) { + rc = -ENOMEM; + goto out; + } + } + goto build_flags; + } else + goto out; + } /* Standard string-based options. */ while ((p = strsep(&options, "|")) != NULL) { @@ -880,37 +901,26 @@ int selinux_parse_opts_str(char *options, struct security_mnt_opts *opts) } } - rc = -ENOMEM; - opts->mnt_opts = kcalloc(NUM_SEL_MNT_OPTS, sizeof(char *), GFP_ATOMIC); - if (!opts->mnt_opts) - goto out_err; - - opts->mnt_opts_flags = kcalloc(NUM_SEL_MNT_OPTS, sizeof(int), GFP_ATOMIC); - if (!opts->mnt_opts_flags) { - kfree(opts->mnt_opts); - goto out_err; - } - +build_flags: if (fscontext) { - opts->mnt_opts[num_mnt_opts] = fscontext; - opts->mnt_opts_flags[num_mnt_opts++] = FSCONTEXT_MNT; + mnt_opts[num_mnt_opts] = fscontext; + mnt_opts_flags[num_mnt_opts++] = FSCONTEXT_MNT; } if (context) { - opts->mnt_opts[num_mnt_opts] = context; - opts->mnt_opts_flags[num_mnt_opts++] = CONTEXT_MNT; + mnt_opts[num_mnt_opts] = context; + mnt_opts_flags[num_mnt_opts++] = CONTEXT_MNT; } if (rootcontext) { - opts->mnt_opts[num_mnt_opts] = rootcontext; - opts->mnt_opts_flags[num_mnt_opts++] = ROOTCONTEXT_MNT; + mnt_opts[num_mnt_opts] = rootcontext; + mnt_opts_flags[num_mnt_opts++] = ROOTCONTEXT_MNT; } if (defcontext) { - opts->mnt_opts[num_mnt_opts] = defcontext; - opts->mnt_opts_flags[num_mnt_opts++] = DEFCONTEXT_MNT; + mnt_opts[num_mnt_opts] = defcontext; + mnt_opts_flags[num_mnt_opts++] = DEFCONTEXT_MNT; } - opts->num_mnt_opts = num_mnt_opts; - return 0; - +out: + rc = selinux_set_mnt_opts(sb, mnt_opts, mnt_opts_flags, num_mnt_opts); out_err: kfree(context); kfree(defcontext); @@ -918,33 +928,6 @@ int selinux_parse_opts_str(char *options, struct security_mnt_opts *opts) kfree(rootcontext); return rc; } -/* - * string mount options parsing and call set the sbsec - */ -static int superblock_doinit(struct super_block *sb, void *data) -{ - int rc = 0; - char *options = data; - struct security_mnt_opts opts; - - security_init_mnt_opts(&opts); - - if (!data) - goto out; - - BUG_ON(sb->s_type->fs_flags & FS_BINARY_MOUNTDATA); - - rc = selinux_parse_opts_str(options, &opts); - if (rc) - goto out_err; - -out: - rc = selinux_set_mnt_opts(sb, &opts); - -out_err: - security_free_mnt_opts(&opts); - return rc; -} static inline u16 inode_mode_to_security_class(umode_t mode) { @@ -2270,7 +2253,7 @@ static inline void take_selinux_option(char **to, char *from, int *first, } } -static int selinux_sb_copy_data(char *orig, char *copy) +static int selinux_sb_copy_data(struct file_system_type *type, void *orig, void *copy) { int fnosec, fsec, rc = 0; char *in_save, *in_curr, *in_end; @@ -2280,6 +2263,12 @@ static int selinux_sb_copy_data(char *orig, char *copy) in_curr = orig; sec_curr = copy; + /* Binary mount data: just copy */ + if (type->fs_flags & FS_BINARY_MOUNTDATA) { + copy_page(sec_curr, in_curr); + goto out; + } + nosec = (char *)get_zeroed_page(GFP_KERNEL); if (!nosec) { rc = -ENOMEM; @@ -5262,8 +5251,6 @@ static struct security_operations selinux_ops = { .sb_get_mnt_opts = selinux_get_mnt_opts, .sb_set_mnt_opts = selinux_set_mnt_opts, .sb_clone_mnt_opts = selinux_sb_clone_mnt_opts, - .sb_parse_opts_str = selinux_parse_opts_str, - .inode_alloc_security = selinux_inode_alloc_security, .inode_free_security = selinux_inode_free_security, diff --git a/trunk/security/selinux/include/security.h b/trunk/security/selinux/include/security.h index f7d2f03781f2..837ce420d2f6 100644 --- a/trunk/security/selinux/include/security.h +++ b/trunk/security/selinux/include/security.h @@ -35,11 +35,6 @@ #define POLICYDB_VERSION_MAX POLICYDB_VERSION_POLCAP #endif -#define CONTEXT_MNT 0x01 -#define FSCONTEXT_MNT 0x02 -#define ROOTCONTEXT_MNT 0x04 -#define DEFCONTEXT_MNT 0x08 - struct netlbl_lsm_secattr; extern int selinux_enabled; diff --git a/trunk/security/smack/smack_lsm.c b/trunk/security/smack/smack_lsm.c index 0241fd359675..770eb067e165 100644 --- a/trunk/security/smack/smack_lsm.c +++ b/trunk/security/smack/smack_lsm.c @@ -189,10 +189,17 @@ static void smack_sb_free_security(struct super_block *sb) * Copy the Smack specific mount options out of the mount * options list. */ -static int smack_sb_copy_data(char *orig, char *smackopts) +static int smack_sb_copy_data(struct file_system_type *type, void *orig, + void *smackopts) { char *cp, *commap, *otheropts, *dp; + /* Binary mount data: just copy */ + if (type->fs_flags & FS_BINARY_MOUNTDATA) { + copy_page(smackopts, orig); + return 0; + } + otheropts = (char *)get_zeroed_page(GFP_KERNEL); if (otheropts == NULL) return -ENOMEM;