]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
Merge master.kernel.org:/home/rmk/linux-2.6-arm
authorLinus Torvalds <torvalds@g5.osdl.org>
Sun, 30 Jul 2006 05:53:46 +0000 (22:53 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 30 Jul 2006 05:53:46 +0000 (22:53 -0700)
* master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] 3734/1: Fix the unused variable warning in __iounmap()
  [ARM] 3737/1: Export ARM copy/clear_user_page symbols
  [ARM] 3736/1: xscale: don't mis-report 80219 as an iop32x
  [ARM] 3733/2: S3C24XX: Remove old IDE registers in Anubis
  [ARM] 3732/1: S3C24XX: tidy syntax in osiris and anubis machines
  [ARM] Fix SMP booting
  [ARM] 3731/1: Allow IRQ definitions of IQ80331 and IQ80332 to co-exist
  [ARM] 3730/1: ep93xx: enable usb ohci driver in the defconfig
  [ARM] Fix cats build

462 files changed:
Documentation/DMA-mapping.txt
Documentation/accounting/delay-accounting.txt [new file with mode: 0644]
Documentation/accounting/getdelays.c [new file with mode: 0644]
Documentation/accounting/taskstats.txt [new file with mode: 0644]
Documentation/feature-removal-schedule.txt
Documentation/kernel-parameters.txt
Documentation/memory-barriers.txt
Documentation/ramdisk.txt
Documentation/x86_64/boot-options.txt
MAINTAINERS
Makefile
arch/i386/kernel/crash.c
arch/i386/kernel/process.c
arch/i386/kernel/setup.c
arch/i386/kernel/time.c
arch/i386/kernel/traps.c
arch/i386/lib/usercopy.c
arch/s390/defconfig
arch/s390/kernel/head31.S
arch/s390/kernel/head64.S
arch/s390/kernel/setup.c
arch/sparc/kernel/devices.c
arch/sparc/kernel/irq.c
arch/sparc/kernel/of_device.c
arch/sparc/kernel/prom.c
arch/sparc/kernel/smp.c
arch/sparc/kernel/sparc_ksyms.c
arch/sparc/kernel/sun4d_smp.c
arch/sparc/kernel/sys_sparc.c
arch/sparc/kernel/time.c
arch/sparc/mm/io-unit.c
arch/sparc/prom/tree.c
arch/sparc64/defconfig
arch/sparc64/kernel/devices.c
arch/sparc64/kernel/head.S
arch/sparc64/kernel/of_device.c
arch/sparc64/kernel/pci_psycho.c
arch/sparc64/kernel/prom.c
arch/sparc64/kernel/sparc64_ksyms.c
arch/sparc64/kernel/sys_sparc.c
arch/sparc64/kernel/time.c
arch/sparc64/mm/fault.c
arch/sparc64/prom/tree.c
arch/um/Makefile-x86_64
arch/um/include/longjmp.h
arch/um/include/os.h
arch/um/kernel/syscall.c
arch/um/kernel/vmlinux.lds.S
arch/um/os-Linux/process.c
arch/um/os-Linux/skas/process.c
arch/um/os-Linux/uaccess.c
arch/x86_64/defconfig
arch/x86_64/ia32/ia32entry.S
arch/x86_64/kernel/pci-calgary.c
arch/x86_64/kernel/pci-swiotlb.c
arch/x86_64/kernel/tce.c
arch/x86_64/kernel/time.c
arch/x86_64/kernel/traps.c
arch/x86_64/pci/k8-bus.c
block/blktrace.c
block/cfq-iosched.c
block/ioctl.c
drivers/block/Kconfig
drivers/block/cciss.c
drivers/block/cpqarray.c
drivers/block/rd.c
drivers/bluetooth/hci_usb.c
drivers/char/nsc_gpio.c
drivers/char/pc8736x_gpio.c
drivers/char/pcmcia/synclink_cs.c
drivers/char/scx200_gpio.c
drivers/char/synclink.c
drivers/char/synclink_gt.c
drivers/char/synclinkmp.c
drivers/char/tpm/tpm.c
drivers/char/tpm/tpm_tis.c
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_ondemand.c
drivers/cpufreq/cpufreq_userspace.c
drivers/crypto/padlock-aes.c
drivers/dma/ioatdma.c
drivers/fc4/fc.c
drivers/ide/ide-disk.c
drivers/ide/ide-dma.c
drivers/ide/ide.c
drivers/ide/pci/it821x.c
drivers/infiniband/core/cm.c
drivers/infiniband/core/cma.c
drivers/infiniband/core/fmr_pool.c
drivers/infiniband/core/mad.c
drivers/infiniband/core/sa_query.c
drivers/infiniband/core/user_mad.c
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/hw/ipath/ipath_driver.c
drivers/infiniband/hw/ipath/ipath_keys.c
drivers/infiniband/hw/ipath/ipath_verbs.c
drivers/infiniband/hw/mthca/mthca_av.c
drivers/infiniband/hw/mthca/mthca_cmd.c
drivers/infiniband/hw/mthca/mthca_qp.c
drivers/infiniband/hw/mthca/mthca_srq.c
drivers/infiniband/ulp/ipoib/ipoib.h
drivers/infiniband/ulp/ipoib/ipoib_main.c
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
drivers/infiniband/ulp/iser/iser_verbs.c
drivers/infiniband/ulp/srp/ib_srp.c
drivers/leds/leds-net48xx.c
drivers/message/fusion/Kconfig
drivers/message/fusion/Makefile
drivers/message/fusion/mptbase.c
drivers/message/fusion/mptbase.h
drivers/message/fusion/mptctl.c
drivers/message/fusion/mptctl.h
drivers/message/fusion/mptfc.c
drivers/message/fusion/mptsas.c
drivers/message/fusion/mptscsih.c
drivers/message/fusion/mptspi.c
drivers/net/dummy.c
drivers/net/e1000/e1000.h
drivers/net/e1000/e1000_main.c
drivers/net/ifb.c
drivers/net/myri10ge/myri10ge.c
drivers/net/skge.c
drivers/net/sky2.c
drivers/net/spider_net.c
drivers/net/spider_net.h
drivers/net/sunhme.c
drivers/net/sunlance.c
drivers/net/tg3.c
drivers/net/via-velocity.c
drivers/net/wan/c101.c
drivers/net/wan/hdlc_ppp.c
drivers/net/wan/hdlc_raw.c
drivers/net/wan/hdlc_raw_eth.c
drivers/net/wan/hdlc_x25.c
drivers/net/wan/n2.c
drivers/net/wireless/Kconfig
drivers/net/wireless/bcm43xx/bcm43xx_main.c
drivers/net/wireless/orinoco.c
drivers/net/wireless/zd1201.c
drivers/rtc/Kconfig
drivers/rtc/Makefile
drivers/rtc/rtc-isl1208.c [new file with mode: 0644]
drivers/s390/block/xpram.c
drivers/s390/char/raw3270.c
drivers/s390/char/tape_class.c
drivers/s390/char/tape_core.c
drivers/s390/cio/ccwgroup.c
drivers/s390/cio/cmf.c
drivers/s390/cio/device_fsm.c
drivers/s390/net/ctcmain.c
drivers/s390/net/qeth_main.c
drivers/sbus/sbus.c
drivers/scsi/53c7xx.c
drivers/scsi/NCR53C9x.c
drivers/scsi/NCR_D700.c
drivers/scsi/aha152x.c
drivers/scsi/aic7xxx/aic79xx_core.c
drivers/scsi/aic7xxx/aic79xx_osm.c
drivers/scsi/aic7xxx/aic7xxx_osm.c
drivers/scsi/arm/fas216.c
drivers/scsi/ata_piix.c
drivers/scsi/atari_NCR5380.c
drivers/scsi/constants.c
drivers/scsi/esp.c
drivers/scsi/ibmvscsi/iseries_vscsi.c
drivers/scsi/ibmvscsi/rpa_vscsi.c
drivers/scsi/jazz_esp.c
drivers/scsi/libata-eh.c
drivers/scsi/lpfc/lpfc.h
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/lpfc/lpfc_crtn.h
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_mem.c
drivers/scsi/lpfc/lpfc_nportdisc.c
drivers/scsi/lpfc/lpfc_scsi.c
drivers/scsi/lpfc/lpfc_sli.c
drivers/scsi/lpfc/lpfc_sli.h
drivers/scsi/lpfc/lpfc_version.h
drivers/scsi/mac53c94.c
drivers/scsi/mesh.c
drivers/scsi/pluto.c
drivers/scsi/qlogicpti.c
drivers/scsi/sata_promise.c
drivers/scsi/scsi.c
drivers/scsi/scsi_debug.c
drivers/scsi/scsi_error.c
drivers/scsi/scsi_ioctl.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_priv.h
drivers/scsi/scsi_transport_sas.c
drivers/scsi/sd.c
drivers/scsi/seagate.c
drivers/scsi/sr.c
drivers/scsi/st.c
drivers/scsi/sun3_NCR5380.c
drivers/scsi/sun3x_esp.c
drivers/scsi/wd33c93.c
drivers/serial/sunsab.c
drivers/serial/sunsu.c
drivers/serial/sunzilog.c
drivers/video/Kconfig
drivers/video/Makefile
drivers/video/mbx/Makefile [new file with mode: 0644]
drivers/video/mbx/mbxdebugfs.c [new file with mode: 0644]
drivers/video/mbx/mbxfb.c [new file with mode: 0644]
drivers/video/mbx/reg_bits.h [new file with mode: 0644]
drivers/video/mbx/regs.h [new file with mode: 0644]
fs/char_dev.c
fs/jfs/jfs_txnmgr.c
fs/jfs/namei.c
fs/namei.c
fs/proc/array.c
fs/proc/base.c
fs/proc/inode.c
fs/reiserfs/procfs.c
fs/xfs/linux-2.6/xfs_buf.h
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/quota/xfs_qm_bhv.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_log.c
fs/xfs/xfs_vfsops.c
include/asm-alpha/barrier.h
include/asm-arm/system.h
include/asm-arm26/system.h
include/asm-cris/system.h
include/asm-frv/system.h
include/asm-generic/Kbuild.asm
include/asm-h8300/system.h
include/asm-i386/system.h
include/asm-ia64/system.h
include/asm-m32r/system.h
include/asm-m68k/oplib.h
include/asm-m68k/system.h
include/asm-m68knommu/system.h
include/asm-mips/system.h
include/asm-parisc/system.h
include/asm-powerpc/system.h
include/asm-ppc/system.h
include/asm-s390/system.h
include/asm-s390/timex.h
include/asm-sh/system.h
include/asm-sh64/system.h
include/asm-sparc/oplib.h
include/asm-sparc/signal.h
include/asm-sparc/system.h
include/asm-sparc64/openprom.h
include/asm-sparc64/oplib.h
include/asm-sparc64/pgtable.h
include/asm-sparc64/sfp-machine.h
include/asm-sparc64/system.h
include/asm-v850/system.h
include/asm-x86_64/calgary.h
include/asm-x86_64/page.h
include/asm-x86_64/swiotlb.h
include/asm-x86_64/system.h
include/asm-xtensa/system.h
include/linux/cpu.h
include/linux/cpufreq.h
include/linux/delayacct.h [new file with mode: 0644]
include/linux/futex.h
include/linux/i2c-id.h
include/linux/ide.h
include/linux/if_vlan.h
include/linux/kthread.h
include/linux/libata.h
include/linux/list.h
include/linux/module.h
include/linux/namei.h
include/linux/netdevice.h
include/linux/netfilter_bridge.h
include/linux/nsc_gpio.h
include/linux/sched.h
include/linux/skbuff.h
include/linux/taskstats.h [new file with mode: 0644]
include/linux/taskstats_kern.h [new file with mode: 0644]
include/linux/time.h
include/linux/vmalloc.h
include/net/genetlink.h
include/net/netdma.h
include/net/pkt_sched.h
include/net/sctp/structs.h
include/net/sctp/user.h
include/rdma/ib_addr.h
include/rdma/ib_fmr_pool.h
include/rdma/ib_mad.h
include/scsi/scsi_cmnd.h
include/scsi/scsi_transport_sas.h
include/video/mbxfb.h [new file with mode: 0644]
init/Kconfig
init/main.c
kernel/Makefile
kernel/acct.c
kernel/cpu.c
kernel/cpuset.c
kernel/delayacct.c [new file with mode: 0644]
kernel/exit.c
kernel/fork.c
kernel/futex.c
kernel/futex_compat.c
kernel/kallsyms.c
kernel/kthread.c
kernel/module.c
kernel/rtmutex-tester.c
kernel/sched.c
kernel/softirq.c
kernel/taskstats.c [new file with mode: 0644]
kernel/timer.c
lib/Kconfig.debug
lib/idr.c
mm/filemap.c
mm/memory.c
mm/nommu.c
mm/vmalloc.c
net/8021q/vlan.c
net/appletalk/ddp.c
net/atm/br2684.c
net/atm/clip.c
net/atm/lec.c
net/atm/mpc.c
net/atm/pppoatm.c
net/atm/resources.c
net/ax25/sysctl_net_ax25.c
net/bluetooth/rfcomm/core.c
net/bridge/br_ioctl.c
net/bridge/br_netfilter.c
net/core/ethtool.c
net/core/skbuff.c
net/core/user_dma.c
net/dccp/feat.h
net/dccp/ipv4.c
net/dccp/ipv6.c
net/dccp/options.c
net/decnet/dn_dev.c
net/decnet/dn_fib.c
net/decnet/dn_neigh.c
net/decnet/dn_rules.c
net/decnet/dn_table.c
net/econet/af_econet.c
net/ieee80211/Kconfig
net/ieee80211/ieee80211_crypt.c
net/ieee80211/ieee80211_crypt_ccmp.c
net/ieee80211/ieee80211_crypt_wep.c
net/ieee80211/ieee80211_wx.c
net/ieee80211/softmac/ieee80211softmac_auth.c
net/ieee80211/softmac/ieee80211softmac_io.c
net/ipv4/ah4.c
net/ipv4/arp.c
net/ipv4/devinet.c
net/ipv4/esp4.c
net/ipv4/fib_hash.c
net/ipv4/fib_rules.c
net/ipv4/fib_semantics.c
net/ipv4/igmp.c
net/ipv4/inet_diag.c
net/ipv4/ip_gre.c
net/ipv4/ip_input.c
net/ipv4/ip_options.c
net/ipv4/ipcomp.c
net/ipv4/ipip.c
net/ipv4/ipmr.c
net/ipv4/ipvs/ip_vs_ctl.c
net/ipv4/ipvs/ip_vs_est.c
net/ipv4/netfilter/ip_conntrack_helper_h323.c
net/ipv4/netfilter/ip_conntrack_standalone.c
net/ipv4/netfilter/ip_nat_snmp_basic.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/raw.c
net/ipv4/tcp_ipv4.c
net/ipv4/udp.c
net/ipv4/xfrm4_mode_tunnel.c
net/ipv6/ip6_input.c
net/ipv6/ip6_tunnel.c
net/ipv6/raw.c
net/ipv6/sit.c
net/ipv6/xfrm6_tunnel.c
net/irda/af_irda.c
net/irda/ircomm/ircomm_core.c
net/irda/ircomm/ircomm_lmp.c
net/irda/ircomm/ircomm_param.c
net/irda/ircomm/ircomm_tty.c
net/irda/irda_device.c
net/irda/iriap.c
net/irda/iriap_event.c
net/irda/irias_object.c
net/irda/irlan/irlan_common.c
net/irda/irlan/irlan_provider.c
net/irda/irlap.c
net/irda/irlap_frame.c
net/irda/irlmp.c
net/irda/irnet/irnet_ppp.c
net/irda/irttp.c
net/lapb/lapb_iface.c
net/llc/llc_core.c
net/netfilter/Kconfig
net/netfilter/nf_conntrack_standalone.c
net/netfilter/nf_queue.c
net/netfilter/xt_physdev.c
net/netfilter/xt_pkttype.c
net/netlink/af_netlink.c
net/rxrpc/connection.c
net/rxrpc/peer.c
net/rxrpc/transport.c
net/sched/act_api.c
net/sched/act_pedit.c
net/sched/act_police.c
net/sched/cls_basic.c
net/sched/cls_fw.c
net/sched/cls_route.c
net/sched/cls_rsvp.h
net/sched/cls_tcindex.c
net/sched/cls_u32.c
net/sched/em_meta.c
net/sched/ematch.c
net/sched/estimator.c
net/sched/sch_cbq.c
net/sched/sch_generic.c
net/sched/sch_gred.c
net/sched/sch_hfsc.c
net/sched/sch_htb.c
net/sched/sch_netem.c
net/sctp/associola.c
net/sctp/bind_addr.c
net/sctp/endpointola.c
net/sctp/ipv6.c
net/sctp/outqueue.c
net/sctp/protocol.c
net/sctp/sm_make_chunk.c
net/sctp/sm_sideeffect.c
net/sctp/sm_statefuns.c
net/sctp/socket.c
net/sctp/transport.c
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/auth_gss/gss_krb5_mech.c
net/sunrpc/auth_gss/gss_mech_switch.c
net/sunrpc/auth_gss/gss_spkm3_mech.c
net/sunrpc/auth_gss/gss_spkm3_token.c
net/sunrpc/clnt.c
net/sunrpc/stats.c
net/sunrpc/svc.c
net/sunrpc/svcsock.c
net/sunrpc/xprt.c
net/sunrpc/xprtsock.c
net/tipc/bearer.c
net/tipc/cluster.c
net/tipc/discover.c
net/tipc/link.c
net/tipc/name_table.c
net/tipc/net.c
net/tipc/port.c
net/tipc/ref.c
net/tipc/subscr.c
net/tipc/user_reg.c
net/tipc/zone.c
net/unix/af_unix.c
net/wanrouter/af_wanpipe.c
net/wanrouter/wanmain.c
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_state.c
security/selinux/hooks.c

index 7c717699032c90f403432ef793cfeed8c359fe7b..63392c9132b4d08bf32f3fab82cc0c14c39e15b1 100644 (file)
@@ -698,12 +698,12 @@ these interfaces.  Remember that, as defined, consistent mappings are
 always going to be SAC addressable.
 
 The first thing your driver needs to do is query the PCI platform
-layer with your devices DAC addressing capabilities:
+layer if it is capable of handling your devices DAC addressing
+capabilities:
 
-       int pci_dac_set_dma_mask(struct pci_dev *pdev, u64 mask);
+       int pci_dac_dma_supported(struct pci_dev *hwdev, u64 mask);
 
-This routine behaves identically to pci_set_dma_mask.  You may not
-use the following interfaces if this routine fails.
+You may not use the following interfaces if this routine fails.
 
 Next, DMA addresses using this API are kept track of using the
 dma64_addr_t type.  It is guaranteed to be big enough to hold any
