]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'kvm-updates-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 27 Jul 2008 17:00:23 +0000 (10:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 27 Jul 2008 17:00:23 +0000 (10:00 -0700)
* 'kvm-updates-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm:
  KVM: ppc: fix invalidation of large guest pages
  KVM: s390: Fix possible host kernel bug on lctl(g) handling
  KVM: s390: Fix instruction naming for lctlg
  KVM: s390: Fix program check on interrupt delivery handling
  KVM: s390: Change guestaddr type in gaccess
  KVM: s390: Fix guest kconfig
  KVM: s390: Advertise KVM_CAP_USER_MEMORY
  KVM: ia64: Fix irq disabling leak in error handling code
  KVM: VMX: Fix undefined beaviour of EPT after reload kvm-intel.ko
  KVM: VMX: Fix bypass_guest_pf enabling when disable EPT in module parameter
  KVM: task switch: translate guest segment limit to virt-extension byte granular field
  KVM: Avoid instruction emulation when event delivery is pending
  KVM: task switch: use seg regs provided by subarch instead of reading from GDT
  KVM: task switch: segment base is linear address
  KVM: SVM: allow enabling/disabling NPT by reloading only the architecture module

52 files changed:
Documentation/sound/alsa/ALSA-Configuration.txt
Documentation/sparse.txt
Kbuild
Makefile
drivers/crypto/talitos.c
drivers/isdn/hardware/mISDN/Kconfig
drivers/isdn/mISDN/layer2.c
drivers/isdn/mISDN/layer2.h
drivers/isdn/mISDN/tei.c
drivers/misc/Kconfig
fs/proc/base.c
include/Kbuild
include/asm-generic/vmlinux.lds.h
include/linux/sched.h
include/linux/task_io_accounting.h
include/linux/task_io_accounting_ops.h
include/net/ipv6.h
include/net/route.h
init/Kconfig
kernel/exit.c
kernel/fork.c
kernel/sysctl.c
kernel/trace/trace.c
kernel/tsacct.c
net/ipv4/route.c
net/ipv4/sysctl_net_ipv4.c
net/ipv6/af_inet6.c
net/ipv6/sysctl_net_ipv6.c
net/sysctl_net.c
scripts/Makefile.headersinst
scripts/diffconfig [new file with mode: 0755]
scripts/hdrcheck.sh [deleted file]
scripts/headers.sh [new file with mode: 0755]
scripts/headers_check.pl [new file with mode: 0644]
scripts/headers_install.pl [new file with mode: 0644]
scripts/kconfig/conf.c
scripts/kconfig/confdata.c
scripts/kconfig/lkc.h
scripts/kernel-doc
scripts/setlocalversion
sound/isa/cs423x/cs4236.c
sound/isa/opti9xx/opti92x-ad1848.c
sound/pci/ac97/ac97_codec.c
sound/pci/ac97/ac97_patch.c
sound/pci/azt3328.h
sound/pci/ens1370.c
sound/pci/hda/hda_intel.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/soc/au1x/psc-i2s.c
sound/soc/codecs/wm9712.c
sound/soc/soc-dapm.c

index 72aff61e731509d7c87f3a3913aa3b4e965ab9c5..6f6d117ac7e22cd2d9fc981f0fc8542d824d1db8 100644 (file)
@@ -1024,6 +1024,7 @@ 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)
index 1a3bdc27d95e98ce49c07791b02515e38ef678a5..42f43fa59f24c75c1f553dc5078f88b949302fd9 100644 (file)
@@ -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 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__:
+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__:
 
-        make C=2 CHECKFLAGS="-D__CHECK_ENDIAN__"
+        make C=2 CF="-D__CHECK_ENDIAN__"
 
 These checks are disabled by default as they generate a host of warnings.
diff --git a/Kbuild b/Kbuild
index e750e9c3fe59862e377a568e0758ca838e11c6f1..f056b4feee519748ae6ef22fde3df1da532e177b 100644 (file)
--- a/Kbuild
+++ b/Kbuild
@@ -43,7 +43,7 @@ $(obj)/$(bounds-file): kernel/bounds.s Kbuild
 # 2) Generate asm-offsets.h
 #
 
-offsets-file := include/asm-$(SRCARCH)/asm-offsets.h
+offsets-file := include/asm/asm-offsets.h
 
 always  += $(offsets-file)
 targets += $(offsets-file)
@@ -81,7 +81,6 @@ 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)
 
 #####
index 3cad7db5eba7a7570b392f5d5b4c99b794ee71e5..40f24810116ccfcf9fe775b03c0fd58eef5fe905 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -205,6 +205,9 @@ ifeq ($(ARCH),x86_64)
         SRCARCH := x86
 endif
 
+# Where to locate arch specific headers
+hdr-arch       := $(SRCARCH)
+
 KCONFIG_CONFIG ?= .config
 
 # SHELL used by kbuild
@@ -326,7 +329,8 @@ AFLAGS_KERNEL       =
 # Needed to be compatible with the O= option
 LINUXINCLUDE    := -Iinclude \
                    $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
-                  -include include/linux/autoconf.h
+                   -I$(srctree)/arch/$(hdr-arch)/include               \
+                   -include include/linux/autoconf.h
 
 KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
 
@@ -922,7 +926,9 @@ ifneq ($(KBUILD_SRC),)
                /bin/false; \
        fi;
        $(Q)if [ ! -d include2 ]; then mkdir -p include2; fi;
