From a898abeebcd1719532d91ea081c31c3252c8515e Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Mon, 14 Jul 2008 20:36:36 +0200 Subject: [PATCH] --- yaml --- r: 106526 b: refs/heads/master c: 5f4cb662a0a2533b45656607471571460310a5ca h: refs/heads/master v: v3 --- [refs] | 2 +- .../sound/alsa/ALSA-Configuration.txt | 1 - trunk/Documentation/sparse.txt | 8 +- trunk/Kbuild | 3 +- trunk/Makefile | 115 ++++----- trunk/arch/x86/kvm/mmu.c | 6 + trunk/arch/x86/kvm/svm.c | 3 +- trunk/drivers/crypto/talitos.c | 49 ++-- trunk/drivers/isdn/hardware/mISDN/Kconfig | 1 - trunk/drivers/isdn/mISDN/layer2.c | 2 +- trunk/drivers/isdn/mISDN/layer2.h | 2 +- trunk/drivers/isdn/mISDN/tei.c | 2 +- trunk/drivers/misc/Kconfig | 2 +- trunk/fs/proc/base.c | 57 +++-- trunk/include/Kbuild | 5 +- trunk/include/asm-generic/vmlinux.lds.h | 4 +- trunk/include/asm-x86/kvm_host.h | 1 + trunk/include/linux/sched.h | 19 +- trunk/include/linux/task_io_accounting.h | 27 +- trunk/include/linux/task_io_accounting_ops.h | 56 +---- trunk/include/net/ipv6.h | 2 - trunk/include/net/route.h | 2 + trunk/init/Kconfig | 4 +- trunk/kernel/exit.c | 30 ++- trunk/kernel/fork.c | 15 +- trunk/kernel/sysctl.c | 16 +- trunk/kernel/trace/trace.c | 1 + trunk/kernel/tsacct.c | 14 +- trunk/net/ipv4/route.c | 11 +- trunk/net/ipv4/sysctl_net_ipv4.c | 14 ++ trunk/net/ipv6/af_inet6.c | 12 - trunk/net/ipv6/sysctl_net_ipv6.c | 16 -- trunk/net/sysctl_net.c | 4 +- trunk/scripts/Makefile.headersinst | 230 +++++++++++++----- trunk/scripts/diffconfig | 129 ---------- trunk/scripts/hdrcheck.sh | 10 + trunk/scripts/headers.sh | 41 ---- trunk/scripts/headers_check.pl | 56 ----- trunk/scripts/headers_install.pl | 45 ---- trunk/scripts/kconfig/conf.c | 161 ++++++------ trunk/scripts/kconfig/confdata.c | 70 ------ trunk/scripts/kconfig/lkc.h | 9 - trunk/scripts/kernel-doc | 1 - trunk/scripts/setlocalversion | 4 +- trunk/sound/isa/cs423x/cs4236.c | 1 - trunk/sound/isa/opti9xx/opti92x-ad1848.c | 6 +- trunk/sound/pci/ac97/ac97_codec.c | 3 +- trunk/sound/pci/ac97/ac97_patch.c | 4 +- trunk/sound/pci/azt3328.h | 4 +- trunk/sound/pci/ens1370.c | 3 +- trunk/sound/pci/hda/hda_intel.c | 6 +- trunk/sound/pci/hda/patch_realtek.c | 181 +------------- trunk/sound/pci/hda/patch_sigmatel.c | 14 +- trunk/sound/soc/au1x/psc-i2s.c | 2 +- trunk/sound/soc/codecs/wm9712.c | 10 +- trunk/sound/soc/soc-dapm.c | 105 ++++---- 56 files changed, 571 insertions(+), 1030 deletions(-) delete mode 100755 trunk/scripts/diffconfig create mode 100755 trunk/scripts/hdrcheck.sh delete mode 100755 trunk/scripts/headers.sh delete mode 100644 trunk/scripts/headers_check.pl delete mode 100644 trunk/scripts/headers_install.pl diff --git a/[refs] b/[refs] index ae9de12247ab..2da2b72236c5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6948385cbd83201fb933125c1a578b29b456605d +refs/heads/master: 5f4cb662a0a2533b45656607471571460310a5ca diff --git a/trunk/Documentation/sound/alsa/ALSA-Configuration.txt b/trunk/Documentation/sound/alsa/ALSA-Configuration.txt index 6f6d117ac7e2..72aff61e7315 100644 --- a/trunk/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/trunk/Documentation/sound/alsa/ALSA-Configuration.txt @@ -1024,7 +1024,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. intel-mac-v3 Intel Mac Type 3 intel-mac-v4 Intel Mac Type 4 intel-mac-v5 Intel Mac Type 5 - intel-mac-auto Intel Mac (detect type according to subsystem id) macmini Intel Mac Mini (equivalent with type 3) macbook Intel Mac Book (eq. type 5) macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3) diff --git a/trunk/Documentation/sparse.txt b/trunk/Documentation/sparse.txt index 42f43fa59f24..1a3bdc27d95e 100644 --- a/trunk/Documentation/sparse.txt +++ b/trunk/Documentation/sparse.txt @@ -73,10 +73,10 @@ recompiled, or use "make C=2" to run sparse on the files whether they need to be recompiled or not. The latter is a fast way to check the whole tree if you have already built it. -The optional make variable CF can be used to pass arguments to sparse. The -build system passes -Wbitwise to sparse automatically. To perform endianness -checks, you may define __CHECK_ENDIAN__: +The optional make variable CHECKFLAGS can be used to pass arguments to sparse. +The build system passes -Wbitwise to sparse automatically. To perform +endianness checks, you may define __CHECK_ENDIAN__: - make C=2 CF="-D__CHECK_ENDIAN__" + make C=2 CHECKFLAGS="-D__CHECK_ENDIAN__" These checks are disabled by default as they generate a host of warnings. diff --git a/trunk/Kbuild b/trunk/Kbuild index f056b4feee51..e750e9c3fe59 100644 --- a/trunk/Kbuild +++ b/trunk/Kbuild @@ -43,7 +43,7 @@ $(obj)/$(bounds-file): kernel/bounds.s Kbuild # 2) Generate asm-offsets.h # -offsets-file := include/asm/asm-offsets.h +offsets-file := include/asm-$(SRCARCH)/asm-offsets.h always += $(offsets-file) targets += $(offsets-file) @@ -81,6 +81,7 @@ arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \ $(call if_changed_dep,cc_s_c) $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild + $(Q)mkdir -p $(dir $@) $(call cmd,offsets) ##### diff --git a/trunk/Makefile b/trunk/Makefile index 40f24810116c..3cad7db5eba7 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -205,9 +205,6 @@ ifeq ($(ARCH),x86_64) SRCARCH := x86 endif -# Where to locate arch specific headers -hdr-arch := $(SRCARCH) - KCONFIG_CONFIG ?= .config # SHELL used by kbuild @@ -329,8 +326,7 @@ AFLAGS_KERNEL = # Needed to be compatible with the O= option LINUXINCLUDE := -Iinclude \ $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ - -I$(srctree)/arch/$(hdr-arch)/include \ - -include include/linux/autoconf.h + -include include/linux/autoconf.h KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) @@ -926,9 +922,7 @@ ifneq ($(KBUILD_SRC),) /bin/false; \ fi; $(Q)if [ ! -d include2 ]; then mkdir -p include2; fi; - $(Q)if [ -e $(srctree)/include/asm-$(SRCARCH)/system.h ]; then \ - ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm; \ - fi + $(Q)ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm endif # prepare2 creates a makefile if using a separate output directory @@ -954,34 +948,22 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) # The asm symlink changes when $(ARCH) changes. # Detect this and ask user to run make mrproper -define check-symlink - set -e; \ - if [ -L include/asm ]; then \ - asmlink=`readlink include/asm | cut -d '-' -f 2`; \ - if [ "$$asmlink" != "$(SRCARCH)" ]; then \ + +include/asm: FORCE + $(Q)set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`; \ + if [ -L include/asm ]; then \ + if [ "$$asmlink" != "$(SRCARCH)" ]; then \ echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \ echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ - exit 1; \ - fi; \ + exit 1; \ + fi; \ + else \ + echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ + if [ ! -d include ]; then \ + mkdir -p include; \ + fi; \ + ln -fsn asm-$(SRCARCH) $@; \ fi -endef - -# We create the target directory of the symlink if it does -# not exist so the test in chack-symlink works and we have a -# directory for generated filesas used by some architectures. -define create-symlink - if [ ! -L include/asm ]; then \ - echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ - if [ ! -d include/asm-$(SRCARCH) ]; then \ - mkdir -p include/asm-$(SRCARCH); \ - fi; \ - ln -fsn asm-$(SRCARCH) $@; \ - fi -endef - -include/asm: FORCE - $(Q)$(check-symlink) - $(Q)$(create-symlink) # Generate some files # --------------------------------------------------------------------------- @@ -1028,43 +1010,36 @@ firmware_install: FORCE # --------------------------------------------------------------------------- # Kernel headers +INSTALL_HDR_PATH=$(objtree)/usr +export INSTALL_HDR_PATH -#Default location for installed headers -export INSTALL_HDR_PATH = $(objtree)/usr - -hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj -# Find out where the Kbuild file is located to support -# arch/$(ARCH)/include/asm -hdr-dir = $(strip \ - $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild), \ - arch/$(hdr-arch)/include/asm, include/asm-$(hdr-arch))) - -# If we do an all arch process set dst to asm-$(hdr-arch) -hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) - -PHONY += __headers -__headers: include/linux/version.h scripts_basic FORCE - $(Q)$(MAKE) $(build)=scripts scripts/unifdef +HDRFILTER=generic i386 x86_64 +HDRARCHES=$(filter-out $(HDRFILTER),$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild))) PHONY += headers_install_all -headers_install_all: - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh install +headers_install_all: include/linux/version.h scripts_basic FORCE + $(Q)$(MAKE) $(build)=scripts scripts/unifdef + $(Q)for arch in $(HDRARCHES); do \ + $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\ + done PHONY += headers_install -headers_install: __headers - $(if $(wildcard $(srctree)/$(hdr-dir)/Kbuild),, \ - $(error Headers not exportable for the $(SRCARCH) architecture)) - $(Q)$(MAKE) $(hdr-inst)=include - $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) +headers_install: include/linux/version.h scripts_basic FORCE + @if [ ! -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ + echo '*** Error: Headers not exportable for this architecture ($(SRCARCH))'; \ + exit 1 ; fi + $(Q)$(MAKE) $(build)=scripts scripts/unifdef + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include PHONY += headers_check_all headers_check_all: headers_install_all - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh check + $(Q)for arch in $(HDRARCHES); do \ + $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch HDRCHECK=1 ;\ + done PHONY += headers_check headers_check: headers_install - $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1 - $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) HDRCHECK=1 + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include HDRCHECK=1 # --------------------------------------------------------------------------- # Modules @@ -1156,7 +1131,7 @@ MRPROPER_FILES += .config .config.old include/asm .version .old_version \ include/linux/autoconf.h include/linux/version.h \ include/linux/utsrelease.h \ include/linux/bounds.h include/asm*/asm-offsets.h \ - Module.symvers Module.markers tags TAGS cscope* + Module.symvers tags TAGS cscope* # clean - Delete most, but leave enough to build external modules # @@ -1175,7 +1150,7 @@ clean: archclean $(clean-dirs) \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ -o -name '*.symtypes' -o -name 'modules.order' \ - -o -name 'Module.markers' -o -name '.tmp_*.o.*' \) \ + -o -name 'Module.markers' \) \ -type f -print | xargs rm -f # mrproper - Delete all generated files, including .config @@ -1249,17 +1224,21 @@ help: @echo ' cscope - Generate cscope index' @echo ' kernelrelease - Output the release version string' @echo ' kernelversion - Output the version stored in Makefile' - @echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \ + @if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ + echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \ echo ' (default: $(INSTALL_HDR_PATH))'; \ - echo '' + fi + @echo '' @echo 'Static analysers' @echo ' checkstack - Generate a list of stack hogs' @echo ' namespacecheck - Name space analysis on compiled kernel' @echo ' versioncheck - Sanity check on version.h usage' @echo ' includecheck - Check for duplicate included header files' @echo ' export_report - List the usages of all exported symbols' - @echo ' headers_check - Sanity check on exported headers'; \ - echo '' + @if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ + echo ' headers_check - Sanity check on exported headers'; \ + fi + @echo '' @echo 'Kernel packaging:' @$(MAKE) $(build)=$(package-dir) help @echo '' @@ -1432,11 +1411,7 @@ define find-sources \( -name config -o -name 'asm-*' \) -prune \ -o -name $1 -print; \ for arch in $(ALLINCLUDE_ARCHS) ; do \ - test -e $(__srctree)include/asm-$${arch} && \ - find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \ - -name $1 -print; \ - test -e $(__srctree)arch/$${arch}/include/asm && \ - find $(__srctree)arch/$${arch}/include/asm $(RCS_FIND_IGNORE) \ + find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \ -name $1 -print; \ done ; \ find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ diff --git a/trunk/arch/x86/kvm/mmu.c b/trunk/arch/x86/kvm/mmu.c index b0e4ddca6c18..d087d9c4f2d9 100644 --- a/trunk/arch/x86/kvm/mmu.c +++ b/trunk/arch/x86/kvm/mmu.c @@ -1870,6 +1870,12 @@ void kvm_enable_tdp(void) } EXPORT_SYMBOL_GPL(kvm_enable_tdp); +void kvm_disable_tdp(void) +{ + tdp_enabled = false; +} +EXPORT_SYMBOL_GPL(kvm_disable_tdp); + static void free_mmu_pages(struct kvm_vcpu *vcpu) { struct kvm_mmu_page *sp; diff --git a/trunk/arch/x86/kvm/svm.c b/trunk/arch/x86/kvm/svm.c index b756e876dce3..951b789cc913 100644 --- a/trunk/arch/x86/kvm/svm.c +++ b/trunk/arch/x86/kvm/svm.c @@ -453,7 +453,8 @@ static __init int svm_hardware_setup(void) if (npt_enabled) { printk(KERN_INFO "kvm: Nested Paging enabled\n"); kvm_enable_tdp(); - } + } else + kvm_disable_tdp(); return 0; diff --git a/trunk/drivers/crypto/talitos.c b/trunk/drivers/crypto/talitos.c index 681c15f42083..b11943dadefd 100644 --- a/trunk/drivers/crypto/talitos.c +++ b/trunk/drivers/crypto/talitos.c @@ -99,9 +99,6 @@ struct talitos_private { /* next channel to be assigned next incoming descriptor */ atomic_t last_chan; - /* per-channel number of requests pending in channel h/w fifo */ - atomic_t *submit_count; - /* per-channel request fifo */ struct talitos_request **fifo; @@ -266,15 +263,15 @@ static int talitos_submit(struct device *dev, struct talitos_desc *desc, spin_lock_irqsave(&priv->head_lock[ch], flags); - if (!atomic_inc_not_zero(&priv->submit_count[ch])) { - /* h/w fifo is full */ + head = priv->head[ch]; + request = &priv->fifo[ch][head]; + + if (request->desc) { + /* request queue is full */ spin_unlock_irqrestore(&priv->head_lock[ch], flags); return -EAGAIN; } - head = priv->head[ch]; - request = &priv->fifo[ch][head]; - /* map descriptor and save caller data */ request->dma_desc = dma_map_single(dev, desc, sizeof(*desc), DMA_BIDIRECTIONAL); @@ -338,9 +335,6 @@ static void flush_channel(struct device *dev, int ch, int error, int reset_ch) priv->tail[ch] = (tail + 1) & (priv->fifo_len - 1); spin_unlock_irqrestore(&priv->tail_lock[ch], flags); - - atomic_dec(&priv->submit_count[ch]); - saved_req.callback(dev, saved_req.desc, saved_req.context, status); /* channel may resume processing in single desc error case */ @@ -848,7 +842,7 @@ static int sg_to_link_tbl(struct scatterlist *sg, int sg_count, /* adjust (decrease) last one (or two) entry's len to cryptlen */ link_tbl_ptr--; - while (be16_to_cpu(link_tbl_ptr->len) <= (-cryptlen)) { + while (link_tbl_ptr->len <= (-cryptlen)) { /* Empty this entry, and move to previous one */ cryptlen += be16_to_cpu(link_tbl_ptr->len); link_tbl_ptr->len = 0; @@ -880,7 +874,7 @@ static int ipsec_esp(struct ipsec_esp_edesc *edesc, struct aead_request *areq, unsigned int cryptlen = areq->cryptlen; unsigned int authsize = ctx->authsize; unsigned int ivsize; - int sg_count, ret; + int sg_count; /* hmac key */ map_single_talitos_ptr(dev, &desc->ptr[0], ctx->authkeylen, &ctx->key, @@ -984,12 +978,7 @@ static int ipsec_esp(struct ipsec_esp_edesc *edesc, struct aead_request *areq, map_single_talitos_ptr(dev, &desc->ptr[6], ivsize, ctx->iv, 0, DMA_FROM_DEVICE); - ret = talitos_submit(dev, desc, callback, areq); - if (ret != -EINPROGRESS) { - ipsec_esp_unmap(dev, edesc, areq); - kfree(edesc); - } - return ret; + return talitos_submit(dev, desc, callback, areq); } @@ -1020,8 +1009,6 @@ static struct ipsec_esp_edesc *ipsec_esp_edesc_alloc(struct aead_request *areq, struct talitos_ctx *ctx = crypto_aead_ctx(authenc); struct ipsec_esp_edesc *edesc; int src_nents, dst_nents, alloc_len, dma_len; - gfp_t flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ? GFP_KERNEL : - GFP_ATOMIC; if (areq->cryptlen + ctx->authsize > TALITOS_MAX_DATA_LEN) { dev_err(ctx->dev, "cryptlen exceeds h/w max limit\n"); @@ -1035,7 +1022,7 @@ static struct ipsec_esp_edesc *ipsec_esp_edesc_alloc(struct aead_request *areq, dst_nents = src_nents; } else { dst_nents = sg_count(areq->dst, areq->cryptlen + ctx->authsize); - dst_nents = (dst_nents == 1) ? 0 : dst_nents; + dst_nents = (dst_nents == 1) ? 0 : src_nents; } /* @@ -1053,7 +1040,7 @@ static struct ipsec_esp_edesc *ipsec_esp_edesc_alloc(struct aead_request *areq, alloc_len += icv_stashing ? ctx->authsize : 0; } - edesc = kmalloc(alloc_len, GFP_DMA | flags); + edesc = kmalloc(alloc_len, GFP_DMA); if (!edesc) { dev_err(ctx->dev, "could not allocate edescriptor\n"); return ERR_PTR(-ENOMEM); @@ -1350,7 +1337,6 @@ static int __devexit talitos_remove(struct of_device *ofdev) if (hw_supports(dev, DESC_HDR_SEL0_RNG)) talitos_unregister_rng(dev); - kfree(priv->submit_count); kfree(priv->tail); kfree(priv->head); @@ -1480,6 +1466,9 @@ static int talitos_probe(struct of_device *ofdev, goto err_out; } + of_node_put(np); + np = NULL; + priv->head_lock = kmalloc(sizeof(spinlock_t) * priv->num_channels, GFP_KERNEL); priv->tail_lock = kmalloc(sizeof(spinlock_t) * priv->num_channels, @@ -1515,16 +1504,6 @@ static int talitos_probe(struct of_device *ofdev, } } - priv->submit_count = kmalloc(sizeof(atomic_t) * priv->num_channels, - GFP_KERNEL); - if (!priv->submit_count) { - dev_err(dev, "failed to allocate fifo submit count space\n"); - err = -ENOMEM; - goto err_out; - } - for (i = 0; i < priv->num_channels; i++) - atomic_set(&priv->submit_count[i], -priv->chfifo_len); - priv->head = kzalloc(sizeof(int) * priv->num_channels, GFP_KERNEL); priv->tail = kzalloc(sizeof(int) * priv->num_channels, GFP_KERNEL); if (!priv->head || !priv->tail) { @@ -1580,6 +1559,8 @@ static int talitos_probe(struct of_device *ofdev, err_out: talitos_remove(ofdev); + if (np) + of_node_put(np); return err; } diff --git a/trunk/drivers/isdn/hardware/mISDN/Kconfig b/trunk/drivers/isdn/hardware/mISDN/Kconfig index 9cd5f5f62280..14793480c453 100644 --- a/trunk/drivers/isdn/hardware/mISDN/Kconfig +++ b/trunk/drivers/isdn/hardware/mISDN/Kconfig @@ -7,7 +7,6 @@ config MISDN_HFCPCI tristate "Support for HFC PCI cards" depends on MISDN depends on PCI - depends on VIRT_TO_BUS help Enable support for cards with Cologne Chip AG's HFC PCI chip. diff --git a/trunk/drivers/isdn/mISDN/layer2.c b/trunk/drivers/isdn/mISDN/layer2.c index a7915a156c04..f5ad888ee71e 100644 --- a/trunk/drivers/isdn/mISDN/layer2.c +++ b/trunk/drivers/isdn/mISDN/layer2.c @@ -2030,7 +2030,7 @@ release_l2(struct layer2 *l2) skb_queue_purge(&l2->down_queue); ReleaseWin(l2); if (test_bit(FLG_LAPD, &l2->flag)) { - TEIrelease(l2); + release_tei(l2); if (l2->ch.st) l2->ch.st->dev->D.ctrl(&l2->ch.st->dev->D, CLOSE_CHANNEL, NULL); diff --git a/trunk/drivers/isdn/mISDN/layer2.h b/trunk/drivers/isdn/mISDN/layer2.h index 6293f80dc2d3..de2dd02056a3 100644 --- a/trunk/drivers/isdn/mISDN/layer2.h +++ b/trunk/drivers/isdn/mISDN/layer2.h @@ -96,7 +96,7 @@ extern int tei_l2(struct layer2 *, u_int, u_long arg); /* from tei.c */ extern int l2_tei(struct layer2 *, u_int, u_long arg); -extern void TEIrelease(struct layer2 *); +extern void release_tei(struct layer2 *); extern int TEIInit(u_int *); extern void TEIFree(void); diff --git a/trunk/drivers/isdn/mISDN/tei.c b/trunk/drivers/isdn/mISDN/tei.c index 6fbae42127bf..56a76a0ffddd 100644 --- a/trunk/drivers/isdn/mISDN/tei.c +++ b/trunk/drivers/isdn/mISDN/tei.c @@ -945,7 +945,7 @@ l2_tei(struct layer2 *l2, u_int cmd, u_long arg) } void -TEIrelease(struct layer2 *l2) +release_tei(struct layer2 *l2) { struct teimgr *tm = l2->tm; u_long flags; diff --git a/trunk/drivers/misc/Kconfig b/trunk/drivers/misc/Kconfig index f5ade1904aad..321eb9134635 100644 --- a/trunk/drivers/misc/Kconfig +++ b/trunk/drivers/misc/Kconfig @@ -360,7 +360,7 @@ config THINKPAD_ACPI_VIDEO If you are not sure, say Y here. config THINKPAD_ACPI_HOTKEY_POLL - bool "Support NVRAM polling for hot keys" + bool "Suport NVRAM polling for hot keys" depends on THINKPAD_ACPI default y ---help--- diff --git a/trunk/fs/proc/base.c b/trunk/fs/proc/base.c index 3d94906c7aa8..e74308bdabd3 100644 --- a/trunk/fs/proc/base.c +++ b/trunk/fs/proc/base.c @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include @@ -2403,17 +2402,44 @@ static int proc_base_fill_cache(struct file *filp, void *dirent, #ifdef CONFIG_TASK_IO_ACCOUNTING static int do_io_accounting(struct task_struct *task, char *buffer, int whole) { - struct proc_io_accounting acct = task->ioac; - unsigned long flags; - - if (whole && lock_task_sighand(task, &flags)) { - struct task_struct *t = task; - - task_io_accounting_add(&acct, &task->signal->ioac); - while_each_thread(task, t) - task_io_accounting_add(&acct, &t->ioac); - - unlock_task_sighand(task, &flags); + u64 rchar, wchar, syscr, syscw; + struct task_io_accounting ioac; + + rchar = task->rchar; + wchar = task->wchar; + syscr = task->syscr; + syscw = task->syscw; + memcpy(&ioac, &task->ioac, sizeof(ioac)); + + if (whole) { + unsigned long flags; + + if (lock_task_sighand(task, &flags)) { + struct signal_struct *sig = task->signal; + struct task_struct *t = task; + + rchar += sig->rchar; + wchar += sig->wchar; + syscr += sig->syscr; + syscw += sig->syscw; + + ioac.read_bytes += sig->ioac.read_bytes; + ioac.write_bytes += sig->ioac.write_bytes; + ioac.cancelled_write_bytes += + sig->ioac.cancelled_write_bytes; + while_each_thread(task, t) { + rchar += t->rchar; + wchar += t->wchar; + syscr += t->syscr; + syscw += t->syscw; + + ioac.read_bytes += t->ioac.read_bytes; + ioac.write_bytes += t->ioac.write_bytes; + ioac.cancelled_write_bytes += + t->ioac.cancelled_write_bytes; + } + unlock_task_sighand(task, &flags); + } } return sprintf(buffer, "rchar: %llu\n" @@ -2423,10 +2449,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) "read_bytes: %llu\n" "write_bytes: %llu\n" "cancelled_write_bytes: %llu\n", - acct.chr.rchar, acct.chr.wchar, - acct.chr.syscr, acct.chr.syscw, - acct.blk.read_bytes, acct.blk.write_bytes, - acct.blk.cancelled_write_bytes); + rchar, wchar, syscr, syscw, + ioac.read_bytes, ioac.write_bytes, + ioac.cancelled_write_bytes); } static int proc_tid_io_accounting(struct task_struct *task, char *buffer) diff --git a/trunk/include/Kbuild b/trunk/include/Kbuild index d8c3e3cbf416..bdca155028ec 100644 --- a/trunk/include/Kbuild +++ b/trunk/include/Kbuild @@ -1,6 +1,3 @@ -# Top-level Makefile calls into asm-$(ARCH) -# List only non-arch directories below - header-y += asm-generic/ header-y += linux/ header-y += sound/ @@ -8,3 +5,5 @@ header-y += mtd/ header-y += rdma/ header-y += video/ header-y += drm/ + +header-y += asm-$(ARCH)/ diff --git a/trunk/include/asm-generic/vmlinux.lds.h b/trunk/include/asm-generic/vmlinux.lds.h index 6d88a923c945..9cd44b162ba1 100644 --- a/trunk/include/asm-generic/vmlinux.lds.h +++ b/trunk/include/asm-generic/vmlinux.lds.h @@ -221,7 +221,6 @@ * during second ld run in second ld pass when generating System.map */ #define TEXT_TEXT \ ALIGN_FUNCTION(); \ - *(.text.hot) \ *(.text) \ *(.ref.text) \ *(.text.init.refok) \ @@ -231,8 +230,7 @@ CPU_KEEP(init.text) \ CPU_KEEP(exit.text) \ MEM_KEEP(init.text) \ - MEM_KEEP(exit.text) \ - *(.text.unlikely) + MEM_KEEP(exit.text) /* sched.text is aling to function alignment to secure we have same diff --git a/trunk/include/asm-x86/kvm_host.h b/trunk/include/asm-x86/kvm_host.h index fdde0bedaa90..bc34dc21f178 100644 --- a/trunk/include/asm-x86/kvm_host.h +++ b/trunk/include/asm-x86/kvm_host.h @@ -556,6 +556,7 @@ int kvm_fix_hypercall(struct kvm_vcpu *vcpu); int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code); void kvm_enable_tdp(void); +void kvm_disable_tdp(void); int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3); int complete_pio(struct kvm_vcpu *vcpu); diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 034c1ca6b332..f59318a0099b 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -505,7 +505,10 @@ struct signal_struct { unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; unsigned long inblock, oublock, cinblock, coublock; - struct proc_io_accounting ioac; +#ifdef CONFIG_TASK_XACCT + u64 rchar, wchar, syscr, syscw; +#endif + struct task_io_accounting ioac; /* * Cumulative ns of scheduled CPU time for dead threads in the @@ -1253,7 +1256,11 @@ struct task_struct { unsigned long ptrace_message; siginfo_t *last_siginfo; /* For ptrace use. */ - struct proc_io_accounting ioac; +#ifdef CONFIG_TASK_XACCT +/* i/o counters(bytes read/written, #syscalls */ + u64 rchar, wchar, syscr, syscw; +#endif + struct task_io_accounting ioac; #if defined(CONFIG_TASK_XACCT) u64 acct_rss_mem1; /* accumulated rss usage */ u64 acct_vm_mem1; /* accumulated virtual memory usage */ @@ -2183,22 +2190,22 @@ extern long sched_group_rt_period(struct task_group *tg); #ifdef CONFIG_TASK_XACCT static inline void add_rchar(struct task_struct *tsk, ssize_t amt) { - tsk->ioac.chr.rchar += amt; + tsk->rchar += amt; } static inline void add_wchar(struct task_struct *tsk, ssize_t amt) { - tsk->ioac.chr.wchar += amt; + tsk->wchar += amt; } static inline void inc_syscr(struct task_struct *tsk) { - tsk->ioac.chr.syscr++; + tsk->syscr++; } static inline void inc_syscw(struct task_struct *tsk) { - tsk->ioac.chr.syscw++; + tsk->syscw++; } #else static inline void add_rchar(struct task_struct *tsk, ssize_t amt) diff --git a/trunk/include/linux/task_io_accounting.h b/trunk/include/linux/task_io_accounting.h index 165390f8b936..44d00e9cceea 100644 --- a/trunk/include/linux/task_io_accounting.h +++ b/trunk/include/linux/task_io_accounting.h @@ -1,5 +1,5 @@ /* - * proc_io_accounting: a structure which is used for recording a single task's + * task_io_accounting: a structure which is used for recording a single task's * IO statistics. * * Don't include this header file directly - it is designed to be dragged in via @@ -8,22 +8,6 @@ * Blame akpm@osdl.org for all this. */ -#ifdef CONFIG_TASK_XACCT -struct task_chr_io_accounting { - /* bytes read */ - u64 rchar; - /* bytes written */ - u64 wchar; - /* # of read syscalls */ - u64 syscr; - /* # of write syscalls */ - u64 syscw; -}; -#else /* CONFIG_TASK_XACCT */ -struct task_chr_io_accounting { -}; -#endif /* CONFIG_TASK_XACCT */ - #ifdef CONFIG_TASK_IO_ACCOUNTING struct task_io_accounting { /* @@ -47,12 +31,7 @@ struct task_io_accounting { */ u64 cancelled_write_bytes; }; -#else /* CONFIG_TASK_IO_ACCOUNTING */ +#else struct task_io_accounting { }; -#endif /* CONFIG_TASK_IO_ACCOUNTING */ - -struct proc_io_accounting { - struct task_chr_io_accounting chr; - struct task_io_accounting blk; -}; +#endif diff --git a/trunk/include/linux/task_io_accounting_ops.h b/trunk/include/linux/task_io_accounting_ops.h index e6f958ebe97f..ff46c6fad79d 100644 --- a/trunk/include/linux/task_io_accounting_ops.h +++ b/trunk/include/linux/task_io_accounting_ops.h @@ -9,7 +9,7 @@ #ifdef CONFIG_TASK_IO_ACCOUNTING static inline void task_io_account_read(size_t bytes) { - current->ioac.blk.read_bytes += bytes; + current->ioac.read_bytes += bytes; } /* @@ -18,12 +18,12 @@ static inline void task_io_account_read(size_t bytes) */ static inline unsigned long task_io_get_inblock(const struct task_struct *p) { - return p->ioac.blk.read_bytes >> 9; + return p->ioac.read_bytes >> 9; } static inline void task_io_account_write(size_t bytes) { - current->ioac.blk.write_bytes += bytes; + current->ioac.write_bytes += bytes; } /* @@ -32,25 +32,17 @@ static inline void task_io_account_write(size_t bytes) */ static inline unsigned long task_io_get_oublock(const struct task_struct *p) { - return p->ioac.blk.write_bytes >> 9; + return p->ioac.write_bytes >> 9; } static inline void task_io_account_cancelled_write(size_t bytes) { - current->ioac.blk.cancelled_write_bytes += bytes; + current->ioac.cancelled_write_bytes += bytes; } -static inline void task_io_accounting_init(struct proc_io_accounting *ioac) +static inline void task_io_accounting_init(struct task_struct *tsk) { - memset(ioac, 0, sizeof(*ioac)); -} - -static inline void task_blk_io_accounting_add(struct proc_io_accounting *dst, - struct proc_io_accounting *src) -{ - dst->blk.read_bytes += src->blk.read_bytes; - dst->blk.write_bytes += src->blk.write_bytes; - dst->blk.cancelled_write_bytes += src->blk.cancelled_write_bytes; + memset(&tsk->ioac, 0, sizeof(tsk->ioac)); } #else @@ -77,37 +69,9 @@ static inline void task_io_account_cancelled_write(size_t bytes) { } -static inline void task_io_accounting_init(struct proc_io_accounting *ioac) -{ -} - -static inline void task_blk_io_accounting_add(struct proc_io_accounting *dst, - struct proc_io_accounting *src) +static inline void task_io_accounting_init(struct task_struct *tsk) { } -#endif /* CONFIG_TASK_IO_ACCOUNTING */ - -#ifdef CONFIG_TASK_XACCT -static inline void task_chr_io_accounting_add(struct proc_io_accounting *dst, - struct proc_io_accounting *src) -{ - dst->chr.rchar += src->chr.rchar; - dst->chr.wchar += src->chr.wchar; - dst->chr.syscr += src->chr.syscr; - dst->chr.syscw += src->chr.syscw; -} -#else -static inline void task_chr_io_accounting_add(struct proc_io_accounting *dst, - struct proc_io_accounting *src) -{ -} -#endif /* CONFIG_TASK_XACCT */ - -static inline void task_io_accounting_add(struct proc_io_accounting *dst, - struct proc_io_accounting *src) -{ - task_chr_io_accounting_add(dst, src); - task_blk_io_accounting_add(dst, src); -} -#endif /* __TASK_IO_ACCOUNTING_OPS_INCLUDED */ +#endif /* CONFIG_TASK_IO_ACCOUNTING */ +#endif /* __TASK_IO_ACCOUNTING_OPS_INCLUDED */ diff --git a/trunk/include/net/ipv6.h b/trunk/include/net/ipv6.h index 113028fb8f66..2d5c18514a2d 100644 --- a/trunk/include/net/ipv6.h +++ b/trunk/include/net/ipv6.h @@ -608,8 +608,6 @@ extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); extern struct ctl_table *ipv6_route_sysctl_init(struct net *net); extern int ipv6_sysctl_register(void); extern void ipv6_sysctl_unregister(void); -extern int ipv6_static_sysctl_register(void); -extern void ipv6_static_sysctl_unregister(void); #endif #endif /* __KERNEL__ */ diff --git a/trunk/include/net/route.h b/trunk/include/net/route.h index 4f0d8c14736c..3140cc500854 100644 --- a/trunk/include/net/route.h +++ b/trunk/include/net/route.h @@ -204,4 +204,6 @@ static inline struct inet_peer *rt_get_peer(struct rtable *rt) return rt->peer; } +extern ctl_table ipv4_route_table[]; + #endif /* _ROUTE_H */ diff --git a/trunk/init/Kconfig b/trunk/init/Kconfig index 43d6989c275f..a50bdfed2df7 100644 --- a/trunk/init/Kconfig +++ b/trunk/init/Kconfig @@ -171,7 +171,7 @@ config BSD_PROCESS_ACCT_V3 process and it's parent. Note that this file format is incompatible with previous v0/v1/v2 file formats, so you will need updated tools for processing it. A preliminary version of these tools is available - at . + at . config TASKSTATS bool "Export task/process statistics through netlink (EXPERIMENTAL)" @@ -486,7 +486,7 @@ config PID_NS default n depends on NAMESPACES && EXPERIMENTAL help - Support process id namespaces. This allows having multiple + Suport process id namespaces. This allows having multiple process with the same pid as long as they are in different pid namespaces. This is a building block of containers. diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index eb4d6470d1d0..0caf590548a0 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -121,7 +121,18 @@ static void __exit_signal(struct task_struct *tsk) sig->nivcsw += tsk->nivcsw; sig->inblock += task_io_get_inblock(tsk); sig->oublock += task_io_get_oublock(tsk); - task_io_accounting_add(&sig->ioac, &tsk->ioac); +#ifdef CONFIG_TASK_XACCT + sig->rchar += tsk->rchar; + sig->wchar += tsk->wchar; + sig->syscr += tsk->syscr; + sig->syscw += tsk->syscw; +#endif /* CONFIG_TASK_XACCT */ +#ifdef CONFIG_TASK_IO_ACCOUNTING + sig->ioac.read_bytes += tsk->ioac.read_bytes; + sig->ioac.write_bytes += tsk->ioac.write_bytes; + sig->ioac.cancelled_write_bytes += + tsk->ioac.cancelled_write_bytes; +#endif /* CONFIG_TASK_IO_ACCOUNTING */ sig->sum_sched_runtime += tsk->se.sum_exec_runtime; sig = NULL; /* Marker for below. */ } @@ -1352,8 +1363,21 @@ static int wait_task_zombie(struct task_struct *p, int options, psig->coublock += task_io_get_oublock(p) + sig->oublock + sig->coublock; - task_io_accounting_add(&psig->ioac, &p->ioac); - task_io_accounting_add(&psig->ioac, &sig->ioac); +#ifdef CONFIG_TASK_XACCT + psig->rchar += p->rchar + sig->rchar; + psig->wchar += p->wchar + sig->wchar; + psig->syscr += p->syscr + sig->syscr; + psig->syscw += p->syscw + sig->syscw; +#endif /* CONFIG_TASK_XACCT */ +#ifdef CONFIG_TASK_IO_ACCOUNTING + psig->ioac.read_bytes += + p->ioac.read_bytes + sig->ioac.read_bytes; + psig->ioac.write_bytes += + p->ioac.write_bytes + sig->ioac.write_bytes; + psig->ioac.cancelled_write_bytes += + p->ioac.cancelled_write_bytes + + sig->ioac.cancelled_write_bytes; +#endif /* CONFIG_TASK_IO_ACCOUNTING */ spin_unlock_irq(&p->parent->sighand->siglock); } diff --git a/trunk/kernel/fork.c b/trunk/kernel/fork.c index 8214ba7c8bb1..5e050c1317c4 100644 --- a/trunk/kernel/fork.c +++ b/trunk/kernel/fork.c @@ -806,7 +806,12 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0; sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0; sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0; - task_io_accounting_init(&sig->ioac); +#ifdef CONFIG_TASK_XACCT + sig->rchar = sig->wchar = sig->syscr = sig->syscw = 0; +#endif +#ifdef CONFIG_TASK_IO_ACCOUNTING + memset(&sig->ioac, 0, sizeof(sig->ioac)); +#endif sig->sum_sched_runtime = 0; INIT_LIST_HEAD(&sig->cpu_timers[0]); INIT_LIST_HEAD(&sig->cpu_timers[1]); @@ -989,7 +994,13 @@ static struct task_struct *copy_process(unsigned long clone_flags, p->last_switch_timestamp = 0; #endif - task_io_accounting_init(&p->ioac); +#ifdef CONFIG_TASK_XACCT + p->rchar = 0; /* I/O counter: bytes read */ + p->wchar = 0; /* I/O counter: bytes written */ + p->syscr = 0; /* I/O counter: read syscalls */ + p->syscw = 0; /* I/O counter: write syscalls */ +#endif + task_io_accounting_init(p); acct_clear_integrals(p); p->it_virt_expires = cputime_zero; diff --git a/trunk/kernel/sysctl.c b/trunk/kernel/sysctl.c index fe4713347275..911d846f0503 100644 --- a/trunk/kernel/sysctl.c +++ b/trunk/kernel/sysctl.c @@ -1680,45 +1680,43 @@ static __init int sysctl_init(void) core_initcall(sysctl_init); -static struct ctl_table *is_branch_in(struct ctl_table *branch, - struct ctl_table *table) +static int is_branch_in(struct ctl_table *branch, struct ctl_table *table) { struct ctl_table *p; const char *s = branch->procname; /* branch should have named subdirectory as its first element */ if (!s || !branch->child) - return NULL; + return 0; /* ... and nothing else */ if (branch[1].procname || branch[1].ctl_name) - return NULL; + return 0; /* table should contain subdirectory with the same name */ for (p = table; p->procname || p->ctl_name; p++) { if (!p->child) continue; if (p->procname && strcmp(p->procname, s) == 0) - return p; + return 1; } - return NULL; + return 0; } /* see if attaching q to p would be an improvement */ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) { struct ctl_table *to = p->ctl_table, *by = q->ctl_table; - struct ctl_table *next; int is_better = 0; int not_in_parent = !p->attached_by; - while ((next = is_branch_in(by, to)) != NULL) { + while (is_branch_in(by, to)) { if (by == q->attached_by) is_better = 1; if (to == p->attached_by) not_in_parent = 1; by = by->child; - to = next->child; + to = to->child; } if (is_better && not_in_parent) { diff --git a/trunk/kernel/trace/trace.c b/trunk/kernel/trace/trace.c index 8f3fb3db61c3..fc20e09a6cb1 100644 --- a/trunk/kernel/trace/trace.c +++ b/trunk/kernel/trace/trace.c @@ -1183,6 +1183,7 @@ static void *find_next_entry_inc(struct trace_iterator *iter) static void *s_next(struct seq_file *m, void *v, loff_t *pos) { struct trace_iterator *iter = m->private; + void *last_ent = iter->ent; int i = (int)*pos; void *ent; diff --git a/trunk/kernel/tsacct.c b/trunk/kernel/tsacct.c index f9cd2561689c..3da47ccdc5e5 100644 --- a/trunk/kernel/tsacct.c +++ b/trunk/kernel/tsacct.c @@ -94,14 +94,14 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) stats->hiwater_vm = mm->hiwater_vm * PAGE_SIZE / KB; mmput(mm); } - stats->read_char = p->ioac.chr.rchar; - stats->write_char = p->ioac.chr.wchar; - stats->read_syscalls = p->ioac.chr.syscr; - stats->write_syscalls = p->ioac.chr.syscw; + stats->read_char = p->rchar; + stats->write_char = p->wchar; + stats->read_syscalls = p->syscr; + stats->write_syscalls = p->syscw; #ifdef CONFIG_TASK_IO_ACCOUNTING - stats->read_bytes = p->ioac.blk.read_bytes; - stats->write_bytes = p->ioac.blk.write_bytes; - stats->cancelled_write_bytes = p->ioac.blk.cancelled_write_bytes; + stats->read_bytes = p->ioac.read_bytes; + stats->write_bytes = p->ioac.write_bytes; + stats->cancelled_write_bytes = p->ioac.cancelled_write_bytes; #else stats->read_bytes = 0; stats->write_bytes = 0; diff --git a/trunk/net/ipv4/route.c b/trunk/net/ipv4/route.c index 380d6474cf66..a507c5e27d0e 100644 --- a/trunk/net/ipv4/route.c +++ b/trunk/net/ipv4/route.c @@ -2914,7 +2914,7 @@ static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, return 0; } -static ctl_table ipv4_route_table[] = { +ctl_table ipv4_route_table[] = { { .ctl_name = NET_IPV4_ROUTE_GC_THRESH, .procname = "gc_thresh", @@ -3216,15 +3216,6 @@ int __init ip_rt_init(void) return rc; } -/* - * We really need to sanitize the damn ipv4 init order, then all - * this nonsense will go away. - */ -void __init ip_static_sysctl_init(void) -{ - register_sysctl_paths(ipv4_route_path, ipv4_route_table); -} - EXPORT_SYMBOL(__ip_select_ident); EXPORT_SYMBOL(ip_route_input); EXPORT_SYMBOL(ip_route_output_key); diff --git a/trunk/net/ipv4/sysctl_net_ipv4.c b/trunk/net/ipv4/sysctl_net_ipv4.c index 770d827f5ab8..d63e9388d92d 100644 --- a/trunk/net/ipv4/sysctl_net_ipv4.c +++ b/trunk/net/ipv4/sysctl_net_ipv4.c @@ -401,6 +401,13 @@ static struct ctl_table ipv4_table[] = { .proc_handler = &ipv4_local_port_range, .strategy = &ipv4_sysctl_local_port_range, }, + { + .ctl_name = NET_IPV4_ROUTE, + .procname = "route", + .maxlen = 0, + .mode = 0555, + .child = ipv4_route_table + }, #ifdef CONFIG_IP_MULTICAST { .ctl_name = NET_IPV4_IGMP_MAX_MEMBERSHIPS, @@ -875,4 +882,11 @@ static __init int sysctl_ipv4_init(void) return 0; } +/* set enough of tree skeleton to get rid of ordering problems */ +void __init ip_static_sysctl_init(void) +{ + static ctl_table table[1]; + register_sysctl_paths(net_ipv4_ctl_path, table); +} + __initcall(sysctl_ipv4_init); diff --git a/trunk/net/ipv6/af_inet6.c b/trunk/net/ipv6/af_inet6.c index 95055f8c3f35..c708ca842298 100644 --- a/trunk/net/ipv6/af_inet6.c +++ b/trunk/net/ipv6/af_inet6.c @@ -934,11 +934,6 @@ static int __init inet6_init(void) if (err) goto out_unregister_sock; -#ifdef CONFIG_SYSCTL - err = ipv6_static_sysctl_register(); - if (err) - goto static_sysctl_fail; -#endif /* * ipngwg API draft makes clear that the correct semantics * for TCP and UDP is to consider one TCP and UDP instance @@ -1063,10 +1058,6 @@ static int __init inet6_init(void) icmp_fail: unregister_pernet_subsys(&inet6_net_ops); register_pernet_fail: -#ifdef CONFIG_SYSCTL - ipv6_static_sysctl_unregister(); -static_sysctl_fail: -#endif cleanup_ipv6_mibs(); out_unregister_sock: sock_unregister(PF_INET6); @@ -1122,9 +1113,6 @@ static void __exit inet6_exit(void) rawv6_exit(); unregister_pernet_subsys(&inet6_net_ops); -#ifdef CONFIG_SYSCTL - ipv6_static_sysctl_unregister(); -#endif cleanup_ipv6_mibs(); proto_unregister(&rawv6_prot); proto_unregister(&udplitev6_prot); diff --git a/trunk/net/ipv6/sysctl_net_ipv6.c b/trunk/net/ipv6/sysctl_net_ipv6.c index e6dfaeac6be3..5c99274558bf 100644 --- a/trunk/net/ipv6/sysctl_net_ipv6.c +++ b/trunk/net/ipv6/sysctl_net_ipv6.c @@ -150,19 +150,3 @@ void ipv6_sysctl_unregister(void) unregister_net_sysctl_table(ip6_header); unregister_pernet_subsys(&ipv6_sysctl_net_ops); } - -static struct ctl_table_header *ip6_base; - -int ipv6_static_sysctl_register(void) -{ - static struct ctl_table empty[1]; - ip6_base = register_net_sysctl_rotable(net_ipv6_ctl_path, empty); - if (ip6_base == NULL) - return -ENOMEM; - return 0; -} - -void ipv6_static_sysctl_unregister(void) -{ - unregister_net_sysctl_table(ip6_base); -} diff --git a/trunk/net/sysctl_net.c b/trunk/net/sysctl_net.c index 972201cd5fa7..cefbc367d8be 100644 --- a/trunk/net/sysctl_net.c +++ b/trunk/net/sysctl_net.c @@ -73,9 +73,7 @@ static struct ctl_table_root net_sysctl_ro_root = { static int sysctl_net_init(struct net *net) { - setup_sysctl_set(&net->sysctls, - &net_sysctl_ro_root.default_set, - is_seen); + setup_sysctl_set(&net->sysctls, NULL, is_seen); return 0; } diff --git a/trunk/scripts/Makefile.headersinst b/trunk/scripts/Makefile.headersinst index 612dc13ddd85..53dae3eb3d1f 100644 --- a/trunk/scripts/Makefile.headersinst +++ b/trunk/scripts/Makefile.headersinst @@ -1,98 +1,194 @@ # ========================================================================== # Installing headers # -# header-y - list files to be installed. They are preprocessed -# to remove __KERNEL__ section of the file -# unifdef-y - Same as header-y. Obsolete -# objhdr-y - Same as header-y but for generated files +# header-y files will be installed verbatim +# unifdef-y are the files where unifdef will be run before installing files +# objhdr-y are generated files that will be installed verbatim # # ========================================================================== -# called may set destination dir (when installing to asm/) +UNIFDEF := scripts/unifdef -U__KERNEL__ + +# Eliminate the contents of (and inclusions of) compiler.h +HDRSED := sed -e "s/ inline / __inline__ /g" \ + -e "s/[[:space:]]__user[[:space:]]\{1,\}/ /g" \ + -e "s/(__user[[:space:]]\{1,\}/ (/g" \ + -e "s/[[:space:]]__force[[:space:]]\{1,\}/ /g" \ + -e "s/(__force[[:space:]]\{1,\}/ (/g" \ + -e "s/[[:space:]]__iomem[[:space:]]\{1,\}/ /g" \ + -e "s/(__iomem[[:space:]]\{1,\}/ (/g" \ + -e "s/[[:space:]]__attribute_const__[[:space:]]\{1,\}/\ /g" \ + -e "s/[[:space:]]__attribute_const__$$//" \ + -e "/^\#include /d" + _dst := $(if $(dst),$(dst),$(obj)) -kbuild-file := $(srctree)/$(obj)/Kbuild -include $(kbuild-file) +ifeq (,$(patsubst include/asm/%,,$(obj)/)) +# For producing the generated stuff in include/asm for biarch builds, include +# both sets of Kbuild files; we'll generate anything which is mentioned in +# _either_ arch, and recurse into subdirectories which are mentioned in either +# arch. Since some directories may exist in one but not the other, we must +# use $(wildcard...). +GENASM := 1 +archasm := $(subst include/asm,asm-$(ARCH),$(obj)) +altarchasm := $(subst include/asm,asm-$(ALTARCH),$(obj)) +KBUILDFILES := $(wildcard $(srctree)/include/$(archasm)/Kbuild $(srctree)/include/$(altarchasm)/Kbuild) +else +KBUILDFILES := $(srctree)/$(obj)/Kbuild +endif -include scripts/Kbuild.include +include $(KBUILDFILES) -install := $(INSTALL_HDR_PATH)/$(_dst) +include scripts/Kbuild.include -header-y := $(sort $(header-y) $(unifdef-y)) -subdirs := $(patsubst %/,%,$(filter %/, $(header-y))) -header-y := $(filter-out %/, $(header-y)) +# If this is include/asm-$(ARCH) and there's no $(ALTARCH), then +# override $(_dst) so that we install to include/asm directly. +# Unless $(BIASMDIR) is set, in which case we're probably doing +# a 'headers_install_all' build and we should keep the -$(ARCH) +# in the directory name. +ifeq ($(obj)$(ALTARCH),include/asm-$(ARCH)$(BIASMDIR)) + _dst := include/asm +endif -# files used to track state of install/check -install-file := $(install)/.install -check-file := $(install)/.check +header-y := $(sort $(header-y)) +unifdef-y := $(sort $(unifdef-y)) +subdir-y := $(patsubst %/,%,$(filter %/, $(header-y))) +header-y := $(filter-out %/, $(header-y)) +header-y := $(filter-out $(unifdef-y),$(header-y)) -# all headers files for this dir -all-files := $(header-y) $(objhdr-y) -input-files := $(addprefix $(srctree)/$(obj)/,$(header-y)) \ - $(addprefix $(objtree)/$(obj)/,$(objhdr-y)) -output-files := $(addprefix $(install)/, $(all-files)) +# stamp files for header checks +check-y := $(patsubst %,.check.%,$(header-y) $(unifdef-y) $(objhdr-y)) # Work out what needs to be removed -oldheaders := $(patsubst $(install)/%,%,$(wildcard $(install)/*.h)) -unwanted := $(filter-out $(all-files),$(oldheaders)) +oldheaders := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/*.h)) +unwanted := $(filter-out $(header-y) $(unifdef-y) $(objhdr-y),$(oldheaders)) -# Prefix unwanted with full paths to $(INSTALL_HDR_PATH) -unwanted-file := $(addprefix $(install)/, $(unwanted)) +oldcheckstamps := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/.check.*.h)) +unwanted += $(filter-out $(check-y),$(oldcheckstamps)) -printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@)) +# Prefix them all with full paths to $(INSTALL_HDR_PATH) +header-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(header-y)) +unifdef-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(unifdef-y)) +objhdr-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(objhdr-y)) +check-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(check-y)) -quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ - file$(if $(word 2, $(all-files)),s)) - cmd_install = \ - $(PERL) $< $(srctree)/$(obj) $(install) $(SRCARCH) $(header-y); \ - $(PERL) $< $(objtree)/$(obj) $(install) $(SRCARCH) $(objhdr-y); \ - touch $@ -quiet_cmd_remove = REMOVE $(unwanted) - cmd_remove = rm -f $(unwanted-file) - -quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files) - cmd_check = $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH) \ - $(addprefix $(install)/, $(all-files)); \ - touch $@ +ifdef ALTARCH +ifeq ($(obj),include/asm-$(ARCH)) +altarch-y := altarch-dir +endif +endif -PHONY += __headersinst __headerscheck +# Make the definitions visible for recursive make invocations +export ALTARCH +export ARCHDEF +export ALTARCHDEF + +quiet_cmd_o_hdr_install = INSTALL $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) + cmd_o_hdr_install = cp $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(objtree)/$(obj)/%,$@) \ + $(INSTALL_HDR_PATH)/$(_dst) + +quiet_cmd_headers_install = INSTALL $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) + cmd_headers_install = $(HDRSED) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \ + > $@ + +quiet_cmd_unifdef = UNIFDEF $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) + cmd_unifdef = $(UNIFDEF) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \ + | $(HDRSED) > $@ || : + +quiet_cmd_check = CHECK $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/.check.%,$(_dst)/%,$@) + cmd_check = $(CONFIG_SHELL) $(srctree)/scripts/hdrcheck.sh \ + $(INSTALL_HDR_PATH)/include $(subst /.check.,/,$@) $@ + +quiet_cmd_remove = REMOVE $(_dst)/$@ + cmd_remove = rm -f $(INSTALL_HDR_PATH)/$(_dst)/$@ + +quiet_cmd_mkdir = MKDIR $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) + cmd_mkdir = mkdir -p $@ + +quiet_cmd_gen = GEN $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) + cmd_gen = \ +FNAME=$(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$@); \ +STUBDEF=__ASM_STUB_`echo $$FNAME | tr a-z.- A-Z__`; \ +(echo "/* File autogenerated by 'make headers_install' */" ; \ +echo "\#ifndef $$STUBDEF" ; \ +echo "\#define $$STUBDEF" ; \ +echo "\# if $(ARCHDEF)" ; \ +if [ -r $(subst /$(_dst)/,/include/$(archasm)/,$@) ]; then \ + echo "\# include <$(archasm)/$$FNAME>" ; \ +else \ + echo "\# error $(archasm)/$$FNAME does not exist in" \ + "the $(ARCH) architecture" ; \ +fi ; \ +echo "\# elif $(ALTARCHDEF)" ; \ +if [ -r $(subst /$(_dst)/,/include/$(altarchasm)/,$@) ]; then \ + echo "\# include <$(altarchasm)/$$FNAME>" ; \ +else \ + echo "\# error $(altarchasm)/$$FNAME does not exist in" \ + "the $(ALTARCH) architecture" ; \ +fi ; \ +echo "\# else" ; \ +echo "\# warning This machine appears to be" \ + "neither $(ARCH) nor $(ALTARCH)." ; \ +echo "\# endif" ; \ +echo "\#endif /* $$STUBDEF */" ; \ +) > $@ + +.PHONY: __headersinst __headerscheck + +ifdef HDRCHECK +__headerscheck: $(subdir-y) $(check-y) + @true + +$(check-y) : $(INSTALL_HDR_PATH)/$(_dst)/.check.%.h : $(INSTALL_HDR_PATH)/$(_dst)/%.h + $(call cmd,check) + +# Other dependencies for $(check-y) +include /dev/null $(wildcard $(check-y)) + +# ... but leave $(check-y) as .PHONY for now until those deps are actually correct. +.PHONY: $(check-y) -ifndef HDRCHECK +else # Rules for installing headers -__headersinst: $(subdirs) $(install-file) - @: +__headersinst: $(subdir-y) $(header-y) $(unifdef-y) $(altarch-y) $(objhdr-y) + @true -targets += $(install-file) -$(install-file): scripts/headers_install.pl $(input-files) FORCE - $(if $(unwanted),$(call cmd,remove),) - $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@))) - $(call if_changed,install) +$(objhdr-y) $(subdir-y) $(header-y) $(unifdef-y): | $(INSTALL_HDR_PATH)/$(_dst) $(unwanted) -else -__headerscheck: $(subdirs) $(check-file) - @: +$(INSTALL_HDR_PATH)/$(_dst): + $(call cmd,mkdir) -targets += $(check-file) -$(check-file): scripts/headers_check.pl $(output-files) FORCE - $(call if_changed,check) +.PHONY: $(unwanted) +$(unwanted): + $(call cmd,remove) -endif +ifdef GENASM +$(objhdr-y) $(header-y) $(unifdef-y): $(KBUILDFILES) + $(call cmd,gen) -# Recursion -hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj -.PHONY: $(subdirs) -$(subdirs): - $(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(_dst)/$@ +else +$(objhdr-y) : $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(objtree)/$(obj)/%.h $(KBUILDFILES) + $(call cmd,o_hdr_install) -targets := $(wildcard $(sort $(targets))) -cmd_files := $(wildcard \ - $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) +$(header-y) : $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES) + $(call cmd,headers_install) -ifneq ($(cmd_files),) - include $(cmd_files) +$(unifdef-y) : $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES) + $(call cmd,unifdef) endif +endif + +hdrinst := -rR -f $(srctree)/scripts/Makefile.headersinst obj -.PHONY: $(PHONY) -PHONY += FORCE -FORCE: ; +.PHONY: altarch-dir +# All the files in the normal arch dir must be created first, since we test +# for their existence. +altarch-dir: $(subdir-y) $(header-y) $(unifdef-y) $(objhdr-y) + $(Q)$(MAKE) $(hdrinst)=include/asm-$(ALTARCH) dst=include/asm-$(ALTARCH) + $(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm$(BIASMDIR) + +# Recursion +.PHONY: $(subdir-y) +$(subdir-y): + $(Q)$(MAKE) $(hdrinst)=$(obj)/$@ dst=$(_dst)/$@ rel=../$(rel) diff --git a/trunk/scripts/diffconfig b/trunk/scripts/diffconfig deleted file mode 100755 index b91f3e34d44d..000000000000 --- a/trunk/scripts/diffconfig +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/python -# -# diffconfig - a tool to compare .config files. -# -# originally written in 2006 by Matt Mackall -# (at least, this was in his bloatwatch source code) -# last worked on 2008 by Tim Bird -# - -import sys, os - -def usage(): - print """Usage: diffconfig [-h] [-m] [ ] - -Diffconfig is a simple utility for comparing two .config files. -Using standard diff to compare .config files often includes extraneous and -distracting information. This utility produces sorted output with only the -changes in configuration values between the two files. - -Added and removed items are shown with a leading plus or minus, respectively. -Changed items show the old and new values on a single line. - -If -m is specified, then output will be in "merge" style, which has the -changed and new values in kernel config option format. - -If no config files are specified, .config and .config.old are used. - -Example usage: - $ diffconfig .config config-with-some-changes --EXT2_FS_XATTR n --EXT2_FS_XIP n - CRAMFS n -> y - EXT2_FS y -> n - LOG_BUF_SHIFT 14 -> 16 - PRINTK_TIME n -> y -""" - sys.exit(0) - -# returns a dictionary of name/value pairs for config items in the file -def readconfig(config_file): - d = {} - for line in config_file: - line = line[:-1] - if line[:7] == "CONFIG_": - name, val = line[7:].split("=", 1) - d[name] = val - if line[-11:] == " is not set": - d[line[9:-11]] = "n" - return d - -def print_config(op, config, value, new_value): - global merge_style - - if merge_style: - if new_value: - if new_value=="n": - print "# CONFIG_%s is not set" % config - else: - print "CONFIG_%s=%s" % (config, new_value) - else: - if op=="-": - print "-%s %s" % (config, value) - elif op=="+": - print "+%s %s" % (config, new_value) - else: - print " %s %s -> %s" % (config, value, new_value) - -def main(): - global merge_style - - # parse command line args - if ("-h" in sys.argv or "--help" in sys.argv): - usage() - - merge_style = 0 - if "-m" in sys.argv: - merge_style = 1 - sys.argv.remove("-m") - - argc = len(sys.argv) - if not (argc==1 or argc == 3): - print "Error: incorrect number of arguments or unrecognized option" - usage() - - if argc == 1: - # if no filenames given, assume .config and .config.old - build_dir="" - if os.environ.has_key("KBUILD_OUTPUT"): - build_dir = os.environ["KBUILD_OUTPUT"]+"/" - - configa_filename = build_dir + ".config.old" - configb_filename = build_dir + ".config" - else: - configa_filename = sys.argv[1] - configb_filename = sys.argv[2] - - a = readconfig(file(configa_filename)) - b = readconfig(file(configb_filename)) - - # print items in a but not b (accumulate, sort and print) - old = [] - for config in a: - if config not in b: - old.append(config) - old.sort() - for config in old: - print_config("-", config, a[config], None) - del a[config] - - # print items that changed (accumulate, sort, and print) - changed = [] - for config in a: - if a[config] != b[config]: - changed.append(config) - else: - del b[config] - changed.sort() - for config in changed: - print_config("->", config, a[config], b[config]) - del b[config] - - # now print items in b but not in a - # (items from b that were in a were removed above) - new = b.keys() - new.sort() - for config in new: - print_config("+", config, None, b[config]) - -main() diff --git a/trunk/scripts/hdrcheck.sh b/trunk/scripts/hdrcheck.sh new file mode 100755 index 000000000000..31598584f871 --- /dev/null +++ b/trunk/scripts/hdrcheck.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +for FILE in `grep '^[ \t]*#[ \t]*include[ \t]*<' $2 | cut -f2 -d\< | cut -f1 -d\> | egrep ^linux\|^asm` ; do + if [ ! -r $1/$FILE ]; then + echo $2 requires $FILE, which does not exist in exported headers + exit 1 + fi +done +# FIXME: List dependencies into $3 +touch $3 diff --git a/trunk/scripts/headers.sh b/trunk/scripts/headers.sh deleted file mode 100755 index d33426f866db..000000000000 --- a/trunk/scripts/headers.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# Run headers_$1 command for all suitable architectures - -# Stop on error -set -e - -do_command() -{ - if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then - make ARCH=$2 KBUILD_HEADERS=$1 headers_$1 - elif [ -f ${srctree}/include/asm-$2/Kbuild ]; then - make ARCH=$2 KBUILD_HEADERS=$1 headers_$1 - else - printf "Ignoring arch: %s\n" ${arch} - fi -} - -# Do not try this architecture -drop="generic um ppc sparc64 cris" - -archs=$(ls ${srctree}/arch) - -for arch in ${archs}; do - case ${arch} in - um) # no userspace export - ;; - ppc) # headers exported by powerpc - ;; - sparc64) # headers exported by sparc - ;; - cris) # headers export are known broken - ;; - *) - if [ -d ${srctree}/arch/${arch} ]; then - do_command $1 ${arch} - fi - ;; - esac -done - - diff --git a/trunk/scripts/headers_check.pl b/trunk/scripts/headers_check.pl deleted file mode 100644 index 15d53a6b1a1f..000000000000 --- a/trunk/scripts/headers_check.pl +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/perl -# -# headers_check.pl execute a number of trivial consistency checks -# -# Usage: headers_check.pl dir [files...] -# dir: dir to look for included files -# arch: architecture -# files: list of files to check -# -# The script reads the supplied files line by line and: -# -# 1) for each include statement it checks if the -# included file actually exists. -# Only include files located in asm* and linux* are checked. -# The rest are assumed to be system include files. -# -# 2) TODO: check for leaked CONFIG_ symbols - -use strict; -use warnings; - -my ($dir, $arch, @files) = @ARGV; - -my $ret = 0; -my $line; -my $lineno = 0; -my $filename; - -foreach my $file (@files) { - $filename = $file; - open(my $fh, '<', "$filename") or die "$filename: $!\n"; - $lineno = 0; - while ($line = <$fh>) { - $lineno++; - check_include(); - } - close $fh; -} -exit $ret; - -sub check_include -{ - if ($line =~ m/^\s*#\s*include\s+<((asm|linux).*)>/) { - my $inc = $1; - my $found; - $found = stat($dir . "/" . $inc); - if (!$found) { - $inc =~ s#asm/#asm-$arch/#; - $found = stat($dir . "/" . $inc); - } - if (!$found) { - printf STDERR "$filename:$lineno: included file '$inc' is not exported\n"; - $ret = 1; - } - } -} diff --git a/trunk/scripts/headers_install.pl b/trunk/scripts/headers_install.pl deleted file mode 100644 index 68591cd08731..000000000000 --- a/trunk/scripts/headers_install.pl +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/perl -# -# headers_install prepare the listed header files for use in -# user space and copy the files to their destination. -# -# Usage: headers_install.pl readdir installdir arch [files...] -# readdir: dir to open files -# installdir: dir to install the files -# arch: current architecture -# arch is used to force a reinstallation when the arch -# changes because kbuild then detect a command line change. -# files: list of files to check -# -# Step in preparation for users space: -# 1) Drop all use of compiler.h definitions -# 2) Drop include of compiler.h -# 3) Drop all sections defined out by __KERNEL__ (using unifdef) - -use strict; -use warnings; - -my ($readdir, $installdir, $arch, @files) = @ARGV; - -my $unifdef = "scripts/unifdef -U__KERNEL__"; - -foreach my $file (@files) { - my $tmpfile = "$installdir/$file.tmp"; - open(my $infile, '<', "$readdir/$file") - or die "$readdir/$file: $!\n"; - open(my $outfile, '>', "$tmpfile") or die "$tmpfile: $!\n"; - while (my $line = <$infile>) { - $line =~ s/([\s(])__user\s/$1/g; - $line =~ s/([\s(])__force\s/$1/g; - $line =~ s/([\s(])__iomem\s/$1/g; - $line =~ s/\s__attribute_const__\s/ /g; - $line =~ s/\s__attribute_const__$//g; - $line =~ s/^#include //; - printf $outfile "%s", $line; - } - close $outfile; - close $infile; - system $unifdef . " $tmpfile > $installdir/$file"; - unlink $tmpfile; -} -exit 0; diff --git a/trunk/scripts/kconfig/conf.c b/trunk/scripts/kconfig/conf.c index 9fba838c7069..fda63136ae68 100644 --- a/trunk/scripts/kconfig/conf.c +++ b/trunk/scripts/kconfig/conf.c @@ -76,6 +76,7 @@ static void check_stdin(void) static int conf_askvalue(struct symbol *sym, const char *def) { enum symbol_type type = sym_get_type(sym); + tristate val; if (!sym_has_value(sym)) printf(_("(NEW) ")); @@ -91,6 +92,15 @@ static int conf_askvalue(struct symbol *sym, const char *def) } switch (input_mode) { + case set_no: + case set_mod: + case set_yes: + case set_random: + if (sym_has_value(sym)) { + printf("%s\n", def); + return 0; + } + break; case ask_new: case ask_silent: if (sym_has_value(sym)) { @@ -102,6 +112,9 @@ static int conf_askvalue(struct symbol *sym, const char *def) fflush(stdout); fgets(line, 128, stdin); return 1; + case set_default: + printf("%s\n", def); + return 1; default: break; } @@ -115,6 +128,52 @@ static int conf_askvalue(struct symbol *sym, const char *def) default: ; } + switch (input_mode) { + case set_yes: + if (sym_tristate_within_range(sym, yes)) { + line[0] = 'y'; + line[1] = '\n'; + line[2] = 0; + break; + } + case set_mod: + if (type == S_TRISTATE) { + if (sym_tristate_within_range(sym, mod)) { + line[0] = 'm'; + line[1] = '\n'; + line[2] = 0; + break; + } + } else { + if (sym_tristate_within_range(sym, yes)) { + line[0] = 'y'; + line[1] = '\n'; + line[2] = 0; + break; + } + } + case set_no: + if (sym_tristate_within_range(sym, no)) { + line[0] = 'n'; + line[1] = '\n'; + line[2] = 0; + break; + } + case set_random: + do { + val = (tristate)(rand() % 3); + } while (!sym_tristate_within_range(sym, val)); + switch (val) { + case no: line[0] = 'n'; break; + case mod: line[0] = 'm'; break; + case yes: line[0] = 'y'; break; + } + line[1] = '\n'; + line[2] = 0; + break; + default: + break; + } printf("%s", line); return 1; } @@ -315,7 +374,15 @@ static int conf_choice(struct menu *menu) else continue; break; - default: + case set_random: + if (is_new) + def = (rand() % cnt) + 1; + case set_default: + case set_yes: + case set_mod: + case set_no: + cnt = def; + printf("%d\n", cnt); break; } @@ -427,43 +494,6 @@ static void check_conf(struct menu *menu) check_conf(child); } -static void conf_do_update(void) -{ - /* Update until a loop caused no more changes */ - do { - conf_cnt = 0; - check_conf(&rootmenu); - } while (conf_cnt); -} - -static int conf_silent_update(void) -{ - const char *name; - - if (conf_get_changed()) { - name = getenv("KCONFIG_NOSILENTUPDATE"); - if (name && *name) { - fprintf(stderr, - _("\n*** Kernel configuration requires explicit update.\n\n")); - return 1; - } - conf_do_update(); - } - return 0; -} - -static int conf_update(void) -{ - rootEntry = &rootmenu; - conf(&rootmenu); - if (input_mode == ask_all) { - input_mode = ask_silent; - valid_stdin = 1; - } - conf_do_update(); - return 0; -} - int main(int ac, char **av) { int opt; @@ -569,43 +599,36 @@ int main(int ac, char **av) default: break; } - switch (input_mode) { - case set_no: - conf_set_all_new_symbols(def_no); - break; - case set_yes: - conf_set_all_new_symbols(def_yes); - break; - case set_mod: - conf_set_all_new_symbols(def_mod); - break; - case set_random: - conf_set_all_new_symbols(def_random); - break; - case set_default: - conf_set_all_new_symbols(def_default); - break; - case ask_silent: - case ask_new: - if (conf_silent_update()) - exit(1); - break; - case ask_all: - if (conf_update()) - exit(1); - break; - } - if (conf_get_changed() && conf_write(NULL)) { + if (input_mode != ask_silent) { + rootEntry = &rootmenu; + conf(&rootmenu); + if (input_mode == ask_all) { + input_mode = ask_silent; + valid_stdin = 1; + } + } else if (conf_get_changed()) { + name = getenv("KCONFIG_NOSILENTUPDATE"); + if (name && *name) { + fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n")); + return 1; + } + } else + goto skip_check; + + do { + conf_cnt = 0; + check_conf(&rootmenu); + } while (conf_cnt); + if (conf_write(NULL)) { fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); - exit(1); + return 1; } - /* ask_silent is used during the build so we shall update autoconf. - * All other commands are only used to generate a config. - */ +skip_check: if (input_mode == ask_silent && conf_write_autoconf()) { fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); return 1; } + return 0; } diff --git a/trunk/scripts/kconfig/confdata.c b/trunk/scripts/kconfig/confdata.c index 07597611cc50..ee5fe943d58d 100644 --- a/trunk/scripts/kconfig/confdata.c +++ b/trunk/scripts/kconfig/confdata.c @@ -812,73 +812,3 @@ void conf_set_changed_callback(void (*fn)(void)) { conf_changed_callback = fn; } - - -void conf_set_all_new_symbols(enum conf_def_mode mode) -{ - struct symbol *sym, *csym; - struct property *prop; - struct expr *e; - int i, cnt, def; - - for_all_symbols(i, sym) { - if (sym_has_value(sym)) - continue; - switch (sym_get_type(sym)) { - case S_BOOLEAN: - case S_TRISTATE: - switch (mode) { - case def_yes: - sym->def[S_DEF_USER].tri = yes; - break; - case def_mod: - sym->def[S_DEF_USER].tri = mod; - break; - case def_no: - sym->def[S_DEF_USER].tri = no; - break; - case def_random: - sym->def[S_DEF_USER].tri = (tristate)(rand() % 3); - break; - default: - continue; - } - if (!sym_is_choice(sym) || mode != def_random) - sym->flags |= SYMBOL_DEF_USER; - break; - default: - break; - } - - } - - if (modules_sym) - sym_calc_value(modules_sym); - - if (mode != def_random) - return; - - for_all_symbols(i, csym) { - if (sym_has_value(csym) || !sym_is_choice(csym)) - continue; - - sym_calc_value(csym); - prop = sym_get_choice_prop(csym); - def = -1; - while (1) { - cnt = 0; - expr_list_for_each_sym(prop->expr, e, sym) { - if (sym->visible == no) - continue; - if (def == cnt++) { - csym->def[S_DEF_USER].val = sym; - break; - } - } - if (def >= 0 || cnt < 2) - break; - def = (rand() % cnt) + 1; - } - csym->flags |= SYMBOL_DEF_USER; - } -} diff --git a/trunk/scripts/kconfig/lkc.h b/trunk/scripts/kconfig/lkc.h index 4a9af6f7886b..96521cb087ec 100644 --- a/trunk/scripts/kconfig/lkc.h +++ b/trunk/scripts/kconfig/lkc.h @@ -42,14 +42,6 @@ extern "C" { #define TF_PARAM 0x0002 #define TF_OPTION 0x0004 -enum conf_def_mode { - def_default, - def_yes, - def_mod, - def_no, - def_random -}; - #define T_OPT_MODULES 1 #define T_OPT_DEFCONFIG_LIST 2 #define T_OPT_ENV 3 @@ -77,7 +69,6 @@ const char *conf_get_configname(void); char *conf_get_default_confname(void); void sym_set_change_count(int count); void sym_add_change_count(int count); -void conf_set_all_new_symbols(enum conf_def_mode mode); /* kconfig_load.c */ void kconfig_load(void); diff --git a/trunk/scripts/kernel-doc b/trunk/scripts/kernel-doc index d8f77e26081c..88e3934a8b8c 100755 --- a/trunk/scripts/kernel-doc +++ b/trunk/scripts/kernel-doc @@ -1643,7 +1643,6 @@ sub dump_function($$) { $prototype =~ s/^__always_inline +//; $prototype =~ s/^noinline +//; $prototype =~ s/__devinit +//; - $prototype =~ s/__init +//; $prototype =~ s/^#define\s+//; #ak added $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; diff --git a/trunk/scripts/setlocalversion b/trunk/scripts/setlocalversion index 83b75126c9f7..1c1bdaf7348a 100755 --- a/trunk/scripts/setlocalversion +++ b/trunk/scripts/setlocalversion @@ -12,9 +12,7 @@ cd "${1:-.}" || usage if head=`git rev-parse --verify HEAD 2>/dev/null`; then # Do we have an untagged version? if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then - if tag=`git describe 2>/dev/null`; then - echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' - fi + git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' fi # Are there uncommitted changes? diff --git a/trunk/sound/isa/cs423x/cs4236.c b/trunk/sound/isa/cs423x/cs4236.c index 4d4b8ddc26ba..dbe63db4bfd6 100644 --- a/trunk/sound/isa/cs423x/cs4236.c +++ b/trunk/sound/isa/cs423x/cs4236.c @@ -325,7 +325,6 @@ static int __devinit snd_cs423x_pnp_init_mpu(int dev, struct pnp_dev *pdev) static int __devinit snd_card_cs4232_pnp(int dev, struct snd_card_cs4236 *acard, struct pnp_dev *pdev) { - acard->wss = pdev; if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0) return -EBUSY; cport[dev] = -1; diff --git a/trunk/sound/isa/opti9xx/opti92x-ad1848.c b/trunk/sound/isa/opti9xx/opti92x-ad1848.c index 0797ca441a37..41c047e665ec 100644 --- a/trunk/sound/isa/opti9xx/opti92x-ad1848.c +++ b/trunk/sound/isa/opti9xx/opti92x-ad1848.c @@ -68,9 +68,7 @@ MODULE_SUPPORTED_DEVICE("{{OPTi,82C924 (AD1848)}," static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ //static int enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */ -#ifdef CONFIG_PNP static int isapnp = 1; /* Enable ISA PnP detection */ -#endif static long port = SNDRV_DEFAULT_PORT1; /* 0x530,0xe80,0xf40,0x604 */ static long mpu_port = SNDRV_DEFAULT_PORT1; /* 0x300,0x310,0x320,0x330 */ static long fm_port = SNDRV_DEFAULT_PORT1; /* 0x388 */ @@ -87,10 +85,8 @@ module_param(id, charp, 0444); MODULE_PARM_DESC(id, "ID string for opti9xx based soundcard."); //module_param(enable, bool, 0444); //MODULE_PARM_DESC(enable, "Enable opti9xx soundcard."); -#ifdef CONFIG_PNP module_param(isapnp, bool, 0444); MODULE_PARM_DESC(isapnp, "Enable ISA PnP detection for specified soundcard."); -#endif module_param(port, long, 0444); MODULE_PARM_DESC(port, "WSS port # for opti9xx driver."); module_param(mpu_port, long, 0444); @@ -692,7 +688,7 @@ static void snd_card_opti9xx_free(struct snd_card *card) if (chip) { #ifdef OPTi93X struct snd_cs4231 *codec = chip->codec; - if (codec && codec->irq > 0) { + if (codec->irq > 0) { disable_irq(codec->irq); free_irq(codec->irq, codec); } diff --git a/trunk/sound/pci/ac97/ac97_codec.c b/trunk/sound/pci/ac97/ac97_codec.c index 8c49a00a5e39..07364c00768a 100644 --- a/trunk/sound/pci/ac97/ac97_codec.c +++ b/trunk/sound/pci/ac97/ac97_codec.c @@ -161,7 +161,6 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = { { 0x50534304, 0xffffffff, "UCB1400", patch_ucb1400, NULL }, { 0x53494c20, 0xffffffe0, "Si3036,8", mpatch_si3036, mpatch_si3036, AC97_MODEM_PATCH }, { 0x54524102, 0xffffffff, "TR28022", NULL, NULL }, -{ 0x54524103, 0xffffffff, "TR28023", NULL, NULL }, { 0x54524106, 0xffffffff, "TR28026", NULL, NULL }, { 0x54524108, 0xffffffff, "TR28028", patch_tritech_tr28028, NULL }, // added by xin jin [07/09/99] { 0x54524123, 0xffffffff, "TR28602", NULL, NULL }, // only guess --jk [TR28023 = eMicro EM28023 (new CT1297)] @@ -170,7 +169,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = { { 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified VT1616 with S/PDIF { 0x56494182, 0xffffffff, "VIA1618", NULL, NULL }, { 0x57454301, 0xffffffff, "W83971D", NULL, NULL }, -{ 0x574d4c00, 0xffffffff, "WM9701,WM9701A", NULL, NULL }, +{ 0x574d4c00, 0xffffffff, "WM9701A", NULL, NULL }, { 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03, NULL}, { 0x574d4C04, 0xffffffff, "WM9704M,WM9704Q", patch_wolfson04, NULL}, { 0x574d4C05, 0xffffffff, "WM9705,WM9710", patch_wolfson05, NULL}, diff --git a/trunk/sound/pci/ac97/ac97_patch.c b/trunk/sound/pci/ac97/ac97_patch.c index f4fbc795ee81..0746e9ccc20b 100644 --- a/trunk/sound/pci/ac97/ac97_patch.c +++ b/trunk/sound/pci/ac97/ac97_patch.c @@ -3381,8 +3381,8 @@ static struct snd_kcontrol *snd_ac97_find_mixer_ctl(struct snd_ac97 *ac97, } /* create a virtual master control and add slaves */ -static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name, - const unsigned int *tlv, const char **slaves) +int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name, + const unsigned int *tlv, const char **slaves) { struct snd_kcontrol *kctl; const char **s; diff --git a/trunk/sound/pci/azt3328.h b/trunk/sound/pci/azt3328.h index 974e05122f00..7e3e8942d073 100644 --- a/trunk/sound/pci/azt3328.h +++ b/trunk/sound/pci/azt3328.h @@ -94,7 +94,7 @@ enum azf_freq_t { AZF_FREQ(48000), AZF_FREQ(66200), #undef AZF_FREQ -}; +} AZF_FREQUENCIES; /** recording area (see also: playback bit flag definitions) **/ #define IDX_IO_REC_FLAGS 0x20 /* ??, PU:0x0000 */ @@ -210,7 +210,7 @@ enum azf_freq_t { enum { AZF_GAME_LEGACY_IO_PORT = 0x200 -}; +} AZF_GAME_CONFIGS; #define IDX_GAME_LEGACY_COMPATIBLE 0x00 /* in some operation mode, writing anything to this port diff --git a/trunk/sound/pci/ens1370.c b/trunk/sound/pci/ens1370.c index 9bf95367c882..fbf1124f7c79 100644 --- a/trunk/sound/pci/ens1370.c +++ b/trunk/sound/pci/ens1370.c @@ -522,7 +522,7 @@ static unsigned int snd_es1371_wait_src_ready(struct ensoniq * ensoniq) return r; cond_resched(); } - snd_printk(KERN_ERR "wait src ready timeout 0x%lx [0x%x]\n", + snd_printk(KERN_ERR "wait source ready timeout 0x%lx [0x%x]\n", ES_REG(ensoniq, 1371_SMPRATE), r); return 0; } @@ -1629,7 +1629,6 @@ static int __devinit snd_ensoniq_1371_mixer(struct ensoniq *ensoniq, memset(&ac97, 0, sizeof(ac97)); ac97.private_data = ensoniq; ac97.private_free = snd_ensoniq_mixer_free_ac97; - ac97.pci = ensoniq->pci; ac97.scaps = AC97_SCAP_AUDIO; if ((err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97)) < 0) return err; diff --git a/trunk/sound/pci/hda/hda_intel.c b/trunk/sound/pci/hda/hda_intel.c index ef9f072b47fc..16715a68ba5e 100644 --- a/trunk/sound/pci/hda/hda_intel.c +++ b/trunk/sound/pci/hda/hda_intel.c @@ -1047,13 +1047,9 @@ static int azx_setup_periods(struct azx *chip, pos_adj = bdl_pos_adj[chip->dev_index]; if (pos_adj > 0) { struct snd_pcm_runtime *runtime = substream->runtime; - int pos_align = pos_adj; pos_adj = (pos_adj * runtime->rate + 47999) / 48000; if (!pos_adj) - pos_adj = pos_align; - else - pos_adj = ((pos_adj + pos_align - 1) / pos_align) * - pos_align; + pos_adj = 1; pos_adj = frames_to_bytes(runtime, pos_adj); if (pos_adj >= period_bytes) { snd_printk(KERN_WARNING "Too big adjustment %d\n", diff --git a/trunk/sound/pci/hda/patch_realtek.c b/trunk/sound/pci/hda/patch_realtek.c index add4e87e0b20..2807bc840d26 100644 --- a/trunk/sound/pci/hda/patch_realtek.c +++ b/trunk/sound/pci/hda/patch_realtek.c @@ -122,8 +122,6 @@ enum { /* ALC269 models */ enum { ALC269_BASIC, - ALC269_ASUS_EEEPC_P703, - ALC269_ASUS_EEEPC_P901, ALC269_AUTO, ALC269_MODEL_LAST /* last tag */ }; @@ -7907,7 +7905,6 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE), SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE), SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE), - SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), /* default Acer */ SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL), SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG), @@ -10949,23 +10946,7 @@ static int patch_alc268(struct hda_codec *codec) static hda_nid_t alc269_adc_nids[1] = { /* ADC1 */ - 0x08, -}; - -static struct hda_input_mux alc269_eeepc_dmic_capture_source = { - .num_items = 2, - .items = { - { "i-Mic", 0x5 }, - { "e-Mic", 0x0 }, - }, -}; - -static struct hda_input_mux alc269_eeepc_amic_capture_source = { - .num_items = 2, - .items = { - { "i-Mic", 0x1 }, - { "e-Mic", 0x0 }, - }, + 0x07, }; #define alc269_modes alc260_modes @@ -10987,27 +10968,10 @@ static struct snd_kcontrol_new alc269_base_mixer[] = { { } /* end */ }; -/* bind volumes of both NID 0x0c and 0x0d */ -static struct hda_bind_ctls alc269_epc_bind_vol = { - .ops = &snd_hda_bind_vol, - .values = { - HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT), - HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT), - 0 - }, -}; - -static struct snd_kcontrol_new alc269_eeepc_mixer[] = { - HDA_CODEC_MUTE("iSpeaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), - HDA_BIND_VOL("LineOut Playback Volume", &alc269_epc_bind_vol), - HDA_CODEC_MUTE("LineOut Playback Switch", 0x15, 0x0, HDA_OUTPUT), - { } /* end */ -}; - /* capture mixer elements */ static struct snd_kcontrol_new alc269_capture_mixer[] = { - HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), - HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT), + HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT), { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, /* The multiple "Capture Source" controls confuse alsamixer @@ -11023,13 +10987,6 @@ static struct snd_kcontrol_new alc269_capture_mixer[] = { { } /* end */ }; -/* capture mixer elements */ -static struct snd_kcontrol_new alc269_epc_capture_mixer[] = { - HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), - HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), - { } /* end */ -}; - /* * generic initialization of ADC, input mixers and output mixers */ @@ -11037,7 +10994,7 @@ static struct hda_verb alc269_init_verbs[] = { /* * Unmute ADC0 and set the default input to mic-in */ - {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, + {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, /* Mute input amps (PCBeep, Line In, Mic 1 & Mic 2) of the * analog-loopback mixer widget @@ -11100,98 +11057,6 @@ static struct hda_verb alc269_init_verbs[] = { { } }; -static struct hda_verb alc269_eeepc_dmic_init_verbs[] = { - {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, - {0x23, AC_VERB_SET_CONNECT_SEL, 0x05}, - {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, - {0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x7019 | (0x00 << 8))}, - {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, - {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, - {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, - {} -}; - -static struct hda_verb alc269_eeepc_amic_init_verbs[] = { - {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, - {0x23, AC_VERB_SET_CONNECT_SEL, 0x01}, - {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, - {0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x701b | (0x00 << 8))}, - {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, - {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, - {} -}; - -/* toggle speaker-output according to the hp-jack state */ -static void alc269_speaker_automute(struct hda_codec *codec) -{ - unsigned int present; - unsigned int bits; - - present = snd_hda_codec_read(codec, 0x15, 0, - AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; - bits = present ? AMP_IN_MUTE(0) : 0; - snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, - AMP_IN_MUTE(0), bits); - snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1, - AMP_IN_MUTE(0), bits); -} - -static void alc269_eeepc_dmic_automute(struct hda_codec *codec) -{ - unsigned int present; - - present = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0) - & AC_PINSENSE_PRESENCE; - snd_hda_codec_write(codec, 0x23, 0, AC_VERB_SET_CONNECT_SEL, - present ? 0 : 5); -} - -static void alc269_eeepc_amic_automute(struct hda_codec *codec) -{ - unsigned int present; - - present = snd_hda_codec_read(codec, 0x18, 0, AC_VERB_GET_PIN_SENSE, 0) - & AC_PINSENSE_PRESENCE; - snd_hda_codec_write(codec, 0x24, 0, AC_VERB_SET_AMP_GAIN_MUTE, - present ? AMP_IN_UNMUTE(0) : AMP_IN_MUTE(0)); - snd_hda_codec_write(codec, 0x24, 0, AC_VERB_SET_AMP_GAIN_MUTE, - present ? AMP_IN_MUTE(1) : AMP_IN_UNMUTE(1)); -} - -/* unsolicited event for HP jack sensing */ -static void alc269_eeepc_dmic_unsol_event(struct hda_codec *codec, - unsigned int res) -{ - if ((res >> 26) == ALC880_HP_EVENT) - alc269_speaker_automute(codec); - - if ((res >> 26) == ALC880_MIC_EVENT) - alc269_eeepc_dmic_automute(codec); -} - -static void alc269_eeepc_dmic_inithook(struct hda_codec *codec) -{ - alc269_speaker_automute(codec); - alc269_eeepc_dmic_automute(codec); -} - -/* unsolicited event for HP jack sensing */ -static void alc269_eeepc_amic_unsol_event(struct hda_codec *codec, - unsigned int res) -{ - if ((res >> 26) == ALC880_HP_EVENT) - alc269_speaker_automute(codec); - - if ((res >> 26) == ALC880_MIC_EVENT) - alc269_eeepc_amic_automute(codec); -} - -static void alc269_eeepc_amic_inithook(struct hda_codec *codec) -{ - alc269_speaker_automute(codec); - alc269_eeepc_amic_automute(codec); -} - /* add playback controls from the parsed DAC table */ static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec, const struct auto_pin_cfg *cfg) @@ -11323,9 +11188,6 @@ static int alc269_parse_auto_config(struct hda_codec *codec) if (err < 0) return err; - spec->mixers[spec->num_mixers] = alc269_capture_mixer; - spec->num_mixers++; - return 1; } @@ -11353,16 +11215,12 @@ static const char *alc269_models[ALC269_MODEL_LAST] = { }; static struct snd_pci_quirk alc269_cfg_tbl[] = { - SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", - ALC269_ASUS_EEEPC_P703), - SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901", - ALC269_ASUS_EEEPC_P901), {} }; static struct alc_config_preset alc269_presets[] = { [ALC269_BASIC] = { - .mixers = { alc269_base_mixer, alc269_capture_mixer }, + .mixers = { alc269_base_mixer }, .init_verbs = { alc269_init_verbs }, .num_dacs = ARRAY_SIZE(alc269_dac_nids), .dac_nids = alc269_dac_nids, @@ -11371,32 +11229,6 @@ static struct alc_config_preset alc269_presets[] = { .channel_mode = alc269_modes, .input_mux = &alc269_capture_source, }, - [ALC269_ASUS_EEEPC_P703] = { - .mixers = { alc269_eeepc_mixer, alc269_epc_capture_mixer }, - .init_verbs = { alc269_init_verbs, - alc269_eeepc_amic_init_verbs }, - .num_dacs = ARRAY_SIZE(alc269_dac_nids), - .dac_nids = alc269_dac_nids, - .hp_nid = 0x03, - .num_channel_mode = ARRAY_SIZE(alc269_modes), - .channel_mode = alc269_modes, - .input_mux = &alc269_eeepc_amic_capture_source, - .unsol_event = alc269_eeepc_amic_unsol_event, - .init_hook = alc269_eeepc_amic_inithook, - }, - [ALC269_ASUS_EEEPC_P901] = { - .mixers = { alc269_eeepc_mixer, alc269_epc_capture_mixer}, - .init_verbs = { alc269_init_verbs, - alc269_eeepc_dmic_init_verbs }, - .num_dacs = ARRAY_SIZE(alc269_dac_nids), - .dac_nids = alc269_dac_nids, - .hp_nid = 0x03, - .num_channel_mode = ARRAY_SIZE(alc269_modes), - .channel_mode = alc269_modes, - .input_mux = &alc269_eeepc_dmic_capture_source, - .unsol_event = alc269_eeepc_dmic_unsol_event, - .init_hook = alc269_eeepc_dmic_inithook, - }, }; static int patch_alc269(struct hda_codec *codec) @@ -11450,6 +11282,8 @@ static int patch_alc269(struct hda_codec *codec) spec->adc_nids = alc269_adc_nids; spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); + spec->mixers[spec->num_mixers] = alc269_capture_mixer; + spec->num_mixers++; codec->patch_ops = alc_patch_ops; if (board_config == ALC269_AUTO) @@ -13160,7 +12994,6 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = { SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP), SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST), SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST), - SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC861VD_LENOVO), SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG), SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO), diff --git a/trunk/sound/pci/hda/patch_sigmatel.c b/trunk/sound/pci/hda/patch_sigmatel.c index 7fdafcb0015d..08cb77f51880 100644 --- a/trunk/sound/pci/hda/patch_sigmatel.c +++ b/trunk/sound/pci/hda/patch_sigmatel.c @@ -94,9 +94,6 @@ enum { STAC_INTEL_MAC_V3, STAC_INTEL_MAC_V4, STAC_INTEL_MAC_V5, - STAC_INTEL_MAC_AUTO, /* This model is selected if no module parameter - * is given, one of the above models will be - * chosen according to the subsystem id. */ /* for backward compatibility */ STAC_MACMINI, STAC_MACBOOK, @@ -1486,7 +1483,6 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { [STAC_INTEL_MAC_V3] = intel_mac_v3_pin_configs, [STAC_INTEL_MAC_V4] = intel_mac_v4_pin_configs, [STAC_INTEL_MAC_V5] = intel_mac_v5_pin_configs, - [STAC_INTEL_MAC_AUTO] = intel_mac_v3_pin_configs, /* for backward compatibility */ [STAC_MACMINI] = intel_mac_v3_pin_configs, [STAC_MACBOOK] = intel_mac_v5_pin_configs, @@ -1509,7 +1505,6 @@ static const char *stac922x_models[STAC_922X_MODELS] = { [STAC_INTEL_MAC_V3] = "intel-mac-v3", [STAC_INTEL_MAC_V4] = "intel-mac-v4", [STAC_INTEL_MAC_V5] = "intel-mac-v5", - [STAC_INTEL_MAC_AUTO] = "intel-mac-auto", /* for backward compatibility */ [STAC_MACMINI] = "macmini", [STAC_MACBOOK] = "macbook", @@ -1581,9 +1576,9 @@ static struct snd_pci_quirk stac922x_cfg_tbl[] = { SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0707, "Intel D945P", STAC_D945GTP5), /* other systems */ - /* Apple Intel Mac (Mac Mini, MacBook, MacBook Pro...) */ + /* Apple Mac Mini (early 2006) */ SND_PCI_QUIRK(0x8384, 0x7680, - "Mac", STAC_INTEL_MAC_AUTO), + "Mac Mini", STAC_INTEL_MAC_V3), /* Dell systems */ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a7, "unknown Dell", STAC_922X_DELL_D81), @@ -3730,7 +3725,7 @@ static int patch_stac922x(struct hda_codec *codec) spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS, stac922x_models, stac922x_cfg_tbl); - if (spec->board_config == STAC_INTEL_MAC_AUTO) { + if (spec->board_config == STAC_INTEL_MAC_V3) { spec->gpio_mask = spec->gpio_dir = 0x03; spec->gpio_data = 0x03; /* Intel Macs have all same PCI SSID, so we need to check @@ -3762,9 +3757,6 @@ static int patch_stac922x(struct hda_codec *codec) case 0x106b2200: spec->board_config = STAC_INTEL_MAC_V5; break; - default: - spec->board_config = STAC_INTEL_MAC_V3; - break; } } diff --git a/trunk/sound/soc/au1x/psc-i2s.c b/trunk/sound/soc/au1x/psc-i2s.c index 9384702c7ebd..ba4b5c199f21 100644 --- a/trunk/sound/soc/au1x/psc-i2s.c +++ b/trunk/sound/soc/au1x/psc-i2s.c @@ -231,7 +231,7 @@ static int au1xpsc_i2s_stop(struct au1xpsc_audio_data *pscdata, int stype) /* if both TX and RX are idle, disable PSC */ stat = au_readl(I2S_STAT(pscdata)); - if (!(stat & (PSC_I2SSTAT_TB | PSC_I2SSTAT_RB))) { + if (!(stat & (PSC_I2SSTAT_RB | PSC_I2SSTAT_RB))) { au_writel(0, I2S_CFG(pscdata)); au_sync(); au_writel(PSC_CTRL_SUSPEND, PSC_CTRL(pscdata)); diff --git a/trunk/sound/soc/codecs/wm9712.c b/trunk/sound/soc/codecs/wm9712.c index 1fb7f9a7aecd..9fc8edd82225 100644 --- a/trunk/sound/soc/codecs/wm9712.c +++ b/trunk/sound/soc/codecs/wm9712.c @@ -427,20 +427,20 @@ static const struct snd_soc_dapm_route audio_map[] = { {"HPOUTR", NULL, "Headphone PGA"}, {"Headphone PGA", NULL, "Right HP Mixer"}, - /* mono mixer */ - {"Mono Mixer", NULL, "Left HP Mixer"}, - {"Mono Mixer", NULL, "Right HP Mixer"}, + /* mono hp mixer */ + {"Mono HP Mixer", NULL, "Left HP Mixer"}, + {"Mono HP Mixer", NULL, "Right HP Mixer"}, /* Out3 Mux */ {"Out3 Mux", "Left", "Left HP Mixer"}, {"Out3 Mux", "Mono", "Phone Mixer"}, - {"Out3 Mux", "Left + Right", "Mono Mixer"}, + {"Out3 Mux", "Left + Right", "Mono HP Mixer"}, {"Out 3 PGA", NULL, "Out3 Mux"}, {"OUT3", NULL, "Out 3 PGA"}, /* speaker Mux */ {"Speaker Mux", "Speaker Mix", "Speaker Mixer"}, - {"Speaker Mux", "Headphone Mix", "Mono Mixer"}, + {"Speaker Mux", "Headphone Mix", "Mono HP Mixer"}, {"Speaker PGA", NULL, "Speaker Mux"}, {"LOUT2", NULL, "Speaker PGA"}, {"ROUT2", NULL, "Speaker PGA"}, diff --git a/trunk/sound/soc/soc-dapm.c b/trunk/sound/soc/soc-dapm.c index 820347c9ae4b..2c87061c2a6b 100644 --- a/trunk/sound/soc/soc-dapm.c +++ b/trunk/sound/soc/soc-dapm.c @@ -523,6 +523,24 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event) continue; } + /* programmable gain/attenuation */ + if (w->id == snd_soc_dapm_pga) { + int on; + in = is_connected_input_ep(w); + dapm_clear_walk(w->codec); + out = is_connected_output_ep(w); + dapm_clear_walk(w->codec); + w->power = on = (out != 0 && in != 0) ? 1 : 0; + + if (!on) + dapm_set_pga(w, on); /* lower volume to reduce pops */ + dapm_update_bits(w); + if (on) + dapm_set_pga(w, on); /* restore volume from zero */ + + continue; + } + /* pre and post event widgets */ if (w->id == snd_soc_dapm_pre) { if (!w->event) @@ -568,56 +586,45 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event) power_change = (w->power == power) ? 0: 1; w->power = power; - if (!power_change) - continue; - /* call any power change event handlers */ - if (w->event) - pr_debug("power %s event for %s flags %x\n", - w->power ? "on" : "off", - w->name, w->event_flags); - - /* power up pre event */ - if (power && w->event && - (w->event_flags & SND_SOC_DAPM_PRE_PMU)) { - ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMU); - if (ret < 0) - return ret; - } - - /* power down pre event */ - if (!power && w->event && - (w->event_flags & SND_SOC_DAPM_PRE_PMD)) { - ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMD); - if (ret < 0) - return ret; - } - - /* Lower PGA volume to reduce pops */ - if (w->id == snd_soc_dapm_pga && !power) - dapm_set_pga(w, power); - - dapm_update_bits(w); - - /* Raise PGA volume to reduce pops */ - if (w->id == snd_soc_dapm_pga && power) - dapm_set_pga(w, power); - - /* power up post event */ - if (power && w->event && - (w->event_flags & SND_SOC_DAPM_POST_PMU)) { - ret = w->event(w, - NULL, SND_SOC_DAPM_POST_PMU); - if (ret < 0) - return ret; - } - - /* power down post event */ - if (!power && w->event && - (w->event_flags & SND_SOC_DAPM_POST_PMD)) { - ret = w->event(w, NULL, SND_SOC_DAPM_POST_PMD); - if (ret < 0) - return ret; + if (power_change) { + if (w->event) { + pr_debug("power %s event for %s flags %x\n", + w->power ? "on" : "off", w->name, w->event_flags); + if (power) { + /* power up event */ + if (w->event_flags & SND_SOC_DAPM_PRE_PMU) { + ret = w->event(w, + NULL, SND_SOC_DAPM_PRE_PMU); + if (ret < 0) + return ret; + } + dapm_update_bits(w); + if (w->event_flags & SND_SOC_DAPM_POST_PMU){ + ret = w->event(w, + NULL, SND_SOC_DAPM_POST_PMU); + if (ret < 0) + return ret; + } + } else { + /* power down event */ + if (w->event_flags & SND_SOC_DAPM_PRE_PMD) { + ret = w->event(w, + NULL, SND_SOC_DAPM_PRE_PMD); + if (ret < 0) + return ret; + } + dapm_update_bits(w); + if (w->event_flags & SND_SOC_DAPM_POST_PMD) { + ret = w->event(w, + NULL, SND_SOC_DAPM_POST_PMD); + if (ret < 0) + return ret; + } + } + } else + /* no event handler */ + dapm_update_bits(w); } } }