diff --git a/Documentation/accounting/delay-accounting.txt b/Documentation/accounting/delay-accounting.txt
new file mode 100644 (file)
index 0000000..be215e5
--- /dev/null
@@ -0,0 +1,110 @@
+Delay accounting
+----------------
+
+Tasks encounter delays in execution when they wait
+for some kernel resource to become available e.g. a
+runnable task may wait for a free CPU to run on.
+
+The per-task delay accounting functionality measures
+the delays experienced by a task while
+
+a) waiting for a CPU (while being runnable)
+b) completion of synchronous block I/O initiated by the task
+c) swapping in pages
+
+and makes these statistics available to userspace through
+the taskstats interface.
+
+Such delays provide feedback for setting a task's cpu priority,
+io priority and rss limit values appropriately. Long delays for
+important tasks could be a trigger for raising its corresponding priority.
+
+The functionality, through its use of the taskstats interface, also provides
+delay statistics aggregated for all tasks (or threads) belonging to a
+thread group (corresponding to a traditional Unix process). This is a commonly
+needed aggregation that is more efficiently done by the kernel.
+
+Userspace utilities, particularly resource management applications, can also
+aggregate delay statistics into arbitrary groups. To enable this, delay
+statistics of a task are available both during its lifetime as well as on its
+exit, ensuring continuous and complete monitoring can be done.
+
+
+Interface
+---------
+
+Delay accounting uses the taskstats interface which is described
+in detail in a separate document in this directory. Taskstats returns a
+generic data structure to userspace corresponding to per-pid and per-tgid
+statistics. The delay accounting functionality populates specific fields of
+this structure. See
+     include/linux/taskstats.h
+for a description of the fields pertaining to delay accounting.
+It will generally be in the form of counters returning the cumulative
+delay seen for cpu, sync block I/O, swapin etc.
+
+Taking the difference of two successive readings of a given
+counter (say cpu_delay_total) for a task will give the delay
+experienced by the task waiting for the corresponding resource
+in that interval.
+
+When a task exits, records containing the per-task statistics
+are sent to userspace without requiring a command. If it is the last exiting
+task of a thread group, the per-tgid statistics are also sent. More details
+are given in the taskstats interface description.
+
+The getdelays.c userspace utility in this directory allows simple commands to
+be run and the corresponding delay statistics to be displayed. It also serves
+as an example of using the taskstats interface.
+
+Usage
+-----
+
+Compile the kernel with
+       CONFIG_TASK_DELAY_ACCT=y
+       CONFIG_TASKSTATS=y
+
+Enable the accounting at boot time by adding
+the following to the kernel boot options
+       delayacct
+
+and after the system has booted up, use a utility
+similar to  getdelays.c to access the delays
+seen by a given task or a task group (tgid).
+The utility also allows a given command to be
+executed and the corresponding delays to be
+seen.
+
+General format of the getdelays command
+
+getdelays [-t tgid] [-p pid] [-c cmd...]
+
+
+Get delays, since system boot, for pid 10
+# ./getdelays -p 10
+(output similar to next case)
+
+Get sum of delays, since system boot, for all pids with tgid 5
+# ./getdelays -t 5
+
+
+CPU    count   real total      virtual total   delay total
+       7876    92005750        100000000       24001500
+IO     count   delay total
+       0       0
+MEM    count   delay total
+       0       0
+
+Get delays seen in executing a given simple command
+# ./getdelays -c ls /
+
+bin   data1  data3  data5  dev  home  media  opt   root  srv        sys  usr
+boot  data2  data4  data6  etc  lib   mnt    proc  sbin  subdomain  tmp  var
+
+
+CPU    count   real total      virtual total   delay total
+       6       4000250         4000000         0
+IO     count   delay total
+       0       0
+MEM    count   delay total
+       0       0
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c
new file mode 100644 (file)
index 0000000..795ca39
--- /dev/null
@@ -0,0 +1,396 @@
+/* getdelays.c
+ *
+ * Utility to get per-pid and per-tgid delay accounting statistics
+ * Also illustrates usage of the taskstats interface
+ *
+ * Copyright (C) Shailabh Nagar, IBM Corp. 2005
+ * Copyright (C) Balbir Singh, IBM Corp. 2006
+ * Copyright (c) Jay Lan, SGI. 2006
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <poll.h>
+#include <string.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <signal.h>
+
+#include <linux/genetlink.h>
+#include <linux/taskstats.h>
+
+/*
+ * Generic macros for dealing with netlink sockets. Might be duplicated
+ * elsewhere. It is recommended that commercial grade applications use
+ * libnl or libnetlink and use the interfaces provided by the library
+ */
+#define GENLMSG_DATA(glh)      ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
+#define GENLMSG_PAYLOAD(glh)   (NLMSG_PAYLOAD(glh, 0) - GENL_HDRLEN)
+#define NLA_DATA(na)           ((void *)((char*)(na) + NLA_HDRLEN))
+#define NLA_PAYLOAD(len)       (len - NLA_HDRLEN)
+
+#define err(code, fmt, arg...) do { printf(fmt, ##arg); exit(code); } while (0)
+int done = 0;
+int rcvbufsz=0;
+
+    char name[100];
+int dbg=0, print_delays=0;
+__u64 stime, utime;
+#define PRINTF(fmt, arg...) {                  \
+           if (dbg) {                          \
+               printf(fmt, ##arg);             \
+           }                                   \
+       }
+
+/* Maximum size of response requested or message sent */
+#define MAX_MSG_SIZE   256
+/* Maximum number of cpus expected to be specified in a cpumask */
+#define MAX_CPUS       32
+/* Maximum length of pathname to log file */
+#define MAX_FILENAME   256
+
+struct msgtemplate {
+       struct nlmsghdr n;
+       struct genlmsghdr g;
+       char buf[MAX_MSG_SIZE];
+};
+
+char cpumask[100+6*MAX_CPUS];
+
+/*
+ * Create a raw netlink socket and bind
+ */
+static int create_nl_socket(int protocol)
+{
+       int fd;
+       struct sockaddr_nl local;
+
+       fd = socket(AF_NETLINK, SOCK_RAW, protocol);
+       if (fd < 0)
+               return -1;
+
+       if (rcvbufsz)
+               if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
+                               &rcvbufsz, sizeof(rcvbufsz)) < 0) {
+                       printf("Unable to set socket rcv buf size to %d\n",
+                              rcvbufsz);
+                       return -1;
+               }
+
+       memset(&local, 0, sizeof(local));
+       local.nl_family = AF_NETLINK;
+
+       if (bind(fd, (struct sockaddr *) &local, sizeof(local)) < 0)
+               goto error;
+
+       return fd;
+error:
+       close(fd);
+       return -1;
+}
+
+
+int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
+            __u8 genl_cmd, __u16 nla_type,
+            void *nla_data, int nla_len)
+{
+       struct nlattr *na;
+       struct sockaddr_nl nladdr;
+       int r, buflen;
+       char *buf;
+
+       struct msgtemplate msg;
+
+       msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
+       msg.n.nlmsg_type = nlmsg_type;
+       msg.n.nlmsg_flags = NLM_F_REQUEST;
+       msg.n.nlmsg_seq = 0;
+       msg.n.nlmsg_pid = nlmsg_pid;
+       msg.g.cmd = genl_cmd;
+       msg.g.version = 0x1;
+       na = (struct nlattr *) GENLMSG_DATA(&msg);
+       na->nla_type = nla_type;
+       na->nla_len = nla_len + 1 + NLA_HDRLEN;
+       memcpy(NLA_DATA(na), nla_data, nla_len);
+       msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
+
+       buf = (char *) &msg;
+       buflen = msg.n.nlmsg_len ;
+       memset(&nladdr, 0, sizeof(nladdr));
+       nladdr.nl_family = AF_NETLINK;
+       while ((r = sendto(sd, buf, buflen, 0, (struct sockaddr *) &nladdr,
+                          sizeof(nladdr))) < buflen) {
+               if (r > 0) {
+                       buf += r;
+                       buflen -= r;
+               } else if (errno != EAGAIN)
+                       return -1;
+       }
+       return 0;
+}
+
+
+/*
+ * Probe the controller in genetlink to find the family id
+ * for the TASKSTATS family
+ */
+int get_family_id(int sd)
+{
+       struct {
+               struct nlmsghdr n;
+               struct genlmsghdr g;
+               char buf[256];
+       } ans;
+
+       int id, rc;
+       struct nlattr *na;
+       int rep_len;
+
+       strcpy(name, TASKSTATS_GENL_NAME);
+       rc = send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY,
+                       CTRL_ATTR_FAMILY_NAME, (void *)name,
+                       strlen(TASKSTATS_GENL_NAME)+1);
+
+       rep_len = recv(sd, &ans, sizeof(ans), 0);
+       if (ans.n.nlmsg_type == NLMSG_ERROR ||
+           (rep_len < 0) || !NLMSG_OK((&ans.n), rep_len))
+               return 0;
+
+       na = (struct nlattr *) GENLMSG_DATA(&ans);
+       na = (struct nlattr *) ((char *) na + NLA_ALIGN(na->nla_len));
+       if (na->nla_type == CTRL_ATTR_FAMILY_ID) {
+               id = *(__u16 *) NLA_DATA(na);
+       }
+       return id;
+}
+
+void print_delayacct(struct taskstats *t)
+{
+       printf("\n\nCPU   %15s%15s%15s%15s\n"
+              "      %15llu%15llu%15llu%15llu\n"
+              "IO    %15s%15s\n"
+              "      %15llu%15llu\n"
+              "MEM   %15s%15s\n"
+              "      %15llu%15llu\n\n",
+              "count", "real total", "virtual total", "delay total",
+              t->cpu_count, t->cpu_run_real_total, t->cpu_run_virtual_total,
+              t->cpu_delay_total,
+              "count", "delay total",
+              t->blkio_count, t->blkio_delay_total,
+              "count", "delay total", t->swapin_count, t->swapin_delay_total);
+}
+
+int main(int argc, char *argv[])
+{
+       int c, rc, rep_len, aggr_len, len2, cmd_type;
+       __u16 id;
+       __u32 mypid;
+
+       struct nlattr *na;
+       int nl_sd = -1;
+       int len = 0;
+       pid_t tid = 0;
+       pid_t rtid = 0;
+
+       int fd = 0;
+       int count = 0;
+       int write_file = 0;
+       int maskset = 0;
+       char logfile[128];
+       int loop = 0;
+
+       struct msgtemplate msg;
+
+       while (1) {
+               c = getopt(argc, argv, "dw:r:m:t:p:v:l");
+               if (c < 0)
+                       break;
+
+               switch (c) {
+               case 'd':
+                       printf("print delayacct stats ON\n");
+                       print_delays = 1;
+                       break;
+               case 'w':
+                       strncpy(logfile, optarg, MAX_FILENAME);
+                       printf("write to file %s\n", logfile);
+                       write_file = 1;
+                       break;
+               case 'r':
+                       rcvbufsz = atoi(optarg);
+                       printf("receive buf size %d\n", rcvbufsz);
+                       if (rcvbufsz < 0)
+                               err(1, "Invalid rcv buf size\n");
+                       break;
+               case 'm':
+                       strncpy(cpumask, optarg, sizeof(cpumask));
+                       maskset = 1;
+                       printf("cpumask %s maskset %d\n", cpumask, maskset);
+                       break;
+               case 't':
+                       tid = atoi(optarg);
+                       if (!tid)
+                               err(1, "Invalid tgid\n");
+                       cmd_type = TASKSTATS_CMD_ATTR_TGID;
+                       print_delays = 1;
+                       break;
+               case 'p':
+                       tid = atoi(optarg);
+                       if (!tid)
+                               err(1, "Invalid pid\n");
+                       cmd_type = TASKSTATS_CMD_ATTR_PID;
+                       print_delays = 1;
+                       break;
+               case 'v':
+                       printf("debug on\n");
+                       dbg = 1;
+                       break;
+               case 'l':
+                       printf("listen forever\n");
+                       loop = 1;
+                       break;
+               default:
+                       printf("Unknown option %d\n", c);
+                       exit(-1);
+               }
+       }
+
+       if (write_file) {
+               fd = open(logfile, O_WRONLY | O_CREAT | O_TRUNC,
+                         S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+               if (fd == -1) {
+                       perror("Cannot open output file\n");
+                       exit(1);
+               }
+       }
+
+       if ((nl_sd = create_nl_socket(NETLINK_GENERIC)) < 0)
+               err(1, "error creating Netlink socket\n");
+
+
+       mypid = getpid();
+       id = get_family_id(nl_sd);
+       if (!id) {
+               printf("Error getting family id, errno %d", errno);
+               goto err;
+       }
+       PRINTF("family id %d\n", id);
+
+       if (maskset) {
+               rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
+                             TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
+                             &cpumask, sizeof(cpumask));
+               PRINTF("Sent register cpumask, retval %d\n", rc);
+               if (rc < 0) {
+                       printf("error sending register cpumask\n");
+                       goto err;
+               }
+       }
+
+       if (tid) {
+               rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
+                             cmd_type, &tid, sizeof(__u32));
+               PRINTF("Sent pid/tgid, retval %d\n", rc);
+               if (rc < 0) {
+                       printf("error sending tid/tgid cmd\n");
+                       goto done;
+               }
+       }
+
+       do {
+               int i;
+
+               rep_len = recv(nl_sd, &msg, sizeof(msg), 0);
+               PRINTF("received %d bytes\n", rep_len);
+
+               if (rep_len < 0) {
+                       printf("nonfatal reply error: errno %d\n", errno);
+                       continue;
+               }
+               if (msg.n.nlmsg_type == NLMSG_ERROR ||
+                   !NLMSG_OK((&msg.n), rep_len)) {
+                       printf("fatal reply error,  errno %d\n", errno);
+                       goto done;
+               }
+
+               PRINTF("nlmsghdr size=%d, nlmsg_len=%d, rep_len=%d\n",
+                      sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len);
+
+
+               rep_len = GENLMSG_PAYLOAD(&msg.n);
+
+               na = (struct nlattr *) GENLMSG_DATA(&msg);
+               len = 0;
+               i = 0;
+               while (len < rep_len) {
+                       len += NLA_ALIGN(na->nla_len);
+                       switch (na->nla_type) {
+                       case TASKSTATS_TYPE_AGGR_TGID:
+                               /* Fall through */
+                       case TASKSTATS_TYPE_AGGR_PID:
+                               aggr_len = NLA_PAYLOAD(na->nla_len);
+                               len2 = 0;
+                               /* For nested attributes, na follows */
+                               na = (struct nlattr *) NLA_DATA(na);
+                               done = 0;
+                               while (len2 < aggr_len) {
+                                       switch (na->nla_type) {
+                                       case TASKSTATS_TYPE_PID:
+                                               rtid = *(int *) NLA_DATA(na);
+                                               if (print_delays)
+                                                       printf("PID\t%d\n", rtid);
+                                               break;
+                                       case TASKSTATS_TYPE_TGID:
+                                               rtid = *(int *) NLA_DATA(na);
+                                               if (print_delays)
+                                                       printf("TGID\t%d\n", rtid);
+                                               break;
+                                       case TASKSTATS_TYPE_STATS:
+                                               count++;
+                                               if (print_delays)
+                                                       print_delayacct((struct taskstats *) NLA_DATA(na));
+                                               if (fd) {
+                                                       if (write(fd, NLA_DATA(na), na->nla_len) < 0) {
+                                                               err(1,"write error\n");
+                                                       }
+                                               }
+                                               if (!loop)
+                                                       goto done;
+                                               break;
+                                       default:
+                                               printf("Unknown nested nla_type %d\n", na->nla_type);
+                                               break;
+                                       }
+                                       len2 += NLA_ALIGN(na->nla_len);
+                                       na = (struct nlattr *) ((char *) na + len2);
+                               }
+                               break;
+
+                       default:
+                               printf("Unknown nla_type %d\n", na->nla_type);
+                               break;
+                       }
+                       na = (struct nlattr *) (GENLMSG_DATA(&msg) + len);
+               }
+       } while (loop);
+done:
+       if (maskset) {
+               rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
+                             TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
+                             &cpumask, sizeof(cpumask));
+               printf("Sent deregister mask, retval %d\n", rc);
+               if (rc < 0)
+                       err(rc, "error sending deregister cpumask\n");
+       }
+err:
+       close(nl_sd);
+       if (fd)
+               close(fd);
+       return 0;
+}
diff --git a/Documentation/accounting/taskstats.txt b/Documentation/accounting/taskstats.txt
new file mode 100644 (file)
index 0000000..92ebf29
--- /dev/null
@@ -0,0 +1,181 @@
+Per-task statistics interface
+-----------------------------
+
+
+Taskstats is a netlink-based interface for sending per-task and
+per-process statistics from the kernel to userspace.
+
+Taskstats was designed for the following benefits:
+
+- efficiently provide statistics during lifetime of a task and on its exit
+- unified interface for multiple accounting subsystems
+- extensibility for use by future accounting patches
+
+Terminology
+-----------
+
+"pid", "tid" and "task" are used interchangeably and refer to the standard
+Linux task defined by struct task_struct.  per-pid stats are the same as
+per-task stats.
+
+"tgid", "process" and "thread group" are used interchangeably and refer to the
+tasks that share an mm_struct i.e. the traditional Unix process. Despite the
+use of tgid, there is no special treatment for the task that is thread group
+leader - a process is deemed alive as long as it has any task belonging to it.
+
+Usage
+-----
+
+To get statistics during a task's lifetime, userspace opens a unicast netlink
+socket (NETLINK_GENERIC family) and sends commands specifying a pid or a tgid.
+The response contains statistics for a task (if pid is specified) or the sum of
+statistics for all tasks of the process (if tgid is specified).
+
+To obtain statistics for tasks which are exiting, the userspace listener
+sends a register command and specifies a cpumask. Whenever a task exits on
+one of the cpus in the cpumask, its per-pid statistics are sent to the
+registered listener. Using cpumasks allows the data received by one listener
+to be limited and assists in flow control over the netlink interface and is
+explained in more detail below.
+
+If the exiting task is the last thread exiting its thread group,
+an additional record containing the per-tgid stats is also sent to userspace.
+The latter contains the sum of per-pid stats for all threads in the thread
+group, both past and present.
+
+getdelays.c is a simple utility demonstrating usage of the taskstats interface
+for reporting delay accounting statistics. Users can register cpumasks,
+send commands and process responses, listen for per-tid/tgid exit data,
+write the data received to a file and do basic flow control by increasing
+receive buffer sizes.
+
+Interface
+---------
+
+The user-kernel interface is encapsulated in include/linux/taskstats.h
+
+To avoid this documentation becoming obsolete as the interface evolves, only
+an outline of the current version is given. taskstats.h always overrides the
+description here.
+
+struct taskstats is the common accounting structure for both per-pid and
+per-tgid data. It is versioned and can be extended by each accounting subsystem
+that is added to the kernel. The fields and their semantics are defined in the
+taskstats.h file.
+
+The data exchanged between user and kernel space is a netlink message belonging
+to the NETLINK_GENERIC family and using the netlink attributes interface.
+The messages are in the format
+
+    +----------+- - -+-------------+-------------------+
+    | nlmsghdr | Pad |  genlmsghdr | taskstats payload |
+    +----------+- - -+-------------+-------------------+
+
+
+The taskstats payload is one of the following three kinds:
+
+1. Commands: Sent from user to kernel. Commands to get data on
+a pid/tgid consist of one attribute, of type TASKSTATS_CMD_ATTR_PID/TGID,
+containing a u32 pid or tgid in the attribute payload. The pid/tgid denotes
+the task/process for which userspace wants statistics.
+
+Commands to register/deregister interest in exit data from a set of cpus
+consist of one attribute, of type
+TASKSTATS_CMD_ATTR_REGISTER/DEREGISTER_CPUMASK and contain a cpumask in the
+attribute payload. The cpumask is specified as an ascii string of
+comma-separated cpu ranges e.g. to listen to exit data from cpus 1,2,3,5,7,8
+the cpumask would be "1-3,5,7-8". If userspace forgets to deregister interest
+in cpus before closing the listening socket, the kernel cleans up its interest
+set over time. However, for the sake of efficiency, an explicit deregistration
+is advisable.
+
+2. Response for a command: sent from the kernel in response to a userspace
+command. The payload is a series of three attributes of type:
+
+a) TASKSTATS_TYPE_AGGR_PID/TGID : attribute containing no payload but indicates
+a pid/tgid will be followed by some stats.
+
+b) TASKSTATS_TYPE_PID/TGID: attribute whose payload is the pid/tgid whose stats
+is being returned.
+
+c) TASKSTATS_TYPE_STATS: attribute with a struct taskstsats as payload. The
+same structure is used for both per-pid and per-tgid stats.
+
+3. New message sent by kernel whenever a task exits. The payload consists of a
+   series of attributes of the following type:
+
+a) TASKSTATS_TYPE_AGGR_PID: indicates next two attributes will be pid+stats
+b) TASKSTATS_TYPE_PID: contains exiting task's pid
+c) TASKSTATS_TYPE_STATS: contains the exiting task's per-pid stats
+d) TASKSTATS_TYPE_AGGR_TGID: indicates next two attributes will be tgid+stats
+e) TASKSTATS_TYPE_TGID: contains tgid of process to which task belongs
+f) TASKSTATS_TYPE_STATS: contains the per-tgid stats for exiting task's process
+
+
+per-tgid stats
+--------------
+
+Taskstats provides per-process stats, in addition to per-task stats, since
+resource management is often done at a process granularity and aggregating task
+stats in userspace alone is inefficient and potentially inaccurate (due to lack
+of atomicity).
+
+However, maintaining per-process, in addition to per-task stats, within the
+kernel has space and time overheads. To address this, the taskstats code
+accumalates each exiting task's statistics into a process-wide data structure.
+When the last task of a process exits, the process level data accumalated also
+gets sent to userspace (along with the per-task data).
+
+When a user queries to get per-tgid data, the sum of all other live threads in
+the group is added up and added to the accumalated total for previously exited
+threads of the same thread group.
+
+Extending taskstats
+-------------------
+
+There are two ways to extend the taskstats interface to export more
+per-task/process stats as patches to collect them get added to the kernel
+in future:
+
+1. Adding more fields to the end of the existing struct taskstats. Backward
+   compatibility is ensured by the version number within the
+   structure. Userspace will use only the fields of the struct that correspond
+   to the version its using.
+
+2. Defining separate statistic structs and using the netlink attributes
+   interface to return them. Since userspace processes each netlink attribute
+   independently, it can always ignore attributes whose type it does not
+   understand (because it is using an older version of the interface).
+
+
+Choosing between 1. and 2. is a matter of trading off flexibility and
+overhead. If only a few fields need to be added, then 1. is the preferable
+path since the kernel and userspace don't need to incur the overhead of
+processing new netlink attributes. But if the new fields expand the existing
+struct too much, requiring disparate userspace accounting utilities to
+unnecessarily receive large structures whose fields are of no interest, then
+extending the attributes structure would be worthwhile.
+
+Flow control for taskstats
+--------------------------
+
+When the rate of task exits becomes large, a listener may not be able to keep
+up with the kernel's rate of sending per-tid/tgid exit data leading to data
+loss. This possibility gets compounded when the taskstats structure gets
+extended and the number of cpus grows large.
+
+To avoid losing statistics, userspace should do one or more of the following:
+
+- increase the receive buffer sizes for the netlink sockets opened by
+listeners to receive exit data.
+
+- create more listeners and reduce the number of cpus being listened to by
+each listener. In the extreme case, there could be one listener for each cpu.
+Users may also consider setting the cpu affinity of the listener to the subset
+of cpus to which it listens, especially if they are listening to just one cpu.
+
+Despite these measures, if the userspace receives ENOBUFS error messages
+indicated overflow of receive buffers, it should take measures to handle the
+loss of data.
+
+----
index 9d3a0775a11df394f3504dbd13ee60af75db4c3b..87851efb02285658f55031c390258c10c490d170 100644 (file)
@@ -258,3 +258,19 @@ Why:       These drivers never compiled since they were added to the kernel
 Who:   Jean Delvare <khali@linux-fr.org>
 
 ---------------------------
+
+What:  Bridge netfilter deferred IPv4/IPv6 output hook calling
+When:  January 2007
+Why:   The deferred output hooks are a layering violation causing unusual
+       and broken behaviour on bridge devices. Examples of things they
+       break include QoS classifation using the MARK or CLASSIFY targets,
+       the IPsec policy match and connection tracking with VLANs on a
+       bridge. Their only use is to enable bridge output port filtering
+       within iptables with the physdev match, which can also be done by
+       combining iptables and ebtables using netfilter marks. Until it
+       will get removed the hook deferral is disabled by default and is
+       only enabled when needed.
+
+Who:   Patrick McHardy <kaber@trash.net>
+
+---------------------------
index 149f62ba14a5023a59a1cbaa53550b053950edb2..e11f7728ec6f0691b940daa3d2ec5c7b182417fc 100644 (file)
@@ -448,6 +448,8 @@ running once the system is up.
                        Format: <area>[,<node>]
                        See also Documentation/networking/decnet.txt.
 
+       delayacct       [KNL] Enable per-task delay accounting
+
        dhash_entries=  [KNL]
                        Set number of hash buckets for dentry cache.
 
index 28d1bc3edb1c9b98f357ff1f0442aa18a79a60f9..46b9b389df35c52cf90ac544ea538f2e23c54361 100644 (file)
@@ -1015,10 +1015,9 @@ CPU from reordering them.
 There are some more advanced barrier functions:
 
  (*) set_mb(var, value)
- (*) set_wmb(var, value)
 
-     These assign the value to the variable and then insert at least a write
-     barrier after it, depending on the function.  They aren't guaranteed to
+     This assigns the value to the variable and then inserts at least a write
+     barrier after it, depending on the function.  It isn't guaranteed to
      insert anything more than a compiler barrier in a UP compilation.
 
 
index 7c25584e082c61919d4e51fde9fcc40d8e1f2bb8..52f75b7d51c2208bcb8352fd7c02e6e45b22474b 100644 (file)
@@ -6,7 +6,7 @@ Contents:
        1) Overview
        2) Kernel Command Line Parameters
        3) Using "rdev -r"
-       4) An Example of Creating a Compressed RAM Disk 
+       4) An Example of Creating a Compressed RAM Disk
 
 
 1) Overview
@@ -34,7 +34,7 @@ make it clearer.  The original "ramdisk=<ram_size>" has been kept around for
 compatibility reasons, but it may be removed in the future.
 
 The new RAM disk also has the ability to load compressed RAM disk images,
-allowing one to squeeze more programs onto an average installation or 
+allowing one to squeeze more programs onto an average installation or
 rescue floppy disk.
 
 