-       $(Q)ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm
+       $(Q)if [ -e $(srctree)/include/asm-$(SRCARCH)/system.h ]; then  \
+           ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm;     \
+           fi
 endif
 
 # prepare2 creates a makefile if using a separate output directory
@@ -948,22 +954,34 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
 
 # The asm symlink changes when $(ARCH) changes.
 # Detect this and ask user to run make mrproper
-
-include/asm: FORCE
-       $(Q)set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`;   \
-       if [ -L include/asm ]; then                                     \
-               if [ "$$asmlink" != "$(SRCARCH)" ]; then                \
+define check-symlink
+       set -e;                                                            \
+       if [ -L include/asm ]; then                                        \
+               asmlink=`readlink include/asm | cut -d '-' -f 2`;          \
+               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;                                                     \
-       else                                                            \
-               echo '  SYMLINK $@ -> include/asm-$(SRCARCH)';          \
-               if [ ! -d include ]; then                               \
-                       mkdir -p include;                               \
-               fi;                                                     \
-               ln -fsn asm-$(SRCARCH) $@;                              \
+                       exit 1;                                            \
+               fi;                                                        \
        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
 # ---------------------------------------------------------------------------
@@ -1010,36 +1028,43 @@ firmware_install: FORCE
 
 # ---------------------------------------------------------------------------
 # Kernel headers
-INSTALL_HDR_PATH=$(objtree)/usr
-export INSTALL_HDR_PATH
 
-HDRFILTER=generic i386 x86_64
-HDRARCHES=$(filter-out $(HDRFILTER),$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild)))
+#Default location for installed headers
+export INSTALL_HDR_PATH = $(objtree)/usr
 
-PHONY += headers_install_all
-headers_install_all: include/linux/version.h scripts_basic FORCE
+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
-       $(Q)for arch in $(HDRARCHES); do \
-        $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\
-        done
+
+PHONY += headers_install_all
+headers_install_all:
+       $(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh install
 
 PHONY += headers_install
-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
+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)
 
 PHONY += headers_check_all
 headers_check_all: headers_install_all
-       $(Q)for arch in $(HDRARCHES); do \
-        $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch HDRCHECK=1 ;\
-        done
+       $(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh check
 
 PHONY += headers_check
 headers_check: headers_install
-       $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include HDRCHECK=1
+       $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
+       $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) HDRCHECK=1
 
 # ---------------------------------------------------------------------------
 # Modules
@@ -1131,7 +1156,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 tags TAGS cscope*
+                 Module.symvers Module.markers tags TAGS cscope*
 
 # clean - Delete most, but leave enough to build external modules
 #
@@ -1150,7 +1175,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 'Module.markers' -o -name '.tmp_*.o.*' \) \
                -type f -print | xargs rm -f
 
 # mrproper - Delete all generated files, including .config
@@ -1224,21 +1249,17 @@ help:
        @echo  '  cscope          - Generate cscope index'
        @echo  '  kernelrelease   - Output the release version string'
        @echo  '  kernelversion   - Output the version stored in Makefile'
-       @if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \
-        echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
+       @echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
         echo  '                    (default: $(INSTALL_HDR_PATH))'; \
-        fi
-       @echo  ''
+        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'
-       @if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \
-        echo  '  headers_check   - Sanity check on exported headers'; \
-        fi
-       @echo  ''
+       @echo  '  headers_check   - Sanity check on exported headers'; \
+        echo  ''
        @echo  'Kernel packaging:'
        @$(MAKE) $(build)=$(package-dir) help
        @echo  ''
@@ -1411,7 +1432,11 @@ define find-sources
               \( -name config -o -name 'asm-*' \) -prune \
               -o -name $1 -print; \
          for arch in $(ALLINCLUDE_ARCHS) ; do \
-              find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
+              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) \
                    -name $1 -print; \
          done ; \
          find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
index b11943dadefd7a23d85d29f5908451859e397497..681c15f420834a545292b17974e523d387d2f243 100644 (file)
@@ -99,6 +99,9 @@ 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;
 
@@ -263,15 +266,15 @@ static int talitos_submit(struct device *dev, struct talitos_desc *desc,
 
        spin_lock_irqsave(&priv->head_lock[ch], flags);
 
-       head = priv->head[ch];
-       request = &priv->fifo[ch][head];
-
-       if (request->desc) {
-               /* request queue is full */
+       if (!atomic_inc_not_zero(&priv->submit_count[ch])) {
+               /* h/w fifo 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);
@@ -335,6 +338,9 @@ 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 */
@@ -842,7 +848,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 (link_tbl_ptr->len <= (-cryptlen)) {
+       while (be16_to_cpu(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;
@@ -874,7 +880,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;
+       int sg_count, ret;
 
        /* hmac key */
        map_single_talitos_ptr(dev, &desc->ptr[0], ctx->authkeylen, &ctx->key,
@@ -978,7 +984,12 @@ 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);
 
-       return talitos_submit(dev, desc, callback, areq);
+       ret = talitos_submit(dev, desc, callback, areq);
+       if (ret != -EINPROGRESS) {
+               ipsec_esp_unmap(dev, edesc, areq);
+               kfree(edesc);
+       }
+       return ret;
 }
 
 
@@ -1009,6 +1020,8 @@ 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");
@@ -1022,7 +1035,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 : src_nents;
+               dst_nents = (dst_nents == 1) ? 0 : dst_nents;
        }
 
        /*
@@ -1040,7 +1053,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);
+       edesc = kmalloc(alloc_len, GFP_DMA | flags);
        if (!edesc) {
                dev_err(ctx->dev, "could not allocate edescriptor\n");
                return ERR_PTR(-ENOMEM);
@@ -1337,6 +1350,7 @@ 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);
 
@@ -1466,9 +1480,6 @@ 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,
@@ -1504,6 +1515,16 @@ 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) {
@@ -1559,8 +1580,6 @@ static int talitos_probe(struct of_device *ofdev,
 
 err_out:
        talitos_remove(ofdev);
-       if (np)
-               of_node_put(np);
 
        return err;
 }
index 14793480c453e0e915a4188dc697af6e9e5b416e..9cd5f5f62280042f870f606a8e2da8d43fe2c8cc 100644 (file)
@@ -7,6 +7,7 @@ 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.
index f5ad888ee71eb06854d0058c23fde221c2ebd984..a7915a156c0419eff3cbafede3b69d649549e934 100644 (file)
@@ -2030,7 +2030,7 @@ release_l2(struct layer2 *l2)
        skb_queue_purge(&l2->down_queue);
        ReleaseWin(l2);
        if (test_bit(FLG_LAPD, &l2->flag)) {
-               release_tei(l2);
+               TEIrelease(l2);
                if (l2->ch.st)
                        l2->ch.st->dev->D.ctrl(&l2->ch.st->dev->D,
                            CLOSE_CHANNEL, NULL);
index de2dd02056a36c607f9568e5c7b332038795ee0b..6293f80dc2d3762bfcb5579490a542271bf8890f 100644 (file)
@@ -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            release_tei(struct layer2 *);
+extern void            TEIrelease(struct layer2 *);
 extern int             TEIInit(u_int *);
 extern void            TEIFree(void);
 
index 56a76a0ffddd5715ad25d2cf22e5bd4581da8b80..6fbae42127bfd8ebcc268db5dc029781d7618ad8 100644 (file)
@@ -945,7 +945,7 @@ l2_tei(struct layer2 *l2, u_int cmd, u_long arg)
 }
 
 void
-release_tei(struct layer2 *l2)
+TEIrelease(struct layer2 *l2)
 {
        struct teimgr   *tm = l2->tm;
        u_long          flags;
index 321eb913463504ed9e7699bdbc17f4b0fa6d297a..f5ade1904aadafefd641a90c36c63eacaf038dfd 100644 (file)
@@ -360,7 +360,7 @@ config THINKPAD_ACPI_VIDEO
          If you are not sure, say Y here.
 
 config THINKPAD_ACPI_HOTKEY_POLL
-       bool "Suport NVRAM polling for hot keys"
+       bool "Support NVRAM polling for hot keys"
        depends on THINKPAD_ACPI
        default y
        ---help---
index e74308bdabd3dc9d5b317dbf8eeadb4dc4f8ceab..3d94906c7aa857129e3fcd904289a1fc0b1afc85 100644 (file)
@@ -53,6 +53,7 @@
 #include <linux/time.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
+#include <linux/task_io_accounting_ops.h>
 #include <linux/init.h>
 #include <linux/capability.h>
 #include <linux/file.h>
@@ -2402,44 +2403,17 @@ 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)
 {
-       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);
-               }
+       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);
        }
        return sprintf(buffer,
                        "rchar: %llu\n"
@@ -2449,9 +2423,10 @@ 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",
-                       rchar, wchar, syscr, syscw,
-                       ioac.read_bytes, ioac.write_bytes,
-                       ioac.cancelled_write_bytes);
+                       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);
 }
 
 static int proc_tid_io_accounting(struct task_struct *task, char *buffer)
index bdca155028ecd343b4ebf0182904dc83f1e61469..d8c3e3cbf41603eb983e5922da3ee796c7fece84 100644 (file)
@@ -1,3 +1,6 @@
+# Top-level Makefile calls into asm-$(ARCH)
+# List only non-arch directories below
+
 header-y += asm-generic/
 header-y += linux/
 header-y += sound/
@@ -5,5 +8,3 @@ header-y += mtd/
 header-y += rdma/
 header-y += video/
 header-y += drm/
-
-header-y += asm-$(ARCH)/
index 9cd44b162ba1809af8d28093da19b353f7be7cd0..6d88a923c945cea5b860bb8dc8051c236740f771 100644 (file)
  * 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)                                     \
        CPU_KEEP(init.text)                                             \
        CPU_KEEP(exit.text)                                             \
        MEM_KEEP(init.text)                                             \
-       MEM_KEEP(exit.text)
+       MEM_KEEP(exit.text)                                             \
+               *(.text.unlikely)
 
 
 /* sched.text is aling to function alignment to secure we have same
index f59318a0099bb5b002001bdf3615cef4340c988e..034c1ca6b3326d6c3b4c5ea4c70777bfb116a561 100644 (file)
@@ -505,10 +505,7 @@ 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;
-#ifdef CONFIG_TASK_XACCT
-       u64 rchar, wchar, syscr, syscw;
-#endif
-       struct task_io_accounting ioac;
+       struct proc_io_accounting ioac;
 
        /*
         * Cumulative ns of scheduled CPU time for dead threads in the
@@ -1256,11 +1253,7 @@ struct task_struct {
 
        unsigned long ptrace_message;
        siginfo_t *last_siginfo; /* For ptrace use.  */
-#ifdef CONFIG_TASK_XACCT
-/* i/o counters(bytes read/written, #syscalls */
-       u64 rchar, wchar, syscr, syscw;
-#endif
-       struct task_io_accounting ioac;
+       struct proc_io_accounting ioac;
 #if defined(CONFIG_TASK_XACCT)
        u64 acct_rss_mem1;      /* accumulated rss usage */
        u64 acct_vm_mem1;       /* accumulated virtual memory usage */
@@ -2190,22 +2183,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->rchar += amt;
+       tsk->ioac.chr.rchar += amt;
 }
 
 static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
 {
-       tsk->wchar += amt;
+       tsk->ioac.chr.wchar += amt;
 }
 
 static inline void inc_syscr(struct task_struct *tsk)
 {
-       tsk->syscr++;
+       tsk->ioac.chr.syscr++;
 }
 
 static inline void inc_syscw(struct task_struct *tsk)
 {
-       tsk->syscw++;
+       tsk->ioac.chr.syscw++;
 }
 #else
 static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
index 44d00e9cceea551256df7428be8856e719d04ef1..165390f8b93672e8b79a2fe9a40eb21f74ab1b5e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * task_io_accounting: a structure which is used for recording a single task's
+ * proc_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,6 +8,22 @@
  * 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 {
        /*
@@ -31,7 +47,12 @@ struct task_io_accounting {
         */
        u64 cancelled_write_bytes;
 };
-#else
+#else /* CONFIG_TASK_IO_ACCOUNTING */
 struct task_io_accounting {
 };
-#endif
+#endif /* CONFIG_TASK_IO_ACCOUNTING */
+
+struct proc_io_accounting {
+       struct task_chr_io_accounting chr;
+       struct task_io_accounting blk;
+};
index ff46c6fad79da300afaa621a41abcfb1bf4c787f..e6f958ebe97fb1f475266ffb389c172312875f01 100644 (file)
@@ -9,7 +9,7 @@
 #ifdef CONFIG_TASK_IO_ACCOUNTING
 static inline void task_io_account_read(size_t bytes)
 {
-       current->ioac.read_bytes += bytes;
+       current->ioac.blk.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.read_bytes >> 9;
+       return p->ioac.blk.read_bytes >> 9;
 }
 
 static inline void task_io_account_write(size_t bytes)
 {
-       current->ioac.write_bytes += bytes;
+       current->ioac.blk.write_bytes += bytes;
 }
 
 /*
@@ -32,17 +32,25 @@ 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.write_bytes >> 9;
+       return p->ioac.blk.write_bytes >> 9;
 }
 
 static inline void task_io_account_cancelled_write(size_t bytes)
 {
-       current->ioac.cancelled_write_bytes += bytes;
+       current->ioac.blk.cancelled_write_bytes += bytes;
 }
 
-static inline void task_io_accounting_init(struct task_struct *tsk)
+static inline void task_io_accounting_init(struct proc_io_accounting *ioac)
 {
-       memset(&tsk->ioac, 0, sizeof(tsk->ioac));
+       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;
 }
 
 #else
@@ -69,9 +77,37 @@ static inline void task_io_account_cancelled_write(size_t bytes)
 {
 }
 
-static inline void task_io_accounting_init(struct task_struct *tsk)
+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)
 {
 }
 
-#endif         /* CONFIG_TASK_IO_ACCOUNTING */
-#endif         /* __TASK_IO_ACCOUNTING_OPS_INCLUDED */
+#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 */
index 2d5c18514a2d2d3b3e77e0a0d141d07dafec0c6d..113028fb8f6610c912e57326dbaf6f4bd1c5c649 100644 (file)
@@ -608,6 +608,8 @@ 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__ */
index 3140cc500854064b647245366ee112115dea40e2..4f0d8c14736cba916799c7793848d8d42595483f 100644 (file)
@@ -204,6 +204,4 @@ static inline struct inet_peer *rt_get_peer(struct rtable *rt)
        return rt->peer;
 }
 
-extern ctl_table ipv4_route_table[];
-
 #endif /* _ROUTE_H */
index a50bdfed2df7664eacbb4a655b07b381caf64d99..43d6989c275f3432a0404771af92015f13717a01 100644 (file)
@@ -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 <http://www.physik3.uni-rostock.de/tim/kernel/utils/acct/>.
+         at <http://www.gnu.org/software/acct/>.
 
 config TASKSTATS
        bool "Export task/process statistics through netlink (EXPERIMENTAL)"
@@ -486,7 +486,7 @@ config PID_NS
        default n
        depends on NAMESPACES && EXPERIMENTAL
        help
-         Suport process id namespaces.  This allows having multiple
+         Support 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.
 
index 0caf590548a0291d0a8be8b89c78e7147fb3e59a..eb4d6470d1d01f79a33a94df89833c3ba7d4387a 100644 (file)
@@ -121,18 +121,7 @@ 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);
-#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 */
+               task_io_accounting_add(&sig->ioac, &tsk->ioac);
                sig->sum_sched_runtime += tsk->se.sum_exec_runtime;
                sig = NULL; /* Marker for below. */
        }
@@ -1363,21 +1352,8 @@ static int wait_task_zombie(struct task_struct *p, int options,
                psig->coublock +=
                        task_io_get_oublock(p) +
                        sig->oublock + sig->coublock;
-#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 */
+               task_io_accounting_add(&psig->ioac, &p->ioac);
+               task_io_accounting_add(&psig->ioac, &sig->ioac);
                spin_unlock_irq(&p->parent->sighand->siglock);
        }
 
index 5e050c1317c4b9cfc5c098c415b267ce93366134..8214ba7c8bb1ad78e110687ade3459bff8b40073 100644 (file)
@@ -806,12 +806,7 @@ 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;
-#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
+       task_io_accounting_init(&sig->ioac);
        sig->sum_sched_runtime = 0;
        INIT_LIST_HEAD(&sig->cpu_timers[0]);
        INIT_LIST_HEAD(&sig->cpu_timers[1]);
@@ -994,13 +989,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        p->last_switch_timestamp = 0;
 #endif
 
-#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);
+       task_io_accounting_init(&p->ioac);
        acct_clear_integrals(p);
 
        p->it_virt_expires = cputime_zero;
index 911d846f0503697b2fbb8c01ff95a78d2d37e4b3..fe47133472758853b039c47ac9390e5eadd34bed 100644 (file)
@@ -1680,43 +1680,45 @@ static __init int sysctl_init(void)
 
 core_initcall(sysctl_init);
 
-static int is_branch_in(struct ctl_table *branch, struct ctl_table *table)
+static struct ctl_table *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 0;
+               return NULL;
 
        /* ... and nothing else */
        if (branch[1].procname || branch[1].ctl_name)
-               return 0;
+               return NULL;
 
        /* 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 1;
+                       return p;
        }
-       return 0;
+       return NULL;
 }
 
 /* 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 (is_branch_in(by, to)) {
+       while ((next = is_branch_in(by, to)) != NULL) {
                if (by == q->attached_by)
                        is_better = 1;
                if (to == p->attached_by)
                        not_in_parent = 1;
                by = by->child;
-               to = to->child;
+               to = next->child;
        }
 
        if (is_better && not_in_parent) {
index fc20e09a6cb1438f8c7b854e9cadb01aa109db02..8f3fb3db61c39306bdbffd36303cfed7dab02420 100644 (file)
@@ -1183,7 +1183,6 @@ 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;
 
index 3da47ccdc5e594b242dc30f1e3471a27822c53f8..f9cd2561689c66b0ed30e71d86fd0e3c61666e2c 100644 (file)
@@ -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->rchar;
-       stats->write_char       = p->wchar;
-       stats->read_syscalls    = p->syscr;
-       stats->write_syscalls   = p->syscw;
+       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;
 #ifdef CONFIG_TASK_IO_ACCOUNTING
-       stats->read_bytes       = p->ioac.read_bytes;
-       stats->write_bytes      = p->ioac.write_bytes;
-       stats->cancelled_write_bytes = p->ioac.cancelled_write_bytes;
+       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;
 #else
        stats->read_bytes       = 0;
        stats->write_bytes      = 0;
index a507c5e27d0e7d057d0870f9d718903c2d083e4e..380d6474cf661d91fb45ef88699c526b23dabd01 100644 (file)
@@ -2914,7 +2914,7 @@ static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table,
        return 0;
 }
 
-ctl_table ipv4_route_table[] = {
+static ctl_table ipv4_route_table[] = {
        {
                .ctl_name       = NET_IPV4_ROUTE_GC_THRESH,
                .procname       = "gc_thresh",
@@ -3216,6 +3216,15 @@ 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);
index d63e9388d92dfff616e432de6d0d4a27f3f6bfdb..770d827f5ab87a75ff6fcaa19a83f3fd7b7f112c 100644 (file)
@@ -401,13 +401,6 @@ 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,
@@ -882,11 +875,4 @@ 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);
index c708ca842298d37590b5d9dd0e6f79bcbe0fb63b..95055f8c3f35eb18d17f4848fe0ae72ed648bbc2 100644 (file)
@@ -934,6 +934,11 @@ 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
@@ -1058,6 +1063,10 @@ ipmr_fail:
 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);
@@ -1113,6 +1122,9 @@ 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);
index 5c99274558bf40412b738c4c71484c2a082e7029..e6dfaeac6be3f9a646b832a57938b7b5832da53b 100644 (file)
@@ -150,3 +150,19 @@ 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);
+}
index cefbc367d8beb0d4f1d3b801d9a364ea29cc49fa..972201cd5fa76791be3d558252d3efb5b009f92e 100644 (file)
@@ -73,7 +73,9 @@ static struct ctl_table_root net_sysctl_ro_root = {
 
 static int sysctl_net_init(struct net *net)
 {
-       setup_sysctl_set(&net->sysctls, NULL, is_seen);
+       setup_sysctl_set(&net->sysctls,
+                        &net_sysctl_ro_root.default_set,
+                        is_seen);
        return 0;
 }
 
index 53dae3eb3d1f0334fb0043759598e6117ab4b3ba..612dc13ddd85fcda58d327ea688746f887ad02db 100644 (file)
 # ==========================================================================
 # Installing headers
 #
-# 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
+# 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
 #
 # ==========================================================================
 
-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 <linux\/compiler.h>/d"
-
+# called may set destination dir (when installing to asm/)
 _dst := $(if $(dst),$(dst),$(obj))
 
-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
+kbuild-file := $(srctree)/$(obj)/Kbuild
+include $(kbuild-file)
 
-include $(KBUILDFILES)
+include scripts/Kbuild.include
 
-include scripts/Kbuild.include 
+install       := $(INSTALL_HDR_PATH)/$(_dst)
 
-# 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
+header-y      := $(sort $(header-y) $(unifdef-y))
+subdirs       := $(patsubst %/,%,$(filter %/, $(header-y)))
+header-y      := $(filter-out %/, $(header-y))
 
-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))
+# files used to track state of install/check
+install-file  := $(install)/.install
+check-file    := $(install)/.check
 
-# stamp files for header checks
-check-y                := $(patsubst %,.check.%,$(header-y) $(unifdef-y) $(objhdr-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))
 
 # Work out what needs to be removed
-oldheaders     := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/*.h))
-unwanted       := $(filter-out $(header-y) $(unifdef-y) $(objhdr-y),$(oldheaders))
+oldheaders    := $(patsubst $(install)/%,%,$(wildcard $(install)/*.h))
+unwanted      := $(filter-out $(all-files),$(oldheaders))
 
-oldcheckstamps := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/.check.*.h))
-unwanted       += $(filter-out $(check-y),$(oldcheckstamps))
+# Prefix unwanted with full paths to $(INSTALL_HDR_PATH)
+unwanted-file := $(addprefix $(install)/, $(unwanted))
 
-# 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))
+printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@))
 
+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 $@
 
-ifdef ALTARCH
-ifeq ($(obj),include/asm-$(ARCH))
-altarch-y      := altarch-dir
-endif
-endif
+quiet_cmd_remove = REMOVE  $(unwanted)
+      cmd_remove = rm -f $(unwanted-file)
 
-# 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)
+quiet_cmd_check = CHECK   $(printdir) ($(words $(all-files)) files)
+      cmd_check = $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH) \
+                  $(addprefix $(install)/, $(all-files));           \
+                 touch $@
 
-else
-# Rules for installing headers
-__headersinst: $(subdir-y) $(header-y) $(unifdef-y) $(altarch-y) $(objhdr-y)
-       @true
+PHONY += __headersinst __headerscheck
 
-$(objhdr-y) $(subdir-y) $(header-y) $(unifdef-y): | $(INSTALL_HDR_PATH)/$(_dst) $(unwanted)
-
-$(INSTALL_HDR_PATH)/$(_dst):
-       $(call cmd,mkdir)
-
-.PHONY: $(unwanted)
-$(unwanted):
-       $(call cmd,remove)
+ifndef HDRCHECK
+# Rules for installing headers
+__headersinst: $(subdirs) $(install-file)
+       @:
 
-ifdef GENASM
-$(objhdr-y) $(header-y) $(unifdef-y): $(KBUILDFILES)
-       $(call cmd,gen)
+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)
 
 else
-$(objhdr-y) :          $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(objtree)/$(obj)/%.h $(KBUILDFILES)
-       $(call cmd,o_hdr_install)
+__headerscheck: $(subdirs) $(check-file)
+       @:
 
-$(header-y) :          $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES)
-       $(call cmd,headers_install)
+targets += $(check-file)
+$(check-file): scripts/headers_check.pl $(output-files) FORCE
+       $(call if_changed,check)
 
-$(unifdef-y) :         $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES)
-       $(call cmd,unifdef)
-endif
 endif
 
-hdrinst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
+# Recursion
+hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
+.PHONY: $(subdirs)
+$(subdirs):
+       $(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(_dst)/$@
 
-.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)
+targets := $(wildcard $(sort $(targets)))
+cmd_files := $(wildcard \
+             $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
 
-# Recursion
-.PHONY: $(subdir-y)
-$(subdir-y):
-       $(Q)$(MAKE) $(hdrinst)=$(obj)/$@ dst=$(_dst)/$@ rel=../$(rel)
+ifneq ($(cmd_files),)
+       include $(cmd_files)
+endif
+
+.PHONY: $(PHONY)
+PHONY += FORCE
+FORCE: ;
diff --git a/scripts/diffconfig b/scripts/diffconfig
new file mode 100755 (executable)
index 0000000..b91f3e3
--- /dev/null
@@ -0,0 +1,129 @@
+#!/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] [<config1> <config2>]
+
+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/scripts/hdrcheck.sh b/scripts/hdrcheck.sh
deleted file mode 100755 (executable)
index 3159858..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/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/scripts/headers.sh b/scripts/headers.sh
new file mode 100755 (executable)
index 0000000..d33426f
--- /dev/null
@@ -0,0 +1,41 @@
+#!/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/scripts/headers_check.pl b/scripts/headers_check.pl
new file mode 100644 (file)
index 0000000..15d53a6
--- /dev/null
@@ -0,0 +1,56 @@
+#!/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/scripts/headers_install.pl b/scripts/headers_install.pl
new file mode 100644 (file)
index 0000000..68591cd
--- /dev/null
@@ -0,0 +1,45 @@
+#!/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 <linux\/compiler.h>//;
+               printf $outfile "%s", $line;
+       }
+       close $outfile;
+       close $infile;
+       system $unifdef . " $tmpfile > $installdir/$file";
+       unlink $tmpfile;
+}
+exit 0;
index fda63136ae6809512c6d84ab5c11d1497eee3bc5..9fba838c7069c4cb71d3fbd9c109e0f951c5e340 100644 (file)
@@ -76,7 +76,6 @@ 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) "));
@@ -92,15 +91,6 @@ 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)) {
@@ -112,9 +102,6 @@ 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;
        }
@@ -128,52 +115,6 @@ 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;
 }
@@ -374,15 +315,7 @@ static int conf_choice(struct menu *menu)
                        else
                                continue;
                        break;
-               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);
+               default:
                        break;
                }
 
@@ -494,6 +427,43 @@ 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;
@@ -599,36 +569,43 @@ 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 (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)) {
+       if (conf_get_changed() && conf_write(NULL)) {
                fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
-               return 1;
+               exit(1);
        }
-skip_check:
+       /* ask_silent is used during the build so we shall update autoconf.
+        * All other commands are only used to generate a config.
+        */
        if (input_mode == ask_silent && conf_write_autoconf()) {
                fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
                return 1;
        }
-
        return 0;
 }
index ee5fe943d58db0eda374b91a8181e5991d8cf23b..07597611cc504deca5098cdd7638ace892cd4441 100644 (file)
@@ -812,3 +812,73 @@ 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;
+       }
+}
index 96521cb087ec388587d4737c375c42862f4b5a24..4a9af6f7886b8f1362fc593009f3e36374a5e3bd 100644 (file)
@@ -42,6 +42,14 @@ 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
@@ -69,6 +77,7 @@ 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);
index 88e3934a8b8c86f6e5962ac64acb36ab7d0c08dd..d8f77e26081c230a3bc489f5c773950cab3b10d3 100755 (executable)
@@ -1643,6 +1643,7 @@ 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,]*\)\)//;
 
index 1c1bdaf7348a61fc3606165cb1cc5c6725831e05..83b75126c9f7b5c57a92c8f996dc94e6c61d6680 100755 (executable)
@@ -12,7 +12,9 @@ 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
-               git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
+               if tag=`git describe 2>/dev/null`; then
+                       echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
+               fi
        fi
 
        # Are there uncommitted changes?
index dbe63db4bfd654cfb656aee997d873353374c02b..4d4b8ddc26bac1711e51b772212497cdfe0f2ddf 100644 (file)
@@ -325,6 +325,7 @@ 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;
index 41c047e665ec7d62c6f85c25dbf45ce1441e901f..0797ca441a372d719de70bad9c7df9b96db458f6 100644 (file)
@@ -68,7 +68,9 @@ 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 */
@@ -85,8 +87,10 @@ 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);
@@ -688,7 +692,7 @@ static void snd_card_opti9xx_free(struct snd_card *card)
        if (chip) {
 #ifdef OPTi93X
                struct snd_cs4231 *codec = chip->codec;
-               if (codec->irq > 0) {
+               if (codec && codec->irq > 0) {
                        disable_irq(codec->irq);
                        free_irq(codec->irq, codec);
                }
index 07364c00768a4dd90f8eceeb338d899955a17685..8c49a00a5e3919d835b3f5d3a6fe0569eafda80d 100644 (file)
@@ -161,6 +161,7 @@ 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)]
@@ -169,7 +170,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, "WM9701A",           NULL,           NULL },
+{ 0x574d4c00, 0xffffffff, "WM9701,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},
index 0746e9ccc20b1572ec1cae300b0178c1ad6f90e9..f4fbc795ee8140853305d4297e0818a48e01dd87 100644 (file)
@@ -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 */
-int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name,
-                        const unsigned int *tlv, const char **slaves)
+static 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;
index 7e3e8942d0733f01fa3b9d5363878f2f9bf2f665..974e05122f005f6d23d70fb1f593a94c017b0081 100644 (file)
@@ -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
index fbf1124f7c79d1609f594fdb786e0ec0e0b676ac..9bf95367c882b4fbe80558f254aa2b45456f9646 100644 (file)
@@ -522,7 +522,7 @@ static unsigned int snd_es1371_wait_src_ready(struct ensoniq * ensoniq)
                        return r;
                cond_resched();
        }
-       snd_printk(KERN_ERR "wait source ready timeout 0x%lx [0x%x]\n",
+       snd_printk(KERN_ERR "wait src ready timeout 0x%lx [0x%x]\n",
                   ES_REG(ensoniq, 1371_SMPRATE), r);
        return 0;
 }
@@ -1629,6 +1629,7 @@ 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;
index 16715a68ba5e59c362b5ea3d3db252b4f022523d..ef9f072b47fcc65749729d22fa8e1390c1f8a8de 100644 (file)
@@ -1047,9 +1047,13 @@ 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 = 1;
+                       pos_adj = pos_align;
+               else
+                       pos_adj = ((pos_adj + pos_align - 1) / pos_align) *
+                               pos_align;
                pos_adj = frames_to_bytes(runtime, pos_adj);
                if (pos_adj >= period_bytes) {
                        snd_printk(KERN_WARNING "Too big adjustment %d\n",
index 2807bc840d26973f695d6be66c55b6bb5ac58717..add4e87e0b203a6ff8d9a52705158622550d6d79 100644 (file)
@@ -122,6 +122,8 @@ enum {
 /* ALC269 models */
 enum {
        ALC269_BASIC,
+       ALC269_ASUS_EEEPC_P703,
+       ALC269_ASUS_EEEPC_P901,
        ALC269_AUTO,
        ALC269_MODEL_LAST /* last tag */
 };
@@ -7905,6 +7907,7 @@ 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),
@@ -10946,7 +10949,23 @@ static int patch_alc268(struct hda_codec *codec)
 
 static hda_nid_t alc269_adc_nids[1] = {
        /* ADC1 */
-       0x07,
+       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 },
+       },
 };
 
 #define alc269_modes           alc260_modes
@@ -10968,10 +10987,27 @@ 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", 0x07, 0x0, HDA_INPUT),
-       HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT),
+       HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
+       HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
        {
                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
                /* The multiple "Capture Source" controls confuse alsamixer
@@ -10987,6 +11023,13 @@ 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
  */
@@ -10994,7 +11037,7 @@ static struct hda_verb alc269_init_verbs[] = {
        /*
         * Unmute ADC0 and set the default input to mic-in
         */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
+       {0x08, 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
@@ -11057,6 +11100,98 @@ 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)
@@ -11188,6 +11323,9 @@ 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;
 }
 
@@ -11215,12 +11353,16 @@ 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 },
+               .mixers = { alc269_base_mixer, alc269_capture_mixer },
                .init_verbs = { alc269_init_verbs },
                .num_dacs = ARRAY_SIZE(alc269_dac_nids),
                .dac_nids = alc269_dac_nids,
@@ -11229,6 +11371,32 @@ 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)
@@ -11282,8 +11450,6 @@ 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)
@@ -12994,6 +13160,7 @@ 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),
index 08cb77f51880a31265c46cf66691715cfbf5dd55..7fdafcb0015d8e9030c13c27b9d060c16ff9b39d 100644 (file)
@@ -94,6 +94,9 @@ 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,
@@ -1483,6 +1486,7 @@ 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,
@@ -1505,6 +1509,7 @@ 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",
@@ -1576,9 +1581,9 @@ static struct snd_pci_quirk stac922x_cfg_tbl[] = {
        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x0707,
                      "Intel D945P", STAC_D945GTP5),
        /* other systems  */
-       /* Apple Mac Mini (early 2006) */
+       /* Apple Intel Mac (Mac Mini, MacBook, MacBook Pro...) */
        SND_PCI_QUIRK(0x8384, 0x7680,
-                     "Mac Mini", STAC_INTEL_MAC_V3),
+                     "Mac", STAC_INTEL_MAC_AUTO),
        /* Dell systems  */
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01a7,
                      "unknown Dell", STAC_922X_DELL_D81),
@@ -3725,7 +3730,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_V3) {
+       if (spec->board_config == STAC_INTEL_MAC_AUTO) {
                spec->gpio_mask = spec->gpio_dir = 0x03;
                spec->gpio_data = 0x03;
                /* Intel Macs have all same PCI SSID, so we need to check
@@ -3757,6 +3762,9 @@ 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;
                }
        }
 
index ba4b5c199f21b9fa97aa62cf0f6166309e00a901..9384702c7ebd7c09f0df6d4e25f9161ac854cc37 100644 (file)
@@ -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_RB | PSC_I2SSTAT_RB))) {
+       if (!(stat & (PSC_I2SSTAT_TB | PSC_I2SSTAT_RB))) {
                au_writel(0, I2S_CFG(pscdata));
                au_sync();
                au_writel(PSC_CTRL_SUSPEND, PSC_CTRL(pscdata));
index 9fc8edd82225cfe98dfbcb6aabadddf48eb1e9c5..1fb7f9a7aecd63dfa6ae6c71414e3702047a5c5a 100644 (file)
@@ -427,20 +427,20 @@ static const struct snd_soc_dapm_route audio_map[] = {
        {"HPOUTR", NULL, "Headphone PGA"},
        {"Headphone PGA", NULL, "Right HP Mixer"},
 
-       /* mono hp mixer */
-       {"Mono HP Mixer", NULL, "Left HP Mixer"},
-       {"Mono HP Mixer", NULL, "Right HP Mixer"},
+       /* mono mixer */
+       {"Mono Mixer", NULL, "Left HP Mixer"},
+       {"Mono Mixer", NULL, "Right HP Mixer"},
 
        /* Out3 Mux */
        {"Out3 Mux", "Left", "Left HP Mixer"},
        {"Out3 Mux", "Mono", "Phone Mixer"},
-       {"Out3 Mux", "Left + Right", "Mono HP Mixer"},
+       {"Out3 Mux", "Left + Right", "Mono 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 HP Mixer"},
+       {"Speaker Mux", "Headphone Mix", "Mono Mixer"},
        {"Speaker PGA", NULL, "Speaker Mux"},
        {"LOUT2", NULL, "Speaker PGA"},
        {"ROUT2", NULL, "Speaker PGA"},
index 2c87061c2a6b4d7b9c35d7479d782462a0d8b3c1..820347c9ae4bbc5d5281e981e94f0cd27d2e28ae 100644 (file)
@@ -523,24 +523,6 @@ 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)
@@ -586,45 +568,56 @@ 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 (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);
+                       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;
                        }
                }
        }