mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 12:44:11 +08:00
Merge branch 'merge'
This commit is contained in:
commit
32bc6e095d
5
.gitignore
vendored
5
.gitignore
vendored
@ -30,6 +30,11 @@ include/config
|
||||
include/linux/autoconf.h
|
||||
include/linux/compile.h
|
||||
include/linux/version.h
|
||||
include/linux/utsrelease.h
|
||||
|
||||
# stgit generated dirs
|
||||
patches-*
|
||||
|
||||
# quilt's files
|
||||
patches
|
||||
series
|
||||
|
@ -153,10 +153,13 @@ scaling_governor, and by "echoing" the name of another
|
||||
that some governors won't load - they only
|
||||
work on some specific architectures or
|
||||
processors.
|
||||
scaling_min_freq and
|
||||
scaling_min_freq and
|
||||
scaling_max_freq show the current "policy limits" (in
|
||||
kHz). By echoing new values into these
|
||||
files, you can change these limits.
|
||||
NOTE: when setting a policy you need to
|
||||
first set scaling_max_freq, then
|
||||
scaling_min_freq.
|
||||
|
||||
|
||||
If you have selected the "userspace" governor which allows you to
|
||||
|
@ -51,8 +51,6 @@ Debugging Information
|
||||
|
||||
References
|
||||
|
||||
IETF IP over InfiniBand (ipoib) Working Group
|
||||
http://ietf.org/html.charters/ipoib-charter.html
|
||||
Transmission of IP over InfiniBand (IPoIB) (RFC 4391)
|
||||
http://ietf.org/rfc/rfc4391.txt
|
||||
IP over InfiniBand (IPoIB) Architecture (RFC 4392)
|
||||
|
@ -211,9 +211,8 @@ Controls the kernel's behaviour when an oops or BUG is encountered.
|
||||
|
||||
0: try to continue operation
|
||||
|
||||
1: delay a few seconds (to give klogd time to record the oops output) and
|
||||
then panic. If the `panic' sysctl is also non-zero then the machine will
|
||||
be rebooted.
|
||||
1: panic immediatly. If the `panic' sysctl is also non-zero then the
|
||||
machine will be rebooted.
|
||||
|
||||
==============================================================
|
||||
|
||||
|
@ -59,7 +59,7 @@ bind to an interface (or perhaps several) using an ioctl call. You
|
||||
would issue more ioctls to the device to communicate to it using
|
||||
control, bulk, or other kinds of USB transfers. The IOCTLs are
|
||||
listed in the <linux/usbdevice_fs.h> file, and at this writing the
|
||||
source code (linux/drivers/usb/devio.c) is the primary reference
|
||||
source code (linux/drivers/usb/core/devio.c) is the primary reference
|
||||
for how to access devices through those files.
|
||||
|
||||
Note that since by default these BBB/DDD files are writable only by
|
||||
|
@ -5,8 +5,7 @@ For USB help other than the readme files that are located in
|
||||
Documentation/usb/*, see the following:
|
||||
|
||||
Linux-USB project: http://www.linux-usb.org
|
||||
mirrors at http://www.suse.cz/development/linux-usb/
|
||||
and http://usb.in.tum.de/linux-usb/
|
||||
mirrors at http://usb.in.tum.de/linux-usb/
|
||||
and http://it.linux-usb.org
|
||||
Linux USB Guide: http://linux-usb.sourceforge.net
|
||||
Linux-USB device overview (working devices and drivers):
|
||||
|
21
MAINTAINERS
21
MAINTAINERS
@ -214,6 +214,12 @@ W: http://acpi.sourceforge.net/
|
||||
T: git kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git
|
||||
S: Maintained
|
||||
|
||||
ACPI PCI HOTPLUG DRIVER
|
||||
P: Kristen Carlson Accardi
|
||||
M: kristen.c.accardi@intel.com
|
||||
L: pcihpd-discuss@lists.sourceforge.net
|
||||
S: Maintained
|
||||
|
||||
AD1816 SOUND DRIVER
|
||||
P: Thorsten Knabe
|
||||
M: Thorsten Knabe <linux@thorsten-knabe.de>
|
||||
@ -292,6 +298,13 @@ L: info-linux@geode.amd.com
|
||||
W: http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html
|
||||
S: Supported
|
||||
|
||||
AOA (Apple Onboard Audio) ALSA DRIVER
|
||||
P: Johannes Berg
|
||||
M: johannes@sipsolutions.net
|
||||
L: linuxppc-dev@ozlabs.org
|
||||
L: alsa-devel@alsa-project.org
|
||||
S: Maintained
|
||||
|
||||
APM DRIVER
|
||||
P: Stephen Rothwell
|
||||
M: sfr@canb.auug.org.au
|
||||
@ -2635,6 +2648,14 @@ M: dbrownell@users.sourceforge.net
|
||||
L: spi-devel-general@lists.sourceforge.net
|
||||
S: Maintained
|
||||
|
||||
STABLE BRANCH:
|
||||
P: Greg Kroah-Hartman
|
||||
M: greg@kroah.com
|
||||
P: Chris Wright
|
||||
M: chrisw@sous-sol.org
|
||||
L: stable@kernel.org
|
||||
S: Maintained
|
||||
|
||||
TPM DEVICE DRIVER
|
||||
P: Kylene Hall
|
||||
M: kjhall@us.ibm.com
|
||||
|
7
Makefile
7
Makefile
@ -1,7 +1,7 @@
|
||||
VERSION = 2
|
||||
PATCHLEVEL = 6
|
||||
SUBLEVEL = 18
|
||||
EXTRAVERSION = -rc3
|
||||
EXTRAVERSION = -rc4
|
||||
NAME=Crazed Snow-Weasel
|
||||
|
||||
# *DOCUMENTATION*
|
||||
@ -310,8 +310,8 @@ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
|
||||
CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
||||
-fno-strict-aliasing -fno-common
|
||||
# Force gcc to behave correct even for buggy distributions
|
||||
CFLAGS += $(call cc-option, -fno-stack-protector-all \
|
||||
-fno-stack-protector)
|
||||
CFLAGS += $(call cc-option, -fno-stack-protector)
|
||||
|
||||
AFLAGS := -D__ASSEMBLY__
|
||||
|
||||
# Read KERNELRELEASE from include/config/kernel.release (if it exists)
|
||||
@ -368,6 +368,7 @@ endif
|
||||
|
||||
no-dot-config-targets := clean mrproper distclean \
|
||||
cscope TAGS tags help %docs check% \
|
||||
include/linux/version.h headers_% \
|
||||
kernelrelease kernelversion
|
||||
|
||||
config-targets := 0
|
||||
|
@ -95,7 +95,8 @@ static void gic_set_cpu(unsigned int irq, cpumask_t mask_val)
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct irqchip gic_chip = {
|
||||
static struct irq_chip gic_chip = {
|
||||
.name = "GIC",
|
||||
.ack = gic_ack_irq,
|
||||
.mask = gic_mask_irq,
|
||||
.unmask = gic_unmask_irq,
|
||||
|
@ -204,7 +204,8 @@ static void locomo_unmask_irq(unsigned int irq)
|
||||
locomo_writel(r, mapbase + LOCOMO_ICR);
|
||||
}
|
||||
|
||||
static struct irqchip locomo_chip = {
|
||||
static struct irq_chip locomo_chip = {
|
||||
.name = "LOCOMO",
|
||||
.ack = locomo_ack_irq,
|
||||
.mask = locomo_mask_irq,
|
||||
.unmask = locomo_unmask_irq,
|
||||
@ -249,7 +250,8 @@ static void locomo_key_unmask_irq(unsigned int irq)
|
||||
locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
|
||||
}
|
||||
|
||||
static struct irqchip locomo_key_chip = {
|
||||
static struct irq_chip locomo_key_chip = {
|
||||
.name = "LOCOMO-key",
|
||||
.ack = locomo_key_ack_irq,
|
||||
.mask = locomo_key_mask_irq,
|
||||
.unmask = locomo_key_unmask_irq,
|
||||
@ -312,7 +314,8 @@ static void locomo_gpio_unmask_irq(unsigned int irq)
|
||||
locomo_writel(r, mapbase + LOCOMO_GIE);
|
||||
}
|
||||
|
||||
static struct irqchip locomo_gpio_chip = {
|
||||
static struct irq_chip locomo_gpio_chip = {
|
||||
.name = "LOCOMO-gpio",
|
||||
.ack = locomo_gpio_ack_irq,
|
||||
.mask = locomo_gpio_mask_irq,
|
||||
.unmask = locomo_gpio_unmask_irq,
|
||||
@ -357,7 +360,8 @@ static void locomo_lt_unmask_irq(unsigned int irq)
|
||||
locomo_writel(r, mapbase + LOCOMO_LTINT);
|
||||
}
|
||||
|
||||
static struct irqchip locomo_lt_chip = {
|
||||
static struct irq_chip locomo_lt_chip = {
|
||||
.name = "LOCOMO-lt",
|
||||
.ack = locomo_lt_ack_irq,
|
||||
.mask = locomo_lt_mask_irq,
|
||||
.unmask = locomo_lt_unmask_irq,
|
||||
@ -418,7 +422,8 @@ static void locomo_spi_unmask_irq(unsigned int irq)
|
||||
locomo_writel(r, mapbase + LOCOMO_SPIIE);
|
||||
}
|
||||
|
||||
static struct irqchip locomo_spi_chip = {
|
||||
static struct irq_chip locomo_spi_chip = {
|
||||
.name = "LOCOMO-spi",
|
||||
.ack = locomo_spi_ack_irq,
|
||||
.mask = locomo_spi_mask_irq,
|
||||
.unmask = locomo_spi_unmask_irq,
|
||||
|
@ -272,7 +272,8 @@ static int sa1111_wake_lowirq(unsigned int irq, unsigned int on)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irqchip sa1111_low_chip = {
|
||||
static struct irq_chip sa1111_low_chip = {
|
||||
.name = "SA1111-l",
|
||||
.ack = sa1111_ack_irq,
|
||||
.mask = sa1111_mask_lowirq,
|
||||
.unmask = sa1111_unmask_lowirq,
|
||||
@ -368,7 +369,8 @@ static int sa1111_wake_highirq(unsigned int irq, unsigned int on)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irqchip sa1111_high_chip = {
|
||||
static struct irq_chip sa1111_high_chip = {
|
||||
.name = "SA1111-h",
|
||||
.ack = sa1111_ack_irq,
|
||||
.mask = sa1111_mask_highirq,
|
||||
.unmask = sa1111_unmask_highirq,
|
||||
|
@ -39,7 +39,8 @@ static void vic_unmask_irq(unsigned int irq)
|
||||
writel(1 << irq, base + VIC_INT_ENABLE);
|
||||
}
|
||||
|
||||
static struct irqchip vic_chip = {
|
||||
static struct irq_chip vic_chip = {
|
||||
.name = "VIC",
|
||||
.ack = vic_mask_irq,
|
||||
.mask = vic_mask_irq,
|
||||
.unmask = vic_unmask_irq,
|
||||
|
@ -470,7 +470,8 @@ static void ecard_irq_mask(unsigned int irqnr)
|
||||
}
|
||||
}
|
||||
|
||||
static struct irqchip ecard_chip = {
|
||||
static struct irq_chip ecard_chip = {
|
||||
.name = "ECARD",
|
||||
.ack = ecard_irq_mask,
|
||||
.mask = ecard_irq_mask,
|
||||
.unmask = ecard_irq_unmask,
|
||||
|
@ -77,6 +77,7 @@ int show_interrupts(struct seq_file *p, void *v)
|
||||
seq_printf(p, "%3d: ", i);
|
||||
for_each_present_cpu(cpu)
|
||||
seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]);
|
||||
seq_printf(p, " %10s", irq_desc[i].chip->name ? : "-");
|
||||
seq_printf(p, " %s", action->name);
|
||||
for (action = action->next; action; action = action->next)
|
||||
seq_printf(p, ", %s", action->name);
|
||||
|
@ -327,7 +327,8 @@ static int gpio_irq_type(unsigned pin, unsigned type)
|
||||
return (type == IRQT_BOTHEDGE) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
static struct irqchip gpio_irqchip = {
|
||||
static struct irq_chip gpio_irqchip = {
|
||||
.name = "GPIO",
|
||||
.mask = gpio_irq_mask,
|
||||
.unmask = gpio_irq_unmask,
|
||||
.set_type = gpio_irq_type,
|
||||
|
@ -114,7 +114,8 @@ void at91_irq_resume(void)
|
||||
#define at91_aic_set_wake NULL
|
||||
#endif
|
||||
|
||||
static struct irqchip at91_aic_chip = {
|
||||
static struct irq_chip at91_aic_chip = {
|
||||
.name = "AIC",
|
||||
.ack = at91_aic_mask_irq,
|
||||
.mask = at91_aic_mask_irq,
|
||||
.unmask = at91_aic_unmask_irq,
|
||||
|
@ -204,13 +204,15 @@ imx_gpiod_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
|
||||
imx_gpio_handler(mask, irq, desc, regs);
|
||||
}
|
||||
|
||||
static struct irqchip imx_internal_chip = {
|
||||
static struct irq_chip imx_internal_chip = {
|
||||
.name = "MPU",
|
||||
.ack = imx_mask_irq,
|
||||
.mask = imx_mask_irq,
|
||||
.unmask = imx_unmask_irq,
|
||||
};
|
||||
|
||||
static struct irqchip imx_gpio_chip = {
|
||||
static struct irq_chip imx_gpio_chip = {
|
||||
.name = "GPIO",
|
||||
.ack = imx_gpio_ack_irq,
|
||||
.mask = imx_gpio_mask_irq,
|
||||
.unmask = imx_gpio_unmask_irq,
|
||||
|
@ -161,7 +161,8 @@ static void sc_unmask_irq(unsigned int irq)
|
||||
writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_SET);
|
||||
}
|
||||
|
||||
static struct irqchip sc_chip = {
|
||||
static struct irq_chip sc_chip = {
|
||||
.name = "SC",
|
||||
.ack = sc_mask_irq,
|
||||
.mask = sc_mask_irq,
|
||||
.unmask = sc_unmask_irq,
|
||||
|
@ -156,7 +156,8 @@ static void cic_unmask_irq(unsigned int irq)
|
||||
cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_SET);
|
||||
}
|
||||
|
||||
static struct irqchip cic_chip = {
|
||||
static struct irq_chip cic_chip = {
|
||||
.name = "CIC",
|
||||
.ack = cic_mask_irq,
|
||||
.mask = cic_mask_irq,
|
||||
.unmask = cic_unmask_irq,
|
||||
@ -174,7 +175,8 @@ static void pic_unmask_irq(unsigned int irq)
|
||||
pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_SET);
|
||||
}
|
||||
|
||||
static struct irqchip pic_chip = {
|
||||
static struct irq_chip pic_chip = {
|
||||
.name = "PIC",
|
||||
.ack = pic_mask_irq,
|
||||
.mask = pic_mask_irq,
|
||||
.unmask = pic_unmask_irq,
|
||||
@ -192,7 +194,8 @@ static void sic_unmask_irq(unsigned int irq)
|
||||
sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_SET);
|
||||
}
|
||||
|
||||
static struct irqchip sic_chip = {
|
||||
static struct irq_chip sic_chip = {
|
||||
.name = "SIC",
|
||||
.ack = sic_mask_irq,
|
||||
.mask = sic_mask_irq,
|
||||
.unmask = sic_unmask_irq,
|
||||
|
@ -52,7 +52,8 @@ iop321_irq_unmask (unsigned int irq)
|
||||
intctl_write(iop321_mask);
|
||||
}
|
||||
|
||||
struct irqchip ext_chip = {
|
||||
struct irq_chip ext_chip = {
|
||||
.name = "IOP",
|
||||
.ack = iop321_irq_mask,
|
||||
.mask = iop321_irq_mask,
|
||||
.unmask = iop321_irq_unmask,
|
||||
|
@ -77,13 +77,15 @@ iop331_irq_unmask2(unsigned int irq)
|
||||
intctl_write1(iop331_mask1);
|
||||
}
|
||||
|
||||
struct irqchip iop331_irqchip1 = {
|
||||
struct irq_chip iop331_irqchip1 = {
|
||||
.name = "IOP-1",
|
||||
.ack = iop331_irq_mask1,
|
||||
.mask = iop331_irq_mask1,
|
||||
.unmask = iop331_irq_unmask1,
|
||||
};
|
||||
|
||||
struct irqchip iop331_irqchip2 = {
|
||||
struct irq_chip iop331_irqchip2 = {
|
||||
.name = "IOP-2",
|
||||
.ack = iop331_irq_mask2,
|
||||
.mask = iop331_irq_mask2,
|
||||
.unmask = iop331_irq_unmask2,
|
||||
|
@ -63,7 +63,8 @@ static void kev7a400_unmask_cpld_irq (u32 irq)
|
||||
CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask;
|
||||
}
|
||||
|
||||
static struct irqchip kev7a400_cpld_chip = {
|
||||
static struct irq_chip kev7a400_cpld_chip = {
|
||||
.name = "CPLD",
|
||||
.ack = kev7a400_ack_cpld_irq,
|
||||
.mask = kev7a400_mask_cpld_irq,
|
||||
.unmask = kev7a400_unmask_cpld_irq,
|
||||
|
@ -200,7 +200,8 @@ static void lh7a40x_unmask_cpld_irq (u32 irq)
|
||||
}
|
||||
}
|
||||
|
||||
static struct irqchip lpd7a40x_cpld_chip = {
|
||||
static struct irq_chip lpd7a40x_cpld_chip = {
|
||||
.name = "CPLD",
|
||||
.ack = lh7a40x_ack_cpld_irq,
|
||||
.mask = lh7a40x_mask_cpld_irq,
|
||||
.unmask = lh7a40x_unmask_cpld_irq,
|
||||
|
@ -43,7 +43,8 @@ lh7a400_unmask_cpld_irq (u32 irq)
|
||||
}
|
||||
|
||||
static struct
|
||||
irqchip lh7a400_cpld_chip = {
|
||||
irq_chip lh7a400_cpld_chip = {
|
||||
.name = "CPLD",
|
||||
.ack = lh7a400_ack_cpld_irq,
|
||||
.mask = lh7a400_mask_cpld_irq,
|
||||
.unmask = lh7a400_unmask_cpld_irq,
|
||||
|
@ -38,13 +38,15 @@ static void lh7a400_ack_gpio_irq (u32 irq)
|
||||
INTC_INTENC = (1 << irq);
|
||||
}
|
||||
|
||||
static struct irqchip lh7a400_internal_chip = {
|
||||
static struct irq_chip lh7a400_internal_chip = {
|
||||
.name = "MPU",
|
||||
.ack = lh7a400_mask_irq, /* Level triggering -> mask is ack */
|
||||
.mask = lh7a400_mask_irq,
|
||||
.unmask = lh7a400_unmask_irq,
|
||||
};
|
||||
|
||||
static struct irqchip lh7a400_gpio_chip = {
|
||||
static struct irq_chip lh7a400_gpio_chip = {
|
||||
.name = "GPIO",
|
||||
.ack = lh7a400_ack_gpio_irq,
|
||||
.mask = lh7a400_mask_irq,
|
||||
.unmask = lh7a400_unmask_irq,
|
||||
|
@ -76,25 +76,29 @@ static void lh7a404_vic2_ack_gpio_irq (u32 irq)
|
||||
VIC2_INTENCLR = (1 << irq);
|
||||
}
|
||||
|
||||
static struct irqchip lh7a404_vic1_chip = {
|
||||
static struct irq_chip lh7a404_vic1_chip = {
|
||||
.name = "VIC1",
|
||||
.ack = lh7a404_vic1_mask_irq, /* Because level-triggered */
|
||||
.mask = lh7a404_vic1_mask_irq,
|
||||
.unmask = lh7a404_vic1_unmask_irq,
|
||||
};
|
||||
|
||||
static struct irqchip lh7a404_vic2_chip = {
|
||||
static struct irq_chip lh7a404_vic2_chip = {
|
||||
.name = "VIC2",
|
||||
.ack = lh7a404_vic2_mask_irq, /* Because level-triggered */
|
||||
.mask = lh7a404_vic2_mask_irq,
|
||||
.unmask = lh7a404_vic2_unmask_irq,
|
||||
};
|
||||
|
||||
static struct irqchip lh7a404_gpio_vic1_chip = {
|
||||
static struct irq_chip lh7a404_gpio_vic1_chip = {
|
||||
.name = "GPIO-VIC1",
|
||||
.ack = lh7a404_vic1_ack_gpio_irq,
|
||||
.mask = lh7a404_vic1_mask_irq,
|
||||
.unmask = lh7a404_vic1_unmask_irq,
|
||||
};
|
||||
|
||||
static struct irqchip lh7a404_gpio_vic2_chip = {
|
||||
static struct irq_chip lh7a404_gpio_vic2_chip = {
|
||||
.name = "GPIO-VIC2",
|
||||
.ack = lh7a404_vic2_ack_gpio_irq,
|
||||
.mask = lh7a404_vic2_mask_irq,
|
||||
.unmask = lh7a404_vic2_unmask_irq,
|
||||
|
@ -50,7 +50,8 @@ static void lh7a40x_unmask_cpld_irq (u32 irq)
|
||||
}
|
||||
}
|
||||
|
||||
static struct irqchip lh7a40x_cpld_chip = {
|
||||
static struct irq_chip lh7a40x_cpld_chip = {
|
||||
.name = "CPLD",
|
||||
.ack = lh7a40x_ack_cpld_irq,
|
||||
.mask = lh7a40x_mask_cpld_irq,
|
||||
.unmask = lh7a40x_unmask_cpld_irq,
|
||||
|
@ -106,14 +106,16 @@ void innovator_fpga_IRQ_demux(unsigned int irq, struct irqdesc *desc,
|
||||
}
|
||||
}
|
||||
|
||||
static struct irqchip omap_fpga_irq_ack = {
|
||||
static struct irq_chip omap_fpga_irq_ack = {
|
||||
.name = "FPGA-ack",
|
||||
.ack = fpga_mask_ack_irq,
|
||||
.mask = fpga_mask_irq,
|
||||
.unmask = fpga_unmask_irq,
|
||||
};
|
||||
|
||||
|
||||
static struct irqchip omap_fpga_irq = {
|
||||
static struct irq_chip omap_fpga_irq = {
|
||||
.name = "FPGA",
|
||||
.ack = fpga_ack_irq,
|
||||
.mask = fpga_mask_irq,
|
||||
.unmask = fpga_unmask_irq,
|
||||
|
@ -168,7 +168,8 @@ static struct omap_irq_bank omap1610_irq_banks[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct irqchip omap_irq_chip = {
|
||||
static struct irq_chip omap_irq_chip = {
|
||||
.name = "MPU",
|
||||
.ack = omap_mask_ack_irq,
|
||||
.mask = omap_mask_irq,
|
||||
.unmask = omap_unmask_irq,
|
||||
|
@ -94,7 +94,8 @@ static void omap_mask_ack_irq(unsigned int irq)
|
||||
omap_ack_irq(irq);
|
||||
}
|
||||
|
||||
static struct irqchip omap_irq_chip = {
|
||||
static struct irq_chip omap_irq_chip = {
|
||||
.name = "INTC",
|
||||
.ack = omap_mask_ack_irq,
|
||||
.mask = omap_mask_irq,
|
||||
.unmask = omap_unmask_irq,
|
||||
|
@ -39,7 +39,8 @@ static void pxa_unmask_low_irq(unsigned int irq)
|
||||
ICMR |= (1 << (irq + PXA_IRQ_SKIP));
|
||||
}
|
||||
|
||||
static struct irqchip pxa_internal_chip_low = {
|
||||
static struct irq_chip pxa_internal_chip_low = {
|
||||
.name = "SC",
|
||||
.ack = pxa_mask_low_irq,
|
||||
.mask = pxa_mask_low_irq,
|
||||
.unmask = pxa_unmask_low_irq,
|
||||
@ -61,7 +62,8 @@ static void pxa_unmask_high_irq(unsigned int irq)
|
||||
ICMR2 |= (1 << (irq - 32 + PXA_IRQ_SKIP));
|
||||
}
|
||||
|
||||
static struct irqchip pxa_internal_chip_high = {
|
||||
static struct irq_chip pxa_internal_chip_high = {
|
||||
.name = "SC-hi",
|
||||
.ack = pxa_mask_high_irq,
|
||||
.mask = pxa_mask_high_irq,
|
||||
.unmask = pxa_unmask_high_irq,
|
||||
@ -129,7 +131,8 @@ static void pxa_ack_low_gpio(unsigned int irq)
|
||||
GEDR0 = (1 << (irq - IRQ_GPIO0));
|
||||
}
|
||||
|
||||
static struct irqchip pxa_low_gpio_chip = {
|
||||
static struct irq_chip pxa_low_gpio_chip = {
|
||||
.name = "GPIO-l",
|
||||
.ack = pxa_ack_low_gpio,
|
||||
.mask = pxa_mask_low_irq,
|
||||
.unmask = pxa_unmask_low_irq,
|
||||
@ -237,7 +240,8 @@ static void pxa_unmask_muxed_gpio(unsigned int irq)
|
||||
GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
|
||||
}
|
||||
|
||||
static struct irqchip pxa_muxed_gpio_chip = {
|
||||
static struct irq_chip pxa_muxed_gpio_chip = {
|
||||
.name = "GPIO",
|
||||
.ack = pxa_ack_muxed_gpio,
|
||||
.mask = pxa_mask_muxed_gpio,
|
||||
.unmask = pxa_unmask_muxed_gpio,
|
||||
|
@ -68,7 +68,8 @@ static void lpd270_unmask_irq(unsigned int irq)
|
||||
__raw_writew(lpd270_irq_enabled, LPD270_INT_MASK);
|
||||
}
|
||||
|
||||
static struct irqchip lpd270_irq_chip = {
|
||||
static struct irq_chip lpd270_irq_chip = {
|
||||
.name = "CPLD",
|
||||
.ack = lpd270_mask_irq,
|
||||
.mask = lpd270_mask_irq,
|
||||
.unmask = lpd270_unmask_irq,
|
||||
|
@ -78,7 +78,8 @@ static void lubbock_unmask_irq(unsigned int irq)
|
||||
LUB_IRQ_MASK_EN = (lubbock_irq_enabled |= (1 << lubbock_irq));
|
||||
}
|
||||
|
||||
static struct irqchip lubbock_irq_chip = {
|
||||
static struct irq_chip lubbock_irq_chip = {
|
||||
.name = "FPGA",
|
||||
.ack = lubbock_mask_irq,
|
||||
.mask = lubbock_mask_irq,
|
||||
.unmask = lubbock_unmask_irq,
|
||||
|
@ -64,7 +64,8 @@ static void mainstone_unmask_irq(unsigned int irq)
|
||||
MST_INTMSKENA = (mainstone_irq_enabled |= (1 << mainstone_irq));
|
||||
}
|
||||
|
||||
static struct irqchip mainstone_irq_chip = {
|
||||
static struct irq_chip mainstone_irq_chip = {
|
||||
.name = "FPGA",
|
||||
.ack = mainstone_mask_irq,
|
||||
.mask = mainstone_mask_irq,
|
||||
.unmask = mainstone_unmask_irq,
|
||||
|
@ -95,7 +95,8 @@ static int sa1100_low_gpio_wake(unsigned int irq, unsigned int on)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irqchip sa1100_low_gpio_chip = {
|
||||
static struct irq_chip sa1100_low_gpio_chip = {
|
||||
.name = "GPIO-l",
|
||||
.ack = sa1100_low_gpio_ack,
|
||||
.mask = sa1100_low_gpio_mask,
|
||||
.unmask = sa1100_low_gpio_unmask,
|
||||
@ -178,7 +179,8 @@ static int sa1100_high_gpio_wake(unsigned int irq, unsigned int on)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irqchip sa1100_high_gpio_chip = {
|
||||
static struct irq_chip sa1100_high_gpio_chip = {
|
||||
.name = "GPIO-h",
|
||||
.ack = sa1100_high_gpio_ack,
|
||||
.mask = sa1100_high_gpio_mask,
|
||||
.unmask = sa1100_high_gpio_unmask,
|
||||
@ -215,7 +217,8 @@ static int sa1100_set_wake(unsigned int irq, unsigned int on)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static struct irqchip sa1100_normal_chip = {
|
||||
static struct irq_chip sa1100_normal_chip = {
|
||||
.name = "SC",
|
||||
.ack = sa1100_mask_irq,
|
||||
.mask = sa1100_mask_irq,
|
||||
.unmask = sa1100_unmask_irq,
|
||||
|
@ -69,7 +69,8 @@ static irqreturn_t bogus_int(int irq, void *dev_id, struct pt_regs *regs)
|
||||
|
||||
static struct irqaction cascade;
|
||||
|
||||
static struct irqchip fb_chip = {
|
||||
static struct irq_chip fb_chip = {
|
||||
.name = "XT-PIC",
|
||||
.ack = shark_ack_8259A_irq,
|
||||
.mask = shark_disable_8259A_irq,
|
||||
.unmask = shark_enable_8259A_irq,
|
||||
|
@ -69,7 +69,8 @@ static void sic_unmask_irq(unsigned int irq)
|
||||
writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_SET);
|
||||
}
|
||||
|
||||
static struct irqchip sic_chip = {
|
||||
static struct irq_chip sic_chip = {
|
||||
.name = "SIC",
|
||||
.ack = sic_mask_irq,
|
||||
.mask = sic_mask_irq,
|
||||
.unmask = sic_unmask_irq,
|
||||
|
@ -944,7 +944,8 @@ static void mpuio_unmask_irq(unsigned int irq)
|
||||
_set_gpio_irqenable(bank, gpio, 1);
|
||||
}
|
||||
|
||||
static struct irqchip gpio_irq_chip = {
|
||||
static struct irq_chip gpio_irq_chip = {
|
||||
.name = "GPIO",
|
||||
.ack = gpio_ack_irq,
|
||||
.mask = gpio_mask_irq,
|
||||
.unmask = gpio_unmask_irq,
|
||||
@ -952,10 +953,11 @@ static struct irqchip gpio_irq_chip = {
|
||||
.set_wake = gpio_wake_enable,
|
||||
};
|
||||
|
||||
static struct irqchip mpuio_irq_chip = {
|
||||
static struct irq_chip mpuio_irq_chip = {
|
||||
.name = "MPUIO",
|
||||
.ack = mpuio_ack_irq,
|
||||
.mask = mpuio_mask_irq,
|
||||
.unmask = mpuio_unmask_irq
|
||||
.unmask = mpuio_unmask_irq
|
||||
};
|
||||
|
||||
static int initialized;
|
||||
|
@ -96,6 +96,7 @@ config X86_POWERNOW_K8_ACPI
|
||||
|
||||
config X86_GX_SUSPMOD
|
||||
tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation"
|
||||
depends on PCI
|
||||
help
|
||||
This add the CPUFreq driver for NatSemi Geode processors which
|
||||
support suspend modulation.
|
||||
@ -202,7 +203,7 @@ config X86_LONGRUN
|
||||
config X86_LONGHAUL
|
||||
tristate "VIA Cyrix III Longhaul"
|
||||
select CPU_FREQ_TABLE
|
||||
depends on BROKEN
|
||||
depends on ACPI_PROCESSOR
|
||||
help
|
||||
This adds the CPUFreq driver for VIA Samuel/CyrixIII,
|
||||
VIA Cyrix Samuel/C3, VIA Cyrix Ezra and VIA Cyrix Ezra-T
|
||||
|
@ -384,8 +384,7 @@ static int acpi_cpufreq_early_init_acpi(void)
|
||||
}
|
||||
|
||||
/* Do initialization in ACPI core */
|
||||
acpi_processor_preregister_performance(acpi_perf_data);
|
||||
return 0;
|
||||
return acpi_processor_preregister_performance(acpi_perf_data);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -29,11 +29,13 @@
|
||||
#include <linux/cpufreq.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/pci.h>
|
||||
|
||||
#include <asm/msr.h>
|
||||
#include <asm/timex.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/acpi.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <acpi/processor.h>
|
||||
|
||||
#include "longhaul.h"
|
||||
|
||||
@ -56,6 +58,8 @@ static int minvid, maxvid;
|
||||
static unsigned int minmult, maxmult;
|
||||
static int can_scale_voltage;
|
||||
static int vrmrev;
|
||||
static struct acpi_processor *pr = NULL;
|
||||
static struct acpi_processor_cx *cx = NULL;
|
||||
|
||||
/* Module parameters */
|
||||
static int dont_scale_voltage;
|
||||
@ -118,84 +122,65 @@ static int longhaul_get_cpu_mult(void)
|
||||
return eblcr_table[invalue];
|
||||
}
|
||||
|
||||
/* For processor with BCR2 MSR */
|
||||
|
||||
static void do_powersaver(union msr_longhaul *longhaul,
|
||||
unsigned int clock_ratio_index)
|
||||
static void do_longhaul1(int cx_address, 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];
|
||||
union msr_bcr2 bcr2;
|
||||
u32 t;
|
||||
|
||||
switch (cpu_model) {
|
||||
case CPU_EZRA_T:
|
||||
version = 3;
|
||||
break;
|
||||
case CPU_NEHEMIAH:
|
||||
version = 0xf;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);
|
||||
longhaul->bits.SoftBusRatio = clock_ratio_index & 0xf;
|
||||
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 */
|
||||
rdmsrl(MSR_VIA_BCR2, bcr2.val);
|
||||
/* Enable software clock multiplier */
|
||||
bcr2.bits.ESOFTBF = 1;
|
||||
bcr2.bits.CLOCKMUL = clock_ratio_index;
|
||||
|
||||
/* Sync to timer tick */
|
||||
safe_halt();
|
||||
wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
|
||||
halt();
|
||||
ACPI_FLUSH_CPU_CACHE();
|
||||
/* Change frequency on next halt or sleep */
|
||||
wrmsrl(MSR_VIA_BCR2, bcr2.val);
|
||||
/* Invoke C3 */
|
||||
inb(cx_address);
|
||||
/* Dummy op - must do something useless after P_LVL3 read */
|
||||
t = inl(acpi_fadt.xpm_tmr_blk.address);
|
||||
|
||||
/* Disable software clock multiplier */
|
||||
local_irq_disable();
|
||||
rdmsrl(MSR_VIA_BCR2, bcr2.val);
|
||||
bcr2.bits.ESOFTBF = 0;
|
||||
wrmsrl(MSR_VIA_BCR2, bcr2.val);
|
||||
}
|
||||
|
||||
outb(tmp_mask,0x21); /* restore mask */
|
||||
/* For processor with Longhaul MSR */
|
||||
|
||||
/* 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();
|
||||
static void do_powersaver(int cx_address, unsigned int clock_ratio_index)
|
||||
{
|
||||
union msr_longhaul longhaul;
|
||||
u32 t;
|
||||
|
||||
/* disable bus ratio bit */
|
||||
rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);
|
||||
longhaul->bits.EnableSoftBusRatio = 0;
|
||||
longhaul->bits.RevisionKey = version;
|
||||
wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
|
||||
rdmsrl(MSR_VIA_LONGHAUL, longhaul.val);
|
||||
longhaul.bits.RevisionKey = longhaul.bits.RevisionID;
|
||||
longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf;
|
||||
longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
|
||||
longhaul.bits.EnableSoftBusRatio = 1;
|
||||
|
||||
/* Sync to timer tick */
|
||||
safe_halt();
|
||||
ACPI_FLUSH_CPU_CACHE();
|
||||
/* Change frequency on next halt or sleep */
|
||||
wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
|
||||
/* Invoke C3 */
|
||||
inb(cx_address);
|
||||
/* Dummy op - must do something useless after P_LVL3 read */
|
||||
t = inl(acpi_fadt.xpm_tmr_blk.address);
|
||||
|
||||
/* Disable bus ratio bit */
|
||||
local_irq_disable();
|
||||
longhaul.bits.RevisionKey = longhaul.bits.RevisionID;
|
||||
longhaul.bits.EnableSoftBusRatio = 0;
|
||||
longhaul.bits.EnableSoftBSEL = 0;
|
||||
longhaul.bits.EnableSoftVID = 0;
|
||||
wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -209,9 +194,9 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
|
||||
{
|
||||
int speed, mult;
|
||||
struct cpufreq_freqs freqs;
|
||||
union msr_longhaul longhaul;
|
||||
union msr_bcr2 bcr2;
|
||||
static unsigned int old_ratio=-1;
|
||||
unsigned long flags;
|
||||
unsigned int pic1_mask, pic2_mask;
|
||||
|
||||
if (old_ratio == clock_ratio_index)
|
||||
return;
|
||||
@ -234,6 +219,20 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
|
||||
dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n",
|
||||
fsb, mult/10, mult%10, print_speed(speed/1000));
|
||||
|
||||
preempt_disable();
|
||||
local_irq_save(flags);
|
||||
|
||||
pic2_mask = inb(0xA1);
|
||||
pic1_mask = inb(0x21); /* works on C3. save mask. */
|
||||
outb(0xFF,0xA1); /* Overkill */
|
||||
outb(0xFE,0x21); /* TMR0 only */
|
||||
|
||||
/* Disable bus master arbitration */
|
||||
if (pr->flags.bm_check) {
|
||||
acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1,
|
||||
ACPI_MTX_DO_NOT_LOCK);
|
||||
}
|
||||
|
||||
switch (longhaul_version) {
|
||||
|
||||
/*
|
||||
@ -245,20 +244,7 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
|
||||
*/
|
||||
case TYPE_LONGHAUL_V1:
|
||||
case TYPE_LONGHAUL_V2:
|
||||
rdmsrl (MSR_VIA_BCR2, bcr2.val);
|
||||
/* Enable software clock multiplier */
|
||||
bcr2.bits.ESOFTBF = 1;
|
||||
bcr2.bits.CLOCKMUL = clock_ratio_index;
|
||||
local_irq_disable();
|
||||
wrmsrl (MSR_VIA_BCR2, bcr2.val);
|
||||
safe_halt();
|
||||
|
||||
/* Disable software clock multiplier */
|
||||
rdmsrl (MSR_VIA_BCR2, bcr2.val);
|
||||
bcr2.bits.ESOFTBF = 0;
|
||||
local_irq_disable();
|
||||
wrmsrl (MSR_VIA_BCR2, bcr2.val);
|
||||
local_irq_enable();
|
||||
do_longhaul1(cx->address, clock_ratio_index);
|
||||
break;
|
||||
|
||||
/*
|
||||
@ -273,10 +259,22 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
|
||||
* to work in practice.
|
||||
*/
|
||||
case TYPE_POWERSAVER:
|
||||
do_powersaver(&longhaul, clock_ratio_index);
|
||||
do_powersaver(cx->address, clock_ratio_index);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Enable bus master arbitration */
|
||||
if (pr->flags.bm_check) {
|
||||
acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0,
|
||||
ACPI_MTX_DO_NOT_LOCK);
|
||||
}
|
||||
|
||||
outb(pic2_mask,0xA1); /* restore mask */
|
||||
outb(pic1_mask,0x21);
|
||||
|
||||
local_irq_restore(flags);
|
||||
preempt_enable();
|
||||
|
||||
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||
}
|
||||
|
||||
@ -324,9 +322,11 @@ static int guess_fsb(void)
|
||||
static int __init longhaul_get_ranges(void)
|
||||
{
|
||||
unsigned long invalue;
|
||||
unsigned int multipliers[32]= {
|
||||
50,30,40,100,55,35,45,95,90,70,80,60,120,75,85,65,
|
||||
-1,110,120,-1,135,115,125,105,130,150,160,140,-1,155,-1,145 };
|
||||
unsigned int ezra_t_multipliers[32]= {
|
||||
90, 30, 40, 100, 55, 35, 45, 95,
|
||||
50, 70, 80, 60, 120, 75, 85, 65,
|
||||
-1, 110, 120, -1, 135, 115, 125, 105,
|
||||
130, 150, 160, 140, -1, 155, -1, 145 };
|
||||
unsigned int j, k = 0;
|
||||
union msr_longhaul longhaul;
|
||||
unsigned long lo, hi;
|
||||
@ -355,13 +355,13 @@ static int __init longhaul_get_ranges(void)
|
||||
invalue = longhaul.bits.MaxMHzBR;
|
||||
if (longhaul.bits.MaxMHzBR4)
|
||||
invalue += 16;
|
||||
maxmult=multipliers[invalue];
|
||||
maxmult=ezra_t_multipliers[invalue];
|
||||
|
||||
invalue = longhaul.bits.MinMHzBR;
|
||||
if (longhaul.bits.MinMHzBR4 == 1)
|
||||
minmult = 30;
|
||||
else
|
||||
minmult = multipliers[invalue];
|
||||
minmult = ezra_t_multipliers[invalue];
|
||||
fsb = eblcr_fsb_table_v2[longhaul.bits.MaxMHzFSB];
|
||||
break;
|
||||
}
|
||||
@ -527,6 +527,18 @@ static unsigned int longhaul_get(unsigned int cpu)
|
||||
return calc_speed(longhaul_get_cpu_mult());
|
||||
}
|
||||
|
||||
static acpi_status longhaul_walk_callback(acpi_handle obj_handle,
|
||||
u32 nesting_level,
|
||||
void *context, void **return_value)
|
||||
{
|
||||
struct acpi_device *d;
|
||||
|
||||
if ( acpi_bus_get_device(obj_handle, &d) ) {
|
||||
return 0;
|
||||
}
|
||||
*return_value = (void *)acpi_driver_data(d);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
@ -534,6 +546,15 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
|
||||
char *cpuname=NULL;
|
||||
int ret;
|
||||
|
||||
/* Check ACPI support for C3 state */
|
||||
acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
|
||||
&longhaul_walk_callback, NULL, (void *)&pr);
|
||||
if (pr == NULL) goto err_acpi;
|
||||
|
||||
cx = &pr->power.states[ACPI_STATE_C3];
|
||||
if (cx->address == 0 || cx->latency > 1000) goto err_acpi;
|
||||
|
||||
/* Now check what we have on this motherboard */
|
||||
switch (c->x86_model) {
|
||||
case 6:
|
||||
cpu_model = CPU_SAMUEL;
|
||||
@ -634,6 +655,10 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
|
||||
cpufreq_frequency_table_get_attr(longhaul_table, policy->cpu);
|
||||
|
||||
return 0;
|
||||
|
||||
err_acpi:
|
||||
printk(KERN_ERR PFX "No ACPI support for CPU frequency changes.\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int __devexit longhaul_cpu_exit(struct cpufreq_policy *policy)
|
||||
@ -666,6 +691,18 @@ static int __init longhaul_init(void)
|
||||
if (c->x86_vendor != X86_VENDOR_CENTAUR || c->x86 != 6)
|
||||
return -ENODEV;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
if (num_online_cpus() > 1) {
|
||||
return -ENODEV;
|
||||
printk(KERN_ERR PFX "More than 1 CPU detected, longhaul disabled.\n");
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_X86_IO_APIC
|
||||
if (cpu_has_apic) {
|
||||
printk(KERN_ERR PFX "APIC detected. Longhaul is currently broken in this configuration.\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
switch (c->x86_model) {
|
||||
case 6 ... 9:
|
||||
return cpufreq_register_driver(&longhaul_driver);
|
||||
@ -699,6 +736,6 @@ MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>");
|
||||
MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors.");
|
||||
MODULE_LICENSE ("GPL");
|
||||
|
||||
module_init(longhaul_init);
|
||||
late_initcall(longhaul_init);
|
||||
module_exit(longhaul_exit);
|
||||
|
||||
|
@ -151,7 +151,7 @@ static void
|
||||
simscsi_sg_readwrite (struct scsi_cmnd *sc, int mode, unsigned long offset)
|
||||
{
|
||||
int list_len = sc->use_sg;
|
||||
struct scatterlist *sl = (struct scatterlist *)sc->buffer;
|
||||
struct scatterlist *sl = (struct scatterlist *)sc->request_buffer;
|
||||
struct disk_stat stat;
|
||||
struct disk_req req;
|
||||
|
||||
@ -244,7 +244,7 @@ static void simscsi_fillresult(struct scsi_cmnd *sc, char *buf, unsigned len)
|
||||
|
||||
if (scatterlen == 0)
|
||||
memcpy(sc->request_buffer, buf, len);
|
||||
else for (slp = (struct scatterlist *)sc->buffer; scatterlen-- > 0 && len > 0; slp++) {
|
||||
else for (slp = (struct scatterlist *)sc->request_buffer; scatterlen-- > 0 && len > 0; slp++) {
|
||||
unsigned thislen = min(len, slp->length);
|
||||
|
||||
memcpy(page_address(slp->page) + slp->offset, buf, thislen);
|
||||
|
@ -632,7 +632,7 @@ kern_memory_descriptor (unsigned long phys_addr)
|
||||
if (phys_addr - md->start < (md->num_pages << EFI_PAGE_SHIFT))
|
||||
return md;
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static efi_memory_desc_t *
|
||||
@ -652,7 +652,7 @@ efi_memory_descriptor (unsigned long phys_addr)
|
||||
if (phys_addr - md->phys_addr < (md->num_pages << EFI_PAGE_SHIFT))
|
||||
return md;
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u32
|
||||
@ -923,7 +923,7 @@ find_memmap_space (void)
|
||||
void
|
||||
efi_memmap_init(unsigned long *s, unsigned long *e)
|
||||
{
|
||||
struct kern_memdesc *k, *prev = 0;
|
||||
struct kern_memdesc *k, *prev = NULL;
|
||||
u64 contig_low=0, contig_high=0;
|
||||
u64 as, ae, lim;
|
||||
void *efi_map_start, *efi_map_end, *p, *q;
|
||||
|
@ -853,7 +853,6 @@ END(__ia64_init_fpu)
|
||||
*/
|
||||
GLOBAL_ENTRY(ia64_switch_mode_phys)
|
||||
{
|
||||
alloc r2=ar.pfs,0,0,0,0
|
||||
rsm psr.i | psr.ic // disable interrupts and interrupt collection
|
||||
mov r15=ip
|
||||
}
|
||||
@ -902,7 +901,6 @@ END(ia64_switch_mode_phys)
|
||||
*/
|
||||
GLOBAL_ENTRY(ia64_switch_mode_virt)
|
||||
{
|
||||
alloc r2=ar.pfs,0,0,0,0
|
||||
rsm psr.i | psr.ic // disable interrupts and interrupt collection
|
||||
mov r15=ip
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ EXPORT_SYMBOL(__udivdi3);
|
||||
EXPORT_SYMBOL(__moddi3);
|
||||
EXPORT_SYMBOL(__umoddi3);
|
||||
|
||||
#if defined(CONFIG_MD_RAID5) || defined(CONFIG_MD_RAID5_MODULE)
|
||||
#if defined(CONFIG_MD_RAID456) || defined(CONFIG_MD_RAID456_MODULE)
|
||||
extern void xor_ia64_2(void);
|
||||
extern void xor_ia64_3(void);
|
||||
extern void xor_ia64_4(void);
|
||||
|
@ -217,12 +217,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
|
||||
.body
|
||||
;;
|
||||
ld8 loc2 = [loc2] // loc2 <- entry point
|
||||
mov out0 = in0 // first argument
|
||||
mov out1 = in1 // copy arg2
|
||||
mov out2 = in2 // copy arg3
|
||||
mov out3 = in3 // copy arg3
|
||||
;;
|
||||
mov loc3 = psr // save psr
|
||||
mov loc3 = psr // save psr
|
||||
;;
|
||||
mov loc4=ar.rsc // save RSE configuration
|
||||
dep.z loc2=loc2,0,61 // convert pal entry point to physical
|
||||
@ -236,18 +231,23 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
|
||||
;;
|
||||
andcm r16=loc3,r16 // removes bits to clear from psr
|
||||
br.call.sptk.many rp=ia64_switch_mode_phys
|
||||
.ret6:
|
||||
|
||||
mov out0 = in0 // first argument
|
||||
mov out1 = in1 // copy arg2
|
||||
mov out2 = in2 // copy arg3
|
||||
mov out3 = in3 // copy arg3
|
||||
mov loc5 = r19
|
||||
mov loc6 = r20
|
||||
|
||||
br.call.sptk.many rp=b7 // now make the call
|
||||
.ret7:
|
||||
|
||||
mov ar.rsc=0 // put RSE in enforced lazy, LE mode
|
||||
mov r16=loc3 // r16= original psr
|
||||
mov r19=loc5
|
||||
mov r20=loc6
|
||||
br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode
|
||||
|
||||
.ret8: mov psr.l = loc3 // restore init PSR
|
||||
mov psr.l = loc3 // restore init PSR
|
||||
mov ar.pfs = loc1
|
||||
mov rp = loc0
|
||||
;;
|
||||
|
@ -566,29 +566,23 @@ version_info(char *page)
|
||||
pal_version_u_t min_ver, cur_ver;
|
||||
char *p = page;
|
||||
|
||||
/* The PAL_VERSION call is advertised as being able to support
|
||||
* both physical and virtual mode calls. This seems to be a documentation
|
||||
* bug rather than firmware bug. In fact, it does only support physical mode.
|
||||
* So now the code reflects this fact and the pal_version() has been updated
|
||||
* accordingly.
|
||||
*/
|
||||
if (ia64_pal_version(&min_ver, &cur_ver) != 0) return 0;
|
||||
if (ia64_pal_version(&min_ver, &cur_ver) != 0)
|
||||
return 0;
|
||||
|
||||
p += sprintf(p,
|
||||
"PAL_vendor : 0x%02x (min=0x%02x)\n"
|
||||
"PAL_A : %x.%x.%x (min=%x.%x.%x)\n"
|
||||
"PAL_B : %x.%x.%x (min=%x.%x.%x)\n",
|
||||
cur_ver.pal_version_s.pv_pal_vendor, min_ver.pal_version_s.pv_pal_vendor,
|
||||
|
||||
cur_ver.pal_version_s.pv_pal_a_model>>4,
|
||||
cur_ver.pal_version_s.pv_pal_a_model&0xf, cur_ver.pal_version_s.pv_pal_a_rev,
|
||||
min_ver.pal_version_s.pv_pal_a_model>>4,
|
||||
min_ver.pal_version_s.pv_pal_a_model&0xf, min_ver.pal_version_s.pv_pal_a_rev,
|
||||
|
||||
cur_ver.pal_version_s.pv_pal_b_model>>4,
|
||||
cur_ver.pal_version_s.pv_pal_b_model&0xf, cur_ver.pal_version_s.pv_pal_b_rev,
|
||||
min_ver.pal_version_s.pv_pal_b_model>>4,
|
||||
min_ver.pal_version_s.pv_pal_b_model&0xf, min_ver.pal_version_s.pv_pal_b_rev);
|
||||
"PAL_A : %02x.%02x (min=%02x.%02x)\n"
|
||||
"PAL_B : %02x.%02x (min=%02x.%02x)\n",
|
||||
cur_ver.pal_version_s.pv_pal_vendor,
|
||||
min_ver.pal_version_s.pv_pal_vendor,
|
||||
cur_ver.pal_version_s.pv_pal_a_model,
|
||||
cur_ver.pal_version_s.pv_pal_a_rev,
|
||||
min_ver.pal_version_s.pv_pal_a_model,
|
||||
min_ver.pal_version_s.pv_pal_a_rev,
|
||||
cur_ver.pal_version_s.pv_pal_b_model,
|
||||
cur_ver.pal_version_s.pv_pal_b_rev,
|
||||
min_ver.pal_version_s.pv_pal_b_model,
|
||||
min_ver.pal_version_s.pv_pal_b_rev);
|
||||
return p - page;
|
||||
}
|
||||
|
||||
|
@ -32,32 +32,38 @@
|
||||
|
||||
extern void __init efi_memmap_walk_uc(efi_freemem_callback_t, void *);
|
||||
|
||||
#define MAX_UNCACHED_GRANULES 5
|
||||
static int allocated_granules;
|
||||
struct uncached_pool {
|
||||
struct gen_pool *pool;
|
||||
struct mutex add_chunk_mutex; /* serialize adding a converted chunk */
|
||||
int nchunks_added; /* #of converted chunks added to pool */
|
||||
atomic_t status; /* smp called function's return status*/
|
||||
};
|
||||
|
||||
struct gen_pool *uncached_pool[MAX_NUMNODES];
|
||||
#define MAX_CONVERTED_CHUNKS_PER_NODE 2
|
||||
|
||||
struct uncached_pool uncached_pools[MAX_NUMNODES];
|
||||
|
||||
|
||||
static void uncached_ipi_visibility(void *data)
|
||||
{
|
||||
int status;
|
||||
struct uncached_pool *uc_pool = (struct uncached_pool *)data;
|
||||
|
||||
status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
|
||||
if ((status != PAL_VISIBILITY_OK) &&
|
||||
(status != PAL_VISIBILITY_OK_REMOTE_NEEDED))
|
||||
printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on "
|
||||
"CPU %i\n", status, raw_smp_processor_id());
|
||||
atomic_inc(&uc_pool->status);
|
||||
}
|
||||
|
||||
|
||||
static void uncached_ipi_mc_drain(void *data)
|
||||
{
|
||||
int status;
|
||||
struct uncached_pool *uc_pool = (struct uncached_pool *)data;
|
||||
|
||||
status = ia64_pal_mc_drain();
|
||||
if (status)
|
||||
printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on "
|
||||
"CPU %i\n", status, raw_smp_processor_id());
|
||||
if (status != PAL_STATUS_SUCCESS)
|
||||
atomic_inc(&uc_pool->status);
|
||||
}
|
||||
|
||||
|
||||
@ -70,21 +76,34 @@ static void uncached_ipi_mc_drain(void *data)
|
||||
* This is accomplished by first allocating a granule of cached memory pages
|
||||
* and then converting them to uncached memory pages.
|
||||
*/
|
||||
static int uncached_add_chunk(struct gen_pool *pool, int nid)
|
||||
static int uncached_add_chunk(struct uncached_pool *uc_pool, int nid)
|
||||
{
|
||||
struct page *page;
|
||||
int status, i;
|
||||
int status, i, nchunks_added = uc_pool->nchunks_added;
|
||||
unsigned long c_addr, uc_addr;
|
||||
|
||||
if (allocated_granules >= MAX_UNCACHED_GRANULES)
|
||||
if (mutex_lock_interruptible(&uc_pool->add_chunk_mutex) != 0)
|
||||
return -1; /* interrupted by a signal */
|
||||
|
||||
if (uc_pool->nchunks_added > nchunks_added) {
|
||||
/* someone added a new chunk while we were waiting */
|
||||
mutex_unlock(&uc_pool->add_chunk_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (uc_pool->nchunks_added >= MAX_CONVERTED_CHUNKS_PER_NODE) {
|
||||
mutex_unlock(&uc_pool->add_chunk_mutex);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* attempt to allocate a granule's worth of cached memory pages */
|
||||
|
||||
page = alloc_pages_node(nid, GFP_KERNEL | __GFP_ZERO,
|
||||
IA64_GRANULE_SHIFT-PAGE_SHIFT);
|
||||
if (!page)
|
||||
if (!page) {
|
||||
mutex_unlock(&uc_pool->add_chunk_mutex);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* convert the memory pages from cached to uncached */
|
||||
|
||||
@ -102,11 +121,14 @@ static int uncached_add_chunk(struct gen_pool *pool, int nid)
|
||||
flush_tlb_kernel_range(uc_addr, uc_adddr + IA64_GRANULE_SIZE);
|
||||
|
||||
status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
|
||||
if (!status) {
|
||||
status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1);
|
||||
if (status)
|
||||
if (status == PAL_VISIBILITY_OK_REMOTE_NEEDED) {
|
||||
atomic_set(&uc_pool->status, 0);
|
||||
status = smp_call_function(uncached_ipi_visibility, uc_pool,
|
||||
0, 1);
|
||||
if (status || atomic_read(&uc_pool->status))
|
||||
goto failed;
|
||||
}
|
||||
} else if (status != PAL_VISIBILITY_OK)
|
||||
goto failed;
|
||||
|
||||
preempt_disable();
|
||||
|
||||
@ -120,20 +142,24 @@ static int uncached_add_chunk(struct gen_pool *pool, int nid)
|
||||
|
||||
preempt_enable();
|
||||
|
||||
ia64_pal_mc_drain();
|
||||
status = smp_call_function(uncached_ipi_mc_drain, NULL, 0, 1);
|
||||
if (status)
|
||||
status = ia64_pal_mc_drain();
|
||||
if (status != PAL_STATUS_SUCCESS)
|
||||
goto failed;
|
||||
atomic_set(&uc_pool->status, 0);
|
||||
status = smp_call_function(uncached_ipi_mc_drain, uc_pool, 0, 1);
|
||||
if (status || atomic_read(&uc_pool->status))
|
||||
goto failed;
|
||||
|
||||
/*
|
||||
* The chunk of memory pages has been converted to uncached so now we
|
||||
* can add it to the pool.
|
||||
*/
|
||||
status = gen_pool_add(pool, uc_addr, IA64_GRANULE_SIZE, nid);
|
||||
status = gen_pool_add(uc_pool->pool, uc_addr, IA64_GRANULE_SIZE, nid);
|
||||
if (status)
|
||||
goto failed;
|
||||
|
||||
allocated_granules++;
|
||||
uc_pool->nchunks_added++;
|
||||
mutex_unlock(&uc_pool->add_chunk_mutex);
|
||||
return 0;
|
||||
|
||||
/* failed to convert or add the chunk so give it back to the kernel */
|
||||
@ -142,6 +168,7 @@ failed:
|
||||
ClearPageUncached(&page[i]);
|
||||
|
||||
free_pages(c_addr, IA64_GRANULE_SHIFT-PAGE_SHIFT);
|
||||
mutex_unlock(&uc_pool->add_chunk_mutex);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -158,7 +185,7 @@ failed:
|
||||
unsigned long uncached_alloc_page(int starting_nid)
|
||||
{
|
||||
unsigned long uc_addr;
|
||||
struct gen_pool *pool;
|
||||
struct uncached_pool *uc_pool;
|
||||
int nid;
|
||||
|
||||
if (unlikely(starting_nid >= MAX_NUMNODES))
|
||||
@ -171,14 +198,14 @@ unsigned long uncached_alloc_page(int starting_nid)
|
||||
do {
|
||||
if (!node_online(nid))
|
||||
continue;
|
||||
pool = uncached_pool[nid];
|
||||
if (pool == NULL)
|
||||
uc_pool = &uncached_pools[nid];
|
||||
if (uc_pool->pool == NULL)
|
||||
continue;
|
||||
do {
|
||||
uc_addr = gen_pool_alloc(pool, PAGE_SIZE);
|
||||
uc_addr = gen_pool_alloc(uc_pool->pool, PAGE_SIZE);
|
||||
if (uc_addr != 0)
|
||||
return uc_addr;
|
||||
} while (uncached_add_chunk(pool, nid) == 0);
|
||||
} while (uncached_add_chunk(uc_pool, nid) == 0);
|
||||
|
||||
} while ((nid = (nid + 1) % MAX_NUMNODES) != starting_nid);
|
||||
|
||||
@ -197,7 +224,7 @@ EXPORT_SYMBOL(uncached_alloc_page);
|
||||
void uncached_free_page(unsigned long uc_addr)
|
||||
{
|
||||
int nid = paddr_to_nid(uc_addr - __IA64_UNCACHED_OFFSET);
|
||||
struct gen_pool *pool = uncached_pool[nid];
|
||||
struct gen_pool *pool = uncached_pools[nid].pool;
|
||||
|
||||
if (unlikely(pool == NULL))
|
||||
return;
|
||||
@ -224,7 +251,7 @@ static int __init uncached_build_memmap(unsigned long uc_start,
|
||||
unsigned long uc_end, void *arg)
|
||||
{
|
||||
int nid = paddr_to_nid(uc_start - __IA64_UNCACHED_OFFSET);
|
||||
struct gen_pool *pool = uncached_pool[nid];
|
||||
struct gen_pool *pool = uncached_pools[nid].pool;
|
||||
size_t size = uc_end - uc_start;
|
||||
|
||||
touch_softlockup_watchdog();
|
||||
@ -242,7 +269,8 @@ static int __init uncached_init(void)
|
||||
int nid;
|
||||
|
||||
for_each_online_node(nid) {
|
||||
uncached_pool[nid] = gen_pool_create(PAGE_SHIFT, nid);
|
||||
uncached_pools[nid].pool = gen_pool_create(PAGE_SHIFT, nid);
|
||||
mutex_init(&uncached_pools[nid].add_chunk_mutex);
|
||||
}
|
||||
|
||||
efi_memmap_walk_uc(uncached_build_memmap, NULL);
|
||||
|
@ -14,7 +14,7 @@ lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \
|
||||
lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o
|
||||
lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o
|
||||
lib-$(CONFIG_PERFMON) += carta_random.o
|
||||
lib-$(CONFIG_MD_RAID5) += xor.o
|
||||
lib-$(CONFIG_MD_RAID456) += xor.o
|
||||
|
||||
AFLAGS___divdi3.o =
|
||||
AFLAGS___udivdi3.o = -DUNSIGNED
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#ifdef CONFIG_VIRTUAL_MEM_MAP
|
||||
static unsigned long num_dma_physpages;
|
||||
static unsigned long max_gap;
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -45,9 +46,15 @@ show_mem (void)
|
||||
|
||||
printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
|
||||
i = max_mapnr;
|
||||
while (i-- > 0) {
|
||||
if (!pfn_valid(i))
|
||||
for (i = 0; i < max_mapnr; i++) {
|
||||
if (!pfn_valid(i)) {
|
||||
#ifdef CONFIG_VIRTUAL_MEM_MAP
|
||||
if (max_gap < LARGE_GAP)
|
||||
continue;
|
||||
i = vmemmap_find_next_valid_pfn(0, i) - 1;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
total++;
|
||||
if (PageReserved(mem_map+i))
|
||||
reserved++;
|
||||
@ -234,7 +241,6 @@ paging_init (void)
|
||||
unsigned long zones_size[MAX_NR_ZONES];
|
||||
#ifdef CONFIG_VIRTUAL_MEM_MAP
|
||||
unsigned long zholes_size[MAX_NR_ZONES];
|
||||
unsigned long max_gap;
|
||||
#endif
|
||||
|
||||
/* initialize mem_map[] */
|
||||
@ -266,7 +272,6 @@ paging_init (void)
|
||||
}
|
||||
}
|
||||
|
||||
max_gap = 0;
|
||||
efi_memmap_walk(find_largest_hole, (u64 *)&max_gap);
|
||||
if (max_gap < LARGE_GAP) {
|
||||
vmem_map = (struct page *) 0;
|
||||
@ -277,7 +282,8 @@ paging_init (void)
|
||||
|
||||
/* allocate virtual_mem_map */
|
||||
|
||||
map_size = PAGE_ALIGN(max_low_pfn * sizeof(struct page));
|
||||
map_size = PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
|
||||
sizeof(struct page));
|
||||
vmalloc_end -= map_size;
|
||||
vmem_map = (struct page *) vmalloc_end;
|
||||
efi_memmap_walk(create_mem_map_page_table, NULL);
|
||||
|
@ -534,68 +534,6 @@ void __cpuinit *per_cpu_init(void)
|
||||
}
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
#ifdef CONFIG_VIRTUAL_MEM_MAP
|
||||
static inline int find_next_valid_pfn_for_pgdat(pg_data_t *pgdat, int i)
|
||||
{
|
||||
unsigned long end_address, hole_next_pfn;
|
||||
unsigned long stop_address;
|
||||
|
||||
end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
|
||||
end_address = PAGE_ALIGN(end_address);
|
||||
|
||||
stop_address = (unsigned long) &vmem_map[
|
||||
pgdat->node_start_pfn + pgdat->node_spanned_pages];
|
||||
|
||||
do {
|
||||
pgd_t *pgd;
|
||||
pud_t *pud;
|
||||
pmd_t *pmd;
|
||||
pte_t *pte;
|
||||
|
||||
pgd = pgd_offset_k(end_address);
|
||||
if (pgd_none(*pgd)) {
|
||||
end_address += PGDIR_SIZE;
|
||||
continue;
|
||||
}
|
||||
|
||||
pud = pud_offset(pgd, end_address);
|
||||
if (pud_none(*pud)) {
|
||||
end_address += PUD_SIZE;
|
||||
continue;
|
||||
}
|
||||
|
||||
pmd = pmd_offset(pud, end_address);
|
||||
if (pmd_none(*pmd)) {
|
||||
end_address += PMD_SIZE;
|
||||
continue;
|
||||
}
|
||||
|
||||
pte = pte_offset_kernel(pmd, end_address);
|
||||
retry_pte:
|
||||
if (pte_none(*pte)) {
|
||||
end_address += PAGE_SIZE;
|
||||
pte++;
|
||||
if ((end_address < stop_address) &&
|
||||
(end_address != ALIGN(end_address, 1UL << PMD_SHIFT)))
|
||||
goto retry_pte;
|
||||
continue;
|
||||
}
|
||||
/* Found next valid vmem_map page */
|
||||
break;
|
||||
} while (end_address < stop_address);
|
||||
|
||||
end_address = min(end_address, stop_address);
|
||||
end_address = end_address - (unsigned long) vmem_map + sizeof(struct page) - 1;
|
||||
hole_next_pfn = end_address / sizeof(struct page);
|
||||
return hole_next_pfn - pgdat->node_start_pfn;
|
||||
}
|
||||
#else
|
||||
static inline int find_next_valid_pfn_for_pgdat(pg_data_t *pgdat, int i)
|
||||
{
|
||||
return i + 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* show_mem - give short summary of memory stats
|
||||
*
|
||||
@ -625,7 +563,8 @@ void show_mem(void)
|
||||
if (pfn_valid(pgdat->node_start_pfn + i))
|
||||
page = pfn_to_page(pgdat->node_start_pfn + i);
|
||||
else {
|
||||
i = find_next_valid_pfn_for_pgdat(pgdat, i) - 1;
|
||||
i = vmemmap_find_next_valid_pfn(pgdat->node_id,
|
||||
i) - 1;
|
||||
continue;
|
||||
}
|
||||
if (PageReserved(page))
|
||||
@ -751,7 +690,8 @@ void __init paging_init(void)
|
||||
efi_memmap_walk(filter_rsvd_memory, count_node_pages);
|
||||
|
||||
#ifdef CONFIG_VIRTUAL_MEM_MAP
|
||||
vmalloc_end -= PAGE_ALIGN(max_low_pfn * sizeof(struct page));
|
||||
vmalloc_end -= PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
|
||||
sizeof(struct page));
|
||||
vmem_map = (struct page *) vmalloc_end;
|
||||
efi_memmap_walk(create_mem_map_page_table, NULL);
|
||||
printk("Virtual mem_map starts at 0x%p\n", vmem_map);
|
||||
|
@ -415,6 +415,61 @@ ia64_mmu_init (void *my_cpu_data)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_VIRTUAL_MEM_MAP
|
||||
int vmemmap_find_next_valid_pfn(int node, int i)
|
||||
{
|
||||
unsigned long end_address, hole_next_pfn;
|
||||
unsigned long stop_address;
|
||||
pg_data_t *pgdat = NODE_DATA(node);
|
||||
|
||||
end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
|
||||
end_address = PAGE_ALIGN(end_address);
|
||||
|
||||
stop_address = (unsigned long) &vmem_map[
|
||||
pgdat->node_start_pfn + pgdat->node_spanned_pages];
|
||||
|
||||
do {
|
||||
pgd_t *pgd;
|
||||
pud_t *pud;
|
||||
pmd_t *pmd;
|
||||
pte_t *pte;
|
||||
|
||||
pgd = pgd_offset_k(end_address);
|
||||
if (pgd_none(*pgd)) {
|
||||
end_address += PGDIR_SIZE;
|
||||
continue;
|
||||
}
|
||||
|
||||
pud = pud_offset(pgd, end_address);
|
||||
if (pud_none(*pud)) {
|
||||
end_address += PUD_SIZE;
|
||||
continue;
|
||||
}
|
||||
|
||||
pmd = pmd_offset(pud, end_address);
|
||||
if (pmd_none(*pmd)) {
|
||||
end_address += PMD_SIZE;
|
||||
continue;
|
||||
}
|
||||
|
||||
pte = pte_offset_kernel(pmd, end_address);
|
||||
retry_pte:
|
||||
if (pte_none(*pte)) {
|
||||
end_address += PAGE_SIZE;
|
||||
pte++;
|
||||
if ((end_address < stop_address) &&
|
||||
(end_address != ALIGN(end_address, 1UL << PMD_SHIFT)))
|
||||
goto retry_pte;
|
||||
continue;
|
||||
}
|
||||
/* Found next valid vmem_map page */
|
||||
break;
|
||||
} while (end_address < stop_address);
|
||||
|
||||
end_address = min(end_address, stop_address);
|
||||
end_address = end_address - (unsigned long) vmem_map + sizeof(struct page) - 1;
|
||||
hole_next_pfn = end_address / sizeof(struct page);
|
||||
return hole_next_pfn - pgdat->node_start_pfn;
|
||||
}
|
||||
|
||||
int __init
|
||||
create_mem_map_page_table (u64 start, u64 end, void *arg)
|
||||
|
@ -32,7 +32,7 @@ ioremap (unsigned long offset, unsigned long size)
|
||||
*/
|
||||
attr = kern_mem_attribute(offset, size);
|
||||
if (attr & EFI_MEMORY_WB)
|
||||
return phys_to_virt(offset);
|
||||
return (void __iomem *) phys_to_virt(offset);
|
||||
else if (attr & EFI_MEMORY_UC)
|
||||
return __ioremap(offset, size);
|
||||
|
||||
@ -43,7 +43,7 @@ ioremap (unsigned long offset, unsigned long size)
|
||||
gran_base = GRANULEROUNDDOWN(offset);
|
||||
gran_size = GRANULEROUNDUP(offset + size) - gran_base;
|
||||
if (efi_mem_attribute(gran_base, gran_size) & EFI_MEMORY_WB)
|
||||
return phys_to_virt(offset);
|
||||
return (void __iomem *) phys_to_virt(offset);
|
||||
|
||||
return __ioremap(offset, size);
|
||||
}
|
||||
@ -53,7 +53,7 @@ void __iomem *
|
||||
ioremap_nocache (unsigned long offset, unsigned long size)
|
||||
{
|
||||
if (kern_mem_attribute(offset, size) & EFI_MEMORY_WB)
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
return __ioremap(offset, size);
|
||||
}
|
||||
|
@ -480,7 +480,7 @@ xpc_activating(void *__partid)
|
||||
partid_t partid = (u64) __partid;
|
||||
struct xpc_partition *part = &xpc_partitions[partid];
|
||||
unsigned long irq_flags;
|
||||
struct sched_param param = { sched_priority: MAX_RT_PRIO - 1 };
|
||||
struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };
|
||||
int ret;
|
||||
|
||||
|
||||
|
@ -74,7 +74,7 @@ tioce_mmr_war_pre(struct tioce_kernel *kern, void *mmr_addr)
|
||||
else
|
||||
mmr_war_offset = 0x158;
|
||||
|
||||
readq_relaxed((void *)(mmr_base + mmr_war_offset));
|
||||
readq_relaxed((void __iomem *)(mmr_base + mmr_war_offset));
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,8 +92,8 @@ tioce_mmr_war_post(struct tioce_kernel *kern, void *mmr_addr)
|
||||
|
||||
if (mmr_offset < 0x45000) {
|
||||
if (mmr_offset == 0x100)
|
||||
readq_relaxed((void *)(mmr_base + 0x38));
|
||||
readq_relaxed((void *)(mmr_base + 0xb050));
|
||||
readq_relaxed((void __iomem *)(mmr_base + 0x38));
|
||||
readq_relaxed((void __iomem *)(mmr_base + 0xb050));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -571,6 +571,27 @@ int rtas_set_indicator(int indicator, int index, int new_value)
|
||||
}
|
||||
EXPORT_SYMBOL(rtas_set_indicator);
|
||||
|
||||
/*
|
||||
* Ignoring RTAS extended delay
|
||||
*/
|
||||
int rtas_set_indicator_fast(int indicator, int index, int new_value)
|
||||
{
|
||||
int rc;
|
||||
int token = rtas_token("set-indicator");
|
||||
|
||||
if (token == RTAS_UNKNOWN_SERVICE)
|
||||
return -ENOENT;
|
||||
|
||||
rc = rtas_call(token, 3, 1, NULL, indicator, index, new_value);
|
||||
|
||||
WARN_ON(rc == -2 || (rc >= 9900 && rc <= 9905));
|
||||
|
||||
if (rc < 0)
|
||||
return rtas_error_rc(rc);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
void rtas_restart(char *cmd)
|
||||
{
|
||||
if (rtas_flash_term_hook)
|
||||
|
@ -213,8 +213,6 @@ static void pseries_lpar_enable_pmcs(void)
|
||||
{
|
||||
unsigned long set, reset;
|
||||
|
||||
power4_enable_pmcs();
|
||||
|
||||
set = 1UL << 63;
|
||||
reset = 0;
|
||||
plpar_hcall_norets(H_PERFMON, set, reset);
|
||||
|
@ -447,7 +447,7 @@ void xics_setup_cpu(void)
|
||||
*
|
||||
* XXX: undo of teardown on kexec needs this too, as may hotplug
|
||||
*/
|
||||
rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
|
||||
rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
|
||||
(1UL << interrupt_server_size) - 1 - default_distrib_server, 1);
|
||||
}
|
||||
|
||||
@ -776,7 +776,7 @@ void xics_teardown_cpu(int secondary)
|
||||
* so leave the master cpu in the group.
|
||||
*/
|
||||
if (secondary)
|
||||
rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
|
||||
rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
|
||||
(1UL << interrupt_server_size) - 1 -
|
||||
default_distrib_server, 0);
|
||||
}
|
||||
@ -793,7 +793,7 @@ void xics_migrate_irqs_away(void)
|
||||
xics_set_cpu_priority(cpu, 0);
|
||||
|
||||
/* remove ourselves from the global interrupt queue */
|
||||
status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
|
||||
status = rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
|
||||
(1UL << interrupt_server_size) - 1 - default_distrib_server, 0);
|
||||
WARN_ON(status < 0);
|
||||
|
||||
|
@ -421,18 +421,22 @@ static struct miscdevice sq_dev = {
|
||||
|
||||
static int __init sq_api_init(void)
|
||||
{
|
||||
int ret;
|
||||
printk(KERN_NOTICE "sq: Registering store queue API.\n");
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
create_proc_read_entry("sq_mapping", 0, 0, sq_mapping_read_proc, 0);
|
||||
#endif
|
||||
|
||||
return misc_register(&sq_dev);
|
||||
ret = misc_register(&sq_dev);
|
||||
if (ret)
|
||||
remove_proc_entry("sq_mapping", NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void __exit sq_api_exit(void)
|
||||
{
|
||||
misc_deregister(&sq_dev);
|
||||
remove_proc_entry("sq_mapping", NULL);
|
||||
}
|
||||
|
||||
module_init(sq_api_init);
|
||||
|
@ -513,6 +513,7 @@ END(stub_rt_sigreturn)
|
||||
swapgs
|
||||
1: incl %gs:pda_irqcount # RED-PEN should check preempt count
|
||||
cmoveq %gs:pda_irqstackptr,%rsp
|
||||
push %rbp # backlink for old unwinder
|
||||
/*
|
||||
* We entered an interrupt context - irqs are off:
|
||||
*/
|
||||
@ -1139,18 +1140,21 @@ ENTRY(machine_check)
|
||||
END(machine_check)
|
||||
#endif
|
||||
|
||||
/* Call softirq on interrupt stack. Interrupts are off. */
|
||||
ENTRY(call_softirq)
|
||||
CFI_STARTPROC
|
||||
movq %gs:pda_irqstackptr,%rax
|
||||
movq %rsp,%rdx
|
||||
CFI_DEF_CFA_REGISTER rdx
|
||||
push %rbp
|
||||
CFI_ADJUST_CFA_OFFSET 8
|
||||
CFI_REL_OFFSET rbp,0
|
||||
mov %rsp,%rbp
|
||||
CFI_DEF_CFA_REGISTER rbp
|
||||
incl %gs:pda_irqcount
|
||||
cmove %rax,%rsp
|
||||
pushq %rdx
|
||||
/*todo CFI_DEF_CFA_EXPRESSION ...*/
|
||||
cmove %gs:pda_irqstackptr,%rsp
|
||||
push %rbp # backlink for old unwinder
|
||||
call __do_softirq
|
||||
popq %rsp
|
||||
leaveq
|
||||
CFI_DEF_CFA_REGISTER rsp
|
||||
CFI_ADJUST_CFA_OFFSET -8
|
||||
decl %gs:pda_irqcount
|
||||
ret
|
||||
CFI_ENDPROC
|
||||
|
@ -92,5 +92,7 @@ void __init no_iommu_init(void)
|
||||
{
|
||||
if (dma_ops)
|
||||
return;
|
||||
|
||||
force_iommu = 0; /* no HW IOMMU */
|
||||
dma_ops = &nommu_dma_ops;
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ int __cpuinit init_smp_flush(void)
|
||||
{
|
||||
int i;
|
||||
for_each_cpu_mask(i, cpu_possible_map) {
|
||||
spin_lock_init(&per_cpu(flush_state.tlbstate_lock, i));
|
||||
spin_lock_init(&per_cpu(flush_state, i).tlbstate_lock);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -129,11 +129,15 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
|
||||
struct acpi_memory_info *info, *n;
|
||||
|
||||
|
||||
if (!list_empty(&mem_device->res_list))
|
||||
return 0;
|
||||
|
||||
status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,
|
||||
acpi_memory_get_resource, mem_device);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
list_for_each_entry_safe(info, n, &mem_device->res_list, list)
|
||||
kfree(info);
|
||||
INIT_LIST_HEAD(&mem_device->res_list);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -230,17 +234,10 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
|
||||
* (i.e. memory-hot-remove function)
|
||||
*/
|
||||
list_for_each_entry(info, &mem_device->res_list, list) {
|
||||
u64 start_pfn, end_pfn;
|
||||
|
||||
start_pfn = info->start_addr >> PAGE_SHIFT;
|
||||
end_pfn = (info->start_addr + info->length - 1) >> PAGE_SHIFT;
|
||||
|
||||
if (pfn_valid(start_pfn) || pfn_valid(end_pfn)) {
|
||||
/* already enabled. try next area */
|
||||
if (info->enabled) { /* just sanity check...*/
|
||||
num_enabled++;
|
||||
continue;
|
||||
}
|
||||
|
||||
result = add_memory(node, info->start_addr, info->length);
|
||||
if (result)
|
||||
continue;
|
||||
|
@ -58,8 +58,8 @@ struct dock_dependent_device {
|
||||
};
|
||||
|
||||
#define DOCK_DOCKING 0x00000001
|
||||
#define DOCK_EVENT KOBJ_DOCK
|
||||
#define UNDOCK_EVENT KOBJ_UNDOCK
|
||||
#define DOCK_EVENT 3
|
||||
#define UNDOCK_EVENT 2
|
||||
|
||||
static struct dock_station *dock_station;
|
||||
|
||||
@ -322,11 +322,10 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event)
|
||||
|
||||
static void dock_event(struct dock_station *ds, u32 event, int num)
|
||||
{
|
||||
struct acpi_device *device;
|
||||
|
||||
device = dock_create_acpi_device(ds->handle);
|
||||
if (device)
|
||||
kobject_uevent(&device->kobj, num);
|
||||
/*
|
||||
* we don't do events until someone tells me that
|
||||
* they would like to have them.
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -311,7 +311,8 @@ static void hvsi_recv_control(struct hvsi_struct *hp, uint8_t *packet,
|
||||
/* CD went away; no more connection */
|
||||
pr_debug("hvsi%i: CD dropped\n", hp->index);
|
||||
hp->mctrl &= TIOCM_CD;
|
||||
if (!(hp->tty->flags & CLOCAL))
|
||||
/* If userland hasn't done an open(2) yet, hp->tty is NULL. */
|
||||
if (hp->tty && !(hp->tty->flags & CLOCAL))
|
||||
*to_hangup = hp->tty;
|
||||
}
|
||||
break;
|
||||
@ -986,10 +987,7 @@ static void hvsi_write_worker(void *arg)
|
||||
start_j = 0;
|
||||
#endif /* DEBUG */
|
||||
wake_up_all(&hp->emptyq);
|
||||
if (test_bit(TTY_DO_WRITE_WAKEUP, &hp->tty->flags)
|
||||
&& hp->tty->ldisc.write_wakeup)
|
||||
hp->tty->ldisc.write_wakeup(hp->tty);
|
||||
wake_up_interruptible(&hp->tty->write_wait);
|
||||
tty_wakeup(hp->tty);
|
||||
}
|
||||
|
||||
out:
|
||||
|
@ -25,12 +25,12 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/random.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/hw_random.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/hardware/clock.h>
|
||||
|
||||
#define RNG_OUT_REG 0x00 /* Output register */
|
||||
#define RNG_STAT_REG 0x04 /* Status register
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
static void __iomem *rng_base;
|
||||
static struct clk *rng_ick;
|
||||
static struct device *rng_dev;
|
||||
static struct platform_device *rng_dev;
|
||||
|
||||
static u32 omap_rng_read_reg(int reg)
|
||||
{
|
||||
@ -83,9 +83,8 @@ static struct hwrng omap_rng_ops = {
|
||||
.data_read = omap_rng_data_read,
|
||||
};
|
||||
|
||||
static int __init omap_rng_probe(struct device *dev)
|
||||
static int __init omap_rng_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct resource *res, *mem;
|
||||
int ret;
|
||||
|
||||
@ -95,16 +94,14 @@ static int __init omap_rng_probe(struct device *dev)
|
||||
*/
|
||||
BUG_ON(rng_dev);
|
||||
|
||||
if (cpu_is_omap24xx()) {
|
||||
if (cpu_is_omap24xx()) {
|
||||
rng_ick = clk_get(NULL, "rng_ick");
|
||||
if (IS_ERR(rng_ick)) {
|
||||
dev_err(dev, "Could not get rng_ick\n");
|
||||
dev_err(&pdev->dev, "Could not get rng_ick\n");
|
||||
ret = PTR_ERR(rng_ick);
|
||||
return ret;
|
||||
}
|
||||
else {
|
||||
clk_use(rng_ick);
|
||||
}
|
||||
} else
|
||||
clk_enable(rng_ick);
|
||||
}
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
@ -117,7 +114,7 @@ static int __init omap_rng_probe(struct device *dev)
|
||||
if (mem == NULL)
|
||||
return -EBUSY;
|
||||
|
||||
dev_set_drvdata(dev, mem);
|
||||
dev_set_drvdata(&pdev->dev, mem);
|
||||
rng_base = (u32 __iomem *)io_p2v(res->start);
|
||||
|
||||
ret = hwrng_register(&omap_rng_ops);
|
||||
@ -127,25 +124,25 @@ static int __init omap_rng_probe(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
dev_info(dev, "OMAP Random Number Generator ver. %02x\n",
|
||||
dev_info(&pdev->dev, "OMAP Random Number Generator ver. %02x\n",
|
||||
omap_rng_read_reg(RNG_REV_REG));
|
||||
omap_rng_write_reg(RNG_MASK_REG, 0x1);
|
||||
|
||||
rng_dev = dev;
|
||||
rng_dev = pdev;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __exit omap_rng_remove(struct device *dev)
|
||||
static int __exit omap_rng_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *mem = dev_get_drvdata(dev);
|
||||
struct resource *mem = dev_get_drvdata(&pdev->dev);
|
||||
|
||||
hwrng_unregister(&omap_rng_ops);
|
||||
|
||||
omap_rng_write_reg(RNG_MASK_REG, 0x0);
|
||||
|
||||
if (cpu_is_omap24xx()) {
|
||||
clk_unuse(rng_ick);
|
||||
clk_disable(rng_ick);
|
||||
clk_put(rng_ick);
|
||||
}
|
||||
|
||||
@ -157,18 +154,16 @@ static int __exit omap_rng_remove(struct device *dev)
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
static int omap_rng_suspend(struct device *dev, pm_message_t message, u32 level)
|
||||
static int omap_rng_suspend(struct platform_device *pdev, pm_message_t message)
|
||||
{
|
||||
omap_rng_write_reg(RNG_MASK_REG, 0x0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int omap_rng_resume(struct device *dev, pm_message_t message, u32 level)
|
||||
static int omap_rng_resume(struct platform_device *pdev)
|
||||
{
|
||||
omap_rng_write_reg(RNG_MASK_REG, 0x1);
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -179,9 +174,11 @@ static int omap_rng_resume(struct device *dev, pm_message_t message, u32 level)
|
||||
#endif
|
||||
|
||||
|
||||
static struct device_driver omap_rng_driver = {
|
||||
.name = "omap_rng",
|
||||
.bus = &platform_bus_type,
|
||||
static struct platform_driver omap_rng_driver = {
|
||||
.driver = {
|
||||
.name = "omap_rng",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
.probe = omap_rng_probe,
|
||||
.remove = __exit_p(omap_rng_remove),
|
||||
.suspend = omap_rng_suspend,
|
||||
@ -193,12 +190,12 @@ static int __init omap_rng_init(void)
|
||||
if (!cpu_is_omap16xx() && !cpu_is_omap24xx())
|
||||
return -ENODEV;
|
||||
|
||||
return driver_register(&omap_rng_driver);
|
||||
return platform_driver_register(&omap_rng_driver);
|
||||
}
|
||||
|
||||
static void __exit omap_rng_exit(void)
|
||||
{
|
||||
driver_unregister(&omap_rng_driver);
|
||||
platform_driver_unregister(&omap_rng_driver);
|
||||
}
|
||||
|
||||
module_init(omap_rng_init);
|
||||
|
@ -107,7 +107,6 @@ const int NR_TYPES = ARRAY_SIZE(max_vals);
|
||||
|
||||
struct kbd_struct kbd_table[MAX_NR_CONSOLES];
|
||||
static struct kbd_struct *kbd = kbd_table;
|
||||
static struct kbd_struct kbd0;
|
||||
|
||||
int spawnpid, spawnsig;
|
||||
|
||||
@ -223,13 +222,13 @@ static void kd_nosound(unsigned long ignored)
|
||||
{
|
||||
struct list_head *node;
|
||||
|
||||
list_for_each(node,&kbd_handler.h_list) {
|
||||
list_for_each(node, &kbd_handler.h_list) {
|
||||
struct input_handle *handle = to_handle_h(node);
|
||||
if (test_bit(EV_SND, handle->dev->evbit)) {
|
||||
if (test_bit(SND_TONE, handle->dev->sndbit))
|
||||
input_event(handle->dev, EV_SND, SND_TONE, 0);
|
||||
input_inject_event(handle, EV_SND, SND_TONE, 0);
|
||||
if (test_bit(SND_BELL, handle->dev->sndbit))
|
||||
input_event(handle->dev, EV_SND, SND_BELL, 0);
|
||||
input_inject_event(handle, EV_SND, SND_BELL, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -247,11 +246,11 @@ void kd_mksound(unsigned int hz, unsigned int ticks)
|
||||
struct input_handle *handle = to_handle_h(node);
|
||||
if (test_bit(EV_SND, handle->dev->evbit)) {
|
||||
if (test_bit(SND_TONE, handle->dev->sndbit)) {
|
||||
input_event(handle->dev, EV_SND, SND_TONE, hz);
|
||||
input_inject_event(handle, EV_SND, SND_TONE, hz);
|
||||
break;
|
||||
}
|
||||
if (test_bit(SND_BELL, handle->dev->sndbit)) {
|
||||
input_event(handle->dev, EV_SND, SND_BELL, 1);
|
||||
input_inject_event(handle, EV_SND, SND_BELL, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -272,15 +271,15 @@ int kbd_rate(struct kbd_repeat *rep)
|
||||
unsigned int d = 0;
|
||||
unsigned int p = 0;
|
||||
|
||||
list_for_each(node,&kbd_handler.h_list) {
|
||||
list_for_each(node, &kbd_handler.h_list) {
|
||||
struct input_handle *handle = to_handle_h(node);
|
||||
struct input_dev *dev = handle->dev;
|
||||
|
||||
if (test_bit(EV_REP, dev->evbit)) {
|
||||
if (rep->delay > 0)
|
||||
input_event(dev, EV_REP, REP_DELAY, rep->delay);
|
||||
input_inject_event(handle, EV_REP, REP_DELAY, rep->delay);
|
||||
if (rep->period > 0)
|
||||
input_event(dev, EV_REP, REP_PERIOD, rep->period);
|
||||
input_inject_event(handle, EV_REP, REP_PERIOD, rep->period);
|
||||
d = dev->rep[REP_DELAY];
|
||||
p = dev->rep[REP_PERIOD];
|
||||
}
|
||||
@ -988,7 +987,7 @@ static inline unsigned char getleds(void)
|
||||
* interrupt routines for this thing allows us to easily mask
|
||||
* this when we don't want any of the above to happen.
|
||||
* This allows for easy and efficient race-condition prevention
|
||||
* for kbd_refresh_leds => input_event(dev, EV_LED, ...) => ...
|
||||
* for kbd_start => input_inject_event(dev, EV_LED, ...) => ...
|
||||
*/
|
||||
|
||||
static void kbd_bh(unsigned long dummy)
|
||||
@ -998,11 +997,11 @@ static void kbd_bh(unsigned long dummy)
|
||||
|
||||
if (leds != ledstate) {
|
||||
list_for_each(node, &kbd_handler.h_list) {
|
||||
struct input_handle * handle = to_handle_h(node);
|
||||
input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01));
|
||||
input_event(handle->dev, EV_LED, LED_NUML, !!(leds & 0x02));
|
||||
input_event(handle->dev, EV_LED, LED_CAPSL, !!(leds & 0x04));
|
||||
input_sync(handle->dev);
|
||||
struct input_handle *handle = to_handle_h(node);
|
||||
input_inject_event(handle, EV_LED, LED_SCROLLL, !!(leds & 0x01));
|
||||
input_inject_event(handle, EV_LED, LED_NUML, !!(leds & 0x02));
|
||||
input_inject_event(handle, EV_LED, LED_CAPSL, !!(leds & 0x04));
|
||||
input_inject_event(handle, EV_SYN, SYN_REPORT, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1011,23 +1010,6 @@ static void kbd_bh(unsigned long dummy)
|
||||
|
||||
DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
|
||||
|
||||
/*
|
||||
* This allows a newly plugged keyboard to pick the LED state.
|
||||
*/
|
||||
static void kbd_refresh_leds(struct input_handle *handle)
|
||||
{
|
||||
unsigned char leds = ledstate;
|
||||
|
||||
tasklet_disable(&keyboard_tasklet);
|
||||
if (leds != 0xff) {
|
||||
input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01));
|
||||
input_event(handle->dev, EV_LED, LED_NUML, !!(leds & 0x02));
|
||||
input_event(handle->dev, EV_LED, LED_CAPSL, !!(leds & 0x04));
|
||||
input_sync(handle->dev);
|
||||
}
|
||||
tasklet_enable(&keyboard_tasklet);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) ||\
|
||||
defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) ||\
|
||||
defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) ||\
|
||||
@ -1043,7 +1025,7 @@ static const unsigned short x86_keycodes[256] =
|
||||
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
|
||||
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
|
||||
80, 81, 82, 83, 84,118, 86, 87, 88,115,120,119,121,112,123, 92,
|
||||
284,285,309,298,312, 91,327,328,329,331,333,335,336,337,338,339,
|
||||
284,285,309, 0,312, 91,327,328,329,331,333,335,336,337,338,339,
|
||||
367,288,302,304,350, 89,334,326,267,126,268,269,125,347,348,349,
|
||||
360,261,262,263,268,376,100,101,321,316,373,286,289,102,351,355,
|
||||
103,104,105,275,287,279,306,106,274,107,294,364,358,363,362,361,
|
||||
@ -1065,38 +1047,55 @@ extern void sun_do_break(void);
|
||||
static int emulate_raw(struct vc_data *vc, unsigned int keycode,
|
||||
unsigned char up_flag)
|
||||
{
|
||||
if (keycode > 255 || !x86_keycodes[keycode])
|
||||
return -1;
|
||||
int code;
|
||||
|
||||
switch (keycode) {
|
||||
case KEY_PAUSE:
|
||||
put_queue(vc, 0xe1);
|
||||
put_queue(vc, 0x1d | up_flag);
|
||||
put_queue(vc, 0x45 | up_flag);
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case KEY_HANGEUL:
|
||||
if (!up_flag)
|
||||
put_queue(vc, 0xf2);
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case KEY_HANJA:
|
||||
if (!up_flag)
|
||||
put_queue(vc, 0xf1);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
if (keycode == KEY_SYSRQ && sysrq_alt) {
|
||||
put_queue(vc, 0x54 | up_flag);
|
||||
return 0;
|
||||
}
|
||||
case KEY_SYSRQ:
|
||||
/*
|
||||
* Real AT keyboards (that's what we're trying
|
||||
* to emulate here emit 0xe0 0x2a 0xe0 0x37 when
|
||||
* pressing PrtSc/SysRq alone, but simply 0x54
|
||||
* when pressing Alt+PrtSc/SysRq.
|
||||
*/
|
||||
if (sysrq_alt) {
|
||||
put_queue(vc, 0x54 | up_flag);
|
||||
} else {
|
||||
put_queue(vc, 0xe0);
|
||||
put_queue(vc, 0x2a | up_flag);
|
||||
put_queue(vc, 0xe0);
|
||||
put_queue(vc, 0x37 | up_flag);
|
||||
}
|
||||
break;
|
||||
|
||||
if (x86_keycodes[keycode] & 0x100)
|
||||
put_queue(vc, 0xe0);
|
||||
default:
|
||||
if (keycode > 255)
|
||||
return -1;
|
||||
|
||||
put_queue(vc, (x86_keycodes[keycode] & 0x7f) | up_flag);
|
||||
code = x86_keycodes[keycode];
|
||||
if (!code)
|
||||
return -1;
|
||||
|
||||
if (keycode == KEY_SYSRQ) {
|
||||
put_queue(vc, 0xe0);
|
||||
put_queue(vc, 0x37 | up_flag);
|
||||
if (code & 0x100)
|
||||
put_queue(vc, 0xe0);
|
||||
put_queue(vc, (code & 0x7f) | up_flag);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -1298,16 +1297,15 @@ static struct input_handle *kbd_connect(struct input_handler *handler,
|
||||
if (i == BTN_MISC && !test_bit(EV_SND, dev->evbit))
|
||||
return NULL;
|
||||
|
||||
if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL)))
|
||||
handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL);
|
||||
if (!handle)
|
||||
return NULL;
|
||||
memset(handle, 0, sizeof(struct input_handle));
|
||||
|
||||
handle->dev = dev;
|
||||
handle->handler = handler;
|
||||
handle->name = "kbd";
|
||||
|
||||
input_open_device(handle);
|
||||
kbd_refresh_leds(handle);
|
||||
|
||||
return handle;
|
||||
}
|
||||
@ -1318,6 +1316,24 @@ static void kbd_disconnect(struct input_handle *handle)
|
||||
kfree(handle);
|
||||
}
|
||||
|
||||
/*
|
||||
* Start keyboard handler on the new keyboard by refreshing LED state to
|
||||
* match the rest of the system.
|
||||
*/
|
||||
static void kbd_start(struct input_handle *handle)
|
||||
{
|
||||
unsigned char leds = ledstate;
|
||||
|
||||
tasklet_disable(&keyboard_tasklet);
|
||||
if (leds != 0xff) {
|
||||
input_inject_event(handle, EV_LED, LED_SCROLLL, !!(leds & 0x01));
|
||||
input_inject_event(handle, EV_LED, LED_NUML, !!(leds & 0x02));
|
||||
input_inject_event(handle, EV_LED, LED_CAPSL, !!(leds & 0x04));
|
||||
input_inject_event(handle, EV_SYN, SYN_REPORT, 0);
|
||||
}
|
||||
tasklet_enable(&keyboard_tasklet);
|
||||
}
|
||||
|
||||
static struct input_device_id kbd_ids[] = {
|
||||
{
|
||||
.flags = INPUT_DEVICE_ID_MATCH_EVBIT,
|
||||
@ -1338,6 +1354,7 @@ static struct input_handler kbd_handler = {
|
||||
.event = kbd_event,
|
||||
.connect = kbd_connect,
|
||||
.disconnect = kbd_disconnect,
|
||||
.start = kbd_start,
|
||||
.name = "kbd",
|
||||
.id_table = kbd_ids,
|
||||
};
|
||||
@ -1346,15 +1363,15 @@ int __init kbd_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
kbd0.ledflagstate = kbd0.default_ledflagstate = KBD_DEFLEDS;
|
||||
kbd0.ledmode = LED_SHOW_FLAGS;
|
||||
kbd0.lockstate = KBD_DEFLOCK;
|
||||
kbd0.slockstate = 0;
|
||||
kbd0.modeflags = KBD_DEFMODE;
|
||||
kbd0.kbdmode = VC_XLATE;
|
||||
|
||||
for (i = 0 ; i < MAX_NR_CONSOLES ; i++)
|
||||
kbd_table[i] = kbd0;
|
||||
for (i = 0; i < MAX_NR_CONSOLES; i++) {
|
||||
kbd_table[i].ledflagstate = KBD_DEFLEDS;
|
||||
kbd_table[i].default_ledflagstate = KBD_DEFLEDS;
|
||||
kbd_table[i].ledmode = LED_SHOW_FLAGS;
|
||||
kbd_table[i].lockstate = KBD_DEFLOCK;
|
||||
kbd_table[i].slockstate = 0;
|
||||
kbd_table[i].modeflags = KBD_DEFMODE;
|
||||
kbd_table[i].kbdmode = VC_XLATE;
|
||||
}
|
||||
|
||||
input_register_handler(&kbd_handler);
|
||||
|
||||
|
@ -374,7 +374,12 @@ scdrv_init(void)
|
||||
struct sysctl_data_s *scd;
|
||||
void *salbuf;
|
||||
dev_t first_dev, dev;
|
||||
nasid_t event_nasid = ia64_sn_get_console_nasid();
|
||||
nasid_t event_nasid;
|
||||
|
||||
if (!ia64_platform_is("sn2"))
|
||||
return -ENODEV;
|
||||
|
||||
event_nasid = ia64_sn_get_console_nasid();
|
||||
|
||||
if (alloc_chrdev_region(&first_dev, 0, num_cnodes,
|
||||
SYSCTL_BASENAME) < 0) {
|
||||
|
@ -284,39 +284,69 @@ EXPORT_SYMBOL_GPL(cpufreq_notify_transition);
|
||||
* SYSFS INTERFACE *
|
||||
*********************************************************************/
|
||||
|
||||
static struct cpufreq_governor *__find_governor(const char *str_governor)
|
||||
{
|
||||
struct cpufreq_governor *t;
|
||||
|
||||
list_for_each_entry(t, &cpufreq_governor_list, governor_list)
|
||||
if (!strnicmp(str_governor,t->name,CPUFREQ_NAME_LEN))
|
||||
return t;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* cpufreq_parse_governor - parse a governor string
|
||||
*/
|
||||
static int cpufreq_parse_governor (char *str_governor, unsigned int *policy,
|
||||
struct cpufreq_governor **governor)
|
||||
{
|
||||
int err = -EINVAL;
|
||||
|
||||
if (!cpufreq_driver)
|
||||
return -EINVAL;
|
||||
goto out;
|
||||
|
||||
if (cpufreq_driver->setpolicy) {
|
||||
if (!strnicmp(str_governor, "performance", CPUFREQ_NAME_LEN)) {
|
||||
*policy = CPUFREQ_POLICY_PERFORMANCE;
|
||||
return 0;
|
||||
err = 0;
|
||||
} else if (!strnicmp(str_governor, "powersave", CPUFREQ_NAME_LEN)) {
|
||||
*policy = CPUFREQ_POLICY_POWERSAVE;
|
||||
return 0;
|
||||
err = 0;
|
||||
}
|
||||
return -EINVAL;
|
||||
} else {
|
||||
} else if (cpufreq_driver->target) {
|
||||
struct cpufreq_governor *t;
|
||||
|
||||
mutex_lock(&cpufreq_governor_mutex);
|
||||
if (!cpufreq_driver || !cpufreq_driver->target)
|
||||
goto out;
|
||||
list_for_each_entry(t, &cpufreq_governor_list, governor_list) {
|
||||
if (!strnicmp(str_governor,t->name,CPUFREQ_NAME_LEN)) {
|
||||
*governor = t;
|
||||
|
||||
t = __find_governor(str_governor);
|
||||
|
||||
if (t == NULL) {
|
||||
char *name = kasprintf(GFP_KERNEL, "cpufreq_%s", str_governor);
|
||||
|
||||
if (name) {
|
||||
int ret;
|
||||
|
||||
mutex_unlock(&cpufreq_governor_mutex);
|
||||
return 0;
|
||||
ret = request_module(name);
|
||||
mutex_lock(&cpufreq_governor_mutex);
|
||||
|
||||
if (ret == 0)
|
||||
t = __find_governor(str_governor);
|
||||
}
|
||||
|
||||
kfree(name);
|
||||
}
|
||||
out:
|
||||
|
||||
if (t != NULL) {
|
||||
*governor = t;
|
||||
err = 0;
|
||||
}
|
||||
|
||||
mutex_unlock(&cpufreq_governor_mutex);
|
||||
}
|
||||
return -EINVAL;
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@ -1265,23 +1295,21 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
|
||||
|
||||
int cpufreq_register_governor(struct cpufreq_governor *governor)
|
||||
{
|
||||
struct cpufreq_governor *t;
|
||||
int err;
|
||||
|
||||
if (!governor)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&cpufreq_governor_mutex);
|
||||
|
||||
list_for_each_entry(t, &cpufreq_governor_list, governor_list) {
|
||||
if (!strnicmp(governor->name,t->name,CPUFREQ_NAME_LEN)) {
|
||||
mutex_unlock(&cpufreq_governor_mutex);
|
||||
return -EBUSY;
|
||||
}
|
||||
err = -EBUSY;
|
||||
if (__find_governor(governor->name) == NULL) {
|
||||
err = 0;
|
||||
list_add(&governor->governor_list, &cpufreq_governor_list);
|
||||
}
|
||||
list_add(&governor->governor_list, &cpufreq_governor_list);
|
||||
|
||||
mutex_unlock(&cpufreq_governor_mutex);
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(cpufreq_register_governor);
|
||||
|
||||
@ -1343,6 +1371,11 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
|
||||
|
||||
memcpy(&policy->cpuinfo, &data->cpuinfo, sizeof(struct cpufreq_cpuinfo));
|
||||
|
||||
if (policy->min > data->min && policy->min > policy->max) {
|
||||
ret = -EINVAL;
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
/* verify the cpu speed can be set within this limit */
|
||||
ret = cpufreq_driver->verify(policy);
|
||||
if (ret)
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#define EDAC_MC_LABEL_LEN 31
|
||||
#define MC_PROC_NAME_MAX_LEN 7
|
||||
|
@ -232,7 +232,7 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface)
|
||||
unsigned long timeout;
|
||||
|
||||
timeout = jiffies + POLL_TIMEOUT;
|
||||
while (time_before(jiffies, timeout)) {
|
||||
while (1) {
|
||||
status = inb(ACBST);
|
||||
|
||||
/* Reset the status register to avoid the hang */
|
||||
@ -242,7 +242,10 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface)
|
||||
scx200_acb_machine(iface, status);
|
||||
return;
|
||||
}
|
||||
yield();
|
||||
if (time_after(jiffies, timeout))
|
||||
break;
|
||||
cpu_relax();
|
||||
cond_resched();
|
||||
}
|
||||
|
||||
dev_err(&iface->adapter.dev, "timeout in state %s\n",
|
||||
|
@ -2515,6 +2515,9 @@ static int sbp2scsi_slave_configure(struct scsi_device *sdev)
|
||||
sdev->skip_ms_page_8 = 1;
|
||||
if (scsi_id->workarounds & SBP2_WORKAROUND_FIX_CAPACITY)
|
||||
sdev->fix_capacity = 1;
|
||||
if (scsi_id->ne->guid_vendor_id == 0x0010b9 && /* Maxtor's OUI */
|
||||
(sdev->type == TYPE_DISK || sdev->type == TYPE_RBC))
|
||||
sdev->allow_restart = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include <net/arp.h>
|
||||
#include <net/neighbour.h>
|
||||
#include <net/route.h>
|
||||
#include <net/netevent.h>
|
||||
#include <rdma/ib_addr.h>
|
||||
|
||||
MODULE_AUTHOR("Sean Hefty");
|
||||
@ -326,25 +327,22 @@ void rdma_addr_cancel(struct rdma_dev_addr *addr)
|
||||
}
|
||||
EXPORT_SYMBOL(rdma_addr_cancel);
|
||||
|
||||
static int addr_arp_recv(struct sk_buff *skb, struct net_device *dev,
|
||||
struct packet_type *pkt, struct net_device *orig_dev)
|
||||
static int netevent_callback(struct notifier_block *self, unsigned long event,
|
||||
void *ctx)
|
||||
{
|
||||
struct arphdr *arp_hdr;
|
||||
if (event == NETEVENT_NEIGH_UPDATE) {
|
||||
struct neighbour *neigh = ctx;
|
||||
|
||||
arp_hdr = (struct arphdr *) skb->nh.raw;
|
||||
|
||||
if (arp_hdr->ar_op == htons(ARPOP_REQUEST) ||
|
||||
arp_hdr->ar_op == htons(ARPOP_REPLY))
|
||||
set_timeout(jiffies);
|
||||
|
||||
kfree_skb(skb);
|
||||
if (neigh->dev->type == ARPHRD_INFINIBAND &&
|
||||
(neigh->nud_state & NUD_VALID)) {
|
||||
set_timeout(jiffies);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct packet_type addr_arp = {
|
||||
.type = __constant_htons(ETH_P_ARP),
|
||||
.func = addr_arp_recv,
|
||||
.af_packet_priv = (void*) 1,
|
||||
static struct notifier_block nb = {
|
||||
.notifier_call = netevent_callback
|
||||
};
|
||||
|
||||
static int addr_init(void)
|
||||
@ -353,13 +351,13 @@ static int addr_init(void)
|
||||
if (!addr_wq)
|
||||
return -ENOMEM;
|
||||
|
||||
dev_add_pack(&addr_arp);
|
||||
register_netevent_notifier(&nb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void addr_cleanup(void)
|
||||
{
|
||||
dev_remove_pack(&addr_arp);
|
||||
unregister_netevent_notifier(&nb);
|
||||
destroy_workqueue(addr_wq);
|
||||
}
|
||||
|
||||
|
@ -975,8 +975,10 @@ int ib_send_cm_req(struct ib_cm_id *cm_id,
|
||||
|
||||
cm_id_priv->timewait_info = cm_create_timewait_info(cm_id_priv->
|
||||
id.local_id);
|
||||
if (IS_ERR(cm_id_priv->timewait_info))
|
||||
if (IS_ERR(cm_id_priv->timewait_info)) {
|
||||
ret = PTR_ERR(cm_id_priv->timewait_info);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = cm_init_av_by_path(param->primary_path, &cm_id_priv->av);
|
||||
if (ret)
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include <linux/kref.h>
|
||||
#include <linux/idr.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/completion.h>
|
||||
|
||||
#include <rdma/ib_verbs.h>
|
||||
#include <rdma/ib_user_verbs.h>
|
||||
@ -69,6 +70,7 @@
|
||||
|
||||
struct ib_uverbs_device {
|
||||
struct kref ref;
|
||||
struct completion comp;
|
||||
int devnum;
|
||||
struct cdev *dev;
|
||||
struct class_device *class_dev;
|
||||
|
@ -122,7 +122,7 @@ static void ib_uverbs_release_dev(struct kref *ref)
|
||||
struct ib_uverbs_device *dev =
|
||||
container_of(ref, struct ib_uverbs_device, ref);
|
||||
|
||||
kfree(dev);
|
||||
complete(&dev->comp);
|
||||
}
|
||||
|
||||
void ib_uverbs_release_ucq(struct ib_uverbs_file *file,
|
||||
@ -740,6 +740,7 @@ static void ib_uverbs_add_one(struct ib_device *device)
|
||||
return;
|
||||
|
||||
kref_init(&uverbs_dev->ref);
|
||||
init_completion(&uverbs_dev->comp);
|
||||
|
||||
spin_lock(&map_lock);
|
||||
uverbs_dev->devnum = find_first_zero_bit(dev_map, IB_UVERBS_MAX_DEVICES);
|
||||
@ -793,6 +794,8 @@ err_cdev:
|
||||
|
||||
err:
|
||||
kref_put(&uverbs_dev->ref, ib_uverbs_release_dev);
|
||||
wait_for_completion(&uverbs_dev->comp);
|
||||
kfree(uverbs_dev);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -812,7 +815,10 @@ static void ib_uverbs_remove_one(struct ib_device *device)
|
||||
spin_unlock(&map_lock);
|
||||
|
||||
clear_bit(uverbs_dev->devnum, dev_map);
|
||||
|
||||
kref_put(&uverbs_dev->ref, ib_uverbs_release_dev);
|
||||
wait_for_completion(&uverbs_dev->comp);
|
||||
kfree(uverbs_dev);
|
||||
}
|
||||
|
||||
static int uverbs_event_get_sb(struct file_system_type *fs_type, int flags,
|
||||
|
@ -108,14 +108,15 @@ void mthca_alloc_cleanup(struct mthca_alloc *alloc)
|
||||
* serialize access to the array.
|
||||
*/
|
||||
|
||||
#define MTHCA_ARRAY_MASK (PAGE_SIZE / sizeof (void *) - 1)
|
||||
|
||||
void *mthca_array_get(struct mthca_array *array, int index)
|
||||
{
|
||||
int p = (index * sizeof (void *)) >> PAGE_SHIFT;
|
||||
|
||||
if (array->page_list[p].page) {
|
||||
int i = index & (PAGE_SIZE / sizeof (void *) - 1);
|
||||
return array->page_list[p].page[i];
|
||||
} else
|
||||
if (array->page_list[p].page)
|
||||
return array->page_list[p].page[index & MTHCA_ARRAY_MASK];
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -130,8 +131,7 @@ int mthca_array_set(struct mthca_array *array, int index, void *value)
|
||||
if (!array->page_list[p].page)
|
||||
return -ENOMEM;
|
||||
|
||||
array->page_list[p].page[index & (PAGE_SIZE / sizeof (void *) - 1)] =
|
||||
value;
|
||||
array->page_list[p].page[index & MTHCA_ARRAY_MASK] = value;
|
||||
++array->page_list[p].used;
|
||||
|
||||
return 0;
|
||||
@ -144,7 +144,8 @@ void mthca_array_clear(struct mthca_array *array, int index)
|
||||
if (--array->page_list[p].used == 0) {
|
||||
free_page((unsigned long) array->page_list[p].page);
|
||||
array->page_list[p].page = NULL;
|
||||
}
|
||||
} else
|
||||
array->page_list[p].page[index & MTHCA_ARRAY_MASK] = NULL;
|
||||
|
||||
if (array->page_list[p].used < 0)
|
||||
pr_debug("Array %p index %d page %d with ref count %d < 0\n",
|
||||
|
@ -6,8 +6,7 @@ config INFINIBAND_IPOIB
|
||||
transports IP packets over InfiniBand so you can use your IB
|
||||
device as a fancy NIC.
|
||||
|
||||
The IPoIB protocol is defined by the IETF ipoib working
|
||||
group: <http://www.ietf.org/html.charters/ipoib-charter.html>.
|
||||
See Documentation/infiniband/ipoib.txt for more information
|
||||
|
||||
config INFINIBAND_IPOIB_DEBUG
|
||||
bool "IP-over-InfiniBand debugging" if EMBEDDED
|
||||
|
@ -77,6 +77,14 @@ MODULE_PARM_DESC(topspin_workarounds,
|
||||
|
||||
static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad };
|
||||
|
||||
static int mellanox_workarounds = 1;
|
||||
|
||||
module_param(mellanox_workarounds, int, 0444);
|
||||
MODULE_PARM_DESC(mellanox_workarounds,
|
||||
"Enable workarounds for Mellanox SRP target bugs if != 0");
|
||||
|
||||
static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 };
|
||||
|
||||
static void srp_add_one(struct ib_device *device);
|
||||
static void srp_remove_one(struct ib_device *device);
|
||||
static void srp_completion(struct ib_cq *cq, void *target_ptr);
|
||||
@ -526,8 +534,10 @@ static int srp_reconnect_target(struct srp_target_port *target)
|
||||
while (ib_poll_cq(target->cq, 1, &wc) > 0)
|
||||
; /* nothing */
|
||||
|
||||
spin_lock_irq(target->scsi_host->host_lock);
|
||||
list_for_each_entry_safe(req, tmp, &target->req_queue, list)
|
||||
srp_reset_req(target, req);
|
||||
spin_unlock_irq(target->scsi_host->host_lock);
|
||||
|
||||
target->rx_head = 0;
|
||||
target->tx_head = 0;
|
||||
@ -567,7 +577,7 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int srp_map_fmr(struct srp_device *dev, struct scatterlist *scat,
|
||||
static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat,
|
||||
int sg_cnt, struct srp_request *req,
|
||||
struct srp_direct_buf *buf)
|
||||
{
|
||||
@ -577,10 +587,15 @@ static int srp_map_fmr(struct srp_device *dev, struct scatterlist *scat,
|
||||
int page_cnt;
|
||||
int i, j;
|
||||
int ret;
|
||||
struct srp_device *dev = target->srp_host->dev;
|
||||
|
||||
if (!dev->fmr_pool)
|
||||
return -ENODEV;
|
||||
|
||||
if ((sg_dma_address(&scat[0]) & ~dev->fmr_page_mask) &&
|
||||
mellanox_workarounds && !memcmp(&target->ioc_guid, mellanox_oui, 3))
|
||||
return -EINVAL;
|
||||
|
||||
len = page_cnt = 0;
|
||||
for (i = 0; i < sg_cnt; ++i) {
|
||||
if (sg_dma_address(&scat[i]) & ~dev->fmr_page_mask) {
|
||||
@ -683,7 +698,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
|
||||
buf->va = cpu_to_be64(sg_dma_address(scat));
|
||||
buf->key = cpu_to_be32(target->srp_host->dev->mr->rkey);
|
||||
buf->len = cpu_to_be32(sg_dma_len(scat));
|
||||
} else if (srp_map_fmr(target->srp_host->dev, scat, count, req,
|
||||
} else if (srp_map_fmr(target, scat, count, req,
|
||||
(void *) cmd->add_data)) {
|
||||
/*
|
||||
* FMR mapping failed, and the scatterlist has more
|
||||
|
@ -127,14 +127,10 @@ static int evdev_open(struct inode * inode, struct file * file)
|
||||
{
|
||||
struct evdev_list *list;
|
||||
int i = iminor(inode) - EVDEV_MINOR_BASE;
|
||||
int accept_err;
|
||||
|
||||
if (i >= EVDEV_MINORS || !evdev_table[i] || !evdev_table[i]->exist)
|
||||
return -ENODEV;
|
||||
|
||||
if ((accept_err = input_accept_process(&(evdev_table[i]->handle), file)))
|
||||
return accept_err;
|
||||
|
||||
if (!(list = kzalloc(sizeof(struct evdev_list), GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
|
||||
@ -260,7 +256,7 @@ static ssize_t evdev_write(struct file * file, const char __user * buffer, size_
|
||||
|
||||
if (evdev_event_from_user(buffer + retval, &event))
|
||||
return -EFAULT;
|
||||
input_event(list->evdev->handle.dev, event.type, event.code, event.value);
|
||||
input_inject_event(&list->evdev->handle, event.type, event.code, event.value);
|
||||
retval += evdev_event_size();
|
||||
}
|
||||
|
||||
@ -428,8 +424,8 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd,
|
||||
if (get_user(v, ip + 1))
|
||||
return -EFAULT;
|
||||
|
||||
input_event(dev, EV_REP, REP_DELAY, u);
|
||||
input_event(dev, EV_REP, REP_PERIOD, v);
|
||||
input_inject_event(&evdev->handle, EV_REP, REP_DELAY, u);
|
||||
input_inject_event(&evdev->handle, EV_REP, REP_PERIOD, v);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -106,10 +106,10 @@ static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device
|
||||
gp->gameport = port;
|
||||
gp->res_port = request_region(port->io, 0x10, "FM801 GP");
|
||||
if (!gp->res_port) {
|
||||
kfree(gp);
|
||||
gameport_free_port(port);
|
||||
printk(KERN_DEBUG "fm801-gp: unable to grab region 0x%x-0x%x\n",
|
||||
port->io, port->io + 0x0f);
|
||||
gameport_free_port(port);
|
||||
kfree(gp);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,7 @@ static LIST_HEAD(gameport_list);
|
||||
|
||||
static struct bus_type gameport_bus;
|
||||
|
||||
static void gameport_add_driver(struct gameport_driver *drv);
|
||||
static void gameport_add_port(struct gameport *gameport);
|
||||
static void gameport_destroy_port(struct gameport *gameport);
|
||||
static void gameport_reconnect_port(struct gameport *gameport);
|
||||
@ -211,8 +212,14 @@ static void gameport_release_driver(struct gameport *gameport)
|
||||
|
||||
static void gameport_find_driver(struct gameport *gameport)
|
||||
{
|
||||
int error;
|
||||
|
||||
down_write(&gameport_bus.subsys.rwsem);
|
||||
device_attach(&gameport->dev);
|
||||
error = device_attach(&gameport->dev);
|
||||
if (error < 0)
|
||||
printk(KERN_WARNING
|
||||
"gameport: device_attach() failed for %s (%s), error: %d\n",
|
||||
gameport->phys, gameport->name, error);
|
||||
up_write(&gameport_bus.subsys.rwsem);
|
||||
}
|
||||
|
||||
@ -316,7 +323,6 @@ static void gameport_remove_duplicate_events(struct gameport_event *event)
|
||||
spin_unlock_irqrestore(&gameport_event_lock, flags);
|
||||
}
|
||||
|
||||
|
||||
static struct gameport_event *gameport_get_event(void)
|
||||
{
|
||||
struct gameport_event *event;
|
||||
@ -342,7 +348,6 @@ static struct gameport_event *gameport_get_event(void)
|
||||
static void gameport_handle_event(void)
|
||||
{
|
||||
struct gameport_event *event;
|
||||
struct gameport_driver *gameport_drv;
|
||||
|
||||
mutex_lock(&gameport_mutex);
|
||||
|
||||
@ -369,8 +374,7 @@ static void gameport_handle_event(void)
|
||||
break;
|
||||
|
||||
case GAMEPORT_REGISTER_DRIVER:
|
||||
gameport_drv = event->object;
|
||||
driver_register(&gameport_drv->driver);
|
||||
gameport_add_driver(event->object);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -532,6 +536,7 @@ static void gameport_init_port(struct gameport *gameport)
|
||||
if (gameport->parent)
|
||||
gameport->dev.parent = &gameport->parent->dev;
|
||||
|
||||
INIT_LIST_HEAD(&gameport->node);
|
||||
spin_lock_init(&gameport->timer_lock);
|
||||
init_timer(&gameport->poll_timer);
|
||||
gameport->poll_timer.function = gameport_run_poll_handler;
|
||||
@ -544,6 +549,8 @@ static void gameport_init_port(struct gameport *gameport)
|
||||
*/
|
||||
static void gameport_add_port(struct gameport *gameport)
|
||||
{
|
||||
int error;
|
||||
|
||||
if (gameport->parent)
|
||||
gameport->parent->child = gameport;
|
||||
|
||||
@ -558,8 +565,13 @@ static void gameport_add_port(struct gameport *gameport)
|
||||
printk(KERN_INFO "gameport: %s is %s, speed %dkHz\n",
|
||||
gameport->name, gameport->phys, gameport->speed);
|
||||
|
||||
device_add(&gameport->dev);
|
||||
gameport->registered = 1;
|
||||
error = device_add(&gameport->dev);
|
||||
if (error)
|
||||
printk(KERN_ERR
|
||||
"gameport: device_add() failed for %s (%s), error: %d\n",
|
||||
gameport->phys, gameport->name, error);
|
||||
else
|
||||
gameport->registered = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -583,10 +595,11 @@ static void gameport_destroy_port(struct gameport *gameport)
|
||||
|
||||
if (gameport->registered) {
|
||||
device_del(&gameport->dev);
|
||||
list_del_init(&gameport->node);
|
||||
gameport->registered = 0;
|
||||
}
|
||||
|
||||
list_del_init(&gameport->node);
|
||||
|
||||
gameport_remove_pending_events(gameport);
|
||||
put_device(&gameport->dev);
|
||||
}
|
||||
@ -704,11 +717,22 @@ static int gameport_driver_remove(struct device *dev)
|
||||
}
|
||||
|
||||
static struct bus_type gameport_bus = {
|
||||
.name = "gameport",
|
||||
.probe = gameport_driver_probe,
|
||||
.remove = gameport_driver_remove,
|
||||
.name = "gameport",
|
||||
.probe = gameport_driver_probe,
|
||||
.remove = gameport_driver_remove,
|
||||
};
|
||||
|
||||
static void gameport_add_driver(struct gameport_driver *drv)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = driver_register(&drv->driver);
|
||||
if (error)
|
||||
printk(KERN_ERR
|
||||
"gameport: driver_register() failed for %s, error: %d\n",
|
||||
drv->driver.name, error);
|
||||
}
|
||||
|
||||
void __gameport_register_driver(struct gameport_driver *drv, struct module *owner)
|
||||
{
|
||||
drv->driver.bus = &gameport_bus;
|
||||
@ -778,16 +802,24 @@ void gameport_close(struct gameport *gameport)
|
||||
|
||||
static int __init gameport_init(void)
|
||||
{
|
||||
gameport_task = kthread_run(gameport_thread, NULL, "kgameportd");
|
||||
if (IS_ERR(gameport_task)) {
|
||||
printk(KERN_ERR "gameport: Failed to start kgameportd\n");
|
||||
return PTR_ERR(gameport_task);
|
||||
}
|
||||
int error;
|
||||
|
||||
gameport_bus.dev_attrs = gameport_device_attrs;
|
||||
gameport_bus.drv_attrs = gameport_driver_attrs;
|
||||
gameport_bus.match = gameport_bus_match;
|
||||
bus_register(&gameport_bus);
|
||||
error = bus_register(&gameport_bus);
|
||||
if (error) {
|
||||
printk(KERN_ERR "gameport: failed to register gameport bus, error: %d\n", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
gameport_task = kthread_run(gameport_thread, NULL, "kgameportd");
|
||||
if (IS_ERR(gameport_task)) {
|
||||
bus_unregister(&gameport_bus);
|
||||
error = PTR_ERR(gameport_task);
|
||||
printk(KERN_ERR "gameport: Failed to start kgameportd, error: %d\n", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -35,6 +35,16 @@ static LIST_HEAD(input_handler_list);
|
||||
|
||||
static struct input_handler *input_table[8];
|
||||
|
||||
/**
|
||||
* input_event() - report new input event
|
||||
* @handle: device that generated the event
|
||||
* @type: type of the event
|
||||
* @code: event code
|
||||
* @value: value of the event
|
||||
*
|
||||
* This function should be used by drivers implementing various input devices
|
||||
* See also input_inject_event()
|
||||
*/
|
||||
void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
|
||||
{
|
||||
struct input_handle *handle;
|
||||
@ -183,6 +193,23 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
|
||||
}
|
||||
EXPORT_SYMBOL(input_event);
|
||||
|
||||
/**
|
||||
* input_inject_event() - send input event from input handler
|
||||
* @handle: input handle to send event through
|
||||
* @type: type of the event
|
||||
* @code: event code
|
||||
* @value: value of the event
|
||||
*
|
||||
* Similar to input_event() but will ignore event if device is "grabbed" and handle
|
||||
* injecting event is not the one that owns the device.
|
||||
*/
|
||||
void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
|
||||
{
|
||||
if (!handle->dev->grab || handle->dev->grab == handle)
|
||||
input_event(handle->dev, type, code, value);
|
||||
}
|
||||
EXPORT_SYMBOL(input_inject_event);
|
||||
|
||||
static void input_repeat_key(unsigned long data)
|
||||
{
|
||||
struct input_dev *dev = (void *) data;
|
||||
@ -197,15 +224,6 @@ static void input_repeat_key(unsigned long data)
|
||||
mod_timer(&dev->timer, jiffies + msecs_to_jiffies(dev->rep[REP_PERIOD]));
|
||||
}
|
||||
|
||||
int input_accept_process(struct input_handle *handle, struct file *file)
|
||||
{
|
||||
if (handle->dev->accept)
|
||||
return handle->dev->accept(handle->dev, file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(input_accept_process);
|
||||
|
||||
int input_grab_device(struct input_handle *handle)
|
||||
{
|
||||
if (handle->dev->grab)
|
||||
@ -218,8 +236,15 @@ EXPORT_SYMBOL(input_grab_device);
|
||||
|
||||
void input_release_device(struct input_handle *handle)
|
||||
{
|
||||
if (handle->dev->grab == handle)
|
||||
handle->dev->grab = NULL;
|
||||
struct input_dev *dev = handle->dev;
|
||||
|
||||
if (dev->grab == handle) {
|
||||
dev->grab = NULL;
|
||||
|
||||
list_for_each_entry(handle, &dev->h_list, d_node)
|
||||
if (handle->handler->start)
|
||||
handle->handler->start(handle);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(input_release_device);
|
||||
|
||||
@ -963,8 +988,11 @@ int input_register_device(struct input_dev *dev)
|
||||
list_for_each_entry(handler, &input_handler_list, node)
|
||||
if (!handler->blacklist || !input_match_device(handler->blacklist, dev))
|
||||
if ((id = input_match_device(handler->id_table, dev)))
|
||||
if ((handle = handler->connect(handler, dev, id)))
|
||||
if ((handle = handler->connect(handler, dev, id))) {
|
||||
input_link_handle(handle);
|
||||
if (handler->start)
|
||||
handler->start(handle);
|
||||
}
|
||||
|
||||
input_wakeup_procfs_readers();
|
||||
|
||||
@ -1028,8 +1056,11 @@ void input_register_handler(struct input_handler *handler)
|
||||
list_for_each_entry(dev, &input_dev_list, node)
|
||||
if (!handler->blacklist || !input_match_device(handler->blacklist, dev))
|
||||
if ((id = input_match_device(handler->id_table, dev)))
|
||||
if ((handle = handler->connect(handler, dev, id)))
|
||||
if ((handle = handler->connect(handler, dev, id))) {
|
||||
input_link_handle(handle);
|
||||
if (handler->start)
|
||||
handler->start(handle);
|
||||
}
|
||||
|
||||
input_wakeup_procfs_readers();
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ static struct iforce_device iforce_device[] = {
|
||||
{ 0x06f8, 0x0001, "Guillemot Race Leader Force Feedback", btn_wheel, abs_wheel, ff_iforce }, //?
|
||||
{ 0x06f8, 0x0004, "Guillemot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //?
|
||||
{ 0x06f8, 0x0004, "Gullemot Jet Leader 3D", btn_joystick, abs_joystick, ff_iforce }, //?
|
||||
{ 0x06d6, 0x29bc, "Trust Force Feedback Race Master", btn_wheel, abs_wheel, ff_iforce },
|
||||
{ 0x0000, 0x0000, "Unknown I-Force Device [%04x:%04x]", btn_joystick, abs_joystick, ff_iforce }
|
||||
};
|
||||
|
||||
@ -222,22 +223,22 @@ static int iforce_erase_effect(struct input_dev *dev, int effect_id)
|
||||
int err = 0;
|
||||
struct iforce_core_effect* core_effect;
|
||||
|
||||
/* Check who is trying to erase this effect */
|
||||
if (iforce->core_effects[effect_id].owner != current->pid) {
|
||||
printk(KERN_WARNING "iforce-main.c: %d tried to erase an effect belonging to %d\n", current->pid, iforce->core_effects[effect_id].owner);
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
if (effect_id < 0 || effect_id >= FF_EFFECTS_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
core_effect = iforce->core_effects + effect_id;
|
||||
core_effect = &iforce->core_effects[effect_id];
|
||||
|
||||
/* Check who is trying to erase this effect */
|
||||
if (core_effect->owner != current->pid) {
|
||||
printk(KERN_WARNING "iforce-main.c: %d tried to erase an effect belonging to %d\n", current->pid, core_effect->owner);
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
if (test_bit(FF_MOD1_IS_USED, core_effect->flags))
|
||||
err = release_resource(&(iforce->core_effects[effect_id].mod1_chunk));
|
||||
err = release_resource(&core_effect->mod1_chunk);
|
||||
|
||||
if (!err && test_bit(FF_MOD2_IS_USED, core_effect->flags))
|
||||
err = release_resource(&(iforce->core_effects[effect_id].mod2_chunk));
|
||||
err = release_resource(&core_effect->mod2_chunk);
|
||||
|
||||
/*TODO: remember to change that if more FF_MOD* bits are added */
|
||||
core_effect->flags[0] = 0;
|
||||
|
@ -50,7 +50,7 @@ MODULE_LICENSE("GPL");
|
||||
*/
|
||||
|
||||
#define SPACEBALL_MAX_LENGTH 128
|
||||
#define SPACEBALL_MAX_ID 8
|
||||
#define SPACEBALL_MAX_ID 9
|
||||
|
||||
#define SPACEBALL_1003 1
|
||||
#define SPACEBALL_2003B 3
|
||||
|
@ -482,6 +482,55 @@ out:
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int atkbd_set_repeat_rate(struct atkbd *atkbd)
|
||||
{
|
||||
const short period[32] =
|
||||
{ 33, 37, 42, 46, 50, 54, 58, 63, 67, 75, 83, 92, 100, 109, 116, 125,
|
||||
133, 149, 167, 182, 200, 217, 232, 250, 270, 303, 333, 370, 400, 435, 470, 500 };
|
||||
const short delay[4] =
|
||||
{ 250, 500, 750, 1000 };
|
||||
|
||||
struct input_dev *dev = atkbd->dev;
|
||||
unsigned char param;
|
||||
int i = 0, j = 0;
|
||||
|
||||
while (i < ARRAY_SIZE(period) - 1 && period[i] < dev->rep[REP_PERIOD])
|
||||
i++;
|
||||
dev->rep[REP_PERIOD] = period[i];
|
||||
|
||||
while (j < ARRAY_SIZE(period) - 1 && delay[j] < dev->rep[REP_DELAY])
|
||||
j++;
|
||||
dev->rep[REP_DELAY] = delay[j];
|
||||
|
||||
param = i | (j << 5);
|
||||
return ps2_command(&atkbd->ps2dev, ¶m, ATKBD_CMD_SETREP);
|
||||
}
|
||||
|
||||
static int atkbd_set_leds(struct atkbd *atkbd)
|
||||
{
|
||||
struct input_dev *dev = atkbd->dev;
|
||||
unsigned char param[2];
|
||||
|
||||
param[0] = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0)
|
||||
| (test_bit(LED_NUML, dev->led) ? 2 : 0)
|
||||
| (test_bit(LED_CAPSL, dev->led) ? 4 : 0);
|
||||
if (ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETLEDS))
|
||||
return -1;
|
||||
|
||||
if (atkbd->extra) {
|
||||
param[0] = 0;
|
||||
param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0)
|
||||
| (test_bit(LED_SLEEP, dev->led) ? 0x02 : 0)
|
||||
| (test_bit(LED_SUSPEND, dev->led) ? 0x04 : 0)
|
||||
| (test_bit(LED_MISC, dev->led) ? 0x10 : 0)
|
||||
| (test_bit(LED_MUTE, dev->led) ? 0x20 : 0);
|
||||
if (ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_EX_SETLEDS))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* atkbd_event_work() is used to complete processing of events that
|
||||
* can not be processed by input_event() which is often called from
|
||||
@ -490,47 +539,15 @@ out:
|
||||
|
||||
static void atkbd_event_work(void *data)
|
||||
{
|
||||
const short period[32] =
|
||||
{ 33, 37, 42, 46, 50, 54, 58, 63, 67, 75, 83, 92, 100, 109, 116, 125,
|
||||
133, 149, 167, 182, 200, 217, 232, 250, 270, 303, 333, 370, 400, 435, 470, 500 };
|
||||
const short delay[4] =
|
||||
{ 250, 500, 750, 1000 };
|
||||
|
||||
struct atkbd *atkbd = data;
|
||||
struct input_dev *dev = atkbd->dev;
|
||||
unsigned char param[2];
|
||||
int i, j;
|
||||
|
||||
mutex_lock(&atkbd->event_mutex);
|
||||
|
||||
if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask)) {
|
||||
param[0] = (test_bit(LED_SCROLLL, dev->led) ? 1 : 0)
|
||||
| (test_bit(LED_NUML, dev->led) ? 2 : 0)
|
||||
| (test_bit(LED_CAPSL, dev->led) ? 4 : 0);
|
||||
ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETLEDS);
|
||||
if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask))
|
||||
atkbd_set_leds(atkbd);
|
||||
|
||||
if (atkbd->extra) {
|
||||
param[0] = 0;
|
||||
param[1] = (test_bit(LED_COMPOSE, dev->led) ? 0x01 : 0)
|
||||
| (test_bit(LED_SLEEP, dev->led) ? 0x02 : 0)
|
||||
| (test_bit(LED_SUSPEND, dev->led) ? 0x04 : 0)
|
||||
| (test_bit(LED_MISC, dev->led) ? 0x10 : 0)
|
||||
| (test_bit(LED_MUTE, dev->led) ? 0x20 : 0);
|
||||
ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_EX_SETLEDS);
|
||||
}
|
||||
}
|
||||
|
||||
if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask)) {
|
||||
i = j = 0;
|
||||
while (i < 31 && period[i] < dev->rep[REP_PERIOD])
|
||||
i++;
|
||||
while (j < 3 && delay[j] < dev->rep[REP_DELAY])
|
||||
j++;
|
||||
dev->rep[REP_PERIOD] = period[i];
|
||||
dev->rep[REP_DELAY] = delay[j];
|
||||
param[0] = i | (j << 5);
|
||||
ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETREP);
|
||||
}
|
||||
if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask))
|
||||
atkbd_set_repeat_rate(atkbd);
|
||||
|
||||
mutex_unlock(&atkbd->event_mutex);
|
||||
}
|
||||
@ -975,7 +992,6 @@ static int atkbd_reconnect(struct serio *serio)
|
||||
{
|
||||
struct atkbd *atkbd = serio_get_drvdata(serio);
|
||||
struct serio_driver *drv = serio->drv;
|
||||
unsigned char param[1];
|
||||
|
||||
if (!atkbd || !drv) {
|
||||
printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n");
|
||||
@ -985,10 +1001,6 @@ static int atkbd_reconnect(struct serio *serio)
|
||||
atkbd_disable(atkbd);
|
||||
|
||||
if (atkbd->write) {
|
||||
param[0] = (test_bit(LED_SCROLLL, atkbd->dev->led) ? 1 : 0)
|
||||
| (test_bit(LED_NUML, atkbd->dev->led) ? 2 : 0)
|
||||
| (test_bit(LED_CAPSL, atkbd->dev->led) ? 4 : 0);
|
||||
|
||||
if (atkbd_probe(atkbd))
|
||||
return -1;
|
||||
if (atkbd->set != atkbd_select_set(atkbd, atkbd->set, atkbd->extra))
|
||||
@ -996,8 +1008,13 @@ static int atkbd_reconnect(struct serio *serio)
|
||||
|
||||
atkbd_activate(atkbd);
|
||||
|
||||
if (ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETLEDS))
|
||||
return -1;
|
||||
/*
|
||||
* Restore repeat rate and LEDs (that were reset by atkbd_activate)
|
||||
* to pre-resume state
|
||||
*/
|
||||
if (!atkbd->softrepeat)
|
||||
atkbd_set_repeat_rate(atkbd);
|
||||
atkbd_set_leds(atkbd);
|
||||
}
|
||||
|
||||
atkbd_enable(atkbd);
|
||||
|
@ -94,7 +94,7 @@ static void call_bios(struct regs *regs)
|
||||
|
||||
static ssize_t __init locate_wistron_bios(void __iomem *base)
|
||||
{
|
||||
static const unsigned char __initdata signature[] =
|
||||
static unsigned char __initdata signature[] =
|
||||
{ 0x42, 0x21, 0x55, 0x30 };
|
||||
ssize_t offset;
|
||||
|
||||
@ -259,11 +259,11 @@ static int __init dmi_matched(struct dmi_system_id *dmi)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct key_entry keymap_empty[] = {
|
||||
static struct key_entry keymap_empty[] __initdata = {
|
||||
{ KE_END, 0 }
|
||||
};
|
||||
|
||||
static struct key_entry keymap_fs_amilo_pro_v2000[] = {
|
||||
static struct key_entry keymap_fs_amilo_pro_v2000[] __initdata = {
|
||||
{ KE_KEY, 0x01, KEY_HELP },
|
||||
{ KE_KEY, 0x11, KEY_PROG1 },
|
||||
{ KE_KEY, 0x12, KEY_PROG2 },
|
||||
@ -273,7 +273,7 @@ static struct key_entry keymap_fs_amilo_pro_v2000[] = {
|
||||
{ KE_END, 0 }
|
||||
};
|
||||
|
||||
static struct key_entry keymap_fujitsu_n3510[] = {
|
||||
static struct key_entry keymap_fujitsu_n3510[] __initdata = {
|
||||
{ KE_KEY, 0x11, KEY_PROG1 },
|
||||
{ KE_KEY, 0x12, KEY_PROG2 },
|
||||
{ KE_KEY, 0x36, KEY_WWW },
|
||||
@ -285,7 +285,7 @@ static struct key_entry keymap_fujitsu_n3510[] = {
|
||||
{ KE_END, 0 }
|
||||
};
|
||||
|
||||
static struct key_entry keymap_wistron_ms2111[] = {
|
||||
static struct key_entry keymap_wistron_ms2111[] __initdata = {
|
||||
{ KE_KEY, 0x11, KEY_PROG1 },
|
||||
{ KE_KEY, 0x12, KEY_PROG2 },
|
||||
{ KE_KEY, 0x13, KEY_PROG3 },
|
||||
@ -294,7 +294,7 @@ static struct key_entry keymap_wistron_ms2111[] = {
|
||||
{ KE_END, 0 }
|
||||
};
|
||||
|
||||
static struct key_entry keymap_wistron_ms2141[] = {
|
||||
static struct key_entry keymap_wistron_ms2141[] __initdata = {
|
||||
{ KE_KEY, 0x11, KEY_PROG1 },
|
||||
{ KE_KEY, 0x12, KEY_PROG2 },
|
||||
{ KE_WIFI, 0x30, 0 },
|
||||
@ -307,7 +307,7 @@ static struct key_entry keymap_wistron_ms2141[] = {
|
||||
{ KE_END, 0 }
|
||||
};
|
||||
|
||||
static struct key_entry keymap_acer_aspire_1500[] = {
|
||||
static struct key_entry keymap_acer_aspire_1500[] __initdata = {
|
||||
{ KE_KEY, 0x11, KEY_PROG1 },
|
||||
{ KE_KEY, 0x12, KEY_PROG2 },
|
||||
{ KE_WIFI, 0x30, 0 },
|
||||
@ -317,7 +317,7 @@ static struct key_entry keymap_acer_aspire_1500[] = {
|
||||
{ KE_END, 0 }
|
||||
};
|
||||
|
||||
static struct key_entry keymap_acer_travelmate_240[] = {
|
||||
static struct key_entry keymap_acer_travelmate_240[] __initdata = {
|
||||
{ KE_KEY, 0x31, KEY_MAIL },
|
||||
{ KE_KEY, 0x36, KEY_WWW },
|
||||
{ KE_KEY, 0x11, KEY_PROG1 },
|
||||
@ -327,7 +327,7 @@ static struct key_entry keymap_acer_travelmate_240[] = {
|
||||
{ KE_END, 0 }
|
||||
};
|
||||
|
||||
static struct key_entry keymap_aopen_1559as[] = {
|
||||
static struct key_entry keymap_aopen_1559as[] __initdata = {
|
||||
{ KE_KEY, 0x01, KEY_HELP },
|
||||
{ KE_KEY, 0x06, KEY_PROG3 },
|
||||
{ KE_KEY, 0x11, KEY_PROG1 },
|
||||
@ -343,7 +343,7 @@ static struct key_entry keymap_aopen_1559as[] = {
|
||||
* a list of buttons and their key codes (reported when loading this module
|
||||
* with force=1) and the output of dmidecode to $MODULE_AUTHOR.
|
||||
*/
|
||||
static struct dmi_system_id dmi_ids[] = {
|
||||
static struct dmi_system_id dmi_ids[] __initdata = {
|
||||
{
|
||||
.callback = dmi_matched,
|
||||
.ident = "Fujitsu-Siemens Amilo Pro V2000",
|
||||
|
@ -238,8 +238,7 @@ static struct ps2pp_info *get_model_info(unsigned char model)
|
||||
{ 100, PS2PP_KIND_MX, /* MX510 */
|
||||
PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
|
||||
PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },
|
||||
{ 111, PS2PP_KIND_MX, /* MX300 */
|
||||
PS2PP_WHEEL | PS2PP_EXTRA_BTN | PS2PP_TASK_BTN },
|
||||
{ 111, PS2PP_KIND_MX, PS2PP_WHEEL | PS2PP_SIDE_BTN }, /* MX300 reports task button as side */
|
||||
{ 112, PS2PP_KIND_MX, /* MX500 */
|
||||
PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
|
||||
PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },
|
||||
|
@ -183,21 +183,26 @@ static struct attribute_group trackpoint_attr_group = {
|
||||
.attrs = trackpoint_attrs,
|
||||
};
|
||||
|
||||
static void trackpoint_disconnect(struct psmouse *psmouse)
|
||||
static int trackpoint_start_protocol(struct psmouse *psmouse, unsigned char *firmware_id)
|
||||
{
|
||||
sysfs_remove_group(&psmouse->ps2dev.serio->dev.kobj, &trackpoint_attr_group);
|
||||
unsigned char param[2] = { 0 };
|
||||
|
||||
kfree(psmouse->private);
|
||||
psmouse->private = NULL;
|
||||
if (ps2_command(&psmouse->ps2dev, param, MAKE_PS2_CMD(0, 2, TP_READ_ID)))
|
||||
return -1;
|
||||
|
||||
if (param[0] != TP_MAGIC_IDENT)
|
||||
return -1;
|
||||
|
||||
if (firmware_id)
|
||||
*firmware_id = param[1];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int trackpoint_sync(struct psmouse *psmouse)
|
||||
{
|
||||
unsigned char toggle;
|
||||
struct trackpoint_data *tp = psmouse->private;
|
||||
|
||||
if (!tp)
|
||||
return -1;
|
||||
unsigned char toggle;
|
||||
|
||||
/* Disable features that may make device unusable with this driver */
|
||||
trackpoint_read(&psmouse->ps2dev, TP_TOGGLE_TWOHAND, &toggle);
|
||||
@ -263,27 +268,38 @@ static void trackpoint_defaults(struct trackpoint_data *tp)
|
||||
tp->ext_dev = TP_DEF_EXT_DEV;
|
||||
}
|
||||
|
||||
static void trackpoint_disconnect(struct psmouse *psmouse)
|
||||
{
|
||||
sysfs_remove_group(&psmouse->ps2dev.serio->dev.kobj, &trackpoint_attr_group);
|
||||
|
||||
kfree(psmouse->private);
|
||||
psmouse->private = NULL;
|
||||
}
|
||||
|
||||
static int trackpoint_reconnect(struct psmouse *psmouse)
|
||||
{
|
||||
if (trackpoint_start_protocol(psmouse, NULL))
|
||||
return -1;
|
||||
|
||||
if (trackpoint_sync(psmouse))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int trackpoint_detect(struct psmouse *psmouse, int set_properties)
|
||||
{
|
||||
struct trackpoint_data *priv;
|
||||
struct ps2dev *ps2dev = &psmouse->ps2dev;
|
||||
unsigned char firmware_id;
|
||||
unsigned char button_info;
|
||||
unsigned char param[2];
|
||||
|
||||
param[0] = param[1] = 0;
|
||||
|
||||
if (ps2_command(ps2dev, param, MAKE_PS2_CMD(0, 2, TP_READ_ID)))
|
||||
return -1;
|
||||
|
||||
if (param[0] != TP_MAGIC_IDENT)
|
||||
if (trackpoint_start_protocol(psmouse, &firmware_id))
|
||||
return -1;
|
||||
|
||||
if (!set_properties)
|
||||
return 0;
|
||||
|
||||
firmware_id = param[1];
|
||||
|
||||
if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) {
|
||||
printk(KERN_WARNING "trackpoint.c: failed to get extended button data\n");
|
||||
button_info = 0;
|
||||
@ -296,7 +312,7 @@ int trackpoint_detect(struct psmouse *psmouse, int set_properties)
|
||||
psmouse->vendor = "IBM";
|
||||
psmouse->name = "TrackPoint";
|
||||
|
||||
psmouse->reconnect = trackpoint_sync;
|
||||
psmouse->reconnect = trackpoint_reconnect;
|
||||
psmouse->disconnect = trackpoint_disconnect;
|
||||
|
||||
trackpoint_defaults(priv);
|
||||
|
@ -177,6 +177,11 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (send && !param) {
|
||||
WARN_ON(1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING);
|
||||
|
||||
serio_pause_rx(ps2dev->serio);
|
||||
|
@ -62,6 +62,7 @@ static LIST_HEAD(serio_list);
|
||||
|
||||
static struct bus_type serio_bus;
|
||||
|
||||
static void serio_add_driver(struct serio_driver *drv);
|
||||
static void serio_add_port(struct serio *serio);
|
||||
static void serio_destroy_port(struct serio *serio);
|
||||
static void serio_reconnect_port(struct serio *serio);
|
||||
@ -140,8 +141,14 @@ static void serio_release_driver(struct serio *serio)
|
||||
|
||||
static void serio_find_driver(struct serio *serio)
|
||||
{
|
||||
int error;
|
||||
|
||||
down_write(&serio_bus.subsys.rwsem);
|
||||
device_attach(&serio->dev);
|
||||
error = device_attach(&serio->dev);
|
||||
if (error < 0)
|
||||
printk(KERN_WARNING
|
||||
"serio: device_attach() failed for %s (%s), error: %d\n",
|
||||
serio->phys, serio->name, error);
|
||||
up_write(&serio_bus.subsys.rwsem);
|
||||
}
|
||||
|
||||
@ -272,7 +279,6 @@ static struct serio_event *serio_get_event(void)
|
||||
static void serio_handle_event(void)
|
||||
{
|
||||
struct serio_event *event;
|
||||
struct serio_driver *serio_drv;
|
||||
|
||||
mutex_lock(&serio_mutex);
|
||||
|
||||
@ -304,8 +310,7 @@ static void serio_handle_event(void)
|
||||
break;
|
||||
|
||||
case SERIO_REGISTER_DRIVER:
|
||||
serio_drv = event->object;
|
||||
driver_register(&serio_drv->driver);
|
||||
serio_add_driver(event->object);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -525,6 +530,7 @@ static void serio_init_port(struct serio *serio)
|
||||
|
||||
__module_get(THIS_MODULE);
|
||||
|
||||
INIT_LIST_HEAD(&serio->node);
|
||||
spin_lock_init(&serio->lock);
|
||||
mutex_init(&serio->drv_mutex);
|
||||
device_initialize(&serio->dev);
|
||||
@ -542,6 +548,8 @@ static void serio_init_port(struct serio *serio)
|
||||
*/
|
||||
static void serio_add_port(struct serio *serio)
|
||||
{
|
||||
int error;
|
||||
|
||||
if (serio->parent) {
|
||||
serio_pause_rx(serio->parent);
|
||||
serio->parent->child = serio;
|
||||
@ -551,9 +559,19 @@ static void serio_add_port(struct serio *serio)
|
||||
list_add_tail(&serio->node, &serio_list);
|
||||
if (serio->start)
|
||||
serio->start(serio);
|
||||
device_add(&serio->dev);
|
||||
sysfs_create_group(&serio->dev.kobj, &serio_id_attr_group);
|
||||
serio->registered = 1;
|
||||
error = device_add(&serio->dev);
|
||||
if (error)
|
||||
printk(KERN_ERR
|
||||
"serio: device_add() failed for %s (%s), error: %d\n",
|
||||
serio->phys, serio->name, error);
|
||||
else {
|
||||
serio->registered = 1;
|
||||
error = sysfs_create_group(&serio->dev.kobj, &serio_id_attr_group);
|
||||
if (error)
|
||||
printk(KERN_ERR
|
||||
"serio: sysfs_create_group() failed for %s (%s), error: %d\n",
|
||||
serio->phys, serio->name, error);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -583,10 +601,10 @@ static void serio_destroy_port(struct serio *serio)
|
||||
if (serio->registered) {
|
||||
sysfs_remove_group(&serio->dev.kobj, &serio_id_attr_group);
|
||||
device_del(&serio->dev);
|
||||
list_del_init(&serio->node);
|
||||
serio->registered = 0;
|
||||
}
|
||||
|
||||
list_del_init(&serio->node);
|
||||
serio_remove_pending_events(serio);
|
||||
put_device(&serio->dev);
|
||||
}
|
||||
@ -756,6 +774,17 @@ static struct bus_type serio_bus = {
|
||||
.remove = serio_driver_remove,
|
||||
};
|
||||
|
||||
static void serio_add_driver(struct serio_driver *drv)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = driver_register(&drv->driver);
|
||||
if (error)
|
||||
printk(KERN_ERR
|
||||
"serio: driver_register() failed for %s, error: %d\n",
|
||||
drv->driver.name, error);
|
||||
}
|
||||
|
||||
void __serio_register_driver(struct serio_driver *drv, struct module *owner)
|
||||
{
|
||||
drv->driver.bus = &serio_bus;
|
||||
@ -903,18 +932,26 @@ irqreturn_t serio_interrupt(struct serio *serio,
|
||||
|
||||
static int __init serio_init(void)
|
||||
{
|
||||
serio_task = kthread_run(serio_thread, NULL, "kseriod");
|
||||
if (IS_ERR(serio_task)) {
|
||||
printk(KERN_ERR "serio: Failed to start kseriod\n");
|
||||
return PTR_ERR(serio_task);
|
||||
}
|
||||
int error;
|
||||
|
||||
serio_bus.dev_attrs = serio_device_attrs;
|
||||
serio_bus.drv_attrs = serio_driver_attrs;
|
||||
serio_bus.match = serio_bus_match;
|
||||
serio_bus.uevent = serio_uevent;
|
||||
serio_bus.resume = serio_resume;
|
||||
bus_register(&serio_bus);
|
||||
error = bus_register(&serio_bus);
|
||||
if (error) {
|
||||
printk(KERN_ERR "serio: failed to register serio bus, error: %d\n", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
serio_task = kthread_run(serio_thread, NULL, "kseriod");
|
||||
if (IS_ERR(serio_task)) {
|
||||
bus_unregister(&serio_bus);
|
||||
error = PTR_ERR(serio_task);
|
||||
printk(KERN_ERR "serio: Failed to start kseriod, error: %d\n", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -256,7 +256,6 @@ typedef struct
|
||||
#define NO_ORDER_CHECK_MASK 0x00000010
|
||||
#define LOW_CHANNEL_MASK 0x00000020
|
||||
#define NO_HSCX30_MASK 0x00000040
|
||||
#define MODE_MASK 0x00000080
|
||||
#define SET_BOARD 0x00001000
|
||||
#define SET_CRC4 0x00030000
|
||||
#define SET_L1_TRISTATE 0x00040000
|
||||
|
@ -162,7 +162,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
|
||||
goto out;
|
||||
}
|
||||
|
||||
min_spacing = mddev->array_size;
|
||||
min_spacing = conf->array_size;
|
||||
sector_div(min_spacing, PAGE_SIZE/sizeof(struct dev_info *));
|
||||
|
||||
/* min_spacing is the minimum spacing that will fit the hash
|
||||
@ -171,7 +171,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
|
||||
* that is larger than min_spacing as use the size of that as
|
||||
* the actual spacing
|
||||
*/
|
||||
conf->hash_spacing = mddev->array_size;
|
||||
conf->hash_spacing = conf->array_size;
|
||||
for (i=0; i < cnt-1 ; i++) {
|
||||
sector_t sz = 0;
|
||||
int j;
|
||||
@ -228,7 +228,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
|
||||
curr_offset = 0;
|
||||
i = 0;
|
||||
for (curr_offset = 0;
|
||||
curr_offset < mddev->array_size;
|
||||
curr_offset < conf->array_size;
|
||||
curr_offset += conf->hash_spacing) {
|
||||
|
||||
while (i < mddev->raid_disks-1 &&
|
||||
|
@ -526,7 +526,9 @@ static int dvb_frontend_thread(void *data)
|
||||
fepriv->delay = 3*HZ;
|
||||
fepriv->status = 0;
|
||||
fepriv->wakeup = 0;
|
||||
fepriv->reinitialise = 1;
|
||||
fepriv->reinitialise = 0;
|
||||
|
||||
dvb_frontend_init(fe);
|
||||
|
||||
while (1) {
|
||||
up(&fepriv->sem); /* is locked when we enter the thread... */
|
||||
@ -1013,17 +1015,18 @@ static int dvb_frontend_open(struct inode *inode, struct file *file)
|
||||
return ret;
|
||||
|
||||
if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
|
||||
|
||||
/* normal tune mode when opened R/W */
|
||||
fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
|
||||
fepriv->tone = -1;
|
||||
fepriv->voltage = -1;
|
||||
|
||||
ret = dvb_frontend_start (fe);
|
||||
if (ret)
|
||||
dvb_generic_release (inode, file);
|
||||
|
||||
/* empty event queue */
|
||||
fepriv->events.eventr = fepriv->events.eventw = 0;
|
||||
|
||||
/* normal tune mode when opened R/W */
|
||||
fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
|
||||
fepriv->tone = -1;
|
||||
fepriv->voltage = -1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -194,11 +194,11 @@ struct dvb_pll_desc dvb_pll_tda665x = {
|
||||
{ 253834000, 36249333, 166667, 0xca, 0x62 /* 011 0 0 0 10 */ },
|
||||
{ 383834000, 36249333, 166667, 0xca, 0xa2 /* 101 0 0 0 10 */ },
|
||||
{ 443834000, 36249333, 166667, 0xca, 0xc2 /* 110 0 0 0 10 */ },
|
||||
{ 444000000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0 11 */ },
|
||||
{ 583834000, 36249333, 166667, 0xca, 0x63 /* 011 0 0 0 11 */ },
|
||||
{ 793834000, 36249333, 166667, 0xca, 0xa3 /* 101 0 0 0 11 */ },
|
||||
{ 444834000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0 11 */ },
|
||||
{ 861000000, 36249333, 166667, 0xca, 0xe3 /* 111 0 0 0 11 */ },
|
||||
{ 444000000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ },
|
||||
{ 583834000, 36249333, 166667, 0xca, 0x64 /* 011 0 0 1 00 */ },
|
||||
{ 793834000, 36249333, 166667, 0xca, 0xa4 /* 101 0 0 1 00 */ },
|
||||
{ 444834000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ },
|
||||
{ 861000000, 36249333, 166667, 0xca, 0xe4 /* 111 0 0 1 00 */ },
|
||||
}
|
||||
};
|
||||
EXPORT_SYMBOL(dvb_pll_tda665x);
|
||||
@ -613,7 +613,21 @@ static struct dvb_tuner_ops dvb_pll_tuner_ops = {
|
||||
|
||||
int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc)
|
||||
{
|
||||
u8 b1 [] = { 0 };
|
||||
struct i2c_msg msg = { .addr = pll_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 };
|
||||
struct dvb_pll_priv *priv = NULL;
|
||||
int ret;
|
||||
|
||||
if (i2c != NULL) {
|
||||
if (fe->ops.i2c_gate_ctrl)
|
||||
fe->ops.i2c_gate_ctrl(fe, 1);
|
||||
|
||||
ret = i2c_transfer (i2c, &msg, 1);
|
||||
if (ret != 1)
|
||||
return -1;
|
||||
if (fe->ops.i2c_gate_ctrl)
|
||||
fe->ops.i2c_gate_ctrl(fe, 0);
|
||||
}
|
||||
|
||||
priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL);
|
||||
if (priv == NULL)
|
||||
|
@ -2203,8 +2203,8 @@ static int frontend_init(struct av7110 *av7110)
|
||||
av7110->fe->ops.tuner_ops.set_params = nexusca_stv0297_tuner_set_params;
|
||||
|
||||
/* set TDA9819 into DVB mode */
|
||||
saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD)
|
||||
saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF)
|
||||
saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD)
|
||||
saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF)
|
||||
|
||||
/* tuner on this needs a slower i2c bus speed */
|
||||
av7110->dev->i2c_bitrate = SAA7146_I2C_BUS_BIT_RATE_240;
|
||||
|
@ -272,8 +272,8 @@ static int av7110_dvb_c_switch(struct saa7146_fh *fh)
|
||||
if (ves1820_writereg(dev, 0x09, 0x0f, 0x60))
|
||||
dprintk(1, "setting band in demodulator failed.\n");
|
||||
} else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) {
|
||||
saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // TDA9198 pin9(STD)
|
||||
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); // TDA9198 pin30(VIF)
|
||||
saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // TDA9819 pin9(STD)
|
||||
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); // TDA9819 pin30(VIF)
|
||||
}
|
||||
if (i2c_writereg(av7110, 0x48, 0x02, 0xd0) != 1)
|
||||
dprintk(1, "saa7113 write failed @ card %d", av7110->dvb_adapter.num);
|
||||
@ -308,8 +308,8 @@ static int av7110_dvb_c_switch(struct saa7146_fh *fh)
|
||||
if (ves1820_writereg(dev, 0x09, 0x0f, 0x20))
|
||||
dprintk(1, "setting band in demodulator failed.\n");
|
||||
} else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) {
|
||||
saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD)
|
||||
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF)
|
||||
saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD)
|
||||
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF)
|
||||
}
|
||||
}
|
||||
|
||||
@ -750,8 +750,8 @@ int av7110_init_analog_module(struct av7110 *av7110)
|
||||
if (ves1820_writereg(av7110->dev, 0x09, 0x0f, 0x20))
|
||||
dprintk(1, "setting band in demodulator failed.\n");
|
||||
} else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) {
|
||||
saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD)
|
||||
saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF)
|
||||
saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9819 pin9(STD)
|
||||
saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9819 pin30(VIF)
|
||||
}
|
||||
|
||||
/* init the saa7113 */
|
||||
|
@ -1303,6 +1303,9 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
|
||||
budget_av->budget.dvb_adapter.priv = budget_av;
|
||||
frontend_init(budget_av);
|
||||
ciintf_init(budget_av);
|
||||
|
||||
ttpci_budget_init_hooks(&budget_av->budget);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1101,6 +1101,8 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
|
||||
budget_ci->budget.dvb_adapter.priv = budget_ci;
|
||||
frontend_init(budget_ci);
|
||||
|
||||
ttpci_budget_init_hooks(&budget_ci->budget);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -63,9 +63,6 @@ static int stop_ts_capture(struct budget *budget)
|
||||
{
|
||||
dprintk(2, "budget: %p\n", budget);
|
||||
|
||||
if (--budget->feeding)
|
||||
return budget->feeding;
|
||||
|
||||
saa7146_write(budget->dev, MC1, MASK_20); // DMA3 off
|
||||
SAA7146_IER_DISABLE(budget->dev, MASK_10);
|
||||
return 0;
|
||||
@ -77,8 +74,8 @@ static int start_ts_capture(struct budget *budget)
|
||||
|
||||
dprintk(2, "budget: %p\n", budget);
|
||||
|
||||
if (budget->feeding)
|
||||
return ++budget->feeding;
|
||||
if (!budget->feeding || !budget->fe_synced)
|
||||
return 0;
|
||||
|
||||
saa7146_write(dev, MC1, MASK_20); // DMA3 off
|
||||
|
||||
@ -139,7 +136,33 @@ static int start_ts_capture(struct budget *budget)
|
||||
SAA7146_IER_ENABLE(budget->dev, MASK_10); /* VPE */
|
||||
saa7146_write(dev, MC1, (MASK_04 | MASK_20)); /* DMA3 on */
|
||||
|
||||
return ++budget->feeding;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int budget_read_fe_status(struct dvb_frontend *fe, fe_status_t *status)
|
||||
{
|
||||
struct budget *budget = (struct budget *) fe->dvb->priv;
|
||||
int synced;
|
||||
int ret;
|
||||
|
||||
if (budget->read_fe_status)
|
||||
ret = budget->read_fe_status(fe, status);
|
||||
else
|
||||
ret = -EINVAL;
|
||||
|
||||
if (!ret) {
|
||||
synced = (*status & FE_HAS_LOCK);
|
||||
if (synced != budget->fe_synced) {
|
||||
budget->fe_synced = synced;
|
||||
spin_lock(&budget->feedlock);
|
||||
if (synced)
|
||||
start_ts_capture(budget);
|
||||
else
|
||||
stop_ts_capture(budget);
|
||||
spin_unlock(&budget->feedlock);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void vpeirq(unsigned long data)
|
||||
@ -267,7 +290,7 @@ static int budget_start_feed(struct dvb_demux_feed *feed)
|
||||
{
|
||||
struct dvb_demux *demux = feed->demux;
|
||||
struct budget *budget = (struct budget *) demux->priv;
|
||||
int status;
|
||||
int status = 0;
|
||||
|
||||
dprintk(2, "budget: %p\n", budget);
|
||||
|
||||
@ -276,7 +299,8 @@ static int budget_start_feed(struct dvb_demux_feed *feed)
|
||||
|
||||
spin_lock(&budget->feedlock);
|
||||
feed->pusi_seen = 0; /* have a clean section start */
|
||||
status = start_ts_capture(budget);
|
||||
if (budget->feeding++ == 0)
|
||||
status = start_ts_capture(budget);
|
||||
spin_unlock(&budget->feedlock);
|
||||
return status;
|
||||
}
|
||||
@ -285,12 +309,13 @@ static int budget_stop_feed(struct dvb_demux_feed *feed)
|
||||
{
|
||||
struct dvb_demux *demux = feed->demux;
|
||||
struct budget *budget = (struct budget *) demux->priv;
|
||||
int status;
|
||||
int status = 0;
|
||||
|
||||
dprintk(2, "budget: %p\n", budget);
|
||||
|
||||
spin_lock(&budget->feedlock);
|
||||
status = stop_ts_capture(budget);
|
||||
if (--budget->feeding == 0)
|
||||
status = stop_ts_capture(budget);
|
||||
spin_unlock(&budget->feedlock);
|
||||
return status;
|
||||
}
|
||||
@ -470,6 +495,14 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void ttpci_budget_init_hooks(struct budget *budget)
|
||||
{
|
||||
if (budget->dvb_frontend && !budget->read_fe_status) {
|
||||
budget->read_fe_status = budget->dvb_frontend->ops.read_status;
|
||||
budget->dvb_frontend->ops.read_status = budget_read_fe_status;
|
||||
}
|
||||
}
|
||||
|
||||
int ttpci_budget_deinit(struct budget *budget)
|
||||
{
|
||||
struct saa7146_dev *dev = budget->dev;
|
||||
@ -508,11 +541,8 @@ void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port)
|
||||
spin_lock(&budget->feedlock);
|
||||
budget->video_port = video_port;
|
||||
if (budget->feeding) {
|
||||
int oldfeeding = budget->feeding;
|
||||
budget->feeding = 1;
|
||||
stop_ts_capture(budget);
|
||||
start_ts_capture(budget);
|
||||
budget->feeding = oldfeeding;
|
||||
}
|
||||
spin_unlock(&budget->feedlock);
|
||||
}
|
||||
@ -520,6 +550,7 @@ void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port)
|
||||
EXPORT_SYMBOL_GPL(ttpci_budget_debiread);
|
||||
EXPORT_SYMBOL_GPL(ttpci_budget_debiwrite);
|
||||
EXPORT_SYMBOL_GPL(ttpci_budget_init);
|
||||
EXPORT_SYMBOL_GPL(ttpci_budget_init_hooks);
|
||||
EXPORT_SYMBOL_GPL(ttpci_budget_deinit);
|
||||
EXPORT_SYMBOL_GPL(ttpci_budget_irq10_handler);
|
||||
EXPORT_SYMBOL_GPL(ttpci_budget_set_video_port);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user