@@ -51,7 +51,7 @@ default is 4096 (4 MB) (8192 (8 MB) on S390).
        ===================
 
 This parameter tells the RAM disk driver how many bytes to use per block.  The
-default is 512.
+default is 1024 (BLOCK_SIZE).
 
 
 3) Using "rdev -r"
@@ -70,7 +70,7 @@ These numbers are no magical secrets, as seen below:
 ./arch/i386/kernel/setup.c:#define RAMDISK_PROMPT_FLAG          0x8000
 ./arch/i386/kernel/setup.c:#define RAMDISK_LOAD_FLAG            0x4000
 
-Consider a typical two floppy disk setup, where you will have the 
+Consider a typical two floppy disk setup, where you will have the
 kernel on disk one, and have already put a RAM disk image onto disk #2.
 
 Hence you want to set bits 0 to 13 as 0, meaning that your RAM disk
@@ -97,12 +97,12 @@ Since the default start = 0 and the default prompt = 1, you could use:
        append = "load_ramdisk=1"
 
 
-4) An Example of Creating a Compressed RAM Disk 
+4) An Example of Creating a Compressed RAM Disk
 ----------------------------------------------
 
 To create a RAM disk image, you will need a spare block device to
 construct it on. This can be the RAM disk device itself, or an
-unused disk partition (such as an unmounted swap partition). For this 
+unused disk partition (such as an unmounted swap partition). For this
 example, we will use the RAM disk device, "/dev/ram0".
 
 Note: This technique should not be done on a machine with less than 8 MB
index 6887d44d266188c9d5d17fc267b2441cc82d8e39..6da24e7a56cba01c9b7af0a0e1c894667a614d75 100644 (file)
@@ -238,6 +238,13 @@ Debugging
   pagefaulttrace Dump all page faults. Only useful for extreme debugging
                and will create a lot of output.
 
+  call_trace=[old|both|newfallback|new]
+               old: use old inexact backtracer
+               new: use new exact dwarf2 unwinder
+               both: print entries from both
+               newfallback: use new unwinder but fall back to old if it gets
+                       stuck (default)
+
 Misc
 
   noreplacement  Don't replace instructions with more appropriate ones
index a3462c3414cdf07f99bf99135c248723323b42d5..b2afc7ae965bde912209daaceaff89ed6f1c7bb2 100644 (file)
@@ -771,6 +771,7 @@ M:  aliakc@web.de
 P:     Jamie Lenehan
 M:     lenehan@twibble.org
 W:     http://twibble.org/dist/dc395x/
+L:     dc395x@twibble.org
 L:     http://lists.twibble.org/mailman/listinfo/dc395x/
 S:     Maintained
 
@@ -1501,6 +1502,7 @@ P:        Yi Zhu
 M:     yi.zhu@intel.com
 P:     James Ketrenos
 M:     jketreno@linux.intel.com
+L:     ipw2100-devel@lists.sourceforge.net
 L:     http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
 W:     http://ipw2100.sourceforge.net
 S:     Supported
@@ -1510,6 +1512,7 @@ P:        Yi Zhu
 M:     yi.zhu@intel.com
 P:     James Ketrenos
 M:     jketreno@linux.intel.com
+L:     ipw2100-devel@lists.sourceforge.net
 L:     http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
 W:     http://ipw2200.sourceforge.net
 S:     Supported
@@ -1673,10 +1676,8 @@ L:       linux-kernel@vger.kernel.org
 S:     Maintained
 
 LAPB module
-P:     Henner Eisen
-M:     eis@baty.hanse.de
 L:     linux-x25@vger.kernel.org
-S:     Maintained
+S:     Orphan
 
 LASI 53c700 driver for PARISC
 P:     James E.J. Bottomley
@@ -2226,6 +2227,7 @@ S:        Maintained
 
 PCMCIA SUBSYSTEM
 P:     Linux PCMCIA Team
+L:     linux-pcmcia@lists.infradead.org
 L:     http://lists.infradead.org/mailman/listinfo/linux-pcmcia
 T:     git kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
 S:     Maintained
@@ -2236,6 +2238,12 @@ M:       tsbogend@alpha.franken.de
 L:     netdev@vger.kernel.org
 S:     Maintained
 
+PER-TASK DELAY ACCOUNTING
+P:     Shailabh Nagar
+M:     nagar@watson.ibm.com
+L:     linux-kernel@vger.kernel.org
+S:     Maintained
+
 PERSONALITY HANDLING
 P:     Christoph Hellwig
 M:     hch@infradead.org
@@ -2763,6 +2771,12 @@ P:       Deepak Saxena
 M:     dsaxena@plexity.net
 S:     Maintained
 
+TASKSTATS STATISTICS INTERFACE
+P:     Shailabh Nagar
+M:     nagar@watson.ibm.com
+L:     linux-kernel@vger.kernel.org
+S:     Maintained
+
 TI PARALLEL LINK CABLE DRIVER
 P:     Romain Lievin
 M:     roms@lpg.ticalc.org
index 7c010f3325a96f9541731ab9bbd584df0e862398..1dd58d35d72c53dc8e33623f1793bb7f58ed5401 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 18
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc2
 NAME=Crazed Snow-Weasel
 
 # *DOCUMENTATION*
index 48f0f62f781c98d9b82456a3bb929638cdcc7bcd..5b96f038367f4481dca597f7c32e771efbf3fcfc 100644 (file)
@@ -90,7 +90,7 @@ static void crash_save_self(struct pt_regs *regs)
        crash_save_this_cpu(regs, cpu);
 }
 
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC)
 static atomic_t waiting_for_crash_ipi;
 
 static int crash_nmi_callback(struct pt_regs *regs, int cpu)
index 923bb292f47fbc91ac978777ab69eafc28a2535c..8657c739656a37bbcef81cb36accb486902cf5d1 100644 (file)
@@ -690,8 +690,8 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
        /*
         * Now maybe handle debug registers and/or IO bitmaps
         */
-       if (unlikely((task_thread_info(next_p)->flags & _TIF_WORK_CTXSW))
-           || test_tsk_thread_flag(prev_p, TIF_IO_BITMAP))
+       if (unlikely((task_thread_info(next_p)->flags & _TIF_WORK_CTXSW)
+           || test_tsk_thread_flag(prev_p, TIF_IO_BITMAP)))
                __switch_to_xtra(next_p, tss);
 
        disable_tsc(prev_p, next_p);
index 7864395c1441f0b2aef4b5672c52a7732ae5f0ad..f1682206d304d31fb650992bf8a1cb551b2c54ee 100644 (file)
@@ -1327,7 +1327,10 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat
                res->start = e820.map[i].addr;
                res->end = res->start + e820.map[i].size - 1;
                res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
-               request_resource(&iomem_resource, res);
+               if (request_resource(&iomem_resource, res)) {
+                       kfree(res);
+                       continue;
+               }
                if (e820.map[i].type == E820_RAM) {
                        /*
                         *  We don't know which RAM region contains kernel data,
index 8705c0f0578881afafb5af2e80337f347bfad5ec..edd00f6cee377715fdc6e73e411d0e2c8fed2026 100644 (file)
@@ -135,7 +135,7 @@ unsigned long profile_pc(struct pt_regs *regs)
 {
        unsigned long pc = instruction_pointer(regs);
 
-       if (in_lock_functions(pc))
+       if (!user_mode_vm(regs) && in_lock_functions(pc))
                return *(unsigned long *)(regs->ebp + 4);
 
        return pc;
index 5cfd4f42eeba08f3650f47e0ae6cd405c98486c1..021f8fdc7512a296cf9aa00a6c2d3fb15bd9cac3 100644 (file)
@@ -187,10 +187,21 @@ static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
                        if (unwind_init_blocked(&info, task) == 0)
                                unw_ret = show_trace_unwind(&info, log_lvl);
                }
-               if (unw_ret > 0) {
-                       if (call_trace > 0)
+               if (unw_ret > 0 && !arch_unw_user_mode(&info)) {
+#ifdef CONFIG_STACK_UNWIND
+                       print_symbol("DWARF2 unwinder stuck at %s\n",
+                                    UNW_PC(&info));
+                       if (call_trace == 1) {
+                               printk("Leftover inexact backtrace:\n");
+                               if (UNW_SP(&info))
+                                       stack = (void *)UNW_SP(&info);
+                       } else if (call_trace > 1)
                                return;
-                       printk("%sLegacy call trace:\n", log_lvl);
+                       else
+                               printk("Full inexact backtrace again:\n");
+#else
+                       printk("Inexact backtrace:\n");
+#endif
                }
        }
 
@@ -324,35 +335,35 @@ void show_registers(struct pt_regs *regs)
 
 static void handle_BUG(struct pt_regs *regs)
 {
+       unsigned long eip = regs->eip;
        unsigned short ud2;
-       unsigned short line;
-       char *file;
-       char c;
-       unsigned long eip;
-
-       eip = regs->eip;
 
        if (eip < PAGE_OFFSET)
-               goto no_bug;
+               return;
        if (__get_user(ud2, (unsigned short __user *)eip))
-               goto no_bug;
+               return;
        if (ud2 != 0x0b0f)
-               goto no_bug;
-       if (__get_user(line, (unsigned short __user *)(eip + 2)))
-               goto bug;
-       if (__get_user(file, (char * __user *)(eip + 4)) ||
-               (unsigned long)file < PAGE_OFFSET || __get_user(c, file))
-               file = "<bad filename>";
+               return;
 
        printk(KERN_EMERG "------------[ cut here ]------------\n");
-       printk(KERN_EMERG "kernel BUG at %s:%d!\n", file, line);
 
-no_bug:
-       return;
+#ifdef CONFIG_DEBUG_BUGVERBOSE
+       do {
+               unsigned short line;
+               char *file;
+               char c;
+
+               if (__get_user(line, (unsigned short __user *)(eip + 2)))
+                       break;
+               if (__get_user(file, (char * __user *)(eip + 4)) ||
+                   (unsigned long)file < PAGE_OFFSET || __get_user(c, file))
+                       file = "<bad filename>";
 
-       /* Here we know it was a BUG but file-n-line is unavailable */
-bug:
-       printk(KERN_EMERG "Kernel BUG\n");
+               printk(KERN_EMERG "kernel BUG at %s:%d!\n", file, line);
+               return;
+       } while (0);
+#endif
+       printk(KERN_EMERG "Kernel BUG at [verbose debug info unavailable]\n");
 }
 
 /* This is gone through when something in the kernel
@@ -1238,8 +1249,10 @@ static int __init call_trace_setup(char *s)
                call_trace = -1;
        else if (strcmp(s, "both") == 0)
                call_trace = 0;
-       else if (strcmp(s, "new") == 0)
+       else if (strcmp(s, "newfallback") == 0)
                call_trace = 1;
+       else if (strcmp(s, "new") == 2)
+               call_trace = 2;
        return 1;
 }
 __setup("call_trace=", call_trace_setup);
index 4b75212ab6dd877786057eef6b2192cfadd4d6ed..efc7e7d5f4d0f518847b5232f38aad75ea9367f4 100644 (file)
@@ -843,7 +843,6 @@ unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *fr
 unsigned long
 copy_to_user(void __user *to, const void *from, unsigned long n)
 {
-       might_sleep();
        BUG_ON((long) n < 0);
        if (access_ok(VERIFY_WRITE, to, n))
                n = __copy_to_user(to, from, n);
@@ -870,7 +869,6 @@ EXPORT_SYMBOL(copy_to_user);
 unsigned long
 copy_from_user(void *to, const void __user *from, unsigned long n)
 {
-       might_sleep();
        BUG_ON((long) n < 0);
        if (access_ok(VERIFY_READ, from, n))
                n = __copy_from_user(to, from, n);
index f4dfc10026d2411fb8ec0a301360fb50b1dbf5f9..f1d4591eddbbd3bcf26801a728e033992841f412 100644 (file)
@@ -1,13 +1,16 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17-rc1
-# Mon Apr  3 14:34:15 2006
+# Linux kernel version: 2.6.18-rc2
+# Thu Jul 27 13:51:07 2006
 #
 CONFIG_MMU=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_S390=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
 # Code maturity level options
@@ -25,6 +28,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
 CONFIG_SYSCTL=y
 CONFIG_AUDIT=y
 # CONFIG_AUDITSYSCALL is not set
@@ -43,10 +47,12 @@ CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
+CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -94,7 +100,6 @@ CONFIG_HOTPLUG_CPU=y
 CONFIG_DEFAULT_MIGRATION_COST=1000000
 CONFIG_COMPAT=y
 CONFIG_SYSVIPC_COMPAT=y
-CONFIG_BINFMT_ELF32=y
 
 #
 # Code generation options
@@ -115,6 +120,7 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
 
 #
 # I/O subsystem configuration
@@ -142,6 +148,7 @@ CONFIG_VIRT_CPU_ACCOUNTING=y
 # CONFIG_APPLDATA_BASE is not set
 CONFIG_NO_IDLE_HZ=y
 CONFIG_NO_IDLE_HZ_INIT=y
+CONFIG_S390_HYPFS_FS=y
 CONFIG_KEXEC=y
 
 #
@@ -174,6 +181,8 @@ CONFIG_IP_FIB_HASH=y
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_INET_XFRM_TUNNEL is not set
 # CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -186,7 +195,10 @@ CONFIG_IPV6=y
 # CONFIG_INET6_IPCOMP is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=y
+CONFIG_INET6_XFRM_MODE_TUNNEL=y
 # CONFIG_IPV6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
 
 #
@@ -263,6 +275,7 @@ CONFIG_NET_ESTIMATOR=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NET_TCPPROBE is not set
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
@@ -276,6 +289,7 @@ CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
+CONFIG_SYS_HYPERVISOR=y
 
 #
 # Connector - unified userspace <-> kernelspace linker
@@ -334,6 +348,7 @@ CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 
@@ -359,9 +374,7 @@ CONFIG_MD_LINEAR=m
 CONFIG_MD_RAID0=m
 CONFIG_MD_RAID1=m
 # CONFIG_MD_RAID10 is not set
-CONFIG_MD_RAID5=m
-# CONFIG_MD_RAID5_RESHAPE is not set
-# CONFIG_MD_RAID6 is not set
+# CONFIG_MD_RAID456 is not set
 CONFIG_MD_MULTIPATH=m
 # CONFIG_MD_FAULTY is not set
 CONFIG_BLK_DEV_DM=y
@@ -419,7 +432,8 @@ CONFIG_S390_TAPE_34XX=m
 #
 # Cryptographic devices
 #
-CONFIG_Z90CRYPT=m
+CONFIG_ZCRYPT=m
+# CONFIG_ZCRYPT_MONOLITHIC is not set
 
 #
 # Network device support
@@ -509,6 +523,7 @@ CONFIG_FS_MBCACHE=y
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
 CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
@@ -614,26 +629,36 @@ CONFIG_MSDOS_PARTITION=y
 # Instrumentation Support
 #
 # CONFIG_PROFILING is not set
-# CONFIG_STATISTICS is not set
+CONFIG_STATISTICS=y
+CONFIG_KPROBES=y
 
 #
 # Kernel hacking
 #
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
 CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_DETECT_SOFTLOCKUP is not set
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
 CONFIG_DEBUG_PREEMPT=y
-CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
 CONFIG_DEBUG_SPINLOCK=y
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_RWSEMS is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
 CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_VM is not set
+# CONFIG_FRAME_POINTER is not set
 # CONFIG_UNWIND_INFO is not set
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
@@ -688,3 +713,4 @@ CONFIG_CRYPTO=y
 # CONFIG_CRC16 is not set
 CONFIG_CRC32=m
 # CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
index d00de17b3778ef9fde54a971de2175922ab5b03d..a4dc61f3285e3ef55e1ff7c559137ae965a59c10 100644 (file)
@@ -273,7 +273,7 @@ startup_continue:
 .Lbss_end:  .long _end
 .Lparmaddr: .long PARMAREA
 .Lsccbaddr: .long .Lsccb
-       .align  4096
+       .org    0x12000
 .Lsccb:
        .hword  0x1000                  # length, one page
        .byte   0x00,0x00,0x00
@@ -290,7 +290,7 @@ startup_continue:
 .Lscpincr2:
        .quad   0x00
        .fill   3984,1,0
-       .align  4096
+       .org    0x13000
 
 #ifdef CONFIG_SHARED_KERNEL
        .org    0x100000
index 47744fcca930d92f3e2dad3184a64be84009d3c8..9d80c5b1ef9582d79b7bd8670da36813bc0c926d 100644 (file)
@@ -268,7 +268,7 @@ startup_continue:
 .Lparmaddr:
        .quad   PARMAREA
 
-       .align 4096
+       .org    0x12000
 .Lsccb:
        .hword 0x1000                   # length, one page
        .byte 0x00,0x00,0x00
@@ -285,7 +285,7 @@ startup_continue:
 .Lscpincr2:
        .quad 0x00
        .fill 3984,1,0
-       .align 4096
+       .org    0x13000
 
 #ifdef CONFIG_SHARED_KERNEL
        .org   0x100000
index 1ca34f54ea8a2419e278825072ba66596efc1618..c902f059c7aab7d7e0e33d442b192f9a2650d036 100644 (file)
@@ -877,31 +877,57 @@ static struct bin_attribute ipl_scp_data_attr = {
 
 static decl_subsys(ipl, NULL, NULL);
 
+static int ipl_register_fcp_files(void)
+{
+       int rc;
+
+       rc = sysfs_create_group(&ipl_subsys.kset.kobj,
+                               &ipl_fcp_attr_group);
+       if (rc)
+               goto out;
+       rc = sysfs_create_bin_file(&ipl_subsys.kset.kobj,
+                                  &ipl_parameter_attr);
+       if (rc)
+               goto out_ipl_parm;
+       rc = sysfs_create_bin_file(&ipl_subsys.kset.kobj,
+                                  &ipl_scp_data_attr);
+       if (!rc)
+               goto out;
+
+       sysfs_remove_bin_file(&ipl_subsys.kset.kobj, &ipl_parameter_attr);
+
+out_ipl_parm:
+       sysfs_remove_group(&ipl_subsys.kset.kobj, &ipl_fcp_attr_group);
+out:
+       return rc;
+}
+
 static int __init
 ipl_device_sysfs_register(void) {
        int rc;
 
        rc = firmware_register(&ipl_subsys);
        if (rc)
-               return rc;
+               goto out;
 
        switch (get_ipl_type()) {
        case ipl_type_ccw:
-               sysfs_create_group(&ipl_subsys.kset.kobj, &ipl_ccw_attr_group);
+               rc = sysfs_create_group(&ipl_subsys.kset.kobj,
+                                       &ipl_ccw_attr_group);
                break;
        case ipl_type_fcp:
-               sysfs_create_group(&ipl_subsys.kset.kobj, &ipl_fcp_attr_group);
-               sysfs_create_bin_file(&ipl_subsys.kset.kobj,
-                                     &ipl_parameter_attr);
-               sysfs_create_bin_file(&ipl_subsys.kset.kobj,
-                                     &ipl_scp_data_attr);
+               rc = ipl_register_fcp_files();
                break;
        default:
-               sysfs_create_group(&ipl_subsys.kset.kobj,
-                                  &ipl_unknown_attr_group);
+               rc = sysfs_create_group(&ipl_subsys.kset.kobj,
+                                       &ipl_unknown_attr_group);
                break;
        }
-       return 0;
+
+       if (rc)
+               firmware_unregister(&ipl_subsys);
+out:
+       return rc;
 }
 
 __initcall(ipl_device_sysfs_register);
index adba9dfee35e0954326829c3a9c7f7a3318a2268..af90a5f9ab5751a6ee19161221b198c55f9ae8b8 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <asm/page.h>
 #include <asm/oplib.h>
+#include <asm/prom.h>
 #include <asm/smp.h>
 #include <asm/system.h>
 #include <asm/cpudata.h>
@@ -34,12 +35,6 @@ static int check_cpu_node(int nd, int *cur_inst,
                          int (*compare)(int, int, void *), void *compare_arg,
                          int *prom_node, int *mid)
 {
-       char node_str[128];
-
-       prom_getstring(nd, "device_type", node_str, sizeof(node_str));
-       if (strcmp(node_str, "cpu"))
-               return -ENODEV;
-       
        if (!compare(nd, *cur_inst, compare_arg)) {
                if (prom_node)
                        *prom_node = nd;
@@ -59,20 +54,14 @@ static int check_cpu_node(int nd, int *cur_inst,
 static int __cpu_find_by(int (*compare)(int, int, void *), void *compare_arg,
                         int *prom_node, int *mid)
 {
-       int nd, cur_inst, err;
+       struct device_node *dp;
+       int cur_inst;
 
-       nd = prom_root_node;
        cur_inst = 0;
-
-       err = check_cpu_node(nd, &cur_inst, compare, compare_arg,
-                            prom_node, mid);
-       if (!err)
-               return 0;
-
-       nd = prom_getchild(nd);
-       while ((nd = prom_getsibling(nd)) != 0) {
-               err = check_cpu_node(nd, &cur_inst, compare, compare_arg,
-                                    prom_node, mid);
+       for_each_node_by_type(dp, "cpu") {
+               int err = check_cpu_node(dp->node, &cur_inst,
+                                        compare, compare_arg,
+                                        prom_node, mid);
                if (!err)
                        return 0;
        }
index cde73327ca962b906cee82d0b40c6d1c09f63ecb..72f0201051a0bd9fa0cff67c8a3792e5dbf3795c 100644 (file)
@@ -329,7 +329,7 @@ void handler_irq(int irq, struct pt_regs * regs)
        disable_pil_irq(irq);
 #ifdef CONFIG_SMP
        /* Only rotate on lower priority IRQ's (scsi, ethernet, etc.). */
-       if(irq < 10)
+       if((sparc_cpu_model==sun4m) && (irq < 10))
                smp4m_irq_rotate(cpu);
 #endif
        action = sparc_irq[irq].action;
index 5a2faad5d043eb2f4f2fcdb3a8ebf80f484a96fc..97bf87e8cdde56853b86dda4677569be491dff9f 100644 (file)
@@ -596,14 +596,41 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
                static int pil_to_sbus[] = {
                        0, 0, 1, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 0,
                };
-               struct device_node *busp = dp->parent;
+               struct device_node *io_unit, *sbi = dp->parent;
                struct linux_prom_registers *regs;
-               int board = of_getintprop_default(busp, "board#", 0);
-               int slot;
+               int board, slot;
+
+               while (sbi) {
+                       if (!strcmp(sbi->name, "sbi"))
+                               break;
+
+                       sbi = sbi->parent;
+               }
+               if (!sbi)
+                       goto build_resources;
 
                regs = of_get_property(dp, "reg", NULL);
+               if (!regs)
+                       goto build_resources;
+
                slot = regs->which_io;
 
