diff --git a/[refs] b/[refs]
index 7cb8e43f90c8..e03bff9db362 100644
--- a/[refs]
+++ b/[refs]
@@ -1,2 +1,2 @@
---
-refs/heads/master: a7df849c67f0a5248693e432d03f738e84d6826c
+refs/heads/master: af6f5e3247a68074e384ef93c0b4bce1b73c9d80
diff --git a/trunk/CREDITS b/trunk/CREDITS
index d65ffe5a4d08..9bd099d960f3 100644
--- a/trunk/CREDITS
+++ b/trunk/CREDITS
@@ -2475,9 +2475,13 @@ S: Potsdam, New York 13676
S: USA
N: Dave Neuer
-E: dave.neuer@pobox.com
+E: dneuer@innovation-charter.com
+E: mr_fred_smoothie@yahoo.com
D: Helped implement support for Compaq's H31xx series iPAQs
D: Other mostly minor tweaks & bugfixes
+S: 325 E. Main St., Suite 3
+S: Carnegie, PA 15105
+S: USA
N: Michael Neuffer
E: mike@i-Connect.Net
diff --git a/trunk/Documentation/DocBook/libata.tmpl b/trunk/Documentation/DocBook/libata.tmpl
index 6df1dfd18b65..cf2fce7707da 100644
--- a/trunk/Documentation/DocBook/libata.tmpl
+++ b/trunk/Documentation/DocBook/libata.tmpl
@@ -14,7 +14,7 @@
- 2003-2005
+ 2003
Jeff Garzik
@@ -44,38 +44,30 @@
-
- Introduction
+
+ Thanks
- libATA is a library used inside the Linux kernel to support ATA host
- controllers and devices. libATA provides an ATA driver API, class
- transports for ATA and ATAPI devices, and SCSI<->ATA translation
- for ATA devices according to the T10 SAT specification.
+ The bulk of the ATA knowledge comes thanks to long conversations with
+ Andre Hedrick (www.linux-ide.org).
- This Guide documents the libATA driver API, library functions, library
- internals, and a couple sample ATA low-level drivers.
+ Thanks to Alan Cox for pointing out similarities
+ between SATA and SCSI, and in general for motivation to hack on
+ libata.
+
+
+ libata's device detection
+ method, ata_pio_devchk, and in general all the early probing was
+ based on extensive study of Hale Landis's probe/reset code in his
+ ATADRVR driver (www.ata-atapi.com).
libata Driver API
-
- struct ata_port_operations is defined for every low-level libata
- hardware driver, and it controls how the low-level driver
- interfaces with the ATA and SCSI layers.
-
-
- FIS-based drivers will hook into the system with ->qc_prep() and
- ->qc_issue() high-level hooks. Hardware which behaves in a manner
- similar to PCI IDE hardware may utilize several generic helpers,
- defining at a bare minimum the bus I/O addresses of the ATA shadow
- register blocks.
-
struct ata_port_operations
- Disable ATA port
void (*port_disable) (struct ata_port *);
@@ -86,9 +78,6 @@ void (*port_disable) (struct ata_port *);
unplug).
-
-
- Post-IDENTIFY device configuration
void (*dev_config) (struct ata_port *, struct ata_device *);
@@ -99,9 +88,6 @@ void (*dev_config) (struct ata_port *, struct ata_device *);
issue of SET FEATURES - XFER MODE, and prior to operation.
-
-
- Set PIO/DMA mode
void (*set_piomode) (struct ata_port *, struct ata_device *);
void (*set_dmamode) (struct ata_port *, struct ata_device *);
@@ -122,9 +108,6 @@ void (*post_set_mode) (struct ata_port *ap);
->set_dma_mode() is only called if DMA is possible.
-
-
- Taskfile read/write
void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf);
void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
@@ -137,9 +120,6 @@ void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
taskfile register values.
-
-
- ATA command execute
void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf);
@@ -149,37 +129,17 @@ void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf);
->tf_load(), to be initiated in hardware.
-
-
- Per-cmd ATAPI DMA capabilities filter
-
-int (*check_atapi_dma) (struct ata_queued_cmd *qc);
-
-
-
-Allow low-level driver to filter ATA PACKET commands, returning a status
-indicating whether or not it is OK to use DMA for the supplied PACKET
-command.
-
-
-
-
- Read specific ATA shadow registers
u8 (*check_status)(struct ata_port *ap);
-u8 (*check_altstatus)(struct ata_port *ap);
-u8 (*check_err)(struct ata_port *ap);
+void (*dev_select)(struct ata_port *ap, unsigned int device);
- Reads the Status/AltStatus/Error ATA shadow register from
- hardware. On some hardware, reading the Status register has
- the side effect of clearing the interrupt condition.
+ Reads the Status ATA shadow register from hardware. On some
+ hardware, this has the side effect of clearing the interrupt
+ condition.
-
-
- Select ATA device on bus
void (*dev_select)(struct ata_port *ap, unsigned int device);
@@ -187,13 +147,9 @@ void (*dev_select)(struct ata_port *ap, unsigned int device);
Issues the low-level hardware command(s) that causes one of N
hardware devices to be considered 'selected' (active and
- available for use) on the ATA bus. This generally has no
-meaning on FIS-based devices.
+ available for use) on the ATA bus.
-
-
- Reset ATA bus
void (*phy_reset) (struct ata_port *ap);
@@ -206,31 +162,17 @@ void (*phy_reset) (struct ata_port *ap);
functions ata_bus_reset() or sata_phy_reset() for this hook.
-
-
- Control PCI IDE BMDMA engine
void (*bmdma_setup) (struct ata_queued_cmd *qc);
void (*bmdma_start) (struct ata_queued_cmd *qc);
-void (*bmdma_stop) (struct ata_port *ap);
-u8 (*bmdma_status) (struct ata_port *ap);
-When setting up an IDE BMDMA transaction, these hooks arm
-(->bmdma_setup), fire (->bmdma_start), and halt (->bmdma_stop)
-the hardware's DMA engine. ->bmdma_status is used to read the standard
-PCI IDE DMA Status register.
+ When setting up an IDE BMDMA transaction, these hooks arm
+ (->bmdma_setup) and fire (->bmdma_start) the hardware's DMA
+ engine.
-
-These hooks are typically either no-ops, or simply not implemented, in
-FIS-based drivers.
-
-
-
-
- High-level taskfile hooks
void (*qc_prep) (struct ata_queued_cmd *qc);
int (*qc_issue) (struct ata_queued_cmd *qc);
@@ -248,26 +190,20 @@ int (*qc_issue) (struct ata_queued_cmd *qc);
->qc_issue is used to make a command active, once the hardware
and S/G tables have been prepared. IDE BMDMA drivers use the
helper function ata_qc_issue_prot() for taskfile protocol-based
- dispatch. More advanced drivers implement their own ->qc_issue.
+ dispatch. More advanced drivers roll their own ->qc_issue
+ implementation, using this as the "issue new ATA command to
+ hardware" hook.
-
-
- Timeout (error) handling
void (*eng_timeout) (struct ata_port *ap);
-This is a high level error handling function, called from the
-error handling thread, when a command times out. Most newer
-hardware will implement its own error handling code here. IDE BMDMA
-drivers may use the helper function ata_eng_timeout().
+ This is a high level error handling function, called from the
+ error handling thread, when a command times out.
-
-
- Hardware interrupt handling
irqreturn_t (*irq_handler)(int, void *, struct pt_regs *);
void (*irq_clear) (struct ata_port *);
@@ -280,9 +216,6 @@ void (*irq_clear) (struct ata_port *);
is quiet.
-
-
- SATA phy read/write
u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
@@ -294,9 +227,6 @@ void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
if ->phy_reset hook called the sata_phy_reset() helper function.
-
-
- Init and shutdown
int (*port_start) (struct ata_port *ap);
void (*port_stop) (struct ata_port *ap);
@@ -310,17 +240,15 @@ void (*host_stop) (struct ata_host_set *host_set);
tasks.
+ ->host_stop() is called when the rmmod or hot unplug process
+ begins. The hook must stop all hardware interrupts, DMA
+ engines, etc.
+
+
->port_stop() is called after ->host_stop(). It's sole function
is to release DMA/memory resources, now that they are no longer
actively being used.
-
- ->host_stop() is called after all ->port_stop() calls
-have completed. The hook must finalize hardware shutdown, release DMA
-and other resources, etc.
-
-
-
@@ -351,24 +279,4 @@ and other resources, etc.
!Idrivers/scsi/sata_sil.c
-
- Thanks
-
- The bulk of the ATA knowledge comes thanks to long conversations with
- Andre Hedrick (www.linux-ide.org), and long hours pondering the ATA
- and SCSI specifications.
-
-
- Thanks to Alan Cox for pointing out similarities
- between SATA and SCSI, and in general for motivation to hack on
- libata.
-
-
- libata's device detection
- method, ata_pio_devchk, and in general all the early probing was
- based on extensive study of Hale Landis's probe/reset code in his
- ATADRVR driver (www.ata-atapi.com).
-
-
-
diff --git a/trunk/Documentation/cpu-freq/cpufreq-stats.txt b/trunk/Documentation/cpu-freq/cpufreq-stats.txt
deleted file mode 100644
index e2d1e760b4ba..000000000000
--- a/trunk/Documentation/cpu-freq/cpufreq-stats.txt
+++ /dev/null
@@ -1,128 +0,0 @@
-
- CPU frequency and voltage scaling statictics in the Linux(TM) kernel
-
-
- L i n u x c p u f r e q - s t a t s d r i v e r
-
- - information for users -
-
-
- Venkatesh Pallipadi
-
-Contents
-1. Introduction
-2. Statistics Provided (with example)
-3. Configuring cpufreq-stats
-
-
-1. Introduction
-
-cpufreq-stats is a driver that provices CPU frequency statistics for each CPU.
-This statistics is provided in /sysfs as a bunch of read_only interfaces. This
-interface (when configured) will appear in a seperate directory under cpufreq
-in /sysfs (/devices/system/cpu/cpuX/cpufreq/stats/) for each CPU.
-Various statistics will form read_only files under this directory.
-
-This driver is designed to be independent of any particular cpufreq_driver
-that may be running on your CPU. So, it will work with any cpufreq_driver.
-
-
-2. Statistics Provided (with example)
-
-cpufreq stats provides following statistics (explained in detail below).
-- time_in_state
-- total_trans
-- trans_table
-
-All the statistics will be from the time the stats driver has been inserted
-to the time when a read of a particular statistic is done. Obviously, stats
-driver will not have any information about the the frequcny transitions before
-the stats driver insertion.
-
---------------------------------------------------------------------------------
-:/sys/devices/system/cpu/cpu0/cpufreq/stats # ls -l
-total 0
-drwxr-xr-x 2 root root 0 May 14 16:06 .
-drwxr-xr-x 3 root root 0 May 14 15:58 ..
--r--r--r-- 1 root root 4096 May 14 16:06 time_in_state
--r--r--r-- 1 root root 4096 May 14 16:06 total_trans
--r--r--r-- 1 root root 4096 May 14 16:06 trans_table
---------------------------------------------------------------------------------
-
-- time_in_state
-This gives the amount of time spent in each of the frequencies supported by
-this CPU. The cat output will have " " pair in each line, which
-will mean this CPU spent usertime units of time at . Output
-will have one line for each of the supported freuencies. usertime units here
-is 10mS (similar to other time exported in /proc).
-
---------------------------------------------------------------------------------
-:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat time_in_state
-3600000 2089
-3400000 136
-3200000 34
-3000000 67
-2800000 172488
---------------------------------------------------------------------------------
-
-
-- total_trans
-This gives the total number of frequency transitions on this CPU. The cat
-output will have a single count which is the total number of frequency
-transitions.
-
---------------------------------------------------------------------------------
-:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat total_trans
-20
---------------------------------------------------------------------------------
-
-- trans_table
-This will give a fine grained information about all the CPU frequency
-transitions. The cat output here is a two dimensional matrix, where an entry
- (row i, column j) represents the count of number of transitions from
-Freq_i to Freq_j. Freq_i is in descending order with increasing rows and
-Freq_j is in descending order with increasing columns. The output here also
-contains the actual freq values for each row and column for better readability.
-
---------------------------------------------------------------------------------
-:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat trans_table
- From : To
- : 3600000 3400000 3200000 3000000 2800000
- 3600000: 0 5 0 0 0
- 3400000: 4 0 2 0 0
- 3200000: 0 1 0 2 0
- 3000000: 0 0 1 0 3
- 2800000: 0 0 0 2 0
---------------------------------------------------------------------------------
-
-
-3. Configuring cpufreq-stats
-
-To configure cpufreq-stats in your kernel
-Config Main Menu
- Power management options (ACPI, APM) --->
- CPU Frequency scaling --->
- [*] CPU Frequency scaling
- <*> CPU frequency translation statistics
- [*] CPU frequency translation statistics details
-
-
-"CPU Frequency scaling" (CONFIG_CPU_FREQ) should be enabled to configure
-cpufreq-stats.
-
-"CPU frequency translation statistics" (CONFIG_CPU_FREQ_STAT) provides the
-basic statistics which includes time_in_state and total_trans.
-
-"CPU frequency translation statistics details" (CONFIG_CPU_FREQ_STAT_DETAILS)
-provides fine grained cpufreq stats by trans_table. The reason for having a
-seperate config option for trans_table is:
-- trans_table goes against the traditional /sysfs rule of one value per
- interface. It provides a whole bunch of value in a 2 dimensional matrix
- form.
-
-Once these two options are enabled and your CPU supports cpufrequency, you
-will be able to see the CPU frequency statistics in /sysfs.
-
-
-
-
diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS
index 65ad8251e4bc..97bc927d2c55 100644
--- a/trunk/MAINTAINERS
+++ b/trunk/MAINTAINERS
@@ -239,12 +239,6 @@ L: linux-usb-devel@lists.sourceforge.net
W: http://www.linux-usb.org/SpeedTouch/
S: Maintained
-ALI1563 I2C DRIVER
-P: Rudolf Marek
-M: r.marek@sh.cvut.cz
-L: sensors@stimpy.netroedge.com
-S: Maintained
-
ALPHA PORT
P: Richard Henderson
M: rth@twiddle.net
diff --git a/trunk/Makefile b/trunk/Makefile
index 9e005e18c71c..c11a317ea910 100644
--- a/trunk/Makefile
+++ b/trunk/Makefile
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 12
-EXTRAVERSION =-rc6
+EXTRAVERSION =-rc5
NAME=Woozy Numbat
# *DOCUMENTATION*
diff --git a/trunk/arch/arm/Kconfig b/trunk/arch/arm/Kconfig
index 5eee3bcb22b5..bf397a9f8ac2 100644
--- a/trunk/arch/arm/Kconfig
+++ b/trunk/arch/arm/Kconfig
@@ -497,7 +497,7 @@ source "drivers/cpufreq/Kconfig"
config CPU_FREQ_SA1100
bool
- depends on CPU_FREQ && (SA1100_H3100 || SA1100_H3600 || SA1100_H3800 || SA1100_LART || SA1100_PLEB || SA1100_BADGE4 || SA1100_HACKKIT)
+ depends on CPU_FREQ && (SA1100_LART || SA1100_PLEB)
default y
config CPU_FREQ_SA1110
diff --git a/trunk/arch/arm/boot/compressed/head-xscale.S b/trunk/arch/arm/boot/compressed/head-xscale.S
index d3fe2533907e..665bd2c20743 100644
--- a/trunk/arch/arm/boot/compressed/head-xscale.S
+++ b/trunk/arch/arm/boot/compressed/head-xscale.S
@@ -47,10 +47,3 @@ __XScale_start:
orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00)
#endif
-#ifdef CONFIG_ARCH_IXP2000
- mov r1, #-1
- mov r0, #0xd6000000
- str r1, [r0, #0x14]
- str r1, [r0, #0x18]
-#endif
-
diff --git a/trunk/arch/arm/configs/badge4_defconfig b/trunk/arch/arm/configs/badge4_defconfig
index 5d92af975d87..2b4059d2f8e4 100644
--- a/trunk/arch/arm/configs/badge4_defconfig
+++ b/trunk/arch/arm/configs/badge4_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.12-rc6-git3
-# Thu Jun 9 19:00:50 2005
+# Linux kernel version: 2.6.12-rc1-bk2
+# Sat Mar 26 21:32:26 2005
#
CONFIG_ARM=y
CONFIG_MMU=y
@@ -16,7 +16,6 @@ CONFIG_GENERIC_IOMAP=y
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
#
# General setup
@@ -35,8 +34,6 @@ CONFIG_EMBEDDED=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
# CONFIG_KALLSYMS_EXTRA_PASS is not set
-CONFIG_PRINTK=y
-CONFIG_BUG=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
@@ -112,6 +109,7 @@ CONFIG_CPU_ABRT_EV4=y
CONFIG_CPU_CACHE_V4WB=y
CONFIG_CPU_CACHE_VIVT=y
CONFIG_CPU_TLB_V4WB=y
+CONFIG_CPU_MINICACHE=y
#
# Processor Features
@@ -124,7 +122,6 @@ CONFIG_FORCE_MAX_ZONEORDER=9
# Bus support
#
CONFIG_ISA=y
-CONFIG_ISA_DMA_API=y
#
# PCCARD (PCMCIA/CardBus) support
@@ -134,7 +131,6 @@ CONFIG_ISA_DMA_API=y
#
# Kernel Features
#
-# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
CONFIG_DISCONTIGMEM=y
# CONFIG_LEDS is not set
@@ -156,14 +152,12 @@ CONFIG_CPU_FREQ_TABLE=y
# CONFIG_CPU_FREQ_DEBUG is not set
CONFIG_CPU_FREQ_STAT=y
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
-CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
-CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
-# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
-CONFIG_CPU_FREQ_SA1100=y
#
# Floating point emulation
@@ -300,6 +294,7 @@ CONFIG_PARPORT_NOT_PC=y
#
# Block devices
#
+# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_PARIDE is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
@@ -433,6 +428,7 @@ CONFIG_NET=y
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
+# CONFIG_NETLINK_DEV is not set
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
@@ -530,7 +526,6 @@ CONFIG_IRDA_ULTRA=y
# CONFIG_SMC_IRCC_FIR is not set
# CONFIG_ALI_FIR is not set
CONFIG_SA1100_FIR=y
-# CONFIG_VIA_FIR is not set
CONFIG_BT=m
CONFIG_BT_L2CAP=m
# CONFIG_BT_SCO is not set
@@ -623,6 +618,7 @@ CONFIG_NET_WIRELESS=y
#
# CONFIG_SERIO is not set
# CONFIG_GAMEPORT is not set
+CONFIG_SOUND_GAMEPORT=y
#
# Character devices
@@ -691,6 +687,7 @@ CONFIG_RTC=m
#
# TPM devices
#
+# CONFIG_TCG_TPM is not set
#
# I2C support
@@ -739,7 +736,6 @@ CONFIG_I2C_ELEKTOR=m
# CONFIG_SENSORS_LM85 is not set
# CONFIG_SENSORS_LM87 is not set
# CONFIG_SENSORS_LM90 is not set
-# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_MAX1619 is not set
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_SMSC47B397 is not set
@@ -751,7 +747,6 @@ CONFIG_I2C_ELEKTOR=m
#
# Other I2C Chip support
#
-# CONFIG_SENSORS_DS1337 is not set
# CONFIG_SENSORS_EEPROM is not set
# CONFIG_SENSORS_PCF8574 is not set
# CONFIG_SENSORS_PCF8591 is not set
@@ -876,6 +871,7 @@ CONFIG_USB_PRINTER=m
#
CONFIG_USB_STORAGE=y
CONFIG_USB_STORAGE_DEBUG=y
+# CONFIG_USB_STORAGE_RW_DETECT is not set
# CONFIG_USB_STORAGE_DATAFAB is not set
# CONFIG_USB_STORAGE_FREECOM is not set
# CONFIG_USB_STORAGE_ISD200 is not set
@@ -958,11 +954,9 @@ CONFIG_USB_USS720=m
#
CONFIG_USB_SERIAL=m
CONFIG_USB_SERIAL_GENERIC=y
-# CONFIG_USB_SERIAL_AIRPRIME is not set
CONFIG_USB_SERIAL_BELKIN=m
CONFIG_USB_SERIAL_WHITEHEAT=m
CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
-# CONFIG_USB_SERIAL_CP2101 is not set
# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
CONFIG_USB_SERIAL_EMPEG=m
CONFIG_USB_SERIAL_FTDI_SIO=m
@@ -991,7 +985,6 @@ CONFIG_USB_SERIAL_KEYSPAN=m
# CONFIG_USB_SERIAL_KOBIL_SCT is not set
CONFIG_USB_SERIAL_MCT_U232=m
CONFIG_USB_SERIAL_PL2303=m
-# CONFIG_USB_SERIAL_HP4X is not set
# CONFIG_USB_SERIAL_SAFE is not set
# CONFIG_USB_SERIAL_TI is not set
CONFIG_USB_SERIAL_CYBERJACK=m
diff --git a/trunk/arch/arm/configs/h3600_defconfig b/trunk/arch/arm/configs/h3600_defconfig
index b9de07de80fe..b4e297dd54b2 100644
--- a/trunk/arch/arm/configs/h3600_defconfig
+++ b/trunk/arch/arm/configs/h3600_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.12-rc4
-# Thu Jun 9 01:59:03 2005
+# Linux kernel version: 2.6.12-rc1-bk2
+# Mon Mar 28 00:02:26 2005
#
CONFIG_ARM=y
CONFIG_MMU=y
@@ -16,7 +16,6 @@ CONFIG_GENERIC_IOMAP=y
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
#
# General setup
@@ -34,8 +33,6 @@ CONFIG_KOBJECT_UEVENT=y
# CONFIG_EMBEDDED is not set
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
-CONFIG_PRINTK=y
-CONFIG_BUG=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
@@ -123,7 +120,6 @@ CONFIG_CPU_MINICACHE=y
# Bus support
#
CONFIG_ISA=y
-CONFIG_ISA_DMA_API=y
#
# PCCARD (PCMCIA/CardBus) support
@@ -142,7 +138,6 @@ CONFIG_PCMCIA_SA1100=y
#
# Kernel Features
#
-# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
CONFIG_DISCONTIGMEM=y
# CONFIG_LEDS is not set
@@ -164,13 +159,12 @@ CONFIG_CPU_FREQ_TABLE=y
# CONFIG_CPU_FREQ_DEBUG is not set
CONFIG_CPU_FREQ_STAT=y
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
-CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
-# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
-CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
-CONFIG_CPU_FREQ_SA1100=y
#
# Floating point emulation
@@ -304,6 +298,7 @@ CONFIG_MTD_SA1100=y
#
# Block devices
#
+# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
@@ -384,6 +379,7 @@ CONFIG_NET=y
# Networking options
#
# CONFIG_PACKET is not set
+# CONFIG_NETLINK_DEV is not set
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
@@ -480,7 +476,6 @@ CONFIG_IRCOMM=m
# CONFIG_SMC_IRCC_FIR is not set
# CONFIG_ALI_FIR is not set
CONFIG_SA1100_FIR=m
-# CONFIG_VIA_FIR is not set
# CONFIG_BT is not set
CONFIG_NETDEVICES=y
# CONFIG_DUMMY is not set
@@ -652,6 +647,7 @@ CONFIG_LEGACY_PTY_COUNT=256
#
# TPM devices
#
+# CONFIG_TCG_TPM is not set
#
# I2C support
@@ -680,11 +676,9 @@ CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_SOFT_CURSOR=y
-# CONFIG_FB_MACMODES is not set
# CONFIG_FB_MODE_HELPERS is not set
# CONFIG_FB_TILEBLITTING is not set
CONFIG_FB_SA1100=y
-# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_VIRTUAL is not set
#
diff --git a/trunk/arch/arm/configs/hackkit_defconfig b/trunk/arch/arm/configs/hackkit_defconfig
index fb41a36a5a68..6987c8c5ddb4 100644
--- a/trunk/arch/arm/configs/hackkit_defconfig
+++ b/trunk/arch/arm/configs/hackkit_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.12-rc6-git3
-# Thu Jun 9 20:58:58 2005
+# Linux kernel version: 2.6.12-rc1-bk2
+# Mon Mar 28 00:22:34 2005
#
CONFIG_ARM=y
CONFIG_MMU=y
@@ -16,7 +16,6 @@ CONFIG_GENERIC_IOMAP=y
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
#
# General setup
@@ -35,8 +34,6 @@ CONFIG_KOBJECT_UEVENT=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
# CONFIG_KALLSYMS_EXTRA_PASS is not set
-CONFIG_PRINTK=y
-CONFIG_BUG=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
@@ -112,6 +109,7 @@ CONFIG_CPU_ABRT_EV4=y
CONFIG_CPU_CACHE_V4WB=y
CONFIG_CPU_CACHE_VIVT=y
CONFIG_CPU_TLB_V4WB=y
+CONFIG_CPU_MINICACHE=y
#
# Processor Features
@@ -121,7 +119,6 @@ CONFIG_CPU_TLB_V4WB=y
# Bus support
#
CONFIG_ISA=y
-CONFIG_ISA_DMA_API=y
#
# PCCARD (PCMCIA/CardBus) support
@@ -131,7 +128,6 @@ CONFIG_ISA_DMA_API=y
#
# Kernel Features
#
-# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
CONFIG_DISCONTIGMEM=y
CONFIG_LEDS=y
@@ -155,14 +151,12 @@ CONFIG_CPU_FREQ_TABLE=y
# CONFIG_CPU_FREQ_DEBUG is not set
CONFIG_CPU_FREQ_STAT=y
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
-CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
-CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
-# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
-CONFIG_CPU_FREQ_SA1100=y
#
# Floating point emulation
@@ -286,6 +280,7 @@ CONFIG_MTD_CFI_UTIL=y
#
# Block devices
#
+# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
# CONFIG_BLK_DEV_LOOP is not set
@@ -343,6 +338,7 @@ CONFIG_NET=y
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
+# CONFIG_NETLINK_DEV is not set
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
@@ -488,6 +484,7 @@ CONFIG_SERIO=y
CONFIG_SERIO_SERPORT=y
# CONFIG_SERIO_RAW is not set
# CONFIG_GAMEPORT is not set
+CONFIG_SOUND_GAMEPORT=y
#
# Character devices
@@ -536,6 +533,7 @@ CONFIG_LEGACY_PTY_COUNT=256
#
# TPM devices
#
+# CONFIG_TCG_TPM is not set
#
# I2C support
diff --git a/trunk/arch/arm/kernel/entry-armv.S b/trunk/arch/arm/kernel/entry-armv.S
index e14278d59882..4eb36155dc93 100644
--- a/trunk/arch/arm/kernel/entry-armv.S
+++ b/trunk/arch/arm/kernel/entry-armv.S
@@ -269,7 +269,7 @@ __pabt_svc:
add r5, sp, #S_PC
ldmia r7, {r2 - r4} @ Get USR pc, cpsr
-#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
+#if __LINUX_ARM_ARCH__ < 6
@ make sure our user space atomic helper is aborted
cmp r2, #VIRT_OFFSET
bichs r3, r3, #PSR_Z_BIT
@@ -616,17 +616,11 @@ __kuser_helper_start:
__kuser_cmpxchg: @ 0xffff0fc0
-#if defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
+#if __LINUX_ARM_ARCH__ < 6
- /*
- * Poor you. No fast solution possible...
- * The kernel itself must perform the operation.
- * A special ghost syscall is used for that (see traps.c).
- */
- swi #0x9ffff0
- mov pc, lr
-
-#elif __LINUX_ARM_ARCH__ < 6
+#ifdef CONFIG_SMP /* sanity check */
+#error "CONFIG_SMP on a machine supporting pre-ARMv6 processors?"
+#endif
/*
* Theory of operation:
diff --git a/trunk/arch/arm/kernel/traps.c b/trunk/arch/arm/kernel/traps.c
index 45d2a032d890..14df16b983f4 100644
--- a/trunk/arch/arm/kernel/traps.c
+++ b/trunk/arch/arm/kernel/traps.c
@@ -464,55 +464,6 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
#endif
return 0;
-#ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG
- /*
- * Atomically store r1 in *r2 if *r2 is equal to r0 for user space.
- * Return zero in r0 if *MEM was changed or non-zero if no exchange
- * happened. Also set the user C flag accordingly.
- * If access permissions have to be fixed up then non-zero is
- * returned and the operation has to be re-attempted.
- *
- * *NOTE*: This is a ghost syscall private to the kernel. Only the
- * __kuser_cmpxchg code in entry-armv.S should be aware of its
- * existence. Don't ever use this from user code.
- */
- case 0xfff0:
- {
- extern void do_DataAbort(unsigned long addr, unsigned int fsr,
- struct pt_regs *regs);
- unsigned long val;
- unsigned long addr = regs->ARM_r2;
- struct mm_struct *mm = current->mm;
- pgd_t *pgd; pmd_t *pmd; pte_t *pte;
-
- regs->ARM_cpsr &= ~PSR_C_BIT;
- spin_lock(&mm->page_table_lock);
- pgd = pgd_offset(mm, addr);
- if (!pgd_present(*pgd))
- goto bad_access;
- pmd = pmd_offset(pgd, addr);
- if (!pmd_present(*pmd))
- goto bad_access;
- pte = pte_offset_map(pmd, addr);
- if (!pte_present(*pte) || !pte_write(*pte))
- goto bad_access;
- val = *(unsigned long *)addr;
- val -= regs->ARM_r0;
- if (val == 0) {
- *(unsigned long *)addr = regs->ARM_r1;
- regs->ARM_cpsr |= PSR_C_BIT;
- }
- spin_unlock(&mm->page_table_lock);
- return val;
-
- bad_access:
- spin_unlock(&mm->page_table_lock);
- /* simulate a read access fault */
- do_DataAbort(addr, 15 + (1 << 11), regs);
- return -1;
- }
-#endif
-
default:
/* Calls 9f00xx..9f07ff are defined to return -ENOSYS
if not implemented, rather than raising SIGILL. This
diff --git a/trunk/arch/arm/lib/io-writesw-armv4.S b/trunk/arch/arm/lib/io-writesw-armv4.S
index 5e240e452af6..6d1d7c27806e 100644
--- a/trunk/arch/arm/lib/io-writesw-armv4.S
+++ b/trunk/arch/arm/lib/io-writesw-armv4.S
@@ -87,9 +87,9 @@ ENTRY(__raw_writesw)
subs r2, r2, #2
orr ip, ip, r3, push_hbyte1
strh ip, [r0]
- bpl 1b
+ bpl 2b
- tst r2, #1
-3: movne ip, r3, lsr #8
+3: tst r2, #1
+2: movne ip, r3, lsr #8
strneh ip, [r0]
mov pc, lr
diff --git a/trunk/arch/arm/mach-pxa/mainstone.c b/trunk/arch/arm/mach-pxa/mainstone.c
index 6823ae28ae6a..3f952237ae3d 100644
--- a/trunk/arch/arm/mach-pxa/mainstone.c
+++ b/trunk/arch/arm/mach-pxa/mainstone.c
@@ -304,15 +304,6 @@ static void __init mainstone_map_io(void)
PWER = 0xC0000002;
PRER = 0x00000002;
PFER = 0x00000002;
- /* for use I SRAM as framebuffer. */
- PSLR |= 0xF04;
- PCFR = 0x66;
- /* For Keypad wakeup. */
- KPC &=~KPC_ASACT;
- KPC |=KPC_AS;
- PKWR = 0x000FD000;
- /* Need read PKWR back after set it. */
- PKWR;
}
MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
diff --git a/trunk/arch/arm/mach-pxa/pm.c b/trunk/arch/arm/mach-pxa/pm.c
index 9799fe80df23..82a4bf34c251 100644
--- a/trunk/arch/arm/mach-pxa/pm.c
+++ b/trunk/arch/arm/mach-pxa/pm.c
@@ -29,6 +29,9 @@
*/
#undef DEBUG
+extern void pxa_cpu_suspend(void);
+extern void pxa_cpu_resume(void);
+
#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
@@ -60,12 +63,6 @@ enum { SLEEP_SAVE_START = 0,
SLEEP_SAVE_ICMR,
SLEEP_SAVE_CKEN,
-#ifdef CONFIG_PXA27x
- SLEEP_SAVE_MDREFR,
- SLEEP_SAVE_PWER, SLEEP_SAVE_PCFR, SLEEP_SAVE_PRER,
- SLEEP_SAVE_PFER, SLEEP_SAVE_PKWR,
-#endif
-
SLEEP_SAVE_CKSUM,
SLEEP_SAVE_SIZE
@@ -78,7 +75,9 @@ static int pxa_pm_enter(suspend_state_t state)
unsigned long checksum = 0;
struct timespec delta, rtc;
int i;
- extern void pxa_cpu_pm_enter(suspend_state_t state);
+
+ if (state != PM_SUSPEND_MEM)
+ return -EINVAL;
#ifdef CONFIG_IWMMXT
/* force any iWMMXt context to ram **/
@@ -101,17 +100,16 @@ static int pxa_pm_enter(suspend_state_t state)
SAVE(GAFR2_L); SAVE(GAFR2_U);
#ifdef CONFIG_PXA27x
- SAVE(MDREFR);
SAVE(GPLR3); SAVE(GPDR3); SAVE(GRER3); SAVE(GFER3); SAVE(PGSR3);
SAVE(GAFR3_L); SAVE(GAFR3_U);
- SAVE(PWER); SAVE(PCFR); SAVE(PRER);
- SAVE(PFER); SAVE(PKWR);
#endif
SAVE(ICMR);
ICMR = 0;
SAVE(CKEN);
+ CKEN = 0;
+
SAVE(PSTR);
/* Note: wake up source are set up in each machine specific files */
@@ -125,13 +123,16 @@ static int pxa_pm_enter(suspend_state_t state)
/* Clear sleep reset status */
RCSR = RCSR_SMR;
+ /* set resume return address */
+ PSPR = virt_to_phys(pxa_cpu_resume);
+
/* before sleeping, calculate and save a checksum */
for (i = 0; i < SLEEP_SAVE_SIZE - 1; i++)
checksum += sleep_save[i];
sleep_save[SLEEP_SAVE_CKSUM] = checksum;
/* *** go zzz *** */
- pxa_cpu_pm_enter(state);
+ pxa_cpu_suspend();
/* after sleeping, validate the checksum */
checksum = 0;
@@ -144,7 +145,7 @@ static int pxa_pm_enter(suspend_state_t state)
LUB_HEXLED = 0xbadbadc5;
#endif
while (1)
- pxa_cpu_pm_enter(state);
+ pxa_cpu_suspend();
}
/* ensure not to come back here if it wasn't intended */
@@ -161,11 +162,8 @@ static int pxa_pm_enter(suspend_state_t state)
RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2);
#ifdef CONFIG_PXA27x
- RESTORE(MDREFR);
RESTORE(GAFR3_L); RESTORE(GAFR3_U); RESTORE_GPLEVEL(3);
RESTORE(GPDR3); RESTORE(GRER3); RESTORE(GFER3); RESTORE(PGSR3);
- RESTORE(PWER); RESTORE(PCFR); RESTORE(PRER);
- RESTORE(PFER); RESTORE(PKWR);
#endif
PSSR = PSSR_RDH | PSSR_PH;
@@ -199,9 +197,7 @@ unsigned long sleep_phys_sp(void *sp)
*/
static int pxa_pm_prepare(suspend_state_t state)
{
- extern int pxa_cpu_pm_prepare(suspend_state_t state);
-
- return pxa_cpu_pm_prepare(state);
+ return 0;
}
/*
diff --git a/trunk/arch/arm/mach-pxa/pxa25x.c b/trunk/arch/arm/mach-pxa/pxa25x.c
index b6d945a6e774..e887b7175ef3 100644
--- a/trunk/arch/arm/mach-pxa/pxa25x.c
+++ b/trunk/arch/arm/mach-pxa/pxa25x.c
@@ -102,32 +102,3 @@ unsigned int get_lcdclk_frequency_10khz(void)
}
EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
-
-
-int pxa_cpu_pm_prepare(suspend_state_t state)
-{
- switch (state) {
- case PM_SUSPEND_MEM:
- break;
- default:
- return -EINVAL;
- }
-
- return 0;
-}
-
-void pxa_cpu_pm_enter(suspend_state_t state)
-{
- extern void pxa_cpu_suspend(unsigned int);
- extern void pxa_cpu_resume(void);
-
- CKEN = 0;
-
- switch (state) {
- case PM_SUSPEND_MEM:
- /* set resume return address */
- PSPR = virt_to_phys(pxa_cpu_resume);
- pxa_cpu_suspend(3);
- break;
- }
-}
diff --git a/trunk/arch/arm/mach-pxa/pxa27x.c b/trunk/arch/arm/mach-pxa/pxa27x.c
index aa3c3b2ab75e..7e863afefb53 100644
--- a/trunk/arch/arm/mach-pxa/pxa27x.c
+++ b/trunk/arch/arm/mach-pxa/pxa27x.c
@@ -120,38 +120,6 @@ EXPORT_SYMBOL(get_clk_frequency_khz);
EXPORT_SYMBOL(get_memclk_frequency_10khz);
EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
-int pxa_cpu_pm_prepare(suspend_state_t state)
-{
- switch (state) {
- case PM_SUSPEND_MEM:
- return 0;
- default:
- return -EINVAL;
- }
-}
-
-void pxa_cpu_pm_enter(suspend_state_t state)
-{
- extern void pxa_cpu_standby(void);
- extern void pxa_cpu_suspend(unsigned int);
- extern void pxa_cpu_resume(void);
-
- CKEN = CKEN22_MEMC | CKEN9_OSTIMER;
-
- /* ensure voltage-change sequencer not initiated, which hangs */
- PCFR &= ~PCFR_FVC;
-
- /* Clear edge-detect status register. */
- PEDR = 0xDF12FE1B;
-
- switch (state) {
- case PM_SUSPEND_MEM:
- /* set resume return address */
- PSPR = virt_to_phys(pxa_cpu_resume);
- pxa_cpu_suspend(3);
- break;
- }
-}
/*
* device registration specific to PXA27x.
diff --git a/trunk/arch/arm/mach-s3c2410/dma.c b/trunk/arch/arm/mach-s3c2410/dma.c
index c7c28890d406..bc229fab86d4 100644
--- a/trunk/arch/arm/mach-s3c2410/dma.c
+++ b/trunk/arch/arm/mach-s3c2410/dma.c
@@ -785,10 +785,6 @@ int s3c2410_dma_free(dmach_t channel, s3c2410_dma_client_t *client)
chan->client = NULL;
chan->in_use = 0;
- if (chan->irq_claimed)
- free_irq(chan->irq, (void *)chan);
- chan->irq_claimed = 0;
-
local_irq_restore(flags);
return 0;
diff --git a/trunk/arch/arm/mach-sa1100/Kconfig b/trunk/arch/arm/mach-sa1100/Kconfig
index 6923316b3d0d..50cde576dadf 100644
--- a/trunk/arch/arm/mach-sa1100/Kconfig
+++ b/trunk/arch/arm/mach-sa1100/Kconfig
@@ -150,7 +150,7 @@ config SA1100_SSP
config H3600_SLEEVE
tristate "Compaq iPAQ Handheld sleeve support"
- depends on SA1100_H3100 || SA1100_H3600
+ depends on SA1100_H3600
help
Choose this option to enable support for extension packs (sleeves)
for the Compaq iPAQ H3XXX series of handheld computers. This option
diff --git a/trunk/arch/arm/mm/Kconfig b/trunk/arch/arm/mm/Kconfig
index 3fefb43c67f7..48bac7da8c70 100644
--- a/trunk/arch/arm/mm/Kconfig
+++ b/trunk/arch/arm/mm/Kconfig
@@ -228,6 +228,7 @@ config CPU_SA1100
select CPU_CACHE_V4WB
select CPU_CACHE_VIVT
select CPU_TLB_V4WB
+ select CPU_MINICACHE
# XScale
config CPU_XSCALE
@@ -238,6 +239,7 @@ config CPU_XSCALE
select CPU_ABRT_EV5T
select CPU_CACHE_VIVT
select CPU_TLB_V4WBI
+ select CPU_MINICACHE
# ARMv6
config CPU_V6
@@ -343,6 +345,11 @@ config CPU_TLB_V4WBI
config CPU_TLB_V6
bool
+config CPU_MINICACHE
+ bool
+ help
+ Processor has a minicache.
+
comment "Processor Features"
config ARM_THUMB
@@ -422,11 +429,3 @@ config HAS_TLS_REG
assume directly accessing that register and always obtain the
expected value only on ARMv7 and above.
-config NEEDS_SYSCALL_FOR_CMPXCHG
- bool
- default y if SMP && (CPU_32v5 || CPU_32v4 || CPU_32v3)
- help
- SMP on a pre-ARMv6 processor? Well OK then.
- Forget about fast user space cmpxchg support.
- It is just not possible.
-
diff --git a/trunk/arch/arm/mm/Makefile b/trunk/arch/arm/mm/Makefile
index 59f47d4c2dfe..ccf316c11e02 100644
--- a/trunk/arch/arm/mm/Makefile
+++ b/trunk/arch/arm/mm/Makefile
@@ -31,6 +31,8 @@ obj-$(CONFIG_CPU_COPY_V6) += copypage-v6.o mmu.o
obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o
obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o
+obj-$(CONFIG_CPU_MINICACHE) += minicache.o
+
obj-$(CONFIG_CPU_TLB_V3) += tlb-v3.o
obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o
obj-$(CONFIG_CPU_TLB_V4WB) += tlb-v4wb.o
diff --git a/trunk/arch/arm/mm/copypage-xscale.S b/trunk/arch/arm/mm/copypage-xscale.S
new file mode 100644
index 000000000000..bb277316ef52
--- /dev/null
+++ b/trunk/arch/arm/mm/copypage-xscale.S
@@ -0,0 +1,113 @@
+/*
+ * linux/arch/arm/lib/copypage-xscale.S
+ *
+ * Copyright (C) 2001 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include
+#include
+#include
+
+/*
+ * General note:
+ * We don't really want write-allocate cache behaviour for these functions
+ * since that will just eat through 8K of the cache.
+ */
+
+ .text
+ .align 5
+/*
+ * XScale optimised copy_user_page
+ * r0 = destination
+ * r1 = source
+ * r2 = virtual user address of ultimate destination page
+ *
+ * The source page may have some clean entries in the cache already, but we
+ * can safely ignore them - break_cow() will flush them out of the cache
+ * if we eventually end up using our copied page.
+ *
+ * What we could do is use the mini-cache to buffer reads from the source
+ * page. We rely on the mini-cache being smaller than one page, so we'll
+ * cycle through the complete cache anyway.
+ */
+ENTRY(xscale_mc_copy_user_page)
+ stmfd sp!, {r4, r5, lr}
+ mov r5, r0
+ mov r0, r1
+ bl map_page_minicache
+ mov r1, r5
+ mov lr, #PAGE_SZ/64-1
+
+ /*
+ * Strangely enough, best performance is achieved
+ * when prefetching destination as well. (NP)
+ */
+ pld [r0, #0]
+ pld [r0, #32]
+ pld [r1, #0]
+ pld [r1, #32]
+
+1: pld [r0, #64]
+ pld [r0, #96]
+ pld [r1, #64]
+ pld [r1, #96]
+
+2: ldrd r2, [r0], #8
+ ldrd r4, [r0], #8
+ mov ip, r1
+ strd r2, [r1], #8
+ ldrd r2, [r0], #8
+ strd r4, [r1], #8
+ ldrd r4, [r0], #8
+ strd r2, [r1], #8
+ strd r4, [r1], #8
+ mcr p15, 0, ip, c7, c10, 1 @ clean D line
+ ldrd r2, [r0], #8
+ mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
+ ldrd r4, [r0], #8
+ mov ip, r1
+ strd r2, [r1], #8
+ ldrd r2, [r0], #8
+ strd r4, [r1], #8
+ ldrd r4, [r0], #8
+ strd r2, [r1], #8
+ strd r4, [r1], #8
+ mcr p15, 0, ip, c7, c10, 1 @ clean D line
+ subs lr, lr, #1
+ mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
+ bgt 1b
+ beq 2b
+
+ ldmfd sp!, {r4, r5, pc}
+
+ .align 5
+/*
+ * XScale optimised clear_user_page
+ * r0 = destination
+ * r1 = virtual user address of ultimate destination page
+ */
+ENTRY(xscale_mc_clear_user_page)
+ mov r1, #PAGE_SZ/32
+ mov r2, #0
+ mov r3, #0
+1: mov ip, r0
+ strd r2, [r0], #8
+ strd r2, [r0], #8
+ strd r2, [r0], #8
+ strd r2, [r0], #8
+ mcr p15, 0, ip, c7, c10, 1 @ clean D line
+ subs r1, r1, #1
+ mcr p15, 0, ip, c7, c6, 1 @ invalidate D line
+ bne 1b
+ mov pc, lr
+
+ __INITDATA
+
+ .type xscale_mc_user_fns, #object
+ENTRY(xscale_mc_user_fns)
+ .long xscale_mc_clear_user_page
+ .long xscale_mc_copy_user_page
+ .size xscale_mc_user_fns, . - xscale_mc_user_fns
diff --git a/trunk/arch/arm/mm/copypage-xscale.c b/trunk/arch/arm/mm/copypage-xscale.c
deleted file mode 100644
index 42a6ee255ce0..000000000000
--- a/trunk/arch/arm/mm/copypage-xscale.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * linux/arch/arm/lib/copypage-xscale.S
- *
- * Copyright (C) 1995-2005 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This handles the mini data cache, as found on SA11x0 and XScale
- * processors. When we copy a user page page, we map it in such a way
- * that accesses to this page will not touch the main data cache, but
- * will be cached in the mini data cache. This prevents us thrashing
- * the main data cache on page faults.
- */
-#include
-#include
-
-#include
-#include
-#include
-
-/*
- * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
- * specific hacks for copying pages efficiently.
- */
-#define COPYPAGE_MINICACHE 0xffff8000
-
-#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
- L_PTE_CACHEABLE)
-
-#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
-
-static DEFINE_SPINLOCK(minicache_lock);
-
-/*
- * XScale mini-dcache optimised copy_user_page
- *
- * We flush the destination cache lines just before we write the data into the
- * corresponding address. Since the Dcache is read-allocate, this removes the
- * Dcache aliasing issue. The writes will be forwarded to the write buffer,
- * and merged as appropriate.
- */
-static void __attribute__((naked))
-mc_copy_user_page(void *from, void *to)
-{
- /*
- * Strangely enough, best performance is achieved
- * when prefetching destination as well. (NP)
- */
- asm volatile(
- "stmfd sp!, {r4, r5, lr} \n\
- mov lr, %2 \n\
- pld [r0, #0] \n\
- pld [r0, #32] \n\
- pld [r1, #0] \n\
- pld [r1, #32] \n\
-1: pld [r0, #64] \n\
- pld [r0, #96] \n\
- pld [r1, #64] \n\
- pld [r1, #96] \n\
-2: ldrd r2, [r0], #8 \n\
- ldrd r4, [r0], #8 \n\
- mov ip, r1 \n\
- strd r2, [r1], #8 \n\
- ldrd r2, [r0], #8 \n\
- strd r4, [r1], #8 \n\
- ldrd r4, [r0], #8 \n\
- strd r2, [r1], #8 \n\
- strd r4, [r1], #8 \n\
- mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\
- ldrd r2, [r0], #8 \n\
- mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\
- ldrd r4, [r0], #8 \n\
- mov ip, r1 \n\
- strd r2, [r1], #8 \n\
- ldrd r2, [r0], #8 \n\
- strd r4, [r1], #8 \n\
- ldrd r4, [r0], #8 \n\
- strd r2, [r1], #8 \n\
- strd r4, [r1], #8 \n\
- mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\
- subs lr, lr, #1 \n\
- mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\
- bgt 1b \n\
- beq 2b \n\
- ldmfd sp!, {r4, r5, pc} "
- :
- : "r" (from), "r" (to), "I" (PAGE_SIZE / 64 - 1));
-}
-
-void xscale_mc_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
-{
- spin_lock(&minicache_lock);
-
- set_pte(TOP_PTE(COPYPAGE_MINICACHE), pfn_pte(__pa(kfrom) >> PAGE_SHIFT, minicache_pgprot));
- flush_tlb_kernel_page(COPYPAGE_MINICACHE);
-
- mc_copy_user_page((void *)COPYPAGE_MINICACHE, kto);
-
- spin_unlock(&minicache_lock);
-}
-
-/*
- * XScale optimised clear_user_page
- */
-void __attribute__((naked))
-xscale_mc_clear_user_page(void *kaddr, unsigned long vaddr)
-{
- asm volatile(
- "mov r1, %0 \n\
- mov r2, #0 \n\
- mov r3, #0 \n\
-1: mov ip, r0 \n\
- strd r2, [r0], #8 \n\
- strd r2, [r0], #8 \n\
- strd r2, [r0], #8 \n\
- strd r2, [r0], #8 \n\
- mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\
- subs r1, r1, #1 \n\
- mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\
- bne 1b \n\
- mov pc, lr"
- :
- : "I" (PAGE_SIZE / 32));
-}
-
-struct cpu_user_fns xscale_mc_user_fns __initdata = {
- .cpu_clear_user_page = xscale_mc_clear_user_page,
- .cpu_copy_user_page = xscale_mc_copy_user_page,
-};
diff --git a/trunk/arch/arm/mm/minicache.c b/trunk/arch/arm/mm/minicache.c
new file mode 100644
index 000000000000..dedf2ab01b2a
--- /dev/null
+++ b/trunk/arch/arm/mm/minicache.c
@@ -0,0 +1,73 @@
+/*
+ * linux/arch/arm/mm/minicache.c
+ *
+ * Copyright (C) 2001 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This handles the mini data cache, as found on SA11x0 and XScale
+ * processors. When we copy a user page page, we map it in such a way
+ * that accesses to this page will not touch the main data cache, but
+ * will be cached in the mini data cache. This prevents us thrashing
+ * the main data cache on page faults.
+ */
+#include
+#include
+
+#include
+#include
+#include
+
+/*
+ * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
+ * specific hacks for copying pages efficiently.
+ */
+#define minicache_address (0xffff8000)
+#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
+ L_PTE_CACHEABLE)
+
+static pte_t *minicache_pte;
+
+/*
+ * Note that this is intended to be called only from the copy_user_page
+ * asm code; anything else will require special locking to prevent the
+ * mini-cache space being re-used. (Note: probably preempt unsafe).
+ *
+ * We rely on the fact that the minicache is 2K, and we'll be pushing
+ * 4K of data through it, so we don't actually have to specifically
+ * flush the minicache when we change the mapping.
+ *
+ * Note also: assert(PAGE_OFFSET <= virt < high_memory).
+ * Unsafe: preempt, kmap.
+ */
+unsigned long map_page_minicache(unsigned long virt)
+{
+ set_pte(minicache_pte, pfn_pte(__pa(virt) >> PAGE_SHIFT, minicache_pgprot));
+ flush_tlb_kernel_page(minicache_address);
+
+ return minicache_address;
+}
+
+static int __init minicache_init(void)
+{
+ pgd_t *pgd;
+ pmd_t *pmd;
+
+ spin_lock(&init_mm.page_table_lock);
+
+ pgd = pgd_offset_k(minicache_address);
+ pmd = pmd_alloc(&init_mm, pgd, minicache_address);
+ if (!pmd)
+ BUG();
+ minicache_pte = pte_alloc_kernel(&init_mm, pmd, minicache_address);
+ if (!minicache_pte)
+ BUG();
+
+ spin_unlock(&init_mm.page_table_lock);
+
+ return 0;
+}
+
+core_initcall(minicache_init);
diff --git a/trunk/arch/h8300/kernel/process.c b/trunk/arch/h8300/kernel/process.c
index b5f83e9f04db..134aec1c6d19 100644
--- a/trunk/arch/h8300/kernel/process.c
+++ b/trunk/arch/h8300/kernel/process.c
@@ -54,7 +54,7 @@ asmlinkage void ret_from_fork(void);
void default_idle(void)
{
while(1) {
- if (!need_resched()) {
+ if (need_resched()) {
local_irq_enable();
__asm__("sleep");
local_irq_disable();
diff --git a/trunk/arch/i386/kernel/Makefile b/trunk/arch/i386/kernel/Makefile
index 51ecd512603d..0fbcfe00dd8d 100644
--- a/trunk/arch/i386/kernel/Makefile
+++ b/trunk/arch/i386/kernel/Makefile
@@ -43,7 +43,7 @@ obj-$(CONFIG_SCx200) += scx200.o
# Note: kbuild does not track this dependency due to usage of .incbin
$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so
targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so)
-targets += vsyscall-note.o vsyscall.lds
+targets += vsyscall.lds
# The DSO images are built using a special linker script.
quiet_cmd_syscall = SYSCALL $@
diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/Kconfig b/trunk/arch/i386/kernel/cpu/cpufreq/Kconfig
index 0f1eb507233b..f25ffd74235c 100644
--- a/trunk/arch/i386/kernel/cpu/cpufreq/Kconfig
+++ b/trunk/arch/i386/kernel/cpu/cpufreq/Kconfig
@@ -23,7 +23,7 @@ config X86_ACPI_CPUFREQ
If in doubt, say N.
config ELAN_CPUFREQ
- tristate "AMD Elan SC400 and SC410"
+ tristate "AMD Elan"
select CPU_FREQ_TABLE
depends on X86_ELAN
---help---
@@ -38,18 +38,6 @@ config ELAN_CPUFREQ
If in doubt, say N.
-config SC520_CPUFREQ
- tristate "AMD Elan SC520"
- select CPU_FREQ_TABLE
- depends on X86_ELAN
- ---help---
- This adds the CPUFreq driver for AMD Elan SC520 processor.
-
- For details, take a look at .
-
- If in doubt, say N.
-
-
config X86_POWERNOW_K6
tristate "AMD Mobile K6-2/K6-3 PowerNow!"
select CPU_FREQ_TABLE
diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/Makefile b/trunk/arch/i386/kernel/cpu/cpufreq/Makefile
index 2e894f1c8910..a922e97aeedd 100644
--- a/trunk/arch/i386/kernel/cpu/cpufreq/Makefile
+++ b/trunk/arch/i386/kernel/cpu/cpufreq/Makefile
@@ -3,7 +3,6 @@ obj-$(CONFIG_X86_POWERNOW_K7) += powernow-k7.o
obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o
obj-$(CONFIG_X86_LONGHAUL) += longhaul.o
obj-$(CONFIG_ELAN_CPUFREQ) += elanfreq.o
-obj-$(CONFIG_SC520_CPUFREQ) += sc520_freq.o
obj-$(CONFIG_X86_LONGRUN) += longrun.o
obj-$(CONFIG_X86_GX_SUSPMOD) += gx-suspmod.o
obj-$(CONFIG_X86_SPEEDSTEP_ICH) += speedstep-ich.o
diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/longhaul.c b/trunk/arch/i386/kernel/cpu/cpufreq/longhaul.c
index 04e3563da4fe..ab0f9f5aac11 100644
--- a/trunk/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/trunk/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -29,7 +29,6 @@
#include
#include
#include
-#include
#include
#include
@@ -120,13 +119,7 @@ static int longhaul_get_cpu_mult(void)
static void do_powersaver(union msr_longhaul *longhaul,
unsigned int clock_ratio_index)
{
- struct pci_dev *dev;
- unsigned long flags;
- unsigned int tmp_mask;
int version;
- int i;
- u16 pci_cmd;
- u16 cmd_state[64];
switch (cpu_model) {
case CPU_EZRA_T:
@@ -144,58 +137,17 @@ static void do_powersaver(union msr_longhaul *longhaul,
longhaul->bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
longhaul->bits.EnableSoftBusRatio = 1;
longhaul->bits.RevisionKey = 0;
-
- preempt_disable();
- local_irq_save(flags);
-
- /*
- * get current pci bus master state for all devices
- * and clear bus master bit
- */
- dev = NULL;
- i = 0;
- do {
- dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
- if (dev != NULL) {
- pci_read_config_word(dev, PCI_COMMAND, &pci_cmd);
- cmd_state[i++] = pci_cmd;
- pci_cmd &= ~PCI_COMMAND_MASTER;
- pci_write_config_word(dev, PCI_COMMAND, pci_cmd);
- }
- } while (dev != NULL);
-
- tmp_mask=inb(0x21); /* works on C3. save mask. */
- outb(0xFE,0x21); /* TMR0 only */
- outb(0xFF,0x80); /* delay */
-
- local_irq_enable();
-
- __hlt();
+ local_irq_disable();
wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
+ local_irq_enable();
__hlt();
- local_irq_disable();
-
- outb(tmp_mask,0x21); /* restore mask */
-
- /* restore pci bus master state for all devices */
- dev = NULL;
- i = 0;
- do {
- dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);
- if (dev != NULL) {
- pci_cmd = cmd_state[i++];
- pci_write_config_byte(dev, PCI_COMMAND, pci_cmd);
- }
- } while (dev != NULL);
- local_irq_restore(flags);
- preempt_enable();
-
- /* disable bus ratio bit */
rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);
longhaul->bits.EnableSoftBusRatio = 0;
longhaul->bits.RevisionKey = version;
+ local_irq_disable();
wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
+ local_irq_enable();
}
/**
@@ -626,7 +578,7 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
longhaul_setup_voltagescaling();
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- policy->cpuinfo.transition_latency = 200000; /* nsec */
+ policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
policy->cur = calc_speed(longhaul_get_cpu_mult());
ret = cpufreq_frequency_table_cpuinfo(policy, longhaul_table);
diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
index 5c530064eb74..913f652623d9 100644
--- a/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+++ b/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
@@ -23,7 +23,6 @@
#include
#include
-#include
#include
#include
#include
@@ -587,17 +586,13 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val);
- /* recalibrate cpu_khz */
- result = recalibrate_cpu_khz();
- if (result)
- return result;
-
- fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.CFID];
+ /* A K7 with powernow technology is set to max frequency by BIOS */
+ fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.MFID];
if (!fsb) {
printk(KERN_WARNING PFX "can not determine bus frequency\n");
return -EINVAL;
}
- dprintk("FSB: %3dMHz\n", fsb/1000);
+ dprintk("FSB: %3d.%03d MHz\n", fsb/1000, fsb%1000);
if (dmi_check_system(powernow_dmi_table) || acpi_force) {
printk (KERN_INFO PFX "PSB/PST known to be broken. Trying ACPI instead\n");
diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index 10cc096c0ade..a65ff7e32e5d 100644
--- a/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -4,7 +4,7 @@
* GNU general public license version 2. See "COPYING" or
* http://www.gnu.org/licenses/gpl.html
*
- * Support : mark.langsdorf@amd.com
+ * Support : paul.devriendt@amd.com
*
* Based on the powernow-k7.c module written by Dave Jones.
* (C) 2003 Dave Jones on behalf of SuSE Labs
@@ -15,13 +15,12 @@
*
* Valuable input gratefully received from Dave Jones, Pavel Machek,
* Dominik Brodowski, and others.
- * Originally developed by Paul Devriendt.
* Processor information obtained from Chapter 9 (Power and Thermal Management)
* of the "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD
* Opteron Processors" available for download from www.amd.com
*
* Tables for specific CPUs can be infrerred from
- * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/30430.pdf
+ * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/30430.pdf
*/
#include
@@ -31,7 +30,6 @@
#include
#include
#include
-#include
#include
#include
@@ -44,7 +42,7 @@
#define PFX "powernow-k8: "
#define BFX PFX "BIOS error: "
-#define VERSION "version 1.40.2"
+#define VERSION "version 1.00.09e"
#include "powernow-k8.h"
/* serialize freq changes */
@@ -52,10 +50,6 @@ static DECLARE_MUTEX(fidvid_sem);
static struct powernow_k8_data *powernow_data[NR_CPUS];
-#ifndef CONFIG_SMP
-static cpumask_t cpu_core_map[1];
-#endif
-
/* Return a frequency in MHz, given an input fid */
static u32 find_freq_from_fid(u32 fid)
{
@@ -280,18 +274,11 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid
{
u32 rvosteps = data->rvo;
u32 savefid = data->currfid;
- u32 maxvid, lo;
dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n",
smp_processor_id(),
data->currfid, data->currvid, reqvid, data->rvo);
- rdmsr(MSR_FIDVID_STATUS, lo, maxvid);
- maxvid = 0x1f & (maxvid >> 16);
- dprintk("ph1 maxvid=0x%x\n", maxvid);
- if (reqvid < maxvid) /* lower numbers are higher voltages */
- reqvid = maxvid;
-
while (data->currvid > reqvid) {
dprintk("ph1: curr 0x%x, req vid 0x%x\n",
data->currvid, reqvid);
@@ -299,8 +286,8 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid
return 1;
}
- while ((rvosteps > 0) && ((data->rvo + data->currvid) > reqvid)) {
- if (data->currvid == maxvid) {
+ while ((rvosteps > 0) && ((data->rvo + data->currvid) > reqvid)) {
+ if (data->currvid == 0) {
rvosteps = 0;
} else {
dprintk("ph1: changing vid for rvo, req 0x%x\n",
@@ -684,7 +671,7 @@ static int find_psb_table(struct powernow_k8_data *data)
* BIOS and Kernel Developer's Guide, which is available on
* www.amd.com
*/
- printk(KERN_INFO PFX "BIOS error - no PSB or ACPI _PSS objects\n");
+ printk(KERN_ERR PFX "BIOS error - no PSB\n");
return -ENODEV;
}
@@ -708,7 +695,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
struct cpufreq_frequency_table *powernow_table;
if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) {
- dprintk("register performance failed: bad ACPI data\n");
+ dprintk("register performance failed\n");
return -EIO;
}
@@ -759,23 +746,22 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
continue;
}
- /* verify only 1 entry from the lo frequency table */
- if (fid < HI_FID_TABLE_BOTTOM) {
- if (cntlofreq) {
- /* if both entries are the same, ignore this
- * one...
- */
- if ((powernow_table[i].frequency != powernow_table[cntlofreq].frequency) ||
- (powernow_table[i].index != powernow_table[cntlofreq].index)) {
- printk(KERN_ERR PFX "Too many lo freq table entries\n");
- goto err_out_mem;
- }
-
- dprintk("double low frequency table entry, ignoring it.\n");
- powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
- continue;
- } else
- cntlofreq = i;
+ if (fid < HI_FID_TABLE_BOTTOM) {
+ if (cntlofreq) {
+ /* if both entries are the same, ignore this
+ * one...
+ */
+ if ((powernow_table[i].frequency != powernow_table[cntlofreq].frequency) ||
+ (powernow_table[i].index != powernow_table[cntlofreq].index)) {
+ printk(KERN_ERR PFX "Too many lo freq table entries\n");
+ goto err_out_mem;
+ }
+
+ dprintk("double low frequency table entry, ignoring it.\n");
+ powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
+ continue;
+ } else
+ cntlofreq = i;
}
if (powernow_table[i].frequency != (data->acpi_data.states[i].core_frequency * 1000)) {
@@ -830,7 +816,7 @@ static int transition_frequency(struct powernow_k8_data *data, unsigned int inde
{
u32 fid;
u32 vid;
- int res, i;
+ int res;
struct cpufreq_freqs freqs;
dprintk("cpu %d transition to index %u\n", smp_processor_id(), index);
@@ -855,8 +841,7 @@ static int transition_frequency(struct powernow_k8_data *data, unsigned int inde
}
if ((fid < HI_FID_TABLE_BOTTOM) && (data->currfid < HI_FID_TABLE_BOTTOM)) {
- printk(KERN_ERR PFX
- "ignoring illegal change in lo freq table-%x to 0x%x\n",
+ printk("ignoring illegal change in lo freq table-%x to 0x%x\n",
data->currfid, fid);
return 1;
}
@@ -865,20 +850,18 @@ static int transition_frequency(struct powernow_k8_data *data, unsigned int inde
smp_processor_id(), fid, vid);
freqs.cpu = data->cpu;
+
freqs.old = find_khz_freq_from_fid(data->currfid);
freqs.new = find_khz_freq_from_fid(fid);
- for_each_cpu_mask(i, cpu_core_map[data->cpu]) {
- freqs.cpu = i;
- cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
- }
+ cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+ down(&fidvid_sem);
res = transition_fid_vid(data, fid, vid);
+ up(&fidvid_sem);
freqs.new = find_khz_freq_from_fid(data->currfid);
- for_each_cpu_mask(i, cpu_core_map[data->cpu]) {
- freqs.cpu = i;
- cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
- }
+ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+
return res;
}
@@ -891,7 +874,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
u32 checkvid = data->currvid;
unsigned int newstate;
int ret = -EIO;
- int i;
/* only run on specific CPU from here on */
oldmask = current->cpus_allowed;
@@ -920,41 +902,22 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
data->currfid, data->currvid);
if ((checkvid != data->currvid) || (checkfid != data->currfid)) {
- printk(KERN_INFO PFX
- "error - out of sync, fix 0x%x 0x%x, vid 0x%x 0x%x\n",
- checkfid, data->currfid, checkvid, data->currvid);
+ printk(KERN_ERR PFX
+ "error - out of sync, fid 0x%x 0x%x, vid 0x%x 0x%x\n",
+ checkfid, data->currfid, checkvid, data->currvid);
}
if (cpufreq_frequency_table_target(pol, data->powernow_table, targfreq, relation, &newstate))
goto err_out;
- down(&fidvid_sem);
-
- for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
- /* make sure the sibling is initialized */
- if (!powernow_data[i]) {
- ret = 0;
- up(&fidvid_sem);
- goto err_out;
- }
- }
-
powernow_k8_acpi_pst_values(data, newstate);
if (transition_frequency(data, newstate)) {
printk(KERN_ERR PFX "transition frequency failed\n");
ret = 1;
- up(&fidvid_sem);
goto err_out;
}
- /* Update all the fid/vids of our siblings */
- for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
- powernow_data[i]->currvid = data->currvid;
- powernow_data[i]->currfid = data->currfid;
- }
- up(&fidvid_sem);
-
pol->cur = find_khz_freq_from_fid(data->currfid);
ret = 0;
@@ -999,7 +962,7 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
*/
if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
- printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");
+ printk(KERN_INFO PFX "MP systems not supported by PSB BIOS structure\n");
kfree(data);
return -ENODEV;
}
@@ -1040,7 +1003,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
schedule();
pol->governor = CPUFREQ_DEFAULT_GOVERNOR;
- pol->cpus = cpu_core_map[pol->cpu];
/* Take a crude guess here.
* That guess was in microseconds, so multiply with 1000 */
@@ -1107,7 +1069,7 @@ static unsigned int powernowk8_get (unsigned int cpu)
return 0;
}
preempt_disable();
-
+
if (query_current_values_with_pending_wait(data))
goto out;
@@ -1165,10 +1127,9 @@ static void __exit powernowk8_exit(void)
cpufreq_unregister_driver(&cpufreq_amd64_driver);
}
-MODULE_AUTHOR("Paul Devriendt and Mark Langsdorf ");
MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver.");
MODULE_LICENSE("GPL");
late_initcall(powernowk8_init);
module_exit(powernowk8_exit);
-
diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k8.h b/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
index 9ed5bf221cb7..63ebc8470f52 100644
--- a/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
+++ b/trunk/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
@@ -174,18 +174,3 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvi
static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid);
static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index);
-
-#ifndef for_each_cpu_mask
-#define for_each_cpu_mask(i,mask) for (i=0;i<1;i++)
-#endif
-
-#ifdef CONFIG_SMP
-static inline void define_siblings(int cpu, cpumask_t cpu_sharedcore_mask[])
-{
-}
-#else
-static inline void define_siblings(int cpu, cpumask_t cpu_sharedcore_mask[])
-{
- cpu_set(0, cpu_sharedcore_mask[0]);
-}
-#endif
diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/sc520_freq.c b/trunk/arch/i386/kernel/cpu/cpufreq/sc520_freq.c
deleted file mode 100644
index ef457d50f4ac..000000000000
--- a/trunk/arch/i386/kernel/cpu/cpufreq/sc520_freq.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * sc520_freq.c: cpufreq driver for the AMD Elan sc520
- *
- * Copyright (C) 2005 Sean Young
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Based on elanfreq.c
- *
- * 2005-03-30: - initial revision
- */
-
-#include
-#include
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-
-#define MMCR_BASE 0xfffef000 /* The default base address */
-#define OFFS_CPUCTL 0x2 /* CPU Control Register */
-
-static __u8 __iomem *cpuctl;
-
-#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "sc520_freq", msg)
-
-static struct cpufreq_frequency_table sc520_freq_table[] = {
- {0x01, 100000},
- {0x02, 133000},
- {0, CPUFREQ_TABLE_END},
-};
-
-static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu)
-{
- u8 clockspeed_reg = *cpuctl;
-
- switch (clockspeed_reg & 0x03) {
- default:
- printk(KERN_ERR "sc520_freq: error: cpuctl register has unexpected value %02x\n", clockspeed_reg);
- case 0x01:
- return 100000;
- case 0x02:
- return 133000;
- }
-}
-
-static void sc520_freq_set_cpu_state (unsigned int state)
-{
-
- struct cpufreq_freqs freqs;
- u8 clockspeed_reg;
-
- freqs.old = sc520_freq_get_cpu_frequency(0);
- freqs.new = sc520_freq_table[state].frequency;
- freqs.cpu = 0; /* AMD Elan is UP */
-
- cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
-
- dprintk("attempting to set frequency to %i kHz\n",
- sc520_freq_table[state].frequency);
-
- local_irq_disable();
-
- clockspeed_reg = *cpuctl & ~0x03;
- *cpuctl = clockspeed_reg | sc520_freq_table[state].index;
-
- local_irq_enable();
-
- cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
-};
-
-static int sc520_freq_verify (struct cpufreq_policy *policy)
-{
- return cpufreq_frequency_table_verify(policy, &sc520_freq_table[0]);
-}
-
-static int sc520_freq_target (struct cpufreq_policy *policy,
- unsigned int target_freq,
- unsigned int relation)
-{
- unsigned int newstate = 0;
-
- if (cpufreq_frequency_table_target(policy, sc520_freq_table, target_freq, relation, &newstate))
- return -EINVAL;
-
- sc520_freq_set_cpu_state(newstate);
-
- return 0;
-}
-
-
-/*
- * Module init and exit code
- */
-
-static int sc520_freq_cpu_init(struct cpufreq_policy *policy)
-{
- struct cpuinfo_x86 *c = cpu_data;
- int result;
-
- /* capability check */
- if (c->x86_vendor != X86_VENDOR_AMD ||
- c->x86 != 4 || c->x86_model != 9)
- return -ENODEV;
-
- /* cpuinfo and default policy values */
- policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
- policy->cpuinfo.transition_latency = 1000000; /* 1ms */
- policy->cur = sc520_freq_get_cpu_frequency(0);
-
- result = cpufreq_frequency_table_cpuinfo(policy, sc520_freq_table);
- if (result)
- return (result);
-
- cpufreq_frequency_table_get_attr(sc520_freq_table, policy->cpu);
-
- return 0;
-}
-
-
-static int sc520_freq_cpu_exit(struct cpufreq_policy *policy)
-{
- cpufreq_frequency_table_put_attr(policy->cpu);
- return 0;
-}
-
-
-static struct freq_attr* sc520_freq_attr[] = {
- &cpufreq_freq_attr_scaling_available_freqs,
- NULL,
-};
-
-
-static struct cpufreq_driver sc520_freq_driver = {
- .get = sc520_freq_get_cpu_frequency,
- .verify = sc520_freq_verify,
- .target = sc520_freq_target,
- .init = sc520_freq_cpu_init,
- .exit = sc520_freq_cpu_exit,
- .name = "sc520_freq",
- .owner = THIS_MODULE,
- .attr = sc520_freq_attr,
-};
-
-
-static int __init sc520_freq_init(void)
-{
- struct cpuinfo_x86 *c = cpu_data;
-
- /* Test if we have the right hardware */
- if(c->x86_vendor != X86_VENDOR_AMD ||
- c->x86 != 4 || c->x86_model != 9) {
- dprintk("no Elan SC520 processor found!\n");
- return -ENODEV;
- }
- cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1);
- if(!cpuctl) {
- printk(KERN_ERR "sc520_freq: error: failed to remap memory\n");
- return -ENOMEM;
- }
-
- return cpufreq_register_driver(&sc520_freq_driver);
-}
-
-
-static void __exit sc520_freq_exit(void)
-{
- cpufreq_unregister_driver(&sc520_freq_driver);
- iounmap(cpuctl);
-}
-
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Sean Young ");
-MODULE_DESCRIPTION("cpufreq driver for AMD's Elan sc520 CPU");
-
-module_init(sc520_freq_init);
-module_exit(sc520_freq_exit);
-
diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index 7dcbf70fc16f..07d5612dc00f 100644
--- a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -54,8 +54,6 @@ enum {
CPU_DOTHAN_A1,
CPU_DOTHAN_A2,
CPU_DOTHAN_B0,
- CPU_MP4HT_D0,
- CPU_MP4HT_E0,
};
static const struct cpu_id cpu_ids[] = {
@@ -63,8 +61,6 @@ static const struct cpu_id cpu_ids[] = {
[CPU_DOTHAN_A1] = { 6, 13, 1 },
[CPU_DOTHAN_A2] = { 6, 13, 2 },
[CPU_DOTHAN_B0] = { 6, 13, 6 },
- [CPU_MP4HT_D0] = {15, 3, 4 },
- [CPU_MP4HT_E0] = {15, 4, 1 },
};
#define N_IDS (sizeof(cpu_ids)/sizeof(cpu_ids[0]))
@@ -230,8 +226,6 @@ static struct cpu_model models[] =
{ &cpu_ids[CPU_DOTHAN_A1], NULL, 0, NULL },
{ &cpu_ids[CPU_DOTHAN_A2], NULL, 0, NULL },
{ &cpu_ids[CPU_DOTHAN_B0], NULL, 0, NULL },
- { &cpu_ids[CPU_MP4HT_D0], NULL, 0, NULL },
- { &cpu_ids[CPU_MP4HT_E0], NULL, 0, NULL },
{ NULL, }
};
diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
index d368b3f5fce8..8ba430a9c3a2 100644
--- a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
+++ b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
@@ -336,7 +336,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
if (!prev_speed)
return -EIO;
- dprintk("previous speed is %u\n", prev_speed);
+ dprintk("previous seped is %u\n", prev_speed);
local_irq_save(flags);
@@ -348,7 +348,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
goto out;
}
- dprintk("low speed is %u\n", *low_speed);
+ dprintk("low seped is %u\n", *low_speed);
/* switch to high state */
set_state(SPEEDSTEP_HIGH);
@@ -358,7 +358,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
goto out;
}
- dprintk("high speed is %u\n", *high_speed);
+ dprintk("high seped is %u\n", *high_speed);
if (*low_speed == *high_speed) {
ret = -ENODEV;
diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
index b25fb6b635ae..79440b3f087e 100644
--- a/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/trunk/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
@@ -357,9 +357,6 @@ static int __init speedstep_init(void)
case SPEEDSTEP_PROCESSOR_PIII_C:
case SPEEDSTEP_PROCESSOR_PIII_C_EARLY:
break;
- case SPEEDSTEP_PROCESSOR_P4M:
- printk(KERN_INFO "speedstep-smi: you're trying to use this cpufreq driver on a Pentium 4-based CPU. Most likely it will not work.\n");
- break;
default:
speedstep_processor = 0;
}
diff --git a/trunk/arch/i386/kernel/setup.c b/trunk/arch/i386/kernel/setup.c
index 2bfbddebdbf8..945ec73163c8 100644
--- a/trunk/arch/i386/kernel/setup.c
+++ b/trunk/arch/i386/kernel/setup.c
@@ -1502,13 +1502,11 @@ void __init setup_arch(char **cmdline_p)
if (efi_enabled)
efi_map_memmap();
-#ifdef CONFIG_ACPI_BOOT
/*
* Parse the ACPI tables for possible boot-time SMP configuration.
*/
acpi_boot_table_init();
acpi_boot_init();
-#endif
#ifdef CONFIG_X86_LOCAL_APIC
if (smp_found_config)
diff --git a/trunk/arch/i386/kernel/timers/common.c b/trunk/arch/i386/kernel/timers/common.c
index 8e201219f525..f7f90005e22e 100644
--- a/trunk/arch/i386/kernel/timers/common.c
+++ b/trunk/arch/i386/kernel/timers/common.c
@@ -6,7 +6,6 @@
#include
#include
#include
-#include
#include
#include
@@ -25,7 +24,7 @@
#define CALIBRATE_TIME (5 * 1000020/HZ)
-unsigned long calibrate_tsc(void)
+unsigned long __init calibrate_tsc(void)
{
mach_prepare_counter();
@@ -140,7 +139,7 @@ unsigned long __init calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr)
#endif
/* calculate cpu_khz */
-void init_cpu_khz(void)
+void __init init_cpu_khz(void)
{
if (cpu_has_tsc) {
unsigned long tsc_quotient = calibrate_tsc();
@@ -159,4 +158,3 @@ void init_cpu_khz(void)
}
}
}
-
diff --git a/trunk/arch/i386/kernel/timers/timer_tsc.c b/trunk/arch/i386/kernel/timers/timer_tsc.c
index 180444d87824..7926d967be00 100644
--- a/trunk/arch/i386/kernel/timers/timer_tsc.c
+++ b/trunk/arch/i386/kernel/timers/timer_tsc.c
@@ -320,26 +320,6 @@ core_initcall(cpufreq_tsc);
static inline void cpufreq_delayed_get(void) { return; }
#endif
-int recalibrate_cpu_khz(void)
-{
-#ifndef CONFIG_SMP
- unsigned long cpu_khz_old = cpu_khz;
-
- if (cpu_has_tsc) {
- init_cpu_khz();
- cpu_data[0].loops_per_jiffy =
- cpufreq_scale(cpu_data[0].loops_per_jiffy,
- cpu_khz_old,
- cpu_khz);
- return 0;
- } else
- return -ENODEV;
-#else
- return -ENODEV;
-#endif
-}
-EXPORT_SYMBOL(recalibrate_cpu_khz);
-
static void mark_offset_tsc(void)
{
unsigned long lost,delay;
diff --git a/trunk/arch/ia64/ia32/sys_ia32.c b/trunk/arch/ia64/ia32/sys_ia32.c
index c1e20d65dd6c..247a21c64aea 100644
--- a/trunk/arch/ia64/ia32/sys_ia32.c
+++ b/trunk/arch/ia64/ia32/sys_ia32.c
@@ -2427,7 +2427,7 @@ sys32_epoll_wait(int epfd, struct epoll_event32 __user * events, int maxevents,
{
struct epoll_event *events64 = NULL;
mm_segment_t old_fs = get_fs();
- int numevents, size;
+ int error, numevents, size;
int evt_idx;
int do_free_pages = 0;
diff --git a/trunk/arch/ia64/kernel/fsys.S b/trunk/arch/ia64/kernel/fsys.S
index 962b6c4e32b5..4f3cdef75797 100644
--- a/trunk/arch/ia64/kernel/fsys.S
+++ b/trunk/arch/ia64/kernel/fsys.S
@@ -460,9 +460,9 @@ EX(.fail_efault, ld8 r14=[r33]) // r14 <- *set
;;
st8 [r2]=r14 // update current->blocked with new mask
- cmpxchg4.acq r8=[r9],r18,ar.ccv // current->thread_info->flags <- r18
+ cmpxchg4.acq r14=[r9],r18,ar.ccv // current->thread_info->flags <- r18
;;
- cmp.ne p6,p0=r17,r8 // update failed?
+ cmp.ne p6,p0=r17,r14 // update failed?
(p6) br.cond.spnt.few 1b // yes -> retry
#ifdef CONFIG_SMP
diff --git a/trunk/arch/ia64/kernel/mca.c b/trunk/arch/ia64/kernel/mca.c
index 736e328b5e61..2c75741dcc66 100644
--- a/trunk/arch/ia64/kernel/mca.c
+++ b/trunk/arch/ia64/kernel/mca.c
@@ -1103,6 +1103,8 @@ ia64_mca_cpe_int_caller(int cpe_irq, void *arg, struct pt_regs *ptregs)
return IRQ_HANDLED;
}
+#endif /* CONFIG_ACPI */
+
/*
* ia64_mca_cpe_poll
*
@@ -1120,8 +1122,6 @@ ia64_mca_cpe_poll (unsigned long dummy)
platform_send_ipi(first_cpu(cpu_online_map), IA64_CPEP_VECTOR, IA64_IPI_DM_INT, 0);
}
-#endif /* CONFIG_ACPI */
-
/*
* C portion of the OS INIT handler
*
diff --git a/trunk/arch/ia64/kernel/module.c b/trunk/arch/ia64/kernel/module.c
index f1aca7cffd12..febc091c2f02 100644
--- a/trunk/arch/ia64/kernel/module.c
+++ b/trunk/arch/ia64/kernel/module.c
@@ -825,16 +825,14 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
* XXX Should have an arch-hook for running this after final section
* addresses have been selected...
*/
- uint64_t gp;
- if (mod->core_size > MAX_LTOFF)
+ /* See if gp can cover the entire core module: */
+ uint64_t gp = (uint64_t) mod->module_core + MAX_LTOFF / 2;
+ if (mod->core_size >= MAX_LTOFF)
/*
* This takes advantage of fact that SHF_ARCH_SMALL gets allocated
* at the end of the module.
*/
- gp = mod->core_size - MAX_LTOFF / 2;
- else
- gp = mod->core_size / 2;
- gp = (uint64_t) mod->module_core + ((gp + 7) & -8);
+ gp = (uint64_t) mod->module_core + mod->core_size - MAX_LTOFF / 2;
mod->arch.gp = gp;
DEBUGP("%s: placing gp at 0x%lx\n", __FUNCTION__, gp);
}
diff --git a/trunk/arch/ia64/kernel/ptrace.c b/trunk/arch/ia64/kernel/ptrace.c
index 575a8f657b31..08c8a5eb25ab 100644
--- a/trunk/arch/ia64/kernel/ptrace.c
+++ b/trunk/arch/ia64/kernel/ptrace.c
@@ -635,17 +635,11 @@ ia64_flush_fph (struct task_struct *task)
{
struct ia64_psr *psr = ia64_psr(ia64_task_regs(task));
- /*
- * Prevent migrating this task while
- * we're fiddling with the FPU state
- */
- preempt_disable();
if (ia64_is_local_fpu_owner(task) && psr->mfh) {
psr->mfh = 0;
task->thread.flags |= IA64_THREAD_FPH_VALID;
ia64_save_fpu(&task->thread.fph[0]);
}
- preempt_enable();
}
/*
diff --git a/trunk/arch/ia64/kernel/setup.c b/trunk/arch/ia64/kernel/setup.c
index d14692e0920a..b7e6b4cb374b 100644
--- a/trunk/arch/ia64/kernel/setup.c
+++ b/trunk/arch/ia64/kernel/setup.c
@@ -720,8 +720,7 @@ cpu_init (void)
ia64_set_kr(IA64_KR_PT_BASE, __pa(ia64_imva(empty_zero_page)));
/*
- * Initialize default control register to defer speculative faults except
- * for those arising from TLB misses, which are not deferred. The
+ * Initialize default control register to defer all speculative faults. The
* kernel MUST NOT depend on a particular setting of these bits (in other words,
* the kernel must have recovery code for all speculative accesses). Turn on
* dcr.lc as per recommendation by the architecture team. Most IA-32 apps
diff --git a/trunk/arch/ia64/kernel/traps.c b/trunk/arch/ia64/kernel/traps.c
index 1861173bd4f6..e82ad78081b3 100644
--- a/trunk/arch/ia64/kernel/traps.c
+++ b/trunk/arch/ia64/kernel/traps.c
@@ -111,24 +111,6 @@ ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
siginfo_t siginfo;
int sig, code;
- /* break.b always sets cr.iim to 0, which causes problems for
- * debuggers. Get the real break number from the original instruction,
- * but only for kernel code. User space break.b is left alone, to
- * preserve the existing behaviour. All break codings have the same
- * format, so there is no need to check the slot type.
- */
- if (break_num == 0 && !user_mode(regs)) {
- struct ia64_psr *ipsr = ia64_psr(regs);
- unsigned long *bundle = (unsigned long *)regs->cr_iip;
- unsigned long slot;
- switch (ipsr->ri) {
- case 0: slot = (bundle[0] >> 5); break;
- case 1: slot = (bundle[0] >> 46) | (bundle[1] << 18); break;
- default: slot = (bundle[1] >> 23); break;
- }
- break_num = ((slot >> 36 & 1) << 20) | (slot >> 6 & 0xfffff);
- }
-
/* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */
siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri);
siginfo.si_imm = break_num;
@@ -220,21 +202,13 @@ disabled_fph_fault (struct pt_regs *regs)
/* first, grant user-level access to fph partition: */
psr->dfh = 0;
-
- /*
- * Make sure that no other task gets in on this processor
- * while we're claiming the FPU
- */
- preempt_disable();
#ifndef CONFIG_SMP
{
struct task_struct *fpu_owner
= (struct task_struct *)ia64_get_kr(IA64_KR_FPU_OWNER);
- if (ia64_is_local_fpu_owner(current)) {
- preempt_enable_no_resched();
+ if (ia64_is_local_fpu_owner(current))
return;
- }
if (fpu_owner)
ia64_flush_fph(fpu_owner);
@@ -252,7 +226,6 @@ disabled_fph_fault (struct pt_regs *regs)
*/
psr->mfh = 1;
}
- preempt_enable_no_resched();
}
static inline int
diff --git a/trunk/arch/ia64/mm/init.c b/trunk/arch/ia64/mm/init.c
index 4eb2f52b87a1..547785e3cba2 100644
--- a/trunk/arch/ia64/mm/init.c
+++ b/trunk/arch/ia64/mm/init.c
@@ -305,9 +305,8 @@ setup_gate (void)
struct page *page;
/*
- * Map the gate page twice: once read-only to export the ELF
- * headers etc. and once execute-only page to enable
- * privilege-promotion via "epc":
+ * Map the gate page twice: once read-only to export the ELF headers etc. and once
+ * execute-only page to enable privilege-promotion via "epc":
*/
page = virt_to_page(ia64_imva(__start_gate_section));
put_kernel_page(page, GATE_ADDR, PAGE_READONLY);
@@ -316,20 +315,6 @@ setup_gate (void)
put_kernel_page(page, GATE_ADDR + PAGE_SIZE, PAGE_GATE);
#else
put_kernel_page(page, GATE_ADDR + PERCPU_PAGE_SIZE, PAGE_GATE);
- /* Fill in the holes (if any) with read-only zero pages: */
- {
- unsigned long addr;
-
- for (addr = GATE_ADDR + PAGE_SIZE;
- addr < GATE_ADDR + PERCPU_PAGE_SIZE;
- addr += PAGE_SIZE)
- {
- put_kernel_page(ZERO_PAGE(0), addr,
- PAGE_READONLY);
- put_kernel_page(ZERO_PAGE(0), addr + PERCPU_PAGE_SIZE,
- PAGE_READONLY);
- }
- }
#endif
ia64_patch_gate();
}
diff --git a/trunk/arch/ia64/sn/kernel/setup.c b/trunk/arch/ia64/sn/kernel/setup.c
index 44bfc7f318cb..e64cb8175f7a 100644
--- a/trunk/arch/ia64/sn/kernel/setup.c
+++ b/trunk/arch/ia64/sn/kernel/setup.c
@@ -222,7 +222,7 @@ void __init early_sn_setup(void)
extern int platform_intr_list[];
extern nasid_t master_nasid;
-static int __initdata shub_1_1_found = 0;
+static int shub_1_1_found __initdata;
/*
* sn_check_for_wars
@@ -251,7 +251,7 @@ static void __init sn_check_for_wars(void)
} else {
for_each_online_node(cnode) {
if (is_shub_1_1(cnodeid_to_nasid(cnode)))
- shub_1_1_found = 1;
+ sn_hub_info->shub_1_1_found = 1;
}
}
}
diff --git a/trunk/arch/m68knommu/kernel/process.c b/trunk/arch/m68knommu/kernel/process.c
index c4a33f265dc0..2b6c9d32b7a6 100644
--- a/trunk/arch/m68knommu/kernel/process.c
+++ b/trunk/arch/m68knommu/kernel/process.c
@@ -45,13 +45,11 @@ asmlinkage void ret_from_fork(void);
*/
void default_idle(void)
{
- local_irq_disable();
- while (!need_resched()) {
- /* This stop will re-enable interrupts */
- __asm__("stop #0x2000" : : : "cc");
- local_irq_disable();
+ while(1) {
+ if (need_resched())
+ __asm__("stop #0x2000" : : : "cc");
+ schedule();
}
- local_irq_enable();
}
void (*idle)(void) = default_idle;
@@ -65,12 +63,7 @@ void (*idle)(void) = default_idle;
void cpu_idle(void)
{
/* endless idle loop with no priority at all */
- while (1) {
- idle();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
- }
+ idle();
}
void machine_restart(char * __unused)
diff --git a/trunk/arch/ppc/kernel/cputable.c b/trunk/arch/ppc/kernel/cputable.c
index d44b7dc5390a..8aa5e8c69009 100644
--- a/trunk/arch/ppc/kernel/cputable.c
+++ b/trunk/arch/ppc/kernel/cputable.c
@@ -838,17 +838,6 @@ struct cpu_spec cpu_specs[] = {
.icache_bsize = 32,
.dcache_bsize = 32,
},
- { /* 405EP */
- .pvr_mask = 0xffff0000,
- .pvr_value = 0x51210000,
- .cpu_name = "405EP",
- .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
- CPU_FTR_USE_TB,
- .cpu_user_features = PPC_FEATURE_32 |
- PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
- .icache_bsize = 32,
- .dcache_bsize = 32,
- },
#endif /* CONFIG_40x */
#ifdef CONFIG_44x
diff --git a/trunk/arch/ppc/kernel/misc.S b/trunk/arch/ppc/kernel/misc.S
index 7329ef177a18..e4f1615ec13f 100644
--- a/trunk/arch/ppc/kernel/misc.S
+++ b/trunk/arch/ppc/kernel/misc.S
@@ -619,7 +619,7 @@ _GLOBAL(flush_instruction_cache)
_GLOBAL(flush_icache_range)
BEGIN_FTR_SECTION
blr /* for 601, do nothing */
-END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
+END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE)
li r5,L1_CACHE_LINE_SIZE-1
andc r3,r3,r5
subf r4,r3,r4
@@ -736,7 +736,7 @@ _GLOBAL(flush_dcache_all)
_GLOBAL(__flush_dcache_icache)
BEGIN_FTR_SECTION
blr /* for 601, do nothing */
-END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
+END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE)
rlwinm r3,r3,0,0,19 /* Get page base address */
li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */
mtctr r4
@@ -764,7 +764,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
_GLOBAL(__flush_dcache_icache_phys)
BEGIN_FTR_SECTION
blr /* for 601, do nothing */
-END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
+END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE)
mfmsr r10
rlwinm r0,r10,0,28,26 /* clear DR */
mtmsr r0
diff --git a/trunk/arch/ppc/platforms/pmac_cpufreq.c b/trunk/arch/ppc/platforms/pmac_cpufreq.c
index 5fdd4f607a40..937f46df711e 100644
--- a/trunk/arch/ppc/platforms/pmac_cpufreq.c
+++ b/trunk/arch/ppc/platforms/pmac_cpufreq.c
@@ -83,7 +83,7 @@ static u32 frequency_gpio;
static u32 slew_done_gpio;
static int no_schedule;
static int has_cpu_l2lve;
-static int is_pmu_based;
+
/* There are only two frequency states for each processor. Values
* are in kHz for the time being.
@@ -463,7 +463,7 @@ static int __pmac pmac_cpufreq_suspend(struct cpufreq_policy *policy, u32 state)
*/
no_schedule = 1;
sleep_freq = cur_freq;
- if (cur_freq == low_freq && !is_pmu_based)
+ if (cur_freq == low_freq)
do_set_cpu_speed(CPUFREQ_HIGH, 0);
return 0;
}
@@ -588,7 +588,6 @@ static int __pmac pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
return 1;
hi_freq = (*value) / 1000;
set_speed_proc = pmu_set_cpu_speed;
- is_pmu_based = 1;
return 0;
}
@@ -693,7 +692,6 @@ static int __init pmac_cpufreq_setup(void)
hi_freq = cur_freq;
low_freq = 400000;
set_speed_proc = pmu_set_cpu_speed;
- is_pmu_based = 1;
}
/* Else check for TiPb 400 & 500 */
else if (machine_is_compatible("PowerBook3,2")) {
@@ -705,7 +703,6 @@ static int __init pmac_cpufreq_setup(void)
hi_freq = cur_freq;
low_freq = 300000;
set_speed_proc = pmu_set_cpu_speed;
- is_pmu_based = 1;
}
/* Else check for 750FX */
else if (PVR_VER(mfspr(SPRN_PVR)) == 0x7000)
diff --git a/trunk/arch/ppc/syslib/prom_init.c b/trunk/arch/ppc/syslib/prom_init.c
index 7f15136830f4..2cee87137f2e 100644
--- a/trunk/arch/ppc/syslib/prom_init.c
+++ b/trunk/arch/ppc/syslib/prom_init.c
@@ -626,18 +626,8 @@ inspect_node(phandle node, struct device_node *dad,
l = call_prom("package-to-path", 3, 1, node,
mem_start, mem_end - mem_start);
if (l >= 0) {
- char *p, *ep;
-
np->full_name = PTRUNRELOC((char *) mem_start);
*(char *)(mem_start + l) = 0;
- /* Fixup an Apple bug where they have bogus \0 chars in the
- * middle of the path in some properties
- */
- for (p = (char *)mem_start, ep = p + l; p < ep; p++)
- if ((*p) == '\0') {
- memmove(p, p+1, ep - p);
- ep--;
- }
mem_start = ALIGNUL(mem_start + l + 1);
}
diff --git a/trunk/arch/ppc64/boot/prom.c b/trunk/arch/ppc64/boot/prom.c
index d5218b15824e..7b607d1862cb 100644
--- a/trunk/arch/ppc64/boot/prom.c
+++ b/trunk/arch/ppc64/boot/prom.c
@@ -11,23 +11,6 @@
#include
#include
-extern __u32 __div64_32(unsigned long long *dividend, __u32 divisor);
-
-/* The unnecessary pointer compare is there
- * to check for type safety (n must be 64bit)
- */
-# define do_div(n,base) ({ \
- __u32 __base = (base); \
- __u32 __rem; \
- (void)(((typeof((n)) *)0) == ((unsigned long long *)0)); \
- if (((n) >> 32) == 0) { \
- __rem = (__u32)(n) % __base; \
- (n) = (__u32)(n) / __base; \
- } else \
- __rem = __div64_32(&(n), __base); \
- __rem; \
- })
-
int (*prom)(void *);
void *chosen_handle;
@@ -369,7 +352,7 @@ static int skip_atoi(const char **s)
#define SPECIAL 32 /* 0x */
#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
-static char * number(char * str, unsigned long long num, int base, int size, int precision, int type)
+static char * number(char * str, long num, int base, int size, int precision, int type)
{
char c,sign,tmp[66];
const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
@@ -384,9 +367,9 @@ static char * number(char * str, unsigned long long num, int base, int size, int
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
- if ((signed long long)num < 0) {
+ if (num < 0) {
sign = '-';
- num = - (signed long long)num;
+ num = -num;
size--;
} else if (type & PLUS) {
sign = '+';
@@ -406,7 +389,8 @@ static char * number(char * str, unsigned long long num, int base, int size, int
if (num == 0)
tmp[i++]='0';
else while (num != 0) {
- tmp[i++] = digits[do_div(num, base)];
+ tmp[i++] = digits[num % base];
+ num /= base;
}
if (i > precision)
precision = i;
@@ -442,7 +426,7 @@ int sprintf(char * buf, const char *fmt, ...);
int vsprintf(char *buf, const char *fmt, va_list args)
{
int len;
- unsigned long long num;
+ unsigned long num;
int i, base;
char * str;
const char *s;
diff --git a/trunk/arch/ppc64/kernel/entry.S b/trunk/arch/ppc64/kernel/entry.S
index b61572eb2a71..d3604056e1a9 100644
--- a/trunk/arch/ppc64/kernel/entry.S
+++ b/trunk/arch/ppc64/kernel/entry.S
@@ -436,6 +436,15 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
REST_8GPRS(14, r1)
REST_10GPRS(22, r1)
+#ifdef CONFIG_PPC_ISERIES
+ clrrdi r7,r1,THREAD_SHIFT /* get current_thread_info() */
+ ld r7,TI_FLAGS(r7) /* Get run light flag */
+ mfspr r9,CTRLF
+ srdi r7,r7,TIF_RUN_LIGHT
+ insrdi r9,r7,1,63 /* Insert run light into CTRL */
+ mtspr CTRLT,r9
+#endif
+
/* convert old thread to its task_struct for return value */
addi r3,r3,-THREAD
ld r7,_NIP(r1) /* Return to _switch caller in new task */
diff --git a/trunk/arch/ppc64/kernel/head.S b/trunk/arch/ppc64/kernel/head.S
index 346dbf606b5d..92a744c31ab1 100644
--- a/trunk/arch/ppc64/kernel/head.S
+++ b/trunk/arch/ppc64/kernel/head.S
@@ -626,10 +626,10 @@ system_reset_iSeries:
lhz r24,PACAPACAINDEX(r13) /* Get processor # */
cmpwi 0,r24,0 /* Are we processor 0? */
beq .__start_initialization_iSeries /* Start up the first processor */
- mfspr r4,SPRN_CTRLF
- li r5,CTRL_RUNLATCH /* Turn off the run light */
+ mfspr r4,CTRLF
+ li r5,RUNLATCH /* Turn off the run light */
andc r4,r4,r5
- mtspr SPRN_CTRLT,r4
+ mtspr CTRLT,r4
1:
HMT_LOW
@@ -2082,9 +2082,9 @@ _GLOBAL(hmt_start_secondary)
mfspr r4, HID0
ori r4, r4, 0x1
mtspr HID0, r4
- mfspr r4, SPRN_CTRLF
+ mfspr r4, CTRLF
oris r4, r4, 0x40
- mtspr SPRN_CTRLT, r4
+ mtspr CTRLT, r4
blr
#endif
diff --git a/trunk/arch/ppc64/kernel/iSeries_setup.c b/trunk/arch/ppc64/kernel/iSeries_setup.c
index 6d06eb550a3f..da20120f2261 100644
--- a/trunk/arch/ppc64/kernel/iSeries_setup.c
+++ b/trunk/arch/ppc64/kernel/iSeries_setup.c
@@ -852,28 +852,6 @@ static int __init iSeries_src_init(void)
late_initcall(iSeries_src_init);
-static int set_spread_lpevents(char *str)
-{
- unsigned long i;
- unsigned long val = simple_strtoul(str, NULL, 0);
-
- /*
- * The parameter is the number of processors to share in processing
- * lp events.
- */
- if (( val > 0) && (val <= NR_CPUS)) {
- for (i = 1; i < val; ++i)
- paca[i].lpqueue_ptr = paca[0].lpqueue_ptr;
-
- printk("lpevent processing spread over %ld processors\n", val);
- } else {
- printk("invalid spread_lpevents %ld\n", val);
- }
-
- return 1;
-}
-__setup("spread_lpevents=", set_spread_lpevents);
-
void __init iSeries_early_setup(void)
{
iSeries_fixup_klimit();
diff --git a/trunk/arch/ppc64/kernel/idle.c b/trunk/arch/ppc64/kernel/idle.c
index f24ce2b87200..6abc621d3ba0 100644
--- a/trunk/arch/ppc64/kernel/idle.c
+++ b/trunk/arch/ppc64/kernel/idle.c
@@ -75,9 +75,13 @@ static int iSeries_idle(void)
{
struct paca_struct *lpaca;
long oldval;
+ unsigned long CTRL;
/* ensure iSeries run light will be out when idle */
- ppc64_runlatch_off();
+ clear_thread_flag(TIF_RUN_LIGHT);
+ CTRL = mfspr(CTRLF);
+ CTRL &= ~RUNLATCH;
+ mtspr(CTRLT, CTRL);
lpaca = get_paca();
@@ -107,9 +111,7 @@ static int iSeries_idle(void)
}
}
- ppc64_runlatch_on();
schedule();
- ppc64_runlatch_off();
}
return 0;
diff --git a/trunk/arch/ppc64/kernel/kprobes.c b/trunk/arch/ppc64/kernel/kprobes.c
index e950a2058a19..103daaf73573 100644
--- a/trunk/arch/ppc64/kernel/kprobes.c
+++ b/trunk/arch/ppc64/kernel/kprobes.c
@@ -45,17 +45,12 @@ static struct pt_regs jprobe_saved_regs;
int arch_prepare_kprobe(struct kprobe *p)
{
- int ret = 0;
kprobe_opcode_t insn = *p->addr;
- if ((unsigned long)p->addr & 0x03) {
- printk("Attempt to register kprobe at an unaligned address\n");
- ret = -EINVAL;
- } else if (IS_MTMSRD(insn) || IS_RFID(insn)) {
- printk("Cannot register a kprobe on rfid or mtmsrd\n");
- ret = -EINVAL;
- }
- return ret;
+ if (IS_MTMSRD(insn) || IS_RFID(insn))
+ /* cannot put bp on RFID/MTMSRD */
+ return 1;
+ return 0;
}
void arch_copy_kprobe(struct kprobe *p)
@@ -177,6 +172,8 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs)
ret = emulate_step(regs, p->ainsn.insn[0]);
if (ret == 0)
regs->nip = (unsigned long)p->addr + 4;
+
+ regs->msr &= ~MSR_SE;
}
static inline int post_kprobe_handler(struct pt_regs *regs)
@@ -213,7 +210,6 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
if (kprobe_status & KPROBE_HIT_SS) {
resume_execution(current_kprobe, regs);
- regs->msr &= ~MSR_SE;
regs->msr |= kprobe_saved_msr;
unlock_kprobes();
@@ -237,6 +233,8 @@ int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val,
*/
preempt_disable();
switch (val) {
+ case DIE_IABR_MATCH:
+ case DIE_DABR_MATCH:
case DIE_BPT:
if (kprobe_handler(args->regs))
ret = NOTIFY_STOP;
diff --git a/trunk/arch/ppc64/kernel/misc.S b/trunk/arch/ppc64/kernel/misc.S
index e3c73b3425dc..b944717c1dbd 100644
--- a/trunk/arch/ppc64/kernel/misc.S
+++ b/trunk/arch/ppc64/kernel/misc.S
@@ -792,7 +792,7 @@ _GLOBAL(sys_call_table32)
.llong .compat_sys_newstat
.llong .compat_sys_newlstat
.llong .compat_sys_newfstat
- .llong .sys32_uname
+ .llong .sys_uname
.llong .sys_ni_syscall /* 110 old iopl syscall */
.llong .sys_vhangup
.llong .sys_ni_syscall /* old idle syscall */
diff --git a/trunk/arch/ppc64/kernel/pSeries_reconfig.c b/trunk/arch/ppc64/kernel/pSeries_reconfig.c
index dc2a69d412a2..cb5443f2e49b 100644
--- a/trunk/arch/ppc64/kernel/pSeries_reconfig.c
+++ b/trunk/arch/ppc64/kernel/pSeries_reconfig.c
@@ -47,6 +47,14 @@ static void remove_node_proc_entries(struct device_node *np)
remove_proc_entry(pp->name, np->pde);
pp = pp->next;
}
+
+ /* Assuming that symlinks have the same parent directory as
+ * np->pde.
+ */
+ if (np->name_link)
+ remove_proc_entry(np->name_link->name, parent->pde);
+ if (np->addr_link)
+ remove_proc_entry(np->addr_link->name, parent->pde);
if (np->pde)
remove_proc_entry(np->pde->name, parent->pde);
}
diff --git a/trunk/arch/ppc64/kernel/process.c b/trunk/arch/ppc64/kernel/process.c
index cdfecbeb331f..8b0686122738 100644
--- a/trunk/arch/ppc64/kernel/process.c
+++ b/trunk/arch/ppc64/kernel/process.c
@@ -378,6 +378,9 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
childregs->gpr[1] = sp + sizeof(struct pt_regs);
p->thread.regs = NULL; /* no user register state */
clear_ti_thread_flag(p->thread_info, TIF_32BIT);
+#ifdef CONFIG_PPC_ISERIES
+ set_ti_thread_flag(p->thread_info, TIF_RUN_LIGHT);
+#endif
} else {
childregs->gpr[1] = usp;
p->thread.regs = childregs;
diff --git a/trunk/arch/ppc64/kernel/prom_init.c b/trunk/arch/ppc64/kernel/prom_init.c
index b7683abfbe6a..bc53967a8643 100644
--- a/trunk/arch/ppc64/kernel/prom_init.c
+++ b/trunk/arch/ppc64/kernel/prom_init.c
@@ -211,23 +211,13 @@ struct {
*/
#define ADDR(x) (u32) ((unsigned long)(x) - offset)
-/*
- * Error results ... some OF calls will return "-1" on error, some
- * will return 0, some will return either. To simplify, here are
- * macros to use with any ihandle or phandle return value to check if
- * it is valid
- */
-
-#define PROM_ERROR (-1u)
-#define PHANDLE_VALID(p) ((p) != 0 && (p) != PROM_ERROR)
-#define IHANDLE_VALID(i) ((i) != 0 && (i) != PROM_ERROR)
-
-
/* This is the one and *ONLY* place where we actually call open
* firmware from, since we need to make sure we're running in 32b
* mode when we do. We switch back to 64b mode upon return.
*/
+#define PROM_ERROR (-1)
+
static int __init call_prom(const char *service, int nargs, int nret, ...)
{
int i;
@@ -597,13 +587,14 @@ static void __init prom_send_capabilities(void)
{
unsigned long offset = reloc_offset();
ihandle elfloader;
+ int ret;
elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader"));
if (elfloader == 0) {
prom_printf("couldn't open /packages/elf-loader\n");
return;
}
- call_prom("call-method", 3, 1, ADDR("process-elf-header"),
+ ret = call_prom("call-method", 3, 1, ADDR("process-elf-header"),
elfloader, ADDR(&fake_elf));
call_prom("close", 1, 0, elfloader);
}
@@ -655,7 +646,7 @@ static unsigned long __init alloc_up(unsigned long size, unsigned long align)
base = _ALIGN_UP(base + 0x100000, align)) {
prom_debug(" trying: 0x%x\n\r", base);
addr = (unsigned long)prom_claim(base, size, 0);
- if (addr != PROM_ERROR)
+ if ((int)addr != PROM_ERROR)
break;
addr = 0;
if (align == 0)
@@ -717,7 +708,7 @@ static unsigned long __init alloc_down(unsigned long size, unsigned long align,
for(; base > RELOC(alloc_bottom); base = _ALIGN_DOWN(base - 0x100000, align)) {
prom_debug(" trying: 0x%x\n\r", base);
addr = (unsigned long)prom_claim(base, size, 0);
- if (addr != PROM_ERROR)
+ if ((int)addr != PROM_ERROR)
break;
addr = 0;
}
@@ -911,19 +902,18 @@ static void __init prom_instantiate_rtas(void)
{
unsigned long offset = reloc_offset();
struct prom_t *_prom = PTRRELOC(&prom);
- phandle rtas_node;
- ihandle rtas_inst;
+ phandle prom_rtas, rtas_node;
u32 base, entry = 0;
u32 size = 0;
prom_debug("prom_instantiate_rtas: start...\n");
- rtas_node = call_prom("finddevice", 1, 1, ADDR("/rtas"));
- prom_debug("rtas_node: %x\n", rtas_node);
- if (!PHANDLE_VALID(rtas_node))
+ prom_rtas = call_prom("finddevice", 1, 1, ADDR("/rtas"));
+ prom_debug("prom_rtas: %x\n", prom_rtas);
+ if (prom_rtas == (phandle) -1)
return;
- prom_getprop(rtas_node, "rtas-size", &size, sizeof(size));
+ prom_getprop(prom_rtas, "rtas-size", &size, sizeof(size));
if (size == 0)
return;
@@ -932,18 +922,14 @@ static void __init prom_instantiate_rtas(void)
prom_printf("RTAS allocation failed !\n");
return;
}
+ prom_printf("instantiating rtas at 0x%x", base);
- rtas_inst = call_prom("open", 1, 1, ADDR("/rtas"));
- if (!IHANDLE_VALID(rtas_inst)) {
- prom_printf("opening rtas package failed");
- return;
- }
-
- prom_printf("instantiating rtas at 0x%x ...", base);
+ rtas_node = call_prom("open", 1, 1, ADDR("/rtas"));
+ prom_printf("...");
if (call_prom("call-method", 3, 2,
ADDR("instantiate-rtas"),
- rtas_inst, base) != PROM_ERROR) {
+ rtas_node, base) != PROM_ERROR) {
entry = (long)_prom->args.rets[1];
}
if (entry == 0) {
@@ -954,8 +940,8 @@ static void __init prom_instantiate_rtas(void)
reserve_mem(base, size);
- prom_setprop(rtas_node, "linux,rtas-base", &base, sizeof(base));
- prom_setprop(rtas_node, "linux,rtas-entry", &entry, sizeof(entry));
+ prom_setprop(prom_rtas, "linux,rtas-base", &base, sizeof(base));
+ prom_setprop(prom_rtas, "linux,rtas-entry", &entry, sizeof(entry));
prom_debug("rtas base = 0x%x\n", base);
prom_debug("rtas entry = 0x%x\n", entry);
@@ -1076,7 +1062,7 @@ static void __init prom_initialize_tce_table(void)
prom_printf("opening PHB %s", path);
phb_node = call_prom("open", 1, 1, path);
- if (phb_node == 0)
+ if ( (long)phb_node <= 0)
prom_printf("... failed\n");
else
prom_printf("... done\n");
@@ -1293,12 +1279,12 @@ static void __init prom_init_client_services(unsigned long pp)
/* get a handle for the stdout device */
_prom->chosen = call_prom("finddevice", 1, 1, ADDR("/chosen"));
- if (!PHANDLE_VALID(_prom->chosen))
+ if ((long)_prom->chosen <= 0)
prom_panic("cannot find chosen"); /* msg won't be printed :( */
/* get device tree root */
_prom->root = call_prom("finddevice", 1, 1, ADDR("/"));
- if (!PHANDLE_VALID(_prom->root))
+ if ((long)_prom->root <= 0)
prom_panic("cannot find device tree root"); /* msg won't be printed :( */
}
@@ -1370,8 +1356,9 @@ static int __init prom_find_machine_type(void)
}
/* Default to pSeries. We need to know if we are running LPAR */
rtas = call_prom("finddevice", 1, 1, ADDR("/rtas"));
- if (PHANDLE_VALID(rtas)) {
- int x = prom_getproplen(rtas, "ibm,hypertas-functions");
+ if (rtas != (phandle) -1) {
+ unsigned long x;
+ x = prom_getproplen(rtas, "ibm,hypertas-functions");
if (x != PROM_ERROR) {
prom_printf("Hypertas detected, assuming LPAR !\n");
return PLATFORM_PSERIES_LPAR;
@@ -1439,13 +1426,12 @@ static void __init prom_check_displays(void)
* leave some room at the end of the path for appending extra
* arguments
*/
- if (call_prom("package-to-path", 3, 1, node, path,
- PROM_SCRATCH_SIZE-10) == PROM_ERROR)
+ if (call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-10) < 0)
continue;
prom_printf("found display : %s, opening ... ", path);
ih = call_prom("open", 1, 1, path);
- if (ih == 0) {
+ if (ih == (ihandle)0 || ih == (ihandle)-1) {
prom_printf("failed\n");
continue;
}
@@ -1528,12 +1514,6 @@ static unsigned long __init dt_find_string(char *str)
return 0;
}
-/*
- * The Open Firmware 1275 specification states properties must be 31 bytes or
- * less, however not all firmwares obey this. Make it 64 bytes to be safe.
- */
-#define MAX_PROPERTY_NAME 64
-
static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
unsigned long *mem_end)
{
@@ -1547,12 +1527,10 @@ static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
/* get and store all property names */
prev_name = RELOC("");
for (;;) {
- int rc;
-
- /* 64 is max len of name including nul. */
- namep = make_room(mem_start, mem_end, MAX_PROPERTY_NAME, 1);
- rc = call_prom("nextprop", 3, 1, node, prev_name, namep);
- if (rc != 1) {
+
+ /* 32 is max len of name including nul. */
+ namep = make_room(mem_start, mem_end, 32, 1);
+ if (call_prom("nextprop", 3, 1, node, prev_name, namep) <= 0) {
/* No more nodes: unwind alloc */
*mem_start = (unsigned long)namep;
break;
@@ -1577,12 +1555,18 @@ static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
}
}
+/*
+ * The Open Firmware 1275 specification states properties must be 31 bytes or
+ * less, however not all firmwares obey this. Make it 64 bytes to be safe.
+ */
+#define MAX_PROPERTY_NAME 64
+
static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
unsigned long *mem_end)
{
int l, align;
phandle child;
- char *namep, *prev_name, *sstart, *p, *ep;
+ char *namep, *prev_name, *sstart;
unsigned long soff;
unsigned char *valp;
unsigned long offset = reloc_offset();
@@ -1604,14 +1588,6 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
call_prom("package-to-path", 3, 1, node, namep, l);
}
namep[l] = '\0';
- /* Fixup an Apple bug where they have bogus \0 chars in the
- * middle of the path in some properties
- */
- for (p = namep, ep = namep + l; p < ep; p++)
- if (*p == '\0') {
- memmove(p, p+1, ep - p);
- ep--; l--;
- }
*mem_start = _ALIGN(((unsigned long) namep) + strlen(namep) + 1, 4);
}
@@ -1623,10 +1599,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
prev_name = RELOC("");
sstart = (char *)RELOC(dt_string_start);
for (;;) {
- int rc;
-
- rc = call_prom("nextprop", 3, 1, node, prev_name, pname);
- if (rc != 1)
+ if (call_prom("nextprop", 3, 1, node, prev_name, pname) <= 0)
break;
/* find string offset */
@@ -1642,7 +1615,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
l = call_prom("getproplen", 2, 1, node, pname);
/* sanity checks */
- if (l == PROM_ERROR)
+ if (l < 0)
continue;
if (l > MAX_PROPERTY_LENGTH) {
prom_printf("WARNING: ignoring large property ");
@@ -1790,18 +1763,17 @@ static void __init fixup_device_tree(void)
/* Some G5s have a missing interrupt definition, fix it up here */
u3 = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000"));
- if (!PHANDLE_VALID(u3))
+ if ((long)u3 <= 0)
return;
i2c = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/i2c@f8001000"));
- if (!PHANDLE_VALID(i2c))
+ if ((long)i2c <= 0)
return;
mpic = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/mpic@f8040000"));
- if (!PHANDLE_VALID(mpic))
+ if ((long)mpic <= 0)
return;
/* check if proper rev of u3 */
- if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev))
- == PROM_ERROR)
+ if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev)) <= 0)
return;
if (u3_rev != 0x35)
return;
diff --git a/trunk/arch/ppc64/kernel/setup.c b/trunk/arch/ppc64/kernel/setup.c
index dce198d39328..21c57f539c29 100644
--- a/trunk/arch/ppc64/kernel/setup.c
+++ b/trunk/arch/ppc64/kernel/setup.c
@@ -103,6 +103,11 @@ extern void unflatten_device_tree(void);
extern void smp_release_cpus(void);
+unsigned long decr_overclock = 1;
+unsigned long decr_overclock_proc0 = 1;
+unsigned long decr_overclock_set = 0;
+unsigned long decr_overclock_proc0_set = 0;
+
int have_of = 1;
int boot_cpuid = 0;
int boot_cpuid_phys = 0;
@@ -1115,15 +1120,64 @@ void ppc64_dump_msg(unsigned int src, const char *msg)
printk("[dump]%04x %s\n", src, msg);
}
+int set_spread_lpevents( char * str )
+{
+ /* The parameter is the number of processors to share in processing lp events */
+ unsigned long i;
+ unsigned long val = simple_strtoul( str, NULL, 0 );
+ if ( ( val > 0 ) && ( val <= NR_CPUS ) ) {
+ for ( i=1; idefault_decr = tb_ticks_per_jiffy;
+ if ( decr_overclock_set && !decr_overclock_proc0_set )
+ decr_overclock_proc0 = decr_overclock;
+
+ lpaca->default_decr = tb_ticks_per_jiffy / decr_overclock_proc0;
lpaca->next_jiffy_update_tb = get_tb() + tb_ticks_per_jiffy;
}
+int set_decr_overclock_proc0( char * str )
+{
+ unsigned long val = simple_strtoul( str, NULL, 0 );
+ if ( ( val >= 1 ) && ( val <= 48 ) ) {
+ decr_overclock_proc0_set = 1;
+ decr_overclock_proc0 = val;
+ printk("proc 0 decrementer overclock factor of %ld\n", val);
+ }
+ else
+ printk("invalid proc 0 decrementer overclock factor of %ld\n", val);
+ return 1;
+}
+
+int set_decr_overclock( char * str )
+{
+ unsigned long val = simple_strtoul( str, NULL, 0 );
+ if ( ( val >= 1 ) && ( val <= 48 ) ) {
+ decr_overclock_set = 1;
+ decr_overclock = val;
+ printk("decrementer overclock factor of %ld\n", val);
+ }
+ else
+ printk("invalid decrementer overclock factor of %ld\n", val);
+ return 1;
+
+}
+
+__setup("spread_lpevents=", set_spread_lpevents );
+__setup("decr_overclock_proc0=", set_decr_overclock_proc0 );
+__setup("decr_overclock=", set_decr_overclock );
+
#ifndef CONFIG_PPC_ISERIES
/*
* This function can be used by platforms to "find" legacy serial ports.
diff --git a/trunk/arch/ppc64/kernel/smp.c b/trunk/arch/ppc64/kernel/smp.c
index 9ef5d36d6b25..3b906cd94037 100644
--- a/trunk/arch/ppc64/kernel/smp.c
+++ b/trunk/arch/ppc64/kernel/smp.c
@@ -334,6 +334,7 @@ void smp_call_function_interrupt(void)
}
}
+extern unsigned long decr_overclock;
extern struct gettimeofday_struct do_gtod;
struct thread_info *current_set[NR_CPUS];
@@ -490,7 +491,7 @@ int __devinit __cpu_up(unsigned int cpu)
if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu))
return -EINVAL;
- paca[cpu].default_decr = tb_ticks_per_jiffy;
+ paca[cpu].default_decr = tb_ticks_per_jiffy / decr_overclock;
if (!cpu_has_feature(CPU_FTR_SLB)) {
void *tmp;
diff --git a/trunk/arch/ppc64/kernel/sys_ppc32.c b/trunk/arch/ppc64/kernel/sys_ppc32.c
index 9c8e317c598d..7cf7a9600025 100644
--- a/trunk/arch/ppc64/kernel/sys_ppc32.c
+++ b/trunk/arch/ppc64/kernel/sys_ppc32.c
@@ -791,6 +791,31 @@ asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn)
}
+asmlinkage int ppc64_newuname(struct new_utsname __user * name)
+{
+ int errno = sys_newuname(name);
+
+ if (current->personality == PER_LINUX32 && !errno) {
+ if(copy_to_user(name->machine, "ppc\0\0", 8)) {
+ errno = -EFAULT;
+ }
+ }
+ return errno;
+}
+
+asmlinkage int ppc64_personality(unsigned long personality)
+{
+ int ret;
+ if (current->personality == PER_LINUX32 && personality == PER_LINUX)
+ personality = PER_LINUX32;
+ ret = sys_personality(personality);
+ if (ret == PER_LINUX32)
+ ret = PER_LINUX;
+ return ret;
+}
+
+
+
/* Note: it is necessary to treat mode as an unsigned int,
* with the corresponding cast to a signed int to insure that the
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
@@ -1133,47 +1158,26 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
}
#endif
-asmlinkage int sys32_uname(struct old_utsname __user * name)
-{
- int err = 0;
-
- down_read(&uts_sem);
- if (copy_to_user(name, &system_utsname, sizeof(*name)))
- err = -EFAULT;
- up_read(&uts_sem);
- if (!err && personality(current->personality) == PER_LINUX32) {
- /* change "ppc64" to "ppc" */
- if (__put_user(0, name->machine + 3)
- || __put_user(0, name->machine + 4))
- err = -EFAULT;
- }
- return err;
-}
-
asmlinkage int sys32_olduname(struct oldold_utsname __user * name)
{
int error;
-
+
+ if (!name)
+ return -EFAULT;
if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
return -EFAULT;
down_read(&uts_sem);
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,&system_utsname.nodename,__OLD_UTS_LEN);
- 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,&system_utsname.version,__OLD_UTS_LEN);
- 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);
- if (personality(current->personality) == PER_LINUX32) {
- /* change "ppc64" to "ppc" */
- error |= __put_user(0, name->machine + 3);
- error |= __put_user(0, name->machine + 4);
- }
-
+ 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,&system_utsname.release,__OLD_UTS_LEN);
+ 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,&system_utsname.machine,__OLD_UTS_LEN);
+ error = __put_user(0,name->machine+__OLD_UTS_LEN);
up_read(&uts_sem);
error = error ? -EFAULT : 0;
diff --git a/trunk/arch/ppc64/kernel/syscalls.c b/trunk/arch/ppc64/kernel/syscalls.c
index a8cbb202b8cd..f2865ff8d2f9 100644
--- a/trunk/arch/ppc64/kernel/syscalls.c
+++ b/trunk/arch/ppc64/kernel/syscalls.c
@@ -199,33 +199,24 @@ unsigned long sys_mmap(unsigned long addr, size_t len,
return ret;
}
-long ppc64_personality(unsigned long personality)
+static int __init set_fakeppc(char *str)
{
- long ret;
-
- if (personality(current->personality) == PER_LINUX32
- && personality == PER_LINUX)
- personality = PER_LINUX32;
- ret = sys_personality(personality);
- if (ret == PER_LINUX32)
- ret = PER_LINUX;
- return ret;
+ if (*str)
+ return 0;
+ init_task.personality = PER_LINUX32;
+ return 1;
}
+__setup("fakeppc", set_fakeppc);
-long ppc64_newuname(struct new_utsname __user * name)
+asmlinkage int sys_uname(struct old_utsname __user * name)
{
- int err = 0;
-
+ int err = -EFAULT;
+
down_read(&uts_sem);
- if (copy_to_user(name, &system_utsname, sizeof(*name)))
- err = -EFAULT;
+ if (name && !copy_to_user(name, &system_utsname, sizeof (*name)))
+ err = 0;
up_read(&uts_sem);
- if (!err && personality(current->personality) == PER_LINUX32) {
- /* change ppc64 to ppc */
- if (__put_user(0, name->machine + 3)
- || __put_user(0, name->machine + 4))
- err = -EFAULT;
- }
+
return err;
}
diff --git a/trunk/arch/ppc64/kernel/sysfs.c b/trunk/arch/ppc64/kernel/sysfs.c
index c8fa6569b2fd..0925694c3ce5 100644
--- a/trunk/arch/ppc64/kernel/sysfs.c
+++ b/trunk/arch/ppc64/kernel/sysfs.c
@@ -113,6 +113,7 @@ void ppc64_enable_pmcs(void)
#ifdef CONFIG_PPC_PSERIES
unsigned long set, reset;
int ret;
+ unsigned int ctrl;
#endif /* CONFIG_PPC_PSERIES */
/* Only need to enable them once */
@@ -166,8 +167,11 @@ void ppc64_enable_pmcs(void)
* On SMT machines we have to set the run latch in the ctrl register
* in order to make PMC6 spin.
*/
- if (cpu_has_feature(CPU_FTR_SMT))
- ppc64_runlatch_on();
+ if (cpu_has_feature(CPU_FTR_SMT)) {
+ ctrl = mfspr(CTRLF);
+ ctrl |= RUNLATCH;
+ mtspr(CTRLT, ctrl);
+ }
#endif /* CONFIG_PPC_PSERIES */
}
diff --git a/trunk/arch/ppc64/kernel/time.c b/trunk/arch/ppc64/kernel/time.c
index 33364a7d2cd2..3d54745108c7 100644
--- a/trunk/arch/ppc64/kernel/time.c
+++ b/trunk/arch/ppc64/kernel/time.c
@@ -325,7 +325,9 @@ int timer_interrupt(struct pt_regs * regs)
irq_enter();
+#ifndef CONFIG_PPC_ISERIES
profile_tick(CPU_PROFILING, regs);
+#endif
lpaca->lppaca.int_dword.fields.decr_int = 0;
diff --git a/trunk/arch/s390/appldata/appldata_base.c b/trunk/arch/s390/appldata/appldata_base.c
index c067435bae45..01ae1964c938 100644
--- a/trunk/arch/s390/appldata/appldata_base.c
+++ b/trunk/arch/s390/appldata/appldata_base.c
@@ -28,7 +28,6 @@
//#include
#include
#include
-#include
#include "appldata.h"
@@ -134,12 +133,9 @@ static int appldata_interval = APPLDATA_CPU_INTERVAL;
static int appldata_timer_active;
/*
- * Work queue
+ * Tasklet
*/
-static struct workqueue_struct *appldata_wq;
-static void appldata_work_fn(void *data);
-static DECLARE_WORK(appldata_work, appldata_work_fn, NULL);
-
+static struct tasklet_struct appldata_tasklet_struct;
/*
* Ops list
@@ -148,11 +144,11 @@ static DEFINE_SPINLOCK(appldata_ops_lock);
static LIST_HEAD(appldata_ops_list);
-/*************************** timer, work, DIAG *******************************/
+/************************* timer, tasklet, DIAG ******************************/
/*
* appldata_timer_function()
*
- * schedule work and reschedule timer
+ * schedule tasklet and reschedule timer
*/
static void appldata_timer_function(unsigned long data, struct pt_regs *regs)
{
@@ -161,22 +157,22 @@ static void appldata_timer_function(unsigned long data, struct pt_regs *regs)
atomic_read(&appldata_expire_count));
if (atomic_dec_and_test(&appldata_expire_count)) {
atomic_set(&appldata_expire_count, num_online_cpus());
- queue_work(appldata_wq, (struct work_struct *) data);
+ tasklet_schedule((struct tasklet_struct *) data);
}
}
/*
- * appldata_work_fn()
+ * appldata_tasklet_function()
*
* call data gathering function for each (active) module
*/
-static void appldata_work_fn(void *data)
+static void appldata_tasklet_function(unsigned long data)
{
struct list_head *lh;
struct appldata_ops *ops;
int i;
- P_DEBUG(" -= Work Queue =-\n");
+ P_DEBUG(" -= Tasklet =-\n");
i = 0;
spin_lock(&appldata_ops_lock);
list_for_each(lh, &appldata_ops_list) {
@@ -235,7 +231,7 @@ static int appldata_diag(char record_nr, u16 function, unsigned long buffer,
: "=d" (ry) : "d" (&(appldata_parameter_list)) : "cc");
return (int) ry;
}
-/************************ timer, work, DIAG ****************************/
+/********************** timer, tasklet, DIAG ***************************/
/****************************** /proc stuff **********************************/
@@ -415,7 +411,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
struct list_head *lh;
found = 0;
- spin_lock(&appldata_ops_lock);
+ spin_lock_bh(&appldata_ops_lock);
list_for_each(lh, &appldata_ops_list) {
tmp_ops = list_entry(lh, struct appldata_ops, list);
if (&tmp_ops->ctl_table[2] == ctl) {
@@ -423,15 +419,15 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
}
}
if (!found) {
- spin_unlock(&appldata_ops_lock);
+ spin_unlock_bh(&appldata_ops_lock);
return -ENODEV;
}
ops = ctl->data;
if (!try_module_get(ops->owner)) { // protect this function
- spin_unlock(&appldata_ops_lock);
+ spin_unlock_bh(&appldata_ops_lock);
return -ENODEV;
}
- spin_unlock(&appldata_ops_lock);
+ spin_unlock_bh(&appldata_ops_lock);
if (!*lenp || *ppos) {
*lenp = 0;
@@ -455,11 +451,10 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
return -EFAULT;
}
- spin_lock(&appldata_ops_lock);
+ spin_lock_bh(&appldata_ops_lock);
if ((buf[0] == '1') && (ops->active == 0)) {
- // protect work queue callback
- if (!try_module_get(ops->owner)) {
- spin_unlock(&appldata_ops_lock);
+ if (!try_module_get(ops->owner)) { // protect tasklet
+ spin_unlock_bh(&appldata_ops_lock);
module_put(ops->owner);
return -ENODEV;
}
@@ -490,7 +485,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
}
module_put(ops->owner);
}
- spin_unlock(&appldata_ops_lock);
+ spin_unlock_bh(&appldata_ops_lock);
out:
*lenp = len;
*ppos += len;
@@ -534,7 +529,7 @@ int appldata_register_ops(struct appldata_ops *ops)
}
memset(ops->ctl_table, 0, 4*sizeof(struct ctl_table));
- spin_lock(&appldata_ops_lock);
+ spin_lock_bh(&appldata_ops_lock);
list_for_each(lh, &appldata_ops_list) {
tmp_ops = list_entry(lh, struct appldata_ops, list);
P_DEBUG("register_ops loop: %i) name = %s, ctl = %i\n",
@@ -546,18 +541,18 @@ int appldata_register_ops(struct appldata_ops *ops)
APPLDATA_PROC_NAME_LENGTH) == 0) {
P_ERROR("Name \"%s\" already registered!\n", ops->name);
kfree(ops->ctl_table);
- spin_unlock(&appldata_ops_lock);
+ spin_unlock_bh(&appldata_ops_lock);
return -EBUSY;
}
if (tmp_ops->ctl_nr == ops->ctl_nr) {
P_ERROR("ctl_nr %i already registered!\n", ops->ctl_nr);
kfree(ops->ctl_table);
- spin_unlock(&appldata_ops_lock);
+ spin_unlock_bh(&appldata_ops_lock);
return -EBUSY;
}
}
list_add(&ops->list, &appldata_ops_list);
- spin_unlock(&appldata_ops_lock);
+ spin_unlock_bh(&appldata_ops_lock);
ops->ctl_table[0].ctl_name = CTL_APPLDATA;
ops->ctl_table[0].procname = appldata_proc_name;
@@ -588,12 +583,12 @@ int appldata_register_ops(struct appldata_ops *ops)
*/
void appldata_unregister_ops(struct appldata_ops *ops)
{
- spin_lock(&appldata_ops_lock);
+ spin_lock_bh(&appldata_ops_lock);
unregister_sysctl_table(ops->sysctl_header);
list_del(&ops->list);
kfree(ops->ctl_table);
ops->ctl_table = NULL;
- spin_unlock(&appldata_ops_lock);
+ spin_unlock_bh(&appldata_ops_lock);
P_INFO("%s-ops unregistered!\n", ops->name);
}
/********************** module-ops management **************************/
@@ -607,7 +602,7 @@ appldata_online_cpu(int cpu)
init_virt_timer(&per_cpu(appldata_timer, cpu));
per_cpu(appldata_timer, cpu).function = appldata_timer_function;
per_cpu(appldata_timer, cpu).data = (unsigned long)
- &appldata_work;
+ &appldata_tasklet_struct;
atomic_inc(&appldata_expire_count);
spin_lock(&appldata_timer_lock);
__appldata_vtimer_setup(APPLDATA_MOD_TIMER);
@@ -620,7 +615,7 @@ appldata_offline_cpu(int cpu)
del_virt_timer(&per_cpu(appldata_timer, cpu));
if (atomic_dec_and_test(&appldata_expire_count)) {
atomic_set(&appldata_expire_count, num_online_cpus());
- queue_work(appldata_wq, &appldata_work);
+ tasklet_schedule(&appldata_tasklet_struct);
}
spin_lock(&appldata_timer_lock);
__appldata_vtimer_setup(APPLDATA_MOD_TIMER);
@@ -653,7 +648,7 @@ static struct notifier_block __devinitdata appldata_nb = {
/*
* appldata_init()
*
- * init timer, register /proc entries
+ * init timer and tasklet, register /proc entries
*/
static int __init appldata_init(void)
{
@@ -662,12 +657,6 @@ static int __init appldata_init(void)
P_DEBUG("sizeof(parameter_list) = %lu\n",
sizeof(struct appldata_parameter_list));
- appldata_wq = create_singlethread_workqueue("appldata");
- if (!appldata_wq) {
- P_ERROR("Could not create work queue\n");
- return -ENOMEM;
- }
-
for_each_online_cpu(i)
appldata_online_cpu(i);
@@ -681,6 +670,7 @@ static int __init appldata_init(void)
appldata_table[1].de->owner = THIS_MODULE;
#endif
+ tasklet_init(&appldata_tasklet_struct, appldata_tasklet_function, 0);
P_DEBUG("Base interface initialized.\n");
return 0;
}
@@ -688,7 +678,7 @@ static int __init appldata_init(void)
/*
* appldata_exit()
*
- * stop timer, unregister /proc entries
+ * stop timer and tasklet, unregister /proc entries
*/
static void __exit appldata_exit(void)
{
@@ -700,7 +690,7 @@ static void __exit appldata_exit(void)
/*
* ops list should be empty, but just in case something went wrong...
*/
- spin_lock(&appldata_ops_lock);
+ spin_lock_bh(&appldata_ops_lock);
list_for_each(lh, &appldata_ops_list) {
ops = list_entry(lh, struct appldata_ops, list);
rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
@@ -710,7 +700,7 @@ static void __exit appldata_exit(void)
"return code: %d\n", ops->name, rc);
}
}
- spin_unlock(&appldata_ops_lock);
+ spin_unlock_bh(&appldata_ops_lock);
for_each_online_cpu(i)
appldata_offline_cpu(i);
@@ -719,7 +709,7 @@ static void __exit appldata_exit(void)
unregister_sysctl_table(appldata_sysctl_header);
- destroy_workqueue(appldata_wq);
+ tasklet_kill(&appldata_tasklet_struct);
P_DEBUG("... module unloaded!\n");
}
/**************************** init / exit ******************************/
diff --git a/trunk/arch/s390/appldata/appldata_mem.c b/trunk/arch/s390/appldata/appldata_mem.c
index f0e2fbed3d4c..462ee9a84e76 100644
--- a/trunk/arch/s390/appldata/appldata_mem.c
+++ b/trunk/arch/s390/appldata/appldata_mem.c
@@ -68,7 +68,7 @@ struct appldata_mem_data {
u64 pgmajfault; /* page faults (major only) */
// <-- New in 2.6
-} __attribute__((packed)) appldata_mem_data;
+} appldata_mem_data;
static inline void appldata_debug_print(struct appldata_mem_data *mem_data)
diff --git a/trunk/arch/s390/appldata/appldata_net_sum.c b/trunk/arch/s390/appldata/appldata_net_sum.c
index 2a4c7432db4a..dd61638d3027 100644
--- a/trunk/arch/s390/appldata/appldata_net_sum.c
+++ b/trunk/arch/s390/appldata/appldata_net_sum.c
@@ -57,7 +57,7 @@ struct appldata_net_sum_data {
u64 rx_dropped; /* no space in linux buffers */
u64 tx_dropped; /* no space available in linux */
u64 collisions; /* collisions while transmitting */
-} __attribute__((packed)) appldata_net_sum_data;
+} appldata_net_sum_data;
static inline void appldata_print_debug(struct appldata_net_sum_data *net_data)
diff --git a/trunk/arch/s390/appldata/appldata_os.c b/trunk/arch/s390/appldata/appldata_os.c
index e0a476bf4fd6..b83f07484551 100644
--- a/trunk/arch/s390/appldata/appldata_os.c
+++ b/trunk/arch/s390/appldata/appldata_os.c
@@ -49,7 +49,7 @@ struct appldata_os_per_cpu {
u32 per_cpu_softirq; /* ... spent in softirqs */
u32 per_cpu_iowait; /* ... spent while waiting for I/O */
// <-- New in 2.6
-} __attribute__((packed));
+};
struct appldata_os_data {
u64 timestamp;
@@ -75,7 +75,7 @@ struct appldata_os_data {
/* per cpu data */
struct appldata_os_per_cpu os_cpu[0];
-} __attribute__((packed));
+};
static struct appldata_os_data *appldata_os_data;
diff --git a/trunk/arch/s390/kernel/ptrace.c b/trunk/arch/s390/kernel/ptrace.c
index 06afa3103ace..26889366929a 100644
--- a/trunk/arch/s390/kernel/ptrace.c
+++ b/trunk/arch/s390/kernel/ptrace.c
@@ -40,7 +40,6 @@
#include
#include
#include
-#include
#ifdef CONFIG_S390_SUPPORT
#include "compat_ptrace.h"
@@ -131,19 +130,13 @@ static int
peek_user(struct task_struct *child, addr_t addr, addr_t data)
{
struct user *dummy = NULL;
- addr_t offset, tmp, mask;
+ addr_t offset, tmp;
/*
* Stupid gdb peeks/pokes the access registers in 64 bit with
* an alignment of 4. Programmers from hell...
*/
- mask = __ADDR_MASK;
-#ifdef CONFIG_ARCH_S390X
- if (addr >= (addr_t) &dummy->regs.acrs &&
- addr < (addr_t) &dummy->regs.orig_gpr2)
- mask = 3;
-#endif
- if ((addr & mask) || addr > sizeof(struct user) - __ADDR_MASK)
+ if ((addr & 3) || addr > sizeof(struct user) - __ADDR_MASK)
return -EIO;
if (addr < (addr_t) &dummy->regs.acrs) {
@@ -160,16 +153,6 @@ peek_user(struct task_struct *child, addr_t addr, addr_t data)
* access registers are stored in the thread structure
*/
offset = addr - (addr_t) &dummy->regs.acrs;
-#ifdef CONFIG_ARCH_S390X
- /*
- * Very special case: old & broken 64 bit gdb reading
- * from acrs[15]. Result is a 64 bit value. Read the
- * 32 bit acrs[15] value and shift it by 32. Sick...
- */
- if (addr == (addr_t) &dummy->regs.acrs[15])
- tmp = ((unsigned long) child->thread.acrs[15]) << 32;
- else
-#endif
tmp = *(addr_t *)((addr_t) &child->thread.acrs + offset);
} else if (addr == (addr_t) &dummy->regs.orig_gpr2) {
@@ -184,9 +167,6 @@ peek_user(struct task_struct *child, addr_t addr, addr_t data)
*/
offset = addr - (addr_t) &dummy->regs.fp_regs;
tmp = *(addr_t *)((addr_t) &child->thread.fp_regs + offset);
- if (addr == (addr_t) &dummy->regs.fp_regs.fpc)
- tmp &= (unsigned long) FPC_VALID_MASK
- << (BITS_PER_LONG - 32);
} else if (addr < (addr_t) (&dummy->regs.per_info + 1)) {
/*
@@ -211,19 +191,13 @@ static int
poke_user(struct task_struct *child, addr_t addr, addr_t data)
{
struct user *dummy = NULL;
- addr_t offset, mask;
+ addr_t offset;
/*
* Stupid gdb peeks/pokes the access registers in 64 bit with
* an alignment of 4. Programmers from hell indeed...
*/
- mask = __ADDR_MASK;
-#ifdef CONFIG_ARCH_S390X
- if (addr >= (addr_t) &dummy->regs.acrs &&
- addr < (addr_t) &dummy->regs.orig_gpr2)
- mask = 3;
-#endif
- if ((addr & mask) || addr > sizeof(struct user) - __ADDR_MASK)
+ if ((addr & 3) || addr > sizeof(struct user) - __ADDR_MASK)
return -EIO;
if (addr < (addr_t) &dummy->regs.acrs) {
@@ -250,17 +224,6 @@ poke_user(struct task_struct *child, addr_t addr, addr_t data)
* access registers are stored in the thread structure
*/
offset = addr - (addr_t) &dummy->regs.acrs;
-#ifdef CONFIG_ARCH_S390X
- /*
- * Very special case: old & broken 64 bit gdb writing
- * to acrs[15] with a 64 bit value. Ignore the lower
- * half of the value and write the upper 32 bit to
- * acrs[15]. Sick...
- */
- if (addr == (addr_t) &dummy->regs.acrs[15])
- child->thread.acrs[15] = (unsigned int) (data >> 32);
- else
-#endif
*(addr_t *)((addr_t) &child->thread.acrs + offset) = data;
} else if (addr == (addr_t) &dummy->regs.orig_gpr2) {
@@ -274,8 +237,7 @@ poke_user(struct task_struct *child, addr_t addr, addr_t data)
* floating point regs. are stored in the thread structure
*/
if (addr == (addr_t) &dummy->regs.fp_regs.fpc &&
- (data & ~((unsigned long) FPC_VALID_MASK
- << (BITS_PER_LONG - 32))) != 0)
+ (data & ~FPC_VALID_MASK) != 0)
return -EINVAL;
offset = addr - (addr_t) &dummy->regs.fp_regs;
*(addr_t *)((addr_t) &child->thread.fp_regs + offset) = data;
@@ -760,13 +722,6 @@ syscall_trace(struct pt_regs *regs, int entryexit)
ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
? 0x80 : 0));
- /*
- * If the debuffer has set an invalid system call number,
- * we prepare to skip the system call restart handling.
- */
- if (!entryexit && regs->gprs[2] >= NR_syscalls)
- regs->trap = -1;
-
/*
* this isn't the same as continuing with a signal, but it will do
* for normal use. strace only continues with a signal if the
diff --git a/trunk/arch/s390/mm/fault.c b/trunk/arch/s390/mm/fault.c
index 75fde949d125..80306bc8c799 100644
--- a/trunk/arch/s390/mm/fault.c
+++ b/trunk/arch/s390/mm/fault.c
@@ -207,7 +207,7 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection)
* we are not in an interrupt and that there is a
* user context.
*/
- if (user_address == 0 || in_atomic() || !mm)
+ if (user_address == 0 || in_interrupt() || !mm)
goto no_context;
/*
diff --git a/trunk/arch/sparc64/kernel/pci_iommu.c b/trunk/arch/sparc64/kernel/pci_iommu.c
index 2803bc7c2c79..33ca56c90da2 100644
--- a/trunk/arch/sparc64/kernel/pci_iommu.c
+++ b/trunk/arch/sparc64/kernel/pci_iommu.c
@@ -196,34 +196,6 @@ static iopte_t *alloc_consistent_cluster(struct pci_iommu *iommu, unsigned long
return NULL;
}
-static int iommu_alloc_ctx(struct pci_iommu *iommu)
-{
- int lowest = iommu->ctx_lowest_free;
- int sz = IOMMU_NUM_CTXS - lowest;
- int n = find_next_zero_bit(iommu->ctx_bitmap, sz, lowest);
-
- if (unlikely(n == sz)) {
- n = find_next_zero_bit(iommu->ctx_bitmap, lowest, 1);
- if (unlikely(n == lowest)) {
- printk(KERN_WARNING "IOMMU: Ran out of contexts.\n");
- n = 0;
- }
- }
- if (n)
- __set_bit(n, iommu->ctx_bitmap);
-
- return n;
-}
-
-static inline void iommu_free_ctx(struct pci_iommu *iommu, int ctx)
-{
- if (likely(ctx)) {
- __clear_bit(ctx, iommu->ctx_bitmap);
- if (ctx < iommu->ctx_lowest_free)
- iommu->ctx_lowest_free = ctx;
- }
-}
-
/* Allocate and map kernel buffer of size SIZE using consistent mode
* DMA for PCI device PDEV. Return non-NULL cpu-side address if
* successful and set *DMA_ADDRP to the PCI side dma address.
@@ -264,7 +236,7 @@ void *pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_ad
npages = size >> IO_PAGE_SHIFT;
ctx = 0;
if (iommu->iommu_ctxflush)
- ctx = iommu_alloc_ctx(iommu);
+ ctx = iommu->iommu_cur_ctx++;
first_page = __pa(first_page);
while (npages--) {
iopte_val(*iopte) = (IOPTE_CONSISTENT(ctx) |
@@ -345,8 +317,6 @@ void pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu, dma_addr_
}
}
- iommu_free_ctx(iommu, ctx);
-
spin_unlock_irqrestore(&iommu->lock, flags);
order = get_order(size);
@@ -390,7 +360,7 @@ dma_addr_t pci_map_single(struct pci_dev *pdev, void *ptr, size_t sz, int direct
base_paddr = __pa(oaddr & IO_PAGE_MASK);
ctx = 0;
if (iommu->iommu_ctxflush)
- ctx = iommu_alloc_ctx(iommu);
+ ctx = iommu->iommu_cur_ctx++;
if (strbuf->strbuf_enabled)
iopte_protection = IOPTE_STREAMING(ctx);
else
@@ -410,53 +380,39 @@ dma_addr_t pci_map_single(struct pci_dev *pdev, void *ptr, size_t sz, int direct
return PCI_DMA_ERROR_CODE;
}
-static void pci_strbuf_flush(struct pci_strbuf *strbuf, struct pci_iommu *iommu, u32 vaddr, unsigned long ctx, unsigned long npages, int direction)
+static void pci_strbuf_flush(struct pci_strbuf *strbuf, struct pci_iommu *iommu, u32 vaddr, unsigned long ctx, unsigned long npages)
{
int limit;
+ PCI_STC_FLUSHFLAG_INIT(strbuf);
if (strbuf->strbuf_ctxflush &&
iommu->iommu_ctxflush) {
unsigned long matchreg, flushreg;
- u64 val;
flushreg = strbuf->strbuf_ctxflush;
matchreg = PCI_STC_CTXMATCH_ADDR(strbuf, ctx);
+ limit = 100000;
pci_iommu_write(flushreg, ctx);
- val = pci_iommu_read(matchreg);
- val &= 0xffff;
- if (!val)
- goto do_flush_sync;
-
- while (val) {
- if (val & 0x1)
- pci_iommu_write(flushreg, ctx);
- val >>= 1;
+ for(;;) {
+ if (((long)pci_iommu_read(matchreg)) >= 0L)
+ break;
+ limit--;
+ if (!limit)
+ break;
+ udelay(1);
}
- val = pci_iommu_read(matchreg);
- if (unlikely(val)) {
+ if (!limit)
printk(KERN_WARNING "pci_strbuf_flush: ctx flush "
- "timeout matchreg[%lx] ctx[%lx]\n",
- val, ctx);
- goto do_page_flush;
- }
+ "timeout vaddr[%08x] ctx[%lx]\n",
+ vaddr, ctx);
} else {
unsigned long i;
- do_page_flush:
for (i = 0; i < npages; i++, vaddr += IO_PAGE_SIZE)
pci_iommu_write(strbuf->strbuf_pflush, vaddr);
}
-do_flush_sync:
- /* If the device could not have possibly put dirty data into
- * the streaming cache, no flush-flag synchronization needs
- * to be performed.
- */
- if (direction == PCI_DMA_TODEVICE)
- return;
-
- PCI_STC_FLUSHFLAG_INIT(strbuf);
pci_iommu_write(strbuf->strbuf_fsync, strbuf->strbuf_flushflag_pa);
(void) pci_iommu_read(iommu->write_complete_reg);
@@ -510,7 +466,7 @@ void pci_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int
/* Step 1: Kick data out of streaming buffers if necessary. */
if (strbuf->strbuf_enabled)
- pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
+ pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages);
/* Step 2: Clear out first TSB entry. */
iopte_make_dummy(iommu, base);
@@ -518,8 +474,6 @@ void pci_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int
free_streaming_cluster(iommu, bus_addr - iommu->page_table_map_base,
npages, ctx);
- iommu_free_ctx(iommu, ctx);
-
spin_unlock_irqrestore(&iommu->lock, flags);
}
@@ -659,7 +613,7 @@ int pci_map_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int
/* Step 4: Choose a context if necessary. */
ctx = 0;
if (iommu->iommu_ctxflush)
- ctx = iommu_alloc_ctx(iommu);
+ ctx = iommu->iommu_cur_ctx++;
/* Step 5: Create the mappings. */
if (strbuf->strbuf_enabled)
@@ -724,7 +678,7 @@ void pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems,
/* Step 1: Kick data out of streaming buffers if necessary. */
if (strbuf->strbuf_enabled)
- pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
+ pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages);
/* Step 2: Clear out first TSB entry. */
iopte_make_dummy(iommu, base);
@@ -732,8 +686,6 @@ void pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems,
free_streaming_cluster(iommu, bus_addr - iommu->page_table_map_base,
npages, ctx);
- iommu_free_ctx(iommu, ctx);
-
spin_unlock_irqrestore(&iommu->lock, flags);
}
@@ -772,7 +724,7 @@ void pci_dma_sync_single_for_cpu(struct pci_dev *pdev, dma_addr_t bus_addr, size
}
/* Step 2: Kick data out of streaming buffers. */
- pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
+ pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages);
spin_unlock_irqrestore(&iommu->lock, flags);
}
@@ -816,7 +768,7 @@ void pci_dma_sync_sg_for_cpu(struct pci_dev *pdev, struct scatterlist *sglist, i
i--;
npages = (IO_PAGE_ALIGN(sglist[i].dma_address + sglist[i].dma_length)
- bus_addr) >> IO_PAGE_SHIFT;
- pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages, direction);
+ pci_strbuf_flush(strbuf, iommu, bus_addr, ctx, npages);
spin_unlock_irqrestore(&iommu->lock, flags);
}
diff --git a/trunk/arch/sparc64/kernel/pci_psycho.c b/trunk/arch/sparc64/kernel/pci_psycho.c
index 534320ef0db2..3567fa879e1f 100644
--- a/trunk/arch/sparc64/kernel/pci_psycho.c
+++ b/trunk/arch/sparc64/kernel/pci_psycho.c
@@ -1212,7 +1212,7 @@ static void __init psycho_iommu_init(struct pci_controller_info *p)
/* Setup initial software IOMMU state. */
spin_lock_init(&iommu->lock);
- iommu->ctx_lowest_free = 1;
+ iommu->iommu_cur_ctx = 0;
/* Register addresses. */
iommu->iommu_control = p->pbm_A.controller_regs + PSYCHO_IOMMU_CONTROL;
diff --git a/trunk/arch/sparc64/kernel/pci_sabre.c b/trunk/arch/sparc64/kernel/pci_sabre.c
index 53d333b4a4e8..5525d1ec4af8 100644
--- a/trunk/arch/sparc64/kernel/pci_sabre.c
+++ b/trunk/arch/sparc64/kernel/pci_sabre.c
@@ -1265,7 +1265,7 @@ static void __init sabre_iommu_init(struct pci_controller_info *p,
/* Setup initial software IOMMU state. */
spin_lock_init(&iommu->lock);
- iommu->ctx_lowest_free = 1;
+ iommu->iommu_cur_ctx = 0;
/* Register addresses. */
iommu->iommu_control = p->pbm_A.controller_regs + SABRE_IOMMU_CONTROL;
diff --git a/trunk/arch/sparc64/kernel/pci_schizo.c b/trunk/arch/sparc64/kernel/pci_schizo.c
index 5753175b94e6..e93fcadc3722 100644
--- a/trunk/arch/sparc64/kernel/pci_schizo.c
+++ b/trunk/arch/sparc64/kernel/pci_schizo.c
@@ -1753,7 +1753,7 @@ static void schizo_pbm_iommu_init(struct pci_pbm_info *pbm)
/* Setup initial software IOMMU state. */
spin_lock_init(&iommu->lock);
- iommu->ctx_lowest_free = 1;
+ iommu->iommu_cur_ctx = 0;
/* Register addresses, SCHIZO has iommu ctx flushing. */
iommu->iommu_control = pbm->pbm_regs + SCHIZO_IOMMU_CONTROL;
diff --git a/trunk/arch/sparc64/kernel/sbus.c b/trunk/arch/sparc64/kernel/sbus.c
index 89f5e019f24c..76ea6455433f 100644
--- a/trunk/arch/sparc64/kernel/sbus.c
+++ b/trunk/arch/sparc64/kernel/sbus.c
@@ -117,25 +117,17 @@ static void iommu_flush(struct sbus_iommu *iommu, u32 base, unsigned long npages
#define STRBUF_TAG_VALID 0x02UL
-static void sbus_strbuf_flush(struct sbus_iommu *iommu, u32 base, unsigned long npages, int direction)
+static void sbus_strbuf_flush(struct sbus_iommu *iommu, u32 base, unsigned long npages)
{
unsigned long n;
int limit;
+ iommu->strbuf_flushflag = 0UL;
n = npages;
while (n--)
upa_writeq(base + (n << IO_PAGE_SHIFT),
iommu->strbuf_regs + STRBUF_PFLUSH);
- /* If the device could not have possibly put dirty data into
- * the streaming cache, no flush-flag synchronization needs
- * to be performed.
- */
- if (direction == SBUS_DMA_TODEVICE)
- return;
-
- iommu->strbuf_flushflag = 0UL;
-
/* Whoopee cushion! */
upa_writeq(__pa(&iommu->strbuf_flushflag),
iommu->strbuf_regs + STRBUF_FSYNC);
@@ -429,7 +421,7 @@ void sbus_unmap_single(struct sbus_dev *sdev, dma_addr_t dma_addr, size_t size,
spin_lock_irqsave(&iommu->lock, flags);
free_streaming_cluster(iommu, dma_base, size >> IO_PAGE_SHIFT);
- sbus_strbuf_flush(iommu, dma_base, size >> IO_PAGE_SHIFT, direction);
+ sbus_strbuf_flush(iommu, dma_base, size >> IO_PAGE_SHIFT);
spin_unlock_irqrestore(&iommu->lock, flags);
}
@@ -592,7 +584,7 @@ void sbus_unmap_sg(struct sbus_dev *sdev, struct scatterlist *sg, int nents, int
iommu = sdev->bus->iommu;
spin_lock_irqsave(&iommu->lock, flags);
free_streaming_cluster(iommu, dvma_base, size >> IO_PAGE_SHIFT);
- sbus_strbuf_flush(iommu, dvma_base, size >> IO_PAGE_SHIFT, direction);
+ sbus_strbuf_flush(iommu, dvma_base, size >> IO_PAGE_SHIFT);
spin_unlock_irqrestore(&iommu->lock, flags);
}
@@ -604,7 +596,7 @@ void sbus_dma_sync_single_for_cpu(struct sbus_dev *sdev, dma_addr_t base, size_t
size = (IO_PAGE_ALIGN(base + size) - (base & IO_PAGE_MASK));
spin_lock_irqsave(&iommu->lock, flags);
- sbus_strbuf_flush(iommu, base & IO_PAGE_MASK, size >> IO_PAGE_SHIFT, direction);
+ sbus_strbuf_flush(iommu, base & IO_PAGE_MASK, size >> IO_PAGE_SHIFT);
spin_unlock_irqrestore(&iommu->lock, flags);
}
@@ -628,7 +620,7 @@ void sbus_dma_sync_sg_for_cpu(struct sbus_dev *sdev, struct scatterlist *sg, int
size = IO_PAGE_ALIGN(sg[i].dma_address + sg[i].dma_length) - base;
spin_lock_irqsave(&iommu->lock, flags);
- sbus_strbuf_flush(iommu, base, size >> IO_PAGE_SHIFT, direction);
+ sbus_strbuf_flush(iommu, base, size >> IO_PAGE_SHIFT);
spin_unlock_irqrestore(&iommu->lock, flags);
}
diff --git a/trunk/arch/um/Kconfig_char b/trunk/arch/um/Kconfig_char
index 62d87b71179b..3e50fdb67626 100644
--- a/trunk/arch/um/Kconfig_char
+++ b/trunk/arch/um/Kconfig_char
@@ -204,11 +204,5 @@ config UML_RANDOM
http://sourceforge.net/projects/gkernel/). rngd periodically reads
/dev/hwrng and injects the entropy into /dev/random.
-config MMAPPER
- tristate "iomem emulation driver"
- help
- This driver allows a host file to be used as emulated IO memory inside
- UML.
-
endmenu
diff --git a/trunk/arch/um/drivers/chan_user.c b/trunk/arch/um/drivers/chan_user.c
index 5d3768156c92..583b8e137c33 100644
--- a/trunk/arch/um/drivers/chan_user.c
+++ b/trunk/arch/um/drivers/chan_user.c
@@ -143,22 +143,22 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out)
{
struct winch_data data;
unsigned long stack;
- int fds[2], n, err;
+ int fds[2], pid, n, err;
char c;
err = os_pipe(fds, 1, 1);
if(err < 0){
printk("winch_tramp : os_pipe failed, err = %d\n", -err);
- goto out;
+ return(err);
}
data = ((struct winch_data) { .pty_fd = fd,
.pipe_fd = fds[1],
.close_me = fds[0] } );
- err = run_helper_thread(winch_thread, &data, 0, &stack, 0);
- if(err < 0){
+ pid = run_helper_thread(winch_thread, &data, 0, &stack, 0);
+ if(pid < 0){
printk("fork of winch_thread failed - errno = %d\n", errno);
- goto out_close;
+ return(pid);
}
os_close_file(fds[1]);
@@ -168,22 +168,14 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out)
printk("winch_tramp : failed to read synchronization byte\n");
printk("read failed, err = %d\n", -n);
printk("fd %d will not support SIGWINCH\n", fd);
- err = -EINVAL;
- goto out_close1;
+ *fd_out = -1;
}
- return err ;
-
- out_close:
- os_close_file(fds[1]);
- out_close1:
- os_close_file(fds[0]);
- out:
- return err;
+ return(pid);
}
void register_winch(int fd, struct tty_struct *tty)
{
- int pid, thread, thread_fd = -1;
+ int pid, thread, thread_fd;
int count;
char c = 1;
@@ -194,7 +186,7 @@ void register_winch(int fd, struct tty_struct *tty)
if(!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd,
tty) && (pid == -1)){
thread = winch_tramp(fd, tty, &thread_fd);
- if(thread > 0){
+ if(fd != -1){
register_winch_irq(thread_fd, fd, thread, tty);
count = os_write_file(thread_fd, &c, sizeof(c));
diff --git a/trunk/arch/um/drivers/mmapper_kern.c b/trunk/arch/um/drivers/mmapper_kern.c
index a37a5ac13c22..a63231dffe05 100644
--- a/trunk/arch/um/drivers/mmapper_kern.c
+++ b/trunk/arch/um/drivers/mmapper_kern.c
@@ -18,7 +18,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -118,39 +117,24 @@ static struct file_operations mmapper_fops = {
.release = mmapper_release,
};
-static struct miscdevice mmapper_dev = {
- .minor = MISC_DYNAMIC_MINOR,
- .name = "mmapper",
- .fops = &mmapper_fops
-};
-
static int __init mmapper_init(void)
{
- int err;
-
printk(KERN_INFO "Mapper v0.1\n");
v_buf = (char *) find_iomem("mmapper", &mmapper_size);
if(mmapper_size == 0){
printk(KERN_ERR "mmapper_init - find_iomem failed\n");
- goto out;
- }
-
- err = misc_register(&mmapper_dev);
- if(err){
- printk(KERN_ERR "mmapper - misc_register failed, err = %d\n",
- err);
- goto out;
+ return(0);
}
p_buf = __pa(v_buf);
-out:
- return 0;
+
+ devfs_mk_cdev(MKDEV(30, 0), S_IFCHR|S_IRUGO|S_IWUGO, "mmapper");
+ return(0);
}
static void mmapper_exit(void)
{
- misc_deregister(&mmapper_dev);
}
module_init(mmapper_init);
diff --git a/trunk/arch/um/drivers/net_user.c b/trunk/arch/um/drivers/net_user.c
index 3730d4f12713..47229fe4a813 100644
--- a/trunk/arch/um/drivers/net_user.c
+++ b/trunk/arch/um/drivers/net_user.c
@@ -32,7 +32,7 @@ int tap_open_common(void *dev, char *gate_addr)
return(0);
}
-void tap_check_ips(char *gate_addr, unsigned char *eth_addr)
+void tap_check_ips(char *gate_addr, char *eth_addr)
{
int tap_addr[4];
diff --git a/trunk/arch/um/drivers/slip.h b/trunk/arch/um/drivers/slip.h
index d523618cd5ac..495f2f1b1420 100644
--- a/trunk/arch/um/drivers/slip.h
+++ b/trunk/arch/um/drivers/slip.h
@@ -12,8 +12,8 @@ struct slip_data {
char *addr;
char *gate_addr;
int slave;
- unsigned char ibuf[ENC_BUF_SIZE];
- unsigned char obuf[ENC_BUF_SIZE];
+ char ibuf[ENC_BUF_SIZE];
+ char obuf[ENC_BUF_SIZE];
int more; /* more data: do not read fd until ibuf has been drained */
int pos;
int esc;
diff --git a/trunk/arch/um/drivers/slip_proto.h b/trunk/arch/um/drivers/slip_proto.h
index 4c4d94a33100..7206361ace45 100644
--- a/trunk/arch/um/drivers/slip_proto.h
+++ b/trunk/arch/um/drivers/slip_proto.h
@@ -12,8 +12,7 @@
#define SLIP_ESC_END 0334 /* ESC ESC_END means END 'data' */
#define SLIP_ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */
-static inline int slip_unesc(unsigned char c, unsigned char *buf, int *pos,
- int *esc)
+static inline int slip_unesc(unsigned char c,char *buf,int *pos, int *esc)
{
int ret;
diff --git a/trunk/arch/um/drivers/slirp.h b/trunk/arch/um/drivers/slirp.h
index afa4e30284fd..04e407d1e44a 100644
--- a/trunk/arch/um/drivers/slirp.h
+++ b/trunk/arch/um/drivers/slirp.h
@@ -24,8 +24,8 @@ struct slirp_data {
struct arg_list_dummy_wrapper argw;
int pid;
int slave;
- unsigned char ibuf[ENC_BUF_SIZE];
- unsigned char obuf[ENC_BUF_SIZE];
+ char ibuf[ENC_BUF_SIZE];
+ char obuf[ENC_BUF_SIZE];
int more; /* more data: do not read fd until ibuf has been drained */
int pos;
int esc;
diff --git a/trunk/arch/um/drivers/stderr_console.c b/trunk/arch/um/drivers/stderr_console.c
index 429ae8e6c7e5..98565b53d170 100644
--- a/trunk/arch/um/drivers/stderr_console.c
+++ b/trunk/arch/um/drivers/stderr_console.c
@@ -22,9 +22,9 @@ static void stderr_console_write(struct console *console, const char *string,
}
static struct console stderr_console = {
- .name = "stderr",
- .write = stderr_console_write,
- .flags = CON_PRINTBUFFER,
+ .name "stderr",
+ .write stderr_console_write,
+ .flags CON_PRINTBUFFER,
};
static int __init stderr_console_init(void)
diff --git a/trunk/arch/um/include/mconsole.h b/trunk/arch/um/include/mconsole.h
index cfa368e045a5..9fbe3083fdd8 100644
--- a/trunk/arch/um/include/mconsole.h
+++ b/trunk/arch/um/include/mconsole.h
@@ -56,7 +56,7 @@ struct mc_request
int as_interrupt;
int originating_fd;
- unsigned int originlen;
+ int originlen;
unsigned char origin[128]; /* sockaddr_un */
struct mconsole_request request;
diff --git a/trunk/arch/um/include/net_user.h b/trunk/arch/um/include/net_user.h
index 89885a77a771..36807b796e9f 100644
--- a/trunk/arch/um/include/net_user.h
+++ b/trunk/arch/um/include/net_user.h
@@ -35,7 +35,7 @@ extern void *get_output_buffer(int *len_out);
extern void free_output_buffer(void *buffer);
extern int tap_open_common(void *dev, char *gate_addr);
-extern void tap_check_ips(char *gate_addr, unsigned char *eth_addr);
+extern void tap_check_ips(char *gate_addr, char *eth_addr);
extern void read_output(int fd, char *output_out, int len);
diff --git a/trunk/arch/um/include/os.h b/trunk/arch/um/include/os.h
index 881d2988d2d8..d246d5a24609 100644
--- a/trunk/arch/um/include/os.h
+++ b/trunk/arch/um/include/os.h
@@ -136,7 +136,7 @@ extern int os_seek_file(int fd, __u64 offset);
extern int os_open_file(char *file, struct openflags flags, int mode);
extern int os_read_file(int fd, void *buf, int len);
extern int os_write_file(int fd, const void *buf, int count);
-extern int os_file_size(char *file, unsigned long long *size_out);
+extern int os_file_size(char *file, long long *size_out);
extern int os_file_modtime(char *file, unsigned long *modtime);
extern int os_pipe(int *fd, int stream, int close_on_exec);
extern int os_set_fd_async(int fd, int owner);
diff --git a/trunk/arch/um/include/user_util.h b/trunk/arch/um/include/user_util.h
index 7b6a24dfd302..b8c5b8a95250 100644
--- a/trunk/arch/um/include/user_util.h
+++ b/trunk/arch/um/include/user_util.h
@@ -41,6 +41,9 @@ extern unsigned long highmem;
extern char host_info[];
extern char saved_command_line[];
+extern char command_line[];
+
+extern char *tempdir;
extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end;
extern unsigned long _unprotected_end;
diff --git a/trunk/arch/um/kernel/skas/process_kern.c b/trunk/arch/um/kernel/skas/process_kern.c
index fc71ef295782..ab5d3271da0b 100644
--- a/trunk/arch/um/kernel/skas/process_kern.c
+++ b/trunk/arch/um/kernel/skas/process_kern.c
@@ -68,11 +68,8 @@ void new_thread_handler(int sig)
* 0 if it just exits
*/
n = run_kernel_thread(fn, arg, ¤t->thread.exec_buf);
- if(n == 1){
- /* Handle any immediate reschedules or signals */
- interrupt_end();
+ if(n == 1)
userspace(¤t->thread.regs.regs);
- }
else do_exit(0);
}
@@ -99,8 +96,6 @@ void fork_handler(int sig)
schedule_tail(current->thread.prev_sched);
current->thread.prev_sched = NULL;
- /* Handle any immediate reschedules or signals */
- interrupt_end();
userspace(¤t->thread.regs.regs);
}
diff --git a/trunk/arch/um/os-Linux/elf_aux.c b/trunk/arch/um/os-Linux/elf_aux.c
index f0d6060e3e57..9aee0b62ebca 100644
--- a/trunk/arch/um/os-Linux/elf_aux.c
+++ b/trunk/arch/um/os-Linux/elf_aux.c
@@ -45,11 +45,7 @@ __init void scan_elf_aux( char **envp)
elf_aux_hwcap = auxv->a_un.a_val;
break;
case AT_PLATFORM:
- /* elf.h removed the pointer elements from
- * a_un, so we have to use a_val, which is
- * all that's left.
- */
- elf_aux_platform = (char *) auxv->a_un.a_val;
+ elf_aux_platform = auxv->a_un.a_ptr;
break;
case AT_PAGESZ:
page_size = auxv->a_un.a_val;
diff --git a/trunk/arch/um/os-Linux/file.c b/trunk/arch/um/os-Linux/file.c
index fd45bb260907..77d4066d1af8 100644
--- a/trunk/arch/um/os-Linux/file.c
+++ b/trunk/arch/um/os-Linux/file.c
@@ -363,7 +363,7 @@ int os_write_file(int fd, const void *buf, int len)
(int (*)(int, void *, int)) write, copy_to_user_proc));
}
-int os_file_size(char *file, unsigned long long *size_out)
+int os_file_size(char *file, long long *size_out)
{
struct uml_stat buf;
int err;
diff --git a/trunk/arch/x86_64/Kconfig b/trunk/arch/x86_64/Kconfig
index 289f448ac89c..0f430d9d3632 100644
--- a/trunk/arch/x86_64/Kconfig
+++ b/trunk/arch/x86_64/Kconfig
@@ -305,7 +305,6 @@ config HPET_TIMER
config X86_PM_TIMER
bool "PM timer"
- depends on ACPI
default y
help
Support the ACPI PM timer for time keeping. This is slow,
diff --git a/trunk/arch/x86_64/kernel/aperture.c b/trunk/arch/x86_64/kernel/aperture.c
index 504e63474993..a491f72cc966 100644
--- a/trunk/arch/x86_64/kernel/aperture.c
+++ b/trunk/arch/x86_64/kernel/aperture.c
@@ -33,11 +33,13 @@ int fallback_aper_force __initdata = 0;
int fix_aperture __initdata = 1;
-/* This code runs before the PCI subsystem is initialized, so just
- access the northbridge directly. */
-
#define NB_ID_3 (PCI_VENDOR_ID_AMD | (0x1103<<16))
+static struct resource aper_res = {
+ .name = "Aperture",
+ .flags = IORESOURCE_MEM,
+};
+
static u32 __init allocate_aperture(void)
{
#ifdef CONFIG_DISCONTIGMEM
@@ -53,11 +55,24 @@ static u32 __init allocate_aperture(void)
aper_size = (32 * 1024 * 1024) << fallback_aper_order;
/*
- * Aperture has to be naturally aligned. This means an 2GB aperture won't
- * have much chances to find a place in the lower 4GB of memory.
- * Unfortunately we cannot move it up because that would make the
- * IOMMU useless.
+ * Aperture has to be naturally aligned. This means an 2GB
+ * aperture won't have much chances to find a place in the
+ * lower 4GB of memory. Unfortunately we cannot move it up
+ * because that would make the IOMMU useless.
*/
+
+ /* First try to find some free unused space */
+ if (!allocate_resource(&iomem_resource, &aper_res,
+ aper_size,
+ 0, 0xffffffff,
+ aper_size,
+ NULL, NULL)) {
+ printk(KERN_INFO "Putting aperture at %lx-%lx\n",
+ aper_res.start, aper_res.end);
+ return aper_res.start;
+ }
+
+ /* No free space found. Go on to waste some memory... */
p = __alloc_bootmem_node(nd0, aper_size, aper_size, 0);
if (!p || __pa(p)+aper_size > 0xffffffff) {
printk("Cannot allocate aperture memory hole (%p,%uK)\n",
@@ -66,7 +81,7 @@ static u32 __init allocate_aperture(void)
free_bootmem_node(nd0, (unsigned long)p, aper_size);
return 0;
}
- printk("Mapping aperture over %d KB of RAM @ %lx\n",
+ printk("Mapping aperture over %d KB of precious RAM @ %lx\n",
aper_size >> 10, __pa(p));
return (u32)__pa(p);
}
@@ -87,10 +102,16 @@ static int __init aperture_valid(char *name, u64 aper_base, u32 aper_size)
printk("Aperture from %s pointing to e820 RAM. Ignoring.\n",name);
return 0;
}
+ /* Don't check the resource here because the aperture is usually
+ in an e820 reserved area, and we allocated these earlier. */
return 1;
}
-/* Find a PCI capability */
+/*
+ * Find a PCI capability.
+ * This code runs before the PCI subsystem is initialized, so just
+ * access the northbridge directly.
+ */
static __u32 __init find_cap(int num, int slot, int func, int cap)
{
u8 pos;
@@ -255,8 +276,6 @@ void __init iommu_hole_init(void)
fallback_aper_force) {
printk("Your BIOS doesn't leave a aperture memory hole\n");
printk("Please enable the IOMMU option in the BIOS setup\n");
- printk("This costs you %d MB of RAM\n",
- 32 << fallback_aper_order);
aper_order = fallback_aper_order;
aper_alloc = allocate_aperture();
diff --git a/trunk/arch/x86_64/kernel/io_apic.c b/trunk/arch/x86_64/kernel/io_apic.c
index afd87e64d0a8..80e9b498c443 100644
--- a/trunk/arch/x86_64/kernel/io_apic.c
+++ b/trunk/arch/x86_64/kernel/io_apic.c
@@ -37,7 +37,6 @@
#include
#include
#include
-#include
#define __apicdebuginit __init
diff --git a/trunk/arch/x86_64/kernel/mpparse.c b/trunk/arch/x86_64/kernel/mpparse.c
index 61a63be6b294..f86d9db94bfc 100644
--- a/trunk/arch/x86_64/kernel/mpparse.c
+++ b/trunk/arch/x86_64/kernel/mpparse.c
@@ -30,7 +30,6 @@
#include
#include
#include
-#include
/* Have we found an MP table */
int smp_found_config;
diff --git a/trunk/arch/x86_64/kernel/time.c b/trunk/arch/x86_64/kernel/time.c
index fb8c809b4cd9..735b6767c8ed 100644
--- a/trunk/arch/x86_64/kernel/time.c
+++ b/trunk/arch/x86_64/kernel/time.c
@@ -27,9 +27,7 @@
#include
#include
#include
-#ifdef CONFIG_ACPI
#include /* for PM timer frequency */
-#endif
#include
#include
#include
diff --git a/trunk/drivers/atm/Makefile b/trunk/drivers/atm/Makefile
index 5b77188527a9..d1dcd8eae3c9 100644
--- a/trunk/drivers/atm/Makefile
+++ b/trunk/drivers/atm/Makefile
@@ -39,8 +39,7 @@ ifeq ($(CONFIG_ATM_FORE200E_PCA),y)
fore_200e-objs += fore200e_pca_fw.o
# guess the target endianess to choose the right PCA-200E firmware image
ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y)
- byteorder.h := include$(if $(patsubst $(srctree),,$(objtree)),2)/asm/byteorder.h
- CONFIG_ATM_FORE200E_PCA_FW := $(obj)/pca200e$(if $(shell $(CC) -E -dM $(byteorder.h) | grep ' __LITTLE_ENDIAN '),.bin,_ecd.bin2)
+ CONFIG_ATM_FORE200E_PCA_FW = $(shell if test -n "`$(CC) -E -dM $(src)/../../include/asm/byteorder.h | grep ' __LITTLE_ENDIAN '`"; then echo $(obj)/pca200e.bin; else echo $(obj)/pca200e_ecd.bin2; fi)
endif
endif
diff --git a/trunk/drivers/atm/fore200e.c b/trunk/drivers/atm/fore200e.c
index 5f702199543a..9e65bfb85ba3 100644
--- a/trunk/drivers/atm/fore200e.c
+++ b/trunk/drivers/atm/fore200e.c
@@ -383,7 +383,8 @@ fore200e_shutdown(struct fore200e* fore200e)
switch(fore200e->state) {
case FORE200E_STATE_COMPLETE:
- kfree(fore200e->stats);
+ if (fore200e->stats)
+ kfree(fore200e->stats);
case FORE200E_STATE_IRQ:
free_irq(fore200e->irq, fore200e->atm_dev);
@@ -962,7 +963,8 @@ fore200e_tx_irq(struct fore200e* fore200e)
entry, txq->tail, entry->vc_map, entry->skb);
/* free copy of misaligned data */
- kfree(entry->data);
+ if (entry->data)
+ kfree(entry->data);
/* remove DMA mapping */
fore200e->bus->dma_unmap(fore200e, entry->tpd->tsd[ 0 ].buffer, entry->tpd->tsd[ 0 ].length,
diff --git a/trunk/drivers/atm/he.c b/trunk/drivers/atm/he.c
index df2c83fd5496..3022c548a132 100644
--- a/trunk/drivers/atm/he.c
+++ b/trunk/drivers/atm/he.c
@@ -412,7 +412,8 @@ he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent)
init_one_failure:
if (atm_dev)
atm_dev_deregister(atm_dev);
- kfree(he_dev);
+ if (he_dev)
+ kfree(he_dev);
pci_disable_device(pci_dev);
return err;
}
@@ -2533,7 +2534,8 @@ he_open(struct atm_vcc *vcc)
open_failed:
if (err) {
- kfree(he_vcc);
+ if (he_vcc)
+ kfree(he_vcc);
clear_bit(ATM_VF_ADDR, &vcc->flags);
}
else
diff --git a/trunk/drivers/atm/nicstar.c b/trunk/drivers/atm/nicstar.c
index b2a7b754fd14..85bf5c8442b0 100644
--- a/trunk/drivers/atm/nicstar.c
+++ b/trunk/drivers/atm/nicstar.c
@@ -676,10 +676,10 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
PRINTK("nicstar%d: RSQ base at 0x%x.\n", i, (u32) card->rsq.base);
/* Initialize SCQ0, the only VBR SCQ used */
- card->scq1 = NULL;
- card->scq2 = NULL;
+ card->scq1 = (scq_info *) NULL;
+ card->scq2 = (scq_info *) NULL;
card->scq0 = get_scq(VBR_SCQSIZE, NS_VRSCD0);
- if (card->scq0 == NULL)
+ if (card->scq0 == (scq_info *) NULL)
{
printk("nicstar%d: can't get SCQ0.\n", i);
error = 12;
@@ -993,24 +993,24 @@ static scq_info *get_scq(int size, u32 scd)
int i;
if (size != VBR_SCQSIZE && size != CBR_SCQSIZE)
- return NULL;
+ return (scq_info *) NULL;
scq = (scq_info *) kmalloc(sizeof(scq_info), GFP_KERNEL);
- if (scq == NULL)
- return NULL;
+ if (scq == (scq_info *) NULL)
+ return (scq_info *) NULL;
scq->org = kmalloc(2 * size, GFP_KERNEL);
if (scq->org == NULL)
{
kfree(scq);
- return NULL;
+ return (scq_info *) NULL;
}
scq->skb = (struct sk_buff **) kmalloc(sizeof(struct sk_buff *) *
(size / NS_SCQE_SIZE), GFP_KERNEL);
- if (scq->skb == NULL)
+ if (scq->skb == (struct sk_buff **) NULL)
{
kfree(scq->org);
kfree(scq);
- return NULL;
+ return (scq_info *) NULL;
}
scq->num_entries = size / NS_SCQE_SIZE;
scq->base = (ns_scqe *) ALIGN_ADDRESS(scq->org, size);
@@ -1498,7 +1498,7 @@ static int ns_open(struct atm_vcc *vcc)
vc->cbr_scd = NS_FRSCD + frscdi * NS_FRSCD_SIZE;
scq = get_scq(CBR_SCQSIZE, vc->cbr_scd);
- if (scq == NULL)
+ if (scq == (scq_info *) NULL)
{
PRINTK("nicstar%d: can't get fixed rate SCQ.\n", card->index);
card->scd2vc[frscdi] = NULL;
diff --git a/trunk/drivers/atm/zatm.c b/trunk/drivers/atm/zatm.c
index 8d5e65cb9755..47a800519ad0 100644
--- a/trunk/drivers/atm/zatm.c
+++ b/trunk/drivers/atm/zatm.c
@@ -902,7 +902,7 @@ static void close_tx(struct atm_vcc *vcc)
zatm_dev->tx_bw += vcc->qos.txtp.min_pcr;
dealloc_shaper(vcc->dev,zatm_vcc->shaper);
}
- kfree(zatm_vcc->ring);
+ if (zatm_vcc->ring) kfree(zatm_vcc->ring);
}
@@ -1339,9 +1339,12 @@ static int __init zatm_start(struct atm_dev *dev)
return 0;
out:
for (i = 0; i < NR_MBX; i++)
- kfree(zatm_dev->mbx_start[i]);
- kfree(zatm_dev->rx_map);
- kfree(zatm_dev->tx_map);
+ if (zatm_dev->mbx_start[i] != 0)
+ kfree((void *) zatm_dev->mbx_start[i]);
+ if (zatm_dev->rx_map != NULL)
+ kfree(zatm_dev->rx_map);
+ if (zatm_dev->tx_map != NULL)
+ kfree(zatm_dev->tx_map);
free_irq(zatm_dev->irq, dev);
return error;
}
diff --git a/trunk/drivers/block/ub.c b/trunk/drivers/block/ub.c
index 19c5e59bcfa8..ce42889f98fb 100644
--- a/trunk/drivers/block/ub.c
+++ b/trunk/drivers/block/ub.c
@@ -8,12 +8,13 @@
* and is not licensed separately. See file COPYING for details.
*
* TODO (sorted by decreasing priority)
- * -- Kill first_open (Al Viro fixed the block layer now)
* -- Do resets with usb_device_reset (needs a thread context, use khubd)
* -- set readonly flag for CDs, set removable flag for CF readers
* -- do inquiry and verify we got a disk and not a tape (for LUN mismatch)
+ * -- support pphaneuf's SDDR-75 with two LUNs (also broken capacity...)
* -- special case some senses, e.g. 3a/0 -> no media present, reduce retries
* -- verify the 13 conditions and do bulk resets
+ * -- normal pool of commands instead of cmdv[]?
* -- kill last_pipe and simply do two-state clearing on both pipes
* -- verify protocol (bulk) from USB descriptors (maybe...)
* -- highmem and sg
@@ -48,14 +49,7 @@
#define US_SC_SCSI 0x06 /* Transparent */
/*
- * This many LUNs per USB device.
- * Every one of them takes a host, see UB_MAX_HOSTS.
*/
-#define UB_MAX_LUNS 9
-
-/*
- */
-
#define UB_MINORS_PER_MAJOR 8
#define UB_MAX_CDB_SIZE 16 /* Corresponds to Bulk */
@@ -71,7 +65,7 @@ struct bulk_cb_wrap {
u32 Tag; /* unique per command id */
__le32 DataTransferLength; /* size of data */
u8 Flags; /* direction in bit 0 */
- u8 Lun; /* LUN */
+ u8 Lun; /* LUN normally 0 */
u8 Length; /* of of the CDB */
u8 CDB[UB_MAX_CDB_SIZE]; /* max command */
};
@@ -174,7 +168,6 @@ struct ub_scsi_cmd {
unsigned int len; /* Requested length */
// struct scatterlist sgv[UB_MAX_REQ_SG];
- struct ub_lun *lun;
void (*done)(struct ub_dev *, struct ub_scsi_cmd *);
void *back;
};
@@ -259,47 +252,25 @@ struct ub_scsi_cmd_queue {
};
/*
- * The block device instance (one per LUN).
- */
-struct ub_lun {
- struct ub_dev *udev;
- struct list_head link;
- struct gendisk *disk;
- int id; /* Host index */
- int num; /* LUN number */
- char name[16];
-
- int changed; /* Media was changed */
- int removable;
- int readonly;
- int first_open; /* Kludge. See ub_bd_open. */
-
- /* Use Ingo's mempool if or when we have more than one command. */
- /*
- * Currently we never need more than one command for the whole device.
- * However, giving every LUN a command is a cheap and automatic way
- * to enforce fairness between them.
- */
- int cmda[1];
- struct ub_scsi_cmd cmdv[1];
-
- struct ub_capacity capacity;
-};
-
-/*
- * The USB device instance.
+ * The UB device instance.
*/
struct ub_dev {
spinlock_t lock;
+ int id; /* Number among ub's */
atomic_t poison; /* The USB device is disconnected */
int openc; /* protected by ub_lock! */
/* kref is too implicit for our taste */
unsigned int tagcnt;
- char name[12];
+ int changed; /* Media was changed */
+ int removable;
+ int readonly;
+ int first_open; /* Kludge. See ub_bd_open. */
+ char name[8];
struct usb_device *dev;
struct usb_interface *intf;
- struct list_head luns;
+ struct ub_capacity capacity;
+ struct gendisk *disk;
unsigned int send_bulk_pipe; /* cached pipe values */
unsigned int recv_bulk_pipe;
@@ -308,6 +279,10 @@ struct ub_dev {
struct tasklet_struct tasklet;
+ /* XXX Use Ingo's mempool (once we have more than one) */
+ int cmda[1];
+ struct ub_scsi_cmd cmdv[1];
+
struct ub_scsi_cmd_queue cmd_queue;
struct ub_scsi_cmd top_rqs_cmd; /* REQUEST SENSE */
unsigned char top_sense[UB_SENSE_SIZE];
@@ -326,9 +301,9 @@ struct ub_dev {
/*
*/
static void ub_cleanup(struct ub_dev *sc);
-static int ub_bd_rq_fn_1(struct ub_lun *lun, struct request *rq);
-static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
- struct ub_scsi_cmd *cmd, struct request *rq);
+static int ub_bd_rq_fn_1(struct ub_dev *sc, struct request *rq);
+static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
+ struct request *rq);
static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
struct request *rq);
static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd);
@@ -345,10 +320,8 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd);
static int ub_submit_clear_stall(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
int stalled_pipe);
static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd);
-static int ub_sync_tur(struct ub_dev *sc, struct ub_lun *lun);
-static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
- struct ub_capacity *ret);
-static int ub_probe_lun(struct ub_dev *sc, int lnum);
+static int ub_sync_tur(struct ub_dev *sc);
+static int ub_sync_read_cap(struct ub_dev *sc, struct ub_capacity *ret);
/*
*/
@@ -369,7 +342,6 @@ MODULE_DEVICE_TABLE(usb, ub_usb_ids);
*/
#define UB_MAX_HOSTS 26
static char ub_hostv[UB_MAX_HOSTS];
-
static DEFINE_SPINLOCK(ub_lock); /* Locks globals and ->openc */
/*
@@ -434,8 +406,6 @@ static ssize_t ub_diag_show(struct device *dev, char *page)
{
struct usb_interface *intf;
struct ub_dev *sc;
- struct list_head *p;
- struct ub_lun *lun;
int cnt;
unsigned long flags;
int nc, nh;
@@ -451,15 +421,9 @@ static ssize_t ub_diag_show(struct device *dev, char *page)
spin_lock_irqsave(&sc->lock, flags);
cnt += sprintf(page + cnt,
- "qlen %d qmax %d\n",
- sc->cmd_queue.qlen, sc->cmd_queue.qmax);
-
- list_for_each (p, &sc->luns) {
- lun = list_entry(p, struct ub_lun, link);
- cnt += sprintf(page + cnt,
- "lun %u changed %d removable %d readonly %d\n",
- lun->num, lun->changed, lun->removable, lun->readonly);
- }
+ "qlen %d qmax %d changed %d removable %d readonly %d\n",
+ sc->cmd_queue.qlen, sc->cmd_queue.qmax,
+ sc->changed, sc->removable, sc->readonly);
if ((nc = sc->tr.cur + 1) == SCMD_TRACE_SZ) nc = 0;
for (j = 0; j < SCMD_TRACE_SZ; j++) {
@@ -559,63 +523,53 @@ static void ub_put(struct ub_dev *sc)
*/
static void ub_cleanup(struct ub_dev *sc)
{
- struct list_head *p;
- struct ub_lun *lun;
request_queue_t *q;
- while (!list_empty(&sc->luns)) {
- p = sc->luns.next;
- lun = list_entry(p, struct ub_lun, link);
- list_del(p);
-
- /* I don't think queue can be NULL. But... Stolen from sx8.c */
- if ((q = lun->disk->queue) != NULL)
- blk_cleanup_queue(q);
- /*
- * If we zero disk->private_data BEFORE put_disk, we have
- * to check for NULL all over the place in open, release,
- * check_media and revalidate, because the block level
- * semaphore is well inside the put_disk.
- * But we cannot zero after the call, because *disk is gone.
- * The sd.c is blatantly racy in this area.
- */
- /* disk->private_data = NULL; */
- put_disk(lun->disk);
- lun->disk = NULL;
+ /* I don't think queue can be NULL. But... Stolen from sx8.c */
+ if ((q = sc->disk->queue) != NULL)
+ blk_cleanup_queue(q);
- ub_id_put(lun->id);
- kfree(lun);
- }
+ /*
+ * If we zero disk->private_data BEFORE put_disk, we have to check
+ * for NULL all over the place in open, release, check_media and
+ * revalidate, because the block level semaphore is well inside the
+ * put_disk. But we cannot zero after the call, because *disk is gone.
+ * The sd.c is blatantly racy in this area.
+ */
+ /* disk->private_data = NULL; */
+ put_disk(sc->disk);
+ sc->disk = NULL;
+ ub_id_put(sc->id);
kfree(sc);
}
/*
* The "command allocator".
*/
-static struct ub_scsi_cmd *ub_get_cmd(struct ub_lun *lun)
+static struct ub_scsi_cmd *ub_get_cmd(struct ub_dev *sc)
{
struct ub_scsi_cmd *ret;
- if (lun->cmda[0])
+ if (sc->cmda[0])
return NULL;
- ret = &lun->cmdv[0];
- lun->cmda[0] = 1;
+ ret = &sc->cmdv[0];
+ sc->cmda[0] = 1;
return ret;
}
-static void ub_put_cmd(struct ub_lun *lun, struct ub_scsi_cmd *cmd)
+static void ub_put_cmd(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
{
- if (cmd != &lun->cmdv[0]) {
+ if (cmd != &sc->cmdv[0]) {
printk(KERN_WARNING "%s: releasing a foreign cmd %p\n",
- lun->name, cmd);
+ sc->name, cmd);
return;
}
- if (!lun->cmda[0]) {
- printk(KERN_WARNING "%s: releasing a free cmd\n", lun->name);
+ if (!sc->cmda[0]) {
+ printk(KERN_WARNING "%s: releasing a free cmd\n", sc->name);
return;
}
- lun->cmda[0] = 0;
+ sc->cmda[0] = 0;
}
/*
@@ -676,30 +630,29 @@ static struct ub_scsi_cmd *ub_cmdq_pop(struct ub_dev *sc)
static void ub_bd_rq_fn(request_queue_t *q)
{
- struct ub_lun *lun = q->queuedata;
+ struct ub_dev *sc = q->queuedata;
struct request *rq;
while ((rq = elv_next_request(q)) != NULL) {
- if (ub_bd_rq_fn_1(lun, rq) != 0) {
+ if (ub_bd_rq_fn_1(sc, rq) != 0) {
blk_stop_queue(q);
break;
}
}
}
-static int ub_bd_rq_fn_1(struct ub_lun *lun, struct request *rq)
+static int ub_bd_rq_fn_1(struct ub_dev *sc, struct request *rq)
{
- struct ub_dev *sc = lun->udev;
struct ub_scsi_cmd *cmd;
int rc;
- if (atomic_read(&sc->poison) || lun->changed) {
+ if (atomic_read(&sc->poison) || sc->changed) {
blkdev_dequeue_request(rq);
ub_end_rq(rq, 0);
return 0;
}
- if ((cmd = ub_get_cmd(lun)) == NULL)
+ if ((cmd = ub_get_cmd(sc)) == NULL)
return -1;
memset(cmd, 0, sizeof(struct ub_scsi_cmd));
@@ -708,30 +661,32 @@ static int ub_bd_rq_fn_1(struct ub_lun *lun, struct request *rq)
if (blk_pc_request(rq)) {
rc = ub_cmd_build_packet(sc, cmd, rq);
} else {
- rc = ub_cmd_build_block(sc, lun, cmd, rq);
+ rc = ub_cmd_build_block(sc, cmd, rq);
}
if (rc != 0) {
- ub_put_cmd(lun, cmd);
+ ub_put_cmd(sc, cmd);
ub_end_rq(rq, 0);
+ blk_start_queue(sc->disk->queue);
return 0;
}
+
cmd->state = UB_CMDST_INIT;
- cmd->lun = lun;
cmd->done = ub_rw_cmd_done;
cmd->back = rq;
cmd->tag = sc->tagcnt++;
if ((rc = ub_submit_scsi(sc, cmd)) != 0) {
- ub_put_cmd(lun, cmd);
+ ub_put_cmd(sc, cmd);
ub_end_rq(rq, 0);
+ blk_start_queue(sc->disk->queue);
return 0;
}
return 0;
}
-static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
- struct ub_scsi_cmd *cmd, struct request *rq)
+static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
+ struct request *rq)
{
int ub_dir;
#if 0 /* We use rq->buffer for now */
@@ -752,7 +707,7 @@ static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
sg = &cmd->sgv[0];
n_elem = blk_rq_map_sg(q, rq, sg);
if (n_elem <= 0) {
- ub_put_cmd(lun, cmd);
+ ub_put_cmd(sc, cmd);
ub_end_rq(rq, 0);
blk_start_queue(q);
return 0; /* request with no s/g entries? */
@@ -761,7 +716,7 @@ static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
if (n_elem != 1) { /* Paranoia */
printk(KERN_WARNING "%s: request with %d segments\n",
sc->name, n_elem);
- ub_put_cmd(lun, cmd);
+ ub_put_cmd(sc, cmd);
ub_end_rq(rq, 0);
blk_start_queue(q);
return 0;
@@ -793,8 +748,8 @@ static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
* The call to blk_queue_hardsect_size() guarantees that request
* is aligned, but it is given in terms of 512 byte units, always.
*/
- block = rq->sector >> lun->capacity.bshift;
- nblks = rq->nr_sectors >> lun->capacity.bshift;
+ block = rq->sector >> sc->capacity.bshift;
+ nblks = rq->nr_sectors >> sc->capacity.bshift;
cmd->cdb[0] = (ub_dir == UB_DIR_READ)? READ_10: WRITE_10;
/* 10-byte uses 4 bytes of LBA: 2147483648KB, 2097152MB, 2048GB */
@@ -848,8 +803,7 @@ static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
{
struct request *rq = cmd->back;
- struct ub_lun *lun = cmd->lun;
- struct gendisk *disk = lun->disk;
+ struct gendisk *disk = sc->disk;
request_queue_t *q = disk->queue;
int uptodate;
@@ -864,7 +818,7 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
else
uptodate = 0;
- ub_put_cmd(lun, cmd);
+ ub_put_cmd(sc, cmd);
ub_end_rq(rq, uptodate);
blk_start_queue(q);
}
@@ -933,7 +887,7 @@ static int ub_scsi_cmd_start(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
bcb->Tag = cmd->tag; /* Endianness is not important */
bcb->DataTransferLength = cpu_to_le32(cmd->len);
bcb->Flags = (cmd->dir == UB_DIR_READ) ? 0x80 : 0;
- bcb->Lun = (cmd->lun != NULL) ? cmd->lun->num : 0;
+ bcb->Lun = 0; /* No multi-LUN yet */
bcb->Length = cmd->cdb_len;
/* copy the command payload */
@@ -1048,8 +1002,9 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
* The control pipe clears itself - nothing to do.
* XXX Might try to reset the device here and retry.
*/
- printk(KERN_NOTICE "%s: stall on control pipe\n",
- sc->name);
+ printk(KERN_NOTICE "%s: "
+ "stall on control pipe for device %u\n",
+ sc->name, sc->dev->devnum);
goto Bad_End;
}
@@ -1070,8 +1025,9 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
* The control pipe clears itself - nothing to do.
* XXX Might try to reset the device here and retry.
*/
- printk(KERN_NOTICE "%s: stall on control pipe\n",
- sc->name);
+ printk(KERN_NOTICE "%s: "
+ "stall on control pipe for device %u\n",
+ sc->name, sc->dev->devnum);
goto Bad_End;
}
@@ -1090,8 +1046,9 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe);
if (rc != 0) {
printk(KERN_NOTICE "%s: "
- "unable to submit clear (%d)\n",
- sc->name, rc);
+ "unable to submit clear for device %u"
+ " (code %d)\n",
+ sc->name, sc->dev->devnum, rc);
/*
* This is typically ENOMEM or some other such shit.
* Retrying is pointless. Just do Bad End on it...
@@ -1150,8 +1107,9 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe);
if (rc != 0) {
printk(KERN_NOTICE "%s: "
- "unable to submit clear (%d)\n",
- sc->name, rc);
+ "unable to submit clear for device %u"
+ " (code %d)\n",
+ sc->name, sc->dev->devnum, rc);
/*
* This is typically ENOMEM or some other such shit.
* Retrying is pointless. Just do Bad End on it...
@@ -1182,8 +1140,9 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe);
if (rc != 0) {
printk(KERN_NOTICE "%s: "
- "unable to submit clear (%d)\n",
- sc->name, rc);
+ "unable to submit clear for device %u"
+ " (code %d)\n",
+ sc->name, sc->dev->devnum, rc);
/*
* This is typically ENOMEM or some other such shit.
* Retrying is pointless. Just do Bad End on it...
@@ -1205,8 +1164,9 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
* encounter such a thing, try to read the CSW again.
*/
if (++cmd->stat_count >= 4) {
- printk(KERN_NOTICE "%s: unable to get CSW\n",
- sc->name);
+ printk(KERN_NOTICE "%s: "
+ "unable to get CSW on device %u\n",
+ sc->name, sc->dev->devnum);
goto Bad_End;
}
__ub_state_stat(sc, cmd);
@@ -1247,8 +1207,10 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
*/
if (++cmd->stat_count >= 4) {
printk(KERN_NOTICE "%s: "
- "tag mismatch orig 0x%x reply 0x%x\n",
- sc->name, cmd->tag, bcs->Tag);
+ "tag mismatch orig 0x%x reply 0x%x "
+ "on device %u\n",
+ sc->name, cmd->tag, bcs->Tag,
+ sc->dev->devnum);
goto Bad_End;
}
__ub_state_stat(sc, cmd);
@@ -1282,8 +1244,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
} else {
printk(KERN_WARNING "%s: "
- "wrong command state %d\n",
- sc->name, cmd->state);
+ "wrong command state %d on device %u\n",
+ sc->name, cmd->state, sc->dev->devnum);
goto Bad_End;
}
return;
@@ -1326,6 +1288,7 @@ static void __ub_state_stat(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
if ((rc = usb_submit_urb(&sc->work_urb, GFP_ATOMIC)) != 0) {
/* XXX Clear stalls */
+ printk("%s: CSW #%d submit failed (%d)\n", sc->name, cmd->tag, rc); /* P3 */
ub_complete(&sc->work_done);
ub_state_done(sc, cmd, rc);
return;
@@ -1370,7 +1333,6 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
scmd->state = UB_CMDST_INIT;
scmd->data = sc->top_sense;
scmd->len = UB_SENSE_SIZE;
- scmd->lun = cmd->lun;
scmd->done = ub_top_sense_done;
scmd->back = cmd;
@@ -1449,14 +1411,14 @@ static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd)
}
if (cmd != scmd->back) {
printk(KERN_WARNING "%s: "
- "sense done for wrong command 0x%x\n",
- sc->name, cmd->tag);
+ "sense done for wrong command 0x%x on device %u\n",
+ sc->name, cmd->tag, sc->dev->devnum);
return;
}
if (cmd->state != UB_CMDST_SENSE) {
printk(KERN_WARNING "%s: "
- "sense done with bad cmd state %d\n",
- sc->name, cmd->state);
+ "sense done with bad cmd state %d on device %u\n",
+ sc->name, cmd->state, sc->dev->devnum);
return;
}
@@ -1467,32 +1429,68 @@ static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd)
ub_scsi_urb_compl(sc, cmd);
}
+#if 0
+/* Determine what the maximum LUN supported is */
+int usb_stor_Bulk_max_lun(struct us_data *us)
+{
+ int result;
+
+ /* issue the command */
+ result = usb_stor_control_msg(us, us->recv_ctrl_pipe,
+ US_BULK_GET_MAX_LUN,
+ USB_DIR_IN | USB_TYPE_CLASS |
+ USB_RECIP_INTERFACE,
+ 0, us->ifnum, us->iobuf, 1, HZ);
+
+ /*
+ * Some devices (i.e. Iomega Zip100) need this -- apparently
+ * the bulk pipes get STALLed when the GetMaxLUN request is
+ * processed. This is, in theory, harmless to all other devices
+ * (regardless of if they stall or not).
+ */
+ if (result < 0) {
+ usb_stor_clear_halt(us, us->recv_bulk_pipe);
+ usb_stor_clear_halt(us, us->send_bulk_pipe);
+ }
+
+ US_DEBUGP("GetMaxLUN command result is %d, data is %d\n",
+ result, us->iobuf[0]);
+
+ /* if we have a successful request, return the result */
+ if (result == 1)
+ return us->iobuf[0];
+
+ /* return the default -- no LUNs */
+ return 0;
+}
+#endif
+
/*
* This is called from a process context.
*/
-static void ub_revalidate(struct ub_dev *sc, struct ub_lun *lun)
+static void ub_revalidate(struct ub_dev *sc)
{
- lun->readonly = 0; /* XXX Query this from the device */
+ sc->readonly = 0; /* XXX Query this from the device */
- lun->capacity.nsec = 0;
- lun->capacity.bsize = 512;
- lun->capacity.bshift = 0;
+ sc->capacity.nsec = 0;
+ sc->capacity.bsize = 512;
+ sc->capacity.bshift = 0;
- if (ub_sync_tur(sc, lun) != 0)
+ if (ub_sync_tur(sc) != 0)
return; /* Not ready */
- lun->changed = 0;
+ sc->changed = 0;
- if (ub_sync_read_cap(sc, lun, &lun->capacity) != 0) {
+ if (ub_sync_read_cap(sc, &sc->capacity) != 0) {
/*
* The retry here means something is wrong, either with the
* device, with the transport, or with our code.
* We keep this because sd.c has retries for capacity.
*/
- if (ub_sync_read_cap(sc, lun, &lun->capacity) != 0) {
- lun->capacity.nsec = 0;
- lun->capacity.bsize = 512;
- lun->capacity.bshift = 0;
+ if (ub_sync_read_cap(sc, &sc->capacity) != 0) {
+ sc->capacity.nsec = 0;
+ sc->capacity.bsize = 512;
+ sc->capacity.bshift = 0;
}
}
}
@@ -1505,15 +1503,12 @@ static void ub_revalidate(struct ub_dev *sc, struct ub_lun *lun)
static int ub_bd_open(struct inode *inode, struct file *filp)
{
struct gendisk *disk = inode->i_bdev->bd_disk;
- struct ub_lun *lun;
struct ub_dev *sc;
unsigned long flags;
int rc;
- if ((lun = disk->private_data) == NULL)
+ if ((sc = disk->private_data) == NULL)
return -ENXIO;
- sc = lun->udev;
-
spin_lock_irqsave(&ub_lock, flags);
if (atomic_read(&sc->poison)) {
spin_unlock_irqrestore(&ub_lock, flags);
@@ -1534,15 +1529,15 @@ static int ub_bd_open(struct inode *inode, struct file *filp)
* The bottom line is, Al Viro says that we should not allow
* bdev->bd_invalidated to be set when doing add_disk no matter what.
*/
- if (lun->first_open) {
- lun->first_open = 0;
- if (lun->changed) {
+ if (sc->first_open) {
+ if (sc->changed) {
+ sc->first_open = 0;
rc = -ENOMEDIUM;
goto err_open;
}
}
- if (lun->removable || lun->readonly)
+ if (sc->removable || sc->readonly)
check_disk_change(inode->i_bdev);
/*
@@ -1550,12 +1545,12 @@ static int ub_bd_open(struct inode *inode, struct file *filp)
* under some pretty murky conditions (a failure of READ CAPACITY).
* We may need it one day.
*/
- if (lun->removable && lun->changed && !(filp->f_flags & O_NDELAY)) {
+ if (sc->removable && sc->changed && !(filp->f_flags & O_NDELAY)) {
rc = -ENOMEDIUM;
goto err_open;
}
- if (lun->readonly && (filp->f_mode & FMODE_WRITE)) {
+ if (sc->readonly && (filp->f_mode & FMODE_WRITE)) {
rc = -EROFS;
goto err_open;
}
@@ -1572,8 +1567,7 @@ static int ub_bd_open(struct inode *inode, struct file *filp)
static int ub_bd_release(struct inode *inode, struct file *filp)
{
struct gendisk *disk = inode->i_bdev->bd_disk;
- struct ub_lun *lun = disk->private_data;
- struct ub_dev *sc = lun->udev;
+ struct ub_dev *sc = disk->private_data;
ub_put(sc);
return 0;
@@ -1603,14 +1597,20 @@ static int ub_bd_ioctl(struct inode *inode, struct file *filp,
*/
static int ub_bd_revalidate(struct gendisk *disk)
{
- struct ub_lun *lun = disk->private_data;
-
- ub_revalidate(lun->udev, lun);
+ struct ub_dev *sc = disk->private_data;
+
+ ub_revalidate(sc);
+ /* This is pretty much a long term P3 */
+ if (!atomic_read(&sc->poison)) { /* Cover sc->dev */
+ printk(KERN_INFO "%s: device %u capacity nsec %ld bsize %u\n",
+ sc->name, sc->dev->devnum,
+ sc->capacity.nsec, sc->capacity.bsize);
+ }
/* XXX Support sector size switching like in sr.c */
- blk_queue_hardsect_size(disk->queue, lun->capacity.bsize);
- set_capacity(disk, lun->capacity.nsec);
- // set_disk_ro(sdkp->disk, lun->readonly);
+ blk_queue_hardsect_size(disk->queue, sc->capacity.bsize);
+ set_capacity(disk, sc->capacity.nsec);
+ // set_disk_ro(sdkp->disk, sc->readonly);
return 0;
}
@@ -1626,9 +1626,9 @@ static int ub_bd_revalidate(struct gendisk *disk)
*/
static int ub_bd_media_changed(struct gendisk *disk)
{
- struct ub_lun *lun = disk->private_data;
+ struct ub_dev *sc = disk->private_data;
- if (!lun->removable)
+ if (!sc->removable)
return 0;
/*
@@ -1640,12 +1640,12 @@ static int ub_bd_media_changed(struct gendisk *disk)
* will fail, then block layer discards the data. Since we never
* spin drives up, such devices simply cannot be used with ub anyway.
*/
- if (ub_sync_tur(lun->udev, lun) != 0) {
- lun->changed = 1;
+ if (ub_sync_tur(sc) != 0) {
+ sc->changed = 1;
return 1;
}
- return lun->changed;
+ return sc->changed;
}
static struct block_device_operations ub_bd_fops = {
@@ -1669,7 +1669,7 @@ static void ub_probe_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
/*
* Test if the device has a check condition on it, synchronously.
*/
-static int ub_sync_tur(struct ub_dev *sc, struct ub_lun *lun)
+static int ub_sync_tur(struct ub_dev *sc)
{
struct ub_scsi_cmd *cmd;
enum { ALLOC_SIZE = sizeof(struct ub_scsi_cmd) };
@@ -1688,7 +1688,6 @@ static int ub_sync_tur(struct ub_dev *sc, struct ub_lun *lun)
cmd->cdb_len = 6;
cmd->dir = UB_DIR_NONE;
cmd->state = UB_CMDST_INIT;
- cmd->lun = lun; /* This may be NULL, but that's ok */
cmd->done = ub_probe_done;
cmd->back = &compl;
@@ -1719,8 +1718,7 @@ static int ub_sync_tur(struct ub_dev *sc, struct ub_lun *lun)
/*
* Read the SCSI capacity synchronously (for probing).
*/
-static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
- struct ub_capacity *ret)
+static int ub_sync_read_cap(struct ub_dev *sc, struct ub_capacity *ret)
{
struct ub_scsi_cmd *cmd;
char *p;
@@ -1745,7 +1743,6 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
cmd->state = UB_CMDST_INIT;
cmd->data = p;
cmd->len = 8;
- cmd->lun = lun;
cmd->done = ub_probe_done;
cmd->back = &compl;
@@ -1814,90 +1811,6 @@ static void ub_probe_timeout(unsigned long arg)
complete(cop);
}
-/*
- * Get number of LUNs by the way of Bulk GetMaxLUN command.
- */
-static int ub_sync_getmaxlun(struct ub_dev *sc)
-{
- int ifnum = sc->intf->cur_altsetting->desc.bInterfaceNumber;
- unsigned char *p;
- enum { ALLOC_SIZE = 1 };
- struct usb_ctrlrequest *cr;
- struct completion compl;
- struct timer_list timer;
- int nluns;
- int rc;
-
- init_completion(&compl);
-
- rc = -ENOMEM;
- if ((p = kmalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
- goto err_alloc;
- *p = 55;
-
- cr = &sc->work_cr;
- cr->bRequestType = USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE;
- cr->bRequest = US_BULK_GET_MAX_LUN;
- cr->wValue = cpu_to_le16(0);
- cr->wIndex = cpu_to_le16(ifnum);
- cr->wLength = cpu_to_le16(1);
-
- usb_fill_control_urb(&sc->work_urb, sc->dev, sc->recv_ctrl_pipe,
- (unsigned char*) cr, p, 1, ub_probe_urb_complete, &compl);
- sc->work_urb.transfer_flags = 0;
- sc->work_urb.actual_length = 0;
- sc->work_urb.error_count = 0;
- sc->work_urb.status = 0;
-
- if ((rc = usb_submit_urb(&sc->work_urb, GFP_KERNEL)) != 0) {
- if (rc == -EPIPE) {
- printk("%s: Stall at GetMaxLUN, using 1 LUN\n",
- sc->name); /* P3 */
- } else {
- printk(KERN_WARNING
- "%s: Unable to submit GetMaxLUN (%d)\n",
- sc->name, rc);
- }
- goto err_submit;
- }
-
- init_timer(&timer);
- timer.function = ub_probe_timeout;
- timer.data = (unsigned long) &compl;
- timer.expires = jiffies + UB_CTRL_TIMEOUT;
- add_timer(&timer);
-
- wait_for_completion(&compl);
-
- del_timer_sync(&timer);
- usb_kill_urb(&sc->work_urb);
-
- if (sc->work_urb.actual_length != 1) {
- printk("%s: GetMaxLUN returned %d bytes\n", sc->name,
- sc->work_urb.actual_length); /* P3 */
- nluns = 0;
- } else {
- if ((nluns = *p) == 55) {
- nluns = 0;
- } else {
- /* GetMaxLUN returns the maximum LUN number */
- nluns += 1;
- if (nluns > UB_MAX_LUNS)
- nluns = UB_MAX_LUNS;
- }
- printk("%s: GetMaxLUN returned %d, using %d LUNs\n", sc->name,
- *p, nluns); /* P3 */
- }
-
- kfree(p);
- return nluns;
-
-err_submit:
- kfree(p);
-err_alloc:
- return rc;
-}
-
/*
* Clear initial stalls.
*/
@@ -1984,8 +1897,8 @@ static int ub_get_pipes(struct ub_dev *sc, struct usb_device *dev,
}
if (ep_in == NULL || ep_out == NULL) {
- printk(KERN_NOTICE "%s: failed endpoint check\n",
- sc->name);
+ printk(KERN_NOTICE "%s: device %u failed endpoint check\n",
+ sc->name, sc->dev->devnum);
return -EIO;
}
@@ -2008,7 +1921,8 @@ static int ub_probe(struct usb_interface *intf,
const struct usb_device_id *dev_id)
{
struct ub_dev *sc;
- int nluns;
+ request_queue_t *q;
+ struct gendisk *disk;
int rc;
int i;
@@ -2017,7 +1931,6 @@ static int ub_probe(struct usb_interface *intf,
goto err_core;
memset(sc, 0, sizeof(struct ub_dev));
spin_lock_init(&sc->lock);
- INIT_LIST_HEAD(&sc->luns);
usb_init_urb(&sc->work_urb);
tasklet_init(&sc->tasklet, ub_scsi_action, (unsigned long)sc);
atomic_set(&sc->poison, 0);
@@ -2029,16 +1942,19 @@ static int ub_probe(struct usb_interface *intf,
ub_init_completion(&sc->work_done);
sc->work_done.done = 1; /* A little yuk, but oh well... */
+ rc = -ENOSR;
+ if ((sc->id = ub_id_get()) == -1)
+ goto err_id;
+ snprintf(sc->name, 8, DRV_NAME "%c", sc->id + 'a');
+
sc->dev = interface_to_usbdev(intf);
sc->intf = intf;
// sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
+
usb_set_intfdata(intf, sc);
usb_get_dev(sc->dev);
// usb_get_intf(sc->intf); /* Do we need this? */
- snprintf(sc->name, 12, DRV_NAME "(%d.%d)",
- sc->dev->bus->busnum, sc->dev->devnum);
-
/* XXX Verify that we can handle the device (from descriptors) */
ub_get_pipes(sc, sc->dev, intf);
@@ -2076,88 +1992,35 @@ static int ub_probe(struct usb_interface *intf,
* In any case it's not our business how revaliadation is implemented.
*/
for (i = 0; i < 3; i++) { /* Retries for benh's key */
- if ((rc = ub_sync_tur(sc, NULL)) <= 0) break;
+ if ((rc = ub_sync_tur(sc)) <= 0) break;
if (rc != 0x6) break;
msleep(10);
}
- nluns = 1;
- for (i = 0; i < 3; i++) {
- if ((rc = ub_sync_getmaxlun(sc)) < 0) {
- /*
- * Some devices (i.e. Iomega Zip100) need this --
- * apparently the bulk pipes get STALLed when the
- * GetMaxLUN request is processed.
- * XXX I have a ZIP-100, verify it does this.
- */
- if (rc == -EPIPE) {
- ub_probe_clear_stall(sc, sc->recv_bulk_pipe);
- ub_probe_clear_stall(sc, sc->send_bulk_pipe);
- }
- break;
- }
- if (rc != 0) {
- nluns = rc;
- break;
- }
- msleep(100);
- }
+ sc->removable = 1; /* XXX Query this from the device */
+ sc->changed = 1; /* ub_revalidate clears only */
+ sc->first_open = 1;
- for (i = 0; i < nluns; i++) {
- ub_probe_lun(sc, i);
- }
- return 0;
-
- /* device_remove_file(&sc->intf->dev, &dev_attr_diag); */
-err_diag:
- usb_set_intfdata(intf, NULL);
- // usb_put_intf(sc->intf);
- usb_put_dev(sc->dev);
- kfree(sc);
-err_core:
- return rc;
-}
-
-static int ub_probe_lun(struct ub_dev *sc, int lnum)
-{
- struct ub_lun *lun;
- request_queue_t *q;
- struct gendisk *disk;
- int rc;
-
- rc = -ENOMEM;
- if ((lun = kmalloc(sizeof(struct ub_lun), GFP_KERNEL)) == NULL)
- goto err_alloc;
- memset(lun, 0, sizeof(struct ub_lun));
- lun->num = lnum;
-
- rc = -ENOSR;
- if ((lun->id = ub_id_get()) == -1)
- goto err_id;
-
- lun->udev = sc;
- list_add(&lun->link, &sc->luns);
-
- snprintf(lun->name, 16, DRV_NAME "%c(%d.%d.%d)",
- lun->id + 'a', sc->dev->bus->busnum, sc->dev->devnum, lun->num);
-
- lun->removable = 1; /* XXX Query this from the device */
- lun->changed = 1; /* ub_revalidate clears only */
- lun->first_open = 1;
- ub_revalidate(sc, lun);
+ ub_revalidate(sc);
+ /* This is pretty much a long term P3 */
+ printk(KERN_INFO "%s: device %u capacity nsec %ld bsize %u\n",
+ sc->name, sc->dev->devnum, sc->capacity.nsec, sc->capacity.bsize);
+ /*
+ * Just one disk per sc currently, but maybe more.
+ */
rc = -ENOMEM;
if ((disk = alloc_disk(UB_MINORS_PER_MAJOR)) == NULL)
goto err_diskalloc;
- lun->disk = disk;
- sprintf(disk->disk_name, DRV_NAME "%c", lun->id + 'a');
- sprintf(disk->devfs_name, DEVFS_NAME "/%c", lun->id + 'a');
+ sc->disk = disk;
+ sprintf(disk->disk_name, DRV_NAME "%c", sc->id + 'a');
+ sprintf(disk->devfs_name, DEVFS_NAME "/%c", sc->id + 'a');
disk->major = UB_MAJOR;
- disk->first_minor = lun->id * UB_MINORS_PER_MAJOR;
+ disk->first_minor = sc->id * UB_MINORS_PER_MAJOR;
disk->fops = &ub_bd_fops;
- disk->private_data = lun;
- disk->driverfs_dev = &sc->intf->dev; /* XXX Many to one ok? */
+ disk->private_data = sc;
+ disk->driverfs_dev = &intf->dev;
rc = -ENOMEM;
if ((q = blk_init_queue(ub_bd_rq_fn, &sc->lock)) == NULL)
@@ -2165,17 +2028,28 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum)
disk->queue = q;
- blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH);
+ // blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask);
blk_queue_max_hw_segments(q, UB_MAX_REQ_SG);
blk_queue_max_phys_segments(q, UB_MAX_REQ_SG);
- blk_queue_segment_boundary(q, 0xffffffff); /* Dubious. */
+ // blk_queue_segment_boundary(q, CARM_SG_BOUNDARY);
blk_queue_max_sectors(q, UB_MAX_SECTORS);
- blk_queue_hardsect_size(q, lun->capacity.bsize);
+ blk_queue_hardsect_size(q, sc->capacity.bsize);
+
+ /*
+ * This is a serious infraction, caused by a deficiency in the
+ * USB sg interface (usb_sg_wait()). We plan to remove this once
+ * we get mileage on the driver and can justify a change to USB API.
+ * See blk_queue_bounce_limit() to understand this part.
+ *
+ * XXX And I still need to be aware of the DMA mask in the HC.
+ */
+ q->bounce_pfn = blk_max_low_pfn;
+ q->bounce_gfp = GFP_NOIO;
- q->queuedata = lun;
+ q->queuedata = sc;
- set_capacity(disk, lun->capacity.nsec);
- if (lun->removable)
+ set_capacity(disk, sc->capacity.nsec);
+ if (sc->removable)
disk->flags |= GENHD_FL_REMOVABLE;
add_disk(disk);
@@ -2185,20 +2059,22 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum)
err_blkqinit:
put_disk(disk);
err_diskalloc:
- list_del(&lun->link);
- ub_id_put(lun->id);
+ device_remove_file(&sc->intf->dev, &dev_attr_diag);
+err_diag:
+ usb_set_intfdata(intf, NULL);
+ // usb_put_intf(sc->intf);
+ usb_put_dev(sc->dev);
+ ub_id_put(sc->id);
err_id:
- kfree(lun);
-err_alloc:
+ kfree(sc);
+err_core:
return rc;
}
static void ub_disconnect(struct usb_interface *intf)
{
struct ub_dev *sc = usb_get_intfdata(intf);
- struct list_head *p;
- struct ub_lun *lun;
- struct gendisk *disk;
+ struct gendisk *disk = sc->disk;
unsigned long flags;
/*
@@ -2248,18 +2124,14 @@ static void ub_disconnect(struct usb_interface *intf)
/*
* Unregister the upper layer.
*/
- list_for_each (p, &sc->luns) {
- lun = list_entry(p, struct ub_lun, link);
- disk = lun->disk;
- if (disk->flags & GENHD_FL_UP)
- del_gendisk(disk);
- /*
- * I wish I could do:
- * set_bit(QUEUE_FLAG_DEAD, &q->queue_flags);
- * As it is, we rely on our internal poisoning and let
- * the upper levels to spin furiously failing all the I/O.
- */
- }
+ if (disk->flags & GENHD_FL_UP)
+ del_gendisk(disk);
+ /*
+ * I wish I could do:
+ * set_bit(QUEUE_FLAG_DEAD, &q->queue_flags);
+ * As it is, we rely on our internal poisoning and let
+ * the upper levels to spin furiously failing all the I/O.
+ */
/*
* Taking a lock on a structure which is about to be freed
@@ -2310,8 +2182,8 @@ static int __init ub_init(void)
{
int rc;
- /* P3 */ printk("ub: sizeof ub_scsi_cmd %zu ub_dev %zu ub_lun %zu\n",
- sizeof(struct ub_scsi_cmd), sizeof(struct ub_dev), sizeof(struct ub_lun));
+ /* P3 */ printk("ub: sizeof ub_scsi_cmd %zu ub_dev %zu\n",
+ sizeof(struct ub_scsi_cmd), sizeof(struct ub_dev));
if ((rc = register_blkdev(UB_MAJOR, DRV_NAME)) != 0)
goto err_regblkdev;
diff --git a/trunk/drivers/char/agp/agp.h b/trunk/drivers/char/agp/agp.h
index c1fe013c64f3..ad9c11391d81 100644
--- a/trunk/drivers/char/agp/agp.h
+++ b/trunk/drivers/char/agp/agp.h
@@ -278,8 +278,6 @@ void agp3_generic_cleanup(void);
#define AGP_GENERIC_SIZES_ENTRIES 11
extern struct aper_size_info_16 agp3_generic_sizes[];
-#define virt_to_gart(x) (phys_to_gart(virt_to_phys(x)))
-#define gart_to_virt(x) (phys_to_virt(gart_to_phys(x)))
extern int agp_off;
extern int agp_try_unsupported_boot;
diff --git a/trunk/drivers/char/agp/ali-agp.c b/trunk/drivers/char/agp/ali-agp.c
index 9c9c9c2247ce..0212febda654 100644
--- a/trunk/drivers/char/agp/ali-agp.c
+++ b/trunk/drivers/char/agp/ali-agp.c
@@ -150,7 +150,7 @@ static void *m1541_alloc_page(struct agp_bridge_data *bridge)
pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
(((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
- virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN ));
+ virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN ));
return addr;
}
@@ -174,7 +174,7 @@ static void m1541_destroy_page(void * addr)
pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
(((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
- virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN));
+ virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN));
agp_generic_destroy_page(addr);
}
diff --git a/trunk/drivers/char/agp/amd-k7-agp.c b/trunk/drivers/char/agp/amd-k7-agp.c
index 3a41672e4d66..e62a3c2c44a9 100644
--- a/trunk/drivers/char/agp/amd-k7-agp.c
+++ b/trunk/drivers/char/agp/amd-k7-agp.c
@@ -43,7 +43,7 @@ static int amd_create_page_map(struct amd_page_map *page_map)
SetPageReserved(virt_to_page(page_map->real));
global_cache_flush();
- page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real),
+ page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
PAGE_SIZE);
if (page_map->remapped == NULL) {
ClearPageReserved(virt_to_page(page_map->real));
@@ -154,7 +154,7 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge)
agp_bridge->gatt_table_real = (u32 *)page_dir.real;
agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
- agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real);
+ agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real);
/* Get the address for the gart region.
* This is a bus address even on the alpha, b/c its
@@ -167,7 +167,7 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge)
/* Calculate the agp offset */
for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
- writel(virt_to_gart(amd_irongate_private.gatt_pages[i]->real) | 1,
+ writel(virt_to_phys(amd_irongate_private.gatt_pages[i]->real) | 1,
page_dir.remapped+GET_PAGE_DIR_OFF(addr));
readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */
}
diff --git a/trunk/drivers/char/agp/amd64-agp.c b/trunk/drivers/char/agp/amd64-agp.c
index 1407945a5892..399c042f68f0 100644
--- a/trunk/drivers/char/agp/amd64-agp.c
+++ b/trunk/drivers/char/agp/amd64-agp.c
@@ -219,7 +219,7 @@ static struct aper_size_info_32 amd_8151_sizes[7] =
static int amd_8151_configure(void)
{
- unsigned long gatt_bus = virt_to_gart(agp_bridge->gatt_table_real);
+ unsigned long gatt_bus = virt_to_phys(agp_bridge->gatt_table_real);
/* Configure AGP regs in each x86-64 host bridge. */
for_each_nb() {
@@ -591,7 +591,7 @@ static void __devexit agp_amd64_remove(struct pci_dev *pdev)
{
struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
- release_mem_region(virt_to_gart(bridge->gatt_table_real),
+ release_mem_region(virt_to_phys(bridge->gatt_table_real),
amd64_aperture_sizes[bridge->aperture_size_idx].size);
agp_remove_bridge(bridge);
agp_put_bridge(bridge);
diff --git a/trunk/drivers/char/agp/ati-agp.c b/trunk/drivers/char/agp/ati-agp.c
index e572ced9100a..a65f8827c283 100644
--- a/trunk/drivers/char/agp/ati-agp.c
+++ b/trunk/drivers/char/agp/ati-agp.c
@@ -61,7 +61,7 @@ static int ati_create_page_map(ati_page_map *page_map)
SetPageReserved(virt_to_page(page_map->real));
err = map_page_into_agp(virt_to_page(page_map->real));
- page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real),
+ page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
PAGE_SIZE);
if (page_map->remapped == NULL || err) {
ClearPageReserved(virt_to_page(page_map->real));
@@ -343,7 +343,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge)
agp_bridge->gatt_table_real = (u32 *)page_dir.real;
agp_bridge->gatt_table = (u32 __iomem *) page_dir.remapped;
- agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real);
+ agp_bridge->gatt_bus_addr = virt_to_bus(page_dir.real);
/* Write out the size register */
current_size = A_SIZE_LVL2(agp_bridge->current_size);
@@ -373,7 +373,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge)
/* Calculate the agp offset */
for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
- writel(virt_to_gart(ati_generic_private.gatt_pages[i]->real) | 1,
+ writel(virt_to_bus(ati_generic_private.gatt_pages[i]->real) | 1,
page_dir.remapped+GET_PAGE_DIR_OFF(addr));
readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */
}
diff --git a/trunk/drivers/char/agp/backend.c b/trunk/drivers/char/agp/backend.c
index 4d4e602fdc7e..2f3dfb63bdc6 100644
--- a/trunk/drivers/char/agp/backend.c
+++ b/trunk/drivers/char/agp/backend.c
@@ -148,7 +148,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
return -ENOMEM;
}
- bridge->scratch_page_real = virt_to_gart(addr);
+ bridge->scratch_page_real = virt_to_phys(addr);
bridge->scratch_page =
bridge->driver->mask_memory(bridge, bridge->scratch_page_real, 0);
}
@@ -189,7 +189,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
err_out:
if (bridge->driver->needs_scratch_page)
bridge->driver->agp_destroy_page(
- gart_to_virt(bridge->scratch_page_real));
+ phys_to_virt(bridge->scratch_page_real));
if (got_gatt)
bridge->driver->free_gatt_table(bridge);
if (got_keylist) {
@@ -214,7 +214,7 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge)
if (bridge->driver->agp_destroy_page &&
bridge->driver->needs_scratch_page)
bridge->driver->agp_destroy_page(
- gart_to_virt(bridge->scratch_page_real));
+ phys_to_virt(bridge->scratch_page_real));
}
/* When we remove the global variable agp_bridge from all drivers
diff --git a/trunk/drivers/char/agp/efficeon-agp.c b/trunk/drivers/char/agp/efficeon-agp.c
index ac19fdcd21c1..1383c3165ea1 100644
--- a/trunk/drivers/char/agp/efficeon-agp.c
+++ b/trunk/drivers/char/agp/efficeon-agp.c
@@ -219,7 +219,7 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge)
efficeon_private.l1_table[index] = page;
- value = virt_to_gart(page) | pati | present | index;
+ value = __pa(page) | pati | present | index;
pci_write_config_dword(agp_bridge->dev,
EFFICEON_ATTPAGE, value);
diff --git a/trunk/drivers/char/agp/generic.c b/trunk/drivers/char/agp/generic.c
index f0079e991bdc..c321a924e38a 100644
--- a/trunk/drivers/char/agp/generic.c
+++ b/trunk/drivers/char/agp/generic.c
@@ -153,7 +153,7 @@ void agp_free_memory(struct agp_memory *curr)
}
if (curr->page_count != 0) {
for (i = 0; i < curr->page_count; i++) {
- curr->bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[i]));
+ curr->bridge->driver->agp_destroy_page(phys_to_virt(curr->memory[i]));
}
}
agp_free_key(curr->key);
@@ -209,7 +209,7 @@ struct agp_memory *agp_allocate_memory(struct agp_bridge_data *bridge,
agp_free_memory(new);
return NULL;
}
- new->memory[i] = virt_to_gart(addr);
+ new->memory[i] = virt_to_phys(addr);
new->page_count++;
}
new->bridge = bridge;
@@ -295,6 +295,19 @@ int agp_num_entries(void)
EXPORT_SYMBOL_GPL(agp_num_entries);
+static int check_bridge_mode(struct pci_dev *dev)
+{
+ u32 agp3;
+ u8 cap_ptr;
+
+ cap_ptr = pci_find_capability(dev, PCI_CAP_ID_AGP);
+ pci_read_config_dword(dev, cap_ptr+AGPSTAT, &agp3);
+ if (agp3 & AGPSTAT_MODE_3_0)
+ return 1;
+ return 0;
+}
+
+
/**
* agp_copy_info - copy bridge state information
*
@@ -315,7 +328,7 @@ int agp_copy_info(struct agp_bridge_data *bridge, struct agp_kern_info *info)
info->version.minor = bridge->version->minor;
info->chipset = SUPPORTED;
info->device = bridge->dev;
- if (bridge->mode & AGPSTAT_MODE_3_0)
+ if (check_bridge_mode(bridge->dev))
info->mode = bridge->mode & ~AGP3_RESERVED_MASK;
else
info->mode = bridge->mode & ~AGP2_RESERVED_MASK;
@@ -648,7 +661,7 @@ u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 requested_mode
bridge_agpstat &= ~AGPSTAT_FW;
/* Check to see if we are operating in 3.0 mode */
- if (agp_bridge->mode & AGPSTAT_MODE_3_0)
+ if (check_bridge_mode(agp_bridge->dev))
agp_v3_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat);
else
agp_v2_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat);
@@ -719,7 +732,7 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode)
/* Do AGP version specific frobbing. */
if (bridge->major_version >= 3) {
- if (bridge->mode & AGPSTAT_MODE_3_0) {
+ if (check_bridge_mode(bridge->dev)) {
/* If we have 3.5, we can do the isoch stuff. */
if (bridge->minor_version >= 5)
agp_3_5_enable(bridge);
@@ -793,7 +806,8 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
break;
}
- table = alloc_gatt_pages(page_order);
+ table = (char *) __get_free_pages(GFP_KERNEL,
+ page_order);
if (table == NULL) {
i++;
@@ -824,7 +838,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
size = ((struct aper_size_info_fixed *) temp)->size;
page_order = ((struct aper_size_info_fixed *) temp)->page_order;
num_entries = ((struct aper_size_info_fixed *) temp)->num_entries;
- table = alloc_gatt_pages(page_order);
+ table = (char *) __get_free_pages(GFP_KERNEL, page_order);
}
if (table == NULL)
@@ -839,7 +853,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
agp_gatt_table = (void *)table;
bridge->driver->cache_flush();
- bridge->gatt_table = ioremap_nocache(virt_to_gart(table),
+ bridge->gatt_table = ioremap_nocache(virt_to_phys(table),
(PAGE_SIZE * (1 << page_order)));
bridge->driver->cache_flush();
@@ -847,11 +861,11 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
ClearPageReserved(page);
- free_gatt_pages(table, page_order);
+ free_pages((unsigned long) table, page_order);
return -ENOMEM;
}
- bridge->gatt_bus_addr = virt_to_gart(bridge->gatt_table_real);
+ bridge->gatt_bus_addr = virt_to_phys(bridge->gatt_table_real);
/* AK: bogus, should encode addresses > 4GB */
for (i = 0; i < num_entries; i++) {
@@ -905,7 +919,7 @@ int agp_generic_free_gatt_table(struct agp_bridge_data *bridge)
for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
ClearPageReserved(page);
- free_gatt_pages(bridge->gatt_table_real, page_order);
+ free_pages((unsigned long) bridge->gatt_table_real, page_order);
agp_gatt_table = NULL;
bridge->gatt_table = NULL;
diff --git a/trunk/drivers/char/agp/hp-agp.c b/trunk/drivers/char/agp/hp-agp.c
index 99762b6c19ae..6052bfa04c72 100644
--- a/trunk/drivers/char/agp/hp-agp.c
+++ b/trunk/drivers/char/agp/hp-agp.c
@@ -110,7 +110,7 @@ static int __init hp_zx1_ioc_shared(void)
hp->gart_size = HP_ZX1_GART_SIZE;
hp->gatt_entries = hp->gart_size / hp->io_page_size;
- hp->io_pdir = gart_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE));
+ hp->io_pdir = phys_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE));
hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)];
if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) {
@@ -248,7 +248,7 @@ hp_zx1_configure (void)
agp_bridge->mode = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS);
if (hp->io_pdir_owner) {
- writel(virt_to_gart(hp->io_pdir), hp->ioc_regs+HP_ZX1_PDIR_BASE);
+ writel(virt_to_phys(hp->io_pdir), hp->ioc_regs+HP_ZX1_PDIR_BASE);
readl(hp->ioc_regs+HP_ZX1_PDIR_BASE);
writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG);
readl(hp->ioc_regs+HP_ZX1_TCNFG);
diff --git a/trunk/drivers/char/agp/i460-agp.c b/trunk/drivers/char/agp/i460-agp.c
index 94943298c03e..adbea896c0d2 100644
--- a/trunk/drivers/char/agp/i460-agp.c
+++ b/trunk/drivers/char/agp/i460-agp.c
@@ -372,7 +372,7 @@ static int i460_alloc_large_page (struct lp_desc *lp)
}
memset(lp->alloced_map, 0, map_size);
- lp->paddr = virt_to_gart(lpage);
+ lp->paddr = virt_to_phys(lpage);
lp->refcount = 0;
atomic_add(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp);
return 0;
@@ -383,7 +383,7 @@ static void i460_free_large_page (struct lp_desc *lp)
kfree(lp->alloced_map);
lp->alloced_map = NULL;
- free_pages((unsigned long) gart_to_virt(lp->paddr), I460_IO_PAGE_SHIFT - PAGE_SHIFT);
+ free_pages((unsigned long) phys_to_virt(lp->paddr), I460_IO_PAGE_SHIFT - PAGE_SHIFT);
atomic_sub(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp);
}
diff --git a/trunk/drivers/char/agp/intel-agp.c b/trunk/drivers/char/agp/intel-agp.c
index 51266d6b4d78..8c7d727432bb 100644
--- a/trunk/drivers/char/agp/intel-agp.c
+++ b/trunk/drivers/char/agp/intel-agp.c
@@ -286,7 +286,7 @@ static struct agp_memory *alloc_agpphysmem_i8xx(size_t pg_count, int type)
if (new == NULL)
return NULL;
- new->memory[0] = virt_to_gart(addr);
+ new->memory[0] = virt_to_phys(addr);
if (pg_count == 4) {
/* kludge to get 4 physical pages for ARGB cursor */
new->memory[1] = new->memory[0] + PAGE_SIZE;
@@ -329,10 +329,10 @@ static void intel_i810_free_by_type(struct agp_memory *curr)
agp_free_key(curr->key);
if(curr->type == AGP_PHYS_MEMORY) {
if (curr->page_count == 4)
- i8xx_destroy_pages(gart_to_virt(curr->memory[0]));
+ i8xx_destroy_pages(phys_to_virt(curr->memory[0]));
else
agp_bridge->driver->agp_destroy_page(
- gart_to_virt(curr->memory[0]));
+ phys_to_virt(curr->memory[0]));
vfree(curr->memory);
}
kfree(curr);
@@ -418,8 +418,7 @@ static void intel_i830_init_gtt_entries(void)
case I915_GMCH_GMS_STOLEN_48M:
/* Check it's really I915G */
if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB ||
- agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB ||
- agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB)
+ agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB)
gtt_entries = MB(48) - KB(size);
else
gtt_entries = 0;
@@ -427,8 +426,7 @@ static void intel_i830_init_gtt_entries(void)
case I915_GMCH_GMS_STOLEN_64M:
/* Check it's really I915G */
if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB ||
- agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB ||
- agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB)
+ agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB)
gtt_entries = MB(64) - KB(size);
else
gtt_entries = 0;
@@ -1664,14 +1662,6 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
}
name = "915GM";
break;
- case PCI_DEVICE_ID_INTEL_82945G_HB:
- if (find_i830(PCI_DEVICE_ID_INTEL_82945G_IG)) {
- bridge->driver = &intel_915_driver;
- } else {
- bridge->driver = &intel_845_driver;
- }
- name = "945G";
- break;
case PCI_DEVICE_ID_INTEL_7505_0:
bridge->driver = &intel_7505_driver;
name = "E7505";
@@ -1811,7 +1801,6 @@ static struct pci_device_id agp_intel_pci_table[] = {
ID(PCI_DEVICE_ID_INTEL_7205_0),
ID(PCI_DEVICE_ID_INTEL_82915G_HB),
ID(PCI_DEVICE_ID_INTEL_82915GM_HB),
- ID(PCI_DEVICE_ID_INTEL_82945G_HB),
{ }
};
diff --git a/trunk/drivers/char/agp/sgi-agp.c b/trunk/drivers/char/agp/sgi-agp.c
index d3aa159c9dec..4b3eda267976 100644
--- a/trunk/drivers/char/agp/sgi-agp.c
+++ b/trunk/drivers/char/agp/sgi-agp.c
@@ -133,14 +133,11 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
off_t j;
void *temp;
struct agp_bridge_data *bridge;
- u64 *table;
bridge = mem->bridge;
if (!bridge)
return -EINVAL;
- table = (u64 *)bridge->gatt_table;
-
temp = bridge->current_size;
switch (bridge->driver->size_type) {
@@ -178,7 +175,7 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
j = pg_start;
while (j < (pg_start + mem->page_count)) {
- if (table[j])
+ if (*(bridge->gatt_table + j))
return -EBUSY;
j++;
}
@@ -189,7 +186,7 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
}
for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
- table[j] =
+ *(bridge->gatt_table + j) =
bridge->driver->mask_memory(bridge, mem->memory[i],
mem->type);
}
@@ -203,7 +200,6 @@ static int sgi_tioca_remove_memory(struct agp_memory *mem, off_t pg_start,
{
size_t i;
struct agp_bridge_data *bridge;
- u64 *table;
bridge = mem->bridge;
if (!bridge)
@@ -213,10 +209,8 @@ static int sgi_tioca_remove_memory(struct agp_memory *mem, off_t pg_start,
return -EINVAL;
}
- table = (u64 *)bridge->gatt_table;
-
for (i = pg_start; i < (mem->page_count + pg_start); i++) {
- table[i] = 0;
+ *(bridge->gatt_table + i) = 0;
}
bridge->driver->tlb_flush(mem);
diff --git a/trunk/drivers/char/agp/sworks-agp.c b/trunk/drivers/char/agp/sworks-agp.c
index a9fb12c20eb7..10c23302dd84 100644
--- a/trunk/drivers/char/agp/sworks-agp.c
+++ b/trunk/drivers/char/agp/sworks-agp.c
@@ -51,7 +51,7 @@ static int serverworks_create_page_map(struct serverworks_page_map *page_map)
}
SetPageReserved(virt_to_page(page_map->real));
global_cache_flush();
- page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real),
+ page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
PAGE_SIZE);
if (page_map->remapped == NULL) {
ClearPageReserved(virt_to_page(page_map->real));
@@ -162,7 +162,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge)
/* Create a fake scratch directory */
for(i = 0; i < 1024; i++) {
writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i);
- writel(virt_to_gart(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i);
+ writel(virt_to_phys(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i);
}
retval = serverworks_create_gatt_pages(value->num_entries / 1024);
@@ -174,7 +174,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge)
agp_bridge->gatt_table_real = (u32 *)page_dir.real;
agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
- agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real);
+ agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real);
/* Get the address for the gart region.
* This is a bus address even on the alpha, b/c its
@@ -187,7 +187,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge)
/* Calculate the agp offset */
for(i = 0; i < value->num_entries / 1024; i++)
- writel(virt_to_gart(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i);
+ writel(virt_to_phys(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i);
return 0;
}
diff --git a/trunk/drivers/char/agp/uninorth-agp.c b/trunk/drivers/char/agp/uninorth-agp.c
index c8255312b8c1..a673971f2a90 100644
--- a/trunk/drivers/char/agp/uninorth-agp.c
+++ b/trunk/drivers/char/agp/uninorth-agp.c
@@ -407,7 +407,7 @@ static int uninorth_create_gatt_table(struct agp_bridge_data *bridge)
bridge->gatt_table_real = (u32 *) table;
bridge->gatt_table = (u32 *)table;
- bridge->gatt_bus_addr = virt_to_gart(table);
+ bridge->gatt_bus_addr = virt_to_phys(table);
for (i = 0; i < num_entries; i++)
bridge->gatt_table[i] = 0;
diff --git a/trunk/drivers/char/drm/drm_pciids.h b/trunk/drivers/char/drm/drm_pciids.h
index 11c6950158b3..54a2914e3a32 100644
--- a/trunk/drivers/char/drm/drm_pciids.h
+++ b/trunk/drivers/char/drm/drm_pciids.h
@@ -220,6 +220,5 @@
{0x8086, 0x2572, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0x8086, 0x2582, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0x8086, 0x2592, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
- {0x8086, 0x2772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0, 0, 0}
diff --git a/trunk/drivers/char/drm/radeon_irq.c b/trunk/drivers/char/drm/radeon_irq.c
index cd25f28e26a3..5b18bee6492e 100644
--- a/trunk/drivers/char/drm/radeon_irq.c
+++ b/trunk/drivers/char/drm/radeon_irq.c
@@ -123,6 +123,11 @@ static int radeon_wait_irq(drm_device_t *dev, int swi_nr)
dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE;
+ /* This is a hack to work around mysterious freezes on certain
+ * systems:
+ */
+ radeon_acknowledge_irqs( dev_priv );
+
DRM_WAIT_ON( ret, dev_priv->swi_queue, 3 * DRM_HZ,
RADEON_READ( RADEON_LAST_SWI_REG ) >= swi_nr );
diff --git a/trunk/drivers/char/mxser.c b/trunk/drivers/char/mxser.c
index f022f0944434..7a245068e3e5 100644
--- a/trunk/drivers/char/mxser.c
+++ b/trunk/drivers/char/mxser.c
@@ -1995,6 +1995,9 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status)
unsigned char ch, gdl;
int ignored = 0;
int cnt = 0;
+ unsigned char *cp;
+ char *fp;
+ int count;
int recv_room;
int max = 256;
unsigned long flags;
@@ -2008,6 +2011,10 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status)
//return;
}
+ cp = tty->flip.char_buf;
+ fp = tty->flip.flag_buf;
+ count = 0;
+
// following add by Victor Yu. 09-02-2002
if (info->IsMoxaMustChipFlag != MOXA_OTHER_UART) {
@@ -2034,10 +2041,12 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status)
}
while (gdl--) {
ch = inb(info->base + UART_RX);
- tty_insert_flip_char(tty, ch, 0);
+ count++;
+ *cp++ = ch;
+ *fp++ = 0;
cnt++;
/*
- if((cnt>=HI_WATER) && (info->stop_rx==0)){
+ if((count>=HI_WATER) && (info->stop_rx==0)){
mxser_stoprx(tty);
info->stop_rx=1;
break;
@@ -2052,7 +2061,7 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status)
if (max-- < 0)
break;
/*
- if((cnt>=HI_WATER) && (info->stop_rx==0)){
+ if((count>=HI_WATER) && (info->stop_rx==0)){
mxser_stoprx(tty);
info->stop_rx=1;
break;
@@ -2069,33 +2078,36 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status)
if (++ignored > 100)
break;
} else {
- char flag = 0;
+ count++;
if (*status & UART_LSR_SPECIAL) {
if (*status & UART_LSR_BI) {
- flag = TTY_BREAK;
+ *fp++ = TTY_BREAK;
/* added by casper 1/11/2000 */
info->icount.brk++;
+
/* */
if (info->flags & ASYNC_SAK)
do_SAK(tty);
} else if (*status & UART_LSR_PE) {
- flag = TTY_PARITY;
+ *fp++ = TTY_PARITY;
/* added by casper 1/11/2000 */
info->icount.parity++;
/* */
} else if (*status & UART_LSR_FE) {
- flag = TTY_FRAME;
+ *fp++ = TTY_FRAME;
/* added by casper 1/11/2000 */
info->icount.frame++;
/* */
} else if (*status & UART_LSR_OE) {
- flag = TTY_OVERRUN;
+ *fp++ = TTY_OVERRUN;
/* added by casper 1/11/2000 */
info->icount.overrun++;
/* */
- }
- }
- tty_insert_flip_char(tty, ch, flag);
+ } else
+ *fp++ = 0;
+ } else
+ *fp++ = 0;
+ *cp++ = ch;
cnt++;
if (cnt >= recv_room) {
if (!info->ldisc_stop_rx) {
@@ -2120,13 +2132,13 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status)
// above add by Victor Yu. 09-02-2002
} while (*status & UART_LSR_DR);
-end_intr: // add by Victor Yu. 09-02-2002
+ end_intr: // add by Victor Yu. 09-02-2002
mxvar_log.rxcnt[info->port] += cnt;
info->mon_data.rxcnt += cnt;
info->mon_data.up_rxcnt += cnt;
spin_unlock_irqrestore(&info->slock, flags);
-
+
tty_flip_buffer_push(tty);
}
diff --git a/trunk/drivers/cpufreq/Kconfig b/trunk/drivers/cpufreq/Kconfig
index 60c9be99c6d9..95882bb1950e 100644
--- a/trunk/drivers/cpufreq/Kconfig
+++ b/trunk/drivers/cpufreq/Kconfig
@@ -46,10 +46,6 @@ config CPU_FREQ_STAT_DETAILS
This will show detail CPU frequency translation table in sysfs file
system
-# Note that it is not currently possible to set the other governors (such as ondemand)
-# as the default, since if they fail to initialise, cpufreq will be
-# left in an undefined state.
-
choice
prompt "Default CPUFreq governor"
default CPU_FREQ_DEFAULT_GOV_USERSPACE if CPU_FREQ_SA1100 || CPU_FREQ_SA1110
@@ -119,24 +115,4 @@ config CPU_FREQ_GOV_ONDEMAND
If in doubt, say N.
-config CPU_FREQ_GOV_CONSERVATIVE
- tristate "'conservative' cpufreq governor"
- depends on CPU_FREQ
- help
- 'conservative' - this driver is rather similar to the 'ondemand'
- governor both in its source code and its purpose, the difference is
- its optimisation for better suitability in a battery powered
- environment. The frequency is gracefully increased and decreased
- rather than jumping to 100% when speed is required.
-
- If you have a desktop machine then you should really be considering
- the 'ondemand' governor instead, however if you are using a laptop,
- PDA or even an AMD64 based computer (due to the unacceptable
- step-by-step latency issues between the minimum and maximum frequency
- transitions in the CPU) you will probably want to use this governor.
-
- For details, take a look at linux/Documentation/cpu-freq.
-
- If in doubt, say N.
-
endif # CPU_FREQ
diff --git a/trunk/drivers/cpufreq/Makefile b/trunk/drivers/cpufreq/Makefile
index 71fc3b4173f1..67b16e5a41a7 100644
--- a/trunk/drivers/cpufreq/Makefile
+++ b/trunk/drivers/cpufreq/Makefile
@@ -8,7 +8,6 @@ obj-$(CONFIG_CPU_FREQ_GOV_PERFORMANCE) += cpufreq_performance.o
obj-$(CONFIG_CPU_FREQ_GOV_POWERSAVE) += cpufreq_powersave.o
obj-$(CONFIG_CPU_FREQ_GOV_USERSPACE) += cpufreq_userspace.o
obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND) += cpufreq_ondemand.o
-obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative.o
# CPUfreq cross-arch helpers
obj-$(CONFIG_CPU_FREQ_TABLE) += freq_table.o
diff --git a/trunk/drivers/cpufreq/cpufreq.c b/trunk/drivers/cpufreq/cpufreq.c
index 03b5fb2ddcf4..8e561313d094 100644
--- a/trunk/drivers/cpufreq/cpufreq.c
+++ b/trunk/drivers/cpufreq/cpufreq.c
@@ -258,7 +258,7 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
(likely(cpufreq_cpu_data[freqs->cpu]->cur)) &&
(unlikely(freqs->old != cpufreq_cpu_data[freqs->cpu]->cur)))
{
- dprintk(KERN_WARNING "Warning: CPU frequency is %u, "
+ printk(KERN_WARNING "Warning: CPU frequency is %u, "
"cpufreq assumed %u kHz.\n", freqs->old, cpufreq_cpu_data[freqs->cpu]->cur);
freqs->old = cpufreq_cpu_data[freqs->cpu]->cur;
}
@@ -814,7 +814,7 @@ static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, unsigne
{
struct cpufreq_freqs freqs;
- dprintk(KERN_WARNING "Warning: CPU frequency out of sync: cpufreq and timing "
+ printk(KERN_WARNING "Warning: CPU frequency out of sync: cpufreq and timing "
"core thinks of %u, is %u kHz.\n", old_freq, new_freq);
freqs.cpu = cpu;
@@ -923,7 +923,7 @@ static int cpufreq_suspend(struct sys_device * sysdev, u32 state)
struct cpufreq_freqs freqs;
if (!(cpufreq_driver->flags & CPUFREQ_PM_NO_WARN))
- dprintk(KERN_DEBUG "Warning: CPU frequency is %u, "
+ printk(KERN_DEBUG "Warning: CPU frequency is %u, "
"cpufreq assumed %u kHz.\n",
cur_freq, cpu_policy->cur);
@@ -1004,7 +1004,7 @@ static int cpufreq_resume(struct sys_device * sysdev)
struct cpufreq_freqs freqs;
if (!(cpufreq_driver->flags & CPUFREQ_PM_NO_WARN))
- dprintk(KERN_WARNING "Warning: CPU frequency"
+ printk(KERN_WARNING "Warning: CPU frequency"
"is %u, cpufreq assumed %u kHz.\n",
cur_freq, cpu_policy->cur);
diff --git a/trunk/drivers/cpufreq/cpufreq_conservative.c b/trunk/drivers/cpufreq/cpufreq_conservative.c
deleted file mode 100644
index e1df376e709e..000000000000
--- a/trunk/drivers/cpufreq/cpufreq_conservative.c
+++ /dev/null
@@ -1,586 +0,0 @@
-/*
- * drivers/cpufreq/cpufreq_conservative.c
- *
- * Copyright (C) 2001 Russell King
- * (C) 2003 Venkatesh Pallipadi .
- * Jun Nakajima
- * (C) 2004 Alexander Clouter
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/*
- * dbs is used in this file as a shortform for demandbased switching
- * It helps to keep variable names smaller, simpler
- */
-
-#define DEF_FREQUENCY_UP_THRESHOLD (80)
-#define MIN_FREQUENCY_UP_THRESHOLD (0)
-#define MAX_FREQUENCY_UP_THRESHOLD (100)
-
-#define DEF_FREQUENCY_DOWN_THRESHOLD (20)
-#define MIN_FREQUENCY_DOWN_THRESHOLD (0)
-#define MAX_FREQUENCY_DOWN_THRESHOLD (100)
-
-/*
- * The polling frequency of this governor depends on the capability of
- * the processor. Default polling frequency is 1000 times the transition
- * latency of the processor. The governor will work on any processor with
- * transition latency <= 10mS, using appropriate sampling
- * rate.
- * For CPUs with transition latency > 10mS (mostly drivers with CPUFREQ_ETERNAL)
- * this governor will not work.
- * All times here are in uS.
- */
-static unsigned int def_sampling_rate;
-#define MIN_SAMPLING_RATE (def_sampling_rate / 2)
-#define MAX_SAMPLING_RATE (500 * def_sampling_rate)
-#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (100000)
-#define DEF_SAMPLING_DOWN_FACTOR (5)
-#define TRANSITION_LATENCY_LIMIT (10 * 1000)
-
-static void do_dbs_timer(void *data);
-
-struct cpu_dbs_info_s {
- struct cpufreq_policy *cur_policy;
- unsigned int prev_cpu_idle_up;
- unsigned int prev_cpu_idle_down;
- unsigned int enable;
-};
-static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info);
-
-static unsigned int dbs_enable; /* number of CPUs using this policy */
-
-static DECLARE_MUTEX (dbs_sem);
-static DECLARE_WORK (dbs_work, do_dbs_timer, NULL);
-
-struct dbs_tuners {
- unsigned int sampling_rate;
- unsigned int sampling_down_factor;
- unsigned int up_threshold;
- unsigned int down_threshold;
- unsigned int ignore_nice;
- unsigned int freq_step;
-};
-
-static struct dbs_tuners dbs_tuners_ins = {
- .up_threshold = DEF_FREQUENCY_UP_THRESHOLD,
- .down_threshold = DEF_FREQUENCY_DOWN_THRESHOLD,
- .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR,
-};
-
-static inline unsigned int get_cpu_idle_time(unsigned int cpu)
-{
- return kstat_cpu(cpu).cpustat.idle +
- kstat_cpu(cpu).cpustat.iowait +
- ( !dbs_tuners_ins.ignore_nice ?
- kstat_cpu(cpu).cpustat.nice :
- 0);
-}
-
-/************************** sysfs interface ************************/
-static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)
-{
- return sprintf (buf, "%u\n", MAX_SAMPLING_RATE);
-}
-
-static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf)
-{
- return sprintf (buf, "%u\n", MIN_SAMPLING_RATE);
-}
-
-#define define_one_ro(_name) \
-static struct freq_attr _name = \
-__ATTR(_name, 0444, show_##_name, NULL)
-
-define_one_ro(sampling_rate_max);
-define_one_ro(sampling_rate_min);
-
-/* cpufreq_conservative Governor Tunables */
-#define show_one(file_name, object) \
-static ssize_t show_##file_name \
-(struct cpufreq_policy *unused, char *buf) \
-{ \
- return sprintf(buf, "%u\n", dbs_tuners_ins.object); \
-}
-show_one(sampling_rate, sampling_rate);
-show_one(sampling_down_factor, sampling_down_factor);
-show_one(up_threshold, up_threshold);
-show_one(down_threshold, down_threshold);
-show_one(ignore_nice, ignore_nice);
-show_one(freq_step, freq_step);
-
-static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused,
- const char *buf, size_t count)
-{
- unsigned int input;
- int ret;
- ret = sscanf (buf, "%u", &input);
- if (ret != 1 )
- return -EINVAL;
-
- down(&dbs_sem);
- dbs_tuners_ins.sampling_down_factor = input;
- up(&dbs_sem);
-
- return count;
-}
-
-static ssize_t store_sampling_rate(struct cpufreq_policy *unused,
- const char *buf, size_t count)
-{
- unsigned int input;
- int ret;
- ret = sscanf (buf, "%u", &input);
-
- down(&dbs_sem);
- if (ret != 1 || input > MAX_SAMPLING_RATE || input < MIN_SAMPLING_RATE) {
- up(&dbs_sem);
- return -EINVAL;
- }
-
- dbs_tuners_ins.sampling_rate = input;
- up(&dbs_sem);
-
- return count;
-}
-
-static ssize_t store_up_threshold(struct cpufreq_policy *unused,
- const char *buf, size_t count)
-{
- unsigned int input;
- int ret;
- ret = sscanf (buf, "%u", &input);
-
- down(&dbs_sem);
- if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD ||
- input < MIN_FREQUENCY_UP_THRESHOLD ||
- input <= dbs_tuners_ins.down_threshold) {
- up(&dbs_sem);
- return -EINVAL;
- }
-
- dbs_tuners_ins.up_threshold = input;
- up(&dbs_sem);
-
- return count;
-}
-
-static ssize_t store_down_threshold(struct cpufreq_policy *unused,
- const char *buf, size_t count)
-{
- unsigned int input;
- int ret;
- ret = sscanf (buf, "%u", &input);
-
- down(&dbs_sem);
- if (ret != 1 || input > MAX_FREQUENCY_DOWN_THRESHOLD ||
- input < MIN_FREQUENCY_DOWN_THRESHOLD ||
- input >= dbs_tuners_ins.up_threshold) {
- up(&dbs_sem);
- return -EINVAL;
- }
-
- dbs_tuners_ins.down_threshold = input;
- up(&dbs_sem);
-
- return count;
-}
-
-static ssize_t store_ignore_nice(struct cpufreq_policy *policy,
- const char *buf, size_t count)
-{
- unsigned int input;
- int ret;
-
- unsigned int j;
-
- ret = sscanf (buf, "%u", &input);
- if ( ret != 1 )
- return -EINVAL;
-
- if ( input > 1 )
- input = 1;
-
- down(&dbs_sem);
- if ( input == dbs_tuners_ins.ignore_nice ) { /* nothing to do */
- up(&dbs_sem);
- return count;
- }
- dbs_tuners_ins.ignore_nice = input;
-
- /* we need to re-evaluate prev_cpu_idle_up and prev_cpu_idle_down */
- for_each_online_cpu(j) {
- struct cpu_dbs_info_s *j_dbs_info;
- j_dbs_info = &per_cpu(cpu_dbs_info, j);
- j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j);
- j_dbs_info->prev_cpu_idle_down = j_dbs_info->prev_cpu_idle_up;
- }
- up(&dbs_sem);
-
- return count;
-}
-
-static ssize_t store_freq_step(struct cpufreq_policy *policy,
- const char *buf, size_t count)
-{
- unsigned int input;
- int ret;
-
- ret = sscanf (buf, "%u", &input);
-
- if ( ret != 1 )
- return -EINVAL;
-
- if ( input > 100 )
- input = 100;
-
- /* no need to test here if freq_step is zero as the user might actually
- * want this, they would be crazy though :) */
- down(&dbs_sem);
- dbs_tuners_ins.freq_step = input;
- up(&dbs_sem);
-
- return count;
-}
-
-#define define_one_rw(_name) \
-static struct freq_attr _name = \
-__ATTR(_name, 0644, show_##_name, store_##_name)
-
-define_one_rw(sampling_rate);
-define_one_rw(sampling_down_factor);
-define_one_rw(up_threshold);
-define_one_rw(down_threshold);
-define_one_rw(ignore_nice);
-define_one_rw(freq_step);
-
-static struct attribute * dbs_attributes[] = {
- &sampling_rate_max.attr,
- &sampling_rate_min.attr,
- &sampling_rate.attr,
- &sampling_down_factor.attr,
- &up_threshold.attr,
- &down_threshold.attr,
- &ignore_nice.attr,
- &freq_step.attr,
- NULL
-};
-
-static struct attribute_group dbs_attr_group = {
- .attrs = dbs_attributes,
- .name = "conservative",
-};
-
-/************************** sysfs end ************************/
-
-static void dbs_check_cpu(int cpu)
-{
- unsigned int idle_ticks, up_idle_ticks, down_idle_ticks;
- unsigned int freq_step;
- unsigned int freq_down_sampling_rate;
- static int down_skip[NR_CPUS];
- static int requested_freq[NR_CPUS];
- static unsigned short init_flag = 0;
- struct cpu_dbs_info_s *this_dbs_info;
- struct cpu_dbs_info_s *dbs_info;
-
- struct cpufreq_policy *policy;
- unsigned int j;
-
- this_dbs_info = &per_cpu(cpu_dbs_info, cpu);
- if (!this_dbs_info->enable)
- return;
-
- policy = this_dbs_info->cur_policy;
-
- if ( init_flag == 0 ) {
- for ( /* NULL */; init_flag < NR_CPUS; init_flag++ ) {
- dbs_info = &per_cpu(cpu_dbs_info, init_flag);
- requested_freq[cpu] = dbs_info->cur_policy->cur;
- }
- init_flag = 1;
- }
-
- /*
- * The default safe range is 20% to 80%
- * Every sampling_rate, we check
- * - If current idle time is less than 20%, then we try to
- * increase frequency
- * Every sampling_rate*sampling_down_factor, we check
- * - If current idle time is more than 80%, then we try to
- * decrease frequency
- *
- * Any frequency increase takes it to the maximum frequency.
- * Frequency reduction happens at minimum steps of
- * 5% (default) of max_frequency
- */
-
- /* Check for frequency increase */
-
- idle_ticks = UINT_MAX;
- for_each_cpu_mask(j, policy->cpus) {
- unsigned int tmp_idle_ticks, total_idle_ticks;
- struct cpu_dbs_info_s *j_dbs_info;
-
- j_dbs_info = &per_cpu(cpu_dbs_info, j);
- /* Check for frequency increase */
- total_idle_ticks = get_cpu_idle_time(j);
- tmp_idle_ticks = total_idle_ticks -
- j_dbs_info->prev_cpu_idle_up;
- j_dbs_info->prev_cpu_idle_up = total_idle_ticks;
-
- if (tmp_idle_ticks < idle_ticks)
- idle_ticks = tmp_idle_ticks;
- }
-
- /* Scale idle ticks by 100 and compare with up and down ticks */
- idle_ticks *= 100;
- up_idle_ticks = (100 - dbs_tuners_ins.up_threshold) *
- usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
-
- if (idle_ticks < up_idle_ticks) {
- down_skip[cpu] = 0;
- for_each_cpu_mask(j, policy->cpus) {
- struct cpu_dbs_info_s *j_dbs_info;
-
- j_dbs_info = &per_cpu(cpu_dbs_info, j);
- j_dbs_info->prev_cpu_idle_down =
- j_dbs_info->prev_cpu_idle_up;
- }
- /* if we are already at full speed then break out early */
- if (requested_freq[cpu] == policy->max)
- return;
-
- freq_step = (dbs_tuners_ins.freq_step * policy->max) / 100;
-
- /* max freq cannot be less than 100. But who knows.... */
- if (unlikely(freq_step == 0))
- freq_step = 5;
-
- requested_freq[cpu] += freq_step;
- if (requested_freq[cpu] > policy->max)
- requested_freq[cpu] = policy->max;
-
- __cpufreq_driver_target(policy, requested_freq[cpu],
- CPUFREQ_RELATION_H);
- return;
- }
-
- /* Check for frequency decrease */
- down_skip[cpu]++;
- if (down_skip[cpu] < dbs_tuners_ins.sampling_down_factor)
- return;
-
- idle_ticks = UINT_MAX;
- for_each_cpu_mask(j, policy->cpus) {
- unsigned int tmp_idle_ticks, total_idle_ticks;
- struct cpu_dbs_info_s *j_dbs_info;
-
- j_dbs_info = &per_cpu(cpu_dbs_info, j);
- total_idle_ticks = j_dbs_info->prev_cpu_idle_up;
- tmp_idle_ticks = total_idle_ticks -
- j_dbs_info->prev_cpu_idle_down;
- j_dbs_info->prev_cpu_idle_down = total_idle_ticks;
-
- if (tmp_idle_ticks < idle_ticks)
- idle_ticks = tmp_idle_ticks;
- }
-
- /* Scale idle ticks by 100 and compare with up and down ticks */
- idle_ticks *= 100;
- down_skip[cpu] = 0;
-
- freq_down_sampling_rate = dbs_tuners_ins.sampling_rate *
- dbs_tuners_ins.sampling_down_factor;
- down_idle_ticks = (100 - dbs_tuners_ins.down_threshold) *
- usecs_to_jiffies(freq_down_sampling_rate);
-
- if (idle_ticks > down_idle_ticks) {
- /* if we are already at the lowest speed then break out early
- * or if we 'cannot' reduce the speed as the user might want
- * freq_step to be zero */
- if (requested_freq[cpu] == policy->min
- || dbs_tuners_ins.freq_step == 0)
- return;
-
- freq_step = (dbs_tuners_ins.freq_step * policy->max) / 100;
-
- /* max freq cannot be less than 100. But who knows.... */
- if (unlikely(freq_step == 0))
- freq_step = 5;
-
- requested_freq[cpu] -= freq_step;
- if (requested_freq[cpu] < policy->min)
- requested_freq[cpu] = policy->min;
-
- __cpufreq_driver_target(policy,
- requested_freq[cpu],
- CPUFREQ_RELATION_H);
- return;
- }
-}
-
-static void do_dbs_timer(void *data)
-{
- int i;
- down(&dbs_sem);
- for_each_online_cpu(i)
- dbs_check_cpu(i);
- schedule_delayed_work(&dbs_work,
- usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
- up(&dbs_sem);
-}
-
-static inline void dbs_timer_init(void)
-{
- INIT_WORK(&dbs_work, do_dbs_timer, NULL);
- schedule_delayed_work(&dbs_work,
- usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
- return;
-}
-
-static inline void dbs_timer_exit(void)
-{
- cancel_delayed_work(&dbs_work);
- return;
-}
-
-static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
- unsigned int event)
-{
- unsigned int cpu = policy->cpu;
- struct cpu_dbs_info_s *this_dbs_info;
- unsigned int j;
-
- this_dbs_info = &per_cpu(cpu_dbs_info, cpu);
-
- switch (event) {
- case CPUFREQ_GOV_START:
- if ((!cpu_online(cpu)) ||
- (!policy->cur))
- return -EINVAL;
-
- if (policy->cpuinfo.transition_latency >
- (TRANSITION_LATENCY_LIMIT * 1000))
- return -EINVAL;
- if (this_dbs_info->enable) /* Already enabled */
- break;
-
- down(&dbs_sem);
- for_each_cpu_mask(j, policy->cpus) {
- struct cpu_dbs_info_s *j_dbs_info;
- j_dbs_info = &per_cpu(cpu_dbs_info, j);
- j_dbs_info->cur_policy = policy;
-
- j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j);
- j_dbs_info->prev_cpu_idle_down
- = j_dbs_info->prev_cpu_idle_up;
- }
- this_dbs_info->enable = 1;
- sysfs_create_group(&policy->kobj, &dbs_attr_group);
- dbs_enable++;
- /*
- * Start the timerschedule work, when this governor
- * is used for first time
- */
- if (dbs_enable == 1) {
- unsigned int latency;
- /* policy latency is in nS. Convert it to uS first */
-
- latency = policy->cpuinfo.transition_latency;
- if (latency < 1000)
- latency = 1000;
-
- def_sampling_rate = (latency / 1000) *
- DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;
- dbs_tuners_ins.sampling_rate = def_sampling_rate;
- dbs_tuners_ins.ignore_nice = 0;
- dbs_tuners_ins.freq_step = 5;
-
- dbs_timer_init();
- }
-
- up(&dbs_sem);
- break;
-
- case CPUFREQ_GOV_STOP:
- down(&dbs_sem);
- this_dbs_info->enable = 0;
- sysfs_remove_group(&policy->kobj, &dbs_attr_group);
- dbs_enable--;
- /*
- * Stop the timerschedule work, when this governor
- * is used for first time
- */
- if (dbs_enable == 0)
- dbs_timer_exit();
-
- up(&dbs_sem);
-
- break;
-
- case CPUFREQ_GOV_LIMITS:
- down(&dbs_sem);
- if (policy->max < this_dbs_info->cur_policy->cur)
- __cpufreq_driver_target(
- this_dbs_info->cur_policy,
- policy->max, CPUFREQ_RELATION_H);
- else if (policy->min > this_dbs_info->cur_policy->cur)
- __cpufreq_driver_target(
- this_dbs_info->cur_policy,
- policy->min, CPUFREQ_RELATION_L);
- up(&dbs_sem);
- break;
- }
- return 0;
-}
-
-static struct cpufreq_governor cpufreq_gov_dbs = {
- .name = "conservative",
- .governor = cpufreq_governor_dbs,
- .owner = THIS_MODULE,
-};
-
-static int __init cpufreq_gov_dbs_init(void)
-{
- return cpufreq_register_governor(&cpufreq_gov_dbs);
-}
-
-static void __exit cpufreq_gov_dbs_exit(void)
-{
- /* Make sure that the scheduled work is indeed not running */
- flush_scheduled_work();
-
- cpufreq_unregister_governor(&cpufreq_gov_dbs);
-}
-
-
-MODULE_AUTHOR ("Alexander Clouter ");
-MODULE_DESCRIPTION ("'cpufreq_conservative' - A dynamic cpufreq governor for "
- "Low Latency Frequency Transition capable processors "
- "optimised for use in a battery environment");
-MODULE_LICENSE ("GPL");
-
-module_init(cpufreq_gov_dbs_init);
-module_exit(cpufreq_gov_dbs_exit);
diff --git a/trunk/drivers/cpufreq/cpufreq_ondemand.c b/trunk/drivers/cpufreq/cpufreq_ondemand.c
index c1fc9c62bb51..8d83a21c6477 100644
--- a/trunk/drivers/cpufreq/cpufreq_ondemand.c
+++ b/trunk/drivers/cpufreq/cpufreq_ondemand.c
@@ -34,9 +34,13 @@
*/
#define DEF_FREQUENCY_UP_THRESHOLD (80)
-#define MIN_FREQUENCY_UP_THRESHOLD (11)
+#define MIN_FREQUENCY_UP_THRESHOLD (0)
#define MAX_FREQUENCY_UP_THRESHOLD (100)
+#define DEF_FREQUENCY_DOWN_THRESHOLD (20)
+#define MIN_FREQUENCY_DOWN_THRESHOLD (0)
+#define MAX_FREQUENCY_DOWN_THRESHOLD (100)
+
/*
* The polling frequency of this governor depends on the capability of
* the processor. Default polling frequency is 1000 times the transition
@@ -51,9 +55,9 @@ static unsigned int def_sampling_rate;
#define MIN_SAMPLING_RATE (def_sampling_rate / 2)
#define MAX_SAMPLING_RATE (500 * def_sampling_rate)
#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000)
-#define DEF_SAMPLING_DOWN_FACTOR (1)
-#define MAX_SAMPLING_DOWN_FACTOR (10)
+#define DEF_SAMPLING_DOWN_FACTOR (10)
#define TRANSITION_LATENCY_LIMIT (10 * 1000)
+#define sampling_rate_in_HZ(x) (((x * HZ) < (1000 * 1000))?1:((x * HZ) / (1000 * 1000)))
static void do_dbs_timer(void *data);
@@ -74,23 +78,15 @@ struct dbs_tuners {
unsigned int sampling_rate;
unsigned int sampling_down_factor;
unsigned int up_threshold;
- unsigned int ignore_nice;
+ unsigned int down_threshold;
};
static struct dbs_tuners dbs_tuners_ins = {
.up_threshold = DEF_FREQUENCY_UP_THRESHOLD,
+ .down_threshold = DEF_FREQUENCY_DOWN_THRESHOLD,
.sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR,
};
-static inline unsigned int get_cpu_idle_time(unsigned int cpu)
-{
- return kstat_cpu(cpu).cpustat.idle +
- kstat_cpu(cpu).cpustat.iowait +
- ( !dbs_tuners_ins.ignore_nice ?
- kstat_cpu(cpu).cpustat.nice :
- 0);
-}
-
/************************** sysfs interface ************************/
static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)
{
@@ -119,7 +115,7 @@ static ssize_t show_##file_name \
show_one(sampling_rate, sampling_rate);
show_one(sampling_down_factor, sampling_down_factor);
show_one(up_threshold, up_threshold);
-show_one(ignore_nice, ignore_nice);
+show_one(down_threshold, down_threshold);
static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused,
const char *buf, size_t count)
@@ -130,9 +126,6 @@ static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused,
if (ret != 1 )
return -EINVAL;
- if (input > MAX_SAMPLING_DOWN_FACTOR || input < 1)
- return -EINVAL;
-
down(&dbs_sem);
dbs_tuners_ins.sampling_down_factor = input;
up(&dbs_sem);
@@ -168,7 +161,8 @@ static ssize_t store_up_threshold(struct cpufreq_policy *unused,
down(&dbs_sem);
if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD ||
- input < MIN_FREQUENCY_UP_THRESHOLD) {
+ input < MIN_FREQUENCY_UP_THRESHOLD ||
+ input <= dbs_tuners_ins.down_threshold) {
up(&dbs_sem);
return -EINVAL;
}
@@ -179,35 +173,22 @@ static ssize_t store_up_threshold(struct cpufreq_policy *unused,
return count;
}
-static ssize_t store_ignore_nice(struct cpufreq_policy *policy,
+static ssize_t store_down_threshold(struct cpufreq_policy *unused,
const char *buf, size_t count)
{
unsigned int input;
int ret;
-
- unsigned int j;
-
ret = sscanf (buf, "%u", &input);
- if ( ret != 1 )
- return -EINVAL;
- if ( input > 1 )
- input = 1;
-
down(&dbs_sem);
- if ( input == dbs_tuners_ins.ignore_nice ) { /* nothing to do */
+ if (ret != 1 || input > MAX_FREQUENCY_DOWN_THRESHOLD ||
+ input < MIN_FREQUENCY_DOWN_THRESHOLD ||
+ input >= dbs_tuners_ins.up_threshold) {
up(&dbs_sem);
- return count;
+ return -EINVAL;
}
- dbs_tuners_ins.ignore_nice = input;
- /* we need to re-evaluate prev_cpu_idle_up and prev_cpu_idle_down */
- for_each_online_cpu(j) {
- struct cpu_dbs_info_s *j_dbs_info;
- j_dbs_info = &per_cpu(cpu_dbs_info, j);
- j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j);
- j_dbs_info->prev_cpu_idle_down = j_dbs_info->prev_cpu_idle_up;
- }
+ dbs_tuners_ins.down_threshold = input;
up(&dbs_sem);
return count;
@@ -220,7 +201,7 @@ __ATTR(_name, 0644, show_##_name, store_##_name)
define_one_rw(sampling_rate);
define_one_rw(sampling_down_factor);
define_one_rw(up_threshold);
-define_one_rw(ignore_nice);
+define_one_rw(down_threshold);
static struct attribute * dbs_attributes[] = {
&sampling_rate_max.attr,
@@ -228,7 +209,7 @@ static struct attribute * dbs_attributes[] = {
&sampling_rate.attr,
&sampling_down_factor.attr,
&up_threshold.attr,
- &ignore_nice.attr,
+ &down_threshold.attr,
NULL
};
@@ -241,8 +222,9 @@ static struct attribute_group dbs_attr_group = {
static void dbs_check_cpu(int cpu)
{
- unsigned int idle_ticks, up_idle_ticks, total_ticks;
- unsigned int freq_next;
+ unsigned int idle_ticks, up_idle_ticks, down_idle_ticks;
+ unsigned int total_idle_ticks;
+ unsigned int freq_down_step;
unsigned int freq_down_sampling_rate;
static int down_skip[NR_CPUS];
struct cpu_dbs_info_s *this_dbs_info;
@@ -256,25 +238,38 @@ static void dbs_check_cpu(int cpu)
policy = this_dbs_info->cur_policy;
/*
- * Every sampling_rate, we check, if current idle time is less
- * than 20% (default), then we try to increase frequency
- * Every sampling_rate*sampling_down_factor, we look for a the lowest
- * frequency which can sustain the load while keeping idle time over
- * 30%. If such a frequency exist, we try to decrease to this frequency.
+ * The default safe range is 20% to 80%
+ * Every sampling_rate, we check
+ * - If current idle time is less than 20%, then we try to
+ * increase frequency
+ * Every sampling_rate*sampling_down_factor, we check
+ * - If current idle time is more than 80%, then we try to
+ * decrease frequency
*
* Any frequency increase takes it to the maximum frequency.
* Frequency reduction happens at minimum steps of
- * 5% (default) of current frequency
+ * 5% of max_frequency
*/
/* Check for frequency increase */
- idle_ticks = UINT_MAX;
+ total_idle_ticks = kstat_cpu(cpu).cpustat.idle +
+ kstat_cpu(cpu).cpustat.iowait;
+ idle_ticks = total_idle_ticks -
+ this_dbs_info->prev_cpu_idle_up;
+ this_dbs_info->prev_cpu_idle_up = total_idle_ticks;
+
+
for_each_cpu_mask(j, policy->cpus) {
- unsigned int tmp_idle_ticks, total_idle_ticks;
+ unsigned int tmp_idle_ticks;
struct cpu_dbs_info_s *j_dbs_info;
+ if (j == cpu)
+ continue;
+
j_dbs_info = &per_cpu(cpu_dbs_info, j);
- total_idle_ticks = get_cpu_idle_time(j);
+ /* Check for frequency increase */
+ total_idle_ticks = kstat_cpu(j).cpustat.idle +
+ kstat_cpu(j).cpustat.iowait;
tmp_idle_ticks = total_idle_ticks -
j_dbs_info->prev_cpu_idle_up;
j_dbs_info->prev_cpu_idle_up = total_idle_ticks;
@@ -286,23 +281,13 @@ static void dbs_check_cpu(int cpu)
/* Scale idle ticks by 100 and compare with up and down ticks */
idle_ticks *= 100;
up_idle_ticks = (100 - dbs_tuners_ins.up_threshold) *
- usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
+ sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate);
if (idle_ticks < up_idle_ticks) {
- down_skip[cpu] = 0;
- for_each_cpu_mask(j, policy->cpus) {
- struct cpu_dbs_info_s *j_dbs_info;
-
- j_dbs_info = &per_cpu(cpu_dbs_info, j);
- j_dbs_info->prev_cpu_idle_down =
- j_dbs_info->prev_cpu_idle_up;
- }
- /* if we are already at full speed then break out early */
- if (policy->cur == policy->max)
- return;
-
__cpufreq_driver_target(policy, policy->max,
CPUFREQ_RELATION_H);
+ down_skip[cpu] = 0;
+ this_dbs_info->prev_cpu_idle_down = total_idle_ticks;
return;
}
@@ -311,14 +296,23 @@ static void dbs_check_cpu(int cpu)
if (down_skip[cpu] < dbs_tuners_ins.sampling_down_factor)
return;
- idle_ticks = UINT_MAX;
+ total_idle_ticks = kstat_cpu(cpu).cpustat.idle +
+ kstat_cpu(cpu).cpustat.iowait;
+ idle_ticks = total_idle_ticks -
+ this_dbs_info->prev_cpu_idle_down;
+ this_dbs_info->prev_cpu_idle_down = total_idle_ticks;
+
for_each_cpu_mask(j, policy->cpus) {
- unsigned int tmp_idle_ticks, total_idle_ticks;
+ unsigned int tmp_idle_ticks;
struct cpu_dbs_info_s *j_dbs_info;
+ if (j == cpu)
+ continue;
+
j_dbs_info = &per_cpu(cpu_dbs_info, j);
- /* Check for frequency decrease */
- total_idle_ticks = j_dbs_info->prev_cpu_idle_up;
+ /* Check for frequency increase */
+ total_idle_ticks = kstat_cpu(j).cpustat.idle +
+ kstat_cpu(j).cpustat.iowait;
tmp_idle_ticks = total_idle_ticks -
j_dbs_info->prev_cpu_idle_down;
j_dbs_info->prev_cpu_idle_down = total_idle_ticks;
@@ -327,37 +321,38 @@ static void dbs_check_cpu(int cpu)
idle_ticks = tmp_idle_ticks;
}
+ /* Scale idle ticks by 100 and compare with up and down ticks */
+ idle_ticks *= 100;
down_skip[cpu] = 0;
- /* if we cannot reduce the frequency anymore, break out early */
- if (policy->cur == policy->min)
- return;
- /* Compute how many ticks there are between two measurements */
freq_down_sampling_rate = dbs_tuners_ins.sampling_rate *
dbs_tuners_ins.sampling_down_factor;
- total_ticks = usecs_to_jiffies(freq_down_sampling_rate);
+ down_idle_ticks = (100 - dbs_tuners_ins.down_threshold) *
+ sampling_rate_in_HZ(freq_down_sampling_rate);
- /*
- * The optimal frequency is the frequency that is the lowest that
- * can support the current CPU usage without triggering the up
- * policy. To be safe, we focus 10 points under the threshold.
- */
- freq_next = ((total_ticks - idle_ticks) * 100) / total_ticks;
- freq_next = (freq_next * policy->cur) /
- (dbs_tuners_ins.up_threshold - 10);
+ if (idle_ticks > down_idle_ticks ) {
+ freq_down_step = (5 * policy->max) / 100;
+
+ /* max freq cannot be less than 100. But who knows.... */
+ if (unlikely(freq_down_step == 0))
+ freq_down_step = 5;
- if (freq_next <= ((policy->cur * 95) / 100))
- __cpufreq_driver_target(policy, freq_next, CPUFREQ_RELATION_L);
+ __cpufreq_driver_target(policy,
+ policy->cur - freq_down_step,
+ CPUFREQ_RELATION_H);
+ return;
+ }
}
static void do_dbs_timer(void *data)
{
int i;
down(&dbs_sem);
- for_each_online_cpu(i)
- dbs_check_cpu(i);
+ for (i = 0; i < NR_CPUS; i++)
+ if (cpu_online(i))
+ dbs_check_cpu(i);
schedule_delayed_work(&dbs_work,
- usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
+ sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate));
up(&dbs_sem);
}
@@ -365,7 +360,7 @@ static inline void dbs_timer_init(void)
{
INIT_WORK(&dbs_work, do_dbs_timer, NULL);
schedule_delayed_work(&dbs_work,
- usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
+ sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate));
return;
}
@@ -402,9 +397,12 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
j_dbs_info = &per_cpu(cpu_dbs_info, j);
j_dbs_info->cur_policy = policy;
- j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j);
- j_dbs_info->prev_cpu_idle_down
- = j_dbs_info->prev_cpu_idle_up;
+ j_dbs_info->prev_cpu_idle_up =
+ kstat_cpu(j).cpustat.idle +
+ kstat_cpu(j).cpustat.iowait;
+ j_dbs_info->prev_cpu_idle_down =
+ kstat_cpu(j).cpustat.idle +
+ kstat_cpu(j).cpustat.iowait;
}
this_dbs_info->enable = 1;
sysfs_create_group(&policy->kobj, &dbs_attr_group);
@@ -424,7 +422,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
def_sampling_rate = (latency / 1000) *
DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;
dbs_tuners_ins.sampling_rate = def_sampling_rate;
- dbs_tuners_ins.ignore_nice = 0;
dbs_timer_init();
}
@@ -464,11 +461,12 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
return 0;
}
-static struct cpufreq_governor cpufreq_gov_dbs = {
+struct cpufreq_governor cpufreq_gov_dbs = {
.name = "ondemand",
.governor = cpufreq_governor_dbs,
.owner = THIS_MODULE,
};
+EXPORT_SYMBOL(cpufreq_gov_dbs);
static int __init cpufreq_gov_dbs_init(void)
{
diff --git a/trunk/drivers/cpufreq/cpufreq_stats.c b/trunk/drivers/cpufreq/cpufreq_stats.c
index 741b6b191e6a..2084593937c6 100644
--- a/trunk/drivers/cpufreq/cpufreq_stats.c
+++ b/trunk/drivers/cpufreq/cpufreq_stats.c
@@ -19,7 +19,6 @@
#include
#include
#include
-#include
static spinlock_t cpufreq_stats_lock;
@@ -30,14 +29,20 @@ static struct freq_attr _attr_##_name = {\
.show = _show,\
};
+static unsigned long
+delta_time(unsigned long old, unsigned long new)
+{
+ return (old > new) ? (old - new): (new + ~old + 1);
+}
+
struct cpufreq_stats {
unsigned int cpu;
unsigned int total_trans;
- unsigned long long last_time;
+ unsigned long long last_time;
unsigned int max_state;
unsigned int state_num;
unsigned int last_index;
- cputime64_t *time_in_state;
+ unsigned long long *time_in_state;
unsigned int *freq_table;
#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
unsigned int *trans_table;
@@ -55,16 +60,12 @@ static int
cpufreq_stats_update (unsigned int cpu)
{
struct cpufreq_stats *stat;
- unsigned long long cur_time;
-
- cur_time = get_jiffies_64();
spin_lock(&cpufreq_stats_lock);
stat = cpufreq_stats_table[cpu];
if (stat->time_in_state)
- stat->time_in_state[stat->last_index] =
- cputime64_add(stat->time_in_state[stat->last_index],
- cputime_sub(cur_time, stat->last_time));
- stat->last_time = cur_time;
+ stat->time_in_state[stat->last_index] +=
+ delta_time(stat->last_time, jiffies);
+ stat->last_time = jiffies;
spin_unlock(&cpufreq_stats_lock);
return 0;
}
@@ -89,8 +90,8 @@ show_time_in_state(struct cpufreq_policy *policy, char *buf)
return 0;
cpufreq_stats_update(stat->cpu);
for (i = 0; i < stat->state_num; i++) {
- len += sprintf(buf + len, "%u %llu\n", stat->freq_table[i],
- (unsigned long long)cputime64_to_clock_t(stat->time_in_state[i]));
+ len += sprintf(buf + len, "%u %llu\n",
+ stat->freq_table[i], stat->time_in_state[i]);
}
return len;
}
@@ -106,30 +107,16 @@ show_trans_table(struct cpufreq_policy *policy, char *buf)
if(!stat)
return 0;
cpufreq_stats_update(stat->cpu);
- len += snprintf(buf + len, PAGE_SIZE - len, " From : To\n");
- len += snprintf(buf + len, PAGE_SIZE - len, " : ");
- for (i = 0; i < stat->state_num; i++) {
- if (len >= PAGE_SIZE)
- break;
- len += snprintf(buf + len, PAGE_SIZE - len, "%9u ",
- stat->freq_table[i]);
- }
- if (len >= PAGE_SIZE)
- return len;
-
- len += snprintf(buf + len, PAGE_SIZE - len, "\n");
-
for (i = 0; i < stat->state_num; i++) {
if (len >= PAGE_SIZE)
break;
-
- len += snprintf(buf + len, PAGE_SIZE - len, "%9u: ",
+ len += snprintf(buf + len, PAGE_SIZE - len, "%9u:\t",
stat->freq_table[i]);
for (j = 0; j < stat->state_num; j++) {
if (len >= PAGE_SIZE)
break;
- len += snprintf(buf + len, PAGE_SIZE - len, "%9u ",
+ len += snprintf(buf + len, PAGE_SIZE - len, "%u\t",
stat->trans_table[i*stat->max_state+j]);
}
len += snprintf(buf + len, PAGE_SIZE - len, "\n");
@@ -210,7 +197,7 @@ cpufreq_stats_create_table (struct cpufreq_policy *policy,
count++;
}
- alloc_size = count * sizeof(int) + count * sizeof(cputime64_t);
+ alloc_size = count * sizeof(int) + count * sizeof(long long);
#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
alloc_size += count * count * sizeof(int);
@@ -237,7 +224,7 @@ cpufreq_stats_create_table (struct cpufreq_policy *policy,
}
stat->state_num = j;
spin_lock(&cpufreq_stats_lock);
- stat->last_time = get_jiffies_64();
+ stat->last_time = jiffies;
stat->last_index = freq_table_get_index(stat, policy->cur);
spin_unlock(&cpufreq_stats_lock);
cpufreq_cpu_put(data);
diff --git a/trunk/drivers/firmware/pcdp.c b/trunk/drivers/firmware/pcdp.c
index df1b721154d2..6d5df6c2efa2 100644
--- a/trunk/drivers/firmware/pcdp.c
+++ b/trunk/drivers/firmware/pcdp.c
@@ -11,7 +11,6 @@
* published by the Free Software Foundation.
*/
-#include
#include
#include
#include
diff --git a/trunk/drivers/i2c/busses/i2c-ali1563.c b/trunk/drivers/i2c/busses/i2c-ali1563.c
index fdd881aee618..35710818fe47 100644
--- a/trunk/drivers/i2c/busses/i2c-ali1563.c
+++ b/trunk/drivers/i2c/busses/i2c-ali1563.c
@@ -2,7 +2,6 @@
* i2c-ali1563.c - i2c driver for the ALi 1563 Southbridge
*
* Copyright (C) 2004 Patrick Mochel
- * 2005 Rudolf Marek
*
* The 1563 southbridge is deceptively similar to the 1533, with a
* few notable exceptions. One of those happens to be the fact they
@@ -58,11 +57,10 @@
#define HST_CNTL2_BLOCK 0x05
-#define HST_CNTL2_SIZEMASK 0x38
static unsigned short ali1563_smba;
-static int ali1563_transaction(struct i2c_adapter * a, int size)
+static int ali1563_transaction(struct i2c_adapter * a)
{
u32 data;
int timeout;
@@ -75,7 +73,7 @@ static int ali1563_transaction(struct i2c_adapter * a, int size)
data = inb_p(SMB_HST_STS);
if (data & HST_STS_BAD) {
- dev_err(&a->dev, "ali1563: Trying to reset busy device\n");
+ dev_warn(&a->dev,"ali1563: Trying to reset busy device\n");
outb_p(data | HST_STS_BAD,SMB_HST_STS);
data = inb_p(SMB_HST_STS);
if (data & HST_STS_BAD)
@@ -96,31 +94,19 @@ static int ali1563_transaction(struct i2c_adapter * a, int size)
if (timeout && !(data & HST_STS_BAD))
return 0;
+ dev_warn(&a->dev, "SMBus Error: %s%s%s%s%s\n",
+ timeout ? "Timeout " : "",
+ data & HST_STS_FAIL ? "Transaction Failed " : "",
+ data & HST_STS_BUSERR ? "No response or Bus Collision " : "",
+ data & HST_STS_DEVERR ? "Device Error " : "",
+ !(data & HST_STS_DONE) ? "Transaction Never Finished " : "");
- if (!timeout) {
- dev_err(&a->dev, "Timeout - Trying to KILL transaction!\n");
+ if (!(data & HST_STS_DONE))
/* Issue 'kill' to host controller */
outb_p(HST_CNTL2_KILL,SMB_HST_CNTL2);
- data = inb_p(SMB_HST_STS);
- }
-
- /* device error - no response, ignore the autodetection case */
- if ((data & HST_STS_DEVERR) && (size != HST_CNTL2_QUICK)) {
- dev_err(&a->dev, "Device error!\n");
- }
-
- /* bus collision */
- if (data & HST_STS_BUSERR) {
- dev_err(&a->dev, "Bus collision!\n");
- /* Issue timeout, hoping it helps */
+ else
+ /* Issue timeout to reset all devices on bus */
outb_p(HST_CNTL1_TIMEOUT,SMB_HST_CNTL1);
- }
-
- if (data & HST_STS_FAIL) {
- dev_err(&a->dev, "Cleaning fail after KILL!\n");
- outb_p(0x0,SMB_HST_CNTL2);
- }
-
return -1;
}
@@ -163,7 +149,7 @@ static int ali1563_block_start(struct i2c_adapter * a)
if (timeout && !(data & HST_STS_BAD))
return 0;
- dev_err(&a->dev, "SMBus Error: %s%s%s%s%s\n",
+ dev_warn(&a->dev, "SMBus Error: %s%s%s%s%s\n",
timeout ? "Timeout " : "",
data & HST_STS_FAIL ? "Transaction Failed " : "",
data & HST_STS_BUSERR ? "No response or Bus Collision " : "",
@@ -256,15 +242,13 @@ static s32 ali1563_access(struct i2c_adapter * a, u16 addr,
}
outb_p(((addr & 0x7f) << 1) | (rw & 0x01), SMB_HST_ADD);
- outb_p((inb_p(SMB_HST_CNTL2) & ~HST_CNTL2_SIZEMASK) | (size << 3), SMB_HST_CNTL2);
+ outb_p(inb_p(SMB_HST_CNTL2) | (size << 3), SMB_HST_CNTL2);
/* Write the command register */
-
switch(size) {
case HST_CNTL2_BYTE:
if (rw== I2C_SMBUS_WRITE)
- /* Beware it uses DAT0 register and not CMD! */
- outb_p(cmd, SMB_HST_DAT0);
+ outb_p(cmd, SMB_HST_CMD);
break;
case HST_CNTL2_BYTE_DATA:
outb_p(cmd, SMB_HST_CMD);
@@ -284,7 +268,7 @@ static s32 ali1563_access(struct i2c_adapter * a, u16 addr,
goto Done;
}
- if ((error = ali1563_transaction(a, size)))
+ if ((error = ali1563_transaction(a)))
goto Done;
if ((rw == I2C_SMBUS_WRITE) || (size == HST_CNTL2_QUICK))
diff --git a/trunk/drivers/ide/pci/amd74xx.c b/trunk/drivers/ide/pci/amd74xx.c
index 4e0f13d1d060..47225e324356 100644
--- a/trunk/drivers/ide/pci/amd74xx.c
+++ b/trunk/drivers/ide/pci/amd74xx.c
@@ -72,7 +72,6 @@ static struct amd_ide_chip {
{ PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x50, AMD_UDMA_133 },
{ PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, 0x50, AMD_UDMA_133 },
{ PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, 0x50, AMD_UDMA_133 },
{ 0 }
};
@@ -488,7 +487,6 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
/* 12 */ DECLARE_NV_DEV("NFORCE3-250-SATA2"),
/* 13 */ DECLARE_NV_DEV("NFORCE-CK804"),
/* 14 */ DECLARE_NV_DEV("NFORCE-MCP04"),
- /* 15 */ DECLARE_NV_DEV("NFORCE-MCP51"),
};
static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
@@ -523,7 +521,6 @@ static struct pci_device_id amd74xx_pci_tbl[] = {
#endif
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13 },
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 },
- { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15 },
{ 0, },
};
MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
diff --git a/trunk/drivers/input/keyboard/atkbd.c b/trunk/drivers/input/keyboard/atkbd.c
index 48fdf1e517cf..af0446c6de82 100644
--- a/trunk/drivers/input/keyboard/atkbd.c
+++ b/trunk/drivers/input/keyboard/atkbd.c
@@ -54,7 +54,7 @@ static int atkbd_softraw = 1;
module_param_named(softraw, atkbd_softraw, bool, 0);
MODULE_PARM_DESC(softraw, "Use software generated rawmode");
-static int atkbd_scroll = 0;
+static int atkbd_scroll = 1;
module_param_named(scroll, atkbd_scroll, bool, 0);
MODULE_PARM_DESC(scroll, "Enable scroll-wheel on MS Office and similar keyboards");
diff --git a/trunk/drivers/macintosh/via-pmu.c b/trunk/drivers/macintosh/via-pmu.c
index b941ee220997..bb9f4044c74d 100644
--- a/trunk/drivers/macintosh/via-pmu.c
+++ b/trunk/drivers/macintosh/via-pmu.c
@@ -2593,9 +2593,6 @@ powerbook_sleep_Core99(void)
/* Restore VIA */
restore_via_state();
- /* tweak LPJ before cpufreq is there */
- loops_per_jiffy *= 2;
-
/* Restore video */
pmac_call_early_video_resume();
@@ -2616,9 +2613,6 @@ powerbook_sleep_Core99(void)
pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
pmu_wait_complete(&req);
- /* Restore LPJ, cpufreq will adjust the cpu frequency */
- loops_per_jiffy /= 2;
-
pmac_wakeup_devices();
return 0;
diff --git a/trunk/drivers/md/dm-mpath.c b/trunk/drivers/md/dm-mpath.c
index 0c1b8520ef86..1e97b3c12bd5 100644
--- a/trunk/drivers/md/dm-mpath.c
+++ b/trunk/drivers/md/dm-mpath.c
@@ -985,9 +985,6 @@ static int do_end_io(struct multipath *m, struct bio *bio,
if (!error)
return 0; /* I/O complete */
- if ((error == -EWOULDBLOCK) && bio_rw_ahead(bio))
- return error;
-
spin_lock(&m->lock);
if (!m->nr_valid_paths) {
if (!m->queue_if_no_path || m->suspended) {
diff --git a/trunk/drivers/net/hamradio/baycom_epp.c b/trunk/drivers/net/hamradio/baycom_epp.c
index a7f15d9f13e5..1c563f905a59 100644
--- a/trunk/drivers/net/hamradio/baycom_epp.c
+++ b/trunk/drivers/net/hamradio/baycom_epp.c
@@ -374,6 +374,29 @@ static inline void do_kiss_params(struct baycom_state *bc,
}
/* --------------------------------------------------------------------- */
+/*
+ * high performance HDLC encoder
+ * yes, it's ugly, but generates pretty good code
+ */
+
+#define ENCODEITERA(j) \
+({ \
+ if (!(notbitstream & (0x1f0 << j))) \
+ goto stuff##j; \
+ encodeend##j: ; \
+})
+
+#define ENCODEITERB(j) \
+({ \
+ stuff##j: \
+ bitstream &= ~(0x100 << j); \
+ bitbuf = (bitbuf & (((2 << j) << numbit) - 1)) | \
+ ((bitbuf & ~(((2 << j) << numbit) - 1)) << 1); \
+ numbit++; \
+ notbitstream = ~bitstream; \
+ goto encodeend##j; \
+})
+
static void encode_hdlc(struct baycom_state *bc)
{
@@ -382,7 +405,6 @@ static void encode_hdlc(struct baycom_state *bc)
int pkt_len;
unsigned bitstream, notbitstream, bitbuf, numbit, crc;
unsigned char crcarr[2];
- int j;
if (bc->hdlctx.bufcnt > 0)
return;
@@ -407,14 +429,24 @@ static void encode_hdlc(struct baycom_state *bc)
pkt_len--;
if (!pkt_len)
bp = crcarr;
- for (j = 0; j < 8; j++)
- if (unlikely(!(notbitstream & (0x1f0 << j)))) {
- bitstream &= ~(0x100 << j);
- bitbuf = (bitbuf & (((2 << j) << numbit) - 1)) |
- ((bitbuf & ~(((2 << j) << numbit) - 1)) << 1);
- numbit++;
- notbitstream = ~bitstream;
- }
+ ENCODEITERA(0);
+ ENCODEITERA(1);
+ ENCODEITERA(2);
+ ENCODEITERA(3);
+ ENCODEITERA(4);
+ ENCODEITERA(5);
+ ENCODEITERA(6);
+ ENCODEITERA(7);
+ goto enditer;
+ ENCODEITERB(0);
+ ENCODEITERB(1);
+ ENCODEITERB(2);
+ ENCODEITERB(3);
+ ENCODEITERB(4);
+ ENCODEITERB(5);
+ ENCODEITERB(6);
+ ENCODEITERB(7);
+ enditer:
numbit += 8;
while (numbit >= 8) {
*wp++ = bitbuf;
@@ -578,6 +610,37 @@ static void do_rxpacket(struct net_device *dev)
bc->stats.rx_packets++;
}
+#define DECODEITERA(j) \
+({ \
+ if (!(notbitstream & (0x0fc << j))) /* flag or abort */ \
+ goto flgabrt##j; \
+ if ((bitstream & (0x1f8 << j)) == (0xf8 << j)) /* stuffed bit */ \
+ goto stuff##j; \
+ enditer##j: ; \
+})
+
+#define DECODEITERB(j) \
+({ \
+ flgabrt##j: \
+ if (!(notbitstream & (0x1fc << j))) { /* abort received */ \
+ state = 0; \
+ goto enditer##j; \
+ } \
+ if ((bitstream & (0x1fe << j)) != (0x0fc << j)) /* flag received */ \
+ goto enditer##j; \
+ if (state) \
+ do_rxpacket(dev); \
+ bc->hdlcrx.bufcnt = 0; \
+ bc->hdlcrx.bufptr = bc->hdlcrx.buf; \
+ state = 1; \
+ numbits = 7-j; \
+ goto enditer##j; \
+ stuff##j: \
+ numbits--; \
+ bitbuf = (bitbuf & ((~0xff) << j)) | ((bitbuf & ~((~0xff) << j)) << 1); \
+ goto enditer##j; \
+})
+
static int receive(struct net_device *dev, int cnt)
{
struct baycom_state *bc = netdev_priv(dev);
@@ -586,7 +649,6 @@ static int receive(struct net_device *dev, int cnt)
unsigned char tmp[128];
unsigned char *cp;
int cnt2, ret = 0;
- int j;
numbits = bc->hdlcrx.numbits;
state = bc->hdlcrx.state;
@@ -607,32 +669,24 @@ static int receive(struct net_device *dev, int cnt)
bitbuf |= (*cp) << 8;
numbits += 8;
notbitstream = ~bitstream;
- for (j = 0; j < 8; j++) {
-
- /* flag or abort */
- if (unlikely(!(notbitstream & (0x0fc << j)))) {
-
- /* abort received */
- if (!(notbitstream & (0x1fc << j)))
- state = 0;
-
- /* not flag received */
- else if (!(bitstream & (0x1fe << j)) != (0x0fc << j)) {
- if (state)
- do_rxpacket(dev);
- bc->hdlcrx.bufcnt = 0;
- bc->hdlcrx.bufptr = bc->hdlcrx.buf;
- state = 1;
- numbits = 7-j;
- }
- }
-
- /* stuffed bit */
- else if (unlikely((bitstream & (0x1f8 << j)) == (0xf8 << j))) {
- numbits--;
- bitbuf = (bitbuf & ((~0xff) << j)) | ((bitbuf & ~((~0xff) << j)) << 1);
- }
- }
+ DECODEITERA(0);
+ DECODEITERA(1);
+ DECODEITERA(2);
+ DECODEITERA(3);
+ DECODEITERA(4);
+ DECODEITERA(5);
+ DECODEITERA(6);
+ DECODEITERA(7);
+ goto enddec;
+ DECODEITERB(0);
+ DECODEITERB(1);
+ DECODEITERB(2);
+ DECODEITERB(3);
+ DECODEITERB(4);
+ DECODEITERB(5);
+ DECODEITERB(6);
+ DECODEITERB(7);
+ enddec:
while (state && numbits >= 8) {
if (bc->hdlcrx.bufcnt >= TXBUFFER_SIZE) {
state = 0;
diff --git a/trunk/drivers/net/iseries_veth.c b/trunk/drivers/net/iseries_veth.c
index 55af32e9bf08..13ed8dc1e91d 100644
--- a/trunk/drivers/net/iseries_veth.c
+++ b/trunk/drivers/net/iseries_veth.c
@@ -802,14 +802,13 @@ static void veth_tx_timeout(struct net_device *dev)
spin_lock_irqsave(&port->pending_gate, flags);
- if (!port->pending_lpmask) {
- spin_unlock_irqrestore(&port->pending_gate, flags);
- return;
- }
-
printk(KERN_WARNING "%s: Tx timeout! Resetting lp connections: %08x\n",
dev->name, port->pending_lpmask);
+ /* If we've timed out the queue must be stopped, which should
+ * only ever happen when there is a pending packet. */
+ WARN_ON(! port->pending_lpmask);
+
for (i = 0; i < HVMAXARCHITECTEDLPS; i++) {
struct veth_lpar_connection *cnx = veth_cnx[i];
diff --git a/trunk/drivers/net/pcmcia/3c574_cs.c b/trunk/drivers/net/pcmcia/3c574_cs.c
index c6e8b25f9685..41e517114807 100644
--- a/trunk/drivers/net/pcmcia/3c574_cs.c
+++ b/trunk/drivers/net/pcmcia/3c574_cs.c
@@ -1274,9 +1274,6 @@ static int el3_close(struct net_device *dev)
spin_lock_irqsave(&lp->window_lock, flags);
update_stats(dev);
spin_unlock_irqrestore(&lp->window_lock, flags);
-
- /* force interrupts off */
- outw(SetIntrEnb | 0x0000, ioaddr + EL3_CMD);
}
link->open--;
diff --git a/trunk/drivers/net/r8169.c b/trunk/drivers/net/r8169.c
index b3768d844747..c59507f8a76b 100644
--- a/trunk/drivers/net/r8169.c
+++ b/trunk/drivers/net/r8169.c
@@ -1585,8 +1585,8 @@ rtl8169_hw_start(struct net_device *dev)
RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
RTL_W8(EarlyTxThres, EarlyTxThld);
- /* Low hurts. Let's disable the filtering. */
- RTL_W16(RxMaxSize, 16383);
+ /* For gigabit rtl8169, MTU + header + CRC + VLAN */
+ RTL_W16(RxMaxSize, tp->rx_buf_sz);
/* Set Rx Config register */
i = rtl8169_rx_config |
@@ -2127,11 +2127,6 @@ rtl8169_tx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
}
}
-static inline int rtl8169_fragmented_frame(u32 status)
-{
- return (status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag);
-}
-
static inline void rtl8169_rx_csum(struct sk_buff *skb, struct RxDesc *desc)
{
u32 opts1 = le32_to_cpu(desc->opts1);
@@ -2182,41 +2177,27 @@ rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
while (rx_left > 0) {
unsigned int entry = cur_rx % NUM_RX_DESC;
- struct RxDesc *desc = tp->RxDescArray + entry;
u32 status;
rmb();
- status = le32_to_cpu(desc->opts1);
+ status = le32_to_cpu(tp->RxDescArray[entry].opts1);
if (status & DescOwn)
break;
if (status & RxRES) {
- printk(KERN_INFO "%s: Rx ERROR. status = %08x\n",
- dev->name, status);
+ printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name);
tp->stats.rx_errors++;
if (status & (RxRWT | RxRUNT))
tp->stats.rx_length_errors++;
if (status & RxCRC)
tp->stats.rx_crc_errors++;
- rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
} else {
+ struct RxDesc *desc = tp->RxDescArray + entry;
struct sk_buff *skb = tp->Rx_skbuff[entry];
int pkt_size = (status & 0x00001FFF) - 4;
void (*pci_action)(struct pci_dev *, dma_addr_t,
size_t, int) = pci_dma_sync_single_for_device;
- /*
- * The driver does not support incoming fragmented
- * frames. They are seen as a symptom of over-mtu
- * sized frames.
- */
- if (unlikely(rtl8169_fragmented_frame(status))) {
- tp->stats.rx_dropped++;
- tp->stats.rx_length_errors++;
- rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
- goto move_on;
- }
-
rtl8169_rx_csum(skb, desc);
pci_dma_sync_single_for_cpu(tp->pci_dev,
@@ -2243,7 +2224,7 @@ rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
tp->stats.rx_bytes += pkt_size;
tp->stats.rx_packets++;
}
-move_on:
+
cur_rx++;
rx_left--;
}
diff --git a/trunk/drivers/net/shaper.c b/trunk/drivers/net/shaper.c
index 20edeb345792..e68cf5fb4920 100644
--- a/trunk/drivers/net/shaper.c
+++ b/trunk/drivers/net/shaper.c
@@ -100,8 +100,35 @@ static int sh_debug; /* Debug flag */
#define SHAPER_BANNER "CymruNet Traffic Shaper BETA 0.04 for Linux 2.1\n"
+/*
+ * Locking
+ */
+
+static int shaper_lock(struct shaper *sh)
+{
+ /*
+ * Lock in an interrupt must fail
+ */
+ while (test_and_set_bit(0, &sh->locked))
+ {
+ if (!in_interrupt())
+ sleep_on(&sh->wait_queue);
+ else
+ return 0;
+
+ }
+ return 1;
+}
+
static void shaper_kick(struct shaper *sh);
+static void shaper_unlock(struct shaper *sh)
+{
+ clear_bit(0, &sh->locked);
+ wake_up(&sh->wait_queue);
+ shaper_kick(sh);
+}
+
/*
* Compute clocks on a buffer
*/
@@ -130,15 +157,17 @@ static void shaper_setspeed(struct shaper *shaper, int bitspersec)
* Throw a frame at a shaper.
*/
-
-static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static int shaper_qframe(struct shaper *shaper, struct sk_buff *skb)
{
- struct shaper *shaper = dev->priv;
struct sk_buff *ptr;
- if (down_trylock(&shaper->sem))
- return -1;
-
+ /*
+ * Get ready to work on this shaper. Lock may fail if its
+ * an interrupt and locked.
+ */
+
+ if(!shaper_lock(shaper))
+ return -1;
ptr=shaper->sendq.prev;
/*
@@ -231,8 +260,7 @@ static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev)
dev_kfree_skb(ptr);
shaper->stats.collisions++;
}
- shaper_kick(shaper);
- up(&shaper->sem);
+ shaper_unlock(shaper);
return 0;
}
@@ -269,13 +297,8 @@ static void shaper_queue_xmit(struct shaper *shaper, struct sk_buff *skb)
static void shaper_timer(unsigned long data)
{
- struct shaper *shaper = (struct shaper *)data;
-
- if (!down_trylock(&shaper->sem)) {
- shaper_kick(shaper);
- up(&shaper->sem);
- } else
- mod_timer(&shaper->timer, jiffies);
+ struct shaper *sh=(struct shaper *)data;
+ shaper_kick(sh);
}
/*
@@ -287,6 +310,19 @@ static void shaper_kick(struct shaper *shaper)
{
struct sk_buff *skb;
+ /*
+ * Shaper unlock will kick
+ */
+
+ if (test_and_set_bit(0, &shaper->locked))
+ {
+ if(sh_debug)
+ printk("Shaper locked.\n");
+ mod_timer(&shaper->timer, jiffies);
+ return;
+ }
+
+
/*
* Walk the list (may be empty)
*/
@@ -328,6 +364,8 @@ static void shaper_kick(struct shaper *shaper)
if(skb!=NULL)
mod_timer(&shaper->timer, SHAPERCB(skb)->shapeclock);
+
+ clear_bit(0, &shaper->locked);
}
@@ -338,12 +376,14 @@ static void shaper_kick(struct shaper *shaper)
static void shaper_flush(struct shaper *shaper)
{
struct sk_buff *skb;
-
- down(&shaper->sem);
+ if(!shaper_lock(shaper))
+ {
+ printk(KERN_ERR "shaper: shaper_flush() called by an irq!\n");
+ return;
+ }
while((skb=skb_dequeue(&shaper->sendq))!=NULL)
dev_kfree_skb(skb);
- shaper_kick(shaper);
- up(&shaper->sem);
+ shaper_unlock(shaper);
}
/*
@@ -386,6 +426,13 @@ static int shaper_close(struct net_device *dev)
* ARP and other resolutions and not before.
*/
+
+static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ struct shaper *sh=dev->priv;
+ return shaper_qframe(sh, skb);
+}
+
static struct net_device_stats *shaper_get_stats(struct net_device *dev)
{
struct shaper *sh=dev->priv;
@@ -576,6 +623,7 @@ static void shaper_init_priv(struct net_device *dev)
init_timer(&sh->timer);
sh->timer.function=shaper_timer;
sh->timer.data=(unsigned long)sh;
+ init_waitqueue_head(&sh->wait_queue);
}
/*
diff --git a/trunk/drivers/net/tg3.c b/trunk/drivers/net/tg3.c
index a0b8848049c9..fc9b5cd957aa 100644
--- a/trunk/drivers/net/tg3.c
+++ b/trunk/drivers/net/tg3.c
@@ -7,12 +7,7 @@
* Copyright (C) 2005 Broadcom Corporation.
*
* Firmware is:
- * Derived from proprietary unpublished source code,
- * Copyright (C) 2000-2003 Broadcom Corporation.
- *
- * Permission is hereby granted for the distribution of this firmware
- * data in hexadecimal or equivalent format, provided this copyright
- * notice is accompanying it.
+ * Copyright (C) 2000-2003 Broadcom Corporation.
*/
#include
@@ -66,8 +61,8 @@
#define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": "
-#define DRV_MODULE_VERSION "3.31"
-#define DRV_MODULE_RELDATE "June 8, 2005"
+#define DRV_MODULE_VERSION "3.29"
+#define DRV_MODULE_RELDATE "May 23, 2005"
#define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0
@@ -8560,16 +8555,6 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
case NIC_SRAM_DATA_CFG_LED_MODE_MAC:
tp->led_ctrl = LED_CTRL_MODE_MAC;
-
- /* Default to PHY_1_MODE if 0 (MAC_MODE) is
- * read on some older 5700/5701 bootcode.
- */
- if (GET_ASIC_REV(tp->pci_chip_rev_id) ==
- ASIC_REV_5700 ||
- GET_ASIC_REV(tp->pci_chip_rev_id) ==
- ASIC_REV_5701)
- tp->led_ctrl = LED_CTRL_MODE_PHY_1;
-
break;
case SHASTA_EXT_LED_SHARED:
@@ -9695,24 +9680,10 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
}
if ((tp->dma_rwctrl & DMA_RWCTRL_WRITE_BNDRY_MASK) !=
DMA_RWCTRL_WRITE_BNDRY_16) {
- static struct pci_device_id dma_wait_state_chipsets[] = {
- { PCI_DEVICE(PCI_VENDOR_ID_APPLE,
- PCI_DEVICE_ID_APPLE_UNI_N_PCI15) },
- { },
- };
-
/* DMA test passed without adjusting DMA boundary,
- * now look for chipsets that are known to expose the
- * DMA bug without failing the test.
+ * just restore the calculated DMA boundary
*/
- if (pci_dev_present(dma_wait_state_chipsets)) {
- tp->dma_rwctrl &= ~DMA_RWCTRL_WRITE_BNDRY_MASK;
- tp->dma_rwctrl |= DMA_RWCTRL_WRITE_BNDRY_16;
- }
- else
- /* Safe to use the calculated DMA boundary. */
- tp->dma_rwctrl = saved_dma_rwctrl;
-
+ tp->dma_rwctrl = saved_dma_rwctrl;
tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl);
}
diff --git a/trunk/drivers/pci/hotplug/cpci_hotplug_core.c b/trunk/drivers/pci/hotplug/cpci_hotplug_core.c
index 30af105271a2..9e9dab7fe86a 100644
--- a/trunk/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/trunk/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -1,7 +1,7 @@
/*
* CompactPCI Hot Plug Driver
*
- * Copyright (C) 2002,2005 SOMA Networks, Inc.
+ * Copyright (C) 2002 SOMA Networks, Inc.
* Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (C) 2001 IBM Corp.
*
@@ -45,10 +45,10 @@
#define dbg(format, arg...) \
do { \
- if (cpci_debug) \
+ if(cpci_debug) \
printk (KERN_DEBUG "%s: " format "\n", \
MY_NAME , ## arg); \
- } while (0)
+ } while(0)
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
@@ -111,8 +111,10 @@ enable_slot(struct hotplug_slot *hotplug_slot)
dbg("%s - physical_slot = %s", __FUNCTION__, hotplug_slot->name);
- if (controller->ops->set_power)
+ if(controller->ops->set_power) {
retval = controller->ops->set_power(slot, 1);
+ }
+
return retval;
}
@@ -124,41 +126,37 @@ disable_slot(struct hotplug_slot *hotplug_slot)
dbg("%s - physical_slot = %s", __FUNCTION__, hotplug_slot->name);
- down_write(&list_rwsem);
-
/* Unconfigure device */
dbg("%s - unconfiguring slot %s",
__FUNCTION__, slot->hotplug_slot->name);
- if ((retval = cpci_unconfigure_slot(slot))) {
+ if((retval = cpci_unconfigure_slot(slot))) {
err("%s - could not unconfigure slot %s",
__FUNCTION__, slot->hotplug_slot->name);
- goto disable_error;
+ return retval;
}
dbg("%s - finished unconfiguring slot %s",
__FUNCTION__, slot->hotplug_slot->name);
/* Clear EXT (by setting it) */
- if (cpci_clear_ext(slot)) {
+ if(cpci_clear_ext(slot)) {
err("%s - could not clear EXT for slot %s",
__FUNCTION__, slot->hotplug_slot->name);
retval = -ENODEV;
- goto disable_error;
}
cpci_led_on(slot);
- if (controller->ops->set_power)
- if ((retval = controller->ops->set_power(slot, 0)))
- goto disable_error;
+ if(controller->ops->set_power) {
+ retval = controller->ops->set_power(slot, 0);
+ }
- if (update_adapter_status(slot->hotplug_slot, 0))
+ if(update_adapter_status(slot->hotplug_slot, 0)) {
warn("failure to update adapter file");
+ }
- if (slot->extracting) {
+ if(slot->extracting) {
slot->extracting = 0;
atomic_dec(&extracting);
}
-disable_error:
- up_write(&list_rwsem);
return retval;
}
@@ -167,8 +165,9 @@ cpci_get_power_status(struct slot *slot)
{
u8 power = 1;
- if (controller->ops->get_power)
+ if(controller->ops->get_power) {
power = controller->ops->get_power(slot);
+ }
return power;
}
@@ -217,8 +216,6 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
kfree(slot->hotplug_slot->info);
kfree(slot->hotplug_slot->name);
kfree(slot->hotplug_slot);
- if (slot->dev)
- pci_dev_put(slot->dev);
kfree(slot);
}
@@ -240,8 +237,9 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last)
int status = -ENOMEM;
int i;
- if (!(controller && bus))
+ if(!(controller && bus)) {
return -ENODEV;
+ }
/*
* Create a structure for each slot, and register that slot
@@ -318,30 +316,32 @@ int
cpci_hp_unregister_bus(struct pci_bus *bus)
{
struct slot *slot;
- struct slot *tmp;
- int status = 0;
+ struct list_head *tmp;
+ struct list_head *next;
+ int status;
down_write(&list_rwsem);
- if (!slots) {
+ if(!slots) {
up_write(&list_rwsem);
return -1;
}
- list_for_each_entry_safe(slot, tmp, &slot_list, slot_list) {
- if (slot->bus == bus) {
- list_del(&slot->slot_list);
- slots--;
-
+ list_for_each_safe(tmp, next, &slot_list) {
+ slot = list_entry(tmp, struct slot, slot_list);
+ if(slot->bus == bus) {
dbg("deregistering slot %s", slot->hotplug_slot->name);
status = pci_hp_deregister(slot->hotplug_slot);
- if (status) {
+ if(status) {
err("pci_hp_deregister failed with error %d",
status);
- break;
+ return status;
}
+
+ list_del(&slot->slot_list);
+ slots--;
}
}
up_write(&list_rwsem);
- return status;
+ return 0;
}
/* This is the interrupt mode interrupt handler */
@@ -351,7 +351,7 @@ cpci_hp_intr(int irq, void *data, struct pt_regs *regs)
dbg("entered cpci_hp_intr");
/* Check to see if it was our interrupt */
- if ((controller->irq_flags & SA_SHIRQ) &&
+ if((controller->irq_flags & SA_SHIRQ) &&
!controller->ops->check_irq(controller->dev_id)) {
dbg("exited cpci_hp_intr, not our interrupt");
return IRQ_NONE;
@@ -373,30 +373,38 @@ cpci_hp_intr(int irq, void *data, struct pt_regs *regs)
* INS bits of the cold-inserted devices.
*/
static int
-init_slots(int clear_ins)
+init_slots(void)
{
struct slot *slot;
+ struct list_head *tmp;
struct pci_dev* dev;
dbg("%s - enter", __FUNCTION__);
down_read(&list_rwsem);
- if (!slots) {
+ if(!slots) {
up_read(&list_rwsem);
return -1;
}
- list_for_each_entry(slot, &slot_list, slot_list) {
+ list_for_each(tmp, &slot_list) {
+ slot = list_entry(tmp, struct slot, slot_list);
dbg("%s - looking at slot %s",
__FUNCTION__, slot->hotplug_slot->name);
- if (clear_ins && cpci_check_and_clear_ins(slot))
+ if(cpci_check_and_clear_ins(slot)) {
dbg("%s - cleared INS for slot %s",
__FUNCTION__, slot->hotplug_slot->name);
- dev = pci_get_slot(slot->bus, PCI_DEVFN(slot->number, 0));
- if (dev) {
- if (update_adapter_status(slot->hotplug_slot, 1))
- warn("failure to update adapter file");
- if (update_latch_status(slot->hotplug_slot, 1))
- warn("failure to update latch file");
- slot->dev = dev;
+ dev = pci_find_slot(slot->bus->number, PCI_DEVFN(slot->number, 0));
+ if(dev) {
+ if(update_adapter_status(slot->hotplug_slot, 1)) {
+ warn("failure to update adapter file");
+ }
+ if(update_latch_status(slot->hotplug_slot, 1)) {
+ warn("failure to update latch file");
+ }
+ slot->dev = dev;
+ } else {
+ err("%s - no driver attached to device in slot %s",
+ __FUNCTION__, slot->hotplug_slot->name);
+ }
}
}
up_read(&list_rwsem);
@@ -408,28 +416,26 @@ static int
check_slots(void)
{
struct slot *slot;
+ struct list_head *tmp;
int extracted;
int inserted;
u16 hs_csr;
down_read(&list_rwsem);
- if (!slots) {
+ if(!slots) {
up_read(&list_rwsem);
err("no slots registered, shutting down");
return -1;
}
extracted = inserted = 0;
- list_for_each_entry(slot, &slot_list, slot_list) {
+ list_for_each(tmp, &slot_list) {
+ slot = list_entry(tmp, struct slot, slot_list);
dbg("%s - looking at slot %s",
__FUNCTION__, slot->hotplug_slot->name);
- if (cpci_check_and_clear_ins(slot)) {
- /*
- * Some broken hardware (e.g. PLX 9054AB) asserts
- * ENUM# twice...
- */
- if (slot->dev) {
- warn("slot %s already inserted",
- slot->hotplug_slot->name);
+ if(cpci_check_and_clear_ins(slot)) {
+ /* Some broken hardware (e.g. PLX 9054AB) asserts ENUM# twice... */
+ if(slot->dev) {
+ warn("slot %s already inserted", slot->hotplug_slot->name);
inserted++;
continue;
}
@@ -446,7 +452,7 @@ check_slots(void)
/* Configure device */
dbg("%s - configuring slot %s",
__FUNCTION__, slot->hotplug_slot->name);
- if (cpci_configure_slot(slot)) {
+ if(cpci_configure_slot(slot)) {
err("%s - could not configure slot %s",
__FUNCTION__, slot->hotplug_slot->name);
continue;
@@ -459,11 +465,13 @@ check_slots(void)
dbg("%s - slot %s HS_CSR (2) = %04x",
__FUNCTION__, slot->hotplug_slot->name, hs_csr);
- if (update_latch_status(slot->hotplug_slot, 1))
+ if(update_latch_status(slot->hotplug_slot, 1)) {
warn("failure to update latch file");
+ }
- if (update_adapter_status(slot->hotplug_slot, 1))
+ if(update_adapter_status(slot->hotplug_slot, 1)) {
warn("failure to update adapter file");
+ }
cpci_led_off(slot);
@@ -473,7 +481,7 @@ check_slots(void)
__FUNCTION__, slot->hotplug_slot->name, hs_csr);
inserted++;
- } else if (cpci_check_ext(slot)) {
+ } else if(cpci_check_ext(slot)) {
/* Process extraction request */
dbg("%s - slot %s extracted",
__FUNCTION__, slot->hotplug_slot->name);
@@ -483,25 +491,27 @@ check_slots(void)
dbg("%s - slot %s HS_CSR = %04x",
__FUNCTION__, slot->hotplug_slot->name, hs_csr);
- if (!slot->extracting) {
- if (update_latch_status(slot->hotplug_slot, 0)) {
+ if(!slot->extracting) {
+ if(update_latch_status(slot->hotplug_slot, 0)) {
warn("failure to update latch file");
+
}
- slot->extracting = 1;
atomic_inc(&extracting);
+ slot->extracting = 1;
}
extracted++;
- } else if (slot->extracting) {
+ } else if(slot->extracting) {
hs_csr = cpci_get_hs_csr(slot);
- if (hs_csr == 0xffff) {
+ if(hs_csr == 0xffff) {
/*
* Hmmm, we're likely hosed at this point, should we
* bother trying to tell the driver or not?
*/
err("card in slot %s was improperly removed",
slot->hotplug_slot->name);
- if (update_adapter_status(slot->hotplug_slot, 0))
+ if(update_adapter_status(slot->hotplug_slot, 0)) {
warn("failure to update adapter file");
+ }
slot->extracting = 0;
atomic_dec(&extracting);
}
@@ -510,9 +520,10 @@ check_slots(void)
up_read(&list_rwsem);
dbg("inserted=%d, extracted=%d, extracting=%d",
inserted, extracted, atomic_read(&extracting));
- if (inserted || extracted)
+ if(inserted || extracted) {
return extracted;
- else if (!atomic_read(&extracting)) {
+ }
+ else if(!atomic_read(&extracting)) {
err("cannot find ENUM# source, shutting down");
return -1;
}
@@ -530,12 +541,12 @@ event_thread(void *data)
unlock_kernel();
dbg("%s - event thread started", __FUNCTION__);
- while (1) {
+ while(1) {
dbg("event thread sleeping");
down_interruptible(&event_semaphore);
dbg("event thread woken, thread_finished = %d",
thread_finished);
- if (thread_finished || signal_pending(current))
+ if(thread_finished || signal_pending(current))
break;
do {
rc = check_slots();
@@ -547,9 +558,7 @@ event_thread(void *data)
thread_finished = 1;
break;
}
- } while (atomic_read(&extracting) && !thread_finished);
- if (thread_finished)
- break;
+ } while(atomic_read(&extracting) != 0);
/* Re-enable ENUM# interrupt */
dbg("%s - re-enabling irq", __FUNCTION__);
@@ -570,21 +579,21 @@ poll_thread(void *data)
daemonize("cpci_hp_polld");
unlock_kernel();
- while (1) {
- if (thread_finished || signal_pending(current))
+ while(1) {
+ if(thread_finished || signal_pending(current))
break;
- if (controller->ops->query_enum()) {
+ if(controller->ops->query_enum()) {
do {
rc = check_slots();
- if (rc > 0) {
+ if(rc > 0) {
/* Give userspace a chance to handle extraction */
msleep(500);
- } else if (rc < 0) {
+ } else if(rc < 0) {
dbg("%s - error checking slots", __FUNCTION__);
thread_finished = 1;
break;
}
- } while (atomic_read(&extracting) && !thread_finished);
+ } while(atomic_read(&extracting) != 0);
}
msleep(100);
}
@@ -603,11 +612,12 @@ cpci_start_thread(void)
init_MUTEX_LOCKED(&thread_exit);
thread_finished = 0;
- if (controller->irq)
+ if(controller->irq) {
pid = kernel_thread(event_thread, NULL, 0);
- else
+ } else {
pid = kernel_thread(poll_thread, NULL, 0);
- if (pid < 0) {
+ }
+ if(pid < 0) {
err("Can't start up our thread");
return -1;
}
@@ -620,8 +630,9 @@ cpci_stop_thread(void)
{
thread_finished = 1;
dbg("thread finish command given");
- if (controller->irq)
+ if(controller->irq) {
up(&event_semaphore);
+ }
dbg("wait for thread to exit");
down(&thread_exit);
}
@@ -631,67 +642,45 @@ cpci_hp_register_controller(struct cpci_hp_controller *new_controller)
{
int status = 0;
- if (controller)
- return -1;
- if (!(new_controller && new_controller->ops))
- return -EINVAL;
- if (new_controller->irq) {
- if (!(new_controller->ops->enable_irq &&
- new_controller->ops->disable_irq))
- status = -EINVAL;
- if (request_irq(new_controller->irq,
- cpci_hp_intr,
- new_controller->irq_flags,
- MY_NAME,
- new_controller->dev_id)) {
- err("Can't get irq %d for the hotplug cPCI controller",
- new_controller->irq);
- status = -ENODEV;
+ if(!controller) {
+ controller = new_controller;
+ if(controller->irq) {
+ if(request_irq(controller->irq,
+ cpci_hp_intr,
+ controller->irq_flags,
+ MY_NAME, controller->dev_id)) {
+ err("Can't get irq %d for the hotplug cPCI controller", controller->irq);
+ status = -ENODEV;
+ }
+ dbg("%s - acquired controller irq %d", __FUNCTION__,
+ controller->irq);
}
- dbg("%s - acquired controller irq %d",
- __FUNCTION__, new_controller->irq);
+ } else {
+ err("cPCI hotplug controller already registered");
+ status = -1;
}
- if (!status)
- controller = new_controller;
return status;
}
-static void
-cleanup_slots(void)
-{
- struct slot *slot;
- struct slot *tmp;
-
- /*
- * Unregister all of our slots with the pci_hotplug subsystem,
- * and free up all memory that we had allocated.
- */
- down_write(&list_rwsem);
- if (!slots)
- goto cleanup_null;
- list_for_each_entry_safe(slot, tmp, &slot_list, slot_list) {
- list_del(&slot->slot_list);
- pci_hp_deregister(slot->hotplug_slot);
- }
-cleanup_null:
- up_write(&list_rwsem);
- return;
-}
-
int
cpci_hp_unregister_controller(struct cpci_hp_controller *old_controller)
{
int status = 0;
- if (controller) {
- if (!thread_finished)
+ if(controller) {
+ if(atomic_read(&extracting) != 0) {
+ return -EBUSY;
+ }
+ if(!thread_finished) {
cpci_stop_thread();
- if (controller->irq)
+ }
+ if(controller->irq) {
free_irq(controller->irq, controller->dev_id);
+ }
controller = NULL;
- cleanup_slots();
- } else
+ } else {
status = -ENODEV;
+ }
return status;
}
@@ -702,28 +691,32 @@ cpci_hp_start(void)
int status;
dbg("%s - enter", __FUNCTION__);
- if (!controller)
+ if(!controller) {
return -ENODEV;
+ }
down_read(&list_rwsem);
- if (list_empty(&slot_list)) {
+ if(list_empty(&slot_list)) {
up_read(&list_rwsem);
return -ENODEV;
}
up_read(&list_rwsem);
- status = init_slots(first);
- if (first)
+ if(first) {
+ status = init_slots();
+ if(status) {
+ return status;
+ }
first = 0;
- if (status)
- return status;
+ }
status = cpci_start_thread();
- if (status)
+ if(status) {
return status;
+ }
dbg("%s - thread started", __FUNCTION__);
- if (controller->irq) {
+ if(controller->irq) {
/* Start enum interrupt processing */
dbg("%s - enabling irq", __FUNCTION__);
controller->ops->enable_irq();
@@ -735,9 +728,13 @@ cpci_hp_start(void)
int
cpci_hp_stop(void)
{
- if (!controller)
+ if(!controller) {
return -ENODEV;
- if (controller->irq) {
+ }
+ if(atomic_read(&extracting) != 0) {
+ return -EBUSY;
+ }
+ if(controller->irq) {
/* Stop enum interrupt processing */
dbg("%s - disabling irq", __FUNCTION__);
controller->ops->disable_irq();
@@ -746,6 +743,34 @@ cpci_hp_stop(void)
return 0;
}
+static void __exit
+cleanup_slots(void)
+{
+ struct list_head *tmp;
+ struct slot *slot;
+
+ /*
+ * Unregister all of our slots with the pci_hotplug subsystem,
+ * and free up all memory that we had allocated.
+ */
+ down_write(&list_rwsem);
+ if(!slots) {
+ goto null_cleanup;
+ }
+ list_for_each(tmp, &slot_list) {
+ slot = list_entry(tmp, struct slot, slot_list);
+ list_del(&slot->slot_list);
+ pci_hp_deregister(slot->hotplug_slot);
+ kfree(slot->hotplug_slot->info);
+ kfree(slot->hotplug_slot->name);
+ kfree(slot->hotplug_slot);
+ kfree(slot);
+ }
+ null_cleanup:
+ up_write(&list_rwsem);
+ return;
+}
+
int __init
cpci_hotplug_init(int debug)
{
@@ -759,8 +784,7 @@ cpci_hotplug_exit(void)
/*
* Clean everything up.
*/
- cpci_hp_stop();
- cpci_hp_unregister_controller(controller);
+ cleanup_slots();
}
EXPORT_SYMBOL_GPL(cpci_hp_register_controller);
diff --git a/trunk/drivers/pci/hotplug/cpci_hotplug_pci.c b/trunk/drivers/pci/hotplug/cpci_hotplug_pci.c
index 225b5e551dd6..69eb4fc54f2f 100644
--- a/trunk/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/trunk/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -1,7 +1,7 @@
/*
* CompactPCI Hot Plug Driver PCI functions
*
- * Copyright (C) 2002,2005 by SOMA Networks, Inc.
+ * Copyright (C) 2002 by SOMA Networks, Inc.
*
* All rights reserved.
*
@@ -38,10 +38,10 @@ extern int cpci_debug;
#define dbg(format, arg...) \
do { \
- if (cpci_debug) \
+ if(cpci_debug) \
printk (KERN_DEBUG "%s: " format "\n", \
MY_NAME , ## arg); \
- } while (0)
+ } while(0)
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
@@ -57,15 +57,16 @@ u8 cpci_get_attention_status(struct slot* slot)
hs_cap = pci_bus_find_capability(slot->bus,
slot->devfn,
PCI_CAP_ID_CHSWP);
- if (!hs_cap)
+ if(!hs_cap) {
return 0;
+ }
- if (pci_bus_read_config_word(slot->bus,
+ if(pci_bus_read_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
- &hs_csr))
+ &hs_csr)) {
return 0;
-
+ }
return hs_csr & 0x0008 ? 1 : 0;
}
@@ -77,22 +78,27 @@ int cpci_set_attention_status(struct slot* slot, int status)
hs_cap = pci_bus_find_capability(slot->bus,
slot->devfn,
PCI_CAP_ID_CHSWP);
- if (!hs_cap)
+ if(!hs_cap) {
return 0;
- if (pci_bus_read_config_word(slot->bus,
+ }
+
+ if(pci_bus_read_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
- &hs_csr))
+ &hs_csr)) {
return 0;
- if (status)
+ }
+ if(status) {
hs_csr |= HS_CSR_LOO;
- else
+ } else {
hs_csr &= ~HS_CSR_LOO;
- if (pci_bus_write_config_word(slot->bus,
+ }
+ if(pci_bus_write_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
- hs_csr))
+ hs_csr)) {
return 0;
+ }
return 1;
}
@@ -104,13 +110,16 @@ u16 cpci_get_hs_csr(struct slot* slot)
hs_cap = pci_bus_find_capability(slot->bus,
slot->devfn,
PCI_CAP_ID_CHSWP);
- if (!hs_cap)
+ if(!hs_cap) {
return 0xFFFF;
- if (pci_bus_read_config_word(slot->bus,
+ }
+
+ if(pci_bus_read_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
- &hs_csr))
+ &hs_csr)) {
return 0xFFFF;
+ }
return hs_csr;
}
@@ -123,22 +132,24 @@ int cpci_check_and_clear_ins(struct slot* slot)
hs_cap = pci_bus_find_capability(slot->bus,
slot->devfn,
PCI_CAP_ID_CHSWP);
- if (!hs_cap)
+ if(!hs_cap) {
return 0;
- if (pci_bus_read_config_word(slot->bus,
+ }
+ if(pci_bus_read_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
- &hs_csr))
+ &hs_csr)) {
return 0;
- if (hs_csr & HS_CSR_INS) {
+ }
+ if(hs_csr & HS_CSR_INS) {
/* Clear INS (by setting it) */
- if (pci_bus_write_config_word(slot->bus,
+ if(pci_bus_write_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
- hs_csr))
+ hs_csr)) {
ins = 0;
- else
- ins = 1;
+ }
+ ins = 1;
}
return ins;
}
@@ -152,15 +163,18 @@ int cpci_check_ext(struct slot* slot)
hs_cap = pci_bus_find_capability(slot->bus,
slot->devfn,
PCI_CAP_ID_CHSWP);
- if (!hs_cap)
+ if(!hs_cap) {
return 0;
- if (pci_bus_read_config_word(slot->bus,
+ }
+ if(pci_bus_read_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
- &hs_csr))
+ &hs_csr)) {
return 0;
- if (hs_csr & HS_CSR_EXT)
+ }
+ if(hs_csr & HS_CSR_EXT) {
ext = 1;
+ }
return ext;
}
@@ -172,20 +186,23 @@ int cpci_clear_ext(struct slot* slot)
hs_cap = pci_bus_find_capability(slot->bus,
slot->devfn,
PCI_CAP_ID_CHSWP);
- if (!hs_cap)
+ if(!hs_cap) {
return -ENODEV;
- if (pci_bus_read_config_word(slot->bus,
+ }
+ if(pci_bus_read_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
- &hs_csr))
+ &hs_csr)) {
return -ENODEV;
- if (hs_csr & HS_CSR_EXT) {
+ }
+ if(hs_csr & HS_CSR_EXT) {
/* Clear EXT (by setting it) */
- if (pci_bus_write_config_word(slot->bus,
+ if(pci_bus_write_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
- hs_csr))
+ hs_csr)) {
return -ENODEV;
+ }
}
return 0;
}
@@ -198,16 +215,18 @@ int cpci_led_on(struct slot* slot)
hs_cap = pci_bus_find_capability(slot->bus,
slot->devfn,
PCI_CAP_ID_CHSWP);
- if (!hs_cap)
+ if(!hs_cap) {
return -ENODEV;
- if (pci_bus_read_config_word(slot->bus,
+ }
+ if(pci_bus_read_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
- &hs_csr))
+ &hs_csr)) {
return -ENODEV;
- if ((hs_csr & HS_CSR_LOO) != HS_CSR_LOO) {
+ }
+ if((hs_csr & HS_CSR_LOO) != HS_CSR_LOO) {
hs_csr |= HS_CSR_LOO;
- if (pci_bus_write_config_word(slot->bus,
+ if(pci_bus_write_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
hs_csr)) {
@@ -227,16 +246,18 @@ int cpci_led_off(struct slot* slot)
hs_cap = pci_bus_find_capability(slot->bus,
slot->devfn,
PCI_CAP_ID_CHSWP);
- if (!hs_cap)
+ if(!hs_cap) {
return -ENODEV;
- if (pci_bus_read_config_word(slot->bus,
+ }
+ if(pci_bus_read_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
- &hs_csr))
+ &hs_csr)) {
return -ENODEV;
- if (hs_csr & HS_CSR_LOO) {
+ }
+ if(hs_csr & HS_CSR_LOO) {
hs_csr &= ~HS_CSR_LOO;
- if (pci_bus_write_config_word(slot->bus,
+ if(pci_bus_write_config_word(slot->bus,
slot->devfn,
hs_cap + 2,
hs_csr)) {
@@ -253,6 +274,19 @@ int cpci_led_off(struct slot* slot)
* Device configuration functions
*/
+static void cpci_enable_device(struct pci_dev *dev)
+{
+ struct pci_bus *bus;
+
+ pci_enable_device(dev);
+ if(dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
+ bus = dev->subordinate;
+ list_for_each_entry(dev, &bus->devices, bus_list) {
+ cpci_enable_device(dev);
+ }
+ }
+}
+
int cpci_configure_slot(struct slot* slot)
{
unsigned char busnr;
@@ -260,14 +294,14 @@ int cpci_configure_slot(struct slot* slot)
dbg("%s - enter", __FUNCTION__);
- if (slot->dev == NULL) {
+ if(slot->dev == NULL) {
dbg("pci_dev null, finding %02x:%02x:%x",
slot->bus->number, PCI_SLOT(slot->devfn), PCI_FUNC(slot->devfn));
- slot->dev = pci_get_slot(slot->bus, slot->devfn);
+ slot->dev = pci_find_slot(slot->bus->number, slot->devfn);
}
/* Still NULL? Well then scan for it! */
- if (slot->dev == NULL) {
+ if(slot->dev == NULL) {
int n;
dbg("pci_dev still null");
@@ -277,10 +311,10 @@ int cpci_configure_slot(struct slot* slot)
*/
n = pci_scan_slot(slot->bus, slot->devfn);
dbg("%s: pci_scan_slot returned %d", __FUNCTION__, n);
- if (n > 0)
+ if(n > 0)
pci_bus_add_devices(slot->bus);
- slot->dev = pci_get_slot(slot->bus, slot->devfn);
- if (slot->dev == NULL) {
+ slot->dev = pci_find_slot(slot->bus->number, slot->devfn);
+ if(slot->dev == NULL) {
err("Could not find PCI device for slot %02x", slot->number);
return 1;
}
@@ -295,6 +329,8 @@ int cpci_configure_slot(struct slot* slot)
pci_bus_assign_resources(slot->dev->bus);
+ cpci_enable_device(slot->dev);
+
dbg("%s - exit", __FUNCTION__);
return 0;
}
@@ -305,22 +341,19 @@ int cpci_unconfigure_slot(struct slot* slot)
struct pci_dev *dev;
dbg("%s - enter", __FUNCTION__);
- if (!slot->dev) {
+ if(!slot->dev) {
err("No device for slot %02x\n", slot->number);
return -ENODEV;
}
for (i = 0; i < 8; i++) {
- dev = pci_get_slot(slot->bus,
+ dev = pci_find_slot(slot->bus->number,
PCI_DEVFN(PCI_SLOT(slot->devfn), i));
- if (dev) {
+ if(dev) {
pci_remove_bus_device(dev);
- pci_dev_put(dev);
+ slot->dev = NULL;
}
}
- pci_dev_put(slot->dev);
- slot->dev = NULL;
-
dbg("%s - exit", __FUNCTION__);
return 0;
}
diff --git a/trunk/drivers/pci/hotplug/shpchprm_acpi.c b/trunk/drivers/pci/hotplug/shpchprm_acpi.c
index 7957cdc72cd0..243a51d88b86 100644
--- a/trunk/drivers/pci/hotplug/shpchprm_acpi.c
+++ b/trunk/drivers/pci/hotplug/shpchprm_acpi.c
@@ -1626,7 +1626,7 @@ int shpchprm_set_hpp(
pci_bus->number = func->bus;
devfn = PCI_DEVFN(func->device, func->function);
- ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->slot_bus);
+ ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->bus);
if (ab) {
if (ab->_hpp) {
@@ -1681,7 +1681,7 @@ void shpchprm_enable_card(
| PCI_COMMAND_IO | PCI_COMMAND_MEMORY;
bcmd = bcommand = bcommand | PCI_BRIDGE_CTL_NO_ISA;
- ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->slot_bus);
+ ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->bus);
if (ab) {
if (ab->_hpp) {
if (ab->_hpp->enable_perr) {
diff --git a/trunk/drivers/pci/pci.ids b/trunk/drivers/pci/pci.ids
index 1d2ef1e2ffc6..93481b41b613 100644
--- a/trunk/drivers/pci/pci.ids
+++ b/trunk/drivers/pci/pci.ids
@@ -7173,7 +7173,6 @@
080f Sentry5 DDR/SDR RAM Controller
0811 Sentry5 External Interface Core
0816 BCM3302 Sentry5 MIPS32 CPU
- 1600 NetXtreme BCM5752 Gigabit Ethernet PCI Express
1644 NetXtreme BCM5700 Gigabit Ethernet
1014 0277 Broadcom Vigil B5700 1000Base-T
1028 00d1 Broadcom BCM5700
diff --git a/trunk/drivers/pci/quirks.c b/trunk/drivers/pci/quirks.c
index 968033fd29f0..637e9493034b 100644
--- a/trunk/drivers/pci/quirks.c
+++ b/trunk/drivers/pci/quirks.c
@@ -456,15 +456,20 @@ static void __init quirk_amd_8131_ioapic(struct pci_dev *dev)
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_APIC, quirk_amd_8131_ioapic );
-static void __init quirk_svw_msi(struct pci_dev *dev)
-{
- pci_msi_quirk = 1;
- printk(KERN_WARNING "PCI: MSI quirk detected. pci_msi_quirk set.\n");
-}
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_svw_msi );
#endif /* CONFIG_X86_IO_APIC */
+/*
+ * Via 686A/B: The PCI_INTERRUPT_LINE register for the on-chip
+ * devices, USB0/1, AC97, MC97, and ACPI, has an unusual feature:
+ * when written, it makes an internal connection to the PIC.
+ * For these devices, this register is defined to be 4 bits wide.
+ * Normally this is fine. However for IO-APIC motherboards, or
+ * non-x86 architectures (yes Via exists on PPC among other places),
+ * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get
+ * interrupts delivered properly.
+ */
+
/*
* FIXME: it is questionable that quirk_via_acpi
* is needed. It shows up as an ISA bridge, and does not
@@ -487,30 +492,28 @@ static void __devinit quirk_via_acpi(struct pci_dev *d)
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_acpi );
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi );
-/*
- * Via 686A/B: The PCI_INTERRUPT_LINE register for the on-chip
- * devices, USB0/1, AC97, MC97, and ACPI, has an unusual feature:
- * when written, it makes an internal connection to the PIC.
- * For these devices, this register is defined to be 4 bits wide.
- * Normally this is fine. However for IO-APIC motherboards, or
- * non-x86 architectures (yes Via exists on PPC among other places),
- * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get
- * interrupts delivered properly.
- */
-static void quirk_via_irq(struct pci_dev *dev)
+static void quirk_via_irqpic(struct pci_dev *dev)
{
u8 irq, new_irq;
+#ifdef CONFIG_X86_IO_APIC
+ if (nr_ioapics && !skip_ioapic_setup)
+ return;
+#endif
+#ifdef CONFIG_ACPI
+ if (acpi_irq_model != ACPI_IRQ_MODEL_PIC)
+ return;
+#endif
new_irq = dev->irq & 0xf;
pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
if (new_irq != irq) {
- printk(KERN_INFO "PCI: Via IRQ fixup for %s, from %d to %d\n",
+ printk(KERN_INFO "PCI: Via PIC IRQ fixup for %s, from %d to %d\n",
pci_name(dev), irq, new_irq);
udelay(15); /* unknown if delay really needed */
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
}
}
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irq);
+DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irqpic);
/*
* PIIX3 USB: We have to disable USB interrupts that are
diff --git a/trunk/drivers/scsi/ata_piix.c b/trunk/drivers/scsi/ata_piix.c
index 3be546439252..54c52349adc5 100644
--- a/trunk/drivers/scsi/ata_piix.c
+++ b/trunk/drivers/scsi/ata_piix.c
@@ -665,6 +665,15 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
return ata_pci_init_one(pdev, port_info, n_ports);
}
+/**
+ * piix_init -
+ *
+ * LOCKING:
+ *
+ * RETURNS:
+ *
+ */
+
static int __init piix_init(void)
{
int rc;
@@ -680,6 +689,13 @@ static int __init piix_init(void)
return 0;
}
+/**
+ * piix_exit -
+ *
+ * LOCKING:
+ *
+ */
+
static void __exit piix_exit(void)
{
pci_unregister_driver(&piix_pci_driver);
diff --git a/trunk/drivers/scsi/libata-core.c b/trunk/drivers/scsi/libata-core.c
index 9e58f134f68b..30a88f0e7bd6 100644
--- a/trunk/drivers/scsi/libata-core.c
+++ b/trunk/drivers/scsi/libata-core.c
@@ -186,28 +186,6 @@ static void ata_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf)
ata_wait_idle(ap);
}
-
-/**
- * ata_tf_load - send taskfile registers to host controller
- * @ap: Port to which output is sent
- * @tf: ATA taskfile register set
- *
- * Outputs ATA taskfile to standard ATA host controller using MMIO
- * or PIO as indicated by the ATA_FLAG_MMIO flag.
- * Writes the control, feature, nsect, lbal, lbam, and lbah registers.
- * Optionally (ATA_TFLAG_LBA48) writes hob_feature, hob_nsect,
- * hob_lbal, hob_lbam, and hob_lbah.
- *
- * This function waits for idle (!BUSY and !DRQ) after writing
- * registers. If the control register has a new value, this
- * function also waits for idle after writing control and before
- * writing the remaining registers.
- *
- * May be used as the tf_load() entry in ata_port_operations.
- *
- * LOCKING:
- * Inherited from caller.
- */
void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf)
{
if (ap->flags & ATA_FLAG_MMIO)
@@ -217,11 +195,11 @@ void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf)
}
/**
- * ata_exec_command_pio - issue ATA command to host controller
+ * ata_exec_command - issue ATA command to host controller
* @ap: port to which command is being issued
* @tf: ATA taskfile register set
*
- * Issues PIO write to ATA command register, with proper
+ * Issues PIO/MMIO write to ATA command register, with proper
* synchronization with interrupt handler / other threads.
*
* LOCKING:
@@ -257,18 +235,6 @@ static void ata_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf)
ata_pause(ap);
}
-
-/**
- * ata_exec_command - issue ATA command to host controller
- * @ap: port to which command is being issued
- * @tf: ATA taskfile register set
- *
- * Issues PIO/MMIO write to ATA command register, with proper
- * synchronization with interrupt handler / other threads.
- *
- * LOCKING:
- * spin_lock_irqsave(host_set lock)
- */
void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf)
{
if (ap->flags & ATA_FLAG_MMIO)
@@ -339,7 +305,7 @@ void ata_tf_to_host_nolock(struct ata_port *ap, struct ata_taskfile *tf)
}
/**
- * ata_tf_read_pio - input device's ATA taskfile shadow registers
+ * ata_tf_read - input device's ATA taskfile shadow registers
* @ap: Port from which input is read
* @tf: ATA taskfile register set for storing input
*
@@ -402,23 +368,6 @@ static void ata_tf_read_mmio(struct ata_port *ap, struct ata_taskfile *tf)
}
}
-
-/**
- * ata_tf_read - input device's ATA taskfile shadow registers
- * @ap: Port from which input is read
- * @tf: ATA taskfile register set for storing input
- *
- * Reads ATA taskfile registers for currently-selected device
- * into @tf.
- *
- * Reads nsect, lbal, lbam, lbah, and device. If ATA_TFLAG_LBA48
- * is set, also reads the hob registers.
- *
- * May be used as the tf_read() entry in ata_port_operations.
- *
- * LOCKING:
- * Inherited from caller.
- */
void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
{
if (ap->flags & ATA_FLAG_MMIO)
@@ -432,7 +381,7 @@ void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
* @ap: port where the device is
*
* Reads ATA taskfile status register for currently-selected device
- * and return its value. This also clears pending interrupts
+ * and return it's value. This also clears pending interrupts
* from this device
*
* LOCKING:
@@ -448,7 +397,7 @@ static u8 ata_check_status_pio(struct ata_port *ap)
* @ap: port where the device is
*
* Reads ATA taskfile status register for currently-selected device
- * via MMIO and return its value. This also clears pending interrupts
+ * via MMIO and return it's value. This also clears pending interrupts
* from this device
*
* LOCKING:
@@ -459,20 +408,6 @@ static u8 ata_check_status_mmio(struct ata_port *ap)
return readb((void __iomem *) ap->ioaddr.status_addr);
}
-
-/**
- * ata_check_status - Read device status reg & clear interrupt
- * @ap: port where the device is
- *
- * Reads ATA taskfile status register for currently-selected device
- * and return its value. This also clears pending interrupts
- * from this device
- *
- * May be used as the check_status() entry in ata_port_operations.
- *
- * LOCKING:
- * Inherited from caller.
- */
u8 ata_check_status(struct ata_port *ap)
{
if (ap->flags & ATA_FLAG_MMIO)
@@ -480,20 +415,6 @@ u8 ata_check_status(struct ata_port *ap)
return ata_check_status_pio(ap);
}
-
-/**
- * ata_altstatus - Read device alternate status reg
- * @ap: port where the device is
- *
- * Reads ATA taskfile alternate status register for
- * currently-selected device and return its value.
- *
- * Note: may NOT be used as the check_altstatus() entry in
- * ata_port_operations.
- *
- * LOCKING:
- * Inherited from caller.
- */
u8 ata_altstatus(struct ata_port *ap)
{
if (ap->ops->check_altstatus)
@@ -504,20 +425,6 @@ u8 ata_altstatus(struct ata_port *ap)
return inb(ap->ioaddr.altstatus_addr);
}
-
-/**
- * ata_chk_err - Read device error reg
- * @ap: port where the device is
- *
- * Reads ATA taskfile error register for
- * currently-selected device and return its value.
- *
- * Note: may NOT be used as the check_err() entry in
- * ata_port_operations.
- *
- * LOCKING:
- * Inherited from caller.
- */
u8 ata_chk_err(struct ata_port *ap)
{
if (ap->ops->check_err)
@@ -966,24 +873,10 @@ void ata_dev_id_string(u16 *id, unsigned char *s,
}
}
-
-/**
- * ata_noop_dev_select - Select device 0/1 on ATA bus
- * @ap: ATA channel to manipulate
- * @device: ATA device (numbered from zero) to select
- *
- * This function performs no actual function.
- *
- * May be used as the dev_select() entry in ata_port_operations.
- *
- * LOCKING:
- * caller.
- */
void ata_noop_dev_select (struct ata_port *ap, unsigned int device)
{
}
-
/**
* ata_std_dev_select - Select device 0/1 on ATA bus
* @ap: ATA channel to manipulate
@@ -991,9 +884,7 @@ void ata_noop_dev_select (struct ata_port *ap, unsigned int device)
*
* Use the method defined in the ATA specification to
* make either device 0, or device 1, active on the
- * ATA channel. Works with both PIO and MMIO.
- *
- * May be used as the dev_select() entry in ata_port_operations.
+ * ATA channel.
*
* LOCKING:
* caller.
@@ -1299,12 +1190,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
* ata_bus_probe - Reset and probe ATA bus
* @ap: Bus to probe
*
- * Master ATA bus probing function. Initiates a hardware-dependent
- * bus reset, then attempts to identify any devices found on
- * the bus.
- *
* LOCKING:
- * PCI/etc. bus probe sem.
*
* RETURNS:
* Zero on success, non-zero on error.
@@ -1343,14 +1229,10 @@ static int ata_bus_probe(struct ata_port *ap)
}
/**
- * ata_port_probe - Mark port as enabled
- * @ap: Port for which we indicate enablement
- *
- * Modify @ap data structure such that the system
- * thinks that the entire port is enabled.
+ * ata_port_probe -
+ * @ap:
*
- * LOCKING: host_set lock, or some other form of
- * serialization.
+ * LOCKING:
*/
void ata_port_probe(struct ata_port *ap)
@@ -1359,15 +1241,10 @@ void ata_port_probe(struct ata_port *ap)
}
/**
- * __sata_phy_reset - Wake/reset a low-level SATA PHY
- * @ap: SATA port associated with target SATA PHY.
- *
- * This function issues commands to standard SATA Sxxx
- * PHY registers, to wake up the phy (and device), and
- * clear any reset condition.
+ * __sata_phy_reset -
+ * @ap:
*
* LOCKING:
- * PCI/etc. bus probe sem.
*
*/
void __sata_phy_reset(struct ata_port *ap)
@@ -1412,14 +1289,10 @@ void __sata_phy_reset(struct ata_port *ap)
}
/**
- * sata_phy_reset - Reset SATA bus.
- * @ap: SATA port associated with target SATA PHY.
- *
- * This function resets the SATA bus, and then probes
- * the bus for devices.
+ * __sata_phy_reset -
+ * @ap:
*
* LOCKING:
- * PCI/etc. bus probe sem.
*
*/
void sata_phy_reset(struct ata_port *ap)
@@ -1431,16 +1304,10 @@ void sata_phy_reset(struct ata_port *ap)
}
/**
- * ata_port_disable - Disable port.
- * @ap: Port to be disabled.
- *
- * Modify @ap data structure such that the system
- * thinks that the entire port is disabled, and should
- * never attempt to probe or communicate with devices
- * on this port.
+ * ata_port_disable -
+ * @ap:
*
- * LOCKING: host_set lock, or some other form of
- * serialization.
+ * LOCKING:
*/
void ata_port_disable(struct ata_port *ap)
@@ -1549,10 +1416,7 @@ static void ata_host_set_dma(struct ata_port *ap, u8 xfer_mode,
* ata_set_mode - Program timings and issue SET FEATURES - XFER
* @ap: port on which timings will be programmed
*
- * Set ATA device disk transfer mode (PIO3, UDMA6, etc.).
- *
* LOCKING:
- * PCI/etc. bus probe sem.
*
*/
static void ata_set_mode(struct ata_port *ap)
@@ -1603,10 +1467,7 @@ static void ata_set_mode(struct ata_port *ap)
* @tmout_pat: impatience timeout
* @tmout: overall timeout
*
- * Sleep until ATA Status register bit BSY clears,
- * or a timeout occurs.
- *
- * LOCKING: None.
+ * LOCKING:
*
*/
@@ -1692,14 +1553,10 @@ static void ata_bus_post_reset(struct ata_port *ap, unsigned int devmask)
}
/**
- * ata_bus_edd - Issue EXECUTE DEVICE DIAGNOSTIC command.
- * @ap: Port to reset and probe
- *
- * Use the EXECUTE DEVICE DIAGNOSTIC command to reset and
- * probe the bus. Not often used these days.
+ * ata_bus_edd -
+ * @ap:
*
* LOCKING:
- * PCI/etc. bus probe sem.
*
*/
@@ -1776,8 +1633,8 @@ static unsigned int ata_bus_softreset(struct ata_port *ap,
* the device is ATA or ATAPI.
*
* LOCKING:
- * PCI/etc. bus probe sem.
- * Obtains host_set lock.
+ * Inherited from caller. Some functions called by this function
+ * obtain the host_set lock.
*
* SIDE EFFECTS:
* Sets ATA_FLAG_PORT_DISABLED if bus reset fails.
@@ -2019,11 +1876,7 @@ static int fgb(u32 bitmap)
* @xfer_mode_out: (output) SET FEATURES - XFER MODE code
* @xfer_shift_out: (output) bit shift that selects this mode
*
- * Based on host and device capabilities, determine the
- * maximum transfer mode that is amenable to all.
- *
* LOCKING:
- * PCI/etc. bus probe sem.
*
* RETURNS:
* Zero on success, negative on error.
@@ -2056,11 +1909,7 @@ static int ata_choose_xfer_mode(struct ata_port *ap,
* @ap: Port associated with device @dev
* @dev: Device to which command will be sent
*
- * Issue SET FEATURES - XFER MODE command to device @dev
- * on port @ap.
- *
* LOCKING:
- * PCI/etc. bus probe sem.
*/
static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)
@@ -2098,13 +1947,10 @@ static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)
}
/**
- * ata_sg_clean - Unmap DMA memory associated with command
- * @qc: Command containing DMA memory to be released
- *
- * Unmap all mapped DMA memory associated with this command.
+ * ata_sg_clean -
+ * @qc:
*
* LOCKING:
- * spin_lock_irqsave(host_set lock)
*/
static void ata_sg_clean(struct ata_queued_cmd *qc)
@@ -2135,11 +1981,7 @@ static void ata_sg_clean(struct ata_queued_cmd *qc)
* ata_fill_sg - Fill PCI IDE PRD table
* @qc: Metadata associated with taskfile to be transferred
*
- * Fill PCI IDE PRD (scatter-gather) table with segments
- * associated with the current disk command.
- *
* LOCKING:
- * spin_lock_irqsave(host_set lock)
*
*/
static void ata_fill_sg(struct ata_queued_cmd *qc)
@@ -2186,13 +2028,7 @@ static void ata_fill_sg(struct ata_queued_cmd *qc)
* ata_check_atapi_dma - Check whether ATAPI DMA can be supported
* @qc: Metadata associated with taskfile to check
*
- * Allow low-level driver to filter ATA PACKET commands, returning
- * a status indicating whether or not it is OK to use DMA for the
- * supplied PACKET command.
- *
* LOCKING:
- * spin_lock_irqsave(host_set lock)
- *
* RETURNS: 0 when ATAPI DMA can be used
* nonzero otherwise
*/
@@ -2210,8 +2046,6 @@ int ata_check_atapi_dma(struct ata_queued_cmd *qc)
* ata_qc_prep - Prepare taskfile for submission
* @qc: Metadata associated with taskfile to be prepared
*
- * Prepare ATA taskfile for submission.
- *
* LOCKING:
* spin_lock_irqsave(host_set lock)
*/
@@ -2223,32 +2057,6 @@ void ata_qc_prep(struct ata_queued_cmd *qc)
ata_fill_sg(qc);
}
-/**
- * ata_sg_init_one - Associate command with memory buffer
- * @qc: Command to be associated
- * @buf: Memory buffer
- * @buflen: Length of memory buffer, in bytes.
- *
- * Initialize the data-related elements of queued_cmd @qc
- * to point to a single memory buffer, @buf of byte length @buflen.
- *
- * LOCKING:
- * spin_lock_irqsave(host_set lock)
- */
-
-
-
-/**
- * ata_sg_init_one - Prepare a one-entry scatter-gather list.
- * @qc: Queued command
- * @buf: transfer buffer
- * @buflen: length of buf
- *
- * Builds a single-entry scatter-gather list to initiate a
- * transfer utilizing the specified buffer.
- *
- * LOCKING:
- */
void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen)
{
struct scatterlist *sg;
@@ -2266,32 +2074,6 @@ void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen)
sg->length = buflen;
}
-/**
- * ata_sg_init - Associate command with scatter-gather table.
- * @qc: Command to be associated
- * @sg: Scatter-gather table.
- * @n_elem: Number of elements in s/g table.
- *
- * Initialize the data-related elements of queued_cmd @qc
- * to point to a scatter-gather table @sg, containing @n_elem
- * elements.
- *
- * LOCKING:
- * spin_lock_irqsave(host_set lock)
- */
-
-
-/**
- * ata_sg_init - Assign a scatter gather list to a queued command
- * @qc: Queued command
- * @sg: Scatter-gather list
- * @n_elem: length of sg list
- *
- * Attaches a scatter-gather list to a queued command.
- *
- * LOCKING:
- */
-
void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
unsigned int n_elem)
{
@@ -2301,16 +2083,14 @@ void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
}
/**
- * ata_sg_setup_one - DMA-map the memory buffer associated with a command.
- * @qc: Command with memory buffer to be mapped.
- *
- * DMA-map the memory buffer associated with queued_cmd @qc.
+ * ata_sg_setup_one -
+ * @qc:
*
* LOCKING:
* spin_lock_irqsave(host_set lock)
*
* RETURNS:
- * Zero on success, negative on error.
+ *
*/
static int ata_sg_setup_one(struct ata_queued_cmd *qc)
@@ -2335,16 +2115,13 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
}
/**
- * ata_sg_setup - DMA-map the scatter-gather table associated with a command.
- * @qc: Command with scatter-gather table to be mapped.
- *
- * DMA-map the scatter-gather table associated with queued_cmd @qc.
+ * ata_sg_setup -
+ * @qc:
*
* LOCKING:
* spin_lock_irqsave(host_set lock)
*
* RETURNS:
- * Zero on success, negative on error.
*
*/
@@ -2374,7 +2151,6 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
* @ap:
*
* LOCKING:
- * None. (executing in kernel thread context)
*
* RETURNS:
*
@@ -2422,7 +2198,6 @@ static unsigned long ata_pio_poll(struct ata_port *ap)
* @ap:
*
* LOCKING:
- * None. (executing in kernel thread context)
*/
static void ata_pio_complete (struct ata_port *ap)
@@ -2465,18 +2240,6 @@ static void ata_pio_complete (struct ata_port *ap)
ata_qc_complete(qc, drv_stat);
}
-
-/**
- * swap_buf_le16 -
- * @buf: Buffer to swap
- * @buf_words: Number of 16-bit words in buffer.
- *
- * Swap halves of 16-bit words if needed to convert from
- * little-endian byte order to native cpu byte order, or
- * vice-versa.
- *
- * LOCKING:
- */
void swap_buf_le16(u16 *buf, unsigned int buf_words)
{
#ifdef __BIG_ENDIAN
@@ -2577,6 +2340,7 @@ static void __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)
next_sg:
sg = &qc->sg[qc->cursg];
+next_page:
page = sg->page;
offset = sg->offset + qc->cursg_ofs;
@@ -2584,7 +2348,6 @@ static void __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)
page = nth_page(page, (offset >> PAGE_SHIFT));
offset %= PAGE_SIZE;
- /* don't overrun current sg */
count = min(sg->length - qc->cursg_ofs, bytes);
/* don't cross page boundaries */
@@ -2609,6 +2372,8 @@ static void __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)
kunmap(page);
if (bytes) {
+ if (qc->cursg_ofs < sg->length)
+ goto next_page;
goto next_sg;
}
}
@@ -2650,7 +2415,6 @@ static void atapi_pio_bytes(struct ata_queued_cmd *qc)
* @ap:
*
* LOCKING:
- * None. (executing in kernel thread context)
*/
static void ata_pio_block(struct ata_port *ap)
@@ -2819,7 +2583,6 @@ static void atapi_request_sense(struct ata_port *ap, struct ata_device *dev,
* transaction completed successfully.
*
* LOCKING:
- * Inherited from SCSI layer (none, can sleep)
*/
static void ata_qc_timeout(struct ata_queued_cmd *qc)
@@ -2929,7 +2692,6 @@ void ata_eng_timeout(struct ata_port *ap)
* @dev: Device from whom we request an available command structure
*
* LOCKING:
- * None.
*/
static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
@@ -2955,7 +2717,6 @@ static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
* @dev: Device from whom we request an available command structure
*
* LOCKING:
- * None.
*/
struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
@@ -3020,7 +2781,6 @@ static void __ata_qc_complete(struct ata_queued_cmd *qc)
* in case something prevents using it.
*
* LOCKING:
- * spin_lock_irqsave(host_set lock)
*
*/
void ata_qc_free(struct ata_queued_cmd *qc)
@@ -3034,13 +2794,9 @@ void ata_qc_free(struct ata_queued_cmd *qc)
/**
* ata_qc_complete - Complete an active ATA command
* @qc: Command to complete
- * @drv_stat: ATA Status register contents
- *
- * Indicate to the mid and upper layers that an ATA
- * command has completed, with either an ok or not-ok status.
+ * @drv_stat: ATA status register contents
*
* LOCKING:
- * spin_lock_irqsave(host_set lock)
*
*/
@@ -3136,7 +2892,6 @@ int ata_qc_issue(struct ata_queued_cmd *qc)
return -1;
}
-
/**
* ata_qc_issue_prot - issue taskfile to device in proto-dependent manner
* @qc: command to issue to device
@@ -3146,8 +2901,6 @@ int ata_qc_issue(struct ata_queued_cmd *qc)
* classes called "protocols", and issuing each type of protocol
* is slightly different.
*
- * May be used as the qc_issue() entry in ata_port_operations.
- *
* LOCKING:
* spin_lock_irqsave(host_set lock)
*
@@ -3205,7 +2958,7 @@ int ata_qc_issue_prot(struct ata_queued_cmd *qc)
}
/**
- * ata_bmdma_setup_mmio - Set up PCI IDE BMDMA transaction
+ * ata_bmdma_setup - Set up PCI IDE BMDMA transaction
* @qc: Info associated with this ATA transaction.
*
* LOCKING:
@@ -3312,18 +3065,6 @@ static void ata_bmdma_start_pio (struct ata_queued_cmd *qc)
ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
}
-
-/**
- * ata_bmdma_start - Start a PCI IDE BMDMA transaction
- * @qc: Info associated with this ATA transaction.
- *
- * Writes the ATA_DMA_START flag to the DMA command register.
- *
- * May be used as the bmdma_start() entry in ata_port_operations.
- *
- * LOCKING:
- * spin_lock_irqsave(host_set lock)
- */
void ata_bmdma_start(struct ata_queued_cmd *qc)
{
if (qc->ap->flags & ATA_FLAG_MMIO)
@@ -3332,20 +3073,6 @@ void ata_bmdma_start(struct ata_queued_cmd *qc)
ata_bmdma_start_pio(qc);
}
-
-/**
- * ata_bmdma_setup - Set up PCI IDE BMDMA transaction
- * @qc: Info associated with this ATA transaction.
- *
- * Writes address of PRD table to device's PRD Table Address
- * register, sets the DMA control register, and calls
- * ops->exec_command() to start the transfer.
- *
- * May be used as the bmdma_setup() entry in ata_port_operations.
- *
- * LOCKING:
- * spin_lock_irqsave(host_set lock)
- */
void ata_bmdma_setup(struct ata_queued_cmd *qc)
{
if (qc->ap->flags & ATA_FLAG_MMIO)
@@ -3354,19 +3081,6 @@ void ata_bmdma_setup(struct ata_queued_cmd *qc)
ata_bmdma_setup_pio(qc);
}
-
-/**
- * ata_bmdma_irq_clear - Clear PCI IDE BMDMA interrupt.
- * @ap: Port associated with this ATA transaction.
- *
- * Clear interrupt and error flags in DMA status register.
- *
- * May be used as the irq_clear() entry in ata_port_operations.
- *
- * LOCKING:
- * spin_lock_irqsave(host_set lock)
- */
-
void ata_bmdma_irq_clear(struct ata_port *ap)
{
if (ap->flags & ATA_FLAG_MMIO) {
@@ -3379,19 +3093,6 @@ void ata_bmdma_irq_clear(struct ata_port *ap)
}
-
-/**
- * ata_bmdma_status - Read PCI IDE BMDMA status
- * @ap: Port associated with this ATA transaction.
- *
- * Read and return BMDMA status register.
- *
- * May be used as the bmdma_status() entry in ata_port_operations.
- *
- * LOCKING:
- * spin_lock_irqsave(host_set lock)
- */
-
u8 ata_bmdma_status(struct ata_port *ap)
{
u8 host_stat;
@@ -3403,19 +3104,6 @@ u8 ata_bmdma_status(struct ata_port *ap)
return host_stat;
}
-
-/**
- * ata_bmdma_stop - Stop PCI IDE BMDMA transfer
- * @ap: Port associated with this ATA transaction.
- *
- * Clears the ATA_DMA_START flag in the dma control register
- *
- * May be used as the bmdma_stop() entry in ata_port_operations.
- *
- * LOCKING:
- * spin_lock_irqsave(host_set lock)
- */
-
void ata_bmdma_stop(struct ata_port *ap)
{
if (ap->flags & ATA_FLAG_MMIO) {
@@ -3515,18 +3203,13 @@ inline unsigned int ata_host_intr (struct ata_port *ap,
/**
* ata_interrupt - Default ATA host interrupt handler
- * @irq: irq line (unused)
- * @dev_instance: pointer to our ata_host_set information structure
+ * @irq: irq line
+ * @dev_instance: pointer to our host information structure
* @regs: unused
*
- * Default interrupt handler for PCI IDE devices. Calls
- * ata_host_intr() for each port that is not disabled.
- *
* LOCKING:
- * Obtains host_set lock during operation.
*
* RETURNS:
- * IRQ_NONE or IRQ_HANDLED.
*
*/
@@ -3619,19 +3302,6 @@ static void atapi_packet_task(void *_data)
ata_qc_complete(qc, ATA_ERR);
}
-
-/**
- * ata_port_start - Set port up for dma.
- * @ap: Port to initialize
- *
- * Called just after data structures for each port are
- * initialized. Allocates space for PRD table.
- *
- * May be used as the port_start() entry in ata_port_operations.
- *
- * LOCKING:
- */
-
int ata_port_start (struct ata_port *ap)
{
struct device *dev = ap->host_set->dev;
@@ -3645,18 +3315,6 @@ int ata_port_start (struct ata_port *ap)
return 0;
}
-
-/**
- * ata_port_stop - Undo ata_port_start()
- * @ap: Port to shut down
- *
- * Frees the PRD table.
- *
- * May be used as the port_stop() entry in ata_port_operations.
- *
- * LOCKING:
- */
-
void ata_port_stop (struct ata_port *ap)
{
struct device *dev = ap->host_set->dev;
@@ -3699,11 +3357,7 @@ static void ata_host_remove(struct ata_port *ap, unsigned int do_unregister)
* @ent: Probe information provided by low-level driver
* @port_no: Port number associated with this ata_port
*
- * Initialize a new ata_port structure, and its associated
- * scsi_host.
- *
* LOCKING:
- * Inherited from caller.
*
*/
@@ -3758,13 +3412,9 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
* @host_set: Collections of ports to which we add
* @port_no: Port number associated with this host
*
- * Attach low-level ATA driver to system.
- *
* LOCKING:
- * PCI/etc. bus probe sem.
*
* RETURNS:
- * New ata_port on success, for NULL on error.
*
*/
@@ -3797,22 +3447,12 @@ static struct ata_port * ata_host_add(struct ata_probe_ent *ent,
}
/**
- * ata_device_add - Register hardware device with ATA and SCSI layers
- * @ent: Probe information describing hardware device to be registered
- *
- * This function processes the information provided in the probe
- * information struct @ent, allocates the necessary ATA and SCSI
- * host information structures, initializes them, and registers
- * everything with requisite kernel subsystems.
- *
- * This function requests irqs, probes the ATA bus, and probes
- * the SCSI bus.
+ * ata_device_add -
+ * @ent:
*
* LOCKING:
- * PCI/etc. bus probe sem.
*
* RETURNS:
- * Number of ports registered. Zero on error (no ports registered).
*
*/
@@ -3964,15 +3604,7 @@ int ata_scsi_release(struct Scsi_Host *host)
/**
* ata_std_ports - initialize ioaddr with standard port offsets.
* @ioaddr: IO address structure to be initialized
- *
- * Utility function which initializes data_addr, error_addr,
- * feature_addr, nsect_addr, lbal_addr, lbam_addr, lbah_addr,
- * device_addr, status_addr, and command_addr to standard offsets
- * relative to cmd_addr.
- *
- * Does not set ctl_addr, altstatus_addr, bmdma_addr, or scr_addr.
*/
-
void ata_std_ports(struct ata_ioports *ioaddr)
{
ioaddr->data_addr = ioaddr->cmd_addr + ATA_REG_DATA;
@@ -4014,20 +3646,6 @@ ata_probe_ent_alloc(struct device *dev, struct ata_port_info *port)
return probe_ent;
}
-
-
-/**
- * ata_pci_init_native_mode - Initialize native-mode driver
- * @pdev: pci device to be initialized
- * @port: array[2] of pointers to port info structures.
- *
- * Utility function which allocates and initializes an
- * ata_probe_ent structure for a standard dual-port
- * PIO-based IDE controller. The returned ata_probe_ent
- * structure can be passed to ata_device_add(). The returned
- * ata_probe_ent structure should then be freed with kfree().
- */
-
#ifdef CONFIG_PCI
struct ata_probe_ent *
ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port)
@@ -4109,19 +3727,10 @@ ata_pci_init_legacy_mode(struct pci_dev *pdev, struct ata_port_info **port,
* @port_info: Information from low-level host driver
* @n_ports: Number of ports attached to host controller
*
- * This is a helper function which can be called from a driver's
- * xxx_init_one() probe function if the hardware uses traditional
- * IDE taskfile registers.
- *
- * This function calls pci_enable_device(), reserves its register
- * regions, sets the dma mask, enables bus master mode, and calls
- * ata_device_add()
- *
* LOCKING:
* Inherited from PCI layer (may sleep).
*
* RETURNS:
- * Zero on success, negative on errno-based value on error.
*
*/
@@ -4340,6 +3949,15 @@ int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits)
#endif /* CONFIG_PCI */
+/**
+ * ata_init -
+ *
+ * LOCKING:
+ *
+ * RETURNS:
+ *
+ */
+
static int __init ata_init(void)
{
ata_wq = create_workqueue("ata");
diff --git a/trunk/drivers/scsi/libata-scsi.c b/trunk/drivers/scsi/libata-scsi.c
index 7a4adc4c8f09..416ba67ba9ee 100644
--- a/trunk/drivers/scsi/libata-scsi.c
+++ b/trunk/drivers/scsi/libata-scsi.c
@@ -947,7 +947,7 @@ unsigned int ata_scsiop_inq_83(struct ata_scsi_args *args, u8 *rbuf,
}
/**
- * ata_scsiop_noop - Command handler that simply returns success.
+ * ata_scsiop_noop -
* @args: device IDENTIFY data / SCSI command of interest.
* @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
* @buflen: Response buffer length.
diff --git a/trunk/drivers/scsi/qla2xxx/qla_os.c b/trunk/drivers/scsi/qla2xxx/qla_os.c
index 3c97aa45772d..579448222d69 100644
--- a/trunk/drivers/scsi/qla2xxx/qla_os.c
+++ b/trunk/drivers/scsi/qla2xxx/qla_os.c
@@ -507,7 +507,6 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
int ret, i;
unsigned int id, lun;
unsigned long serial;
- unsigned long flags;
if (!CMD_SP(cmd))
return FAILED;
@@ -520,7 +519,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
/* Check active list for command command. */
spin_unlock_irq(ha->host->host_lock);
- spin_lock_irqsave(&ha->hardware_lock, flags);
+ spin_lock(&ha->hardware_lock);
for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) {
sp = ha->outstanding_cmds[i];
@@ -535,7 +534,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
sp->state));
DEBUG3(qla2x00_print_scsi_cmd(cmd);)
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ spin_unlock(&ha->hardware_lock);
if (qla2x00_abort_command(ha, sp)) {
DEBUG2(printk("%s(%ld): abort_command "
"mbx failed.\n", __func__, ha->host_no));
@@ -544,19 +543,20 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
"mbx success.\n", __func__, ha->host_no));
ret = SUCCESS;
}
- spin_lock_irqsave(&ha->hardware_lock, flags);
+ spin_lock(&ha->hardware_lock);
break;
}
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
/* Wait for the command to be returned. */
if (ret == SUCCESS) {
+ spin_unlock(&ha->hardware_lock);
if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) {
qla_printk(KERN_ERR, ha,
"scsi(%ld:%d:%d): Abort handler timed out -- %lx "
"%x.\n", ha->host_no, id, lun, serial, ret);
}
+ spin_lock(&ha->hardware_lock);
}
spin_lock_irq(ha->host->host_lock);
@@ -588,7 +588,6 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
int status;
srb_t *sp;
struct scsi_cmnd *cmd;
- unsigned long flags;
status = 0;
@@ -597,11 +596,11 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
* array
*/
for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
- spin_lock_irqsave(&ha->hardware_lock, flags);
+ spin_lock(&ha->hardware_lock);
sp = ha->outstanding_cmds[cnt];
if (sp) {
cmd = sp->cmd;
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ spin_unlock(&ha->hardware_lock);
if (cmd->device->id == t) {
if (!qla2x00_eh_wait_on_command(ha, cmd)) {
status = 1;
@@ -609,7 +608,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
}
}
} else {
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ spin_unlock(&ha->hardware_lock);
}
}
return (status);
@@ -741,7 +740,6 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
int status;
srb_t *sp;
struct scsi_cmnd *cmd;
- unsigned long flags;
status = 1;
@@ -750,17 +748,17 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
* array
*/
for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
- spin_lock_irqsave(&ha->hardware_lock, flags);
+ spin_lock(&ha->hardware_lock);
sp = ha->outstanding_cmds[cnt];
if (sp) {
cmd = sp->cmd;
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ spin_unlock(&ha->hardware_lock);
status = qla2x00_eh_wait_on_command(ha, cmd);
if (status == 0)
break;
}
else {
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ spin_unlock(&ha->hardware_lock);
}
}
return (status);
diff --git a/trunk/drivers/scsi/sata_sil.c b/trunk/drivers/scsi/sata_sil.c
index 49ed557a4b66..238580d244e6 100644
--- a/trunk/drivers/scsi/sata_sil.c
+++ b/trunk/drivers/scsi/sata_sil.c
@@ -432,13 +432,7 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
writeb(cls, mmio_base + SIL_FIFO_R0);
writeb(cls, mmio_base + SIL_FIFO_W0);
writeb(cls, mmio_base + SIL_FIFO_R1);
- writeb(cls, mmio_base + SIL_FIFO_W1);
- if (ent->driver_data == sil_3114) {
- writeb(cls, mmio_base + SIL_FIFO_R2);
- writeb(cls, mmio_base + SIL_FIFO_W2);
- writeb(cls, mmio_base + SIL_FIFO_R3);
- writeb(cls, mmio_base + SIL_FIFO_W3);
- }
+ writeb(cls, mmio_base + SIL_FIFO_W2);
} else
printk(KERN_WARNING DRV_NAME "(%s): cache line size not set. Driver may not function\n",
pci_name(pdev));
diff --git a/trunk/drivers/scsi/scsi_scan.c b/trunk/drivers/scsi/scsi_scan.c
index 8d0d302844a1..cca772624ae7 100644
--- a/trunk/drivers/scsi/scsi_scan.c
+++ b/trunk/drivers/scsi/scsi_scan.c
@@ -1197,7 +1197,6 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
if (!starget)
return ERR_PTR(-ENOMEM);
- get_device(&starget->dev);
down(&shost->scan_mutex);
res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata);
if (res != SCSI_SCAN_LUN_PRESENT)
diff --git a/trunk/drivers/serial/sa1100.c b/trunk/drivers/serial/sa1100.c
index 98641c3f5ab9..22565a67a57c 100644
--- a/trunk/drivers/serial/sa1100.c
+++ b/trunk/drivers/serial/sa1100.c
@@ -197,7 +197,7 @@ static void
sa1100_rx_chars(struct sa1100_port *sport, struct pt_regs *regs)
{
struct tty_struct *tty = sport->port.info->tty;
- unsigned int status, ch, flg;
+ unsigned int status, ch, flg, ignored = 0;
status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) |
UTSR0_TO_SM(UART_GET_UTSR0(sport));
diff --git a/trunk/drivers/serial/vr41xx_siu.c b/trunk/drivers/serial/vr41xx_siu.c
index 1f985327b0d4..5d2ceb623e6f 100644
--- a/trunk/drivers/serial/vr41xx_siu.c
+++ b/trunk/drivers/serial/vr41xx_siu.c
@@ -234,7 +234,7 @@ static inline const char *siu_type_name(struct uart_port *port)
return "DSIU";
}
- return NULL;
+ return "unknown";
}
static unsigned int siu_tx_empty(struct uart_port *port)
@@ -482,6 +482,9 @@ static irqreturn_t siu_interrupt(int irq, void *dev_id, struct pt_regs *regs)
struct uart_port *port;
uint8_t iir, lsr;
+ if (dev_id == NULL)
+ return IRQ_NONE;
+
port = (struct uart_port *)dev_id;
iir = siu_read(port, UART_IIR);
@@ -504,9 +507,6 @@ static int siu_startup(struct uart_port *port)
{
int retval;
- if (port->membase == NULL)
- return -ENODEV;
-
siu_clear_fifo(port);
(void)siu_read(port, UART_LSR);
@@ -545,6 +545,9 @@ static void siu_shutdown(struct uart_port *port)
unsigned long flags;
uint8_t lcr;
+ if (port->membase == NULL)
+ return;
+
siu_write(port, UART_IER, 0);
spin_lock_irqsave(&port->lock, flags);
@@ -799,6 +802,53 @@ static int siu_init_ports(void)
#ifdef CONFIG_SERIAL_VR41XX_CONSOLE
+static void early_set_termios(struct uart_port *port, struct termios *new,
+ struct termios *old)
+{
+ tcflag_t c_cflag;
+ uint8_t lcr;
+ unsigned int baud, quot;
+
+ c_cflag = new->c_cflag;
+ switch (c_cflag & CSIZE) {
+ case CS5:
+ lcr = UART_LCR_WLEN5;
+ break;
+ case CS6:
+ lcr = UART_LCR_WLEN6;
+ break;
+ case CS7:
+ lcr = UART_LCR_WLEN7;
+ break;
+ default:
+ lcr = UART_LCR_WLEN8;
+ break;
+ }
+
+ if (c_cflag & CSTOPB)
+ lcr |= UART_LCR_STOP;
+ if (c_cflag & PARENB)
+ lcr |= UART_LCR_PARITY;
+ if ((c_cflag & PARODD) != PARODD)
+ lcr |= UART_LCR_EPAR;
+ if (c_cflag & CMSPAR)
+ lcr |= UART_LCR_SPAR;
+
+ baud = uart_get_baud_rate(port, new, old, 0, port->uartclk/16);
+ quot = uart_get_divisor(port, baud);
+
+ siu_write(port, UART_LCR, lcr | UART_LCR_DLAB);
+
+ siu_write(port, UART_DLL, (uint8_t)quot);
+ siu_write(port, UART_DLM, (uint8_t)(quot >> 8));
+
+ siu_write(port, UART_LCR, lcr);
+}
+
+static struct uart_ops early_uart_ops = {
+ .set_termios = early_set_termios,
+};
+
#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
static void wait_for_xmitr(struct uart_port *port)
@@ -865,7 +915,7 @@ static int siu_console_setup(struct console *con, char *options)
if (port->membase == NULL) {
if (port->mapbase == 0)
return -ENODEV;
- port->membase = ioremap(port->mapbase, siu_port_size(port));
+ port->membase = (unsigned char __iomem *)KSEG1ADDR(port->mapbase);
}
vr41xx_select_siu_interface(SIU_INTERFACE_RS232C);
@@ -899,7 +949,7 @@ static int __devinit siu_console_init(void)
for (i = 0; i < num; i++) {
port = &siu_uart_ports[i];
- port->ops = &siu_uart_ops;
+ port->ops = &early_uart_ops;
}
register_console(&siu_console);
@@ -944,10 +994,8 @@ static int siu_probe(struct device *dev)
port->dev = dev;
retval = uart_add_one_port(&siu_uart_driver, port);
- if (retval < 0) {
- port->dev = NULL;
+ if (retval)
break;
- }
}
if (i == 0 && retval < 0) {
diff --git a/trunk/drivers/usb/core/sysfs.c b/trunk/drivers/usb/core/sysfs.c
index 4d0c9e65cd03..4ab50009291d 100644
--- a/trunk/drivers/usb/core/sysfs.c
+++ b/trunk/drivers/usb/core/sysfs.c
@@ -290,30 +290,32 @@ static ssize_t show_modalias(struct device *dev, char *buf)
{
struct usb_interface *intf;
struct usb_device *udev;
- int len;
intf = to_usb_interface(dev);
udev = interface_to_usbdev(intf);
+ if (udev->descriptor.bDeviceClass == 0) {
+ struct usb_host_interface *alt = intf->cur_altsetting;
- len = sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic",
+ return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02X\n",
le16_to_cpu(udev->descriptor.idVendor),
le16_to_cpu(udev->descriptor.idProduct),
le16_to_cpu(udev->descriptor.bcdDevice),
udev->descriptor.bDeviceClass,
udev->descriptor.bDeviceSubClass,
- udev->descriptor.bDeviceProtocol);
- buf += len;
-
- if (udev->descriptor.bDeviceClass == 0) {
- struct usb_host_interface *alt = intf->cur_altsetting;
-
- return len + sprintf(buf, "%02Xisc%02Xip%02X\n",
+ udev->descriptor.bDeviceProtocol,
alt->desc.bInterfaceClass,
alt->desc.bInterfaceSubClass,
alt->desc.bInterfaceProtocol);
} else {
- return len + sprintf(buf, "*isc*ip*\n");
+ return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic*isc*ip*\n",
+ le16_to_cpu(udev->descriptor.idVendor),
+ le16_to_cpu(udev->descriptor.idProduct),
+ le16_to_cpu(udev->descriptor.bcdDevice),
+ udev->descriptor.bDeviceClass,
+ udev->descriptor.bDeviceSubClass,
+ udev->descriptor.bDeviceProtocol);
}
+
}
static DEVICE_ATTR(modalias, S_IRUGO, show_modalias, NULL);
diff --git a/trunk/drivers/usb/host/Kconfig b/trunk/drivers/usb/host/Kconfig
index 19e598c9641f..3196c3265ff5 100644
--- a/trunk/drivers/usb/host/Kconfig
+++ b/trunk/drivers/usb/host/Kconfig
@@ -124,14 +124,3 @@ config USB_SL811_HCD
To compile this driver as a module, choose M here: the
module will be called sl811-hcd.
-config USB_SL811_CS
- tristate "CF/PCMCIA support for SL811HS HCD"
- depends on USB_SL811_HCD && PCMCIA
- default N
- help
- Wraps a PCMCIA driver around the SL811HS HCD, supporting the RATOC
- REX-CFU1U CF card (often used with PDAs). If unsure, say N.
-
- To compile this driver as a module, choose M here: the
- module will be called "sl811_cs".
-
diff --git a/trunk/drivers/usb/host/Makefile b/trunk/drivers/usb/host/Makefile
index 5dbd3e7a27c7..a574ca06cf6b 100644
--- a/trunk/drivers/usb/host/Makefile
+++ b/trunk/drivers/usb/host/Makefile
@@ -7,5 +7,4 @@ obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o
obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
obj-$(CONFIG_USB_SL811_HCD) += sl811-hcd.o
-obj-$(CONFIG_USB_SL811_CS) += sl811_cs.o
obj-$(CONFIG_ETRAX_ARCH_V10) += hc_crisv10.o
diff --git a/trunk/drivers/usb/host/sl811-hcd.c b/trunk/drivers/usb/host/sl811-hcd.c
index 99d43f758ad0..a374b7692073 100644
--- a/trunk/drivers/usb/host/sl811-hcd.c
+++ b/trunk/drivers/usb/host/sl811-hcd.c
@@ -2,8 +2,8 @@
* SL811HS HCD (Host Controller Driver) for USB.
*
* Copyright (C) 2004 Psion Teklogix (for NetBook PRO)
- * Copyright (C) 2004-2005 David Brownell
- *
+ * Copyright (C) 2004 David Brownell
+ *
* Periodic scheduling is based on Roman's OHCI code
* Copyright (C) 1999 Roman Weissgaerber
*
@@ -15,7 +15,7 @@
* For documentation, see the SL811HS spec and the "SL811HS Embedded Host"
* document (providing significant pieces missing from that spec); plus
* the SL811S spec if you want peripheral side info.
- */
+ */
/*
* Status: Passed basic stress testing, works with hubs, mice, keyboards,
@@ -67,7 +67,7 @@
MODULE_DESCRIPTION("SL811HS USB Host Controller Driver");
MODULE_LICENSE("GPL");
-#define DRIVER_VERSION "19 May 2005"
+#define DRIVER_VERSION "15 Dec 2004"
#ifndef DEBUG
@@ -121,10 +121,6 @@ static void port_power(struct sl811 *sl811, int is_on)
/* reset as thoroughly as we can */
if (sl811->board && sl811->board->reset)
sl811->board->reset(hcd->self.controller);
- else {
- sl811_write(sl811, SL11H_CTLREG1, SL11H_CTL1MASK_SE0);
- mdelay(20);
- }
sl811_write(sl811, SL11H_IRQ_ENABLE, 0);
sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1);
@@ -447,7 +443,6 @@ static void finish_request(
spin_lock(&urb->lock);
if (urb->status == -EINPROGRESS)
urb->status = status;
- urb->hcpriv = NULL;
spin_unlock(&urb->lock);
spin_unlock(&sl811->lock);
@@ -477,7 +472,7 @@ static void finish_request(
if (*prev)
*prev = ep->next;
sl811->load[i] -= ep->load;
- }
+ }
ep->branch = PERIODIC_SIZE;
sl811->periodic_count--;
sl811_to_hcd(sl811)->self.bandwidth_allocated
@@ -666,9 +661,9 @@ static irqreturn_t sl811h_irq(struct usb_hcd *hcd, struct pt_regs *regs)
#ifdef QUIRK2
/* this may no longer be necessary ... */
- if (irqstat == 0) {
+ if (irqstat == 0 && ret == IRQ_NONE) {
irqstat = checkdone(sl811);
- if (irqstat)
+ if (irqstat /* && irq != ~0 */ )
sl811->stat_lost++;
}
#endif
@@ -727,8 +722,7 @@ static irqreturn_t sl811h_irq(struct usb_hcd *hcd, struct pt_regs *regs)
if (sl811->active_a) {
sl811_write(sl811, SL811_EP_A(SL11H_HOSTCTLREG), 0);
finish_request(sl811, sl811->active_a,
- container_of(sl811->active_a
- ->hep->urb_list.next,
+ container_of(sl811->active_a->hep->urb_list.next,
struct urb, urb_list),
NULL, -ESHUTDOWN);
sl811->active_a = NULL;
@@ -737,8 +731,7 @@ static irqreturn_t sl811h_irq(struct usb_hcd *hcd, struct pt_regs *regs)
if (sl811->active_b) {
sl811_write(sl811, SL811_EP_B(SL11H_HOSTCTLREG), 0);
finish_request(sl811, sl811->active_b,
- container_of(sl811->active_b
- ->hep->urb_list.next,
+ container_of(sl811->active_b->hep->urb_list.next,
struct urb, urb_list),
NULL, -ESHUTDOWN);
sl811->active_b = NULL;
@@ -768,7 +761,7 @@ static irqreturn_t sl811h_irq(struct usb_hcd *hcd, struct pt_regs *regs)
goto retry;
}
- if (sl811->periodic_count == 0 && list_empty(&sl811->async))
+ if (sl811->periodic_count == 0 && list_empty(&sl811->async))
sofirq_off(sl811);
sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable);
@@ -803,7 +796,7 @@ static int balance(struct sl811 *sl811, u16 period, u16 load)
}
if (j < PERIODIC_SIZE)
continue;
- branch = i;
+ branch = i;
}
}
return branch;
@@ -897,7 +890,6 @@ static int sl811h_urb_enqueue(
break;
}
- ep->hep = hep;
hep->hcpriv = ep;
}
@@ -969,16 +961,15 @@ static int sl811h_urb_enqueue(
static int sl811h_urb_dequeue(struct usb_hcd *hcd, struct urb *urb)
{
struct sl811 *sl811 = hcd_to_sl811(hcd);
- struct usb_host_endpoint *hep;
+ struct usb_host_endpoint *hep = urb->hcpriv;
unsigned long flags;
struct sl811h_ep *ep;
int retval = 0;
- spin_lock_irqsave(&sl811->lock, flags);
- hep = urb->hcpriv;
if (!hep)
- goto fail;
+ return -EINVAL;
+ spin_lock_irqsave(&sl811->lock, flags);
ep = hep->hcpriv;
if (ep) {
/* finish right away if this urb can't be active ...
@@ -1026,7 +1017,6 @@ static int sl811h_urb_dequeue(struct usb_hcd *hcd, struct urb *urb)
VDBG("dequeue, urb %p active %s; wait4irq\n", urb,
(sl811->active_a == ep) ? "A" : "B");
} else
-fail:
retval = -EINVAL;
spin_unlock_irqrestore(&sl811->lock, flags);
return retval;
@@ -1586,9 +1576,6 @@ sl811h_start(struct usb_hcd *hcd)
if (sl811->board && sl811->board->power)
hub_set_power_budget(udev, sl811->board->power * 2);
- /* enable power and interupts */
- port_power(sl811, 1);
-
return 0;
}
@@ -1631,7 +1618,7 @@ static struct hc_driver sl811h_hc_driver = {
/*-------------------------------------------------------------------------*/
-static int __devexit
+static int __init_or_module
sl811h_remove(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
@@ -1644,20 +1631,21 @@ sl811h_remove(struct device *dev)
remove_debug_file(sl811);
usb_remove_hcd(hcd);
- /* some platforms may use IORESOURCE_IO */
+ iounmap(sl811->data_reg);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- if (res)
- iounmap(sl811->data_reg);
+ release_mem_region(res->start, 1);
+ iounmap(sl811->addr_reg);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (res)
- iounmap(sl811->addr_reg);
+ release_mem_region(res->start, 1);
usb_put_hcd(hcd);
return 0;
}
-static int __devinit
+#define resource_len(r) (((r)->end - (r)->start) + 1)
+
+static int __init
sl811h_probe(struct device *dev)
{
struct usb_hcd *hcd;
@@ -1668,7 +1656,7 @@ sl811h_probe(struct device *dev)
void __iomem *addr_reg;
void __iomem *data_reg;
int retval;
- u8 tmp, ioaddr = 0;
+ u8 tmp;
/* basic sanity checks first. board-specific init logic should
* have initialized these three resources and probably board
@@ -1676,8 +1664,13 @@ sl811h_probe(struct device *dev)
* minimal sanity checking.
*/
pdev = container_of(dev, struct platform_device, dev);
+ if (pdev->num_resources < 3)
+ return -ENODEV;
+
+ addr = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ data = platform_get_resource(pdev, IORESOURCE_MEM, 1);
irq = platform_get_irq(pdev, 0);
- if (pdev->num_resources < 3 || irq < 0)
+ if (!addr || !data || irq < 0)
return -ENODEV;
/* refuse to confuse usbcore */
@@ -1686,31 +1679,24 @@ sl811h_probe(struct device *dev)
return -EINVAL;
}
- /* the chip may be wired for either kind of addressing */
- addr = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- data = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- retval = -EBUSY;
- if (!addr || !data) {
- addr = platform_get_resource(pdev, IORESOURCE_IO, 0);
- data = platform_get_resource(pdev, IORESOURCE_IO, 1);
- if (!addr || !data)
- return -ENODEV;
- ioaddr = 1;
-
- addr_reg = (void __iomem *) addr->start;
- data_reg = (void __iomem *) data->start;
- } else {
- addr_reg = ioremap(addr->start, 1);
- if (addr_reg == NULL) {
- retval = -ENOMEM;
- goto err2;
- }
+ if (!request_mem_region(addr->start, 1, hcd_name)) {
+ retval = -EBUSY;
+ goto err1;
+ }
+ addr_reg = ioremap(addr->start, resource_len(addr));
+ if (addr_reg == NULL) {
+ retval = -ENOMEM;
+ goto err2;
+ }
- data_reg = ioremap(data->start, 1);
- if (data_reg == NULL) {
- retval = -ENOMEM;
- goto err4;
- }
+ if (!request_mem_region(data->start, 1, hcd_name)) {
+ retval = -EBUSY;
+ goto err3;
+ }
+ data_reg = ioremap(data->start, resource_len(addr));
+ if (data_reg == NULL) {
+ retval = -ENOMEM;
+ goto err4;
}
/* allocate and initialize hcd */
@@ -1751,14 +1737,12 @@ sl811h_probe(struct device *dev)
goto err6;
}
- /* The chip's IRQ is level triggered, active high. A requirement
- * for platform device setup is to cope with things like signal
- * inverters (e.g. CF is active low) or working only with edge
- * triggers (e.g. most ARM CPUs). Initial driver stress testing
- * was on a system with single edge triggering, so most sorts of
- * triggering arrangement should work.
- */
- retval = usb_add_hcd(hcd, irq, SA_INTERRUPT | SA_SHIRQ);
+ /* sl811s would need a different handler for this irq */
+#ifdef CONFIG_ARM
+ /* Cypress docs say the IRQ is IRQT_HIGH ... */
+ set_irq_type(irq, IRQT_RISING);
+#endif
+ retval = usb_add_hcd(hcd, irq, SA_INTERRUPT);
if (retval != 0)
goto err6;
@@ -1768,12 +1752,14 @@ sl811h_probe(struct device *dev)
err6:
usb_put_hcd(hcd);
err5:
- if (!ioaddr)
- iounmap(data_reg);
+ iounmap(data_reg);
err4:
- if (!ioaddr)
- iounmap(addr_reg);
+ release_mem_region(data->start, 1);
+ err3:
+ iounmap(addr_reg);
err2:
+ release_mem_region(addr->start, 1);
+ err1:
DBG("init error, %d\n", retval);
return retval;
}
@@ -1781,7 +1767,7 @@ sl811h_probe(struct device *dev)
#ifdef CONFIG_PM
/* for this device there's no useful distinction between the controller
- * and its root hub, except that the root hub only gets direct PM calls
+ * and its root hub, except that the root hub only gets direct PM calls
* when CONFIG_USB_SUSPEND is enabled.
*/
@@ -1835,22 +1821,20 @@ sl811h_resume(struct device *dev, u32 phase)
#endif
-/* this driver is exported so sl811_cs can depend on it */
-struct device_driver sl811h_driver = {
+static struct device_driver sl811h_driver = {
.name = (char *) hcd_name,
.bus = &platform_bus_type,
.probe = sl811h_probe,
- .remove = __devexit_p(sl811h_remove),
+ .remove = sl811h_remove,
.suspend = sl811h_suspend,
.resume = sl811h_resume,
};
-EXPORT_SYMBOL(sl811h_driver);
/*-------------------------------------------------------------------------*/
-
-static int __init sl811h_init(void)
+
+static int __init sl811h_init(void)
{
if (usb_disabled())
return -ENODEV;
@@ -1860,8 +1844,8 @@ static int __init sl811h_init(void)
}
module_init(sl811h_init);
-static void __exit sl811h_cleanup(void)
-{
+static void __exit sl811h_cleanup(void)
+{
driver_unregister(&sl811h_driver);
}
module_exit(sl811h_cleanup);
diff --git a/trunk/drivers/usb/host/sl811_cs.c b/trunk/drivers/usb/host/sl811_cs.c
deleted file mode 100644
index 6e173265095c..000000000000
--- a/trunk/drivers/usb/host/sl811_cs.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- * PCMCIA driver for SL811HS (as found in REX-CFU1U)
- * Filename: sl811_cs.c
- * Author: Yukio Yamamoto
- *
- * Port to sl811-hcd and 2.6.x by
- * Botond Botyanszki
- * Simon Pickering
- *
- * Last update: 2005-05-12
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-MODULE_AUTHOR("Botond Botyanszki");
-MODULE_DESCRIPTION("REX-CFU1U PCMCIA driver for 2.6");
-MODULE_LICENSE("GPL");
-
-
-/*====================================================================*/
-/* MACROS */
-/*====================================================================*/
-
-#if defined(DEBUG) || defined(CONFIG_USB_DEBUG) || defined(PCMCIA_DEBUG)
-
-static int pc_debug = 0;
-module_param(pc_debug, int, 0644);
-
-#define DBG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG "sl811_cs: " args)
-
-#else
-#define DBG(n, args...) do{}while(0)
-#endif /* no debugging */
-
-#define INFO(args...) printk(KERN_INFO "sl811_cs: " args)
-
-#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0444)
-
-#define CS_CHECK(fn, ret) \
- do { \
- last_fn = (fn); \
- if ((last_ret = (ret)) != 0) \
- goto cs_failed; \
- } while (0)
-
-/*====================================================================*/
-/* VARIABLES */
-/*====================================================================*/
-
-static const char driver_name[DEV_NAME_LEN] = "sl811_cs";
-
-static dev_link_t *dev_list = NULL;
-
-static int irq_list[4] = { -1 };
-static int irq_list_count;
-
-module_param_array(irq_list, int, &irq_list_count, 0444);
-
-INT_MODULE_PARM(irq_mask, 0xdeb8);
-
-typedef struct local_info_t {
- dev_link_t link;
- dev_node_t node;
-} local_info_t;
-
-/*====================================================================*/
-
-static void release_platform_dev(struct device * dev)
-{
- DBG(0, "sl811_cs platform_dev release\n");
- dev->parent = NULL;
-}
-
-static struct sl811_platform_data platform_data = {
- .potpg = 100,
- .power = 50, /* == 100mA */
- // .reset = ... FIXME: invoke CF reset on the card
-};
-
-static struct resource resources[] = {
- [0] = {
- .flags = IORESOURCE_IRQ,
- },
- [1] = {
- // .name = "address",
- .flags = IORESOURCE_IO,
- },
- [2] = {
- // .name = "data",
- .flags = IORESOURCE_IO,
- },
-};
-
-extern struct device_driver sl811h_driver;
-
-static struct platform_device platform_dev = {
- .id = -1,
- .dev = {
- .platform_data = &platform_data,
- .release = release_platform_dev,
- },
- .resource = resources,
- .num_resources = ARRAY_SIZE(resources),
-};
-
-static int sl811_hc_init(struct device *parent, ioaddr_t base_addr, int irq)
-{
- if (platform_dev.dev.parent)
- return -EBUSY;
- platform_dev.dev.parent = parent;
-
- /* finish seting up the platform device */
- resources[0].start = irq;
-
- resources[1].start = base_addr;
- resources[1].end = base_addr;
-
- resources[2].start = base_addr + 1;
- resources[2].end = base_addr + 1;
-
- /* The driver core will probe for us. We know sl811-hcd has been
- * initialized already because of the link order dependency.
- */
- platform_dev.name = sl811h_driver.name;
- return platform_device_register(&platform_dev);
-}
-
-/*====================================================================*/
-
-static void sl811_cs_detach(dev_link_t *link)
-{
- dev_link_t **linkp;
-
- DBG(0, "sl811_cs_detach(0x%p)\n", link);
-
- /* Locate device structure */
- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) {
- if (*linkp == link)
- break;
- }
- if (*linkp == NULL)
- return;
-
- /* Break the link with Card Services */
- if (link->handle)
- pcmcia_deregister_client(link->handle);
-
- /* Unlink device structure, and free it */
- *linkp = link->next;
- /* This points to the parent local_info_t struct */
- kfree(link->priv);
-}
-
-static void sl811_cs_release(dev_link_t * link)
-{
-
- DBG(0, "sl811_cs_release(0x%p)\n", link);
-
- if (link->open) {
- DBG(1, "sl811_cs: release postponed, '%s' still open\n",
- link->dev->dev_name);
- link->state |= DEV_STALE_CONFIG;
- return;
- }
-
- /* Unlink the device chain */
- link->dev = NULL;
-
- platform_device_unregister(&platform_dev);
- pcmcia_release_configuration(link->handle);
- if (link->io.NumPorts1)
- pcmcia_release_io(link->handle, &link->io);
- if (link->irq.AssignedIRQ)
- pcmcia_release_irq(link->handle, &link->irq);
- link->state &= ~DEV_CONFIG;
-
- if (link->state & DEV_STALE_LINK)
- sl811_cs_detach(link);
-}
-
-static void sl811_cs_config(dev_link_t *link)
-{
- client_handle_t handle = link->handle;
- struct device *parent = &handle_to_dev(handle);
- local_info_t *dev = link->priv;
- tuple_t tuple;
- cisparse_t parse;
- int last_fn, last_ret;
- u_char buf[64];
- config_info_t conf;
- cistpl_cftable_entry_t dflt = { 0 };
-
- DBG(0, "sl811_cs_config(0x%p)\n", link);
-
- tuple.DesiredTuple = CISTPL_CONFIG;
- tuple.Attributes = 0;
- tuple.TupleData = buf;
- tuple.TupleDataMax = sizeof(buf);
- tuple.TupleOffset = 0;
- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
- CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
- CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
- link->conf.ConfigBase = parse.config.base;
- link->conf.Present = parse.config.rmask[0];
-
- /* Configure card */
- link->state |= DEV_CONFIG;
-
- /* Look up the current Vcc */
- CS_CHECK(GetConfigurationInfo,
- pcmcia_get_configuration_info(handle, &conf));
- link->conf.Vcc = conf.Vcc;
-
- tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
- while (1) {
- cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
-
- if (pcmcia_get_tuple_data(handle, &tuple) != 0
- || pcmcia_parse_tuple(handle, &tuple, &parse)
- != 0)
- goto next_entry;
-
- if (cfg->flags & CISTPL_CFTABLE_DEFAULT) {
- dflt = *cfg;
- }
-
- if (cfg->index == 0)
- goto next_entry;
-
- link->conf.ConfigIndex = cfg->index;
-
- /* Use power settings for Vcc and Vpp if present */
- /* Note that the CIS values need to be rescaled */
- if (cfg->vcc.present & (1<vcc.param[CISTPL_POWER_VNOM]/10000
- != conf.Vcc)
- goto next_entry;
- } else if (dflt.vcc.present & (1<vpp1.present & (1<conf.Vpp1 = link->conf.Vpp2 =
- cfg->vpp1.param[CISTPL_POWER_VNOM]/10000;
- else if (dflt.vpp1.present & (1<conf.Vpp1 = link->conf.Vpp2 =
- dflt.vpp1.param[CISTPL_POWER_VNOM]/10000;
-
- /* we need an interrupt */
- if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
- link->conf.Attributes |= CONF_ENABLE_IRQ;
-
- /* IO window settings */
- link->io.NumPorts1 = link->io.NumPorts2 = 0;
- if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
- cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
-
- link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
- link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
- link->io.BasePort1 = io->win[0].base;
- link->io.NumPorts1 = io->win[0].len;
-
- if (pcmcia_request_io(link->handle, &link->io) != 0)
- goto next_entry;
- }
- break;
-
-next_entry:
- if (link->io.NumPorts1)
- pcmcia_release_io(link->handle, &link->io);
- last_ret = pcmcia_get_next_tuple(handle, &tuple);
- }
-
- /* require an IRQ and two registers */
- if (!link->io.NumPorts1 || link->io.NumPorts1 < 2)
- goto cs_failed;
- if (link->conf.Attributes & CONF_ENABLE_IRQ)
- CS_CHECK(RequestIRQ,
- pcmcia_request_irq(link->handle, &link->irq));
- else
- goto cs_failed;
-
- CS_CHECK(RequestConfiguration,
- pcmcia_request_configuration(link->handle, &link->conf));
-
- sprintf(dev->node.dev_name, driver_name);
- dev->node.major = dev->node.minor = 0;
- link->dev = &dev->node;
-
- printk(KERN_INFO "%s: index 0x%02x: Vcc %d.%d",
- dev->node.dev_name, link->conf.ConfigIndex,
- link->conf.Vcc/10, link->conf.Vcc%10);
- if (link->conf.Vpp1)
- printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10);
- printk(", irq %d", link->irq.AssignedIRQ);
- printk(", io 0x%04x-0x%04x", link->io.BasePort1,
- link->io.BasePort1+link->io.NumPorts1-1);
- printk("\n");
-
- link->state &= ~DEV_CONFIG_PENDING;
-
- if (sl811_hc_init(parent, link->io.BasePort1, link->irq.AssignedIRQ)
- < 0) {
-cs_failed:
- printk("sl811_cs_config failed\n");
- cs_error(link->handle, last_fn, last_ret);
- sl811_cs_release(link);
- link->state &= ~DEV_CONFIG_PENDING;
- }
-}
-
-static int
-sl811_cs_event(event_t event, int priority, event_callback_args_t *args)
-{
- dev_link_t *link = args->client_data;
-
- DBG(1, "sl811_cs_event(0x%06x)\n", event);
-
- switch (event) {
- case CS_EVENT_CARD_REMOVAL:
- link->state &= ~DEV_PRESENT;
- if (link->state & DEV_CONFIG)
- sl811_cs_release(link);
- break;
-
- case CS_EVENT_CARD_INSERTION:
- link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- sl811_cs_config(link);
- break;
-
- case CS_EVENT_PM_SUSPEND:
- link->state |= DEV_SUSPEND;
- /* Fall through... */
- case CS_EVENT_RESET_PHYSICAL:
- if (link->state & DEV_CONFIG)
- pcmcia_release_configuration(link->handle);
- break;
-
- case CS_EVENT_PM_RESUME:
- link->state &= ~DEV_SUSPEND;
- /* Fall through... */
- case CS_EVENT_CARD_RESET:
- if (link->state & DEV_CONFIG)
- pcmcia_request_configuration(link->handle, &link->conf);
- DBG(0, "reset sl811-hcd here?\n");
- break;
- }
- return 0;
-}
-
-static dev_link_t *sl811_cs_attach(void)
-{
- local_info_t *local;
- dev_link_t *link;
- client_reg_t client_reg;
- int ret, i;
-
- local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
- if (!local)
- return NULL;
- memset(local, 0, sizeof(local_info_t));
- link = &local->link;
- link->priv = local;
-
- /* Initialize */
- link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
- link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
- if (irq_list[0] == -1)
- link->irq.IRQInfo2 = irq_mask;
- else
- for (i = 0; i < irq_list_count; i++)
- link->irq.IRQInfo2 |= 1 << irq_list[i];
- link->irq.Handler = NULL;
-
- link->conf.Attributes = 0;
- link->conf.Vcc = 33;
- link->conf.IntType = INT_MEMORY_AND_IO;
-
- /* Register with Card Services */
- link->next = dev_list;
- dev_list = link;
- client_reg.dev_info = (dev_info_t *) &driver_name;
- client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
- client_reg.EventMask =
- CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
- CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
- CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
- client_reg.event_handler = &sl811_cs_event;
- client_reg.Version = 0x0210;
- client_reg.event_callback_args.client_data = link;
- ret = pcmcia_register_client(&link->handle, &client_reg);
- if (ret != CS_SUCCESS) {
- cs_error(link->handle, RegisterClient, ret);
- sl811_cs_detach(link);
- return NULL;
- }
-
- return link;
-}
-
-static struct pcmcia_driver sl811_cs_driver = {
- .owner = THIS_MODULE,
- .drv = {
- .name = (char *)driver_name,
- },
- .attach = sl811_cs_attach,
- .detach = sl811_cs_detach,
-};
-
-/*====================================================================*/
-
-static int __init init_sl811_cs(void)
-{
- return pcmcia_register_driver(&sl811_cs_driver);
-}
-module_init(init_sl811_cs);
-
-static void __exit exit_sl811_cs(void)
-{
- pcmcia_unregister_driver(&sl811_cs_driver);
-}
-module_exit(exit_sl811_cs);
diff --git a/trunk/drivers/usb/input/hid-core.c b/trunk/drivers/usb/input/hid-core.c
index 2d8bd9dcc6ed..869ff73690ac 100644
--- a/trunk/drivers/usb/input/hid-core.c
+++ b/trunk/drivers/usb/input/hid-core.c
@@ -1315,8 +1315,6 @@ void hid_init_reports(struct hid_device *hid)
#define USB_DEVICE_ID_WACOM_INTUOS2 0x0040
#define USB_DEVICE_ID_WACOM_VOLITO 0x0060
#define USB_DEVICE_ID_WACOM_PTU 0x0003
-#define USB_DEVICE_ID_WACOM_INTUOS3 0x00B0
-#define USB_DEVICE_ID_WACOM_CINTIQ 0x003F
#define USB_VENDOR_ID_KBGEAR 0x084e
#define USB_DEVICE_ID_KBGEAR_JAMSTUDIO 0x1001
@@ -1403,7 +1401,6 @@ void hid_init_reports(struct hid_device *hid)
#define USB_VENDOR_ID_DELORME 0x1163
#define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100
-#define USB_DEVICE_ID_DELORME_EM_LT20 0x0200
#define USB_VENDOR_ID_MCC 0x09db
#define USB_DEVICE_ID_MCC_PMD1024LS 0x0076
@@ -1415,12 +1412,6 @@ void hid_init_reports(struct hid_device *hid)
#define USB_VENDOR_ID_BTC 0x046e
#define USB_DEVICE_ID_BTC_KEYBOARD 0x5303
-#define USB_VENDOR_ID_VERNIER 0x08f7
-#define USB_DEVICE_ID_VERNIER_LABPRO 0x0001
-#define USB_DEVICE_ID_VERNIER_GOTEMP 0x0002
-#define USB_DEVICE_ID_VERNIER_SKIP 0x0003
-#define USB_DEVICE_ID_VERNIER_CYCLOPS 0x0004
-
/*
* Alphabetically sorted blacklist by quirk type.
@@ -1446,7 +1437,6 @@ static struct hid_blacklist {
{ USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW28, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_HIDCOM, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE, HID_QUIRK_IGNORE },
- { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_GLAB, USB_DEVICE_ID_4_PHIDGETSERVO_30, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_GLAB, USB_DEVICE_ID_1_PHIDGETSERVO_30, HID_QUIRK_IGNORE },
@@ -1466,10 +1456,6 @@ static struct hid_blacklist {
{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 300, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 400, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 500, HID_QUIRK_IGNORE },
- { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO, HID_QUIRK_IGNORE },
- { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP, HID_QUIRK_IGNORE },
- { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP, HID_QUIRK_IGNORE },
- { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_CYCLOPS, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PENPARTNER, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 1, HID_QUIRK_IGNORE },
@@ -1495,10 +1481,6 @@ static struct hid_blacklist {
{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 7, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PTU, HID_QUIRK_IGNORE },
- { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3, HID_QUIRK_IGNORE },
- { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 1, HID_QUIRK_IGNORE },
- { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 2, HID_QUIRK_IGNORE },
- { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_CINTIQ, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
diff --git a/trunk/drivers/usb/media/pwc/ChangeLog b/trunk/drivers/usb/media/pwc/ChangeLog
new file mode 100644
index 000000000000..b2eb71a9afb5
--- /dev/null
+++ b/trunk/drivers/usb/media/pwc/ChangeLog
@@ -0,0 +1,143 @@
+9.0.2
+
+* Adding #ifdef to compile PWC before and after 2.6.5
+
+9.0.1
+
+9.0
+
+
+8.12
+
+* Implement motorized pan/tilt feature for Logitech QuickCam Orbit/Spere.
+
+8.11.1
+
+* Fix for PCVC720/40, would not be able to set videomode
+* Fix for Samsung MPC models, appearantly they are based on a newer chipset
+
+8.11
+
+* 20 dev_hints (per request)
+* Hot unplugging should be better, no more dangling pointers or memory leaks
+* Added reserved Logitech webcam IDs
+* Device now remembers size & fps between close()/open()
+* Removed palette stuff altogether
+
+8.10.1
+
+* Added IDs for PCVC720K/40 and Creative Labs Webcam Pro
+
+8.10
+
+* Fixed ID for QuickCam Notebook pro
+* Added GREALSIZE ioctl() call
+* Fixed bug in case PWCX was not loaded and invalid size was set
+
+8.9
+
+* Merging with kernel 2.5.49
+* Adding IDs for QuickCam Zoom & QuickCam Notebook
+
+8.8
+
+* Fixing 'leds' parameter
+* Adding IDs for Logitech QuickCam Pro 4000
+* Making URB init/cleanup a little nicer
+
+8.7
+
+* Incorporating changes in ioctl() parameter passing
+* Also changes to URB mechanism
+
+8.6
+
+* Added ID's for Visionite VCS UM100 and UC300
+* Removed YUV420-interlaced palette altogether (was confusing)
+* Removed MIRROR stuff as it didn't work anyway
+* Fixed a problem with the 'leds' parameter (wouldn't blink)
+* Added ioctl()s for advanced features: 'extended' whitebalance ioctl()s,
+ CONTOUR, BACKLIGHT, FLICKER, DYNNOISE.
+* VIDIOCGCAP.name now contains real camera model name instead of
+ 'Philips xxx webcam'
+* Added PROBE ioctl (see previous point & API doc)
+
+8.5
+
+* Adding IDs for Creative Labs Webcam 5
+* Adding IDs for SOTEC CMS-001 webcam
+* Solving possible hang in VIDIOCSYNC when unplugging the cam
+* Forgot to return structure in VIDIOCPWCGAWB, oops
+* Time interval for the LEDs are now in milliseconds
+
+8.4
+
+* Fixing power_save option for Vesta range
+* Handling new error codes in ISOC callback
+* Adding dev_hint module parameter, to specify /dev/videoX device nodes
+
+8.3
+
+* Adding Samsung C10 and C30 cameras
+* Removing palette module parameter
+* Fixed typo in ID of QuickCam 3000 Pro
+* Adding LED settings (blinking while in use) for ToUCam cameras.
+* Turns LED off when camera is not in use.
+
+8.2
+
+* Making module more silent when trace = 0
+* Adding QuickCam 3000 Pro IDs
+* Chrominance control for the Vesta cameras
+* Hopefully fixed problems on machines with BIGMEM and > 1GB of RAM
+* Included Oliver Neukem's lock_kernel() patch
+* Allocates less memory for image buffers
+* Adds ioctl()s for the whitebalancing
+
+8.1
+
+* Adding support for 750
+* Adding V4L GAUDIO/SAUDIO/UNIT ioctl() calls
+
+8.0
+* 'damage control' after inclusion in 2.4.5.
+* Changed wait-queue mechanism in read/mmap/poll according to the book.
+* Included YUV420P palette.
+* Changed interface to decompressor module.
+* Cleaned up pwc structure a bit.
+
+7.0
+
+* Fixed bug in vcvt_420i_yuyv; extra variables on stack were misaligned.
+* There is now a clear error message when an image size is selected that
+ is only supported using the decompressor, and the decompressor isn't
+ loaded.
+* When the decompressor wasn't loaded, selecting large image size
+ would create skewed or double images.
+
+6.3
+
+* Introduced spinlocks for the buffer pointer manipulation; a number of
+ reports seem to suggest the down()/up() semaphores were the cause of
+ lockups, since they are not suitable for interrupt/user locking.
+* Separated decompressor and core code into 2 modules.
+
+6.2
+
+* Non-integral image sizes are now padded with gray or black.
+* Added SHUTTERSPEED ioctl().
+* Fixed buglet in VIDIOCPWCSAGC; the function would always return an error,
+ even though the call succeeded.
+* Added hotplug support for 2.4.*.
+* Memory: the 645/646 uses less memory now.
+
+6.1
+
+* VIDIOCSPICT returns -EINVAL with invalid palettes.
+* Added saturation control.
+* Split decompressors from rest.
+* Fixed bug that would reset the framerate to the default framerate if
+ the rate field was set to 0 (which is not what I intended, nl. do not
+ change the framerate!).
+* VIDIOCPWCSCQUAL (setting compression quality) now takes effect immediately.
+* Workaround for a bug in the 730 sensor.
diff --git a/trunk/drivers/usb/net/usbnet.c b/trunk/drivers/usb/net/usbnet.c
index 4cbb408af727..85476e76b244 100644
--- a/trunk/drivers/usb/net/usbnet.c
+++ b/trunk/drivers/usb/net/usbnet.c
@@ -2765,7 +2765,7 @@ static int blan_mdlm_bind (struct usbnet *dev, struct usb_interface *intf)
}
/* expect bcdVersion 1.0, ignore */
if (memcmp(&desc->bGUID, blan_guid, 16)
- && memcmp(&desc->bGUID, safe_guid, 16) ) {
+ && memcmp(&desc->bGUID, blan_guid, 16) ) {
/* hey, this one might _really_ be MDLM! */
dev_dbg (&intf->dev, "MDLM guid\n");
goto bad_desc;
diff --git a/trunk/drivers/usb/serial/Kconfig b/trunk/drivers/usb/serial/Kconfig
index 9438909e87a5..bc798edf0358 100644
--- a/trunk/drivers/usb/serial/Kconfig
+++ b/trunk/drivers/usb/serial/Kconfig
@@ -455,17 +455,6 @@ config USB_SERIAL_XIRCOM
To compile this driver as a module, choose M here: the
module will be called keyspan_pda.
-config USB_SERIAL_OPTION
- tristate "USB Option PCMCIA serial driver"
- depends on USB_SERIAL && USB_OHCI_HCD && PCCARD
- help
- Say Y here if you want to use an Option card. This is a
- GSM card, controlled by three serial ports which are connected
- via an OHCI adapter located on a PC card.
-
- To compile this driver as a module, choose M here: the
- module will be called option.
-
config USB_SERIAL_OMNINET
tristate "USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)"
depends on USB_SERIAL && EXPERIMENTAL
diff --git a/trunk/drivers/usb/serial/Makefile b/trunk/drivers/usb/serial/Makefile
index 6c7cdcc99a9e..d56ff6d86cce 100644
--- a/trunk/drivers/usb/serial/Makefile
+++ b/trunk/drivers/usb/serial/Makefile
@@ -32,7 +32,6 @@ obj-$(CONFIG_USB_SERIAL_KLSI) += kl5kusb105.o
obj-$(CONFIG_USB_SERIAL_KOBIL_SCT) += kobil_sct.o
obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o
obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o
-obj-$(CONFIG_USB_SERIAL_OPTION) += option.o
obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o
obj-$(CONFIG_USB_SERIAL_SAFE) += safe_serial.o
obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o
diff --git a/trunk/drivers/usb/serial/cp2101.c b/trunk/drivers/usb/serial/cp2101.c
index 4ace9964fc6b..7e9bb63eb466 100644
--- a/trunk/drivers/usb/serial/cp2101.c
+++ b/trunk/drivers/usb/serial/cp2101.c
@@ -7,14 +7,6 @@
* modify it under the terms of the GNU General Public License version
* 2 as published by the Free Software Foundation.
*
- * Support to set flow control line levels using TIOCMGET and TIOCMSET
- * thanks to Karl Hiramoto karl@hiramoto.org. RTSCTS hardware flow
- * control thanks to Munir Nassar nassarmu@real-time.com
- *
- * Outstanding Issues:
- * Buffers are not flushed when the port is opened.
- * Multiple calls to write() may fail with "Resource temporarily unavailable"
- *
*/
#include
@@ -32,7 +24,7 @@
/*
* Version Information
*/
-#define DRIVER_VERSION "v0.04"
+#define DRIVER_VERSION "v0.03"
#define DRIVER_DESC "Silicon Labs CP2101/CP2102 RS232 serial adaptor driver"
/*
@@ -43,9 +35,6 @@ static void cp2101_cleanup(struct usb_serial_port*);
static void cp2101_close(struct usb_serial_port*, struct file*);
static void cp2101_get_termios(struct usb_serial_port*);
static void cp2101_set_termios(struct usb_serial_port*, struct termios*);
-static int cp2101_tiocmget (struct usb_serial_port *, struct file *);
-static int cp2101_tiocmset (struct usb_serial_port *, struct file *,
- unsigned int, unsigned int);
static void cp2101_break_ctl(struct usb_serial_port*, int);
static int cp2101_startup (struct usb_serial *);
static void cp2101_shutdown(struct usb_serial*);
@@ -54,10 +43,9 @@ static void cp2101_shutdown(struct usb_serial*);
static int debug;
static struct usb_device_id id_table [] = {
- { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
- { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */
- { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */
- { } /* Terminating Entry */
+ {USB_DEVICE(0x10c4, 0xea60) }, /*Silicon labs factory default*/
+ {USB_DEVICE(0x10ab, 0x10c5) }, /*Siemens MC60 Cable*/
+ { } /* Terminating Entry*/
};
MODULE_DEVICE_TABLE (usb, id_table);
@@ -82,35 +70,32 @@ static struct usb_serial_device_type cp2101_device = {
.close = cp2101_close,
.break_ctl = cp2101_break_ctl,
.set_termios = cp2101_set_termios,
- .tiocmget = cp2101_tiocmget,
- .tiocmset = cp2101_tiocmset,
.attach = cp2101_startup,
.shutdown = cp2101_shutdown,
};
-/* Config request types */
+/*Config request types*/
#define REQTYPE_HOST_TO_DEVICE 0x41
#define REQTYPE_DEVICE_TO_HOST 0xc1
-/* Config SET requests. To GET, add 1 to the request number */
-#define CP2101_UART 0x00 /* Enable / Disable */
-#define CP2101_BAUDRATE 0x01 /* (BAUD_RATE_GEN_FREQ / baudrate) */
-#define CP2101_BITS 0x03 /* 0x(0)(databits)(parity)(stopbits) */
-#define CP2101_BREAK 0x05 /* On / Off */
-#define CP2101_CONTROL 0x07 /* Flow control line states */
-#define CP2101_MODEMCTL 0x13 /* Modem controls */
-#define CP2101_CONFIG_6 0x19 /* 6 bytes of config data ??? */
+/*Config SET requests. To GET, add 1 to the request number*/
+#define CP2101_UART 0x00 /*Enable / Disable*/
+#define CP2101_BAUDRATE 0x01 /*(BAUD_RATE_GEN_FREQ / baudrate)*/
+#define CP2101_BITS 0x03 /*0x(0)(data bits)(parity)(stop bits)*/
+#define CP2101_BREAK 0x05 /*On / Off*/
+#define CP2101_DTRRTS 0x07 /*101 / 202 ???*/
+#define CP2101_CONFIG_16 0x13 /*16 bytes of config data ???*/
+#define CP2101_CONFIG_6 0x19 /*6 bytes of config data ???*/
-/* CP2101_UART */
+/*CP2101_UART*/
#define UART_ENABLE 0x0001
#define UART_DISABLE 0x0000
-/* CP2101_BAUDRATE */
+/*CP2101_BAUDRATE*/
#define BAUD_RATE_GEN_FREQ 0x384000
-/* CP2101_BITS */
+/*CP2101_BITS*/
#define BITS_DATA_MASK 0X0f00
-#define BITS_DATA_5 0X0500
#define BITS_DATA_6 0X0600
#define BITS_DATA_7 0X0700
#define BITS_DATA_8 0X0800
@@ -127,137 +112,64 @@ static struct usb_serial_device_type cp2101_device = {
#define BITS_STOP_1 0x0000
#define BITS_STOP_1_5 0x0001
#define BITS_STOP_2 0x0002
-
-/* CP2101_BREAK */
#define BREAK_ON 0x0000
#define BREAK_OFF 0x0001
-/* CP2101_CONTROL */
-#define CONTROL_DTR 0x0001
-#define CONTROL_RTS 0x0002
-#define CONTROL_CTS 0x0010
-#define CONTROL_DSR 0x0020
-#define CONTROL_RING 0x0040
-#define CONTROL_DCD 0x0080
-#define CONTROL_WRITE_DTR 0x0100
-#define CONTROL_WRITE_RTS 0x0200
-/*
- * cp2101_get_config
- * Reads from the CP2101 configuration registers
- * 'size' is specified in bytes.
- * 'data' is a pointer to a pre-allocated array of integers large
- * enough to hold 'size' bytes (with 4 bytes to each integer)
- */
-static int cp2101_get_config(struct usb_serial_port* port, u8 request,
- unsigned int *data, int size)
+static int cp2101_get_config(struct usb_serial_port* port, u8 request)
{
struct usb_serial *serial = port->serial;
- u32 *buf;
- int result, i, length;
-
- /* Number of integers required to contain the array */
- length = (((size - 1) | 3) + 1)/4;
-
- buf = kmalloc (length * sizeof(u32), GFP_KERNEL);
- memset(buf, 0, length * sizeof(u32));
-
- if (!buf) {
- dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__);
- return -ENOMEM;
- }
+ unsigned char buf[4];
+ unsigned int value;
+ int result, i;
- /* For get requests, the request number must be incremented */
+ /*For get requests, the request number must be incremented*/
request++;
- /* Issue the request, attempting to read 'size' bytes */
+ /*Issue the request, attempting to read 4 bytes*/
result = usb_control_msg (serial->dev,usb_rcvctrlpipe (serial->dev, 0),
request, REQTYPE_DEVICE_TO_HOST, 0x0000,
- 0, buf, size, 300);
+ 0, buf, 4, 300);
- /* Convert data into an array of integers */
- for (i=0; idev, "%s - Unable to send config request, "
- "request=0x%x size=%d result=%d\n",
- __FUNCTION__, request, size, result);
- return -EPROTO;
+ "request=0x%x result=%d\n",
+ __FUNCTION__, request, result);
+ return result;
}
- return 0;
+ /*Assemble each byte read into an integer value*/
+ value = 0;
+ for (i=0; i<4 && iserial;
- u32 *buf;
- int result, i, length;
-
- /* Number of integers required to contain the array */
- length = (((size - 1) | 3) + 1)/4;
-
- buf = kmalloc(length * sizeof(u32), GFP_KERNEL);
- if (!buf) {
- dev_err(&port->dev, "%s - out of memory.\n",
- __FUNCTION__);
- return -ENOMEM;
- }
+ int result;
+ result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0),
+ request, REQTYPE_HOST_TO_DEVICE, value,
+ 0, NULL, 0, 300);
- /* Array of integers into bytes */
- for (i = 0; i < length; i++)
- buf[i] = cpu_to_le32(data[i]);
-
- if (size > 2) {
- result = usb_control_msg (serial->dev,
- usb_sndctrlpipe(serial->dev, 0),
- request, REQTYPE_HOST_TO_DEVICE, 0x0000,
- 0, buf, size, 300);
- } else {
- result = usb_control_msg (serial->dev,
- usb_sndctrlpipe(serial->dev, 0),
- request, REQTYPE_HOST_TO_DEVICE, data[0],
- 0, NULL, 0, 300);
+ if (result <0) {
+ dev_err(&port->dev, "%s - Unable to send config request, "
+ "request=0x%x value=0x%x result=%d\n",
+ __FUNCTION__, request, value, result);
+ return result;
}
- kfree(buf);
-
- if ((size > 2 && result != size) || result < 0) {
- dev_err(&port->dev, "%s - Unable to send request, "
- "request=0x%x size=%d result=%d\n",
- __FUNCTION__, request, size, result);
- return -EPROTO;
- }
+ dbg(" %s - request=0x%x value=0x%x result=%d",
+ __FUNCTION__, request, value, result);
- /* Single data value */
- result = usb_control_msg (serial->dev,
- usb_sndctrlpipe(serial->dev, 0),
- request, REQTYPE_HOST_TO_DEVICE, data[0],
- 0, NULL, 0, 300);
return 0;
}
-/*
- * cp2101_set_config_single
- * Convenience function for calling cp2101_set_config on single data values
- * without requiring an integer pointer
- */
-static inline int cp2101_set_config_single(struct usb_serial_port* port,
- u8 request, unsigned int data)
-{
- return cp2101_set_config(port, request, &data, 2);
-}
-
static int cp2101_open (struct usb_serial_port *port, struct file *filp)
{
struct usb_serial *serial = port->serial;
@@ -265,7 +177,7 @@ static int cp2101_open (struct usb_serial_port *port, struct file *filp)
dbg("%s - port %d", __FUNCTION__, port->number);
- if (cp2101_set_config_single(port, CP2101_UART, UART_ENABLE)) {
+ if (cp2101_set_config(port, CP2101_UART, UART_ENABLE)) {
dev_err(&port->dev, "%s - Unable to enable UART\n",
__FUNCTION__);
return -EPROTO;
@@ -286,12 +198,9 @@ static int cp2101_open (struct usb_serial_port *port, struct file *filp)
return result;
}
- /* Configure the termios structure */
+ /*Configure the termios structure*/
cp2101_get_termios(port);
- /* Set the DTR and RTS pins low */
- cp2101_tiocmset(port, NULL, TIOCM_DTR | TIOCM_RTS, 0);
-
return 0;
}
@@ -319,18 +228,16 @@ static void cp2101_close (struct usb_serial_port *port, struct file * filp)
usb_kill_urb(port->write_urb);
usb_kill_urb(port->read_urb);
- cp2101_set_config_single(port, CP2101_UART, UART_DISABLE);
+ cp2101_set_config(port, CP2101_UART, UART_DISABLE);
}
-/*
- * cp2101_get_termios
- * Reads the baud rate, data bits, parity, stop bits and flow control mode
- * from the device, corrects any unsupported values, and configures the
- * termios structure to reflect the state of the device
- */
+/* cp2101_get_termios*/
+/* Reads the baud rate, data bits, parity and stop bits from the device*/
+/* Corrects any unsupported values*/
+/* Configures the termios structure to reflect the state of the device*/
static void cp2101_get_termios (struct usb_serial_port *port)
{
- unsigned int cflag, modem_ctl[4];
+ unsigned int cflag;
int baud;
int bits;
@@ -342,16 +249,15 @@ static void cp2101_get_termios (struct usb_serial_port *port)
}
cflag = port->tty->termios->c_cflag;
- cp2101_get_config(port, CP2101_BAUDRATE, &baud, 2);
- /* Convert to baudrate */
+ baud = cp2101_get_config(port, CP2101_BAUDRATE);
+ /*Convert to baudrate*/
if (baud)
baud = BAUD_RATE_GEN_FREQ / baud;
dbg("%s - baud rate = %d", __FUNCTION__, baud);
cflag &= ~CBAUD;
switch (baud) {
- /*
- * The baud rates which are commented out below
+ /* The baud rates which are commented out below
* appear to be supported by the device
* but are non-standard
*/
@@ -378,18 +284,14 @@ static void cp2101_get_termios (struct usb_serial_port *port)
dbg("%s - Baud rate is not supported, "
"using 9600 baud", __FUNCTION__);
cflag |= B9600;
- cp2101_set_config_single(port, CP2101_BAUDRATE,
+ cp2101_set_config(port, CP2101_BAUDRATE,
(BAUD_RATE_GEN_FREQ/9600));
break;
}
- cp2101_get_config(port, CP2101_BITS, &bits, 2);
+ bits = cp2101_get_config(port, CP2101_BITS);
cflag &= ~CSIZE;
switch(bits & BITS_DATA_MASK) {
- case BITS_DATA_5:
- dbg("%s - data bits = 5", __FUNCTION__);
- cflag |= CS5;
- break;
case BITS_DATA_6:
dbg("%s - data bits = 6", __FUNCTION__);
cflag |= CS6;
@@ -408,7 +310,7 @@ static void cp2101_get_termios (struct usb_serial_port *port)
cflag |= CS8;
bits &= ~BITS_DATA_MASK;
bits |= BITS_DATA_8;
- cp2101_set_config(port, CP2101_BITS, &bits, 2);
+ cp2101_set_config(port, CP2101_BITS, bits);
break;
default:
dbg("%s - Unknown number of data bits, "
@@ -416,7 +318,7 @@ static void cp2101_get_termios (struct usb_serial_port *port)
cflag |= CS8;
bits &= ~BITS_DATA_MASK;
bits |= BITS_DATA_8;
- cp2101_set_config(port, CP2101_BITS, &bits, 2);
+ cp2101_set_config(port, CP2101_BITS, bits);
break;
}
@@ -439,21 +341,21 @@ static void cp2101_get_termios (struct usb_serial_port *port)
"disabling parity)", __FUNCTION__);
cflag &= ~PARENB;
bits &= ~BITS_PARITY_MASK;
- cp2101_set_config(port, CP2101_BITS, &bits, 2);
+ cp2101_set_config(port, CP2101_BITS, bits);
break;
case BITS_PARITY_SPACE:
dbg("%s - parity = SPACE (not supported, "
"disabling parity)", __FUNCTION__);
cflag &= ~PARENB;
bits &= ~BITS_PARITY_MASK;
- cp2101_set_config(port, CP2101_BITS, &bits, 2);
+ cp2101_set_config(port, CP2101_BITS, bits);
break;
default:
dbg("%s - Unknown parity mode, "
"disabling parity", __FUNCTION__);
cflag &= ~PARENB;
bits &= ~BITS_PARITY_MASK;
- cp2101_set_config(port, CP2101_BITS, &bits, 2);
+ cp2101_set_config(port, CP2101_BITS, bits);
break;
}
@@ -464,9 +366,9 @@ static void cp2101_get_termios (struct usb_serial_port *port)
break;
case BITS_STOP_1_5:
dbg("%s - stop bits = 1.5 (not supported, "
- "using 1 stop bit)", __FUNCTION__);
+ "using 1 stop bit", __FUNCTION__);
bits &= ~BITS_STOP_MASK;
- cp2101_set_config(port, CP2101_BITS, &bits, 2);
+ cp2101_set_config(port, CP2101_BITS, bits);
break;
case BITS_STOP_2:
dbg("%s - stop bits = 2", __FUNCTION__);
@@ -476,19 +378,10 @@ static void cp2101_get_termios (struct usb_serial_port *port)
dbg("%s - Unknown number of stop bits, "
"using 1 stop bit", __FUNCTION__);
bits &= ~BITS_STOP_MASK;
- cp2101_set_config(port, CP2101_BITS, &bits, 2);
+ cp2101_set_config(port, CP2101_BITS, bits);
break;
}
- cp2101_get_config(port, CP2101_MODEMCTL, modem_ctl, 16);
- if (modem_ctl[0] & 0x0008) {
- dbg("%s - flow control = CRTSCTS", __FUNCTION__);
- cflag |= CRTSCTS;
- } else {
- dbg("%s - flow control = NONE", __FUNCTION__);
- cflag &= ~CRTSCTS;
- }
-
port->tty->termios->c_cflag = cflag;
}
@@ -496,8 +389,8 @@ static void cp2101_set_termios (struct usb_serial_port *port,
struct termios *old_termios)
{
unsigned int cflag, old_cflag=0;
- int baud=0, bits;
- unsigned int modem_ctl[4];
+ int baud=0;
+ int bits;
dbg("%s - port %d", __FUNCTION__, port->number);
@@ -507,7 +400,7 @@ static void cp2101_set_termios (struct usb_serial_port *port,
}
cflag = port->tty->termios->c_cflag;
- /* Check that they really want us to change something */
+ /* check that they really want us to change something */
if (old_termios) {
if ((cflag == old_termios->c_cflag) &&
(RELEVANT_IFLAG(port->tty->termios->c_iflag)
@@ -522,8 +415,7 @@ static void cp2101_set_termios (struct usb_serial_port *port,
/* If the baud rate is to be updated*/
if ((cflag & CBAUD) != (old_cflag & CBAUD)) {
switch (cflag & CBAUD) {
- /*
- * The baud rates which are commented out below
+ /* The baud rates which are commented out below
* appear to be supported by the device
* but are non-standard
*/
@@ -556,22 +448,18 @@ static void cp2101_set_termios (struct usb_serial_port *port,
if (baud) {
dbg("%s - Setting baud rate to %d baud", __FUNCTION__,
baud);
- if (cp2101_set_config_single(port, CP2101_BAUDRATE,
+ if (cp2101_set_config(port, CP2101_BAUDRATE,
(BAUD_RATE_GEN_FREQ / baud)))
dev_err(&port->dev, "Baud rate requested not "
"supported by device\n");
}
}
- /* If the number of data bits is to be updated */
+ /*If the number of data bits is to be updated*/
if ((cflag & CSIZE) != (old_cflag & CSIZE)) {
- cp2101_get_config(port, CP2101_BITS, &bits, 2);
+ bits = cp2101_get_config(port, CP2101_BITS);
bits &= ~BITS_DATA_MASK;
switch (cflag & CSIZE) {
- case CS5:
- bits |= BITS_DATA_5;
- dbg("%s - data bits = 5", __FUNCTION__);
- break;
case CS6:
bits |= BITS_DATA_6;
dbg("%s - data bits = 6", __FUNCTION__);
@@ -595,13 +483,13 @@ static void cp2101_set_termios (struct usb_serial_port *port,
bits |= BITS_DATA_8;
break;
}
- if (cp2101_set_config(port, CP2101_BITS, &bits, 2))
+ if (cp2101_set_config(port, CP2101_BITS, bits))
dev_err(&port->dev, "Number of data bits requested "
"not supported by device\n");
}
if ((cflag & (PARENB|PARODD)) != (old_cflag & (PARENB|PARODD))) {
- cp2101_get_config(port, CP2101_BITS, &bits, 2);
+ bits = cp2101_get_config(port, CP2101_BITS);
bits &= ~BITS_PARITY_MASK;
if (cflag & PARENB) {
if (cflag & PARODD) {
@@ -612,13 +500,13 @@ static void cp2101_set_termios (struct usb_serial_port *port,
dbg("%s - parity = EVEN", __FUNCTION__);
}
}
- if (cp2101_set_config(port, CP2101_BITS, &bits, 2))
+ if (cp2101_set_config(port, CP2101_BITS, bits))
dev_err(&port->dev, "Parity mode not supported "
"by device\n");
}
if ((cflag & CSTOPB) != (old_cflag & CSTOPB)) {
- cp2101_get_config(port, CP2101_BITS, &bits, 2);
+ bits = cp2101_get_config(port, CP2101_BITS);
bits &= ~BITS_STOP_MASK;
if (cflag & CSTOPB) {
bits |= BITS_STOP_2;
@@ -627,90 +515,15 @@ static void cp2101_set_termios (struct usb_serial_port *port,
bits |= BITS_STOP_1;
dbg("%s - stop bits = 1", __FUNCTION__);
}
- if (cp2101_set_config(port, CP2101_BITS, &bits, 2))
+ if (cp2101_set_config(port, CP2101_BITS, bits))
dev_err(&port->dev, "Number of stop bits requested "
"not supported by device\n");
}
-
- if ((cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
- cp2101_get_config(port, CP2101_MODEMCTL, modem_ctl, 16);
- dbg("%s - read modem controls = 0x%.4x 0x%.4x 0x%.4x 0x%.4x",
- __FUNCTION__, modem_ctl[0], modem_ctl[1],
- modem_ctl[2], modem_ctl[3]);
-
- if (cflag & CRTSCTS) {
- modem_ctl[0] &= ~0x7B;
- modem_ctl[0] |= 0x09;
- modem_ctl[1] = 0x80;
- dbg("%s - flow control = CRTSCTS", __FUNCTION__);
- } else {
- modem_ctl[0] &= ~0x7B;
- modem_ctl[0] |= 0x01;
- modem_ctl[1] |= 0x40;
- dbg("%s - flow control = NONE", __FUNCTION__);
- }
-
- dbg("%s - write modem controls = 0x%.4x 0x%.4x 0x%.4x 0x%.4x",
- __FUNCTION__, modem_ctl[0], modem_ctl[1],
- modem_ctl[2], modem_ctl[3]);
- cp2101_set_config(port, CP2101_MODEMCTL, modem_ctl, 16);
- }
-
-}
-
-static int cp2101_tiocmset (struct usb_serial_port *port, struct file *file,
- unsigned int set, unsigned int clear)
-{
- int control = 0;
-
- dbg("%s - port %d", __FUNCTION__, port->number);
-
- if (set & TIOCM_RTS) {
- control |= CONTROL_RTS;
- control |= CONTROL_WRITE_RTS;
- }
- if (set & TIOCM_DTR) {
- control |= CONTROL_DTR;
- control |= CONTROL_WRITE_DTR;
- }
- if (clear & TIOCM_RTS) {
- control &= ~CONTROL_RTS;
- control |= CONTROL_WRITE_RTS;
- }
- if (clear & TIOCM_DTR) {
- control &= ~CONTROL_DTR;
- control |= CONTROL_WRITE_DTR;
- }
-
- dbg("%s - control = 0x%.4x", __FUNCTION__, control);
-
- return cp2101_set_config(port, CP2101_CONTROL, &control, 2);
-
-}
-
-static int cp2101_tiocmget (struct usb_serial_port *port, struct file *file)
-{
- int control, result;
-
- dbg("%s - port %d", __FUNCTION__, port->number);
-
- cp2101_get_config(port, CP2101_CONTROL, &control, 1);
-
- result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0)
- |((control & CONTROL_RTS) ? TIOCM_RTS : 0)
- |((control & CONTROL_CTS) ? TIOCM_CTS : 0)
- |((control & CONTROL_DSR) ? TIOCM_DSR : 0)
- |((control & CONTROL_RING)? TIOCM_RI : 0)
- |((control & CONTROL_DCD) ? TIOCM_CD : 0);
-
- dbg("%s - control = 0x%.2x", __FUNCTION__, control);
-
- return result;
}
static void cp2101_break_ctl (struct usb_serial_port *port, int break_state)
{
- int state;
+ u16 state;
dbg("%s - port %d", __FUNCTION__, port->number);
if (break_state == 0)
@@ -719,12 +532,12 @@ static void cp2101_break_ctl (struct usb_serial_port *port, int break_state)
state = BREAK_ON;
dbg("%s - turning break %s", __FUNCTION__,
state==BREAK_OFF ? "off" : "on");
- cp2101_set_config(port, CP2101_BREAK, &state, 2);
+ cp2101_set_config(port, CP2101_BREAK, state);
}
static int cp2101_startup (struct usb_serial *serial)
{
- /* CP2101 buffers behave strangely unless device is reset */
+ /*CP2101 buffers behave strangely unless device is reset*/
usb_reset_device(serial->dev);
return 0;
}
@@ -735,7 +548,7 @@ static void cp2101_shutdown (struct usb_serial *serial)
dbg("%s", __FUNCTION__);
- /* Stop reads and writes on all ports */
+ /* stop reads and writes on all ports */
for (i=0; i < serial->num_ports; ++i) {
cp2101_cleanup(serial->port[i]);
}
@@ -747,16 +560,16 @@ static int __init cp2101_init (void)
retval = usb_serial_register(&cp2101_device);
if (retval)
- return retval; /* Failed to register */
+ return retval; /*Failed to register*/
retval = usb_register(&cp2101_driver);
if (retval) {
- /* Failed to register */
+ /*Failed to register*/
usb_serial_deregister(&cp2101_device);
return retval;
}
- /* Success */
+ /*Success*/
info(DRIVER_DESC " " DRIVER_VERSION);
return 0;
}
diff --git a/trunk/drivers/usb/serial/ftdi_sio.c b/trunk/drivers/usb/serial/ftdi_sio.c
index 3bfcc7b9f861..52394f08a947 100644
--- a/trunk/drivers/usb/serial/ftdi_sio.c
+++ b/trunk/drivers/usb/serial/ftdi_sio.c
@@ -264,7 +264,7 @@
/*
* Version Information
*/
-#define DRIVER_VERSION "v1.4.2"
+#define DRIVER_VERSION "v1.4.1"
#define DRIVER_AUTHOR "Greg Kroah-Hartman , Bill Ryder , Kuba Ober "
#define DRIVER_DESC "USB FTDI Serial Converters Driver"
@@ -364,7 +364,6 @@ static struct usb_device_id id_table_8U232AM [] = {
{ USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_3, 0, 0x3ff) },
{ USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_4, 0, 0x3ff) },
{ USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UO100_PID, 0, 0x3ff) },
- { USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UM100_PID, 0, 0x3ff) },
{ USB_DEVICE_VER(FTDI_VID, INSIDE_ACCESSO, 0, 0x3ff) },
{ USB_DEVICE_VER(INTREPID_VID, INTREPID_VALUECAN_PID, 0, 0x3ff) },
{ USB_DEVICE_VER(INTREPID_VID, INTREPID_NEOVI_PID, 0, 0x3ff) },
@@ -476,7 +475,6 @@ static struct usb_device_id id_table_FT232BM [] = {
{ USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88E_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88F_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UO100_PID, 0x400, 0xffff) },
- { USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UM100_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(FTDI_VID, LINX_SDMUSBQSS_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(FTDI_VID, LINX_MASTERDEVEL2_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_0_PID, 0x400, 0xffff) },
@@ -620,7 +618,6 @@ static struct usb_device_id id_table_combined [] = {
{ USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88E_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88F_PID, 0x400, 0xffff) },
{ USB_DEVICE(FTDI_VID, FTDI_ELV_UO100_PID) },
- { USB_DEVICE(FTDI_VID, FTDI_ELV_UM100_PID) },
{ USB_DEVICE_VER(FTDI_VID, LINX_SDMUSBQSS_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(FTDI_VID, LINX_MASTERDEVEL2_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_0_PID, 0x400, 0xffff) },
@@ -687,8 +684,6 @@ struct ftdi_private {
char prev_status, diff_status; /* Used for TIOCMIWAIT */
__u8 rx_flags; /* receive state flags (throttling) */
spinlock_t rx_lock; /* spinlock for receive state */
- struct work_struct rx_work;
- int rx_processed;
__u16 interface; /* FT2232C port interface (0 for FT232/245) */
@@ -719,7 +714,7 @@ static int ftdi_write_room (struct usb_serial_port *port);
static int ftdi_chars_in_buffer (struct usb_serial_port *port);
static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs);
static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs);
-static void ftdi_process_read (void *param);
+static void ftdi_process_read (struct usb_serial_port *port);
static void ftdi_set_termios (struct usb_serial_port *port, struct termios * old);
static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file);
static int ftdi_tiocmset (struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear);
@@ -1389,8 +1384,6 @@ static int ftdi_common_startup (struct usb_serial *serial)
port->read_urb->transfer_buffer_length = BUFSZ;
}
- INIT_WORK(&priv->rx_work, ftdi_process_read, port);
-
/* Free port's existing write urb and transfer buffer. */
if (port->write_urb) {
usb_free_urb (port->write_urb);
@@ -1621,7 +1614,6 @@ static int ftdi_open (struct usb_serial_port *port, struct file *filp)
spin_unlock_irqrestore(&priv->rx_lock, flags);
/* Start reading from the device */
- priv->rx_processed = 0;
usb_fill_bulk_urb(port->read_urb, dev,
usb_rcvbulkpipe(dev, port->bulk_in_endpointAddress),
port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
@@ -1672,10 +1664,6 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp)
err("Error from RTS LOW urb");
}
} /* Note change no line if hupcl is off */
-
- /* cancel any scheduled reading */
- cancel_delayed_work(&priv->rx_work);
- flush_scheduled_work();
/* shutdown our bulk read */
if (port->read_urb)
@@ -1871,14 +1859,23 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
return;
}
+ /* If throttled, delay receive processing until unthrottled. */
+ spin_lock(&priv->rx_lock);
+ if (priv->rx_flags & THROTTLED) {
+ dbg("Deferring read urb processing until unthrottled");
+ priv->rx_flags |= ACTUALLY_THROTTLED;
+ spin_unlock(&priv->rx_lock);
+ return;
+ }
+ spin_unlock(&priv->rx_lock);
+
ftdi_process_read(port);
} /* ftdi_read_bulk_callback */
-static void ftdi_process_read (void *param)
+static void ftdi_process_read (struct usb_serial_port *port)
{ /* ftdi_process_read */
- struct usb_serial_port *port = (struct usb_serial_port*)param;
struct urb *urb;
struct tty_struct *tty;
struct ftdi_private *priv;
@@ -1889,7 +1886,6 @@ static void ftdi_process_read (void *param)
int result;
int need_flip;
int packet_offset;
- unsigned long flags;
dbg("%s - port %d", __FUNCTION__, port->number);
@@ -1916,18 +1912,12 @@ static void ftdi_process_read (void *param)
data = urb->transfer_buffer;
- if (priv->rx_processed) {
- dbg("%s - already processed: %d bytes, %d remain", __FUNCTION__,
- priv->rx_processed,
- urb->actual_length - priv->rx_processed);
+ /* The first two bytes of every read packet are status */
+ if (urb->actual_length > 2) {
+ usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
} else {
- /* The first two bytes of every read packet are status */
- if (urb->actual_length > 2) {
- usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
- } else {
- dbg("Status only: %03oo %03oo",data[0],data[1]);
- }
- }
+ dbg("Status only: %03oo %03oo",data[0],data[1]);
+ }
/* TO DO -- check for hung up line and handle appropriately: */
@@ -1936,12 +1926,8 @@ static void ftdi_process_read (void *param)
/* if CD is dropped and the line is not CLOCAL then we should hangup */
need_flip = 0;
- for (packet_offset = priv->rx_processed; packet_offset < urb->actual_length; packet_offset += PKTSZ) {
- int length;
-
+ for (packet_offset=0; packet_offset < urb->actual_length; packet_offset += PKTSZ) {
/* Compare new line status to the old one, signal if different */
- /* N.B. packet may be processed more than once, but differences
- * are only processed once. */
if (priv != NULL) {
char new_status = data[packet_offset+0] & FTDI_STATUS_B0_MASK;
if (new_status != priv->prev_status) {
@@ -1951,35 +1937,6 @@ static void ftdi_process_read (void *param)
}
}
- length = min(PKTSZ, urb->actual_length-packet_offset)-2;
- if (length < 0) {
- err("%s - bad packet length: %d", __FUNCTION__, length+2);
- length = 0;
- }
-
- /* have to make sure we don't overflow the buffer
- with tty_insert_flip_char's */
- if (tty->flip.count+length > TTY_FLIPBUF_SIZE) {
- tty_flip_buffer_push(tty);
- need_flip = 0;
-
- if (tty->flip.count != 0) {
- /* flip didn't work, this happens when ftdi_process_read() is
- * called from ftdi_unthrottle, because TTY_DONT_FLIP is set */
- dbg("%s - flip buffer push failed", __FUNCTION__);
- break;
- }
- }
- if (priv->rx_flags & THROTTLED) {
- dbg("%s - throttled", __FUNCTION__);
- break;
- }
- if (tty->ldisc.receive_room(tty)-tty->flip.count < length) {
- /* break out & wait for throttling/unthrottling to happen */
- dbg("%s - receive room low", __FUNCTION__);
- break;
- }
-
/* Handle errors and break */
error_flag = TTY_NORMAL;
/* Although the device uses a bitmask and hence can have multiple */
@@ -2002,8 +1959,13 @@ static void ftdi_process_read (void *param)
error_flag = TTY_FRAME;
dbg("FRAMING error");
}
- if (length > 0) {
- for (i = 2; i < length+2; i++) {
+ if (urb->actual_length > packet_offset + 2) {
+ for (i = 2; (i < PKTSZ) && ((i+packet_offset) < urb->actual_length); ++i) {
+ /* have to make sure we don't overflow the buffer
+ with tty_insert_flip_char's */
+ if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
+ tty_flip_buffer_push(tty);
+ }
/* Note that the error flag is duplicated for
every character received since we don't know
which character it applied to */
@@ -2040,35 +2002,6 @@ static void ftdi_process_read (void *param)
tty_flip_buffer_push(tty);
}
- if (packet_offset < urb->actual_length) {
- /* not completely processed - record progress */
- priv->rx_processed = packet_offset;
- dbg("%s - incomplete, %d bytes processed, %d remain",
- __FUNCTION__, packet_offset,
- urb->actual_length - packet_offset);
- /* check if we were throttled while processing */
- spin_lock_irqsave(&priv->rx_lock, flags);
- if (priv->rx_flags & THROTTLED) {
- priv->rx_flags |= ACTUALLY_THROTTLED;
- spin_unlock_irqrestore(&priv->rx_lock, flags);
- dbg("%s - deferring remainder until unthrottled",
- __FUNCTION__);
- return;
- }
- spin_unlock_irqrestore(&priv->rx_lock, flags);
- /* if the port is closed stop trying to read */
- if (port->open_count > 0){
- /* delay processing of remainder */
- schedule_delayed_work(&priv->rx_work, 1);
- } else {
- dbg("%s - port is closed", __FUNCTION__);
- }
- return;
- }
-
- /* urb is completely processed */
- priv->rx_processed = 0;
-
/* if the port is closed stop trying to read */
if (port->open_count > 0){
/* Continue trying to always read */
@@ -2508,7 +2441,7 @@ static void ftdi_unthrottle (struct usb_serial_port *port)
spin_unlock_irqrestore(&priv->rx_lock, flags);
if (actually_throttled)
- schedule_work(&priv->rx_work);
+ ftdi_process_read(port);
}
static int __init ftdi_init (void)
diff --git a/trunk/drivers/usb/serial/ftdi_sio.h b/trunk/drivers/usb/serial/ftdi_sio.h
index 8866376823a5..a52bb13a9ce4 100644
--- a/trunk/drivers/usb/serial/ftdi_sio.h
+++ b/trunk/drivers/usb/serial/ftdi_sio.h
@@ -144,8 +144,6 @@
/* ELV USB Module UO100 (PID sent by Stefan Frings) */
#define FTDI_ELV_UO100_PID 0xFB58 /* Product Id */
-/* ELV USB Module UM100 (PID sent by Arnim Laeuger) */
-#define FTDI_ELV_UM100_PID 0xFB5A /* Product Id */
/*
* Definitions for ID TECH (www.idt-net.com) devices
diff --git a/trunk/drivers/usb/serial/option.c b/trunk/drivers/usb/serial/option.c
deleted file mode 100644
index b722175f108f..000000000000
--- a/trunk/drivers/usb/serial/option.c
+++ /dev/null
@@ -1,729 +0,0 @@
-/*
- Option Card (PCMCIA to) USB to Serial Driver
-
- Copyright (C) 2005 Matthias Urlichs
-
- This driver is free software; you can redistribute it and/or modify
- it under the terms of Version 2 of the GNU General Public License as
- published by the Free Software Foundation.
-
- Portions copied from the Keyspan driver by Hugh Blemings
-
- History:
-
- 2005-05-19 v0.1 Initial version, based on incomplete docs
- and analysis of misbehavior of the standard driver
- 2005-05-20 v0.2 Extended the input buffer to avoid losing
- random 64-byte chunks of data
- 2005-05-21 v0.3 implemented chars_in_buffer()
- turned on low_latency
- simplified the code somewhat
-*/
-#define DRIVER_VERSION "v0.3"
-#define DRIVER_AUTHOR "Matthias Urlichs "
-#define DRIVER_DESC "Option Card (PC-Card to) USB to Serial Driver"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "usb-serial.h"
-
-/* Function prototypes */
-static int option_open (struct usb_serial_port *port, struct file *filp);
-static void option_close (struct usb_serial_port *port, struct file *filp);
-static int option_startup (struct usb_serial *serial);
-static void option_shutdown (struct usb_serial *serial);
-static void option_rx_throttle (struct usb_serial_port *port);
-static void option_rx_unthrottle (struct usb_serial_port *port);
-static int option_write_room (struct usb_serial_port *port);
-
-static void option_instat_callback(struct urb *urb, struct pt_regs *regs);
-
-
-static int option_write (struct usb_serial_port *port,
- const unsigned char *buf, int count);
-
-static int option_chars_in_buffer (struct usb_serial_port *port);
-static int option_ioctl (struct usb_serial_port *port, struct file *file,
- unsigned int cmd, unsigned long arg);
-static void option_set_termios (struct usb_serial_port *port,
- struct termios *old);
-static void option_break_ctl (struct usb_serial_port *port, int break_state);
-static int option_tiocmget (struct usb_serial_port *port, struct file *file);
-static int option_tiocmset (struct usb_serial_port *port, struct file *file,
- unsigned int set, unsigned int clear);
-static int option_send_setup (struct usb_serial_port *port);
-
-/* Vendor and product IDs */
-#define OPTION_VENDOR_ID 0x0AF0
-
-#define OPTION_PRODUCT_OLD 0x5000
-#define OPTION_PRODUCT_WLAN 0x6000
-
-static struct usb_device_id option_ids[] = {
- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) },
- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_WLAN) },
- { } /* Terminating entry */
-};
-
-MODULE_DEVICE_TABLE(usb, option_ids);
-
-static struct usb_driver option_driver = {
- .owner = THIS_MODULE,
- .name = "option",
- .probe = usb_serial_probe,
- .disconnect = usb_serial_disconnect,
- .id_table = option_ids,
-};
-
-/* The card has three separate interfaces, wich the serial driver
- * recognizes separately, thus num_port=1.
- */
-static struct usb_serial_device_type option_3port_device = {
- .owner = THIS_MODULE,
- .name = "Option 3-port card",
- .short_name = "option",
- .id_table = option_ids,
- .num_interrupt_in = NUM_DONT_CARE,
- .num_bulk_in = NUM_DONT_CARE,
- .num_bulk_out = NUM_DONT_CARE,
- .num_ports = 1, /* 3 */
- .open = option_open,
- .close = option_close,
- .write = option_write,
- .write_room = option_write_room,
- .chars_in_buffer = option_chars_in_buffer,
- .throttle = option_rx_throttle,
- .unthrottle = option_rx_unthrottle,
- .ioctl = option_ioctl,
- .set_termios = option_set_termios,
- .break_ctl = option_break_ctl,
- .tiocmget = option_tiocmget,
- .tiocmset = option_tiocmset,
- .attach = option_startup,
- .shutdown = option_shutdown,
- .read_int_callback = option_instat_callback,
-};
-
-static int debug;
-
-/* per port private data */
-
-#define N_IN_URB 4
-#define N_OUT_URB 1
-#define IN_BUFLEN 1024
-#define OUT_BUFLEN 1024
-
-struct option_port_private {
- /* Input endpoints and buffer for this port */
- struct urb *in_urbs[N_IN_URB];
- char in_buffer[N_IN_URB][IN_BUFLEN];
- /* Output endpoints and buffer for this port */
- struct urb *out_urbs[N_OUT_URB];
- char out_buffer[N_OUT_URB][OUT_BUFLEN];
-
- /* Settings for the port */
- int rts_state; /* Handshaking pins (outputs) */
- int dtr_state;
- int cts_state; /* Handshaking pins (inputs) */
- int dsr_state;
- int dcd_state;
- int ri_state;
- // int break_on;
-
- unsigned long tx_start_time[N_OUT_URB];
-};
-
-
-/* Functions used by new usb-serial code. */
-static int __init
-option_init (void)
-{
- int retval;
- retval = usb_serial_register(&option_3port_device);
- if (retval)
- goto failed_3port_device_register;
- retval = usb_register(&option_driver);
- if (retval)
- goto failed_driver_register;
-
- info(DRIVER_DESC ": " DRIVER_VERSION);
-
- return 0;
-
-failed_driver_register:
- usb_serial_deregister (&option_3port_device);
-failed_3port_device_register:
- return retval;
-}
-
-static void __exit
-option_exit (void)
-{
- usb_deregister (&option_driver);
- usb_serial_deregister (&option_3port_device);
-}
-
-module_init(option_init);
-module_exit(option_exit);
-
-static void
-option_rx_throttle (struct usb_serial_port *port)
-{
- dbg("%s", __FUNCTION__);
-}
-
-
-static void
-option_rx_unthrottle (struct usb_serial_port *port)
-{
- dbg("%s", __FUNCTION__);
-}
-
-
-static void
-option_break_ctl (struct usb_serial_port *port, int break_state)
-{
- /* Unfortunately, I don't know how to send a break */
- dbg("%s", __FUNCTION__);
-}
-
-
-static void
-option_set_termios (struct usb_serial_port *port,
- struct termios *old_termios)
-{
- dbg("%s", __FUNCTION__);
-
- option_send_setup(port);
-}
-
-static int
-option_tiocmget(struct usb_serial_port *port, struct file *file)
-{
- unsigned int value;
- struct option_port_private *portdata;
-
- portdata = usb_get_serial_port_data(port);
-
- value = ((portdata->rts_state) ? TIOCM_RTS : 0) |
- ((portdata->dtr_state) ? TIOCM_DTR : 0) |
- ((portdata->cts_state) ? TIOCM_CTS : 0) |
- ((portdata->dsr_state) ? TIOCM_DSR : 0) |
- ((portdata->dcd_state) ? TIOCM_CAR : 0) |
- ((portdata->ri_state) ? TIOCM_RNG : 0);
-
- return value;
-}
-
-static int
-option_tiocmset (struct usb_serial_port *port, struct file *file,
- unsigned int set, unsigned int clear)
-{
- struct option_port_private *portdata;
-
- portdata = usb_get_serial_port_data(port);
-
- if (set & TIOCM_RTS)
- portdata->rts_state = 1;
- if (set & TIOCM_DTR)
- portdata->dtr_state = 1;
-
- if (clear & TIOCM_RTS)
- portdata->rts_state = 0;
- if (clear & TIOCM_DTR)
- portdata->dtr_state = 0;
- return option_send_setup(port);
-}
-
-static int
-option_ioctl (struct usb_serial_port *port, struct file *file,
- unsigned int cmd, unsigned long arg)
-{
- return -ENOIOCTLCMD;
-}
-
-/* Write */
-static int
-option_write(struct usb_serial_port *port,
- const unsigned char *buf, int count)
-{
- struct option_port_private *portdata;
- int i;
- int left, todo;
- struct urb *this_urb = NULL; /* spurious */
- int err;
-
- portdata = usb_get_serial_port_data(port);
-
- dbg("%s: write (%d chars)", __FUNCTION__, count);
-
-#if 0
- spin_lock(&port->lock);
- if (port->write_urb_busy) {
- spin_unlock(&port->lock);
- dbg("%s: already writing", __FUNCTION__);
- return 0;
- }
- port->write_urb_busy = 1;
- spin_unlock(&port->lock);
-#endif
-
- i = 0;
- left = count;
- while (left>0) {
- todo = left;
- if (todo > OUT_BUFLEN)
- todo = OUT_BUFLEN;
-
- for (;i < N_OUT_URB; i++) {
- /* Check we have a valid urb/endpoint before we use it... */
- this_urb = portdata->out_urbs[i];
- if (this_urb->status != -EINPROGRESS)
- break;
- if (this_urb->transfer_flags & URB_ASYNC_UNLINK)
- continue;
- if (time_before(jiffies, portdata->tx_start_time[i] + 10 * HZ))
- continue;
- this_urb->transfer_flags |= URB_ASYNC_UNLINK;
- usb_unlink_urb(this_urb);
- }
-
- if (i == N_OUT_URB) {
- /* no bulk out free! */
- dbg("%s: no output urb -- left %d", __FUNCTION__,count-left);
-#if 0
- port->write_urb_busy = 0;
-#endif
- return count-left;
- }
-
- dbg("%s: endpoint %d buf %d", __FUNCTION__, usb_pipeendpoint(this_urb->pipe), i);
-
- memcpy (this_urb->transfer_buffer, buf, todo);
-
- /* send the data out the bulk port */
- this_urb->transfer_buffer_length = todo;
-
- this_urb->transfer_flags &= ~URB_ASYNC_UNLINK;
- this_urb->dev = port->serial->dev;
- err = usb_submit_urb(this_urb, GFP_ATOMIC);
- if (err) {
- dbg("usb_submit_urb %p (write bulk) failed (%d,, has %d)", this_urb, err, this_urb->status);
- continue;
- }
- portdata->tx_start_time[i] = jiffies;
- buf += todo;
- left -= todo;
- }
-
- count -= left;
-#if 0
- port->write_urb_busy = 0;
-#endif
- dbg("%s: wrote (did %d)", __FUNCTION__, count);
- return count;
-}
-
-static void
-option_indat_callback (struct urb *urb, struct pt_regs *regs)
-{
- int i, err;
- int endpoint;
- struct usb_serial_port *port;
- struct tty_struct *tty;
- unsigned char *data = urb->transfer_buffer;
-
- dbg("%s: %p", __FUNCTION__, urb);
-
- endpoint = usb_pipeendpoint(urb->pipe);
- port = (struct usb_serial_port *) urb->context;
-
- if (urb->status) {
- dbg("%s: nonzero status: %d on endpoint %02x.",
- __FUNCTION__, urb->status, endpoint);
- } else {
- tty = port->tty;
- if (urb->actual_length) {
- for (i = 0; i < urb->actual_length ; ++i) {
- if (tty->flip.count >= TTY_FLIPBUF_SIZE)
- tty_flip_buffer_push(tty);
- tty_insert_flip_char(tty, data[i], 0);
- }
- tty_flip_buffer_push(tty);
- } else {
- dbg("%s: empty read urb received", __FUNCTION__);
- }
-
- /* Resubmit urb so we continue receiving */
- if (port->open_count && urb->status != -ESHUTDOWN) {
- err = usb_submit_urb(urb, GFP_ATOMIC);
- if (err)
- printk(KERN_ERR "%s: resubmit read urb failed. (%d)", __FUNCTION__, err);
- }
- }
- return;
-}
-
-static void
-option_outdat_callback (struct urb *urb, struct pt_regs *regs)
-{
- struct usb_serial_port *port;
-
- dbg("%s", __FUNCTION__);
-
- port = (struct usb_serial_port *) urb->context;
-
- if (port->open_count)
- schedule_work(&port->work);
-}
-
-static void
-option_instat_callback (struct urb *urb, struct pt_regs *regs)
-{
- int err;
- struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
- struct option_port_private *portdata = usb_get_serial_port_data(port);
- struct usb_serial *serial = port->serial;
-
- dbg("%s", __FUNCTION__);
- dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata);
-
- if (urb->status == 0) {
- struct usb_ctrlrequest *req_pkt =
- (struct usb_ctrlrequest *)urb->transfer_buffer;
-
- if (!req_pkt) {
- dbg("%s: NULL req_pkt\n", __FUNCTION__);
- return;
- }
- if ((req_pkt->bRequestType == 0xA1) && (req_pkt->bRequest == 0x20)) {
- int old_dcd_state;
- unsigned char signals = *((unsigned char *)
- urb->transfer_buffer + sizeof(struct usb_ctrlrequest));
-
- dbg("%s: signal x%x", __FUNCTION__, signals);
-
- old_dcd_state = portdata->dcd_state;
- portdata->cts_state = 1;
- portdata->dcd_state = ((signals & 0x01) ? 1 : 0);
- portdata->dsr_state = ((signals & 0x02) ? 1 : 0);
- portdata->ri_state = ((signals & 0x08) ? 1 : 0);
-
- if (port->tty && !C_CLOCAL(port->tty)
- && old_dcd_state && !portdata->dcd_state) {
- tty_hangup(port->tty);
- }
- } else
- dbg("%s: type %x req %x", __FUNCTION__, req_pkt->bRequestType,req_pkt->bRequest);
- } else
- dbg("%s: error %d", __FUNCTION__, urb->status);
-
- /* Resubmit urb so we continue receiving IRQ data */
- if (urb->status != -ESHUTDOWN) {
- urb->dev = serial->dev;
- err = usb_submit_urb(urb, GFP_ATOMIC);
- if (err)
- dbg("%s: resubmit intr urb failed. (%d)", __FUNCTION__, err);
- }
-}
-
-
-static int
-option_write_room (struct usb_serial_port *port)
-{
- struct option_port_private *portdata;
- int i;
- int data_len = 0;
- struct urb *this_urb;
-
- portdata = usb_get_serial_port_data(port);
-
- for (i=0; i < N_OUT_URB; i++)
- this_urb = portdata->out_urbs[i];
- if (this_urb && this_urb->status != -EINPROGRESS)
- data_len += OUT_BUFLEN;
-
- dbg("%s: %d", __FUNCTION__, data_len);
- return data_len;
-}
-
-
-static int
-option_chars_in_buffer (struct usb_serial_port *port)
-{
- struct option_port_private *portdata;
- int i;
- int data_len = 0;
- struct urb *this_urb;
-
- portdata = usb_get_serial_port_data(port);
-
- for (i=0; i < N_OUT_URB; i++)
- this_urb = portdata->out_urbs[i];
- if (this_urb && this_urb->status == -EINPROGRESS)
- data_len += this_urb->transfer_buffer_length;
-
- dbg("%s: %d", __FUNCTION__, data_len);
- return data_len;
-}
-
-
-static int
-option_open (struct usb_serial_port *port, struct file *filp)
-{
- struct option_port_private *portdata;
- struct usb_serial *serial = port->serial;
- int i, err;
- struct urb *urb;
-
- portdata = usb_get_serial_port_data(port);
-
- dbg("%s", __FUNCTION__);
-
- /* Set some sane defaults */
- portdata->rts_state = 1;
- portdata->dtr_state = 1;
-
- /* Reset low level data toggle and start reading from endpoints */
- for (i = 0; i < N_IN_URB; i++) {
- urb = portdata->in_urbs[i];
- if (! urb)
- continue;
- if (urb->dev != serial->dev) {
- dbg("%s: dev %p != %p", __FUNCTION__, urb->dev, serial->dev);
- continue;
- }
-
- /* make sure endpoint data toggle is synchronized with the device */
-
- usb_clear_halt(urb->dev, urb->pipe);
-
- err = usb_submit_urb(urb, GFP_KERNEL);
- if (err) {
- dbg("%s: submit urb %d failed (%d) %d", __FUNCTION__, i, err,
- urb->transfer_buffer_length);
- }
- }
-
- /* Reset low level data toggle on out endpoints */
- for (i = 0; i < N_OUT_URB; i++) {
- urb = portdata->out_urbs[i];
- if (! urb)
- continue;
- urb->dev = serial->dev;
- /* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe), 0); */
- }
-
- port->tty->low_latency = 1;
-
- option_send_setup(port);
-
- return (0);
-}
-
-static inline void
-stop_urb(struct urb *urb)
-{
- if (urb && urb->status == -EINPROGRESS) {
- urb->transfer_flags &= ~URB_ASYNC_UNLINK;
- usb_kill_urb(urb);
- }
-}
-
-static void
-option_close(struct usb_serial_port *port, struct file *filp)
-{
- int i;
- struct usb_serial *serial = port->serial;
- struct option_port_private *portdata;
-
- dbg("%s", __FUNCTION__);
- portdata = usb_get_serial_port_data(port);
-
- portdata->rts_state = 0;
- portdata->dtr_state = 0;
-
- if (serial->dev) {
- option_send_setup(port);
-
- /* Stop reading/writing urbs */
- for (i = 0; i < N_IN_URB; i++)
- stop_urb(portdata->in_urbs[i]);
- for (i = 0; i < N_OUT_URB; i++)
- stop_urb(portdata->out_urbs[i]);
- }
- port->tty = NULL;
-}
-
-
-/* Helper functions used by option_setup_urbs */
-static struct urb *
-option_setup_urb (struct usb_serial *serial, int endpoint,
- int dir, void *ctx, char *buf, int len,
- void (*callback)(struct urb *, struct pt_regs *regs))
-{
- struct urb *urb;
-
- if (endpoint == -1)
- return NULL; /* endpoint not needed */
-
- urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
- if (urb == NULL) {
- dbg("%s: alloc for endpoint %d failed.", __FUNCTION__, endpoint);
- return NULL;
- }
-
- /* Fill URB using supplied data. */
- usb_fill_bulk_urb(urb, serial->dev,
- usb_sndbulkpipe(serial->dev, endpoint) | dir,
- buf, len, callback, ctx);
-
- return urb;
-}
-
-/* Setup urbs */
-static void
-option_setup_urbs(struct usb_serial *serial)
-{
- int j;
- struct usb_serial_port *port;
- struct option_port_private *portdata;
-
- dbg("%s", __FUNCTION__);
-
- port = serial->port[0];
- portdata = usb_get_serial_port_data(port);
-
- /* Do indat endpoints first */
- for (j = 0; j <= N_IN_URB; ++j) {
- portdata->in_urbs[j] = option_setup_urb (serial,
- port->bulk_in_endpointAddress, USB_DIR_IN, port,
- portdata->in_buffer[j], IN_BUFLEN, option_indat_callback);
- }
-
- /* outdat endpoints */
- for (j = 0; j <= N_OUT_URB; ++j) {
- portdata->out_urbs[j] = option_setup_urb (serial,
- port->bulk_out_endpointAddress, USB_DIR_OUT, port,
- portdata->out_buffer[j], OUT_BUFLEN, option_outdat_callback);
- }
-}
-
-
-static int
-option_send_setup(struct usb_serial_port *port)
-{
- struct usb_serial *serial = port->serial;
- struct option_port_private *portdata;
-
- dbg("%s", __FUNCTION__);
-
- portdata = usb_get_serial_port_data(port);
-
- if (port->tty) {
- int val = 0;
- if (portdata->dtr_state)
- val |= 0x01;
- if (portdata->rts_state)
- val |= 0x02;
-
- return usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
- 0x22,0x21,val,0,NULL,0,USB_CTRL_SET_TIMEOUT);
- }
-
- return 0;
-}
-
-
-static int
-option_startup (struct usb_serial *serial)
-{
- int i, err;
- struct usb_serial_port *port;
- struct option_port_private *portdata;
-
- dbg("%s", __FUNCTION__);
-
- /* Now setup per port private data */
- for (i = 0; i < serial->num_ports; i++) {
- port = serial->port[i];
- portdata = kmalloc(sizeof(struct option_port_private), GFP_KERNEL);
- if (!portdata) {
- dbg("%s: kmalloc for option_port_private (%d) failed!.", __FUNCTION__, i);
- return (1);
- }
- memset(portdata, 0, sizeof(struct option_port_private));
-
- usb_set_serial_port_data(port, portdata);
-
- if (! port->interrupt_in_urb)
- continue;
- err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
- if (err)
- dbg("%s: submit irq_in urb failed %d", __FUNCTION__, err);
- }
-
- option_setup_urbs(serial);
-
- return (0);
-}
-
-static void
-option_shutdown (struct usb_serial *serial)
-{
- int i, j;
- struct usb_serial_port *port;
- struct option_port_private *portdata;
-
- dbg("%s", __FUNCTION__);
-
- /* Stop reading/writing urbs */
- for (i = 0; i < serial->num_ports; ++i) {
- port = serial->port[i];
- portdata = usb_get_serial_port_data(port);
- for (j = 0; j < N_IN_URB; j++)
- stop_urb(portdata->in_urbs[j]);
- for (j = 0; j < N_OUT_URB; j++)
- stop_urb(portdata->out_urbs[j]);
- }
-
- /* Now free them */
- for (i = 0; i < serial->num_ports; ++i) {
- port = serial->port[i];
- portdata = usb_get_serial_port_data(port);
-
- for (j = 0; j < N_IN_URB; j++) {
- if (portdata->in_urbs[j]) {
- usb_free_urb(portdata->in_urbs[j]);
- portdata->in_urbs[j] = NULL;
- }
- }
- for (j = 0; j < N_OUT_URB; j++) {
- if (portdata->out_urbs[j]) {
- usb_free_urb(portdata->out_urbs[j]);
- portdata->out_urbs[j] = NULL;
- }
- }
- }
-
- /* Now free per port private data */
- for (i = 0; i < serial->num_ports; i++) {
- port = serial->port[i];
- kfree(usb_get_serial_port_data(port));
- }
-}
-
-MODULE_AUTHOR(DRIVER_AUTHOR);
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_VERSION(DRIVER_VERSION);
-MODULE_LICENSE("GPL");
-
-module_param(debug, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(debug, "Debug messages");
-
diff --git a/trunk/drivers/usb/serial/usb-serial.c b/trunk/drivers/usb/serial/usb-serial.c
index 5da76dd8fb28..4536f63faaea 100644
--- a/trunk/drivers/usb/serial/usb-serial.c
+++ b/trunk/drivers/usb/serial/usb-serial.c
@@ -1297,6 +1297,13 @@ static int __init usb_serial_init(void)
goto exit_bus;
}
+ /* register the generic driver, if we should */
+ result = usb_serial_generic_register(debug);
+ if (result < 0) {
+ err("%s - registering generic driver failed", __FUNCTION__);
+ goto exit_generic;
+ }
+
usb_serial_tty_driver->owner = THIS_MODULE;
usb_serial_tty_driver->driver_name = "usbserial";
usb_serial_tty_driver->devfs_name = "usb/tts/";
@@ -1322,24 +1329,17 @@ static int __init usb_serial_init(void)
goto exit_tty;
}
- /* register the generic driver, if we should */
- result = usb_serial_generic_register(debug);
- if (result < 0) {
- err("%s - registering generic driver failed", __FUNCTION__);
- goto exit_generic;
- }
-
info(DRIVER_DESC " " DRIVER_VERSION);
return result;
-exit_generic:
- usb_deregister(&usb_serial_driver);
-
exit_tty:
tty_unregister_driver(usb_serial_tty_driver);
exit_reg_driver:
+ usb_serial_generic_deregister();
+
+exit_generic:
bus_unregister(&usb_serial_bus_type);
exit_bus:
diff --git a/trunk/drivers/usb/storage/unusual_devs.h b/trunk/drivers/usb/storage/unusual_devs.h
index 9fcc7bd1fbe4..d2891f475793 100644
--- a/trunk/drivers/usb/storage/unusual_devs.h
+++ b/trunk/drivers/usb/storage/unusual_devs.h
@@ -862,15 +862,6 @@ UNUSUAL_DEV( 0x090a, 0x1001, 0x0100, 0x0100,
US_SC_DEVICE, US_PR_BULK, NULL,
US_FL_NEED_OVERRIDE ),
-/* Reported by Filippo Bardelli
- * The device reports a subclass of RBC, which is wrong.
- */
-UNUSUAL_DEV( 0x090a, 0x1050, 0x0100, 0x0100,
- "Trumpion Microelectronics, Inc.",
- "33520 USB Digital Voice Recorder",
- US_SC_UFI, US_PR_DEVICE, NULL,
- 0),
-
/* Trumpion Microelectronics MP3 player (felipe_alfaro@linuxmail.org) */
UNUSUAL_DEV( 0x090a, 0x1200, 0x0000, 0x9999,
"Trumpion",
diff --git a/trunk/fs/binfmt_flat.c b/trunk/fs/binfmt_flat.c
index c8998dc66882..f0cd67d9d31b 100644
--- a/trunk/fs/binfmt_flat.c
+++ b/trunk/fs/binfmt_flat.c
@@ -520,7 +520,7 @@ static int load_flat_file(struct linux_binprm * bprm,
DBG_FLT("BINFMT_FLAT: ROM mapping of file (we hope)\n");
down_write(¤t->mm->mmap_sem);
- textpos = do_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, MAP_SHARED, 0);
+ textpos = do_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, 0, 0);
up_write(¤t->mm->mmap_sem);
if (!textpos || textpos >= (unsigned long) -4096) {
if (!textpos)
@@ -532,7 +532,7 @@ static int load_flat_file(struct linux_binprm * bprm,
down_write(¤t->mm->mmap_sem);
realdatastart = do_mmap(0, 0, data_len + extra +
MAX_SHARED_LIBS * sizeof(unsigned long),
- PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0);
+ PROT_READ|PROT_WRITE|PROT_EXEC, 0, 0);
up_write(¤t->mm->mmap_sem);
if (realdatastart == 0 || realdatastart >= (unsigned long)-4096) {
@@ -574,7 +574,7 @@ static int load_flat_file(struct linux_binprm * bprm,
down_write(¤t->mm->mmap_sem);
textpos = do_mmap(0, 0, text_len + data_len + extra +
MAX_SHARED_LIBS * sizeof(unsigned long),
- PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0);
+ PROT_READ | PROT_EXEC | PROT_WRITE, 0, 0);
up_write(¤t->mm->mmap_sem);
if (!textpos || textpos >= (unsigned long) -4096) {
if (!textpos)
diff --git a/trunk/fs/jbd/checkpoint.c b/trunk/fs/jbd/checkpoint.c
index 5a97e346bd95..98d830401c56 100644
--- a/trunk/fs/jbd/checkpoint.c
+++ b/trunk/fs/jbd/checkpoint.c
@@ -188,6 +188,7 @@ static int __cleanup_transaction(journal_t *journal, transaction_t *transaction)
} else {
jbd_unlock_bh_state(bh);
}
+ jh = next_jh;
} while (jh != last_jh);
return ret;
@@ -338,10 +339,8 @@ int log_do_checkpoint(journal_t *journal)
}
} while (jh != last_jh && !retry);
- if (batch_count) {
+ if (batch_count)
__flush_batch(journal, bhs, &batch_count);
- retry = 1;
- }
/*
* If someone cleaned up this transaction while we slept, we're
diff --git a/trunk/fs/mpage.c b/trunk/fs/mpage.c
index bb9aebe93862..b92c0e64aefa 100644
--- a/trunk/fs/mpage.c
+++ b/trunk/fs/mpage.c
@@ -79,11 +79,8 @@ static int mpage_end_io_write(struct bio *bio, unsigned int bytes_done, int err)
if (--bvec >= bio->bi_io_vec)
prefetchw(&bvec->bv_page->flags);
- if (!uptodate){
+ if (!uptodate)
SetPageError(page);
- if (page->mapping)
- set_bit(AS_EIO, &page->mapping->flags);
- }
end_page_writeback(page);
} while (bvec >= bio->bi_io_vec);
bio_put(bio);
diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c
index a7f7f44119b3..dd78f01b6de8 100644
--- a/trunk/fs/namei.c
+++ b/trunk/fs/namei.c
@@ -493,21 +493,12 @@ static inline int __vfs_follow_link(struct nameidata *nd, const char *link)
return PTR_ERR(link);
}
-struct path {
- struct vfsmount *mnt;
- struct dentry *dentry;
-};
-
-static inline int __do_follow_link(struct path *path, struct nameidata *nd)
+static inline int __do_follow_link(struct dentry *dentry, struct nameidata *nd)
{
int error;
- struct dentry *dentry = path->dentry;
- touch_atime(path->mnt, dentry);
+ touch_atime(nd->mnt, dentry);
nd_set_link(nd, NULL);
-
- if (path->mnt == nd->mnt)
- mntget(path->mnt);
error = dentry->d_inode->i_op->follow_link(dentry, nd);
if (!error) {
char *s = nd_get_link(nd);
@@ -516,8 +507,6 @@ static inline int __do_follow_link(struct path *path, struct nameidata *nd)
if (dentry->d_inode->i_op->put_link)
dentry->d_inode->i_op->put_link(dentry, nd);
}
- dput(dentry);
- mntput(path->mnt);
return error;
}
@@ -529,7 +518,7 @@ static inline int __do_follow_link(struct path *path, struct nameidata *nd)
* Without that kind of total limit, nasty chains of consecutive
* symlinks can cause almost arbitrarily long lookups.
*/
-static inline int do_follow_link(struct path *path, struct nameidata *nd)
+static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd)
{
int err = -ELOOP;
if (current->link_count >= MAX_NESTED_LINKS)
@@ -538,20 +527,17 @@ static inline int do_follow_link(struct path *path, struct nameidata *nd)
goto loop;
BUG_ON(nd->depth >= MAX_NESTED_LINKS);
cond_resched();
- err = security_inode_follow_link(path->dentry, nd);
+ err = security_inode_follow_link(dentry, nd);
if (err)
goto loop;
current->link_count++;
current->total_link_count++;
nd->depth++;
- err = __do_follow_link(path, nd);
+ err = __do_follow_link(dentry, nd);
current->link_count--;
nd->depth--;
return err;
loop:
- dput(path->dentry);
- if (path->mnt != nd->mnt)
- mntput(path->mnt);
path_release(nd);
return err;
}
@@ -579,91 +565,87 @@ int follow_up(struct vfsmount **mnt, struct dentry **dentry)
/* no need for dcache_lock, as serialization is taken care in
* namespace.c
*/
-static int __follow_mount(struct path *path)
+static int follow_mount(struct vfsmount **mnt, struct dentry **dentry)
{
int res = 0;
- while (d_mountpoint(path->dentry)) {
- struct vfsmount *mounted = lookup_mnt(path->mnt, path->dentry);
- if (!mounted)
- break;
- dput(path->dentry);
- if (res)
- mntput(path->mnt);
- path->mnt = mounted;
- path->dentry = dget(mounted->mnt_root);
- res = 1;
- }
- return res;
-}
-
-static void follow_mount(struct vfsmount **mnt, struct dentry **dentry)
-{
while (d_mountpoint(*dentry)) {
struct vfsmount *mounted = lookup_mnt(*mnt, *dentry);
if (!mounted)
break;
- dput(*dentry);
mntput(*mnt);
*mnt = mounted;
+ dput(*dentry);
*dentry = dget(mounted->mnt_root);
+ res = 1;
}
+ return res;
}
/* no need for dcache_lock, as serialization is taken care in
* namespace.c
*/
-int follow_down(struct vfsmount **mnt, struct dentry **dentry)
+static inline int __follow_down(struct vfsmount **mnt, struct dentry **dentry)
{
struct vfsmount *mounted;
mounted = lookup_mnt(*mnt, *dentry);
if (mounted) {
- dput(*dentry);
mntput(*mnt);
*mnt = mounted;
+ dput(*dentry);
*dentry = dget(mounted->mnt_root);
return 1;
}
return 0;
}
-static inline void follow_dotdot(struct nameidata *nd)
+int follow_down(struct vfsmount **mnt, struct dentry **dentry)
+{
+ return __follow_down(mnt,dentry);
+}
+
+static inline void follow_dotdot(struct vfsmount **mnt, struct dentry **dentry)
{
while(1) {
struct vfsmount *parent;
- struct dentry *old = nd->dentry;
+ struct dentry *old = *dentry;
read_lock(¤t->fs->lock);
- if (nd->dentry == current->fs->root &&
- nd->mnt == current->fs->rootmnt) {
+ if (*dentry == current->fs->root &&
+ *mnt == current->fs->rootmnt) {
read_unlock(¤t->fs->lock);
break;
}
read_unlock(¤t->fs->lock);
spin_lock(&dcache_lock);
- if (nd->dentry != nd->mnt->mnt_root) {
- nd->dentry = dget(nd->dentry->d_parent);
+ if (*dentry != (*mnt)->mnt_root) {
+ *dentry = dget((*dentry)->d_parent);
spin_unlock(&dcache_lock);
dput(old);
break;
}
spin_unlock(&dcache_lock);
spin_lock(&vfsmount_lock);
- parent = nd->mnt->mnt_parent;
- if (parent == nd->mnt) {
+ parent = (*mnt)->mnt_parent;
+ if (parent == *mnt) {
spin_unlock(&vfsmount_lock);
break;
}
mntget(parent);
- nd->dentry = dget(nd->mnt->mnt_mountpoint);
+ *dentry = dget((*mnt)->mnt_mountpoint);
spin_unlock(&vfsmount_lock);
dput(old);
- mntput(nd->mnt);
- nd->mnt = parent;
+ mntput(*mnt);
+ *mnt = parent;
}
- follow_mount(&nd->mnt, &nd->dentry);
+ follow_mount(mnt, dentry);
}
+struct path {
+ struct vfsmount *mnt;
+ struct dentry *dentry;
+};
+
/*
* It's more convoluted than I'd like it to be, but... it's still fairly
* small and for now I'd prefer to have fast path as straight as possible.
@@ -682,7 +664,6 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
done:
path->mnt = mnt;
path->dentry = dentry;
- __follow_mount(path);
return 0;
need_lookup:
@@ -770,7 +751,7 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
case 2:
if (this.name[1] != '.')
break;
- follow_dotdot(nd);
+ follow_dotdot(&nd->mnt, &nd->dentry);
inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
@@ -790,6 +771,8 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
err = do_lookup(nd, &this, &next);
if (err)
break;
+ /* Check mountpoints.. */
+ follow_mount(&next.mnt, &next.dentry);
err = -ENOENT;
inode = next.dentry->d_inode;
@@ -800,7 +783,10 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
goto out_dput;
if (inode->i_op->follow_link) {
- err = do_follow_link(&next, nd);
+ mntget(next.mnt);
+ err = do_follow_link(next.dentry, nd);
+ dput(next.dentry);
+ mntput(next.mnt);
if (err)
goto return_err;
err = -ENOENT;
@@ -812,8 +798,6 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
break;
} else {
dput(nd->dentry);
- if (nd->mnt != next.mnt)
- mntput(nd->mnt);
nd->mnt = next.mnt;
nd->dentry = next.dentry;
}
@@ -835,7 +819,7 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
case 2:
if (this.name[1] != '.')
break;
- follow_dotdot(nd);
+ follow_dotdot(&nd->mnt, &nd->dentry);
inode = nd->dentry->d_inode;
/* fallthrough */
case 1:
@@ -849,17 +833,19 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
err = do_lookup(nd, &this, &next);
if (err)
break;
+ follow_mount(&next.mnt, &next.dentry);
inode = next.dentry->d_inode;
if ((lookup_flags & LOOKUP_FOLLOW)
&& inode && inode->i_op && inode->i_op->follow_link) {
- err = do_follow_link(&next, nd);
+ mntget(next.mnt);
+ err = do_follow_link(next.dentry, nd);
+ dput(next.dentry);
+ mntput(next.mnt);
if (err)
goto return_err;
inode = nd->dentry->d_inode;
} else {
dput(nd->dentry);
- if (nd->mnt != next.mnt)
- mntput(nd->mnt);
nd->mnt = next.mnt;
nd->dentry = next.dentry;
}
@@ -899,8 +885,6 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
return 0;
out_dput:
dput(next.dentry);
- if (nd->mnt != next.mnt)
- mntput(next.mnt);
break;
}
path_release(nd);
@@ -1414,7 +1398,7 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
{
int acc_mode, error = 0;
- struct path path;
+ struct dentry *dentry;
struct dentry *dir;
int count = 0;
@@ -1458,24 +1442,23 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
dir = nd->dentry;
nd->flags &= ~LOOKUP_PARENT;
down(&dir->d_inode->i_sem);
- path.dentry = __lookup_hash(&nd->last, nd->dentry, nd);
- path.mnt = nd->mnt;
+ dentry = __lookup_hash(&nd->last, nd->dentry, nd);
do_last:
- error = PTR_ERR(path.dentry);
- if (IS_ERR(path.dentry)) {
+ error = PTR_ERR(dentry);
+ if (IS_ERR(dentry)) {
up(&dir->d_inode->i_sem);
goto exit;
}
/* Negative dentry, just create the file */
- if (!path.dentry->d_inode) {
+ if (!dentry->d_inode) {
if (!IS_POSIXACL(dir->d_inode))
mode &= ~current->fs->umask;
- error = vfs_create(dir->d_inode, path.dentry, mode, nd);
+ error = vfs_create(dir->d_inode, dentry, mode, nd);
up(&dir->d_inode->i_sem);
dput(nd->dentry);
- nd->dentry = path.dentry;
+ nd->dentry = dentry;
if (error)
goto exit;
/* Don't check for write permission, don't truncate */
@@ -1493,24 +1476,22 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
if (flag & O_EXCL)
goto exit_dput;
- if (__follow_mount(&path)) {
+ if (d_mountpoint(dentry)) {
error = -ELOOP;
if (flag & O_NOFOLLOW)
goto exit_dput;
+ while (__follow_down(&nd->mnt,&dentry) && d_mountpoint(dentry));
}
error = -ENOENT;
- if (!path.dentry->d_inode)
+ if (!dentry->d_inode)
goto exit_dput;
- if (path.dentry->d_inode->i_op && path.dentry->d_inode->i_op->follow_link)
+ if (dentry->d_inode->i_op && dentry->d_inode->i_op->follow_link)
goto do_link;
dput(nd->dentry);
- nd->dentry = path.dentry;
- if (nd->mnt != path.mnt)
- mntput(nd->mnt);
- nd->mnt = path.mnt;
+ nd->dentry = dentry;
error = -EISDIR;
- if (path.dentry->d_inode && S_ISDIR(path.dentry->d_inode->i_mode))
+ if (dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode))
goto exit;
ok:
error = may_open(nd, acc_mode, flag);
@@ -1519,9 +1500,7 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
return 0;
exit_dput:
- dput(path.dentry);
- if (nd->mnt != path.mnt)
- mntput(path.mnt);
+ dput(dentry);
exit:
path_release(nd);
return error;
@@ -1541,15 +1520,18 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
* are done. Procfs-like symlinks just set LAST_BIND.
*/
nd->flags |= LOOKUP_PARENT;
- error = security_inode_follow_link(path.dentry, nd);
+ error = security_inode_follow_link(dentry, nd);
if (error)
goto exit_dput;
- error = __do_follow_link(&path, nd);
+ error = __do_follow_link(dentry, nd);
+ dput(dentry);
if (error)
return error;
nd->flags &= ~LOOKUP_PARENT;
- if (nd->last_type == LAST_BIND)
+ if (nd->last_type == LAST_BIND) {
+ dentry = nd->dentry;
goto ok;
+ }
error = -EISDIR;
if (nd->last_type != LAST_NORM)
goto exit;
@@ -1564,8 +1546,7 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
}
dir = nd->dentry;
down(&dir->d_inode->i_sem);
- path.dentry = __lookup_hash(&nd->last, nd->dentry, nd);
- path.mnt = nd->mnt;
+ dentry = __lookup_hash(&nd->last, nd->dentry, nd);
putname(nd->last.name);
goto do_last;
}
diff --git a/trunk/fs/nfs/dir.c b/trunk/fs/nfs/dir.c
index ff6155f5e8d9..73f96acd5d37 100644
--- a/trunk/fs/nfs/dir.c
+++ b/trunk/fs/nfs/dir.c
@@ -528,39 +528,19 @@ static inline void nfs_renew_times(struct dentry * dentry)
dentry->d_time = jiffies;
}
-/*
- * Return the intent data that applies to this particular path component
- *
- * Note that the current set of intents only apply to the very last
- * component of the path.
- * We check for this using LOOKUP_CONTINUE and LOOKUP_PARENT.
- */
-static inline unsigned int nfs_lookup_check_intent(struct nameidata *nd, unsigned int mask)
-{
- if (nd->flags & (LOOKUP_CONTINUE|LOOKUP_PARENT))
- return 0;
- return nd->flags & mask;
-}
-
-/*
- * Inode and filehandle revalidation for lookups.
- *
- * We force revalidation in the cases where the VFS sets LOOKUP_REVAL,
- * or if the intent information indicates that we're about to open this
- * particular file and the "nocto" mount flag is not set.
- *
- */
static inline
int nfs_lookup_verify_inode(struct inode *inode, struct nameidata *nd)
{
struct nfs_server *server = NFS_SERVER(inode);
if (nd != NULL) {
+ int ndflags = nd->flags;
/* VFS wants an on-the-wire revalidation */
- if (nd->flags & LOOKUP_REVAL)
+ if (ndflags & LOOKUP_REVAL)
goto out_force;
/* This is an open(2) */
- if (nfs_lookup_check_intent(nd, LOOKUP_OPEN) != 0 &&
+ if ((ndflags & LOOKUP_OPEN) &&
+ !(ndflags & LOOKUP_CONTINUE) &&
!(server->flags & NFS_MOUNT_NOCTO))
goto out_force;
}
@@ -580,8 +560,12 @@ static inline
int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry,
struct nameidata *nd)
{
+ int ndflags = 0;
+
+ if (nd)
+ ndflags = nd->flags;
/* Don't revalidate a negative dentry if we're creating a new file */
- if (nd != NULL && nfs_lookup_check_intent(nd, LOOKUP_CREATE) != 0)
+ if ((ndflags & LOOKUP_CREATE) && !(ndflags & LOOKUP_CONTINUE))
return 0;
return !nfs_check_verifier(dir, dentry);
}
@@ -716,16 +700,12 @@ struct dentry_operations nfs_dentry_operations = {
.d_iput = nfs_dentry_iput,
};
-/*
- * Use intent information to check whether or not we're going to do
- * an O_EXCL create using this path component.
- */
static inline
int nfs_is_exclusive_create(struct inode *dir, struct nameidata *nd)
{
if (NFS_PROTO(dir)->version == 2)
return 0;
- if (nd == NULL || nfs_lookup_check_intent(nd, LOOKUP_CREATE) == 0)
+ if (!nd || (nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_CREATE))
return 0;
return (nd->intent.open.flags & O_EXCL) != 0;
}
@@ -792,13 +772,12 @@ struct dentry_operations nfs4_dentry_operations = {
.d_iput = nfs_dentry_iput,
};
-/*
- * Use intent information to determine whether we need to substitute
- * the NFSv4-style stateful OPEN for the LOOKUP call
- */
static int is_atomic_open(struct inode *dir, struct nameidata *nd)
{
- if (nd == NULL || nfs_lookup_check_intent(nd, LOOKUP_OPEN) == 0)
+ if (!nd)
+ return 0;
+ /* Check that we are indeed trying to open this file */
+ if ((nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_OPEN))
return 0;
/* NFS does not (yet) have a stateful open for directories */
if (nd->flags & LOOKUP_DIRECTORY)
diff --git a/trunk/fs/proc/proc_devtree.c b/trunk/fs/proc/proc_devtree.c
index 6fd57f154197..67423c696c0a 100644
--- a/trunk/fs/proc/proc_devtree.c
+++ b/trunk/fs/proc/proc_devtree.c
@@ -12,8 +12,15 @@
#include
#ifndef HAVE_ARCH_DEVTREE_FIXUPS
-static inline void set_node_proc_entry(struct device_node *np,
- struct proc_dir_entry *de)
+static inline void set_node_proc_entry(struct device_node *np, struct proc_dir_entry *de)
+{
+}
+
+static void inline set_node_name_link(struct device_node *np, struct proc_dir_entry *de)
+{
+}
+
+static void inline set_node_addr_link(struct device_node *np, struct proc_dir_entry *de)
{
}
#endif
@@ -51,67 +58,89 @@ static int property_read_proc(char *page, char **start, off_t off,
/*
* Process a node, adding entries for its children and its properties.
*/
-void proc_device_tree_add_node(struct device_node *np,
- struct proc_dir_entry *de)
+void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *de)
{
struct property *pp;
struct proc_dir_entry *ent;
- struct device_node *child;
- struct proc_dir_entry *list = NULL, **lastp;
- const char *p;
+ struct device_node *child, *sib;
+ const char *p, *at;
+ int l;
+ struct proc_dir_entry *list, **lastp, *al;
set_node_proc_entry(np, de);
lastp = &list;
- for (child = NULL; (child = of_get_next_child(np, child));) {
+ for (pp = np->properties; pp != 0; pp = pp->next) {
+ /*
+ * Unfortunately proc_register puts each new entry
+ * at the beginning of the list. So we rearrange them.
+ */
+ ent = create_proc_read_entry(pp->name, strncmp(pp->name, "security-", 9) ?
+ S_IRUGO : S_IRUSR, de, property_read_proc, pp);
+ if (ent == 0)
+ break;
+ if (!strncmp(pp->name, "security-", 9))
+ ent->size = 0; /* don't leak number of password chars */
+ else
+ ent->size = pp->length;
+ *lastp = ent;
+ lastp = &ent->next;
+ }
+ child = NULL;
+ while ((child = of_get_next_child(np, child))) {
p = strrchr(child->full_name, '/');
if (!p)
p = child->full_name;
else
++p;
+ /* chop off '@0' if the name ends with that */
+ l = strlen(p);
+ if (l > 2 && p[l-2] == '@' && p[l-1] == '0')
+ l -= 2;
ent = proc_mkdir(p, de);
if (ent == 0)
break;
*lastp = ent;
- ent->next = NULL;
lastp = &ent->next;
proc_device_tree_add_node(child, ent);
- }
- of_node_put(child);
- for (pp = np->properties; pp != 0; pp = pp->next) {
+
/*
- * Yet another Apple device-tree bogosity: on some machines,
- * they have properties & nodes with the same name. Those
- * properties are quite unimportant for us though, thus we
- * simply "skip" them here, but we do have to check.
+ * If we left the address part on the name, consider
+ * adding symlinks from the name and address parts.
*/
- for (ent = list; ent != NULL; ent = ent->next)
- if (!strcmp(ent->name, pp->name))
- break;
- if (ent != NULL) {
- printk(KERN_WARNING "device-tree: property \"%s\" name"
- " conflicts with node in %s\n", pp->name,
- np->full_name);
+ if (p[l] != 0 || (at = strchr(p, '@')) == 0)
continue;
- }
/*
- * Unfortunately proc_register puts each new entry
- * at the beginning of the list. So we rearrange them.
+ * If this is the first node with a given name property,
+ * add a symlink with the name property as its name.
*/
- ent = create_proc_read_entry(pp->name,
- strncmp(pp->name, "security-", 9)
- ? S_IRUGO : S_IRUSR, de,
- property_read_proc, pp);
- if (ent == 0)
+ sib = NULL;
+ while ((sib = of_get_next_child(np, sib)) && sib != child)
+ if (sib->name && strcmp(sib->name, child->name) == 0)
+ break;
+ if (sib == child && strncmp(p, child->name, l) != 0) {
+ al = proc_symlink(child->name, de, ent->name);
+ if (al == 0) {
+ of_node_put(sib);
+ break;
+ }
+ set_node_name_link(child, al);
+ *lastp = al;
+ lastp = &al->next;
+ }
+ of_node_put(sib);
+ /*
+ * Add another directory with the @address part as its name.
+ */
+ al = proc_symlink(at, de, ent->name);
+ if (al == 0)
break;
- if (!strncmp(pp->name, "security-", 9))
- ent->size = 0; /* don't leak number of password chars */
- else
- ent->size = pp->length;
- ent->next = NULL;
- *lastp = ent;
- lastp = &ent->next;
+ set_node_addr_link(child, al);
+ *lastp = al;
+ lastp = &al->next;
}
+ of_node_put(child);
+ *lastp = NULL;
de->subdir = list;
}
diff --git a/trunk/fs/udf/udftime.c b/trunk/fs/udf/udftime.c
index 85d8dbe843f1..457a8fe28575 100644
--- a/trunk/fs/udf/udftime.c
+++ b/trunk/fs/udf/udftime.c
@@ -46,7 +46,7 @@
#endif
/* How many days come before each month (0-12). */
-static const unsigned short int __mon_yday[2][13] =
+const unsigned short int __mon_yday[2][13] =
{
/* Normal years. */
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
diff --git a/trunk/include/asm-alpha/agp.h b/trunk/include/asm-alpha/agp.h
index ef855a3bc0f5..c99dbbb5bcb5 100644
--- a/trunk/include/asm-alpha/agp.h
+++ b/trunk/include/asm-alpha/agp.h
@@ -10,14 +10,4 @@
#define flush_agp_mappings()
#define flush_agp_cache() mb()
-/* Convert a physical address to an address suitable for the GART. */
-#define phys_to_gart(x) (x)
-#define gart_to_phys(x) (x)
-
-/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-#define alloc_gatt_pages(order) \
- ((char *)__get_free_pages(GFP_KERNEL, (order)))
-#define free_gatt_pages(table, order) \
- free_pages((unsigned long)(table), (order))
-
#endif
diff --git a/trunk/include/asm-arm/arch-ixp2000/io.h b/trunk/include/asm-arm/arch-ixp2000/io.h
index 083462668e18..a8e3c2daefd6 100644
--- a/trunk/include/asm-arm/arch-ixp2000/io.h
+++ b/trunk/include/asm-arm/arch-ixp2000/io.h
@@ -75,8 +75,8 @@ static inline void insw(u32 ptr, void *buf, int length)
* Is this cycle meant for the CS8900?
*/
if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
- (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) &&
- ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) {
+ ((port >= IXDP2X01_CS8900_VIRT_BASE) &&
+ (port <= IXDP2X01_CS8900_VIRT_END))) {
u8 *buf8 = (u8*)buf;
register u32 tmp32;
@@ -100,8 +100,8 @@ static inline void outsw(u32 ptr, void *buf, int length)
* Is this cycle meant for the CS8900?
*/
if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
- (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) &&
- ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) {
+ ((port >= IXDP2X01_CS8900_VIRT_BASE) &&
+ (port <= IXDP2X01_CS8900_VIRT_END))) {
register u32 tmp32;
u8 *buf8 = (u8*)buf;
do {
@@ -124,8 +124,8 @@ static inline u16 inw(u32 ptr)
* Is this cycle meant for the CS8900?
*/
if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
- (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) &&
- ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) {
+ ((port >= IXDP2X01_CS8900_VIRT_BASE) &&
+ (port <= IXDP2X01_CS8900_VIRT_END))) {
return (u16)(*port);
}
@@ -137,8 +137,8 @@ static inline void outw(u16 value, u32 ptr)
register volatile u32 *port = (volatile u32 *)ptr;
if ((machine_is_ixdp2401() || machine_is_ixdp2801()) &&
- (((u32)port >= (u32)IXDP2X01_CS8900_VIRT_BASE) &&
- ((u32)port <= (u32)IXDP2X01_CS8900_VIRT_END))) {
+ ((port >= IXDP2X01_CS8900_VIRT_BASE) &&
+ (port <= IXDP2X01_CS8900_VIRT_END))) {
*port = value;
return;
}
diff --git a/trunk/include/asm-arm/arch-pxa/pxa-regs.h b/trunk/include/asm-arm/arch-pxa/pxa-regs.h
index b5e54a9e9fa7..39741d3c9a34 100644
--- a/trunk/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/trunk/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1296,7 +1296,6 @@
#define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */
#define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */
#define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */
-#define GPIO113_I2S_SYSCLK 113 /* I2S System Clock (PXA27x) */
#define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */
/* GPIO alternate function mode & direction */
@@ -1429,7 +1428,6 @@
#define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT)
#define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT)
#define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT)
-#define GPIO113_I2S_SYSCLK_MD (113 | GPIO_ALT_FN_1_OUT)
#define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT)
#define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_OUT)
#define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN)
diff --git a/trunk/include/asm-arm/elf.h b/trunk/include/asm-arm/elf.h
index a1696ba238d3..cbceacbe5afa 100644
--- a/trunk/include/asm-arm/elf.h
+++ b/trunk/include/asm-arm/elf.h
@@ -38,9 +38,9 @@ typedef struct user_fp elf_fpregset_t;
*/
#define ELF_CLASS ELFCLASS32
#ifdef __ARMEB__
-#define ELF_DATA ELFDATA2MSB
+#define ELF_DATA ELFDATA2MSB;
#else
-#define ELF_DATA ELFDATA2LSB
+#define ELF_DATA ELFDATA2LSB;
#endif
#define ELF_ARCH EM_ARM
diff --git a/trunk/include/asm-arm26/elf.h b/trunk/include/asm-arm26/elf.h
index 5a47fdb3015d..8b149474db24 100644
--- a/trunk/include/asm-arm26/elf.h
+++ b/trunk/include/asm-arm26/elf.h
@@ -36,7 +36,7 @@ typedef struct { void *null; } elf_fpregset_t;
* These are used to set parameters in the core dumps.
*/
#define ELF_CLASS ELFCLASS32
-#define ELF_DATA ELFDATA2LSB
+#define ELF_DATA ELFDATA2LSB;
#define ELF_ARCH EM_ARM
#define USE_ELF_CORE_DUMP
diff --git a/trunk/include/asm-h8300/kmap_types.h b/trunk/include/asm-h8300/kmap_types.h
index 1ec8a3427120..82431edeb2a1 100644
--- a/trunk/include/asm-h8300/kmap_types.h
+++ b/trunk/include/asm-h8300/kmap_types.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_H8300_KMAP_TYPES_H
-#define _ASM_H8300_KMAP_TYPES_H
+#ifndef _ASM_KMAP_TYPES_H
+#define _ASM_KMAP_TYPES_H
enum km_type {
KM_BOUNCE_READ,
@@ -13,8 +13,6 @@ enum km_type {
KM_PTE1,
KM_IRQ0,
KM_IRQ1,
- KM_SOFTIRQ0,
- KM_SOFTIRQ1,
KM_TYPE_NR
};
diff --git a/trunk/include/asm-h8300/mman.h b/trunk/include/asm-h8300/mman.h
index 63f727a59850..abe08856c84f 100644
--- a/trunk/include/asm-h8300/mman.h
+++ b/trunk/include/asm-h8300/mman.h
@@ -4,7 +4,6 @@
#define PROT_READ 0x1 /* page can be read */
#define PROT_WRITE 0x2 /* page can be written */
#define PROT_EXEC 0x4 /* page can be executed */
-#define PROT_SEM 0x8 /* page may be used for atomic ops */
#define PROT_NONE 0x0 /* page can not be accessed */
#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
@@ -20,8 +19,6 @@
#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
#define MAP_LOCKED 0x2000 /* pages are locked */
#define MAP_NORESERVE 0x4000 /* don't check for reservations */
-#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
-#define MAP_NONBLOCK 0x10000 /* do not block on IO */
#define MS_ASYNC 1 /* sync memory asynchronously */
#define MS_INVALIDATE 2 /* invalidate the caches */
diff --git a/trunk/include/asm-i386/agp.h b/trunk/include/asm-i386/agp.h
index b82f5f3ab887..a917ff50354f 100644
--- a/trunk/include/asm-i386/agp.h
+++ b/trunk/include/asm-i386/agp.h
@@ -21,14 +21,4 @@ int unmap_page_from_agp(struct page *page);
worth it. Would need a page for it. */
#define flush_agp_cache() asm volatile("wbinvd":::"memory")
-/* Convert a physical address to an address suitable for the GART. */
-#define phys_to_gart(x) (x)
-#define gart_to_phys(x) (x)
-
-/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-#define alloc_gatt_pages(order) \
- ((char *)__get_free_pages(GFP_KERNEL, (order)))
-#define free_gatt_pages(table, order) \
- free_pages((unsigned long)(table), (order))
-
#endif
diff --git a/trunk/include/asm-i386/mach-numaq/mach_ipi.h b/trunk/include/asm-i386/mach-numaq/mach_ipi.h
index c6044488e9e6..1b46fd3f2ae3 100644
--- a/trunk/include/asm-i386/mach-numaq/mach_ipi.h
+++ b/trunk/include/asm-i386/mach-numaq/mach_ipi.h
@@ -1,7 +1,7 @@
#ifndef __ASM_MACH_IPI_H
#define __ASM_MACH_IPI_H
-void send_IPI_mask_sequence(cpumask_t, int vector);
+inline void send_IPI_mask_sequence(cpumask_t, int vector);
static inline void send_IPI_mask(cpumask_t mask, int vector)
{
diff --git a/trunk/include/asm-i386/timer.h b/trunk/include/asm-i386/timer.h
index c34709849839..40c54f69780e 100644
--- a/trunk/include/asm-i386/timer.h
+++ b/trunk/include/asm-i386/timer.h
@@ -53,7 +53,6 @@ extern struct init_timer_opts timer_cyclone_init;
extern unsigned long calibrate_tsc(void);
extern void init_cpu_khz(void);
-extern int recalibrate_cpu_khz(void);
#ifdef CONFIG_HPET_TIMER
extern struct init_timer_opts timer_hpet_init;
extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
diff --git a/trunk/include/asm-ia64/agp.h b/trunk/include/asm-ia64/agp.h
index 4e517f0e6afa..d1316f1e6ee1 100644
--- a/trunk/include/asm-ia64/agp.h
+++ b/trunk/include/asm-ia64/agp.h
@@ -18,14 +18,4 @@
#define flush_agp_mappings() /* nothing */
#define flush_agp_cache() mb()
-/* Convert a physical address to an address suitable for the GART. */
-#define phys_to_gart(x) (x)
-#define gart_to_phys(x) (x)
-
-/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-#define alloc_gatt_pages(order) \
- ((char *)__get_free_pages(GFP_KERNEL, (order)))
-#define free_gatt_pages(table, order) \
- free_pages((unsigned long)(table), (order))
-
#endif /* _ASM_IA64_AGP_H */
diff --git a/trunk/include/asm-ia64/pgtable.h b/trunk/include/asm-ia64/pgtable.h
index fcc9c3344ab4..ea121a002309 100644
--- a/trunk/include/asm-ia64/pgtable.h
+++ b/trunk/include/asm-ia64/pgtable.h
@@ -8,7 +8,7 @@
* This hopefully works with any (fixed) IA-64 page-size, as defined
* in .
*
- * Copyright (C) 1998-2005 Hewlett-Packard Co
+ * Copyright (C) 1998-2004 Hewlett-Packard Co
* David Mosberger-Tang
*/
@@ -551,11 +551,7 @@ do { \
/* These tell get_user_pages() that the first gate page is accessible from user-level. */
#define FIXADDR_USER_START GATE_ADDR
-#ifdef HAVE_BUGGY_SEGREL
-# define FIXADDR_USER_END (GATE_ADDR + 2*PAGE_SIZE)
-#else
-# define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE)
-#endif
+#define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE)
#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
diff --git a/trunk/include/asm-ia64/processor.h b/trunk/include/asm-ia64/processor.h
index 91bbd1f22461..9e1ba8b7fb68 100644
--- a/trunk/include/asm-ia64/processor.h
+++ b/trunk/include/asm-ia64/processor.h
@@ -403,10 +403,7 @@ extern void ia64_setreg_unknown_kr (void);
* task_struct at this point.
*/
-/*
- * Return TRUE if task T owns the fph partition of the CPU we're running on.
- * Must be called from code that has preemption disabled.
- */
+/* Return TRUE if task T owns the fph partition of the CPU we're running on. */
#define ia64_is_local_fpu_owner(t) \
({ \
struct task_struct *__ia64_islfo_task = (t); \
@@ -414,10 +411,7 @@ extern void ia64_setreg_unknown_kr (void);
&& __ia64_islfo_task == (struct task_struct *) ia64_get_kr(IA64_KR_FPU_OWNER)); \
})
-/*
- * Mark task T as owning the fph partition of the CPU we're running on.
- * Must be called from code that has preemption disabled.
- */
+/* Mark task T as owning the fph partition of the CPU we're running on. */
#define ia64_set_local_fpu_owner(t) do { \
struct task_struct *__ia64_slfo_task = (t); \
__ia64_slfo_task->thread.last_fph_cpu = smp_processor_id(); \
diff --git a/trunk/include/asm-ppc/agp.h b/trunk/include/asm-ppc/agp.h
index ca9e423307f4..be27cfa8c5b0 100644
--- a/trunk/include/asm-ppc/agp.h
+++ b/trunk/include/asm-ppc/agp.h
@@ -10,14 +10,4 @@
#define flush_agp_mappings()
#define flush_agp_cache() mb()
-/* Convert a physical address to an address suitable for the GART. */
-#define phys_to_gart(x) (x)
-#define gart_to_phys(x) (x)
-
-/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-#define alloc_gatt_pages(order) \
- ((char *)__get_free_pages(GFP_KERNEL, (order)))
-#define free_gatt_pages(table, order) \
- free_pages((unsigned long)(table), (order))
-
#endif
diff --git a/trunk/include/asm-ppc/sigcontext.h b/trunk/include/asm-ppc/sigcontext.h
index b7a417e0a921..f82dcccdee1e 100644
--- a/trunk/include/asm-ppc/sigcontext.h
+++ b/trunk/include/asm-ppc/sigcontext.h
@@ -2,7 +2,7 @@
#define _ASM_PPC_SIGCONTEXT_H
#include
-#include
+
struct sigcontext {
unsigned long _unused[4];
diff --git a/trunk/include/asm-ppc64/agp.h b/trunk/include/asm-ppc64/agp.h
index ca9e423307f4..be27cfa8c5b0 100644
--- a/trunk/include/asm-ppc64/agp.h
+++ b/trunk/include/asm-ppc64/agp.h
@@ -10,14 +10,4 @@
#define flush_agp_mappings()
#define flush_agp_cache() mb()
-/* Convert a physical address to an address suitable for the GART. */
-#define phys_to_gart(x) (x)
-#define gart_to_phys(x) (x)
-
-/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-#define alloc_gatt_pages(order) \
- ((char *)__get_free_pages(GFP_KERNEL, (order)))
-#define free_gatt_pages(table, order) \
- free_pages((unsigned long)(table), (order))
-
#endif
diff --git a/trunk/include/asm-ppc64/elf.h b/trunk/include/asm-ppc64/elf.h
index 085eedb956fe..6c42d61bedd1 100644
--- a/trunk/include/asm-ppc64/elf.h
+++ b/trunk/include/asm-ppc64/elf.h
@@ -221,7 +221,9 @@ do { \
set_thread_flag(TIF_ABI_PENDING); \
else \
clear_thread_flag(TIF_ABI_PENDING); \
- if (personality(current->personality) != PER_LINUX32) \
+ if (ibcs2) \
+ set_personality(PER_SVR4); \
+ else if (current->personality != PER_LINUX32) \
set_personality(PER_LINUX); \
} while (0)
diff --git a/trunk/include/asm-ppc64/processor.h b/trunk/include/asm-ppc64/processor.h
index 809c634ba1df..0035efe2db2b 100644
--- a/trunk/include/asm-ppc64/processor.h
+++ b/trunk/include/asm-ppc64/processor.h
@@ -120,18 +120,103 @@
/* Special Purpose Registers (SPRNs)*/
+#define SPRN_CDBCR 0x3D7 /* Cache Debug Control Register */
#define SPRN_CTR 0x009 /* Count Register */
#define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */
-#define DABR_TRANSLATION (1UL << 2)
+#define SPRN_DAC1 0x3F6 /* Data Address Compare 1 */
+#define SPRN_DAC2 0x3F7 /* Data Address Compare 2 */
#define SPRN_DAR 0x013 /* Data Address Register */
+#define SPRN_DBCR 0x3F2 /* Debug Control Regsiter */
+#define DBCR_EDM 0x80000000
+#define DBCR_IDM 0x40000000
+#define DBCR_RST(x) (((x) & 0x3) << 28)
+#define DBCR_RST_NONE 0
+#define DBCR_RST_CORE 1
+#define DBCR_RST_CHIP 2
+#define DBCR_RST_SYSTEM 3
+#define DBCR_IC 0x08000000 /* Instruction Completion Debug Evnt */
+#define DBCR_BT 0x04000000 /* Branch Taken Debug Event */
+#define DBCR_EDE 0x02000000 /* Exception Debug Event */
+#define DBCR_TDE 0x01000000 /* TRAP Debug Event */
+#define DBCR_FER 0x00F80000 /* First Events Remaining Mask */
+#define DBCR_FT 0x00040000 /* Freeze Timers on Debug Event */
+#define DBCR_IA1 0x00020000 /* Instr. Addr. Compare 1 Enable */
+#define DBCR_IA2 0x00010000 /* Instr. Addr. Compare 2 Enable */
+#define DBCR_D1R 0x00008000 /* Data Addr. Compare 1 Read Enable */
+#define DBCR_D1W 0x00004000 /* Data Addr. Compare 1 Write Enable */
+#define DBCR_D1S(x) (((x) & 0x3) << 12) /* Data Adrr. Compare 1 Size */
+#define DAC_BYTE 0
+#define DAC_HALF 1
+#define DAC_WORD 2
+#define DAC_QUAD 3
+#define DBCR_D2R 0x00000800 /* Data Addr. Compare 2 Read Enable */
+#define DBCR_D2W 0x00000400 /* Data Addr. Compare 2 Write Enable */
+#define DBCR_D2S(x) (((x) & 0x3) << 8) /* Data Addr. Compare 2 Size */
+#define DBCR_SBT 0x00000040 /* Second Branch Taken Debug Event */
+#define DBCR_SED 0x00000020 /* Second Exception Debug Event */
+#define DBCR_STD 0x00000010 /* Second Trap Debug Event */
+#define DBCR_SIA 0x00000008 /* Second IAC Enable */
+#define DBCR_SDA 0x00000004 /* Second DAC Enable */
+#define DBCR_JOI 0x00000002 /* JTAG Serial Outbound Int. Enable */
+#define DBCR_JII 0x00000001 /* JTAG Serial Inbound Int. Enable */
+#define SPRN_DBCR0 0x3F2 /* Debug Control Register 0 */
+#define SPRN_DBCR1 0x3BD /* Debug Control Register 1 */
+#define SPRN_DBSR 0x3F0 /* Debug Status Register */
+#define SPRN_DCCR 0x3FA /* Data Cache Cacheability Register */
+#define DCCR_NOCACHE 0 /* Noncacheable */
+#define DCCR_CACHE 1 /* Cacheable */
+#define SPRN_DCMP 0x3D1 /* Data TLB Compare Register */
+#define SPRN_DCWR 0x3BA /* Data Cache Write-thru Register */
+#define DCWR_COPY 0 /* Copy-back */
+#define DCWR_WRITE 1 /* Write-through */
+#define SPRN_DEAR 0x3D5 /* Data Error Address Register */
#define SPRN_DEC 0x016 /* Decrement Register */
+#define SPRN_DMISS 0x3D0 /* Data TLB Miss Register */
#define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */
#define DSISR_NOHPTE 0x40000000 /* no translation found */
#define DSISR_PROTFAULT 0x08000000 /* protection fault */
#define DSISR_ISSTORE 0x02000000 /* access was a store */
#define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */
#define DSISR_NOSEGMENT 0x00200000 /* STAB/SLB miss */
+#define SPRN_EAR 0x11A /* External Address Register */
+#define SPRN_ESR 0x3D4 /* Exception Syndrome Register */
+#define ESR_IMCP 0x80000000 /* Instr. Machine Check - Protection */
+#define ESR_IMCN 0x40000000 /* Instr. Machine Check - Non-config */
+#define ESR_IMCB 0x20000000 /* Instr. Machine Check - Bus error */
+#define ESR_IMCT 0x10000000 /* Instr. Machine Check - Timeout */
+#define ESR_PIL 0x08000000 /* Program Exception - Illegal */
+#define ESR_PPR 0x04000000 /* Program Exception - Priveleged */
+#define ESR_PTR 0x02000000 /* Program Exception - Trap */
+#define ESR_DST 0x00800000 /* Storage Exception - Data miss */
+#define ESR_DIZ 0x00400000 /* Storage Exception - Zone fault */
+#define SPRN_EVPR 0x3D6 /* Exception Vector Prefix Register */
+#define SPRN_HASH1 0x3D2 /* Primary Hash Address Register */
+#define SPRN_HASH2 0x3D3 /* Secondary Hash Address Resgister */
#define SPRN_HID0 0x3F0 /* Hardware Implementation Register 0 */
+#define HID0_EMCP (1<<31) /* Enable Machine Check pin */
+#define HID0_EBA (1<<29) /* Enable Bus Address Parity */
+#define HID0_EBD (1<<28) /* Enable Bus Data Parity */
+#define HID0_SBCLK (1<<27)
+#define HID0_EICE (1<<26)
+#define HID0_ECLK (1<<25)
+#define HID0_PAR (1<<24)
+#define HID0_DOZE (1<<23)
+#define HID0_NAP (1<<22)
+#define HID0_SLEEP (1<<21)
+#define HID0_DPM (1<<20)
+#define HID0_ICE (1<<15) /* Instruction Cache Enable */
+#define HID0_DCE (1<<14) /* Data Cache Enable */
+#define HID0_ILOCK (1<<13) /* Instruction Cache Lock */
+#define HID0_DLOCK (1<<12) /* Data Cache Lock */
+#define HID0_ICFI (1<<11) /* Instr. Cache Flash Invalidate */
+#define HID0_DCI (1<<10) /* Data Cache Invalidate */
+#define HID0_SPD (1<<9) /* Speculative disable */
+#define HID0_SGE (1<<7) /* Store Gathering Enable */
+#define HID0_SIED (1<<7) /* Serial Instr. Execution [Disable] */
+#define HID0_BTIC (1<<5) /* Branch Target Instruction Cache Enable */
+#define HID0_ABE (1<<3) /* Address Broadcast Enable */
+#define HID0_BHTE (1<<2) /* Branch History Table Enable */
+#define HID0_BTCD (1<<1) /* Branch target cache disable */
#define SPRN_MSRDORM 0x3F1 /* Hardware Implementation Register 1 */
#define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */
#define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */
@@ -140,8 +225,23 @@
#define SPRN_HID5 0x3F6 /* 970 HID5 */
#define SPRN_TSC 0x3FD /* Thread switch control */
#define SPRN_TST 0x3FC /* Thread switch timeout */
+#define SPRN_IAC1 0x3F4 /* Instruction Address Compare 1 */
+#define SPRN_IAC2 0x3F5 /* Instruction Address Compare 2 */
+#define SPRN_ICCR 0x3FB /* Instruction Cache Cacheability Register */
+#define ICCR_NOCACHE 0 /* Noncacheable */
+#define ICCR_CACHE 1 /* Cacheable */
+#define SPRN_ICDBDR 0x3D3 /* Instruction Cache Debug Data Register */
+#define SPRN_ICMP 0x3D5 /* Instruction TLB Compare Register */
+#define SPRN_ICTC 0x3FB /* Instruction Cache Throttling Control Reg */
+#define SPRN_IMISS 0x3D4 /* Instruction TLB Miss Register */
+#define SPRN_IMMR 0x27E /* Internal Memory Map Register */
#define SPRN_L2CR 0x3F9 /* Level 2 Cache Control Regsiter */
#define SPRN_LR 0x008 /* Link Register */
+#define SPRN_PBL1 0x3FC /* Protection Bound Lower 1 */
+#define SPRN_PBL2 0x3FE /* Protection Bound Lower 2 */
+#define SPRN_PBU1 0x3FD /* Protection Bound Upper 1 */
+#define SPRN_PBU2 0x3FF /* Protection Bound Upper 2 */
+#define SPRN_PID 0x3B1 /* Process ID */
#define SPRN_PIR 0x3FF /* Processor Identification Register */
#define SPRN_PIT 0x3DB /* Programmable Interval Timer */
#define SPRN_PURR 0x135 /* Processor Utilization of Resources Register */
@@ -149,6 +249,9 @@
#define SPRN_RPA 0x3D6 /* Required Physical Address Register */
#define SPRN_SDA 0x3BF /* Sampled Data Address Register */
#define SPRN_SDR1 0x019 /* MMU Hash Base Register */
+#define SPRN_SGR 0x3B9 /* Storage Guarded Register */
+#define SGR_NORMAL 0
+#define SGR_GUARDED 1
#define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */
#define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */
#define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */
@@ -161,12 +264,50 @@
#define SPRN_TBWL 0x11C /* Time Base Lower Register (super, W/O) */
#define SPRN_TBWU 0x11D /* Time Base Write Upper Register (super, W/O) */
#define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */
+#define SPRN_TCR 0x3DA /* Timer Control Register */
+#define TCR_WP(x) (((x)&0x3)<<30) /* WDT Period */
+#define WP_2_17 0 /* 2^17 clocks */
+#define WP_2_21 1 /* 2^21 clocks */
+#define WP_2_25 2 /* 2^25 clocks */
+#define WP_2_29 3 /* 2^29 clocks */
+#define TCR_WRC(x) (((x)&0x3)<<28) /* WDT Reset Control */
+#define WRC_NONE 0 /* No reset will occur */
+#define WRC_CORE 1 /* Core reset will occur */
+#define WRC_CHIP 2 /* Chip reset will occur */
+#define WRC_SYSTEM 3 /* System reset will occur */
+#define TCR_WIE 0x08000000 /* WDT Interrupt Enable */
+#define TCR_PIE 0x04000000 /* PIT Interrupt Enable */
+#define TCR_FP(x) (((x)&0x3)<<24) /* FIT Period */
+#define FP_2_9 0 /* 2^9 clocks */
+#define FP_2_13 1 /* 2^13 clocks */
+#define FP_2_17 2 /* 2^17 clocks */
+#define FP_2_21 3 /* 2^21 clocks */
+#define TCR_FIE 0x00800000 /* FIT Interrupt Enable */
+#define TCR_ARE 0x00400000 /* Auto Reload Enable */
+#define SPRN_THRM1 0x3FC /* Thermal Management Register 1 */
+#define THRM1_TIN (1<<0)
+#define THRM1_TIV (1<<1)
+#define THRM1_THRES (0x7f<<2)
+#define THRM1_TID (1<<29)
+#define THRM1_TIE (1<<30)
+#define THRM1_V (1<<31)
+#define SPRN_THRM2 0x3FD /* Thermal Management Register 2 */
+#define SPRN_THRM3 0x3FE /* Thermal Management Register 3 */
+#define THRM3_E (1<<31)
+#define SPRN_TSR 0x3D8 /* Timer Status Register */
+#define TSR_ENW 0x80000000 /* Enable Next Watchdog */
+#define TSR_WIS 0x40000000 /* WDT Interrupt Status */
+#define TSR_WRS(x) (((x)&0x3)<<28) /* WDT Reset Status */
+#define WRS_NONE 0 /* No WDT reset occurred */
+#define WRS_CORE 1 /* WDT forced core reset */
+#define WRS_CHIP 2 /* WDT forced chip reset */
+#define WRS_SYSTEM 3 /* WDT forced system reset */
+#define TSR_PIS 0x08000000 /* PIT Interrupt Status */
+#define TSR_FIS 0x04000000 /* FIT Interrupt Status */
#define SPRN_USIA 0x3AB /* User Sampled Instruction Address Register */
#define SPRN_XER 0x001 /* Fixed Point Exception Register */
+#define SPRN_ZPR 0x3B0 /* Zone Protection Register */
#define SPRN_VRSAVE 0x100 /* Vector save */
-#define SPRN_CTRLF 0x088
-#define SPRN_CTRLT 0x098
-#define CTRL_RUNLATCH 0x1
/* Performance monitor SPRs */
#define SPRN_SIAR 780
@@ -211,19 +352,28 @@
#define CTR SPRN_CTR /* Counter Register */
#define DAR SPRN_DAR /* Data Address Register */
#define DABR SPRN_DABR /* Data Address Breakpoint Register */
+#define DCMP SPRN_DCMP /* Data TLB Compare Register */
#define DEC SPRN_DEC /* Decrement Register */
+#define DMISS SPRN_DMISS /* Data TLB Miss Register */
#define DSISR SPRN_DSISR /* Data Storage Interrupt Status Register */
+#define EAR SPRN_EAR /* External Address Register */
+#define HASH1 SPRN_HASH1 /* Primary Hash Address Register */
+#define HASH2 SPRN_HASH2 /* Secondary Hash Address Register */
#define HID0 SPRN_HID0 /* Hardware Implementation Register 0 */
#define MSRDORM SPRN_MSRDORM /* MSR Dormant Register */
#define NIADORM SPRN_NIADORM /* NIA Dormant Register */
#define TSC SPRN_TSC /* Thread switch control */
#define TST SPRN_TST /* Thread switch timeout */
#define IABR SPRN_IABR /* Instruction Address Breakpoint Register */
+#define ICMP SPRN_ICMP /* Instruction TLB Compare Register */
+#define IMISS SPRN_IMISS /* Instruction TLB Miss Register */
+#define IMMR SPRN_IMMR /* PPC 860/821 Internal Memory Map Register */
#define L2CR SPRN_L2CR /* PPC 750 L2 control register */
#define __LR SPRN_LR
#define PVR SPRN_PVR /* Processor Version */
#define PIR SPRN_PIR /* Processor ID */
#define PURR SPRN_PURR /* Processor Utilization of Resource Register */
+//#define RPA SPRN_RPA /* Required Physical Address Register */
#define SDR1 SPRN_SDR1 /* MMU hash base register */
#define SPR0 SPRN_SPRG0 /* Supervisor Private Registers */
#define SPR1 SPRN_SPRG1
@@ -239,6 +389,10 @@
#define TBRU SPRN_TBRU /* Time Base Read Upper Register */
#define TBWL SPRN_TBWL /* Time Base Write Lower Register */
#define TBWU SPRN_TBWU /* Time Base Write Upper Register */
+#define ICTC 1019
+#define THRM1 SPRN_THRM1 /* Thermal Management Register 1 */
+#define THRM2 SPRN_THRM2 /* Thermal Management Register 2 */
+#define THRM3 SPRN_THRM3 /* Thermal Management Register 3 */
#define XER SPRN_XER
/* Processor Version Register (PVR) field extraction */
@@ -282,6 +436,12 @@
#define XGLUE(a,b) a##b
#define GLUE(a,b) XGLUE(a,b)
+/* iSeries CTRL register (for runlatch) */
+
+#define CTRLT 0x098
+#define CTRLF 0x088
+#define RUNLATCH 0x0001
+
#ifdef __ASSEMBLY__
#define _GLOBAL(name) \
@@ -496,24 +656,6 @@ static inline void prefetchw(const void *x)
#define HAVE_ARCH_PICK_MMAP_LAYOUT
-static inline void ppc64_runlatch_on(void)
-{
- unsigned long ctrl;
-
- ctrl = mfspr(SPRN_CTRLF);
- ctrl |= CTRL_RUNLATCH;
- mtspr(SPRN_CTRLT, ctrl);
-}
-
-static inline void ppc64_runlatch_off(void)
-{
- unsigned long ctrl;
-
- ctrl = mfspr(SPRN_CTRLF);
- ctrl &= ~CTRL_RUNLATCH;
- mtspr(SPRN_CTRLT, ctrl);
-}
-
#endif /* __KERNEL__ */
#endif /* __ASSEMBLY__ */
diff --git a/trunk/include/asm-ppc64/prom.h b/trunk/include/asm-ppc64/prom.h
index 04b1a84f7ca3..2440a2c90ae9 100644
--- a/trunk/include/asm-ppc64/prom.h
+++ b/trunk/include/asm-ppc64/prom.h
@@ -147,7 +147,9 @@ struct device_node {
struct device_node *sibling;
struct device_node *next; /* next device of same type */
struct device_node *allnext; /* next in list of all nodes */
- struct proc_dir_entry *pde; /* this node's proc directory */
+ struct proc_dir_entry *pde; /* this node's proc directory */
+ struct proc_dir_entry *name_link; /* name symlink */
+ struct proc_dir_entry *addr_link; /* addr symlink */
struct kref kref;
unsigned long _flags;
};
@@ -172,6 +174,15 @@ static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_e
dn->pde = de;
}
+static void inline set_node_name_link(struct device_node *dn, struct proc_dir_entry *de)
+{
+ dn->name_link = de;
+}
+
+static void inline set_node_addr_link(struct device_node *dn, struct proc_dir_entry *de)
+{
+ dn->addr_link = de;
+}
/* OBSOLETE: Old stlye node lookup */
extern struct device_node *find_devices(const char *name);
diff --git a/trunk/include/asm-ppc64/thread_info.h b/trunk/include/asm-ppc64/thread_info.h
index 48b7900e90ec..037b5e06083c 100644
--- a/trunk/include/asm-ppc64/thread_info.h
+++ b/trunk/include/asm-ppc64/thread_info.h
@@ -96,7 +96,7 @@ static inline struct thread_info *current_thread_info(void)
#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
TIF_NEED_RESCHED */
#define TIF_32BIT 5 /* 32 bit binary */
-/* #define SPARE 6 */
+#define TIF_RUN_LIGHT 6 /* iSeries run light */
#define TIF_ABI_PENDING 7 /* 32/64 bit switch needed */
#define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */
#define TIF_SINGLESTEP 9 /* singlestepping active */
@@ -110,7 +110,7 @@ static inline struct thread_info *current_thread_info(void)
#define _TIF_NEED_RESCHED (1<
-#include
+#include
/* Core file format: The core file is written in such a way that gdb
can understand it and provide useful information to the user (under
linux we use the 'trad-core' bfd). There are quite a number of
diff --git a/trunk/include/asm-sparc/uaccess.h b/trunk/include/asm-sparc/uaccess.h
index 0a780e84a12b..f461144067ee 100644
--- a/trunk/include/asm-sparc/uaccess.h
+++ b/trunk/include/asm-sparc/uaccess.h
@@ -41,11 +41,10 @@
* No one can read/write anything from userland in the kernel space by setting
* large size and address near to PAGE_OFFSET - a fault will break his intentions.
*/
-#define __user_ok(addr, size) ({ (void)(size); (addr) < STACK_TOP; })
+#define __user_ok(addr,size) ((addr) < STACK_TOP)
#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS))
#define __access_ok(addr,size) (__user_ok((addr) & get_fs().seg,(size)))
-#define access_ok(type, addr, size) \
- ({ (void)(type); __access_ok((unsigned long)(addr), size); })
+#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size))
/* this function will go away soon - use access_ok() instead */
static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
diff --git a/trunk/include/asm-sparc64/agp.h b/trunk/include/asm-sparc64/agp.h
index 58f8cb6ae767..ba05bdf9a211 100644
--- a/trunk/include/asm-sparc64/agp.h
+++ b/trunk/include/asm-sparc64/agp.h
@@ -8,14 +8,4 @@
#define flush_agp_mappings()
#define flush_agp_cache() mb()
-/* Convert a physical address to an address suitable for the GART. */
-#define phys_to_gart(x) (x)
-#define gart_to_phys(x) (x)
-
-/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-#define alloc_gatt_pages(order) \
- ((char *)__get_free_pages(GFP_KERNEL, (order)))
-#define free_gatt_pages(table, order) \
- free_pages((unsigned long)(table), (order))
-
#endif
diff --git a/trunk/include/asm-sparc64/iommu.h b/trunk/include/asm-sparc64/iommu.h
index 0de7a3da79cd..5fd16e42a045 100644
--- a/trunk/include/asm-sparc64/iommu.h
+++ b/trunk/include/asm-sparc64/iommu.h
@@ -16,6 +16,4 @@
#define IOPTE_CACHE 0x0000000000000010UL /* Cached (in UPA E-cache) */
#define IOPTE_WRITE 0x0000000000000002UL /* Writeable */
-#define IOMMU_NUM_CTXS 4096
-
#endif /* !(_SPARC_IOMMU_H) */
diff --git a/trunk/include/asm-sparc64/pbm.h b/trunk/include/asm-sparc64/pbm.h
index 4c15610a2bac..92999631c819 100644
--- a/trunk/include/asm-sparc64/pbm.h
+++ b/trunk/include/asm-sparc64/pbm.h
@@ -15,7 +15,6 @@
#include
#include
#include
-#include
/* The abstraction used here is that there are PCI controllers,
* each with one (Sabre) or two (PSYCHO/SCHIZO) PCI bus modules
@@ -41,6 +40,9 @@ struct pci_iommu {
*/
spinlock_t lock;
+ /* Context allocator. */
+ unsigned int iommu_cur_ctx;
+
/* IOMMU page table, a linear array of ioptes. */
iopte_t *page_table; /* The page table itself. */
int page_table_sz_bits; /* log2 of ow many pages does it map? */
@@ -85,10 +87,6 @@ struct pci_iommu {
u16 flush;
} alloc_info[PBM_NCLUSTERS];
- /* CTX allocation. */
- unsigned long ctx_lowest_free;
- unsigned long ctx_bitmap[IOMMU_NUM_CTXS / (sizeof(unsigned long) * 8)];
-
/* Here a PCI controller driver describes the areas of
* PCI memory space where DMA to/from physical memory
* are addressed. Drivers interrogate the PCI layer
diff --git a/trunk/include/asm-x86_64/agp.h b/trunk/include/asm-x86_64/agp.h
index 06c52ee9c06b..0bb9019d58aa 100644
--- a/trunk/include/asm-x86_64/agp.h
+++ b/trunk/include/asm-x86_64/agp.h
@@ -19,14 +19,4 @@ int unmap_page_from_agp(struct page *page);
worth it. Would need a page for it. */
#define flush_agp_cache() asm volatile("wbinvd":::"memory")
-/* Convert a physical address to an address suitable for the GART. */
-#define phys_to_gart(x) (x)
-#define gart_to_phys(x) (x)
-
-/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-#define alloc_gatt_pages(order) \
- ((char *)__get_free_pages(GFP_KERNEL, (order)))
-#define free_gatt_pages(table, order) \
- free_pages((unsigned long)(table), (order))
-
#endif
diff --git a/trunk/include/linux/acpi.h b/trunk/include/linux/acpi.h
index b123cc08773d..d5a55bdb9c3c 100644
--- a/trunk/include/linux/acpi.h
+++ b/trunk/include/linux/acpi.h
@@ -25,8 +25,6 @@
#ifndef _LINUX_ACPI_H
#define _LINUX_ACPI_H
-#include
-
#ifdef CONFIG_ACPI
#ifndef _LINUX
diff --git a/trunk/include/linux/cpufreq.h b/trunk/include/linux/cpufreq.h
index 927daa86c9b3..f21af067d015 100644
--- a/trunk/include/linux/cpufreq.h
+++ b/trunk/include/linux/cpufreq.h
@@ -49,7 +49,7 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
/* Frequency values here are CPU kHz so that hardware which doesn't run
* with some frequencies can complain without having to guess what per
* cent / per mille means.
- * Maximum transition latency is in nanoseconds - if it's unknown,
+ * Maximum transition latency is in microseconds - if it's unknown,
* CPUFREQ_ETERNAL shall be used.
*/
diff --git a/trunk/include/linux/if_shaper.h b/trunk/include/linux/if_shaper.h
index 004e6f09a6e2..0485b256d043 100644
--- a/trunk/include/linux/if_shaper.h
+++ b/trunk/include/linux/if_shaper.h
@@ -23,7 +23,7 @@ struct shaper
__u32 shapeclock;
unsigned long recovery; /* Time we can next clock a packet out on
an empty queue */
- struct semaphore sem;
+ unsigned long locked;
struct net_device_stats stats;
struct net_device *dev;
int (*hard_start_xmit) (struct sk_buff *skb,
@@ -38,6 +38,7 @@ struct shaper
int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh);
void (*header_cache_update)(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr);
struct net_device_stats* (*get_stats)(struct net_device *dev);
+ wait_queue_head_t wait_queue;
struct timer_list timer;
};
diff --git a/trunk/include/linux/libata.h b/trunk/include/linux/libata.h
index b009f801e7c5..e74f301e9bae 100644
--- a/trunk/include/linux/libata.h
+++ b/trunk/include/linux/libata.h
@@ -467,34 +467,12 @@ static inline u8 ata_chk_status(struct ata_port *ap)
return ap->ops->check_status(ap);
}
-
-/**
- * ata_pause - Flush writes and pause 400 nanoseconds.
- * @ap: Port to wait for.
- *
- * LOCKING:
- * Inherited from caller.
- */
-
static inline void ata_pause(struct ata_port *ap)
{
ata_altstatus(ap);
ndelay(400);
}
-
-/**
- * ata_busy_wait - Wait for a port status register
- * @ap: Port to wait for.
- *
- * Waits up to max*10 microseconds for the selected bits in the port's
- * status register to be cleared.
- * Returns final value of status register.
- *
- * LOCKING:
- * Inherited from caller.
- */
-
static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits,
unsigned int max)
{
@@ -509,18 +487,6 @@ static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits,
return status;
}
-
-/**
- * ata_wait_idle - Wait for a port to be idle.
- * @ap: Port to wait for.
- *
- * Waits up to 10ms for port's BUSY and DRQ signals to clear.
- * Returns final value of status register.
- *
- * LOCKING:
- * Inherited from caller.
- */
-
static inline u8 ata_wait_idle(struct ata_port *ap)
{
u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
@@ -559,18 +525,6 @@ static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, uns
tf->device = ATA_DEVICE_OBS | ATA_DEV1;
}
-
-/**
- * ata_irq_on - Enable interrupts on a port.
- * @ap: Port on which interrupts are enabled.
- *
- * Enable interrupts on a legacy IDE device using MMIO or PIO,
- * wait for idle, clear any pending interrupts.
- *
- * LOCKING:
- * Inherited from caller.
- */
-
static inline u8 ata_irq_on(struct ata_port *ap)
{
struct ata_ioports *ioaddr = &ap->ioaddr;
@@ -590,18 +544,6 @@ static inline u8 ata_irq_on(struct ata_port *ap)
return tmp;
}
-
-/**
- * ata_irq_ack - Acknowledge a device interrupt.
- * @ap: Port on which interrupts are enabled.
- *
- * Wait up to 10 ms for legacy IDE device to become idle (BUSY
- * or BUSY+DRQ clear). Obtain dma status and port status from
- * device. Clear the interrupt. Return port status.
- *
- * LOCKING:
- */
-
static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
{
unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY;
diff --git a/trunk/include/linux/netdevice.h b/trunk/include/linux/netdevice.h
index ba5d1236aa17..470af8c1a4a0 100644
--- a/trunk/include/linux/netdevice.h
+++ b/trunk/include/linux/netdevice.h
@@ -204,7 +204,7 @@ struct hh_cache
/* cached hardware header; allow for machine alignment needs. */
#define HH_DATA_MOD 16
#define HH_DATA_OFF(__len) \
- (HH_DATA_MOD - (((__len - 1) & (HH_DATA_MOD - 1)) + 1))
+ (HH_DATA_MOD - ((__len) & (HH_DATA_MOD - 1)))
#define HH_DATA_ALIGN(__len) \
(((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1))
unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)];
diff --git a/trunk/include/linux/pci_ids.h b/trunk/include/linux/pci_ids.h
index b8b4ebf9abf1..7ccbc2e4272c 100644
--- a/trunk/include/linux/pci_ids.h
+++ b/trunk/include/linux/pci_ids.h
@@ -874,7 +874,6 @@
#define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026
#define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027
#define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d
-#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e
#define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030
#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032
#define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033
@@ -1231,12 +1230,6 @@
#define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258
#define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259
#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B
-#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265
-#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266
-#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267
-#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268
-#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269
-#define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B
#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280
#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281
#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282
@@ -2383,8 +2376,6 @@
#define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582
#define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590
#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592
-#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770
-#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772
#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640
#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641
#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642
diff --git a/trunk/include/linux/tc_ematch/tc_em_meta.h b/trunk/include/linux/tc_ematch/tc_em_meta.h
index a6b2cc530af5..aa6b48bb4dcd 100644
--- a/trunk/include/linux/tc_ematch/tc_em_meta.h
+++ b/trunk/include/linux/tc_ematch/tc_em_meta.h
@@ -56,36 +56,6 @@ enum
TCF_META_ID_TCCLASSID,
TCF_META_ID_RTCLASSID,
TCF_META_ID_RTIIF,
- TCF_META_ID_SK_FAMILY,
- TCF_META_ID_SK_STATE,
- TCF_META_ID_SK_REUSE,
- TCF_META_ID_SK_BOUND_IF,
- TCF_META_ID_SK_REFCNT,
- TCF_META_ID_SK_SHUTDOWN,
- TCF_META_ID_SK_PROTO,
- TCF_META_ID_SK_TYPE,
- TCF_META_ID_SK_RCVBUF,
- TCF_META_ID_SK_RMEM_ALLOC,
- TCF_META_ID_SK_WMEM_ALLOC,
- TCF_META_ID_SK_OMEM_ALLOC,
- TCF_META_ID_SK_WMEM_QUEUED,
- TCF_META_ID_SK_RCV_QLEN,
- TCF_META_ID_SK_SND_QLEN,
- TCF_META_ID_SK_ERR_QLEN,
- TCF_META_ID_SK_FORWARD_ALLOCS,
- TCF_META_ID_SK_SNDBUF,
- TCF_META_ID_SK_ALLOCS,
- TCF_META_ID_SK_ROUTE_CAPS,
- TCF_META_ID_SK_HASHENT,
- TCF_META_ID_SK_LINGERTIME,
- TCF_META_ID_SK_ACK_BACKLOG,
- TCF_META_ID_SK_MAX_ACK_BACKLOG,
- TCF_META_ID_SK_PRIO,
- TCF_META_ID_SK_RCVLOWAT,
- TCF_META_ID_SK_RCVTIMEO,
- TCF_META_ID_SK_SNDTIMEO,
- TCF_META_ID_SK_SENDMSG_OFF,
- TCF_META_ID_SK_WRITE_PENDING,
__TCF_META_ID_MAX
};
#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
diff --git a/trunk/include/linux/usb.h b/trunk/include/linux/usb.h
index 2d1ac5058534..41d1a644c9d4 100644
--- a/trunk/include/linux/usb.h
+++ b/trunk/include/linux/usb.h
@@ -796,10 +796,6 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *);
* of the iso_frame_desc array, and the number of errors is reported in
* error_count. Completion callbacks for ISO transfers will normally
* (re)submit URBs to ensure a constant transfer rate.
- *
- * Note that even fields marked "public" should not be touched by the driver
- * when the urb is owned by the hcd, that is, since the call to
- * usb_submit_urb() till the entry into the completion routine.
*/
struct urb
{
@@ -807,12 +803,12 @@ struct urb
struct kref kref; /* reference count of the URB */
spinlock_t lock; /* lock for the URB */
void *hcpriv; /* private data for host controller */
+ struct list_head urb_list; /* list pointer to all active urbs */
int bandwidth; /* bandwidth for INT/ISO request */
atomic_t use_count; /* concurrent submissions counter */
u8 reject; /* submissions will fail */
/* public, documented fields in the urb that can be used by drivers */
- struct list_head urb_list; /* list head for use by the urb owner */
struct usb_device *dev; /* (in) pointer to associated device */
unsigned int pipe; /* (in) pipe information */
int status; /* (return) non-ISO status */
diff --git a/trunk/kernel/module.c b/trunk/kernel/module.c
index 83b3d376708c..5734ab09d3f9 100644
--- a/trunk/kernel/module.c
+++ b/trunk/kernel/module.c
@@ -1758,7 +1758,6 @@ sys_init_module(void __user *umod,
const char __user *uargs)
{
struct module *mod;
- mm_segment_t old_fs = get_fs();
int ret = 0;
/* Must have permission */
@@ -1776,9 +1775,6 @@ sys_init_module(void __user *umod,
return PTR_ERR(mod);
}
- /* flush the icache in correct context */
- set_fs(KERNEL_DS);
-
/* Flush the instruction cache, since we've played with text */
if (mod->module_init)
flush_icache_range((unsigned long)mod->module_init,
@@ -1787,8 +1783,6 @@ sys_init_module(void __user *umod,
flush_icache_range((unsigned long)mod->module_core,
(unsigned long)mod->module_core + mod->core_size);
- set_fs(old_fs);
-
/* Now sew it into the lists. They won't access us, since
strong_try_module_get() will fail. */
stop_machine_run(__link_module, mod, NR_CPUS);
diff --git a/trunk/mm/filemap.c b/trunk/mm/filemap.c
index 4a2fee2cb62b..1d33fec7bac6 100644
--- a/trunk/mm/filemap.c
+++ b/trunk/mm/filemap.c
@@ -1968,7 +1968,6 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
do {
unsigned long index;
unsigned long offset;
- unsigned long maxlen;
size_t copied;
offset = (pos & (PAGE_CACHE_SIZE -1)); /* Within page */
@@ -1983,10 +1982,7 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
* same page as we're writing to, without it being marked
* up-to-date.
*/
- maxlen = cur_iov->iov_len - iov_base;
- if (maxlen > bytes)
- maxlen = bytes;
- fault_in_pages_readable(buf, maxlen);
+ fault_in_pages_readable(buf, bytes);
page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec);
if (!page) {
@@ -2028,8 +2024,6 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
filemap_set_next_iovec(&cur_iov,
&iov_base, status);
buf = cur_iov->iov_base + iov_base;
- } else {
- iov_base += status;
}
}
}
diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c
index ab935778ce81..f15a3ffff635 100644
--- a/trunk/net/core/dev.c
+++ b/trunk/net/core/dev.c
@@ -1744,7 +1744,6 @@ static int process_backlog(struct net_device *backlog_dev, int *budget)
struct softnet_data *queue = &__get_cpu_var(softnet_data);
unsigned long start_time = jiffies;
- backlog_dev->weight = weight_p;
for (;;) {
struct sk_buff *skb;
struct net_device *dev;
diff --git a/trunk/net/core/ethtool.c b/trunk/net/core/ethtool.c
index a3eeb88e1c81..8ec484894d68 100644
--- a/trunk/net/core/ethtool.c
+++ b/trunk/net/core/ethtool.c
@@ -356,7 +356,7 @@ static int ethtool_set_coalesce(struct net_device *dev, void __user *useraddr)
{
struct ethtool_coalesce coalesce;
- if (!dev->ethtool_ops->set_coalesce)
+ if (!dev->ethtool_ops->get_coalesce)
return -EOPNOTSUPP;
if (copy_from_user(&coalesce, useraddr, sizeof(coalesce)))
diff --git a/trunk/net/core/net-sysfs.c b/trunk/net/core/net-sysfs.c
index e2137f3e489d..910eb4c05a47 100644
--- a/trunk/net/core/net-sysfs.c
+++ b/trunk/net/core/net-sysfs.c
@@ -185,22 +185,6 @@ static ssize_t store_tx_queue_len(struct class_device *dev, const char *buf, siz
static CLASS_DEVICE_ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len,
store_tx_queue_len);
-NETDEVICE_SHOW(weight, fmt_dec);
-
-static int change_weight(struct net_device *net, unsigned long new_weight)
-{
- net->weight = new_weight;
- return 0;
-}
-
-static ssize_t store_weight(struct class_device *dev, const char *buf, size_t len)
-{
- return netdev_store(dev, buf, len, change_weight);
-}
-
-static CLASS_DEVICE_ATTR(weight, S_IRUGO | S_IWUSR, show_weight,
- store_weight);
-
static struct class_device_attribute *net_class_attributes[] = {
&class_device_attr_ifindex,
@@ -210,7 +194,6 @@ static struct class_device_attribute *net_class_attributes[] = {
&class_device_attr_features,
&class_device_attr_mtu,
&class_device_attr_flags,
- &class_device_attr_weight,
&class_device_attr_type,
&class_device_attr_address,
&class_device_attr_broadcast,
diff --git a/trunk/net/ipv4/esp4.c b/trunk/net/ipv4/esp4.c
index eae84cc39d3f..053a883247ba 100644
--- a/trunk/net/ipv4/esp4.c
+++ b/trunk/net/ipv4/esp4.c
@@ -478,7 +478,7 @@ static int __init esp4_init(void)
{
struct xfrm_decap_state decap;
- if (sizeof(struct esp_decap_data) >
+ if (sizeof(struct esp_decap_data) <
sizeof(decap.decap_data)) {
extern void decap_data_too_small(void);
diff --git a/trunk/net/ipv4/ipvs/Makefile b/trunk/net/ipv4/ipvs/Makefile
index 30e85de9ffff..a788461a40c9 100644
--- a/trunk/net/ipv4/ipvs/Makefile
+++ b/trunk/net/ipv4/ipvs/Makefile
@@ -11,7 +11,7 @@ ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_AH) += ip_vs_proto_ah.o
ip_vs-objs := ip_vs_conn.o ip_vs_core.o ip_vs_ctl.o ip_vs_sched.o \
ip_vs_xmit.o ip_vs_app.o ip_vs_sync.o \
- ip_vs_est.o ip_vs_proto.o \
+ ip_vs_est.o ip_vs_proto.o ip_vs_proto_icmp.o \
$(ip_vs_proto-objs-y)
diff --git a/trunk/net/ipv4/ipvs/ip_vs_proto.c b/trunk/net/ipv4/ipvs/ip_vs_proto.c
index 867d4e9c6594..253c46252bd5 100644
--- a/trunk/net/ipv4/ipvs/ip_vs_proto.c
+++ b/trunk/net/ipv4/ipvs/ip_vs_proto.c
@@ -216,6 +216,9 @@ int ip_vs_protocol_init(void)
#ifdef CONFIG_IP_VS_PROTO_UDP
REGISTER_PROTOCOL(&ip_vs_protocol_udp);
#endif
+#ifdef CONFIG_IP_VS_PROTO_ICMP
+ REGISTER_PROTOCOL(&ip_vs_protocol_icmp);
+#endif
#ifdef CONFIG_IP_VS_PROTO_AH
REGISTER_PROTOCOL(&ip_vs_protocol_ah);
#endif
diff --git a/trunk/net/ipv4/ipvs/ip_vs_proto_icmp.c b/trunk/net/ipv4/ipvs/ip_vs_proto_icmp.c
new file mode 100644
index 000000000000..191e94aa1c1f
--- /dev/null
+++ b/trunk/net/ipv4/ipvs/ip_vs_proto_icmp.c
@@ -0,0 +1,182 @@
+/*
+ * ip_vs_proto_icmp.c: ICMP load balancing support for IP Virtual Server
+ *
+ * Authors: Julian Anastasov , March 2002
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation;
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+
+static int icmp_timeouts[1] = { 1*60*HZ };
+
+static char * icmp_state_name_table[1] = { "ICMP" };
+
+static struct ip_vs_conn *
+icmp_conn_in_get(const struct sk_buff *skb,
+ struct ip_vs_protocol *pp,
+ const struct iphdr *iph,
+ unsigned int proto_off,
+ int inverse)
+{
+#if 0
+ struct ip_vs_conn *cp;
+
+ if (likely(!inverse)) {
+ cp = ip_vs_conn_in_get(iph->protocol,
+ iph->saddr, 0,
+ iph->daddr, 0);
+ } else {
+ cp = ip_vs_conn_in_get(iph->protocol,
+ iph->daddr, 0,
+ iph->saddr, 0);
+ }
+
+ return cp;
+
+#else
+ return NULL;
+#endif
+}
+
+static struct ip_vs_conn *
+icmp_conn_out_get(const struct sk_buff *skb,
+ struct ip_vs_protocol *pp,
+ const struct iphdr *iph,
+ unsigned int proto_off,
+ int inverse)
+{
+#if 0
+ struct ip_vs_conn *cp;
+
+ if (likely(!inverse)) {
+ cp = ip_vs_conn_out_get(iph->protocol,
+ iph->saddr, 0,
+ iph->daddr, 0);
+ } else {
+ cp = ip_vs_conn_out_get(IPPROTO_UDP,
+ iph->daddr, 0,
+ iph->saddr, 0);
+ }
+
+ return cp;
+#else
+ return NULL;
+#endif
+}
+
+static int
+icmp_conn_schedule(struct sk_buff *skb, struct ip_vs_protocol *pp,
+ int *verdict, struct ip_vs_conn **cpp)
+{
+ *verdict = NF_ACCEPT;
+ return 0;
+}
+
+static int
+icmp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
+{
+ if (!(skb->nh.iph->frag_off & __constant_htons(IP_OFFSET))) {
+ if (skb->ip_summed != CHECKSUM_UNNECESSARY) {
+ if (ip_vs_checksum_complete(skb, skb->nh.iph->ihl * 4)) {
+ IP_VS_DBG_RL_PKT(0, pp, skb, 0, "Failed checksum for");
+ return 0;
+ }
+ }
+ }
+ return 1;
+}
+
+static void
+icmp_debug_packet(struct ip_vs_protocol *pp,
+ const struct sk_buff *skb,
+ int offset,
+ const char *msg)
+{
+ char buf[256];
+ struct iphdr _iph, *ih;
+
+ ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph);
+ if (ih == NULL)
+ sprintf(buf, "%s TRUNCATED", pp->name);
+ else if (ih->frag_off & __constant_htons(IP_OFFSET))
+ sprintf(buf, "%s %u.%u.%u.%u->%u.%u.%u.%u frag",
+ pp->name, NIPQUAD(ih->saddr),
+ NIPQUAD(ih->daddr));
+ else {
+ struct icmphdr _icmph, *ic;
+
+ ic = skb_header_pointer(skb, offset + ih->ihl*4,
+ sizeof(_icmph), &_icmph);
+ if (ic == NULL)
+ sprintf(buf, "%s TRUNCATED to %u bytes\n",
+ pp->name, skb->len - offset);
+ else
+ sprintf(buf, "%s %u.%u.%u.%u->%u.%u.%u.%u T:%d C:%d",
+ pp->name, NIPQUAD(ih->saddr),
+ NIPQUAD(ih->daddr),
+ ic->type, ic->code);
+ }
+ printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf);
+}
+
+static int
+icmp_state_transition(struct ip_vs_conn *cp, int direction,
+ const struct sk_buff *skb,
+ struct ip_vs_protocol *pp)
+{
+ cp->timeout = pp->timeout_table[IP_VS_ICMP_S_NORMAL];
+ return 1;
+}
+
+static int
+icmp_set_state_timeout(struct ip_vs_protocol *pp, char *sname, int to)
+{
+ int num;
+ char **names;
+
+ num = IP_VS_ICMP_S_LAST;
+ names = icmp_state_name_table;
+ return ip_vs_set_state_timeout(pp->timeout_table, num, names, sname, to);
+}
+
+
+static void icmp_init(struct ip_vs_protocol *pp)
+{
+ pp->timeout_table = icmp_timeouts;
+}
+
+static void icmp_exit(struct ip_vs_protocol *pp)
+{
+}
+
+struct ip_vs_protocol ip_vs_protocol_icmp = {
+ .name = "ICMP",
+ .protocol = IPPROTO_ICMP,
+ .dont_defrag = 0,
+ .init = icmp_init,
+ .exit = icmp_exit,
+ .conn_schedule = icmp_conn_schedule,
+ .conn_in_get = icmp_conn_in_get,
+ .conn_out_get = icmp_conn_out_get,
+ .snat_handler = NULL,
+ .dnat_handler = NULL,
+ .csum_check = icmp_csum_check,
+ .state_transition = icmp_state_transition,
+ .register_app = NULL,
+ .unregister_app = NULL,
+ .app_conn_bind = NULL,
+ .debug_packet = icmp_debug_packet,
+ .timeout_change = NULL,
+ .set_state_timeout = icmp_set_state_timeout,
+};
diff --git a/trunk/net/ipv4/netfilter/ip_queue.c b/trunk/net/ipv4/netfilter/ip_queue.c
index eda1fba431a4..e5746b674413 100644
--- a/trunk/net/ipv4/netfilter/ip_queue.c
+++ b/trunk/net/ipv4/netfilter/ip_queue.c
@@ -3,7 +3,6 @@
* communicating with userspace via netlink.
*
* (C) 2000-2002 James Morris
- * (C) 2003-2005 Netfilter Core Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -18,7 +17,6 @@
* 2005-01-10: Added /proc counter for dropped packets; fixed so
* packets aren't delivered to user space if they're going
* to be dropped.
- * 2005-05-26: local_bh_{disable,enable} around nf_reinject (Harald Welte)
*
*/
#include
@@ -73,15 +71,7 @@ static DECLARE_MUTEX(ipqnl_sem);
static void
ipq_issue_verdict(struct ipq_queue_entry *entry, int verdict)
{
- /* TCP input path (and probably other bits) assume to be called
- * from softirq context, not from syscall, like ipq_issue_verdict is
- * called. TCP input path deadlocks with locks taken from timer
- * softirq, e.g. We therefore emulate this by local_bh_disable() */
-
- local_bh_disable();
nf_reinject(entry->skb, entry->info, verdict);
- local_bh_enable();
-
kfree(entry);
}
diff --git a/trunk/net/ipv4/udp.c b/trunk/net/ipv4/udp.c
index 7c24e64b443f..4a6952e3fee9 100644
--- a/trunk/net/ipv4/udp.c
+++ b/trunk/net/ipv4/udp.c
@@ -738,7 +738,7 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
unsigned long amount;
amount = 0;
- spin_lock_bh(&sk->sk_receive_queue.lock);
+ spin_lock_irq(&sk->sk_receive_queue.lock);
skb = skb_peek(&sk->sk_receive_queue);
if (skb != NULL) {
/*
@@ -748,7 +748,7 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
*/
amount = skb->len - sizeof(struct udphdr);
}
- spin_unlock_bh(&sk->sk_receive_queue.lock);
+ spin_unlock_irq(&sk->sk_receive_queue.lock);
return put_user(amount, (int __user *)arg);
}
@@ -848,12 +848,12 @@ static int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
/* Clear queue. */
if (flags&MSG_PEEK) {
int clear = 0;
- spin_lock_bh(&sk->sk_receive_queue.lock);
+ spin_lock_irq(&sk->sk_receive_queue.lock);
if (skb == skb_peek(&sk->sk_receive_queue)) {
__skb_unlink(skb, &sk->sk_receive_queue);
clear = 1;
}
- spin_unlock_bh(&sk->sk_receive_queue.lock);
+ spin_unlock_irq(&sk->sk_receive_queue.lock);
if (clear)
kfree_skb(skb);
}
@@ -1334,7 +1334,7 @@ unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait)
struct sk_buff_head *rcvq = &sk->sk_receive_queue;
struct sk_buff *skb;
- spin_lock_bh(&rcvq->lock);
+ spin_lock_irq(&rcvq->lock);
while ((skb = skb_peek(rcvq)) != NULL) {
if (udp_checksum_complete(skb)) {
UDP_INC_STATS_BH(UDP_MIB_INERRORS);
@@ -1345,7 +1345,7 @@ unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait)
break;
}
}
- spin_unlock_bh(&rcvq->lock);
+ spin_unlock_irq(&rcvq->lock);
/* nothing to see, move along */
if (skb == NULL)
diff --git a/trunk/net/ipv6/ip6_tunnel.c b/trunk/net/ipv6/ip6_tunnel.c
index ba3b0c267f75..3b1c9fa184ae 100644
--- a/trunk/net/ipv6/ip6_tunnel.c
+++ b/trunk/net/ipv6/ip6_tunnel.c
@@ -882,7 +882,6 @@ ip6ip6_tnl_change(struct ip6_tnl *t, struct ip6_tnl_parm *p)
t->parms.hop_limit = p->hop_limit;
t->parms.encap_limit = p->encap_limit;
t->parms.flowinfo = p->flowinfo;
- t->parms.link = p->link;
ip6ip6_tnl_link_config(t);
return 0;
}
diff --git a/trunk/net/ipv6/ipv6_syms.c b/trunk/net/ipv6/ipv6_syms.c
index 5ade5a5d1990..2f4c91ddc9a3 100644
--- a/trunk/net/ipv6/ipv6_syms.c
+++ b/trunk/net/ipv6/ipv6_syms.c
@@ -37,4 +37,5 @@ EXPORT_SYMBOL(in6_dev_finish_destroy);
EXPORT_SYMBOL(xfrm6_rcv);
#endif
EXPORT_SYMBOL(rt6_lookup);
+EXPORT_SYMBOL(fl6_sock_lookup);
EXPORT_SYMBOL(ipv6_push_nfrag_opts);
diff --git a/trunk/net/sched/Kconfig b/trunk/net/sched/Kconfig
index b22c9beb604d..b0941186f867 100644
--- a/trunk/net/sched/Kconfig
+++ b/trunk/net/sched/Kconfig
@@ -405,7 +405,7 @@ config NET_EMATCH_STACK
---help---
Size of the local stack variable used while evaluating the tree of
ematches. Limits the depth of the tree, i.e. the number of
- encapsulated precedences. Every level requires 4 bytes of additional
+ encapsulated precedences. Every level requires 4 bytes of addtional
stack space.
config NET_EMATCH_CMP
diff --git a/trunk/net/sched/cls_basic.c b/trunk/net/sched/cls_basic.c
index dfb300bb6baa..0d2d4415f334 100644
--- a/trunk/net/sched/cls_basic.c
+++ b/trunk/net/sched/cls_basic.c
@@ -261,9 +261,6 @@ static int basic_dump(struct tcf_proto *tp, unsigned long fh,
rta = (struct rtattr *) b;
RTA_PUT(skb, TCA_OPTIONS, 0, NULL);
- if (f->res.classid)
- RTA_PUT(skb, TCA_BASIC_CLASSID, sizeof(u32), &f->res.classid);
-
if (tcf_exts_dump(skb, &f->exts, &basic_ext_map) < 0 ||
tcf_em_tree_dump(skb, &f->ematches, TCA_BASIC_EMATCHES) < 0)
goto rtattr_failure;
diff --git a/trunk/net/sched/em_meta.c b/trunk/net/sched/em_meta.c
index 48bb23c2a35a..f1eeaf65cee5 100644
--- a/trunk/net/sched/em_meta.c
+++ b/trunk/net/sched/em_meta.c
@@ -32,7 +32,7 @@
* +-----------+ +-----------+
* | |
* ---> meta_ops[INT][INDEV](...) |
- * | |
+ * | |
* ----------- |
* V V
* +-----------+ +-----------+
@@ -70,7 +70,6 @@
#include
#include
#include
-#include
struct meta_obj
{
@@ -284,214 +283,6 @@ META_COLLECTOR(int_rtiif)
dst->value = ((struct rtable*) skb->dst)->fl.iif;
}
-/**************************************************************************
- * Socket Attributes
- **************************************************************************/
-
-#define SKIP_NONLOCAL(skb) \
- if (unlikely(skb->sk == NULL)) { \
- *err = -1; \
- return; \
- }
-
-META_COLLECTOR(int_sk_family)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_family;
-}
-
-META_COLLECTOR(int_sk_state)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_state;
-}
-
-META_COLLECTOR(int_sk_reuse)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_reuse;
-}
-
-META_COLLECTOR(int_sk_bound_if)
-{
- SKIP_NONLOCAL(skb);
- /* No error if bound_dev_if is 0, legal userspace check */
- dst->value = skb->sk->sk_bound_dev_if;
-}
-
-META_COLLECTOR(var_sk_bound_if)
-{
- SKIP_NONLOCAL(skb);
-
- if (skb->sk->sk_bound_dev_if == 0) {
- dst->value = (unsigned long) "any";
- dst->len = 3;
- } else {
- struct net_device *dev;
-
- dev = dev_get_by_index(skb->sk->sk_bound_dev_if);
- *err = var_dev(dev, dst);
- if (dev)
- dev_put(dev);
- }
-}
-
-META_COLLECTOR(int_sk_refcnt)
-{
- SKIP_NONLOCAL(skb);
- dst->value = atomic_read(&skb->sk->sk_refcnt);
-}
-
-META_COLLECTOR(int_sk_rcvbuf)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_rcvbuf;
-}
-
-META_COLLECTOR(int_sk_shutdown)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_shutdown;
-}
-
-META_COLLECTOR(int_sk_proto)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_protocol;
-}
-
-META_COLLECTOR(int_sk_type)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_type;
-}
-
-META_COLLECTOR(int_sk_rmem_alloc)
-{
- SKIP_NONLOCAL(skb);
- dst->value = atomic_read(&skb->sk->sk_rmem_alloc);
-}
-
-META_COLLECTOR(int_sk_wmem_alloc)
-{
- SKIP_NONLOCAL(skb);
- dst->value = atomic_read(&skb->sk->sk_wmem_alloc);
-}
-
-META_COLLECTOR(int_sk_omem_alloc)
-{
- SKIP_NONLOCAL(skb);
- dst->value = atomic_read(&skb->sk->sk_omem_alloc);
-}
-
-META_COLLECTOR(int_sk_rcv_qlen)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_receive_queue.qlen;
-}
-
-META_COLLECTOR(int_sk_snd_qlen)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_write_queue.qlen;
-}
-
-META_COLLECTOR(int_sk_wmem_queued)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_wmem_queued;
-}
-
-META_COLLECTOR(int_sk_fwd_alloc)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_forward_alloc;
-}
-
-META_COLLECTOR(int_sk_sndbuf)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_sndbuf;
-}
-
-META_COLLECTOR(int_sk_alloc)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_allocation;
-}
-
-META_COLLECTOR(int_sk_route_caps)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_route_caps;
-}
-
-META_COLLECTOR(int_sk_hashent)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_hashent;
-}
-
-META_COLLECTOR(int_sk_lingertime)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_lingertime / HZ;
-}
-
-META_COLLECTOR(int_sk_err_qlen)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_error_queue.qlen;
-}
-
-META_COLLECTOR(int_sk_ack_bl)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_ack_backlog;
-}
-
-META_COLLECTOR(int_sk_max_ack_bl)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_max_ack_backlog;
-}
-
-META_COLLECTOR(int_sk_prio)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_priority;
-}
-
-META_COLLECTOR(int_sk_rcvlowat)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_rcvlowat;
-}
-
-META_COLLECTOR(int_sk_rcvtimeo)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_rcvtimeo / HZ;
-}
-
-META_COLLECTOR(int_sk_sndtimeo)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_sndtimeo / HZ;
-}
-
-META_COLLECTOR(int_sk_sendmsg_off)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_sndmsg_off;
-}
-
-META_COLLECTOR(int_sk_write_pend)
-{
- SKIP_NONLOCAL(skb);
- dst->value = skb->sk->sk_write_pending;
-}
-
/**************************************************************************
* Meta value collectors assignment table
**************************************************************************/
@@ -502,75 +293,41 @@ struct meta_ops
struct meta_value *, struct meta_obj *, int *);
};
-#define META_ID(name) TCF_META_ID_##name
-#define META_FUNC(name) { .get = meta_##name }
-
/* Meta value operations table listing all meta value collectors and
* assigns them to a type and meta id. */
static struct meta_ops __meta_ops[TCF_META_TYPE_MAX+1][TCF_META_ID_MAX+1] = {
[TCF_META_TYPE_VAR] = {
- [META_ID(DEV)] = META_FUNC(var_dev),
- [META_ID(INDEV)] = META_FUNC(var_indev),
- [META_ID(REALDEV)] = META_FUNC(var_realdev),
- [META_ID(SK_BOUND_IF)] = META_FUNC(var_sk_bound_if),
+ [TCF_META_ID_DEV] = { .get = meta_var_dev },
+ [TCF_META_ID_INDEV] = { .get = meta_var_indev },
+ [TCF_META_ID_REALDEV] = { .get = meta_var_realdev }
},
[TCF_META_TYPE_INT] = {
- [META_ID(RANDOM)] = META_FUNC(int_random),
- [META_ID(LOADAVG_0)] = META_FUNC(int_loadavg_0),
- [META_ID(LOADAVG_1)] = META_FUNC(int_loadavg_1),
- [META_ID(LOADAVG_2)] = META_FUNC(int_loadavg_2),
- [META_ID(DEV)] = META_FUNC(int_dev),
- [META_ID(INDEV)] = META_FUNC(int_indev),
- [META_ID(REALDEV)] = META_FUNC(int_realdev),
- [META_ID(PRIORITY)] = META_FUNC(int_priority),
- [META_ID(PROTOCOL)] = META_FUNC(int_protocol),
- [META_ID(SECURITY)] = META_FUNC(int_security),
- [META_ID(PKTTYPE)] = META_FUNC(int_pkttype),
- [META_ID(PKTLEN)] = META_FUNC(int_pktlen),
- [META_ID(DATALEN)] = META_FUNC(int_datalen),
- [META_ID(MACLEN)] = META_FUNC(int_maclen),
+ [TCF_META_ID_RANDOM] = { .get = meta_int_random },
+ [TCF_META_ID_LOADAVG_0] = { .get = meta_int_loadavg_0 },
+ [TCF_META_ID_LOADAVG_1] = { .get = meta_int_loadavg_1 },
+ [TCF_META_ID_LOADAVG_2] = { .get = meta_int_loadavg_2 },
+ [TCF_META_ID_DEV] = { .get = meta_int_dev },
+ [TCF_META_ID_INDEV] = { .get = meta_int_indev },
+ [TCF_META_ID_REALDEV] = { .get = meta_int_realdev },
+ [TCF_META_ID_PRIORITY] = { .get = meta_int_priority },
+ [TCF_META_ID_PROTOCOL] = { .get = meta_int_protocol },
+ [TCF_META_ID_SECURITY] = { .get = meta_int_security },
+ [TCF_META_ID_PKTTYPE] = { .get = meta_int_pkttype },
+ [TCF_META_ID_PKTLEN] = { .get = meta_int_pktlen },
+ [TCF_META_ID_DATALEN] = { .get = meta_int_datalen },
+ [TCF_META_ID_MACLEN] = { .get = meta_int_maclen },
#ifdef CONFIG_NETFILTER
- [META_ID(NFMARK)] = META_FUNC(int_nfmark),
+ [TCF_META_ID_NFMARK] = { .get = meta_int_nfmark },
#endif
- [META_ID(TCINDEX)] = META_FUNC(int_tcindex),
+ [TCF_META_ID_TCINDEX] = { .get = meta_int_tcindex },
#ifdef CONFIG_NET_CLS_ACT
- [META_ID(TCVERDICT)] = META_FUNC(int_tcverd),
- [META_ID(TCCLASSID)] = META_FUNC(int_tcclassid),
+ [TCF_META_ID_TCVERDICT] = { .get = meta_int_tcverd },
+ [TCF_META_ID_TCCLASSID] = { .get = meta_int_tcclassid },
#endif
#ifdef CONFIG_NET_CLS_ROUTE
- [META_ID(RTCLASSID)] = META_FUNC(int_rtclassid),
+ [TCF_META_ID_RTCLASSID] = { .get = meta_int_rtclassid },
#endif
- [META_ID(RTIIF)] = META_FUNC(int_rtiif),
- [META_ID(SK_FAMILY)] = META_FUNC(int_sk_family),
- [META_ID(SK_STATE)] = META_FUNC(int_sk_state),
- [META_ID(SK_REUSE)] = META_FUNC(int_sk_reuse),
- [META_ID(SK_BOUND_IF)] = META_FUNC(int_sk_bound_if),
- [META_ID(SK_REFCNT)] = META_FUNC(int_sk_refcnt),
- [META_ID(SK_RCVBUF)] = META_FUNC(int_sk_rcvbuf),
- [META_ID(SK_SNDBUF)] = META_FUNC(int_sk_sndbuf),
- [META_ID(SK_SHUTDOWN)] = META_FUNC(int_sk_shutdown),
- [META_ID(SK_PROTO)] = META_FUNC(int_sk_proto),
- [META_ID(SK_TYPE)] = META_FUNC(int_sk_type),
- [META_ID(SK_RMEM_ALLOC)] = META_FUNC(int_sk_rmem_alloc),
- [META_ID(SK_WMEM_ALLOC)] = META_FUNC(int_sk_wmem_alloc),
- [META_ID(SK_OMEM_ALLOC)] = META_FUNC(int_sk_omem_alloc),
- [META_ID(SK_WMEM_QUEUED)] = META_FUNC(int_sk_wmem_queued),
- [META_ID(SK_RCV_QLEN)] = META_FUNC(int_sk_rcv_qlen),
- [META_ID(SK_SND_QLEN)] = META_FUNC(int_sk_snd_qlen),
- [META_ID(SK_ERR_QLEN)] = META_FUNC(int_sk_err_qlen),
- [META_ID(SK_FORWARD_ALLOCS)] = META_FUNC(int_sk_fwd_alloc),
- [META_ID(SK_ALLOCS)] = META_FUNC(int_sk_alloc),
- [META_ID(SK_ROUTE_CAPS)] = META_FUNC(int_sk_route_caps),
- [META_ID(SK_HASHENT)] = META_FUNC(int_sk_hashent),
- [META_ID(SK_LINGERTIME)] = META_FUNC(int_sk_lingertime),
- [META_ID(SK_ACK_BACKLOG)] = META_FUNC(int_sk_ack_bl),
- [META_ID(SK_MAX_ACK_BACKLOG)] = META_FUNC(int_sk_max_ack_bl),
- [META_ID(SK_PRIO)] = META_FUNC(int_sk_prio),
- [META_ID(SK_RCVLOWAT)] = META_FUNC(int_sk_rcvlowat),
- [META_ID(SK_RCVTIMEO)] = META_FUNC(int_sk_rcvtimeo),
- [META_ID(SK_SNDTIMEO)] = META_FUNC(int_sk_sndtimeo),
- [META_ID(SK_SENDMSG_OFF)] = META_FUNC(int_sk_sendmsg_off),
- [META_ID(SK_WRITE_PENDING)] = META_FUNC(int_sk_write_pend),
+ [TCF_META_ID_RTIIF] = { .get = meta_int_rtiif }
}
};
@@ -639,9 +396,9 @@ static int meta_int_compare(struct meta_obj *a, struct meta_obj *b)
/* Let gcc optimize it, the unlikely is not really based on
* some numbers but jump free code for mismatches seems
* more logical. */
- if (unlikely(a->value == b->value))
+ if (unlikely(a == b))
return 0;
- else if (a->value < b->value)
+ else if (a < b)
return -1;
else
return 1;
diff --git a/trunk/net/sched/sch_dsmark.c b/trunk/net/sched/sch_dsmark.c
index d8bd2a569c7c..8a3db9d95bab 100644
--- a/trunk/net/sched/sch_dsmark.c
+++ b/trunk/net/sched/sch_dsmark.c
@@ -18,7 +18,7 @@
#include
-#if 0 /* control */
+#if 1 /* control */
#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
#else
#define DPRINTK(format,args...)
@@ -73,13 +73,8 @@ static int dsmark_graft(struct Qdisc *sch,unsigned long arg,
DPRINTK("dsmark_graft(sch %p,[qdisc %p],new %p,old %p)\n",sch,p,new,
old);
-
- if (new == NULL) {
- new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops);
- if (new == NULL)
- new = &noop_qdisc;
- }
-
+ if (!new)
+ new = &noop_qdisc;
sch_tree_lock(sch);
*old = xchg(&p->q,new);
if (*old)
@@ -168,15 +163,14 @@ static void dsmark_walk(struct Qdisc *sch,struct qdisc_walker *walker)
return;
for (i = 0; i < p->indices; i++) {
if (p->mask[i] == 0xff && !p->value[i])
- goto ignore;
+ continue;
if (walker->count >= walker->skip) {
if (walker->fn(sch, i+1, walker) < 0) {
walker->stop = 1;
break;
}
}
-ignore:
- walker->count++;
+ walker->count++;
}
}