+               /* If SBI's parent is not io-unit or the io-unit lacks
+                * a "board#" property, something is very wrong.
+                */
+               if (!sbi->parent || strcmp(sbi->parent->name, "io-unit")) {
+                       printk("%s: Error, parent is not io-unit.\n",
+                              sbi->full_name);
+                       goto build_resources;
+               }
+               io_unit = sbi->parent;
+               board = of_getintprop_default(io_unit, "board#", -1);
+               if (board == -1) {
+                       printk("%s: Error, lacks board# property.\n",
+                              io_unit->full_name);
+                       goto build_resources;
+               }
+
                for (i = 0; i < op->num_irqs; i++) {
                        int this_irq = op->irqs[i];
                        int sbusl = pil_to_sbus[this_irq];
@@ -617,6 +644,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
                }
        }
 
+build_resources:
        build_device_resources(op, parent);
 
        op->dev.parent = parent;
index 4b06dcb00ebde6212caafa0ff47989f86ce57f7e..4ca9e5fc97f4d504c12b1dabbfd8ad2bbcf06dde 100644 (file)
@@ -444,6 +444,7 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s
        static struct property *tmp = NULL;
        struct property *p;
        int len;
+       const char *name;
 
        if (tmp) {
                p = tmp;
@@ -456,19 +457,21 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s
 
        p->name = (char *) (p + 1);
        if (special_name) {
+               strcpy(p->name, special_name);
                p->length = special_len;
                p->value = prom_early_alloc(special_len);
                memcpy(p->value, special_val, special_len);
        } else {
                if (prev == NULL) {
-                       prom_firstprop(node, p->name);
+                       name = prom_firstprop(node, NULL);
                } else {
-                       prom_nextprop(node, prev, p->name);
+                       name = prom_nextprop(node, prev, NULL);
                }
-               if (strlen(p->name) == 0) {
+               if (strlen(name) == 0) {
                        tmp = p;
                        return NULL;
                }
+               strcpy(p->name, name);
                p->length = prom_getproplen(node, p->name);
                if (p->length <= 0) {
                        p->length = 0;
index 6135d4faeeeb62f76abd49ba23b812b38a86f686..e311ade1b490adad0b3188f694ca96d345e82ac6 100644 (file)
@@ -87,6 +87,7 @@ void __cpuinit smp_store_cpu_info(int id)
 void __init smp_cpus_done(unsigned int max_cpus)
 {
        extern void smp4m_smp_done(void);
+       extern void smp4d_smp_done(void);
        unsigned long bogosum = 0;
        int cpu, num;
 
@@ -100,8 +101,34 @@ void __init smp_cpus_done(unsigned int max_cpus)
                num, bogosum/(500000/HZ),
                (bogosum/(5000/HZ))%100);
 
-       BUG_ON(sparc_cpu_model != sun4m);
-       smp4m_smp_done();
+       switch(sparc_cpu_model) {
+       case sun4:
+               printk("SUN4\n");
+               BUG();
+               break;
+       case sun4c:
+               printk("SUN4C\n");
+               BUG();
+               break;
+       case sun4m:
+               smp4m_smp_done();
+               break;
+       case sun4d:
+               smp4d_smp_done();
+               break;
+       case sun4e:
+               printk("SUN4E\n");
+               BUG();
+               break;
+       case sun4u:
+               printk("SUN4U\n");
+               BUG();
+               break;
+       default:
+               printk("UNKNOWN!\n");
+               BUG();
+               break;
+       };
 }
 
 void cpu_panic(void)
@@ -267,9 +294,9 @@ int setup_profiling_timer(unsigned int multiplier)
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
        extern void smp4m_boot_cpus(void);
+       extern void smp4d_boot_cpus(void);
        int i, cpuid, extra;
 
-       BUG_ON(sparc_cpu_model != sun4m);
        printk("Entering SMP Mode...\n");
 
        extra = 0;
@@ -283,7 +310,34 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
 
        smp_store_cpu_info(boot_cpu_id);
 
-       smp4m_boot_cpus();
+       switch(sparc_cpu_model) {
+       case sun4:
+               printk("SUN4\n");
+               BUG();
+               break;
+       case sun4c:
+               printk("SUN4C\n");
+               BUG();
+               break;
+       case sun4m:
+               smp4m_boot_cpus();
+               break;
+       case sun4d:
+               smp4d_boot_cpus();
+               break;
+       case sun4e:
+               printk("SUN4E\n");
+               BUG();
+               break;
+       case sun4u:
+               printk("SUN4U\n");
+               BUG();
+               break;
+       default:
+               printk("UNKNOWN!\n");
+               BUG();
+               break;
+       };
 }
 
 /* Set this up early so that things like the scheduler can init
@@ -323,9 +377,37 @@ void __init smp_prepare_boot_cpu(void)
 int __cpuinit __cpu_up(unsigned int cpu)
 {
        extern int smp4m_boot_one_cpu(int);
-       int ret;
-
-       ret = smp4m_boot_one_cpu(cpu);
+       extern int smp4d_boot_one_cpu(int);
+       int ret=0;
+
+       switch(sparc_cpu_model) {
+       case sun4:
+               printk("SUN4\n");
+               BUG();
+               break;
+       case sun4c:
+               printk("SUN4C\n");
+               BUG();
+               break;
+       case sun4m:
+               ret = smp4m_boot_one_cpu(cpu);
+               break;
+       case sun4d:
+               ret = smp4d_boot_one_cpu(cpu);
+               break;
+       case sun4e:
+               printk("SUN4E\n");
+               BUG();
+               break;
+       case sun4u:
+               printk("SUN4U\n");
+               BUG();
+               break;
+       default:
+               printk("UNKNOWN!\n");
+               BUG();
+               break;
+       };
 
        if (!ret) {
                cpu_set(cpu, smp_commenced_mask);
index 5fb987fc3d63ac4e4aad336ac562ae78fd9e7b32..4d441a554d35406da94a99ff9ac20bd3e035986c 100644 (file)
@@ -237,7 +237,6 @@ EXPORT_SYMBOL(prom_node_has_property);
 EXPORT_SYMBOL(prom_setprop);
 EXPORT_SYMBOL(saved_command_line);
 EXPORT_SYMBOL(prom_apply_obio_ranges);
-EXPORT_SYMBOL(prom_getname);
 EXPORT_SYMBOL(prom_feval);
 EXPORT_SYMBOL(prom_getbool);
 EXPORT_SYMBOL(prom_getstring);
index b141b7ee6717751751743587cd9072f68390ffc4..ba843f6a28325eeb0189b05af903ac453c5d2631 100644 (file)
@@ -43,15 +43,10 @@ extern ctxd_t *srmmu_ctx_table_phys;
 extern void calibrate_delay(void);
 
 extern volatile int smp_processors_ready;
-extern int smp_num_cpus;
 static int smp_highest_cpu;
 extern volatile unsigned long cpu_callin_map[NR_CPUS];
 extern cpuinfo_sparc cpu_data[NR_CPUS];
 extern unsigned char boot_cpu_id;
-extern int smp_activated;
-extern volatile int __cpu_number_map[NR_CPUS];
-extern volatile int __cpu_logical_map[NR_CPUS];
-extern volatile unsigned long ipi_count;
 extern volatile int smp_process_available;
 
 extern cpumask_t smp_commenced_mask;
@@ -144,6 +139,8 @@ void __init smp4d_callin(void)
        spin_lock_irqsave(&sun4d_imsk_lock, flags);
        cc_set_imsk(cc_get_imsk() & ~0x4000); /* Allow PIL 14 as well */
        spin_unlock_irqrestore(&sun4d_imsk_lock, flags);
+       cpu_set(cpuid, cpu_online_map);
+
 }
 
 extern void init_IRQ(void);
@@ -160,51 +157,24 @@ extern unsigned long trapbase_cpu3[];
 
 void __init smp4d_boot_cpus(void)
 {
-       int cpucount = 0;
-       int i, mid;
-
-       printk("Entering SMP Mode...\n");
-       
        if (boot_cpu_id)
                current_set[0] = NULL;
-
-       local_irq_enable();
-       cpus_clear(cpu_present_map);
-
-       /* XXX This whole thing has to go.  See sparc64. */
-       for (i = 0; !cpu_find_by_instance(i, NULL, &mid); i++)
-               cpu_set(mid, cpu_present_map);
-       SMP_PRINTK(("cpu_present_map %08lx\n", cpus_addr(cpu_present_map)[0]));
-       for(i=0; i < NR_CPUS; i++)
-               __cpu_number_map[i] = -1;
-       for(i=0; i < NR_CPUS; i++)
-               __cpu_logical_map[i] = -1;
-       __cpu_number_map[boot_cpu_id] = 0;
-       __cpu_logical_map[0] = boot_cpu_id;
-       current_thread_info()->cpu = boot_cpu_id;
-       smp_store_cpu_info(boot_cpu_id);
        smp_setup_percpu_timer();
        local_flush_cache_all();
-       if (cpu_find_by_instance(1, NULL, NULL))
-               return;  /* Not an MP box. */
-       SMP_PRINTK(("Iterating over CPUs\n"));
-       for(i = 0; i < NR_CPUS; i++) {
-               if(i == boot_cpu_id)
-                       continue;
-
-               if (cpu_isset(i, cpu_present_map)) {
+}
+
+int smp4d_boot_one_cpu(int i)
+{
                        extern unsigned long sun4d_cpu_startup;
                        unsigned long *entry = &sun4d_cpu_startup;
                        struct task_struct *p;
                        int timeout;
-                       int no;
+                       int cpu_node;
 
+                       cpu_find_by_instance(i, &cpu_node,NULL);
                        /* Cook up an idler for this guy. */
                        p = fork_idle(i);
-                       cpucount++;
                        current_set[i] = task_thread_info(p);
-                       for (no = 0; !cpu_find_by_instance(no, NULL, &mid)
-                                    && mid != i; no++) ;
 
                        /*
                         * Initialize the contexts table
@@ -216,9 +186,9 @@ void __init smp4d_boot_cpus(void)
                        smp_penguin_ctable.reg_size = 0;
 
                        /* whirrr, whirrr, whirrrrrrrrr... */
-                       SMP_PRINTK(("Starting CPU %d at %p task %d node %08x\n", i, entry, cpucount, cpu_data(no).prom_node));
+                       SMP_PRINTK(("Starting CPU %d at %p \n", i, entry));
                        local_flush_cache_all();
-                       prom_startcpu(cpu_data(no).prom_node,
+                       prom_startcpu(cpu_node,
                                      &smp_penguin_ctable, 0, (char *)entry);
                                      
                        SMP_PRINTK(("prom_startcpu returned :)\n"));
@@ -230,39 +200,30 @@ void __init smp4d_boot_cpus(void)
                                udelay(200);
                        }
                        
-                       if(cpu_callin_map[i]) {
-                               /* Another "Red Snapper". */
-                               __cpu_number_map[i] = cpucount;
-                               __cpu_logical_map[cpucount] = i;
-                       } else {
-                               cpucount--;
-                               printk("Processor %d is stuck.\n", i);
-                       }
-               }
-               if(!(cpu_callin_map[i])) {
-                       cpu_clear(i, cpu_present_map);
-                       __cpu_number_map[i] = -1;
-               }
+       if (!(cpu_callin_map[i])) {
+               printk("Processor %d is stuck.\n", i);
+               return -ENODEV;
+
        }
        local_flush_cache_all();
-       if(cpucount == 0) {
-               printk("Error: only one Processor found.\n");
-               cpu_present_map = cpumask_of_cpu(hard_smp4d_processor_id());
-       } else {
-               unsigned long bogosum = 0;
-               
-               for_each_present_cpu(i) {
-                       bogosum += cpu_data(i).udelay_val;
-                       smp_highest_cpu = i;
+       return 0;
+}
+
+void __init smp4d_smp_done(void)
+{
+       int i, first;
+       int *prev;
+
+       /* setup cpu list for irq rotation */
+       first = 0;
+       prev = &first;
+       for (i = 0; i < NR_CPUS; i++)
+               if (cpu_online(i)) {
+                       *prev = i;
+                       prev = &cpu_data(i).next;
                }
-               SMP_PRINTK(("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n", cpucount + 1, bogosum/(500000/HZ), (bogosum/(5000/HZ))%100));
-               printk("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n",
-                      cpucount + 1,
-                      bogosum/(500000/HZ),
-                      (bogosum/(5000/HZ))%100);
-               smp_activated = 1;
-               smp_num_cpus = cpucount + 1;
-       }
+       *prev = first;
+       local_flush_cache_all();
 
        /* Free unneeded trap tables */
        ClearPageReserved(virt_to_page(trapbase_cpu1));
@@ -334,7 +295,7 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
                        register int i;
 
                        mask = cpumask_of_cpu(hard_smp4d_processor_id());
-                       cpus_andnot(mask, cpu_present_map, mask);
+                       cpus_andnot(mask, cpu_online_map, mask);
                        for(i = 0; i <= high; i++) {
                                if (cpu_isset(i, mask)) {
                                        ccall_info.processors_in[i] = 0;
index 0cdfc9d294b45a777b20ec249ed79094862b650f..a41c8a5c20070847a037a8b73ef4e7bcda0a53b4 100644 (file)
@@ -465,21 +465,21 @@ sys_rt_sigaction(int sig,
 
 asmlinkage int sys_getdomainname(char __user *name, int len)
 {
-       int nlen;
-       int err = -EFAULT;
+       int nlen, err;
        
+       if (len < 0 || len > __NEW_UTS_LEN)
+               return -EINVAL;
+
        down_read(&uts_sem);
        
        nlen = strlen(system_utsname.domainname) + 1;
-
        if (nlen < len)
                len = nlen;
-       if (len > __NEW_UTS_LEN)
-               goto done;
-       if (copy_to_user(name, system_utsname.domainname, len))
-               goto done;
-       err = 0;
-done:
+
+       err = -EFAULT;
+       if (!copy_to_user(name, system_utsname.domainname, len))
+               err = 0;
+
        up_read(&uts_sem);
        return err;
 }
index 04eb1eab6e3e17f2777045c86a31650900cb999e..845081b0126760ac14e8b7c2735ad089bee991f2 100644 (file)
@@ -225,6 +225,32 @@ static __inline__ int has_low_battery(void)
        return (data1 == data2);        /* Was the write blocked? */
 }
 
+static void __init mostek_set_system_time(void)
+{
+       unsigned int year, mon, day, hour, min, sec;
+       struct mostek48t02 *mregs;
+
+       mregs = (struct mostek48t02 *)mstk48t02_regs;
+       if(!mregs) {
+               prom_printf("Something wrong, clock regs not mapped yet.\n");
+               prom_halt();
+       }               
+       spin_lock_irq(&mostek_lock);
+       mregs->creg |= MSTK_CREG_READ;
+       sec = MSTK_REG_SEC(mregs);
+       min = MSTK_REG_MIN(mregs);
+       hour = MSTK_REG_HOUR(mregs);
+       day = MSTK_REG_DOM(mregs);
+       mon = MSTK_REG_MONTH(mregs);
+       year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
+       xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
+       xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
+        set_normalized_timespec(&wall_to_monotonic,
+                                -xtime.tv_sec, -xtime.tv_nsec);
+       mregs->creg &= ~MSTK_CREG_READ;
+       spin_unlock_irq(&mostek_lock);
+}
+
 /* Probe for the real time clock chip on Sun4 */
 static __inline__ void sun4_clock_probe(void)
 {
@@ -273,6 +299,7 @@ static __inline__ void sun4_clock_probe(void)
 #endif
 }
 
+#ifndef CONFIG_SUN4
 static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match)
 {
        struct device_node *dp = op->node;
@@ -307,6 +334,8 @@ static int __devinit clock_probe(struct of_device *op, const struct of_device_id
        if (mostek_read(mstk48t02_regs + MOSTEK_SEC) & MSTK_STOP)
                kick_start_clock();
 
+       mostek_set_system_time();
+
        return 0;
 }
 
@@ -325,56 +354,37 @@ static struct of_platform_driver clock_driver = {
 
 
 /* Probe for the mostek real time clock chip. */
-static void clock_init(void)
+static int __init clock_init(void)
 {
-       of_register_driver(&clock_driver, &of_bus_type);
+       return of_register_driver(&clock_driver, &of_bus_type);
 }
 
+/* Must be after subsys_initcall() so that busses are probed.  Must
+ * be before device_initcall() because things like the RTC driver
+ * need to see the clock registers.
+ */
+fs_initcall(clock_init);
+#endif /* !CONFIG_SUN4 */
+
 void __init sbus_time_init(void)
 {
-       unsigned int year, mon, day, hour, min, sec;
-       struct mostek48t02 *mregs;
-
-#ifdef CONFIG_SUN4
-       int temp;
-       struct intersil *iregs;
-#endif
 
        BTFIXUPSET_CALL(bus_do_settimeofday, sbus_do_settimeofday, BTFIXUPCALL_NORM);
        btfixup();
 
        if (ARCH_SUN4)
                sun4_clock_probe();
-       else
-               clock_init();
 
        sparc_init_timers(timer_interrupt);
        
 #ifdef CONFIG_SUN4
        if(idprom->id_machtype == (SM_SUN4 | SM_4_330)) {
-#endif
-       mregs = (struct mostek48t02 *)mstk48t02_regs;
-       if(!mregs) {
-               prom_printf("Something wrong, clock regs not mapped yet.\n");
-               prom_halt();
-       }               
-       spin_lock_irq(&mostek_lock);
-       mregs->creg |= MSTK_CREG_READ;
-       sec = MSTK_REG_SEC(mregs);
-       min = MSTK_REG_MIN(mregs);
-       hour = MSTK_REG_HOUR(mregs);
-       day = MSTK_REG_DOM(mregs);
-       mon = MSTK_REG_MONTH(mregs);
-       year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
-       xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
-       xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
-        set_normalized_timespec(&wall_to_monotonic,
-                                -xtime.tv_sec, -xtime.tv_nsec);
-       mregs->creg &= ~MSTK_CREG_READ;
-       spin_unlock_irq(&mostek_lock);
-#ifdef CONFIG_SUN4
+               mostek_set_system_time();
        } else if(idprom->id_machtype == (SM_SUN4 | SM_4_260) ) {
                /* initialise the intersil on sun4 */
+               unsigned int year, mon, day, hour, min, sec;
+               int temp;
+               struct intersil *iregs;
 
                iregs=intersil_clock;
                if(!iregs) {
index 42c1c700c0a70b3c7ca86a13c90b22bf0e84fb5f..2bb1309003dd9e6ba316fdf87df308f2bceb34b5 100644 (file)
@@ -64,6 +64,7 @@ iounit_init(int sbi_node, int io_node, struct sbus_bus *sbus)
        
        sbus->iommu = (struct iommu_struct *)iounit;
        iounit->page_table = xpt;
+       spin_lock_init(&iounit->lock);
        
        for (xptend = iounit->page_table + (16 * PAGE_SIZE) / sizeof(iopte_t);
             xpt < xptend;)
index 2bf03ee8cde5d10b70c55258631d592e5c92aab4..5ec246573a98ee8d8399323b13227c7aac48241f 100644 (file)
@@ -205,24 +205,6 @@ int prom_searchsiblings(int node_start, char *nodename)
        return 0;
 }
 
-/* Gets name in the form prom v2+ uses it (name@x,yyyyy or name (if no reg)) */
-int prom_getname (int node, char *buffer, int len)
-{
-       int i;
-       struct linux_prom_registers reg[PROMREG_MAX];
-       
-       i = prom_getproperty (node, "name", buffer, len);
-       if (i <= 0) return -1;
-       buffer [i] = 0;
-       len -= i;
-       i = prom_getproperty (node, "reg", (char *)reg, sizeof (reg));
-       if (i <= 0) return 0;
-       if (len < 11) return -1;
-       buffer = strchr (buffer, 0);
-       sprintf (buffer, "@%x,%x", reg[0].which_io, (uint)reg[0].phys_addr);
-       return 0;
-}
-
 /* Interal version of nextprop that does not alter return values. */
 char * __prom_nextprop(int node, char * oprop)
 {
index 38353621069e03ee9f3dfe02ad7ee8a675d637dd..43d9229fca07b39d9a37914b95d5308a05abab81 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-rc1
-# Wed Jul 12 14:00:58 2006
+# Linux kernel version: 2.6.18-rc2
+# Fri Jul 21 14:19:24 2006
 #
 CONFIG_SPARC=y
 CONFIG_SPARC64=y
@@ -36,6 +36,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
@@ -1120,7 +1121,7 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
-# CONFIG_USB_CY7C63 is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_PHIDGETKIT is not set
 # CONFIG_USB_PHIDGETSERVO is not set
@@ -1279,7 +1280,6 @@ CONFIG_RAMFS=y
 # CONFIG_NFSD is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
-# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
index f8ef2f2b9b375a62375b0237a366a3193c4d2ba2..ec10f7edcf868713891e1d1e5f0d1b3ee38df00c 100644 (file)
@@ -66,9 +66,6 @@ static int check_cpu_node(struct device_node *dp, int *cur_inst,
                          void *compare_arg,
                          struct device_node **dev_node, int *mid)
 {
-       if (strcmp(dp->type, "cpu"))
-               return -ENODEV;
-
        if (!compare(dp, *cur_inst, compare_arg)) {
                if (dev_node)
                        *dev_node = dp;
index 75684b56767e099a48556ed95645a1cf35df7942..c8e9dc9d68a9758c62d8e6efc7b5e0a02d88a8e4 100644 (file)
@@ -551,9 +551,10 @@ setup_trap_table:
        save    %sp, -192, %sp
 
        /* Force interrupts to be disabled. */
-       rdpr    %pstate, %o1
-       andn    %o1, PSTATE_IE, %o1
+       rdpr    %pstate, %l0
+       andn    %l0, PSTATE_IE, %o1
        wrpr    %o1, 0x0, %pstate
+       rdpr    %pil, %l1
        wrpr    %g0, 15, %pil
 
        /* Make the firmware call to jump over to the Linux trap table.  */
@@ -622,11 +623,9 @@ setup_trap_table:
        call    init_irqwork_curcpu
         nop
 
-       /* Now we can turn interrupts back on. */
-       rdpr    %pstate, %o1
-       or      %o1, PSTATE_IE, %o1
-       wrpr    %o1, 0, %pstate
-       wrpr    %g0, 0x0, %pil
+       /* Now we can restore interrupt state. */
+       wrpr    %l0, 0, %pstate
+       wrpr    %l1, 0x0, %pil
 
        ret
         restore
index 7064cee290ae15d78b8888429660fc9caba9d399..238bbf6de07d1603b5ab7e225442ef1eabab2177 100644 (file)
@@ -542,9 +542,17 @@ static void __init build_device_resources(struct of_device *op,
        /* Convert to num-cells.  */
        num_reg /= 4;
 
-       /* Conver to num-entries.  */
+       /* Convert to num-entries.  */
        num_reg /= na + ns;
 
+       /* Prevent overruning the op->resources[] array.  */
+       if (num_reg > PROMREG_MAX) {
+               printk(KERN_WARNING "%s: Too many regs (%d), "
+                      "limiting to %d.\n",
+                      op->node->full_name, num_reg, PROMREG_MAX);
+               num_reg = PROMREG_MAX;
+       }
+
        for (index = 0; index < num_reg; index++) {
                struct resource *r = &op->resource[index];
                u32 addr[OF_MAX_ADDR_CELLS];
@@ -650,8 +658,22 @@ apply_interrupt_map(struct device_node *dp, struct device_node *pp,
        next:
                imap += (na + 3);
        }
-       if (i == imlen)
+       if (i == imlen) {
+               /* Psycho and Sabre PCI controllers can have 'interrupt-map'
+                * properties that do not include the on-board device
+                * interrupts.  Instead, the device's 'interrupts' property
+                * is already a fully specified INO value.
+                *
+                * Handle this by deciding that, if we didn't get a
+                * match in the parent's 'interrupt-map', and the
+                * parent is an IRQ translater, then use the parent as
+                * our IRQ controller.
+                */
+               if (pp->irq_trans)
+                       return pp;
+
                return NULL;
+       }
 
        *irq_p = irq;
        cp = of_find_node_by_phandle(handle);
@@ -803,6 +825,14 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
                op->num_irqs = 0;
        }
 
+       /* Prevent overruning the op->irqs[] array.  */
+       if (op->num_irqs > PROMINTR_MAX) {
+               printk(KERN_WARNING "%s: Too many irqs (%d), "
+                      "limiting to %d.\n",
+                      dp->full_name, op->num_irqs, PROMINTR_MAX);
+               op->num_irqs = PROMINTR_MAX;
+       }
+
        build_device_resources(op, parent);
        for (i = 0; i < op->num_irqs; i++)
                op->irqs[i] = build_one_device_irq(op, parent, op->irqs[i]);
index 197a7ffd57ee32dc8635644be48e5c71fe02317b..1ec0aab68c08079d5d7204c770496c019086c416 100644 (file)
@@ -1099,9 +1099,6 @@ static void pbm_register_toplevel_resources(struct pci_controller_info *p,
 {
        char *name = pbm->name;
 
-       sprintf(name, "PSYCHO%d PBM%c",
-               p->index,
-               (pbm == &p->pbm_A ? 'A' : 'B'));
        pbm->io_space.name = pbm->mem_space.name = name;
 
        request_resource(&ioport_resource, &pbm->io_space);
@@ -1203,12 +1200,13 @@ static void psycho_pbm_init(struct pci_controller_info *p,
        pbm->io_space.flags = IORESOURCE_IO;
        pbm->mem_space.end = pbm->mem_space.start + PSYCHO_MEMSPACE_SIZE;
        pbm->mem_space.flags = IORESOURCE_MEM;
-       pbm_register_toplevel_resources(p, pbm);
 
        pbm->parent = p;
        pbm->prom_node = dp;
        pbm->name = dp->full_name;
 
+       pbm_register_toplevel_resources(p, pbm);
+
        printk("%s: PSYCHO PCI Bus Module ver[%x:%x]\n",
               pbm->name,
               pbm->chip_version, pbm->chip_revision);
index c86007a2aa3f251493606edb38a37edea7298b0d..5cc5ab63293fa912188053b8d7a9a360e60fd3e5 100644 (file)
@@ -344,10 +344,12 @@ static unsigned long __psycho_onboard_imap_off[] = {
 /*0x2f*/       PSYCHO_IMAP_CE,
 /*0x30*/       PSYCHO_IMAP_A_ERR,
 /*0x31*/       PSYCHO_IMAP_B_ERR,
-/*0x32*/       PSYCHO_IMAP_PMGMT
+/*0x32*/       PSYCHO_IMAP_PMGMT,
+/*0x33*/       PSYCHO_IMAP_GFX,
+/*0x34*/       PSYCHO_IMAP_EUPA,
 };
 #define PSYCHO_ONBOARD_IRQ_BASE                0x20
-#define PSYCHO_ONBOARD_IRQ_LAST                0x32
+#define PSYCHO_ONBOARD_IRQ_LAST                0x34
 #define psycho_onboard_imap_offset(__ino) \
        __psycho_onboard_imap_off[(__ino) - PSYCHO_ONBOARD_IRQ_BASE]
 
@@ -529,6 +531,10 @@ static unsigned long __sabre_onboard_imap_off[] = {
 /*0x2e*/       SABRE_IMAP_UE,
 /*0x2f*/       SABRE_IMAP_CE,
 /*0x30*/       SABRE_IMAP_PCIERR,
+/*0x31*/       0 /* reserved */,
+/*0x32*/       0 /* reserved */,
+/*0x33*/       SABRE_IMAP_GFX,
+/*0x34*/       SABRE_IMAP_EUPA,
 };
 #define SABRE_ONBOARD_IRQ_BASE         0x20
 #define SABRE_ONBOARD_IRQ_LAST         0x30
@@ -895,6 +901,8 @@ static unsigned long sysio_irq_offsets[] = {
        SYSIO_IMAP_CE,
        SYSIO_IMAP_SBERR,
        SYSIO_IMAP_PMGMT,
+       SYSIO_IMAP_GFX,
+       SYSIO_IMAP_EUPA,
 };
 
 #undef bogon
index 237524d87cab9149fe920ef501e6ac4b7f77fbb3..beffc82a1e85a632a27f4b0095c2005b60e478d2 100644 (file)
@@ -254,7 +254,6 @@ EXPORT_SYMBOL(prom_getproperty);
 EXPORT_SYMBOL(prom_node_has_property);
 EXPORT_SYMBOL(prom_setprop);
 EXPORT_SYMBOL(saved_command_line);
-EXPORT_SYMBOL(prom_getname);
 EXPORT_SYMBOL(prom_finddevice);
 EXPORT_SYMBOL(prom_feval);
 EXPORT_SYMBOL(prom_getbool);
index 51c056df528eb2f1f7a1687bfc8a4e172fa2952a..054d0abdb7eef49ad2db9f0a8eea114029dc7a94 100644 (file)
@@ -701,21 +701,21 @@ extern void check_pending(int signum);
 
 asmlinkage long sys_getdomainname(char __user *name, int len)
 {
-        int nlen;
-       int err = -EFAULT;
+        int nlen, err;
+
+       if (len < 0 || len > __NEW_UTS_LEN)
+               return -EINVAL;
 
        down_read(&uts_sem);
        
        nlen = strlen(system_utsname.domainname) + 1;
-
         if (nlen < len)
                 len = nlen;
-       if (len > __NEW_UTS_LEN)
-               goto done;
-       if (copy_to_user(name, system_utsname.domainname, len))
-               goto done;
-       err = 0;
-done:
+
+       err = -EFAULT;
+       if (!copy_to_user(name, system_utsname.domainname, len))
+               err = 0;
+
        up_read(&uts_sem);
        return err;
 }
index b43de647ba73187dee153f261f9cd7b136728c80..094d3e35be183ac8737ac5168a4202c563614370 100644 (file)
@@ -928,8 +928,6 @@ static void sparc64_start_timers(void)
        __asm__ __volatile__("wrpr      %0, 0x0, %%pstate"
                             : /* no outputs */
                             : "r" (pstate));
-
-       local_irq_enable();
 }
 
 struct freq_table {
index 1605967cce91c1a076a482a56cb9cf399ebc204e..55ae802dc0ad6ffd6c06b9bd12e860f9a777267b 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/kprobes.h>
+#include <linux/kallsyms.h>
 
 #include <asm/page.h>
 #include <asm/pgtable.h>
@@ -132,6 +133,8 @@ static void bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr)
 
        printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n",
               regs->tpc);
+       printk(KERN_CRIT "OOPS: RPC [%016lx]\n", regs->u_regs[15]);
+       print_symbol("RPC: <%s>\n", regs->u_regs[15]);
        printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr);
        __asm__("mov %%sp, %0" : "=r" (ksp));
        show_stack(current, ksp);
index 49075abd7cbc2d08394f47df7e71e906ff976fed..500f05e2cfcb655af8ba1deeb0ae224192b560b9 100644 (file)
@@ -193,91 +193,6 @@ prom_searchsiblings(int node_start, const char *nodename)
        return 0;
 }
 
-/* Gets name in the {name@x,yyyyy|name (if no reg)} form */
-int 
-prom_getname (int node, char *buffer, int len)
-{
-       int i, sbus = 0;
-       int pci = 0, ebus = 0, ide = 0;
-       struct linux_prom_registers *reg;
-       struct linux_prom64_registers reg64[PROMREG_MAX];
-       
-       for (sbus = prom_getparent (node); sbus; sbus = prom_getparent (sbus)) {
-               i = prom_getproperty (sbus, "name", buffer, len);
-               if (i > 0) {
-                       buffer [i] = 0;
-                       if (!strcmp (buffer, "sbus"))
-                               goto getit;
-               }
-       }
-       if ((pci = prom_getparent (node))) {
-               i = prom_getproperty (pci, "name", buffer, len);
-               if (i > 0) {
-                       buffer [i] = 0;
-                       if (!strcmp (buffer, "pci"))
-                               goto getit;
-               }
-               pci = 0;
-       }
-       if ((ebus = prom_getparent (node))) {
-               i = prom_getproperty (ebus, "name", buffer, len);
-               if (i > 0) {
-                       buffer[i] = 0;
-                       if (!strcmp (buffer, "ebus"))
-                               goto getit;
-               }
-               ebus = 0;
-       }
-       if ((ide = prom_getparent (node))) {
-               i = prom_getproperty (ide, "name", buffer, len);
-               if (i > 0) {
-                       buffer [i] = 0;
-                       if (!strcmp (buffer, "ide"))
-                               goto getit;
-               }
-               ide = 0;
-       }
-getit:
-       i = prom_getproperty (node, "name", buffer, len);
-       if (i <= 0) {
-               buffer [0] = 0;
-               return -1;
-       }
-       buffer [i] = 0;
-       len -= i;
-       i = prom_getproperty (node, "reg", (char *)reg64, sizeof (reg64));
-       if (i <= 0) return 0;
-       if (len < 16) return -1;
-       buffer = strchr (buffer, 0);
-       if (sbus) {
-               reg = (struct linux_prom_registers *)reg64;
-               sprintf (buffer, "@%x,%x", reg[0].which_io, (uint)reg[0].phys_addr);
-       } else if (pci) {
-               int dev, fn;
-               reg = (struct linux_prom_registers *)reg64;
-               fn = (reg[0].which_io >> 8) & 0x07;
-               dev = (reg[0].which_io >> 11) & 0x1f;
-               if (fn)
-                       sprintf (buffer, "@%x,%x", dev, fn);
-               else
-                       sprintf (buffer, "@%x", dev);
-       } else if (ebus) {
-               reg = (struct linux_prom_registers *)reg64;
-               sprintf (buffer, "@%x,%x", reg[0].which_io, reg[0].phys_addr);
-       } else if (ide) {
-               reg = (struct linux_prom_registers *)reg64;
-               sprintf (buffer, "@%x,%x", reg[0].which_io, reg[0].phys_addr);
-       } else if (i == 4) {    /* Happens on 8042's children on Ultra/PCI. */
-               reg = (struct linux_prom_registers *)reg64;
-               sprintf (buffer, "@%x", reg[0].which_io);
-       } else {
-               sprintf (buffer, "@%x,%x",
-                        (unsigned int)(reg64[0].phys_addr >> 36),
-                        (unsigned int)(reg64[0].phys_addr));
-       }
-       return 0;
-}
-
 /* Return the first property type for node 'node'.
  * buffer should be at least 32B in length
  */
index dffd1184c956cca4314eb4c1127f30cbaf373185..9558a7cf34d599f8eda369838ffda69bba6ec646 100644 (file)
@@ -11,6 +11,7 @@ USER_CFLAGS += -fno-builtin -m64
 CHECKFLAGS  += -m64
 AFLAGS += -m64
 LDFLAGS += -m elf_x86_64
+CPPFLAGS += -m64
 
 ELF_ARCH := i386:x86-64
 ELF_FORMAT := elf64-x86-64
index 8e7053013f7b7d11d218603487abf8c9dcd96294..1b5c0131a12ec7b321983e2bd5b1e23c93828399 100644 (file)
@@ -8,8 +8,8 @@
        longjmp(*buf, val);     \
 } while(0)
 
-#define UML_SETJMP(buf, enable) ({ \
-       int n; \
+#define UML_SETJMP(buf) ({ \
+       int n, enable;     \
        enable = get_signals(); \
        n = setjmp(*buf); \
        if(n != 0) \
index b6c52496e15a3d86e23018f1cc3aa6ff3e55c4da..5316e8a4a4fdee933a96ef47c9be7416a005e269 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
  * Licensed under the GPL
  */
@@ -15,9 +15,9 @@
 #include "irq_user.h"
 #include "sysdep/tls.h"
 
-#define OS_TYPE_FILE 1 
-#define OS_TYPE_DIR 2 
-#define OS_TYPE_SYMLINK 3 
+#define OS_TYPE_FILE 1
+#define OS_TYPE_DIR 2
+#define OS_TYPE_SYMLINK 3
 #define OS_TYPE_CHARDEV 4
 #define OS_TYPE_BLOCKDEV 5
 #define OS_TYPE_FIFO 6
@@ -61,68 +61,68 @@ struct openflags {
 };
 
 #define OPENFLAGS() ((struct openflags) { .r = 0, .w = 0, .s = 0, .c = 0, \
-                                         .t = 0, .a = 0, .e = 0, .cl = 0 })
+                                         .t = 0, .a = 0, .e = 0, .cl = 0 })
 
 static inline struct openflags of_read(struct openflags flags)
 {
-       flags.r = 1; 
-       return(flags);
+       flags.r = 1;
+       return flags;
 }
 
 static inline struct openflags of_write(struct openflags flags)
 {
-       flags.w = 1; 
-       return(flags); 
+       flags.w = 1;
+       return flags;
 }
 
 static inline struct openflags of_rdwr(struct openflags flags)
 {
-       return(of_read(of_write(flags)));
+       return of_read(of_write(flags));
 }
 
 static inline struct openflags of_set_rw(struct openflags flags, int r, int w)
 {
        flags.r = r;
        flags.w = w;
-       return(flags);
+       return flags;
 }
 
 static inline struct openflags of_sync(struct openflags flags)
-{ 
-       flags.s = 1; 
-       return(flags); 
+{
+       flags.s = 1;
+       return flags;
 }
 
 static inline struct openflags of_create(struct openflags flags)
-{ 
-       flags.c = 1; 
-       return(flags); 
+{
+       flags.c = 1;
+       return flags;
 }
+
 static inline struct openflags of_trunc(struct openflags flags)
-{ 
-       flags.t = 1; 
-       return(flags); 
+{
+       flags.t = 1;
+       return flags;
 }
+
 static inline struct openflags of_append(struct openflags flags)
-{ 
-       flags.a = 1; 
-       return(flags); 
+{
+       flags.a = 1;
+       return flags;
 }
+
 static inline struct openflags of_excl(struct openflags flags)
-{ 
-       flags.e = 1; 
-       return(flags); 
+{
+       flags.e = 1;
+       return flags;
 }
 
 static inline struct openflags of_cloexec(struct openflags flags)
-{ 
-       flags.cl = 1; 
-       return(flags); 
+{
+       flags.cl = 1;
+       return flags;
 }
-  
+
 /* file.c */
 extern int os_stat_file(const char *file_name, struct uml_stat *buf);
 extern int os_stat_fd(const int fd, struct uml_stat *buf);
@@ -204,7 +204,7 @@ extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr);
 
 extern int os_map_memory(void *virt, int fd, unsigned long long off,
                         unsigned long len, int r, int w, int x);
-extern int os_protect_memory(void *addr, unsigned long len, 
+extern int os_protect_memory(void *addr, unsigned long len,
                             int r, int w, int x);
 extern int os_unmap_memory(void *addr, int len);
 extern int os_drop_memory(void *addr, int length);
index abf14aaf905ffb2fda7789ccbfab5779122f91e8..48cf88dd02d4daaf94c0aca862065eb9abeb8388 100644 (file)
@@ -110,7 +110,7 @@ long sys_uname(struct old_utsname __user * name)
        if (!name)
                return -EFAULT;
        down_read(&uts_sem);
-       err = copy_to_user(name, utsname(), sizeof (*name));
+       err = copy_to_user(name, &system_utsname, sizeof (*name));
        up_read(&uts_sem);
        return err?-EFAULT:0;
 }
@@ -126,21 +126,21 @@ long sys_olduname(struct oldold_utsname __user * name)
 
        down_read(&uts_sem);
 
-       error = __copy_to_user(&name->sysname, &utsname()->sysname,
+       error = __copy_to_user(&name->sysname,&system_utsname.sysname,
                               __OLD_UTS_LEN);
-       error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
-       error |= __copy_to_user(&name->nodename, &utsname()->nodename,
+       error |= __put_user(0,name->sysname+__OLD_UTS_LEN);
+       error |= __copy_to_user(&name->nodename,&system_utsname.nodename,
                                __OLD_UTS_LEN);
-       error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
-       error |= __copy_to_user(&name->release, &utsname()->release,
+       error |= __put_user(0,name->nodename+__OLD_UTS_LEN);
+       error |= __copy_to_user(&name->release,&system_utsname.release,
                                __OLD_UTS_LEN);
-       error |= __put_user(0, name->release + __OLD_UTS_LEN);
-       error |= __copy_to_user(&name->version, &utsname()->version,
+       error |= __put_user(0,name->release+__OLD_UTS_LEN);
+       error |= __copy_to_user(&name->version,&system_utsname.version,
                                __OLD_UTS_LEN);
-       error |= __put_user(0, name->version + __OLD_UTS_LEN);
-       error |= __copy_to_user(&name->machine, &utsname()->machine,
+       error |= __put_user(0,name->version+__OLD_UTS_LEN);
+       error |= __copy_to_user(&name->machine,&system_utsname.machine,
                                __OLD_UTS_LEN);
-       error |= __put_user(0, name->machine + __OLD_UTS_LEN);
+       error |= __put_user(0,name->machine+__OLD_UTS_LEN);
 
        up_read(&uts_sem);
 
index 72acdce205e0a3eff5d6ae6cdbdd73a20c22a952..f8aeb448aab62ba76584f9c0e497e1897e490c6b 100644 (file)
@@ -1,5 +1,3 @@
-/* in case the preprocessor is a 32bit one */
-#undef i386
 #ifdef CONFIG_LD_SCRIPT_STATIC
 #include "uml.lds.S"
 #else
index b1cda818f5b5755e5ae601c2a39ee3b35f143816..b98d3ca2cd1bdb5dba29e45aa6682c729f3425fc 100644 (file)
@@ -273,12 +273,12 @@ void init_new_thread_signals(void)
 int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr)
 {
        jmp_buf buf;
-       int n, enable;
+       int n;
 
        *jmp_ptr = &buf;
-       n = UML_SETJMP(&buf, enable);
+       n = UML_SETJMP(&buf);
        if(n != 0)
-               return(n);
+               return n;
        (*fn)(arg);
-       return(0);
+       return 0;
 }
index bf35572d9cfa6e319976ce6fba4c05fdd2d3b2ce..7baf90fda58b971115a3becea1aef4e45e427ffd 100644 (file)
@@ -435,7 +435,6 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
 {
        unsigned long flags;
        jmp_buf switch_buf, fork_buf;
-       int enable;
 
        *switch_buf_ptr = &switch_buf;
        *fork_buf_ptr = &fork_buf;
@@ -450,7 +449,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
         */
        flags = get_signals();
        block_signals();
-       if(UML_SETJMP(&fork_buf, enable) == 0)
+       if(UML_SETJMP(&fork_buf) == 0)
                new_thread_proc(stack, handler);
 
        remove_sigstack();
@@ -467,21 +466,19 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
 void thread_wait(void *sw, void *fb)
 {
        jmp_buf buf, **switch_buf = sw, *fork_buf;
-       int enable;
 
        *switch_buf = &buf;
        fork_buf = fb;
-       if(UML_SETJMP(&buf, enable) == 0)
+       if(UML_SETJMP(&buf) == 0)
                siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK);
 }
 
 void switch_threads(void *me, void *next)
 {
        jmp_buf my_buf, **me_ptr = me, *next_buf = next;
-       int enable;
 
        *me_ptr = &my_buf;
-       if(UML_SETJMP(&my_buf, enable) == 0)
+       if(UML_SETJMP(&my_buf) == 0)
                UML_LONGJMP(next_buf, 1);
 }
 
@@ -495,14 +492,14 @@ static jmp_buf *cb_back;
 int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
 {
        jmp_buf **switch_buf = switch_buf_ptr;
-       int n, enable;
+       int n;
 
        set_handler(SIGWINCH, (__sighandler_t) sig_handler,
                    SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGALRM,
                    SIGVTALRM, -1);
 
        *fork_buf_ptr = &initial_jmpbuf;
-       n = UML_SETJMP(&initial_jmpbuf, enable);
+       n = UML_SETJMP(&initial_jmpbuf);
        switch(n){
        case INIT_JMP_NEW_THREAD:
                new_thread_proc((void *) stack, new_thread_handler);
@@ -529,14 +526,13 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
 void initial_thread_cb_skas(void (*proc)(void *), void *arg)
 {
        jmp_buf here;
-       int enable;
 
        cb_proc = proc;
        cb_arg = arg;
        cb_back = &here;
 
        block_signals();
-       if(UML_SETJMP(&here, enable) == 0)
+       if(UML_SETJMP(&here) == 0)
                UML_LONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK);
        unblock_signals();
 
index e523719330b27cb2b0a29bd1dacbf15bc8b1ca05..865f6a6a25905924d3f17ab6a449451cd73ebb9c 100644 (file)
@@ -14,11 +14,10 @@ unsigned long __do_user_copy(void *to, const void *from, int n,
                                        int n), int *faulted_out)
 {
        unsigned long *faddrp = (unsigned long *) fault_addr, ret;
-       int enable;
 
        jmp_buf jbuf;
        *fault_catcher = &jbuf;
-       if(UML_SETJMP(&jbuf, enable) == 0){
+       if(UML_SETJMP(&jbuf) == 0){
                (*op)(to, from, n);
                ret = 0;
                *faulted_out = 0;
index 83d389b8ebd80f8f3eddb23a2b5cc802f6284136..840d5d93d5cc9f3447c844f1a4eef8e6f6ffef87 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17-git22
-# Tue Jul  4 14:24:40 2006
+# Linux kernel version: 2.6.18-rc2
+# Tue Jul 18 17:13:20 2006
 #
 CONFIG_X86_64=y
 CONFIG_64BIT=y
@@ -37,6 +37,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
@@ -413,6 +414,7 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
@@ -1195,7 +1197,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
-# CONFIG_USB_CY7C63 is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_PHIDGETKIT is not set
 # CONFIG_USB_PHIDGETSERVO is not set
@@ -1373,7 +1375,6 @@ CONFIG_SUNRPC=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
-# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
index 9b5bb413a6e938ea1efe0c41327563e07547774d..5d4a7d125ed0bbd9cbc0729290b25475b3a1534d 100644 (file)
@@ -103,7 +103,7 @@ ENTRY(ia32_sysenter_target)
        pushq   %rax
        CFI_ADJUST_CFA_OFFSET 8
        cld
-       SAVE_ARGS 0,0,1
+       SAVE_ARGS 0,0,0
        /* no need to do an access_ok check here because rbp has been
           32bit zero extended */ 
 1:     movl    (%rbp),%r9d
index e71ed53b08fb7bad84aa3f852504d1291237f249..146924ba5df5b5d86ec3aea9b2a1edddc17f83e8 100644 (file)
@@ -85,7 +85,8 @@
 #define CSR_AGENT_MASK         0xffe0ffff
 
 #define MAX_NUM_OF_PHBS                8 /* how many PHBs in total? */
-#define MAX_PHB_BUS_NUM                (MAX_NUM_OF_PHBS * 2) /* max dev->bus->number */
+#define MAX_NUM_CHASSIS                8 /* max number of chassis */
+#define MAX_PHB_BUS_NUM                (MAX_NUM_OF_PHBS * MAX_NUM_CHASSIS * 2) /* max dev->bus->number */
 #define PHBS_PER_CALGARY       4
 
 /* register offsets in Calgary's internal register space */
@@ -110,7 +111,8 @@ static const unsigned long phb_offsets[] = {
        0xB000 /* PHB3 */
 };
 
-void* tce_table_kva[MAX_NUM_OF_PHBS * MAX_NUMNODES];
+static char bus_to_phb[MAX_PHB_BUS_NUM];
+void* tce_table_kva[MAX_PHB_BUS_NUM];
 unsigned int specified_table_size = TCE_TABLE_SIZE_UNSPECIFIED;
 static int translate_empty_slots __read_mostly = 0;
 static int calgary_detected __read_mostly = 0;
@@ -119,7 +121,7 @@ static int calgary_detected __read_mostly = 0;
  * the bitmap of PHBs the user requested that we disable
  * translation on.
  */
-static DECLARE_BITMAP(translation_disabled, MAX_NUMNODES * MAX_PHB_BUS_NUM);
+static DECLARE_BITMAP(translation_disabled, MAX_PHB_BUS_NUM);
 
 static void tce_cache_blast(struct iommu_table *tbl);
 
@@ -452,7 +454,7 @@ static struct dma_mapping_ops calgary_dma_ops = {
 
 static inline int busno_to_phbid(unsigned char num)
 {
-       return bus_to_phb(num) % PHBS_PER_CALGARY;
+       return bus_to_phb[num];
 }
 
 static inline unsigned long split_queue_offset(unsigned char num)
@@ -812,7 +814,7 @@ static int __init calgary_init(void)
        int i, ret = -ENODEV;
        struct pci_dev *dev = NULL;
 
-       for (i = 0; i <= num_online_nodes() * MAX_NUM_OF_PHBS; i++) {
+       for (i = 0; i < MAX_PHB_BUS_NUM; i++) {
                dev = pci_get_device(PCI_VENDOR_ID_IBM,
                                     PCI_DEVICE_ID_IBM_CALGARY,
                                     dev);
@@ -822,7 +824,7 @@ static int __init calgary_init(void)
                        calgary_init_one_nontraslated(dev);
                        continue;
                }
-               if (!tce_table_kva[i] && !translate_empty_slots) {
+               if (!tce_table_kva[dev->bus->number] && !translate_empty_slots) {
                        pci_dev_put(dev);
                        continue;
                }
@@ -842,7 +844,7 @@ error:
                        pci_dev_put(dev);
                        continue;
                }
-               if (!tce_table_kva[i] && !translate_empty_slots)
+               if (!tce_table_kva[dev->bus->number] && !translate_empty_slots)
                        continue;
                calgary_disable_translation(dev);
                calgary_free_tar(dev);
@@ -876,9 +878,10 @@ static inline int __init determine_tce_table_size(u64 ram)
 void __init detect_calgary(void)
 {
        u32 val;
-       int bus, table_idx;
+       int bus;
        void *tbl;
-       int detected = 0;
+       int calgary_found = 0;
+       int phb = -1;
 
        /*
         * if the user specified iommu=off or iommu=soft or we found
@@ -889,38 +892,46 @@ void __init detect_calgary(void)
 
        specified_table_size = determine_tce_table_size(end_pfn * PAGE_SIZE);
 
-       for (bus = 0, table_idx = 0;
-            bus <= num_online_nodes() * MAX_PHB_BUS_NUM;
-            bus++) {
-               BUG_ON(bus > MAX_NUMNODES * MAX_PHB_BUS_NUM);
+       for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) {
+               int dev;
+
+               tce_table_kva[bus] = NULL;
+               bus_to_phb[bus] = -1;
+
                if (read_pci_config(bus, 0, 0, 0) != PCI_VENDOR_DEVICE_ID_CALGARY)
                        continue;
+
+               /*
+                * There are 4 PHBs per Calgary chip.  Set phb to which phb (0-3)
+                * it is connected to releative to the clagary chip.
+                */
+               phb = (phb + 1) % PHBS_PER_CALGARY;
+
                if (test_bit(bus, translation_disabled)) {
                        printk(KERN_INFO "Calgary: translation is disabled for "
                               "PHB 0x%x\n", bus);
                        /* skip this phb, don't allocate a tbl for it */
-                       tce_table_kva[table_idx] = NULL;
-                       table_idx++;
                        continue;
                }
                /*
-                * scan the first slot of the PCI bus to see if there
-                * are any devices present
+                * Scan the slots of the PCI bus to see if there is a device present.
+                * The parent bus will be the zero-ith device, so start at 1.
                 */
-               val = read_pci_config(bus, 1, 0, 0);
-               if (val != 0xffffffff || translate_empty_slots) {
-                       tbl = alloc_tce_table();
-                       if (!tbl)
-                               goto cleanup;
-                       detected = 1;
-               } else
-                       tbl = NULL;
-
-               tce_table_kva[table_idx] = tbl;
-               table_idx++;
+               for (dev = 1; dev < 8; dev++) {
+                       val = read_pci_config(bus, dev, 0, 0);
+                       if (val != 0xffffffff || translate_empty_slots) {
+                               tbl = alloc_tce_table();
+                               if (!tbl)
+                                       goto cleanup;
+                               tce_table_kva[bus] = tbl;
+                               bus_to_phb[bus] = phb;
+                               calgary_found = 1;
+                               break;
+                       }
+               }
        }
 
-       if (detected) {
+       if (calgary_found) {
                iommu_detected = 1;
                calgary_detected = 1;
                printk(KERN_INFO "PCI-DMA: Calgary IOMMU detected. "
@@ -929,9 +940,9 @@ void __init detect_calgary(void)
        return;
 
 cleanup:
-       for (--table_idx; table_idx >= 0; --table_idx)
-               if (tce_table_kva[table_idx])
-                       free_tce_table(tce_table_kva[table_idx]);
+       for (--bus; bus >= 0; --bus)
+               if (tce_table_kva[bus])
+                       free_tce_table(tce_table_kva[bus]);
 }
 
 int __init calgary_iommu_init(void)
@@ -1002,7 +1013,7 @@ static int __init calgary_parse_options(char *p)
                        if (p == endp)
                                break;
 
-                       if (bridge <= (num_online_nodes() * MAX_PHB_BUS_NUM)) {
+                       if (bridge < MAX_PHB_BUS_NUM) {
                                printk(KERN_INFO "Calgary: disabling "
                                       "translation for PHB 0x%x\n", bridge);
                                set_bit(bridge, translation_disabled);
index ebdb77fe20573702facc612fd1262ab3e3d93ade..6a55f87ba97f917ed2814bc3c11c3f21a3ad096b 100644 (file)
@@ -31,9 +31,10 @@ struct dma_mapping_ops swiotlb_dma_ops = {
 void pci_swiotlb_init(void)
 {
        /* don't initialize swiotlb if iommu=off (no_iommu=1) */
-       if (!iommu_detected && !no_iommu &&
-           (end_pfn > MAX_DMA32_PFN || force_iommu))
+       if (!iommu_detected && !no_iommu && end_pfn > MAX_DMA32_PFN)
               swiotlb = 1;
+       if (swiotlb_force)
+               swiotlb = 1;
        if (swiotlb) {
                printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
                swiotlb_init();
index d3a9e79e954c43aaf8bd873be430a57448382c61..5530dda3f27ac3b84ec63a6e4f96662f4f50abc3 100644 (file)
@@ -96,7 +96,6 @@ static inline unsigned int table_size_to_number_of_entries(unsigned char size)
 static int tce_table_setparms(struct pci_dev *dev, struct iommu_table *tbl)
 {
        unsigned int bitmapsz;
-       unsigned int tce_table_index;
        unsigned long bmppages;
        int ret;
 
@@ -105,8 +104,7 @@ static int tce_table_setparms(struct pci_dev *dev, struct iommu_table *tbl)
        /* set the tce table size - measured in entries */
        tbl->it_size = table_size_to_number_of_entries(specified_table_size);
 
-       tce_table_index = bus_to_phb(tbl->it_busno);
-       tbl->it_base = (unsigned long)tce_table_kva[tce_table_index];
+       tbl->it_base = (unsigned long)tce_table_kva[dev->bus->number];
        if (!tbl->it_base) {
                printk(KERN_ERR "Calgary: iommu_table_setparms: "
                       "no table allocated?!\n");
index b9ff75992c16d85b8fd1c7b7a2118c7d6847087b..7a9b18224182ced7cd0932b2691249c69f70e4ad 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/acpi.h>
 #ifdef CONFIG_ACPI
 #include <acpi/achware.h>      /* for PM timer frequency */
+#include <acpi/acpi_bus.h>
 #endif
 #include <asm/8253pit.h>
 #include <asm/pgtable.h>
@@ -193,7 +194,7 @@ unsigned long profile_pc(struct pt_regs *regs)
           is just accounted to the spinlock function.
           Better would be to write these functions in assembler again
           and check exactly. */
-       if (in_lock_functions(pc)) {
+       if (!user_mode(regs) && in_lock_functions(pc)) {
                char *v = *(char **)regs->rsp;
                if ((v >= _stext && v <= _etext) ||
                        (v >= _sinittext && v <= _einittext) ||
@@ -953,11 +954,18 @@ __cpuinit int unsynchronized_tsc(void)
 #ifdef CONFIG_SMP
        if (apic_is_clustered_box())
                return 1;
-       /* Intel systems are normally all synchronized. Exceptions
-          are handled in the check above. */
-       if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
-               return 0;
 #endif
+       /* Most intel systems have synchronized TSCs except for
+          multi node systems */
+       if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
+#ifdef CONFIG_ACPI
+               /* But TSC doesn't tick in C3 so don't use it there */
+               if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 100)
+                       return 1;
+#endif
+               return 0;
+       }
+
        /* Assume multi socket systems are not synchronized */
        return num_present_cpus() > 1;
 }
index eb39a2775236428a405aeda04227d15be93b8b27..f7a9d1421078648304f243347bc3f6238428488b 100644 (file)
@@ -254,7 +254,6 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
 {
        const unsigned cpu = safe_smp_processor_id();
        unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr;
-       int i = 11;
        unsigned used = 0;
 
        printk("\nCall Trace:\n");
@@ -275,11 +274,20 @@ void show_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long * s
                        if (unwind_init_blocked(&info, tsk) == 0)
                                unw_ret = show_trace_unwind(&info, NULL);
                }
-               if (unw_ret > 0) {
-                       if (call_trace > 0)
+               if (unw_ret > 0 && !arch_unw_user_mode(&info)) {
+#ifdef CONFIG_STACK_UNWIND
+                       unsigned long rip = info.regs.rip;
+                       print_symbol("DWARF2 unwinder stuck at %s\n", rip);
+                       if (call_trace == 1) {
+                               printk("Leftover inexact backtrace:\n");
+                               stack = (unsigned long *)info.regs.rsp;
+                       } else if (call_trace > 1)
                                return;
-                       printk("Legacy call trace:");
-                       i = 18;
+                       else
+                               printk("Full inexact backtrace again:\n");
+#else
+                       printk("Inexact backtrace:\n");
+#endif
                }
        }
 
@@ -1118,8 +1126,10 @@ static int __init call_trace_setup(char *s)
                call_trace = -1;
        else if (strcmp(s, "both") == 0)
                call_trace = 0;
-       else if (strcmp(s, "new") == 0)
+       else if (strcmp(s, "newfallback") == 0)
                call_trace = 1;
+       else if (strcmp(s, "new") == 0)
+               call_trace = 2;
        return 1;
 }
 __setup("call_trace=", call_trace_setup);
index b50a7c7c47f8984b45329d07447a5b9cbb1447d3..3acf60ded2a0b54144a72b5b0faf5f8bc2c00933 100644 (file)
@@ -2,7 +2,6 @@
 #include <linux/pci.h>
 #include <asm/mpspec.h>
 #include <linux/cpumask.h>
-#include <asm/k8.h>
 
 /*
  * This discovers the pcibus <-> node mapping on AMD K8.
@@ -19,6 +18,7 @@
 #define NR_LDT_BUS_NUMBER_REGISTERS 3
 #define SECONDARY_LDT_BUS_NUMBER(dword) ((dword >> 8) & 0xFF)
 #define SUBORDINATE_LDT_BUS_NUMBER(dword) ((dword >> 16) & 0xFF)
+#define PCI_DEVICE_ID_K8HTCONFIG 0x1100
 
 /**
  * fill_mp_bus_to_cpumask()
@@ -28,7 +28,8 @@
 __init static int
 fill_mp_bus_to_cpumask(void)
 {
-       int i, j, k;
+       struct pci_dev *nb_dev = NULL;
+       int i, j;
        u32 ldtbus, nid;
        static int lbnr[3] = {
                LDT_BUS_NUMBER_REGISTER_0,
@@ -36,9 +37,8 @@ fill_mp_bus_to_cpumask(void)
                LDT_BUS_NUMBER_REGISTER_2
        };
 
-       cache_k8_northbridges();
-       for (k = 0; k < num_k8_northbridges; k++) {
-               struct pci_dev *nb_dev = k8_northbridges[k];
+       while ((nb_dev = pci_get_device(PCI_VENDOR_ID_AMD,
+                       PCI_DEVICE_ID_K8HTCONFIG, nb_dev))) {
                pci_read_config_dword(nb_dev, NODE_ID_REGISTER, &nid);
 
                for (i = 0; i < NR_LDT_BUS_NUMBER_REGISTERS; i++) {
index b8c0702777ff4e1bb2557567a7aa7f6d987bb6eb..265f7a830619ef1e5de60bfe1179fa9d3a002229 100644 (file)
@@ -80,7 +80,7 @@ static u32 bio_act[5] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_AC
 #define trace_sync_bit(rw)     \
        (((rw) & (1 << BIO_RW_SYNC)) >> (BIO_RW_SYNC - 1))
 #define trace_ahead_bit(rw)    \
-       (((rw) & (1 << BIO_RW_AHEAD)) << (BIO_RW_AHEAD - 0))
+       (((rw) & (1 << BIO_RW_AHEAD)) << (2 - BIO_RW_AHEAD))
 
 /*
  * The worker for the various blk_add_trace*() types. Fills out a
index 102ebc2c5c34c73f8e7f76c589559ddfde0d9885..aae3123bf3eec6501faa46fdbf3000ea4bfa97af 100644 (file)
@@ -936,7 +936,7 @@ static int cfq_arm_slice_timer(struct cfq_data *cfqd, struct cfq_queue *cfqq)
         * seeks. so allow a little bit of time for him to submit a new rq
         */
        if (sample_valid(cic->seek_samples) && CIC_SEEKY(cic))
-               sl = 2;
+               sl = min(sl, msecs_to_jiffies(2));
 
        mod_timer(&cfqd->idle_slice_timer, jiffies + sl);
        return 1;
index 9cfa2e1ecb24c2568e020222026271f68631deb7..309760b7e37f0c9a7d08ddcf047196dc1eb70875 100644 (file)
@@ -72,7 +72,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
                        bdevp = bdget_disk(disk, part);
                        if (!bdevp)
                                return -ENOMEM;
-                       mutex_lock(&bdevp->bd_mutex);
+                       mutex_lock_nested(&bdevp->bd_mutex, BD_MUTEX_PARTITION);
                        if (bdevp->bd_openers) {
                                mutex_unlock(&bdevp->bd_mutex);
                                bdput(bdevp);
@@ -82,7 +82,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
                        fsync_bdev(bdevp);
                        invalidate_bdev(bdevp, 0);
 
-                       mutex_lock(&bdev->bd_mutex);
+                       mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_WHOLE);
                        delete_partition(disk, part);
                        mutex_unlock(&bdev->bd_mutex);
                        mutex_unlock(&bdevp->bd_mutex);
index 93d94749310bdc6c15beaec61f1f30ccea278ad9..b5382cedf0c09cad0376df575c32b194d5ba7c0d 100644 (file)
@@ -400,6 +400,16 @@ config BLK_DEV_RAM_SIZE
          what are you doing. If you are using IBM S/390, then set this to
          8192.
 
+config BLK_DEV_RAM_BLOCKSIZE
+       int "Default RAM disk block size (bytes)"
+       depends on BLK_DEV_RAM
+       default "1024"
+       help
+         The default value is 1024 kilobytes.  PAGE_SIZE is a much more
+         efficient choice however.  The default is kept to ensure initrd
+         setups function - apparently needed by the rd_load_image routine
+         that supposes the filesystem in the image uses a 1024 blocksize.
+
 config BLK_DEV_INITRD
        bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
        depends on BROKEN || !FRV
index 1c4df22dfd2a960a2309570e093828e570096d94..7b0eca703a678c3c2401b58e9c78f07d0e40f415 100644 (file)
@@ -1233,6 +1233,50 @@ static inline void complete_buffers(struct bio *bio, int status)
        }
 }
 
+static void cciss_check_queues(ctlr_info_t *h)
+{
+       int start_queue = h->next_to_run;
+       int i;
+
+       /* check to see if we have maxed out the number of commands that can
+        * be placed on the queue.  If so then exit.  We do this check here
+        * in case the interrupt we serviced was from an ioctl and did not
+        * free any new commands.
+        */
+       if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS)
+               return;
+
+       /* We have room on the queue for more commands.  Now we need to queue
+        * them up.  We will also keep track of the next queue to run so
+        * that every queue gets a chance to be started first.
+        */
+       for (i = 0; i < h->highest_lun + 1; i++) {
+               int curr_queue = (start_queue + i) % (h->highest_lun + 1);
+               /* make sure the disk has been added and the drive is real
+                * because this can be called from the middle of init_one.
+                */
+               if (!(h->drv[curr_queue].queue) || !(h->drv[curr_queue].heads))
+                       continue;
+               blk_start_queue(h->gendisk[curr_queue]->queue);
+
+               /* check to see if we have maxed out the number of commands
+                * that can be placed on the queue.
+                */
+               if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS) {
+                       if (curr_queue == start_queue) {
+                               h->next_to_run =
+                                   (start_queue + 1) % (h->highest_lun + 1);
+                               break;
+                       } else {
+                               h->next_to_run = curr_queue;
+                               break;
+                       }
+               } else {
+                       curr_queue = (curr_queue + 1) % (h->highest_lun + 1);
+               }
+       }
+}
+
 static void cciss_softirq_done(struct request *rq)
 {
        CommandList_struct *cmd = rq->completion_data;
@@ -1264,6 +1308,7 @@ static void cciss_softirq_done(struct request *rq)
        spin_lock_irqsave(&h->lock, flags);
        end_that_request_last(rq, rq->errors);
        cmd_free(h, cmd, 1);
+       cciss_check_queues(h);
        spin_unlock_irqrestore(&h->lock, flags);
 }
 
@@ -2528,8 +2573,6 @@ static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
        CommandList_struct *c;
        unsigned long flags;
        __u32 a, a1, a2;
-       int j;
-       int start_queue = h->next_to_run;
 
        if (interrupt_not_for_us(h))
                return IRQ_NONE;
@@ -2588,45 +2631,6 @@ static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
                }
        }
 
-       /* check to see if we have maxed out the number of commands that can
-        * be placed on the queue.  If so then exit.  We do this check here
-        * in case the interrupt we serviced was from an ioctl and did not
-        * free any new commands.
-        */
-       if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS)
-               goto cleanup;
-
-       /* We have room on the queue for more commands.  Now we need to queue
-        * them up.  We will also keep track of the next queue to run so
-        * that every queue gets a chance to be started first.
-        */
-       for (j = 0; j < h->highest_lun + 1; j++) {
-               int curr_queue = (start_queue + j) % (h->highest_lun + 1);
-               /* make sure the disk has been added and the drive is real
-                * because this can be called from the middle of init_one.
-                */
-               if (!(h->drv[curr_queue].queue) || !(h->drv[curr_queue].heads))
-                       continue;
-               blk_start_queue(h->gendisk[curr_queue]->queue);
-
-               /* check to see if we have maxed out the number of commands
-                * that can be placed on the queue.
-                */
-               if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS) {
-                       if (curr_queue == start_queue) {
-                               h->next_to_run =
-                                   (start_queue + 1) % (h->highest_lun + 1);
-                               goto cleanup;
-                       } else {
-                               h->next_to_run = curr_queue;
-                               goto cleanup;
-                       }
-               } else {
-                       curr_queue = (curr_queue + 1) % (h->highest_lun + 1);
-               }
-       }
-
-      cleanup:
        spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
        return IRQ_HANDLED;
 }
index 757f42dd8e86683bf4afdbc9312f37a9237dbff8..78082edc14b4f6fdaec8652f12b45e3a921c3223 100644 (file)
@@ -1739,8 +1739,6 @@ static void getgeometry(int ctlr)
             (log_index < id_ctlr_buf->nr_drvs)
             && (log_unit < NWD);
             log_unit++) {
-               struct gendisk *disk = ida_gendisk[ctlr][log_unit];
-
                size = sizeof(sense_log_drv_stat_t);
 
                /*
index 3cf246abb5ecd09ccc4de255a60f4982cc7e1e8e..a3f64bfe6b5870eb52229cdd9e9dd36fd6289aaf 100644 (file)
@@ -84,7 +84,7 @@ int rd_size = CONFIG_BLK_DEV_RAM_SIZE;                /* Size of the RAM disks */
  * behaviour. The default is still BLOCK_SIZE (needed by rd_load_image that
  * supposes the filesystem in the image uses a BLOCK_SIZE blocksize).
  */
-static int rd_blocksize = BLOCK_SIZE;          /* blocksize of the RAM disks */
+static int rd_blocksize = CONFIG_BLK_DEV_RAM_BLOCKSIZE;
 
 /*
  * Copyright (C) 2000 Linus Torvalds.
index 6a0c2230f82fe64fdf60319f30a4c325501d76a5..e2d4beac74207c711bdafaf11399d0170d73d07b 100644 (file)
@@ -67,6 +67,8 @@ static int ignore = 0;
 static int ignore_dga = 0;
 static int ignore_csr = 0;
 static int ignore_sniffer = 0;
+static int disable_scofix = 0;
+static int force_scofix = 0;
 static int reset = 0;
 
 #ifdef CONFIG_BT_HCIUSB_SCO
@@ -107,9 +109,12 @@ static struct usb_device_id blacklist_ids[] = {
        { USB_DEVICE(0x0a5c, 0x2033), .driver_info = HCI_IGNORE },
 
        /* Broadcom BCM2035 */
-       { USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | HCI_BROKEN_ISOC },
+       { USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
        { USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 },
 
+       /* IBM/Lenovo ThinkPad with Broadcom chip */
+       { USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_WRONG_SCO_MTU },
+
        /* Microsoft Wireless Transceiver for Bluetooth 2.0 */
        { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET },
 
@@ -119,11 +124,13 @@ static struct usb_device_id blacklist_ids[] = {
        /* ISSC Bluetooth Adapter v3.1 */
        { USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET },
 
-       /* RTX Telecom based adapter with buggy SCO support */
+       /* RTX Telecom based adapters with buggy SCO support */
        { USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC },
+       { USB_DEVICE(0x0400, 0x080a), .driver_info = HCI_BROKEN_ISOC },
 
-       /* Belkin F8T012 */
+       /* Belkin F8T012 and F8T013 devices */
        { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_WRONG_SCO_MTU },
+       { USB_DEVICE(0x050d, 0x0013), .driver_info = HCI_WRONG_SCO_MTU },
 
        /* Digianswer devices */
        { USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER },
@@ -990,8 +997,10 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
        if (reset || id->driver_info & HCI_RESET)
                set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks);
 
-       if (id->driver_info & HCI_WRONG_SCO_MTU)
-               set_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks);
+       if (force_scofix || id->driver_info & HCI_WRONG_SCO_MTU) {
+               if (!disable_scofix)
+                       set_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks);
+       }
 
        if (id->driver_info & HCI_SNIFFER) {
                if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997)
@@ -1161,6 +1170,12 @@ MODULE_PARM_DESC(ignore_csr, "Ignore devices with id 0a12:0001");
 module_param(ignore_sniffer, bool, 0644);
 MODULE_PARM_DESC(ignore_sniffer, "Ignore devices with id 0a12:0002");
 
+module_param(disable_scofix, bool, 0644);
+MODULE_PARM_DESC(disable_scofix, "Disable fixup of wrong SCO buffer size");
+
+module_param(force_scofix, bool, 0644);
+MODULE_PARM_DESC(force_scofix, "Force fixup of wrong SCO buffers size");
+
 module_param(reset, bool, 0644);
 MODULE_PARM_DESC(reset, "Send HCI reset command on initialization");
 
index 5b91e4e25641d281916ea16b1e1a57371ff0bebd..7719bd75810b2d561a9f9ef0f703573b56e8998b 100644 (file)
@@ -68,13 +68,11 @@ ssize_t nsc_gpio_write(struct file *file, const char __user *data,
                        amp->gpio_config(m, ~1, 0);
                        break;
                case 'T':
-                       dev_dbg(dev, "GPIO%d output is push pull\n",
-                              m);
+                       dev_dbg(dev, "GPIO%d output is push pull\n", m);
                        amp->gpio_config(m, ~2, 2);
                        break;
                case 't':
-                       dev_dbg(dev, "GPIO%d output is open drain\n",
-                              m);
+                       dev_dbg(dev, "GPIO%d output is open drain\n", m);
                        amp->gpio_config(m, ~2, 0);
                        break;
                case 'P':
index 11bd78c806287064cb052ff0a957012277ced456..645eb81cb5a9d6be636fe4eef7dfb6a618ea672f 100644 (file)
@@ -212,22 +212,21 @@ static void pc8736x_gpio_change(unsigned index)
        pc8736x_gpio_set(index, !pc8736x_gpio_current(index));
 }
 
-static struct nsc_gpio_ops pc8736x_access = {
+static struct nsc_gpio_ops pc8736x_gpio_ops = {
        .owner          = THIS_MODULE,
        .gpio_config    = pc8736x_gpio_configure,
        .gpio_dump      = nsc_gpio_dump,
        .gpio_get       = pc8736x_gpio_get,
        .gpio_set       = pc8736x_gpio_set,
-       .gpio_set_high  = pc8736x_gpio_set_high,
-       .gpio_set_low   = pc8736x_gpio_set_low,
        .gpio_change    = pc8736x_gpio_change,
        .gpio_current   = pc8736x_gpio_current
 };
+EXPORT_SYMBOL(pc8736x_gpio_ops);
 
 static int pc8736x_gpio_open(struct inode *inode, struct file *file)
 {
        unsigned m = iminor(inode);
-       file->private_data = &pc8736x_access;
+       file->private_data = &pc8736x_gpio_ops;
 
        dev_dbg(&pdev->dev, "open %d\n", m);
 
@@ -236,7 +235,7 @@ static int pc8736x_gpio_open(struct inode *inode, struct file *file)
        return nonseekable_open(inode, file);
 }
 
-static const struct file_operations pc8736x_gpio_fops = {
+static const struct file_operations pc8736x_gpio_fileops = {
        .owner  = THIS_MODULE,
        .open   = pc8736x_gpio_open,
        .write  = nsc_gpio_write,
@@ -278,7 +277,7 @@ static int __init pc8736x_gpio_init(void)
                dev_err(&pdev->dev, "no device found\n");
                goto undo_platform_dev_add;
        }
-       pc8736x_access.dev = &pdev->dev;
+       pc8736x_gpio_ops.dev = &pdev->dev;
 
        /* Verify that chip and it's GPIO unit are both enabled.
           My BIOS does this, so I take minimum action here
@@ -328,7 +327,7 @@ static int __init pc8736x_gpio_init(void)
        pc8736x_init_shadow();
 
        /* ignore minor errs, and succeed */
-       cdev_init(&pc8736x_gpio_cdev, &pc8736x_gpio_fops);
+       cdev_init(&pc8736x_gpio_cdev, &pc8736x_gpio_fileops);
        cdev_add(&pc8736x_gpio_cdev, devid, PC8736X_GPIO_CT);
 
        return 0;
@@ -355,7 +354,5 @@ static void __exit pc8736x_gpio_cleanup(void)
        platform_device_put(pdev);
 }
 
-EXPORT_SYMBOL(pc8736x_access);
-
 module_init(pc8736x_gpio_init);
 module_exit(pc8736x_gpio_cleanup);
index 17bc8abd5df50b8e9ad1c821340f333807504586..00f574cbb0d47ca0c69d8b4b0c2ed77be9e24282 100644 (file)
@@ -1174,8 +1174,12 @@ static void dcd_change(MGSLPC_INFO *info)
        else
                info->input_signal_events.dcd_down++;
 #ifdef CONFIG_HDLC
-       if (info->netcount)
-               hdlc_set_carrier(info->serial_signals & SerialSignal_DCD, info->netdev);
+       if (info->netcount) {
+               if (info->serial_signals & SerialSignal_DCD)
+                       netif_carrier_on(info->netdev);
+               else
+                       netif_carrier_off(info->netdev);
+       }
 #endif
        wake_up_interruptible(&info->status_event_wait_q);
        wake_up_interruptible(&info->event_wait_q);
@@ -4251,8 +4255,10 @@ static int hdlcdev_open(struct net_device *dev)
        spin_lock_irqsave(&info->lock, flags);
        get_signals(info);
        spin_unlock_irqrestore(&info->lock, flags);
-       hdlc_set_carrier(info->serial_signals & SerialSignal_DCD, dev);
-
+       if (info->serial_signals & SerialSignal_DCD)
+               netif_carrier_on(dev);
+       else
+               netif_carrier_off(dev);
        return 0;
 }
 
index 425c58719db6a6af14c5dc12a68e2e53642087bc..b956c7babd18a8a4933d6a99e74bd86ceb63c62d 100644 (file)
@@ -5,7 +5,6 @@
 
    Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com> */
 
-#include <linux/config.h>
 #include <linux/device.h>
 #include <linux/fs.h>
 #include <linux/module.h>
 #include <linux/scx200_gpio.h>
 #include <linux/nsc_gpio.h>
 
-#define NAME "scx200_gpio"
-#define DEVNAME NAME
+#define DRVNAME "scx200_gpio"
 
 static struct platform_device *pdev;
 
 MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>");
-MODULE_DESCRIPTION("NatSemi SCx200 GPIO Pin Driver");
+MODULE_DESCRIPTION("NatSemi/AMD SCx200 GPIO Pin Driver");
 MODULE_LICENSE("GPL");
 
 static int major = 0;          /* default to dynamic major */
 module_param(major, int, 0);
 MODULE_PARM_DESC(major, "Major device number");
 
-struct nsc_gpio_ops scx200_access = {
+#define MAX_PINS 32            /* 64 later, when known ok */
+
+struct nsc_gpio_ops scx200_gpio_ops = {
        .owner          = THIS_MODULE,
        .gpio_config    = scx200_gpio_configure,
        .gpio_dump      = nsc_gpio_dump,
        .gpio_get       = scx200_gpio_get,
        .gpio_set       = scx200_gpio_set,
-       .gpio_set_high  = scx200_gpio_set_high,
-       .gpio_set_low   = scx200_gpio_set_low,
        .gpio_change    = scx200_gpio_change,
        .gpio_current   = scx200_gpio_current
 };
+EXPORT_SYMBOL(scx200_gpio_ops);
 
 static int scx200_gpio_open(struct inode *inode, struct file *file)
 {
        unsigned m = iminor(inode);
-       file->private_data = &scx200_access;
+       file->private_data = &scx200_gpio_ops;
 
-       if (m > 63)
+       if (m >= MAX_PINS)
                return -EINVAL;
        return nonseekable_open(inode, file);
 }
@@ -62,8 +61,7 @@ static int scx200_gpio_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-
-static const struct file_operations scx200_gpio_fops = {
+static const struct file_operations scx200_gpio_fileops = {
        .owner   = THIS_MODULE,
        .write   = nsc_gpio_write,
        .read    = nsc_gpio_read,
@@ -71,21 +69,20 @@ static const struct file_operations scx200_gpio_fops = {
        .release = scx200_gpio_release,
 };
 
-struct cdev *scx200_devices;
-static int num_pins = 32;
+struct cdev scx200_gpio_cdev;  /* use 1 cdev for all pins */
 
 static int __init scx200_gpio_init(void)
 {
-       int rc, i;
-       dev_t dev = MKDEV(major, 0);
+       int rc;
+       dev_t devid;
 
        if (!scx200_gpio_present()) {
-               printk(KERN_ERR NAME ": no SCx200 gpio present\n");
+               printk(KERN_ERR DRVNAME ": no SCx200 gpio present\n");
                return -ENODEV;
        }
 
        /* support dev_dbg() with pdev->dev */
-       pdev = platform_device_alloc(DEVNAME, 0);
+       pdev = platform_device_alloc(DRVNAME, 0);
        if (!pdev)
                return -ENOMEM;
 
@@ -94,37 +91,25 @@ static int __init scx200_gpio_init(void)
                goto undo_malloc;
 
        /* nsc_gpio uses dev_dbg(), so needs this */
-       scx200_access.dev = &pdev->dev;
-
-       if (major)
-               rc = register_chrdev_region(dev, num_pins, "scx200_gpio");
-       else {
-               rc = alloc_chrdev_region(&dev, 0, num_pins, "scx200_gpio");
-               major = MAJOR(dev);
+       scx200_gpio_ops.dev = &pdev->dev;
+
+       if (major) {
+               devid = MKDEV(major, 0);
+               rc = register_chrdev_region(devid, MAX_PINS, "scx200_gpio");
+       } else {
+               rc = alloc_chrdev_region(&devid, 0, MAX_PINS, "scx200_gpio");
+               major = MAJOR(devid);
        }
        if (rc < 0) {
                dev_err(&pdev->dev, "SCx200 chrdev_region err: %d\n", rc);
                goto undo_platform_device_add;
        }
-       scx200_devices = kzalloc(num_pins * sizeof(struct cdev), GFP_KERNEL);
-       if (!scx200_devices) {
-               rc = -ENOMEM;
-               goto undo_chrdev_region;
-       }
-       for (i = 0; i < num_pins; i++) {
-               struct cdev *cdev = &scx200_devices[i];
-               cdev_init(cdev, &scx200_gpio_fops);
-               cdev->owner = THIS_MODULE;
-               rc = cdev_add(cdev, MKDEV(major, i), 1);
-               /* tolerate 'minor' errors */
-               if (rc)
-                       dev_err(&pdev->dev, "Error %d on minor %d", rc, i);
-       }
+
+       cdev_init(&scx200_gpio_cdev, &scx200_gpio_fileops);
+       cdev_add(&scx200_gpio_cdev, devid, MAX_PINS);
 
        return 0; /* succeed */
 
-undo_chrdev_region:
-       unregister_chrdev_region(dev, num_pins);
 undo_platform_device_add:
        platform_device_del(pdev);
 undo_malloc:
@@ -135,10 +120,11 @@ undo_malloc:
 
 static void __exit scx200_gpio_cleanup(void)
 {
-       kfree(scx200_devices);
-       unregister_chrdev_region(MKDEV(major, 0), num_pins);
+       cdev_del(&scx200_gpio_cdev);
+       /* cdev_put(&scx200_gpio_cdev); */
+
+       unregister_chrdev_region(MKDEV(major, 0), MAX_PINS);
        platform_device_unregister(pdev);
-       /* kfree(pdev); */
 }
 
 module_init(scx200_gpio_init);
index df782dd1098c1b61b92fc915d18f471b07dff0ad..78b1b1a2732b3e9216556c3caa2b77354a0457d6 100644 (file)
@@ -1344,8 +1344,12 @@ static void mgsl_isr_io_pin( struct mgsl_struct *info )
                        } else
                                info->input_signal_events.dcd_down++;
 #ifdef CONFIG_HDLC
-                       if (info->netcount)
-                               hdlc_set_carrier(status & MISCSTATUS_DCD, info->netdev);
+                       if (info->netcount) {
+                               if (status & MISCSTATUS_DCD)
+                                       netif_carrier_on(info->netdev);
+                               else
+                                       netif_carrier_off(info->netdev);
+                       }
 #endif
                }
                if (status & MISCSTATUS_CTS_LATCHED)
@@ -7844,8 +7848,10 @@ static int hdlcdev_open(struct net_device *dev)
        spin_lock_irqsave(&info->irq_spinlock, flags);
        usc_get_serial_signals(info);
        spin_unlock_irqrestore(&info->irq_spinlock, flags);
-       hdlc_set_carrier(info->serial_signals & SerialSignal_DCD, dev);
-
+       if (info->serial_signals & SerialSignal_DCD)
+               netif_carrier_on(dev);
+       else
+               netif_carrier_off(dev);
        return 0;
 }
 
index e829594195c1d836c6dca220c74e47939a5f45ec..b2dbbdb1bf81340092aa91d8b03e2c4b54f20c6a 100644 (file)
@@ -1497,8 +1497,10 @@ static int hdlcdev_open(struct net_device *dev)
        spin_lock_irqsave(&info->lock, flags);
        get_signals(info);
        spin_unlock_irqrestore(&info->lock, flags);
-       hdlc_set_carrier(info->signals & SerialSignal_DCD, dev);
-
+       if (info->signals & SerialSignal_DCD)
+               netif_carrier_on(dev);
+       else
+               netif_carrier_off(dev);
        return 0;
 }
 
@@ -1997,8 +1999,12 @@ static void dcd_change(struct slgt_info *info)
                info->input_signal_events.dcd_down++;
        }
 #ifdef CONFIG_HDLC
-       if (info->netcount)
-               hdlc_set_carrier(info->signals & SerialSignal_DCD, info->netdev);
+       if (info->netcount) {
+               if (info->signals & SerialSignal_DCD)
+                       netif_carrier_on(info->netdev);
+               else
+                       netif_carrier_off(info->netdev);
+       }
 #endif
        wake_up_interruptible(&info->status_event_wait_q);
        wake_up_interruptible(&info->event_wait_q);
index 1e443a233f5102e3eef924ef0cb114e82b6f8f43..66f3754fbbdf443e891b21cdfcf88c799144e6b9 100644 (file)
@@ -1752,8 +1752,10 @@ static int hdlcdev_open(struct net_device *dev)
        spin_lock_irqsave(&info->lock, flags);
        get_signals(info);
        spin_unlock_irqrestore(&info->lock, flags);
-       hdlc_set_carrier(info->serial_signals & SerialSignal_DCD, dev);
-
+       if (info->serial_signals & SerialSignal_DCD)
+               netif_carrier_on(dev);
+       else
+               netif_carrier_off(dev);
        return 0;
 }
 
@@ -2522,8 +2524,12 @@ void isr_io_pin( SLMP_INFO *info, u16 status )
                        } else
                                info->input_signal_events.dcd_down++;
 #ifdef CONFIG_HDLC
-                       if (info->netcount)
-                               hdlc_set_carrier(status & SerialSignal_DCD, info->netdev);
+                       if (info->netcount) {
+                               if (status & SerialSignal_DCD)
+                                       netif_carrier_on(info->netdev);
+                               else
+                                       netif_carrier_off(info->netdev);
+                       }
 #endif
                }
                if (status & MISCSTATUS_CTS_LATCHED)
index 6889e7db3aff5285dd7824317c3f6469fc2e00c2..a082a2e342522a78edfd642f272784bd1fbee276 100644 (file)
@@ -1141,6 +1141,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vend
                put_device(dev);
                clear_bit(chip->dev_num, dev_mask);
                kfree(chip);
+               kfree(devname);
                return NULL;
        }
 
index 3232b1932597e88989366a445d59c0de420728f7..ee7ac6f43c653bd49d7f4f3ac8649b54c092c24a 100644 (file)
@@ -424,6 +424,7 @@ static irqreturn_t tis_int_handler(int irq, void *dev_id, struct pt_regs *regs)
        iowrite32(interrupt,
                  chip->vendor.iobase +
                  TPM_INT_STATUS(chip->vendor.locality));
+       ioread32(chip->vendor.iobase + TPM_INT_STATUS(chip->vendor.locality));
        return IRQ_HANDLED;
 }
 
@@ -431,23 +432,19 @@ static int interrupts = 1;
 module_param(interrupts, bool, 0444);
 MODULE_PARM_DESC(interrupts, "Enable interrupts");
 
-static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
-                                     const struct pnp_device_id *pnp_id)
+static int tpm_tis_init(struct device *dev, resource_size_t start,
+                       resource_size_t len)
 {
        u32 vendor, intfcaps, intmask;
        int rc, i;
-       unsigned long start, len;
        struct tpm_chip *chip;
 
-       start = pnp_mem_start(pnp_dev, 0);
-       len = pnp_mem_len(pnp_dev, 0);
-
        if (!start)
                start = TIS_MEM_BASE;
        if (!len)
                len = TIS_MEM_LEN;
 
-       if (!(chip = tpm_register_hardware(&pnp_dev->dev, &tpm_tis)))
+       if (!(chip = tpm_register_hardware(dev, &tpm_tis)))
                return -ENODEV;
 
        chip->vendor.iobase = ioremap(start, len);
@@ -464,7 +461,7 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
        chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
        chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
 
-       dev_info(&pnp_dev->dev,
+       dev_info(dev,
                 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
                 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
 
@@ -472,26 +469,26 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
        intfcaps =
            ioread32(chip->vendor.iobase +
                     TPM_INTF_CAPS(chip->vendor.locality));
-       dev_dbg(&pnp_dev->dev, "TPM interface capabilities (0x%x):\n",
+       dev_dbg(dev, "TPM interface capabilities (0x%x):\n",
                intfcaps);
        if (intfcaps & TPM_INTF_BURST_COUNT_STATIC)
-               dev_dbg(&pnp_dev->dev, "\tBurst Count Static\n");
+               dev_dbg(dev, "\tBurst Count Static\n");
        if (intfcaps & TPM_INTF_CMD_READY_INT)
-               dev_dbg(&pnp_dev->dev, "\tCommand Ready Int Support\n");
+               dev_dbg(dev, "\tCommand Ready Int Support\n");
        if (intfcaps & TPM_INTF_INT_EDGE_FALLING)
-               dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Falling\n");
+               dev_dbg(dev, "\tInterrupt Edge Falling\n");
        if (intfcaps & TPM_INTF_INT_EDGE_RISING)
-               dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Rising\n");
+               dev_dbg(dev, "\tInterrupt Edge Rising\n");
        if (intfcaps & TPM_INTF_INT_LEVEL_LOW)
-               dev_dbg(&pnp_dev->dev, "\tInterrupt Level Low\n");
+               dev_dbg(dev, "\tInterrupt Level Low\n");
        if (intfcaps & TPM_INTF_INT_LEVEL_HIGH)
-               dev_dbg(&pnp_dev->dev, "\tInterrupt Level High\n");
+               dev_dbg(dev, "\tInterrupt Level High\n");
        if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT)
-               dev_dbg(&pnp_dev->dev, "\tLocality Change Int Support\n");
+               dev_dbg(dev, "\tLocality Change Int Support\n");
        if (intfcaps & TPM_INTF_STS_VALID_INT)
-               dev_dbg(&pnp_dev->dev, "\tSts Valid Int Support\n");
+               dev_dbg(dev, "\tSts Valid Int Support\n");
        if (intfcaps & TPM_INTF_DATA_AVAIL_INT)
-               dev_dbg(&pnp_dev->dev, "\tData Avail Int Support\n");
+               dev_dbg(dev, "\tData Avail Int Support\n");
 
        if (request_locality(chip, 0) != 0) {
                rc = -ENODEV;
@@ -594,6 +591,16 @@ out_err:
        return rc;
 }
 
+static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
+                                     const struct pnp_device_id *pnp_id)
+{
+       resource_size_t start, len;
+       start = pnp_mem_start(pnp_dev, 0);
+       len = pnp_mem_len(pnp_dev, 0);
+
+       return tpm_tis_init(&pnp_dev->dev, start, len);
+}
+
 static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg)
 {
        return tpm_pm_suspend(&dev->dev, msg);
@@ -628,8 +635,36 @@ module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id,
                    sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444);
 MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe");
 
+static struct device_driver tis_drv = {
+       .name = "tpm_tis",
+       .bus = &platform_bus_type,
+       .owner = THIS_MODULE,
+       .suspend = tpm_pm_suspend,
+       .resume = tpm_pm_resume,
+};
+
+static struct platform_device *pdev;
+
+static int force;
+module_param(force, bool, 0444);
+MODULE_PARM_DESC(force, "Force device probe rather than using ACPI entry");
 static int __init init_tis(void)
 {
+       int rc;
+
+       if (force) {
+               rc = driver_register(&tis_drv);
+               if (rc < 0)
+                       return rc;
+               if (IS_ERR(pdev=platform_device_register_simple("tpm_tis", -1, NULL, 0)))
+                       return PTR_ERR(pdev);
+               if((rc=tpm_tis_init(&pdev->dev, 0, 0)) != 0) {
+                       platform_device_unregister(pdev);
+                       driver_unregister(&tis_drv);
+               }
+               return rc;
+       }
+
        return pnp_register_driver(&tis_pnp_driver);
 }
 
@@ -654,7 +689,11 @@ static void __exit cleanup_tis(void)
                tpm_remove_hardware(chip->dev);
        }
        spin_unlock(&tis_lock);
-       pnp_unregister_driver(&tis_pnp_driver);
+       if (force) {
+               platform_device_unregister(pdev);
+               driver_unregister(&tis_drv);
+       } else
+               pnp_unregister_driver(&tis_pnp_driver);
 }
 
 module_init(init_tis);
index 8d328186f774b81cfdd1eabf5c01d244f50115be..bc1088d9b379a97843c58b050f046b8b0df023f5 100644 (file)
@@ -364,10 +364,12 @@ static ssize_t store_##file_name                                  \
        if (ret != 1)                                                   \
                return -EINVAL;                                         \
                                                                        \
+       lock_cpu_hotplug();                                             \
        mutex_lock(&policy->lock);                                      \
        ret = __cpufreq_set_policy(policy, &new_policy);                \
        policy->user_policy.object = policy->object;                    \
        mutex_unlock(&policy->lock);                                    \
+       unlock_cpu_hotplug();                                           \
                                                                        \
        return ret ? ret : count;                                       \
 }
@@ -1197,20 +1199,18 @@ EXPORT_SYMBOL(cpufreq_unregister_notifier);
  *********************************************************************/
 
 
+/* Must be called with lock_cpu_hotplug held */
 int __cpufreq_driver_target(struct cpufreq_policy *policy,
                            unsigned int target_freq,
                            unsigned int relation)
 {
        int retval = -EINVAL;
 
-       lock_cpu_hotplug();
        dprintk("target for CPU %u: %u kHz, relation %u\n", policy->cpu,
                target_freq, relation);
        if (cpu_online(policy->cpu) && cpufreq_driver->target)
                retval = cpufreq_driver->target(policy, target_freq, relation);
 
-       unlock_cpu_hotplug();
-
        return retval;
 }
 EXPORT_SYMBOL_GPL(__cpufreq_driver_target);
@@ -1225,17 +1225,23 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
        if (!policy)
                return -EINVAL;
 
+       lock_cpu_hotplug();
        mutex_lock(&policy->lock);
 
        ret = __cpufreq_driver_target(policy, target_freq, relation);
 
        mutex_unlock(&policy->lock);
+       unlock_cpu_hotplug();
 
        cpufreq_cpu_put(policy);
        return ret;
 }
 EXPORT_SYMBOL_GPL(cpufreq_driver_target);
 
+/*
+ * Locking: Must be called with the lock_cpu_hotplug() lock held
+ * when "event" is CPUFREQ_GOV_LIMITS
+ */
 
 static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
 {
@@ -1257,24 +1263,6 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
 }
 
 
-int cpufreq_governor(unsigned int cpu, unsigned int event)
-{
-       int ret = 0;
-       struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
-
-       if (!policy)
-               return -EINVAL;
-
-       mutex_lock(&policy->lock);
-       ret = __cpufreq_governor(policy, event);
-       mutex_unlock(&policy->lock);
-
-       cpufreq_cpu_put(policy);
-       return ret;
-}
-EXPORT_SYMBOL_GPL(cpufreq_governor);
-
-
 int cpufreq_register_governor(struct cpufreq_governor *governor)
 {
        struct cpufreq_governor *t;
@@ -1342,6 +1330,9 @@ int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
 EXPORT_SYMBOL(cpufreq_get_policy);
 
 
+/*
+ * Locking: Must be called with the lock_cpu_hotplug() lock held
+ */
 static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_policy *policy)
 {
        int ret = 0;
@@ -1436,6 +1427,8 @@ int cpufreq_set_policy(struct cpufreq_policy *policy)
        if (!data)
                return -EINVAL;
 
+       lock_cpu_hotplug();
+
        /* lock this CPU */
        mutex_lock(&data->lock);
 
@@ -1446,6 +1439,8 @@ int cpufreq_set_policy(struct cpufreq_policy *policy)
        data->user_policy.governor = data->governor;
 
        mutex_unlock(&data->lock);
+
+       unlock_cpu_hotplug();
        cpufreq_cpu_put(data);
 
        return ret;
@@ -1469,6 +1464,7 @@ int cpufreq_update_policy(unsigned int cpu)
        if (!data)
                return -ENODEV;
 
+       lock_cpu_hotplug();
        mutex_lock(&data->lock);
 
        dprintk("updating policy for CPU %u\n", cpu);
@@ -1494,7 +1490,7 @@ int cpufreq_update_policy(unsigned int cpu)
        ret = __cpufreq_set_policy(data, &policy);
 
        mutex_unlock(&data->lock);
-
+       unlock_cpu_hotplug();
        cpufreq_cpu_put(data);
        return ret;
 }
index b3ebc8f019753db87d072914b1d699e9f36c85eb..c4c578defabfa0e5df0251d430fde58fee7d45ab 100644 (file)
@@ -525,7 +525,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
                break;
 
        case CPUFREQ_GOV_LIMITS:
-               lock_cpu_hotplug();
                mutex_lock(&dbs_mutex);
                if (policy->max < this_dbs_info->cur_policy->cur)
                        __cpufreq_driver_target(
@@ -536,7 +535,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
                                        this_dbs_info->cur_policy,
                                        policy->min, CPUFREQ_RELATION_L);
                mutex_unlock(&dbs_mutex);
-               unlock_cpu_hotplug();
                break;
        }
        return 0;
index 87299924e73508accd8961191cc4baf99832927b..52cf1f02182591f64f527144e1e3a1394ee9a050 100644 (file)
@@ -239,6 +239,8 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
        total_ticks = (unsigned int) cputime64_sub(cur_jiffies,
                        this_dbs_info->prev_cpu_wall);
        this_dbs_info->prev_cpu_wall = cur_jiffies;
+       if (!total_ticks)
+               return;
        /*
         * Every sampling_rate, we check, if current idle time is less
         * than 20% (default), then we try to increase frequency
@@ -304,7 +306,12 @@ static void do_dbs_timer(void *data)
        unsigned int cpu = smp_processor_id();
        struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu);
 
+       if (!dbs_info->enable)
+               return;
+
+       lock_cpu_hotplug();
        dbs_check_cpu(dbs_info);
+       unlock_cpu_hotplug();
        queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work,
                        usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
 }
@@ -319,11 +326,11 @@ static inline void dbs_timer_init(unsigned int cpu)
        return;
 }
 
-static inline void dbs_timer_exit(unsigned int cpu)
+static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
 {
-       struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu);
-
-       cancel_rearming_delayed_workqueue(kondemand_wq, &dbs_info->work);
+       dbs_info->enable = 0;
+       cancel_delayed_work(&dbs_info->work);
+       flush_workqueue(kondemand_wq);
 }
 
 static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
@@ -396,8 +403,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
 
        case CPUFREQ_GOV_STOP:
                mutex_lock(&dbs_mutex);
-               dbs_timer_exit(policy->cpu);
-               this_dbs_info->enable = 0;
+               dbs_timer_exit(this_dbs_info);
                sysfs_remove_group(&policy->kobj, &dbs_attr_group);
                dbs_enable--;
                if (dbs_enable == 0)
@@ -408,7 +414,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
                break;
 
        case CPUFREQ_GOV_LIMITS:
-               lock_cpu_hotplug();
                mutex_lock(&dbs_mutex);
                if (policy->max < this_dbs_info->cur_policy->cur)
                        __cpufreq_driver_target(this_dbs_info->cur_policy,
@@ -419,7 +424,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
                                                policy->min,
                                                CPUFREQ_RELATION_L);
                mutex_unlock(&dbs_mutex);
-               unlock_cpu_hotplug();
                break;
        }
        return 0;
index 44ae5e5b94cf4a30f4d1ab18287f72ec28caadb1..a06c204589cdf7c9f8e0e68e38c337f1535ace66 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
 #include <linux/cpufreq.h>
+#include <linux/cpu.h>
 #include <linux/types.h>
 #include <linux/fs.h>
 #include <linux/sysfs.h>
@@ -70,6 +71,7 @@ static int cpufreq_set(unsigned int freq, struct cpufreq_policy *policy)
 
        dprintk("cpufreq_set for cpu %u, freq %u kHz\n", policy->cpu, freq);
 
+       lock_cpu_hotplug();
        mutex_lock(&userspace_mutex);
        if (!cpu_is_managed[policy->cpu])
                goto err;
@@ -92,6 +94,7 @@ static int cpufreq_set(unsigned int freq, struct cpufreq_policy *policy)
 
  err:
        mutex_unlock(&userspace_mutex);
+       unlock_cpu_hotplug();
        return ret;
 }
 
index 17ee684144f9d2d54aae8ff95b16f77bdd091965..b643d71298a911807d4e65f71e2924174cbd74e6 100644 (file)
@@ -59,6 +59,9 @@
 #define AES_EXTENDED_KEY_SIZE  64      /* in uint32_t units */
 #define AES_EXTENDED_KEY_SIZE_B        (AES_EXTENDED_KEY_SIZE * sizeof(uint32_t))
 
+/* Whenever making any changes to the following
+ * structure *make sure* you keep E, d_data
+ * and cword aligned on 16 Bytes boundaries!!! */
 struct aes_ctx {
        struct {
                struct cword encrypt;
@@ -66,8 +69,10 @@ struct aes_ctx {
        } cword;
        u32 *D;
        int key_length;
-       u32 E[AES_EXTENDED_KEY_SIZE];
-       u32 d_data[AES_EXTENDED_KEY_SIZE];
+       u32 E[AES_EXTENDED_KEY_SIZE]
+               __attribute__ ((__aligned__(PADLOCK_ALIGNMENT)));
+       u32 d_data[AES_EXTENDED_KEY_SIZE]
+               __attribute__ ((__aligned__(PADLOCK_ALIGNMENT)));
 };
 
 /* ====== Key management routines ====== */
index 78bf46d917b70eec62feab544ca6b839e482f978..dbd4d6c3698e7761849dee0cb019ac7f3366c486 100644 (file)
@@ -828,7 +828,7 @@ static int __init ioat_init_module(void)
        /* if forced, worst case is that rmmod hangs */
        __unsafe(THIS_MODULE);
 
-       return pci_module_init(&ioat_pci_drv);
+       return pci_register_driver(&ioat_pci_drv);
 }
 
 module_init(ioat_init_module);
index 66d03f242d3ce7f1c741109a6b235494a90efca7..1a159e8843ca47dd27778937d350df400448c48f 100644 (file)
@@ -429,7 +429,7 @@ static inline void fcp_scsi_receive(fc_channel *fc, int token, int status, fc_hd
                
                if (fcmd->data) {
                        if (SCpnt->use_sg)
-                               dma_unmap_sg(fc->dev, (struct scatterlist *)SCpnt->buffer,
+                               dma_unmap_sg(fc->dev, (struct scatterlist *)SCpnt->request_buffer,
                                                SCpnt->use_sg,
                                                SCpnt->sc_data_direction);
                        else
@@ -810,7 +810,7 @@ static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, i
                                                             SCpnt->request_bufflen,
                                                             SCpnt->sc_data_direction);
                        } else {
-                               struct scatterlist *sg = (struct scatterlist *)SCpnt->buffer;
+                               struct scatterlist *sg = (struct scatterlist *)SCpnt->request_buffer;
                                int nents;
 
                                FCD(("XXX: Use_sg %d %d\n", SCpnt->use_sg, sg->length))
index f712e4cfd9dcb7eb1dafba2dc59f7e1c584f80f2..7cf3eb02352140d8f8558533aee4107c8fd1a445 100644 (file)
@@ -776,7 +776,7 @@ static void update_ordered(ide_drive_t *drive)
                 * not available so we don't need to recheck that.
                 */
                capacity = idedisk_capacity(drive);
-               barrier = ide_id_has_flush_cache(id) &&
+               barrier = ide_id_has_flush_cache(id) && !drive->noflush &&
                        (drive->addressing == 0 || capacity <= (1ULL << 28) ||
                         ide_id_has_flush_cache_ext(id));
 
index 98918fb6b2ce32a8854fa4c05068e2fc9ad184c4..7c3a13e1cf647a4cbca6ee39c327c36f9de8d422 100644 (file)
@@ -750,7 +750,7 @@ void ide_dma_verbose(ide_drive_t *drive)
                        goto bug_dma_off;
                printk(", DMA");
        } else if (id->field_valid & 1) {
-               printk(", BUG");
+               goto bug_dma_off;
        }
        return;
 bug_dma_off:
index 05fbd9298db7c7cd5e265a8d9a65a994ec1c81f5..defd4b4bd37488ab38198e8ab86f963c438e2809 100644 (file)
@@ -1539,7 +1539,7 @@ static int __init ide_setup(char *s)
                const char *hd_words[] = {
                        "none", "noprobe", "nowerr", "cdrom", "serialize",
                        "autotune", "noautotune", "minus8", "swapdata", "bswap",
-                       "minus11", "remap", "remap63", "scsi", NULL };
+                       "noflush", "remap", "remap63", "scsi", NULL };
                unit = s[2] - 'a';
                hw   = unit / MAX_DRIVES;
                unit = unit % MAX_DRIVES;
@@ -1578,6 +1578,9 @@ static int __init ide_setup(char *s)
                        case -10: /* "bswap" */
                                drive->bswap = 1;
                                goto done;
+                       case -11: /* noflush */
+                               drive->noflush = 1;
+                               goto done;
                        case -12: /* "remap" */
                                drive->remap_0_to_1 = 1;
                                goto done;
index 3cb04424d351dcb9f88e0163a120ea103983b19c..e9bad185968a8e289cd28f2844ac2578b6727373 100644 (file)
@@ -498,9 +498,14 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 {
        u8 speed        = ide_dma_speed(drive, it821x_ratemask(drive));
 
-       config_it821x_chipset_for_pio(drive, !speed);
-       it821x_tune_chipset(drive, speed);
-       return ide_dma_enable(drive);
+       if (speed) {
+               config_it821x_chipset_for_pio(drive, 0);
+               it821x_tune_chipset(drive, speed);
+
+               return ide_dma_enable(drive);
+       }
+
+       return 0;
 }
 
 /**
index 3f6705f3083ac65e7e501e9b7fa8b9cd403c587b..f85c97f7500a844d41bd5e7b5243e6cd10bd44db 100644 (file)
@@ -701,7 +701,7 @@ static void cm_reset_to_idle(struct cm_id_private *cm_id_priv)
        }
 }
 
-void ib_destroy_cm_id(struct ib_cm_id *cm_id)
+static void cm_destroy_id(struct ib_cm_id *cm_id, int err)
 {
        struct cm_id_private *cm_id_priv;
        struct cm_work *work;
@@ -735,12 +735,22 @@ retest:
                               sizeof cm_id_priv->av.port->cm_dev->ca_guid,
                               NULL, 0);
                break;
+       case IB_CM_REQ_RCVD:
+               if (err == -ENOMEM) {
+                       /* Do not reject to allow future retries. */
+                       cm_reset_to_idle(cm_id_priv);
+                       spin_unlock_irqrestore(&cm_id_priv->lock, flags);
+               } else {
+                       spin_unlock_irqrestore(&cm_id_priv->lock, flags);
+                       ib_send_cm_rej(cm_id, IB_CM_REJ_CONSUMER_DEFINED,
+                                      NULL, 0, NULL, 0);
+               }
+               break;
        case IB_CM_MRA_REQ_RCVD:
        case IB_CM_REP_SENT:
        case IB_CM_MRA_REP_RCVD:
                ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg);
                /* Fall through */
-       case IB_CM_REQ_RCVD:
        case IB_CM_MRA_REQ_SENT:
        case IB_CM_REP_RCVD:
        case IB_CM_MRA_REP_SENT:
@@ -775,6 +785,11 @@ retest:
        kfree(cm_id_priv->private_data);
        kfree(cm_id_priv);
 }
+
+void ib_destroy_cm_id(struct ib_cm_id *cm_id)
+{
+       cm_destroy_id(cm_id, 0);
+}
 EXPORT_SYMBOL(ib_destroy_cm_id);
 
 int ib_cm_listen(struct ib_cm_id *cm_id, __be64 service_id, __be64 service_mask,
@@ -1163,7 +1178,7 @@ static void cm_process_work(struct cm_id_private *cm_id_priv,
        }
        cm_deref_id(cm_id_priv);
        if (ret)
-               ib_destroy_cm_id(&cm_id_priv->id);
+               cm_destroy_id(&cm_id_priv->id, ret);
 }
 
 static void cm_format_mra(struct cm_mra_msg *mra_msg,
index 863f64befc7c5d5703fc8fc06adf9001642b660d..d6f99d5720fcf2b12051898fc336a2e1691e882a 100644 (file)
@@ -262,14 +262,14 @@ static void cma_detach_from_dev(struct rdma_id_private *id_priv)
 static int cma_acquire_ib_dev(struct rdma_id_private *id_priv)
 {
        struct cma_device *cma_dev;
-       union ib_gid *gid;
+       union ib_gid gid;
        int ret = -ENODEV;
 
-       gid = ib_addr_get_sgid(&id_priv->id.route.addr.dev_addr);
+       ib_addr_get_sgid(&id_priv->id.route.addr.dev_addr, &gid),
 
        mutex_lock(&lock);
        list_for_each_entry(cma_dev, &dev_list, list) {
-               ret = ib_find_cached_gid(cma_dev->device, gid,
+               ret = ib_find_cached_gid(cma_dev->device, &gid,
                                         &id_priv->id.port_num, NULL);
                if (!ret) {
                        cma_attach_to_dev(id_priv, cma_dev);
@@ -812,6 +812,7 @@ static int cma_ib_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
                cma_modify_qp_err(&id_priv->id);
                status = ib_event->param.rej_rcvd.reason;
                event = RDMA_CM_EVENT_REJECTED;
+               private_data_len = IB_CM_REJ_PRIVATE_DATA_SIZE;
                break;
        default:
                printk(KERN_ERR "RDMA CMA: unexpected IB CM event: %d",
@@ -1134,8 +1135,8 @@ static int cma_query_ib_route(struct rdma_id_private *id_priv, int timeout_ms,
        struct ib_sa_path_rec path_rec;
 
        memset(&path_rec, 0, sizeof path_rec);
-       path_rec.sgid = *ib_addr_get_sgid(addr);
-       path_rec.dgid = *ib_addr_get_dgid(addr);
+       ib_addr_get_sgid(addr, &path_rec.sgid);
+       ib_addr_get_dgid(addr, &path_rec.dgid);
        path_rec.pkey = cpu_to_be16(ib_addr_get_pkey(addr));
        path_rec.numb_path = 1;
 
@@ -1263,7 +1264,7 @@ static int cma_bind_loopback(struct rdma_id_private *id_priv)
 {
        struct cma_device *cma_dev;
        struct ib_port_attr port_attr;
-       union ib_gid *gid;
+       union ib_gid gid;
        u16 pkey;
        int ret;
        u8 p;
@@ -1284,8 +1285,7 @@ static int cma_bind_loopback(struct rdma_id_private *id_priv)
        }
 
 port_found:
-       gid = ib_addr_get_sgid(&id_priv->id.route.addr.dev_addr);
-       ret = ib_get_cached_gid(cma_dev->device, p, 0, gid);
+       ret = ib_get_cached_gid(cma_dev->device, p, 0, &gid);
        if (ret)
                goto out;
 
@@ -1293,6 +1293,7 @@ port_found:
        if (ret)
                goto out;
 
+       ib_addr_set_sgid(&id_priv->id.route.addr.dev_addr, &gid);
        ib_addr_set_pkey(&id_priv->id.route.addr.dev_addr, pkey);
        id_priv->id.port_num = p;
        cma_attach_to_dev(id_priv, cma_dev);
@@ -1339,6 +1340,7 @@ static int cma_resolve_loopback(struct rdma_id_private *id_priv)
 {
        struct cma_work *work;
        struct sockaddr_in *src_in, *dst_in;
+       union ib_gid gid;
        int ret;
 
        work = kzalloc(sizeof *work, GFP_KERNEL);
@@ -1351,8 +1353,8 @@ static int cma_resolve_loopback(struct rdma_id_private *id_priv)
                        goto err;
        }
 
-       ib_addr_set_dgid(&id_priv->id.route.addr.dev_addr,
-                        ib_addr_get_sgid(&id_priv->id.route.addr.dev_addr));
+       ib_addr_get_sgid(&id_priv->id.route.addr.dev_addr, &gid);
+       ib_addr_set_dgid(&id_priv->id.route.addr.dev_addr, &gid);
 
        if (cma_zero_addr(&id_priv->id.route.addr.src_addr)) {
                src_in = (struct sockaddr_in *)&id_priv->id.route.addr.src_addr;
index 615fe9cc6c568fe9b42dffdf007fda3254c81e1e..86a3b2d401dbaf72bdaadd3533fc9594f67fda03 100644 (file)
@@ -426,7 +426,7 @@ EXPORT_SYMBOL(ib_flush_fmr_pool);
 struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
                                         u64                *page_list,
                                         int                 list_len,
-                                        u64                *io_virtual_address)
+                                        u64                 io_virtual_address)
 {
        struct ib_fmr_pool *pool = pool_handle;
        struct ib_pool_fmr *fmr;
@@ -440,7 +440,7 @@ struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
        fmr = ib_fmr_cache_lookup(pool,
                                  page_list,
                                  list_len,
-                                 *io_virtual_address);
+                                 io_virtual_address);
        if (fmr) {
                /* found in cache */
                ++fmr->ref_count;
@@ -464,7 +464,7 @@ struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
        spin_unlock_irqrestore(&pool->pool_lock, flags);
 
        result = ib_map_phys_fmr(fmr->fmr, page_list, list_len,
-                                *io_virtual_address);